@carlonicora/nextjs-jsonapi 1.65.1 → 1.67.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AuthComponent-B4rNZRYE.d.ts → AuthComponent-DL1D3y7f.d.ts} +1 -1
- package/dist/{AuthComponent-nzabiz68.d.mts → AuthComponent-NwQ_ZXsv.d.mts} +1 -1
- package/dist/{BlockNoteEditor-QGNV6E4X.js → BlockNoteEditor-QHWPE3BJ.js} +14 -14
- package/dist/{BlockNoteEditor-QGNV6E4X.js.map → BlockNoteEditor-QHWPE3BJ.js.map} +1 -1
- package/dist/{BlockNoteEditor-CZOW7J5K.mjs → BlockNoteEditor-TIX3GDVZ.mjs} +4 -4
- package/dist/{auth.interface-C1WjZ0fM.d.ts → auth.interface-BX_1qZZJ.d.ts} +1 -1
- package/dist/{auth.interface-fBFqIrw4.d.mts → auth.interface-yeLelxdI.d.mts} +1 -1
- package/dist/billing/index.js +346 -346
- package/dist/billing/index.mjs +3 -3
- package/dist/{chunk-CDCGQFIA.js → chunk-3BWYWS3A.js} +2118 -1659
- package/dist/chunk-3BWYWS3A.js.map +1 -0
- package/dist/{chunk-LRXJT656.js → chunk-CJY63D6U.js} +72 -5
- package/dist/chunk-CJY63D6U.js.map +1 -0
- package/dist/{chunk-RA4RYKYB.js → chunk-KFIQTY4O.js} +11 -11
- package/dist/{chunk-RA4RYKYB.js.map → chunk-KFIQTY4O.js.map} +1 -1
- package/dist/{chunk-G7PGWMFO.mjs → chunk-RIG2BEXJ.mjs} +72 -5
- package/dist/{chunk-G7PGWMFO.mjs.map → chunk-RIG2BEXJ.mjs.map} +1 -1
- package/dist/{chunk-ESGUCYJS.mjs → chunk-WWP32QYC.mjs} +3534 -3075
- package/dist/chunk-WWP32QYC.mjs.map +1 -0
- package/dist/{chunk-5KMKI23S.mjs → chunk-ZYAAJMZZ.mjs} +2 -2
- package/dist/client/index.d.mts +6 -6
- package/dist/client/index.d.ts +6 -6
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/index.d.mts +69 -12
- package/dist/components/index.d.ts +69 -12
- package/dist/components/index.js +18 -4
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +19 -5
- package/dist/{config-DZWAFB7H.d.ts → config-CyCAWW-d.d.ts} +1 -1
- package/dist/{config-ndRJIQsP.d.mts → config-D-mqttuF.d.mts} +1 -1
- package/dist/{content.interface-B5ySfiOE.d.mts → content.interface-8T5-G84c.d.mts} +1 -1
- package/dist/{content.interface-mmz0uMwm.d.ts → content.interface-D-xdYxjt.d.ts} +1 -1
- package/dist/contexts/index.d.mts +3 -3
- package/dist/contexts/index.d.ts +3 -3
- package/dist/contexts/index.js +4 -4
- package/dist/contexts/index.mjs +3 -3
- package/dist/core/index.d.mts +29 -9
- package/dist/core/index.d.ts +29 -9
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +1 -1
- package/dist/index.d.mts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +3 -3
- package/dist/index.mjs +2 -2
- package/dist/{notification.interface-DG7cq9oG.d.mts → notification.interface-C6UcmJqu.d.mts} +20 -0
- package/dist/{notification.interface-COKHDQeE.d.ts → notification.interface-ItBxq2au.d.ts} +20 -0
- package/dist/{s3.service-ppn9iGJU.d.ts → s3.service-Cg5TmbU_.d.ts} +6 -3
- package/dist/{s3.service-BoRPFx82.d.mts → s3.service-DLf_a0xS.d.mts} +6 -3
- package/dist/server/index.d.mts +4 -4
- package/dist/server/index.d.ts +4 -4
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +1 -1
- package/dist/{useRbacState-DhuYYr0S.d.mts → useRbacState-Btk1gkQg.d.mts} +1 -1
- package/dist/{useRbacState-NnzNL2ED.d.ts → useRbacState-CUj0hp8t.d.ts} +1 -1
- package/dist/{useSocket-bsV-K4qR.d.ts → useSocket-BSUN9s3p.d.ts} +1 -1
- package/dist/{useSocket-CtfuR5wD.d.mts → useSocket-DKI92Fbg.d.mts} +1 -1
- package/package.json +2 -1
- package/src/components/EditableAvatar.tsx +175 -0
- package/src/components/containers/RoundPageContainer.tsx +1 -1
- package/src/components/fiscal/FiscalDataDisplay.tsx +26 -0
- package/src/components/fiscal/ItalianFiscalData.tsx +120 -0
- package/src/components/fiscal/ItalianFiscalDataDisplay.tsx +24 -0
- package/src/components/fiscal/index.ts +4 -0
- package/src/components/index.ts +3 -0
- package/src/components/navigations/RecentPagesNavigator.tsx +3 -3
- package/src/features/company/components/details/CompanyContent.tsx +105 -0
- package/src/features/company/components/details/CompanyDetails.tsx +2 -19
- package/src/features/company/components/details/index.ts +1 -0
- package/src/features/company/components/forms/CompanyConfigurationEditor.tsx +38 -70
- package/src/features/company/components/forms/CompanyEditor.tsx +212 -172
- package/src/features/company/data/company.interface.ts +20 -0
- package/src/features/company/data/company.ts +73 -0
- package/src/features/role/components/forms/FormRoles.tsx +5 -4
- package/src/features/user/components/containers/AllUsersListContainer.tsx +36 -0
- package/src/features/user/components/containers/UserContainer.tsx +10 -13
- package/src/features/user/components/containers/UsersListContainer.tsx +15 -24
- package/src/features/user/components/containers/index.ts +1 -0
- package/src/features/user/components/details/UserContent.tsx +92 -0
- package/src/features/user/components/details/index.ts +1 -1
- package/src/features/user/components/forms/UserEditor.tsx +233 -233
- package/src/features/user/components/lists/CompanyUsersList.tsx +3 -1
- package/src/features/user/contexts/UserContext.tsx +1 -6
- package/src/features/user/data/user.service.ts +9 -0
- package/src/features/user/data/user.ts +3 -4
- package/src/utils/fiscal-utils.ts +7 -0
- package/src/utils/italian-validators.ts +79 -0
- package/dist/chunk-CDCGQFIA.js.map +0 -1
- package/dist/chunk-ESGUCYJS.mjs.map +0 -1
- package/dist/chunk-LRXJT656.js.map +0 -1
- package/src/features/user/components/details/UserDetails.tsx +0 -74
- /package/dist/{BlockNoteEditor-CZOW7J5K.mjs.map → BlockNoteEditor-TIX3GDVZ.mjs.map} +0 -0
- /package/dist/{chunk-5KMKI23S.mjs.map → chunk-ZYAAJMZZ.mjs.map} +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import CodiceFiscale from "codice-fiscale-js";
|
|
2
|
+
|
|
3
|
+
export function validatePartitaIva(partitaIva: string): boolean {
|
|
4
|
+
if (!partitaIva || typeof partitaIva !== "string") {
|
|
5
|
+
return false;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const cleaned = partitaIva.replace(/\s/g, "");
|
|
9
|
+
|
|
10
|
+
if (!/^\d{11}$/.test(cleaned)) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const digits = cleaned.split("").map(Number);
|
|
15
|
+
|
|
16
|
+
const oddSum = digits[0] + digits[2] + digits[4] + digits[6] + digits[8] + digits[10];
|
|
17
|
+
|
|
18
|
+
let evenSum = 0;
|
|
19
|
+
for (let i = 1; i < 10; i += 2) {
|
|
20
|
+
let doubled = digits[i] * 2;
|
|
21
|
+
if (doubled > 9) {
|
|
22
|
+
doubled -= 9;
|
|
23
|
+
}
|
|
24
|
+
evenSum += doubled;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const totalSum = oddSum + evenSum;
|
|
28
|
+
|
|
29
|
+
return totalSum % 10 === 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function validateCodiceFiscale(codiceFiscale: string): boolean {
|
|
33
|
+
if (!codiceFiscale || typeof codiceFiscale !== "string") {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const cleaned = codiceFiscale.replace(/\s/g, "").toUpperCase();
|
|
38
|
+
|
|
39
|
+
try {
|
|
40
|
+
return CodiceFiscale.check(cleaned);
|
|
41
|
+
} catch (error) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function validateItalianTaxCode(value: string, type: "partitaIva" | "codiceFiscale"): boolean {
|
|
47
|
+
if (!value || typeof value !== "string") {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
switch (type) {
|
|
52
|
+
case "partitaIva":
|
|
53
|
+
return validatePartitaIva(value);
|
|
54
|
+
case "codiceFiscale":
|
|
55
|
+
return validateCodiceFiscale(value);
|
|
56
|
+
default:
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function formatPartitaIva(partitaIva: string): string {
|
|
62
|
+
if (!partitaIva) return "";
|
|
63
|
+
|
|
64
|
+
const cleaned = partitaIva.replace(/\s/g, "");
|
|
65
|
+
if (/^\d{11}$/.test(cleaned)) {
|
|
66
|
+
return `${cleaned.substring(0, 7)} ${cleaned.substring(7, 10)} ${cleaned.substring(10)}`;
|
|
67
|
+
}
|
|
68
|
+
return partitaIva;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function formatCodiceFiscale(codiceFiscale: string): string {
|
|
72
|
+
if (!codiceFiscale) return "";
|
|
73
|
+
|
|
74
|
+
const cleaned = codiceFiscale.replace(/\s/g, "").toUpperCase();
|
|
75
|
+
if (/^[A-Z0-9]{16}$/.test(cleaned)) {
|
|
76
|
+
return `${cleaned.substring(0, 6)} ${cleaned.substring(6, 11)} ${cleaned.substring(11, 15)} ${cleaned.substring(15)}`;
|
|
77
|
+
}
|
|
78
|
+
return codiceFiscale;
|
|
79
|
+
}
|