datakeen-session-react 1.1.176 → 1.1.177
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/cjs/components/session/UserInputForm/LegalRepFields.js +45 -0
- package/dist/cjs/components/session/UserInputForm/LegalRepFields.js.map +1 -0
- package/dist/cjs/components/session/UserInputForm.js +2 -1
- package/dist/cjs/components/session/UserInputForm.js.map +1 -1
- package/dist/cjs/constants/userInputForm.js +2 -2
- package/dist/cjs/constants/userInputForm.js.map +1 -1
- package/dist/cjs/hooks/useUserInputForm.js +17 -1
- package/dist/cjs/hooks/useUserInputForm.js.map +1 -1
- package/dist/cjs/i18n/documents/documents.en.json.js +3 -0
- package/dist/cjs/i18n/documents/documents.en.json.js.map +1 -1
- package/dist/cjs/i18n/documents/documents.fr.json.js +3 -0
- package/dist/cjs/i18n/documents/documents.fr.json.js.map +1 -1
- package/dist/cjs/i18n/en.json.js +2 -1
- package/dist/cjs/i18n/en.json.js.map +1 -1
- package/dist/cjs/i18n/fr.json.js +2 -1
- package/dist/cjs/i18n/fr.json.js.map +1 -1
- package/dist/cjs/utils/userInputForm.js +1 -0
- package/dist/cjs/utils/userInputForm.js.map +1 -1
- package/dist/esm/components/session/UserInputForm/LegalRepFields.js +22 -0
- package/dist/esm/components/session/UserInputForm/LegalRepFields.js.map +1 -0
- package/dist/esm/components/session/UserInputForm.js +2 -1
- package/dist/esm/components/session/UserInputForm.js.map +1 -1
- package/dist/esm/constants/userInputForm.js +2 -2
- package/dist/esm/constants/userInputForm.js.map +1 -1
- package/dist/esm/hooks/useUserInputForm.js +17 -1
- package/dist/esm/hooks/useUserInputForm.js.map +1 -1
- package/dist/esm/i18n/documents/documents.en.json.js +3 -1
- package/dist/esm/i18n/documents/documents.en.json.js.map +1 -1
- package/dist/esm/i18n/documents/documents.fr.json.js +3 -1
- package/dist/esm/i18n/documents/documents.fr.json.js.map +1 -1
- package/dist/esm/i18n/en.json.js +2 -1
- package/dist/esm/i18n/en.json.js.map +1 -1
- package/dist/esm/i18n/fr.json.js +2 -1
- package/dist/esm/i18n/fr.json.js.map +1 -1
- package/dist/esm/utils/userInputForm.js +1 -0
- package/dist/esm/utils/userInputForm.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documents.fr.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"documents.fr.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/cjs/i18n/en.json.js
CHANGED
|
@@ -304,7 +304,8 @@ var documentTypes = {
|
|
|
304
304
|
pinkDriverLicense: "Pink driving license",
|
|
305
305
|
PinkDriverLicense: "Pink driving license",
|
|
306
306
|
residencePermit: "Residence permit",
|
|
307
|
-
document: "document"
|
|
307
|
+
document: "document",
|
|
308
|
+
delegation_of_power: "Delegation of power"
|
|
308
309
|
};
|
|
309
310
|
var start_verification = "Start my verification";
|
|
310
311
|
var CGU = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"en.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/cjs/i18n/fr.json.js
CHANGED
|
@@ -304,7 +304,8 @@ var documentTypes = {
|
|
|
304
304
|
residencePermit: "Titre de séjour",
|
|
305
305
|
PinkDriverLicense: "Permis de conduire rose",
|
|
306
306
|
pinkDriverLicense: "Permis de conduire rose",
|
|
307
|
-
document: "Document"
|
|
307
|
+
document: "Document",
|
|
308
|
+
delegation_of_power: "Délégation de pouvoir"
|
|
308
309
|
};
|
|
309
310
|
var start_verification = "Commencer ma vérification";
|
|
310
311
|
var CGU = {
|
|
@@ -1 +1 @@
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -5,6 +5,7 @@ require('../node_modules/tslib/tslib.es6.js');
|
|
|
5
5
|
var resolveInformationType = function (informationType, fallback) {
|
|
6
6
|
if (informationType === "identity" ||
|
|
7
7
|
informationType === "identity-legal" ||
|
|
8
|
+
informationType === "identity-legal-rep" ||
|
|
8
9
|
informationType === "contact" ||
|
|
9
10
|
informationType === "address" ||
|
|
10
11
|
informationType === "nationality" ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userInputForm.js","sources":["../../../../src/utils/userInputForm.ts"],"sourcesContent":["import type {\n AddressParts,\n BirthDateParts,\n InformationType,\n} from \"../types/userInputForm\";\n\nexport const resolveInformationType = (\n informationType?: string,\n fallback: InformationType = \"identity\"\n): InformationType => {\n if (\n informationType === \"identity\" ||\n informationType === \"identity-legal\" ||\n informationType === \"contact\" ||\n informationType === \"address\" ||\n informationType === \"nationality\" ||\n informationType === \"custom\"\n ) {\n return informationType;\n }\n return fallback;\n};\n\nexport const parseBirthDate = (value: string): BirthDateParts => {\n if (!value) {\n return { day: \"\", month: \"\", year: \"\" };\n }\n\n try {\n if (value.includes(\"-\")) {\n const parts = value.split(\"-\");\n if (parts.length === 3) {\n if (Number(parts[0]) <= 31) {\n const [day, month, year] = parts;\n return {\n day,\n month,\n year,\n };\n }\n }\n }\n\n const date = new Date(value);\n if (!Number.isNaN(date.getTime())) {\n return {\n day: String(date.getDate()).padStart(2, \"0\"),\n month: String(date.getMonth() + 1).padStart(2, \"0\"),\n year: String(date.getFullYear()),\n };\n }\n } catch (error) {\n console.error(\"Error parsing birth date:\", error);\n }\n\n return { day: \"\", month: \"\", year: \"\" };\n};\n\nexport const checkIsMajor = (birthDate: string): boolean => {\n if (!birthDate) {\n return false;\n }\n\n const today = new Date();\n let birthDateObj: Date | undefined;\n\n if (birthDate.includes(\"-\") && birthDate.split(\"-\").length === 3) {\n const parts = birthDate.split(\"-\");\n if (Number(parts[0]) <= 31) {\n const [day, month, year] = parts;\n birthDateObj = new Date(Number(year), Number(month) - 1, Number(day));\n } else {\n birthDateObj = new Date(birthDate);\n }\n } else {\n birthDateObj = new Date(birthDate);\n }\n\n if (!birthDateObj || Number.isNaN(birthDateObj.getTime())) {\n return false;\n }\n\n const age = today.getFullYear() - birthDateObj.getFullYear();\n const monthDiff = today.getMonth() - birthDateObj.getMonth();\n const dayDiff = today.getDate() - birthDateObj.getDate();\n\n return (\n age > 18 ||\n (age === 18 && (monthDiff > 0 || (monthDiff === 0 && dayDiff >= 0)))\n );\n};\n\nexport const parseAddress = (\n value: string,\n fallback: AddressParts\n): AddressParts => {\n if (!value) {\n return fallback;\n }\n\n const parts = value.split(\",\");\n if (parts.length < 2) {\n return {\n ...fallback,\n addressLine1: value.trim(),\n };\n }\n\n const addressLine1 = (parts[0] || \"\").trim();\n const cityPostalPart = (parts[1] || \"\").trim();\n const country = (parts[2] || \"\").trim();\n\n const cityPostalMatch = cityPostalPart.match(/^(\\d{4,6})\\s+(.*)$/);\n\n if (cityPostalMatch) {\n return {\n addressLine1,\n postalCode: cityPostalMatch[1],\n city: cityPostalMatch[2],\n country,\n };\n }\n\n return {\n addressLine1,\n postalCode: fallback.postalCode,\n city: cityPostalPart || fallback.city,\n country: country || fallback.country,\n };\n};\n"],"names":[],"mappings":";;;;AAMO,IAAM,sBAAsB,GAAG,UACpC,eAAwB,EACxB,QAAsC,EAAA;IAEtC,IACE,eAAe,KAAK,UAAU;AAC9B,QAAA,eAAe,KAAK,gBAAgB;AACpC,QAAA,eAAe,KAAK,SAAS;AAC7B,QAAA,eAAe,KAAK,SAAS;AAC7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GAAG,KAAK,CAAC,WAAW,EAAE,GAAG,YAAY,CAAC,WAAW,EAAE;IAC5D,IAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,EAAE,GAAG,YAAY,CAAC,QAAQ,EAAE;IAC5D,IAAM,OAAO,GAAG,KAAK,CAAC,OAAO,EAAE,GAAG,YAAY,CAAC,OAAO,EAAE;IAExD,QACE,GAAG,GAAG,EAAE;SACP,GAAG,KAAK,EAAE,KAAK,SAAS,GAAG,CAAC,KAAK,SAAS,KAAK,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC;AAExE;;;;;;"}
|
|
1
|
+
{"version":3,"file":"userInputForm.js","sources":["../../../../src/utils/userInputForm.ts"],"sourcesContent":["import type {\n AddressParts,\n BirthDateParts,\n InformationType,\n} from \"../types/userInputForm\";\n\nexport const resolveInformationType = (\n informationType?: string,\n fallback: InformationType = \"identity\"\n): InformationType => {\n if (\n informationType === \"identity\" ||\n informationType === \"identity-legal\" ||\n informationType === \"identity-legal-rep\" ||\n informationType === \"contact\" ||\n informationType === \"address\" ||\n informationType === \"nationality\" ||\n informationType === \"custom\"\n ) {\n return informationType;\n }\n return fallback;\n};\n\nexport const parseBirthDate = (value: string): BirthDateParts => {\n if (!value) {\n return { day: \"\", month: \"\", year: \"\" };\n }\n\n try {\n if (value.includes(\"-\")) {\n const parts = value.split(\"-\");\n if (parts.length === 3) {\n if (Number(parts[0]) <= 31) {\n const [day, month, year] = parts;\n return {\n day,\n month,\n year,\n };\n }\n }\n }\n\n const date = new Date(value);\n if (!Number.isNaN(date.getTime())) {\n return {\n day: String(date.getDate()).padStart(2, \"0\"),\n month: String(date.getMonth() + 1).padStart(2, \"0\"),\n year: String(date.getFullYear()),\n };\n }\n } catch (error) {\n console.error(\"Error parsing birth date:\", error);\n }\n\n return { day: \"\", month: \"\", year: \"\" };\n};\n\nexport const checkIsMajor = (birthDate: string): boolean => {\n if (!birthDate) {\n return false;\n }\n\n const today = new Date();\n let birthDateObj: Date | undefined;\n\n if (birthDate.includes(\"-\") && birthDate.split(\"-\").length === 3) {\n const parts = birthDate.split(\"-\");\n if (Number(parts[0]) <= 31) {\n const [day, month, year] = parts;\n birthDateObj = new Date(Number(year), Number(month) - 1, Number(day));\n } else {\n birthDateObj = new Date(birthDate);\n }\n } else {\n birthDateObj = new Date(birthDate);\n }\n\n if (!birthDateObj || Number.isNaN(birthDateObj.getTime())) {\n return false;\n }\n\n const age = today.getFullYear() - birthDateObj.getFullYear();\n const monthDiff = today.getMonth() - birthDateObj.getMonth();\n const dayDiff = today.getDate() - birthDateObj.getDate();\n\n return (\n age > 18 ||\n (age === 18 && (monthDiff > 0 || (monthDiff === 0 && dayDiff >= 0)))\n );\n};\n\nexport const parseAddress = (\n value: string,\n fallback: AddressParts\n): AddressParts => {\n if (!value) {\n return fallback;\n }\n\n const parts = value.split(\",\");\n if (parts.length < 2) {\n return {\n ...fallback,\n addressLine1: value.trim(),\n };\n }\n\n const addressLine1 = (parts[0] || \"\").trim();\n const cityPostalPart = (parts[1] || \"\").trim();\n const country = (parts[2] || \"\").trim();\n\n const cityPostalMatch = cityPostalPart.match(/^(\\d{4,6})\\s+(.*)$/);\n\n if (cityPostalMatch) {\n return {\n addressLine1,\n postalCode: cityPostalMatch[1],\n city: cityPostalMatch[2],\n country,\n };\n }\n\n return {\n addressLine1,\n postalCode: fallback.postalCode,\n city: cityPostalPart || fallback.city,\n country: country || fallback.country,\n };\n};\n"],"names":[],"mappings":";;;;AAMO,IAAM,sBAAsB,GAAG,UACpC,eAAwB,EACxB,QAAsC,EAAA;IAEtC,IACE,eAAe,KAAK,UAAU;AAC9B,QAAA,eAAe,KAAK,gBAAgB;AACpC,QAAA,eAAe,KAAK,oBAAoB;AACxC,QAAA,eAAe,KAAK,SAAS;AAC7B,QAAA,eAAe,KAAK,SAAS;AAC7B,QAAA,eAAe,KAAK,aAAa;QACjC,eAAe,KAAK,QAAQ,EAC5B;AACA,QAAA,OAAO,eAAe;IACxB;AACA,IAAA,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AAQ,EAAE,GAAG,YAAY,CAAC,QAAQ,EAAE;IAC5D,IAAM,OAAO,GAAG,KAAK,CAAC,OAAO,EAAE,GAAG,YAAY,CAAC,OAAO,EAAE;IAExD,QACE,GAAG,GAAG,EAAE;SACP,GAAG,KAAK,EAAE,KAAK,SAAS,GAAG,CAAC,KAAK,SAAS,KAAK,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC;AAExE;;;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Fragment } from 'react';
|
|
3
|
+
import * as Label from '@radix-ui/react-label';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import { useI18n } from '../../../hooks/useI18n.js';
|
|
6
|
+
|
|
7
|
+
var LegalRepFields = function (_a) {
|
|
8
|
+
var form = _a.form, errors = _a.errors, requestedFields = _a.requestedFields, onFieldChange = _a.onFieldChange;
|
|
9
|
+
var t = useI18n().t;
|
|
10
|
+
return (jsxs(Fragment, { children: [requestedFields.has("legalRepresentativeNom") && (jsxs("div", { className: "space-y-2", children: [jsx(Label.Root, { htmlFor: "legalRepresentativeLastName", className: "block text-sm md:text-base font-semibold text-gray-900", children: t("user_input_form.fields.legal_representative_last_name", "Nom du représentant légal") }), jsx("input", { id: "legalRepresentativeLastName", type: "text", value: form.legalRepresentativeLastName || "", onChange: function (event) {
|
|
11
|
+
return onFieldChange("legalRepresentativeLastName", event.target.value);
|
|
12
|
+
}, placeholder: t("user_input_form.placeholders.legal_representative_last_name", "Nom"), className: clsx("w-full px-3 py-3 md:py-4 border rounded-lg text-base transition-colors focus:outline-none focus:ring-2 focus:ring-[#11E5C5] focus:border-transparent", errors.legalRepresentativeLastName
|
|
13
|
+
? "border-red-500 bg-red-50"
|
|
14
|
+
: "border-gray-300 hover-border-gray-400"), autoComplete: "off" }), errors.legalRepresentativeLastName && (jsxs("p", { className: "text-red-600 text-sm flex items-center gap-1", children: [jsx("span", { className: "text-red-500", children: "\u26A0" }), t("user_input_form.errors.legal_representative_last_name_required")] }))] })), requestedFields.has("legalRepresentativePrenom") && (jsxs("div", { className: "space-y-2", children: [jsx(Label.Root, { htmlFor: "legalRepresentativeFirstName", className: "block text-sm md:text-base font-semibold text-gray-900", children: t("user_input_form.fields.legal_representative_first_name", "Prénom du représentant légal") }), jsx("input", { id: "legalRepresentativeFirstName", type: "text", value: form.legalRepresentativeFirstName || "", onChange: function (event) {
|
|
15
|
+
return onFieldChange("legalRepresentativeFirstName", event.target.value);
|
|
16
|
+
}, placeholder: t("user_input_form.placeholders.legal_representative_first_name", "Prénom"), className: clsx("w-full px-3 py-3 md:py-4 border rounded-lg text-base transition-colors focus:outline-none focus:ring-2 focus:ring-[#11E5C5] focus:border-transparent", errors.legalRepresentativeFirstName
|
|
17
|
+
? "border-red-500 bg-red-50"
|
|
18
|
+
: "border-gray-300 hover-border-gray-400"), autoComplete: "off" }), errors.legalRepresentativeFirstName && (jsxs("p", { className: "text-red-600 text-sm flex items-center gap-1", children: [jsx("span", { className: "text-red-500", children: "\u26A0" }), t("user_input_form.errors.legal_representative_first_name_required")] }))] }))] }));
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { LegalRepFields as default };
|
|
22
|
+
//# sourceMappingURL=LegalRepFields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegalRepFields.js","sources":["../../../../../../src/components/session/UserInputForm/LegalRepFields.tsx"],"sourcesContent":["import { Fragment } from \"react\";\nimport * as Label from \"@radix-ui/react-label\";\nimport clsx from \"clsx\";\nimport type {\n RequestedFields,\n UserInputFormErrors,\n UserInputFormState,\n} from \"../../../types/userInputForm\";\nimport { useI18n } from \"../../../hooks/useI18n\";\n\ninterface LegalRepFieldsProps {\n form: UserInputFormState;\n errors: UserInputFormErrors;\n requestedFields: RequestedFields;\n onFieldChange: (key: keyof UserInputFormState, value: string) => void;\n}\n\nconst LegalRepFields = ({\n form,\n errors,\n requestedFields,\n onFieldChange,\n}: LegalRepFieldsProps) => {\n const { t } = useI18n();\n\n return (\n <Fragment>\n {requestedFields.has(\"legalRepresentativeNom\") && (\n <div className=\"space-y-2\">\n <Label.Root\n htmlFor=\"legalRepresentativeLastName\"\n className=\"block text-sm md:text-base font-semibold text-gray-900\"\n >\n {t(\n \"user_input_form.fields.legal_representative_last_name\",\n \"Nom du représentant légal\",\n )}\n </Label.Root>\n <input\n id=\"legalRepresentativeLastName\"\n type=\"text\"\n value={form.legalRepresentativeLastName || \"\"}\n onChange={(event) =>\n onFieldChange(\"legalRepresentativeLastName\", event.target.value)\n }\n placeholder={t(\n \"user_input_form.placeholders.legal_representative_last_name\",\n \"Nom\",\n )}\n className={clsx(\n \"w-full px-3 py-3 md:py-4 border rounded-lg text-base transition-colors focus:outline-none focus:ring-2 focus:ring-[#11E5C5] focus:border-transparent\",\n errors.legalRepresentativeLastName\n ? \"border-red-500 bg-red-50\"\n : \"border-gray-300 hover-border-gray-400\",\n )}\n autoComplete=\"off\"\n />\n {errors.legalRepresentativeLastName && (\n <p className=\"text-red-600 text-sm flex items-center gap-1\">\n <span className=\"text-red-500\">⚠</span>\n {t(\n \"user_input_form.errors.legal_representative_last_name_required\",\n )}\n </p>\n )}\n </div>\n )}\n\n {requestedFields.has(\"legalRepresentativePrenom\") && (\n <div className=\"space-y-2\">\n <Label.Root\n htmlFor=\"legalRepresentativeFirstName\"\n className=\"block text-sm md:text-base font-semibold text-gray-900\"\n >\n {t(\n \"user_input_form.fields.legal_representative_first_name\",\n \"Prénom du représentant légal\",\n )}\n </Label.Root>\n <input\n id=\"legalRepresentativeFirstName\"\n type=\"text\"\n value={form.legalRepresentativeFirstName || \"\"}\n onChange={(event) =>\n onFieldChange(\"legalRepresentativeFirstName\", event.target.value)\n }\n placeholder={t(\n \"user_input_form.placeholders.legal_representative_first_name\",\n \"Prénom\",\n )}\n className={clsx(\n \"w-full px-3 py-3 md:py-4 border rounded-lg text-base transition-colors focus:outline-none focus:ring-2 focus:ring-[#11E5C5] focus:border-transparent\",\n errors.legalRepresentativeFirstName\n ? \"border-red-500 bg-red-50\"\n : \"border-gray-300 hover-border-gray-400\",\n )}\n autoComplete=\"off\"\n />\n {errors.legalRepresentativeFirstName && (\n <p className=\"text-red-600 text-sm flex items-center gap-1\">\n <span className=\"text-red-500\">⚠</span>\n {t(\n \"user_input_form.errors.legal_representative_first_name_required\",\n )}\n </p>\n )}\n </div>\n )}\n </Fragment>\n );\n};\n\nexport default LegalRepFields;\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;AAiBA,IAAM,cAAc,GAAG,UAAC,EAKF,EAAA;QAJpB,IAAI,GAAA,EAAA,CAAA,IAAA,EACJ,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,eAAe,GAAA,EAAA,CAAA,eAAA,EACf,aAAa,GAAA,EAAA,CAAA,aAAA;AAEL,IAAA,IAAA,CAAC,GAAK,OAAO,EAAE,EAAd;IAET,QACEA,IAAA,CAAC,QAAQ,EAAA,EAAA,QAAA,EAAA,CACN,eAAe,CAAC,GAAG,CAAC,wBAAwB,CAAC,KAC5CA,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,WAAW,EAAA,QAAA,EAAA,CACxBC,GAAA,CAAC,KAAK,CAAC,IAAI,EAAA,EACT,OAAO,EAAC,6BAA6B,EACrC,SAAS,EAAC,wDAAwD,YAEjE,CAAC,CACA,uDAAuD,EACvD,2BAA2B,CAC5B,EAAA,CACU,EACbA,GAAA,CAAA,OAAA,EAAA,EACE,EAAE,EAAC,6BAA6B,EAChC,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,IAAI,CAAC,2BAA2B,IAAI,EAAE,EAC7C,QAAQ,EAAE,UAAC,KAAK,EAAA;4BACd,OAAA,aAAa,CAAC,6BAA6B,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;AAAhE,wBAAA,CAAgE,EAElE,WAAW,EAAE,CAAC,CACZ,6DAA6D,EAC7D,KAAK,CACN,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ClE,IACC,CACL,CAAA,EAAA,CACG,CACP,CAAA,EAAA,CACQ;AAEf;;;;"}
|
|
@@ -7,6 +7,7 @@ import { useI18n } from '../../hooks/useI18n.js';
|
|
|
7
7
|
import { useUserInputForm } from '../../hooks/useUserInputForm.js';
|
|
8
8
|
import IdentityFields from './UserInputForm/IdentityFields.js';
|
|
9
9
|
import LegalEntityFields from './UserInputForm/LegalEntityFields.js';
|
|
10
|
+
import LegalRepFields from './UserInputForm/LegalRepFields.js';
|
|
10
11
|
import ContactFields from './UserInputForm/ContactFields.js';
|
|
11
12
|
import AddressFields from './UserInputForm/AddressFields.js';
|
|
12
13
|
import NationalityField from './UserInputForm/NationalityField.js';
|
|
@@ -28,7 +29,7 @@ var UserInputForm = function (props) {
|
|
|
28
29
|
return (jsxs(MobilePageLayout, { contentClassName: "h-full", footer: jsx(PageActions, { primary: jsx(Button, { onClick: goOnNextStep, children: t("user_input_form.buttons.continue") }), secondary: jsx(Button, { variant: "secondary", onClick: goOnPreviousStep, children: t("user_input_form.buttons.back") }) }), children: [typeof process !== "undefined" &&
|
|
29
30
|
((_a = process.env) === null || _a === void 0 ? void 0 : _a.NODE_ENV) === "development" && (jsx("div", { className: "fixed right-0 top-0 z-50 bg-green-500 p-2 text-xs text-white", children: "UserInputForm Rendered \u2713" })), jsx("div", { className: "px-4 py-6 pt-11 md:px-8 md:py-8", children: jsxs("div", { className: "mx-auto w-full space-y-6 ".concat(hasListCustomField
|
|
30
31
|
? "max-w-[98vw] md:max-w-[1300px] lg:max-w-[1500px]"
|
|
31
|
-
: "max-w-md"), children: [jsxs("div", { className: "space-y-4 text-center", children: [jsx(Title, { className: "text-xl md:text-2xl lg:text-3xl", children: pageTitle }), jsx(Subtitle, { className: "text-sm leading-relaxed text-gray-600 md:text-base whitespace-pre-line", children: pageDescription })] }), jsxs("div", { className: "space-y-6 z-30 h-full", children: [informationType === "identity" && (jsx(IdentityFields, { form: form, errors: errors, requestedFields: requestedFields, onFieldChange: handleFieldChange })), informationType === "identity-legal" && (jsxs(Fragment, { children: [jsx(LegalEntityFields, { form: form, errors: errors, requestedFields: requestedFields, onFieldChange: handleFieldChange }), requestedFields.has("adresse") && (jsxs("div", { className: "space-y-4", children: [jsx("h3", { className: "text-lg md:text-xl font-semibold text-gray-900", children: t("user_input_form.registered_office_address", "Adresse du siège social") }), jsx(AddressFields, { form: form, errors: errors, requestedFields: requestedFields, onFieldChange: handleFieldChange, addressSuggestions: addressSuggestions, showSuggestions: showSuggestions, onAddressChange: handleAddressChange, onAddressFocus: handleAddressFocus, onAddressBlur: handleAddressBlur, onApplySuggestion: applyAddressSuggestion })] }))] })), informationType === "contact" && (jsx(ContactFields, { form: form, errors: errors, requestedFields: requestedFields, onFieldChange: handleFieldChange })), informationType === "address" && (jsx(AddressFields, { form: form, errors: errors, requestedFields: requestedFields, onFieldChange: handleFieldChange, addressSuggestions: addressSuggestions, showSuggestions: showSuggestions, onAddressChange: handleAddressChange, onAddressFocus: handleAddressFocus, onAddressBlur: handleAddressBlur, onApplySuggestion: applyAddressSuggestion })), informationType === "nationality" && (jsx(NationalityField, { form: form, errors: errors, requestedFields: requestedFields, onFieldChange: handleFieldChange })), informationType === "custom" && props.node.customFields && (jsx(CustomFormFields, { customFields: props.node.customFields, formData: customFormData, errors: customFormErrors, cellErrors: customFormCellErrors, onFieldChange: handleCustomFieldChange, addressSuggestions: addressSuggestions, showSuggestions: showSuggestions, onAddressChange: function (fieldId, val) { return handleAddressChange(val); }, onAddressFocus: function (fieldId) { return handleAddressFocus(); }, onAddressBlur: function (fieldId) { return handleAddressBlur(); }, onApplySuggestion: function (fieldId, suggestion) {
|
|
32
|
+
: "max-w-md"), children: [jsxs("div", { className: "space-y-4 text-center", children: [jsx(Title, { className: "text-xl md:text-2xl lg:text-3xl", children: pageTitle }), jsx(Subtitle, { className: "text-sm leading-relaxed text-gray-600 md:text-base whitespace-pre-line", children: pageDescription })] }), jsxs("div", { className: "space-y-6 z-30 h-full", children: [informationType === "identity" && (jsx(IdentityFields, { form: form, errors: errors, requestedFields: requestedFields, onFieldChange: handleFieldChange })), informationType === "identity-legal-rep" && (jsx(LegalRepFields, { form: form, errors: errors, requestedFields: requestedFields, onFieldChange: handleFieldChange })), informationType === "identity-legal" && (jsxs(Fragment, { children: [jsx(LegalEntityFields, { form: form, errors: errors, requestedFields: requestedFields, onFieldChange: handleFieldChange }), requestedFields.has("adresse") && (jsxs("div", { className: "space-y-4", children: [jsx("h3", { className: "text-lg md:text-xl font-semibold text-gray-900", children: t("user_input_form.registered_office_address", "Adresse du siège social") }), jsx(AddressFields, { form: form, errors: errors, requestedFields: requestedFields, onFieldChange: handleFieldChange, addressSuggestions: addressSuggestions, showSuggestions: showSuggestions, onAddressChange: handleAddressChange, onAddressFocus: handleAddressFocus, onAddressBlur: handleAddressBlur, onApplySuggestion: applyAddressSuggestion })] }))] })), informationType === "contact" && (jsx(ContactFields, { form: form, errors: errors, requestedFields: requestedFields, onFieldChange: handleFieldChange })), informationType === "address" && (jsx(AddressFields, { form: form, errors: errors, requestedFields: requestedFields, onFieldChange: handleFieldChange, addressSuggestions: addressSuggestions, showSuggestions: showSuggestions, onAddressChange: handleAddressChange, onAddressFocus: handleAddressFocus, onAddressBlur: handleAddressBlur, onApplySuggestion: applyAddressSuggestion })), informationType === "nationality" && (jsx(NationalityField, { form: form, errors: errors, requestedFields: requestedFields, onFieldChange: handleFieldChange })), informationType === "custom" && props.node.customFields && (jsx(CustomFormFields, { customFields: props.node.customFields, formData: customFormData, errors: customFormErrors, cellErrors: customFormCellErrors, onFieldChange: handleCustomFieldChange, addressSuggestions: addressSuggestions, showSuggestions: showSuggestions, onAddressChange: function (fieldId, val) { return handleAddressChange(val); }, onAddressFocus: function (fieldId) { return handleAddressFocus(); }, onAddressBlur: function (fieldId) { return handleAddressBlur(); }, onApplySuggestion: function (fieldId, suggestion) {
|
|
32
33
|
return applyAddressSuggestion(suggestion);
|
|
33
34
|
} }))] })] }) })] }));
|
|
34
35
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserInputForm.js","sources":["../../../../../src/components/session/UserInputForm.tsx"],"sourcesContent":["import type { UserInputFormProps } from \"../../types/userInput\";\nimport Button from \"../ui/Button\";\nimport PageActions from \"../ui/PageActions\";\nimport Title from \"../ui/Title\";\nimport Subtitle from \"../ui/Subtitle\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport { useUserInputForm } from \"../../hooks/useUserInputForm\";\nimport IdentityFields from \"./UserInputForm/IdentityFields\";\nimport LegalEntityFields from \"./UserInputForm/LegalEntityFields\";\nimport ContactFields from \"./UserInputForm/ContactFields\";\nimport AddressFields from \"./UserInputForm/AddressFields\";\nimport NationalityField from \"./UserInputForm/NationalityField\";\nimport CustomFormFields from \"./UserInputForm/CustomFormFields\";\nimport MobilePageLayout from \"../ui/MobilePageLayout\";\n\nconst UserInputForm = (props: UserInputFormProps) => {\n const { t } = useI18n();\n const hasListCustomField =\n props.node.informationType === \"custom\" &&\n (props.node.customFields || []).some((field) => field.valueType === \"list\");\n\n const {\n form,\n errors,\n informationType,\n requestedFields,\n pageTitle,\n pageDescription,\n addressSuggestions,\n showSuggestions,\n handleFieldChange,\n handleAddressChange,\n handleAddressFocus,\n handleAddressBlur,\n applyAddressSuggestion,\n goOnNextStep,\n goOnPreviousStep,\n customFormData,\n customFormErrors,\n customFormCellErrors,\n handleCustomFieldChange,\n } = useUserInputForm(props);\n\n // DEBUG LOGS\n console.log(\"🔍 [UserInputForm] informationType:\", informationType);\n console.log(\n \"🔍 [UserInputForm] node.informationType:\",\n props.node.informationType,\n );\n console.log(\"🔍 [UserInputForm] node.customFields:\", props.node.customFields);\n console.log(\"🔍 [UserInputForm] customFormData:\", customFormData);\n console.log(\n \"🔍 [UserInputForm] requestedFields:\",\n Array.from(requestedFields),\n );\n\n return (\n <MobilePageLayout\n contentClassName=\"h-full\"\n footer={\n <PageActions\n primary={\n <Button onClick={goOnNextStep}>\n {t(\"user_input_form.buttons.continue\")}\n </Button>\n }\n secondary={\n <Button variant=\"secondary\" onClick={goOnPreviousStep}>\n {t(\"user_input_form.buttons.back\")}\n </Button>\n }\n />\n }\n >\n {typeof process !== \"undefined\" &&\n process.env?.NODE_ENV === \"development\" && (\n <div className=\"fixed right-0 top-0 z-50 bg-green-500 p-2 text-xs text-white\">\n UserInputForm Rendered ✓\n </div>\n )}\n\n <div className=\"px-4 py-6 pt-11 md:px-8 md:py-8\">\n <div\n className={`mx-auto w-full space-y-6 ${\n hasListCustomField\n ? \"max-w-[98vw] md:max-w-[1300px] lg:max-w-[1500px]\"\n : \"max-w-md\"\n }`}\n >\n <div className=\"space-y-4 text-center\">\n <Title className=\"text-xl md:text-2xl lg:text-3xl\">\n {pageTitle}\n </Title>\n <Subtitle className=\"text-sm leading-relaxed text-gray-600 md:text-base whitespace-pre-line\">\n {pageDescription}\n </Subtitle>\n </div>\n\n <div className=\"space-y-6 z-30 h-full\">\n {informationType === \"identity\" && (\n <IdentityFields\n form={form}\n errors={errors}\n requestedFields={requestedFields}\n onFieldChange={handleFieldChange}\n />\n )}\n\n {informationType === \"identity-legal\" && (\n <>\n <LegalEntityFields\n form={form}\n errors={errors}\n requestedFields={requestedFields}\n onFieldChange={handleFieldChange}\n />\n {requestedFields.has(\"adresse\") && (\n <div className=\"space-y-4\">\n <h3 className=\"text-lg md:text-xl font-semibold text-gray-900\">\n {t(\n \"user_input_form.registered_office_address\",\n \"Adresse du siège social\",\n )}\n </h3>\n <AddressFields\n form={form}\n errors={errors}\n requestedFields={requestedFields}\n onFieldChange={handleFieldChange}\n addressSuggestions={addressSuggestions}\n showSuggestions={showSuggestions}\n onAddressChange={handleAddressChange}\n onAddressFocus={handleAddressFocus}\n onAddressBlur={handleAddressBlur}\n onApplySuggestion={applyAddressSuggestion}\n />\n </div>\n )}\n </>\n )}\n\n {informationType === \"contact\" && (\n <ContactFields\n form={form}\n errors={errors}\n requestedFields={requestedFields}\n onFieldChange={handleFieldChange}\n />\n )}\n\n {informationType === \"address\" && (\n <AddressFields\n form={form}\n errors={errors}\n requestedFields={requestedFields}\n onFieldChange={handleFieldChange}\n addressSuggestions={addressSuggestions}\n showSuggestions={showSuggestions}\n onAddressChange={handleAddressChange}\n onAddressFocus={handleAddressFocus}\n onAddressBlur={handleAddressBlur}\n onApplySuggestion={applyAddressSuggestion}\n />\n )}\n\n {informationType === \"nationality\" && (\n <NationalityField\n form={form}\n errors={errors}\n requestedFields={requestedFields}\n onFieldChange={handleFieldChange}\n />\n )}\n\n {informationType === \"custom\" && props.node.customFields && (\n <CustomFormFields\n customFields={props.node.customFields}\n formData={customFormData}\n errors={customFormErrors}\n cellErrors={customFormCellErrors}\n onFieldChange={handleCustomFieldChange}\n addressSuggestions={addressSuggestions}\n showSuggestions={showSuggestions}\n onAddressChange={(fieldId, val) => handleAddressChange(val)}\n onAddressFocus={(fieldId) => handleAddressFocus()}\n onAddressBlur={(fieldId) => handleAddressBlur()}\n onApplySuggestion={(fieldId, suggestion) =>\n applyAddressSuggestion(suggestion)\n }\n />\n )}\n </div>\n </div>\n </div>\n </MobilePageLayout>\n );\n};\n\nexport default UserInputForm;\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;;;;;;AAeA,IAAM,aAAa,GAAG,UAAC,KAAyB,EAAA;;AACtC,IAAA,IAAA,CAAC,GAAK,OAAO,EAAE,EAAd;IACT,IAAM,kBAAkB,GACtB,KAAK,CAAC,IAAI,CAAC,eAAe,KAAK,QAAQ;QACvC,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE,EAAE,IAAI,CAAC,UAAC,KAAK,EAAA,EAAK,OAAA,KAAK,CAAC,SAAS,KAAK,MAAM,CAAA,CAA1B,CAA0B,CAAC;AAEvE,IAAA,IAAA,EAAA,GAoBF,gBAAgB,CAAC,KAAK,CAAC,EAnBzB,IAAI,GAAA,EAAA,CAAA,IAAA,EACJ,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,eAAe,GAAA,EAAA,CAAA,eAAA,EACf,e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CAAC,IAAI,CAAC,YAAY,KACtDA,GAAA,CAAC,gBAAgB,EAAA,EACf,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,EACrC,QAAQ,EAAE,cAAc,EACxB,MAAM,EAAE,gBAAgB,EACxB,UAAU,EAAE,oBAAoB,EAChC,aAAa,EAAE,uBAAuB,EACtC,kBAAkB,EAAE,kBAAkB,EACtC,eAAe,EAAE,eAAe,EAChC,eAAe,EAAE,UAAC,OAAO,EAAE,GAAG,EAAA,EAAK,OAAA,mBAAmB,CAAC,GAAG,CAAC,EAAxB,CAAwB,EAC3D,cAAc,EAAE,UAAC,OAAO,EAAA,EAAK,OAAA,kBAAkB,EAAE,EAApB,CAAoB,EACjD,aAAa,EAAE,UAAC,OAAO,EAAA,EAAK,OAAA,iBAAiB,EAAE,CAAA,CAAnB,CAAmB,EAC/C,iBAAiB,EAAE,UAAC,OAAO,EAAE,UAAU,EAAA;wCACrC,OAAA,sBAAsB,CAAC,UAAU,CAAC;AAAlC,oCAAA,CAAkC,GAEpC,CACH,CAAA,EAAA,CACG,IACF,EAAA,CACF,CAAA,EAAA,CACW;AAEvB;;;;"}
|
|
1
|
+
{"version":3,"file":"UserInputForm.js","sources":["../../../../../src/components/session/UserInputForm.tsx"],"sourcesContent":["import type { UserInputFormProps } from \"../../types/userInput\";\nimport Button from \"../ui/Button\";\nimport PageActions from \"../ui/PageActions\";\nimport Title from \"../ui/Title\";\nimport Subtitle from \"../ui/Subtitle\";\nimport { useI18n } from \"../../hooks/useI18n\";\nimport { useUserInputForm } from \"../../hooks/useUserInputForm\";\nimport IdentityFields from \"./UserInputForm/IdentityFields\";\nimport LegalEntityFields from \"./UserInputForm/LegalEntityFields\";\nimport LegalRepFields from \"./UserInputForm/LegalRepFields\";\nimport ContactFields from \"./UserInputForm/ContactFields\";\nimport AddressFields from \"./UserInputForm/AddressFields\";\nimport NationalityField from \"./UserInputForm/NationalityField\";\nimport CustomFormFields from \"./UserInputForm/CustomFormFields\";\nimport MobilePageLayout from \"../ui/MobilePageLayout\";\n\nconst UserInputForm = (props: UserInputFormProps) => {\n const { t } = useI18n();\n const hasListCustomField =\n props.node.informationType === \"custom\" &&\n (props.node.customFields || []).some((field) => field.valueType === \"list\");\n\n const {\n form,\n errors,\n informationType,\n requestedFields,\n pageTitle,\n pageDescription,\n addressSuggestions,\n showSuggestions,\n handleFieldChange,\n handleAddressChange,\n handleAddressFocus,\n handleAddressBlur,\n applyAddressSuggestion,\n goOnNextStep,\n goOnPreviousStep,\n customFormData,\n customFormErrors,\n customFormCellErrors,\n handleCustomFieldChange,\n } = useUserInputForm(props);\n\n // DEBUG LOGS\n console.log(\"🔍 [UserInputForm] informationType:\", informationType);\n console.log(\n \"🔍 [UserInputForm] node.informationType:\",\n props.node.informationType,\n );\n console.log(\"🔍 [UserInputForm] node.customFields:\", props.node.customFields);\n console.log(\"🔍 [UserInputForm] customFormData:\", customFormData);\n console.log(\n \"🔍 [UserInputForm] requestedFields:\",\n Array.from(requestedFields),\n );\n\n return (\n <MobilePageLayout\n contentClassName=\"h-full\"\n footer={\n <PageActions\n primary={\n <Button onClick={goOnNextStep}>\n {t(\"user_input_form.buttons.continue\")}\n </Button>\n }\n secondary={\n <Button variant=\"secondary\" onClick={goOnPreviousStep}>\n {t(\"user_input_form.buttons.back\")}\n </Button>\n }\n />\n }\n >\n {typeof process !== \"undefined\" &&\n process.env?.NODE_ENV === \"development\" && (\n <div className=\"fixed right-0 top-0 z-50 bg-green-500 p-2 text-xs text-white\">\n UserInputForm Rendered ✓\n </div>\n )}\n\n <div className=\"px-4 py-6 pt-11 md:px-8 md:py-8\">\n <div\n className={`mx-auto w-full space-y-6 ${\n hasListCustomField\n ? \"max-w-[98vw] md:max-w-[1300px] lg:max-w-[1500px]\"\n : \"max-w-md\"\n }`}\n >\n <div className=\"space-y-4 text-center\">\n <Title className=\"text-xl md:text-2xl lg:text-3xl\">\n {pageTitle}\n </Title>\n <Subtitle className=\"text-sm leading-relaxed text-gray-600 md:text-base whitespace-pre-line\">\n {pageDescription}\n </Subtitle>\n </div>\n\n <div className=\"space-y-6 z-30 h-full\">\n {informationType === \"identity\" && (\n <IdentityFields\n form={form}\n errors={errors}\n requestedFields={requestedFields}\n onFieldChange={handleFieldChange}\n />\n )}\n\n {informationType === \"identity-legal-rep\" && (\n <LegalRepFields\n form={form}\n errors={errors}\n requestedFields={requestedFields}\n onFieldChange={handleFieldChange}\n />\n )}\n\n {informationType === \"identity-legal\" && (\n <>\n <LegalEntityFields\n form={form}\n errors={errors}\n requestedFields={requestedFields}\n onFieldChange={handleFieldChange}\n />\n {requestedFields.has(\"adresse\") && (\n <div className=\"space-y-4\">\n <h3 className=\"text-lg md:text-xl font-semibold text-gray-900\">\n {t(\n \"user_input_form.registered_office_address\",\n \"Adresse du siège social\",\n )}\n </h3>\n <AddressFields\n form={form}\n errors={errors}\n requestedFields={requestedFields}\n onFieldChange={handleFieldChange}\n addressSuggestions={addressSuggestions}\n showSuggestions={showSuggestions}\n onAddressChange={handleAddressChange}\n onAddressFocus={handleAddressFocus}\n onAddressBlur={handleAddressBlur}\n onApplySuggestion={applyAddressSuggestion}\n />\n </div>\n )}\n </>\n )}\n\n {informationType === \"contact\" && (\n <ContactFields\n form={form}\n errors={errors}\n requestedFields={requestedFields}\n onFieldChange={handleFieldChange}\n />\n )}\n\n {informationType === \"address\" && (\n <AddressFields\n form={form}\n errors={errors}\n requestedFields={requestedFields}\n onFieldChange={handleFieldChange}\n addressSuggestions={addressSuggestions}\n showSuggestions={showSuggestions}\n onAddressChange={handleAddressChange}\n onAddressFocus={handleAddressFocus}\n onAddressBlur={handleAddressBlur}\n onApplySuggestion={applyAddressSuggestion}\n />\n )}\n\n {informationType === \"nationality\" && (\n <NationalityField\n form={form}\n errors={errors}\n requestedFields={requestedFields}\n onFieldChange={handleFieldChange}\n />\n )}\n\n {informationType === \"custom\" && props.node.customFields && (\n <CustomFormFields\n customFields={props.node.customFields}\n formData={customFormData}\n errors={customFormErrors}\n cellErrors={customFormCellErrors}\n onFieldChange={handleCustomFieldChange}\n addressSuggestions={addressSuggestions}\n showSuggestions={showSuggestions}\n onAddressChange={(fieldId, val) => handleAddressChange(val)}\n onAddressFocus={(fieldId) => handleAddressFocus()}\n onAddressBlur={(fieldId) => handleAddressBlur()}\n onApplySuggestion={(fieldId, suggestion) =>\n applyAddressSuggestion(suggestion)\n }\n />\n )}\n </div>\n </div>\n </div>\n </MobilePageLayout>\n );\n};\n\nexport default UserInputForm;\n"],"names":["_jsxs","_jsx","_Fragment"],"mappings":";;;;;;;;;;;;;;;;AAgBA,IAAM,aAAa,GAAG,UAAC,KAAyB,EAAA;;AACtC,IAAA,IAAA,CAAC,GAAK,OAAO,EAAE,EAAd;IACT,IAAM,kBAAkB,GACtB,KAAK,CAAC,IAAI,CAAC,eAAe,KAAK,QAAQ;QACvC,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE,EAAE,IAAI,CAAC,UAAC,KAAK,EAAA,EAAK,OAAA,KAAK,CAAC,SAAS,KAAK,MAAM,CAAA,CAA1B,CAA0B,CAAC;AAEvE,IAAA,IAAA,EAAA,GAoBF,gBAAgB,CAAC,KAAK,CAAC,EAnBzB,IAAI,GAAA,EAAA,CAAA,IAAA,EACJ,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,eAAe,GAAA,EAAA,CAAA,eAAA,EACf,eAAe,GAAA,EAAA,CAAA,eAAA,EACf,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,eAAe,GAAA,EAAA,CAAA,eAAA,EACf,kBAAkB,GAAA,EAAA,CAAA,kBAAA,EAClB,eAAe,qBAAA,EACf,iBAAiB,GAAA,EAAA,CAAA,iBAAA,EACjB,mBAAmB,GAAA,EAAA,CAAA,mBAAA,EACnB,kBAAkB,GAAA,EAAA,CAAA,kBAAA,EAClB,iBAAiB,GAAA,EAAA,CAAA,iBAAA,EACjB,sBAAsB,GAAA,EAAA,CAAA,sBAAA,EACtB,YAAY,GAAA,EAAA,CAAA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kB,EAAE,kBAAkB,EACtC,eAAe,EAAE,eAAe,EAChC,eAAe,EAAE,UAAC,OAAO,EAAE,GAAG,EAAA,EAAK,OAAA,mBAAmB,CAAC,GAAG,CAAC,CAAA,CAAxB,CAAwB,EAC3D,cAAc,EAAE,UAAC,OAAO,EAAA,EAAK,OAAA,kBAAkB,EAAE,EAApB,CAAoB,EACjD,aAAa,EAAE,UAAC,OAAO,EAAA,EAAK,OAAA,iBAAiB,EAAE,CAAA,CAAnB,CAAmB,EAC/C,iBAAiB,EAAE,UAAC,OAAO,EAAE,UAAU,EAAA;wCACrC,OAAA,sBAAsB,CAAC,UAAU,CAAC;AAAlC,oCAAA,CAAkC,GAEpC,CACH,CAAA,EAAA,CACG,IACF,EAAA,CACF,CAAA,EAAA,CACW;AAEvB;;;;"}
|
|
@@ -39,6 +39,7 @@ var ADDRESS_SUGGESTIONS = [
|
|
|
39
39
|
var DEFAULT_FIELDS = {
|
|
40
40
|
identity: ["nom", "prenom", "date_naissance"],
|
|
41
41
|
"identity-legal": ["nom", "registrationNumber", "siret", "tva", "adresse"],
|
|
42
|
+
"identity-legal-rep": ["legalRepresentativeNom", "legalRepresentativePrenom"],
|
|
42
43
|
contact: ["email", "sms"],
|
|
43
44
|
address: ["adresse"],
|
|
44
45
|
nationality: ["nationalite"],
|
|
@@ -54,8 +55,7 @@ var FIELD_LABELS = {
|
|
|
54
55
|
company: "user_input_form.fields.company_name",
|
|
55
56
|
siret: "user_input_form.fields.siret",
|
|
56
57
|
tva: "user_input_form.fields.vat_number",
|
|
57
|
-
registrationNumber: "user_input_form.fields.registration_number"
|
|
58
|
-
};
|
|
58
|
+
registrationNumber: "user_input_form.fields.registration_number"};
|
|
59
59
|
// Backend endpoint pour l'autocomplétion d'adresses (sécurisé)
|
|
60
60
|
var GEOCODING_AUTOCOMPLETE_ENDPOINT = "/geocoding/autocomplete";
|
|
61
61
|
var FALLBACK_ADDRESS_SUGGESTIONS = ADDRESS_SUGGESTIONS.map(function (label, index) { return ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userInputForm.js","sources":["../../../../src/constants/userInputForm.ts"],"sourcesContent":["import type {\n AddressSuggestion,\n InformationType,\n RequestedFieldKey,\n SelectOption,\n} from \"../types/userInputForm\";\n\nconst days = Array.from({ length: 31 }, (_, index) => index + 1);\nconst currentYear = new Date().getFullYear();\nconst years = Array.from({ length: 120 }, (_, index) => currentYear - index);\n\nconst monthLabels = [\n \"Janvier\",\n \"Février\",\n \"Mars\",\n \"Avril\",\n \"Mai\",\n \"Juin\",\n \"Juillet\",\n \"Août\",\n \"Septembre\",\n \"Octobre\",\n \"Novembre\",\n \"Décembre\",\n];\n\nexport const DAY_OPTIONS: SelectOption[] = days.map((value) => ({\n value: String(value).padStart(2, \"0\"),\n label: String(value).padStart(2, \"0\"),\n}));\n\nexport const MONTH_OPTIONS: SelectOption[] = monthLabels.map(\n (label, index) => ({\n value: String(index + 1).padStart(2, \"0\"),\n label,\n })\n);\n\nexport const YEAR_OPTIONS: SelectOption[] = years.map((value) => ({\n value: String(value),\n label: String(value),\n}));\n\n\nexport const ADDRESS_SUGGESTIONS: string[] = [\n \"10 Rue de Rivoli, 75001 Paris, France\",\n \"221B Baker Street, NW1 6XE Londres, Royaume-Uni\",\n \"1600 Amphitheatre Parkway, 94043 Mountain View, États-Unis\",\n \"55 Rue du Faubourg Saint-Honoré, 75008 Paris, France\",\n \"1 Place du Commerce, 44000 Nantes, France\",\n \"Piazza del Colosseo 1, 00184 Rome, Italie\",\n \"Av. Paulista 1578, 01310-200 São Paulo, Brésil\",\n];\n\nexport const DEFAULT_FIELDS: Record<InformationType, RequestedFieldKey[]> = {\n identity: [\"nom\", \"prenom\", \"date_naissance\"],\n \"identity-legal\": [\"nom\", \"registrationNumber\", \"siret\", \"tva\", \"adresse\"],\n contact: [\"email\", \"sms\"],\n address: [\"adresse\"],\n nationality: [\"nationalite\"],\n custom: [], // Custom forms use customFields instead\n};\n\nexport const FIELD_LABELS: Record<RequestedFieldKey, string> = {\n nom: \"user_input_form.fields.last_name\",\n prenom: \"user_input_form.fields.first_name\",\n date_naissance: \"user_input_form.fields.birth_date\",\n email: \"user_input_form.fields.email\",\n sms: \"user_input_form.fields.phone\",\n adresse: \"user_input_form.fields.address_line1\",\n nationalite: \"user_input_form.fields.nationality\",\n company: \"user_input_form.fields.company_name\",\n siret: \"user_input_form.fields.siret\",\n tva: \"user_input_form.fields.vat_number\",\n registrationNumber: \"user_input_form.fields.registration_number\",\n};\n\n// Backend endpoint pour l'autocomplétion d'adresses (sécurisé)\nexport const GEOCODING_AUTOCOMPLETE_ENDPOINT = \"/geocoding/autocomplete\";\n\nexport const FALLBACK_ADDRESS_SUGGESTIONS: AddressSuggestion[] =\n ADDRESS_SUGGESTIONS.map((label, index) => ({\n id: `fallback-${index}`,\n label,\n addressLine1: label,\n postalCode: \"\",\n city: \"\",\n country: \"\",\n }));\n"],"names":[],"mappings":"AAOA,IAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,UAAC,CAAC,EAAE,KAAK,EAAA,EAAK,OAAA,KAAK,GAAG,CAAC,CAAA,CAAT,CAAS,CAAC;AAChE,IAAM,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;AAC5C,IAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,UAAC,CAAC,EAAE,KAAK,EAAA,EAAK,OAAA,WAAW,GAAG,KAAK,CAAA,CAAnB,CAAmB,CAAC;AAE5E,IAAM,WAAW,GAAG;IAClB,SAAS;IACT,SAAS;IACT,MAAM;IACN,OAAO;IACP,KAAK;IACL,MAAM;IACN,SAAS;IACT,MAAM;IACN,WAAW;IACX,SAAS;IACT,UAAU;IACV,UAAU;CACX;AAEM,IAAM,WAAW,GAAmB,IAAI,CAAC,GAAG,CAAC,UAAC,KAAK,EAAA,EAAK,QAAC;IAC9D,KA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AE,mCAAmC;AACnD,IAAA,KAAK,EAAE,8BAA8B;AACrC,IAAA,GAAG,EAAE,8BAA8B;AACnC,IACA,WAAW,EAAE,oCAAoC;AACjD,IAAA,OAAO,EAAE,qCAAqC;AAC9C,IAAA,KAAK,EAAE,8BAA8B;AACrC,IAAA,GAAG,EAAE,mCAAmC;AACxC,IAAA,kBAAkB,EAAE
|
|
1
|
+
{"version":3,"file":"userInputForm.js","sources":["../../../../src/constants/userInputForm.ts"],"sourcesContent":["import type {\n AddressSuggestion,\n InformationType,\n RequestedFieldKey,\n SelectOption,\n} from \"../types/userInputForm\";\n\nconst days = Array.from({ length: 31 }, (_, index) => index + 1);\nconst currentYear = new Date().getFullYear();\nconst years = Array.from({ length: 120 }, (_, index) => currentYear - index);\n\nconst monthLabels = [\n \"Janvier\",\n \"Février\",\n \"Mars\",\n \"Avril\",\n \"Mai\",\n \"Juin\",\n \"Juillet\",\n \"Août\",\n \"Septembre\",\n \"Octobre\",\n \"Novembre\",\n \"Décembre\",\n];\n\nexport const DAY_OPTIONS: SelectOption[] = days.map((value) => ({\n value: String(value).padStart(2, \"0\"),\n label: String(value).padStart(2, \"0\"),\n}));\n\nexport const MONTH_OPTIONS: SelectOption[] = monthLabels.map(\n (label, index) => ({\n value: String(index + 1).padStart(2, \"0\"),\n label,\n })\n);\n\nexport const YEAR_OPTIONS: SelectOption[] = years.map((value) => ({\n value: String(value),\n label: String(value),\n}));\n\n\nexport const ADDRESS_SUGGESTIONS: string[] = [\n \"10 Rue de Rivoli, 75001 Paris, France\",\n \"221B Baker Street, NW1 6XE Londres, Royaume-Uni\",\n \"1600 Amphitheatre Parkway, 94043 Mountain View, États-Unis\",\n \"55 Rue du Faubourg Saint-Honoré, 75008 Paris, France\",\n \"1 Place du Commerce, 44000 Nantes, France\",\n \"Piazza del Colosseo 1, 00184 Rome, Italie\",\n \"Av. Paulista 1578, 01310-200 São Paulo, Brésil\",\n];\n\nexport const DEFAULT_FIELDS: Record<InformationType, RequestedFieldKey[]> = {\n identity: [\"nom\", \"prenom\", \"date_naissance\"],\n \"identity-legal\": [\"nom\", \"registrationNumber\", \"siret\", \"tva\", \"adresse\"],\n \"identity-legal-rep\": [\"legalRepresentativeNom\", \"legalRepresentativePrenom\"],\n contact: [\"email\", \"sms\"],\n address: [\"adresse\"],\n nationality: [\"nationalite\"],\n custom: [], // Custom forms use customFields instead\n};\n\nexport const FIELD_LABELS: Record<RequestedFieldKey, string> = {\n nom: \"user_input_form.fields.last_name\",\n prenom: \"user_input_form.fields.first_name\",\n date_naissance: \"user_input_form.fields.birth_date\",\n email: \"user_input_form.fields.email\",\n sms: \"user_input_form.fields.phone\",\n adresse: \"user_input_form.fields.address_line1\",\n nationalite: \"user_input_form.fields.nationality\",\n company: \"user_input_form.fields.company_name\",\n siret: \"user_input_form.fields.siret\",\n tva: \"user_input_form.fields.vat_number\",\n registrationNumber: \"user_input_form.fields.registration_number\",\n legalRepresentativeNom:\n \"user_input_form.fields.legal_representative_last_name\",\n legalRepresentativePrenom:\n \"user_input_form.fields.legal_representative_first_name\",\n};\n\n// Backend endpoint pour l'autocomplétion d'adresses (sécurisé)\nexport const GEOCODING_AUTOCOMPLETE_ENDPOINT = \"/geocoding/autocomplete\";\n\nexport const FALLBACK_ADDRESS_SUGGESTIONS: AddressSuggestion[] =\n ADDRESS_SUGGESTIONS.map((label, index) => ({\n id: `fallback-${index}`,\n label,\n addressLine1: label,\n postalCode: \"\",\n city: \"\",\n country: \"\",\n }));\n"],"names":[],"mappings":"AAOA,IAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,UAAC,CAAC,EAAE,KAAK,EAAA,EAAK,OAAA,KAAK,GAAG,CAAC,CAAA,CAAT,CAAS,CAAC;AAChE,IAAM,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;AAC5C,IAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAA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,gBAAgB,EAAE,CAAC,KAAK,EAAE,oBAAoB,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC;AAC1E,IAAA,oBAAoB,EAAE,CAAC,wBAAwB,EAAE,2BAA2B,CAAC;AAC7E,IAAA,OAAO,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC;IACzB,OAAO,EAAE,CAAC,SAAS,CAAC;IACpB,WAAW,EAAE,CAAC,aAAa,CAAC;IAC5B,MAAM,EAAE,EAAE;;AAGL,IAAM,YAAY,GAAsC;AAC7D,IAAA,GAAG,EAAE,kCAAkC;AACvC,IAAA,MAAM,EAAE,mCAAmC;AAC3C,IAAA,cAAc,EAAE,mCAAmC;AACnD,IAAA,KAAK,EAAE,8BAA8B;AACrC,IAAA,GAAG,EAAE,8BAA8B;AACnC,IACA,WAAW,EAAE,oCAAoC;AACjD,IAAA,OAAO,EAAE,qCAAqC;AAC9C,IAAA,KAAK,EAAE,8BAA8B;AACrC,IAAA,GAAG,EAAE,mCAAmC;AACxC,IAAA,kBAAkB,EAAE;AAOtB;AACO,IAAM,+BAA+B,GAAG;AAExC,IAAM,4BAA4B,GACvC,mBAAmB,CAAC,GAAG,CAAC,UAAC,KAAK,EAAE,KAAK,EAAA,EAAK,QAAC;IACzC,EAAE,EAAE,WAAA,CAAA,MAAA,CAAY,KAAK,CAAE;AACvB,IAAA,KAAK,EAAA,KAAA;AACL,IAAA,YAAY,EAAE,KAAK;AACnB,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,IAAI,EAAE,EAAE;AACR,IAAA,OAAO,EAAE,EAAE;CACZ,EAAC,CAPwC,CAOxC;;;;"}
|
|
@@ -57,6 +57,8 @@ var useUserInputForm = function (_a) {
|
|
|
57
57
|
siret: (initialUserInput === null || initialUserInput === void 0 ? void 0 : initialUserInput.siret) || "",
|
|
58
58
|
tva: (initialUserInput === null || initialUserInput === void 0 ? void 0 : initialUserInput.tva) || "",
|
|
59
59
|
registrationNumber: (initialUserInput === null || initialUserInput === void 0 ? void 0 : initialUserInput.registrationNumber) || "",
|
|
60
|
+
legalRepresentativeLastName: (initialUserInput === null || initialUserInput === void 0 ? void 0 : initialUserInput.legalRepresentativeLastName) || "",
|
|
61
|
+
legalRepresentativeFirstName: (initialUserInput === null || initialUserInput === void 0 ? void 0 : initialUserInput.legalRepresentativeFirstName) || "",
|
|
60
62
|
}), form = _b[0], setForm = _b[1];
|
|
61
63
|
var _c = useState({}), errors = _c[0], setErrors = _c[1];
|
|
62
64
|
// Custom form state
|
|
@@ -365,6 +367,16 @@ var useUserInputForm = function (_a) {
|
|
|
365
367
|
markError("registrationNumber");
|
|
366
368
|
}
|
|
367
369
|
}
|
|
370
|
+
if (informationType === "identity-legal-rep") {
|
|
371
|
+
if (requestedFields.has("legalRepresentativeNom") &&
|
|
372
|
+
!form.legalRepresentativeLastName) {
|
|
373
|
+
markError("legalRepresentativeLastName");
|
|
374
|
+
}
|
|
375
|
+
if (requestedFields.has("legalRepresentativePrenom") &&
|
|
376
|
+
!form.legalRepresentativeFirstName) {
|
|
377
|
+
markError("legalRepresentativeFirstName");
|
|
378
|
+
}
|
|
379
|
+
}
|
|
368
380
|
if (informationType === "contact") {
|
|
369
381
|
if (requestedFields.has("email")) {
|
|
370
382
|
var emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
@@ -583,7 +595,7 @@ var useUserInputForm = function (_a) {
|
|
|
583
595
|
if (!validateForm()) {
|
|
584
596
|
return;
|
|
585
597
|
}
|
|
586
|
-
setUserInput(function (previous) { return (__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, previous), (requestedFields.has("nom") && __assign({}, (informationType === "identity-legal"
|
|
598
|
+
setUserInput(function (previous) { return (__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, previous), (requestedFields.has("nom") && __assign({}, (informationType === "identity-legal"
|
|
587
599
|
? { companyName: form.companyName }
|
|
588
600
|
: { lastName: form.lastName })))), (requestedFields.has("prenom") && { firstName: form.firstName })), (requestedFields.has("date_naissance") && {
|
|
589
601
|
birthDate: form.birthDate,
|
|
@@ -598,6 +610,10 @@ var useUserInputForm = function (_a) {
|
|
|
598
610
|
countryCode: form.countryCode,
|
|
599
611
|
})), (requestedFields.has("siret") && { siret: form.siret })), (requestedFields.has("tva") && { tva: form.tva })), (requestedFields.has("registrationNumber") && { registrationNumber: form.registrationNumber })), (requestedFields.has("siret") && !requestedFields.has("registrationNumber") && { registrationNumber: form.siret })), (requestedFields.has("nationalite") && {
|
|
600
612
|
nationality: form.nationality,
|
|
613
|
+
})), (requestedFields.has("legalRepresentativeNom") && {
|
|
614
|
+
legalRepresentativeLastName: form.legalRepresentativeLastName,
|
|
615
|
+
})), (requestedFields.has("legalRepresentativePrenom") && {
|
|
616
|
+
legalRepresentativeFirstName: form.legalRepresentativeFirstName,
|
|
601
617
|
}))); });
|
|
602
618
|
if (informationType === "contact" && setContactInfo) {
|
|
603
619
|
setContactInfo(function (previous) { return (__assign(__assign(__assign({}, previous), (requestedFields.has("email") && { email: form.email })), (requestedFields.has("sms") && { phoneNumber: form.phoneNumber }))); });
|