@redneckz/wildless-cms-uni-blocks 0.14.917 → 0.14.919
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 +440 -367
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/retail/api/getDictionaries.d.ts +2 -0
- package/bundle/retail/components/Fields/BankEmployeeCodeField.d.ts +3 -1
- package/bundle/retail/hooks/useIFrameMode.d.ts +4 -0
- package/bundle/retail/model/LeadFormState.d.ts +1 -1
- package/bundle/retail/model/NameFieldDef.d.ts +1 -1
- package/bundle/retail/utils/getOrganizationParams.d.ts +6 -0
- package/bundle/retail/validator/validators.d.ts +2 -0
- package/bundle/ui-kit/FormField/validators.d.ts +1 -0
- package/bundle/utils/isIFrame.d.ts +1 -0
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -0
- package/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +8 -3
- package/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
- package/dist/components/ContentPage/ContentPage.js +5 -2
- package/dist/components/ContentPage/ContentPage.js.map +1 -1
- package/dist/components/CreditCardForm/CreditCardFormStep.js +2 -0
- package/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/dist/components/CreditCardForm/creditCardFormStepsData.js +21 -18
- package/dist/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
- package/dist/components/CreditCardForm/formStateMap.js +6 -0
- package/dist/components/CreditCardForm/formStateMap.js.map +1 -1
- package/dist/components/CreditForm/CreditFormStep.js +2 -0
- package/dist/components/CreditForm/CreditFormStep.js.map +1 -1
- package/dist/components/CreditForm/creditFormStepsData.js +14 -17
- package/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/dist/components/DebitForm/DebitFormStep.js +2 -0
- package/dist/components/DebitForm/DebitFormStep.js.map +1 -1
- package/dist/retail/adaptors/getPersonalInfoData.js +1 -9
- package/dist/retail/adaptors/getPersonalInfoData.js.map +1 -1
- package/dist/retail/api/getDictionaries.d.ts +2 -0
- package/dist/retail/api/getDictionaries.js +13 -0
- package/dist/retail/api/getDictionaries.js.map +1 -0
- package/dist/retail/components/DraftDialog/parseDraftTask.js +1 -0
- package/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/dist/retail/components/Fields/AmountWorkersField.js +0 -8
- package/dist/retail/components/Fields/AmountWorkersField.js.map +1 -1
- package/dist/retail/components/Fields/BankEmployeeCodeField.d.ts +3 -1
- package/dist/retail/components/Fields/BankEmployeeCodeField.js +17 -2
- package/dist/retail/components/Fields/BankEmployeeCodeField.js.map +1 -1
- package/dist/retail/components/Fields/DaDataInnField.js +21 -8
- package/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
- package/dist/retail/components/Fields/EmployerActivitiesField.js +0 -8
- package/dist/retail/components/Fields/EmployerActivitiesField.js.map +1 -1
- package/dist/retail/components/Fields/EmployerOrganizationField.js +0 -8
- package/dist/retail/components/Fields/EmployerOrganizationField.js.map +1 -1
- package/dist/retail/components/Fields/OrganizationField.js +0 -8
- package/dist/retail/components/Fields/OrganizationField.js.map +1 -1
- package/dist/retail/components/Fields/OrganizationNameField.js +12 -2
- package/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
- package/dist/retail/content.js +4 -11
- package/dist/retail/content.js.map +1 -1
- package/dist/retail/hooks/useIFrameMode.d.ts +4 -0
- package/dist/retail/hooks/useIFrameMode.js +39 -0
- package/dist/retail/hooks/useIFrameMode.js.map +1 -0
- package/dist/retail/inputs.js +1 -1
- package/dist/retail/inputs.js.map +1 -1
- package/dist/retail/model/LeadFormState.d.ts +1 -1
- package/dist/retail/model/NameFieldDef.d.ts +1 -1
- package/dist/retail/utils/getMainFormStateMap.js +1 -6
- package/dist/retail/utils/getMainFormStateMap.js.map +1 -1
- package/dist/retail/utils/getOrganizationParams.d.ts +6 -0
- package/dist/retail/utils/getOrganizationParams.js +7 -1
- package/dist/retail/utils/getOrganizationParams.js.map +1 -1
- package/dist/retail/utils/updateOrganizationFields.js +2 -0
- package/dist/retail/utils/updateOrganizationFields.js.map +1 -1
- package/dist/retail/validator/getRetailFormValidator.js +2 -0
- package/dist/retail/validator/getRetailFormValidator.js.map +1 -1
- package/dist/retail/validator/validators.d.ts +2 -0
- package/dist/retail/validator/validators.js +6 -1
- package/dist/retail/validator/validators.js.map +1 -1
- package/dist/ui-kit/DatePicker/DatePickerInput.js +1 -1
- package/dist/ui-kit/DatePicker/DatePickerInput.js.map +1 -1
- package/dist/ui-kit/FormField/validators.d.ts +1 -0
- package/dist/ui-kit/FormField/validators.js +4 -3
- package/dist/ui-kit/FormField/validators.js.map +1 -1
- package/dist/ui-kit/TabsControl/TabItemInner.js +1 -1
- package/dist/ui-kit/TabsControl/TabItemInner.js.map +1 -1
- package/dist/utils/isIFrame.d.ts +1 -0
- package/dist/utils/isIFrame.js +5 -0
- package/dist/utils/isIFrame.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -0
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +8 -3
- package/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
- package/lib/components/ContentPage/ContentPage.js +5 -2
- package/lib/components/ContentPage/ContentPage.js.map +1 -1
- package/lib/components/CreditCardForm/CreditCardFormStep.js +2 -0
- package/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/lib/components/CreditCardForm/creditCardFormStepsData.js +21 -18
- package/lib/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
- package/lib/components/CreditCardForm/formStateMap.js +6 -0
- package/lib/components/CreditCardForm/formStateMap.js.map +1 -1
- package/lib/components/CreditForm/CreditFormStep.js +2 -0
- package/lib/components/CreditForm/CreditFormStep.js.map +1 -1
- package/lib/components/CreditForm/creditFormStepsData.js +14 -17
- package/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/lib/components/DebitForm/DebitFormStep.js +2 -0
- package/lib/components/DebitForm/DebitFormStep.js.map +1 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -1
- package/lib/retail/adaptors/getPersonalInfoData.js +2 -10
- package/lib/retail/adaptors/getPersonalInfoData.js.map +1 -1
- package/lib/retail/api/getDictionaries.d.ts +2 -0
- package/lib/retail/api/getDictionaries.js +10 -0
- package/lib/retail/api/getDictionaries.js.map +1 -0
- package/lib/retail/components/DraftDialog/parseDraftTask.js +1 -0
- package/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/lib/retail/components/Fields/AmountWorkersField.js +0 -8
- package/lib/retail/components/Fields/AmountWorkersField.js.map +1 -1
- package/lib/retail/components/Fields/BankEmployeeCodeField.d.ts +3 -1
- package/lib/retail/components/Fields/BankEmployeeCodeField.js +17 -2
- package/lib/retail/components/Fields/BankEmployeeCodeField.js.map +1 -1
- package/lib/retail/components/Fields/DaDataInnField.js +22 -9
- package/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
- package/lib/retail/components/Fields/EmployerActivitiesField.js +0 -8
- package/lib/retail/components/Fields/EmployerActivitiesField.js.map +1 -1
- package/lib/retail/components/Fields/EmployerOrganizationField.js +0 -8
- package/lib/retail/components/Fields/EmployerOrganizationField.js.map +1 -1
- package/lib/retail/components/Fields/OrganizationField.js +0 -8
- package/lib/retail/components/Fields/OrganizationField.js.map +1 -1
- package/lib/retail/components/Fields/OrganizationNameField.js +13 -3
- package/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
- package/lib/retail/content.js +4 -11
- package/lib/retail/content.js.map +1 -1
- package/lib/retail/hooks/useIFrameMode.d.ts +4 -0
- package/lib/retail/hooks/useIFrameMode.js +36 -0
- package/lib/retail/hooks/useIFrameMode.js.map +1 -0
- package/lib/retail/inputs.js +2 -2
- package/lib/retail/inputs.js.map +1 -1
- package/lib/retail/model/LeadFormState.d.ts +1 -1
- package/lib/retail/model/NameFieldDef.d.ts +1 -1
- package/lib/retail/utils/getMainFormStateMap.js +1 -6
- package/lib/retail/utils/getMainFormStateMap.js.map +1 -1
- package/lib/retail/utils/getOrganizationParams.d.ts +6 -0
- package/lib/retail/utils/getOrganizationParams.js +6 -0
- package/lib/retail/utils/getOrganizationParams.js.map +1 -1
- package/lib/retail/utils/updateOrganizationFields.js +2 -0
- package/lib/retail/utils/updateOrganizationFields.js.map +1 -1
- package/lib/retail/validator/getRetailFormValidator.js +3 -1
- package/lib/retail/validator/getRetailFormValidator.js.map +1 -1
- package/lib/retail/validator/validators.d.ts +2 -0
- package/lib/retail/validator/validators.js +3 -0
- package/lib/retail/validator/validators.js.map +1 -1
- package/lib/ui-kit/DatePicker/DatePickerInput.js +1 -1
- package/lib/ui-kit/DatePicker/DatePickerInput.js.map +1 -1
- package/lib/ui-kit/FormField/validators.d.ts +1 -0
- package/lib/ui-kit/FormField/validators.js +1 -1
- package/lib/ui-kit/FormField/validators.js.map +1 -1
- package/lib/ui-kit/TabsControl/TabItemInner.js +1 -1
- package/lib/ui-kit/TabsControl/TabItemInner.js.map +1 -1
- package/lib/utils/isIFrame.d.ts +1 -0
- package/lib/utils/isIFrame.js +2 -0
- package/lib/utils/isIFrame.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +444 -371
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/retail/api/getDictionaries.d.ts +2 -0
- package/mobile/bundle/retail/components/Fields/BankEmployeeCodeField.d.ts +3 -1
- package/mobile/bundle/retail/hooks/useIFrameMode.d.ts +4 -0
- package/mobile/bundle/retail/model/LeadFormState.d.ts +1 -1
- package/mobile/bundle/retail/model/NameFieldDef.d.ts +1 -1
- package/mobile/bundle/retail/utils/getOrganizationParams.d.ts +6 -0
- package/mobile/bundle/retail/validator/validators.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/validators.d.ts +1 -0
- package/mobile/bundle/utils/isIFrame.d.ts +1 -0
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -0
- package/mobile/dist/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js +8 -3
- package/mobile/dist/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
- package/mobile/dist/components/ContentPage/ContentPage.js +5 -2
- package/mobile/dist/components/ContentPage/ContentPage.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js +2 -0
- package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/creditCardFormStepsData.js +21 -18
- package/mobile/dist/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/formStateMap.js +6 -0
- package/mobile/dist/components/CreditCardForm/formStateMap.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditFormStep.js +2 -0
- package/mobile/dist/components/CreditForm/CreditFormStep.js.map +1 -1
- package/mobile/dist/components/CreditForm/creditFormStepsData.js +14 -17
- package/mobile/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/mobile/dist/components/DebitForm/DebitFormStep.js +2 -0
- package/mobile/dist/components/DebitForm/DebitFormStep.js.map +1 -1
- package/mobile/dist/retail/adaptors/getPersonalInfoData.js +1 -9
- package/mobile/dist/retail/adaptors/getPersonalInfoData.js.map +1 -1
- package/mobile/dist/retail/api/getDictionaries.d.ts +2 -0
- package/mobile/dist/retail/api/getDictionaries.js +13 -0
- package/mobile/dist/retail/api/getDictionaries.js.map +1 -0
- package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js +1 -0
- package/mobile/dist/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/mobile/dist/retail/components/Fields/AmountWorkersField.js +0 -8
- package/mobile/dist/retail/components/Fields/AmountWorkersField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/BankEmployeeCodeField.d.ts +3 -1
- package/mobile/dist/retail/components/Fields/BankEmployeeCodeField.js +17 -2
- package/mobile/dist/retail/components/Fields/BankEmployeeCodeField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/DaDataInnField.js +21 -8
- package/mobile/dist/retail/components/Fields/DaDataInnField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/EmployerActivitiesField.js +0 -8
- package/mobile/dist/retail/components/Fields/EmployerActivitiesField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/EmployerOrganizationField.js +0 -8
- package/mobile/dist/retail/components/Fields/EmployerOrganizationField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/OrganizationField.js +0 -8
- package/mobile/dist/retail/components/Fields/OrganizationField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/OrganizationNameField.js +12 -2
- package/mobile/dist/retail/components/Fields/OrganizationNameField.js.map +1 -1
- package/mobile/dist/retail/content.js +4 -11
- package/mobile/dist/retail/content.js.map +1 -1
- package/mobile/dist/retail/hooks/useIFrameMode.d.ts +4 -0
- package/mobile/dist/retail/hooks/useIFrameMode.js +39 -0
- package/mobile/dist/retail/hooks/useIFrameMode.js.map +1 -0
- package/mobile/dist/retail/inputs.js +1 -1
- package/mobile/dist/retail/inputs.js.map +1 -1
- package/mobile/dist/retail/model/LeadFormState.d.ts +1 -1
- package/mobile/dist/retail/model/NameFieldDef.d.ts +1 -1
- package/mobile/dist/retail/utils/getMainFormStateMap.js +1 -6
- package/mobile/dist/retail/utils/getMainFormStateMap.js.map +1 -1
- package/mobile/dist/retail/utils/getOrganizationParams.d.ts +6 -0
- package/mobile/dist/retail/utils/getOrganizationParams.js +7 -1
- package/mobile/dist/retail/utils/getOrganizationParams.js.map +1 -1
- package/mobile/dist/retail/utils/updateOrganizationFields.js +2 -0
- package/mobile/dist/retail/utils/updateOrganizationFields.js.map +1 -1
- package/mobile/dist/retail/validator/getRetailFormValidator.js +2 -0
- package/mobile/dist/retail/validator/getRetailFormValidator.js.map +1 -1
- package/mobile/dist/retail/validator/validators.d.ts +2 -0
- package/mobile/dist/retail/validator/validators.js +6 -1
- package/mobile/dist/retail/validator/validators.js.map +1 -1
- package/mobile/dist/ui-kit/DatePicker/DatePickerInput.js +1 -1
- package/mobile/dist/ui-kit/DatePicker/DatePickerInput.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/validators.d.ts +1 -0
- package/mobile/dist/ui-kit/FormField/validators.js +4 -3
- package/mobile/dist/ui-kit/FormField/validators.js.map +1 -1
- package/mobile/dist/ui-kit/TabsControl/TabItemInner.js +1 -1
- package/mobile/dist/ui-kit/TabsControl/TabItemInner.js.map +1 -1
- package/mobile/dist/utils/isIFrame.d.ts +1 -0
- package/mobile/dist/utils/isIFrame.js +5 -0
- package/mobile/dist/utils/isIFrame.js.map +1 -0
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js +2 -0
- package/mobile/lib/components/ApplicationLeadForm/ApplicationLeadForm.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js +8 -3
- package/mobile/lib/components/ApplicationLeadForm/EsiaLoginBanner.js.map +1 -1
- package/mobile/lib/components/ContentPage/ContentPage.js +5 -2
- package/mobile/lib/components/ContentPage/ContentPage.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js +2 -0
- package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/creditCardFormStepsData.js +21 -18
- package/mobile/lib/components/CreditCardForm/creditCardFormStepsData.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/formStateMap.js +6 -0
- package/mobile/lib/components/CreditCardForm/formStateMap.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditFormStep.js +2 -0
- package/mobile/lib/components/CreditForm/CreditFormStep.js.map +1 -1
- package/mobile/lib/components/CreditForm/creditFormStepsData.js +14 -17
- package/mobile/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/mobile/lib/components/DebitForm/DebitFormStep.js +2 -0
- package/mobile/lib/components/DebitForm/DebitFormStep.js.map +1 -1
- package/mobile/lib/retail/adaptors/getPersonalInfoData.js +2 -10
- package/mobile/lib/retail/adaptors/getPersonalInfoData.js.map +1 -1
- package/mobile/lib/retail/api/getDictionaries.d.ts +2 -0
- package/mobile/lib/retail/api/getDictionaries.js +10 -0
- package/mobile/lib/retail/api/getDictionaries.js.map +1 -0
- package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js +1 -0
- package/mobile/lib/retail/components/DraftDialog/parseDraftTask.js.map +1 -1
- package/mobile/lib/retail/components/Fields/AmountWorkersField.js +0 -8
- package/mobile/lib/retail/components/Fields/AmountWorkersField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/BankEmployeeCodeField.d.ts +3 -1
- package/mobile/lib/retail/components/Fields/BankEmployeeCodeField.js +17 -2
- package/mobile/lib/retail/components/Fields/BankEmployeeCodeField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/DaDataInnField.js +22 -9
- package/mobile/lib/retail/components/Fields/DaDataInnField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/EmployerActivitiesField.js +0 -8
- package/mobile/lib/retail/components/Fields/EmployerActivitiesField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/EmployerOrganizationField.js +0 -8
- package/mobile/lib/retail/components/Fields/EmployerOrganizationField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/OrganizationField.js +0 -8
- package/mobile/lib/retail/components/Fields/OrganizationField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/OrganizationNameField.js +13 -3
- package/mobile/lib/retail/components/Fields/OrganizationNameField.js.map +1 -1
- package/mobile/lib/retail/content.js +4 -11
- package/mobile/lib/retail/content.js.map +1 -1
- package/mobile/lib/retail/hooks/useIFrameMode.d.ts +4 -0
- package/mobile/lib/retail/hooks/useIFrameMode.js +36 -0
- package/mobile/lib/retail/hooks/useIFrameMode.js.map +1 -0
- package/mobile/lib/retail/inputs.js +2 -2
- package/mobile/lib/retail/inputs.js.map +1 -1
- package/mobile/lib/retail/model/LeadFormState.d.ts +1 -1
- package/mobile/lib/retail/model/NameFieldDef.d.ts +1 -1
- package/mobile/lib/retail/utils/getMainFormStateMap.js +1 -6
- package/mobile/lib/retail/utils/getMainFormStateMap.js.map +1 -1
- package/mobile/lib/retail/utils/getOrganizationParams.d.ts +6 -0
- package/mobile/lib/retail/utils/getOrganizationParams.js +6 -0
- package/mobile/lib/retail/utils/getOrganizationParams.js.map +1 -1
- package/mobile/lib/retail/utils/updateOrganizationFields.js +2 -0
- package/mobile/lib/retail/utils/updateOrganizationFields.js.map +1 -1
- package/mobile/lib/retail/validator/getRetailFormValidator.js +3 -1
- package/mobile/lib/retail/validator/getRetailFormValidator.js.map +1 -1
- package/mobile/lib/retail/validator/validators.d.ts +2 -0
- package/mobile/lib/retail/validator/validators.js +3 -0
- package/mobile/lib/retail/validator/validators.js.map +1 -1
- package/mobile/lib/ui-kit/DatePicker/DatePickerInput.js +1 -1
- package/mobile/lib/ui-kit/DatePicker/DatePickerInput.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/validators.d.ts +1 -0
- package/mobile/lib/ui-kit/FormField/validators.js +1 -1
- package/mobile/lib/ui-kit/FormField/validators.js.map +1 -1
- package/mobile/lib/ui-kit/TabsControl/TabItemInner.js +1 -1
- package/mobile/lib/ui-kit/TabsControl/TabItemInner.js.map +1 -1
- package/mobile/lib/utils/isIFrame.d.ts +1 -0
- package/mobile/lib/utils/isIFrame.js +2 -0
- package/mobile/lib/utils/isIFrame.js.map +1 -0
- package/mobile/src/common.css +3 -0
- package/mobile/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +2 -1
- package/mobile/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +9 -4
- package/mobile/src/components/ContentPage/ContentPage.tsx +6 -4
- package/mobile/src/components/CreditCardForm/CreditCardFormStep.tsx +2 -0
- package/mobile/src/components/CreditCardForm/creditCardFormStepsData.tsx +21 -18
- package/mobile/src/components/CreditCardForm/formStateMap.tsx +6 -0
- package/mobile/src/components/CreditForm/CreditFormStep.tsx +2 -0
- package/mobile/src/components/CreditForm/creditFormStepsData.tsx +14 -17
- package/mobile/src/components/DebitForm/DebitFormStep.tsx +2 -0
- package/mobile/src/retail/adaptors/getPersonalInfoData.tsx +1 -14
- package/mobile/src/retail/api/getDictionaries.ts +21 -0
- package/mobile/src/retail/components/DraftDialog/parseDraftTask.ts +1 -0
- package/mobile/src/retail/components/Fields/AmountWorkersField.tsx +0 -10
- package/mobile/src/retail/components/Fields/BankEmployeeCodeField.tsx +41 -9
- package/mobile/src/retail/components/Fields/DaDataInnField.tsx +28 -10
- package/mobile/src/retail/components/Fields/EmployerActivitiesField.tsx +0 -10
- package/mobile/src/retail/components/Fields/EmployerOrganizationField.tsx +0 -10
- package/mobile/src/retail/components/Fields/OrganizationField.tsx +0 -10
- package/mobile/src/retail/components/Fields/OrganizationNameField.tsx +17 -2
- package/mobile/src/retail/content.tsx +4 -11
- package/mobile/src/retail/hooks/useIFrameMode.ts +45 -0
- package/mobile/src/retail/inputs.tsx +2 -2
- package/mobile/src/retail/model/LeadFormState.ts +1 -1
- package/mobile/src/retail/model/NameFieldDef.ts +1 -0
- package/mobile/src/retail/utils/getMainFormStateMap.ts +1 -6
- package/mobile/src/retail/utils/getOrganizationParams.ts +7 -0
- package/mobile/src/retail/utils/updateOrganizationFields.ts +2 -0
- package/mobile/src/retail/validator/getRetailFormValidator.ts +4 -0
- package/mobile/src/retail/validator/validators.ts +9 -0
- package/mobile/src/ui-kit/DatePicker/DatePickerInput.tsx +1 -1
- package/mobile/src/ui-kit/FormField/validators.ts +1 -1
- package/mobile/src/ui-kit/TabsControl/TabItemInner.tsx +1 -0
- package/mobile/src/utils/isIFrame.ts +1 -0
- package/package.json +1 -1
- package/src/common.css +3 -0
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.tsx +2 -1
- package/src/components/ApplicationLeadForm/EsiaLoginBanner.tsx +9 -4
- package/src/components/ContentPage/ContentPage.tsx +6 -4
- package/src/components/CreditCardForm/CreditCardFormStep.tsx +2 -0
- package/src/components/CreditCardForm/creditCardFormStepsData.tsx +21 -18
- package/src/components/CreditCardForm/formStateMap.tsx +6 -0
- package/src/components/CreditForm/CreditFormStep.tsx +2 -0
- package/src/components/CreditForm/creditFormStepsData.tsx +14 -17
- package/src/components/DebitForm/DebitFormStep.tsx +2 -0
- package/src/retail/adaptors/getPersonalInfoData.tsx +1 -14
- package/src/retail/api/getDictionaries.ts +21 -0
- package/src/retail/components/DraftDialog/parseDraftTask.ts +1 -0
- package/src/retail/components/Fields/AmountWorkersField.tsx +0 -10
- package/src/retail/components/Fields/BankEmployeeCodeField.tsx +41 -9
- package/src/retail/components/Fields/DaDataInnField.tsx +28 -10
- package/src/retail/components/Fields/EmployerActivitiesField.tsx +0 -10
- package/src/retail/components/Fields/EmployerOrganizationField.tsx +0 -10
- package/src/retail/components/Fields/OrganizationField.tsx +0 -10
- package/src/retail/components/Fields/OrganizationNameField.tsx +17 -2
- package/src/retail/content.tsx +4 -11
- package/src/retail/hooks/useIFrameMode.ts +45 -0
- package/src/retail/inputs.tsx +2 -2
- package/src/retail/model/LeadFormState.ts +1 -1
- package/src/retail/model/NameFieldDef.ts +1 -0
- package/src/retail/utils/getMainFormStateMap.ts +1 -6
- package/src/retail/utils/getOrganizationParams.ts +7 -0
- package/src/retail/utils/updateOrganizationFields.ts +2 -0
- package/src/retail/validator/getRetailFormValidator.ts +4 -0
- package/src/retail/validator/validators.ts +9 -0
- package/src/ui-kit/DatePicker/DatePickerInput.tsx +1 -1
- package/src/ui-kit/FormField/validators.ts +1 -1
- package/src/ui-kit/TabsControl/TabItemInner.tsx +1 -0
- package/src/utils/isIFrame.ts +1 -0
- package/tailwind.config.cjs +3 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useCallback, useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { useForm } from '../../hooks/useForm/useForm';
|
|
4
|
+
import { useIFrameMode } from '../../retail/hooks/useIFrameMode';
|
|
4
5
|
import { useRetailFormStore } from '../../retail/hooks/useRetailFormStore';
|
|
5
6
|
import { type SectionsRetailProps } from '../../retail/model/InputSectionsType';
|
|
6
7
|
import { type LeadFormState } from '../../retail/model/LeadFormState';
|
|
@@ -24,6 +25,7 @@ const PRODUCT_TYPE = 'credit';
|
|
|
24
25
|
export const CreditFormStep = JSX<CreditFormStepProps>(
|
|
25
26
|
({ step, sections, programsSource, onPrevStep, onNextStep, onFinish }) => {
|
|
26
27
|
const { programId } = useRetailFormStore();
|
|
28
|
+
useIFrameMode();
|
|
27
29
|
const calcData = programsSource?.[programId ?? '']; // Need normalizator useForm, to be save defaultParams
|
|
28
30
|
|
|
29
31
|
const inputs = useMemo(
|
|
@@ -44,38 +44,30 @@ const EMPLOYMENT_CONTENT: SectionsRetailProps[] = [
|
|
|
44
44
|
],
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
|
-
inputs: [
|
|
48
|
-
{ name: 'employment', required: true },
|
|
49
|
-
{ name: 'organizationName', required: true, dadata: true, filledByEsia: true },
|
|
50
|
-
],
|
|
47
|
+
inputs: [{ name: 'employment', required: true }],
|
|
51
48
|
},
|
|
52
49
|
{
|
|
53
50
|
columns: 2,
|
|
54
51
|
inputs: [
|
|
52
|
+
{ name: 'organizationName', required: true, dadata: true, filledByEsia: true },
|
|
55
53
|
{ name: 'inn', required: true, dadata: true, filledByEsia: true },
|
|
56
|
-
{ name: 'legalForm', required: true },
|
|
57
54
|
],
|
|
58
55
|
},
|
|
59
56
|
{
|
|
57
|
+
columns: 2,
|
|
60
58
|
inputs: [
|
|
61
|
-
{ name: 'organization', required: true },
|
|
62
59
|
{ name: 'amountWorkers', required: true },
|
|
60
|
+
{
|
|
61
|
+
name: 'organizationPhone',
|
|
62
|
+
label: 'Телефон работодателя',
|
|
63
|
+
required: true,
|
|
64
|
+
},
|
|
63
65
|
],
|
|
64
66
|
},
|
|
65
67
|
{
|
|
66
68
|
columns: 2,
|
|
67
69
|
inputs: [
|
|
68
|
-
{ name: 'employerOrganization', required: true },
|
|
69
70
|
{ name: 'jobsNumber', required: true, filledByEsia: true },
|
|
70
|
-
],
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
inputs: [
|
|
74
|
-
{
|
|
75
|
-
name: 'organizationPhone',
|
|
76
|
-
label: 'Телефон работодателя',
|
|
77
|
-
required: true,
|
|
78
|
-
},
|
|
79
71
|
{ name: 'beginDate', required: true, filledByEsia: true },
|
|
80
72
|
],
|
|
81
73
|
},
|
|
@@ -177,7 +169,12 @@ const DELIVERY_CREDIT_CONTENT: SectionsRetailProps[] = [
|
|
|
177
169
|
],
|
|
178
170
|
},
|
|
179
171
|
{
|
|
180
|
-
|
|
172
|
+
columns: 2,
|
|
173
|
+
inputs: [
|
|
174
|
+
{
|
|
175
|
+
name: 'bankEmployeeCode',
|
|
176
|
+
},
|
|
177
|
+
],
|
|
181
178
|
},
|
|
182
179
|
];
|
|
183
180
|
const CALCULATOR_CONTENT: SectionsRetailProps[] = [
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useCallback, useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { useForm } from '../../hooks/useForm/useForm';
|
|
4
|
+
import { useIFrameMode } from '../../retail/hooks/useIFrameMode';
|
|
4
5
|
import { type SectionsRetailProps } from '../../retail/model/InputSectionsType';
|
|
5
6
|
import type { LeadFormState } from '../../retail/model/LeadFormState';
|
|
6
7
|
import { renderStep } from '../../retail/utils/renderStep';
|
|
@@ -20,6 +21,7 @@ const PRODUCT_TYPE = 'debitCard';
|
|
|
20
21
|
|
|
21
22
|
export const DebitFormStep = JSX<DebitFormStepProps>(
|
|
22
23
|
({ step, sections, onPrevStep, onNextStep, onFinish }) => {
|
|
24
|
+
useIFrameMode();
|
|
23
25
|
const inputs = useMemo(
|
|
24
26
|
() => sections?.flatMap((_: SectionsRetailProps) => _?.inputs ?? []),
|
|
25
27
|
[sections],
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import { formatDate } from '../../utils/formatDate';
|
|
2
|
-
import { formatPhone } from '../../utils/formatPhone';
|
|
3
2
|
import { type Participant } from '../api/updateUserTask';
|
|
4
3
|
import { type LeadFormState } from '../model/LeadFormState';
|
|
5
|
-
import { getParticipantAddresses
|
|
4
|
+
import { getParticipantAddresses } from './utils';
|
|
6
5
|
|
|
7
6
|
export const getPersonalInfoData = (formData: LeadFormState): Partial<Participant> => {
|
|
8
7
|
const {
|
|
9
|
-
name,
|
|
10
|
-
surname,
|
|
11
|
-
middleName,
|
|
12
8
|
limitedBirthday = '',
|
|
13
|
-
phone = '',
|
|
14
|
-
email,
|
|
15
9
|
sex,
|
|
16
10
|
birthPlace,
|
|
17
11
|
dulIssueDate = '',
|
|
@@ -29,9 +23,6 @@ export const getPersonalInfoData = (formData: LeadFormState): Partial<Participan
|
|
|
29
23
|
|
|
30
24
|
return {
|
|
31
25
|
birthDate: formatDate(limitedBirthday, true),
|
|
32
|
-
midname: middleName,
|
|
33
|
-
name,
|
|
34
|
-
surname,
|
|
35
26
|
birthPlace,
|
|
36
27
|
dulIssueDate: formatDate(dulIssueDate, true),
|
|
37
28
|
dulIssuedBy,
|
|
@@ -44,10 +35,6 @@ export const getPersonalInfoData = (formData: LeadFormState): Partial<Participan
|
|
|
44
35
|
: undefined,
|
|
45
36
|
homeMatchFlg: addressMatch,
|
|
46
37
|
houseTypeCd: housing,
|
|
47
|
-
participantContacts: getParticipantContacts({
|
|
48
|
-
phone: formatPhone(phone),
|
|
49
|
-
email,
|
|
50
|
-
}),
|
|
51
38
|
participantAddresses: getParticipantAddresses({
|
|
52
39
|
addressRegistration,
|
|
53
40
|
addressFact: addressMatch ? addressRegistration : addressFact,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type CreditFormDictionarySlice } from '../hooks/useRetailFormStore';
|
|
2
|
+
import { type DictionaryItem } from '../model/LeadFormData';
|
|
3
|
+
import { fetchRetailJSON } from './doRequest';
|
|
4
|
+
|
|
5
|
+
export const getDictionaries = (
|
|
6
|
+
dictionaries: Record<string, string>,
|
|
7
|
+
store: CreditFormDictionarySlice,
|
|
8
|
+
) => {
|
|
9
|
+
Promise.all(
|
|
10
|
+
Object.entries(dictionaries).map((dictionary) => {
|
|
11
|
+
const [fieldName, dictionaryName] = dictionary;
|
|
12
|
+
|
|
13
|
+
fetchRetailJSON<DictionaryItem[]>(
|
|
14
|
+
`/dictionary?dictionaryType=${encodeURIComponent(dictionaryName)}`,
|
|
15
|
+
'POST',
|
|
16
|
+
).then((res) => {
|
|
17
|
+
store[fieldName] = res;
|
|
18
|
+
});
|
|
19
|
+
}),
|
|
20
|
+
);
|
|
21
|
+
};
|
|
@@ -90,6 +90,7 @@ export const parseDraftTask = (task: Task): LeadFormState => {
|
|
|
90
90
|
employment: getSelectValue(employment, EMPLOYMENT_TYPE),
|
|
91
91
|
organizationName,
|
|
92
92
|
inn,
|
|
93
|
+
isDadataOrganization: Boolean(inn),
|
|
93
94
|
employerActivities: getSelectValue(employerActivities),
|
|
94
95
|
organization: getSelectValue(organization),
|
|
95
96
|
employerOrganization: getSelectValue(employerOrganization),
|
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { useEffect } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
2
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
4
|
-
import { useLeadFormData } from '../../hooks/useLeadFormData';
|
|
5
3
|
import { useRetailFormStore } from '../../hooks/useRetailFormStore';
|
|
6
4
|
import { SelectField } from './SelectField';
|
|
7
5
|
|
|
8
6
|
export const AmountWorkersField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
9
|
-
const { data } = useLeadFormData('EMPLOYEES_NUMBER');
|
|
10
|
-
|
|
11
7
|
const store = useRetailFormStore();
|
|
12
8
|
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
if (data) {
|
|
15
|
-
store.amountWorkers = data;
|
|
16
|
-
}
|
|
17
|
-
}, [data]);
|
|
18
|
-
|
|
19
9
|
return (
|
|
20
10
|
<SelectField
|
|
21
11
|
field={field}
|
|
@@ -1,13 +1,45 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
3
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
4
|
+
import { type RadioButtonItem } from '../../../ui-kit/RadioButtonGroup/RadioButtonGroup';
|
|
5
|
+
import { RadioButtonGroupControl } from '../../../ui-kit/RadioButtonGroup/RadioButtonGroupControl';
|
|
3
6
|
import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
|
|
4
7
|
|
|
5
|
-
export const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
)
|
|
8
|
+
export const BUTTON_TYPES: RadioButtonItem[] = [
|
|
9
|
+
{ id: 'true', text: 'Да' },
|
|
10
|
+
{ id: 'false', text: 'Нет' },
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
export const BankEmployeeCodeField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
14
|
+
const [bankEmployeeFlg, setBankEmployeeFlg] = useState('');
|
|
15
|
+
|
|
16
|
+
const handleBankEmployeeFlgChange = useCallback((value: string) => {
|
|
17
|
+
setBankEmployeeFlg(value);
|
|
18
|
+
|
|
19
|
+
if (value === 'false') {
|
|
20
|
+
field('bankEmployeeCode')?.onChange?.(null);
|
|
21
|
+
}
|
|
22
|
+
}, []);
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<div className="flex flex-col md:flex-row">
|
|
26
|
+
<RadioButtonGroupControl
|
|
27
|
+
label="Мне помог сотрудник Банка"
|
|
28
|
+
orientation="horizontal"
|
|
29
|
+
items={BUTTON_TYPES}
|
|
30
|
+
value={bankEmployeeFlg}
|
|
31
|
+
onChange={handleBankEmployeeFlgChange}
|
|
32
|
+
/>
|
|
33
|
+
{bankEmployeeFlg === 'true' ? (
|
|
34
|
+
<DaDataInputControl
|
|
35
|
+
label="Код представителя Банка"
|
|
36
|
+
placeholder="Введите код"
|
|
37
|
+
isInteger={true}
|
|
38
|
+
maxLength={8}
|
|
39
|
+
{...field(input?.name ?? '')}
|
|
40
|
+
{...input}
|
|
41
|
+
/>
|
|
42
|
+
) : null}
|
|
43
|
+
</div>
|
|
44
|
+
);
|
|
45
|
+
});
|
|
@@ -1,23 +1,40 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { useCallback, useEffect } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
import { useCallback, useEffect, useState } 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
|
+
import { getDictionaries } from '../../api/getDictionaries';
|
|
5
6
|
import { getOrganizationFromInn } from '../../api/getOrganizationFromInn';
|
|
6
7
|
import { useRetailFormStore, type CreditFormStoreSlice } from '../../hooks/useRetailFormStore';
|
|
8
|
+
import { organizationDictionaries } from '../../utils/getOrganizationParams';
|
|
7
9
|
import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
|
|
8
10
|
import { updateOrganizationFields } from '../../utils/updateOrganizationFields';
|
|
9
11
|
import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
|
|
10
12
|
|
|
13
|
+
const NO_DADATA_ERROR_TEXT = 'Необходимо выбрать ИНН из выпадающего списка';
|
|
14
|
+
|
|
11
15
|
export const DaDataInnField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
12
16
|
const store = useRetailFormStore();
|
|
17
|
+
const [errorText, setErrorText] = useState('');
|
|
13
18
|
const { employerActivities, employerOrganization, organization, amountWorkers } = store;
|
|
14
19
|
const esiaAccountTypeCd = field?.('esiaAccountTypeCd')?.value;
|
|
15
20
|
const inn = field?.('inn')?.value;
|
|
21
|
+
const fieldError = field?.('organizationName')?.error;
|
|
22
|
+
const isDadataOrganization = field('isDadataOrganization')?.value;
|
|
23
|
+
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
setErrorText(fieldError && !isDadataOrganization ? NO_DADATA_ERROR_TEXT : '');
|
|
26
|
+
}, [isDadataOrganization, fieldError]);
|
|
16
27
|
|
|
17
28
|
const onDaDataChange = useCallback((item: DaDataSuggestion) => {
|
|
18
29
|
updateOrganizationFields(store, field, item);
|
|
19
30
|
}, []);
|
|
20
31
|
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
(async () => {
|
|
34
|
+
await getDictionaries(organizationDictionaries, store);
|
|
35
|
+
})();
|
|
36
|
+
}, []);
|
|
37
|
+
|
|
21
38
|
useEffect(() => {
|
|
22
39
|
if (!esiaAccountTypeCd || !inn || !isDictionariesAlreadyLoad(store as CreditFormStoreSlice)) {
|
|
23
40
|
return;
|
|
@@ -30,6 +47,11 @@ export const DaDataInnField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
|
30
47
|
})();
|
|
31
48
|
}, [employerActivities, employerOrganization, organization, amountWorkers]);
|
|
32
49
|
|
|
50
|
+
const onChange = useCallback((value: string) => {
|
|
51
|
+
field?.('inn')?.onChange?.(value);
|
|
52
|
+
field?.('isDadataOrganization')?.onChange?.(false);
|
|
53
|
+
}, []);
|
|
54
|
+
|
|
33
55
|
return (
|
|
34
56
|
<DaDataInputControl
|
|
35
57
|
label="ИНН"
|
|
@@ -39,18 +61,14 @@ export const DaDataInnField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
|
39
61
|
{...field(input?.name ?? '')}
|
|
40
62
|
onDaDataChange={onDaDataChange}
|
|
41
63
|
disabled={isEsiaAuthorize(field, input)}
|
|
64
|
+
onChange={onChange}
|
|
65
|
+
error={errorText || field('inn')?.error}
|
|
42
66
|
/>
|
|
43
67
|
);
|
|
44
68
|
});
|
|
45
69
|
|
|
46
70
|
const isDictionariesAlreadyLoad = (store: CreditFormStoreSlice) => {
|
|
47
|
-
const { employerActivities, employerOrganization, organization, amountWorkers
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return [
|
|
51
|
-
employerOrganization,
|
|
52
|
-
organization,
|
|
53
|
-
amountWorkers,
|
|
54
|
-
productType === 'creditCard' ? employerActivities : true,
|
|
55
|
-
].every(Boolean);
|
|
71
|
+
const { employerActivities, employerOrganization, organization, amountWorkers } = store;
|
|
72
|
+
|
|
73
|
+
return [employerOrganization, organization, amountWorkers, employerActivities].every(Boolean);
|
|
56
74
|
};
|
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { useEffect } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
2
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
4
|
-
import { useLeadFormData } from '../../hooks/useLeadFormData';
|
|
5
3
|
import { useRetailFormStore } from '../../hooks/useRetailFormStore';
|
|
6
4
|
import { SelectField } from './SelectField';
|
|
7
5
|
|
|
8
6
|
export const EmployerActivitiesField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
9
|
-
const { data } = useLeadFormData('ORGANIZATION_ACTIVITY_TYPE');
|
|
10
|
-
|
|
11
7
|
const store = useRetailFormStore();
|
|
12
8
|
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
if (data) {
|
|
15
|
-
store.employerActivities = data;
|
|
16
|
-
}
|
|
17
|
-
}, [data]);
|
|
18
|
-
|
|
19
9
|
return (
|
|
20
10
|
<SelectField
|
|
21
11
|
field={field}
|
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { useEffect } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
2
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
4
|
-
import { useLeadFormData } from '../../hooks/useLeadFormData';
|
|
5
3
|
import { useRetailFormStore } from '../../hooks/useRetailFormStore';
|
|
6
4
|
import { SelectField } from './SelectField';
|
|
7
5
|
|
|
8
6
|
export const EmployerOrganizationField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
9
|
-
const { data } = useLeadFormData('ORGANIZATION_KIND');
|
|
10
|
-
|
|
11
7
|
const store = useRetailFormStore();
|
|
12
8
|
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
if (data) {
|
|
15
|
-
store.employerOrganization = data;
|
|
16
|
-
}
|
|
17
|
-
}, [data]);
|
|
18
|
-
|
|
19
9
|
return (
|
|
20
10
|
<SelectField
|
|
21
11
|
field={field}
|
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { useEffect } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
2
|
import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
|
|
4
|
-
import { useLeadFormData } from '../../hooks/useLeadFormData';
|
|
5
3
|
import { useRetailFormStore } from '../../hooks/useRetailFormStore';
|
|
6
4
|
import { SelectField } from './SelectField';
|
|
7
5
|
|
|
8
6
|
export const OrganizationField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
9
|
-
const { data } = useLeadFormData('ORGANIZATION_TYPE');
|
|
10
|
-
|
|
11
7
|
const store = useRetailFormStore();
|
|
12
8
|
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
if (data) {
|
|
15
|
-
store.organization = data;
|
|
16
|
-
}
|
|
17
|
-
}, [data]);
|
|
18
|
-
|
|
19
9
|
return (
|
|
20
10
|
<SelectField
|
|
21
11
|
field={field}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
import { useCallback, useEffect, useState } 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 { useRetailFormStore } from '../../hooks/useRetailFormStore';
|
|
@@ -7,14 +7,27 @@ import { isEsiaAuthorize } from '../../utils/isEsiaAuthorize';
|
|
|
7
7
|
import { updateOrganizationFields } from '../../utils/updateOrganizationFields';
|
|
8
8
|
import { DaDataInputControl } from '../DaDataInputControl/DaDataInputControl';
|
|
9
9
|
|
|
10
|
+
const NO_DADATA_ERROR_TEXT = 'Необходимо выбрать организацию из выпадающего списка';
|
|
11
|
+
|
|
10
12
|
export const OrganizationNameField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
11
13
|
const store = useRetailFormStore();
|
|
14
|
+
const [errorText, setErrorText] = useState('');
|
|
15
|
+
const fieldError = field?.('organizationName')?.error;
|
|
16
|
+
const isDadataOrganization = field('isDadataOrganization')?.value;
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
setErrorText(fieldError && !isDadataOrganization ? NO_DADATA_ERROR_TEXT : '');
|
|
20
|
+
}, [isDadataOrganization, fieldError]);
|
|
12
21
|
|
|
13
22
|
const onDaDataChange = useCallback((item: DaDataSuggestion) => {
|
|
14
|
-
field?.('inn')?.onChange?.(item.data?.inn);
|
|
15
23
|
updateOrganizationFields(store, field, item);
|
|
16
24
|
}, []);
|
|
17
25
|
|
|
26
|
+
const onChange = useCallback((value: string) => {
|
|
27
|
+
field?.('organizationName')?.onChange?.(value);
|
|
28
|
+
field?.('isDadataOrganization')?.onChange?.(false);
|
|
29
|
+
}, []);
|
|
30
|
+
|
|
18
31
|
return (
|
|
19
32
|
<DaDataInputControl
|
|
20
33
|
label="Наименование организации"
|
|
@@ -22,6 +35,8 @@ export const OrganizationNameField = JSX<CustomFieldProps>(({ field, input }) =>
|
|
|
22
35
|
{...field(input?.name ?? '')}
|
|
23
36
|
disabled={isEsiaAuthorize(field, input)}
|
|
24
37
|
onDaDataChange={onDaDataChange}
|
|
38
|
+
onChange={onChange}
|
|
39
|
+
error={errorText || field('organizationName')?.error}
|
|
25
40
|
/>
|
|
26
41
|
);
|
|
27
42
|
});
|
|
@@ -6,21 +6,14 @@ export const PERSONAL_DATA: CreditCardSectionsProps[] = [
|
|
|
6
6
|
title: 'Персональные данные',
|
|
7
7
|
columns: 2,
|
|
8
8
|
inputs: [
|
|
9
|
-
{
|
|
10
|
-
name: 'surname',
|
|
11
|
-
required: true,
|
|
12
|
-
dadata: true,
|
|
13
|
-
filledByEsia: true,
|
|
14
|
-
},
|
|
15
|
-
{ name: 'name', required: true, dadata: true, filledByEsia: true },
|
|
16
|
-
{ name: 'middleName', dadata: true, filledByEsia: true },
|
|
17
|
-
{ name: 'sex', required: true },
|
|
18
9
|
{ name: 'limitedBirthday', required: true, filledByEsia: true },
|
|
19
10
|
{ name: 'birthPlace', required: true, filledByEsia: true },
|
|
20
|
-
{ name: 'phone', disabled: true, required: true },
|
|
21
|
-
{ name: 'email', required: true, dadata: true },
|
|
22
11
|
],
|
|
23
12
|
},
|
|
13
|
+
{
|
|
14
|
+
columns: 2,
|
|
15
|
+
inputs: [{ name: 'sex', required: true }],
|
|
16
|
+
},
|
|
24
17
|
{
|
|
25
18
|
title: 'Паспортные данные',
|
|
26
19
|
columns: 2,
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { useEffect } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
import { useSessionStore } from '@redneckz/uni-jsx/lib/Store/useSessionStore';
|
|
3
|
+
import { initializeExternalStylesheet } from '../../hooks/useExternalNS';
|
|
4
|
+
import { isIFrame } from '../../utils/isIFrame';
|
|
5
|
+
|
|
6
|
+
export type IFrameStore = {
|
|
7
|
+
frameLocation: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const useIFrameMode = () => {
|
|
11
|
+
const isFrame = isIFrame();
|
|
12
|
+
const height = globalThis.document?.body?.scrollHeight;
|
|
13
|
+
const sessionStore = useSessionStore<IFrameStore>();
|
|
14
|
+
const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
|
|
15
|
+
|
|
16
|
+
const styles = params.get('styles');
|
|
17
|
+
if (styles) {
|
|
18
|
+
initializeExternalStylesheet(styles);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (isFrame) {
|
|
23
|
+
globalThis.parent.postMessage({ height: document.body.scrollHeight }, '*');
|
|
24
|
+
}
|
|
25
|
+
}, [height, isFrame]);
|
|
26
|
+
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
const handlePostMessage = (event: MessageEvent<{ location: string }>) => {
|
|
29
|
+
if (!event.data?.location) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
sessionStore.frameLocation = event.data?.location;
|
|
34
|
+
};
|
|
35
|
+
if (isFrame) {
|
|
36
|
+
globalThis.addEventListener('message', handlePostMessage);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return () => {
|
|
40
|
+
if (isFrame) {
|
|
41
|
+
globalThis.removeEventListener('message', handlePostMessage);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}, [isFrame]);
|
|
45
|
+
};
|
|
@@ -8,7 +8,7 @@ import { AddressMatchField } from './components/Fields/AddressMatchField';
|
|
|
8
8
|
import { AddressRetailField } from './components/Fields/AddressRetailField';
|
|
9
9
|
import { AmountWorkersField } from './components/Fields/AmountWorkersField';
|
|
10
10
|
import { ArmyIdFlgField } from './components/Fields/ArmyIdFlgField';
|
|
11
|
-
import {
|
|
11
|
+
import { BankEmployeeCodeField } from './components/Fields/BankEmployeeCodeField';
|
|
12
12
|
import { BankruptcyFlgField } from './components/Fields/BankruptcyFlgField';
|
|
13
13
|
import { BeginDateField } from './components/Fields/BeginDateField';
|
|
14
14
|
import { BirthPlaceField } from './components/Fields/BirthPlaceField';
|
|
@@ -136,7 +136,7 @@ export const InputsRetailMap = {
|
|
|
136
136
|
shareholderFlg: ShareholderFlgField,
|
|
137
137
|
legalEntityName: LegalEntityNameField,
|
|
138
138
|
creditInRshbCd: CreditInRshbCdField,
|
|
139
|
-
bankEmployeeCode:
|
|
139
|
+
bankEmployeeCode: BankEmployeeCodeField,
|
|
140
140
|
partInBusiness: PartInBusinessField,
|
|
141
141
|
regionRetail: RegionRetailField,
|
|
142
142
|
infoCard: InfoCardField,
|
|
@@ -128,6 +128,7 @@ export interface LeadFormState extends FormRetailConsents, FormStateDeliveryType
|
|
|
128
128
|
inn?: string;
|
|
129
129
|
legalForm?: string;
|
|
130
130
|
organizationName?: string;
|
|
131
|
+
isDadataOrganization?: boolean;
|
|
131
132
|
generalSeniority?: string;
|
|
132
133
|
lastJobExperience?: string;
|
|
133
134
|
experience5Years?: string;
|
|
@@ -136,7 +137,6 @@ export interface LeadFormState extends FormRetailConsents, FormStateDeliveryType
|
|
|
136
137
|
beginDate?: Date | string;
|
|
137
138
|
addressFact?: Address;
|
|
138
139
|
addressBranch?: Option;
|
|
139
|
-
bankEmpolee?: string;
|
|
140
140
|
applicationDate?: string;
|
|
141
141
|
comment?: string;
|
|
142
142
|
isClient?: boolean;
|
|
@@ -43,6 +43,7 @@ export const getMainFormStateMap = (isCredit = false): Partial<LeadFormState>[]
|
|
|
43
43
|
fiasCode: '',
|
|
44
44
|
},
|
|
45
45
|
organizationName: '',
|
|
46
|
+
isDadataOrganization: false,
|
|
46
47
|
organizationPhone: '',
|
|
47
48
|
partInBusiness: undefined,
|
|
48
49
|
positionOrganization: { key: '', text: '' },
|
|
@@ -59,10 +60,4 @@ export const getMainFormStateMap = (isCredit = false): Partial<LeadFormState>[]
|
|
|
59
60
|
esiaAccountTypeCd: { key: '', text: '' },
|
|
60
61
|
initiateBankruptcyFlg: isCredit ? false : undefined,
|
|
61
62
|
},
|
|
62
|
-
{
|
|
63
|
-
bankruptcyFlg: false,
|
|
64
|
-
shareholderFlg: false,
|
|
65
|
-
legalEntityName: '',
|
|
66
|
-
creditInRshbCd: undefined,
|
|
67
|
-
},
|
|
68
63
|
];
|
|
@@ -129,3 +129,10 @@ const getOptionOp = (options: DictionaryItem[]) => (key: string) =>
|
|
|
129
129
|
options
|
|
130
130
|
.map((_): Option => ({ key: _.key as string, text: _.value as string }))
|
|
131
131
|
.find((_) => _.key === key) ?? null;
|
|
132
|
+
|
|
133
|
+
export const organizationDictionaries = {
|
|
134
|
+
amountWorkers: 'EMPLOYEES_NUMBER',
|
|
135
|
+
employerOrganization: 'ORGANIZATION_KIND',
|
|
136
|
+
employerActivities: 'ORGANIZATION_ACTIVITY_TYPE',
|
|
137
|
+
organization: 'ORGANIZATION_TYPE',
|
|
138
|
+
};
|
|
@@ -28,6 +28,8 @@ export const updateOrganizationFields = (
|
|
|
28
28
|
organization: getOrganizationType(store?.organization ?? [], okopf, inn),
|
|
29
29
|
employerOrganization: getOrganizationKind(store?.employerOrganization ?? [], okopf),
|
|
30
30
|
organizationName,
|
|
31
|
+
inn,
|
|
32
|
+
isDadataOrganization: true,
|
|
31
33
|
};
|
|
32
34
|
|
|
33
35
|
for (const fieldName in organizationData) {
|
|
@@ -8,6 +8,8 @@ import { validatorObj } from './validatorObj';
|
|
|
8
8
|
import {
|
|
9
9
|
dateRegistrationValidator,
|
|
10
10
|
generalSeniorityValidator,
|
|
11
|
+
organizationInnValidator,
|
|
12
|
+
organizationNameValidator,
|
|
11
13
|
passportValidator,
|
|
12
14
|
workBeginDateValidator,
|
|
13
15
|
} from './validators';
|
|
@@ -32,4 +34,6 @@ export const getRetailFormValidator = ({
|
|
|
32
34
|
generalSeniority: generalSeniorityValidator(formState.lastJobExperience as string),
|
|
33
35
|
beginDate: workBeginDateValidator(formState.limitedBirthday as Date),
|
|
34
36
|
participantDateRegistration: dateRegistrationValidator(formState.limitedBirthday as Date),
|
|
37
|
+
organizationName: organizationNameValidator(formState.isDadataOrganization),
|
|
38
|
+
inn: organizationInnValidator(formState.isDadataOrganization),
|
|
35
39
|
})(formState);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isValidInnLength } from '../../ui-kit/FormField/validators';
|
|
1
2
|
import { isCyrillic } from '../../utils/isCyrilic';
|
|
2
3
|
import { validator } from '../../validation/validator';
|
|
3
4
|
import { type Address } from '../model/LeadFormState';
|
|
@@ -135,3 +136,11 @@ export const validateDateFromBirth = (age: number, birthDate?: Date) =>
|
|
|
135
136
|
|
|
136
137
|
return false;
|
|
137
138
|
});
|
|
139
|
+
|
|
140
|
+
export const organizationNameValidator = (isDadataOrganization?: boolean) =>
|
|
141
|
+
validator((_: string) => Boolean(_) && Boolean(isDadataOrganization))(
|
|
142
|
+
'Укажите наименование организации',
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
export const organizationInnValidator = (isDadataOrganization?: boolean) =>
|
|
146
|
+
validator((_: string) => isValidInnLength(_) && Boolean(isDadataOrganization))('Укажите ИНН');
|
|
@@ -70,7 +70,7 @@ export const DatePickerInput = JSX<DatePickerInputProps>(
|
|
|
70
70
|
<div onClick={onInputClick} className={style('relative', className)}>
|
|
71
71
|
<input
|
|
72
72
|
ref={ref}
|
|
73
|
-
className="h-full w-full px-m text-l text-black focus-visible:outline-none"
|
|
73
|
+
className="h-full w-full px-m text-l text-black focus-visible:outline-none rounded-none"
|
|
74
74
|
value={inputValue}
|
|
75
75
|
type="text"
|
|
76
76
|
onChange={handleChange}
|
|
@@ -43,5 +43,5 @@ const emailValidate = (email: string) => /^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test
|
|
|
43
43
|
export const emailValidator = (errorMsg: string) =>
|
|
44
44
|
validator((_: string) => emailValidate(_))(errorMsg);
|
|
45
45
|
|
|
46
|
-
const isValidInnLength = (value: string | undefined): boolean =>
|
|
46
|
+
export const isValidInnLength = (value: string | undefined): boolean =>
|
|
47
47
|
typeof value === 'string' && (value.length === 10 || value.length === 12);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const isIFrame = () => globalThis.location !== globalThis?.top?.location;
|