@redneckz/wildless-cms-uni-blocks 0.14.865 → 0.14.867
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 +586 -435
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +4 -5
- package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +6 -0
- package/bundle/components/CreditCardForm/getCreditCardFormTaskData.d.ts +1 -3
- package/bundle/components/DebitForm/getDebitCardFormTaskData.d.ts +1 -3
- package/bundle/retail/adaptors/getCreditFormTaskData.d.ts +1 -3
- package/bundle/retail/api/createUserTaskDebit.d.ts +3 -1
- package/bundle/retail/api/updateUserTask.d.ts +3 -2
- package/bundle/retail/api/updateUserTaskDebit.d.ts +1 -1
- package/bundle/retail/components/DraftDialog/parseDraftTask.d.ts +1 -1
- package/bundle/retail/components/Fields/InitiateBankruptcyFlgField.d.ts +2 -0
- package/bundle/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +7 -2
- package/bundle/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -2
- package/bundle/retail/content.d.ts +2 -8
- package/bundle/retail/inputs.d.ts +1 -1
- package/bundle/retail/model/LeadFormState.d.ts +4 -2
- package/bundle/retail/model/NameFieldDef.d.ts +1 -1
- package/bundle/retail/model/ReferalData.d.ts +0 -1
- package/bundle/retail/utils/getMainFormStateMap.d.ts +2 -0
- package/dist/components/ApplicationLeadForm/applicationFormData.js +0 -1
- package/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
- package/dist/components/ApplicationLeadForm/consents.js +0 -4
- package/dist/components/ApplicationLeadForm/consents.js.map +1 -1
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +4 -5
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +20 -17
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +12 -11
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +6 -0
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +20 -12
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/dist/components/CreditCardForm/creditCardFormStepsData.js +245 -3
- package/dist/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
- package/dist/components/CreditCardForm/formStateMap.js +2 -2
- package/dist/components/CreditCardForm/formStateMap.js.map +1 -1
- package/dist/components/CreditCardForm/getCreditCardFormTaskData.d.ts +1 -3
- package/dist/components/CreditCardForm/getCreditCardFormTaskData.js +24 -30
- package/dist/components/CreditCardForm/getCreditCardFormTaskData.js.map +1 -1
- package/dist/components/CreditCardForm/useCreditCardFormAPI.js +0 -2
- package/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/dist/components/CreditForm/CreditForm.js +1 -2
- package/dist/components/CreditForm/CreditForm.js.map +1 -1
- package/dist/components/CreditForm/creditFormStepsData.js +192 -3
- package/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/dist/components/CreditForm/formStateMap.js +2 -2
- package/dist/components/CreditForm/formStateMap.js.map +1 -1
- package/dist/components/CreditForm/useCreditFormAPI.js +1 -3
- package/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/dist/components/DebitForm/DebitFormStepsData.js +71 -3
- package/dist/components/DebitForm/DebitFormStepsData.js.map +1 -1
- package/dist/components/DebitForm/getDebitCardFormTaskData.d.ts +1 -3
- package/dist/components/DebitForm/getDebitCardFormTaskData.js +16 -22
- package/dist/components/DebitForm/getDebitCardFormTaskData.js.map +1 -1
- package/dist/components/DebitForm/useDebitFormAPI.js +0 -2
- package/dist/components/DebitForm/useDebitFormAPI.js.map +1 -1
- package/dist/retail/adaptors/getCreditFormTaskData.d.ts +1 -3
- package/dist/retail/adaptors/getCreditFormTaskData.js +24 -33
- package/dist/retail/adaptors/getCreditFormTaskData.js.map +1 -1
- package/dist/retail/adaptors/getEmploymentData.js +3 -3
- package/dist/retail/adaptors/getEmploymentData.js.map +1 -1
- package/dist/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -1
- package/dist/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
- package/dist/retail/adaptors/getPersonalInfoData.js +4 -2
- package/dist/retail/adaptors/getPersonalInfoData.js.map +1 -1
- package/dist/retail/api/checkCode.js +1 -1
- package/dist/retail/api/checkCode.js.map +1 -1
- package/dist/retail/api/createUserTaskDebit.d.ts +3 -1
- package/dist/retail/api/createUserTaskDebit.js.map +1 -1
- package/dist/retail/api/updateUserTask.d.ts +3 -2
- package/dist/retail/api/updateUserTask.js.map +1 -1
- package/dist/retail/api/updateUserTaskDebit.d.ts +1 -1
- package/dist/retail/components/DraftDialog/DraftDialog.js +1 -2
- package/dist/retail/components/DraftDialog/DraftDialog.js.map +1 -1
- package/dist/retail/components/DraftDialog/parseDraftTask.d.ts +1 -1
- package/dist/retail/components/DraftDialog/parseDraftTask.js +2 -3
- package/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/dist/retail/components/Fields/DaDataInnField.js +10 -3
- package/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
- package/dist/retail/components/Fields/InitiateBankruptcyFlgField.d.ts +2 -0
- package/dist/retail/components/Fields/InitiateBankruptcyFlgField.js +7 -0
- package/dist/retail/components/Fields/InitiateBankruptcyFlgField.js.map +1 -0
- package/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +7 -2
- package/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +19 -10
- package/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
- package/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -2
- package/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +21 -10
- package/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/dist/retail/content.d.ts +2 -8
- package/dist/retail/content.js +3 -361
- package/dist/retail/content.js.map +1 -1
- package/dist/retail/inputs.d.ts +1 -1
- package/dist/retail/inputs.js +2 -1
- package/dist/retail/inputs.js.map +1 -1
- package/dist/retail/model/LeadFormState.d.ts +4 -2
- package/dist/retail/model/NameFieldDef.d.ts +1 -1
- package/dist/retail/model/ReferalData.d.ts +0 -1
- package/dist/retail/utils/getMainFormStateMap.d.ts +2 -0
- package/dist/retail/utils/{mainFormStateMap.js → getMainFormStateMap.js} +6 -4
- package/dist/retail/utils/getMainFormStateMap.js.map +1 -0
- package/lib/components/ApplicationLeadForm/applicationFormData.js +0 -1
- package/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
- package/lib/components/ApplicationLeadForm/consents.js +0 -4
- package/lib/components/ApplicationLeadForm/consents.js.map +1 -1
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +4 -5
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +20 -17
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +12 -11
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +6 -0
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +20 -12
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/lib/components/CreditCardForm/creditCardFormStepsData.js +244 -2
- package/lib/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
- package/lib/components/CreditCardForm/formStateMap.js +2 -2
- package/lib/components/CreditCardForm/formStateMap.js.map +1 -1
- package/lib/components/CreditCardForm/getCreditCardFormTaskData.d.ts +1 -3
- package/lib/components/CreditCardForm/getCreditCardFormTaskData.js +24 -30
- package/lib/components/CreditCardForm/getCreditCardFormTaskData.js.map +1 -1
- package/lib/components/CreditCardForm/useCreditCardFormAPI.js +0 -2
- package/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/lib/components/CreditForm/CreditForm.js +1 -2
- package/lib/components/CreditForm/CreditForm.js.map +1 -1
- package/lib/components/CreditForm/creditFormStepsData.js +191 -2
- package/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/lib/components/CreditForm/formStateMap.js +2 -2
- package/lib/components/CreditForm/formStateMap.js.map +1 -1
- package/lib/components/CreditForm/useCreditFormAPI.js +1 -3
- package/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/lib/components/DebitForm/DebitFormStepsData.js +70 -2
- package/lib/components/DebitForm/DebitFormStepsData.js.map +1 -1
- package/lib/components/DebitForm/getDebitCardFormTaskData.d.ts +1 -3
- package/lib/components/DebitForm/getDebitCardFormTaskData.js +16 -22
- package/lib/components/DebitForm/getDebitCardFormTaskData.js.map +1 -1
- package/lib/components/DebitForm/useDebitFormAPI.js +0 -2
- package/lib/components/DebitForm/useDebitFormAPI.js.map +1 -1
- package/lib/retail/adaptors/getCreditFormTaskData.d.ts +1 -3
- package/lib/retail/adaptors/getCreditFormTaskData.js +24 -33
- package/lib/retail/adaptors/getCreditFormTaskData.js.map +1 -1
- package/lib/retail/adaptors/getEmploymentData.js +3 -3
- package/lib/retail/adaptors/getEmploymentData.js.map +1 -1
- package/lib/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -1
- package/lib/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
- package/lib/retail/adaptors/getPersonalInfoData.js +4 -2
- package/lib/retail/adaptors/getPersonalInfoData.js.map +1 -1
- package/lib/retail/api/checkCode.js +1 -1
- package/lib/retail/api/checkCode.js.map +1 -1
- package/lib/retail/api/createUserTaskDebit.d.ts +3 -1
- package/lib/retail/api/createUserTaskDebit.js.map +1 -1
- package/lib/retail/api/updateUserTask.d.ts +3 -2
- package/lib/retail/api/updateUserTask.js.map +1 -1
- package/lib/retail/api/updateUserTaskDebit.d.ts +1 -1
- package/lib/retail/components/DraftDialog/DraftDialog.js +1 -2
- package/lib/retail/components/DraftDialog/DraftDialog.js.map +1 -1
- package/lib/retail/components/DraftDialog/parseDraftTask.d.ts +1 -1
- package/lib/retail/components/DraftDialog/parseDraftTask.js +2 -3
- package/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/lib/retail/components/Fields/DaDataInnField.js +10 -3
- package/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
- package/lib/retail/components/Fields/InitiateBankruptcyFlgField.d.ts +2 -0
- package/lib/retail/components/Fields/InitiateBankruptcyFlgField.js +5 -0
- package/lib/retail/components/Fields/InitiateBankruptcyFlgField.js.map +1 -0
- package/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +7 -2
- package/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +18 -9
- package/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
- package/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -2
- package/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +21 -10
- package/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/lib/retail/content.d.ts +2 -8
- package/lib/retail/content.js +2 -360
- package/lib/retail/content.js.map +1 -1
- package/lib/retail/inputs.d.ts +1 -1
- package/lib/retail/inputs.js +2 -1
- package/lib/retail/inputs.js.map +1 -1
- package/lib/retail/model/LeadFormState.d.ts +4 -2
- package/lib/retail/model/NameFieldDef.d.ts +1 -1
- package/lib/retail/model/ReferalData.d.ts +0 -1
- package/lib/retail/utils/getMainFormStateMap.d.ts +2 -0
- package/lib/retail/utils/{mainFormStateMap.js → getMainFormStateMap.js} +4 -3
- package/lib/retail/utils/getMainFormStateMap.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +501 -333
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +4 -5
- package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +6 -0
- package/mobile/bundle/components/CreditCardForm/getCreditCardFormTaskData.d.ts +1 -3
- package/mobile/bundle/components/DebitForm/getDebitCardFormTaskData.d.ts +1 -3
- package/mobile/bundle/retail/adaptors/getCreditFormTaskData.d.ts +1 -3
- package/mobile/bundle/retail/api/createUserTaskDebit.d.ts +3 -1
- package/mobile/bundle/retail/api/updateUserTask.d.ts +3 -2
- package/mobile/bundle/retail/api/updateUserTaskDebit.d.ts +1 -1
- package/mobile/bundle/retail/components/DraftDialog/parseDraftTask.d.ts +1 -1
- package/mobile/bundle/retail/components/Fields/InitiateBankruptcyFlgField.d.ts +2 -0
- package/mobile/bundle/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +7 -2
- package/mobile/bundle/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -2
- package/mobile/bundle/retail/content.d.ts +2 -8
- package/mobile/bundle/retail/inputs.d.ts +1 -1
- package/mobile/bundle/retail/model/LeadFormState.d.ts +4 -2
- package/mobile/bundle/retail/model/NameFieldDef.d.ts +1 -1
- package/mobile/bundle/retail/model/ReferalData.d.ts +0 -1
- package/mobile/bundle/retail/utils/getMainFormStateMap.d.ts +2 -0
- package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js +0 -1
- package/mobile/dist/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/consents.js +0 -4
- package/mobile/dist/components/ApplicationLeadForm/consents.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +4 -5
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +20 -17
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +12 -11
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +6 -0
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +20 -12
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/creditCardFormStepsData.js +245 -3
- package/mobile/dist/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/formStateMap.js +2 -2
- package/mobile/dist/components/CreditCardForm/formStateMap.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/getCreditCardFormTaskData.d.ts +1 -3
- package/mobile/dist/components/CreditCardForm/getCreditCardFormTaskData.js +24 -30
- package/mobile/dist/components/CreditCardForm/getCreditCardFormTaskData.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js +0 -2
- package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditForm.js +1 -2
- package/mobile/dist/components/CreditForm/CreditForm.js.map +1 -1
- package/mobile/dist/components/CreditForm/creditFormStepsData.js +192 -3
- package/mobile/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/mobile/dist/components/CreditForm/formStateMap.js +2 -2
- package/mobile/dist/components/CreditForm/formStateMap.js.map +1 -1
- package/mobile/dist/components/CreditForm/useCreditFormAPI.js +1 -3
- package/mobile/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/mobile/dist/components/DebitForm/DebitFormStepsData.js +71 -3
- package/mobile/dist/components/DebitForm/DebitFormStepsData.js.map +1 -1
- package/mobile/dist/components/DebitForm/getDebitCardFormTaskData.d.ts +1 -3
- package/mobile/dist/components/DebitForm/getDebitCardFormTaskData.js +16 -22
- package/mobile/dist/components/DebitForm/getDebitCardFormTaskData.js.map +1 -1
- package/mobile/dist/components/DebitForm/useDebitFormAPI.js +0 -2
- package/mobile/dist/components/DebitForm/useDebitFormAPI.js.map +1 -1
- package/mobile/dist/retail/adaptors/getCreditFormTaskData.d.ts +1 -3
- package/mobile/dist/retail/adaptors/getCreditFormTaskData.js +24 -33
- package/mobile/dist/retail/adaptors/getCreditFormTaskData.js.map +1 -1
- package/mobile/dist/retail/adaptors/getEmploymentData.js +3 -3
- package/mobile/dist/retail/adaptors/getEmploymentData.js.map +1 -1
- package/mobile/dist/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -1
- package/mobile/dist/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
- package/mobile/dist/retail/adaptors/getPersonalInfoData.js +4 -2
- package/mobile/dist/retail/adaptors/getPersonalInfoData.js.map +1 -1
- package/mobile/dist/retail/api/checkCode.js +1 -1
- package/mobile/dist/retail/api/checkCode.js.map +1 -1
- package/mobile/dist/retail/api/createUserTaskDebit.d.ts +3 -1
- package/mobile/dist/retail/api/createUserTaskDebit.js.map +1 -1
- package/mobile/dist/retail/api/updateUserTask.d.ts +3 -2
- package/mobile/dist/retail/api/updateUserTask.js.map +1 -1
- package/mobile/dist/retail/api/updateUserTaskDebit.d.ts +1 -1
- package/mobile/dist/retail/components/DraftDialog/DraftDialog.js +1 -2
- package/mobile/dist/retail/components/DraftDialog/DraftDialog.js.map +1 -1
- package/mobile/dist/retail/components/DraftDialog/parseDraftTask.d.ts +1 -1
- package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js +2 -3
- package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/mobile/dist/retail/components/Fields/DaDataInnField.js +10 -3
- package/mobile/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/InitiateBankruptcyFlgField.d.ts +2 -0
- package/mobile/dist/retail/components/Fields/InitiateBankruptcyFlgField.js +7 -0
- package/mobile/dist/retail/components/Fields/InitiateBankruptcyFlgField.js.map +1 -0
- package/mobile/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +7 -2
- package/mobile/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +19 -10
- package/mobile/dist/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
- package/mobile/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -2
- package/mobile/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +21 -10
- package/mobile/dist/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/mobile/dist/retail/content.d.ts +2 -8
- package/mobile/dist/retail/content.js +3 -361
- package/mobile/dist/retail/content.js.map +1 -1
- package/mobile/dist/retail/inputs.d.ts +1 -1
- package/mobile/dist/retail/inputs.js +2 -1
- package/mobile/dist/retail/inputs.js.map +1 -1
- package/mobile/dist/retail/model/LeadFormState.d.ts +4 -2
- package/mobile/dist/retail/model/NameFieldDef.d.ts +1 -1
- package/mobile/dist/retail/model/ReferalData.d.ts +0 -1
- package/mobile/dist/retail/utils/getMainFormStateMap.d.ts +2 -0
- package/mobile/{lib/retail/utils/mainFormStateMap.js → dist/retail/utils/getMainFormStateMap.js} +7 -3
- package/mobile/dist/retail/utils/getMainFormStateMap.js.map +1 -0
- package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js +0 -1
- package/mobile/lib/components/ApplicationLeadForm/applicationFormData.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/consents.js +0 -4
- package/mobile/lib/components/ApplicationLeadForm/consents.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +4 -5
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +20 -17
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +12 -11
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +6 -0
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +20 -12
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/creditCardFormStepsData.js +244 -2
- package/mobile/lib/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/formStateMap.js +2 -2
- package/mobile/lib/components/CreditCardForm/formStateMap.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/getCreditCardFormTaskData.d.ts +1 -3
- package/mobile/lib/components/CreditCardForm/getCreditCardFormTaskData.js +24 -30
- package/mobile/lib/components/CreditCardForm/getCreditCardFormTaskData.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js +0 -2
- package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditForm.js +1 -2
- package/mobile/lib/components/CreditForm/CreditForm.js.map +1 -1
- package/mobile/lib/components/CreditForm/creditFormStepsData.js +191 -2
- package/mobile/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/mobile/lib/components/CreditForm/formStateMap.js +2 -2
- package/mobile/lib/components/CreditForm/formStateMap.js.map +1 -1
- package/mobile/lib/components/CreditForm/useCreditFormAPI.js +1 -3
- package/mobile/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/mobile/lib/components/DebitForm/DebitFormStepsData.js +70 -2
- package/mobile/lib/components/DebitForm/DebitFormStepsData.js.map +1 -1
- package/mobile/lib/components/DebitForm/getDebitCardFormTaskData.d.ts +1 -3
- package/mobile/lib/components/DebitForm/getDebitCardFormTaskData.js +16 -22
- package/mobile/lib/components/DebitForm/getDebitCardFormTaskData.js.map +1 -1
- package/mobile/lib/components/DebitForm/useDebitFormAPI.js +0 -2
- package/mobile/lib/components/DebitForm/useDebitFormAPI.js.map +1 -1
- package/mobile/lib/retail/adaptors/getCreditFormTaskData.d.ts +1 -3
- package/mobile/lib/retail/adaptors/getCreditFormTaskData.js +24 -33
- package/mobile/lib/retail/adaptors/getCreditFormTaskData.js.map +1 -1
- package/mobile/lib/retail/adaptors/getEmploymentData.js +3 -3
- package/mobile/lib/retail/adaptors/getEmploymentData.js.map +1 -1
- package/mobile/lib/retail/adaptors/getFamilyStatusAndIncomeData.js +2 -1
- package/mobile/lib/retail/adaptors/getFamilyStatusAndIncomeData.js.map +1 -1
- package/mobile/lib/retail/adaptors/getPersonalInfoData.js +4 -2
- package/mobile/lib/retail/adaptors/getPersonalInfoData.js.map +1 -1
- package/mobile/lib/retail/api/checkCode.js +1 -1
- package/mobile/lib/retail/api/checkCode.js.map +1 -1
- package/mobile/lib/retail/api/createUserTaskDebit.d.ts +3 -1
- package/mobile/lib/retail/api/createUserTaskDebit.js.map +1 -1
- package/mobile/lib/retail/api/updateUserTask.d.ts +3 -2
- package/mobile/lib/retail/api/updateUserTask.js.map +1 -1
- package/mobile/lib/retail/api/updateUserTaskDebit.d.ts +1 -1
- package/mobile/lib/retail/components/DraftDialog/DraftDialog.js +1 -2
- package/mobile/lib/retail/components/DraftDialog/DraftDialog.js.map +1 -1
- package/mobile/lib/retail/components/DraftDialog/parseDraftTask.d.ts +1 -1
- package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js +2 -3
- package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/mobile/lib/retail/components/Fields/DaDataInnField.js +10 -3
- package/mobile/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/InitiateBankruptcyFlgField.d.ts +2 -0
- package/mobile/lib/retail/components/Fields/InitiateBankruptcyFlgField.js +5 -0
- package/mobile/lib/retail/components/Fields/InitiateBankruptcyFlgField.js.map +1 -0
- package/mobile/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.d.ts +7 -2
- package/mobile/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js +18 -9
- package/mobile/lib/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
- package/mobile/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.d.ts +1 -2
- package/mobile/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js +21 -10
- package/mobile/lib/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.js.map +1 -1
- package/mobile/lib/retail/content.d.ts +2 -8
- package/mobile/lib/retail/content.js +2 -360
- package/mobile/lib/retail/content.js.map +1 -1
- package/mobile/lib/retail/inputs.d.ts +1 -1
- package/mobile/lib/retail/inputs.js +2 -1
- package/mobile/lib/retail/inputs.js.map +1 -1
- package/mobile/lib/retail/model/LeadFormState.d.ts +4 -2
- package/mobile/lib/retail/model/NameFieldDef.d.ts +1 -1
- package/mobile/lib/retail/model/ReferalData.d.ts +0 -1
- package/mobile/lib/retail/utils/getMainFormStateMap.d.ts +2 -0
- package/mobile/{dist/retail/utils/mainFormStateMap.js → lib/retail/utils/getMainFormStateMap.js} +4 -5
- package/mobile/lib/retail/utils/getMainFormStateMap.js.map +1 -0
- package/mobile/src/components/ApplicationLeadForm/applicationFormData.tsx +0 -1
- package/mobile/src/components/ApplicationLeadForm/consents.ts +0 -4
- package/mobile/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +22 -20
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +15 -11
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +31 -12
- package/mobile/src/components/CreditCardForm/creditCardFormStepsData.tsx +246 -6
- package/mobile/src/components/CreditCardForm/formStateMap.tsx +2 -2
- package/mobile/src/components/CreditCardForm/getCreditCardFormTaskData.ts +24 -34
- package/mobile/src/components/CreditCardForm/useCreditCardFormAPI.tsx +0 -2
- package/mobile/src/components/CreditForm/CreditForm.tsx +1 -2
- package/mobile/src/components/CreditForm/creditFormStepsData.tsx +194 -6
- package/mobile/src/components/CreditForm/formStateMap.tsx +2 -2
- package/mobile/src/components/CreditForm/useCreditFormAPI.tsx +1 -3
- package/mobile/src/components/DebitForm/DebitFormStepsData.tsx +71 -6
- package/mobile/src/components/DebitForm/getDebitCardFormTaskData.ts +16 -26
- package/mobile/src/components/DebitForm/useDebitFormAPI.tsx +0 -2
- package/mobile/src/retail/adaptors/getCreditFormTaskData.ts +26 -39
- package/mobile/src/retail/adaptors/getEmploymentData.tsx +3 -3
- package/mobile/src/retail/adaptors/getFamilyStatusAndIncomeData.ts +2 -0
- package/mobile/src/retail/adaptors/getPersonalInfoData.tsx +4 -2
- package/mobile/src/retail/api/checkCode.ts +1 -1
- package/mobile/src/retail/api/createUserTaskDebit.ts +3 -1
- package/mobile/src/retail/api/updateUserTask.ts +3 -2
- package/mobile/src/retail/api/updateUserTaskDebit.ts +1 -1
- package/mobile/src/retail/components/DraftDialog/DraftDialog.tsx +1 -2
- package/mobile/src/retail/components/DraftDialog/parseDraftTask.ts +2 -5
- package/mobile/src/retail/components/Fields/DaDataInnField.tsx +14 -6
- package/mobile/src/retail/components/Fields/InitiateBankruptcyFlgField.tsx +10 -0
- package/mobile/src/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.tsx +31 -27
- package/mobile/src/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +22 -10
- package/mobile/src/retail/content.tsx +3 -362
- package/mobile/src/retail/inputs.tsx +2 -1
- package/mobile/src/retail/model/LeadFormState.ts +4 -2
- package/mobile/src/retail/model/NameFieldDef.ts +1 -0
- package/mobile/src/retail/model/ReferalData.ts +0 -1
- package/mobile/src/retail/utils/{mainFormStateMap.ts → getMainFormStateMap.ts} +3 -2
- package/package.json +1 -1
- package/src/components/ApplicationLeadForm/applicationFormData.tsx +0 -1
- package/src/components/ApplicationLeadForm/consents.ts +0 -4
- package/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +22 -20
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +15 -11
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +31 -12
- package/src/components/CreditCardForm/creditCardFormStepsData.tsx +246 -6
- package/src/components/CreditCardForm/formStateMap.tsx +2 -2
- package/src/components/CreditCardForm/getCreditCardFormTaskData.ts +24 -34
- package/src/components/CreditCardForm/useCreditCardFormAPI.tsx +0 -2
- package/src/components/CreditForm/CreditForm.tsx +1 -2
- package/src/components/CreditForm/creditFormStepsData.tsx +194 -6
- package/src/components/CreditForm/formStateMap.tsx +2 -2
- package/src/components/CreditForm/useCreditFormAPI.tsx +1 -3
- package/src/components/DebitForm/DebitFormStepsData.tsx +71 -6
- package/src/components/DebitForm/getDebitCardFormTaskData.ts +16 -26
- package/src/components/DebitForm/useDebitFormAPI.tsx +0 -2
- package/src/retail/adaptors/getCreditFormTaskData.ts +26 -39
- package/src/retail/adaptors/getEmploymentData.tsx +3 -3
- package/src/retail/adaptors/getFamilyStatusAndIncomeData.ts +2 -0
- package/src/retail/adaptors/getPersonalInfoData.tsx +4 -2
- package/src/retail/api/checkCode.ts +1 -1
- package/src/retail/api/createUserTaskDebit.ts +3 -1
- package/src/retail/api/updateUserTask.ts +3 -2
- package/src/retail/api/updateUserTaskDebit.ts +1 -1
- package/src/retail/components/DraftDialog/DraftDialog.tsx +1 -2
- package/src/retail/components/DraftDialog/parseDraftTask.ts +2 -5
- package/src/retail/components/Fields/DaDataInnField.tsx +14 -6
- package/src/retail/components/Fields/InitiateBankruptcyFlgField.tsx +10 -0
- package/src/retail/components/VerifyPhoneDialog/VerifyPhoneDialog.tsx +31 -27
- package/src/retail/components/VerifyPhoneDialog/useVerifyPhoneDialogSubmit.tsx +22 -10
- package/src/retail/content.tsx +3 -362
- package/src/retail/inputs.tsx +2 -1
- package/src/retail/model/LeadFormState.ts +4 -2
- package/src/retail/model/NameFieldDef.ts +1 -0
- package/src/retail/model/ReferalData.ts +0 -1
- package/src/retail/utils/{mainFormStateMap.ts → getMainFormStateMap.ts} +3 -2
- package/bundle/retail/utils/mainFormStateMap.d.ts +0 -2
- package/dist/retail/utils/mainFormStateMap.d.ts +0 -2
- package/dist/retail/utils/mainFormStateMap.js.map +0 -1
- package/lib/retail/utils/mainFormStateMap.d.ts +0 -2
- package/lib/retail/utils/mainFormStateMap.js.map +0 -1
- package/mobile/bundle/retail/utils/mainFormStateMap.d.ts +0 -2
- package/mobile/dist/retail/utils/mainFormStateMap.d.ts +0 -2
- package/mobile/dist/retail/utils/mainFormStateMap.js.map +0 -1
- package/mobile/lib/retail/utils/mainFormStateMap.d.ts +0 -2
- package/mobile/lib/retail/utils/mainFormStateMap.js.map +0 -1
|
@@ -17,7 +17,7 @@ export const checkCode = async (body: CheckCodeBody) =>
|
|
|
17
17
|
fetchRetailJSON<CheckCodeResponse>('/sms/checkCode', 'POST', body).then(saveToken);
|
|
18
18
|
|
|
19
19
|
export const saveToken = (data: CheckCodeResponse | null) => {
|
|
20
|
-
if (data) {
|
|
20
|
+
if (data?.access_token && data?.refresh_token) {
|
|
21
21
|
globalThis.sessionStorage.setItem('accessToken', data.access_token);
|
|
22
22
|
globalThis.sessionStorage.setItem('refreshToken', data.refresh_token);
|
|
23
23
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { type Nullable } from '../../utils/Nullable';
|
|
1
2
|
import { fetchRetailJSON } from './doRequest';
|
|
2
|
-
import { type Participant } from './updateUserTask';
|
|
3
|
+
import { type MarketingInfo, type Participant } from './updateUserTask';
|
|
3
4
|
|
|
4
5
|
export type CreateUserTaskDebitBody = {
|
|
5
6
|
task: {
|
|
@@ -8,6 +9,7 @@ export type CreateUserTaskDebitBody = {
|
|
|
8
9
|
code: string;
|
|
9
10
|
};
|
|
10
11
|
participants: Participant[];
|
|
12
|
+
marketingInfo?: Nullable<MarketingInfo>;
|
|
11
13
|
};
|
|
12
14
|
};
|
|
13
15
|
|
|
@@ -125,13 +125,14 @@ export type MarketingInfo = {
|
|
|
125
125
|
utm_source?: Nullable<string>;
|
|
126
126
|
utm_content?: Nullable<string>;
|
|
127
127
|
utm_term?: Nullable<string>;
|
|
128
|
+
bannerId?: Nullable<string>;
|
|
128
129
|
};
|
|
129
130
|
|
|
130
131
|
export type UpdateUserTaskBody = {
|
|
131
132
|
sendToBank: boolean;
|
|
132
133
|
taskKind: 'SHORT' | 'FULL' | 'UNITED';
|
|
133
134
|
task: {
|
|
134
|
-
taskSource
|
|
135
|
+
taskSource?: string;
|
|
135
136
|
id: number;
|
|
136
137
|
office?: {
|
|
137
138
|
id: string;
|
|
@@ -149,7 +150,7 @@ export type UpdateUserTaskBody = {
|
|
|
149
150
|
loanAmount?: number;
|
|
150
151
|
creditPeriod?: number;
|
|
151
152
|
paymentTypeCd?: PaymentType;
|
|
152
|
-
marketingInfo?: MarketingInfo
|
|
153
|
+
marketingInfo?: Nullable<MarketingInfo>;
|
|
153
154
|
files?: File[];
|
|
154
155
|
};
|
|
155
156
|
};
|
|
@@ -46,13 +46,12 @@ export const DraftDialog = JSX<DraftDialogProps>(function ({
|
|
|
46
46
|
const { id: participantId, profile } = participants[0];
|
|
47
47
|
|
|
48
48
|
const handleGoToDraft = useCallback(() => {
|
|
49
|
-
const
|
|
49
|
+
const taskFromDraft = parseDraftTask(task);
|
|
50
50
|
retailFormStore.participantId = participantId ?? null;
|
|
51
51
|
retailFormStore.taskId = taskId;
|
|
52
52
|
retailFormStore.profileId = profile?.id ?? null;
|
|
53
53
|
retailFormStore.programId = programmId;
|
|
54
54
|
retailFormStore.leadForm = taskFromDraft;
|
|
55
|
-
retailFormStore.referalData = { isTaskWithReferalCode };
|
|
56
55
|
|
|
57
56
|
if (profile?.id) {
|
|
58
57
|
sendAspects(profile.id, taskId);
|
|
@@ -11,14 +11,13 @@ import {
|
|
|
11
11
|
INCOME_CERTIFICATE,
|
|
12
12
|
} from './utils';
|
|
13
13
|
|
|
14
|
-
export const parseDraftTask = (task: Task):
|
|
14
|
+
export const parseDraftTask = (task: Task): LeadFormState => {
|
|
15
15
|
const participant = task.participants[0];
|
|
16
16
|
const {
|
|
17
17
|
classCard: cardCategory,
|
|
18
18
|
codeWord,
|
|
19
19
|
paymentSystemTypeCd: paymentSystem,
|
|
20
20
|
currencyCode: currency,
|
|
21
|
-
taskSource,
|
|
22
21
|
} = task;
|
|
23
22
|
|
|
24
23
|
const { loanAmount: moneyValue, creditPeriod: monthsValue, paymentTypeCd } = task;
|
|
@@ -72,7 +71,7 @@ export const parseDraftTask = (task: Task): [LeadFormState, boolean] => {
|
|
|
72
71
|
profile,
|
|
73
72
|
} = participant;
|
|
74
73
|
|
|
75
|
-
|
|
74
|
+
return {
|
|
76
75
|
currency: currency?.key,
|
|
77
76
|
paymentSystem: getSelectValue(paymentSystem),
|
|
78
77
|
cardCategory: getSelectValue(cardCategory),
|
|
@@ -129,6 +128,4 @@ export const parseDraftTask = (task: Task): [LeadFormState, boolean] => {
|
|
|
129
128
|
...getParticipantContacts(participantContacts),
|
|
130
129
|
...getParticipantGender(genderCd),
|
|
131
130
|
};
|
|
132
|
-
|
|
133
|
-
return [taskFromDraft, taskSource === 'ReferalSF'];
|
|
134
131
|
};
|
|
@@ -3,7 +3,7 @@ import { useCallback, useEffect } from '@redneckz/uni-jsx/lib/hooks';
|
|
|
3
3
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
4
4
|
import { type DaDataSuggestion } from '../../api/dadataHints/dadataHintsType';
|
|
5
5
|
import { getOrganizationFromInn } from '../../api/getOrganizationFromInn';
|
|
6
|
-
import { useRetailFormStore } from '../../hooks/useRetailFormStore';
|
|
6
|
+
import { useRetailFormStore, type CreditFormStoreSlice } from '../../hooks/useRetailFormStore';
|
|
7
7
|
import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
|
|
8
8
|
import { updateOrganizationFields } from '../../utils/updateOrganizationFields';
|
|
9
9
|
import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
|
|
@@ -19,11 +19,7 @@ export const DaDataInnField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
|
19
19
|
}, []);
|
|
20
20
|
|
|
21
21
|
useEffect(() => {
|
|
22
|
-
if (
|
|
23
|
-
!esiaAccountTypeCd ||
|
|
24
|
-
!inn ||
|
|
25
|
-
!(employerActivities && employerOrganization && organization && amountWorkers)
|
|
26
|
-
) {
|
|
22
|
+
if (!esiaAccountTypeCd || !inn || !isDictionariesAlreadyLoad(store as CreditFormStoreSlice)) {
|
|
27
23
|
return;
|
|
28
24
|
}
|
|
29
25
|
(async () => {
|
|
@@ -46,3 +42,15 @@ export const DaDataInnField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
|
46
42
|
/>
|
|
47
43
|
);
|
|
48
44
|
});
|
|
45
|
+
|
|
46
|
+
const isDictionariesAlreadyLoad = (store: CreditFormStoreSlice) => {
|
|
47
|
+
const { employerActivities, employerOrganization, organization, amountWorkers, productType } =
|
|
48
|
+
store;
|
|
49
|
+
|
|
50
|
+
return [
|
|
51
|
+
employerOrganization,
|
|
52
|
+
organization,
|
|
53
|
+
amountWorkers,
|
|
54
|
+
productType === 'creditCard' ? employerActivities : true,
|
|
55
|
+
].every(Boolean);
|
|
56
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { CheckboxWithError } from '../../../ui-kit/Checkbox/CheckboxWithError';
|
|
3
|
+
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
4
|
+
|
|
5
|
+
export const InitiateBankruptcyFlgField = JSX<CustomFieldProps>(({ field, input }) => (
|
|
6
|
+
<CheckboxWithError
|
|
7
|
+
text="Я планирую в ближайшее время инициировать дело о банкротстве в отношении себя"
|
|
8
|
+
{...field(input?.name ?? '')}
|
|
9
|
+
/>
|
|
10
|
+
));
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
3
|
import { useCallback, useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
4
4
|
|
|
5
|
+
import { useSessionStore } from '@redneckz/uni-jsx/lib/Store/useSessionStore';
|
|
5
6
|
import { Headline } from '../../../components/Headline/Headline';
|
|
6
7
|
import type { OnCloseProps } from '../../../model/OnCloseProps';
|
|
7
8
|
import { Button } from '../../../ui-kit/Button/Button';
|
|
@@ -20,26 +21,27 @@ import { InputCode } from './InputCode';
|
|
|
20
21
|
import { SubmitButton } from './SubmitButton';
|
|
21
22
|
import { useVerifyPhoneDialogSubmit } from './useVerifyPhoneDialogSubmit';
|
|
22
23
|
|
|
24
|
+
export const TIME_TO_RESEND = 180;
|
|
25
|
+
const CODE_LENGTH = 4;
|
|
26
|
+
|
|
23
27
|
export interface VerifyPhoneDialogProps extends OnCloseProps {
|
|
24
28
|
phone: string;
|
|
25
|
-
code?: boolean;
|
|
26
29
|
withDescription?: boolean;
|
|
27
|
-
codeLength?: number;
|
|
28
30
|
consents?: string[];
|
|
29
31
|
onSuccess?: (smsCode?: string) => void;
|
|
30
32
|
}
|
|
31
33
|
|
|
34
|
+
export interface SmsCodeStore {
|
|
35
|
+
smsCode: {
|
|
36
|
+
sendTime?: number;
|
|
37
|
+
attempts?: number;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
32
41
|
export const VerifyPhoneDialog = JSX<VerifyPhoneDialogProps>(
|
|
33
|
-
({
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
withDescription = true,
|
|
37
|
-
codeLength = 4,
|
|
38
|
-
consents,
|
|
39
|
-
onSuccess = noop,
|
|
40
|
-
onClose = noop,
|
|
41
|
-
}) => {
|
|
42
|
-
const [values, setValues] = useState(Array(codeLength).fill(''));
|
|
42
|
+
({ phone, withDescription = true, consents, onSuccess = noop, onClose = noop }) => {
|
|
43
|
+
const [values, setValues] = useState(Array(CODE_LENGTH).fill(''));
|
|
44
|
+
const sessionStore = useSessionStore<SmsCodeStore>();
|
|
43
45
|
|
|
44
46
|
const {
|
|
45
47
|
handleSubmit,
|
|
@@ -49,8 +51,7 @@ export const VerifyPhoneDialog = JSX<VerifyPhoneDialogProps>(
|
|
|
49
51
|
timeNextReq,
|
|
50
52
|
isSubmitButtonDisabled,
|
|
51
53
|
setTimeNextReq,
|
|
52
|
-
|
|
53
|
-
setAttempts,
|
|
54
|
+
setErrorText,
|
|
54
55
|
} = useVerifyPhoneDialogSubmit({ values, onSuccess });
|
|
55
56
|
|
|
56
57
|
const captchaDialog = useDialog(CaptchaDialog);
|
|
@@ -66,17 +67,22 @@ export const VerifyPhoneDialog = JSX<VerifyPhoneDialogProps>(
|
|
|
66
67
|
});
|
|
67
68
|
|
|
68
69
|
if (isSuccessSendCode) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
setTimeNextReq(TIME_TO_RESEND);
|
|
71
|
+
restartTimer(TIME_TO_RESEND);
|
|
72
|
+
setErrorText('');
|
|
73
|
+
sessionStore.smsCode = {
|
|
74
|
+
sendTime: Date.now(),
|
|
75
|
+
attempts: 0,
|
|
76
|
+
};
|
|
73
77
|
} else {
|
|
74
78
|
captchaDialog.open({ phoneNumber, sendCode: handleSendCode });
|
|
75
79
|
}
|
|
76
80
|
}, [phoneNumber, restartTimer, onClose]);
|
|
77
81
|
|
|
78
82
|
useEffect(() => {
|
|
79
|
-
|
|
83
|
+
if (!sessionStore.smsCode?.sendTime) {
|
|
84
|
+
handleSendCode();
|
|
85
|
+
}
|
|
80
86
|
}, []);
|
|
81
87
|
|
|
82
88
|
return (
|
|
@@ -93,14 +99,12 @@ export const VerifyPhoneDialog = JSX<VerifyPhoneDialogProps>(
|
|
|
93
99
|
isEmbedded={true}
|
|
94
100
|
as="h6"
|
|
95
101
|
/>
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
/>
|
|
103
|
-
) : null}
|
|
102
|
+
<InputCode
|
|
103
|
+
values={values}
|
|
104
|
+
setValues={setValues}
|
|
105
|
+
errorText={errorText}
|
|
106
|
+
hasError={hasError}
|
|
107
|
+
/>
|
|
104
108
|
{renderText(timeNextReq, handleSendCode)}
|
|
105
109
|
|
|
106
110
|
{withDescription ? (
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { useCallback, useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
2
|
import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
|
|
3
|
+
import { useSessionStore } from '@redneckz/uni-jsx/lib/Store/useSessionStore';
|
|
3
4
|
import { checkCode } from '../../api/checkCode';
|
|
5
|
+
import { TIME_TO_RESEND, type SmsCodeStore } from './VerifyPhoneDialog';
|
|
4
6
|
|
|
5
7
|
type useVerifyPhoneDialogSubmitProps = {
|
|
6
8
|
values: string[];
|
|
@@ -11,28 +13,33 @@ export const useVerifyPhoneDialogSubmit = ({
|
|
|
11
13
|
values,
|
|
12
14
|
onSuccess,
|
|
13
15
|
}: useVerifyPhoneDialogSubmitProps) => {
|
|
16
|
+
const sessionStore = useSessionStore<SmsCodeStore>();
|
|
17
|
+
const attempts = sessionStore.smsCode?.attempts || 0;
|
|
18
|
+
const timer = Math.max(getTimer(sessionStore.smsCode?.sendTime || Date.now()), 0);
|
|
19
|
+
|
|
14
20
|
const [errorText, setErrorText] = useState('');
|
|
15
21
|
const [isLoading, { setTrue: startLoading, setFalse: endLoading }] = useBool(false);
|
|
16
|
-
const [timeNextReq, setTimeNextReq] = useState(
|
|
17
|
-
const [isTimerStarted, setIsTimerStarted] = useState(false);
|
|
18
|
-
const [attempts, setAttempts] = useState(0);
|
|
22
|
+
const [timeNextReq, setTimeNextReq] = useState(timer);
|
|
19
23
|
|
|
20
24
|
const resetError = useCallback(() => setErrorText(''), []);
|
|
21
25
|
|
|
22
|
-
const isTimeExpired = Boolean(timeNextReq === 0 &&
|
|
26
|
+
const isTimeExpired = Boolean(timeNextReq === 0 && sessionStore.smsCode?.sendTime);
|
|
23
27
|
const isSubmitButtonDisabled = attempts > 2 || isTimeExpired || !values.every(Boolean);
|
|
24
28
|
|
|
25
29
|
const handleSubmit = useCallback(async () => {
|
|
26
30
|
try {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
sessionStore.smsCode = {
|
|
32
|
+
...sessionStore.smsCode,
|
|
33
|
+
attempts: attempts + 1,
|
|
34
|
+
};
|
|
30
35
|
startLoading();
|
|
31
36
|
await checkCode({
|
|
32
37
|
smsText: values.join(''),
|
|
33
38
|
smsCodesSetName: { key: 'AUTHENTICATION' },
|
|
34
39
|
});
|
|
40
|
+
setTimeNextReq(0);
|
|
35
41
|
resetError();
|
|
42
|
+
sessionStore.smsCode = null;
|
|
36
43
|
await onSuccess?.(values.join(''));
|
|
37
44
|
} catch {
|
|
38
45
|
setErrorText(attempts > 1 ? 'Исчерпан лимит ввода смс-кода' : 'Неверный код');
|
|
@@ -42,7 +49,11 @@ export const useVerifyPhoneDialogSubmit = ({
|
|
|
42
49
|
}, [values, attempts]);
|
|
43
50
|
|
|
44
51
|
useEffect(() => {
|
|
45
|
-
|
|
52
|
+
if (isTimeExpired) {
|
|
53
|
+
setErrorText('Код просрочен');
|
|
54
|
+
} else if (attempts > 2) {
|
|
55
|
+
setErrorText('Исчерпан лимит ввода смс-кода');
|
|
56
|
+
}
|
|
46
57
|
}, [isTimeExpired]);
|
|
47
58
|
|
|
48
59
|
return {
|
|
@@ -53,7 +64,8 @@ export const useVerifyPhoneDialogSubmit = ({
|
|
|
53
64
|
timeNextReq,
|
|
54
65
|
isSubmitButtonDisabled,
|
|
55
66
|
setTimeNextReq,
|
|
56
|
-
|
|
57
|
-
setAttempts,
|
|
67
|
+
setErrorText,
|
|
58
68
|
};
|
|
59
69
|
};
|
|
70
|
+
|
|
71
|
+
const getTimer = (sendTime: number) => TIME_TO_RESEND - Math.floor((Date.now() - sendTime) / 1000);
|