@redneckz/wildless-cms-uni-blocks 0.14.709 → 0.14.710
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/bundle/bundle.umd.js +323 -355
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/useSaveUserData.d.ts +1 -1
- package/bundle/components/CreditCardForm/CreditCardFormStep.d.ts +2 -2
- package/bundle/components/CreditCardForm/getInitialFormState.d.ts +1 -1
- package/bundle/components/CreditCardForm/useCreditCardFormAPI.d.ts +4 -17
- package/bundle/components/CreditForm/CreditFormStep.d.ts +3 -3
- package/bundle/components/CreditForm/getInitialFormState.d.ts +1 -1
- package/bundle/components/CreditForm/useCreditFormAPI.d.ts +4 -17
- package/bundle/hooks/useRetailFormStore.d.ts +33 -0
- package/bundle/ui-kit/FormField/updateOrganizationFields.d.ts +2 -2
- package/dist/components/ApplicationLeadForm/useSaveUserData.d.ts +1 -1
- package/dist/components/ApplicationLeadForm/useSaveUserData.js +2 -4
- package/dist/components/ApplicationLeadForm/useSaveUserData.js.map +1 -1
- package/dist/components/CreditCardForm/CreditCardForm.js +3 -2
- package/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/dist/components/CreditCardForm/CreditCardFormStatusTracker.js +2 -2
- package/dist/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
- package/dist/components/CreditCardForm/CreditCardFormStep.d.ts +2 -2
- package/dist/components/CreditCardForm/CreditCardFormStep.js +7 -13
- package/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/dist/components/CreditCardForm/PendingStatusContent.js +2 -2
- package/dist/components/CreditCardForm/PendingStatusContent.js.map +1 -1
- package/dist/components/CreditCardForm/ReworkStatusContent.js +2 -2
- package/dist/components/CreditCardForm/ReworkStatusContent.js.map +1 -1
- package/dist/components/CreditCardForm/SuccessStatusContent.js +2 -2
- package/dist/components/CreditCardForm/SuccessStatusContent.js.map +1 -1
- package/dist/components/CreditCardForm/formStateMap.js +1 -4
- package/dist/components/CreditCardForm/formStateMap.js.map +1 -1
- package/dist/components/CreditCardForm/getInitialFormState.d.ts +1 -1
- package/dist/components/CreditCardForm/getInitialFormState.js +8 -11
- package/dist/components/CreditCardForm/getInitialFormState.js.map +1 -1
- package/dist/components/CreditCardForm/useCreditCardFormAPI.d.ts +4 -17
- package/dist/components/CreditCardForm/useCreditCardFormAPI.js +32 -34
- package/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/dist/components/CreditForm/CreditForm.js +3 -2
- package/dist/components/CreditForm/CreditForm.js.map +1 -1
- package/dist/components/CreditForm/CreditFormStatusTracker.js +2 -2
- package/dist/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
- package/dist/components/CreditForm/CreditFormStep.d.ts +3 -3
- package/dist/components/CreditForm/CreditFormStep.js +9 -14
- package/dist/components/CreditForm/CreditFormStep.js.map +1 -1
- package/dist/components/CreditForm/PendingStatusContent.js +2 -2
- package/dist/components/CreditForm/PendingStatusContent.js.map +1 -1
- package/dist/components/CreditForm/ReworkStatusContent.js +2 -2
- package/dist/components/CreditForm/ReworkStatusContent.js.map +1 -1
- package/dist/components/CreditForm/SuccessStatusContent.js +2 -2
- package/dist/components/CreditForm/SuccessStatusContent.js.map +1 -1
- package/dist/components/CreditForm/getInitialFormState.d.ts +1 -1
- package/dist/components/CreditForm/getInitialFormState.js +8 -11
- package/dist/components/CreditForm/getInitialFormState.js.map +1 -1
- package/dist/components/CreditForm/useCreditFormAPI.d.ts +4 -17
- package/dist/components/CreditForm/useCreditFormAPI.js +32 -39
- package/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/dist/hooks/useRetailFormStore.d.ts +33 -0
- package/{mobile/dist/hooks/useCreditFormStore.js → dist/hooks/useRetailFormStore.js} +4 -4
- package/dist/hooks/useRetailFormStore.js.map +1 -0
- package/dist/ui-kit/DraftDialog/DraftDialog.js +7 -9
- package/dist/ui-kit/DraftDialog/DraftDialog.js.map +1 -1
- package/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js +6 -6
- package/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/AmountWorkersField.js +2 -2
- package/dist/ui-kit/FormField/Fields/AmountWorkersField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/EmployerActivitiesField.js +2 -2
- package/dist/ui-kit/FormField/Fields/EmployerActivitiesField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/EmployerOrganizationField.js +2 -2
- package/dist/ui-kit/FormField/Fields/EmployerOrganizationField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/InnField.js +2 -2
- package/dist/ui-kit/FormField/Fields/OrganizationField.js +2 -2
- package/dist/ui-kit/FormField/Fields/OrganizationField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/OrganizationNameField.js +2 -2
- package/dist/ui-kit/FormField/updateOrganizationFields.d.ts +2 -2
- package/dist/ui-kit/FormField/updateOrganizationFields.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useSaveUserData.d.ts +1 -1
- package/lib/components/ApplicationLeadForm/useSaveUserData.js +2 -4
- package/lib/components/ApplicationLeadForm/useSaveUserData.js.map +1 -1
- package/lib/components/CreditCardForm/CreditCardForm.js +3 -2
- package/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/lib/components/CreditCardForm/CreditCardFormStatusTracker.js +2 -2
- package/lib/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
- package/lib/components/CreditCardForm/CreditCardFormStep.d.ts +2 -2
- package/lib/components/CreditCardForm/CreditCardFormStep.js +7 -13
- package/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/lib/components/CreditCardForm/PendingStatusContent.js +2 -2
- package/lib/components/CreditCardForm/PendingStatusContent.js.map +1 -1
- package/lib/components/CreditCardForm/ReworkStatusContent.js +2 -2
- package/lib/components/CreditCardForm/ReworkStatusContent.js.map +1 -1
- package/lib/components/CreditCardForm/SuccessStatusContent.js +2 -2
- package/lib/components/CreditCardForm/SuccessStatusContent.js.map +1 -1
- package/lib/components/CreditCardForm/formStateMap.js +1 -4
- package/lib/components/CreditCardForm/formStateMap.js.map +1 -1
- package/lib/components/CreditCardForm/getInitialFormState.d.ts +1 -1
- package/lib/components/CreditCardForm/getInitialFormState.js +8 -11
- package/lib/components/CreditCardForm/getInitialFormState.js.map +1 -1
- package/lib/components/CreditCardForm/useCreditCardFormAPI.d.ts +4 -17
- package/lib/components/CreditCardForm/useCreditCardFormAPI.js +33 -35
- package/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/lib/components/CreditForm/CreditForm.js +3 -2
- package/lib/components/CreditForm/CreditForm.js.map +1 -1
- package/lib/components/CreditForm/CreditFormStatusTracker.js +2 -2
- package/lib/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
- package/lib/components/CreditForm/CreditFormStep.d.ts +3 -3
- package/lib/components/CreditForm/CreditFormStep.js +9 -14
- package/lib/components/CreditForm/CreditFormStep.js.map +1 -1
- package/lib/components/CreditForm/PendingStatusContent.js +2 -2
- package/lib/components/CreditForm/PendingStatusContent.js.map +1 -1
- package/lib/components/CreditForm/ReworkStatusContent.js +2 -2
- package/lib/components/CreditForm/ReworkStatusContent.js.map +1 -1
- package/lib/components/CreditForm/SuccessStatusContent.js +2 -2
- package/lib/components/CreditForm/SuccessStatusContent.js.map +1 -1
- package/lib/components/CreditForm/getInitialFormState.d.ts +1 -1
- package/lib/components/CreditForm/getInitialFormState.js +8 -11
- package/lib/components/CreditForm/getInitialFormState.js.map +1 -1
- package/lib/components/CreditForm/useCreditFormAPI.d.ts +4 -17
- package/lib/components/CreditForm/useCreditFormAPI.js +33 -40
- package/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -1
- package/lib/hooks/useRetailFormStore.d.ts +33 -0
- package/lib/hooks/{useCreditFormStore.js → useRetailFormStore.js} +2 -2
- package/lib/hooks/useRetailFormStore.js.map +1 -0
- package/lib/ui-kit/DraftDialog/DraftDialog.js +7 -9
- package/lib/ui-kit/DraftDialog/DraftDialog.js.map +1 -1
- package/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js +6 -6
- package/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/AmountWorkersField.js +2 -2
- package/lib/ui-kit/FormField/Fields/AmountWorkersField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/EmployerActivitiesField.js +2 -2
- package/lib/ui-kit/FormField/Fields/EmployerActivitiesField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/EmployerOrganizationField.js +2 -2
- package/lib/ui-kit/FormField/Fields/EmployerOrganizationField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/InnField.js +2 -2
- package/lib/ui-kit/FormField/Fields/OrganizationField.js +2 -2
- package/lib/ui-kit/FormField/Fields/OrganizationField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/OrganizationNameField.js +2 -2
- package/lib/ui-kit/FormField/updateOrganizationFields.d.ts +2 -2
- package/lib/ui-kit/FormField/updateOrganizationFields.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +323 -355
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/useSaveUserData.d.ts +1 -1
- package/mobile/bundle/components/CreditCardForm/CreditCardFormStep.d.ts +2 -2
- package/mobile/bundle/components/CreditCardForm/getInitialFormState.d.ts +1 -1
- package/mobile/bundle/components/CreditCardForm/useCreditCardFormAPI.d.ts +4 -17
- package/mobile/bundle/components/CreditForm/CreditFormStep.d.ts +3 -3
- package/mobile/bundle/components/CreditForm/getInitialFormState.d.ts +1 -1
- package/mobile/bundle/components/CreditForm/useCreditFormAPI.d.ts +4 -17
- package/mobile/bundle/hooks/useRetailFormStore.d.ts +33 -0
- package/mobile/bundle/ui-kit/FormField/updateOrganizationFields.d.ts +2 -2
- package/mobile/dist/components/ApplicationLeadForm/useSaveUserData.d.ts +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useSaveUserData.js +2 -4
- package/mobile/dist/components/ApplicationLeadForm/useSaveUserData.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/CreditCardForm.js +3 -2
- package/mobile/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/CreditCardFormStatusTracker.js +2 -2
- package/mobile/dist/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/CreditCardFormStep.d.ts +2 -2
- package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js +7 -13
- package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/PendingStatusContent.js +2 -2
- package/mobile/dist/components/CreditCardForm/PendingStatusContent.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/ReworkStatusContent.js +2 -2
- package/mobile/dist/components/CreditCardForm/ReworkStatusContent.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/SuccessStatusContent.js +2 -2
- package/mobile/dist/components/CreditCardForm/SuccessStatusContent.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/formStateMap.js +1 -4
- package/mobile/dist/components/CreditCardForm/formStateMap.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/getInitialFormState.d.ts +1 -1
- package/mobile/dist/components/CreditCardForm/getInitialFormState.js +8 -11
- package/mobile/dist/components/CreditCardForm/getInitialFormState.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.d.ts +4 -17
- package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js +32 -34
- package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditForm.js +3 -2
- package/mobile/dist/components/CreditForm/CreditForm.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditFormStatusTracker.js +2 -2
- package/mobile/dist/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditFormStep.d.ts +3 -3
- package/mobile/dist/components/CreditForm/CreditFormStep.js +9 -14
- package/mobile/dist/components/CreditForm/CreditFormStep.js.map +1 -1
- package/mobile/dist/components/CreditForm/PendingStatusContent.js +2 -2
- package/mobile/dist/components/CreditForm/PendingStatusContent.js.map +1 -1
- package/mobile/dist/components/CreditForm/ReworkStatusContent.js +2 -2
- package/mobile/dist/components/CreditForm/ReworkStatusContent.js.map +1 -1
- package/mobile/dist/components/CreditForm/SuccessStatusContent.js +2 -2
- package/mobile/dist/components/CreditForm/SuccessStatusContent.js.map +1 -1
- package/mobile/dist/components/CreditForm/getInitialFormState.d.ts +1 -1
- package/mobile/dist/components/CreditForm/getInitialFormState.js +8 -11
- package/mobile/dist/components/CreditForm/getInitialFormState.js.map +1 -1
- package/mobile/dist/components/CreditForm/useCreditFormAPI.d.ts +4 -17
- package/mobile/dist/components/CreditForm/useCreditFormAPI.js +32 -39
- package/mobile/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/mobile/dist/hooks/useRetailFormStore.d.ts +33 -0
- package/{dist/hooks/useCreditFormStore.js → mobile/dist/hooks/useRetailFormStore.js} +4 -4
- package/mobile/dist/hooks/useRetailFormStore.js.map +1 -0
- package/mobile/dist/ui-kit/DraftDialog/DraftDialog.js +7 -9
- package/mobile/dist/ui-kit/DraftDialog/DraftDialog.js.map +1 -1
- package/mobile/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js +6 -6
- package/mobile/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/AmountWorkersField.js +2 -2
- package/mobile/dist/ui-kit/FormField/Fields/AmountWorkersField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/EmployerActivitiesField.js +2 -2
- package/mobile/dist/ui-kit/FormField/Fields/EmployerActivitiesField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/EmployerOrganizationField.js +2 -2
- package/mobile/dist/ui-kit/FormField/Fields/EmployerOrganizationField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/InnField.js +2 -2
- package/mobile/dist/ui-kit/FormField/Fields/OrganizationField.js +2 -2
- package/mobile/dist/ui-kit/FormField/Fields/OrganizationField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/OrganizationNameField.js +2 -2
- package/mobile/dist/ui-kit/FormField/updateOrganizationFields.d.ts +2 -2
- package/mobile/dist/ui-kit/FormField/updateOrganizationFields.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useSaveUserData.d.ts +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useSaveUserData.js +2 -4
- package/mobile/lib/components/ApplicationLeadForm/useSaveUserData.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardForm.js +3 -2
- package/mobile/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardFormStatusTracker.js +2 -2
- package/mobile/lib/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardFormStep.d.ts +2 -2
- package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js +7 -13
- package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/PendingStatusContent.js +2 -2
- package/mobile/lib/components/CreditCardForm/PendingStatusContent.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/ReworkStatusContent.js +2 -2
- package/mobile/lib/components/CreditCardForm/ReworkStatusContent.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/SuccessStatusContent.js +2 -2
- package/mobile/lib/components/CreditCardForm/SuccessStatusContent.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/formStateMap.js +1 -4
- package/mobile/lib/components/CreditCardForm/formStateMap.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/getInitialFormState.d.ts +1 -1
- package/mobile/lib/components/CreditCardForm/getInitialFormState.js +8 -11
- package/mobile/lib/components/CreditCardForm/getInitialFormState.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.d.ts +4 -17
- package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js +33 -35
- package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditForm.js +3 -2
- package/mobile/lib/components/CreditForm/CreditForm.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditFormStatusTracker.js +2 -2
- package/mobile/lib/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditFormStep.d.ts +3 -3
- package/mobile/lib/components/CreditForm/CreditFormStep.js +9 -14
- package/mobile/lib/components/CreditForm/CreditFormStep.js.map +1 -1
- package/mobile/lib/components/CreditForm/PendingStatusContent.js +2 -2
- package/mobile/lib/components/CreditForm/PendingStatusContent.js.map +1 -1
- package/mobile/lib/components/CreditForm/ReworkStatusContent.js +2 -2
- package/mobile/lib/components/CreditForm/ReworkStatusContent.js.map +1 -1
- package/mobile/lib/components/CreditForm/SuccessStatusContent.js +2 -2
- package/mobile/lib/components/CreditForm/SuccessStatusContent.js.map +1 -1
- package/mobile/lib/components/CreditForm/getInitialFormState.d.ts +1 -1
- package/mobile/lib/components/CreditForm/getInitialFormState.js +8 -11
- package/mobile/lib/components/CreditForm/getInitialFormState.js.map +1 -1
- package/mobile/lib/components/CreditForm/useCreditFormAPI.d.ts +4 -17
- package/mobile/lib/components/CreditForm/useCreditFormAPI.js +33 -40
- package/mobile/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/mobile/lib/hooks/useRetailFormStore.d.ts +33 -0
- package/mobile/lib/hooks/{useCreditFormStore.js → useRetailFormStore.js} +2 -2
- package/mobile/lib/hooks/useRetailFormStore.js.map +1 -0
- package/mobile/lib/ui-kit/DraftDialog/DraftDialog.js +7 -9
- package/mobile/lib/ui-kit/DraftDialog/DraftDialog.js.map +1 -1
- package/mobile/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js +6 -6
- package/mobile/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/AmountWorkersField.js +2 -2
- package/mobile/lib/ui-kit/FormField/Fields/AmountWorkersField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/EmployerActivitiesField.js +2 -2
- package/mobile/lib/ui-kit/FormField/Fields/EmployerActivitiesField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/EmployerOrganizationField.js +2 -2
- package/mobile/lib/ui-kit/FormField/Fields/EmployerOrganizationField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/InnField.js +2 -2
- package/mobile/lib/ui-kit/FormField/Fields/OrganizationField.js +2 -2
- package/mobile/lib/ui-kit/FormField/Fields/OrganizationField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/OrganizationNameField.js +2 -2
- package/mobile/lib/ui-kit/FormField/updateOrganizationFields.d.ts +2 -2
- package/mobile/lib/ui-kit/FormField/updateOrganizationFields.js.map +1 -1
- package/mobile/src/components/ApplicationLeadForm/useSaveUserData.ts +2 -4
- package/mobile/src/components/CreditCardForm/CreditCardForm.tsx +4 -3
- package/mobile/src/components/CreditCardForm/CreditCardFormStatusTracker.tsx +2 -2
- package/mobile/src/components/CreditCardForm/CreditCardFormStep.tsx +12 -16
- package/mobile/src/components/CreditCardForm/PendingStatusContent.tsx +2 -3
- package/mobile/src/components/CreditCardForm/ReworkStatusContent.tsx +2 -3
- package/mobile/src/components/CreditCardForm/SuccessStatusContent.tsx +2 -3
- package/mobile/src/components/CreditCardForm/formStateMap.tsx +1 -4
- package/mobile/src/components/CreditCardForm/getInitialFormState.tsx +8 -12
- package/mobile/src/components/CreditCardForm/useCreditCardFormAPI.tsx +65 -84
- package/mobile/src/components/CreditForm/CreditForm.tsx +5 -4
- package/mobile/src/components/CreditForm/CreditFormStatusTracker.tsx +2 -2
- package/mobile/src/components/CreditForm/CreditFormStep.tsx +15 -19
- package/mobile/src/components/CreditForm/PendingStatusContent.tsx +2 -3
- package/mobile/src/components/CreditForm/ReworkStatusContent.tsx +2 -3
- package/mobile/src/components/CreditForm/SuccessStatusContent.tsx +2 -3
- package/mobile/src/components/CreditForm/getInitialFormState.tsx +8 -12
- package/mobile/src/components/CreditForm/useCreditFormAPI.tsx +65 -88
- package/mobile/src/hooks/useRetailFormStore.tsx +29 -0
- package/mobile/src/ui-kit/DraftDialog/DraftDialog.tsx +7 -9
- package/mobile/src/ui-kit/EsiaLoginDialog/EsiaLoginDialog.tsx +7 -7
- package/mobile/src/ui-kit/FormField/Fields/AmountWorkersField.tsx +2 -2
- package/mobile/src/ui-kit/FormField/Fields/EmployerActivitiesField.tsx +2 -2
- package/mobile/src/ui-kit/FormField/Fields/EmployerOrganizationField.tsx +2 -2
- package/mobile/src/ui-kit/FormField/Fields/InnField.tsx +2 -2
- package/mobile/src/ui-kit/FormField/Fields/OrganizationField.tsx +2 -2
- package/mobile/src/ui-kit/FormField/Fields/OrganizationNameField.tsx +2 -2
- package/mobile/src/ui-kit/FormField/updateOrganizationFields.ts +2 -2
- package/package.json +1 -1
- package/src/components/ApplicationLeadForm/useSaveUserData.ts +2 -4
- package/src/components/CreditCardForm/CreditCardForm.tsx +4 -3
- package/src/components/CreditCardForm/CreditCardFormStatusTracker.tsx +2 -2
- package/src/components/CreditCardForm/CreditCardFormStep.tsx +12 -16
- package/src/components/CreditCardForm/PendingStatusContent.tsx +2 -3
- package/src/components/CreditCardForm/ReworkStatusContent.tsx +2 -3
- package/src/components/CreditCardForm/SuccessStatusContent.tsx +2 -3
- package/src/components/CreditCardForm/formStateMap.tsx +1 -4
- package/src/components/CreditCardForm/getInitialFormState.tsx +8 -12
- package/src/components/CreditCardForm/useCreditCardFormAPI.tsx +65 -84
- package/src/components/CreditForm/CreditForm.tsx +5 -4
- package/src/components/CreditForm/CreditFormStatusTracker.tsx +2 -2
- package/src/components/CreditForm/CreditFormStep.tsx +15 -19
- package/src/components/CreditForm/PendingStatusContent.tsx +2 -3
- package/src/components/CreditForm/ReworkStatusContent.tsx +2 -3
- package/src/components/CreditForm/SuccessStatusContent.tsx +2 -3
- package/src/components/CreditForm/getInitialFormState.tsx +8 -12
- package/src/components/CreditForm/useCreditFormAPI.tsx +65 -88
- package/src/hooks/useRetailFormStore.tsx +29 -0
- package/src/icons/IconName.ts +4 -4
- package/src/ui-kit/DraftDialog/DraftDialog.tsx +7 -9
- package/src/ui-kit/EsiaLoginDialog/EsiaLoginDialog.tsx +7 -7
- package/src/ui-kit/FormField/Fields/AmountWorkersField.tsx +2 -2
- package/src/ui-kit/FormField/Fields/EmployerActivitiesField.tsx +2 -2
- package/src/ui-kit/FormField/Fields/EmployerOrganizationField.tsx +2 -2
- package/src/ui-kit/FormField/Fields/InnField.tsx +2 -2
- package/src/ui-kit/FormField/Fields/OrganizationField.tsx +2 -2
- package/src/ui-kit/FormField/Fields/OrganizationNameField.tsx +2 -2
- package/src/ui-kit/FormField/updateOrganizationFields.ts +2 -2
- package/bundle/hooks/useCreditFormStore.d.ts +0 -13
- package/dist/hooks/useCreditFormStore.d.ts +0 -13
- package/dist/hooks/useCreditFormStore.js.map +0 -1
- package/lib/hooks/useCreditFormStore.d.ts +0 -13
- package/lib/hooks/useCreditFormStore.js.map +0 -1
- package/mobile/bundle/hooks/useCreditFormStore.d.ts +0 -13
- package/mobile/dist/hooks/useCreditFormStore.d.ts +0 -13
- package/mobile/dist/hooks/useCreditFormStore.js.map +0 -1
- package/mobile/lib/hooks/useCreditFormStore.d.ts +0 -13
- package/mobile/lib/hooks/useCreditFormStore.js.map +0 -1
- package/mobile/src/hooks/useCreditFormStore.tsx +0 -13
- package/src/hooks/useCreditFormStore.tsx +0 -13
package/bundle/bundle.umd.js
CHANGED
|
@@ -2807,7 +2807,7 @@
|
|
|
2807
2807
|
return useStore(localStore, methods);
|
|
2808
2808
|
}
|
|
2809
2809
|
|
|
2810
|
-
const
|
|
2810
|
+
const useRetailFormStore = () => {
|
|
2811
2811
|
return useLocalStore();
|
|
2812
2812
|
};
|
|
2813
2813
|
|
|
@@ -2823,7 +2823,7 @@
|
|
|
2823
2823
|
|
|
2824
2824
|
const AmountWorkersField = JSX(({ field, input }) => {
|
|
2825
2825
|
const { data } = useLeadFormData('EMPLOYEES_NUMBER');
|
|
2826
|
-
const store =
|
|
2826
|
+
const store = useRetailFormStore();
|
|
2827
2827
|
useEffect(() => {
|
|
2828
2828
|
if (data) {
|
|
2829
2829
|
store.amountWorkers = data;
|
|
@@ -3659,7 +3659,7 @@
|
|
|
3659
3659
|
|
|
3660
3660
|
const EmployerActivitiesField = JSX(({ field, input }) => {
|
|
3661
3661
|
const { data } = useLeadFormData('ORGANIZATION_ACTIVITY_TYPE');
|
|
3662
|
-
const store =
|
|
3662
|
+
const store = useRetailFormStore();
|
|
3663
3663
|
useEffect(() => {
|
|
3664
3664
|
if (data) {
|
|
3665
3665
|
store.employerActivities = data;
|
|
@@ -3670,7 +3670,7 @@
|
|
|
3670
3670
|
|
|
3671
3671
|
const EmployerOrganizationField = JSX(({ field, input }) => {
|
|
3672
3672
|
const { data } = useLeadFormData('ORGANIZATION_KIND');
|
|
3673
|
-
const store =
|
|
3673
|
+
const store = useRetailFormStore();
|
|
3674
3674
|
useEffect(() => {
|
|
3675
3675
|
if (data) {
|
|
3676
3676
|
store.employerOrganization = data;
|
|
@@ -3851,7 +3851,7 @@
|
|
|
3851
3851
|
});
|
|
3852
3852
|
|
|
3853
3853
|
const InnField = JSX(({ field, input }) => {
|
|
3854
|
-
const store =
|
|
3854
|
+
const store = useRetailFormStore();
|
|
3855
3855
|
const onDaDataChange = useCallback((item) => {
|
|
3856
3856
|
field?.('organizationName')?.onChange?.(item.data?.name?.short_with_opf);
|
|
3857
3857
|
updateOrganizationFields(store, field, item);
|
|
@@ -3915,7 +3915,7 @@
|
|
|
3915
3915
|
|
|
3916
3916
|
const OrganizationField = JSX(({ field, input }) => {
|
|
3917
3917
|
const { data } = useLeadFormData('ORGANIZATION_TYPE');
|
|
3918
|
-
const store =
|
|
3918
|
+
const store = useRetailFormStore();
|
|
3919
3919
|
useEffect(() => {
|
|
3920
3920
|
if (data) {
|
|
3921
3921
|
store.organization = data;
|
|
@@ -3925,7 +3925,7 @@
|
|
|
3925
3925
|
});
|
|
3926
3926
|
|
|
3927
3927
|
const OrganizationNameField = JSX(({ field, input }) => {
|
|
3928
|
-
const store =
|
|
3928
|
+
const store = useRetailFormStore();
|
|
3929
3929
|
const onDaDataChange = useCallback((item) => {
|
|
3930
3930
|
field?.('inn')?.onChange?.(item.data?.inn);
|
|
3931
3931
|
updateOrganizationFields(store, field, item);
|
|
@@ -4785,18 +4785,6 @@
|
|
|
4785
4785
|
};
|
|
4786
4786
|
};
|
|
4787
4787
|
|
|
4788
|
-
const useLeadFormStore = () => useLocalStore();
|
|
4789
|
-
|
|
4790
|
-
const useSetter = (target, key) => useCallback((value) => {
|
|
4791
|
-
const newValue = value instanceof Function ? value(target[key]) : value;
|
|
4792
|
-
if (newValue !== null && newValue !== undefined) {
|
|
4793
|
-
target[key] = newValue;
|
|
4794
|
-
}
|
|
4795
|
-
else {
|
|
4796
|
-
delete target[key];
|
|
4797
|
-
}
|
|
4798
|
-
}, [target, key]);
|
|
4799
|
-
|
|
4800
4788
|
const DraftActionButton = JSX(({ title, icon, description, onClick = noop }) => (jsxs("button", { className: "flex gap-lg items-center border border-gray rounded-md cursor-pointer p-4 hover:border-green", type: "button", onClick: onClick, children: [jsx(Img, { image: { icon: icon, iconVersion: 'black' }, width: "78", height: "78" }), jsxs("div", { children: [jsx(Heading, { className: "text-left", title: title, headingType: "h5" }), description ? (jsx(Paragraph, { color: "text-secondary-text", size: "text-m", children: description })) : null] })] })));
|
|
4801
4789
|
|
|
4802
4790
|
const creditCodesToProgrammIdMap = {
|
|
@@ -4939,8 +4927,7 @@
|
|
|
4939
4927
|
};
|
|
4940
4928
|
|
|
4941
4929
|
const DraftDialog = JSX(function ({ task, isFromLead = false, onClose = noop, }) {
|
|
4942
|
-
const
|
|
4943
|
-
const saveForm = useSetter(leadFormStore, 'leadForm');
|
|
4930
|
+
const retailFormStore = useRetailFormStore();
|
|
4944
4931
|
const navigator = locationNavigator();
|
|
4945
4932
|
const { participants, creditProgram, id: taskId } = task;
|
|
4946
4933
|
const programmId = creditProgramCodeToProductIdMap[creditProgram.code];
|
|
@@ -4949,11 +4936,11 @@
|
|
|
4949
4936
|
const { name, midname, id: participantId, profile } = participants[0];
|
|
4950
4937
|
const handleGoToDraft = useCallback(() => {
|
|
4951
4938
|
const taskFromDraft = parseDraftTask(task);
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4939
|
+
retailFormStore.participantId = participantId;
|
|
4940
|
+
retailFormStore.taskId = taskId;
|
|
4941
|
+
retailFormStore.profileId = profile?.id;
|
|
4942
|
+
retailFormStore.programId = programmId;
|
|
4943
|
+
retailFormStore.leadForm = taskFromDraft;
|
|
4957
4944
|
navigator.assign(nextStepLink);
|
|
4958
4945
|
}, []);
|
|
4959
4946
|
const handleGoToNewTask = useCallback(() => {
|
|
@@ -4991,7 +4978,7 @@
|
|
|
4991
4978
|
|
|
4992
4979
|
const EsiaLoginDialog = JSX(({ onClose }) => {
|
|
4993
4980
|
const navigator = locationNavigator();
|
|
4994
|
-
const
|
|
4981
|
+
const retailFormStore = useRetailFormStore();
|
|
4995
4982
|
const handleAuth = useCallback(async () => {
|
|
4996
4983
|
const resp = await getLink({
|
|
4997
4984
|
redirectUri: navigator.href,
|
|
@@ -5001,10 +4988,10 @@
|
|
|
5001
4988
|
}
|
|
5002
4989
|
}, []);
|
|
5003
4990
|
const handleClose = useCallback(() => {
|
|
5004
|
-
if (leadForm
|
|
5005
|
-
const
|
|
5006
|
-
|
|
5007
|
-
|
|
4991
|
+
if (retailFormStore.leadForm) {
|
|
4992
|
+
const leadForm = { ...retailFormStore.leadForm };
|
|
4993
|
+
delete leadForm.esiaAccountTypeCd;
|
|
4994
|
+
retailFormStore.leadForm = leadForm;
|
|
5008
4995
|
}
|
|
5009
4996
|
onClose?.();
|
|
5010
4997
|
}, []);
|
|
@@ -5118,15 +5105,16 @@
|
|
|
5118
5105
|
};
|
|
5119
5106
|
};
|
|
5120
5107
|
|
|
5108
|
+
const useLeadFormStore = () => useLocalStore();
|
|
5109
|
+
|
|
5121
5110
|
const useSaveUserData = () => {
|
|
5122
5111
|
const leadFormStore = useLeadFormStore();
|
|
5123
|
-
const
|
|
5124
|
-
const saveUserData = useCallback(({ participantId, taskId, profileId, formData, programId: programNumber }) => {
|
|
5112
|
+
const saveUserData = useCallback(({ participantId, taskId, profileId, programId: programNumber, formData }) => {
|
|
5125
5113
|
leadFormStore.participantId = participantId;
|
|
5126
5114
|
leadFormStore.taskId = taskId;
|
|
5127
5115
|
leadFormStore.profileId = profileId;
|
|
5128
5116
|
leadFormStore.programId = programNumber;
|
|
5129
|
-
|
|
5117
|
+
leadFormStore.leadForm = formData;
|
|
5130
5118
|
}, []);
|
|
5131
5119
|
return saveUserData;
|
|
5132
5120
|
};
|
|
@@ -5232,6 +5220,16 @@
|
|
|
5232
5220
|
|
|
5233
5221
|
const updateProfileEsia = (body) => fetchRetailJSON('/esia/updateProfileEsia', 'POST', body);
|
|
5234
5222
|
|
|
5223
|
+
const useSetter = (target, key) => useCallback((value) => {
|
|
5224
|
+
const newValue = value instanceof Function ? value(target[key]) : value;
|
|
5225
|
+
if (newValue !== null && newValue !== undefined) {
|
|
5226
|
+
target[key] = newValue;
|
|
5227
|
+
}
|
|
5228
|
+
else {
|
|
5229
|
+
delete target[key];
|
|
5230
|
+
}
|
|
5231
|
+
}, [target, key]);
|
|
5232
|
+
|
|
5235
5233
|
const initialFormState = {
|
|
5236
5234
|
typeForm: '',
|
|
5237
5235
|
region: { key: '', text: '' },
|
|
@@ -6831,7 +6829,7 @@
|
|
|
6831
6829
|
const FailedStatusContent$1 = JSX(() => (jsx(CreditCardFormStatus, { title: "\u0411\u043B\u0430\u0433\u043E\u0434\u0430\u0440\u0438\u043C \u0412\u0430\u0441 \u0437\u0430 \u043E\u0436\u0438\u0434\u0430\u043D\u0438\u0435", description: "\u0412 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0438\u0439 \u043C\u043E\u043C\u0435\u043D\u0442 \u0411\u0430\u043D\u043A \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u043E\u0434\u043E\u0431\u0440\u0438\u0442\u044C \u0412\u0430\u0448\u0443 \u0437\u0430\u044F\u0432\u043A\u0443 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442. \u041F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u043F\u043E\u0434\u0430\u0442\u044C \u0437\u0430\u044F\u0432\u043A\u0443 \u043F\u043E\u0437\u0436\u0435. \u0421\u043F\u0430\u0441\u0438\u0431\u043E \u0437\u0430 \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0435 \u0432 \u0410\u041E \u00AB\u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u00BB.", buttonText: "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E" })));
|
|
6832
6830
|
|
|
6833
6831
|
const PendingStatusContent$1 = JSX(({ handleExpireTimer }) => {
|
|
6834
|
-
const
|
|
6832
|
+
const { statusInfo } = useRetailFormStore();
|
|
6835
6833
|
return (jsx(CreditCardFormStatus, { interval: 300, intervalExpireAction: handleExpireTimer, title: "\u0417\u0430\u044F\u0432\u043A\u0430 \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0430", description: "\u041D\u0435 \u0437\u0430\u043A\u0440\u044B\u0432\u0430\u0439\u0442\u0435 \u043E\u043A\u043D\u043E, \u0441\u043A\u043E\u0440\u043E \u0441\u043E\u043E\u0431\u0449\u0438\u043C \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442", sectionInfoTitle: "\u0417\u0430\u044F\u0432\u043B\u0435\u043D\u043D\u044B\u0435 \u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u043E \u043A\u0440\u0435\u0434\u0438\u0442\u0443", sectionInfo: [
|
|
6836
6834
|
{
|
|
6837
6835
|
label: 'Название продукта',
|
|
@@ -6845,7 +6843,7 @@
|
|
|
6845
6843
|
});
|
|
6846
6844
|
|
|
6847
6845
|
const ReworkStatusContent$1 = JSX(() => {
|
|
6848
|
-
const
|
|
6846
|
+
const { statusInfo } = useRetailFormStore();
|
|
6849
6847
|
return (jsx(CreditCardFormStatus, { title: "\u0411\u043B\u0430\u0433\u043E\u0434\u0430\u0440\u0438\u043C \u0432\u0430\u0441 \u0437\u0430 \u043E\u0436\u0438\u0434\u0430\u043D\u0438\u0435, \u043D\u043E \u043D\u0430\u043C \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044F \u0431\u043E\u043B\u044C\u0448\u0435 \u0432\u0440\u0435\u043C\u0435\u043D\u0438 \u0434\u043B\u044F \u043F\u0440\u0438\u043D\u044F\u0442\u0438\u044F \u0440\u0435\u0448\u0435\u043D\u0438\u044F", description: "\u041F\u043E\u0441\u0435\u0442\u0438\u0442\u0435 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u0435 \u043E\u0442\u0434\u0435\u043B\u0435\u043D\u0438\u0435 \u0431\u0430\u043D\u043A\u0430 \u0441 \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u044B\u043C\u0438 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u043C\u0438 \u0438 \u0442\u0430\u043A \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0435 \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u0435 \u043A\u0440\u0435\u0434\u0438\u0442\u0430.", sectionAdditionalTitle: "\u0412 \u043E\u0442\u0434\u0435\u043B\u0435\u043D\u0438\u0438 \u0411\u0430\u043D\u043A\u0430", sectionInfoAdditional: [
|
|
6850
6848
|
{
|
|
6851
6849
|
label: 'Регион',
|
|
@@ -6864,7 +6862,7 @@
|
|
|
6864
6862
|
});
|
|
6865
6863
|
|
|
6866
6864
|
const SuccessStatusContent$1 = JSX(() => {
|
|
6867
|
-
const
|
|
6865
|
+
const { statusInfo } = useRetailFormStore();
|
|
6868
6866
|
return (jsx(CreditCardFormStatus, { title: "\u0411\u0430\u043D\u043A \u043E\u0434\u043E\u0431\u0440\u0438\u043B \u0432\u0430\u043C \u043A\u0440\u0435\u0434\u0438\u0442", description: "\u041E\u0431\u0440\u0430\u0442\u0438\u0442\u0435\u0441\u044C \u0432 \u043E\u0442\u0434\u0435\u043B\u0435\u043D\u0438\u0435 \u0431\u0430\u043D\u043A\u0430, \u0447\u0442\u043E\u0431\u044B \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044C \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u0435 \u0438 \u043F\u043E\u043B\u0443\u0447\u0438\u0442 \u0432\u0430\u0448 \u043A\u0440\u0435\u0434\u0438\u0442", sectionInfo: [
|
|
6869
6867
|
{
|
|
6870
6868
|
label: 'Название продукта',
|
|
@@ -6895,7 +6893,7 @@
|
|
|
6895
6893
|
];
|
|
6896
6894
|
const CreditCardFormStatusTracker = JSX(() => {
|
|
6897
6895
|
const [status, setStatus] = useState(STATUS_TYPE.process);
|
|
6898
|
-
const
|
|
6896
|
+
const { taskId } = useRetailFormStore();
|
|
6899
6897
|
useEffect(() => {
|
|
6900
6898
|
(async () => {
|
|
6901
6899
|
for (const signalType of SIGNAL_TYPES$1) {
|
|
@@ -6924,117 +6922,6 @@
|
|
|
6924
6922
|
return statusesMap[status] || jsx(ReworkStatusContent$1, {});
|
|
6925
6923
|
};
|
|
6926
6924
|
|
|
6927
|
-
const formStateMap$1 = [
|
|
6928
|
-
{
|
|
6929
|
-
paymentSystem: { name: '', type: '' },
|
|
6930
|
-
currency: '810',
|
|
6931
|
-
codeWord: '',
|
|
6932
|
-
},
|
|
6933
|
-
{
|
|
6934
|
-
surname: '',
|
|
6935
|
-
name: '',
|
|
6936
|
-
middleName: '',
|
|
6937
|
-
sex: '',
|
|
6938
|
-
limitedBirthday: undefined,
|
|
6939
|
-
birthPlace: '',
|
|
6940
|
-
phone: '',
|
|
6941
|
-
email: '',
|
|
6942
|
-
dulSerie: undefined,
|
|
6943
|
-
dulNumber: undefined,
|
|
6944
|
-
dulIssueDateField: undefined,
|
|
6945
|
-
dulSubdivisionCode: '',
|
|
6946
|
-
dulIssuedBy: '',
|
|
6947
|
-
addressRegistration: {
|
|
6948
|
-
fullAddress: '',
|
|
6949
|
-
fiasCode: '',
|
|
6950
|
-
},
|
|
6951
|
-
participantDateRegistration: undefined,
|
|
6952
|
-
addressFact: {
|
|
6953
|
-
fullAddress: '',
|
|
6954
|
-
fiasCode: '',
|
|
6955
|
-
},
|
|
6956
|
-
housing: undefined,
|
|
6957
|
-
methodObtain: 'office',
|
|
6958
|
-
addressCourier: {
|
|
6959
|
-
fullAddress: '',
|
|
6960
|
-
fiasCode: '',
|
|
6961
|
-
},
|
|
6962
|
-
},
|
|
6963
|
-
{
|
|
6964
|
-
amountWorkers: { key: '', text: '' },
|
|
6965
|
-
beginDate: undefined,
|
|
6966
|
-
employerActivities: { key: '', text: '' },
|
|
6967
|
-
employerOrganization: { key: '', text: '' },
|
|
6968
|
-
employment: { key: '', text: '' },
|
|
6969
|
-
experience5Years: undefined,
|
|
6970
|
-
inn: undefined,
|
|
6971
|
-
jobsNumber: undefined,
|
|
6972
|
-
lastJobExperience: undefined,
|
|
6973
|
-
legalForm: '',
|
|
6974
|
-
organization: { key: '', text: '' },
|
|
6975
|
-
organizationAddress: {
|
|
6976
|
-
fullAddress: '',
|
|
6977
|
-
fiasCode: '',
|
|
6978
|
-
},
|
|
6979
|
-
organizationName: '',
|
|
6980
|
-
organizationPhone: '',
|
|
6981
|
-
partInBusiness: undefined,
|
|
6982
|
-
positionOrganization: { key: '', text: '' },
|
|
6983
|
-
},
|
|
6984
|
-
{
|
|
6985
|
-
familyStatus: { key: '', text: '' },
|
|
6986
|
-
dependents: undefined,
|
|
6987
|
-
familyMembers: undefined,
|
|
6988
|
-
confirmationIncome: { key: '', text: '' },
|
|
6989
|
-
wages: undefined,
|
|
6990
|
-
mandatoryPayments: undefined,
|
|
6991
|
-
snils: '',
|
|
6992
|
-
armyIdFlg: false,
|
|
6993
|
-
},
|
|
6994
|
-
{
|
|
6995
|
-
disablePeopleFlg: false,
|
|
6996
|
-
bankruptcyFlg: false,
|
|
6997
|
-
shareholderFlg: false,
|
|
6998
|
-
legalEntityName: '',
|
|
6999
|
-
creditInRshbCd: undefined,
|
|
7000
|
-
},
|
|
7001
|
-
{
|
|
7002
|
-
regionRetail: { key: '', text: '' },
|
|
7003
|
-
addressRetail: {
|
|
7004
|
-
key: '',
|
|
7005
|
-
text: '',
|
|
7006
|
-
},
|
|
7007
|
-
bankEmployeeCode: undefined,
|
|
7008
|
-
addressCourier: {
|
|
7009
|
-
fullAddress: '',
|
|
7010
|
-
fiasCode: '',
|
|
7011
|
-
},
|
|
7012
|
-
methodObtain: 'office',
|
|
7013
|
-
deliveryDate: undefined,
|
|
7014
|
-
},
|
|
7015
|
-
];
|
|
7016
|
-
|
|
7017
|
-
const getInitialFormState$1 = (step, localStorageData) => ({
|
|
7018
|
-
...formStateMap$1[step],
|
|
7019
|
-
...localStorageData,
|
|
7020
|
-
limitedBirthday: transformStringToData$1(localStorageData?.limitedBirthday),
|
|
7021
|
-
dulIssueDateField: transformStringToData$1(localStorageData?.dulIssueDateField),
|
|
7022
|
-
participantDateRegistration: transformStringToData$1(localStorageData?.participantDateRegistration),
|
|
7023
|
-
beginDate: transformStringToData$1(localStorageData?.beginDate),
|
|
7024
|
-
deliveryDate: transformStringToData$1(localStorageData?.deliveryDate),
|
|
7025
|
-
});
|
|
7026
|
-
const transformStringToData$1 = (text) => {
|
|
7027
|
-
if (!text) {
|
|
7028
|
-
return undefined;
|
|
7029
|
-
}
|
|
7030
|
-
try {
|
|
7031
|
-
return new Date(text);
|
|
7032
|
-
}
|
|
7033
|
-
catch (_) {
|
|
7034
|
-
return undefined;
|
|
7035
|
-
}
|
|
7036
|
-
};
|
|
7037
|
-
|
|
7038
6925
|
const calculateInputs$1 = (getValue) => (inputs, step) => inputs
|
|
7039
6926
|
.filter((_) => _)
|
|
7040
6927
|
.map((_) => {
|
|
@@ -7265,20 +7152,139 @@
|
|
|
7265
7152
|
}
|
|
7266
7153
|
};
|
|
7267
7154
|
|
|
7268
|
-
const
|
|
7155
|
+
const formStateMap$1 = [
|
|
7156
|
+
{
|
|
7157
|
+
paymentSystem: { name: '', type: '' },
|
|
7158
|
+
currency: '810',
|
|
7159
|
+
codeWord: '',
|
|
7160
|
+
},
|
|
7161
|
+
{
|
|
7162
|
+
surname: '',
|
|
7163
|
+
name: '',
|
|
7164
|
+
middleName: '',
|
|
7165
|
+
sex: '',
|
|
7166
|
+
limitedBirthday: undefined,
|
|
7167
|
+
birthPlace: '',
|
|
7168
|
+
phone: '',
|
|
7169
|
+
email: '',
|
|
7170
|
+
dulSerie: undefined,
|
|
7171
|
+
dulNumber: undefined,
|
|
7172
|
+
dulIssueDateField: undefined,
|
|
7173
|
+
dulSubdivisionCode: '',
|
|
7174
|
+
dulIssuedBy: '',
|
|
7175
|
+
addressRegistration: {
|
|
7176
|
+
fullAddress: '',
|
|
7177
|
+
fiasCode: '',
|
|
7178
|
+
},
|
|
7179
|
+
participantDateRegistration: undefined,
|
|
7180
|
+
addressFact: {
|
|
7181
|
+
fullAddress: '',
|
|
7182
|
+
fiasCode: '',
|
|
7183
|
+
},
|
|
7184
|
+
housing: undefined,
|
|
7185
|
+
methodObtain: 'office',
|
|
7186
|
+
addressCourier: {
|
|
7187
|
+
fullAddress: '',
|
|
7188
|
+
fiasCode: '',
|
|
7189
|
+
},
|
|
7190
|
+
},
|
|
7191
|
+
{
|
|
7192
|
+
amountWorkers: { key: '', text: '' },
|
|
7193
|
+
beginDate: undefined,
|
|
7194
|
+
employerActivities: { key: '', text: '' },
|
|
7195
|
+
employerOrganization: { key: '', text: '' },
|
|
7196
|
+
employment: { key: '', text: '' },
|
|
7197
|
+
experience5Years: undefined,
|
|
7198
|
+
inn: undefined,
|
|
7199
|
+
jobsNumber: undefined,
|
|
7200
|
+
lastJobExperience: undefined,
|
|
7201
|
+
legalForm: '',
|
|
7202
|
+
organization: { key: '', text: '' },
|
|
7203
|
+
organizationAddress: {
|
|
7204
|
+
fullAddress: '',
|
|
7205
|
+
fiasCode: '',
|
|
7206
|
+
},
|
|
7207
|
+
organizationName: '',
|
|
7208
|
+
organizationPhone: '',
|
|
7209
|
+
partInBusiness: undefined,
|
|
7210
|
+
positionOrganization: { key: '', text: '' },
|
|
7211
|
+
},
|
|
7212
|
+
{
|
|
7213
|
+
familyStatus: { key: '', text: '' },
|
|
7214
|
+
dependents: undefined,
|
|
7215
|
+
familyMembers: undefined,
|
|
7216
|
+
confirmationIncome: { key: '', text: '' },
|
|
7217
|
+
wages: undefined,
|
|
7218
|
+
mandatoryPayments: undefined,
|
|
7219
|
+
snils: '',
|
|
7220
|
+
armyIdFlg: false,
|
|
7221
|
+
},
|
|
7222
|
+
{
|
|
7223
|
+
disablePeopleFlg: false,
|
|
7224
|
+
bankruptcyFlg: false,
|
|
7225
|
+
shareholderFlg: false,
|
|
7226
|
+
legalEntityName: '',
|
|
7227
|
+
creditInRshbCd: undefined,
|
|
7228
|
+
},
|
|
7229
|
+
{
|
|
7230
|
+
regionRetail: { key: '', text: '' },
|
|
7231
|
+
addressRetail: { key: '', text: '' },
|
|
7232
|
+
bankEmployeeCode: undefined,
|
|
7233
|
+
addressCourier: {
|
|
7234
|
+
fullAddress: '',
|
|
7235
|
+
fiasCode: '',
|
|
7236
|
+
},
|
|
7237
|
+
methodObtain: 'office',
|
|
7238
|
+
deliveryDate: undefined,
|
|
7239
|
+
},
|
|
7240
|
+
];
|
|
7241
|
+
|
|
7242
|
+
const getInitialFormState$1 = (step, formState) => ({
|
|
7243
|
+
...formStateMap$1[step],
|
|
7244
|
+
...formState,
|
|
7245
|
+
limitedBirthday: transformStringToData$1(formState?.limitedBirthday),
|
|
7246
|
+
dulIssueDateField: transformStringToData$1(formState?.dulIssueDateField),
|
|
7247
|
+
participantDateRegistration: transformStringToData$1(formState?.participantDateRegistration),
|
|
7248
|
+
beginDate: transformStringToData$1(formState?.beginDate),
|
|
7249
|
+
deliveryDate: transformStringToData$1(formState?.deliveryDate),
|
|
7250
|
+
});
|
|
7251
|
+
const transformStringToData$1 = (text) => {
|
|
7252
|
+
try {
|
|
7253
|
+
return text ? new Date(text) : undefined;
|
|
7254
|
+
}
|
|
7255
|
+
catch (_) {
|
|
7256
|
+
return undefined;
|
|
7257
|
+
}
|
|
7258
|
+
};
|
|
7259
|
+
|
|
7260
|
+
const useCreditCardFormAPI = ({ step, inputs, onNextStep, onFinish, }) => {
|
|
7269
7261
|
const isFinalStep = step === 5;
|
|
7270
|
-
const
|
|
7271
|
-
const
|
|
7272
|
-
const
|
|
7273
|
-
|
|
7274
|
-
|
|
7262
|
+
const retailFormStore = useRetailFormStore();
|
|
7263
|
+
const initialState = useMemo(() => getInitialFormState$1(step, retailFormStore.leadForm), [step, retailFormStore.leadForm]);
|
|
7264
|
+
const resetForm = useCallback((response) => {
|
|
7265
|
+
const { leadForm } = retailFormStore;
|
|
7266
|
+
if (isFinalStep && response.ok && leadForm) {
|
|
7267
|
+
retailFormStore.statusInfo = {
|
|
7268
|
+
regionRetail: leadForm?.regionRetail?.text,
|
|
7269
|
+
addressRetail: leadForm?.addressRetail?.text,
|
|
7270
|
+
cardCategory: leadForm?.cardCategory?.text,
|
|
7271
|
+
calculator: {
|
|
7272
|
+
monthsValue: leadForm?.calculator?.monthsValue,
|
|
7273
|
+
moneyValue: leadForm?.calculator?.moneyValue,
|
|
7274
|
+
isAnnuity: leadForm?.calculator?.isAnnuity,
|
|
7275
|
+
},
|
|
7276
|
+
};
|
|
7277
|
+
retailFormStore.leadForm = initialState;
|
|
7278
|
+
}
|
|
7279
|
+
}, [isFinalStep, initialState]);
|
|
7275
7280
|
const handleSubmit = useCallback(async (formData) => {
|
|
7276
7281
|
const feedbackValidator = objectValidator(getObjectValidator(calculateInputs$1(getValue$2(formData))(inputs, step)));
|
|
7277
7282
|
if (!isValidationSuccess(feedbackValidator(formData))) {
|
|
7278
|
-
return
|
|
7283
|
+
return;
|
|
7279
7284
|
}
|
|
7280
|
-
|
|
7285
|
+
retailFormStore.leadForm = formData;
|
|
7281
7286
|
try {
|
|
7287
|
+
const { taskId, profileId, participantId } = retailFormStore;
|
|
7282
7288
|
if (taskId && profileId && participantId) {
|
|
7283
7289
|
const response = await updateUserTask(getCreditCardFormTaskData({
|
|
7284
7290
|
participantId,
|
|
@@ -7287,53 +7293,31 @@
|
|
|
7287
7293
|
step,
|
|
7288
7294
|
formData: formData,
|
|
7289
7295
|
}));
|
|
7290
|
-
resetForm
|
|
7296
|
+
resetForm(response);
|
|
7297
|
+
}
|
|
7298
|
+
onNextStep();
|
|
7299
|
+
if (isFinalStep) {
|
|
7300
|
+
onFinish?.();
|
|
7291
7301
|
}
|
|
7292
7302
|
}
|
|
7293
7303
|
catch (ex) {
|
|
7294
|
-
|
|
7295
|
-
}
|
|
7296
|
-
onNextStep();
|
|
7297
|
-
if (isFinalStep) {
|
|
7298
|
-
finishForm?.(true);
|
|
7304
|
+
// Do nothing
|
|
7299
7305
|
}
|
|
7300
|
-
|
|
7301
|
-
|
|
7302
|
-
return {
|
|
7303
|
-
handleSubmit,
|
|
7304
|
-
};
|
|
7305
|
-
};
|
|
7306
|
-
const resetForm$1 = ({ isFinalStep, response, leadForm, setStatusInfo, }) => {
|
|
7307
|
-
if (isFinalStep && response.ok && leadForm) {
|
|
7308
|
-
const regionRetail = leadForm?.regionRetail?.text;
|
|
7309
|
-
const addressRetail = leadForm?.addressRetail?.text;
|
|
7310
|
-
const cardCategory = leadForm?.cardCategory?.text;
|
|
7311
|
-
const calculator = {
|
|
7312
|
-
monthsValue: leadForm?.calculator?.monthsValue,
|
|
7313
|
-
moneyValue: leadForm?.calculator?.moneyValue,
|
|
7314
|
-
isAnnuity: leadForm?.calculator?.isAnnuity,
|
|
7315
|
-
};
|
|
7316
|
-
setStatusInfo({ regionRetail, addressRetail, cardCategory, calculator });
|
|
7317
|
-
globalThis.localStorage.removeItem('leadForm');
|
|
7318
|
-
}
|
|
7306
|
+
}, [isFinalStep, resetForm]);
|
|
7307
|
+
return [initialState, handleSubmit];
|
|
7319
7308
|
};
|
|
7320
7309
|
const getValue$2 = (formData) => (name) => formData[name];
|
|
7321
7310
|
|
|
7322
|
-
const CreditCardFormStep = JSX(({ step, sections, onPrevStep, onNextStep,
|
|
7323
|
-
const
|
|
7324
|
-
const initialState =
|
|
7325
|
-
const inputs = (sections?.flatMap((_) => _?.inputs) || []);
|
|
7326
|
-
const { handleSubmit } = useCreditCardFormAPI({
|
|
7311
|
+
const CreditCardFormStep = JSX(({ step, sections, isFormFinished, onPrevStep, onNextStep, onFinish }) => {
|
|
7312
|
+
const inputs = useMemo(() => (sections?.flatMap((_) => _?.inputs) || []), [sections]);
|
|
7313
|
+
const [initialState, onSubmit] = useCreditCardFormAPI({
|
|
7327
7314
|
step,
|
|
7328
7315
|
inputs,
|
|
7329
7316
|
onNextStep,
|
|
7330
|
-
|
|
7331
|
-
finishForm,
|
|
7332
|
-
});
|
|
7333
|
-
const [, { field, onSubmit }] = useForm(initialState, {
|
|
7334
|
-
onSubmit: handleSubmit,
|
|
7317
|
+
onFinish,
|
|
7335
7318
|
});
|
|
7336
|
-
|
|
7319
|
+
const [, { field, onSubmit: handleSubmit }] = useForm(initialState, { onSubmit });
|
|
7320
|
+
return isFormFinished ? (jsx(CreditCardFormStatusTracker, {})) : (jsxs("form", { onSubmit: handleSubmit, className: "space-y-m", children: [renderStep$2({ sections, field, step }), jsx(StepsNavigationButtons$1, { step: step, onPrevStep: onPrevStep })] }));
|
|
7337
7321
|
});
|
|
7338
7322
|
|
|
7339
7323
|
/* eslint-disable max-lines */
|
|
@@ -7709,8 +7693,8 @@
|
|
|
7709
7693
|
scrollToTop();
|
|
7710
7694
|
}, []);
|
|
7711
7695
|
const sections = useMemo(() => stepsSectionsMap$1[step], [step]);
|
|
7712
|
-
const [isFormFinished,
|
|
7713
|
-
return (jsx(BlockWrapper, { className: className, ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isFormFinished ? null : (jsx(CreditCardFormProgress, { stepsTitles: TITLES, step: step, totalSteps: STEPS$1 })), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: jsx(CreditCardFormStep, { step: step, sections: sections, onNextStep: handleNextStep, onPrevStep: handlePrevStep,
|
|
7696
|
+
const [isFormFinished, { setTrue: handleFinish }] = useBool(false);
|
|
7697
|
+
return (jsx(BlockWrapper, { className: className, ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isFormFinished ? null : (jsx(CreditCardFormProgress, { stepsTitles: TITLES, step: step, totalSteps: STEPS$1 })), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: jsx(CreditCardFormStep, { step: step, sections: sections, isFormFinished: isFormFinished, onNextStep: handleNextStep, onPrevStep: handlePrevStep, onFinish: handleFinish }, String(step)) })] }) }));
|
|
7714
7698
|
});
|
|
7715
7699
|
|
|
7716
7700
|
const CreditFormProgress = JSX(({ step = 1, totalSteps = 5, stepsTitles = [] }) => {
|
|
@@ -7737,7 +7721,7 @@
|
|
|
7737
7721
|
const FailedStatusContent = JSX(() => (jsx(CreditFormStatus, { title: "\u0411\u043B\u0430\u0433\u043E\u0434\u0430\u0440\u0438\u043C \u0412\u0430\u0441 \u0437\u0430 \u043E\u0436\u0438\u0434\u0430\u043D\u0438\u0435", description: "\u0412 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0438\u0439 \u043C\u043E\u043C\u0435\u043D\u0442 \u0411\u0430\u043D\u043A \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u043E\u0434\u043E\u0431\u0440\u0438\u0442\u044C \u0412\u0430\u0448\u0443 \u0437\u0430\u044F\u0432\u043A\u0443 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442. \u041F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u043F\u043E\u0434\u0430\u0442\u044C \u0437\u0430\u044F\u0432\u043A\u0443 \u043F\u043E\u0437\u0436\u0435. \u0421\u043F\u0430\u0441\u0438\u0431\u043E \u0437\u0430 \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0435 \u0432 \u0410\u041E \u00AB\u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u00BB.", buttonText: "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E" })));
|
|
7738
7722
|
|
|
7739
7723
|
const PendingStatusContent = JSX(({ handleExpireTimer }) => {
|
|
7740
|
-
const
|
|
7724
|
+
const { statusInfo } = useRetailFormStore();
|
|
7741
7725
|
return (jsx(CreditFormStatus, { interval: 300, intervalExpireAction: handleExpireTimer, title: "\u0417\u0430\u044F\u0432\u043A\u0430 \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0430", description: "\u041D\u0435 \u0437\u0430\u043A\u0440\u044B\u0432\u0430\u0439\u0442\u0435 \u043E\u043A\u043D\u043E, \u0441\u043A\u043E\u0440\u043E \u0441\u043E\u043E\u0431\u0449\u0438\u043C \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442", sectionInfoTitle: "\u0417\u0430\u044F\u0432\u043B\u0435\u043D\u043D\u044B\u0435 \u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u043E \u043A\u0440\u0435\u0434\u0438\u0442\u0443", sectionInfo: [
|
|
7742
7726
|
{
|
|
7743
7727
|
label: 'Название продукта',
|
|
@@ -7763,7 +7747,7 @@
|
|
|
7763
7747
|
});
|
|
7764
7748
|
|
|
7765
7749
|
const ReworkStatusContent = JSX(() => {
|
|
7766
|
-
const
|
|
7750
|
+
const { statusInfo } = useRetailFormStore();
|
|
7767
7751
|
return (jsx(CreditFormStatus, { title: "\u0411\u043B\u0430\u0433\u043E\u0434\u0430\u0440\u0438\u043C \u0432\u0430\u0441 \u0437\u0430 \u043E\u0436\u0438\u0434\u0430\u043D\u0438\u0435, \u043D\u043E \u043D\u0430\u043C \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044F \u0431\u043E\u043B\u044C\u0448\u0435 \u0432\u0440\u0435\u043C\u0435\u043D\u0438 \u0434\u043B\u044F \u043F\u0440\u0438\u043D\u044F\u0442\u0438\u044F \u0440\u0435\u0448\u0435\u043D\u0438\u044F", description: "\u041F\u043E\u0441\u0435\u0442\u0438\u0442\u0435 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u043E\u0435 \u043E\u0442\u0434\u0435\u043B\u0435\u043D\u0438\u0435 \u0431\u0430\u043D\u043A\u0430 \u0441 \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u044B\u043C\u0438 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u043C\u0438 \u0438 \u0442\u0430\u043A \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0435 \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u0435 \u043A\u0440\u0435\u0434\u0438\u0442\u0430.", sectionAdditionalTitle: "\u0412 \u043E\u0442\u0434\u0435\u043B\u0435\u043D\u0438\u0438 \u0411\u0430\u043D\u043A\u0430", sectionInfoAdditional: [
|
|
7768
7752
|
{
|
|
7769
7753
|
label: 'Регион',
|
|
@@ -7782,7 +7766,7 @@
|
|
|
7782
7766
|
});
|
|
7783
7767
|
|
|
7784
7768
|
const SuccessStatusContent = JSX(() => {
|
|
7785
|
-
const
|
|
7769
|
+
const { statusInfo } = useRetailFormStore();
|
|
7786
7770
|
return (jsx(CreditFormStatus, { title: "\u0411\u0430\u043D\u043A \u043E\u0434\u043E\u0431\u0440\u0438\u043B \u0432\u0430\u043C \u043A\u0440\u0435\u0434\u0438\u0442", description: "\u041E\u0431\u0440\u0430\u0442\u0438\u0442\u0435\u0441\u044C \u0432 \u043E\u0442\u0434\u0435\u043B\u0435\u043D\u0438\u0435 \u0431\u0430\u043D\u043A\u0430, \u0447\u0442\u043E\u0431\u044B \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044C \u043E\u0444\u043E\u0440\u043C\u043B\u0435\u043D\u0438\u0435 \u0438 \u043F\u043E\u043B\u0443\u0447\u0438\u0442 \u0432\u0430\u0448 \u043A\u0440\u0435\u0434\u0438\u0442", sectionInfo: [
|
|
7787
7771
|
{
|
|
7788
7772
|
label: 'Название продукта',
|
|
@@ -7813,7 +7797,7 @@
|
|
|
7813
7797
|
];
|
|
7814
7798
|
const CreditFormStatusTracker = JSX(() => {
|
|
7815
7799
|
const [status, setStatus] = useState(STATUS_TYPE.process);
|
|
7816
|
-
const
|
|
7800
|
+
const { taskId } = useRetailFormStore();
|
|
7817
7801
|
useEffect(() => {
|
|
7818
7802
|
(async () => {
|
|
7819
7803
|
for (const signalType of SIGNAL_TYPES) {
|
|
@@ -7842,109 +7826,6 @@
|
|
|
7842
7826
|
return statusesMap[status] || jsx(ReworkStatusContent, {});
|
|
7843
7827
|
};
|
|
7844
7828
|
|
|
7845
|
-
const formStateMap = [
|
|
7846
|
-
{
|
|
7847
|
-
calculator: {
|
|
7848
|
-
moneyValue: 0,
|
|
7849
|
-
monthsValue: 0,
|
|
7850
|
-
isAnnuity: false,
|
|
7851
|
-
isInsurance: false,
|
|
7852
|
-
isSalaryClient: false,
|
|
7853
|
-
isPensionClient: false,
|
|
7854
|
-
isStateEmployee: false,
|
|
7855
|
-
},
|
|
7856
|
-
},
|
|
7857
|
-
{
|
|
7858
|
-
surname: '',
|
|
7859
|
-
name: '',
|
|
7860
|
-
middleName: '',
|
|
7861
|
-
sex: '',
|
|
7862
|
-
limitedBirthday: undefined,
|
|
7863
|
-
birthPlace: '',
|
|
7864
|
-
phone: '',
|
|
7865
|
-
email: '',
|
|
7866
|
-
dulSerie: undefined,
|
|
7867
|
-
dulNumber: undefined,
|
|
7868
|
-
dulIssueDateField: undefined,
|
|
7869
|
-
dulSubdivisionCode: '',
|
|
7870
|
-
dulIssuedBy: '',
|
|
7871
|
-
addressRegistration: {
|
|
7872
|
-
fullAddress: '',
|
|
7873
|
-
fiasCode: '',
|
|
7874
|
-
},
|
|
7875
|
-
participantDateRegistration: undefined,
|
|
7876
|
-
addressFact: {
|
|
7877
|
-
fullAddress: '',
|
|
7878
|
-
fiasCode: '',
|
|
7879
|
-
},
|
|
7880
|
-
housing: undefined,
|
|
7881
|
-
},
|
|
7882
|
-
{
|
|
7883
|
-
amountWorkers: { key: '', text: '' },
|
|
7884
|
-
beginDate: undefined,
|
|
7885
|
-
employerActivities: { key: '', text: '' },
|
|
7886
|
-
employerOrganization: { key: '', text: '' },
|
|
7887
|
-
employment: { key: '', text: '' },
|
|
7888
|
-
experience5Years: undefined,
|
|
7889
|
-
inn: undefined,
|
|
7890
|
-
jobsNumber: undefined,
|
|
7891
|
-
lastJobExperience: undefined,
|
|
7892
|
-
legalForm: '',
|
|
7893
|
-
organization: { key: '', text: '' },
|
|
7894
|
-
organizationAddress: {
|
|
7895
|
-
fullAddress: '',
|
|
7896
|
-
fiasCode: '',
|
|
7897
|
-
},
|
|
7898
|
-
organizationName: '',
|
|
7899
|
-
organizationPhone: '',
|
|
7900
|
-
partInBusiness: undefined,
|
|
7901
|
-
positionOrganization: { key: '', text: '' },
|
|
7902
|
-
},
|
|
7903
|
-
{
|
|
7904
|
-
familyStatus: { key: '', text: '' },
|
|
7905
|
-
dependents: undefined,
|
|
7906
|
-
familyMembers: undefined,
|
|
7907
|
-
confirmationIncome: { key: '', text: '' },
|
|
7908
|
-
wages: undefined,
|
|
7909
|
-
mandatoryPayments: undefined,
|
|
7910
|
-
snils: '',
|
|
7911
|
-
armyIdFlg: false,
|
|
7912
|
-
},
|
|
7913
|
-
{
|
|
7914
|
-
disablePeopleFlg: false,
|
|
7915
|
-
bankruptcyFlg: false,
|
|
7916
|
-
shareholderFlg: false,
|
|
7917
|
-
legalEntityName: '',
|
|
7918
|
-
creditInRshbCd: undefined,
|
|
7919
|
-
},
|
|
7920
|
-
{
|
|
7921
|
-
regionRetail: { key: '', text: '' },
|
|
7922
|
-
addressRetail: undefined,
|
|
7923
|
-
bankEmployeeCode: undefined,
|
|
7924
|
-
},
|
|
7925
|
-
];
|
|
7926
|
-
|
|
7927
|
-
const getInitialFormState = (step, localStorageData) => ({
|
|
7928
|
-
...formStateMap[step],
|
|
7929
|
-
...localStorageData,
|
|
7930
|
-
limitedBirthday: transformStringToData(localStorageData?.limitedBirthday),
|
|
7931
|
-
dulIssueDateField: transformStringToData(localStorageData?.dulIssueDateField),
|
|
7932
|
-
participantDateRegistration: transformStringToData(localStorageData?.participantDateRegistration),
|
|
7933
|
-
beginDate: transformStringToData(localStorageData?.beginDate),
|
|
7934
|
-
deliveryDate: transformStringToData(localStorageData?.deliveryDate),
|
|
7935
|
-
});
|
|
7936
|
-
const transformStringToData = (text) => {
|
|
7937
|
-
if (!text) {
|
|
7938
|
-
return undefined;
|
|
7939
|
-
}
|
|
7940
|
-
try {
|
|
7941
|
-
return new Date(text);
|
|
7942
|
-
}
|
|
7943
|
-
catch (_) {
|
|
7944
|
-
return undefined;
|
|
7945
|
-
}
|
|
7946
|
-
};
|
|
7947
|
-
|
|
7948
7829
|
const calculateInputs = (getValue) => (inputs, step) => inputs
|
|
7949
7830
|
.filter((_) => _)
|
|
7950
7831
|
.map((_) => {
|
|
@@ -8155,20 +8036,134 @@
|
|
|
8155
8036
|
}
|
|
8156
8037
|
};
|
|
8157
8038
|
|
|
8158
|
-
const
|
|
8039
|
+
const formStateMap = [
|
|
8040
|
+
{
|
|
8041
|
+
calculator: {
|
|
8042
|
+
moneyValue: 0,
|
|
8043
|
+
monthsValue: 0,
|
|
8044
|
+
isAnnuity: false,
|
|
8045
|
+
isInsurance: false,
|
|
8046
|
+
isSalaryClient: false,
|
|
8047
|
+
isPensionClient: false,
|
|
8048
|
+
isStateEmployee: false,
|
|
8049
|
+
},
|
|
8050
|
+
},
|
|
8051
|
+
{
|
|
8052
|
+
surname: '',
|
|
8053
|
+
name: '',
|
|
8054
|
+
middleName: '',
|
|
8055
|
+
sex: '',
|
|
8056
|
+
limitedBirthday: undefined,
|
|
8057
|
+
birthPlace: '',
|
|
8058
|
+
phone: '',
|
|
8059
|
+
email: '',
|
|
8060
|
+
dulSerie: undefined,
|
|
8061
|
+
dulNumber: undefined,
|
|
8062
|
+
dulIssueDateField: undefined,
|
|
8063
|
+
dulSubdivisionCode: '',
|
|
8064
|
+
dulIssuedBy: '',
|
|
8065
|
+
addressRegistration: {
|
|
8066
|
+
fullAddress: '',
|
|
8067
|
+
fiasCode: '',
|
|
8068
|
+
},
|
|
8069
|
+
participantDateRegistration: undefined,
|
|
8070
|
+
addressFact: {
|
|
8071
|
+
fullAddress: '',
|
|
8072
|
+
fiasCode: '',
|
|
8073
|
+
},
|
|
8074
|
+
housing: undefined,
|
|
8075
|
+
},
|
|
8076
|
+
{
|
|
8077
|
+
amountWorkers: { key: '', text: '' },
|
|
8078
|
+
beginDate: undefined,
|
|
8079
|
+
employerActivities: { key: '', text: '' },
|
|
8080
|
+
employerOrganization: { key: '', text: '' },
|
|
8081
|
+
employment: { key: '', text: '' },
|
|
8082
|
+
experience5Years: undefined,
|
|
8083
|
+
inn: undefined,
|
|
8084
|
+
jobsNumber: undefined,
|
|
8085
|
+
lastJobExperience: undefined,
|
|
8086
|
+
legalForm: '',
|
|
8087
|
+
organization: { key: '', text: '' },
|
|
8088
|
+
organizationAddress: {
|
|
8089
|
+
fullAddress: '',
|
|
8090
|
+
fiasCode: '',
|
|
8091
|
+
},
|
|
8092
|
+
organizationName: '',
|
|
8093
|
+
organizationPhone: '',
|
|
8094
|
+
partInBusiness: undefined,
|
|
8095
|
+
positionOrganization: { key: '', text: '' },
|
|
8096
|
+
},
|
|
8097
|
+
{
|
|
8098
|
+
familyStatus: { key: '', text: '' },
|
|
8099
|
+
dependents: undefined,
|
|
8100
|
+
familyMembers: undefined,
|
|
8101
|
+
confirmationIncome: { key: '', text: '' },
|
|
8102
|
+
wages: undefined,
|
|
8103
|
+
mandatoryPayments: undefined,
|
|
8104
|
+
snils: '',
|
|
8105
|
+
armyIdFlg: false,
|
|
8106
|
+
},
|
|
8107
|
+
{
|
|
8108
|
+
disablePeopleFlg: false,
|
|
8109
|
+
bankruptcyFlg: false,
|
|
8110
|
+
shareholderFlg: false,
|
|
8111
|
+
legalEntityName: '',
|
|
8112
|
+
creditInRshbCd: undefined,
|
|
8113
|
+
},
|
|
8114
|
+
{
|
|
8115
|
+
regionRetail: { key: '', text: '' },
|
|
8116
|
+
addressRetail: undefined,
|
|
8117
|
+
bankEmployeeCode: undefined,
|
|
8118
|
+
},
|
|
8119
|
+
];
|
|
8120
|
+
|
|
8121
|
+
const getInitialFormState = (step, formState) => ({
|
|
8122
|
+
...formStateMap[step],
|
|
8123
|
+
...formState,
|
|
8124
|
+
limitedBirthday: transformStringToData(formState?.limitedBirthday),
|
|
8125
|
+
dulIssueDateField: transformStringToData(formState?.dulIssueDateField),
|
|
8126
|
+
participantDateRegistration: transformStringToData(formState?.participantDateRegistration),
|
|
8127
|
+
beginDate: transformStringToData(formState?.beginDate),
|
|
8128
|
+
deliveryDate: transformStringToData(formState?.deliveryDate),
|
|
8129
|
+
});
|
|
8130
|
+
const transformStringToData = (text) => {
|
|
8131
|
+
try {
|
|
8132
|
+
return text ? new Date(text) : undefined;
|
|
8133
|
+
}
|
|
8134
|
+
catch (_) {
|
|
8135
|
+
return undefined;
|
|
8136
|
+
}
|
|
8137
|
+
};
|
|
8138
|
+
|
|
8139
|
+
const useCreditFormAPI = ({ step, inputs, onNextStep, onFinish, }) => {
|
|
8159
8140
|
const isFinalStep = step === 5;
|
|
8160
|
-
const
|
|
8161
|
-
const
|
|
8162
|
-
const
|
|
8163
|
-
|
|
8164
|
-
|
|
8141
|
+
const retailFormStore = useRetailFormStore();
|
|
8142
|
+
const initialState = useMemo(() => getInitialFormState(step, retailFormStore.leadForm), [step, retailFormStore.leadForm]);
|
|
8143
|
+
const resetForm = useCallback((response) => {
|
|
8144
|
+
const { leadForm } = retailFormStore;
|
|
8145
|
+
if (isFinalStep && response.ok && leadForm) {
|
|
8146
|
+
retailFormStore.statusInfo = {
|
|
8147
|
+
regionRetail: leadForm?.regionRetail?.text,
|
|
8148
|
+
addressRetail: leadForm?.addressRetail?.text,
|
|
8149
|
+
cardCategory: leadForm?.cardCategory?.text,
|
|
8150
|
+
calculator: {
|
|
8151
|
+
monthsValue: leadForm?.calculator?.monthsValue,
|
|
8152
|
+
moneyValue: leadForm?.calculator?.moneyValue,
|
|
8153
|
+
isAnnuity: leadForm?.calculator?.isAnnuity,
|
|
8154
|
+
},
|
|
8155
|
+
};
|
|
8156
|
+
retailFormStore.leadForm = initialState;
|
|
8157
|
+
}
|
|
8158
|
+
}, [isFinalStep, initialState]);
|
|
8165
8159
|
const handleSubmit = useCallback(async (formData) => {
|
|
8166
8160
|
const feedbackValidator = objectValidator(getObjectValidator(calculateInputs(getValue(formData))(inputs, step)));
|
|
8167
8161
|
if (!isValidationSuccess(feedbackValidator(formData))) {
|
|
8168
|
-
return
|
|
8162
|
+
return;
|
|
8169
8163
|
}
|
|
8170
|
-
|
|
8164
|
+
retailFormStore.leadForm = formData;
|
|
8171
8165
|
try {
|
|
8166
|
+
const { taskId, profileId, participantId } = retailFormStore;
|
|
8172
8167
|
if (taskId && profileId && participantId) {
|
|
8173
8168
|
const response = await updateUserTask(getCreditFormTaskData({
|
|
8174
8169
|
participantId,
|
|
@@ -8177,60 +8172,33 @@
|
|
|
8177
8172
|
step,
|
|
8178
8173
|
formData: formData,
|
|
8179
8174
|
}));
|
|
8180
|
-
resetForm(
|
|
8175
|
+
resetForm(response);
|
|
8176
|
+
}
|
|
8177
|
+
onNextStep();
|
|
8178
|
+
if (isFinalStep) {
|
|
8179
|
+
onFinish?.();
|
|
8181
8180
|
}
|
|
8182
8181
|
}
|
|
8183
8182
|
catch (ex) {
|
|
8184
|
-
|
|
8185
|
-
}
|
|
8186
|
-
onNextStep();
|
|
8187
|
-
if (isFinalStep) {
|
|
8188
|
-
finishForm?.(true);
|
|
8183
|
+
// Do nothing
|
|
8189
8184
|
}
|
|
8190
|
-
|
|
8191
|
-
|
|
8192
|
-
return {
|
|
8193
|
-
handleSubmit,
|
|
8194
|
-
};
|
|
8195
|
-
};
|
|
8196
|
-
const resetForm = ({ isFinalStep, response, leadForm, setStatusInfo, }) => {
|
|
8197
|
-
if (isFinalStep && response.ok && leadForm !== null) {
|
|
8198
|
-
const regionRetail = leadForm?.regionRetail?.text;
|
|
8199
|
-
const addressRetail = leadForm?.addressRetail?.text;
|
|
8200
|
-
const cardCategory = leadForm?.cardCategory?.text;
|
|
8201
|
-
const calculator = {
|
|
8202
|
-
monthsValue: leadForm?.calculator?.monthsValue,
|
|
8203
|
-
moneyValue: leadForm?.calculator?.moneyValue,
|
|
8204
|
-
isAnnuity: leadForm?.calculator?.isAnnuity,
|
|
8205
|
-
};
|
|
8206
|
-
setStatusInfo({
|
|
8207
|
-
regionRetail,
|
|
8208
|
-
addressRetail,
|
|
8209
|
-
cardCategory,
|
|
8210
|
-
calculator,
|
|
8211
|
-
});
|
|
8212
|
-
globalThis.localStorage.removeItem('leadForm');
|
|
8213
|
-
}
|
|
8185
|
+
}, [isFinalStep, resetForm]);
|
|
8186
|
+
return [initialState, handleSubmit];
|
|
8214
8187
|
};
|
|
8215
8188
|
const getValue = (formData) => (name) => formData[name];
|
|
8216
8189
|
|
|
8217
|
-
const CreditFormStep = JSX(({ step, sections,
|
|
8218
|
-
const
|
|
8219
|
-
const [programId] = useLocalStorage('programId');
|
|
8190
|
+
const CreditFormStep = JSX(({ step, sections, isFormFinished, programsSource, onPrevStep, onNextStep, onFinish }) => {
|
|
8191
|
+
const { programId } = useRetailFormStore();
|
|
8220
8192
|
const calcData = programsSource?.[programId ?? '']; // Need normalizator useForm, to be save defaultParams
|
|
8221
|
-
const
|
|
8222
|
-
const
|
|
8223
|
-
const { handleSubmit } = useCreditFormAPI({
|
|
8193
|
+
const inputs = useMemo(() => (sections?.flatMap((_) => _?.inputs) || []), [sections]);
|
|
8194
|
+
const [initialState, onSubmit] = useCreditFormAPI({
|
|
8224
8195
|
step,
|
|
8225
8196
|
inputs,
|
|
8226
8197
|
onNextStep,
|
|
8227
|
-
|
|
8228
|
-
finishForm,
|
|
8229
|
-
});
|
|
8230
|
-
const [, { field, onSubmit }] = useForm(initialState, {
|
|
8231
|
-
onSubmit: handleSubmit,
|
|
8198
|
+
onFinish,
|
|
8232
8199
|
});
|
|
8233
|
-
|
|
8200
|
+
const [, { field, onSubmit: handleSubmit }] = useForm(initialState, { onSubmit });
|
|
8201
|
+
return isFormFinished ? (jsx(CreditFormStatusTracker, {})) : (jsxs("form", { onSubmit: handleSubmit, className: "space-y-m", children: [renderStep$1({ sections, field, step, params: { calcData } }), jsx(StepsNavigationButtons, { step: step, onPrevStep: onPrevStep })] }));
|
|
8234
8202
|
});
|
|
8235
8203
|
|
|
8236
8204
|
/* eslint-disable max-lines */
|
|
@@ -8540,8 +8508,8 @@
|
|
|
8540
8508
|
}, []);
|
|
8541
8509
|
const sections = useMemo(() => stepsSectionsMap[step], [step]);
|
|
8542
8510
|
const isStartStep = step === 0;
|
|
8543
|
-
const [isFormFinished,
|
|
8544
|
-
return (jsx(BlockWrapper, { className: className, ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isStartStep || isFormFinished ? null : (jsx(CreditFormProgress, { stepsTitles: STEP_TITLES, step: step, totalSteps: STEPS })), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: jsx(CreditFormStep, { step: step, sections: sections,
|
|
8511
|
+
const [isFormFinished, { setTrue: handleFinish }] = useBool(false);
|
|
8512
|
+
return (jsx(BlockWrapper, { className: className, ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isStartStep || isFormFinished ? null : (jsx(CreditFormProgress, { stepsTitles: STEP_TITLES, step: step, totalSteps: STEPS })), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: jsx(CreditFormStep, { step: step, sections: sections, isFormFinished: isFormFinished, programsSource: programsSource, onNextStep: handleNextStep, onPrevStep: handlePrevStep, onFinish: handleFinish }, String(step)) })] }) }));
|
|
8545
8513
|
});
|
|
8546
8514
|
|
|
8547
8515
|
const isRateRow = (rateRow) => typeof rateRow?.minMonths === 'number' && typeof rateRow?.maxMonths === 'number';
|
|
@@ -10818,7 +10786,7 @@
|
|
|
10818
10786
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
10819
10787
|
});
|
|
10820
10788
|
|
|
10821
|
-
const packageVersion = "0.14.
|
|
10789
|
+
const packageVersion = "0.14.709";
|
|
10822
10790
|
|
|
10823
10791
|
exports.Blocks = Blocks;
|
|
10824
10792
|
exports.ContentPage = ContentPage;
|