@redneckz/wildless-cms-uni-blocks 0.14.708 → 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/api/RetailAPI/utils/getOrganizationParams.d.ts +1 -1
- package/bundle/bundle.umd.js +345 -364
- 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/api/RetailAPI/utils/getOrganizationParams.d.ts +1 -1
- package/dist/api/RetailAPI/utils/getOrganizationParams.js +7 -2
- package/dist/api/RetailAPI/utils/getOrganizationParams.js.map +1 -1
- 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 +15 -7
- package/dist/ui-kit/FormField/updateOrganizationFields.js.map +1 -1
- package/lib/api/RetailAPI/utils/getOrganizationParams.d.ts +1 -1
- package/lib/api/RetailAPI/utils/getOrganizationParams.js +7 -2
- package/lib/api/RetailAPI/utils/getOrganizationParams.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 +15 -7
- package/lib/ui-kit/FormField/updateOrganizationFields.js.map +1 -1
- package/mobile/bundle/api/RetailAPI/utils/getOrganizationParams.d.ts +1 -1
- package/mobile/bundle/bundle.umd.js +345 -364
- 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/api/RetailAPI/utils/getOrganizationParams.d.ts +1 -1
- package/mobile/dist/api/RetailAPI/utils/getOrganizationParams.js +7 -2
- package/mobile/dist/api/RetailAPI/utils/getOrganizationParams.js.map +1 -1
- 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 +15 -7
- package/mobile/dist/ui-kit/FormField/updateOrganizationFields.js.map +1 -1
- package/mobile/lib/api/RetailAPI/utils/getOrganizationParams.d.ts +1 -1
- package/mobile/lib/api/RetailAPI/utils/getOrganizationParams.js +7 -2
- package/mobile/lib/api/RetailAPI/utils/getOrganizationParams.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 +15 -7
- package/mobile/lib/ui-kit/FormField/updateOrganizationFields.js.map +1 -1
- package/mobile/src/api/RetailAPI/utils/getOrganizationParams.ts +9 -3
- 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 +18 -17
- package/package.json +1 -1
- package/src/api/RetailAPI/utils/getOrganizationParams.ts +9 -3
- 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 +18 -17
- 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
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
1
|
+
import { useCallback, useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
2
|
import { updateUserTask } from '../../api/RetailAPI/updateUserTask';
|
|
3
|
-
import {
|
|
3
|
+
import { useRetailFormStore } from '../../hooks/useRetailFormStore';
|
|
4
4
|
import { getObjectValidator } from '../../ui-kit/FormField/getObjectValidator';
|
|
5
5
|
import { objectValidator } from '../../validation/objectValidator';
|
|
6
6
|
import { isValidationSuccess } from '../../validation/validator';
|
|
@@ -8,107 +8,88 @@ import { type FieldDef } from '../ApplicationLeadForm/ApplicationLeadFormContent
|
|
|
8
8
|
import { type LeadFormState } from '../ApplicationLeadForm/LeadFormState';
|
|
9
9
|
import { calculateInputs, type GetValue } from './calculateInputs';
|
|
10
10
|
import { getCreditCardFormTaskData } from './getCreditCardFormTaskData';
|
|
11
|
+
import { getInitialFormState } from './getInitialFormState';
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
interface CreditFormApiProps {
|
|
13
14
|
step: number;
|
|
14
15
|
inputs: FieldDef[];
|
|
15
16
|
onNextStep: () => void;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export type StatusInfoState = {
|
|
21
|
-
regionRetail?: string;
|
|
22
|
-
addressRetail?: string;
|
|
23
|
-
cardCategory?: string;
|
|
24
|
-
calculator?: {
|
|
25
|
-
monthsValue?: number;
|
|
26
|
-
moneyValue?: number;
|
|
27
|
-
isAnnuity?: boolean;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
17
|
+
onFinish?: () => void;
|
|
18
|
+
}
|
|
30
19
|
|
|
31
20
|
export const useCreditCardFormAPI = ({
|
|
32
21
|
step,
|
|
33
22
|
inputs,
|
|
34
23
|
onNextStep,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}: CreditCardFormApiProps) => {
|
|
24
|
+
onFinish,
|
|
25
|
+
}: CreditFormApiProps): [LeadFormState, (formData: LeadFormState) => void] => {
|
|
38
26
|
const isFinalStep = step === 5;
|
|
39
|
-
const [taskId] = useLocalStorage<number>('taskId');
|
|
40
|
-
const [profileId] = useLocalStorage<number>('profileId');
|
|
41
|
-
const [participantId] = useLocalStorage<number>('participantId');
|
|
42
|
-
const [, setStatusInfo] = useLocalStorage('statusInfo');
|
|
43
|
-
const [leadForm] = useLocalStorage<LeadFormState>('leadForm');
|
|
44
|
-
|
|
45
|
-
const handleSubmit = useCallback(async (formData: LeadFormState) => {
|
|
46
|
-
const feedbackValidator = objectValidator(
|
|
47
|
-
getObjectValidator(calculateInputs(getValue(formData))(inputs, step)),
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
if (!isValidationSuccess(feedbackValidator(formData))) {
|
|
51
|
-
return console.warn('validation fail');
|
|
52
|
-
}
|
|
53
27
|
|
|
54
|
-
|
|
28
|
+
const retailFormStore = useRetailFormStore();
|
|
55
29
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
30
|
+
const initialState = useMemo(
|
|
31
|
+
() => getInitialFormState(step, retailFormStore.leadForm),
|
|
32
|
+
[step, retailFormStore.leadForm],
|
|
33
|
+
);
|
|
34
|
+
const resetForm = useCallback(
|
|
35
|
+
(response: Response) => {
|
|
36
|
+
const { leadForm } = retailFormStore;
|
|
37
|
+
if (isFinalStep && response.ok && leadForm) {
|
|
38
|
+
retailFormStore.statusInfo = {
|
|
39
|
+
regionRetail: leadForm?.regionRetail?.text,
|
|
40
|
+
addressRetail: leadForm?.addressRetail?.text,
|
|
41
|
+
cardCategory: leadForm?.cardCategory?.text,
|
|
42
|
+
calculator: {
|
|
43
|
+
monthsValue: leadForm?.calculator?.monthsValue,
|
|
44
|
+
moneyValue: leadForm?.calculator?.moneyValue,
|
|
45
|
+
isAnnuity: leadForm?.calculator?.isAnnuity,
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
retailFormStore.leadForm = initialState;
|
|
68
49
|
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
50
|
+
},
|
|
51
|
+
[isFinalStep, initialState],
|
|
52
|
+
);
|
|
72
53
|
|
|
73
|
-
|
|
54
|
+
const handleSubmit = useCallback(
|
|
55
|
+
async (formData: LeadFormState) => {
|
|
56
|
+
const feedbackValidator = objectValidator(
|
|
57
|
+
getObjectValidator(calculateInputs(getValue(formData))(inputs, step)),
|
|
58
|
+
);
|
|
74
59
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
return 'OK';
|
|
80
|
-
}, []);
|
|
60
|
+
if (!isValidationSuccess(feedbackValidator(formData))) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
81
63
|
|
|
82
|
-
|
|
83
|
-
handleSubmit,
|
|
84
|
-
};
|
|
85
|
-
};
|
|
64
|
+
retailFormStore.leadForm = formData;
|
|
86
65
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
})
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
const cardCategory = leadForm?.cardCategory?.text;
|
|
102
|
-
const calculator = {
|
|
103
|
-
monthsValue: leadForm?.calculator?.monthsValue,
|
|
104
|
-
moneyValue: leadForm?.calculator?.moneyValue,
|
|
105
|
-
isAnnuity: leadForm?.calculator?.isAnnuity,
|
|
106
|
-
};
|
|
66
|
+
try {
|
|
67
|
+
const { taskId, profileId, participantId } = retailFormStore;
|
|
68
|
+
if (taskId && profileId && participantId) {
|
|
69
|
+
const response = await updateUserTask(
|
|
70
|
+
getCreditCardFormTaskData({
|
|
71
|
+
participantId,
|
|
72
|
+
taskId,
|
|
73
|
+
profileId,
|
|
74
|
+
step,
|
|
75
|
+
formData: formData as any,
|
|
76
|
+
}),
|
|
77
|
+
);
|
|
78
|
+
resetForm(response);
|
|
79
|
+
}
|
|
107
80
|
|
|
108
|
-
|
|
81
|
+
onNextStep();
|
|
82
|
+
if (isFinalStep) {
|
|
83
|
+
onFinish?.();
|
|
84
|
+
}
|
|
85
|
+
} catch (ex) {
|
|
86
|
+
// Do nothing
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
[isFinalStep, resetForm],
|
|
90
|
+
);
|
|
109
91
|
|
|
110
|
-
|
|
111
|
-
}
|
|
92
|
+
return [initialState, handleSubmit];
|
|
112
93
|
};
|
|
113
94
|
|
|
114
95
|
const getValue =
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo, useRef, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
|
|
2
3
|
import { updateRefreshToken } from '../../api/RetailAPI/updateRefreshToken';
|
|
3
4
|
import { type JSONRefObject } from '../../data/JSONRefObject';
|
|
4
5
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
@@ -50,7 +51,7 @@ export const CreditForm = UniBlock<CreditFormProps>(({ className, programsSource
|
|
|
50
51
|
const sections = useMemo(() => stepsSectionsMap[step], [step]);
|
|
51
52
|
|
|
52
53
|
const isStartStep = step === 0;
|
|
53
|
-
const [isFormFinished,
|
|
54
|
+
const [isFormFinished, { setTrue: handleFinish }] = useBool(false);
|
|
54
55
|
|
|
55
56
|
return (
|
|
56
57
|
<BlockWrapper className={className} {...rest}>
|
|
@@ -63,11 +64,11 @@ export const CreditForm = UniBlock<CreditFormProps>(({ className, programsSource
|
|
|
63
64
|
key={String(step)}
|
|
64
65
|
step={step}
|
|
65
66
|
sections={sections}
|
|
66
|
-
onNextStep={handleNextStep}
|
|
67
|
-
onPrevStep={handlePrevStep}
|
|
68
67
|
isFormFinished={isFormFinished}
|
|
69
|
-
finishForm={setIsFormFinished}
|
|
70
68
|
programsSource={programsSource as ProgramsSourceProps}
|
|
69
|
+
onNextStep={handleNextStep}
|
|
70
|
+
onPrevStep={handlePrevStep}
|
|
71
|
+
onFinish={handleFinish}
|
|
71
72
|
/>
|
|
72
73
|
</div>
|
|
73
74
|
</div>
|
|
@@ -3,7 +3,7 @@ import { useCallback, useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
|
3
3
|
import { getTaskStatus, STATUS_TYPE } from '../../api/RetailAPI/getTaskStatus';
|
|
4
4
|
import { sendSignalToProcess, type SignalType } from '../../api/RetailAPI/sendSignalToProcess';
|
|
5
5
|
import { useInterval } from '../../hooks/useInterval';
|
|
6
|
-
import {
|
|
6
|
+
import { useRetailFormStore } from '../../hooks/useRetailFormStore';
|
|
7
7
|
import { type VNode } from '../../model/VNode';
|
|
8
8
|
import { FailedStatusContent } from './FailedStatusContent';
|
|
9
9
|
import { PendingStatusContent } from './PendingStatusContent';
|
|
@@ -16,7 +16,7 @@ const SIGNAL_TYPES: SignalType[] = [
|
|
|
16
16
|
|
|
17
17
|
export const CreditFormStatusTracker = JSX(() => {
|
|
18
18
|
const [status, setStatus] = useState(STATUS_TYPE.process);
|
|
19
|
-
const
|
|
19
|
+
const { taskId } = useRetailFormStore();
|
|
20
20
|
|
|
21
21
|
useEffect(() => {
|
|
22
22
|
(async () => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
3
|
import { useForm } from '../../hooks/useForm';
|
|
3
|
-
import {
|
|
4
|
+
import { useRetailFormStore } from '../../hooks/useRetailFormStore';
|
|
4
5
|
import { type SectionsProps } from '../../model/InputSectionsType';
|
|
5
6
|
import { type FieldDef } from '../ApplicationLeadForm/ApplicationLeadFormContent';
|
|
6
7
|
import { CreditFormStatusTracker } from './CreditFormStatusTracker';
|
|
7
|
-
import { getInitialFormState } from './getInitialFormState';
|
|
8
8
|
import { type ProgramsSourceProps } from './ProgramsSourceProps';
|
|
9
9
|
import { renderStep } from './renderStep';
|
|
10
10
|
import { StepsNavigationButtons } from './StepsNavigationButtons';
|
|
@@ -13,40 +13,36 @@ import { useCreditFormAPI } from './useCreditFormAPI';
|
|
|
13
13
|
export interface CreditFormStepProps {
|
|
14
14
|
step: number;
|
|
15
15
|
sections: SectionsProps[];
|
|
16
|
+
isFormFinished?: boolean;
|
|
17
|
+
programsSource?: ProgramsSourceProps;
|
|
16
18
|
onNextStep: () => void;
|
|
17
19
|
onPrevStep: () => void;
|
|
18
|
-
|
|
19
|
-
finishForm?: (bool: boolean) => void;
|
|
20
|
-
programsSource?: ProgramsSourceProps;
|
|
20
|
+
onFinish?: () => void;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export const CreditFormStep = JSX<CreditFormStepProps>(
|
|
24
|
-
({ step, sections,
|
|
25
|
-
const
|
|
26
|
-
const [programId] = useLocalStorage<string>('programId');
|
|
27
|
-
|
|
24
|
+
({ step, sections, isFormFinished, programsSource, onPrevStep, onNextStep, onFinish }) => {
|
|
25
|
+
const { programId } = useRetailFormStore();
|
|
28
26
|
const calcData = programsSource?.[programId ?? '']; // Need normalizator useForm, to be save defaultParams
|
|
29
27
|
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
const inputs = useMemo(
|
|
29
|
+
() => (sections?.flatMap((_: SectionsProps) => _?.inputs) || []) as FieldDef[],
|
|
30
|
+
[sections],
|
|
31
|
+
);
|
|
33
32
|
|
|
34
|
-
const
|
|
33
|
+
const [initialState, onSubmit] = useCreditFormAPI({
|
|
35
34
|
step,
|
|
36
35
|
inputs,
|
|
37
36
|
onNextStep,
|
|
38
|
-
|
|
39
|
-
finishForm,
|
|
37
|
+
onFinish,
|
|
40
38
|
});
|
|
41
39
|
|
|
42
|
-
const [, { field, onSubmit }] = useForm(initialState, {
|
|
43
|
-
onSubmit: handleSubmit,
|
|
44
|
-
});
|
|
40
|
+
const [, { field, onSubmit: handleSubmit }] = useForm(initialState, { onSubmit });
|
|
45
41
|
|
|
46
42
|
return isFormFinished ? (
|
|
47
43
|
<CreditFormStatusTracker />
|
|
48
44
|
) : (
|
|
49
|
-
<form onSubmit={
|
|
45
|
+
<form onSubmit={handleSubmit} className="space-y-m">
|
|
50
46
|
{renderStep({ sections, field, step, params: { calcData } })}
|
|
51
47
|
<StepsNavigationButtons step={step} onPrevStep={onPrevStep} />
|
|
52
48
|
</form>
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { useRetailFormStore } from '../../hooks/useRetailFormStore';
|
|
3
3
|
import { CreditFormStatus } from './CreditFormStatus';
|
|
4
|
-
import { type StatusInfoState } from './useCreditFormAPI';
|
|
5
4
|
|
|
6
5
|
export const PendingStatusContent = JSX(
|
|
7
6
|
({ handleExpireTimer }: { handleExpireTimer: () => void }) => {
|
|
8
|
-
const
|
|
7
|
+
const { statusInfo } = useRetailFormStore();
|
|
9
8
|
|
|
10
9
|
return (
|
|
11
10
|
<CreditFormStatus
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { useRetailFormStore } from '../../hooks/useRetailFormStore';
|
|
3
3
|
import { CreditFormStatus } from './CreditFormStatus';
|
|
4
|
-
import { type StatusInfoState } from './useCreditFormAPI';
|
|
5
4
|
|
|
6
5
|
export const ReworkStatusContent = JSX(() => {
|
|
7
|
-
const
|
|
6
|
+
const { statusInfo } = useRetailFormStore();
|
|
8
7
|
|
|
9
8
|
return (
|
|
10
9
|
<CreditFormStatus
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { useRetailFormStore } from '../../hooks/useRetailFormStore';
|
|
3
3
|
import { CreditFormStatus } from './CreditFormStatus';
|
|
4
|
-
import { type StatusInfoState } from './useCreditFormAPI';
|
|
5
4
|
|
|
6
5
|
export const SuccessStatusContent = JSX(() => {
|
|
7
|
-
const
|
|
6
|
+
const { statusInfo } = useRetailFormStore();
|
|
8
7
|
|
|
9
8
|
return (
|
|
10
9
|
<CreditFormStatus
|
|
@@ -3,26 +3,22 @@ import { formStateMap } from './formStateMap';
|
|
|
3
3
|
|
|
4
4
|
export const getInitialFormState = (
|
|
5
5
|
step: number,
|
|
6
|
-
|
|
6
|
+
formState: LeadFormState | null,
|
|
7
7
|
): LeadFormState => ({
|
|
8
8
|
...formStateMap[step],
|
|
9
|
-
...
|
|
10
|
-
limitedBirthday: transformStringToData(
|
|
11
|
-
dulIssueDateField: transformStringToData(
|
|
9
|
+
...formState,
|
|
10
|
+
limitedBirthday: transformStringToData(formState?.limitedBirthday as string),
|
|
11
|
+
dulIssueDateField: transformStringToData(formState?.dulIssueDateField as string),
|
|
12
12
|
participantDateRegistration: transformStringToData(
|
|
13
|
-
|
|
13
|
+
formState?.participantDateRegistration as string,
|
|
14
14
|
),
|
|
15
|
-
beginDate: transformStringToData(
|
|
16
|
-
deliveryDate: transformStringToData(
|
|
15
|
+
beginDate: transformStringToData(formState?.beginDate as string),
|
|
16
|
+
deliveryDate: transformStringToData(formState?.deliveryDate as string),
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
const transformStringToData = (text?: string) => {
|
|
20
|
-
if (!text) {
|
|
21
|
-
return undefined;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
20
|
try {
|
|
25
|
-
return new Date(text);
|
|
21
|
+
return text ? new Date(text) : undefined;
|
|
26
22
|
} catch (_) {
|
|
27
23
|
return undefined;
|
|
28
24
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
1
|
+
import { useCallback, useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
2
|
import { updateUserTask } from '../../api/RetailAPI/updateUserTask';
|
|
3
|
-
import {
|
|
3
|
+
import { useRetailFormStore } from '../../hooks/useRetailFormStore';
|
|
4
4
|
import { getObjectValidator } from '../../ui-kit/FormField/getObjectValidator';
|
|
5
5
|
import { objectValidator } from '../../validation/objectValidator';
|
|
6
6
|
import { isValidationSuccess } from '../../validation/validator';
|
|
@@ -8,112 +8,89 @@ import { type FieldDef } from '../ApplicationLeadForm/ApplicationLeadFormContent
|
|
|
8
8
|
import { type LeadFormState } from '../ApplicationLeadForm/LeadFormState';
|
|
9
9
|
import { calculateInputs, type GetValue } from './calculateInputs';
|
|
10
10
|
import { getCreditFormTaskData } from './getCreditFormTaskData';
|
|
11
|
+
import { getInitialFormState } from './getInitialFormState';
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
interface CreditFormApiProps {
|
|
13
14
|
step: number;
|
|
14
15
|
inputs: FieldDef[];
|
|
15
16
|
onNextStep: () => void;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export type StatusInfoState = {
|
|
21
|
-
regionRetail?: string;
|
|
22
|
-
addressRetail?: string;
|
|
23
|
-
cardCategory?: string;
|
|
24
|
-
calculator?: {
|
|
25
|
-
monthsValue?: number;
|
|
26
|
-
moneyValue?: number;
|
|
27
|
-
isAnnuity?: boolean;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
17
|
+
onFinish?: () => void;
|
|
18
|
+
}
|
|
30
19
|
|
|
31
20
|
export const useCreditFormAPI = ({
|
|
32
21
|
step,
|
|
33
22
|
inputs,
|
|
34
23
|
onNextStep,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}: CreditFormApiProps) => {
|
|
24
|
+
onFinish,
|
|
25
|
+
}: CreditFormApiProps): [LeadFormState, (formData: LeadFormState) => void] => {
|
|
38
26
|
const isFinalStep = step === 5;
|
|
39
|
-
const [taskId] = useLocalStorage<number>('taskId');
|
|
40
|
-
const [profileId] = useLocalStorage<number>('profileId');
|
|
41
|
-
const [participantId] = useLocalStorage<number>('participantId');
|
|
42
|
-
const [, setStatusInfo] = useLocalStorage('statusInfo');
|
|
43
|
-
const [leadForm] = useLocalStorage<LeadFormState>('leadForm');
|
|
44
|
-
|
|
45
|
-
const handleSubmit = useCallback(async (formData: LeadFormState) => {
|
|
46
|
-
const feedbackValidator = objectValidator(
|
|
47
|
-
getObjectValidator(calculateInputs(getValue(formData))(inputs, step)),
|
|
48
|
-
);
|
|
49
27
|
|
|
50
|
-
|
|
51
|
-
return console.warn('validation fail');
|
|
52
|
-
}
|
|
28
|
+
const retailFormStore = useRetailFormStore();
|
|
53
29
|
|
|
54
|
-
|
|
30
|
+
const initialState = useMemo(
|
|
31
|
+
() => getInitialFormState(step, retailFormStore.leadForm),
|
|
32
|
+
[step, retailFormStore.leadForm],
|
|
33
|
+
);
|
|
55
34
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
35
|
+
const resetForm = useCallback(
|
|
36
|
+
(response: Response) => {
|
|
37
|
+
const { leadForm } = retailFormStore;
|
|
38
|
+
if (isFinalStep && response.ok && leadForm) {
|
|
39
|
+
retailFormStore.statusInfo = {
|
|
40
|
+
regionRetail: leadForm?.regionRetail?.text,
|
|
41
|
+
addressRetail: leadForm?.addressRetail?.text,
|
|
42
|
+
cardCategory: leadForm?.cardCategory?.text,
|
|
43
|
+
calculator: {
|
|
44
|
+
monthsValue: leadForm?.calculator?.monthsValue,
|
|
45
|
+
moneyValue: leadForm?.calculator?.moneyValue,
|
|
46
|
+
isAnnuity: leadForm?.calculator?.isAnnuity,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
retailFormStore.leadForm = initialState;
|
|
68
50
|
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
51
|
+
},
|
|
52
|
+
[isFinalStep, initialState],
|
|
53
|
+
);
|
|
72
54
|
|
|
73
|
-
|
|
55
|
+
const handleSubmit = useCallback(
|
|
56
|
+
async (formData: LeadFormState) => {
|
|
57
|
+
const feedbackValidator = objectValidator(
|
|
58
|
+
getObjectValidator(calculateInputs(getValue(formData))(inputs, step)),
|
|
59
|
+
);
|
|
74
60
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
return 'OK';
|
|
80
|
-
}, []);
|
|
61
|
+
if (!isValidationSuccess(feedbackValidator(formData))) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
81
64
|
|
|
82
|
-
|
|
83
|
-
handleSubmit,
|
|
84
|
-
};
|
|
85
|
-
};
|
|
65
|
+
retailFormStore.leadForm = formData;
|
|
86
66
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
})
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
const cardCategory = leadForm?.cardCategory?.text;
|
|
102
|
-
const calculator = {
|
|
103
|
-
monthsValue: leadForm?.calculator?.monthsValue,
|
|
104
|
-
moneyValue: leadForm?.calculator?.moneyValue,
|
|
105
|
-
isAnnuity: leadForm?.calculator?.isAnnuity,
|
|
106
|
-
};
|
|
67
|
+
try {
|
|
68
|
+
const { taskId, profileId, participantId } = retailFormStore;
|
|
69
|
+
if (taskId && profileId && participantId) {
|
|
70
|
+
const response = await updateUserTask(
|
|
71
|
+
getCreditFormTaskData({
|
|
72
|
+
participantId,
|
|
73
|
+
taskId,
|
|
74
|
+
profileId,
|
|
75
|
+
step,
|
|
76
|
+
formData: formData as any,
|
|
77
|
+
}),
|
|
78
|
+
);
|
|
79
|
+
resetForm(response);
|
|
80
|
+
}
|
|
107
81
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
82
|
+
onNextStep();
|
|
83
|
+
if (isFinalStep) {
|
|
84
|
+
onFinish?.();
|
|
85
|
+
}
|
|
86
|
+
} catch (ex) {
|
|
87
|
+
// Do nothing
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
[isFinalStep, resetForm],
|
|
91
|
+
);
|
|
114
92
|
|
|
115
|
-
|
|
116
|
-
}
|
|
93
|
+
return [initialState, handleSubmit];
|
|
117
94
|
};
|
|
118
95
|
|
|
119
96
|
const getValue =
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useLocalStore } from '@redneckz/uni-jsx/lib/Store/useLocalStore';
|
|
2
|
+
import { type LeadProps } from '../api/RetailAPI/model/LeadFormData';
|
|
3
|
+
import { type LeadFormStoreSlice } from '../components/ApplicationLeadForm/useLeadFormStore';
|
|
4
|
+
|
|
5
|
+
export type StatusInfoState = {
|
|
6
|
+
regionRetail?: string;
|
|
7
|
+
addressRetail?: string;
|
|
8
|
+
cardCategory?: string;
|
|
9
|
+
calculator?: {
|
|
10
|
+
monthsValue?: number;
|
|
11
|
+
moneyValue?: number;
|
|
12
|
+
isAnnuity?: boolean;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export interface CreditFormDictionarySlice {
|
|
17
|
+
amountWorkers: LeadProps[] | null;
|
|
18
|
+
organization: LeadProps[] | null;
|
|
19
|
+
employerActivities: LeadProps[] | null;
|
|
20
|
+
employerOrganization: LeadProps[] | null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface CreditFormStoreSlice extends CreditFormDictionarySlice, LeadFormStoreSlice {
|
|
24
|
+
statusInfo: StatusInfoState;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const useRetailFormStore = () => {
|
|
28
|
+
return useLocalStore<CreditFormStoreSlice>();
|
|
29
|
+
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { type Task } from '../../api/RetailAPI/draftTasksKZO';
|
|
4
|
-
import { useLeadFormStore } from '../../components/ApplicationLeadForm/useLeadFormStore';
|
|
5
4
|
import { locationNavigator } from '../../external/locationNavigator';
|
|
6
|
-
import {
|
|
5
|
+
import { useRetailFormStore } from '../../hooks/useRetailFormStore';
|
|
7
6
|
import { noop } from '../../utils/noop';
|
|
8
7
|
import { Button } from '../Button/Button';
|
|
9
8
|
import { Dialog } from '../DialogManager/Dialog';
|
|
@@ -23,8 +22,7 @@ export const DraftDialog = JSX<DraftDialogProps>(function ({
|
|
|
23
22
|
isFromLead = false,
|
|
24
23
|
onClose = noop,
|
|
25
24
|
}) {
|
|
26
|
-
const
|
|
27
|
-
const saveForm = useSetter(leadFormStore, 'leadForm');
|
|
25
|
+
const retailFormStore = useRetailFormStore();
|
|
28
26
|
const navigator = locationNavigator();
|
|
29
27
|
|
|
30
28
|
const { participants, creditProgram, id: taskId } = task;
|
|
@@ -37,11 +35,11 @@ export const DraftDialog = JSX<DraftDialogProps>(function ({
|
|
|
37
35
|
|
|
38
36
|
const handleGoToDraft = useCallback(() => {
|
|
39
37
|
const taskFromDraft = parseDraftTask(task);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
retailFormStore.participantId = participantId;
|
|
39
|
+
retailFormStore.taskId = taskId;
|
|
40
|
+
retailFormStore.profileId = profile?.id;
|
|
41
|
+
retailFormStore.programId = programmId;
|
|
42
|
+
retailFormStore.leadForm = taskFromDraft;
|
|
45
43
|
navigator.assign(nextStepLink);
|
|
46
44
|
}, []);
|
|
47
45
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { getLink } from '../../api/RetailAPI/getLink';
|
|
4
|
-
import { type LeadFormState } from '../../components/ApplicationLeadForm/LeadFormState';
|
|
5
4
|
import { locationNavigator } from '../../external/locationNavigator';
|
|
6
|
-
import {
|
|
5
|
+
import { useRetailFormStore } from '../../hooks/useRetailFormStore';
|
|
7
6
|
import { Button } from '../Button/Button';
|
|
8
7
|
import { Dialog } from '../DialogManager/Dialog';
|
|
9
8
|
import { Img } from '../Img/Img';
|
|
@@ -14,7 +13,8 @@ export interface EsiaLoginDialogProps {
|
|
|
14
13
|
|
|
15
14
|
export const EsiaLoginDialog = JSX<EsiaLoginDialogProps>(({ onClose }) => {
|
|
16
15
|
const navigator = locationNavigator();
|
|
17
|
-
const
|
|
16
|
+
const retailFormStore = useRetailFormStore();
|
|
17
|
+
|
|
18
18
|
const handleAuth = useCallback(async () => {
|
|
19
19
|
const resp = await getLink({
|
|
20
20
|
redirectUri: navigator.href,
|
|
@@ -26,10 +26,10 @@ export const EsiaLoginDialog = JSX<EsiaLoginDialogProps>(({ onClose }) => {
|
|
|
26
26
|
}, []);
|
|
27
27
|
|
|
28
28
|
const handleClose = useCallback(() => {
|
|
29
|
-
if (leadForm
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
if (retailFormStore.leadForm) {
|
|
30
|
+
const leadForm = { ...retailFormStore.leadForm };
|
|
31
|
+
delete leadForm.esiaAccountTypeCd;
|
|
32
|
+
retailFormStore.leadForm = leadForm;
|
|
33
33
|
}
|
|
34
34
|
onClose?.();
|
|
35
35
|
}, []);
|