Compare commits
No commits in common. "main" and "MVPTN-37" have entirely different histories.
710 changed files with 6923 additions and 9774 deletions
|
|
@ -1,11 +1,13 @@
|
|||
{
|
||||
"folders": [{ "path": "D:/IIS/Orius/app" }],
|
||||
"folders": [
|
||||
{ "path": "D:/IIS/Orius/app" }
|
||||
],
|
||||
"settings": {
|
||||
// === GERAL ===
|
||||
"editor.formatOnSave": true,
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll": "explicit",
|
||||
"source.organizeImports": "explicit",
|
||||
"source.organizeImports": "explicit"
|
||||
},
|
||||
"editor.formatOnPaste": false,
|
||||
"editor.formatOnType": false,
|
||||
|
|
@ -21,48 +23,53 @@
|
|||
"**/dist/**": true,
|
||||
"**/build/**": true,
|
||||
"**/.next/**": true,
|
||||
"**/.git/**": true,
|
||||
"**/.git/**": true
|
||||
},
|
||||
"search.exclude": {
|
||||
"**/node_modules": true,
|
||||
"**/dist": true,
|
||||
"**/.next": true,
|
||||
"**/.git": true,
|
||||
"**/.git": true
|
||||
},
|
||||
|
||||
// === FRONTEND ===
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
|
||||
"eslint.validate": [
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"typescript",
|
||||
"typescriptreact"
|
||||
],
|
||||
"[typescript]": {
|
||||
"editor.defaultFormatter": "vscode.typescript-language-features",
|
||||
"editor.defaultFormatter": "vscode.typescript-language-features"
|
||||
},
|
||||
"[typescriptreact]": {
|
||||
"editor.defaultFormatter": "vscode.typescript-language-features",
|
||||
"editor.defaultFormatter": "vscode.typescript-language-features"
|
||||
},
|
||||
|
||||
// === TAILWIND ===
|
||||
"files.associations": {
|
||||
"*.css": "tailwindcss",
|
||||
"*.css": "tailwindcss"
|
||||
},
|
||||
"tailwindCSS.includeLanguages": {
|
||||
"plaintext": "html",
|
||||
"javascript": "javascript",
|
||||
"typescriptreact": "typescriptreact",
|
||||
"typescriptreact": "typescriptreact"
|
||||
},
|
||||
|
||||
// === TERMINAIS ===
|
||||
"terminal.integrated.profiles.windows": {
|
||||
"Next.js Dev": {
|
||||
"path": "cmd.exe",
|
||||
"args": ["/k", "cd D:\\IIS\\Orius\\app && npm run dev"],
|
||||
"args": ["/k", "cd D:\\IIS\\Orius\\app && npm run dev"]
|
||||
},
|
||||
"Build & Preview": {
|
||||
"path": "cmd.exe",
|
||||
"args": ["/k", "cd D:\\IIS\\Orius\\app && npm run build && npm run start"],
|
||||
"args": ["/k", "cd D:\\IIS\\Orius\\app && npm run build && npm run start"]
|
||||
},
|
||||
"Git Bash": {
|
||||
"path": "C:\\Program Files\\Git\\bin\\bash.exe",
|
||||
},
|
||||
"path": "C:\\Program Files\\Git\\bin\\bash.exe"
|
||||
}
|
||||
},
|
||||
"terminal.integrated.defaultProfile.windows": "Git Bash",
|
||||
|
||||
|
|
@ -81,8 +88,8 @@
|
|||
// === MISC ===
|
||||
"files.exclude": {
|
||||
"**/.DS_Store": true,
|
||||
"**/*.log": true,
|
||||
},
|
||||
"**/*.log": true
|
||||
}
|
||||
},
|
||||
"launch": {
|
||||
"version": "0.2.0",
|
||||
|
|
@ -94,9 +101,9 @@
|
|||
"runtimeExecutable": "npm",
|
||||
"runtimeArgs": ["run", "dev"],
|
||||
"cwd": "${workspaceFolder}",
|
||||
"port": 9229,
|
||||
},
|
||||
],
|
||||
"port": 9229
|
||||
}
|
||||
]
|
||||
},
|
||||
"extensions": {
|
||||
"recommendations": [
|
||||
|
|
@ -111,7 +118,7 @@
|
|||
"streetsidesoftware.code-spell-checker",
|
||||
"eamodio.gitlens",
|
||||
"mhutchie.git-graph",
|
||||
"donjayamanne.githistory",
|
||||
],
|
||||
},
|
||||
"donjayamanne.githistory"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
65
Dockerfile
65
Dockerfile
|
|
@ -1,59 +1,22 @@
|
|||
# ============================
|
||||
# STAGE 1 – Build
|
||||
# ============================
|
||||
FROM node:20-alpine AS builder
|
||||
# Use uma imagem Node.js completa para o desenvolvimento
|
||||
FROM node:20-alpine
|
||||
|
||||
# Define o diretório de trabalho no container
|
||||
WORKDIR /app
|
||||
|
||||
# Copia pacotes e instala dependências
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
# Copia os arquivos de configuração do projeto
|
||||
COPY package.json package-lock.json ./
|
||||
|
||||
# Copia o restante do código
|
||||
# Instala todas as dependências do projeto
|
||||
# Isso é necessário para o modo de desenvolvimento, pois o build não pré-compila os arquivos.
|
||||
RUN npm install
|
||||
|
||||
# Copia o restante do código da sua aplicação
|
||||
COPY . .
|
||||
|
||||
# ---------- Variáveis de build ----------
|
||||
# Estas variáveis são usadas pelo Next.js durante o "build"
|
||||
# para embutir no bundle do frontend.
|
||||
ARG NEXT_PUBLIC_ORIUS_APP_STATE
|
||||
ARG NEXT_PUBLIC_ORIUS_APP_API_URL
|
||||
ARG NEXT_PUBLIC_ORIUS_APP_API_PREFIX
|
||||
ARG NEXT_PUBLIC_ORIUS_APP_API_CONTENT_TYPE
|
||||
|
||||
ENV NEXT_PUBLIC_ORIUS_APP_STATE=$NEXT_PUBLIC_ORIUS_APP_STATE
|
||||
ENV NEXT_PUBLIC_ORIUS_APP_API_URL=$NEXT_PUBLIC_ORIUS_APP_API_URL
|
||||
ENV NEXT_PUBLIC_ORIUS_APP_API_PREFIX=$NEXT_PUBLIC_ORIUS_APP_API_PREFIX
|
||||
ENV NEXT_PUBLIC_ORIUS_APP_API_CONTENT_TYPE=$NEXT_PUBLIC_ORIUS_APP_API_CONTENT_TYPE
|
||||
|
||||
# ---------- Build ----------
|
||||
ENV NODE_ENV=production
|
||||
RUN npm run build
|
||||
|
||||
# ============================
|
||||
# STAGE 2 – Runner (standalone)
|
||||
# ============================
|
||||
FROM node:20-alpine AS runner
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# ---------- Variáveis em runtime ----------
|
||||
ENV NODE_ENV=production
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
# Copia apenas o necessário do build
|
||||
COPY --from=builder /app/.next/standalone ./
|
||||
COPY --from=builder /app/.next/static ./.next/static
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder /app/package*.json ./
|
||||
|
||||
# ---------- Corrige permissões ----------
|
||||
RUN addgroup -S nodejs && adduser -S nextjs -G nodejs \
|
||||
&& mkdir -p .next/cache/images \
|
||||
&& chown -R nextjs:nodejs /app
|
||||
|
||||
USER nextjs
|
||||
|
||||
# Expõe a porta de desenvolvimento padrão do Next.js
|
||||
EXPOSE 3000
|
||||
|
||||
# ---------- Executa o servidor ----------
|
||||
CMD ["node", "server.js"]
|
||||
# Define o comando para iniciar a aplicação em modo de desenvolvimento
|
||||
# Isso ativará o servidor de desenvolvimento e a recarga automática
|
||||
CMD ["npm", "run", "dev"]
|
||||
|
|
|
|||
41
Dockerfile-homologacao
Normal file
41
Dockerfile-homologacao
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
# Etapa 1: Construir a aplicação
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
# Define o diretório de trabalho
|
||||
WORKDIR /app
|
||||
|
||||
# Copia os arquivos de configuração do pacote
|
||||
COPY package.json package-lock.json ./
|
||||
|
||||
# Instala as dependências do projeto
|
||||
RUN npm install
|
||||
|
||||
# Copia todo o código da aplicação para o container
|
||||
COPY . .
|
||||
|
||||
# Constrói a aplicação com o output 'standalone'
|
||||
RUN npm run build
|
||||
|
||||
# Etapa 2: Executar a aplicação
|
||||
# Usa uma imagem Node.js leve
|
||||
FROM node:20-alpine AS runner
|
||||
|
||||
# Define o diretório de trabalho
|
||||
WORKDIR /app
|
||||
|
||||
# Copia o diretório 'standalone' da etapa de build, que já contém o servidor e as dependências
|
||||
# O diretório 'standalone' é a pasta .next/standalone gerada pela configuração 'output: standalone'
|
||||
COPY --from=builder /app/.next/standalone ./
|
||||
|
||||
# Copia os arquivos públicos
|
||||
COPY --from=builder /app/public ./public
|
||||
|
||||
# Copia os arquivos estáticos gerados pelo build. É aqui que os arquivos CSS e JS ficam.
|
||||
COPY --from=builder /app/.next/static ./.next/static
|
||||
|
||||
# Expõe a porta padrão do Next.js
|
||||
EXPOSE 3000
|
||||
|
||||
# Define o comando para iniciar a aplicação
|
||||
# O 'start' do package.json não é necessário, o próprio servidor standalone já está no container
|
||||
CMD ["node", "server.js"]
|
||||
57
README.md
57
README.md
|
|
@ -1,58 +1 @@
|
|||
# saas_app
|
||||
|
||||
Criar envlocal para usar variaveis de ambiente no em desenvolvimento
|
||||
NEXT_PUBLIC_ORIUS_APP_STATE=GO
|
||||
NEXT_PUBLIC_ORIUS_APP_API_URL=<http://localhost:8000/>
|
||||
NEXT_PUBLIC_ORIUS_APP_API_PREFIX=api/v1/
|
||||
NEXT_PUBLIC_ORIUS_APP_API_CONTENT_TYPE=application/json
|
||||
|
||||
## Modo Debug
|
||||
|
||||
Abra Run → Add Configuration… → Attach to Node.js
|
||||
|
||||
Configure:
|
||||
|
||||
{
|
||||
"name": "Attach Next.js (9230)",
|
||||
"type": "node",
|
||||
"request": "attach",
|
||||
"port": 9230,
|
||||
"restart": true,
|
||||
"smartStep": true,
|
||||
"skipFiles": ["<node_internals>/**"]
|
||||
}
|
||||
|
||||
npm run dev:debug
|
||||
|
||||
## onlyoffice
|
||||
|
||||
docker run -i -t -d -p 8081:80 --restart=always -e JWT_ENABLED=false onlyoffice/documentserver
|
||||
|
||||
## next em rede
|
||||
|
||||
```
|
||||
npx next dev -H 0.0.0.0
|
||||
```
|
||||
|
||||
```
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"dev:lan": "next dev -H 0.0.0.0" <-- Adicione esta linha
|
||||
},
|
||||
```
|
||||
|
||||
Como acessar no outro dispositivo
|
||||
Descubra seu IP Local:
|
||||
|
||||
No Windows (seu caso), abra um terminal (CMD ou PowerShell) e digite:
|
||||
|
||||
Bash
|
||||
|
||||
ipconfig
|
||||
Procure por Endereço IPv4 (geralmente começa com 192.168.x.x ou 10.0.x.x).
|
||||
|
||||
Acesse no navegador: No celular ou outro computador, digite: http://SEU_IP_AQUI:3000
|
||||
|
||||
Exemplo: <http://192.168.0.15:3000>
|
||||
|
|
|
|||
|
|
@ -1,17 +1,12 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
// Gera build autônomo para rodar com "node server.js"
|
||||
import type { NextConfig } from 'next';
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
// Isso gera um diretório otimizado que inclui tudo o que a aplicação precisa para rodar
|
||||
output: 'standalone',
|
||||
|
||||
// Configurações gerais
|
||||
reactStrictMode: true,
|
||||
poweredByHeader: false,
|
||||
compress: true,
|
||||
|
||||
// Desativa verificações no build de produção
|
||||
eslint: { ignoreDuringBuilds: true },
|
||||
typescript: { ignoreBuildErrors: true },
|
||||
|
||||
eslint: {
|
||||
// Desativa a verificação de lint durante o build
|
||||
ignoreDuringBuilds: true,
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = nextConfig;
|
||||
export default nextConfig;
|
||||
|
|
|
|||
324
package-lock.json
generated
324
package-lock.json
generated
|
|
@ -7,11 +7,9 @@
|
|||
"": {
|
||||
"name": "saas",
|
||||
"version": "25.9.1",
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"@faker-js/faker": "^10.0.0",
|
||||
"@hookform/resolvers": "^5.2.1",
|
||||
"@onlyoffice/document-editor-react": "^2.1.1",
|
||||
"@radix-ui/react-alert-dialog": "^1.1.15",
|
||||
"@radix-ui/react-avatar": "^1.1.10",
|
||||
"@radix-ui/react-checkbox": "^1.3.3",
|
||||
|
|
@ -35,7 +33,7 @@
|
|||
"clsx": "^2.1.1",
|
||||
"cmdk": "^1.1.1",
|
||||
"cookies-next": "^6.1.0",
|
||||
"date-fns": "^3.6.0",
|
||||
"date-fns": "^4.1.0",
|
||||
"faker-js": "^1.0.0",
|
||||
"framer-motion": "^12.23.24",
|
||||
"input-otp": "^1.4.2",
|
||||
|
|
@ -65,7 +63,6 @@
|
|||
"@types/react-dom": "^19",
|
||||
"@typescript-eslint/eslint-plugin": "^8.46.1",
|
||||
"@typescript-eslint/parser": "^8.46.1",
|
||||
"cross-env": "^10.1.0",
|
||||
"eslint": "^9.38.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-import-resolver-typescript": "^4.4.4",
|
||||
|
|
@ -77,7 +74,6 @@
|
|||
"eslint-plugin-unused-imports": "^4.2.0",
|
||||
"prettier": "^3.6.2",
|
||||
"prettier-plugin-tailwindcss": "^0.6.14",
|
||||
"shx": "^0.4.0",
|
||||
"tailwindcss": "^4",
|
||||
"tw-animate-css": "^1.3.7",
|
||||
"typescript": "5.9.3",
|
||||
|
|
@ -404,13 +400,6 @@
|
|||
"tslib": "^2.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@epic-web/invariant": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@epic-web/invariant/-/invariant-1.0.0.tgz",
|
||||
"integrity": "sha512-lrTPqgvfFQtR/eY/qkIzp98OGdNJu0m5ji3q/nJI8v3SXkRKEnWiOxMmbvcSoAIzv/cGiuvRy57k4suKQSAdwA==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@eslint-community/eslint-utils": {
|
||||
"version": "4.9.0",
|
||||
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz",
|
||||
|
|
@ -1394,19 +1383,6 @@
|
|||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/@onlyoffice/document-editor-react": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@onlyoffice/document-editor-react/-/document-editor-react-2.1.1.tgz",
|
||||
"integrity": "sha512-b0SnFPmT+OEyJons18PPHpwtFABVCI4nr3gPtAAImar1PhN9tNc9703Yo5KPYsHhIgVq+FqHSWgunI9GJnKa5w==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"lodash": "4.17.21"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.9.0 || ^17 || ^18 || ^19",
|
||||
"react-dom": "^16.9.0 || ^17 || ^18 || ^19"
|
||||
}
|
||||
},
|
||||
"node_modules/@pkgr/core": {
|
||||
"version": "0.2.9",
|
||||
"resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.9.tgz",
|
||||
|
|
@ -4278,24 +4254,6 @@
|
|||
"react": ">= 16.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/cross-env": {
|
||||
"version": "10.1.0",
|
||||
"resolved": "https://registry.npmjs.org/cross-env/-/cross-env-10.1.0.tgz",
|
||||
"integrity": "sha512-GsYosgnACZTADcmEyJctkJIoqAhHjttw7RsFrVoJNXbsWWqaq6Ym+7kZjq6mS45O0jij6vtiReppKQEtqWy6Dw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@epic-web/invariant": "^1.0.0",
|
||||
"cross-spawn": "^7.0.6"
|
||||
},
|
||||
"bin": {
|
||||
"cross-env": "dist/bin/cross-env.js",
|
||||
"cross-env-shell": "dist/bin/cross-env-shell.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
}
|
||||
},
|
||||
"node_modules/cross-spawn": {
|
||||
"version": "7.0.6",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
||||
|
|
@ -4501,9 +4459,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/date-fns": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.6.0.tgz",
|
||||
"integrity": "sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww==",
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/date-fns/-/date-fns-4.1.0.tgz",
|
||||
"integrity": "sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"type": "github",
|
||||
|
|
@ -4644,16 +4602,6 @@
|
|||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/end-of-stream": {
|
||||
"version": "1.4.5",
|
||||
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz",
|
||||
"integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"once": "^1.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/enhanced-resolve": {
|
||||
"version": "5.18.3",
|
||||
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.3.tgz",
|
||||
|
|
@ -5511,98 +5459,6 @@
|
|||
"integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/execa": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
|
||||
"integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"cross-spawn": "^6.0.0",
|
||||
"get-stream": "^4.0.0",
|
||||
"is-stream": "^1.1.0",
|
||||
"npm-run-path": "^2.0.0",
|
||||
"p-finally": "^1.0.0",
|
||||
"signal-exit": "^3.0.0",
|
||||
"strip-eof": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/execa/node_modules/cross-spawn": {
|
||||
"version": "6.0.6",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz",
|
||||
"integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"nice-try": "^1.0.4",
|
||||
"path-key": "^2.0.1",
|
||||
"semver": "^5.5.0",
|
||||
"shebang-command": "^1.2.0",
|
||||
"which": "^1.2.9"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.8"
|
||||
}
|
||||
},
|
||||
"node_modules/execa/node_modules/path-key": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
|
||||
"integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/execa/node_modules/semver": {
|
||||
"version": "5.7.2",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
|
||||
"integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"bin": {
|
||||
"semver": "bin/semver"
|
||||
}
|
||||
},
|
||||
"node_modules/execa/node_modules/shebang-command": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
|
||||
"integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"shebang-regex": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/execa/node_modules/shebang-regex": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
|
||||
"integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/execa/node_modules/which": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
|
||||
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"isexe": "^2.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"which": "bin/which"
|
||||
}
|
||||
},
|
||||
"node_modules/faker-js": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/faker-js/-/faker-js-1.0.0.tgz",
|
||||
|
|
@ -5893,19 +5749,6 @@
|
|||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/get-stream": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
|
||||
"integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"pump": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/get-symbol-description": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz",
|
||||
|
|
@ -6199,16 +6042,6 @@
|
|||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/interpret": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz",
|
||||
"integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/is-array-buffer": {
|
||||
"version": "3.0.5",
|
||||
"resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz",
|
||||
|
|
@ -6514,16 +6347,6 @@
|
|||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/is-stream": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
|
||||
"integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/is-string": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz",
|
||||
|
|
@ -7105,12 +6928,6 @@
|
|||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/lodash": {
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/lodash.includes": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz",
|
||||
|
|
@ -7444,13 +7261,6 @@
|
|||
"node": "^10 || ^12 || >=14"
|
||||
}
|
||||
},
|
||||
"node_modules/nice-try": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
|
||||
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/node-releases": {
|
||||
"version": "2.0.25",
|
||||
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.25.tgz",
|
||||
|
|
@ -7458,29 +7268,6 @@
|
|||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/npm-run-path": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
|
||||
"integrity": "sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"path-key": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/npm-run-path/node_modules/path-key": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
|
||||
"integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/object-assign": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||
|
|
@ -7603,16 +7390,6 @@
|
|||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
},
|
||||
"node_modules/optionator": {
|
||||
"version": "0.9.4",
|
||||
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz",
|
||||
|
|
@ -7649,16 +7426,6 @@
|
|||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/p-finally": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
|
||||
"integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/p-limit": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
|
||||
|
|
@ -7927,17 +7694,6 @@
|
|||
"react-is": "^16.13.1"
|
||||
}
|
||||
},
|
||||
"node_modules/pump": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz",
|
||||
"integrity": "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"end-of-stream": "^1.1.0",
|
||||
"once": "^1.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/punycode": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
|
||||
|
|
@ -8142,18 +7898,6 @@
|
|||
"react-is": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/rechoir": {
|
||||
"version": "0.6.2",
|
||||
"resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
|
||||
"integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"resolve": "^1.1.6"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/redux": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz",
|
||||
|
|
@ -8504,42 +8248,6 @@
|
|||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/shelljs": {
|
||||
"version": "0.9.2",
|
||||
"resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.9.2.tgz",
|
||||
"integrity": "sha512-S3I64fEiKgTZzKCC46zT/Ib9meqofLrQVbpSswtjFfAVDW+AZ54WTnAM/3/yENoxz/V1Cy6u3kiiEbQ4DNphvw==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"execa": "^1.0.0",
|
||||
"fast-glob": "^3.3.2",
|
||||
"interpret": "^1.0.0",
|
||||
"rechoir": "^0.6.2"
|
||||
},
|
||||
"bin": {
|
||||
"shjs": "bin/shjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/shx": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/shx/-/shx-0.4.0.tgz",
|
||||
"integrity": "sha512-Z0KixSIlGPpijKgcH6oCMCbltPImvaKy0sGH8AkLRXw1KyzpKtaCTizP2xen+hNDqVF4xxgvA0KXSb9o4Q6hnA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"minimist": "^1.2.8",
|
||||
"shelljs": "^0.9.2"
|
||||
},
|
||||
"bin": {
|
||||
"shx": "lib/cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz",
|
||||
|
|
@ -8616,13 +8324,6 @@
|
|||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/signal-exit": {
|
||||
"version": "3.0.7",
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
|
||||
"integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/sonner": {
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/sonner/-/sonner-2.0.7.tgz",
|
||||
|
|
@ -8789,16 +8490,6 @@
|
|||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/strip-eof": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
|
||||
"integrity": "sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/strip-json-comments": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
|
||||
|
|
@ -9464,13 +9155,6 @@
|
|||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/yallist": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz",
|
||||
|
|
|
|||
11
package.json
11
package.json
|
|
@ -4,17 +4,14 @@
|
|||
"version": "25.9.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"dev:debug": "cross-env NEXT_USE_TURBOPACK=0 NODE_OPTIONS=\"--inspect=9230\" next dev",
|
||||
"dev": "next dev --turbopack",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"lint": "next lint",
|
||||
"postinstall": "shx mkdir -p public/libs && shx cp -r node_modules/tinymce public/libs/tinymce"
|
||||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@faker-js/faker": "^10.0.0",
|
||||
"@hookform/resolvers": "^5.2.1",
|
||||
"@onlyoffice/document-editor-react": "^2.1.1",
|
||||
"@radix-ui/react-alert-dialog": "^1.1.15",
|
||||
"@radix-ui/react-avatar": "^1.1.10",
|
||||
"@radix-ui/react-checkbox": "^1.3.3",
|
||||
|
|
@ -38,7 +35,7 @@
|
|||
"clsx": "^2.1.1",
|
||||
"cmdk": "^1.1.1",
|
||||
"cookies-next": "^6.1.0",
|
||||
"date-fns": "^3.6.0",
|
||||
"date-fns": "^4.1.0",
|
||||
"faker-js": "^1.0.0",
|
||||
"framer-motion": "^12.23.24",
|
||||
"input-otp": "^1.4.2",
|
||||
|
|
@ -68,7 +65,6 @@
|
|||
"@types/react-dom": "^19",
|
||||
"@typescript-eslint/eslint-plugin": "^8.46.1",
|
||||
"@typescript-eslint/parser": "^8.46.1",
|
||||
"cross-env": "^10.1.0",
|
||||
"eslint": "^9.38.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-import-resolver-typescript": "^4.4.4",
|
||||
|
|
@ -80,7 +76,6 @@
|
|||
"eslint-plugin-unused-imports": "^4.2.0",
|
||||
"prettier": "^3.6.2",
|
||||
"prettier-plugin-tailwindcss": "^0.6.14",
|
||||
"shx": "^0.4.0",
|
||||
"tailwindcss": "^4",
|
||||
"tw-animate-css": "^1.3.7",
|
||||
"typescript": "5.9.3",
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -0,0 +1,50 @@
|
|||
'use client';
|
||||
|
||||
import { useEffect } from 'react';
|
||||
import { useParams } from 'next/navigation';
|
||||
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { useGUsuarioReadHooks } from '@/packages/administrativo/hooks/GUsuario/useGUsuarioReadHooks';
|
||||
import Usuario from '@/packages/administrativo/interfaces/GUsuario/GUsuarioInterface';
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
|
||||
export default function UsuarioDetalhes() {
|
||||
const params = useParams();
|
||||
|
||||
const { usuario, fetchUsuario } = useGUsuarioReadHooks();
|
||||
|
||||
useEffect(() => {
|
||||
if (params.id) {
|
||||
fetchUsuario({ usuario_id: Number(params.id) } as Usuario);
|
||||
}
|
||||
}, []);
|
||||
|
||||
if (!usuario) return <Loading type={1} />;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<div className="mb-4 grid grid-cols-4 gap-4">
|
||||
<div>
|
||||
<div className="text-2xl font-semibold">Nome</div>
|
||||
<div className="text-xl">{usuario?.nome_completo}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div className="text-2xl font-semibold">CPF</div>
|
||||
<div className="text-xl">{usuario?.cpf}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div className="text-2xl font-semibold">Função</div>
|
||||
<div className="text-xl">{usuario?.funcao}</div>
|
||||
</div>
|
||||
<div>
|
||||
<div className="text-2xl font-semibold">Email</div>
|
||||
<div className="text-xl">{usuario?.email}</div>
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
'use client';
|
||||
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { z } from 'zod';
|
||||
|
||||
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import {
|
||||
Form,
|
||||
FormControl,
|
||||
FormField,
|
||||
FormItem,
|
||||
FormLabel,
|
||||
FormMessage,
|
||||
} from '@/components/ui/form';
|
||||
import { Input } from '@/components/ui/input';
|
||||
|
||||
import { useGUsuarioSaveHook } from '../../../../../../packages/administrativo/hooks/GUsuario/useGUsuarioSaveHook';
|
||||
import { GUsuarioSchema } from '../../../../../../packages/administrativo/schemas/GUsuario/GUsuarioSchema';
|
||||
|
||||
type FormValues = z.infer<typeof GUsuarioSchema>;
|
||||
|
||||
export default function UsuarioFormularioPage() {
|
||||
const { usuario, saveUsuario } = useGUsuarioSaveHook();
|
||||
|
||||
const form = useForm<FormValues>({
|
||||
resolver: zodResolver(GUsuarioSchema),
|
||||
defaultValues: {
|
||||
login: '',
|
||||
nome_completo: '',
|
||||
funcao: '',
|
||||
email: '',
|
||||
cpf: '',
|
||||
},
|
||||
});
|
||||
|
||||
async function onSubmit(values: FormValues) {
|
||||
saveUsuario(values);
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<Form {...form}>
|
||||
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-8">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="login"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Login</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="nome_completo"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Nome Completo</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="funcao"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Função</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="email"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Email</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="cpf"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Cpf</FormLabel>
|
||||
<FormControl>
|
||||
<Input {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<Button type="submit">Salvar</Button>
|
||||
</form>
|
||||
</Form>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
'use client';
|
||||
|
||||
import Link from 'next/link';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
TableCell,
|
||||
TableHead,
|
||||
TableHeader,
|
||||
TableRow,
|
||||
} from '@/components/ui/table';
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
|
||||
import { useGUsuarioIndexHook } from '../../../../../packages/administrativo/hooks/GUsuario/useGUsuarioIndexHook';
|
||||
import Usuario from '../../../../../packages/administrativo/interfaces/GUsuario/GUsuarioInterface';
|
||||
|
||||
|
||||
|
||||
|
||||
export default function UsuarioPage() {
|
||||
const { usuarios, fetchUsuarios } = useGUsuarioIndexHook();
|
||||
|
||||
useEffect(() => {
|
||||
fetchUsuarios();
|
||||
}, []);
|
||||
|
||||
if (!usuarios) return <Loading type={2} />;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Card>
|
||||
<CardContent>
|
||||
<div className="grid grid-cols-2">
|
||||
<div className="text-2xl font-semibold">Usuarios</div>
|
||||
<div className="text-right">
|
||||
<Button asChild>
|
||||
<Link href="/usuarios/formulario">+ Usuário</Link>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead className="text-center">#</TableHead>
|
||||
<TableHead>Situação</TableHead>
|
||||
<TableHead>CPF</TableHead>
|
||||
<TableHead>Login / Sigla / Nome</TableHead>
|
||||
<TableHead>Função</TableHead>
|
||||
<TableHead></TableHead>
|
||||
<TableHead></TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
{usuarios.map((usuario: Usuario) => (
|
||||
<TableRow key={usuario.usuario_id} className="cursor-pointer">
|
||||
<TableCell className="text-center">{usuario.usuario_id}</TableCell>
|
||||
<TableCell className="font-medium">{usuario.situacao}</TableCell>
|
||||
<TableCell className="font-medium">{usuario.cpf}</TableCell>
|
||||
<TableCell>
|
||||
<div className="text-xs font-semibold">
|
||||
{usuario.login} - {usuario.sigla}
|
||||
</div>
|
||||
<div className="text-base">{usuario.nome_completo}</div>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<div className="text-base">{usuario.funcao}</div>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Button asChild>
|
||||
<Link href={`/usuarios/${usuario.usuario_id}/detalhes`}>Detalhes</Link>
|
||||
</Button>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,7 +1,9 @@
|
|||
'use client';
|
||||
|
||||
import GCartorioIndex from '@/packages/administrativo/components/GCartorio/GCartorioIndex';
|
||||
import GCartorioIndex from "@/packages/administrativo/components/GCartorio/GCartorioIndex";
|
||||
|
||||
export default function GCartorioPage() {
|
||||
return <GCartorioIndex />;
|
||||
return (
|
||||
< GCartorioIndex />
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
export default function TCensecPage() {
|
||||
return <div></div>;
|
||||
}
|
||||
return (
|
||||
<div></div>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,5 +1,9 @@
|
|||
import GCalculoIndex from '@/packages/administrativo/components/GCalculo/GCalculoIndex';
|
||||
import GCalculoIndex from "@/packages/administrativo/components/GCalculo/GCalculoIndex";
|
||||
|
||||
export default function GEmolumentoPeriodoPage() {
|
||||
return <GCalculoIndex />;
|
||||
}
|
||||
|
||||
return (
|
||||
<GCalculoIndex />
|
||||
);
|
||||
|
||||
}
|
||||
|
|
@ -1,16 +1,18 @@
|
|||
'use client';
|
||||
'use client'
|
||||
|
||||
import { useParams } from 'next/navigation';
|
||||
import { useParams } from "next/navigation";
|
||||
|
||||
import GEmolumentoItemIndex from '@/packages/administrativo/components/GEmolumentoItem/GEmolumentoItemIndex';
|
||||
import GEmolumentoItemIndex from "@/packages/administrativo/components/GEmolumentoItem/GEmolumentoItemIndex";
|
||||
|
||||
export default function GGramaticaPage() {
|
||||
const params = useParams();
|
||||
|
||||
return (
|
||||
<GEmolumentoItemIndex
|
||||
emolumento_id={Number(params.emolumentoId)}
|
||||
emolumento_periodo_id={Number(params.emolumentoPeriodoId)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
const params = useParams();
|
||||
|
||||
return (
|
||||
<GEmolumentoItemIndex
|
||||
emolumento_id={Number(params.emolumentoId)}
|
||||
emolumento_periodo_id={Number(params.emolumentoPeriodoId)}
|
||||
/>
|
||||
);
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,9 @@
|
|||
import GEmolumentoIndex from '@/packages/administrativo/components/GEmolumento/GEmolumentoIndex';
|
||||
import GEmolumentoIndex from "@/packages/administrativo/components/GEmolumento/GEmolumentoIndex";
|
||||
|
||||
export default function GEmolumentoPeriodoPage() {
|
||||
return <GEmolumentoIndex />;
|
||||
}
|
||||
|
||||
return (
|
||||
<GEmolumentoIndex />
|
||||
);
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,9 @@
|
|||
import GEmolumentoPeriodoIndex from '@/packages/administrativo/components/GEmolumentoPeriodo/GEmolumentoPeriodoIndex';
|
||||
import GEmolumentoPeriodoIndex from "@/packages/administrativo/components/GEmolumentoPeriodo/GEmolumentoPeriodoIndex";
|
||||
|
||||
export default function GEmolumentoPeriodoPage() {
|
||||
return <GEmolumentoPeriodoIndex />;
|
||||
}
|
||||
|
||||
return (
|
||||
<GEmolumentoPeriodoIndex />
|
||||
);
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,9 @@
|
|||
import GGramaticaIndex from '@/packages/administrativo/components/GGramatica/GGramaticaIndex';
|
||||
import GGramaticaIndex from "@/packages/administrativo/components/GGramatica/GGramaticaIndex";
|
||||
|
||||
export default function GGramaticaPage() {
|
||||
return <GGramaticaIndex />;
|
||||
}
|
||||
|
||||
return (
|
||||
<GGramaticaIndex />
|
||||
);
|
||||
|
||||
}
|
||||
|
|
@ -1,7 +1,9 @@
|
|||
'use client';
|
||||
|
||||
import TImovelDashboard from '@/packages/administrativo/components/TImovel/TImovelDashboard';
|
||||
import TImovelDashboard from "@/packages/administrativo/components/TImovel/TImovelDashboard";
|
||||
|
||||
export default function TImovelDashboardPage() {
|
||||
return <TImovelDashboard />;
|
||||
return (
|
||||
<TImovelDashboard />
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
'use client';
|
||||
|
||||
import TPessoaDashboard from '@/packages/administrativo/components/TPessoa/TPessoaDashboard';
|
||||
import TPessoaDashboard from "@/packages/administrativo/components/TPessoa/TPessoaDashboard";
|
||||
|
||||
export default function TPessoaDashboardPage() {
|
||||
return <TPessoaDashboard />;
|
||||
return (
|
||||
<TPessoaDashboard />
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
import GSeloGrupoIndex from '@/packages/administrativo/components/GSeloGrupo/GSeloGrupoIndex';
|
||||
import GSeloGrupoIndex from "@/packages/administrativo/components/GSeloGrupo/GSeloGrupoIndex";
|
||||
|
||||
export default function GSeloGrupoPage() {
|
||||
return <GSeloGrupoIndex />;
|
||||
}
|
||||
|
||||
return (
|
||||
<GSeloGrupoIndex />
|
||||
);
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
import TServicoTipoIndex from '@/packages/administrativo/components/TServicoTipo/TServicoTipoIndex';
|
||||
|
||||
export default function TServicoTipoPage() {
|
||||
return <TServicoTipoIndex />;
|
||||
}
|
||||
|
|
@ -1,5 +1,11 @@
|
|||
import GNaturezaTituloIndex from '@/packages/administrativo/components/GNaturezaTitulo/GNaturezaTituloIndex';
|
||||
import GNaturezaTituloIndex from "@/packages/administrativo/components/GNaturezaTitulo/GNaturezaTituloIndex";
|
||||
|
||||
export default function GNaturezaPage() {
|
||||
return <GNaturezaTituloIndex sistema_id={2} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<GNaturezaTituloIndex
|
||||
sistema_id={2}
|
||||
/>
|
||||
);
|
||||
|
||||
}
|
||||
|
|
@ -1,13 +1,14 @@
|
|||
'use client';
|
||||
|
||||
import { useParams } from 'next/navigation';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useParams } from 'next/navigation';
|
||||
|
||||
import MainEditor from '@/components/MainEditor';
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import MainEditor from '@/components/MainEditor';
|
||||
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
import { useTMinutaReadHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaReadHook';
|
||||
import { TMinutaInterface } from '@/packages/administrativo/interfaces/TMinuta/TMinutaInterface';
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
|
||||
export default function TMinutaDetalhes() {
|
||||
const params = useParams();
|
||||
|
|
|
|||
|
|
@ -1,13 +1,11 @@
|
|||
'use client';
|
||||
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import z from 'zod';
|
||||
import { useEffect } from 'react';
|
||||
import { useForm, Controller } from 'react-hook-form';
|
||||
import z from 'zod';
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
|
||||
import MainEditor from '@/components/MainEditor';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { Checkbox } from '@/components/ui/checkbox';
|
||||
import {
|
||||
Form,
|
||||
|
|
@ -19,8 +17,11 @@ import {
|
|||
} from '@/components/ui/form';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import { useTMinutaSaveHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaSaveHook';
|
||||
|
||||
import MainEditor from '@/components/MainEditor';
|
||||
import { TMinutaSchema } from '@/packages/administrativo/schemas/TMinuta/TMinutaSchema';
|
||||
import { useTMinutaSaveHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaSaveHook';
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
|
||||
type FormValues = z.infer<typeof TMinutaSchema>;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,19 +1,22 @@
|
|||
'use client';
|
||||
|
||||
import { useEffect, useState, useCallback } from 'react';
|
||||
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import TMinutaForm from '@/packages/administrativo/components/TMinuta/TMinutaForm';
|
||||
import TMinutaTable from '@/packages/administrativo/components/TMinuta/TMinutaTable';
|
||||
import { useTMinutaIndexHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaIndexHook';
|
||||
import { useTMinutaReadHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaReadHook';
|
||||
import { useTMinutaRemoveHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaRemoveHook';
|
||||
import { useTMinutaSaveHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaSaveHook';
|
||||
import { TMinutaInterface } from '@/packages/administrativo/interfaces/TMinuta/TMinutaInterface';
|
||||
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
|
||||
import { useConfirmDialog } from '@/shared/components/confirmDialog/useConfirmDialog';
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
|
||||
import Header from '@/shared/components/structure/Header';
|
||||
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
|
||||
import TMinutaTable from '@/packages/administrativo/components/TMinuta/TMinutaTable';
|
||||
import TMinutaForm from '@/packages/administrativo/components/TMinuta/TMinutaForm';
|
||||
|
||||
import { useTMinutaReadHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaReadHook';
|
||||
import { useTMinutaSaveHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaSaveHook';
|
||||
import { useTMinutaRemoveHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaRemoveHook';
|
||||
|
||||
import { TMinutaInterface } from '@/packages/administrativo/interfaces/TMinuta/TMinutaInterface';
|
||||
import { useTMinutaIndexHook } from '@/packages/administrativo/hooks/TMinuta/useTMinutaIndexHook';
|
||||
|
||||
export default function TMinutaPage() {
|
||||
// Hooks de leitura e escrita
|
||||
|
|
|
|||
|
|
@ -1,22 +1,29 @@
|
|||
'use client';
|
||||
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { useTServicoTipoEditHook } from '@/packages/administrativo/hooks/TServicoTipo/useTServicoTipoEditHook';
|
||||
import { useTServicoTipoReadHook } from '@/packages/administrativo/hooks/TServicoTipo/useTServicoTipoReadHook';
|
||||
import { useTServicoTipoRemoveHook } from '@/packages/administrativo/hooks/TServicoTipo/useTServicoTipoRemoveHook';
|
||||
import { useTServicoTipoSaveHook } from '@/packages/administrativo/hooks/TServicoTipo/useTServicoTipoSaveHook';
|
||||
import TServicoTipoInterface from '@/packages/administrativo/interfaces/TServicoTipo/TServicoTipoInterface';
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
|
||||
// Componentes específicos para TServicoTipo
|
||||
import TServicoTipoForm from '../../_components/t_servico_tipo/TServicoTipoForm';
|
||||
import TServicoTipoTable from '../../_components/t_servico_tipo/TServicoTipoTable';
|
||||
|
||||
// Hooks específicos para TServicoTipo
|
||||
import { useTServicoTipoEditHook } from '../../../../../../packages/administrativo/hooks/TServicoTipo/useTServicoTipoEditHook';
|
||||
import { useTServicoTipoReadHook } from '../../../../../../packages/administrativo/hooks/TServicoTipo/useTServicoTipoReadHook';
|
||||
import { useTServicoTipoRemoveHook } from '../../../../../../packages/administrativo/hooks/TServicoTipo/useTServicoTipoRemoveHook';
|
||||
import { useTServicoTipoSaveHook } from '../../../../../../packages/administrativo/hooks/TServicoTipo/useTServicoTipoSaveHook';
|
||||
|
||||
import ConfirmDialog from '@/shared/components/confirmDialog/ConfirmDialog';
|
||||
import { useConfirmDialog } from '@/shared/components/confirmDialog/useConfirmDialog';
|
||||
import Loading from '@/shared/components/loading/loading';
|
||||
|
||||
// Interface específica para TServicoTipo
|
||||
import Header from '@/shared/components/structure/Header';
|
||||
import TServicoTipoInterface from '../../_interfaces/TServicoTipoInterface';
|
||||
|
||||
import TServicoTipoForm from './TServicoTipoForm';
|
||||
import TServicoTipoTable from './TServicoTipoTable';
|
||||
|
||||
export default function TServicoTipoIndex() {
|
||||
export default function TServicoTipoPage() {
|
||||
// Hooks para leitura, salvamento e remoção
|
||||
const { tServicoTipo, fetchTServicoTipo } = useTServicoTipoReadHook();
|
||||
const { saveTServicoTipo } = useTServicoTipoSaveHook();
|
||||
const { removeTServicoTipo } = useTServicoTipoRemoveHook();
|
||||
|
|
@ -26,8 +33,9 @@ export default function TServicoTipoIndex() {
|
|||
const [selectedServicoTipo, setSelectedServicoTipo] = useState<TServicoTipoInterface | null>(
|
||||
null,
|
||||
);
|
||||
|
||||
const [isFormOpen, setIsFormOpen] = useState(false);
|
||||
|
||||
// Estado para saber qual item será deletado
|
||||
const [itemToDelete, setItemToDelete] = useState<TServicoTipoInterface | null>(null);
|
||||
|
||||
/**
|
||||
|
|
@ -1,8 +1,5 @@
|
|||
'use client';
|
||||
|
||||
import { CirclePlus, DollarSign, Settings, SquarePen, Trash } from 'lucide-react';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Checkbox } from '@/components/ui/checkbox';
|
||||
import {
|
||||
|
|
@ -23,6 +20,11 @@ import {
|
|||
FormMessage,
|
||||
} from '@/components/ui/form';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem
|
||||
} from '@/components/ui/select';
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
|
|
@ -32,94 +34,151 @@ import {
|
|||
TableRow,
|
||||
} from '@/components/ui/table';
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import { CirclePlus, DollarSign, Settings, SquarePen, Trash } from 'lucide-react';
|
||||
import React, { useState } from 'react';
|
||||
import { useForm } from 'react-hook-form';
|
||||
|
||||
import { useGEmolumentoItemReadHook } from '@/app/(protected)/(cadastros)/cadastros/_hooks/g_emolumento_item/useGEmolumentoItemReadHook';
|
||||
import { useTServicoEtiquetaReadHook } from '@/app/(protected)/(cadastros)/cadastros/_hooks/t_servico_etiqueta/useTServicoEtiquetaReadHook';
|
||||
import { useTServicoEtiquetaRemoveHook } from '@/app/(protected)/(cadastros)/cadastros/_hooks/t_servico_etiqueta/useTServicoEtiquetaRemoveHook';
|
||||
import { useTServicoEtiquetaSaveHook } from '@/app/(protected)/(cadastros)/cadastros/_hooks/t_servico_etiqueta/useTServicoEtiquetaSaveHook';
|
||||
import { GEmolumentoItemReadInterface } from '@/app/(protected)/(cadastros)/cadastros/_interfaces/GEmolumentoItemReadInterface';
|
||||
import CCaixaServicoSelect from '@/packages/administrativo/components/CCaixaServico/CCaixaServicoSelect';
|
||||
import GEmolumentoSelect from '@/packages/administrativo/components/GEmolumento/GEmolumentoSelect';
|
||||
import GMarcacaoTipoSelect from '@/packages/administrativo/components/GMarcacaoTipo/GMarcacaoTipoSelect';
|
||||
import TTBReconhecimentoTipoSelect from '@/packages/administrativo/components/TTBReconhecimentoTipo/TTBReconhecimentoTipoSelect';
|
||||
import { TServicoTipoSaveData } from '@/packages/administrativo/data/TServicoTipo/TServicoTipoSaveData';
|
||||
import { useGEmolumentoItemReadHook } from '@/packages/administrativo/hooks/GEmolumentoItem/useGEmolumentoItemReadHook';
|
||||
import { useTServicoEtiquetaReadHook } from '@/packages/administrativo/hooks/TServicoEtiqueta/useTServicoEtiquetaReadHook';
|
||||
import { useTServicoEtiquetaRemoveHook } from '@/packages/administrativo/hooks/TServicoEtiqueta/useTServicoEtiquetaRemoveHook';
|
||||
import { useTServicoEtiquetaSaveHook } from '@/packages/administrativo/hooks/TServicoEtiqueta/useTServicoEtiquetaSaveHook';
|
||||
import { useTServicoTipoFormHook } from '@/packages/administrativo/hooks/TServicoTipo/useTServicoTipoFormHook';
|
||||
import { GEmolumentoItemReadInterface } from '@/packages/administrativo/interfaces/GEmolumentoItem/GEmolumentoItemReadInterface';
|
||||
import TServicoTipoFormInterface from '@/packages/administrativo/interfaces/TServicoTipo/TServicoTipoFormInterface';
|
||||
import { TServicoTipoFormValues } from '@/packages/administrativo/schemas/TServicoTipo/TServicoTipoSchema';
|
||||
import CategoriaServicoSelect from '@/shared/components/categoriaServicoSelect/CategoriaServicoSelect';
|
||||
import { ConfirmacaoCheckBox } from '@/shared/components/confirmacao/ConfirmacaoCheckBox';
|
||||
import ConfirmacaoSelect from '@/shared/components/confirmacao/ConfirmacaoSelect';
|
||||
import { TipoPessoaSelect } from '@/shared/components/tipoPessoa/tipoPessoaSelect';
|
||||
import { ConfirmacaoEnum } from '@/shared/enums/ConfirmacaoEnum';
|
||||
import { SituacoesEnum } from '@/shared/enums/SituacoesEnum';
|
||||
import { useEffect } from 'react';
|
||||
import { TServicoTipoSaveData } from '../../../../../../packages/administrativo/data/TServicoTipo/TServicoTipoSaveData';
|
||||
import { TServicoTipoFormValues, TServicoTipoSchema } from '../../_schemas/TServicoTipoSchema';
|
||||
|
||||
// Propriedades esperadas pelo componente
|
||||
interface Props {
|
||||
isOpen: boolean;
|
||||
data: TServicoTipoFormValues | null;
|
||||
onClose: (item: null, isFormStatus: boolean) => void;
|
||||
onSave: (data: TServicoTipoFormValues) => void;
|
||||
}
|
||||
|
||||
// Componente principal do formulário
|
||||
export default function TServicoTipoForm({
|
||||
isOpen,
|
||||
data,
|
||||
onClose,
|
||||
onSave,
|
||||
}: TServicoTipoFormInterface) {
|
||||
const form = useTServicoTipoFormHook({});
|
||||
export default function TServicoTipoForm({ isOpen, data, onClose, onSave }: Props) {
|
||||
// Inicializa o react-hook-form com validação via Zod
|
||||
const form = useForm<TServicoTipoFormValues>({
|
||||
resolver: zodResolver(TServicoTipoSchema),
|
||||
defaultValues: {
|
||||
servico_tipo_id: 0,
|
||||
emolumento_id: 0,
|
||||
emolumento_obrigatorio: 0,
|
||||
descricao: '',
|
||||
maximo_pessoa: 0,
|
||||
tipo_item: '',
|
||||
frenteverso: 'N',
|
||||
averbacao: 'N',
|
||||
transferencia_veiculo: 'N',
|
||||
usar_a4: 'N',
|
||||
etiqueta_unica: 'N',
|
||||
situacao: 'A',
|
||||
selar: 'N',
|
||||
valor_emolumento: 0,
|
||||
valor_taxa_judiciaria: 0,
|
||||
fundesp_valor: 0,
|
||||
valor_total: 0,
|
||||
tipo_pessoa: 'F', // ou "J"
|
||||
} as unknown as TServicoTipoFormValues,
|
||||
});
|
||||
|
||||
// Carrega o ID caso esteja informado no form
|
||||
const servico_tipo_id = form.getValues('servico_tipo_id') || 0;
|
||||
|
||||
// Hook responsável por buscar emolumentos no backend
|
||||
const { tServicoEtiqueta, fetchTServicoEtiqueta } = useTServicoEtiquetaReadHook();
|
||||
const { fetchTServicoEtiquetaSave } = useTServicoEtiquetaSaveHook();
|
||||
|
||||
// Hook responsável em salvar o a etiqueta selecionada
|
||||
const { tServicoEtiquetaSave, fetchTServicoEtiquetaSave } = useTServicoEtiquetaSaveHook();
|
||||
|
||||
// Hook responsável em excluir a etiqueta selecionada
|
||||
const { fetchTServicoEtiquetaRemove } = useTServicoEtiquetaRemoveHook();
|
||||
|
||||
// Estado para gerenciar os itens da tabela de etiquetas/carimbos
|
||||
const [itensTabela, setItensTabela] = useState<
|
||||
{ servico_etiqueta_id: string | number; descricao: string }[]
|
||||
>([]);
|
||||
|
||||
// Carrega etiquetas quando o form tem ID
|
||||
useEffect(() => {
|
||||
// Carrega os dados de emolumentos apenas uma vez ao montar o componente
|
||||
React.useEffect(() => {
|
||||
// Função para consumir o endpoint da api
|
||||
const loadData = async () => {
|
||||
// Verifica se o ID do serviço tipo foi informado
|
||||
if (servico_tipo_id > 0) {
|
||||
// Consumo o endpoint da api
|
||||
await fetchTServicoEtiqueta({ servico_tipo_id });
|
||||
}
|
||||
};
|
||||
|
||||
// Chama a função para consumir o endpoint da api
|
||||
loadData();
|
||||
}, [servico_tipo_id]);
|
||||
|
||||
// Atualiza a tabela quando muda o hook
|
||||
useEffect(() => {
|
||||
// Atualiza itensTabela sempre que tServicoEtiqueta for carregado
|
||||
React.useEffect(() => {
|
||||
// Verifica se a consulta retornou os dados como objeto
|
||||
if (Array.isArray(tServicoEtiqueta) && tServicoEtiqueta.length > 0) {
|
||||
// Lista os itens
|
||||
const mapped = tServicoEtiqueta.map((item) => ({
|
||||
servico_etiqueta_id: Number(item.servico_etiqueta_id ?? 0),
|
||||
descricao: String(item.descricao ?? 'Sem descrição'),
|
||||
}));
|
||||
|
||||
setItensTabela(mapped);
|
||||
} else {
|
||||
setItensTabela([]);
|
||||
}
|
||||
}, [tServicoEtiqueta]);
|
||||
|
||||
// Função para adicionar um novo item à tabela Etiquetas/Carimbos
|
||||
const handleAddEtiquetaCarimbo = async () => {
|
||||
// Captura o valor selecionado do formulário
|
||||
const valorSelecionado = form.getValues('etiquetas_carimbos');
|
||||
|
||||
// Se não houver valor selecionado, não faz nada
|
||||
if (!valorSelecionado) return;
|
||||
|
||||
// Verifica se o item já se encontra na tabela
|
||||
const alreadyExists = itensTabela.some(
|
||||
(p) => String(p.descricao).trim() === String(valorSelecionado).trim(),
|
||||
(p) => String(p.descricao).trim() === String(valorSelecionado.value).trim(),
|
||||
);
|
||||
|
||||
if (alreadyExists) return;
|
||||
// Caso o item já esteja na tabela, para o procedimento
|
||||
if (alreadyExists) {
|
||||
return;
|
||||
}
|
||||
|
||||
// --- Envio opcional para API ---
|
||||
try {
|
||||
// Verifica se o ID do serviço tipo foi informado
|
||||
if (servico_tipo_id > 0) {
|
||||
const dataToSave = {
|
||||
etiqueta_modelo_id: 0, // não há ID, pois o valor é string
|
||||
// Monta o objeto do item selecionado
|
||||
const data = {
|
||||
etiqueta_modelo_id: valorSelecionado.key,
|
||||
servico_tipo_id: servico_tipo_id,
|
||||
};
|
||||
|
||||
const response = await fetchTServicoEtiquetaSave(dataToSave);
|
||||
// Consumo o endpoint da api
|
||||
const response = await fetchTServicoEtiquetaSave(data);
|
||||
|
||||
// Verifica se tServicoEtiquetaSave é um objeto válido (não null e não array)
|
||||
if (response && typeof response === 'object' && !Array.isArray(response)) {
|
||||
// Monta o objeto com um único item para a tabela
|
||||
const item = {
|
||||
servico_etiqueta_id: Number(response.servico_etiqueta_id) ?? 0,
|
||||
descricao: String(valorSelecionado) ?? 'Sem descrição',
|
||||
descricao: String(valorSelecionado.value) ?? 'Sem descrição',
|
||||
};
|
||||
|
||||
// Adiciona o item na tabela
|
||||
setItensTabela((prev) => {
|
||||
const idAtual = String(response.servico_etiqueta_id ?? '');
|
||||
const exists = prev.some((p) => String(p.servico_etiqueta_id ?? '') === idAtual);
|
||||
|
|
@ -127,80 +186,110 @@ export default function TServicoTipoForm({
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Se ocorrer erros, informo
|
||||
} catch (error) {
|
||||
console.log('Erro ao enviar o serviço para a API: ' + error);
|
||||
}
|
||||
};
|
||||
|
||||
// Remove item da tabela
|
||||
// Função para remover um item da tabela
|
||||
const handleRemoveItem = async (servico_etiqueta_id: number) => {
|
||||
try {
|
||||
// Verifica se o ID da etiqueta tipo foi informado
|
||||
if (servico_etiqueta_id > 0) {
|
||||
const data = { servico_etiqueta_id };
|
||||
// Monta o objeto do item selecionado
|
||||
const data = {
|
||||
servico_etiqueta_id: servico_etiqueta_id,
|
||||
};
|
||||
|
||||
// Consumo o endpoint da api
|
||||
await fetchTServicoEtiquetaRemove(data);
|
||||
}
|
||||
|
||||
// Atualiza a tabela no form
|
||||
setItensTabela((prev) =>
|
||||
prev.filter((p) => Number(p.servico_etiqueta_id) !== servico_etiqueta_id),
|
||||
);
|
||||
|
||||
// Se ocorrer erros, informo
|
||||
} catch (error) {
|
||||
console.log('Erro ao enviar o serviço para a API: ' + error);
|
||||
}
|
||||
};
|
||||
|
||||
// Parâmetros para o hook de leitura de emolumento_item
|
||||
// Inicializa com valores padrão (0) para evitar uso de propriedades não declaradas.
|
||||
const gEmolumentoItemReadParams: GEmolumentoItemReadInterface = { emolumento_id: 0, valor: 0 };
|
||||
|
||||
const [open, setOpen] = useState(false);
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
// Estados locais
|
||||
const [open, setOpen] = React.useState(false);
|
||||
const [isLoading, setIsLoading] = React.useState(false);
|
||||
|
||||
// Hook que realiza a leitura do emolumento_item
|
||||
const { gGEmolumentoItem, fetchGEmolumentoItem } = useGEmolumentoItemReadHook();
|
||||
|
||||
// Busca emolumento item
|
||||
useEffect(() => {
|
||||
// Busca os dados ao montar o componente (somente se houver ID válido)
|
||||
React.useEffect(() => {
|
||||
const loadData = async () => {
|
||||
// Validação: só executa se houver emolumento_id informado e válido
|
||||
if (
|
||||
!gEmolumentoItemReadParams?.emolumento_id ||
|
||||
isNaN(Number(gEmolumentoItemReadParams.emolumento_id)) ||
|
||||
Number(gEmolumentoItemReadParams.emolumento_id) <= 0
|
||||
!gEmolumentoItemReadParams?.emolumento_id || // se não existir o campo
|
||||
isNaN(Number(gEmolumentoItemReadParams.emolumento_id)) || // se não for número
|
||||
Number(gEmolumentoItemReadParams.emolumento_id) <= 0 // se for zero ou negativo
|
||||
) {
|
||||
return;
|
||||
return; // encerra sem executar a busca
|
||||
}
|
||||
|
||||
// Executa a busca apenas se ainda não houver dados carregados
|
||||
if (!gGEmolumentoItem.length) {
|
||||
setIsLoading(true);
|
||||
await fetchGEmolumentoItem(gEmolumentoItemReadParams);
|
||||
setIsLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
loadData();
|
||||
}, [gEmolumentoItemReadParams.emolumento_id]);
|
||||
|
||||
// Captura o ID do serviço para uso local
|
||||
const servicoTipoId = Number(form.watch('servico_tipo_id') || data?.servico_tipo_id || 0);
|
||||
|
||||
// Função chamada ao clicar em "Salvar"
|
||||
const handleSave = async (formData: TServicoTipoFormValues) => {
|
||||
try {
|
||||
// Se o form não trouxe o ID, tenta puxar de `data`
|
||||
const servico_tipo_id =
|
||||
formData.servico_tipo_id || data?.servico_tipo_id || form.getValues('servico_tipo_id') || 0;
|
||||
|
||||
// Atualiza o valor dentro do formData
|
||||
formData.servico_tipo_id = Number(servico_tipo_id);
|
||||
|
||||
// Intercepta e trata o valor de emolumento_id
|
||||
const emolumentoId = Number(formData.emolumento_id ?? 0);
|
||||
formData.emolumento_id = emolumentoId === 0 ? null : emolumentoId;
|
||||
|
||||
// Intercepta e trata o valor de emolumento_obrigatorio
|
||||
const emolumentoObrigatorio = Number(formData.emolumento_obrigatorio ?? 0);
|
||||
formData.emolumento_obrigatorio = emolumentoObrigatorio === 0 ? null : emolumentoObrigatorio;
|
||||
|
||||
// Detecta automaticamente se é edição
|
||||
const isEditing = !!formData.servico_tipo_id && Number(formData.servico_tipo_id) > 0;
|
||||
|
||||
// Envia os dados para o módulo com o método correto
|
||||
const response = await TServicoTipoSaveData({
|
||||
...formData,
|
||||
metodo: isEditing ? 'PUT' : 'POST',
|
||||
metodo: isEditing ? 'PUT' : 'POST', // 💡 Definição explícita do método
|
||||
});
|
||||
|
||||
// Atualiza o formulário apenas se o retorno for válido
|
||||
if (response?.data?.servico_tipo_id) {
|
||||
const novoId = response.data.servico_tipo_id;
|
||||
form.setValue('servico_tipo_id', novoId);
|
||||
form.setValue('servico_tipo_id', novoId); // mantém o ID atualizado
|
||||
|
||||
// Merge dos dados para preservar valores locais
|
||||
form.reset({ ...form.getValues(), ...response.data });
|
||||
|
||||
console.log(`Serviço ${isEditing ? 'atualizado' : 'criado'} com sucesso (ID: ${novoId})`);
|
||||
} else {
|
||||
console.log('Erro ao salvar o tipo de serviço.');
|
||||
|
|
@ -210,12 +299,17 @@ export default function TServicoTipoForm({
|
|||
}
|
||||
};
|
||||
|
||||
// Carrega dados ao abrir o modal
|
||||
// Carrega os dados apenas quando o modal
|
||||
// abrir e houver um registro para editar
|
||||
useEffect(() => {
|
||||
// Remove as etiquetas selecionadas
|
||||
setItensTabela([]);
|
||||
|
||||
if (isOpen && data && Number(data.servico_tipo_id ?? 0) > 0) {
|
||||
form.reset(data);
|
||||
/** Carrega os dados no formulário */
|
||||
form.reset(data); // edição
|
||||
} else if (isOpen && !data) {
|
||||
/** Reseta os campos do formulário */
|
||||
form.reset({
|
||||
servico_tipo_id: 0,
|
||||
emolumento_id: 0,
|
||||
|
|
@ -223,13 +317,13 @@ export default function TServicoTipoForm({
|
|||
descricao: '',
|
||||
maximo_pessoa: 0,
|
||||
tipo_item: '',
|
||||
frenteverso: ConfirmacaoEnum.N,
|
||||
averbacao: ConfirmacaoEnum.N,
|
||||
transferencia_veiculo: ConfirmacaoEnum.N,
|
||||
usar_a4: ConfirmacaoEnum.N,
|
||||
etiqueta_unica: ConfirmacaoEnum.N,
|
||||
situacao: SituacoesEnum.A,
|
||||
selar: ConfirmacaoEnum.N,
|
||||
frenteverso: 'N',
|
||||
averbacao: 'N',
|
||||
transferencia_veiculo: 'N',
|
||||
usar_a4: 'N',
|
||||
etiqueta_unica: 'N',
|
||||
situacao: 'A',
|
||||
selar: 'N',
|
||||
valor_emolumento: 0,
|
||||
valor_taxa_judiciaria: 0,
|
||||
fundesp_valor: 0,
|
||||
|
|
@ -402,10 +496,8 @@ export default function TServicoTipoForm({
|
|||
<FormControl>
|
||||
<Checkbox
|
||||
className="cursor-pointer"
|
||||
checked={field.value === ConfirmacaoEnum.S}
|
||||
onCheckedChange={(checked) =>
|
||||
field.onChange(checked ? ConfirmacaoEnum.S : ConfirmacaoEnum.N)
|
||||
}
|
||||
checked={field.value === 'S'} // marca quando o valor for "S"
|
||||
onCheckedChange={(checked) => field.onChange(checked ? 'S' : 'N')} // grava "S" ou "N"
|
||||
disabled={!isEnabled}
|
||||
/>
|
||||
</FormControl>
|
||||
|
|
@ -424,7 +516,9 @@ export default function TServicoTipoForm({
|
|||
control={form.control}
|
||||
name="situacao"
|
||||
render={({ field }) => {
|
||||
const isChecked = field.value === SituacoesEnum.A || !field.value;
|
||||
// Considera "A" ou vazio como marcado
|
||||
const isChecked = field.value === 'A' || !field.value;
|
||||
|
||||
return (
|
||||
<FormItem className="flex flex-row items-center space-y-0 space-x-3">
|
||||
<FormControl>
|
||||
|
|
@ -432,7 +526,7 @@ export default function TServicoTipoForm({
|
|||
className="cursor-pointer"
|
||||
checked={isChecked}
|
||||
onCheckedChange={(checked) => {
|
||||
field.onChange(checked ? SituacoesEnum.A : SituacoesEnum.I);
|
||||
field.onChange(checked ? 'A' : 'I'); // grava "A" ou "I" no form
|
||||
}}
|
||||
/>
|
||||
</FormControl>
|
||||
|
|
@ -508,9 +602,19 @@ export default function TServicoTipoForm({
|
|||
render={({ field }) => (
|
||||
<FormItem className="w-full">
|
||||
<FormLabel>Biometria</FormLabel>
|
||||
<FormControl>
|
||||
<ConfirmacaoSelect field={field} />
|
||||
</FormControl>
|
||||
<Select value={field.value} onValueChange={field.onChange}>
|
||||
<FormControl>
|
||||
<ConfirmacaoSelect field={field} />
|
||||
</FormControl>
|
||||
<SelectContent>
|
||||
<SelectItem value="S" className="cursor-pointer">
|
||||
Sim
|
||||
</SelectItem>
|
||||
<SelectItem value="N" className="cursor-pointer">
|
||||
Não
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
|
|
@ -525,9 +629,19 @@ export default function TServicoTipoForm({
|
|||
render={({ field }) => (
|
||||
<FormItem className="w-full">
|
||||
<FormLabel>CPF/CNPJ</FormLabel>
|
||||
<FormControl>
|
||||
<ConfirmacaoSelect field={field} />
|
||||
</FormControl>
|
||||
<Select value={field.value} onValueChange={field.onChange}>
|
||||
<FormControl>
|
||||
<ConfirmacaoSelect field={field} />
|
||||
</FormControl>
|
||||
<SelectContent>
|
||||
<SelectItem value="S" className="cursor-pointer">
|
||||
Sim
|
||||
</SelectItem>
|
||||
<SelectItem value="N" className="cursor-pointer">
|
||||
Não
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
|
|
@ -542,9 +656,19 @@ export default function TServicoTipoForm({
|
|||
render={({ field }) => (
|
||||
<FormItem className="w-full">
|
||||
<FormLabel>Autorização</FormLabel>
|
||||
<FormControl>
|
||||
<ConfirmacaoSelect field={field} />
|
||||
</FormControl>
|
||||
<Select value={field.value} onValueChange={field.onChange}>
|
||||
<FormControl>
|
||||
<ConfirmacaoSelect field={field} />
|
||||
</FormControl>
|
||||
<SelectContent>
|
||||
<SelectItem value="S" className="cursor-pointer">
|
||||
Sim
|
||||
</SelectItem>
|
||||
<SelectItem value="N" className="cursor-pointer">
|
||||
Não
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
|
|
@ -559,9 +683,19 @@ export default function TServicoTipoForm({
|
|||
render={({ field }) => (
|
||||
<FormItem className="w-full">
|
||||
<FormLabel>Abonador</FormLabel>
|
||||
<FormControl>
|
||||
<ConfirmacaoSelect field={field} />
|
||||
</FormControl>
|
||||
<Select value={field.value} onValueChange={field.onChange}>
|
||||
<FormControl>
|
||||
<ConfirmacaoSelect field={field} />
|
||||
</FormControl>
|
||||
<SelectContent>
|
||||
<SelectItem value="S" className="cursor-pointer">
|
||||
Sim
|
||||
</SelectItem>
|
||||
<SelectItem value="N" className="cursor-pointer">
|
||||
Não
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
|
|
@ -625,7 +759,7 @@ export default function TServicoTipoForm({
|
|||
variant="outline"
|
||||
className="w-full cursor-pointer"
|
||||
type="button"
|
||||
onClick={() => handleRemoveItem(Number(item.servico_etiqueta_id))}
|
||||
onClick={() => handleRemoveItem(item.servico_etiqueta_id)}
|
||||
>
|
||||
<Trash /> Remover
|
||||
</Button>
|
||||
|
|
@ -655,9 +789,19 @@ export default function TServicoTipoForm({
|
|||
render={({ field }) => (
|
||||
<FormItem className="w-full">
|
||||
<FormLabel>Selar</FormLabel>
|
||||
<FormControl>
|
||||
<ConfirmacaoSelect field={field} />
|
||||
</FormControl>
|
||||
<Select value={field.value} onValueChange={field.onChange}>
|
||||
<FormControl>
|
||||
<ConfirmacaoSelect field={field} />
|
||||
</FormControl>
|
||||
<SelectContent>
|
||||
<SelectItem value="S" className="cursor-pointer">
|
||||
Sim
|
||||
</SelectItem>
|
||||
<SelectItem value="N" className="cursor-pointer">
|
||||
Não
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
'use client';
|
||||
|
||||
import { Button } from '@/components/ui/button';
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuGroup,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuSeparator,
|
||||
DropdownMenuTrigger,
|
||||
} from '@/components/ui/dropdown-menu';
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
TableCell,
|
||||
TableHead,
|
||||
TableHeader,
|
||||
TableRow,
|
||||
} from '@/components/ui/table';
|
||||
|
||||
import { EllipsisIcon, PencilIcon, Trash2Icon } from 'lucide-react';
|
||||
import TServicoTipoInterface from '../../_interfaces/TServicoTipoInterface'; // Import alterado
|
||||
|
||||
// Tipagem das props do componente da tabela
|
||||
interface TServicoTipoTableProps {
|
||||
// Nome da interface alterado
|
||||
data: TServicoTipoInterface[]; // lista de tipos de serviço
|
||||
onEdit: (item: TServicoTipoInterface, isEditingFormStatus: boolean) => void; // callback para edição
|
||||
onDelete: (item: TServicoTipoInterface, isEditingFormStatus: boolean) => void; // callback para exclusão
|
||||
}
|
||||
|
||||
/**
|
||||
* Componente principal da tabela de Tipos de Serviço
|
||||
*/
|
||||
export default function TServicoTipoTable({ data, onEdit, onDelete }: TServicoTipoTableProps) {
|
||||
return (
|
||||
<Table className="w-full table-fixed">
|
||||
{/* Cabeçalho da tabela */}
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead className="w-15 font-bold">#</TableHead>
|
||||
{/* As colunas IBGE e UF foram removidas */}
|
||||
<TableHead className="font-bold">Descrição</TableHead>
|
||||
<TableHead className="text-right"></TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
|
||||
{/* Corpo da tabela */}
|
||||
<TableBody>
|
||||
{data.map((item) => (
|
||||
// Assumindo que o ID do Tipo de Serviço é 'servico_tipo_id'
|
||||
<TableRow key={item.servico_tipo_id} className="cursor-pointer">
|
||||
{/* ID do Tipo de Serviço */}
|
||||
<TableCell>{item.servico_tipo_id}</TableCell>
|
||||
|
||||
{/* Nome/descrição do Tipo de Serviço (descricao) */}
|
||||
<TableCell>{item.descricao}</TableCell>
|
||||
{/* As células de IBGE e UF foram removidas */}
|
||||
|
||||
{/* Ações (menu dropdown) */}
|
||||
<TableCell className="text-right">
|
||||
<DropdownMenu>
|
||||
{/* Botão de disparo do menu */}
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button variant="outline" size="icon" className="cursor-pointer">
|
||||
<EllipsisIcon />
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
|
||||
{/* Conteúdo do menu */}
|
||||
<DropdownMenuContent side="left" align="start">
|
||||
<DropdownMenuGroup>
|
||||
{/* Opção editar */}
|
||||
<DropdownMenuItem
|
||||
className="cursor-pointer"
|
||||
onSelect={() => onEdit(item, true)}
|
||||
>
|
||||
<PencilIcon className="mr-2 h-4 w-4" />
|
||||
Editar
|
||||
</DropdownMenuItem>
|
||||
|
||||
<DropdownMenuSeparator />
|
||||
|
||||
{/* Opção remover */}
|
||||
<DropdownMenuItem
|
||||
className="cursor-pointer"
|
||||
onSelect={() => onDelete(item, true)}
|
||||
>
|
||||
<Trash2Icon className="mr-2 h-4 w-4" />
|
||||
Remover
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuGroup>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
</TableBody>
|
||||
</Table>
|
||||
);
|
||||
}
|
||||
|
|
@ -6,8 +6,7 @@ import API from '@/shared/services/api/Api';
|
|||
|
||||
// Importa o enum que define os métodos HTTP disponíveis (GET, POST, PUT, DELETE, etc.)
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
|
||||
import { CCaixaServicoReadInterface } from '@/packages/administrativo/hooks/CCaixaServico/CCaixaServicoReadInterface';
|
||||
import { CCaixaServicoReadInterface } from '../../_interfaces/CCaixaServicoReadInterface';
|
||||
|
||||
// Função assíncrona responsável por executar a requisição para listar os tipos de marcação
|
||||
async function executeCCaixaServicoIndexData(data: CCaixaServicoReadInterface) {
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
// Importa o utilitário responsável por tratar erros de forma padronizada no cliente
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
// Importa a classe de serviço que gerencia requisições HTTP para a API
|
||||
import API from '@/shared/services/api/Api';
|
||||
|
||||
// Importa o enum que define os métodos HTTP disponíveis (GET, POST, PUT, DELETE, etc.)
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
|
||||
import { GEmolumentoReadInterface } from '../../_interfaces/GEmolumentoReadInterface';
|
||||
|
||||
// Função assíncrona responsável por executar a requisição para listar os tipos de marcação
|
||||
async function executeGEmolumentoIndexData(data: GEmolumentoReadInterface) {
|
||||
|
||||
// Cria uma nova instância da classe API para enviar a requisição
|
||||
const api = new API();
|
||||
|
||||
// Envia uma requisição GET para o endpoint 'administrativo/g_marcacao_tipo/'
|
||||
return await api.send({
|
||||
method: Methods.GET,
|
||||
endpoint: `administrativo/g_emolumento/sistema/${data.sistema_id}?${new URLSearchParams(data.urlParams).toString()}`,
|
||||
});
|
||||
}
|
||||
|
||||
// Exporta a função encapsulada pelo handler de erro, garantindo tratamento uniforme em caso de falhas
|
||||
export const GEmolumentoIndexData = withClientErrorHandler(executeGEmolumentoIndexData);
|
||||
|
|
@ -6,8 +6,7 @@ import API from '@/shared/services/api/Api';
|
|||
|
||||
// Importa o enum que define os métodos HTTP disponíveis (GET, POST, PUT, DELETE, etc.)
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
|
||||
import { GEmolumentoItemReadInterface } from '@/packages/administrativo/interfaces/GEmolumentoItem/GEmolumentoItemReadInterface';
|
||||
import { GEmolumentoItemReadInterface } from '../../_interfaces/GEmolumentoItemReadInterface';
|
||||
|
||||
// Função assíncrona responsável por executar a requisição para listar os tipos de marcação
|
||||
async function executeGEmolumentoItemValorData(data: GEmolumentoItemReadInterface) {
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
// Importa o utilitário responsável por tratar erros de forma padronizada no cliente
|
||||
import { buildQueryString } from '@/shared/actions/api/buildQueryString';
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
// Importa a classe de serviço que gerencia requisições HTTP para a API
|
||||
|
|
@ -7,10 +6,10 @@ import API from '@/shared/services/api/Api';
|
|||
|
||||
// Importa o enum que define os métodos HTTP disponíveis (GET, POST, PUT, DELETE, etc.)
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
|
||||
import { GMarcacaoTipoReadInterface } from '@/packages/administrativo/interfaces/GMarcacaoTipo/GMarcacaoTipoReadInterface';
|
||||
import { GMarcacaoTipoReadInterface } from '../../_interfaces/GMarcacaoTipoReadInterface';
|
||||
|
||||
// Importa a função genérica que monta a query string dinamicamente
|
||||
import { buildQueryString } from '@/shared/actions/api/buildQueryString';
|
||||
|
||||
// Função assíncrona responsável por executar a requisição para listar os tipos de marcação
|
||||
async function executeGMarcacaoTipoIndexData(data: GMarcacaoTipoReadInterface) {
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
// Importa o serviço de API que será utilizado para realizar requisições HTTP
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler'; //
|
||||
import API from '@/shared/services/api/Api'; //
|
||||
|
||||
// Importa o enum que contém os métodos HTTP disponíveis (GET, POST, PUT, DELETE)
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum'; //
|
||||
|
||||
// Importa a interface tipada que define a estrutura dos dados do tipo de serviço
|
||||
import { TServicoEtiquetaInterface } from '@/packages/administrativo/interfaces/TServicoEtiqueta/TServicoEtiquetaInterface';
|
||||
import { TServicoEtiquetaInterface } from '../../_interfaces/TServicoEtiquetaInterface';
|
||||
|
||||
// Importa função que encapsula chamadas assíncronas e trata erros automaticamente
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler'; //
|
||||
|
||||
// Função assíncrona que implementa a lógica de localizar um tipo de serviço
|
||||
async function executeTServicoEtiquetaService(data: TServicoEtiquetaInterface) {
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
// Importa o serviço de API que será utilizado para realizar requisições HTTP
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler'; //
|
||||
import API from '@/shared/services/api/Api'; //
|
||||
|
||||
// Importa o enum que contém os métodos HTTP disponíveis (GET, POST, PUT, DELETE)
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum'; //
|
||||
|
||||
// Importa a interface tipada que define a estrutura dos dados do tipo de serviço
|
||||
import { TServicoEtiquetaInterface } from '@/packages/administrativo/interfaces/TServicoEtiqueta/TServicoEtiquetaInterface'; // Alterado de GCidadeInterface
|
||||
import { TServicoEtiquetaInterface } from '../../_interfaces/TServicoEtiquetaInterface'; // Alterado de GCidadeInterface
|
||||
|
||||
// Importa função que encapsula chamadas assíncronas e trata erros automaticamente
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler'; //
|
||||
|
||||
// Função assíncrona que implementa a lógica de remover um tipo de serviço
|
||||
async function executeTServicoEtiquetaRemoveData(data: TServicoEtiquetaInterface) {
|
||||
|
|
@ -1,17 +1,17 @@
|
|||
// Importa o serviço de API que será utilizado para realizar requisições HTTP
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler'; //
|
||||
import API from '@/shared/services/api/Api'; //
|
||||
|
||||
// Importa o esquema de validação de dados para tipos de serviço
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum'; //
|
||||
|
||||
import { TServicoEtiquetaFormValues } from '@/packages/administrativo/schemas/TServicoEtiqueta/TServicoEtiquetaSchema';
|
||||
import { TServicoEtiquetaFormValues } from '../../_schemas/TServicoEtiquetaSchema';
|
||||
|
||||
// Importa o enum que contém os métodos HTTP disponíveis (GET, POST, PUT, DELETE)
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum'; //
|
||||
|
||||
// Importa a interface tipada que define a estrutura dos dados do tipo de serviço
|
||||
import { TServicoEtiquetaInterface } from '../../_interfaces/TServicoEtiquetaInterface'; // Interface alterada
|
||||
|
||||
// Importa função que encapsula chamadas assíncronas e trata erros automaticamente
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler'; //
|
||||
|
||||
// Função assíncrona que implementa a lógica de salvar (criar/atualizar) um tipo de serviço
|
||||
async function executeTServicoEtiquetaSaveData(data: TServicoEtiquetaFormValues) {
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
// Importa o utilitário responsável por tratar erros de forma padronizada no cliente
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
// Importa a classe de serviço que gerencia requisições HTTP para a API
|
||||
import API from '@/shared/services/api/Api';
|
||||
|
||||
// Importa o enum que define os métodos HTTP disponíveis (GET, POST, PUT, DELETE, etc.)
|
||||
import { Methods } from '@/shared/services/api/enums/ApiMethodEnum';
|
||||
import { TTBReconhecimentoTipoReadInterface } from '../../_interfaces/TTBReconhecimentoTipoReadInterface';
|
||||
|
||||
// Função assíncrona responsável por executar a requisição para listar os tipos de marcação
|
||||
async function executeTTBReconhecimentoTipoIndexData(data: TTBReconhecimentoTipoReadInterface) {
|
||||
// Cria uma nova instância da classe API para enviar a requisição
|
||||
const api = new API();
|
||||
|
||||
// Concatena o endpoint com a query string (caso existam parâmetros)
|
||||
const endpoint = `administrativo/t_tb_reconhecimentotipo/`;
|
||||
|
||||
// Envia uma requisição GET para o endpoint 'administrativo/g_marcacao_tipo/'
|
||||
return await api.send({
|
||||
method: Methods.GET,
|
||||
endpoint: endpoint,
|
||||
});
|
||||
}
|
||||
|
||||
// Exporta a função encapsulada pelo handler de erro, garantindo tratamento uniforme em caso de falhas
|
||||
export const TTBReconhecimentoTipoIndexData = withClientErrorHandler(
|
||||
executeTTBReconhecimentoTipoIndexData,
|
||||
);
|
||||
|
|
@ -1,16 +1,15 @@
|
|||
// Importa o hook responsável por gerenciar e exibir respostas globais (sucesso, erro, etc.)
|
||||
import { useMemo, useState } from 'react';
|
||||
|
||||
import { useResponse } from '@/shared/components/response/ResponseContext';
|
||||
|
||||
// Importa hooks do React para gerenciamento de estado e memorização de valores
|
||||
import { useMemo, useState } from 'react';
|
||||
|
||||
// Importa a interface que define a estrutura dos dados de "CCaixaServico"
|
||||
import { CCaixaServicoInterface } from '@/packages/administrativo/hooks/CCaixaServico/CCaixaServicoInterface';
|
||||
import { CCaixaServicoReadInterface } from '@/packages/administrativo/hooks/CCaixaServico/CCaixaServicoReadInterface';
|
||||
import { CCaixaServicoReadInterface } from '../../_interfaces/CCaixaServicoReadInterface';
|
||||
|
||||
// Importa o serviço responsável por buscar os dados de "CCaixaServico" na API
|
||||
import { CCaixaServicoIndexService } from '@/packages/administrativo/services/CCaixaServico/CCaixaServicoIndexService';
|
||||
import { CCaixaServicoIndexService } from '../../_services/c_caixa_servico/CCaixaServicoIndexService';
|
||||
import { CCaixaServicoInterface } from '../../_interfaces/CCaixaServicoInterface';
|
||||
|
||||
// Hook personalizado para leitura (consulta) dos tipos de marcação
|
||||
export const useCCaixaServicoReadHook = () => {
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
// Importa o hook responsável por gerenciar e exibir respostas globais (sucesso, erro, etc.)
|
||||
import { useMemo, useState } from 'react';
|
||||
|
||||
import { useResponse } from '@/shared/components/response/ResponseContext';
|
||||
|
||||
// Importa hooks do React para gerenciamento de estado e memorização de valores
|
||||
|
||||
// Importa a interface que define a estrutura dos dados de "GEmolumento"
|
||||
import { GEmolumentoInterface } from '../../_interfaces/GEmolumentoInterface';
|
||||
import { GEmolumentoReadInterface } from '../../_interfaces/GEmolumentoReadInterface';
|
||||
|
||||
// Importa o serviço responsável por buscar os dados de "GEmolumento" na API
|
||||
import { GEmolumentoIndexService } from '../../_services/g_emolumento/GEmolumentoIndexService';
|
||||
|
||||
// Hook personalizado para leitura (consulta) dos emolumentos
|
||||
export const useGEmolumentoReadHook = () => {
|
||||
// Obtém a função que atualiza a resposta global do sistema
|
||||
const { setResponse } = useResponse();
|
||||
|
||||
// Define o estado local que armazenará a lista de emolumentos
|
||||
const [gEmolumento, setGEmolumento] = useState<GEmolumentoInterface[]>([]);
|
||||
|
||||
// Função responsável por buscar os dados da API e atualizar o estado
|
||||
const fetchGEmolumento = async (data: GEmolumentoReadInterface) => {
|
||||
// Executa o serviço que faz a requisição à API
|
||||
const response = await GEmolumentoIndexService(data);
|
||||
|
||||
// Atualiza o estado local com os dados retornados
|
||||
setGEmolumento(response.data);
|
||||
|
||||
// Atualiza o contexto global de resposta (ex: para exibir alertas ou mensagens)
|
||||
setResponse(response);
|
||||
};
|
||||
|
||||
// Retorna os dados e a função de busca, memorizando o valor para evitar recriações desnecessárias
|
||||
return useMemo(() => ({ gEmolumento, fetchGEmolumento }), [gEmolumento, fetchGEmolumento]);
|
||||
};
|
||||
|
|
@ -1,11 +1,17 @@
|
|||
// Importa o hook responsável por gerenciar e exibir respostas globais (sucesso, erro, etc.)
|
||||
import { useMemo, useState } from 'react';
|
||||
|
||||
import GEmolumentoItemInterface from '@/packages/administrativo/interfaces/GEmolumentoItem/GEmolumentoItemInterface';
|
||||
import { GEmolumentoItemReadInterface } from '@/packages/administrativo/interfaces/GEmolumentoItem/GEmolumentoItemReadInterface';
|
||||
import { GEmolumentoItemValorService } from '@/packages/administrativo/services/GEmolumentoItem/GEmolumentoItemValorService';
|
||||
import { useResponse } from '@/shared/components/response/ResponseContext';
|
||||
|
||||
// Importa hooks do React para gerenciamento de estado e memorização de valores
|
||||
|
||||
// Importa a interface que define a estrutura dos dados de "gEmolumentoItem"
|
||||
import { GEmolumentoItemInterface } from '../../_interfaces/GEmolumentoItemInterface';
|
||||
import { GEmolumentoItemReadInterface } from '../../_interfaces/GEmolumentoItemReadInterface';
|
||||
|
||||
// Importa o serviço responsável por buscar os dados de "GEmolumentoItem" na API
|
||||
import { GEmolumentoItemValorService } from '../../_services/g_emolumento_item/GEmolumentoItemValorService';
|
||||
|
||||
// Hook personalizado para leitura (consulta) dos emolumentos
|
||||
export const useGEmolumentoItemReadHook = () => {
|
||||
const { setResponse } = useResponse();
|
||||
|
|
@ -1,16 +1,15 @@
|
|||
// Importa o hook responsável por gerenciar e exibir respostas globais (sucesso, erro, etc.)
|
||||
import { useMemo, useState } from 'react';
|
||||
|
||||
import { useResponse } from '@/shared/components/response/ResponseContext';
|
||||
|
||||
// Importa hooks do React para gerenciamento de estado e memorização de valores
|
||||
import { useMemo, useState } from 'react';
|
||||
|
||||
// Importa a interface que define a estrutura dos dados de "GMarcacaoTipo"
|
||||
import { GMarcacaoTipoInterface } from '@/packages/administrativo/interfaces/GMarcacaoTipo/GMarcacaoTipoInterface';
|
||||
import { GMarcacaoTipoReadInterface } from '@/packages/administrativo/interfaces/GMarcacaoTipo/GMarcacaoTipoReadInterface';
|
||||
import { GMarcacaoTipoReadInterface } from '../../_interfaces/GMarcacaoTipoReadInterface';
|
||||
import { GMarcacaoTipoInterface } from '../../_interfaces/GMarcacaoTipoInterface';
|
||||
|
||||
// Importa o serviço responsável por buscar os dados de "GMarcacaoTipo" na API
|
||||
import { GMarcacaoTipoIndexService } from '@/packages/administrativo/services/GMarcacaoTipo/GMarcacaoTipoIndexService';
|
||||
import { GMarcacaoTipoIndexService } from '../../_services/g_marcacao_tipo/GMarcacaoTipoIndexService';
|
||||
|
||||
// Hook personalizado para leitura (consulta) dos tipos de marcação
|
||||
export const useGMarcacaoTipoReadHook = () => {
|
||||
|
|
@ -1,15 +1,14 @@
|
|||
// Importa o hook responsável por gerenciar e exibir respostas globais (sucesso, erro, etc.)
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
import { useResponse } from '@/shared/components/response/ResponseContext';
|
||||
|
||||
// Importa hooks do React para gerenciamento de estado e memorização de valores
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
// Importa a interface que define a estrutura dos dados de "TServicoEtiqueta"
|
||||
import { TServicoEtiquetaInterface } from '@/packages/administrativo/interfaces/TServicoEtiqueta/TServicoEtiquetaInterface';
|
||||
import { TServicoEtiquetaInterface } from '../../_interfaces/TServicoEtiquetaInterface';
|
||||
|
||||
// Importa o serviço responsável por buscar os dados de "TServicoEtiqueta" na API
|
||||
import { TServicoEtiquetaServicoIdService } from '@/packages/administrativo/services/TServicoEtiqueta/TServicoEtiquetaServicoIdService';
|
||||
import { TServicoEtiquetaServicoIdService } from '../../_services/t_servico_etiqueta/TServicoEtiquetaServicoIdService';
|
||||
|
||||
// Hook personalizado para leitura (consulta) dos tipos de marcação
|
||||
export const useTServicoEtiquetaReadHook = () => {
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
import { useResponse } from '@/shared/components/response/ResponseContext'; // Contexto global para gerenciar respostas da API
|
||||
|
||||
// Interface tipada do tipo de serviço
|
||||
import { TServicoEtiquetaRemoveData } from '@/packages/administrativo/data/TServicoEtiqueta/TServicoEtiquetaRemoveData';
|
||||
import { TServicoEtiquetaInterface } from '@/packages/administrativo/interfaces/TServicoEtiqueta/TServicoEtiquetaInterface';
|
||||
import { TServicoEtiquetaInterface } from '../../_interfaces/TServicoEtiquetaInterface';
|
||||
|
||||
// Função que remove o tipo de serviço via API
|
||||
import { TServicoEtiquetaRemoveData } from '../../_data/TServicoEtiqueta/TServicoEtiquetaRemoveData';
|
||||
|
||||
// Hook customizado para remoção de tipos de serviço
|
||||
export const useTServicoEtiquetaRemoveHook = () => {
|
||||
|
|
@ -1,12 +1,11 @@
|
|||
import { useState } from 'react';
|
||||
|
||||
import { useResponse } from '@/shared/components/response/ResponseContext';
|
||||
|
||||
// Interface tipada do serviço etiqueta
|
||||
import { TServicoEtiquetaInterface } from '@/packages/administrativo/interfaces/TServicoEtiqueta/TServicoEtiquetaInterface';
|
||||
import { TServicoEtiquetaInterface } from '../../_interfaces/TServicoEtiquetaInterface';
|
||||
|
||||
// Serviço que salva os dados do serviço etiqueta
|
||||
import { TServicoEtiquetaSaveService } from '@/packages/administrativo/services/TServicoEtiqueta/TServicoEtiquetaSaveService';
|
||||
import { TServicoEtiquetaSaveService } from '../../_services/t_servico_etiqueta/TServicoEtiquetaSaveService';
|
||||
|
||||
export const useTServicoEtiquetaSaveHook = () => {
|
||||
const { setResponse } = useResponse();
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
// Importa o hook responsável por gerenciar e exibir respostas globais (sucesso, erro, etc.)
|
||||
import { useResponse } from '@/shared/components/response/ResponseContext';
|
||||
|
||||
// Importa hooks do React para gerenciamento de estado e memorização de valores
|
||||
import { useMemo, useState } from 'react';
|
||||
|
||||
// Importa a interface que define a estrutura dos dados de "TTBReconhecimentoTipo"
|
||||
import { TTBReconhecimentoTipoReadInterface } from '../../_interfaces/TTBReconhecimentoTipoReadInterface';
|
||||
import { TTBReconhecimentoTipoInterface } from '../../_interfaces/TTBReconhecimentoTipoInterface';
|
||||
|
||||
// Importa o serviço responsável por buscar os dados de "TTBReconhecimentoTipo" na API
|
||||
import { TTBReconhecimentoTipoIndexService } from '../../_services/t_tb_reconhecimentotipo/TTBReconhecimentoTipoIndexService';
|
||||
|
||||
// Hook personalizado para leitura (consulta) dos tipos de marcação
|
||||
export const useTTBReconhecimentoTipoReadHook = () => {
|
||||
// Obtém a função que atualiza a resposta global do sistema
|
||||
const { setResponse } = useResponse();
|
||||
|
||||
// Define o estado local que armazenará a lista de tipos de marcação
|
||||
const [tTBReconhecimentoTipo, setTTBReconhecimentoTipo] = useState<
|
||||
TTBReconhecimentoTipoInterface[]
|
||||
>([]);
|
||||
|
||||
// Função responsável por buscar os dados da API e atualizar o estado
|
||||
const fetchTTBReconhecimentoTipo = async (data: TTBReconhecimentoTipoReadInterface) => {
|
||||
// Executa o serviço que faz a requisição à API
|
||||
const response = await TTBReconhecimentoTipoIndexService(data);
|
||||
|
||||
// Atualiza o estado local com os dados retornados
|
||||
setTTBReconhecimentoTipo(response.data);
|
||||
|
||||
// Atualiza o contexto global de resposta (ex: para exibir alertas ou mensagens)
|
||||
setResponse(response);
|
||||
};
|
||||
|
||||
// Retorna os dados e a função de busca, memorizando o valor para evitar recriações desnecessárias
|
||||
return useMemo(
|
||||
() => ({ tTBReconhecimentoTipo, fetchTTBReconhecimentoTipo }),
|
||||
[tTBReconhecimentoTipo, fetchTTBReconhecimentoTipo],
|
||||
);
|
||||
};
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
// Interface que representa a tabela G_EMOLUMENTO
|
||||
export interface GEmolumentoInterface {
|
||||
emolumento_id?: number; // NUMERIC(10,2) - Chave primária
|
||||
descricao?: string; // VARCHAR(260)
|
||||
tipo?: string; // VARCHAR(1)
|
||||
sistema_id?: number; // NUMERIC(10,2)
|
||||
selo_grupo_id?: number; // NUMERIC(10,2)
|
||||
reg_averb?: string; // VARCHAR(1)
|
||||
pre_definido?: string; // VARCHAR(1)
|
||||
situacao?: string; // VARCHAR(1)
|
||||
situacao_ri?: string; // VARCHAR(1)
|
||||
com_reducao?: string; // VARCHAR(1)
|
||||
motivo_reducao?: string; // VARCHAR(120)
|
||||
valor_maximo_certidao?: number; // NUMERIC(14,3)
|
||||
tipo_objetivo?: string; // VARCHAR(3)
|
||||
modelo_tag?: string; // VARCHAR(3)
|
||||
codigo_nota_id?: number; // NUMERIC(10,2)
|
||||
convenio_codhab?: string; // VARCHAR(1)
|
||||
item_df?: string; // VARCHAR(10)
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
// Interface que representa a tabela G_EMOLUMENTO_ITEM (inferido)
|
||||
export interface GEmolumentoItemInterface {
|
||||
valor_emolumento?: number; // NUMERIC(14,3)
|
||||
emolumento_item_id: number; // NUMERIC(10,2) NOT NULL - Chave primária (assumida)
|
||||
emolumento_id?: number; // NUMERIC(10,2)
|
||||
valor_inicio?: number; // NUMERIC(14,3)
|
||||
valor_fim?: number; // NUMERIC(14,3)
|
||||
valor_taxa_judiciaria?: number; // NUMERIC(14,3)
|
||||
emolumento_periodo_id?: number; // NUMERIC(10,2)
|
||||
codigo?: number; // NUMERIC(10,2)
|
||||
pagina_extra?: number; // NUMERIC(10,2)
|
||||
valor_pagina_extra?: number; // NUMERIC(14,3)
|
||||
valor_outra_taxa1?: number; // NUMERIC(14,3)
|
||||
codigo_selo?: string; // VARCHAR(30)
|
||||
valor_fundo_ri?: number; // NUMERIC(14,3)
|
||||
codigo_tabela?: string; // VARCHAR(30)
|
||||
selo_grupo_id?: number; // NUMERIC(10,2)
|
||||
codigo_km?: string; // VARCHAR(30)
|
||||
emolumento_acresce?: number; // NUMERIC(14,3)
|
||||
taxa_acresce?: number; // NUMERIC(14,3)
|
||||
funcivil_acresce?: number; // NUMERIC(14,3)
|
||||
valor_fracao?: number; // NUMERIC(14,3)
|
||||
valor_por_excedente_emol?: number; // NUMERIC(14,3)
|
||||
valor_por_excedente_tj?: number; // NUMERIC(14,3)
|
||||
valor_por_excedente_fundo?: number; // NUMERIC(14,3)
|
||||
valor_limite_excedente_emol?: number; // NUMERIC(14,3)
|
||||
valor_limite_excedente_tj?: number; // NUMERIC(14,3)
|
||||
valor_limite_excedente_fundo?: number; // NUMERIC(14,3)
|
||||
fundo_selo?: number; // NUMERIC(14,3)
|
||||
distribuicao?: number; // NUMERIC(14,3)
|
||||
vrc_ext?: number; // NUMERIC(10,2) - Renomeado de VRCEXT para vrc_ext (convenção)
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
export interface GEmolumentoReadInterface {
|
||||
sistema_id?: number;
|
||||
urlParams?: Record<string, string>;
|
||||
urlParams?: object
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
export default interface TServicoTipoInterface {
|
||||
servico_tipo_id?: number; // SERVICO_TIPO_ID NUMERIC(10,2) NOT NULL (PK)
|
||||
descricao: string; // DESCRICAO VARCHAR(60)
|
||||
valor?: number; // VALOR NUMERIC(14,3)
|
||||
tipo_item?: string;
|
||||
requer_autorizacao?: string; // REQUER_AUTORIZACAO VARCHAR(1)
|
||||
requer_biometria?: string; // REQUER_BIOMETRIA VARCHAR(1)
|
||||
tipo_pessoa?: string; // TIPO_PESSOA VARCHAR(1)
|
||||
tb_reconhecimentotipo_id?: number; // TB_RECONHECIMENTOTIPO_ID NUMERIC(10,2) (FK)
|
||||
requer_abonador?: string; // REQUER_ABONADOR VARCHAR(1)
|
||||
situacao?: string; // SITUACAO VARCHAR(1)
|
||||
requer_cpf?: string; // REQUER_CPF VARCHAR(1)
|
||||
servico_padrao?: string; // SERVICO_PADRAO VARCHAR(1)
|
||||
maximo_pessoa?: number; // MAXIMO_PESSOA NUMERIC(10,2)
|
||||
alterar_valor?: string; // ALTERAR_VALOR VARCHAR(1)
|
||||
servico_caixa_id?: number; // SERVICO_CAIXA_ID NUMERIC(10,2)
|
||||
caixa_servico_id?: number; // LIBERAR_DESCONTO VARCHAR(1)
|
||||
valor_fixo?: string; // VALOR_FIXO VARCHAR(1)
|
||||
emolumento_id?: number; // EMOLUMENTO_ID NUMERIC(10,2) (FK)
|
||||
emolumento_obrigatorio?: number; // EMOLUMENTO_OBRIGATORIO NUMERIC(10,2) (FK)
|
||||
ato_praticado?: string; // ATO_PRATICADO VARCHAR(1)
|
||||
selar?: string; // SELAR VARCHAR(1)
|
||||
frenteverso?: string; // FRENTEVERSO VARCHAR(1)
|
||||
etiqueta_unica?: string; // ETIQUETA_UNICA VARCHAR(1)
|
||||
transferencia_veiculo?: string; // TRANSFERENCIA_VEICULO VARCHAR(1)
|
||||
usar_a4?: string; // USAR_A4 VARCHAR(1)
|
||||
averbacao?: string; // AVERBACAO VARCHAR(1)
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
// Interface que representa a tabela T_TB_RECONHECIMENTOTIPO
|
||||
export interface TTbReconhecimentoTipoInterface {
|
||||
tb_reconhecimentotipo_id: number; // NUMERIC(10,2) NOT NULL - Chave primária
|
||||
descricao?: string; // VARCHAR(30)
|
||||
situacao?: string; // VARCHAR(1)
|
||||
}
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
export interface TTBReconhecimentoTipoReadInterface {
|
||||
tb_reconhecimentotipo_id?: number;
|
||||
descricao?: string;
|
||||
urlParams?: Record<string, string>;
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
import z from 'zod';
|
||||
|
||||
/**
|
||||
* Tipos utilitários para campos simples
|
||||
*/
|
||||
const SN = z.enum(['S', 'N']).default('N'); // Campos do tipo Sim/Não
|
||||
const AI = z.enum(['A', 'I']).default('A'); // Situação Ativo/Inativo
|
||||
const OneCharString = z.string().max(1, 'Deve ter no máximo 1 caractere').optional();
|
||||
const RequiredString = z.string().min(1, 'O campo é obrigatório');
|
||||
const OptionalNumber = z.number().optional();
|
||||
const RequiredNumber = z.number();
|
||||
|
||||
/**
|
||||
* Schema principal baseado na DDL e adaptado ao formulário React
|
||||
*/
|
||||
export const TServicoTipoSchema = z.object({
|
||||
// Identificador
|
||||
servico_tipo_id: RequiredNumber.describe('ID do Tipo de Serviço').optional(),
|
||||
|
||||
// Campos principais
|
||||
descricao: z.string().max(60, 'A descrição deve ter no máximo 60 caracteres').optional(),
|
||||
categoria: z.string().optional(),
|
||||
|
||||
// Controle de flags (S/N)
|
||||
frenteverso: SN.optional(),
|
||||
averbacao: SN.optional(),
|
||||
transferencia_veiculo: SN.optional(),
|
||||
usar_a4: SN.optional(),
|
||||
etiqueta_unica: SN.optional(),
|
||||
selar: SN.optional(),
|
||||
servico_padrao: SN.optional(),
|
||||
// lancar_taxa: SN.optional(),
|
||||
// lancar_fundesp: SN.optional(),
|
||||
// liberar_desconto: SN.optional(),
|
||||
// fundesp_automatica: SN.optional(),
|
||||
// lancar_valor_documento: SN.optional(),
|
||||
valor_fixo: SN.optional(),
|
||||
ato_praticado: SN.optional(),
|
||||
// apresentante_selo: SN.optional(),
|
||||
// renovacao_cartao: SN.optional(),
|
||||
|
||||
// Situação
|
||||
situacao: AI,
|
||||
|
||||
// Campos numéricos
|
||||
valor: OptionalNumber,
|
||||
maximo_pessoa: OptionalNumber,
|
||||
servico_caixa_id: OptionalNumber,
|
||||
emolumento_id: z.number().nullable(),
|
||||
emolumento_obrigatorio: z.number().nullable(),
|
||||
|
||||
// Relacionamentos e permissões
|
||||
tipo_item: OneCharString,
|
||||
requer_autorizacao: OneCharString,
|
||||
requer_biometria: OneCharString,
|
||||
tipo_pessoa: OneCharString,
|
||||
tb_reconhecimentotipo_id: OptionalNumber,
|
||||
// tipo_permissao_cpf: OneCharString,
|
||||
requer_abonador: OneCharString,
|
||||
// requer_representante: OneCharString,
|
||||
requer_cpf: OneCharString,
|
||||
// alterar_valor: OneCharString,
|
||||
// pagina_acrescida: OneCharString,
|
||||
|
||||
// Campos auxiliares usados apenas no formulário (não persistidos)
|
||||
valor_emolumento: z.number().optional(),
|
||||
valor_taxa_judiciaria: z.number().optional(),
|
||||
fundesp_valor: z.number().optional(),
|
||||
valor_total: z.number().optional(),
|
||||
etiquetas_carimbos: z.any().optional(),
|
||||
emolumento: z.any().optional(),
|
||||
emolumento_auxiliar: z.any().optional(),
|
||||
});
|
||||
|
||||
/**
|
||||
* Tipo inferido do schema — usado diretamente no useForm
|
||||
*/
|
||||
export type TServicoTipoFormValues = z.infer<typeof TServicoTipoSchema>;
|
||||
|
|
@ -1,11 +1,9 @@
|
|||
// Importa o utilitário responsável por lidar com erros de forma padronizada no cliente
|
||||
'use server';
|
||||
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
// Importa a função que realiza a requisição de listagem dos tipos de marcação
|
||||
import { CCaixaServicoIndexData } from '@/packages/administrativo/data/CCaixaServico/CCaixaServicoIndexData';
|
||||
import { CCaixaServicoReadInterface } from '@/packages/administrativo/hooks/CCaixaServico/CCaixaServicoReadInterface';
|
||||
import { CCaixaServicoIndexData } from '../../_data/CCaixaServico/CCaixaServicoIndexData';
|
||||
import { CCaixaServicoReadInterface } from '../../_interfaces/CCaixaServicoReadInterface';
|
||||
|
||||
// Função assíncrona responsável por executar o serviço de listagem de tipos de marcação
|
||||
async function executeCCaixaServicoIndexService(data: CCaixaServicoReadInterface) {
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
// Importa o utilitário responsável por lidar com erros de forma padronizada no cliente
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
// Importa a função que realiza a requisição de listagem dos tipos de marcação
|
||||
import { GEmolumentoIndexData } from '../../_data/GEmolumento/GEmolumentoIndexData';
|
||||
import { GEmolumentoReadInterface } from '../../_interfaces/GEmolumentoReadInterface';
|
||||
|
||||
// Função assíncrona responsável por executar o serviço de listagem de tipos de marcação
|
||||
async function executeGEmolumentoIndexService(data: GEmolumentoReadInterface) {
|
||||
|
||||
// Chama a função que realiza a requisição à API e aguarda a resposta
|
||||
const response = await GEmolumentoIndexData(data);
|
||||
|
||||
// Retorna a resposta obtida da requisição
|
||||
return response;
|
||||
}
|
||||
|
||||
// Exporta o serviço encapsulado pelo handler de erro, garantindo tratamento uniforme em caso de falhas
|
||||
export const GEmolumentoIndexService = withClientErrorHandler(executeGEmolumentoIndexService);
|
||||
|
|
@ -1,11 +1,9 @@
|
|||
// Importa o utilitário responsável por lidar com erros de forma padronizada no cliente
|
||||
'use server';
|
||||
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
// Importa a função que realiza a requisição de listagem dos tipos de marcação
|
||||
import { GEmolumentoItemValorData } from '@/packages/administrativo/data/GEmolumentoItem/GEmolumentoItemValorData';
|
||||
import { GEmolumentoItemReadInterface } from '@/packages/administrativo/interfaces/GEmolumentoItem/GEmolumentoItemReadInterface';
|
||||
import { GEmolumentoItemValorData } from '../../_data/GEmolumentoItem/GEmolumentoItemValorData';
|
||||
import { GEmolumentoItemReadInterface } from '../../_interfaces/GEmolumentoItemReadInterface';
|
||||
|
||||
// Função assíncrona responsável por executar o serviço de listagem de tipos de marcação
|
||||
async function executeGEmolumentoItemValorService(data: GEmolumentoItemReadInterface) {
|
||||
|
|
@ -1,11 +1,9 @@
|
|||
// Importa o utilitário responsável por lidar com erros de forma padronizada no cliente
|
||||
'use server';
|
||||
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
// Importa a função que realiza a requisição de listagem dos tipos de marcação
|
||||
import { GMarcacaoTipoIndexData } from '@/packages/administrativo/data/GMarcacaoTipo/GMarcacaoTipoIndexData';
|
||||
import { GMarcacaoTipoReadInterface } from '@/packages/administrativo/interfaces/GMarcacaoTipo/GMarcacaoTipoReadInterface';
|
||||
import { GMarcacaoTipoIndexData } from '../../_data/GMarcacaoTipo/GMarcacaoTipoIndexData';
|
||||
import { GMarcacaoTipoReadInterface } from '../../_interfaces/GMarcacaoTipoReadInterface';
|
||||
|
||||
// Função assíncrona responsável por executar o serviço de listagem de tipos de marcação
|
||||
async function executeGMarcacaoTipoIndexService(data: GMarcacaoTipoReadInterface) {
|
||||
|
|
@ -1,13 +1,11 @@
|
|||
// Função que envolve qualquer ação assíncrona para capturar e tratar erros do cliente
|
||||
'use server';
|
||||
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
// Função que salva os dados do serviço etiqueta via API (ou mock)
|
||||
import { TServicoEtiquetaSaveData } from '@/packages/administrativo/data/TServicoEtiqueta/TServicoEtiquetaSaveData';
|
||||
import { TServicoEtiquetaSaveData } from '../../_data/TServicoEtiqueta/TServicoEtiquetaSaveData';
|
||||
|
||||
// Interface tipada do serviço etiqueta
|
||||
import { TServicoEtiquetaInterface } from '@/packages/administrativo/interfaces/TServicoEtiqueta/TServicoEtiquetaInterface';
|
||||
import { TServicoEtiquetaInterface } from '../../_interfaces/TServicoEtiquetaInterface';
|
||||
|
||||
// Função assíncrona que executa o salvamento de um serviço etiqueta
|
||||
async function executeTServicoEtiquetaSaveService(data: TServicoEtiquetaInterface) {
|
||||
|
|
@ -1,10 +1,9 @@
|
|||
'use server';
|
||||
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
// Função que envolve qualquer ação assíncrona para capturar e tratar erros do cliente
|
||||
|
||||
import { TServicoEtiquetaReadData } from '@/packages/administrativo/data/TServicoEtiqueta/TServicoEtiquetaReadData';
|
||||
import { TServicoEtiquetaInterface } from '@/packages/administrativo/interfaces/TServicoEtiqueta/TServicoEtiquetaInterface';
|
||||
import { TServicoEtiquetaReadData } from '../../_data/TServicoEtiqueta/TServicoEtiquetaReadData';
|
||||
|
||||
import { TServicoEtiquetaInterface } from '../../_interfaces/TServicoEtiquetaInterface';
|
||||
// Interface tipada do tipo de serviço
|
||||
|
||||
// Função assíncrona que executa a consulta de um tipo de serviço etiqueta
|
||||
|
|
@ -1,14 +1,12 @@
|
|||
// Importa o utilitário responsável por lidar com erros de forma padronizada no cliente
|
||||
'use server';
|
||||
|
||||
import { withClientErrorHandler } from '@/shared/actions/withClientErrorHandler/withClientErrorHandler';
|
||||
|
||||
// Importa a função que realiza a requisição de listagem dos tipos de marcação
|
||||
import { TTBReconhecimentoTipoIndexData } from '@/packages/administrativo/data/TTBReconhecimentoTipo/TTBReconhecimentoTipoIndexData';
|
||||
import { TTBReconhecimentoTipoReadInterface } from '@/packages/administrativo/interfaces/TTBREconhecimentoTipo/TTBReconhecimentoTipoReadInterface';
|
||||
import { TTBReconhecimentoTipoIndexData } from '../../_data/TTBReconhecimentoTipo/TTBReconhecimentoTipoIndexData';
|
||||
import { TTBReconhecimentoTipoReadInterface } from '../../_interfaces/TTBReconhecimentoTipoReadInterface';
|
||||
|
||||
// Função assíncrona responsável por executar o serviço de listagem de tipos de marcação
|
||||
async function executeTTBReconhecimentoTipoIndexService(data?: TTBReconhecimentoTipoReadInterface) {
|
||||
async function executeTTBReconhecimentoTipoIndexService(data: TTBReconhecimentoTipoReadInterface) {
|
||||
// Chama a função que realiza a requisição à API e aguarda a resposta
|
||||
const response = await TTBReconhecimentoTipoIndexData(data);
|
||||
|
||||
|
|
@ -19,6 +19,7 @@ import { Toaster } from '@/components/ui/sonner';
|
|||
import Response from '../../shared/components/response/response';
|
||||
import { ResponseProvider } from '../../shared/components/response/ResponseContext';
|
||||
|
||||
|
||||
const geistSans = Geist({
|
||||
variable: '--font-geist-sans',
|
||||
subsets: ['latin'],
|
||||
|
|
@ -56,7 +57,9 @@ export default function RootLayout({ children }: { children: React.ReactNode })
|
|||
<Breadcrumb>
|
||||
<BreadcrumbList>
|
||||
<BreadcrumbItem className="hidden md:block">
|
||||
<BreadcrumbLink href="#">Building Your Application</BreadcrumbLink>
|
||||
<BreadcrumbLink href="#">
|
||||
Building Your Application
|
||||
</BreadcrumbLink>
|
||||
</BreadcrumbItem>
|
||||
<BreadcrumbSeparator className="hidden md:block" />
|
||||
<BreadcrumbItem>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import useGUsuarioGetJWTHook from '@/shared/hooks/auth/useGUsuarioGetJWTHook';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
export default function Page() {
|
||||
const { userAuthenticated } = useGUsuarioGetJWTHook();
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
import TAtoForm from '@/packages/servicos/components/TAto/TAtoForm';
|
||||
|
||||
export default function TAtoFormPage() {
|
||||
return <TAtoForm />;
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
import TAtoIndex from '@/packages/servicos/components/TAto/TAtoIndex';
|
||||
|
||||
export default function TServicoAToPag() {
|
||||
return <TAtoIndex />;
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
'use client'
|
||||
|
||||
import { useParams } from "next/navigation";
|
||||
|
||||
import TServicoPedidoDetails from "@/packages/servicos/components/TServicoPedido/TServicoPedidoDetails";
|
||||
|
||||
export default function TServicoPedidoDetailsPage() {
|
||||
|
||||
const params = useParams();
|
||||
|
||||
return (
|
||||
<TServicoPedidoDetails
|
||||
servico_pedido_id={Number(params.servicoPedidoId)}
|
||||
/>
|
||||
)
|
||||
}
|
||||
7
src/app/(protected)/servicos/balcao/page.tsx
Normal file
7
src/app/(protected)/servicos/balcao/page.tsx
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import TServicoPedidoIndex from "@/packages/servicos/components/TServicoPedido/TServicoPedidoIndex";
|
||||
|
||||
export default function TServicoPedidoPage() {
|
||||
return (
|
||||
<TServicoPedidoIndex />
|
||||
)
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
'use client'
|
||||
|
||||
import { useParams } from "next/navigation";
|
||||
|
||||
import TServicoPedidoForm from "@/packages/servicos/components/TServicoPedido/TServicoPedidoForm";
|
||||
|
||||
export default function TServicoPedidoPage() {
|
||||
|
||||
const params = useParams();
|
||||
|
||||
return (
|
||||
<TServicoPedidoForm
|
||||
servico_pedido_id={Number(params.servicoPedidoId)}
|
||||
/>
|
||||
)
|
||||
}
|
||||
7
src/app/(protected)/servicos/balcao/pedido/page.tsx
Normal file
7
src/app/(protected)/servicos/balcao/pedido/page.tsx
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import TServicoPedidoForm from "@/packages/servicos/components/TServicoPedido/TServicoPedidoForm"
|
||||
|
||||
export default function TServicoPedidoPage() {
|
||||
return (
|
||||
<TServicoPedidoForm />
|
||||
)
|
||||
}
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
import TServicoPedidoDashboard from '@/packages/servicos/components/TServicoPedido/TServicoPedidoDashboard';
|
||||
import TServicoPedidoDashboard from "@/packages/servicos/components/TServicoPedido/TServicoPedidoDashboard";
|
||||
|
||||
export default function TServicoPedidoPage() {
|
||||
return <TServicoPedidoDashboard />;
|
||||
}
|
||||
return (
|
||||
<TServicoPedidoDashboard />
|
||||
)
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
'use client';
|
||||
|
||||
import { useParams } from 'next/navigation';
|
||||
|
||||
import TServicoPedidoDetails from '@/packages/servicos/components/TServicoPedido/TServicoPedidoDetails';
|
||||
|
||||
export default function TServicoPedidoDetailsPage() {
|
||||
const params = useParams();
|
||||
|
||||
return <TServicoPedidoDetails servico_pedido_id={Number(params.servicoPedidoId)} />;
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
import TServicoPedidoIndex from '@/packages/servicos/components/TServicoPedido/TServicoPedidoIndex';
|
||||
|
||||
export default function TServicoPedidoPage() {
|
||||
return <TServicoPedidoIndex />;
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
'use client';
|
||||
|
||||
import { useParams } from 'next/navigation';
|
||||
|
||||
import TServicoPedidoForm from '@/packages/servicos/components/TServicoPedido/TServicoPedidoForm';
|
||||
|
||||
export default function TServicoPedidoPage() {
|
||||
const params = useParams();
|
||||
|
||||
return <TServicoPedidoForm servico_pedido_id={Number(params.servicoPedidoId)} />;
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
import TServicoPedidoForm from '@/packages/servicos/components/TServicoPedido/TServicoPedidoForm';
|
||||
|
||||
export default function TServicoPedidoPage() {
|
||||
return <TServicoPedidoForm />;
|
||||
}
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
'use client';
|
||||
|
||||
import React, { useState } from 'react';
|
||||
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogCancel,
|
||||
|
|
@ -12,6 +11,7 @@ import {
|
|||
AlertDialogTitle,
|
||||
AlertDialogAction,
|
||||
} from '@/components/ui/alert-dialog';
|
||||
|
||||
import { InputOTP, InputOTPGroup, InputOTPSlot } from '@/components/ui/input-otp';
|
||||
|
||||
interface ConfirmExclusionProps {
|
||||
|
|
|
|||
|
|
@ -6,44 +6,39 @@
|
|||
:root {
|
||||
--background: oklch(0.9911 0 0);
|
||||
--foreground: oklch(0.2988 0.0123 222.4429);
|
||||
--card: oklch(1 0 0);
|
||||
--card: oklch(1.0000 0 0);
|
||||
--card-foreground: oklch(0.2988 0.0123 222.4429);
|
||||
--popover: oklch(0.9881 0 0);
|
||||
--popover-foreground: oklch(0.2988 0.0123 222.4429);
|
||||
--primary: oklch(0.721 0.1873 47.564);
|
||||
--primary-foreground: oklch(1 0 0);
|
||||
--primary: oklch(0.7210 0.1873 47.5640);
|
||||
--primary-foreground: oklch(1.0000 0 0);
|
||||
--secondary: oklch(0.2988 0.0123 222.4429);
|
||||
--secondary-foreground: oklch(1 0 0);
|
||||
--muted: oklch(0.97 0 0);
|
||||
--muted-foreground: oklch(0.556 0 0);
|
||||
--secondary-foreground: oklch(1.0000 0 0);
|
||||
--muted: oklch(0.9700 0 0);
|
||||
--muted-foreground: oklch(0.5560 0 0);
|
||||
--accent: oklch(0.9551 0 0);
|
||||
--accent-foreground: oklch(0.2988 0.0123 222.4429);
|
||||
--destructive: oklch(0.577 0.245 27.325);
|
||||
--destructive: oklch(0.5770 0.2450 27.3250);
|
||||
--destructive-foreground: oklch(1 0 0);
|
||||
--border: oklch(0.922 0 0);
|
||||
--input: oklch(0.922 0 0);
|
||||
--ring: oklch(0.708 0 0);
|
||||
--chart-1: oklch(0.81 0.1 252);
|
||||
--chart-2: oklch(0.62 0.19 260);
|
||||
--chart-3: oklch(0.55 0.22 263);
|
||||
--chart-4: oklch(0.49 0.22 264);
|
||||
--chart-5: oklch(0.42 0.18 266);
|
||||
--sidebar: oklch(1 0 0);
|
||||
--border: oklch(0.9220 0 0);
|
||||
--input: oklch(0.9220 0 0);
|
||||
--ring: oklch(0.7080 0 0);
|
||||
--chart-1: oklch(0.8100 0.1000 252);
|
||||
--chart-2: oklch(0.6200 0.1900 260);
|
||||
--chart-3: oklch(0.5500 0.2200 263);
|
||||
--chart-4: oklch(0.4900 0.2200 264);
|
||||
--chart-5: oklch(0.4200 0.1800 266);
|
||||
--sidebar: oklch(1.0000 0 0);
|
||||
--sidebar-foreground: oklch(0.2988 0.0123 222.4429);
|
||||
--sidebar-primary: oklch(0.2364 0.0083 240.2365);
|
||||
--sidebar-primary-foreground: oklch(0.985 0 0);
|
||||
--sidebar-accent: oklch(0.97 0 0);
|
||||
--sidebar-accent-foreground: oklch(0.205 0 0);
|
||||
--sidebar-border: oklch(0.922 0 0);
|
||||
--sidebar-ring: oklch(0.708 0 0);
|
||||
--font-sans:
|
||||
ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
||||
'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
|
||||
'Segoe UI Symbol', 'Noto Color Emoji';
|
||||
--font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
|
||||
--font-mono:
|
||||
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
|
||||
monospace;
|
||||
--sidebar-primary-foreground: oklch(0.9850 0 0);
|
||||
--sidebar-accent: oklch(0.9700 0 0);
|
||||
--sidebar-accent-foreground: oklch(0.2050 0 0);
|
||||
--sidebar-border: oklch(0.9220 0 0);
|
||||
--sidebar-ring: oklch(0.7080 0 0);
|
||||
--font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
||||
--font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
|
||||
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
--radius: 0.625rem;
|
||||
--shadow-x: 0;
|
||||
--shadow-y: 1px;
|
||||
|
|
@ -53,11 +48,11 @@
|
|||
--shadow-color: oklch(0 0 0);
|
||||
--shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
|
||||
--shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
|
||||
--shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 2px 4px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 4px 6px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 8px 10px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 1px 2px -1px hsl(0 0% 0% / 0.10);
|
||||
--shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 1px 2px -1px hsl(0 0% 0% / 0.10);
|
||||
--shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 2px 4px -1px hsl(0 0% 0% / 0.10);
|
||||
--shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 4px 6px -1px hsl(0 0% 0% / 0.10);
|
||||
--shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 8px 10px -1px hsl(0 0% 0% / 0.10);
|
||||
--shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);
|
||||
--tracking-normal: 0em;
|
||||
--spacing: 0.25rem;
|
||||
|
|
@ -73,40 +68,35 @@
|
|||
--card-foreground: oklch(0.9881 0 0);
|
||||
--popover: oklch(0.2988 0.0123 222.4429);
|
||||
--popover-foreground: oklch(0.9881 0 0);
|
||||
--primary: oklch(0.721 0.1873 47.564);
|
||||
--primary: oklch(0.7210 0.1873 47.5640);
|
||||
--primary-foreground: oklch(0.2988 0.0123 222.4429);
|
||||
--secondary: oklch(0.2988 0.0123 222.4429);
|
||||
--secondary-foreground: oklch(1 0 0);
|
||||
--muted: oklch(0.269 0 0);
|
||||
--muted-foreground: oklch(0.708 0 0);
|
||||
--secondary-foreground: oklch(1.0000 0 0);
|
||||
--muted: oklch(0.2690 0 0);
|
||||
--muted-foreground: oklch(0.7080 0 0);
|
||||
--accent: oklch(0.2988 0.0123 222.4429);
|
||||
--accent-foreground: oklch(1 0 0);
|
||||
--destructive: oklch(0.704 0.191 22.216);
|
||||
--destructive-foreground: oklch(0.985 0 0);
|
||||
--border: oklch(0.275 0 0);
|
||||
--input: oklch(0.325 0 0);
|
||||
--ring: oklch(0.556 0 0);
|
||||
--chart-1: oklch(0.81 0.1 252);
|
||||
--chart-2: oklch(0.62 0.19 260);
|
||||
--chart-3: oklch(0.55 0.22 263);
|
||||
--chart-4: oklch(0.49 0.22 264);
|
||||
--chart-5: oklch(0.42 0.18 266);
|
||||
--accent-foreground: oklch(1.0000 0 0);
|
||||
--destructive: oklch(0.7040 0.1910 22.2160);
|
||||
--destructive-foreground: oklch(0.9850 0 0);
|
||||
--border: oklch(0.2750 0 0);
|
||||
--input: oklch(0.3250 0 0);
|
||||
--ring: oklch(0.5560 0 0);
|
||||
--chart-1: oklch(0.8100 0.1000 252);
|
||||
--chart-2: oklch(0.6200 0.1900 260);
|
||||
--chart-3: oklch(0.5500 0.2200 263);
|
||||
--chart-4: oklch(0.4900 0.2200 264);
|
||||
--chart-5: oklch(0.4200 0.1800 266);
|
||||
--sidebar: oklch(0.2364 0.0083 240.2365);
|
||||
--sidebar-foreground: oklch(0.9881 0 0);
|
||||
--sidebar-primary: oklch(0.488 0.243 264.376);
|
||||
--sidebar-primary-foreground: oklch(0.985 0 0);
|
||||
--sidebar-accent: oklch(0.269 0 0);
|
||||
--sidebar-accent-foreground: oklch(0.985 0 0);
|
||||
--sidebar-border: oklch(0.275 0 0);
|
||||
--sidebar-ring: oklch(0.439 0 0);
|
||||
--font-sans:
|
||||
ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
||||
'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
|
||||
'Segoe UI Symbol', 'Noto Color Emoji';
|
||||
--font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
|
||||
--font-mono:
|
||||
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
|
||||
monospace;
|
||||
--sidebar-primary: oklch(0.4880 0.2430 264.3760);
|
||||
--sidebar-primary-foreground: oklch(0.9850 0 0);
|
||||
--sidebar-accent: oklch(0.2690 0 0);
|
||||
--sidebar-accent-foreground: oklch(0.9850 0 0);
|
||||
--sidebar-border: oklch(0.2750 0 0);
|
||||
--sidebar-ring: oklch(0.4390 0 0);
|
||||
--font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
||||
--font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
|
||||
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
--radius: 0.625rem;
|
||||
--shadow-x: 0;
|
||||
--shadow-y: 1px;
|
||||
|
|
@ -116,11 +106,11 @@
|
|||
--shadow-color: oklch(0 0 0);
|
||||
--shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
|
||||
--shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
|
||||
--shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 2px 4px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 4px 6px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 8px 10px -1px hsl(0 0% 0% / 0.1);
|
||||
--shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 1px 2px -1px hsl(0 0% 0% / 0.10);
|
||||
--shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 1px 2px -1px hsl(0 0% 0% / 0.10);
|
||||
--shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 2px 4px -1px hsl(0 0% 0% / 0.10);
|
||||
--shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 4px 6px -1px hsl(0 0% 0% / 0.10);
|
||||
--shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 8px 10px -1px hsl(0 0% 0% / 0.10);
|
||||
--shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);
|
||||
--shadow-offset-x: 0;
|
||||
--shadow-offset-y: 1px;
|
||||
|
|
@ -162,14 +152,9 @@
|
|||
--color-sidebar-border: var(--sidebar-border);
|
||||
--color-sidebar-ring: var(--sidebar-ring);
|
||||
|
||||
--font-sans:
|
||||
ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
||||
'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
|
||||
'Segoe UI Symbol', 'Noto Color Emoji';
|
||||
--font-mono:
|
||||
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
|
||||
monospace;
|
||||
--font-serif: ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
|
||||
--font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
||||
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
--font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
|
||||
|
||||
--radius-sm: calc(var(--radius) - 4px);
|
||||
--radius-md: calc(var(--radius) - 2px);
|
||||
|
|
@ -212,4 +197,4 @@
|
|||
.bg-brand {
|
||||
background-color: #1a292f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import { Editor } from '@tinymce/tinymce-react';
|
||||
import React from 'react';
|
||||
import { Editor } from '@tinymce/tinymce-react';
|
||||
|
||||
// 1. Define as propriedades que nosso componente vai receber
|
||||
interface MainEditorProps {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import {
|
|||
HouseIcon,
|
||||
SquareMousePointer,
|
||||
SquareTerminal,
|
||||
UsersIcon,
|
||||
UsersIcon
|
||||
} from 'lucide-react';
|
||||
import Image from 'next/image';
|
||||
import * as React from 'react';
|
||||
|
|
@ -27,6 +27,7 @@ import {
|
|||
} from '@/components/ui/sidebar';
|
||||
import useGUsuarioGetJWTHook from '@/shared/hooks/auth/useGUsuarioGetJWTHook';
|
||||
|
||||
|
||||
// This is sample data.
|
||||
const data = {
|
||||
teams: [],
|
||||
|
|
@ -54,12 +55,8 @@ const data = {
|
|||
url: '/servicos/dashboard/',
|
||||
},
|
||||
{
|
||||
title: 'Pedidos',
|
||||
url: '/servicos/pedidos/',
|
||||
},
|
||||
{
|
||||
title: 'Atos',
|
||||
url: '/servicos/atos/',
|
||||
title: 'Balcão',
|
||||
url: '/servicos/balcao/',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
@ -173,41 +170,41 @@ const data = {
|
|||
url: '/administrativo/centrais/censec/naturezas-litigios',
|
||||
},
|
||||
{
|
||||
title: 'Tipos/Serviços',
|
||||
url: '/administrativo/tipos-servicos',
|
||||
title: 'Serviços/Tipos',
|
||||
url: '/cadastros/servicos-tipo/',
|
||||
},
|
||||
{
|
||||
title: 'Atos/Partes Tipos',
|
||||
url: '/administrativo/atos/partes-tipos',
|
||||
},
|
||||
{
|
||||
title: 'Valores de Serviços',
|
||||
url: '/administrativo/valores-de-servicos',
|
||||
title: "Valores de Serviços",
|
||||
url: "/administrativo/valores-de-servicos",
|
||||
},
|
||||
{
|
||||
title: 'Gramatica',
|
||||
url: '/administrativo/gramatica',
|
||||
title: "Gramatica",
|
||||
url: "/administrativo/gramatica",
|
||||
},
|
||||
{
|
||||
title: 'Cartório',
|
||||
url: '/administrativo/cartorio',
|
||||
title: "Cartório",
|
||||
url: "/administrativo/cartorio",
|
||||
},
|
||||
{
|
||||
title: 'Financeiro/Periodo',
|
||||
url: '/administrativo/financeiro/periodos',
|
||||
title: "Financeiro/Periodo",
|
||||
url: "/administrativo/financeiro/periodos",
|
||||
},
|
||||
{
|
||||
title: 'Financeiro/Emolumentos',
|
||||
url: '/administrativo/financeiro/emolumentos',
|
||||
title: "Financeiro/Emolumentos",
|
||||
url: "/administrativo/financeiro/emolumentos",
|
||||
},
|
||||
{
|
||||
title: 'Selos/Grupos',
|
||||
url: '/administrativo/selos/grupos',
|
||||
title: "Selos/Grupos",
|
||||
url: "/administrativo/selos/grupos",
|
||||
},
|
||||
{
|
||||
title: 'Financeiro/Cálculo Rápido',
|
||||
url: '/administrativo/financeiro/calculo-rapido',
|
||||
},
|
||||
title: "Financeiro/Cálculo Rápido",
|
||||
url: "/administrativo/financeiro/calculo-rapido",
|
||||
}
|
||||
],
|
||||
},
|
||||
],
|
||||
|
|
|
|||
|
|
@ -1,20 +1,18 @@
|
|||
'use client';
|
||||
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import Image from 'next/image';
|
||||
import { useState } from 'react';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import z from 'zod';
|
||||
|
||||
import { cn } from '@/lib/utils';
|
||||
import { Card, CardContent } from '@/components/ui/card';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { GUsuarioLoginSchema } from '@/packages/administrativo/schemas/GUsuario/GUsuarioLoginSchema';
|
||||
import z from 'zod';
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import GUsuarioLoginService from '@/packages/administrativo/services/GUsuario/GUsuarioLogin';
|
||||
import LoadingButton from '@/shared/components/loadingButton/LoadingButton';
|
||||
|
||||
import { Button } from './ui/button';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { useState } from 'react';
|
||||
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from './ui/form';
|
||||
import LoadingButton from '@/shared/components/loadingButton/LoadingButton';
|
||||
import { Button } from './ui/button';
|
||||
import { GUsuarioLoginSchema } from '@/packages/administrativo/schemas/GUsuario/GUsuarioLoginSchema';
|
||||
|
||||
type FormValues = z.infer<typeof GUsuarioLoginSchema>;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
'use client';
|
||||
|
||||
import { ChevronsUpDown, LogOut, Moon, Sparkles, Sun } from 'lucide-react';
|
||||
import {
|
||||
ChevronsUpDown,
|
||||
LogOut,
|
||||
Moon,
|
||||
Sparkles,
|
||||
Sun,
|
||||
} from 'lucide-react';
|
||||
import { useTheme } from 'next-themes';
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
|
|
@ -69,7 +75,9 @@ export function NavUser({ user }: { user: GUsuarioAuthenticatedInterface }) {
|
|||
>
|
||||
<Avatar className="h-8 w-8 rounded-lg">
|
||||
<AvatarImage src={user.sigla} alt={user.nome} />
|
||||
<AvatarFallback className="rounded-lg">{user.sigla}</AvatarFallback>
|
||||
<AvatarFallback className="rounded-lg">
|
||||
{user.sigla}
|
||||
</AvatarFallback>
|
||||
</Avatar>
|
||||
|
||||
<div className="grid flex-1 text-left text-sm leading-tight">
|
||||
|
|
@ -91,7 +99,9 @@ export function NavUser({ user }: { user: GUsuarioAuthenticatedInterface }) {
|
|||
<div className="flex items-center gap-2 px-1 py-1.5 text-left text-sm">
|
||||
<Avatar className="h-8 w-8 rounded-lg">
|
||||
<AvatarImage src={user.sigla} alt={user.nome} />
|
||||
<AvatarFallback className="rounded-lg">{user.sigla}</AvatarFallback>
|
||||
<AvatarFallback className="rounded-lg">
|
||||
{user.sigla}
|
||||
</AvatarFallback>
|
||||
</Avatar>
|
||||
|
||||
<div className="grid flex-1 text-left text-sm leading-tight">
|
||||
|
|
@ -105,8 +115,15 @@ export function NavUser({ user }: { user: GUsuarioAuthenticatedInterface }) {
|
|||
|
||||
<DropdownMenuGroup>
|
||||
{/* Alternância de tema */}
|
||||
<DropdownMenuItem className="cursor-pointer" onClick={handleToggleTheme}>
|
||||
{isDark ? <Sun className="mr-2 h-4 w-4" /> : <Moon className="mr-2 h-4 w-4" />}
|
||||
<DropdownMenuItem
|
||||
className="cursor-pointer"
|
||||
onClick={handleToggleTheme}
|
||||
>
|
||||
{isDark ? (
|
||||
<Sun className="mr-2 h-4 w-4" />
|
||||
) : (
|
||||
<Moon className="mr-2 h-4 w-4" />
|
||||
)}
|
||||
{isDark ? 'Modo claro' : 'Modo escuro'}
|
||||
</DropdownMenuItem>
|
||||
|
||||
|
|
@ -118,7 +135,10 @@ export function NavUser({ user }: { user: GUsuarioAuthenticatedInterface }) {
|
|||
|
||||
<DropdownMenuSeparator />
|
||||
|
||||
<DropdownMenuItem className="cursor-pointer" onClick={handleConfirmOpen}>
|
||||
<DropdownMenuItem
|
||||
className="cursor-pointer"
|
||||
onClick={handleConfirmOpen}
|
||||
>
|
||||
<LogOut className="mr-2 h-4 w-4" />
|
||||
Log out
|
||||
</DropdownMenuItem>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import { ChevronsUpDown, Plus } from 'lucide-react';
|
||||
import * as React from 'react';
|
||||
import { ChevronsUpDown, Plus } from 'lucide-react';
|
||||
|
||||
import {
|
||||
DropdownMenu,
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
'use client';
|
||||
"use client";
|
||||
|
||||
import { ThemeProvider as NextThemesProvider } from 'next-themes';
|
||||
import * as React from 'react';
|
||||
import { ThemeProvider as NextThemesProvider } from "next-themes";
|
||||
import * as React from "react";
|
||||
|
||||
export function ThemeProvider({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<NextThemesProvider
|
||||
attribute="class"
|
||||
defaultTheme="system"
|
||||
enableSystem
|
||||
disableTransitionOnChange
|
||||
>
|
||||
{children}
|
||||
</NextThemesProvider>
|
||||
);
|
||||
return (
|
||||
<NextThemesProvider
|
||||
attribute="class"
|
||||
defaultTheme="system"
|
||||
enableSystem
|
||||
disableTransitionOnChange
|
||||
>
|
||||
{children}
|
||||
</NextThemesProvider>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
'use client';
|
||||
|
||||
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
||||
import * as React from 'react';
|
||||
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
||||
|
||||
import { buttonVariants } from '@/components/ui/button';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { buttonVariants } from '@/components/ui/button';
|
||||
|
||||
function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
|
||||
return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
||||
import * as React from 'react';
|
||||
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
||||
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,39 +1,46 @@
|
|||
import { Slot } from '@radix-ui/react-slot';
|
||||
import { cva, type VariantProps } from 'class-variance-authority';
|
||||
import * as React from 'react';
|
||||
import * as React from "react"
|
||||
import { Slot } from "@radix-ui/react-slot"
|
||||
import { cva, type VariantProps } from "class-variance-authority"
|
||||
|
||||
import { cn } from '@/lib/utils';
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
const badgeVariants = cva(
|
||||
'inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden',
|
||||
"inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
|
||||
{
|
||||
variants: {
|
||||
variant: {
|
||||
default: 'border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90',
|
||||
default:
|
||||
"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
||||
secondary:
|
||||
'border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90',
|
||||
"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
||||
destructive:
|
||||
'border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
|
||||
outline: 'text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground',
|
||||
"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
||||
outline:
|
||||
"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
variant: 'default',
|
||||
variant: "default",
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
)
|
||||
|
||||
function Badge({
|
||||
className,
|
||||
variant,
|
||||
asChild = false,
|
||||
...props
|
||||
}: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
|
||||
const Comp = asChild ? Slot : 'span';
|
||||
}: React.ComponentProps<"span"> &
|
||||
VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
|
||||
const Comp = asChild ? Slot : "span"
|
||||
|
||||
return (
|
||||
<Comp data-slot="badge" className={cn(badgeVariants({ variant }), className)} {...props} />
|
||||
);
|
||||
<Comp
|
||||
data-slot="badge"
|
||||
className={cn(badgeVariants({ variant }), className)}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
export { Badge, badgeVariants };
|
||||
export { Badge, badgeVariants }
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import * as React from 'react';
|
||||
import { Slot } from '@radix-ui/react-slot';
|
||||
import { ChevronRight, MoreHorizontal } from 'lucide-react';
|
||||
import * as React from 'react';
|
||||
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { Slot } from '@radix-ui/react-slot';
|
||||
import { cva, type VariantProps } from 'class-variance-authority';
|
||||
import { Slot } from "@radix-ui/react-slot"
|
||||
import { cva, type VariantProps } from "class-variance-authority"
|
||||
|
||||
import { Separator } from '@/components/ui/separator';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { cn } from "@/lib/utils"
|
||||
import { Separator } from "@/components/ui/separator"
|
||||
|
||||
const buttonGroupVariants = cva(
|
||||
"flex w-fit items-stretch [&>*]:focus-visible:z-10 [&>*]:focus-visible:relative [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md has-[>[data-slot=button-group]]:gap-2",
|
||||
|
|
@ -10,22 +10,22 @@ const buttonGroupVariants = cva(
|
|||
variants: {
|
||||
orientation: {
|
||||
horizontal:
|
||||
'[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none',
|
||||
"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
|
||||
vertical:
|
||||
'flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none',
|
||||
"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none",
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
orientation: 'horizontal',
|
||||
orientation: "horizontal",
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
)
|
||||
|
||||
function ButtonGroup({
|
||||
className,
|
||||
orientation,
|
||||
...props
|
||||
}: React.ComponentProps<'div'> & VariantProps<typeof buttonGroupVariants>) {
|
||||
}: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>) {
|
||||
return (
|
||||
<div
|
||||
role="group"
|
||||
|
|
@ -34,32 +34,32 @@ function ButtonGroup({
|
|||
className={cn(buttonGroupVariants({ orientation }), className)}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
function ButtonGroupText({
|
||||
className,
|
||||
asChild = false,
|
||||
...props
|
||||
}: React.ComponentProps<'div'> & {
|
||||
asChild?: boolean;
|
||||
}: React.ComponentProps<"div"> & {
|
||||
asChild?: boolean
|
||||
}) {
|
||||
const Comp = asChild ? Slot : 'div';
|
||||
const Comp = asChild ? Slot : "div"
|
||||
|
||||
return (
|
||||
<Comp
|
||||
className={cn(
|
||||
"bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
||||
className,
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
function ButtonGroupSeparator({
|
||||
className,
|
||||
orientation = 'vertical',
|
||||
orientation = "vertical",
|
||||
...props
|
||||
}: React.ComponentProps<typeof Separator>) {
|
||||
return (
|
||||
|
|
@ -67,12 +67,17 @@ function ButtonGroupSeparator({
|
|||
data-slot="button-group-separator"
|
||||
orientation={orientation}
|
||||
className={cn(
|
||||
'bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto',
|
||||
className,
|
||||
"bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants };
|
||||
export {
|
||||
ButtonGroup,
|
||||
ButtonGroupSeparator,
|
||||
ButtonGroupText,
|
||||
buttonGroupVariants,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,38 +1,40 @@
|
|||
import { Slot } from '@radix-ui/react-slot';
|
||||
import { cva, type VariantProps } from 'class-variance-authority';
|
||||
import * as React from 'react';
|
||||
import * as React from "react"
|
||||
import { Slot } from "@radix-ui/react-slot"
|
||||
import { cva, type VariantProps } from "class-variance-authority"
|
||||
|
||||
import { cn } from '@/lib/utils';
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
const buttonVariants = cva(
|
||||
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
||||
{
|
||||
variants: {
|
||||
variant: {
|
||||
default: 'bg-primary text-primary-foreground hover:bg-primary/90',
|
||||
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
||||
destructive:
|
||||
'bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
|
||||
"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
||||
outline:
|
||||
'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',
|
||||
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
||||
ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
|
||||
link: 'text-primary underline-offset-4 hover:underline',
|
||||
"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
||||
secondary:
|
||||
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
||||
ghost:
|
||||
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
||||
link: "text-primary underline-offset-4 hover:underline",
|
||||
},
|
||||
size: {
|
||||
default: 'h-9 px-4 py-2 has-[>svg]:px-3',
|
||||
sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',
|
||||
lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',
|
||||
icon: 'size-9',
|
||||
'icon-sm': 'size-8',
|
||||
'icon-lg': 'size-10',
|
||||
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
||||
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
||||
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
||||
icon: "size-9",
|
||||
"icon-sm": "size-8",
|
||||
"icon-lg": "size-10",
|
||||
},
|
||||
},
|
||||
defaultVariants: {
|
||||
variant: 'default',
|
||||
size: 'default',
|
||||
variant: "default",
|
||||
size: "default",
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
)
|
||||
|
||||
function Button({
|
||||
className,
|
||||
|
|
@ -40,11 +42,11 @@ function Button({
|
|||
size,
|
||||
asChild = false,
|
||||
...props
|
||||
}: React.ComponentProps<'button'> &
|
||||
}: React.ComponentProps<"button"> &
|
||||
VariantProps<typeof buttonVariants> & {
|
||||
asChild?: boolean;
|
||||
asChild?: boolean
|
||||
}) {
|
||||
const Comp = asChild ? Slot : 'button';
|
||||
const Comp = asChild ? Slot : "button"
|
||||
|
||||
return (
|
||||
<Comp
|
||||
|
|
@ -52,7 +54,7 @@ function Button({
|
|||
className={cn(buttonVariants({ variant, size, className }))}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
export { Button, buttonVariants };
|
||||
export { Button, buttonVariants }
|
||||
|
|
|
|||
|
|
@ -1,75 +1,92 @@
|
|||
import * as React from 'react';
|
||||
import * as React from "react"
|
||||
|
||||
import { cn } from '@/lib/utils';
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
function Card({ className, ...props }: React.ComponentProps<'div'>) {
|
||||
function Card({ className, ...props }: React.ComponentProps<"div">) {
|
||||
return (
|
||||
<div
|
||||
data-slot="card"
|
||||
className={cn(
|
||||
'bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm',
|
||||
className,
|
||||
"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
function CardHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
||||
function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
|
||||
return (
|
||||
<div
|
||||
data-slot="card-header"
|
||||
className={cn(
|
||||
'@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6',
|
||||
className,
|
||||
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
function CardTitle({ className, ...props }: React.ComponentProps<'div'>) {
|
||||
function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
|
||||
return (
|
||||
<div
|
||||
data-slot="card-title"
|
||||
className={cn('leading-none font-semibold', className)}
|
||||
className={cn("leading-none font-semibold", className)}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
function CardDescription({ className, ...props }: React.ComponentProps<'div'>) {
|
||||
function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
|
||||
return (
|
||||
<div
|
||||
data-slot="card-description"
|
||||
className={cn('text-muted-foreground text-sm', className)}
|
||||
className={cn("text-muted-foreground text-sm", className)}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
function CardAction({ className, ...props }: React.ComponentProps<'div'>) {
|
||||
function CardAction({ className, ...props }: React.ComponentProps<"div">) {
|
||||
return (
|
||||
<div
|
||||
data-slot="card-action"
|
||||
className={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)}
|
||||
className={cn(
|
||||
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
function CardContent({ className, ...props }: React.ComponentProps<'div'>) {
|
||||
return <div data-slot="card-content" className={cn('px-6', className)} {...props} />;
|
||||
function CardContent({ className, ...props }: React.ComponentProps<"div">) {
|
||||
return (
|
||||
<div
|
||||
data-slot="card-content"
|
||||
className={cn("px-6", className)}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
function CardFooter({ className, ...props }: React.ComponentProps<'div'>) {
|
||||
function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
|
||||
return (
|
||||
<div
|
||||
data-slot="card-footer"
|
||||
className={cn('flex items-center px-6 [.border-t]:pt-6', className)}
|
||||
className={cn("flex items-center px-6 [.border-t]:pt-6", className)}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };
|
||||
export {
|
||||
Card,
|
||||
CardHeader,
|
||||
CardFooter,
|
||||
CardTitle,
|
||||
CardAction,
|
||||
CardDescription,
|
||||
CardContent,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,132 +0,0 @@
|
|||
const ChartTooltip = RechartsPrimitive.Tooltip;
|
||||
|
||||
function ChartTooltipContent(props: any) {
|
||||
const {
|
||||
active,
|
||||
payload,
|
||||
className,
|
||||
indicator = 'dot',
|
||||
hideLabel = false,
|
||||
hideIndicator = false,
|
||||
label,
|
||||
labelFormatter,
|
||||
labelClassName,
|
||||
formatter,
|
||||
color,
|
||||
nameKey,
|
||||
labelKey,
|
||||
} = props;
|
||||
|
||||
const { config } = useChart();
|
||||
|
||||
const tooltipLabel = React.useMemo(() => {
|
||||
if (hideLabel || !payload?.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const [item] = payload;
|
||||
const key = `${labelKey || item?.dataKey || item?.name || 'value'}`;
|
||||
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
||||
const value =
|
||||
!labelKey && typeof label === 'string'
|
||||
? config[label as keyof typeof config]?.label || label
|
||||
: itemConfig?.label;
|
||||
|
||||
if (labelFormatter) {
|
||||
return (
|
||||
<div className={cn('font-medium', labelClassName)}>{labelFormatter(value, payload)}</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (!value) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return <div className={cn('font-medium', labelClassName)}>{value}</div>;
|
||||
}, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);
|
||||
|
||||
if (!active || !payload?.length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const nestLabel = payload.length === 1 && indicator !== 'dot';
|
||||
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
'border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl',
|
||||
className,
|
||||
)}
|
||||
>
|
||||
{!nestLabel ? tooltipLabel : null}
|
||||
<div className="grid gap-1.5">
|
||||
{payload
|
||||
.filter((item: any) => item.type !== 'none')
|
||||
.map((item: any, index: number) => {
|
||||
const key = `${nameKey || item.name || item.dataKey || 'value'}`;
|
||||
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
||||
const indicatorColor = color || item.payload?.fill || item.color;
|
||||
|
||||
return (
|
||||
<div
|
||||
key={item.dataKey}
|
||||
className={cn(
|
||||
'[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5',
|
||||
indicator === 'dot' && 'items-center',
|
||||
)}
|
||||
>
|
||||
{formatter && item?.value !== undefined && item.name ? (
|
||||
formatter(item.value, item.name, item, index, item.payload)
|
||||
) : (
|
||||
<>
|
||||
{itemConfig?.icon ? (
|
||||
<itemConfig.icon />
|
||||
) : (
|
||||
!hideIndicator && (
|
||||
<div
|
||||
className={cn(
|
||||
'shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)',
|
||||
{
|
||||
'h-2.5 w-2.5': indicator === 'dot',
|
||||
'w-1': indicator === 'line',
|
||||
'w-0 border-[1.5px] border-dashed bg-transparent':
|
||||
indicator === 'dashed',
|
||||
'my-0.5': nestLabel && indicator === 'dashed',
|
||||
},
|
||||
)}
|
||||
style={
|
||||
{
|
||||
'--color-bg': indicatorColor,
|
||||
'--color-border': indicatorColor,
|
||||
} as React.CSSProperties
|
||||
}
|
||||
/>
|
||||
)
|
||||
)}
|
||||
<div
|
||||
className={cn(
|
||||
'flex flex-1 justify-between leading-none',
|
||||
nestLabel ? 'items-end' : 'items-center',
|
||||
)}
|
||||
>
|
||||
<div className="grid gap-1.5">
|
||||
{nestLabel ? tooltipLabel : null}
|
||||
<span className="text-muted-foreground">
|
||||
{itemConfig?.label || item.name}
|
||||
</span>
|
||||
</div>
|
||||
{item.value && (
|
||||
<span className="text-foreground font-mono font-medium tabular-nums">
|
||||
{item.value.toLocaleString()}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
||||
import { CheckIcon } from 'lucide-react';
|
||||
import * as React from 'react';
|
||||
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import { Command as CommandPrimitive } from 'cmdk';
|
||||
import { SearchIcon } from 'lucide-react';
|
||||
import * as React from 'react';
|
||||
|
||||
import { cn } from '@/lib/utils';
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
|
|
@ -11,7 +12,6 @@ import {
|
|||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from '@/components/ui/dialog';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>) {
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
||||
import { XIcon } from 'lucide-react';
|
||||
import * as React from 'react';
|
||||
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
||||
import { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';
|
||||
import * as React from 'react';
|
||||
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue