From b91ce54475de9dffd63fff1911e0638e5aed1533 Mon Sep 17 00:00:00 2001 From: keven Date: Wed, 1 Oct 2025 11:15:02 -0300 Subject: [PATCH] =?UTF-8?q?[MVPTN-99]=20feat(CRUD):=20Inicio=20do=20formul?= =?UTF-8?q?=C3=A1rio=20de=20cadastro=20de=20pessoa=20juridica=20com=20repr?= =?UTF-8?q?esentantes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- eslint.config.js | 21 +- package-lock.json | 940 +- package.json | 8 + src/actions/CNPJ/FormatCNPJ.ts | 23 + src/actions/CPF/FormatCPF.ts | 21 +- src/actions/dateTime/FormatDateTime.ts | 72 +- src/actions/phone/FormatPhone.ts | 62 +- src/actions/text/GetCapitalize.ts | 2 +- src/actions/text/GetNameInitials.ts | 22 +- src/actions/validations/empty.ts | 4 +- .../(t_pessoa)/pessoa/fisica/page.tsx | 260 +- .../(t_pessoa)/pessoa/juridica/page.tsx | 173 + .../_components/g_cidade/GCidadeForm.tsx | 118 +- .../_components/t_pessoa/TPessoaForm.tsx | 1734 +-- .../_components/t_pessoa/TPessoaTable.tsx | 398 +- .../t_pessoa/juridica/TPessoaJuridicaForm.tsx | 464 + .../juridica/TPessoaJuridicaTable.tsx | 218 + .../TPessoaRepresentanteForm.tsx | 346 + .../TPessoaRepresentantePage.tsx | 177 + .../TPessoaRepresentanteTable.tsx | 191 + .../_data/GCidade/GCidadeSaveData.ts | 26 +- .../cadastros/_data/GUf/GUfIndexData.ts | 16 +- .../_data/TPessoa/TPessoaIndexData.ts | 11887 ++++++++-------- .../juridica/TPessoaJuridicaIndexData.ts | 6325 ++++++++ .../TPessoaRepresentanteIndexData.ts | 54 + .../_hooks/g_cidade/useGCidadeSaveHook.ts | 20 +- .../cadastros/_hooks/g_uf/useGUfReadHook.ts | 34 +- .../juridica/useTPessoaJuridicaDeleteHook.ts | 15 + .../juridica/useTPessoaJuridicaIndexHook.ts | 20 + .../juridica/useTPessoaJuridicaSaveHook.ts | 33 + .../_hooks/t_pessoa/useTPessoaDeleteHook.ts | 20 +- .../_hooks/t_pessoa/useTPessoaIndexHook.ts | 24 +- .../_hooks/t_pessoa/useTPessoaSaveHook.ts | 42 +- .../useTPessoaDeleteHook.ts | 15 + .../useTPessoaRepresentanteIndexHook.ts | 23 + .../useTPessoaSaveHook.ts | 33 + .../cadastros/_interfaces/GUfInterface.ts | 10 +- .../cadastros/_interfaces/TPessoaInterface.ts | 124 +- .../_interfaces/TPessoaJuridicaInterface.ts | 63 + .../_interfaces/TPessoaRepresentante.ts | 5 + .../cadastros/_schemas/GCidadeSchema.ts | 16 +- .../_schemas/TPessoaJuridicaSchema.ts | 67 + .../_schemas/TPessoaRepresentante.ts | 7 + .../cadastros/_schemas/TPessoaSchema.ts | 123 +- .../_services/g_cidade/GCidadeSaveService.ts | 12 +- .../_services/g_uf/GUfIndexService.ts | 8 +- .../_services/t_pessoa/TPessoaIndexService.ts | 10 +- .../juridica/TPessoaJuridicaIndexService.ts | 12 + .../TPessoaRepresentante.ts | 12 + src/app/_components/dataTable/dataTable.tsx | 325 +- src/app/_response/ResponseContext.tsx | 1 - src/app/_response/response.tsx | 2 +- src/components/app-sidebar.tsx | 4 + src/components/ui/command.tsx | 52 +- src/components/ui/tabs.tsx | 22 +- src/components/ui/textarea.tsx | 10 +- src/enums/SexoEnum.ts | 6 +- 57 files changed, 16748 insertions(+), 7984 deletions(-) create mode 100644 src/actions/CNPJ/FormatCNPJ.ts create mode 100644 src/app/(protected)/(cadastros)/cadastros/(t_pessoa)/pessoa/juridica/page.tsx create mode 100644 src/app/(protected)/(cadastros)/cadastros/_components/t_pessoa/juridica/TPessoaJuridicaForm.tsx create mode 100644 src/app/(protected)/(cadastros)/cadastros/_components/t_pessoa/juridica/TPessoaJuridicaTable.tsx create mode 100644 src/app/(protected)/(cadastros)/cadastros/_components/t_pessoa_representante/TPessoaRepresentanteForm.tsx create mode 100644 src/app/(protected)/(cadastros)/cadastros/_components/t_pessoa_representante/TPessoaRepresentantePage.tsx create mode 100644 src/app/(protected)/(cadastros)/cadastros/_components/t_pessoa_representante/TPessoaRepresentanteTable.tsx create mode 100644 src/app/(protected)/(cadastros)/cadastros/_data/TPessoa/juridica/TPessoaJuridicaIndexData.ts create mode 100644 src/app/(protected)/(cadastros)/cadastros/_data/TPessoaRepresentante/TPessoaRepresentanteIndexData.ts create mode 100644 src/app/(protected)/(cadastros)/cadastros/_hooks/t_pessoa/juridica/useTPessoaJuridicaDeleteHook.ts create mode 100644 src/app/(protected)/(cadastros)/cadastros/_hooks/t_pessoa/juridica/useTPessoaJuridicaIndexHook.ts create mode 100644 src/app/(protected)/(cadastros)/cadastros/_hooks/t_pessoa/juridica/useTPessoaJuridicaSaveHook.ts create mode 100644 src/app/(protected)/(cadastros)/cadastros/_hooks/t_pessoa_representante/useTPessoaDeleteHook.ts create mode 100644 src/app/(protected)/(cadastros)/cadastros/_hooks/t_pessoa_representante/useTPessoaRepresentanteIndexHook.ts create mode 100644 src/app/(protected)/(cadastros)/cadastros/_hooks/t_pessoa_representante/useTPessoaSaveHook.ts create mode 100644 src/app/(protected)/(cadastros)/cadastros/_interfaces/TPessoaJuridicaInterface.ts create mode 100644 src/app/(protected)/(cadastros)/cadastros/_interfaces/TPessoaRepresentante.ts create mode 100644 src/app/(protected)/(cadastros)/cadastros/_schemas/TPessoaJuridicaSchema.ts create mode 100644 src/app/(protected)/(cadastros)/cadastros/_schemas/TPessoaRepresentante.ts create mode 100644 src/app/(protected)/(cadastros)/cadastros/_services/t_pessoa/juridica/TPessoaJuridicaIndexService.ts create mode 100644 src/app/(protected)/(cadastros)/cadastros/_services/t_pessoa_representante/TPessoaRepresentante.ts diff --git a/eslint.config.js b/eslint.config.js index edf63c9..9a77d70 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -5,19 +5,24 @@ export default [ next, { plugins: { - import: importPlugin + import: importPlugin, }, rules: { "import/order": [ "error", { - groups: ["builtin", "external", "internal", ["parent", "sibling", "index"]], + groups: [ + "builtin", + "external", + "internal", + ["parent", "sibling", "index"], + ], "newlines-between": "always", - alphabetize: { order: "asc", caseInsensitive: true } - } + alphabetize: { order: "asc", caseInsensitive: true }, + }, ], - "semi": ["error", "always"], - "quotes": ["error", "double"] - } - } + semi: ["error", "always"], + quotes: ["error", "double"], + }, + }, ]; diff --git a/package-lock.json b/package-lock.json index 4cc8289..0ca2d05 100644 --- a/package-lock.json +++ b/package-lock.json @@ -53,8 +53,16 @@ "@types/node": "^20", "@types/react": "^19", "@types/react-dom": "^19", + "@typescript-eslint/eslint-plugin": "^8.45.0", + "@typescript-eslint/parser": "^8.45.0", + "eslint": "^8.57.1", "eslint-config-next": "^15.5.4", + "eslint-config-prettier": "^10.1.8", "eslint-plugin-import": "^2.32.0", + "eslint-plugin-prettier": "^5.5.4", + "eslint-plugin-unused-imports": "^4.2.0", + "prettier": "^3.6.2", + "prettier-plugin-tailwindcss": "^0.6.14", "tailwindcss": "^4", "tw-animate-css": "^1.3.7", "typescript": "^5" @@ -148,59 +156,17 @@ "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, - "node_modules/@eslint/config-array": { - "version": "0.21.0", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.0.tgz", - "integrity": "sha512-ENIdc4iLu0d93HeYirvKmrzshzofPw6VkZRKQGe9Nv46ZnWUzcF1xV01dcvEg/1wXUR61OmmlSfyeyO7EvjLxQ==", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@eslint/object-schema": "^2.1.6", - "debug": "^4.3.1", - "minimatch": "^3.1.2" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/config-helpers": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.3.1.tgz", - "integrity": "sha512-xR93k9WhrDYpXHORXpxVL5oHj3Era7wo6k/Wd8/IsQNnZUTzkGS29lyn3nAT05v6ltUuTFVCCYDEGfy2Or/sPA==", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/core": { - "version": "0.15.2", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.15.2.tgz", - "integrity": "sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg==", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@types/json-schema": "^7.0.15" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, "node_modules/@eslint/eslintrc": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", - "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^10.0.1", - "globals": "^14.0.0", + "espree": "^9.6.0", + "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -208,50 +174,20 @@ "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, "node_modules/@eslint/js": { - "version": "9.36.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.36.0.tgz", - "integrity": "sha512-uhCbYtYynH30iZErszX78U+nR3pJU3RHGQ57NXy5QupD4SBVwDeU8TNBy+MjMngc1UyIW9noKqsRqfjQTBU2dw==", + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "url": "https://eslint.org/donate" - } - }, - "node_modules/@eslint/object-schema": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", - "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - } - }, - "node_modules/@eslint/plugin-kit": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.5.tgz", - "integrity": "sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w==", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "dependencies": { - "@eslint/core": "^0.15.2", - "levn": "^0.4.1" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/@faker-js/faker": { @@ -320,30 +256,20 @@ "react-hook-form": "^7.55.0" } }, - "node_modules/@humanfs/core": { - "version": "0.19.1", - "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", - "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "node_modules/@humanwhocodes/config-array": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", + "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", + "deprecated": "Use @eslint/config-array instead", "dev": true, "license": "Apache-2.0", - "peer": true, - "engines": { - "node": ">=18.18.0" - } - }, - "node_modules/@humanfs/node": { - "version": "0.16.7", - "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", - "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", - "dev": true, - "license": "Apache-2.0", - "peer": true, "dependencies": { - "@humanfs/core": "^0.19.1", - "@humanwhocodes/retry": "^0.4.0" + "@humanwhocodes/object-schema": "^2.0.3", + "debug": "^4.3.1", + "minimatch": "^3.0.5" }, "engines": { - "node": ">=18.18.0" + "node": ">=10.10.0" } }, "node_modules/@humanwhocodes/module-importer": { @@ -352,7 +278,6 @@ "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "dev": true, "license": "Apache-2.0", - "peer": true, "engines": { "node": ">=12.22" }, @@ -361,20 +286,13 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@humanwhocodes/retry": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", - "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", + "deprecated": "Use @eslint/object-schema instead", "dev": true, - "license": "Apache-2.0", - "peer": true, - "engines": { - "node": ">=18.18" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } + "license": "BSD-3-Clause" }, "node_modules/@img/colour": { "version": "1.0.0", @@ -1072,6 +990,19 @@ "node": ">=12.4.0" } }, + "node_modules/@pkgr/core": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.9.tgz", + "integrity": "sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/pkgr" + } + }, "node_modules/@radix-ui/number": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@radix-ui/number/-/number-1.1.1.tgz", @@ -2376,14 +2307,6 @@ "tslib": "^2.4.0" } }, - "node_modules/@types/estree": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", - "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", - "dev": true, - "license": "MIT", - "peer": true - }, "node_modules/@types/js-cookie": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/@types/js-cookie/-/js-cookie-3.0.6.tgz", @@ -2391,14 +2314,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/json-schema": { - "version": "7.0.15", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", - "dev": true, - "license": "MIT", - "peer": true - }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", @@ -2455,17 +2370,17 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.44.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.44.1.tgz", - "integrity": "sha512-molgphGqOBT7t4YKCSkbasmu1tb1MgrZ2szGzHbclF7PNmOkSTQVHy+2jXOSnxvR3+Xe1yySHFZoqMpz3TfQsw==", + "version": "8.45.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.45.0.tgz", + "integrity": "sha512-HC3y9CVuevvWCl/oyZuI47dOeDF9ztdMEfMH8/DW/Mhwa9cCLnK1oD7JoTVGW/u7kFzNZUKUoyJEqkaJh5y3Wg==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.44.1", - "@typescript-eslint/type-utils": "8.44.1", - "@typescript-eslint/utils": "8.44.1", - "@typescript-eslint/visitor-keys": "8.44.1", + "@typescript-eslint/scope-manager": "8.45.0", + "@typescript-eslint/type-utils": "8.45.0", + "@typescript-eslint/utils": "8.45.0", + "@typescript-eslint/visitor-keys": "8.45.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -2479,7 +2394,7 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.44.1", + "@typescript-eslint/parser": "^8.45.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } @@ -2495,16 +2410,16 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.44.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.44.1.tgz", - "integrity": "sha512-EHrrEsyhOhxYt8MTg4zTF+DJMuNBzWwgvvOYNj/zm1vnaD/IC5zCXFehZv94Piqa2cRFfXrTFxIvO95L7Qc/cw==", + "version": "8.45.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.45.0.tgz", + "integrity": "sha512-TGf22kon8KW+DeKaUmOibKWktRY8b2NSAZNdtWh798COm1NWx8+xJ6iFBtk3IvLdv6+LGLJLRlyhrhEDZWargQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.44.1", - "@typescript-eslint/types": "8.44.1", - "@typescript-eslint/typescript-estree": "8.44.1", - "@typescript-eslint/visitor-keys": "8.44.1", + "@typescript-eslint/scope-manager": "8.45.0", + "@typescript-eslint/types": "8.45.0", + "@typescript-eslint/typescript-estree": "8.45.0", + "@typescript-eslint/visitor-keys": "8.45.0", "debug": "^4.3.4" }, "engines": { @@ -2520,14 +2435,14 @@ } }, "node_modules/@typescript-eslint/project-service": { - "version": "8.44.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.44.1.tgz", - "integrity": "sha512-ycSa60eGg8GWAkVsKV4E6Nz33h+HjTXbsDT4FILyL8Obk5/mx4tbvCNsLf9zret3ipSumAOG89UcCs/KRaKYrA==", + "version": "8.45.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.45.0.tgz", + "integrity": "sha512-3pcVHwMG/iA8afdGLMuTibGR7pDsn9RjDev6CCB+naRsSYs2pns5QbinF4Xqw6YC/Sj3lMrm/Im0eMfaa61WUg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.44.1", - "@typescript-eslint/types": "^8.44.1", + "@typescript-eslint/tsconfig-utils": "^8.45.0", + "@typescript-eslint/types": "^8.45.0", "debug": "^4.3.4" }, "engines": { @@ -2542,14 +2457,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.44.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.44.1.tgz", - "integrity": "sha512-NdhWHgmynpSvyhchGLXh+w12OMT308Gm25JoRIyTZqEbApiBiQHD/8xgb6LqCWCFcxFtWwaVdFsLPQI3jvhywg==", + "version": "8.45.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.45.0.tgz", + "integrity": "sha512-clmm8XSNj/1dGvJeO6VGH7EUSeA0FMs+5au/u3lrA3KfG8iJ4u8ym9/j2tTEoacAffdW1TVUzXO30W1JTJS7dA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.44.1", - "@typescript-eslint/visitor-keys": "8.44.1" + "@typescript-eslint/types": "8.45.0", + "@typescript-eslint/visitor-keys": "8.45.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2560,9 +2475,9 @@ } }, "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.44.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.44.1.tgz", - "integrity": "sha512-B5OyACouEjuIvof3o86lRMvyDsFwZm+4fBOqFHccIctYgBjqR3qT39FBYGN87khcgf0ExpdCBeGKpKRhSFTjKQ==", + "version": "8.45.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.45.0.tgz", + "integrity": "sha512-aFdr+c37sc+jqNMGhH+ajxPXwjv9UtFZk79k8pLoJ6p4y0snmYpPA52GuWHgt2ZF4gRRW6odsEj41uZLojDt5w==", "dev": true, "license": "MIT", "engines": { @@ -2577,15 +2492,15 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.44.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.44.1.tgz", - "integrity": "sha512-KdEerZqHWXsRNKjF9NYswNISnFzXfXNDfPxoTh7tqohU/PRIbwTmsjGK6V9/RTYWau7NZvfo52lgVk+sJh0K3g==", + "version": "8.45.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.45.0.tgz", + "integrity": "sha512-bpjepLlHceKgyMEPglAeULX1vixJDgaKocp0RVJ5u4wLJIMNuKtUXIczpJCPcn2waII0yuvks/5m5/h3ZQKs0A==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.44.1", - "@typescript-eslint/typescript-estree": "8.44.1", - "@typescript-eslint/utils": "8.44.1", + "@typescript-eslint/types": "8.45.0", + "@typescript-eslint/typescript-estree": "8.45.0", + "@typescript-eslint/utils": "8.45.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -2602,9 +2517,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.44.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.44.1.tgz", - "integrity": "sha512-Lk7uj7y9uQUOEguiDIDLYLJOrYHQa7oBiURYVFqIpGxclAFQ78f6VUOM8lI2XEuNOKNB7XuvM2+2cMXAoq4ALQ==", + "version": "8.45.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.45.0.tgz", + "integrity": "sha512-WugXLuOIq67BMgQInIxxnsSyRLFxdkJEJu8r4ngLR56q/4Q5LrbfkFRH27vMTjxEK8Pyz7QfzuZe/G15qQnVRA==", "dev": true, "license": "MIT", "engines": { @@ -2616,16 +2531,16 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.44.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.44.1.tgz", - "integrity": "sha512-qnQJ+mVa7szevdEyvfItbO5Vo+GfZ4/GZWWDRRLjrxYPkhM+6zYB2vRYwCsoJLzqFCdZT4mEqyJoyzkunsZ96A==", + "version": "8.45.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.45.0.tgz", + "integrity": "sha512-GfE1NfVbLam6XQ0LcERKwdTTPlLvHvXXhOeUGC1OXi4eQBoyy1iVsW+uzJ/J9jtCz6/7GCQ9MtrQ0fml/jWCnA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.44.1", - "@typescript-eslint/tsconfig-utils": "8.44.1", - "@typescript-eslint/types": "8.44.1", - "@typescript-eslint/visitor-keys": "8.44.1", + "@typescript-eslint/project-service": "8.45.0", + "@typescript-eslint/tsconfig-utils": "8.45.0", + "@typescript-eslint/types": "8.45.0", + "@typescript-eslint/visitor-keys": "8.45.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -2701,16 +2616,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.44.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.44.1.tgz", - "integrity": "sha512-DpX5Fp6edTlocMCwA+mHY8Mra+pPjRZ0TfHkXI8QFelIKcbADQz1LUPNtzOFUriBB2UYqw4Pi9+xV4w9ZczHFg==", + "version": "8.45.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.45.0.tgz", + "integrity": "sha512-bxi1ht+tLYg4+XV2knz/F7RVhU0k6VrSMc9sb8DQ6fyCTrGQLHfo7lDtN0QJjZjKkLA2ThrKuCdHEvLReqtIGg==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.44.1", - "@typescript-eslint/types": "8.44.1", - "@typescript-eslint/typescript-estree": "8.44.1" + "@typescript-eslint/scope-manager": "8.45.0", + "@typescript-eslint/types": "8.45.0", + "@typescript-eslint/typescript-estree": "8.45.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2725,13 +2640,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.44.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.44.1.tgz", - "integrity": "sha512-576+u0QD+Jp3tZzvfRfxon0EA2lzcDt3lhUbsC6Lgzy9x2VR4E+JUiNyGHi5T8vk0TV+fpJ5GLG1JsJuWCaKhw==", + "version": "8.45.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.45.0.tgz", + "integrity": "sha512-qsaFBA3e09MIDAGFUrTk+dzqtfv1XPVz8t8d1f0ybTzrCY7BKiMC5cjrl1O/P7UmHsNyW90EYSkU/ZWpmXelag==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.44.1", + "@typescript-eslint/types": "8.45.0", "eslint-visitor-keys": "^4.2.1" }, "engines": { @@ -2742,6 +2657,13 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@ungap/structured-clone": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz", + "integrity": "sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==", + "dev": true, + "license": "ISC" + }, "node_modules/@unrs/resolver-binding-android-arm-eabi": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm-eabi/-/resolver-binding-android-arm-eabi-1.11.1.tgz", @@ -3017,7 +2939,6 @@ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -3031,7 +2952,6 @@ "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, "license": "MIT", - "peer": true, "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -3042,7 +2962,6 @@ "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -3054,13 +2973,22 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -3076,8 +3004,7 @@ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true, - "license": "Python-2.0", - "peer": true + "license": "Python-2.0" }, "node_modules/aria-hidden": { "version": "1.2.6", @@ -3407,7 +3334,6 @@ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=6" } @@ -3438,7 +3364,6 @@ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -3487,18 +3412,20 @@ "node": ">=6" } }, - "node_modules/color": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", - "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "node_modules/cmdk": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/cmdk/-/cmdk-1.1.1.tgz", + "integrity": "sha512-Vsv7kFaXm+ptHDMZ7izaRsP70GgrW9NBNGswt9OZaVBLlE0SNpDq8eu/VGXyF9r7M0azK3Wy7OlYXsuyYLFzHg==", "license": "MIT", - "optional": true, "dependencies": { - "color-convert": "^2.0.1", - "color-string": "^1.9.0" + "@radix-ui/react-compose-refs": "^1.1.1", + "@radix-ui/react-dialog": "^1.1.6", + "@radix-ui/react-id": "^1.1.0", + "@radix-ui/react-primitive": "^2.0.2" }, - "engines": { - "node": ">=12.5.0" + "peerDependencies": { + "react": "^18 || ^19 || ^19.0.0-rc", + "react-dom": "^18 || ^19 || ^19.0.0-rc" } }, "node_modules/color-convert": { @@ -3507,7 +3434,6 @@ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "color-name": "~1.1.4" }, @@ -3520,8 +3446,7 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/concat-map": { "version": "0.0.1", @@ -3558,7 +3483,6 @@ "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -3659,8 +3583,7 @@ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/define-data-property": { "version": "1.1.4", @@ -3955,7 +3878,6 @@ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=10" }, @@ -3964,65 +3886,60 @@ } }, "node_modules/eslint": { - "version": "9.36.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.36.0.tgz", - "integrity": "sha512-hB4FIzXovouYzwzECDcUkJ4OcfOEkXTv2zRY6B9bkwjx/cprAq0uvm1nl7zvQ0/TsUk0zQiN4uPfJpB9m+rPMQ==", + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", + "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", "dev": true, "license": "MIT", - "peer": true, "dependencies": { - "@eslint-community/eslint-utils": "^4.8.0", - "@eslint-community/regexpp": "^4.12.1", - "@eslint/config-array": "^0.21.0", - "@eslint/config-helpers": "^0.3.1", - "@eslint/core": "^0.15.2", - "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "9.36.0", - "@eslint/plugin-kit": "^0.3.5", - "@humanfs/node": "^0.16.6", + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.1", + "@humanwhocodes/config-array": "^0.13.0", "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.4.2", - "@types/estree": "^1.0.6", - "@types/json-schema": "^7.0.15", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.6", + "cross-spawn": "^7.0.2", "debug": "^4.3.2", + "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.4.0", - "eslint-visitor-keys": "^4.2.1", - "espree": "^10.4.0", - "esquery": "^1.5.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^8.0.0", + "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.3" + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { - "url": "https://eslint.org/donate" - }, - "peerDependencies": { - "jiti": "*" - }, - "peerDependenciesMeta": { - "jiti": { - "optional": true - } + "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-config-next": { @@ -4053,6 +3970,22 @@ } } }, + "node_modules/eslint-config-prettier": { + "version": "10.1.8", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz", + "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==", + "dev": true, + "license": "MIT", + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "funding": { + "url": "https://opencollective.com/eslint-config-prettier" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, "node_modules/eslint-import-resolver-node": { "version": "0.3.9", "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", @@ -4222,6 +4155,37 @@ "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9" } }, + "node_modules/eslint-plugin-prettier": { + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.5.4.tgz", + "integrity": "sha512-swNtI95SToIz05YINMA6Ox5R057IMAmWZ26GqPxusAp1TZzj+IdY9tXNWWD3vkF/wEqydCONcwjTFpxybBqZsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.11.7" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-plugin-prettier" + }, + "peerDependencies": { + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "eslint-config-prettier": ">= 7.0.0 <10.0.0 || >=10.1.0", + "prettier": ">=3.0.0" + }, + "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, + "eslint-config-prettier": { + "optional": true + } + } + }, "node_modules/eslint-plugin-react": { "version": "7.37.5", "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.5.tgz", @@ -4296,19 +4260,34 @@ "semver": "bin/semver.js" } }, + "node_modules/eslint-plugin-unused-imports": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-4.2.0.tgz", + "integrity": "sha512-hLbJ2/wnjKq4kGA9AUaExVFIbNzyxYdVo49QZmKCnhk5pc9wcYRbfgLHvWJ8tnsdcseGhoUAddm9gn/lt+d74w==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@typescript-eslint/eslint-plugin": "^8.0.0-0 || ^7.0.0 || ^6.0.0 || ^5.0.0", + "eslint": "^9.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "@typescript-eslint/eslint-plugin": { + "optional": true + } + } + }, "node_modules/eslint-scope": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", - "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "dev": true, "license": "BSD-2-Clause", - "peer": true, "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -4327,20 +4306,58 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/espree": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", - "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", + "node_modules/eslint/node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, - "license": "BSD-2-Clause", - "peer": true, + "license": "Apache-2.0", "dependencies": { - "acorn": "^8.15.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.2.1" + "esutils": "^2.0.2" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": ">=6.0.0" + } + }, + "node_modules/eslint/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -4352,7 +4369,6 @@ "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, "license": "BSD-3-Clause", - "peer": true, "dependencies": { "estraverse": "^5.1.0" }, @@ -4366,7 +4382,6 @@ "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, "license": "BSD-2-Clause", - "peer": true, "dependencies": { "estraverse": "^5.2.0" }, @@ -4405,8 +4420,14 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" + }, + "node_modules/fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true, + "license": "Apache-2.0" }, "node_modules/fast-glob": { "version": "3.3.1", @@ -4443,16 +4464,14 @@ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/fastq": { "version": "1.19.1", @@ -4465,17 +4484,16 @@ } }, "node_modules/file-entry-cache": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", - "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { - "flat-cache": "^4.0.0" + "flat-cache": "^3.0.4" }, "engines": { - "node": ">=16.0.0" + "node": "^10.12.0 || >=12.0.0" } }, "node_modules/fill-range": { @@ -4497,7 +4515,6 @@ "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -4510,18 +4527,18 @@ } }, "node_modules/flat-cache": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", - "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "flatted": "^3.2.9", - "keyv": "^4.5.4" + "keyv": "^4.5.3", + "rimraf": "^3.0.2" }, "engines": { - "node": ">=16" + "node": "^10.12.0 || >=12.0.0" } }, "node_modules/flatted": { @@ -4529,8 +4546,7 @@ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", "dev": true, - "license": "ISC", - "peer": true + "license": "ISC" }, "node_modules/for-each": { "version": "0.3.5", @@ -4548,6 +4564,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, + "license": "ISC" + }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", @@ -4668,13 +4691,34 @@ "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" } }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, "license": "ISC", - "peer": true, "dependencies": { "is-glob": "^4.0.3" }, @@ -4683,14 +4727,16 @@ } }, "node_modules/globals": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", - "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, "license": "MIT", - "peer": true, + "dependencies": { + "type-fest": "^0.20.2" + }, "engines": { - "node": ">=18" + "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -4759,7 +4805,6 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=8" } @@ -4841,7 +4886,6 @@ "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">= 4" } @@ -4852,7 +4896,6 @@ "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -4870,11 +4913,29 @@ "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=0.8.19" } }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, + "license": "ISC" + }, "node_modules/internal-slot": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", @@ -5146,6 +5207,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/is-regex": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", @@ -5303,8 +5374,7 @@ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true, - "license": "ISC", - "peer": true + "license": "ISC" }, "node_modules/iterator.prototype": { "version": "1.1.5", @@ -5343,6 +5413,59 @@ "node": ">=14" } }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, "node_modules/jsonwebtoken": { "version": "9.0.2", "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", @@ -5417,7 +5540,6 @@ "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "json-buffer": "3.0.1" } @@ -5448,7 +5570,6 @@ "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" @@ -5702,7 +5823,6 @@ "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "p-locate": "^5.0.0" }, @@ -5754,8 +5874,7 @@ "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/lodash.once": { "version": "4.1.1", @@ -6133,13 +6252,22 @@ "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", "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", @@ -6176,7 +6304,6 @@ "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "yocto-queue": "^0.1.0" }, @@ -6193,7 +6320,6 @@ "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "p-limit": "^3.0.2" }, @@ -6210,7 +6336,6 @@ "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "callsites": "^3.0.0" }, @@ -6224,18 +6349,26 @@ "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=8" } }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=8" } @@ -6311,11 +6444,126 @@ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz", + "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/prettier-plugin-tailwindcss": { + "version": "0.6.14", + "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.6.14.tgz", + "integrity": "sha512-pi2e/+ZygeIqntN+vC573BcW5Cve8zUB0SSAGxqpB4f96boZF4M3phPVoOFCeypwkpRYdi7+jQ5YJJUwrkGUAg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.21.3" + }, + "peerDependencies": { + "@ianvs/prettier-plugin-sort-imports": "*", + "@prettier/plugin-hermes": "*", + "@prettier/plugin-oxc": "*", + "@prettier/plugin-pug": "*", + "@shopify/prettier-plugin-liquid": "*", + "@trivago/prettier-plugin-sort-imports": "*", + "@zackad/prettier-plugin-twig": "*", + "prettier": "^3.0", + "prettier-plugin-astro": "*", + "prettier-plugin-css-order": "*", + "prettier-plugin-import-sort": "*", + "prettier-plugin-jsdoc": "*", + "prettier-plugin-marko": "*", + "prettier-plugin-multiline-arrays": "*", + "prettier-plugin-organize-attributes": "*", + "prettier-plugin-organize-imports": "*", + "prettier-plugin-sort-imports": "*", + "prettier-plugin-style-order": "*", + "prettier-plugin-svelte": "*" + }, + "peerDependenciesMeta": { + "@ianvs/prettier-plugin-sort-imports": { + "optional": true + }, + "@prettier/plugin-hermes": { + "optional": true + }, + "@prettier/plugin-oxc": { + "optional": true + }, + "@prettier/plugin-pug": { + "optional": true + }, + "@shopify/prettier-plugin-liquid": { + "optional": true + }, + "@trivago/prettier-plugin-sort-imports": { + "optional": true + }, + "@zackad/prettier-plugin-twig": { + "optional": true + }, + "prettier-plugin-astro": { + "optional": true + }, + "prettier-plugin-css-order": { + "optional": true + }, + "prettier-plugin-import-sort": { + "optional": true + }, + "prettier-plugin-jsdoc": { + "optional": true + }, + "prettier-plugin-marko": { + "optional": true + }, + "prettier-plugin-multiline-arrays": { + "optional": true + }, + "prettier-plugin-organize-attributes": { + "optional": true + }, + "prettier-plugin-organize-imports": { + "optional": true + }, + "prettier-plugin-sort-imports": { + "optional": true + }, + "prettier-plugin-style-order": { + "optional": true + }, + "prettier-plugin-svelte": { + "optional": true + } + } + }, "node_modules/prop-types": { "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", @@ -6333,7 +6581,6 @@ "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=6" } @@ -6548,7 +6795,6 @@ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=4" } @@ -6574,6 +6820,23 @@ "node": ">=0.10.0" } }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -6789,7 +7052,6 @@ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "shebang-regex": "^3.0.0" }, @@ -6803,7 +7065,6 @@ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=8" } @@ -7037,6 +7298,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", @@ -7053,7 +7327,6 @@ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=8" }, @@ -7090,7 +7363,6 @@ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -7111,6 +7383,22 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/synckit": { + "version": "0.11.11", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.11.11.tgz", + "integrity": "sha512-MeQTA1r0litLUf0Rp/iisCaL8761lKAZHaimlbGK4j0HysC4PLfqygQj9srcs0m2RdtDYnF8UuYyKpbjHYp7Jw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@pkgr/core": "^0.2.9" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/synckit" + } + }, "node_modules/tailwind-merge": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.3.1.tgz", @@ -7159,6 +7447,13 @@ "node": ">=18" } }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true, + "license": "MIT" + }, "node_modules/tinyglobby": { "version": "0.2.15", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", @@ -7274,7 +7569,6 @@ "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "prelude-ls": "^1.2.1" }, @@ -7282,6 +7576,19 @@ "node": ">= 0.8.0" } }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/typed-array-buffer": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", @@ -7441,7 +7748,6 @@ "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, "license": "BSD-2-Clause", - "peer": true, "dependencies": { "punycode": "^2.1.0" } @@ -7504,7 +7810,6 @@ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "license": "ISC", - "peer": true, "dependencies": { "isexe": "^2.0.0" }, @@ -7610,11 +7915,17 @@ "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, "license": "MIT", - "peer": true, "engines": { "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", @@ -7631,7 +7942,6 @@ "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=10" }, diff --git a/package.json b/package.json index f8de18b..c482f23 100644 --- a/package.json +++ b/package.json @@ -55,8 +55,16 @@ "@types/node": "^20", "@types/react": "^19", "@types/react-dom": "^19", + "@typescript-eslint/eslint-plugin": "^8.45.0", + "@typescript-eslint/parser": "^8.45.0", + "eslint": "^8.57.1", "eslint-config-next": "^15.5.4", + "eslint-config-prettier": "^10.1.8", "eslint-plugin-import": "^2.32.0", + "eslint-plugin-prettier": "^5.5.4", + "eslint-plugin-unused-imports": "^4.2.0", + "prettier": "^3.6.2", + "prettier-plugin-tailwindcss": "^0.6.14", "tailwindcss": "^4", "tw-animate-css": "^1.3.7", "typescript": "^5" diff --git a/src/actions/CNPJ/FormatCNPJ.ts b/src/actions/CNPJ/FormatCNPJ.ts new file mode 100644 index 0000000..b62487f --- /dev/null +++ b/src/actions/CNPJ/FormatCNPJ.ts @@ -0,0 +1,23 @@ +/** + * Formata um número de CNPJ no padrão 99.999.999/9999-99 + * + * @param value - CNPJ em string ou number + * @returns CNPJ formatado ou string parcial se incompleto + */ +export function FormatCNPJ(value: string | number): string { + if (!value) return ""; + + // Converte para string e remove tudo que não seja número + const digits = String(value).replace(/\D/g, ""); + + // Garante que tenha no máximo 14 dígitos + const cleanValue = digits.slice(0, 14); + + // Retorna parcialmente formatado se ainda não tiver 14 dígitos + if (cleanValue.length < 14) return cleanValue; + + return cleanValue.replace( + /(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})/, + "$1.$2.$3/$4-$5", + ); +} diff --git a/src/actions/CPF/FormatCPF.ts b/src/actions/CPF/FormatCPF.ts index f002b4d..2ffbdcf 100644 --- a/src/actions/CPF/FormatCPF.ts +++ b/src/actions/CPF/FormatCPF.ts @@ -1,23 +1,20 @@ /** * Formata um número de CPF no padrão 999.999.999-99 - * + * * @param value - CPF em string ou number * @returns CPF formatado ou string vazia se inválido */ export function FormatCPF(value: string | number): string { - if (!value) return ""; + if (!value) return ""; - // Converte para string e remove tudo que não seja número - const digits = String(value).replace(/\D/g, ""); + // Converte para string e remove tudo que não seja número + const digits = String(value).replace(/\D/g, ""); - // Garante que tenha no máximo 11 dígitos - const cleanValue = digits.slice(0, 11); + // Garante que tenha no máximo 11 dígitos + const cleanValue = digits.slice(0, 11); - // Retorna formatado ou vazio se não tiver tamanho suficiente - if (cleanValue.length !== 11) return cleanValue; + // Retorna formatado ou vazio se não tiver tamanho suficiente + if (cleanValue.length !== 11) return cleanValue; - return cleanValue.replace( - /(\d{3})(\d{3})(\d{3})(\d{2})/, - "$1.$2.$3-$4" - ); + return cleanValue.replace(/(\d{3})(\d{3})(\d{3})(\d{2})/, "$1.$2.$3-$4"); } diff --git a/src/actions/dateTime/FormatDateTime.ts b/src/actions/dateTime/FormatDateTime.ts index 5fce2b9..f5a8d93 100644 --- a/src/actions/dateTime/FormatDateTime.ts +++ b/src/actions/dateTime/FormatDateTime.ts @@ -1,53 +1,55 @@ /** * Formata uma data e hora brasileira (DD/MM/YYYY HH:mm) - * + * * Suporta: * - Entrada como string, Date ou number (timestamp) * - Dados incompletos (apenas dia/mês, sem hora, etc.) * - Retorna "-" se vazio ou inválido - * + * * @param value - Data ou hora em string, Date ou timestamp * @returns Data formatada no padrão DD/MM/YYYY HH:mm ou parcial */ -export function FormatDateTime(value: string | Date | number | null | undefined): string { - if (!value) return "-"; +export function FormatDateTime( + value: string | Date | number | null | undefined, +): string { + if (!value) return "-"; - let date: Date; + let date: Date; - // Converte entrada para Date - if (value instanceof Date) { - date = value; - } else if (typeof value === "number") { - date = new Date(value); - } else if (typeof value === "string") { - // Remove caracteres extras e tenta criar Date - const cleanValue = value.trim().replace(/[^0-9]/g, ""); + // Converte entrada para Date + if (value instanceof Date) { + date = value; + } else if (typeof value === "number") { + date = new Date(value); + } else if (typeof value === "string") { + // Remove caracteres extras e tenta criar Date + const cleanValue = value.trim().replace(/[^0-9]/g, ""); - if (cleanValue.length === 8) { - // DDMMYYYY - const day = parseInt(cleanValue.slice(0, 2), 10); - const month = parseInt(cleanValue.slice(2, 4), 10) - 1; - const year = parseInt(cleanValue.slice(4, 8), 10); - date = new Date(year, month, day); - } else { - // Tenta parse padrão - const parsed = new Date(value); - if (isNaN(parsed.getTime())) return "-"; - date = parsed; - } + if (cleanValue.length === 8) { + // DDMMYYYY + const day = parseInt(cleanValue.slice(0, 2), 10); + const month = parseInt(cleanValue.slice(2, 4), 10) - 1; + const year = parseInt(cleanValue.slice(4, 8), 10); + date = new Date(year, month, day); } else { - return "-"; + // Tenta parse padrão + const parsed = new Date(value); + if (isNaN(parsed.getTime())) return "-"; + date = parsed; } + } else { + return "-"; + } - // Extrai partes da data - const day = date.getDate().toString().padStart(2, "0"); - const month = (date.getMonth() + 1).toString().padStart(2, "0"); - const year = date.getFullYear(); - const hours = date.getHours().toString().padStart(2, "0"); - const minutes = date.getMinutes().toString().padStart(2, "0"); + // Extrai partes da data + const day = date.getDate().toString().padStart(2, "0"); + const month = (date.getMonth() + 1).toString().padStart(2, "0"); + const year = date.getFullYear(); + const hours = date.getHours().toString().padStart(2, "0"); + const minutes = date.getMinutes().toString().padStart(2, "0"); - // Monta string parcialmente, dependendo da hora estar disponível - const hasTime = !(hours === "00" && minutes === "00"); + // Monta string parcialmente, dependendo da hora estar disponível + const hasTime = !(hours === "00" && minutes === "00"); - return `${day}/${month}/${year}${hasTime ? ` ${hours}:${minutes}` : ""}`; + return `${day}/${month}/${year}${hasTime ? ` ${hours}:${minutes}` : ""}`; } diff --git a/src/actions/phone/FormatPhone.ts b/src/actions/phone/FormatPhone.ts index e87bbcb..1be97e6 100644 --- a/src/actions/phone/FormatPhone.ts +++ b/src/actions/phone/FormatPhone.ts @@ -1,47 +1,51 @@ /** * Formata um número de telefone brasileiro. - * + * * Suporta: * - Com ou sem DDD * - Números incompletos * - Telefones com 8 ou 9 dígitos - * + * * @param value - Número de telefone em string ou number * @returns Telefone formatado ou "-" se vazio */ export function FormatPhone(value: string | number): string { - if (!value) return "-"; + if (!value) return "-"; - // Converte para string e remove tudo que não for número - const digits = String(value).replace(/\D/g, ""); + // Converte para string e remove tudo que não for número + const digits = String(value).replace(/\D/g, ""); - // Se não tiver nada após limpar, retorna "-" - if (digits.length === 0) return "-"; + // Se não tiver nada após limpar, retorna "-" + if (digits.length === 0) return "-"; - // Garante no máximo 11 dígitos - const cleanValue = digits.slice(0, 11); + // Garante no máximo 11 dígitos + const cleanValue = digits.slice(0, 11); - // ------------------------------- - // SEM DDD - // ------------------------------- - if (cleanValue.length <= 8) { - // Até 8 dígitos → formato parcial - return cleanValue.replace(/(\d{4})(\d{0,4})/, "$1-$2").replace(/-$/, ""); - } + // ------------------------------- + // SEM DDD + // ------------------------------- + if (cleanValue.length <= 8) { + // Até 8 dígitos → formato parcial + return cleanValue.replace(/(\d{4})(\d{0,4})/, "$1-$2").replace(/-$/, ""); + } - // ------------------------------- - // COM DDD - // ------------------------------- - if (cleanValue.length === 9 || cleanValue.length === 10) { - // DDD + telefone de 8 dígitos - return cleanValue.replace(/^(\d{2})(\d{4})(\d{0,4})$/, "($1) $2-$3").replace(/-$/, ""); - } + // ------------------------------- + // COM DDD + // ------------------------------- + if (cleanValue.length === 9 || cleanValue.length === 10) { + // DDD + telefone de 8 dígitos + return cleanValue + .replace(/^(\d{2})(\d{4})(\d{0,4})$/, "($1) $2-$3") + .replace(/-$/, ""); + } - if (cleanValue.length === 11) { - // DDD + telefone de 9 dígitos - return cleanValue.replace(/^(\d{2})(\d{5})(\d{0,4})$/, "($1) $2-$3").replace(/-$/, ""); - } + if (cleanValue.length === 11) { + // DDD + telefone de 9 dígitos + return cleanValue + .replace(/^(\d{2})(\d{5})(\d{0,4})$/, "($1) $2-$3") + .replace(/-$/, ""); + } - // Caso genérico, se não cair em nenhuma regra - return cleanValue; + // Caso genérico, se não cair em nenhuma regra + return cleanValue; } diff --git a/src/actions/text/GetCapitalize.ts b/src/actions/text/GetCapitalize.ts index 42e2caa..6b15784 100644 --- a/src/actions/text/GetCapitalize.ts +++ b/src/actions/text/GetCapitalize.ts @@ -1,6 +1,6 @@ /** * Capitaliza a primeira letra de uma string. - * + * * @param text - Texto que será capitalizado * @returns String com a primeira letra em maiúscula */ diff --git a/src/actions/text/GetNameInitials.ts b/src/actions/text/GetNameInitials.ts index a9518e8..d8230cb 100644 --- a/src/actions/text/GetNameInitials.ts +++ b/src/actions/text/GetNameInitials.ts @@ -1,16 +1,16 @@ export default function GetNameInitials(data?: string): string { - if (!data) return ""; + if (!data) return ""; - // Remove espaços extras no início e no fim e divide em palavras - const palavras = data.trim().split(/\s+/); + // Remove espaços extras no início e no fim e divide em palavras + const palavras = data.trim().split(/\s+/); - if (palavras.length === 0) return ""; + if (palavras.length === 0) return ""; - if (palavras.length === 1) { - // Apenas uma palavra → retorna as duas primeiras letras - return palavras[0].substring(0, 2).toUpperCase(); - } + if (palavras.length === 1) { + // Apenas uma palavra → retorna as duas primeiras letras + return palavras[0].substring(0, 2).toUpperCase(); + } - // Duas ou mais palavras → retorna a primeira letra das duas primeiras palavras - return (palavras[0].charAt(0) + palavras[1].charAt(0)).toUpperCase(); -} \ No newline at end of file + // Duas ou mais palavras → retorna a primeira letra das duas primeiras palavras + return (palavras[0].charAt(0) + palavras[1].charAt(0)).toUpperCase(); +} diff --git a/src/actions/validations/empty.ts b/src/actions/validations/empty.ts index a64b7c8..468b4ab 100644 --- a/src/actions/validations/empty.ts +++ b/src/actions/validations/empty.ts @@ -1,9 +1,9 @@ /** * Verifica se um valor é vazio, null ou undefined - * + * * @param data - Qualquer valor * @returns true se estiver vazio, null ou undefined */ export default function empty(data: unknown): boolean { - return data == null || data === "" || data === false; + return data == null || data === "" || data === false; } diff --git a/src/app/(protected)/(cadastros)/cadastros/(t_pessoa)/pessoa/fisica/page.tsx b/src/app/(protected)/(cadastros)/cadastros/(t_pessoa)/pessoa/fisica/page.tsx index 6ea43b2..3eee0f5 100644 --- a/src/app/(protected)/(cadastros)/cadastros/(t_pessoa)/pessoa/fisica/page.tsx +++ b/src/app/(protected)/(cadastros)/cadastros/(t_pessoa)/pessoa/fisica/page.tsx @@ -1,4 +1,4 @@ -'use client'; +"use client"; import React, { useEffect, useState, useCallback } from "react"; @@ -17,153 +17,157 @@ import TPessoaInterface from "../../../_interfaces/TPessoaInterface"; import Header from "@/app/_components/structure/Header"; export default function TPessoaFisica() { + // Controle de estado do botão + const [buttonIsLoading, setButtonIsLoading] = useState(false); - // Controle de estado do botão - const [buttonIsLoading, setButtonIsLoading] = useState(false); + // Hooks para leitura e salvamento + const { tPessoa, fetchTPessoa } = useTPessoaIndexHook(); + const { saveTCensec } = useTPessoaSaveHook(); + const { deleteTCensec } = useTPessoaDeleteHook(); - // Hooks para leitura e salvamento - const { tPessoa, fetchTPessoa } = useTPessoaIndexHook(); - const { saveTCensec } = useTPessoaSaveHook(); - const { deleteTCensec } = useTPessoaDeleteHook(); + // Estados + const [selectedAndamento, setSelectedAndamento] = + useState(null); + const [isFormOpen, setIsFormOpen] = useState(false); - // Estados - const [selectedAndamento, setSelectedAndamento] = useState(null); - const [isFormOpen, setIsFormOpen] = useState(false); + // Estado para saber qual item será deletado + const [itemToDelete, setItemToDelete] = useState( + null, + ); - // Estado para saber qual item será deletado - const [itemToDelete, setItemToDelete] = useState(null); + /** + * Hook do modal de confirmação + */ + const { + isOpen: isConfirmOpen, + openDialog: openConfirmDialog, + handleConfirm, + handleCancel, + } = useConfirmDialog(); - /** - * Hook do modal de confirmação - */ - const { - isOpen: isConfirmOpen, - openDialog: openConfirmDialog, - handleConfirm, - handleCancel, - } = useConfirmDialog(); + /** + * Abre o formulário no modo de edição ou criação + */ + const handleOpenForm = useCallback((data: TPessoaInterface | null) => { + setSelectedAndamento(data); + setIsFormOpen(true); + }, []); - /** - * Abre o formulário no modo de edição ou criação - */ - const handleOpenForm = useCallback((data: TPessoaInterface | null) => { - setSelectedAndamento(data); - setIsFormOpen(true); - }, []); + /** + * Fecha o formulário e limpa o andamento selecionado + */ + const handleCloseForm = useCallback(() => { + setSelectedAndamento(null); + setIsFormOpen(false); + }, []); - /** - * Fecha o formulário e limpa o andamento selecionado - */ - const handleCloseForm = useCallback(() => { - setSelectedAndamento(null); - setIsFormOpen(false); - }, []); + /** + * Salva os dados do formulário + */ + const handleSave = useCallback( + async (formData: TPessoaInterface) => { + // Coloca o botão em estado de loading + setButtonIsLoading(true); - /** - * Salva os dados do formulário - */ - const handleSave = useCallback(async (formData: TPessoaInterface) => { + // Aguarda salvar o registro + await saveTCensec(formData); - // Coloca o botão em estado de loading - setButtonIsLoading(true); + // Remove o botão em estado de loading + setButtonIsLoading(false); - // Aguarda salvar o registro - await saveTCensec(formData); + // Atualiza a lista de dados + fetchTPessoa(); + }, + [saveTCensec, fetchTPessoa, handleCloseForm], + ); - // Remove o botão em estado de loading - setButtonIsLoading(false); + /** + * Quando o usuário clica em "remover" na tabela + */ + const handleConfirmDelete = useCallback( + (item: TPessoaInterface) => { + // Define o item atual para remoção + setItemToDelete(item); - // Atualiza a lista de dados - fetchTPessoa(); + // Abre o modal de confirmação + openConfirmDialog(); + }, + [openConfirmDialog], + ); - }, [saveTCensec, fetchTPessoa, handleCloseForm]); + /** + * Executa a exclusão de fato quando o usuário confirma + */ + const handleDelete = useCallback(async () => { + // Protege contra null + if (!itemToDelete) return; - /** - * Quando o usuário clica em "remover" na tabela - */ - const handleConfirmDelete = useCallback((item: TPessoaInterface) => { + // Executa o Hook de remoção + await deleteTCensec(itemToDelete); - // Define o item atual para remoção - setItemToDelete(item); + // Atualiza a lista + await fetchTPessoa(); - // Abre o modal de confirmação - openConfirmDialog(); + // Limpa o item selecionado + setItemToDelete(null); - }, [openConfirmDialog]); + // Fecha o modal + handleCancel(); + }, [itemToDelete, fetchTPessoa, handleCancel]); - /** - * Executa a exclusão de fato quando o usuário confirma - */ - const handleDelete = useCallback(async () => { + /** + * Busca inicial dos dados + */ + useEffect(() => { + fetchTPessoa(); + }, []); - // Protege contra null - if (!itemToDelete) return; + /** + * Tela de loading enquanto carrega os dados + */ + if (tPessoa.length == 0) { + return ; + } - // Executa o Hook de remoção - await deleteTCensec(itemToDelete); + return ( +
+ {/* Cabeçalho */} +
{ + handleOpenForm(null); + }} + /> - // Atualiza a lista - await fetchTPessoa(); + {/* Tabela de Registros */} + - // Limpa o item selecionado - setItemToDelete(null); + {/* Modal de confirmação */} + - // Fecha o modal - handleCancel(); - - }, [itemToDelete, fetchTPessoa, handleCancel]); - - /** - * Busca inicial dos dados - */ - useEffect(() => { - fetchTPessoa(); - }, []); - - /** - * Tela de loading enquanto carrega os dados - */ - if (tPessoa.length == 0) { - return ; - } - - return ( -
- {/* Cabeçalho */} -
{ handleOpenForm(null) }} - /> - - {/* Tabela de Registros */} - - - {/* Modal de confirmação */} - - - {/* Formulário de criação/edição */} - -
- ); -} \ No newline at end of file + {/* Formulário de criação/edição */} + +
+ ); +} diff --git a/src/app/(protected)/(cadastros)/cadastros/(t_pessoa)/pessoa/juridica/page.tsx b/src/app/(protected)/(cadastros)/cadastros/(t_pessoa)/pessoa/juridica/page.tsx new file mode 100644 index 0000000..6827ad1 --- /dev/null +++ b/src/app/(protected)/(cadastros)/cadastros/(t_pessoa)/pessoa/juridica/page.tsx @@ -0,0 +1,173 @@ +"use client"; + +import React, { useEffect, useState, useCallback } from "react"; + +import Loading from "@/app/_components/loading/loading"; + +import { useTPessoaSaveHook } from "../../../_hooks/t_pessoa/useTPessoaSaveHook"; +import { useTPessoaDeleteHook } from "../../../_hooks/t_pessoa/useTPessoaDeleteHook"; + +import ConfirmDialog from "@/app/_components/confirm_dialog/ConfirmDialog"; +import { useConfirmDialog } from "@/app/_components/confirm_dialog/useConfirmDialog"; + +import TPessoaInterface from "../../../_interfaces/TPessoaInterface"; +import Header from "@/app/_components/structure/Header"; +import TPessoaJuridicaTable from "../../../_components/t_pessoa/juridica/TPessoaJuridicaTable"; +import { useTPessoaJuridicaIndexHook } from "../../../_hooks/t_pessoa/juridica/useTPessoaJuridicaIndexHook"; +import TPessoaJuridicaForm from "../../../_components/t_pessoa/juridica/TPessoaJuridicaForm"; + +export default function TPessoaFisica() { + // Controle de estado do botão + const [buttonIsLoading, setButtonIsLoading] = useState(false); + + // Hooks para leitura e salvamento + const { tPessoa, fetchTPessoa } = useTPessoaJuridicaIndexHook(); + const { saveTCensec } = useTPessoaSaveHook(); + const { deleteTCensec } = useTPessoaDeleteHook(); + + // Estados + const [selectedAndamento, setSelectedAndamento] = + useState(null); + const [isFormOpen, setIsFormOpen] = useState(false); + + // Estado para saber qual item será deletado + const [itemToDelete, setItemToDelete] = useState( + null, + ); + + /** + * Hook do modal de confirmação + */ + const { + isOpen: isConfirmOpen, + openDialog: openConfirmDialog, + handleConfirm, + handleCancel, + } = useConfirmDialog(); + + /** + * Abre o formulário no modo de edição ou criação + */ + const handleOpenForm = useCallback((data: TPessoaInterface | null) => { + setSelectedAndamento(data); + setIsFormOpen(true); + }, []); + + /** + * Fecha o formulário e limpa o andamento selecionado + */ + const handleCloseForm = useCallback(() => { + setSelectedAndamento(null); + setIsFormOpen(false); + }, []); + + /** + * Salva os dados do formulário + */ + const handleSave = useCallback( + async (formData: TPessoaInterface) => { + // Coloca o botão em estado de loading + setButtonIsLoading(true); + + // Aguarda salvar o registro + await saveTCensec(formData); + + // Remove o botão em estado de loading + setButtonIsLoading(false); + + // Atualiza a lista de dados + fetchTPessoa(); + }, + [saveTCensec, fetchTPessoa, handleCloseForm], + ); + + /** + * Quando o usuário clica em "remover" na tabela + */ + const handleConfirmDelete = useCallback( + (item: TPessoaInterface) => { + // Define o item atual para remoção + setItemToDelete(item); + + // Abre o modal de confirmação + openConfirmDialog(); + }, + [openConfirmDialog], + ); + + /** + * Executa a exclusão de fato quando o usuário confirma + */ + const handleDelete = useCallback(async () => { + // Protege contra null + if (!itemToDelete) return; + + // Executa o Hook de remoção + await deleteTCensec(itemToDelete); + + // Atualiza a lista + await fetchTPessoa(); + + // Limpa o item selecionado + setItemToDelete(null); + + // Fecha o modal + handleCancel(); + }, [itemToDelete, fetchTPessoa, handleCancel]); + + /** + * Busca inicial dos dados + */ + useEffect(() => { + fetchTPessoa(); + }, []); + + /** + * Tela de loading enquanto carrega os dados + */ + if (tPessoa.length == 0) { + return ; + } + + return ( +
+ {/* Cabeçalho */} +
{ + handleOpenForm(null); + }} + /> + + {/* Tabela de Registros */} + + + {/* Modal de confirmação */} + + + {/* Formulário de criação/edição */} + +
+ ); +} diff --git a/src/app/(protected)/(cadastros)/cadastros/_components/g_cidade/GCidadeForm.tsx b/src/app/(protected)/(cadastros)/cadastros/_components/g_cidade/GCidadeForm.tsx index 8a64225..1705324 100644 --- a/src/app/(protected)/(cadastros)/cadastros/_components/g_cidade/GCidadeForm.tsx +++ b/src/app/(protected)/(cadastros)/cadastros/_components/g_cidade/GCidadeForm.tsx @@ -34,7 +34,7 @@ import { SelectContent, SelectItem, SelectTrigger, - SelectValue + SelectValue, } from "@/components/ui/select"; // Define o tipo do formulário com base no schema Zod @@ -50,38 +50,34 @@ interface Props { // Componente principal do formulário export default function GCidadeForm({ isOpen, data, onClose, onSave }: Props) { + // + const { gUf, fetchGUf } = useGUfReadHook(); - // - const { gUf, fetchGUf } = useGUfReadHook(); + // Inicializa o react-hook-form integrado ao Zod para validação + const form = useForm({ + resolver: zodResolver(GCidadeSchema), + defaultValues: { + cidade_id: 0, + uf: "", + cidade_nome: "", + codigo_ibge: "", + codigo_gyn: "", + }, + }); - // Inicializa o react-hook-form integrado ao Zod para validação - const form = useForm({ - resolver: zodResolver(GCidadeSchema), - defaultValues: { - cidade_id: 0, - uf: "", - cidade_nome: "", - codigo_ibge: "", - codigo_gyn: "" - }, - }); + // Quando recebe dados para edição, atualiza os valores do formulário + useEffect(() => { + // Se existir dados, reseta o formulário com os dados informados + if (data) form.reset(data); - // Quando recebe dados para edição, atualiza os valores do formulário - useEffect(() => { + const loadData = async () => { + // Aguarda a busca terminar + await fetchGUf(); + }; - // Se existir dados, reseta o formulário com os dados informados - if (data) form.reset(data); - - const loadData = async () => { - - // Aguarda a busca terminar - await fetchGUf(); - }; - - // Dispara a função - loadData(); - - }, [data, form]); + // Dispara a função + loadData(); + }, [data, form]); return ( - {/* Tipo */} - ( - - - UF - - - - - )} - /> + {/* Tipo */} + ( + + UF + + + + )} + /> {/* Rodapé do diálogo com botões */} diff --git a/src/app/(protected)/(cadastros)/cadastros/_components/t_pessoa/TPessoaForm.tsx b/src/app/(protected)/(cadastros)/cadastros/_components/t_pessoa/TPessoaForm.tsx index 5c00dfc..e72ffc1 100644 --- a/src/app/(protected)/(cadastros)/cadastros/_components/t_pessoa/TPessoaForm.tsx +++ b/src/app/(protected)/(cadastros)/cadastros/_components/t_pessoa/TPessoaForm.tsx @@ -1,4 +1,4 @@ -'use client'; +"use client"; import z from "zod"; import React, { useEffect } from "react"; @@ -7,856 +7,968 @@ import { zodResolver } from "@hookform/resolvers/zod"; import { Button } from "@/components/ui/button"; import { - Dialog, - DialogClose, - DialogContent, - DialogDescription, - DialogFooter, - DialogHeader, - DialogTitle + Dialog, + DialogClose, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, } from "@/components/ui/dialog"; import { - Form, - FormControl, - FormField, - FormItem, - FormLabel, - FormMessage + Form, + FormControl, + FormField, + FormItem, + FormLabel, + FormMessage, } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; import { TPessoaSchema } from "../../_schemas/TPessoaSchema"; import LoadingButton from "@/app/_components/loadingButton/LoadingButton"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; -import { CheckIcon, ChevronsUpDownIcon, HouseIcon, IdCardIcon, UserIcon } from "lucide-react"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; +import { + CheckIcon, + ChevronsUpDownIcon, + HouseIcon, + IdCardIcon, + UserIcon, +} from "lucide-react"; import { Sexo } from "@/enums/SexoEnum"; import { useGTBEstadoCivilReadHook } from "../../_hooks/g_tb_estadocivil/useGTBEstadoCivilReadHook"; import GetCapitalize from "@/actions/text/GetCapitalize"; import { useGTBRegimeComunhaoReadHook } from "../../_hooks/g_tb_regimecomunhao/useGTBRegimeComunhaoReadHook"; import { useGTBProfissaoReadHook } from "../../_hooks/g_tb_profissao/useGTBProfissaoReadHook"; -import ComboBoxField from "@/app/_components/comboBox/ComboBoxField"; -import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"; -import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "@/components/ui/command"; +import { + Popover, + PopoverContent, + PopoverTrigger, +} from "@/components/ui/popover"; +import { + Command, + CommandEmpty, + CommandGroup, + CommandInput, + CommandItem, + CommandList, +} from "@/components/ui/command"; import { cn } from "@/lib/utils"; type FormValues = z.infer; interface TPessoaFormProps { - isOpen: boolean; - data: FormValues | null; - onClose: (item: null, isFormStatus: boolean) => void; - onSave: (data: FormValues) => void; - buttonIsLoading: boolean; + isOpen: boolean; + data: FormValues | null; + onClose: (item: null, isFormStatus: boolean) => void; + onSave: (data: FormValues) => void; + buttonIsLoading: boolean; } -export default function TCensecForm({ isOpen, data, onClose, onSave, buttonIsLoading }: TPessoaFormProps) { +export default function TCensecForm({ + isOpen, + data, + onClose, + onSave, + buttonIsLoading, +}: TPessoaFormProps) { + const { gTBProfissao, fetchGTBProfissao } = useGTBProfissaoReadHook(); + const { gTBEstadoCivil, fetchGTBEstadoCivil } = useGTBEstadoCivilReadHook(); + const { gTBRegimeComunhao, fetchGTBRegimeComunhao } = + useGTBRegimeComunhaoReadHook(); - const { gTBProfissao, fetchGTBProfissao } = useGTBProfissaoReadHook(); - const { gTBEstadoCivil, fetchGTBEstadoCivil } = useGTBEstadoCivilReadHook(); - const { gTBRegimeComunhao, fetchGTBRegimeComunhao } = useGTBRegimeComunhaoReadHook(); + // Inicializa o react-hook-form com schema zod + const form = useForm({ + resolver: zodResolver(TPessoaSchema), + defaultValues: { + nome: "", + pessoa_id: 0, + }, + }); - // Inicializa o react-hook-form com schema zod - const form = useForm({ - resolver: zodResolver(TPessoaSchema), - defaultValues: { - nome: "", - pessoa_id: 0, - }, - }); + // Atualiza o formulário quando recebe dados para edição + useEffect(() => { + // Função para carregar os dados de forma sincrona + const loadData = async () => { + // Se existir dados, reseta o formulário com os dados informados + if (data) form.reset(data); - // Atualiza o formulário quando recebe dados para edição - useEffect(() => { + // Aguarda a busca terminar + await fetchGTBProfissao(); + await fetchGTBEstadoCivil(); + await fetchGTBRegimeComunhao(); + }; - const loadData = async () => { + // Dispara a função + loadData(); + }, [data, form]); - // Se existir dados, reseta o formulário com os dados informados - if (data) form.reset(data); + return ( + { + if (!open) onClose(null, false); + }} + > + + + Pessoa + Preencha os dados da pessoa + - // Aguarda a busca terminar - await fetchGTBProfissao(); - await fetchGTBEstadoCivil(); - await fetchGTBRegimeComunhao(); - }; +
+ + {/* Tabs */} + + + + + Dados Pessoais + + + Endereço + + + Documentos + + - // Dispara a função - loadData(); + {/* Dados Pessoais */} + +
+ {/* Nome */} +
+ ( + + Nome + + + + + + )} + /> +
+ {/* Data de Nascimento */} +
+ ( + + Data de Nascimento + + + + + + )} + /> +
+ {/* Sexo */} +
+ ( + + Sexo + + + + + + )} + /> +
+ {/* Nacionalidade */} +
+ ( + + Nacionalidade + + + + + + )} + /> +
+ {/* País de Nascimento */} +
+ ( + + País de Nascimento + + + + + + )} + /> +
+ {/* UF */} +
+ ( + + UF + + + + + + )} + /> +
+ {/* Município */} +
+ ( + + Município + + + + + + )} + /> +
+ {/* Naturalidade */} +
+ ( + + Naturalidade + + + + + + )} + /> +
- }, [data, form]); - - return ( - { - if (!open) onClose(null, false); - }} - > - - - - - Pessoa - - - Preencha os dados da pessoa - - - - - - - {/* Tabs */} - - - - - Dados Pessoais - - - Endereço - - - Documentos - - - - {/* Dados Pessoais */} - -
- {/* Nome */} -
- ( - - - Nome - - - - - - + {/* Estado Civil */} +
+ { + const [open, setOpen] = React.useState(false); + return ( + + Estado Civil + + + + + + + + + + + + Nenhum resultado encontrado. + + + {gTBEstadoCivil?.map((item) => ( + { + field.onChange( + Number(item.tb_estadocivil_id), + ); + setOpen(false); + }} + > + -
- {/* Data de Nascimento */} -
- ( - - - Data de Nascimento - - - - - - - )} - /> -
- {/* Sexo */} -
- ( - - Sexo - - - - - - )} - /> -
- {/* Nacionalidade */} -
- ( - - - Nacionalidade - - - - - - - )} - /> -
- {/* País de Nascimento */} -
- ( - - - País de Nascimento - - - - - - - )} - /> -
- {/* UF */} -
- ( - - - UF - - - - - - - )} - /> -
- {/* Município */} -
- ( - - - Município - - - - - - - )} - /> -
- {/* Naturalidade */} -
- ( - - - Naturalidade - - - - - - - )} - /> -
- - {/* Estado Civil */} -
- { - const [open, setOpen] = React.useState(false) - return ( - - - Estado Civil - - - - - - - - - - - - Nenhum resultado encontrado. - - {gTBEstadoCivil.map((item) => ( - { - field.onChange(Number(item.tb_estadocivil_id)) - setOpen(false) - }} - > - - {GetCapitalize(item.descricao)} - - ))} - - - - - - - + /> + {GetCapitalize(item.descricao)} + + ))} + + + + + + + + ); + }} + /> +
+ {/* Regime */} +
+ { + const [open, setOpen] = React.useState(false); + return ( + + Regime + + + + + + + + + + + + Nenhum regime encontrado. + + + {gTBRegimeComunhao?.map((item) => ( + { + field.onChange( + Number(item.tb_regimecomunhao_id), + ); + setOpen(false); + }} + > + -
- {/* Regime */} -
- { - const [open, setOpen] = React.useState(false) - return ( - - - Regime - - - - - - - - - - - - - Nenhum regime encontrado. - - - {gTBRegimeComunhao.map((item) => ( - { - field.onChange(Number(item.tb_regimecomunhao_id)) - setOpen(false) - }} - > - - {GetCapitalize(item.descricao)} - - ))} - - - - - - - - ) - }} - /> -
- {/* Profissão */} -
- { - const [open, setOpen] = React.useState(false) - return ( - - - Profissão - - - - - - - - - - - - - Nenhuma profissão encontrado. - - - {gTBProfissao.map((item) => ( - { - field.onChange(Number(item.tb_profissao_id)) - setOpen(false) - }} - > - - {GetCapitalize(item.descricao)} - - ))} - - - - - - - - ) - }} - /> -
- {/* Pai */} -
- ( - - - Pai - - - - - - + ? "opacity-100" + : "opacity-0", )} - /> -
- {/* Mãe */} -
- ( - - - Mãe - - - - - - + /> + {GetCapitalize(item.descricao)} + + ))} + + + + + + + + ); + }} + /> +
+ {/* Profissão */} +
+ { + const [open, setOpen] = React.useState(false); + return ( + + Profissão + + + + + + + + + + + + Nenhuma profissão encontrado. + + + {gTBProfissao?.map((item) => ( + { + field.onChange( + Number(item.tb_profissao_id), + ); + setOpen(false); + }} + > + -
-
- + /> + {GetCapitalize(item.descricao)} + + ))} + + + + + + + + ); + }} + /> +
+ {/* Pai */} +
+ ( + + Pai + + + + + + )} + /> +
+ {/* Mãe */} +
+ ( + + Mãe + + + + + + )} + /> +
+
+
- {/* Endereço */} - -
- {/* País */} -
- ( - - - País - - - - - - - )} - /> -
- {/* UF */} -
- ( - - - UF - - - - - - - )} - /> -
- {/* CEP */} -
- ( - - - CEP - - - - - - - )} - /> -
- {/* Cidade */} -
- ( - - - Cidade - - - - - - - )} - /> -
- {/* Município */} -
- ( - - - Município - - - - - - - )} - /> -
- {/* Bairro */} -
- ( - - - Bairro - - - - - - - )} - /> -
- {/* Logradouro */} -
- ( - - - Logradouro - - - - - - - )} - /> -
- {/* Número */} -
- ( - - - Número - - - - - - - )} - /> -
- {/* Unidade */} -
- ( - - - Unidade - - - - - - - )} - /> -
- {/* Cidade não encontrada */} -
- ( - - - Cidade não encontrada - - - - - - - )} - /> -
-
-
+ {/* Endereço */} + +
+ {/* País */} +
+ ( + + País + + + + + + )} + /> +
+ {/* UF */} +
+ ( + + UF + + + + + + )} + /> +
+ {/* CEP */} +
+ ( + + CEP + + + + + + )} + /> +
+ {/* Cidade */} +
+ ( + + Cidade + + + + + + )} + /> +
+ {/* Município */} +
+ ( + + Município + + + + + + )} + /> +
+ {/* Bairro */} +
+ ( + + Bairro + + + + + + )} + /> +
+ {/* Logradouro */} +
+ ( + + Logradouro + + + + + + )} + /> +
+ {/* Número */} +
+ ( + + Número + + + + + + )} + /> +
+ {/* Unidade */} +
+ ( + + Unidade + + + + + + )} + /> +
+ {/* Cidade não encontrada */} +
+ ( + + Cidade não encontrada + + + + + + )} + /> +
+
+
- {/* Documentos */} - -
+ {/* Documentos */} + +
+ {/* Tipo */} +
+ ( + + Tipo + + + + + + )} + /> +
- {/* Tipo */} -
- ( - - Tipo - - - - - - )} - /> -
+ {/* Número */} +
+ ( + + Número + + + + + + )} + /> +
- {/* Número */} -
- ( - - Número - - - - - - )} - /> -
+ {/* CPF */} +
+ ( + + CPF + + + + + + )} + /> +
- {/* CPF */} -
- ( - - CPF - - - - - - )} - /> -
+ {/* Órgão Emissor */} +
+ ( + + Órgão + + + + + + )} + /> +
- {/* Órgão Emissor */} -
- ( - - Órgão - - - - - - )} - /> -
+ {/* UF */} +
+ ( + + UF + + + + + + )} + /> +
- {/* UF */} -
- ( - - UF - - - - - - )} - /> -
+ {/* Data de Expedição */} +
+ ( + + Expedição + + + + + + )} + /> +
- {/* Data de Expedição */} -
- ( - - Expedição - - - - - - )} - /> -
+ {/* Validade */} +
+ ( + + Validade + + + + + + )} + /> +
+
+
+ - {/* Validade */} -
- ( - - Validade - - - - - - )} - /> -
+ {/* Rodapé do Dialog */} + + + + + + -
-
- -
- - {/* Rodapé do Dialog */} - - - - - - - - {/* Campo oculto */} - -
- -
-
- - ); + {/* Campo oculto */} + + + + +
+ ); } diff --git a/src/app/(protected)/(cadastros)/cadastros/_components/t_pessoa/TPessoaTable.tsx b/src/app/(protected)/(cadastros)/cadastros/_components/t_pessoa/TPessoaTable.tsx index 3589459..4e63b40 100644 --- a/src/app/(protected)/(cadastros)/cadastros/_components/t_pessoa/TPessoaTable.tsx +++ b/src/app/(protected)/(cadastros)/cadastros/_components/t_pessoa/TPessoaTable.tsx @@ -1,16 +1,21 @@ -'use client'; +"use client"; import { Button } from "@/components/ui/button"; import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuGroup, - DropdownMenuItem, - DropdownMenuSeparator, - DropdownMenuTrigger + DropdownMenu, + DropdownMenuContent, + DropdownMenuGroup, + DropdownMenuItem, + DropdownMenuSeparator, + DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; -import { ArrowUpDownIcon, EllipsisIcon, PencilIcon, Trash2Icon } from "lucide-react"; +import { + ArrowUpDownIcon, + EllipsisIcon, + PencilIcon, + Trash2Icon, +} from "lucide-react"; import { ColumnDef } from "@tanstack/react-table"; import GetNameInitials from "@/actions/text/GetNameInitials"; @@ -24,210 +29,205 @@ import empty from "@/actions/validations/empty"; // Tipagem das props interface TPessoaTableProps { - data: TPessoaInterface[]; - onEdit: (item: TPessoaInterface, isEditingFormStatus: boolean) => void; - onDelete: (item: TPessoaInterface, isEditingFormStatus: boolean) => void; + data: TPessoaInterface[]; + onEdit: (item: TPessoaInterface, isEditingFormStatus: boolean) => void; + onDelete: (item: TPessoaInterface, isEditingFormStatus: boolean) => void; } /** * Função para criar a definição das colunas da tabela */ function createPessoaColumns( - onEdit: (item: TPessoaInterface, isEditingFormStatus: boolean) => void, - onDelete: (item: TPessoaInterface, isEditingFormStatus: boolean) => void + onEdit: (item: TPessoaInterface, isEditingFormStatus: boolean) => void, + onDelete: (item: TPessoaInterface, isEditingFormStatus: boolean) => void, ): ColumnDef[] { - return [ - // ID - { - accessorKey: "pessoa_id", - header: ({ column }) => ( - + ), + cell: ({ row }) => Number(row.getValue("pessoa_id")), + enableSorting: false, + }, + + // Nome / Email / Foto + { + id: "nome_completo", + accessorFn: (row) => row, + header: ({ column }) => ( + + ), + cell: ({ row }) => { + const pessoa = row.original; + + return ( +
+ {/* Foto ou Iniciais */} +
+ {pessoa.foto ? ( + {pessoa.nome + ) : ( + + {GetNameInitials(pessoa.nome)} + + )} +
+ + {/* Nome e Email */} +
+
+ {pessoa.nome || "-"} +
+
+ {empty(pessoa.email) ? "Email não informado" : pessoa.email} +
+
+
+ ); + }, + sortingFn: (a, b) => + (a.original.nome?.toLowerCase() || "").localeCompare( + b.original.nome?.toLowerCase() || "", + ), + }, + + // CPF + { + accessorKey: "cpf_cnpj", + header: ({ column }) => ( + + ), + cell: ({ row }) => FormatCPF(row.getValue("cpf_cnpj")), + }, + + // Telefone + { + accessorKey: "telefone", + header: ({ column }) => ( + + ), + cell: ({ row }) => FormatPhone(row.getValue("telefone")), + }, + + // Cidade / UF + { + id: "cidade_uf", + accessorFn: (row) => `${row.cidade}/${row.uf}`, + header: ({ column }) => ( + + ), + cell: ({ row }) => {row.getValue("cidade_uf") || "-"}, + sortingFn: (a, b) => + `${a.original.cidade}/${a.original.uf}` + .toLowerCase() + .localeCompare(`${b.original.cidade}/${b.original.uf}`.toLowerCase()), + }, + + // Data de cadastro + { + accessorKey: "data_cadastro", + header: ({ column }) => ( + + ), + cell: ({ row }) => FormatDateTime(row.getValue("data_cadastro")), + sortingFn: "datetime", + }, + + // Ações + { + id: "actions", + header: "Ações", + cell: ({ row }) => { + const pessoa = row.original; + return ( + + + + + + + onEdit(pessoa, true)} > - # - - ), - cell: ({ row }) => Number(row.getValue("pessoa_id")), - enableSorting: false, - }, - - // Nome / Email / Foto - { - id: "nome_completo", - accessorFn: (row) => row, - header: ({ column }) => ( - - ), - cell: ({ row }) => { - const pessoa = row.original; - - return ( -
- {/* Foto ou Iniciais */} -
- {pessoa.foto ? ( - {pessoa.nome - ) : ( - - {GetNameInitials(pessoa.nome)} - - )} -
- - {/* Nome e Email */} -
-
- {pessoa.nome || "-"} -
-
- {empty(pessoa.email) ? "Email não informado" : pessoa.email} -
-
-
- ); - }, - sortingFn: (a, b) => - (a.original.nome?.toLowerCase() || "").localeCompare( - b.original.nome?.toLowerCase() || "" - ), - }, - - // CPF - { - accessorKey: "cpf_cnpj", - header: ({ column }) => ( - - ), - cell: ({ row }) => ( - FormatCPF(row.getValue("cpf_cnpj")) - ), - }, - - // Telefone - { - accessorKey: "telefone", - header: ({ column }) => ( - - ), - cell: ({ row }) => ( - FormatPhone(row.getValue("telefone")) - ), - }, - - // Cidade / UF - { - id: "cidade_uf", - accessorFn: (row) => `${row.cidade}/${row.uf}`, - header: ({ column }) => ( - - ), - cell: ({ row }) => {row.getValue("cidade_uf") || "-"}, - sortingFn: (a, b) => - `${a.original.cidade}/${a.original.uf}`.toLowerCase() - .localeCompare(`${b.original.cidade}/${b.original.uf}`.toLowerCase()), - }, - - // Data de cadastro - { - accessorKey: "data_cadastro", - header: ({ column }) => ( - - ), - cell: ({ row }) => ( - FormatDateTime(row.getValue("data_cadastro")) - ), - sortingFn: "datetime", - }, - - // Ações - { - id: "actions", - header: "Ações", - cell: ({ row }) => { - const pessoa = row.original; - return ( - - - - - - - onEdit(pessoa, true)} - > - - Editar - - - onDelete(pessoa, true)} - > - - Remover - - - - - ); - }, - enableSorting: false, - enableHiding: false, - }, - ]; + + Remover +
+
+
+
+ ); + }, + enableSorting: false, + enableHiding: false, + }, + ]; } /** * Componente principal da tabela */ export default function TPessoaTable({ - data, - onEdit, - onDelete, + data, + onEdit, + onDelete, }: TPessoaTableProps) { - - const columns = createPessoaColumns(onEdit, onDelete); - return ( -
- -
- ); -} \ No newline at end of file + const columns = createPessoaColumns(onEdit, onDelete); + return ( +
+ +
+ ); +} diff --git a/src/app/(protected)/(cadastros)/cadastros/_components/t_pessoa/juridica/TPessoaJuridicaForm.tsx b/src/app/(protected)/(cadastros)/cadastros/_components/t_pessoa/juridica/TPessoaJuridicaForm.tsx new file mode 100644 index 0000000..84fdcd9 --- /dev/null +++ b/src/app/(protected)/(cadastros)/cadastros/_components/t_pessoa/juridica/TPessoaJuridicaForm.tsx @@ -0,0 +1,464 @@ +"use client"; + +import z from "zod"; +import React, { useEffect } from "react"; +import { useForm, Controller } from "react-hook-form"; +import { zodResolver } from "@hookform/resolvers/zod"; + +import { Button } from "@/components/ui/button"; +import { + Dialog, + DialogClose, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, +} from "@/components/ui/dialog"; +import { + Form, + FormControl, + FormField, + FormItem, + FormLabel, + FormMessage, +} from "@/components/ui/form"; +import { Input } from "@/components/ui/input"; + +import { TPessoaSchema } from "../../../_schemas/TPessoaSchema"; +import LoadingButton from "@/app/_components/loadingButton/LoadingButton"; +import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; +import { HouseIcon, IdCardIcon, UserIcon } from "lucide-react"; +import { Textarea } from "@/components/ui/textarea"; +import { useTPessoaRepresentanteIndexHook } from "../../../_hooks/t_pessoa_representante/useTPessoaRepresentanteIndexHook"; +import TPessoaRepresentantePage from "../../t_pessoa_representante/TPessoaRepresentantePage"; + +type FormValues = z.infer; + +interface TPessoaFormProps { + isOpen: boolean; + data: FormValues | null; + onClose: (item: null, isFormStatus: boolean) => void; + onSave: (data: FormValues) => void; + buttonIsLoading: boolean; +} + +export default function TPessoaJuridicaForm({ + isOpen, + data, + onClose, + onSave, + buttonIsLoading, +}: TPessoaFormProps) { + const { tPessoaRepresentante, fetchTPessoaRepresentante } = + useTPessoaRepresentanteIndexHook(); + + // Inicializa o react-hook-form com schema zod + const form = useForm({ + resolver: zodResolver(TPessoaSchema), + defaultValues: { + nome: "", + pessoa_id: 0, + }, + }); + + // Atualiza o formulário quando recebe dados para edição + useEffect(() => { + // Carregamento de dados sincronos + const loadData = async () => { + // Se existir dados, reseta o formulário com os dados informados + if (data) form.reset(data); + + // Aguarda a busca terminar + await fetchTPessoaRepresentante(); + }; + + // Dispara a função + loadData(); + }, [data, form]); + + return ( + { + if (!open) onClose(null, false); + }} + > + + + Pessoa + Preencha os dados da pessoa + +
+ + {/* Tabs */} + + + + + Dados Pessoais + + + Endereço + + + Representantes + + +
+ {/* Dados Pessoais */} + +
+ {/* Razão Social */} +
+ ( + + Razão Social + + + + + + )} + /> +
+ + {/* Nome Fantasia */} +
+ ( + + Nome Fantasia + + + + + + )} + /> +
+ + {/* Inscrição Estadual */} +
+ ( + + Inscrição Estadual + + + + + + )} + /> +
+ + {/* CNPJ */} +
+ ( + + CNPJ + + + + + + )} + /> +
+ + {/* Observação */} +
+ ( + + Observação + +