@carlonicora/nextjs-jsonapi 1.131.2 → 1.133.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/{BlockNoteEditor-5RUXGWLR.js → BlockNoteEditor-H626BS5Y.js} +19 -19
- package/dist/{BlockNoteEditor-5RUXGWLR.js.map → BlockNoteEditor-H626BS5Y.js.map} +1 -1
- package/dist/{BlockNoteEditor-F4AKH532.mjs → BlockNoteEditor-VXK7INMR.mjs} +4 -4
- package/dist/billing/index.js +357 -357
- package/dist/billing/index.mjs +3 -3
- package/dist/{chunk-LBMNRFCY.js → chunk-5IE6DZ2D.js} +153 -77
- package/dist/chunk-5IE6DZ2D.js.map +1 -0
- package/dist/{chunk-5MNE72ZE.mjs → chunk-DZL2G7NB.mjs} +77 -1
- package/dist/chunk-DZL2G7NB.mjs.map +1 -0
- package/dist/{chunk-XTLTQQ7X.js → chunk-F6KBHC2X.js} +7 -7
- package/dist/{chunk-XTLTQQ7X.js.map → chunk-F6KBHC2X.js.map} +1 -1
- package/dist/{chunk-T7F2EVPR.js → chunk-TVJFCWST.js} +908 -929
- package/dist/chunk-TVJFCWST.js.map +1 -0
- package/dist/{chunk-NATPK5ME.mjs → chunk-VSAAVVHY.mjs} +2 -2
- package/dist/{chunk-BBBQGJEG.mjs → chunk-WEDLGKSS.mjs} +104 -125
- package/dist/chunk-WEDLGKSS.mjs.map +1 -0
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/index.d.mts +6 -2
- package/dist/components/index.d.ts +6 -2
- package/dist/components/index.js +4 -4
- package/dist/components/index.mjs +3 -3
- package/dist/contexts/index.d.mts +9 -2
- package/dist/contexts/index.d.ts +9 -2
- package/dist/contexts/index.js +6 -4
- package/dist/contexts/index.js.map +1 -1
- package/dist/contexts/index.mjs +5 -3
- package/dist/core/index.d.mts +11 -1
- package/dist/core/index.d.ts +11 -1
- package/dist/core/index.js +12 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +13 -3
- package/dist/features/help/index.js +39 -39
- package/dist/features/help/index.js.map +1 -1
- package/dist/features/help/index.mjs +5 -5
- package/dist/features/help/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -4
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +1 -1
- package/package.json +1 -1
- package/src/components/containers/ReactMarkdownContainer.tsx +1 -1
- package/src/components/containers/RoundPageContainer.tsx +7 -0
- package/src/components/forms/EditorSheet.tsx +24 -1
- package/src/components/forms/FormDateTime.tsx +5 -0
- package/src/components/navigations/Breadcrumb.tsx +13 -11
- package/src/components/navigations/Header.tsx +3 -1
- package/src/components/tables/ContentListTable.tsx +33 -19
- package/src/components/tables/__tests__/ContentListTable.test.tsx +77 -0
- package/src/contexts/HeaderChildrenContext.tsx +17 -2
- package/src/features/assistant-message/components/MessageItem.tsx +1 -1
- package/src/features/auth/components/GdprConsentSection.tsx +2 -2
- package/src/features/auth/components/forms/Register.tsx +2 -2
- package/src/features/help/components/HelpArticleBody.tsx +2 -2
- package/src/features/notification/components/common/NotificationErrorBoundary.tsx +1 -4
- package/src/features/oauth/components/consent/OAuthConsentScreen.tsx +2 -2
- package/src/features/waitlist/components/forms/WaitlistForm.tsx +2 -2
- package/src/features/waitlist/components/lists/WaitlistList.tsx +13 -2
- package/src/shadcnui/custom/link.tsx +1 -1
- package/src/shadcnui/ui/accordion.tsx +1 -1
- package/src/shadcnui/ui/alert-dialog.tsx +1 -1
- package/src/shadcnui/ui/alert.tsx +2 -5
- package/src/shadcnui/ui/badge.tsx +1 -1
- package/src/shadcnui/ui/button.tsx +1 -1
- package/src/shadcnui/ui/dialog.tsx +1 -4
- package/src/shadcnui/ui/field.tsx +1 -1
- package/src/utils/__tests__/italian-validators.test.ts +63 -0
- package/src/utils/index.ts +8 -0
- package/src/utils/italian-validators.ts +18 -5
- package/dist/chunk-5MNE72ZE.mjs.map +0 -1
- package/dist/chunk-BBBQGJEG.mjs.map +0 -1
- package/dist/chunk-LBMNRFCY.js.map +0 -1
- package/dist/chunk-T7F2EVPR.js.map +0 -1
- /package/dist/{BlockNoteEditor-F4AKH532.mjs.map → BlockNoteEditor-VXK7INMR.mjs.map} +0 -0
- /package/dist/{chunk-NATPK5ME.mjs.map → chunk-VSAAVVHY.mjs.map} +0 -0
|
@@ -29,7 +29,12 @@ export function validatePartitaIva(partitaIva: string): boolean {
|
|
|
29
29
|
return totalSum % 10 === 0;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
export
|
|
32
|
+
export type CodiceFiscaleValidationOptions = {
|
|
33
|
+
/** When true, a valid Partita IVA is also accepted as a valid value. */
|
|
34
|
+
allowPartitaIva?: boolean;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export function validateCodiceFiscale(codiceFiscale: string, options?: CodiceFiscaleValidationOptions): boolean {
|
|
33
38
|
if (!codiceFiscale || typeof codiceFiscale !== "string") {
|
|
34
39
|
return false;
|
|
35
40
|
}
|
|
@@ -37,13 +42,21 @@ export function validateCodiceFiscale(codiceFiscale: string): boolean {
|
|
|
37
42
|
const cleaned = codiceFiscale.replace(/\s/g, "").toUpperCase();
|
|
38
43
|
|
|
39
44
|
try {
|
|
40
|
-
|
|
45
|
+
if (CodiceFiscale.check(cleaned)) {
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
41
48
|
} catch (error) {
|
|
42
|
-
|
|
49
|
+
// fall through to the optional Partita IVA check
|
|
43
50
|
}
|
|
51
|
+
|
|
52
|
+
return options?.allowPartitaIva === true && validatePartitaIva(cleaned);
|
|
44
53
|
}
|
|
45
54
|
|
|
46
|
-
export function validateItalianTaxCode(
|
|
55
|
+
export function validateItalianTaxCode(
|
|
56
|
+
value: string,
|
|
57
|
+
type: "partitaIva" | "codiceFiscale",
|
|
58
|
+
options?: CodiceFiscaleValidationOptions,
|
|
59
|
+
): boolean {
|
|
47
60
|
if (!value || typeof value !== "string") {
|
|
48
61
|
return false;
|
|
49
62
|
}
|
|
@@ -52,7 +65,7 @@ export function validateItalianTaxCode(value: string, type: "partitaIva" | "codi
|
|
|
52
65
|
case "partitaIva":
|
|
53
66
|
return validatePartitaIva(value);
|
|
54
67
|
case "codiceFiscale":
|
|
55
|
-
return validateCodiceFiscale(value);
|
|
68
|
+
return validateCodiceFiscale(value, options);
|
|
56
69
|
default:
|
|
57
70
|
return false;
|
|
58
71
|
}
|