@adyen/kyc-components 4.0.0-beta.1 → 4.0.0-beta.3
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/{AcceptTermsOfServiceComponent-BQ4Yct7L.js → AcceptTermsOfServiceComponent-i222mdxX.js} +53 -49
- package/dist/{AccountSetupRejected-UVhxMcAe.js → AccountSetupRejected-DHph9lFl.js} +6 -6
- package/dist/{Avatar-NEiNEcRx.js → Avatar-vCjWXfC7.js} +2 -2
- package/dist/{BusinessDetailsDropin-l0xfPekL.js → BusinessDetailsDropin-DQcfiSR8.js} +333 -287
- package/dist/{BusinessFinancingComponent-Bs-poF2d.js → BusinessFinancingComponent-DC3jzBrq.js} +3 -3
- package/dist/{BusinessFinancingDropin-DoRzdS4n.js → BusinessFinancingDropin-D2lMEbNh.js} +161 -264
- package/dist/{BusinessFinancingPage-DSlmJmOK.js → BusinessFinancingPage-BPD2cSDR.js} +3 -3
- package/dist/{BusinessTypeSelectionPage-Bmi_8K2g.js → BusinessTypeSelectionPage-Cdp8joPJ.js} +82 -87
- package/dist/{CZ-BhoS6sd6.js → CZ-BiPeoA9G.js} +11 -1
- package/dist/{ContractViewer-R4-gfVmp.js → ContractViewer-B0bZ14Ts.js} +305 -296
- package/dist/{CreateIndividualComponent-D3aXuYRk.js → CreateIndividualComponent-D9wnexv4.js} +7 -7
- package/dist/{CreateTransferInstrumentComponent-C-ncZ-A8.js → CreateTransferInstrumentComponent-COzPdQjC.js} +4 -4
- package/dist/{CustomerSupport-CMFRgQNa.js → CustomerSupport-NGBoBg3N.js} +27 -32
- package/dist/{DebugModal-BEmhG3UP.js → DebugModal-I2U6TjGT.js} +43 -35
- package/dist/{DecisionMakerDetailsPage-DI2Ubmef.js → DecisionMakerDetailsPage-BN-H1sJF.js} +3 -3
- package/dist/{DecisionMakers-BKhtcs_K.js → DecisionMakers-CZ5-IRtU.js} +128 -23
- package/dist/{EmbeddedStatus-BsZsXbKc.js → EmbeddedStatus-Blr0seRl.js} +6 -6
- package/dist/FormEndState-JB6QFSet.js +59 -0
- package/dist/{FormFlow-Bt-mu4Wm.js → FormFlow-DjvdNEiV.js} +18 -19
- package/dist/{HU-v3vOxRm8.js → HU-D8vJYkDH.js} +10 -1
- package/dist/{IndividualOnfidoDropin-DGMCOm9M.js → IndividualOnfidoDropin-DHhyO2ai.js} +732 -739
- package/dist/{Introduction-DJ6qIUPC.js → Introduction-erRXgreE.js} +32 -34
- package/dist/LandingLayout-B45lEjOv.js +84 -0
- package/dist/{LegalRepresentativeDetailsPage-CyHwQR_W.js → LegalRepresentativeDetailsPage-rS5K4657.js} +3 -3
- package/dist/{ManageIndividualComponent-BIMCvcr2.js → ManageIndividualComponent-BEzE5lkX.js} +8 -12
- package/dist/{ManagePCIComponent-Blj60xLa.js → ManagePCIComponent-BgdGfAuT.js} +5 -5
- package/dist/{ManageTermsOfServiceComponent-CsM23jq3.js → ManageTermsOfServiceComponent-BWkwy6YC.js} +7 -8
- package/dist/{ManageTransferInstrumentComponent-Vut9_bRn.js → ManageTransferInstrumentComponent-B8kRNftW.js} +21 -29
- package/dist/{OnboardingDropinComponent-BW6er2HU.js → OnboardingDropinComponent-DBW5N3Dr.js} +243 -281
- package/dist/{ProviderButton-DAsW5EVa.js → ProviderButton-B58n0cRC.js} +12 -13
- package/dist/{Review-DWDbL9-9.js → Review-O6Al47Cu.js} +11 -11
- package/dist/{RootBusinessDetailsPage-BTYIldSf.js → RootBusinessDetailsPage-q_6wAcer.js} +3 -3
- package/dist/{RootIndividualDetailsPage-DCxJ3ycQ.js → RootIndividualDetailsPage-CiXgSJsV.js} +3 -3
- package/dist/{SignPCIComponent-kHaxhkWa.js → SignPCIComponent-cqRNhGdl.js} +17 -19
- package/dist/{SingpassSelection-Dmlbiq4Z.js → SingpassSelection-BWEJ3Yi-.js} +6 -9
- package/dist/{SoleProprietorshipPage-Bdhs90-q.js → SoleProprietorshipPage-CRcJSpn9.js} +3 -3
- package/dist/{SourceOfFundsPage-Bj22DAFv.js → SourceOfFundsPage-BxLGXTHb.js} +500 -481
- package/dist/{StoreProvider-BmzY19Td.js → StoreProvider-ClKLaHzy.js} +8753 -10118
- package/dist/{TaskItemStatus-CB6FEOnk.js → TaskItemStatus-DrTIwCTx.js} +14 -14
- package/dist/TaskStatusIndicator-CTtKjo0m.js +69 -0
- package/dist/{TaxReportingDropin-jofokkei.js → TaxReportingDropin-DFZ2ehfk.js} +82 -101
- package/dist/{TileGroup-i5Jc08ns.js → TileGroup-BtE472I1.js} +6 -8
- package/dist/{TrustDetailsPage-B6HmvYUf.js → TrustDetailsPage-CGiiTbfR.js} +71 -73
- package/dist/{TrustMemberCompanyPage-D3VJOq6a.js → TrustMemberCompanyPage-oLNhg0hg.js} +4 -4
- package/dist/{TrustMemberIndividualPage-1aeOYsnG.js → TrustMemberIndividualPage-Bgsis586.js} +3 -3
- package/dist/{UnincorporatedPartnershipIndividualPage-Bt7e6ncF.js → UnincorporatedPartnershipIndividualPage-DPE3grqL.js} +3 -3
- package/dist/{UnincorporatedPartnershipMemberCompanyPage-Ck5C_SEU.js → UnincorporatedPartnershipMemberCompanyPage-HUnc9g0g.js} +3 -3
- package/dist/{VerificationErrorAlert-DhtKOmjt.js → VerificationErrorAlert-BBdJmGJu.js} +10 -8
- package/dist/{ViewVerificationStatusComponent-DtKLcCGI.js → ViewVerificationStatusComponent-DDtXG_pM.js} +12 -13
- package/dist/adyen-business-financing.js +8 -12
- package/dist/adyen-individual.js +6 -4
- package/dist/adyen-kyc-components.js +135 -118
- package/dist/adyen-manage-individual.js +2 -2
- package/dist/adyen-manage-pci.js +2 -2
- package/dist/adyen-manage-terms-of-service.js +2 -2
- package/dist/adyen-manage-transfer-instruments.js +2 -2
- package/dist/adyen-onboarding.js +14 -6
- package/dist/adyen-sign-pci.js +8 -15
- package/dist/adyen-terms-of-service.js +18 -6
- package/dist/adyen-transfer-instrument.js +10 -6
- package/dist/{adyen-transfer-instrument.vue_vue_type_script_lang-BE-ro1iH.js → adyen-transfer-instrument.vue_vue_type_script_lang-DQBzahGy.js} +5 -1
- package/dist/adyen-verification-status.js +2 -2
- package/dist/bg-BG-BY3Wa361.js +54 -0
- package/dist/bg-BG-BvSUDgGF.js +13 -0
- package/dist/bg-BG-HpLj_LOM.js +16 -0
- package/dist/cs-CZ-BEFeaKsV.js +54 -0
- package/dist/cs-CZ-CQ_M3lEp.js +16 -0
- package/dist/cs-CZ-y4mvq4Lv.js +13 -0
- package/dist/{css-CQUoQdd2.js → css-BJGWcW8A.js} +2 -2
- package/dist/da-DK-D6UK8XT9.js +54 -0
- package/dist/da-DK-k4JW3iVF.js +16 -0
- package/dist/da-DK-qgQOVjDp.js +13 -0
- package/dist/de-DE-B3nctkG8.js +13 -0
- package/dist/de-DE-C7mjtS5w.js +16 -0
- package/dist/de-DE-DUl6gRKv.js +54 -0
- package/dist/de-DE-pSdsxBpQ.js +13 -0
- package/dist/decision-makers-group-CgddXgrx.js +1944 -0
- package/dist/el-GR-B5j7VZ3E.js +54 -0
- package/dist/el-GR-Bvjk5Sw8.js +13 -0
- package/dist/el-GR-CEQrkYHW.js +16 -0
- package/dist/el-GR-CdgLZhuO.js +13 -0
- package/dist/en-US-Bq2Twy6x.js +54 -0
- package/dist/en-US-DDagIr01.js +16 -0
- package/dist/en-US-DSoLr6rp.js +13 -0
- package/dist/es-ES-BRfK6tX7.js +13 -0
- package/dist/es-ES-Cavm0szq.js +54 -0
- package/dist/es-ES-DB1c74Kv.js +16 -0
- package/dist/es-ES-Dy1uR2H_.js +13 -0
- package/dist/et-EE-DUWZ2Vqm.js +54 -0
- package/dist/et-EE-d9V24rcf.js +13 -0
- package/dist/et-EE-xIegUSuv.js +16 -0
- package/dist/fi-FI-B0fnAFV2.js +13 -0
- package/dist/fi-FI-DVa-ccaW.js +54 -0
- package/dist/fi-FI-NCxneAqU.js +16 -0
- package/dist/fr-FR-BoKzVp2q.js +13 -0
- package/dist/fr-FR-CY9emHgF.js +54 -0
- package/dist/fr-FR-Dk6Lw2On.js +13 -0
- package/dist/fr-FR-daiUnUwo.js +16 -0
- package/dist/{getFieldsWithExistingData-BW8_TEQl.js → getFieldsWithExistingData-BY--eXBQ.js} +3 -4
- package/dist/{hasDataChanged-Mu0HyZ3E.js → hasDataChanged-CwfuS4et.js} +4 -4
- package/dist/hr-HR-BAUywqDj.js +16 -0
- package/dist/hr-HR-CF0AHQzi.js +13 -0
- package/dist/hr-HR-CnP5sqih.js +54 -0
- package/dist/hu-HU-3GQojIHR.js +16 -0
- package/dist/hu-HU-BTlpbCpc.js +54 -0
- package/dist/hu-HU-CSPhOvLC.js +13 -0
- package/dist/it-IT-BH-eqIKH.js +13 -0
- package/dist/it-IT-D7G4BaP7.js +13 -0
- package/dist/it-IT-GgHc0cHR.js +54 -0
- package/dist/it-IT-pDWPFHEh.js +16 -0
- package/dist/ja-JP-B3yqM_FM.js +13 -0
- package/dist/ja-JP-BhS-_dIx.js +54 -0
- package/dist/ja-JP-DTW_hY1L.js +13 -0
- package/dist/ja-JP-scPXJ93L.js +16 -0
- package/dist/{json-DWikzB4g.js → json-Dk6RRAV8.js} +2 -2
- package/dist/{localizeDateString-QtCjf8Fg.js → localizeDateString-CKCBXzSn.js} +6 -6
- package/dist/lt-LT-BcGNy8Ti.js +16 -0
- package/dist/lt-LT-DTQGR9M0.js +54 -0
- package/dist/lt-LT-Lzl_Cbw-.js +13 -0
- package/dist/lv-LV-BQ4F1GrV.js +54 -0
- package/dist/lv-LV-CBD07r1Y.js +16 -0
- package/dist/lv-LV-y00wN1pj.js +13 -0
- package/dist/{mapFinancialReportsToFinancialInformation-C-2jp0wg.js → mapFinancialReportsToFinancialInformation-D_6u_bSS.js} +19 -12
- package/dist/minus-circle-filled-BGKeHaxJ.js +17 -0
- package/dist/nl-NL-BxJUDHMK.js +16 -0
- package/dist/nl-NL-CFzm75Jw.js +13 -0
- package/dist/nl-NL-CUcML482.js +54 -0
- package/dist/nl-NL-DmnFXAQC.js +13 -0
- package/dist/no-NO-BBCvsecq.js +54 -0
- package/dist/no-NO-DbvFfP96.js +13 -0
- package/dist/no-NO-Drup6Jyy.js +16 -0
- package/dist/pl-PL--mmxopYA.js +13 -0
- package/dist/pl-PL-BXv8Mmzb.js +16 -0
- package/dist/pl-PL-kGaeUP-w.js +54 -0
- package/dist/{plaintext-B39yQnOr.js → plaintext-9WNCwUtz.js} +2 -2
- package/dist/plus-circle-filled-Cnf1oJTm.js +17 -0
- package/dist/preact/adyen-transfer-instrument.js +1 -1
- package/dist/pt-PT-BVzXBFp7.js +13 -0
- package/dist/pt-PT-D8nU-UM2.js +16 -0
- package/dist/pt-PT-DpDxAynk.js +13 -0
- package/dist/pt-PT-JVqqgvPs.js +54 -0
- package/dist/{resolveEnvironment-Dx0BPNMa.js → resolveEnvironment-DQH1ab0S.js} +3 -3
- package/dist/ro-RO-C83h2zHZ.js +54 -0
- package/dist/ro-RO-CG33OwqS.js +16 -0
- package/dist/ro-RO-Cdmevo9A.js +13 -0
- package/dist/ru-RU-FZb2upqh.js +13 -0
- package/dist/{rules-CUANHpja.js → rules-CCnLDGvk.js} +43 -70
- package/dist/sk-SK-CgLJIuJw.js +54 -0
- package/dist/sk-SK-DV_xkO69.js +16 -0
- package/dist/sk-SK-nfeuTcY5.js +13 -0
- package/dist/sl-SI-B5yeoadY.js +16 -0
- package/dist/sl-SI-BzeVaC1Z.js +54 -0
- package/dist/sl-SI-DUTZDqkP.js +13 -0
- package/dist/style.css +417 -605
- package/dist/styles-CLV89_hH.js +417 -605
- package/dist/sv-SE-BTx2XKAp.js +13 -0
- package/dist/sv-SE-CVmo11gI.js +54 -0
- package/dist/sv-SE-CfxyR53r.js +16 -0
- package/dist/sv-SE-rckxD-43.js +13 -0
- package/dist/types/api/companySelection/useCompanySelection.d.ts +18 -1
- package/dist/types/api/configurations/useScenarios.d.ts +6 -6
- package/dist/types/components/BankAccount/forms/BankDocument/types.d.ts +1 -0
- package/dist/types/components/BankAccount/mapping/payoutKeyMappings.d.ts +0 -306
- package/dist/types/components/Business/forms/AdditionalInformation/types.d.ts +2 -1
- package/dist/types/components/Business/forms/BasicInformation/types.d.ts +2 -1
- package/dist/types/components/Business/forms/BusinessDetails/forms.d.ts +1 -1
- package/dist/types/components/Business/forms/rules.d.ts +1 -0
- package/dist/types/components/Business/tasks/BusinessDetailsDropin/businessDetailsFormConfig.d.ts +1 -2
- package/dist/types/components/Business/tasks/BusinessDetailsDropin/utils.d.ts +0 -3
- package/dist/types/components/EFP/fields/LegalFormField/types.d.ts +4 -2
- package/dist/types/components/EFP/mapping/businessFinancingKeyMappings.d.ts +5 -307
- package/dist/types/components/EFP/tasks/BusinessFinancingDropin/utils.d.ts +2 -2
- package/dist/types/components/EFP/tasks/SourceOfFundsDropin/SOFAdditionalData/SOFFinancierModal.d.ts +1 -2
- package/dist/types/components/Individual/fields/NameFields/NameFields.d.ts +0 -2
- package/dist/types/components/Individual/forms/IndividualOnfido/AdditionalPersonalDetails/AdditionalPersonalDetails.d.ts +1 -2
- package/dist/types/components/Individual/forms/IndividualOnfido/GuidanceQuestion/GuidanceQuestion.d.ts +7 -3
- package/dist/types/components/Individual/forms/IndividualOnfido/IndividualOnfido.d.ts +0 -1
- package/dist/types/components/Individual/mapping/adjustOnfidoIdentificationData.d.ts +3 -0
- package/dist/types/components/Individual/mapping/getOnfidoIdentityTypeToApiIdentityTypeMap.d.ts +3 -0
- package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakersGettingStarted/DecisionMakersGettingStarted.d.ts +5 -0
- package/dist/types/components/Individual/tasks/DecisionMakers/DecisionMakersGettingStarted/DecisionMakersModalContent.d.ts +1 -0
- package/dist/types/components/Individual/tasks/IndividualOnfidoDropin/IndividualOnfidoStore.d.ts +6 -0
- package/dist/types/components/Shared/FormNavigation/FormNavigationItem.d.ts +1 -2
- package/dist/types/components/Shared/Introduction/copy.d.ts +2 -2
- package/dist/types/components/Shared/Summary/Summary.d.ts +0 -1
- package/dist/types/components/Shared/devex/DebugListener/DebugModal.d.ts +0 -1
- package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/BusinessRegistrationNumberField.d.ts +1 -1
- package/dist/types/components/Shared/fields/BusinessRegistrationNumberField/types.d.ts +5 -7
- package/dist/types/components/Shared/fields/CountryField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/CountryOfGoverningLawField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/Currency/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/DBANameField/types.d.ts +1 -3
- package/dist/types/components/Shared/fields/DateOfIncorporationField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/EInvoicingCodeField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/FinancialReportingDate/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/IdFieldTypeSelector/getDefaultRegistrationNumberType.d.ts +16 -0
- package/dist/types/components/Shared/fields/IdFieldTypeSelector/getDefaultVatNumberType.d.ts +13 -0
- package/dist/types/components/Shared/fields/LegalCompanyNameField/LegalCompanyNameField.d.ts +1 -2
- package/dist/types/components/Shared/fields/LegalCompanyNameField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/LocalizedLegalCompanyNameField/fieldConfig.d.ts +12 -0
- package/dist/types/components/Shared/fields/LocalizedLegalCompanyNameField/types.d.ts +5 -0
- package/dist/types/components/Shared/fields/NumberOfEmployees/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/PhoneField/PhoneField.d.ts +1 -2
- package/dist/types/components/Shared/fields/PhoneField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/StateField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/StockExchangeMICField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/StockISINField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/StockTickerSymbol/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/TaxInformationField/TaxInformationField.d.ts +1 -2
- package/dist/types/components/Shared/fields/TaxInformationField/fieldConfig.d.ts +5 -3
- package/dist/types/components/Shared/fields/TaxInformationField/types.d.ts +1 -1
- package/dist/types/components/Shared/fields/VatNumberField/VatNumberField.d.ts +1 -1
- package/dist/types/components/Shared/fields/VatNumberField/types.d.ts +2 -4
- package/dist/types/components/Shared/forms/Address/utils.d.ts +1 -1
- package/dist/types/components/Shared/forms/FinancialInformation/formatFinancialInformationSummary.d.ts +1 -1
- package/dist/types/components/Shared/forms/FinancialInformation/mapping/mapFinancialInformationToFinancialReport.d.ts +1 -1
- package/dist/types/components/Shared/forms/FinancialInformation/types.d.ts +1 -1
- package/dist/types/components/Shared/tasks/TaskList/TaskItemStatus.d.ts +1 -2
- package/dist/types/components/UnincorporatedPartnership/tasks/UnincorporatedPartnershipRoleAndType/UnincorporatedPartnershipRadioGroup.d.ts +2 -3
- package/dist/types/components/UnincorporatedPartnership/tasks/UnincorporatedPartnershipRoleAndType/UnincorporatedPartnershipRoleAndType.d.ts +1 -2
- package/dist/types/components/ui/atoms/Accordion/Accordion.d.ts +1 -2
- package/dist/types/components/ui/atoms/Button/Button.d.ts +2 -3
- package/dist/types/components/ui/atoms/Button/Button.types.d.ts +3 -3
- package/dist/types/components/ui/atoms/Field/Field.d.ts +3 -6
- package/dist/types/components/ui/atoms/Field/Field.types.d.ts +9 -12
- package/dist/types/components/ui/atoms/FormHeader/FormHeader.d.ts +4 -6
- package/dist/types/components/ui/atoms/InputBase/InputBase.d.ts +4 -4
- package/dist/types/components/ui/atoms/List/List.d.ts +12 -0
- package/dist/types/components/ui/atoms/Modal/MaybeModal.d.ts +1 -1
- package/dist/types/components/ui/atoms/RadioGroupCard/RadioGroupCard.types.d.ts +3 -3
- package/dist/types/components/ui/atoms/Remove/Remove.d.ts +1 -2
- package/dist/types/components/ui/atoms/Select/Select.d.ts +1 -2
- package/dist/types/components/ui/atoms/Select/Select.types.d.ts +1 -0
- package/dist/types/components/ui/atoms/SelectButton/SelectButton.d.ts +1 -2
- package/dist/types/components/ui/atoms/SelectButton/SelectButton.types.d.ts +3 -4
- package/dist/types/components/ui/atoms/SelectList/SelectList.d.ts +1 -2
- package/dist/types/components/ui/atoms/SelectList/SelectList.types.d.ts +2 -2
- package/dist/types/components/ui/atoms/SelectListItem/SelectListItem.types.d.ts +3 -3
- package/dist/types/components/ui/atoms/Svg/svgs.d.ts +6 -0
- package/dist/types/components/ui/atoms/TextArea/TextArea.d.ts +1 -2
- package/dist/types/components/ui/atoms/Tile/Tile.d.ts +1 -2
- package/dist/types/components/ui/layout/LandingLayout/LandingLayout.d.ts +10 -0
- package/dist/types/components/ui/layout/StackLayout/StackLayout.d.ts +8 -0
- package/dist/types/components/ui/molecules/Card/Card.d.ts +1 -2
- package/dist/types/components/ui/molecules/Card/types.d.ts +3 -3
- package/dist/types/components/ui/molecules/DocumentGuidance/DocumentGuidance.types.d.ts +2 -2
- package/dist/types/components/ui/molecules/Dropzone/Dropzone.d.ts +1 -2
- package/dist/types/components/ui/molecules/Dropzone/FilePicker.d.ts +2 -4
- package/dist/types/components/ui/molecules/EmbeddedStatus/EmbeddedStatus.d.ts +2 -2
- package/dist/types/components/ui/molecules/EmbeddedStatus/statusToTag.d.ts +2 -2
- package/dist/types/components/ui/molecules/FormEndState/FormEndState.d.ts +0 -1
- package/dist/types/components/ui/molecules/InputCurrency/InputCurrency.d.ts +1 -2
- package/dist/types/components/ui/molecules/InputDate/InputDate.d.ts +3 -3
- package/dist/types/components/ui/molecules/MaskedInput/MaskedInput.d.ts +2 -2
- package/dist/types/constants/keys.d.ts +2 -0
- package/dist/types/context/ExperimentContext/types.d.ts +8 -0
- package/dist/types/core/EmbedShell/EmbedShell.d.ts +1 -0
- package/dist/types/core/UIElement/UIElement.d.ts +1 -0
- package/dist/types/core/models/api/financialReport.d.ts +2 -2
- package/dist/types/core/models/api/get-scenarios.d.ts +1 -1
- package/dist/types/core/models/api/legal-arrangement.d.ts +10 -2
- package/dist/types/core/models/api/organization.d.ts +8 -0
- package/dist/types/core/user-events.d.ts +1 -1
- package/dist/types/embeds/business-financing/AdyenBusinessFinancing.d.ts +1 -1
- package/dist/types/embeds/business-financing/adyen-business-financing.types.d.ts +6 -1
- package/dist/types/embeds/individual/adyen-individual.types.d.ts +6 -1
- package/dist/types/embeds/onboarding/AdyenOnboarding.d.ts +1 -0
- package/dist/types/embeds/onboarding/adyen-onboarding.types.d.ts +4 -1
- package/dist/types/embeds/sign-pci/AdyenSignPci.d.ts +0 -1
- package/dist/types/embeds/sign-pci/adyen-sign-pci.types.d.ts +5 -3
- package/dist/types/embeds/terms-of-service/adyen-terms-of-service.types.d.ts +7 -1
- package/dist/types/embeds/transfer-instrument/AdyenTransferInstrument.d.ts +2 -1
- package/dist/types/embeds/transfer-instrument/adyen-transfer-instrument.types.d.ts +7 -2
- package/dist/types/hooks/useForm/types.d.ts +0 -2
- package/dist/types/hooks/useLegalCompanyNameField/useLegalCompanyNameField.d.ts +28 -0
- package/dist/types/hooks/useMultiForm/types.d.ts +36 -34
- package/dist/types/hooks/useMultiForm/useMultiForm.d.ts +1 -1
- package/dist/types/language/Language.d.ts +1 -7
- package/dist/types/language/i18n.d.ts +2 -0
- package/dist/types/language/types.d.ts +3 -0
- package/dist/types/language/utils.d.ts +11 -2
- package/dist/types/types/datasets/country-code.d.ts +249 -249
- package/dist/types/utils/entityAssociationUtil.d.ts +1 -2
- package/dist/types/utils/entityStatusUtil.d.ts +1 -1
- package/dist/types/utils/eventHandlers/handleKeys.d.ts +2 -2
- package/dist/types/utils/getDisplayErrorMessage.d.ts +2 -2
- package/dist/types/utils/getName.d.ts +2 -2
- package/dist/types/utils/makeSelectItemForRole.d.ts +2 -2
- package/dist/types/utils/masking/masks/businessRegistrationNumberMasks.d.ts +1 -0
- package/dist/types/utils/regex/patternValidators.d.ts +2 -0
- package/dist/types/utils/simulateTextChangeFromKeyboardEvent.d.ts +2 -2
- package/dist/types/utils/urlUtils.d.ts +1 -0
- package/dist/types/utils/validatorUtils.d.ts +2 -0
- package/dist/{useMultiForm-Bwx2nVhh.js → useMultiForm-KQwxav4F.js} +158 -135
- package/dist/{useOnboardingStatus-Cwba-HzS.js → useOnboardingStatus-BMyj9Pwn.js} +1 -1
- package/dist/{useSalesChannelsSettings-BLzegVJh.js → useSalesChannelsSettings-43TfSoxc.js} +2 -2
- package/dist/{useTermsOfServiceStatus-C-i9mF4m.js → useTermsOfServiceStatus-CBHKWYSb.js} +1 -1
- package/dist/{useUpdateLegalEntity-xQlAqIqy.js → useUpdateLegalEntity-D8dw9Oc3.js} +2 -2
- package/dist/{utils-DXv7uAh6.js → utils-CL9qlD-O.js} +18 -11
- package/dist/{validate-BN5p-GhK.js → validate-CeF0YKvL.js} +2 -2
- package/dist/vue/adyen-transfer-instrument.js +5 -4
- package/dist/{yaml-jFdy-qnY.js → yaml-CBkrSAtc.js} +2 -2
- package/dist/zh-CN-wUb4MmTZ.js +13 -0
- package/dist/zh-TW-DNTXHLKa.js +13 -0
- package/package.json +28 -27
- package/dist/FormEndState-C3HCmXcw.js +0 -32
- package/dist/SourceOfFunds.module-xwHIboir.js +0 -128
- package/dist/bg-BG-COTwZXwN.js +0 -2040
- package/dist/cs-CZ-DUlgJKVq.js +0 -2040
- package/dist/da-DK-BDzDHhVR.js +0 -2040
- package/dist/de-DE-B3TpRjZX.js +0 -994
- package/dist/de-DE-DJdgXqS_.js +0 -2040
- package/dist/el-GR-CFEuLvxK.js +0 -994
- package/dist/el-GR-D5i9BNyh.js +0 -2040
- package/dist/en-US-ghR-1_C2.js +0 -994
- package/dist/es-ES-BtWn2FOQ.js +0 -994
- package/dist/es-ES-VOSWszW5.js +0 -2040
- package/dist/et-EE-Bp4Ngsn4.js +0 -2040
- package/dist/fi-FI-DaujOE-a.js +0 -2040
- package/dist/fr-FR-BdPZxk11.js +0 -2040
- package/dist/fr-FR-HvIkGqJf.js +0 -994
- package/dist/hr-HR-BY7C7NxY.js +0 -2040
- package/dist/hu-HU-DHCty-Tc.js +0 -2040
- package/dist/it-IT-BMsuhZEQ.js +0 -2040
- package/dist/it-IT-CjbZahlB.js +0 -994
- package/dist/ja-JP-4jufT0xh.js +0 -994
- package/dist/ja-JP-BYDz1z2G.js +0 -2040
- package/dist/lt-LT-DNJ9V9xV.js +0 -2040
- package/dist/lv-LV-CFJwN5wq.js +0 -2040
- package/dist/nl-NL-B3xjfpMi.js +0 -994
- package/dist/nl-NL-DibAf790.js +0 -2040
- package/dist/no-NO-DHCy5rXx.js +0 -2040
- package/dist/pl-PL-eZBNH5HH.js +0 -2040
- package/dist/pt-PT-BpYDD-PX.js +0 -994
- package/dist/pt-PT-CiN_Wmfe.js +0 -2040
- package/dist/ro-RO-CgyMTvLc.js +0 -2040
- package/dist/ru-RU-BlgIj-Q4.js +0 -994
- package/dist/sk-SK-B5qlQB_U.js +0 -2040
- package/dist/sl-SI-8PPfrGzL.js +0 -2040
- package/dist/sv-SE-7lcf_fB9.js +0 -994
- package/dist/sv-SE-ZWLw6D3j.js +0 -2040
- package/dist/types/components/Individual/forms/IndividualOnfido/UboQuestionnaire/RichText.d.ts +0 -5
- package/dist/types/utils/sanitizeHtml.d.ts +0 -3
- package/dist/types/utils/useStateFromProp.d.ts +0 -9
- package/dist/zh-CN-xYZH718R.js +0 -994
- package/dist/zh-TW-DqBBNurv.js +0 -994
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
{
|
|
3
3
|
try {
|
|
4
4
|
let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
5
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "
|
|
5
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "fab1c08c-7248-460e-beb9-3b24de256e82", e._sentryDebugIdIdentifier = "sentry-dbid-fab1c08c-7248-460e-beb9-3b24de256e82");
|
|
6
6
|
} catch (e) {
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
;
|
|
10
10
|
import { useCallback, useMemo, useReducer, useEffect } from "preact/hooks";
|
|
11
|
-
import {
|
|
11
|
+
import { b1 as objectsDeepEqual, dG as ValidationResult, Y as createLogger, dH as isNotEmptyValidator, ar as isEmpty } from "./StoreProvider-ClKLaHzy.js";
|
|
12
12
|
const omitKeys = (obj, omit) => Object.keys(obj).filter((k) => !omit.includes(k)).reduce((a, c) => {
|
|
13
13
|
a[c] = obj[c];
|
|
14
14
|
return a;
|
|
@@ -16,7 +16,7 @@ const omitKeys = (obj, omit) => Object.keys(obj).filter((k) => !omit.includes(k)
|
|
|
16
16
|
const addKeys = (obj, add, initialValue, defaultData, pendingData) => add.reduce(
|
|
17
17
|
(a, c) => ({
|
|
18
18
|
...a,
|
|
19
|
-
[c]: a[c] ??
|
|
19
|
+
[c]: a[c] ?? pendingData?.[c] ?? defaultData?.[c] ?? initialValue
|
|
20
20
|
}),
|
|
21
21
|
obj
|
|
22
22
|
);
|
|
@@ -37,17 +37,16 @@ const processField = ({
|
|
|
37
37
|
formatters,
|
|
38
38
|
staticValidate
|
|
39
39
|
}) => {
|
|
40
|
-
|
|
41
|
-
const formatterFn = ((_a = formatters == null ? void 0 : formatters[key]) == null ? void 0 : _a.formatter) ? (_b = formatters[key]) == null ? void 0 : _b.formatter : formatters == null ? void 0 : formatters[key];
|
|
40
|
+
const formatterFn = formatters?.[key]?.formatter ? formatters[key]?.formatter : formatters?.[key];
|
|
42
41
|
const formattedValue = formatterFn && typeof formatterFn === "function" ? formatterFn(value, fieldContext) : value;
|
|
43
|
-
const shouldValidateField = !(
|
|
42
|
+
const shouldValidateField = !(defaultData?.[key] === value && !!defaultData?.[key]);
|
|
44
43
|
const validationResult = shouldValidateField ? staticValidate({ key, value: formattedValue, mode, formName }, data, fieldContext) : new ValidationResult([
|
|
45
44
|
{
|
|
46
45
|
isValid: true,
|
|
47
46
|
hasError: false
|
|
48
47
|
}
|
|
49
48
|
]);
|
|
50
|
-
const asyncValidationResult =
|
|
49
|
+
const asyncValidationResult = fieldContext.state?.asyncErrors?.[key];
|
|
51
50
|
if (asyncValidationResult) {
|
|
52
51
|
validationResult.addError(asyncValidationResult);
|
|
53
52
|
}
|
|
@@ -66,33 +65,32 @@ function init({
|
|
|
66
65
|
asyncErrors
|
|
67
66
|
}) {
|
|
68
67
|
const getProcessedState = (fieldKey, formName) => {
|
|
69
|
-
var _a, _b, _c, _d;
|
|
70
68
|
const [formattedValue, validationResult] = processField({
|
|
71
69
|
key: fieldKey,
|
|
72
|
-
value:
|
|
70
|
+
value: data?.[formName]?.[fieldKey] ?? defaultData?.[formName]?.[fieldKey] ?? null,
|
|
73
71
|
// When requiredField changes prefill any defaultData if no data is input
|
|
74
72
|
mode: "blur",
|
|
75
73
|
formName,
|
|
76
|
-
formatters: formatters
|
|
77
|
-
defaultData: defaultData
|
|
74
|
+
formatters: formatters?.[formName],
|
|
75
|
+
defaultData: defaultData?.[formName],
|
|
78
76
|
data,
|
|
79
77
|
fieldContext: {
|
|
80
78
|
state: {
|
|
81
|
-
data: data
|
|
82
|
-
obscuredFields: obscuredFields
|
|
83
|
-
optionalFields: optionalFields
|
|
84
|
-
trustedFields: trustedFields
|
|
85
|
-
requiredFields: requiredFields
|
|
86
|
-
asyncErrors: asyncErrors
|
|
79
|
+
data: data?.[formName],
|
|
80
|
+
obscuredFields: obscuredFields?.[formName],
|
|
81
|
+
optionalFields: optionalFields?.[formName],
|
|
82
|
+
trustedFields: trustedFields?.[formName],
|
|
83
|
+
requiredFields: requiredFields?.[formName],
|
|
84
|
+
asyncErrors: asyncErrors?.[formName]
|
|
87
85
|
}
|
|
88
86
|
},
|
|
89
87
|
staticValidate
|
|
90
88
|
});
|
|
91
89
|
return {
|
|
92
|
-
valid: validationResult.isValid && !
|
|
90
|
+
valid: validationResult.isValid && !fieldProblems?.[formName]?.[fieldKey] || false,
|
|
93
91
|
errors: null,
|
|
94
92
|
data: formattedValue,
|
|
95
|
-
fieldProblems:
|
|
93
|
+
fieldProblems: fieldProblems?.[formName]?.[fieldKey]
|
|
96
94
|
};
|
|
97
95
|
};
|
|
98
96
|
if (!requiredFields) {
|
|
@@ -114,10 +112,10 @@ function init({
|
|
|
114
112
|
return availableForms.reduce(
|
|
115
113
|
(acc, formName) => {
|
|
116
114
|
const form = formName;
|
|
117
|
-
const optionalsFormFields =
|
|
118
|
-
const requiredFormFields =
|
|
115
|
+
const optionalsFormFields = optionalFields?.[form] ?? [];
|
|
116
|
+
const requiredFormFields = requiredFields?.[form] ?? [];
|
|
119
117
|
const formFields = [...optionalsFormFields, ...requiredFormFields];
|
|
120
|
-
const formState = formFields
|
|
118
|
+
const formState = formFields?.reduce(
|
|
121
119
|
(acc2, field) => {
|
|
122
120
|
const {
|
|
123
121
|
valid,
|
|
@@ -199,7 +197,6 @@ function reducer({
|
|
|
199
197
|
optionalFields: newOptionalFields,
|
|
200
198
|
asyncValidationResults
|
|
201
199
|
}) => {
|
|
202
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S;
|
|
203
200
|
const clonedState = structuredClone(state);
|
|
204
201
|
switch (type) {
|
|
205
202
|
case "setData": {
|
|
@@ -209,7 +206,7 @@ function reducer({
|
|
|
209
206
|
data: {
|
|
210
207
|
...clonedState.data,
|
|
211
208
|
[formName]: {
|
|
212
|
-
...
|
|
209
|
+
...clonedState.data?.[formName],
|
|
213
210
|
[key]: value
|
|
214
211
|
}
|
|
215
212
|
}
|
|
@@ -217,13 +214,49 @@ function reducer({
|
|
|
217
214
|
}
|
|
218
215
|
case "setFormData": {
|
|
219
216
|
if (!formName || !formData) return state;
|
|
220
|
-
const formRequiredFields =
|
|
221
|
-
const formOptionalFields =
|
|
217
|
+
const formRequiredFields = clonedState.requiredFields?.[formName] ?? [];
|
|
218
|
+
const formOptionalFields = clonedState.optionalFields?.[formName] ?? [];
|
|
222
219
|
const allowedFields = [...formRequiredFields, ...formOptionalFields];
|
|
223
220
|
const filteredUpdates = Object.keys(formData).filter((key2) => allowedFields.includes(key2)).reduce((obj, key2) => {
|
|
224
221
|
obj[key2] = formData[key2];
|
|
225
222
|
return obj;
|
|
226
223
|
}, {});
|
|
224
|
+
const updatedData = {
|
|
225
|
+
// provide the updated data before running validations
|
|
226
|
+
...clonedState.data,
|
|
227
|
+
[formName]: filteredUpdates
|
|
228
|
+
};
|
|
229
|
+
const formValidity = allowedFields.reduce(
|
|
230
|
+
(acc, field) => {
|
|
231
|
+
const [, validation] = processField({
|
|
232
|
+
key: field,
|
|
233
|
+
value: filteredUpdates[field],
|
|
234
|
+
mode: "blur",
|
|
235
|
+
formName,
|
|
236
|
+
defaultData: defaultData?.[formName],
|
|
237
|
+
data: updatedData,
|
|
238
|
+
formatters: formatters?.[formName],
|
|
239
|
+
fieldContext: {
|
|
240
|
+
state: {
|
|
241
|
+
data: clonedState?.data?.[formName],
|
|
242
|
+
obscuredFields: obscuredFields?.[formName],
|
|
243
|
+
optionalFields: optionalFields?.[formName],
|
|
244
|
+
trustedFields: trustedFields?.[formName],
|
|
245
|
+
errors: clonedState.errors?.[formName],
|
|
246
|
+
valid: clonedState.valid?.[formName],
|
|
247
|
+
fieldProblems: clonedState.fieldProblems?.[formName],
|
|
248
|
+
asyncErrors: clonedState.asyncErrors?.[formName]
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
staticValidate
|
|
252
|
+
});
|
|
253
|
+
return {
|
|
254
|
+
...acc,
|
|
255
|
+
[field]: validation.isValid
|
|
256
|
+
};
|
|
257
|
+
},
|
|
258
|
+
{}
|
|
259
|
+
);
|
|
227
260
|
return {
|
|
228
261
|
...clonedState,
|
|
229
262
|
data: {
|
|
@@ -232,17 +265,21 @@ function reducer({
|
|
|
232
265
|
// ...with the new, filtered updates.
|
|
233
266
|
...filteredUpdates
|
|
234
267
|
}
|
|
268
|
+
},
|
|
269
|
+
valid: {
|
|
270
|
+
...clonedState.valid,
|
|
271
|
+
[formName]: formValidity
|
|
235
272
|
}
|
|
236
273
|
};
|
|
237
274
|
}
|
|
238
275
|
case "setValid": {
|
|
239
276
|
if (!key || !formName) return state;
|
|
240
|
-
return
|
|
277
|
+
return clonedState?.valid?.[formName]?.[key] === value ? state : {
|
|
241
278
|
...clonedState,
|
|
242
279
|
valid: {
|
|
243
280
|
...clonedState.valid,
|
|
244
281
|
[formName]: {
|
|
245
|
-
...
|
|
282
|
+
...clonedState.valid?.[formName],
|
|
246
283
|
[key]: value
|
|
247
284
|
}
|
|
248
285
|
}
|
|
@@ -255,7 +292,7 @@ function reducer({
|
|
|
255
292
|
errors: {
|
|
256
293
|
...clonedState.errors,
|
|
257
294
|
[formName]: {
|
|
258
|
-
...
|
|
295
|
+
...clonedState.errors?.[formName],
|
|
259
296
|
[key]: value
|
|
260
297
|
}
|
|
261
298
|
}
|
|
@@ -295,87 +332,75 @@ function reducer({
|
|
|
295
332
|
staticValidate,
|
|
296
333
|
data: defaultData
|
|
297
334
|
});
|
|
298
|
-
const removedFields =
|
|
299
|
-
...(
|
|
335
|
+
const removedFields = clonedState.optionalFields?.[formName].length ? [
|
|
336
|
+
...(clonedState.requiredFields?.[formName] ?? []).filter(
|
|
300
337
|
(field) => !innerFormFields.includes(field)
|
|
301
338
|
),
|
|
302
339
|
...clonedState.optionalFields[formName].filter(
|
|
303
|
-
(field) =>
|
|
304
|
-
var _a2;
|
|
305
|
-
return !((_a2 = optionalFields == null ? void 0 : optionalFields[formName]) == null ? void 0 : _a2.includes(field));
|
|
306
|
-
}
|
|
340
|
+
(field) => !optionalFields?.[formName]?.includes(field)
|
|
307
341
|
)
|
|
308
|
-
] :
|
|
342
|
+
] : clonedState.requiredFields?.[formName]?.filter(
|
|
309
343
|
(field) => !innerFormFields.includes(field)
|
|
310
344
|
);
|
|
311
|
-
const newFields =
|
|
345
|
+
const newFields = optionalFields?.[formName].length ? [
|
|
312
346
|
...innerFormFields.filter(
|
|
313
|
-
(field) =>
|
|
314
|
-
var _a2;
|
|
315
|
-
return !((_a2 = clonedState.requiredFields) == null ? void 0 : _a2[formName].includes(field));
|
|
316
|
-
}
|
|
347
|
+
(field) => !clonedState.requiredFields?.[formName].includes(field)
|
|
317
348
|
),
|
|
318
349
|
...(optionalFields[formName] ?? []).filter(
|
|
319
|
-
(field) =>
|
|
320
|
-
var _a2;
|
|
321
|
-
return !((_a2 = clonedState.optionalFields) == null ? void 0 : _a2[formName].includes(field));
|
|
322
|
-
}
|
|
350
|
+
(field) => !clonedState.optionalFields?.[formName].includes(field)
|
|
323
351
|
)
|
|
324
352
|
] : innerFormFields.filter(
|
|
325
|
-
(field) =>
|
|
326
|
-
var _a2;
|
|
327
|
-
return !((_a2 = clonedState.requiredFields) == null ? void 0 : _a2[formName].includes(field));
|
|
328
|
-
}
|
|
353
|
+
(field) => !clonedState.requiredFields?.[formName].includes(field)
|
|
329
354
|
);
|
|
330
355
|
const formLocal = {
|
|
331
|
-
data: omitKeys(
|
|
332
|
-
errors: omitKeys(
|
|
333
|
-
valid: omitKeys(
|
|
334
|
-
fieldProblems: omitKeys(
|
|
356
|
+
data: omitKeys(clonedState.data?.[formName], newFields),
|
|
357
|
+
errors: omitKeys(clonedState.errors?.[formName], newFields),
|
|
358
|
+
valid: omitKeys(clonedState.valid?.[formName], newFields),
|
|
359
|
+
fieldProblems: omitKeys(clonedState.fieldProblems?.[formName], newFields)
|
|
335
360
|
};
|
|
336
361
|
const local = {
|
|
337
362
|
...clonedState.local,
|
|
338
363
|
[formName]: formLocal
|
|
339
364
|
};
|
|
340
365
|
const updatedFormData = addKeys(
|
|
341
|
-
omitKeys(
|
|
366
|
+
omitKeys(clonedState.data?.[formName], removedFields),
|
|
342
367
|
newFields,
|
|
343
368
|
null,
|
|
344
|
-
|
|
345
|
-
|
|
369
|
+
defaultState.data?.[formName],
|
|
370
|
+
clonedState.local?.[formName].data
|
|
346
371
|
);
|
|
347
372
|
const updatedData = {
|
|
348
373
|
...clonedState.data,
|
|
349
374
|
[formName]: updatedFormData
|
|
350
375
|
};
|
|
351
376
|
const updatedFormValidity = addKeys(
|
|
352
|
-
omitKeys(
|
|
377
|
+
omitKeys(clonedState.valid?.[formName], removedFields),
|
|
353
378
|
newFields,
|
|
354
379
|
false,
|
|
355
|
-
|
|
356
|
-
|
|
380
|
+
defaultState.valid?.[formName],
|
|
381
|
+
clonedState.local?.[formName].valid
|
|
357
382
|
);
|
|
358
383
|
const updatedValidity = {
|
|
359
384
|
...clonedState.valid,
|
|
360
385
|
[formName]: updatedFormValidity
|
|
361
386
|
};
|
|
362
387
|
const updatedFormErrors = addKeys(
|
|
363
|
-
omitKeys(
|
|
388
|
+
omitKeys(clonedState.errors?.[formName], removedFields),
|
|
364
389
|
newFields,
|
|
365
390
|
null,
|
|
366
|
-
|
|
367
|
-
|
|
391
|
+
defaultState.errors?.[formName],
|
|
392
|
+
clonedState.local?.[formName].errors
|
|
368
393
|
);
|
|
369
394
|
const updatedErrors = {
|
|
370
395
|
...clonedState.errors,
|
|
371
396
|
[formName]: updatedFormErrors
|
|
372
397
|
};
|
|
373
398
|
const updatedFormFieldProblems = addKeys(
|
|
374
|
-
omitKeys(
|
|
399
|
+
omitKeys(clonedState.fieldProblems?.[formName], removedFields),
|
|
375
400
|
newFields,
|
|
376
401
|
false,
|
|
377
|
-
|
|
378
|
-
|
|
402
|
+
defaultState.fieldProblems?.[formName],
|
|
403
|
+
clonedState.local?.[formName].fieldProblems
|
|
379
404
|
);
|
|
380
405
|
const updatedFieldProblems = {
|
|
381
406
|
...clonedState.fieldProblems,
|
|
@@ -400,14 +425,14 @@ function reducer({
|
|
|
400
425
|
// provide the updated data before running validations
|
|
401
426
|
...clonedState.data,
|
|
402
427
|
[formName]: {
|
|
403
|
-
...
|
|
428
|
+
...clonedState.data?.[formName],
|
|
404
429
|
[key]: value
|
|
405
430
|
}
|
|
406
431
|
};
|
|
407
|
-
const updatedAsyncErrors = hasValueChanged(value,
|
|
432
|
+
const updatedAsyncErrors = hasValueChanged(value, clonedState.data?.[formName]?.[key]) ? {
|
|
408
433
|
...clonedState.asyncErrors,
|
|
409
434
|
[formName]: {
|
|
410
|
-
...
|
|
435
|
+
...clonedState.asyncErrors?.[formName],
|
|
411
436
|
[key]: null
|
|
412
437
|
}
|
|
413
438
|
} : clonedState.asyncErrors;
|
|
@@ -416,31 +441,31 @@ function reducer({
|
|
|
416
441
|
value,
|
|
417
442
|
mode,
|
|
418
443
|
formName,
|
|
419
|
-
defaultData: defaultData
|
|
444
|
+
defaultData: defaultData?.[formName],
|
|
420
445
|
data: updatedData,
|
|
421
|
-
formatters: formatters
|
|
446
|
+
formatters: formatters?.[formName],
|
|
422
447
|
fieldContext: {
|
|
423
448
|
state: {
|
|
424
|
-
data:
|
|
425
|
-
obscuredFields: obscuredFields
|
|
426
|
-
optionalFields: optionalFields
|
|
427
|
-
trustedFields: trustedFields
|
|
428
|
-
errors:
|
|
429
|
-
valid:
|
|
430
|
-
fieldProblems:
|
|
431
|
-
asyncErrors: updatedAsyncErrors
|
|
449
|
+
data: clonedState?.data?.[formName],
|
|
450
|
+
obscuredFields: obscuredFields?.[formName],
|
|
451
|
+
optionalFields: optionalFields?.[formName],
|
|
452
|
+
trustedFields: trustedFields?.[formName],
|
|
453
|
+
errors: clonedState.errors?.[formName],
|
|
454
|
+
valid: clonedState.valid?.[formName],
|
|
455
|
+
fieldProblems: clonedState.fieldProblems?.[formName],
|
|
456
|
+
asyncErrors: updatedAsyncErrors?.[formName]
|
|
432
457
|
}
|
|
433
458
|
},
|
|
434
459
|
staticValidate
|
|
435
460
|
});
|
|
436
|
-
const oldValue =
|
|
437
|
-
const clearFieldProblems =
|
|
461
|
+
const oldValue = clonedState?.data?.[formName];
|
|
462
|
+
const clearFieldProblems = oldValue?.[key] !== formattedValue;
|
|
438
463
|
const result = {
|
|
439
464
|
...clonedState,
|
|
440
465
|
data: {
|
|
441
466
|
...clonedState.data,
|
|
442
467
|
[formName]: {
|
|
443
|
-
...
|
|
468
|
+
...clonedState?.data?.[formName],
|
|
444
469
|
[key]: formattedValue
|
|
445
470
|
}
|
|
446
471
|
},
|
|
@@ -448,22 +473,22 @@ function reducer({
|
|
|
448
473
|
errors: {
|
|
449
474
|
...clonedState.errors,
|
|
450
475
|
[formName]: {
|
|
451
|
-
...
|
|
476
|
+
...clonedState?.errors?.[formName],
|
|
452
477
|
[key]: validation.getError() ?? null
|
|
453
478
|
}
|
|
454
479
|
},
|
|
455
480
|
valid: {
|
|
456
481
|
...clonedState.valid,
|
|
457
482
|
[formName]: {
|
|
458
|
-
...
|
|
459
|
-
[key]: (validation.isValid && !
|
|
483
|
+
...clonedState?.valid?.[formName],
|
|
484
|
+
[key]: (validation.isValid && !clonedState.fieldProblems?.[formName]?.[key]) ?? false
|
|
460
485
|
}
|
|
461
486
|
},
|
|
462
487
|
fieldProblems: {
|
|
463
488
|
...clonedState.fieldProblems,
|
|
464
489
|
[formName]: {
|
|
465
|
-
...
|
|
466
|
-
...!clearFieldProblems &&
|
|
490
|
+
...clonedState?.fieldProblems?.[formName],
|
|
491
|
+
...!clearFieldProblems && clonedState.fieldProblems?.[formName]?.[key] ? { [key]: true } : {}
|
|
467
492
|
}
|
|
468
493
|
}
|
|
469
494
|
};
|
|
@@ -473,56 +498,55 @@ function reducer({
|
|
|
473
498
|
if (!formName) {
|
|
474
499
|
return state;
|
|
475
500
|
}
|
|
476
|
-
const formFields =
|
|
501
|
+
const formFields = clonedState.requiredFields?.[formName];
|
|
477
502
|
if (!formFields) {
|
|
478
503
|
return state;
|
|
479
504
|
}
|
|
480
505
|
const formState = (selectedSchema || formFields).reduce(
|
|
481
506
|
(acc, field) => {
|
|
482
|
-
|
|
483
|
-
const formData2 = (_a2 = clonedState.data) == null ? void 0 : _a2[formName];
|
|
507
|
+
const formData2 = clonedState.data?.[formName];
|
|
484
508
|
const [formattedValue, validation] = processField({
|
|
485
509
|
key: field,
|
|
486
510
|
mode: "blur",
|
|
487
|
-
value:
|
|
511
|
+
value: formData2?.[field] ?? null,
|
|
488
512
|
formName,
|
|
489
|
-
defaultData: defaultData
|
|
490
|
-
data: clonedState
|
|
491
|
-
formatters: formatters
|
|
513
|
+
defaultData: defaultData?.[formName],
|
|
514
|
+
data: clonedState?.data,
|
|
515
|
+
formatters: formatters?.[formName],
|
|
492
516
|
fieldContext: {
|
|
493
517
|
state: {
|
|
494
|
-
data:
|
|
495
|
-
obscuredFields: obscuredFields
|
|
496
|
-
optionalFields: optionalFields
|
|
497
|
-
trustedFields: trustedFields
|
|
498
|
-
errors:
|
|
499
|
-
valid:
|
|
500
|
-
fieldProblems:
|
|
501
|
-
asyncErrors:
|
|
518
|
+
data: clonedState?.data?.[formName],
|
|
519
|
+
obscuredFields: obscuredFields?.[formName],
|
|
520
|
+
optionalFields: optionalFields?.[formName],
|
|
521
|
+
trustedFields: trustedFields?.[formName],
|
|
522
|
+
errors: clonedState.errors?.[formName],
|
|
523
|
+
valid: clonedState.valid?.[formName],
|
|
524
|
+
fieldProblems: clonedState.fieldProblems?.[formName],
|
|
525
|
+
asyncErrors: clonedState.asyncErrors?.[formName]
|
|
502
526
|
}
|
|
503
527
|
},
|
|
504
528
|
staticValidate
|
|
505
529
|
});
|
|
506
|
-
const oldValue =
|
|
507
|
-
const clearFieldProblems =
|
|
508
|
-
const fieldAsyncValidationResult = asyncValidationResults
|
|
530
|
+
const oldValue = clonedState?.data?.[formName];
|
|
531
|
+
const clearFieldProblems = oldValue?.[field] !== formattedValue;
|
|
532
|
+
const fieldAsyncValidationResult = asyncValidationResults?.[field];
|
|
509
533
|
return {
|
|
510
534
|
data: formData2,
|
|
511
535
|
asyncErrors: {
|
|
512
536
|
...acc.asyncErrors,
|
|
513
|
-
[field]:
|
|
537
|
+
[field]: fieldAsyncValidationResult?.getError() ?? null
|
|
514
538
|
},
|
|
515
539
|
errors: {
|
|
516
540
|
...acc.errors,
|
|
517
|
-
[field]: validation.getError() ??
|
|
541
|
+
[field]: validation.getError() ?? fieldAsyncValidationResult?.getError() ?? null
|
|
518
542
|
},
|
|
519
543
|
valid: {
|
|
520
544
|
...acc.valid,
|
|
521
|
-
[field]: (validation.isValid && (
|
|
545
|
+
[field]: (validation.isValid && (fieldAsyncValidationResult?.isValid ?? true) && !clonedState.fieldProblems?.[formName]?.[field]) ?? false
|
|
522
546
|
},
|
|
523
547
|
fieldProblems: {
|
|
524
548
|
...acc.fieldProblems,
|
|
525
|
-
...!clearFieldProblems &&
|
|
549
|
+
...!clearFieldProblems && acc.fieldProblems?.[field] ? { [field]: true } : {}
|
|
526
550
|
}
|
|
527
551
|
};
|
|
528
552
|
},
|
|
@@ -561,10 +585,9 @@ const useMultiFormAsyncValidator = (asyncRules) => {
|
|
|
561
585
|
};
|
|
562
586
|
const triggerAsyncValidation = useCallback(
|
|
563
587
|
async (field, formName, data) => {
|
|
564
|
-
var _a, _b, _c, _d;
|
|
565
588
|
if (!asyncRules) return new ValidationResult([validResult]);
|
|
566
|
-
const rule = typeof asyncRules === "function" ?
|
|
567
|
-
const value =
|
|
589
|
+
const rule = typeof asyncRules === "function" ? asyncRules?.(data)?.[formName]?.[field] : asyncRules?.[formName]?.[field];
|
|
590
|
+
const value = data?.[formName]?.[field];
|
|
568
591
|
if (!rule || !value) return new ValidationResult([validResult]);
|
|
569
592
|
const isValid = await rule.asyncValidate(value).catch(logger.error);
|
|
570
593
|
if (isValid === false) {
|
|
@@ -581,8 +604,7 @@ const useMultiFormAsyncValidator = (asyncRules) => {
|
|
|
581
604
|
[asyncRules]
|
|
582
605
|
);
|
|
583
606
|
const triggerAsyncFormValidation = async (formName, state, selectedSchema) => {
|
|
584
|
-
|
|
585
|
-
const asyncValidationResults = await ((_b = selectedSchema ?? ((_a = state.requiredFields) == null ? void 0 : _a[formName])) == null ? void 0 : _b.reduce(async (accPromise, fieldName) => {
|
|
607
|
+
const asyncValidationResults = await (selectedSchema ?? state.requiredFields?.[formName])?.reduce(async (accPromise, fieldName) => {
|
|
586
608
|
const acc = await accPromise;
|
|
587
609
|
const asyncValidationResult = await triggerAsyncValidation(
|
|
588
610
|
fieldName,
|
|
@@ -593,7 +615,7 @@ const useMultiFormAsyncValidator = (asyncRules) => {
|
|
|
593
615
|
...acc,
|
|
594
616
|
[fieldName]: asyncValidationResult
|
|
595
617
|
};
|
|
596
|
-
}, Promise.resolve({}))
|
|
618
|
+
}, Promise.resolve({}));
|
|
597
619
|
const isValid = Object.values(asyncValidationResults ?? {}).every(
|
|
598
620
|
(validationResult) => validationResult.isValid
|
|
599
621
|
);
|
|
@@ -609,7 +631,6 @@ const useMultiFormAsyncValidator = (asyncRules) => {
|
|
|
609
631
|
const useMultiFormStaticValidator = (rules) => {
|
|
610
632
|
const getRulesForField = useCallback(
|
|
611
633
|
(field, form, data) => {
|
|
612
|
-
var _a, _b, _c;
|
|
613
634
|
const fallbackRule = {
|
|
614
635
|
validate: () => true,
|
|
615
636
|
modes: ["blur", "input"]
|
|
@@ -617,19 +638,18 @@ const useMultiFormStaticValidator = (rules) => {
|
|
|
617
638
|
if (!form) {
|
|
618
639
|
return [fallbackRule];
|
|
619
640
|
}
|
|
620
|
-
const fieldRules = typeof rules === "function" ?
|
|
641
|
+
const fieldRules = typeof rules === "function" ? rules(data)?.[form]?.[field] ?? [fallbackRule] : rules?.[form]?.[field] ?? [fallbackRule];
|
|
621
642
|
return Array.isArray(fieldRules) ? fieldRules : [fieldRules];
|
|
622
643
|
},
|
|
623
644
|
[rules]
|
|
624
645
|
);
|
|
625
646
|
const triggerStaticValidation = useCallback(
|
|
626
647
|
({ key, value, mode = "blur", formName }, data, context) => {
|
|
627
|
-
var _a, _b;
|
|
628
648
|
const fieldRules = getRulesForField(key, formName, data);
|
|
629
|
-
const isFieldOptional = !!
|
|
630
|
-
const isFieldObscured = !!
|
|
649
|
+
const isFieldOptional = !!context?.state.optionalFields?.includes(key);
|
|
650
|
+
const isFieldObscured = !!context?.state.obscuredFields?.includes(key);
|
|
631
651
|
if (!isFieldOptional) {
|
|
632
|
-
fieldRules
|
|
652
|
+
fieldRules?.unshift(isNotEmptyValidator);
|
|
633
653
|
}
|
|
634
654
|
const validationRulesResult = fieldRules.map((rule) => {
|
|
635
655
|
const shouldValidate = rule.modes.includes(mode) && !isFieldObscured;
|
|
@@ -649,11 +669,12 @@ const useMultiFormStaticValidator = (rules) => {
|
|
|
649
669
|
};
|
|
650
670
|
};
|
|
651
671
|
function useMultiForm({
|
|
652
|
-
requiredFields,
|
|
653
672
|
defaultData,
|
|
654
673
|
rules,
|
|
655
674
|
asyncRules,
|
|
656
675
|
fieldProblems,
|
|
676
|
+
allFields,
|
|
677
|
+
requiredFields,
|
|
657
678
|
obscuredFields,
|
|
658
679
|
optionalFields,
|
|
659
680
|
trustedFields,
|
|
@@ -715,15 +736,14 @@ function useMultiForm({
|
|
|
715
736
|
/* @__PURE__ */ new Set([...formsForOptionalFields, ...formsForRequiredFields])
|
|
716
737
|
);
|
|
717
738
|
return availableForms.reduce((acc, formName) => {
|
|
718
|
-
var _a, _b, _c, _d;
|
|
719
739
|
const form = formName;
|
|
720
|
-
const optionalsFormFields =
|
|
721
|
-
const requiredFormFields =
|
|
740
|
+
const optionalsFormFields = state.optionalFields?.[form] ?? [];
|
|
741
|
+
const requiredFormFields = state.requiredFields?.[form] ?? [];
|
|
722
742
|
const formFields = [...optionalsFormFields, ...requiredFormFields];
|
|
723
|
-
const formValidity =
|
|
743
|
+
const formValidity = state.valid?.[formName] ?? {};
|
|
724
744
|
return {
|
|
725
745
|
...acc,
|
|
726
|
-
[formName]:
|
|
746
|
+
[formName]: Object.entries(formValidity)?.every(
|
|
727
747
|
([field, valid]) => formFields.includes(field) ? valid : true
|
|
728
748
|
)
|
|
729
749
|
};
|
|
@@ -731,10 +751,9 @@ function useMultiForm({
|
|
|
731
751
|
}, [state.requiredFields, state.valid]);
|
|
732
752
|
const getTargetValue = useCallback(
|
|
733
753
|
(key, formName, e) => {
|
|
734
|
-
|
|
735
|
-
if (!(e == null ? void 0 : e.target)) return e;
|
|
754
|
+
if (!e?.target) return e;
|
|
736
755
|
if (e.target.type === "checkbox") {
|
|
737
|
-
return !
|
|
756
|
+
return !state.data?.[formName][key];
|
|
738
757
|
}
|
|
739
758
|
return e.target.value;
|
|
740
759
|
},
|
|
@@ -767,15 +786,15 @@ function useMultiForm({
|
|
|
767
786
|
formName
|
|
768
787
|
});
|
|
769
788
|
},
|
|
770
|
-
[
|
|
789
|
+
[getTargetValue]
|
|
771
790
|
);
|
|
772
791
|
const triggerValidation = useCallback(
|
|
773
792
|
async (formName, selectedSchema) => {
|
|
774
|
-
const asyncValidationResults = await
|
|
793
|
+
const asyncValidationResults = await triggerAsyncFormValidation?.(
|
|
775
794
|
formName,
|
|
776
795
|
state,
|
|
777
796
|
selectedSchema
|
|
778
|
-
)
|
|
797
|
+
);
|
|
779
798
|
dispatch({
|
|
780
799
|
type: "validateForm",
|
|
781
800
|
formName,
|
|
@@ -784,13 +803,13 @@ function useMultiForm({
|
|
|
784
803
|
});
|
|
785
804
|
return asyncValidationResults.isValid;
|
|
786
805
|
},
|
|
787
|
-
[
|
|
806
|
+
[state, triggerAsyncFormValidation]
|
|
788
807
|
);
|
|
789
808
|
const resetToDefaultData = useCallback(() => {
|
|
790
809
|
if (!getSchema) return;
|
|
791
810
|
Object.entries(getSchema).forEach(([formName]) => {
|
|
792
811
|
const form = formName;
|
|
793
|
-
const formData = defaultData
|
|
812
|
+
const formData = defaultData?.[form];
|
|
794
813
|
getSchema[form].forEach((field) => {
|
|
795
814
|
if (!formData || typeof formData[field] !== "undefined") {
|
|
796
815
|
return handleChangeFor(field, form)(formData);
|
|
@@ -802,7 +821,7 @@ function useMultiForm({
|
|
|
802
821
|
});
|
|
803
822
|
}, [defaultData, getSchema, handleChangeFor, setData, setErrors, setValid]);
|
|
804
823
|
useEffect(() => {
|
|
805
|
-
const requiredFields2 = getRequiredFields(state
|
|
824
|
+
const requiredFields2 = getRequiredFields(state?.data);
|
|
806
825
|
if (!requiredFields2) {
|
|
807
826
|
return;
|
|
808
827
|
}
|
|
@@ -822,7 +841,11 @@ function useMultiForm({
|
|
|
822
841
|
triggerValidation,
|
|
823
842
|
resetToDefaultData,
|
|
824
843
|
isValid,
|
|
844
|
+
allFields,
|
|
825
845
|
requiredFields: state.requiredFields,
|
|
846
|
+
optionalFields: state.optionalFields,
|
|
847
|
+
trustedFields: state.trustedFields,
|
|
848
|
+
obscuredFields: state.obscuredFields,
|
|
826
849
|
valid: state.valid,
|
|
827
850
|
errors: state.errors,
|
|
828
851
|
data: state.data,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
;
|
|
10
|
-
import { p as useApiContext, q as useQuery, r as httpGet } from "./StoreProvider-
|
|
10
|
+
import { p as useApiContext, q as useQuery, r as httpGet } from "./StoreProvider-ClKLaHzy.js";
|
|
11
11
|
const getOnboardingStatus = async (legalEntityId, baseUrl) => {
|
|
12
12
|
return httpGet({
|
|
13
13
|
baseUrl,
|