@redneckz/wildless-cms-uni-blocks 0.14.683 → 0.14.684
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/api/RetailAPI/updateUserTask.d.ts +5 -4
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +696 -653
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +13 -7
- package/bundle/components/CalculatorCredit/CalculatorCredit.d.ts +2 -3
- package/bundle/components/CalculatorCredit/defaultValueAdapter.d.ts +11 -0
- package/bundle/components/CreditCardForm/CreditCardFormStatus.d.ts +1 -0
- package/bundle/components/CreditCardForm/PendingStatusContent.d.ts +3 -1
- package/bundle/components/CreditCardForm/renderInputs.d.ts +2 -1
- package/bundle/components/CreditCardForm/renderStep.d.ts +2 -2
- package/bundle/components/CreditForm/CreditForm.d.ts +5 -2
- package/bundle/components/CreditForm/CreditFormContent.d.ts +4 -5
- package/bundle/components/CreditForm/CreditFormStep.d.ts +2 -3
- package/bundle/components/CreditForm/ProgramsSourceProps.d.ts +16 -0
- package/bundle/components/CreditForm/getCalcData.d.ts +3 -0
- package/bundle/components/CreditForm/getZeroStepData.d.ts +1 -1
- package/bundle/components/CreditForm/renderInputs.d.ts +2 -1
- package/bundle/components/CreditForm/renderStep.d.ts +2 -2
- package/bundle/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +0 -1
- package/bundle/components/OfficesAtmsMap/filterItems.d.ts +2 -0
- package/bundle/ui-kit/FormField/CustomFieldProps.d.ts +1 -0
- package/bundle/ui-kit/FormField/Fields/CreditCalcField.d.ts +2 -0
- package/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/bundle/ui-kit/FormField/getField.d.ts +1 -1
- package/dist/api/RetailAPI/getCardTypes.js +1 -1
- package/dist/api/RetailAPI/getCardTypes.js.map +1 -1
- package/dist/api/RetailAPI/updateUserTask.d.ts +5 -4
- package/dist/api/RetailAPI/updateUserTask.js +1 -1
- package/dist/api/RetailAPI/updateUserTask.js.map +1 -1
- package/dist/components/ApplicationForm/ApplicationForm.js +1 -1
- package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/dist/components/ApplicationForm/renderInputs.js +1 -1
- package/dist/components/ApplicationForm/renderInputs.js.map +1 -1
- package/dist/components/ApplicationLeadForm/GroupedConsents.js +1 -1
- package/dist/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
- package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +13 -7
- package/dist/components/ApplicationLeadForm/getInitialFormState.js +0 -1
- package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +4 -2
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/CalculatorCredit/CalculatorCredit.d.ts +2 -3
- package/dist/components/CalculatorCredit/CalculatorCredit.js +5 -3
- package/dist/components/CalculatorCredit/CalculatorCredit.js.map +1 -1
- package/dist/components/CalculatorCredit/defaultValueAdapter.d.ts +11 -0
- package/dist/components/CalculatorCredit/defaultValueAdapter.js +18 -0
- package/dist/components/CalculatorCredit/defaultValueAdapter.js.map +1 -0
- package/dist/components/CreditCardForm/CreditCardForm.js +4 -4
- package/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/dist/components/CreditCardForm/CreditCardFormStatus.d.ts +1 -0
- package/dist/components/CreditCardForm/CreditCardFormStatus.js +3 -1
- package/dist/components/CreditCardForm/CreditCardFormStatus.js.map +1 -1
- package/dist/components/CreditCardForm/CreditCardFormStatusTracker.js +14 -12
- package/dist/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
- package/dist/components/CreditCardForm/CreditCardFormStep.js +2 -14
- package/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/dist/components/CreditCardForm/PendingStatusContent.d.ts +3 -1
- package/dist/components/CreditCardForm/PendingStatusContent.js +2 -2
- package/dist/components/CreditCardForm/PendingStatusContent.js.map +1 -1
- package/dist/components/CreditCardForm/renderInputs.d.ts +2 -1
- package/dist/components/CreditCardForm/renderInputs.js +1 -1
- package/dist/components/CreditCardForm/renderInputs.js.map +1 -1
- package/dist/components/CreditCardForm/renderStep.d.ts +2 -2
- package/dist/components/CreditCardForm/renderStep.js +2 -2
- package/dist/components/CreditCardForm/renderStep.js.map +1 -1
- package/dist/components/CreditForm/CreditForm.d.ts +5 -2
- package/dist/components/CreditForm/CreditForm.js +6 -20
- package/dist/components/CreditForm/CreditForm.js.map +1 -1
- package/dist/components/CreditForm/CreditFormContent.d.ts +4 -5
- package/dist/components/CreditForm/CreditFormStatusTracker.js +10 -10
- package/dist/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
- package/dist/components/CreditForm/CreditFormStep.d.ts +2 -3
- package/dist/components/CreditForm/CreditFormStep.js +5 -10
- package/dist/components/CreditForm/CreditFormStep.js.map +1 -1
- package/dist/components/CreditForm/ProgramsSourceProps.d.ts +16 -0
- package/dist/components/CreditForm/ProgramsSourceProps.js +2 -0
- package/dist/components/CreditForm/ProgramsSourceProps.js.map +1 -0
- package/dist/components/CreditForm/creditFormStepsData.js +9 -1
- package/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/dist/components/CreditForm/formStateMap.js +9 -7
- package/dist/components/CreditForm/formStateMap.js.map +1 -1
- package/dist/components/CreditForm/getCalcData.d.ts +3 -0
- package/dist/components/CreditForm/getCalcData.js +16 -0
- package/dist/components/CreditForm/getCalcData.js.map +1 -0
- package/dist/components/CreditForm/getCreditFormTaskData.js +3 -2
- package/dist/components/CreditForm/getCreditFormTaskData.js.map +1 -1
- package/dist/components/CreditForm/getSecondStepData.js +0 -1
- package/dist/components/CreditForm/getSecondStepData.js.map +1 -1
- package/dist/components/CreditForm/getZeroStepData.d.ts +1 -1
- package/dist/components/CreditForm/getZeroStepData.js +3 -8
- package/dist/components/CreditForm/getZeroStepData.js.map +1 -1
- package/dist/components/CreditForm/renderInputs.d.ts +2 -1
- package/dist/components/CreditForm/renderInputs.js +1 -1
- package/dist/components/CreditForm/renderInputs.js.map +1 -1
- package/dist/components/CreditForm/renderStep.d.ts +2 -2
- package/dist/components/CreditForm/renderStep.js +2 -2
- package/dist/components/CreditForm/renderStep.js.map +1 -1
- package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +0 -1
- package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +1 -6
- package/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/dist/components/OfficesAtmsMap/filterItems.d.ts +2 -0
- package/dist/components/OfficesAtmsMap/filterItems.js +9 -0
- package/dist/components/OfficesAtmsMap/filterItems.js.map +1 -0
- package/dist/components/OfficesAtmsMap/useOfficesAtmsMapData.js +3 -3
- package/dist/components/OfficesAtmsMap/useOfficesAtmsMapData.js.map +1 -1
- package/dist/hooks/useJSONRef/useJSONRef.js +13 -3
- package/dist/hooks/useJSONRef/useJSONRef.js.map +1 -1
- package/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +14 -9
- package/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -1
- package/dist/ui-kit/FormField/CustomFieldProps.d.ts +1 -0
- package/dist/ui-kit/FormField/Fields/CreditCalcField.d.ts +2 -0
- package/dist/ui-kit/FormField/Fields/CreditCalcField.js +15 -0
- package/dist/ui-kit/FormField/Fields/CreditCalcField.js.map +1 -0
- package/dist/ui-kit/FormField/Fields/RegionField.js +3 -1
- package/dist/ui-kit/FormField/Fields/RegionField.js.map +1 -1
- package/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/dist/ui-kit/FormField/SelectField.js +4 -6
- package/dist/ui-kit/FormField/SelectField.js.map +1 -1
- package/dist/ui-kit/FormField/getField.d.ts +1 -1
- package/dist/ui-kit/FormField/getField.js +5 -4
- package/dist/ui-kit/FormField/getField.js.map +1 -1
- package/lib/api/RetailAPI/getCardTypes.js +1 -1
- package/lib/api/RetailAPI/getCardTypes.js.map +1 -1
- package/lib/api/RetailAPI/updateUserTask.d.ts +5 -4
- package/lib/api/RetailAPI/updateUserTask.js +2 -2
- package/lib/api/RetailAPI/updateUserTask.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationForm.js +1 -1
- package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/lib/components/ApplicationForm/renderInputs.js +1 -1
- package/lib/components/ApplicationForm/renderInputs.js.map +1 -1
- package/lib/components/ApplicationLeadForm/GroupedConsents.js +1 -1
- package/lib/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
- package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +13 -7
- package/lib/components/ApplicationLeadForm/getInitialFormState.js +0 -1
- package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +4 -2
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/CalculatorCredit/CalculatorCredit.d.ts +2 -3
- package/lib/components/CalculatorCredit/CalculatorCredit.js +5 -3
- package/lib/components/CalculatorCredit/CalculatorCredit.js.map +1 -1
- package/lib/components/CalculatorCredit/defaultValueAdapter.d.ts +11 -0
- package/lib/components/CalculatorCredit/defaultValueAdapter.js +15 -0
- package/lib/components/CalculatorCredit/defaultValueAdapter.js.map +1 -0
- package/lib/components/CreditCardForm/CreditCardForm.js +4 -4
- package/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/lib/components/CreditCardForm/CreditCardFormStatus.d.ts +1 -0
- package/lib/components/CreditCardForm/CreditCardFormStatus.js +3 -1
- package/lib/components/CreditCardForm/CreditCardFormStatus.js.map +1 -1
- package/lib/components/CreditCardForm/CreditCardFormStatusTracker.js +14 -12
- package/lib/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
- package/lib/components/CreditCardForm/CreditCardFormStep.js +2 -14
- package/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/lib/components/CreditCardForm/PendingStatusContent.d.ts +3 -1
- package/lib/components/CreditCardForm/PendingStatusContent.js +2 -2
- package/lib/components/CreditCardForm/PendingStatusContent.js.map +1 -1
- package/lib/components/CreditCardForm/renderInputs.d.ts +2 -1
- package/lib/components/CreditCardForm/renderInputs.js +1 -1
- package/lib/components/CreditCardForm/renderInputs.js.map +1 -1
- package/lib/components/CreditCardForm/renderStep.d.ts +2 -2
- package/lib/components/CreditCardForm/renderStep.js +2 -2
- package/lib/components/CreditCardForm/renderStep.js.map +1 -1
- package/lib/components/CreditForm/CreditForm.d.ts +5 -2
- package/lib/components/CreditForm/CreditForm.js +6 -20
- package/lib/components/CreditForm/CreditForm.js.map +1 -1
- package/lib/components/CreditForm/CreditFormContent.d.ts +4 -5
- package/lib/components/CreditForm/CreditFormStatusTracker.js +11 -11
- package/lib/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
- package/lib/components/CreditForm/CreditFormStep.d.ts +2 -3
- package/lib/components/CreditForm/CreditFormStep.js +6 -11
- package/lib/components/CreditForm/CreditFormStep.js.map +1 -1
- package/lib/components/CreditForm/ProgramsSourceProps.d.ts +16 -0
- package/lib/components/CreditForm/ProgramsSourceProps.js +2 -0
- package/lib/components/CreditForm/ProgramsSourceProps.js.map +1 -0
- package/lib/components/CreditForm/creditFormStepsData.js +9 -1
- package/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/lib/components/CreditForm/formStateMap.js +9 -7
- package/lib/components/CreditForm/formStateMap.js.map +1 -1
- package/lib/components/CreditForm/getCalcData.d.ts +3 -0
- package/lib/components/CreditForm/getCalcData.js +13 -0
- package/lib/components/CreditForm/getCalcData.js.map +1 -0
- package/lib/components/CreditForm/getCreditFormTaskData.js +3 -2
- package/lib/components/CreditForm/getCreditFormTaskData.js.map +1 -1
- package/lib/components/CreditForm/getSecondStepData.js +0 -1
- package/lib/components/CreditForm/getSecondStepData.js.map +1 -1
- package/lib/components/CreditForm/getZeroStepData.d.ts +1 -1
- package/lib/components/CreditForm/getZeroStepData.js +3 -8
- package/lib/components/CreditForm/getZeroStepData.js.map +1 -1
- package/lib/components/CreditForm/renderInputs.d.ts +2 -1
- package/lib/components/CreditForm/renderInputs.js +1 -1
- package/lib/components/CreditForm/renderInputs.js.map +1 -1
- package/lib/components/CreditForm/renderStep.d.ts +2 -2
- package/lib/components/CreditForm/renderStep.js +2 -2
- package/lib/components/CreditForm/renderStep.js.map +1 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +0 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +0 -4
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/lib/components/OfficesAtmsMap/filterItems.d.ts +2 -0
- package/lib/components/OfficesAtmsMap/filterItems.js +6 -0
- package/lib/components/OfficesAtmsMap/filterItems.js.map +1 -0
- package/lib/components/OfficesAtmsMap/useOfficesAtmsMapData.js +1 -1
- package/lib/components/OfficesAtmsMap/useOfficesAtmsMapData.js.map +1 -1
- package/lib/hooks/useJSONRef/useJSONRef.js +13 -3
- package/lib/hooks/useJSONRef/useJSONRef.js.map +1 -1
- package/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +14 -9
- package/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -1
- package/lib/ui-kit/FormField/CustomFieldProps.d.ts +1 -0
- package/lib/ui-kit/FormField/Fields/CreditCalcField.d.ts +2 -0
- package/lib/ui-kit/FormField/Fields/CreditCalcField.js +13 -0
- package/lib/ui-kit/FormField/Fields/CreditCalcField.js.map +1 -0
- package/lib/ui-kit/FormField/Fields/RegionField.js +3 -1
- package/lib/ui-kit/FormField/Fields/RegionField.js.map +1 -1
- package/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/lib/ui-kit/FormField/SelectField.js +4 -6
- package/lib/ui-kit/FormField/SelectField.js.map +1 -1
- package/lib/ui-kit/FormField/getField.d.ts +1 -1
- package/lib/ui-kit/FormField/getField.js +5 -4
- package/lib/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/bundle/api/RetailAPI/updateUserTask.d.ts +5 -4
- package/mobile/bundle/bundle.umd.js +698 -655
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +13 -7
- package/mobile/bundle/components/CalculatorCredit/CalculatorCredit.d.ts +2 -3
- package/mobile/bundle/components/CalculatorCredit/defaultValueAdapter.d.ts +11 -0
- package/mobile/bundle/components/CreditCardForm/CreditCardFormStatus.d.ts +1 -0
- package/mobile/bundle/components/CreditCardForm/PendingStatusContent.d.ts +3 -1
- package/mobile/bundle/components/CreditCardForm/renderInputs.d.ts +2 -1
- package/mobile/bundle/components/CreditCardForm/renderStep.d.ts +2 -2
- package/mobile/bundle/components/CreditForm/CreditForm.d.ts +5 -2
- package/mobile/bundle/components/CreditForm/CreditFormContent.d.ts +4 -5
- package/mobile/bundle/components/CreditForm/CreditFormStep.d.ts +2 -3
- package/mobile/bundle/components/CreditForm/ProgramsSourceProps.d.ts +16 -0
- package/mobile/bundle/components/CreditForm/getCalcData.d.ts +3 -0
- package/mobile/bundle/components/CreditForm/getZeroStepData.d.ts +1 -1
- package/mobile/bundle/components/CreditForm/renderInputs.d.ts +2 -1
- package/mobile/bundle/components/CreditForm/renderStep.d.ts +2 -2
- package/mobile/bundle/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +0 -1
- package/mobile/bundle/components/OfficesAtmsMap/filterItems.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/CustomFieldProps.d.ts +1 -0
- package/mobile/bundle/ui-kit/FormField/Fields/CreditCalcField.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/bundle/ui-kit/FormField/getField.d.ts +1 -1
- package/mobile/dist/api/RetailAPI/getCardTypes.js +1 -1
- package/mobile/dist/api/RetailAPI/getCardTypes.js.map +1 -1
- package/mobile/dist/api/RetailAPI/updateUserTask.d.ts +5 -4
- package/mobile/dist/api/RetailAPI/updateUserTask.js +1 -1
- package/mobile/dist/api/RetailAPI/updateUserTask.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/renderInputs.js +1 -1
- package/mobile/dist/components/ApplicationForm/renderInputs.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/GroupedConsents.js +1 -1
- package/mobile/dist/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +13 -7
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js +0 -1
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +4 -2
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/components/CalculatorCredit/CalculatorCredit.d.ts +2 -3
- package/mobile/dist/components/CalculatorCredit/CalculatorCredit.js +5 -3
- package/mobile/dist/components/CalculatorCredit/CalculatorCredit.js.map +1 -1
- package/mobile/dist/components/CalculatorCredit/defaultValueAdapter.d.ts +11 -0
- package/mobile/dist/components/CalculatorCredit/defaultValueAdapter.js +18 -0
- package/mobile/dist/components/CalculatorCredit/defaultValueAdapter.js.map +1 -0
- package/mobile/dist/components/CreditCardForm/CreditCardForm.js +4 -4
- package/mobile/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/CreditCardFormStatus.d.ts +1 -0
- package/mobile/dist/components/CreditCardForm/CreditCardFormStatus.js +3 -1
- package/mobile/dist/components/CreditCardForm/CreditCardFormStatus.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/CreditCardFormStatusTracker.js +14 -12
- package/mobile/dist/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js +2 -14
- package/mobile/dist/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/PendingStatusContent.d.ts +3 -1
- package/mobile/dist/components/CreditCardForm/PendingStatusContent.js +2 -2
- package/mobile/dist/components/CreditCardForm/PendingStatusContent.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/renderInputs.d.ts +2 -1
- package/mobile/dist/components/CreditCardForm/renderInputs.js +1 -1
- package/mobile/dist/components/CreditCardForm/renderInputs.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/renderStep.d.ts +2 -2
- package/mobile/dist/components/CreditCardForm/renderStep.js +2 -2
- package/mobile/dist/components/CreditCardForm/renderStep.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditForm.d.ts +5 -2
- package/mobile/dist/components/CreditForm/CreditForm.js +6 -20
- package/mobile/dist/components/CreditForm/CreditForm.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditFormContent.d.ts +4 -5
- package/mobile/dist/components/CreditForm/CreditFormStatusTracker.js +10 -10
- package/mobile/dist/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditFormStep.d.ts +2 -3
- package/mobile/dist/components/CreditForm/CreditFormStep.js +5 -10
- package/mobile/dist/components/CreditForm/CreditFormStep.js.map +1 -1
- package/mobile/dist/components/CreditForm/ProgramsSourceProps.d.ts +16 -0
- package/mobile/dist/components/CreditForm/ProgramsSourceProps.js +2 -0
- package/mobile/dist/components/CreditForm/ProgramsSourceProps.js.map +1 -0
- package/mobile/dist/components/CreditForm/creditFormStepsData.js +9 -1
- package/mobile/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/mobile/dist/components/CreditForm/formStateMap.js +9 -7
- package/mobile/dist/components/CreditForm/formStateMap.js.map +1 -1
- package/mobile/dist/components/CreditForm/getCalcData.d.ts +3 -0
- package/mobile/dist/components/CreditForm/getCalcData.js +16 -0
- package/mobile/dist/components/CreditForm/getCalcData.js.map +1 -0
- package/mobile/dist/components/CreditForm/getCreditFormTaskData.js +3 -2
- package/mobile/dist/components/CreditForm/getCreditFormTaskData.js.map +1 -1
- package/mobile/dist/components/CreditForm/getSecondStepData.js +0 -1
- package/mobile/dist/components/CreditForm/getSecondStepData.js.map +1 -1
- package/mobile/dist/components/CreditForm/getZeroStepData.d.ts +1 -1
- package/mobile/dist/components/CreditForm/getZeroStepData.js +3 -8
- package/mobile/dist/components/CreditForm/getZeroStepData.js.map +1 -1
- package/mobile/dist/components/CreditForm/renderInputs.d.ts +2 -1
- package/mobile/dist/components/CreditForm/renderInputs.js +1 -1
- package/mobile/dist/components/CreditForm/renderInputs.js.map +1 -1
- package/mobile/dist/components/CreditForm/renderStep.d.ts +2 -2
- package/mobile/dist/components/CreditForm/renderStep.js +2 -2
- package/mobile/dist/components/CreditForm/renderStep.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +0 -1
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +1 -6
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/filterItems.d.ts +2 -0
- package/mobile/dist/components/OfficesAtmsMap/filterItems.js +9 -0
- package/mobile/dist/components/OfficesAtmsMap/filterItems.js.map +1 -0
- package/mobile/dist/components/OfficesAtmsMap/useOfficesAtmsMapData.js +3 -3
- package/mobile/dist/components/OfficesAtmsMap/useOfficesAtmsMapData.js.map +1 -1
- package/mobile/dist/hooks/useJSONRef/useJSONRef.js +13 -3
- package/mobile/dist/hooks/useJSONRef/useJSONRef.js.map +1 -1
- package/mobile/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +14 -9
- package/mobile/dist/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/CustomFieldProps.d.ts +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/CreditCalcField.d.ts +2 -0
- package/mobile/dist/ui-kit/FormField/Fields/CreditCalcField.js +15 -0
- package/mobile/dist/ui-kit/FormField/Fields/CreditCalcField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/RegionField.js +3 -1
- package/mobile/dist/ui-kit/FormField/Fields/RegionField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/dist/ui-kit/FormField/SelectField.js +4 -6
- package/mobile/dist/ui-kit/FormField/SelectField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/getField.d.ts +1 -1
- package/mobile/dist/ui-kit/FormField/getField.js +5 -4
- package/mobile/dist/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/lib/api/RetailAPI/getCardTypes.js +1 -1
- package/mobile/lib/api/RetailAPI/getCardTypes.js.map +1 -1
- package/mobile/lib/api/RetailAPI/updateUserTask.d.ts +5 -4
- package/mobile/lib/api/RetailAPI/updateUserTask.js +2 -2
- package/mobile/lib/api/RetailAPI/updateUserTask.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/renderInputs.js +1 -1
- package/mobile/lib/components/ApplicationForm/renderInputs.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/GroupedConsents.js +1 -1
- package/mobile/lib/components/ApplicationLeadForm/GroupedConsents.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +13 -7
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js +0 -1
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +4 -2
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/components/CalculatorCredit/CalculatorCredit.d.ts +2 -3
- package/mobile/lib/components/CalculatorCredit/CalculatorCredit.js +5 -3
- package/mobile/lib/components/CalculatorCredit/CalculatorCredit.js.map +1 -1
- package/mobile/lib/components/CalculatorCredit/defaultValueAdapter.d.ts +11 -0
- package/mobile/lib/components/CalculatorCredit/defaultValueAdapter.js +15 -0
- package/mobile/lib/components/CalculatorCredit/defaultValueAdapter.js.map +1 -0
- package/mobile/lib/components/CreditCardForm/CreditCardForm.js +4 -4
- package/mobile/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardFormStatus.d.ts +1 -0
- package/mobile/lib/components/CreditCardForm/CreditCardFormStatus.js +3 -1
- package/mobile/lib/components/CreditCardForm/CreditCardFormStatus.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardFormStatusTracker.js +14 -12
- package/mobile/lib/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js +2 -14
- package/mobile/lib/components/CreditCardForm/CreditCardFormStep.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/PendingStatusContent.d.ts +3 -1
- package/mobile/lib/components/CreditCardForm/PendingStatusContent.js +2 -2
- package/mobile/lib/components/CreditCardForm/PendingStatusContent.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/renderInputs.d.ts +2 -1
- package/mobile/lib/components/CreditCardForm/renderInputs.js +1 -1
- package/mobile/lib/components/CreditCardForm/renderInputs.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/renderStep.d.ts +2 -2
- package/mobile/lib/components/CreditCardForm/renderStep.js +2 -2
- package/mobile/lib/components/CreditCardForm/renderStep.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditForm.d.ts +5 -2
- package/mobile/lib/components/CreditForm/CreditForm.js +6 -20
- package/mobile/lib/components/CreditForm/CreditForm.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditFormContent.d.ts +4 -5
- package/mobile/lib/components/CreditForm/CreditFormStatusTracker.js +11 -11
- package/mobile/lib/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditFormStep.d.ts +2 -3
- package/mobile/lib/components/CreditForm/CreditFormStep.js +6 -11
- package/mobile/lib/components/CreditForm/CreditFormStep.js.map +1 -1
- package/mobile/lib/components/CreditForm/ProgramsSourceProps.d.ts +16 -0
- package/mobile/lib/components/CreditForm/ProgramsSourceProps.js +2 -0
- package/mobile/lib/components/CreditForm/ProgramsSourceProps.js.map +1 -0
- package/mobile/lib/components/CreditForm/creditFormStepsData.js +9 -1
- package/mobile/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/mobile/lib/components/CreditForm/formStateMap.js +9 -7
- package/mobile/lib/components/CreditForm/formStateMap.js.map +1 -1
- package/mobile/lib/components/CreditForm/getCalcData.d.ts +3 -0
- package/mobile/lib/components/CreditForm/getCalcData.js +13 -0
- package/mobile/lib/components/CreditForm/getCalcData.js.map +1 -0
- package/mobile/lib/components/CreditForm/getCreditFormTaskData.js +3 -2
- package/mobile/lib/components/CreditForm/getCreditFormTaskData.js.map +1 -1
- package/mobile/lib/components/CreditForm/getSecondStepData.js +0 -1
- package/mobile/lib/components/CreditForm/getSecondStepData.js.map +1 -1
- package/mobile/lib/components/CreditForm/getZeroStepData.d.ts +1 -1
- package/mobile/lib/components/CreditForm/getZeroStepData.js +3 -8
- package/mobile/lib/components/CreditForm/getZeroStepData.js.map +1 -1
- package/mobile/lib/components/CreditForm/renderInputs.d.ts +2 -1
- package/mobile/lib/components/CreditForm/renderInputs.js +1 -1
- package/mobile/lib/components/CreditForm/renderInputs.js.map +1 -1
- package/mobile/lib/components/CreditForm/renderStep.d.ts +2 -2
- package/mobile/lib/components/CreditForm/renderStep.js +2 -2
- package/mobile/lib/components/CreditForm/renderStep.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +0 -1
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js +0 -4
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/filterItems.d.ts +2 -0
- package/mobile/lib/components/OfficesAtmsMap/filterItems.js +6 -0
- package/mobile/lib/components/OfficesAtmsMap/filterItems.js.map +1 -0
- package/mobile/lib/components/OfficesAtmsMap/useOfficesAtmsMapData.js +1 -1
- package/mobile/lib/components/OfficesAtmsMap/useOfficesAtmsMapData.js.map +1 -1
- package/mobile/lib/hooks/useJSONRef/useJSONRef.js +13 -3
- package/mobile/lib/hooks/useJSONRef/useJSONRef.js.map +1 -1
- package/mobile/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js +14 -9
- package/mobile/lib/ui-kit/ConsentBkiDialog/useConsentBkiDialog.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/CustomFieldProps.d.ts +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/CreditCalcField.d.ts +2 -0
- package/mobile/lib/ui-kit/FormField/Fields/CreditCalcField.js +13 -0
- package/mobile/lib/ui-kit/FormField/Fields/CreditCalcField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/RegionField.js +3 -1
- package/mobile/lib/ui-kit/FormField/Fields/RegionField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/lib/ui-kit/FormField/SelectField.js +4 -6
- package/mobile/lib/ui-kit/FormField/SelectField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/getField.d.ts +1 -1
- package/mobile/lib/ui-kit/FormField/getField.js +5 -4
- package/mobile/lib/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/src/api/RetailAPI/getCardTypes.ts +1 -1
- package/mobile/src/api/RetailAPI/updateUserTask.ts +6 -5
- package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +1 -1
- package/mobile/src/components/ApplicationForm/renderInputs.tsx +2 -2
- package/mobile/src/components/ApplicationLeadForm/GroupedConsents.tsx +1 -1
- package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +13 -7
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.ts +19 -7
- package/mobile/src/components/CalculatorCredit/CalculatorCredit.tsx +7 -5
- package/mobile/src/components/CalculatorCredit/defaultValueAdapter.ts +26 -0
- package/mobile/src/components/CreditCardForm/CreditCardForm.tsx +4 -8
- package/mobile/src/components/CreditCardForm/CreditCardFormStatus.tsx +7 -1
- package/mobile/src/components/CreditCardForm/CreditCardFormStatusTracker.tsx +14 -8
- package/mobile/src/components/CreditCardForm/CreditCardFormStep.tsx +3 -18
- package/mobile/src/components/CreditCardForm/PendingStatusContent.tsx +24 -21
- package/mobile/src/components/CreditCardForm/renderInputs.tsx +3 -2
- package/mobile/src/components/CreditCardForm/renderStep.tsx +3 -4
- package/mobile/src/components/CreditForm/CreditForm.tsx +12 -30
- package/mobile/src/components/CreditForm/CreditFormContent.ts +5 -8
- package/mobile/src/components/CreditForm/CreditFormStatusTracker.tsx +14 -13
- package/mobile/src/components/CreditForm/CreditFormStep.tsx +10 -24
- package/mobile/src/components/CreditForm/ProgramsSourceProps.tsx +20 -0
- package/mobile/src/components/CreditForm/creditFormStepsData.tsx +9 -1
- package/mobile/src/components/CreditForm/formStateMap.tsx +9 -7
- package/mobile/src/components/CreditForm/getCalcData.ts +19 -0
- package/mobile/src/components/CreditForm/getCreditFormTaskData.ts +3 -2
- package/mobile/src/components/CreditForm/getSecondStepData.tsx +0 -1
- package/mobile/src/components/CreditForm/getZeroStepData.ts +7 -11
- package/mobile/src/components/CreditForm/renderInputs.tsx +3 -2
- package/mobile/src/components/CreditForm/renderStep.tsx +3 -3
- package/mobile/src/components/OfficesAtmsMap/OfficesAtmsMapLayout.tsx +0 -9
- package/mobile/src/components/OfficesAtmsMap/filterItems.tsx +11 -0
- package/mobile/src/components/OfficesAtmsMap/useOfficesAtmsMapData.tsx +1 -1
- package/mobile/src/hooks/useJSONRef/useJSONRef.ts +21 -4
- package/mobile/src/ui-kit/ConsentBkiDialog/useConsentBkiDialog.tsx +14 -10
- package/mobile/src/ui-kit/FormField/CustomFieldProps.ts +1 -0
- package/mobile/src/ui-kit/FormField/Fields/CreditCalcField.tsx +24 -0
- package/mobile/src/ui-kit/FormField/Fields/RegionField.tsx +4 -1
- package/mobile/src/ui-kit/FormField/NameFieldDef.ts +1 -0
- package/mobile/src/ui-kit/FormField/SelectField.tsx +4 -6
- package/mobile/src/ui-kit/FormField/getField.tsx +5 -4
- package/package.json +3 -2
- package/src/api/RetailAPI/getCardTypes.ts +1 -1
- package/src/api/RetailAPI/updateUserTask.ts +6 -5
- package/src/components/ApplicationForm/ApplicationForm.tsx +1 -1
- package/src/components/ApplicationForm/renderInputs.tsx +2 -2
- package/src/components/ApplicationLeadForm/GroupedConsents.tsx +1 -1
- package/src/components/ApplicationLeadForm/getInitialFormState.tsx +13 -7
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.ts +19 -7
- package/src/components/CalculatorCredit/CalculatorCredit.tsx +7 -5
- package/src/components/CalculatorCredit/defaultValueAdapter.ts +26 -0
- package/src/components/CreditCardForm/CreditCardForm.tsx +4 -8
- package/src/components/CreditCardForm/CreditCardFormStatus.tsx +7 -1
- package/src/components/CreditCardForm/CreditCardFormStatusTracker.tsx +14 -8
- package/src/components/CreditCardForm/CreditCardFormStep.tsx +3 -18
- package/src/components/CreditCardForm/PendingStatusContent.tsx +24 -21
- package/src/components/CreditCardForm/renderInputs.tsx +3 -2
- package/src/components/CreditCardForm/renderStep.tsx +3 -4
- package/src/components/CreditForm/CreditForm.fixture.tsx +6 -1
- package/src/components/CreditForm/CreditForm.tsx +12 -30
- package/src/components/CreditForm/CreditFormContent.ts +5 -8
- package/src/components/CreditForm/CreditFormStatusTracker.tsx +14 -13
- package/src/components/CreditForm/CreditFormStep.tsx +10 -24
- package/src/components/CreditForm/ProgramsSourceProps.tsx +20 -0
- package/src/components/CreditForm/creditFormStepsData.tsx +9 -1
- package/src/components/CreditForm/formStateMap.tsx +9 -7
- package/src/components/CreditForm/getCalcData.ts +19 -0
- package/src/components/CreditForm/getCreditFormTaskData.ts +3 -2
- package/src/components/CreditForm/getSecondStepData.tsx +0 -1
- package/src/components/CreditForm/getZeroStepData.ts +7 -11
- package/src/components/CreditForm/renderInputs.tsx +3 -2
- package/src/components/CreditForm/renderStep.tsx +3 -3
- package/src/components/OfficesAtmsMap/OfficesAtmsMapLayout.tsx +0 -9
- package/src/components/OfficesAtmsMap/filterItems.tsx +11 -0
- package/src/components/OfficesAtmsMap/useOfficesAtmsMapData.tsx +1 -1
- package/src/hooks/useJSONRef/useJSONRef.ts +21 -4
- package/src/ui-kit/ConsentBkiDialog/useConsentBkiDialog.tsx +14 -10
- package/src/ui-kit/FormField/CustomFieldProps.ts +1 -0
- package/src/ui-kit/FormField/Fields/CreditCalcField.tsx +24 -0
- package/src/ui-kit/FormField/Fields/RegionField.tsx +4 -1
- package/src/ui-kit/FormField/NameFieldDef.ts +1 -0
- package/src/ui-kit/FormField/SelectField.tsx +4 -6
- package/src/ui-kit/FormField/getField.tsx +5 -4
|
@@ -966,12 +966,22 @@
|
|
|
966
966
|
const refs = collectRef(content);
|
|
967
967
|
const [refsMap, setRefsMap] = useState({});
|
|
968
968
|
useEffect(() => {
|
|
969
|
-
|
|
970
|
-
fetchRefs(refs).then(setRefsMap);
|
|
971
|
-
}
|
|
969
|
+
resolveRefs(refs).then(setRefsMap);
|
|
972
970
|
}, [refs.join()]);
|
|
973
971
|
return refs.length ? resolveBlockProps(content, { ...fallback, ...refsMap }) : content;
|
|
974
972
|
};
|
|
973
|
+
const resolveRefs = async (refs, parentRefsMap = {}) => {
|
|
974
|
+
if (refs.length) {
|
|
975
|
+
const refsMap = await fetchRefs(refs);
|
|
976
|
+
const unionRefsMap = { ...parentRefsMap, ...refsMap };
|
|
977
|
+
const additRefs = Object.entries(refsMap).flatMap(([, v]) => collectRef(v));
|
|
978
|
+
if (additRefs.length) {
|
|
979
|
+
return resolveRefs(additRefs, unionRefsMap);
|
|
980
|
+
}
|
|
981
|
+
return unionRefsMap;
|
|
982
|
+
}
|
|
983
|
+
return parentRefsMap;
|
|
984
|
+
};
|
|
975
985
|
|
|
976
986
|
const extractContent = ({ block, options, className, defaultPadding, padding, isTheme, version, children, ...content }) => content;
|
|
977
987
|
|
|
@@ -1201,9 +1211,6 @@
|
|
|
1201
1211
|
|
|
1202
1212
|
const getConsentDataProcessing = (inputs) => inputs?.find((_) => _?.name === 'consentDataProcessing');
|
|
1203
1213
|
|
|
1204
|
-
const OUT_SERVICE_URL = `${API_BASE_URI}/outservice/outserviceregions`;
|
|
1205
|
-
const getRegionUrl = (typeForm) => typeForm === 'OUTSERVICE' ? OUT_SERVICE_URL : undefined;
|
|
1206
|
-
|
|
1207
1214
|
function useBool(defaultValue = false) {
|
|
1208
1215
|
const [value, setValue] = useState(defaultValue);
|
|
1209
1216
|
const setTrue = useCallback(() => setValue(true), []);
|
|
@@ -2428,11 +2435,6 @@
|
|
|
2428
2435
|
return { header, body };
|
|
2429
2436
|
};
|
|
2430
2437
|
|
|
2431
|
-
const isSSR = () => Boolean(typeof globalThis.process === 'object' && globalThis.process && globalThis.process.version);
|
|
2432
|
-
|
|
2433
|
-
const isClient = !isSSR();
|
|
2434
|
-
const ClientOnly = JSX(({ children }) => (isClient ? children : null));
|
|
2435
|
-
|
|
2436
2438
|
const INITIAL_FILTRATION_STATE$1 = {
|
|
2437
2439
|
workingSaturday: false,
|
|
2438
2440
|
premiumService: false,
|
|
@@ -2477,103 +2479,13 @@
|
|
|
2477
2479
|
transferringDataToBiometricSystem: (item) => Boolean('transferringDataToBiometricSystem' in item && item.transferringDataToBiometricSystem),
|
|
2478
2480
|
};
|
|
2479
2481
|
|
|
2480
|
-
function useButton() {
|
|
2481
|
-
return (props) => ({
|
|
2482
|
-
...props,
|
|
2483
|
-
onClick: handlerDecorator(handleClick(props)),
|
|
2484
|
-
});
|
|
2485
|
-
}
|
|
2486
|
-
function handleClick({ disabled, onClick }) {
|
|
2487
|
-
return (ev) => {
|
|
2488
|
-
!disabled && onClick && onClick(ev);
|
|
2489
|
-
};
|
|
2490
|
-
}
|
|
2491
|
-
|
|
2492
|
-
const buttonStyleMap = {
|
|
2493
|
-
primary: 'text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active',
|
|
2494
|
-
secondary: 'text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active',
|
|
2495
|
-
};
|
|
2496
|
-
const secondaryButtonStyleMap = {
|
|
2497
|
-
primary: style('group-data-secondary:text-primary-main group-data-secondary:bg-white', 'group-data-secondary:hover:text-white group-data-secondary:hover:bg-primary-hover', 'group-data-secondary:active:bg-primary-active'),
|
|
2498
|
-
secondary: style('group-data-secondary:text-white group-data-secondary:bg-white/20', 'group-data-secondary:hover:bg-primary-hover', 'group-data-secondary:active:bg-primary-active'),
|
|
2499
|
-
};
|
|
2500
|
-
const Button = JSX(({ children, ...props }) => {
|
|
2501
|
-
const button = useButton();
|
|
2502
|
-
const { className, version = 'primary', active, disabled, type = 'button', rounded = true, role, onClick, } = button(props);
|
|
2503
|
-
return (jsx("button", { className: style('font-sans px-9 py-4', 'flex justify-center items-center gap-xs', {
|
|
2504
|
-
'text-white bg-primary-active': active,
|
|
2505
|
-
'bg-main-gray text-main-disabled cursor-not-allowed': disabled,
|
|
2506
|
-
'rounded-md': rounded,
|
|
2507
|
-
}, !active && !disabled
|
|
2508
|
-
? style(buttonStyleMap[version], secondaryButtonStyleMap[version])
|
|
2509
|
-
: '', className), type: type, role: role, onClick: onClick, children: children }));
|
|
2510
|
-
});
|
|
2511
|
-
|
|
2512
|
-
const getVersion = (isPrimary, type) => isPrimary && type !== 'underlined' ? 'primary' : 'secondary';
|
|
2513
|
-
|
|
2514
|
-
const renderButtonsGroup = (data, activeButton, onButtonClick) => {
|
|
2515
|
-
const allButtonVersion = getVersion(activeButton === 'all');
|
|
2516
|
-
const businessButtonVersion = getVersion(activeButton === 'business');
|
|
2517
|
-
const handleClick = (e, key, branches) => {
|
|
2518
|
-
const filteredBranches = e.currentTarget === e.target && key === 'business' ? filterBranches(branches) : branches;
|
|
2519
|
-
onButtonClick(key);
|
|
2520
|
-
return filteredBranches;
|
|
2521
|
-
};
|
|
2522
|
-
const filterBranches = (branches) => branches.filter((branch) => branch.workSchedule &&
|
|
2523
|
-
branch.workSchedule.businessScheduleVisibleTag &&
|
|
2524
|
-
!branch.workSchedule.businessScheduleDescription);
|
|
2525
|
-
return (jsxs("div", { className: "flex gap-lg flex-col sm:flex-row pb-lg", children: [jsx(Button, { "data-id": "all", onClick: (e) => handleClick(e, 'all', data), version: allButtonVersion, children: "\u0414\u043B\u044F \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043B\u0438\u0446" }), jsx(Button, { "data-id": "business", onClick: (e) => handleClick(e, 'business', data), version: businessButtonVersion, children: "\u0414\u043B\u044F \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043B\u0438\u0446" })] }));
|
|
2526
|
-
};
|
|
2527
|
-
|
|
2528
|
-
const renderDescriptionBlock$1 = ({ __html, list, richVersion }) => __html || list?.length ? (jsxs("div", { className: "mb-2xl border-b sm:border border-main-divider sm:rounded-md", children: [__html ? (jsx("div", { className: "mb-2xl", children: jsx(RichText, { __html: __html, richVersion: richVersion }) })) : null, list?.length ? (jsx("div", { className: "flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl", children: list.map((item, i) => (jsxs("div", { className: "flex gap-xs items-center", children: [item?.image ? jsx(Img, { image: item.image }) : null, item?.text ? (jsx(Text, { size: "text-m", font: "font-light", children: item.text })) : null] }, String(i)))) })) : null] })) : null;
|
|
2529
|
-
|
|
2530
|
-
const COMMON_FILTERS_STYLES = 'flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl';
|
|
2531
|
-
const renderFiltrationForm = ({ filters, field: { field, reset }, onlyOffice, labels, }) => {
|
|
2532
|
-
const visibleFiltersNum = onlyOffice ? 5 : 6;
|
|
2533
|
-
const filtersCheckbox = (filters || []).map((key) => (jsx(Checkbox, { text: labels[key], ...field(key) }, key)));
|
|
2534
|
-
const [visibleFilters, hiddenFilters] = visibleFiltersNum > 0
|
|
2535
|
-
? [filtersCheckbox.slice(0, visibleFiltersNum), filtersCheckbox.slice(visibleFiltersNum)]
|
|
2536
|
-
: [filtersCheckbox, []];
|
|
2537
|
-
return (jsx("div", { children: filters?.length ? (jsx("div", { children: jsx(Foldable, { renderFoldableSection: ({ isUnfolded }) => (jsxs("div", { children: [jsx("div", { className: COMMON_FILTERS_STYLES, children: visibleFilters }), jsx(FoldableSection, { className: COMMON_FILTERS_STYLES, isUnfolded: isUnfolded, children: hiddenFilters })] })), renderFoldButton: renderFoldButton$2(reset, onlyOffice) }) })) : null }));
|
|
2538
|
-
};
|
|
2539
|
-
const renderFoldButton$2 = (reset, onlyOffice = false) => ({ isUnfolded, onToggle }) => {
|
|
2540
|
-
const labels = ['Больше фильтров', 'Меньше фильтров'];
|
|
2541
|
-
const icons = ['ArrowDownIcon', 'ArrowUpIcon'];
|
|
2542
|
-
return (jsxs("div", { className: "flex space-x-lg", children: [onlyOffice ? (jsx(LinkButton, { version: "transparent", className: "text-secondary-text [&>*]:p-0", appendRight: jsx(Icon, { name: icons[Number(isUnfolded)], width: "16", height: "16" }), text: labels[Number(isUnfolded)], onClick: onToggle })) : null, jsx(LinkButton, { version: "transparent", className: "text-secondary-text [&>*]:p-0", onClick: reset, children: renderBtnInner() })] }));
|
|
2543
|
-
};
|
|
2544
|
-
const renderBtnInner = () => (jsxs("div", { className: "flex items-center", children: ["\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440", jsx(Icon, { name: "CloseIcon", width: "16", height: "16", className: "ml-2xs" })] }));
|
|
2545
|
-
|
|
2546
|
-
const renderHeading = (title, lengthItems) => (jsx("div", { className: "flex flex-col sm:flex-row gap-xs mb-2xl", children: jsxs(Heading, { headingType: "h3", children: [jsx("span", { suppressHydrationWarning: true, children: title }), lengthItems ? (jsx(Text, { size: "text-h2", color: "text-secondary-text", children: jsx("span", { suppressHydrationWarning: true, children: ` (${lengthItems})` }) })) : null] }) }));
|
|
2547
|
-
|
|
2548
|
-
const defaultEmptyFunction$1 = () => void 0;
|
|
2549
|
-
const filtersVisibleStyles = (activeButton) => activeButton === 'all' ? 'block' : 'hidden';
|
|
2550
|
-
const OfficesAtmsMapLayout = JSX(({ className, data = [], isLoad, remoteWorkplaces = [], renderCard = defaultEmptyFunction$1, renderRemoteWorkplaceCard = defaultEmptyFunction$1, getBalloon = defaultEmptyFunction$1, getBalloonRemoteWorkplaces = defaultEmptyFunction$1, descriptionData, title, }) => {
|
|
2551
|
-
const onlyOffice = title?.includes('Офис');
|
|
2552
|
-
const [filtrationState, { field, reset }] = useForm(INITIAL_FILTRATION_STATE$1);
|
|
2553
|
-
const { filteredItems, points, filteredRemoteWorkplaces, lengthItems } = useOfficesAtmsMapData({
|
|
2554
|
-
data,
|
|
2555
|
-
remoteWorkplaces,
|
|
2556
|
-
filtrationState,
|
|
2557
|
-
getBalloon,
|
|
2558
|
-
getBalloonRemoteWorkplaces,
|
|
2559
|
-
});
|
|
2560
|
-
const [activeButton, setActiveButton] = useState('all');
|
|
2561
|
-
const filterOptions = {
|
|
2562
|
-
filters: getFiltersWithNonEmptyData([...data, ...remoteWorkplaces]),
|
|
2563
|
-
field: { field, reset },
|
|
2564
|
-
onlyOffice,
|
|
2565
|
-
labels: FILTRATION_LABELS,
|
|
2566
|
-
};
|
|
2567
|
-
return (jsxs("div", { className: style('space-y-1', className), children: [jsxs("div", { className: "bg-white", children: [jsxs("div", { className: "p-3xl pb-0", children: [renderHeading(title, lengthItems), descriptionData ? renderDescriptionBlock$1(descriptionData) : null, onlyOffice && renderButtonsGroup(data, activeButton, setActiveButton), jsx("div", { className: style('pb-3xl', filtersVisibleStyles(activeButton)), children: renderFiltrationForm(filterOptions) })] }), jsx("div", { className: "h-[600px]", children: jsx(ClientOnly, { children: jsx(YandexMap, { points: points, isLoad: isLoad, className: "h-full" }) }) })] }), jsxs(ClientOnly, { children: [filteredItems.map(renderCard), filteredRemoteWorkplaces.map(renderRemoteWorkplaceCard)] })] }));
|
|
2568
|
-
});
|
|
2569
2482
|
const filterItems$1 = (data, filtrationState) => {
|
|
2570
2483
|
const truthyFilters = Object.keys(filtrationState).filter((key) => filtrationState[key]);
|
|
2571
2484
|
return data.filter((item) => truthyFilters.every((_) => FILTRATION_PREDICATES$1[_](item)));
|
|
2572
2485
|
};
|
|
2573
|
-
const getFiltersWithNonEmptyData = (data) => Object.keys(INITIAL_FILTRATION_STATE$1).filter((_) => data.filter((item) => FILTRATION_PREDICATES$1[_](item)).length);
|
|
2574
2486
|
|
|
2575
|
-
const defaultEmptyFunction = () => void 0;
|
|
2576
|
-
const useOfficesAtmsMapData = ({ data, remoteWorkplaces = [], filtrationState = {}, getBalloon = defaultEmptyFunction, getBalloonRemoteWorkplaces = defaultEmptyFunction, }) => {
|
|
2487
|
+
const defaultEmptyFunction$1 = () => void 0;
|
|
2488
|
+
const useOfficesAtmsMapData = ({ data, remoteWorkplaces = [], filtrationState = {}, getBalloon = defaultEmptyFunction$1, getBalloonRemoteWorkplaces = defaultEmptyFunction$1, }) => {
|
|
2577
2489
|
const [filteredItems, points, filteredRemoteWorkplaces, lengthItems] = useMemo(() => {
|
|
2578
2490
|
const _filteredItems = filterItems$1(data, filtrationState);
|
|
2579
2491
|
const _filteredRemoteWorkplaces = filterItems$1(remoteWorkplaces, filtrationState);
|
|
@@ -2610,6 +2522,11 @@
|
|
|
2610
2522
|
return result || [];
|
|
2611
2523
|
};
|
|
2612
2524
|
|
|
2525
|
+
const isSSR = () => Boolean(typeof globalThis.process === 'object' && globalThis.process && globalThis.process.version);
|
|
2526
|
+
|
|
2527
|
+
const isClient = !isSSR();
|
|
2528
|
+
const ClientOnly = JSX(({ children }) => (isClient ? children : null));
|
|
2529
|
+
|
|
2613
2530
|
const AddressRetailField = JSX(({ field, input }) => {
|
|
2614
2531
|
const [offices, setOffices] = useState([]);
|
|
2615
2532
|
const { data } = useLeadFormData('REGION_RF');
|
|
@@ -2701,12 +2618,10 @@
|
|
|
2701
2618
|
const AmountField = JSX(({ field }) => (jsx(InputRange, { title: "\u0421\u0443\u043C\u043C\u0430, \u20BD", items: ITEMS_CREDIT_AMOUNT, min: MIN_CREDIT_AMOUNT, max: MAX_CREDIT_AMOUNT, ...field('amount') })));
|
|
2702
2619
|
|
|
2703
2620
|
const SelectField = UniBlock(({ field, source, label, fieldName, input, placeholder = 'Выберите из списка', isSearch = false, }) => {
|
|
2704
|
-
const leadOptions = (
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
}))) ||
|
|
2709
|
-
[];
|
|
2621
|
+
const leadOptions = source?.map((_) => ({
|
|
2622
|
+
key: _.key || '',
|
|
2623
|
+
text: _.value,
|
|
2624
|
+
})) || [];
|
|
2710
2625
|
return (jsx(SelectControl, { placeholder: placeholder, label: label, options: leadOptions, isSearch: isSearch, ...getValidation(field(fieldName), validatorObj[fieldName], input?.required) }));
|
|
2711
2626
|
});
|
|
2712
2627
|
|
|
@@ -3006,8 +2921,8 @@
|
|
|
3006
2921
|
|
|
3007
2922
|
const BirthdayField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...getValidation(field('birthday'), validatorObj.birthday, input?.required) })));
|
|
3008
2923
|
|
|
3009
|
-
const FIELD_NAME$
|
|
3010
|
-
const BirthPlaceField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041C\u0435\u0441\u0442\u043E \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...getValidation(field('birthPlace'), validatorObj.birthPlace, input?.required), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME$
|
|
2924
|
+
const FIELD_NAME$a = 'birthPlace';
|
|
2925
|
+
const BirthPlaceField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041C\u0435\u0441\u0442\u043E \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...getValidation(field('birthPlace'), validatorObj.birthPlace, input?.required), ...input, disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME$a) })));
|
|
3011
2926
|
|
|
3012
2927
|
const getCardTypes = async (paymentSystemType) => {
|
|
3013
2928
|
const response = await doRequest('/dictionaryFiltered', 'POST', {
|
|
@@ -3015,7 +2930,7 @@
|
|
|
3015
2930
|
presets: { paymentSystemType, creditProgramId: 13 },
|
|
3016
2931
|
});
|
|
3017
2932
|
const data = await response?.json();
|
|
3018
|
-
return data;
|
|
2933
|
+
return Array.isArray(data) ? data : [];
|
|
3019
2934
|
};
|
|
3020
2935
|
|
|
3021
2936
|
const CardCategoryField = JSX(({ field, input }) => {
|
|
@@ -3074,6 +2989,38 @@
|
|
|
3074
2989
|
},
|
|
3075
2990
|
};
|
|
3076
2991
|
|
|
2992
|
+
function useButton() {
|
|
2993
|
+
return (props) => ({
|
|
2994
|
+
...props,
|
|
2995
|
+
onClick: handlerDecorator(handleClick(props)),
|
|
2996
|
+
});
|
|
2997
|
+
}
|
|
2998
|
+
function handleClick({ disabled, onClick }) {
|
|
2999
|
+
return (ev) => {
|
|
3000
|
+
!disabled && onClick && onClick(ev);
|
|
3001
|
+
};
|
|
3002
|
+
}
|
|
3003
|
+
|
|
3004
|
+
const buttonStyleMap = {
|
|
3005
|
+
primary: 'text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active',
|
|
3006
|
+
secondary: 'text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active',
|
|
3007
|
+
};
|
|
3008
|
+
const secondaryButtonStyleMap = {
|
|
3009
|
+
primary: style('group-data-secondary:text-primary-main group-data-secondary:bg-white', 'group-data-secondary:hover:text-white group-data-secondary:hover:bg-primary-hover', 'group-data-secondary:active:bg-primary-active'),
|
|
3010
|
+
secondary: style('group-data-secondary:text-white group-data-secondary:bg-white/20', 'group-data-secondary:hover:bg-primary-hover', 'group-data-secondary:active:bg-primary-active'),
|
|
3011
|
+
};
|
|
3012
|
+
const Button = JSX(({ children, ...props }) => {
|
|
3013
|
+
const button = useButton();
|
|
3014
|
+
const { className, version = 'primary', active, disabled, type = 'button', rounded = true, role, onClick, } = button(props);
|
|
3015
|
+
return (jsx("button", { className: style('font-sans px-9 py-4', 'flex justify-center items-center gap-xs', {
|
|
3016
|
+
'text-white bg-primary-active': active,
|
|
3017
|
+
'bg-main-gray text-main-disabled cursor-not-allowed': disabled,
|
|
3018
|
+
'rounded-md': rounded,
|
|
3019
|
+
}, !active && !disabled
|
|
3020
|
+
? style(buttonStyleMap[version], secondaryButtonStyleMap[version])
|
|
3021
|
+
: '', className), type: type, role: role, onClick: onClick, children: children }));
|
|
3022
|
+
});
|
|
3023
|
+
|
|
3077
3024
|
const feedbackById = async (id, convertToPng = false) => {
|
|
3078
3025
|
const response = await doRequest(`/feedback/file?id=${encodeURIComponent(id)}&convertToPngFlg=${convertToPng}`, 'GET');
|
|
3079
3026
|
return response ? await response.blob() : new Blob();
|
|
@@ -3109,69 +3056,375 @@
|
|
|
3109
3056
|
|
|
3110
3057
|
const ConsentField = JSX(({ field, input }) => input && input.name ? (jsx(CheckboxWithDoc, { text: CONSENTS[input.name]?.text, docId: CONSENTS[input.name]?.docId, ...getValidation(field(input.name), validatorObj[input.name], input?.required) })) : null);
|
|
3111
3058
|
|
|
3112
|
-
const
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
const
|
|
3116
|
-
|
|
3117
|
-
return (jsx(SelectField, { field: field, source: creditInRshbCd, label: LABEL_TEXT, fieldName: "creditInRshbCd", input: input }));
|
|
3118
|
-
});
|
|
3119
|
-
|
|
3120
|
-
const orientationStyleMap = {
|
|
3121
|
-
horizontal: '@lg:flex-row',
|
|
3122
|
-
vertical: '',
|
|
3123
|
-
};
|
|
3124
|
-
const RadioButtonGroup = JSX(({ label, items, value, className, onChange: onChangeCheckedItem, disabled = false, orientation = 'horizontal', }) => (jsxs("div", { className: "grid gap-xs whitespace-nowrap", children: [label ? (jsx("div", { role: "radiogroup", "aria-label": label, children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: label }) })) : null, jsx("div", { className: style('flex flex-col gap-s', orientationStyleMap[orientation], className), role: "radiogroup", "aria-label": "\u0413\u0440\u0443\u043F\u043F\u0430 \u043A\u043D\u043E\u043F\u043E\u043A", children: items?.map(({ id, text }) => (jsx(Checkbox, { isRadio: true, text: text, value: value === id, onChange: () => onChangeCheckedItem && onChangeCheckedItem(id), disabled: disabled }, String(id)))) })] })));
|
|
3059
|
+
const MONTHS_IN_YEAR$1 = 12;
|
|
3060
|
+
const MONTHLY_INTEREST_RATE = MONTHS_IN_YEAR$1 * 100;
|
|
3061
|
+
const DEFAULT_MIN_MONTHS = 1;
|
|
3062
|
+
const DEFAULT_MAX_MONTHS = 60;
|
|
3063
|
+
const DEFAULT_MONTHS = Math.round((DEFAULT_MAX_MONTHS - DEFAULT_MIN_MONTHS) / 2);
|
|
3125
3064
|
|
|
3126
|
-
const
|
|
3065
|
+
const CalculatorLayout = JSX(({ className, title, children, ...rest }) => (jsxs(BlockWrapper, { className: style('space-y-xl', className), defaultPadding: "p-4xl", ...rest, children: [title ? jsx(Heading, { className: "text-center", title: title }) : null, children] })));
|
|
3127
3066
|
|
|
3128
|
-
const
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
}
|
|
3067
|
+
const CalculatorStyle = {
|
|
3068
|
+
wrapper: 'flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl',
|
|
3069
|
+
input: 'flex flex-col lg:max-w-80 lg:w-1/2 gap-2xl',
|
|
3070
|
+
result: 'flex flex-col gap-y-xl min-w-52',
|
|
3071
|
+
};
|
|
3133
3072
|
|
|
3134
|
-
const
|
|
3073
|
+
const FormatValue = JSX(({ value, fractionDigits, fixed, prefix, postfix }) => (jsx(Text, { size: "text-h3", children: typeof value === 'number'
|
|
3074
|
+
? [prefix, toLocalNumberFormat(fractionDigits, { fixed })(value), postfix]
|
|
3075
|
+
.filter(Boolean)
|
|
3076
|
+
.join(' ')
|
|
3077
|
+
: value })));
|
|
3135
3078
|
|
|
3136
|
-
const
|
|
3079
|
+
const CalculatorValueStyle = 'flex justify-between @xl:flex-col';
|
|
3080
|
+
const CalculatorValue = JSX(({ className, title, value, color = 'text-secondary-text', ...rest }) => (jsxs("div", { className: style(CalculatorValueStyle, className), children: [title ? (jsx(Text, { size: "text-l", font: "font-light", color: color, children: title })) : null, value ? jsx(FormatValue, { value: value, ...rest }) : jsx(Text, { size: "text-h3", children: "-" })] })));
|
|
3137
3081
|
|
|
3138
|
-
const
|
|
3082
|
+
const getDefaultParamsMin = (rateRows) => getDefaultParams([(i, acc) => i < acc, (i, prev) => i?.maxSum > prev?.maxSum], rateRows);
|
|
3083
|
+
const getDefaultParamsMax = (rateRows = [], isNewClient = false) => getDefaultParams([(i, acc) => i > acc, (i, prev) => i?.minSum < prev?.minSum], rateRows?.filter((_) => isNewClient === Boolean(_?.isNewClient)));
|
|
3084
|
+
const getDefaultParams = (comparators, rateRows) => {
|
|
3085
|
+
if (!rateRows?.length) {
|
|
3086
|
+
return undefined;
|
|
3087
|
+
}
|
|
3088
|
+
const rates = rateRows?.reduce((acc, i) => {
|
|
3089
|
+
if (comparators[0](i.rate, acc[0].rate)) {
|
|
3090
|
+
return [i];
|
|
3091
|
+
}
|
|
3092
|
+
else if (i.rate === acc[0].rate) {
|
|
3093
|
+
return [...acc, i];
|
|
3094
|
+
}
|
|
3095
|
+
return acc;
|
|
3096
|
+
}, [rateRows[0]]);
|
|
3097
|
+
if (rates.length > 1) {
|
|
3098
|
+
return rates.reduce((prev, i) => (comparators[1](i, prev) ? i : prev), rates[0]);
|
|
3099
|
+
}
|
|
3100
|
+
return rates[0];
|
|
3101
|
+
};
|
|
3139
3102
|
|
|
3140
|
-
const
|
|
3103
|
+
const getMoneyDefaultValue = (defaultParams, defaultMoney = 0) => defaultParams?.sum ? defaultParams.sum : defaultMoney;
|
|
3104
|
+
const getMonthsDefaultValue = (defaultParams, defaultMonth = 0) => defaultParams?.period &&
|
|
3105
|
+
defaultParams.period >= DEFAULT_MIN_MONTHS &&
|
|
3106
|
+
defaultParams.period <= DEFAULT_MAX_MONTHS
|
|
3107
|
+
? defaultParams.period
|
|
3108
|
+
: defaultMonth;
|
|
3141
3109
|
|
|
3142
|
-
const
|
|
3143
|
-
const DulIssueDateField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0432\u044B\u0434\u0430\u0447\u0438", ...getValidation(field(FIELD_NAME$8), validatorObj.dulIssueDateField, input?.required), disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME$8) })));
|
|
3110
|
+
const renderFootnote = (text, key) => text ? (jsx(Paragraph, { size: "text-xs", font: "font-light", color: "text-secondary-text", children: text }, String(key))) : null;
|
|
3144
3111
|
|
|
3145
|
-
const
|
|
3146
|
-
const
|
|
3147
|
-
|
|
3148
|
-
const onDaDataChange = useCallback((item) => {
|
|
3149
|
-
changeDulSubdivisionCode?.(item?.data?.code?.replace('-', ''));
|
|
3150
|
-
}, []);
|
|
3151
|
-
return (jsx(InputControl, { disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME$7), label: "\u041A\u0435\u043C \u0432\u044B\u0434\u0430\u043D", ...input, ...getValidation(field(FIELD_NAME$7), validatorObj.dulIssuedBy, input?.required), onDaDataChange: onDaDataChange, daDataQueryPrefix: dulSubdivisionCode }));
|
|
3152
|
-
});
|
|
3112
|
+
const STEP_MONTHS = 1;
|
|
3113
|
+
const renderMonthsInput = ({ min = 0, max = 0, availableMonths, ...rest }) => (jsx(InputRange, { items: [`От ${monthText(min)}`, `До ${monthText(max)}`], step: STEP_MONTHS, ...(availableMonths?.length ? { list: availableMonths } : { min, max }), ...rest }));
|
|
3114
|
+
const monthText = (month) => `${month} ${Number(month) % 10 === 1 ? 'месяца' : 'месяцев'}`;
|
|
3153
3115
|
|
|
3154
|
-
const
|
|
3155
|
-
|
|
3116
|
+
const orientationStyleMap = {
|
|
3117
|
+
horizontal: '@lg:flex-row',
|
|
3118
|
+
vertical: '',
|
|
3119
|
+
};
|
|
3120
|
+
const RadioButtonGroup = JSX(({ label, items, value, className, onChange: onChangeCheckedItem, disabled = false, orientation = 'horizontal', }) => (jsxs("div", { className: "grid gap-xs whitespace-nowrap", children: [label ? (jsx("div", { role: "radiogroup", "aria-label": label, children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: label }) })) : null, jsx("div", { className: style('flex flex-col gap-s', orientationStyleMap[orientation], className), role: "radiogroup", "aria-label": "\u0413\u0440\u0443\u043F\u043F\u0430 \u043A\u043D\u043E\u043F\u043E\u043A", children: items?.map(({ id, text }) => (jsx(Checkbox, { isRadio: true, text: text, value: value === id, onChange: () => onChangeCheckedItem && onChangeCheckedItem(id), disabled: disabled }, String(id)))) })] })));
|
|
3156
3121
|
|
|
3157
|
-
const
|
|
3158
|
-
const DulSerieField = JSX(({ field, input }) => (jsx(InputControl, { disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME$5), label: "\u0421\u0435\u0440\u0438\u044F \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430", isInteger: true, maxLength: 4, ...getValidation(field('dulSerie'), validatorObj.dulSerie, input?.required) })));
|
|
3122
|
+
const renderBinaryRadioButtonGroup = ({ items, title, mobileTitle = title, orientation = 'horizontal', value, onChange, ...rest }) => (jsxs("div", { className: "grid gap-s whitespace-nowrap", children: [title ? (jsx("div", { className: "hidden @5xl:block", role: "radiogroup", "aria-label": title, children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: title }) })) : null, mobileTitle ? (jsx("div", { className: "@5xl:hidden", role: "radiogroup", "aria-label": mobileTitle, children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: mobileTitle }) })) : null, jsx(RadioButtonGroup, { orientation: orientation, items: items, value: items[value ? 0 : 1].id, onChange: (_) => onChange && onChange(_ === items[0].id), ...rest })] }));
|
|
3159
3123
|
|
|
3160
|
-
const
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3124
|
+
const renderPaymentType = (props) => renderBinaryRadioButtonGroup({
|
|
3125
|
+
...props,
|
|
3126
|
+
className: 'sm:flex-col',
|
|
3127
|
+
items: [
|
|
3128
|
+
{ id: 'annuity', text: 'Аннуитетный' },
|
|
3129
|
+
{ id: 'differential', text: 'Дифференцированный' },
|
|
3130
|
+
],
|
|
3166
3131
|
});
|
|
3167
3132
|
|
|
3168
|
-
const
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3133
|
+
const DEFAULT_MONEY_STEP = 1000;
|
|
3134
|
+
const renderWantedSumInput = ({ isShowItems = true, step = DEFAULT_MONEY_STEP, postfix = '₽', ...rest }) => (jsx(InputRange, { items: isShowItems
|
|
3135
|
+
? [
|
|
3136
|
+
`От ${toLocalNumberFormat(1)(rest.min || 0)} ${postfix}`,
|
|
3137
|
+
`До ${toLocalNumberFormat(1)(rest.max || 0)} ${postfix}`,
|
|
3138
|
+
]
|
|
3139
|
+
: [], step: step, ...rest }));
|
|
3172
3140
|
|
|
3173
|
-
const
|
|
3174
|
-
|
|
3141
|
+
const setDefaultParamsCalc = ({ field, defParams, calcParams, map, monthsValue = 'maxMonths', }) => {
|
|
3142
|
+
Object.entries(map).forEach(([key, value]) => {
|
|
3143
|
+
field?.(key)?.onChange?.(defParams?.[value]);
|
|
3144
|
+
});
|
|
3145
|
+
field?.('monthsValue')?.onChange?.(clamp(defParams?.[monthsValue], calcParams.minMonths, calcParams.maxMonths));
|
|
3146
|
+
};
|
|
3147
|
+
|
|
3148
|
+
/**
|
|
3149
|
+
* Формулы расчёта аннуитетных и дифференцированных платежей:
|
|
3150
|
+
* https://finuslugi.ru/potrebitelskie_kredity/stat_annuitetnye_i_differentsirovannye_platezhi
|
|
3151
|
+
*/
|
|
3152
|
+
const getMonthlyPayment = (rate, params) => {
|
|
3153
|
+
const { isAnnuity, moneyValue, monthsValue, moneyExtra } = params;
|
|
3154
|
+
if (rate === 0) {
|
|
3155
|
+
return 0;
|
|
3156
|
+
}
|
|
3157
|
+
else if (isAnnuity) {
|
|
3158
|
+
const i = rate / MONTHLY_INTEREST_RATE; // Используется значение ставки в процентах
|
|
3159
|
+
if (moneyExtra) {
|
|
3160
|
+
return (moneyValue + moneyExtra) * (i + i / (Math.pow(1 + i, monthsValue) - 1));
|
|
3161
|
+
}
|
|
3162
|
+
else {
|
|
3163
|
+
return moneyValue * (i + i / (Math.pow(1 + i, monthsValue) - 1));
|
|
3164
|
+
}
|
|
3165
|
+
}
|
|
3166
|
+
else {
|
|
3167
|
+
return Math.round(moneyValue / monthsValue) + moneyValue * (rate / (MONTHS_IN_YEAR$1 * 100)); // Используется значение ставки (rate) в процентах, делённое на сто.
|
|
3168
|
+
}
|
|
3169
|
+
};
|
|
3170
|
+
|
|
3171
|
+
const defaultDiscriminator = (_) => _;
|
|
3172
|
+
const maxBy = (discriminator = defaultDiscriminator) => (list) => list.reduceRight((a, b) => (discriminator(a) > discriminator(b) ? a : b));
|
|
3173
|
+
const max = maxBy();
|
|
3174
|
+
|
|
3175
|
+
const minBy = (discriminator = defaultDiscriminator) => maxBy((_) => -discriminator(_));
|
|
3176
|
+
const min = minBy();
|
|
3177
|
+
|
|
3178
|
+
const getLimitRangeByKeys = ([minKey, maxKey], limitParams, rateRows = []) => limitParams && limitParams[minKey] && limitParams[maxKey]
|
|
3179
|
+
? {
|
|
3180
|
+
[minKey]: limitParams[minKey],
|
|
3181
|
+
[maxKey]: limitParams[maxKey],
|
|
3182
|
+
}
|
|
3183
|
+
: getRangeByKeys([minKey, maxKey], rateRows);
|
|
3184
|
+
const getRangeByKeys = ([minKey, maxKey], rows = []) => ({
|
|
3185
|
+
[minKey]: rows.length
|
|
3186
|
+
? min(rows.filter((row) => typeof row[minKey] === 'number').map((row) => row[minKey]))
|
|
3187
|
+
: 0,
|
|
3188
|
+
[maxKey]: rows.length
|
|
3189
|
+
? max(rows.filter((row) => typeof row[minKey] === 'number').map((row) => row[maxKey]))
|
|
3190
|
+
: 0,
|
|
3191
|
+
});
|
|
3192
|
+
const checkRangeByKeys = (value, [minKey, maxKey], sourceBookRow) => value >= sourceBookRow[minKey] && value <= sourceBookRow[maxKey];
|
|
3193
|
+
|
|
3194
|
+
const DEFAULT_MIN_SUM$2 = 10000;
|
|
3195
|
+
const DEFAULT_MAX_SUM$1 = 5000000;
|
|
3196
|
+
const DEFAULT_CREDIT_CALCULATOR_PARAMS = {
|
|
3197
|
+
minSum: DEFAULT_MIN_SUM$2,
|
|
3198
|
+
maxSum: DEFAULT_MAX_SUM$1,
|
|
3199
|
+
minMonths: DEFAULT_MIN_MONTHS,
|
|
3200
|
+
maxMonths: DEFAULT_MAX_MONTHS,
|
|
3201
|
+
rate: 0,
|
|
3202
|
+
isSalaryClient: false,
|
|
3203
|
+
isPensionClient: false,
|
|
3204
|
+
isStateEmployee: false,
|
|
3205
|
+
isInsurance: true,
|
|
3206
|
+
};
|
|
3207
|
+
|
|
3208
|
+
const checkCreditSourceBookRowCommonParams = (props) => checkRowParam$1({
|
|
3209
|
+
...props,
|
|
3210
|
+
fieldKey: 'isSalaryClient',
|
|
3211
|
+
viewSettingFieldKey: 'isShowSalaryClient',
|
|
3212
|
+
}) &&
|
|
3213
|
+
checkRowParam$1({
|
|
3214
|
+
...props,
|
|
3215
|
+
fieldKey: 'isStateEmployee',
|
|
3216
|
+
viewSettingFieldKey: 'isShowStateEmployee',
|
|
3217
|
+
}) &&
|
|
3218
|
+
checkRowParam$1({
|
|
3219
|
+
...props,
|
|
3220
|
+
fieldKey: 'isPensionClient',
|
|
3221
|
+
viewSettingFieldKey: 'isShowPensionClient',
|
|
3222
|
+
}) &&
|
|
3223
|
+
checkRowParam$1({
|
|
3224
|
+
...props,
|
|
3225
|
+
fieldKey: 'isInsurance',
|
|
3226
|
+
viewSettingFieldKey: 'isShowInsurance',
|
|
3227
|
+
});
|
|
3228
|
+
const checkRowParam$1 = ({ row, userInputParams, paramsViewSettings, fieldKey, viewSettingFieldKey, }) => {
|
|
3229
|
+
const isExclude = paramsViewSettings ? !paramsViewSettings[viewSettingFieldKey] : false;
|
|
3230
|
+
return isExclude || userInputParams[fieldKey] === row[fieldKey];
|
|
3231
|
+
};
|
|
3232
|
+
|
|
3233
|
+
const getCreditCalculatorLimitParams = ({ limitRows, userInputParams, paramsViewSettings, }) => limitRows?.find((row) => checkCreditSourceBookRowCommonParams({
|
|
3234
|
+
row,
|
|
3235
|
+
userInputParams,
|
|
3236
|
+
paramsViewSettings,
|
|
3237
|
+
}));
|
|
3238
|
+
|
|
3239
|
+
const getCreditCalculatorRateParams = ({ rateRows = [], userInputParams, paramsViewSettings, moneyValue, monthsValue, }) => rateRows?.find((row) => checkCreditSourceBookRowCommonParams({
|
|
3240
|
+
row,
|
|
3241
|
+
userInputParams,
|
|
3242
|
+
paramsViewSettings,
|
|
3243
|
+
}) &&
|
|
3244
|
+
checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], row) &&
|
|
3245
|
+
checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], row)) || DEFAULT_CREDIT_CALCULATOR_PARAMS;
|
|
3246
|
+
|
|
3247
|
+
const getCreditCalculatorParams = (userInputParams, calcSource, paramsViewSettings) => {
|
|
3248
|
+
const { moneyValue, monthsValue } = userInputParams;
|
|
3249
|
+
const rateRows = calcSource?.rateRows || [DEFAULT_CREDIT_CALCULATOR_PARAMS];
|
|
3250
|
+
const limitRows = calcSource?.limitRows || [];
|
|
3251
|
+
const creditCalculatorSourceBookLimitParams = getCreditCalculatorLimitParams({
|
|
3252
|
+
limitRows,
|
|
3253
|
+
userInputParams,
|
|
3254
|
+
paramsViewSettings,
|
|
3255
|
+
});
|
|
3256
|
+
const { minSum, maxSum } = getLimitRangeByKeys(['minSum', 'maxSum'], creditCalculatorSourceBookLimitParams, rateRows);
|
|
3257
|
+
const { minMonths, maxMonths } = getLimitRangeByKeys(['minMonths', 'maxMonths'], creditCalculatorSourceBookLimitParams, rateRows);
|
|
3258
|
+
const creditCalculatorRateParams = getCreditCalculatorRateParams({
|
|
3259
|
+
rateRows,
|
|
3260
|
+
userInputParams,
|
|
3261
|
+
paramsViewSettings,
|
|
3262
|
+
moneyValue,
|
|
3263
|
+
monthsValue,
|
|
3264
|
+
});
|
|
3265
|
+
const { rate } = creditCalculatorRateParams;
|
|
3266
|
+
const monthlyPayment = getMonthlyPayment(rate, userInputParams);
|
|
3267
|
+
return {
|
|
3268
|
+
...creditCalculatorRateParams,
|
|
3269
|
+
...userInputParams,
|
|
3270
|
+
minSum,
|
|
3271
|
+
maxSum,
|
|
3272
|
+
minMonths,
|
|
3273
|
+
maxMonths,
|
|
3274
|
+
moneyValue,
|
|
3275
|
+
monthsValue,
|
|
3276
|
+
monthlyPayment,
|
|
3277
|
+
};
|
|
3278
|
+
};
|
|
3279
|
+
|
|
3280
|
+
const isDefaultParams = (defaultParams = {}) => Boolean(Object.values(defaultParams).filter((_) => _).length);
|
|
3281
|
+
|
|
3282
|
+
const CREDIT_DEFAULT_SUM = 200000;
|
|
3283
|
+
const MAP$1 = {
|
|
3284
|
+
isSalaryClient: 'isSalaryClient',
|
|
3285
|
+
isStateEmployee: 'isStateEmployee',
|
|
3286
|
+
isPensionClient: 'isPensionClient',
|
|
3287
|
+
isInsurance: 'isInsurance',
|
|
3288
|
+
moneyValue: 'maxSum',
|
|
3289
|
+
};
|
|
3290
|
+
const CalculatorCredit = UniBlock(({ className, title, calcSource, buttons, footnote, paramsViewSettings, defaultParams, onChange, ...rest }) => {
|
|
3291
|
+
const defaultParamsCals = getDefaultParamsMin(calcSource?.rateRows);
|
|
3292
|
+
const [userInputParams, { field, isDirty }] = useForm({
|
|
3293
|
+
moneyValue: getMoneyDefaultValue(defaultParams, CREDIT_DEFAULT_SUM),
|
|
3294
|
+
monthsValue: getMonthsDefaultValue(defaultParams, DEFAULT_MONTHS),
|
|
3295
|
+
isAnnuity: Boolean(defaultParams?.isAnnuity),
|
|
3296
|
+
isInsurance: Boolean(defaultParams?.isEnableInsurance),
|
|
3297
|
+
isSalaryClient: Boolean(defaultParams?.isEnableSalaryClient),
|
|
3298
|
+
isPensionClient: Boolean(defaultParams?.isEnablePensionClient),
|
|
3299
|
+
isStateEmployee: Boolean(defaultParams?.isEnableStateEmployee),
|
|
3300
|
+
});
|
|
3301
|
+
useEffect(() => {
|
|
3302
|
+
isDirty && onChange?.(userInputParams);
|
|
3303
|
+
}, [userInputParams, isDirty]);
|
|
3304
|
+
const calcParams = getCreditCalculatorParams(userInputParams, calcSource, paramsViewSettings);
|
|
3305
|
+
const paymentTypeElement = renderPaymentType({
|
|
3306
|
+
title: 'Тип платежа',
|
|
3307
|
+
orientation: 'vertical',
|
|
3308
|
+
...field('isAnnuity'),
|
|
3309
|
+
});
|
|
3310
|
+
const { onChange: setMoneyValue } = field('moneyValue');
|
|
3311
|
+
const { onChange: setMonthsValue } = field('monthsValue');
|
|
3312
|
+
useEffect(() => {
|
|
3313
|
+
setMoneyValue &&
|
|
3314
|
+
setMoneyValue(clamp(userInputParams.moneyValue, calcParams.minSum, calcParams.maxSum));
|
|
3315
|
+
}, [calcParams.minSum, calcParams.maxSum]);
|
|
3316
|
+
useEffect(() => {
|
|
3317
|
+
setMonthsValue &&
|
|
3318
|
+
setMonthsValue(clamp(userInputParams.monthsValue, calcParams.minMonths, calcParams.maxMonths));
|
|
3319
|
+
}, [calcParams.minMonths, calcParams.maxMonths]);
|
|
3320
|
+
useEffect(() => {
|
|
3321
|
+
if (!isDefaultParams(defaultParams) && defaultParamsCals) {
|
|
3322
|
+
setDefaultParamsCalc({
|
|
3323
|
+
field,
|
|
3324
|
+
defParams: defaultParamsCals,
|
|
3325
|
+
calcParams,
|
|
3326
|
+
map: MAP$1,
|
|
3327
|
+
monthsValue: 'minMonths',
|
|
3328
|
+
});
|
|
3329
|
+
}
|
|
3330
|
+
}, [calcSource, defaultParams]);
|
|
3331
|
+
return (jsx(CalculatorLayout, { className: className, title: title, ...rest, children: jsxs("section", { className: style(CalculatorStyle.wrapper, className), children: [jsxs("div", { className: CalculatorStyle.input, children: [renderWantedSumInput({
|
|
3332
|
+
title: 'Сумма кредита, ₽',
|
|
3333
|
+
step: 500,
|
|
3334
|
+
min: calcParams.minSum,
|
|
3335
|
+
max: calcParams.maxSum,
|
|
3336
|
+
...field('moneyValue'),
|
|
3337
|
+
value: calcParams.moneyValue,
|
|
3338
|
+
}), renderMonthsInput({
|
|
3339
|
+
title: 'Срок кредита, месяцев',
|
|
3340
|
+
min: calcParams.minMonths,
|
|
3341
|
+
max: calcParams.maxMonths,
|
|
3342
|
+
...field('monthsValue'),
|
|
3343
|
+
value: calcParams.monthsValue,
|
|
3344
|
+
}), renderCreditParamsForm$1({ ...calcParams, ...paramsViewSettings }, field), jsx("div", { className: "sm:hidden", children: paymentTypeElement })] }), jsxs("div", { className: style(CalculatorStyle.result, '@4xl:w-1/2'), children: [jsx(CalculatorValue, { title: "\u041F\u043E\u043B\u043D\u0430\u044F \u0441\u0442\u043E\u0438\u043C\u043E\u0441\u0442\u044C \u043A\u0440\u0435\u0434\u0438\u0442\u0430", value: calcSource?.totalLoanCost }), jsx(CalculatorValue, { title: "\u0421\u0442\u0430\u0432\u043A\u0430", value: calcParams?.rate, fractionDigits: 2, postfix: "%" }), jsx(CalculatorValue, { title: "\u0415\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u044B\u0439 \u043F\u043B\u0430\u0442\u0451\u0436", value: calcParams.monthlyPayment, postfix: "\u20BD" }), jsx("div", { className: "hidden sm:block mb-lg", children: paymentTypeElement }), renderButtonsSection(buttons, { isVertical: true }), renderFootnote(footnote)] })] }) }));
|
|
3345
|
+
});
|
|
3346
|
+
const renderCreditParamsForm$1 = (params, field) => (jsxs("div", { className: "flex flex-col gap-y-2xl", children: [params.isShowSalaryClient ? (jsx(Checkbox, { text: `Получаю зарплату на счёт\nв Россельхозбанке`, ...field('isSalaryClient'), value: params.isSalaryClient, className: "whitespace-pre-line sm:whitespace-normal" })) : null, params.isShowStateEmployee ? (jsx(Checkbox, { text: "\u0420\u0430\u0431\u043E\u0442\u0430\u044E \u0432 \u0431\u044E\u0434\u0436\u0435\u0442\u043D\u043E\u0439 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...field('isStateEmployee'), value: params.isStateEmployee })) : null, params.isShowPensionClient ? (jsx(Checkbox, { text: "\u041F\u043E\u043B\u0443\u0447\u0430\u044E \u043F\u0435\u043D\u0441\u0438\u044E \u043D\u0430 \u043A\u0430\u0440\u0442\u0443 \u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u0430", ...field('isPensionClient'), value: params.isPensionClient })) : null, params.isShowInsurance ? (jsx(Checkbox, { text: "\u041A\u043E\u043C\u043F\u043B\u0435\u043A\u0441\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u0445\u043E\u0432\u0430\u044F \u0437\u0430\u0449\u0438\u0442\u0430", ...field('isInsurance'), value: params.isInsurance })) : null] }));
|
|
3347
|
+
|
|
3348
|
+
const PARAMS_MAP = {
|
|
3349
|
+
moneyValue: 'sum',
|
|
3350
|
+
monthsValue: 'period',
|
|
3351
|
+
isInsurance: 'isEnableInsurance',
|
|
3352
|
+
isPensionClient: 'isEnablePensionClient',
|
|
3353
|
+
isStateEmployee: 'isEnableStateEmployee',
|
|
3354
|
+
isSalaryClient: 'isEnableSalaryClient',
|
|
3355
|
+
isAnnuity: 'isAnnuity',
|
|
3356
|
+
};
|
|
3357
|
+
const defaultValueAdapter = (value, isInverse = false) => {
|
|
3358
|
+
const keysMap = isInverse ? swap(PARAMS_MAP) : PARAMS_MAP;
|
|
3359
|
+
return Object.fromEntries(Object.entries(value ?? {}).map(([k, v]) => [keysMap[k], v]));
|
|
3360
|
+
};
|
|
3361
|
+
const swap = (_) => Object.fromEntries(Object.entries(_).map(([k, v]) => [v, k]));
|
|
3362
|
+
|
|
3363
|
+
const FIELD_NAME$9 = 'calculator';
|
|
3364
|
+
const CreditCalcField = JSX(({ field, params }) => {
|
|
3365
|
+
const handleChange = useCallback((_) => {
|
|
3366
|
+
field(FIELD_NAME$9).onChange?.(_);
|
|
3367
|
+
}, []);
|
|
3368
|
+
return (jsx(CalculatorCredit, { ...params?.calcData, defaultParams: defaultValueAdapter(field(FIELD_NAME$9).value), onChange: handleChange }));
|
|
3369
|
+
});
|
|
3370
|
+
|
|
3371
|
+
const LABEL_TEXT = `Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /
|
|
3372
|
+
вкладчиком с долей участия более 20% уставного капитала руководителем,
|
|
3373
|
+
которого Вы являетесь, кредит в АО «Россельхозбанк»`;
|
|
3374
|
+
const CreditInRshbCdField = JSX(({ field, input }) => {
|
|
3375
|
+
const { data: creditInRshbCd } = useLeadFormData('CREDIT_IN_RSHB');
|
|
3376
|
+
return (jsx(SelectField, { field: field, source: creditInRshbCd, label: LABEL_TEXT, fieldName: "creditInRshbCd", input: input }));
|
|
3377
|
+
});
|
|
3378
|
+
|
|
3379
|
+
const RadioButtonGroupControl = JSX(({ className, label, onChange, error, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(RadioButtonGroup, { label: getRequiredLabel({ label, errors: rest?.errors }), onChange: (_) => onChange && onChange(_), ...rest }), renderErrorText(error)] })));
|
|
3380
|
+
|
|
3381
|
+
const CURRENCY_TYPES = [{ id: 'rub', text: 'Рубль' }];
|
|
3382
|
+
const CurrencyField = JSX(({ field, input }) => {
|
|
3383
|
+
const { value, onChange } = field('currency');
|
|
3384
|
+
return (jsx(RadioButtonGroupControl, { label: "\u0412\u0430\u043B\u044E\u0442\u0430", orientation: "horizontal", items: CURRENCY_TYPES, value: value, onChange: (_) => onChange?.(_), ...getValidation(field('currency'), validatorObj.currency, input?.required) }));
|
|
3385
|
+
});
|
|
3386
|
+
|
|
3387
|
+
const DeliveryDateFiels = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0434\u043E\u0441\u0442\u0430\u0432\u043A\u0438", ...getValidation(field('deliveryDate'), validatorObj.deliveryDate, input?.required) })));
|
|
3388
|
+
|
|
3389
|
+
const DependentsField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0438\u0436\u0434\u0438\u0432\u0435\u043D\u0446\u0435\u0432", placeholder: "\u0417\u0430 \u0438\u0441\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435 \u0434\u0435\u0442\u0435\u0439 \u0434\u043E 18 \u043B\u0435\u0442", isInteger: true, maxLength: 2, ...getValidation(field('dependents'), validatorObj.dependents, input?.required), ...input })));
|
|
3390
|
+
|
|
3391
|
+
const DesiredMeetingDateField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0416\u0435\u043B\u0430\u0435\u043C\u0430\u044F \u0434\u0430\u0442\u0430 \u0432\u0441\u0442\u0440\u0435\u0447\u0438", ...getValidation(field('desiredMeetingDate'), validatorObj.meetingDay, input?.required) })));
|
|
3392
|
+
|
|
3393
|
+
const DisablePeopleFlgField = JSX(({ field, input }) => (jsx(CheckboxWithError, { text: "\u042F\u0432\u043B\u044F\u044E\u0441\u044C \u0438\u043D\u0432\u0430\u043B\u0438\u0434\u043E\u043C", ...getValidation(field('disablePeopleFlg'), validatorObj.disablePeopleFlg, input?.required) })));
|
|
3394
|
+
|
|
3395
|
+
const FIELD_NAME$8 = 'dulIssueDateField';
|
|
3396
|
+
const DulIssueDateField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0432\u044B\u0434\u0430\u0447\u0438", ...getValidation(field(FIELD_NAME$8), validatorObj.dulIssueDateField, input?.required), disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME$8) })));
|
|
3397
|
+
|
|
3398
|
+
const FIELD_NAME$7 = 'dulIssuedBy';
|
|
3399
|
+
const DulIssuedByField = JSX(({ field, input }) => {
|
|
3400
|
+
const { value: dulSubdivisionCode, onChange: changeDulSubdivisionCode } = field('dulSubdivisionCode');
|
|
3401
|
+
const onDaDataChange = useCallback((item) => {
|
|
3402
|
+
changeDulSubdivisionCode?.(item?.data?.code?.replace('-', ''));
|
|
3403
|
+
}, []);
|
|
3404
|
+
return (jsx(InputControl, { disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME$7), label: "\u041A\u0435\u043C \u0432\u044B\u0434\u0430\u043D", ...input, ...getValidation(field(FIELD_NAME$7), validatorObj.dulIssuedBy, input?.required), onDaDataChange: onDaDataChange, daDataQueryPrefix: dulSubdivisionCode }));
|
|
3405
|
+
});
|
|
3406
|
+
|
|
3407
|
+
const FIELD_NAME$6 = 'dulNumber';
|
|
3408
|
+
const DulNumberField = JSX(({ field, input }) => (jsx(InputControl, { disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME$6), label: "\u041D\u043E\u043C\u0435\u0440 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430", isInteger: true, maxLength: 6, ...getValidation(field('dulNumber'), validatorObj.dulNumber, input?.required) })));
|
|
3409
|
+
|
|
3410
|
+
const FIELD_NAME$5 = 'dulSerie';
|
|
3411
|
+
const DulSerieField = JSX(({ field, input }) => (jsx(InputControl, { disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME$5), label: "\u0421\u0435\u0440\u0438\u044F \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430", isInteger: true, maxLength: 4, ...getValidation(field('dulSerie'), validatorObj.dulSerie, input?.required) })));
|
|
3412
|
+
|
|
3413
|
+
const FIELD_NAME$4 = 'dulSubdivisionCode';
|
|
3414
|
+
const DulSubdivisionCodeField = JSX(({ field, input }) => {
|
|
3415
|
+
const onDaDataChange = useCallback((item) => {
|
|
3416
|
+
field?.('dulIssuedBy')?.onChange?.(item?.data?.name);
|
|
3417
|
+
}, []);
|
|
3418
|
+
return (jsx(InputControl, { disabled: input?.filledByEsia && isEsiaAuthorize(field, FIELD_NAME$4), label: "\u041A\u043E\u0434 \u043F\u043E\u0434\u0440\u0430\u0437\u0434\u0435\u043B\u0435\u043D\u0438\u044F", isInteger: true, maxLength: 6, ...input, ...getValidation(field(FIELD_NAME$4), validatorObj.dulSubdivisionCode, input?.required), onDaDataChange: onDaDataChange }));
|
|
3419
|
+
});
|
|
3420
|
+
|
|
3421
|
+
const EducationField = JSX(({ field, input }) => {
|
|
3422
|
+
const { data: education } = useLeadFormData('EDUCATION_LEVEL');
|
|
3423
|
+
return (jsx(SelectField, { field: field, source: education, label: "\u041E\u0431\u0440\u0430\u0437\u043E\u0432\u0430\u043D\u0438\u0435", fieldName: "education", input: input }));
|
|
3424
|
+
});
|
|
3425
|
+
|
|
3426
|
+
const EmailField = JSX(({ field, input }) => {
|
|
3427
|
+
const { required, ...rest } = input;
|
|
3175
3428
|
return (jsx(InputControl, { label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...getValidation(field('email'), validatorObj.email, required), ...rest }));
|
|
3176
3429
|
});
|
|
3177
3430
|
|
|
@@ -3401,6 +3654,9 @@
|
|
|
3401
3654
|
const ProductField = JSX(({ field, source }) => (jsx(SelectControl, { placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043F\u0440\u043E\u0434\u0443\u043A\u0442", label: "\u041F\u0440\u043E\u0434\u0443\u043A\u0442", options: arrayToOptions(source?.productList), ...withValidator(field('product'), validatorObj.product) })));
|
|
3402
3655
|
const arrayToOptions = (array) => (array ?? []).map((_) => ({ key: _, value: _ }));
|
|
3403
3656
|
|
|
3657
|
+
const OUT_SERVICE_URL = `${API_BASE_URI}/outservice/outserviceregions`;
|
|
3658
|
+
const getRegionUrl = (typeForm) => typeForm === 'OUTSERVICE' ? OUT_SERVICE_URL : undefined;
|
|
3659
|
+
|
|
3404
3660
|
const REGIONS_URL = `${API_BASE_URI}/regions`;
|
|
3405
3661
|
const EMPTY_REGIONS = [];
|
|
3406
3662
|
// TODO Почему url можно менять? Разве смысл не в инкапсуляции api url. Тоже под рефакторинг попадает
|
|
@@ -3409,7 +3665,8 @@
|
|
|
3409
3665
|
return Array.isArray(data) ? data : EMPTY_REGIONS;
|
|
3410
3666
|
}
|
|
3411
3667
|
|
|
3412
|
-
const RegionField = JSX(({ field, input,
|
|
3668
|
+
const RegionField = JSX(({ field, input, params }) => {
|
|
3669
|
+
const url = getRegionUrl(params?.typeForm);
|
|
3413
3670
|
const regions = useRegions(url);
|
|
3414
3671
|
return (jsx(SelectControl, { label: "\u0424\u0438\u043B\u0438\u0430\u043B", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B", isSearch: true, options: useMemo(() => regions?.map(({ code = '', name = '' }) => ({ key: code, text: name })), [regions]), ...getValidation(field('region'), validatorObj.region, input?.required) }));
|
|
3415
3672
|
});
|
|
@@ -3521,8 +3778,8 @@
|
|
|
3521
3778
|
const PRODUCT_REF = {
|
|
3522
3779
|
$ref: '/wcms-resources/outservice-productlist.json',
|
|
3523
3780
|
};
|
|
3524
|
-
const getField = (field,
|
|
3525
|
-
const isPremium = typeForm === 'ULTRASERVICE' || typeForm === 'PREMIUMSERVICE';
|
|
3781
|
+
const getField = (field, params) => (input, i) => {
|
|
3782
|
+
const isPremium = params?.typeForm === 'ULTRASERVICE' || params?.typeForm === 'PREMIUMSERVICE';
|
|
3526
3783
|
const InputsMap = {
|
|
3527
3784
|
surname: jsx(SurnameField, { field: field, input: input }),
|
|
3528
3785
|
name: jsx(NameField, { field: field, input: input }),
|
|
@@ -3572,7 +3829,7 @@
|
|
|
3572
3829
|
consentInformFlg: jsx(ConsentField, { field: field, input: input }),
|
|
3573
3830
|
consentPfrFlg: jsx(ConsentField, { field: field, input: input }),
|
|
3574
3831
|
applicationDate: (jsx(InputControl, { label: "\u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u044F \u0432 \u0411\u0430\u043D\u043A", ...field('applicationDate') })),
|
|
3575
|
-
region: isPremium ? (jsx(RegionPremiumField, { field: field })) : (jsx(RegionField, { field: field, input: input,
|
|
3832
|
+
region: isPremium ? (jsx(RegionPremiumField, { field: field })) : (jsx(RegionField, { field: field, input: input, params: params })),
|
|
3576
3833
|
education: jsx(EducationField, { field: field, input: input }),
|
|
3577
3834
|
housing: jsx(HousingField, { field: field, input: input }),
|
|
3578
3835
|
employment: jsx(EmploymentField, { field: field, input: input }),
|
|
@@ -3619,6 +3876,7 @@
|
|
|
3619
3876
|
confirmationIncome: jsx(ConfirmationIncomeField, { field: field, input: input }),
|
|
3620
3877
|
methodObtain: jsx(MethodObtainField, { field: field, input: input }),
|
|
3621
3878
|
deliveryDate: jsx(DeliveryDateFiels, { field: field, input: input }),
|
|
3879
|
+
calculator: jsx(CreditCalcField, { field: field, params: params }),
|
|
3622
3880
|
};
|
|
3623
3881
|
return isRenderField({ input, field }) ? (jsx("div", { children: InputsMap[input?.name || ''] }, String(i))) : null;
|
|
3624
3882
|
};
|
|
@@ -3767,7 +4025,7 @@
|
|
|
3767
4025
|
reset();
|
|
3768
4026
|
}
|
|
3769
4027
|
}, [responseType]);
|
|
3770
|
-
return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: [jsxs("form", { onSubmit: onSubmit, children: [sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), (_?.inputs || [])?.map(getField(field, typeForm))] }, `section-${i}`))), renderAgreementSubmit(fieldName ? field('consentDataProcessing') : undefined, link, button)] }), isContacts ? renderContacts() : null] }));
|
|
4028
|
+
return (jsxs(ApplicationFormLayout, { className: style('container space-y-m', className), title: title, ...rest, children: [jsxs("form", { onSubmit: onSubmit, children: [sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [renderTitle(_.title), (_?.inputs || [])?.map(getField(field, { typeForm }))] }, `section-${i}`))), renderAgreementSubmit(fieldName ? field('consentDataProcessing') : undefined, link, button)] }), isContacts ? renderContacts() : null] }));
|
|
3771
4029
|
});
|
|
3772
4030
|
const getFilteredInputs = (inputs, data) => inputs
|
|
3773
4031
|
.filter((_) => (_?.name === 'secondaryPhone' ? Boolean(data.secondaryPhone) : _))
|
|
@@ -3799,20 +4057,19 @@
|
|
|
3799
4057
|
const hasValidationErrors = useMemo(() => inputs
|
|
3800
4058
|
?.filter((_) => _.required)
|
|
3801
4059
|
?.some((_) => Boolean(withValidator(field(_?.name), validatorObj[_?.name]).error)), [inputs]);
|
|
3802
|
-
return (jsx("div", { className: "w-fit", children: jsx(Foldable, { isFoldButtonOnTop: true, unfoldedByDefault: true, renderFoldableSection: ({ isUnfolded }) => (jsx(FoldableSection, { isUnfolded: isUnfolded, className: "flex flex-col pl-2xl", children: inputs.map(getField(field, typeForm)) })), renderFoldButton: renderGeneralCheckbox(jsxs("div", { children: [jsx(Checkbox, { value: isChecked, onChange: handleGeneralToggle, text: CONSENT_ALL_DOCS_TEXT }, key), renderErrorText(hasValidationErrors ? CONSENT_REQUIRED : '')] })) }) }));
|
|
4060
|
+
return (jsx("div", { className: "w-fit", children: jsx(Foldable, { isFoldButtonOnTop: true, unfoldedByDefault: true, renderFoldableSection: ({ isUnfolded }) => (jsx(FoldableSection, { isUnfolded: isUnfolded, className: "flex flex-col pl-2xl", children: inputs.map(getField(field, { typeForm })) })), renderFoldButton: renderGeneralCheckbox(jsxs("div", { children: [jsx(Checkbox, { value: isChecked, onChange: handleGeneralToggle, text: CONSENT_ALL_DOCS_TEXT }, key), renderErrorText(hasValidationErrors ? CONSENT_REQUIRED : '')] })) }) }));
|
|
3803
4061
|
});
|
|
3804
4062
|
const renderGeneralCheckbox = (generalCheckBox) => (foldableData) => (jsxs("div", { className: "flex items-start", children: [generalCheckBox, jsx("button", { onClick: foldableData.onToggle, className: "px-m py-2xs", type: "button", children: jsx(Icon, { className: "text-primary-text", name: foldableData.isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" }) })] }));
|
|
3805
4063
|
|
|
3806
4064
|
const renderInputs$2 = ({ field, typeForm = '', inputs }) => {
|
|
3807
4065
|
const { consentInputs, restInputs } = splitInputs(inputs || []);
|
|
3808
|
-
return consentInputs.length > 2 ? (jsxs("div", { children: [restInputs.map(getField(field, typeForm)), jsx(GroupedConsents, { inputs: consentInputs, field: field })] })) : ((inputs || [])?.map(getField(field, typeForm)));
|
|
4066
|
+
return consentInputs.length > 2 ? (jsxs("div", { children: [restInputs.map(getField(field, { typeForm })), jsx(GroupedConsents, { inputs: consentInputs, field: field })] })) : ((inputs || [])?.map(getField(field, { typeForm })));
|
|
3809
4067
|
};
|
|
3810
4068
|
const splitInputs = (inputs) => ({
|
|
3811
4069
|
consentInputs: inputs?.filter((_) => Object.keys(CONSENTS).includes(_.name || '')) || [],
|
|
3812
4070
|
restInputs: inputs?.filter((_) => !Object.keys(CONSENTS).includes(_.name || '')) || [],
|
|
3813
4071
|
});
|
|
3814
4072
|
|
|
3815
|
-
/* eslint-disable max-lines */
|
|
3816
4073
|
const initialFormState = {
|
|
3817
4074
|
typeForm: '',
|
|
3818
4075
|
region: { key: '', text: '' },
|
|
@@ -3876,7 +4133,7 @@
|
|
|
3876
4133
|
|
|
3877
4134
|
const updateUserProfile = (body) => fetchRetailJSON('/user-data/updateUserProfile', 'PUT', body);
|
|
3878
4135
|
|
|
3879
|
-
const updateUserTask = (body) =>
|
|
4136
|
+
const updateUserTask = (body) => doRequest('/user-data/updateUserTask', 'PUT', body);
|
|
3880
4137
|
|
|
3881
4138
|
const getUpdateUserProfileData = (profileId, formData) => {
|
|
3882
4139
|
const { name = '', surname = '', middleName = '', birthday = '', phone = '', email = '', processPersonalDataFlg, consentProviderFlg, consentPfrFlg, consentPhotoFlg, consentAssignmentClaimsFlg, consentCollectionFlg, consentInformFlg, } = formData;
|
|
@@ -4167,16 +4424,21 @@
|
|
|
4167
4424
|
const { open, close } = useDialogManager();
|
|
4168
4425
|
const verifyPhoneDialog = useVerifyPhoneDialog();
|
|
4169
4426
|
const handleSuccessVerify = (profileId) => async (smsCode) => {
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4427
|
+
try {
|
|
4428
|
+
if (profileId) {
|
|
4429
|
+
await updateUserProfile({
|
|
4430
|
+
profile: {
|
|
4431
|
+
id: profileId,
|
|
4432
|
+
consentBkiFlg: true,
|
|
4433
|
+
smsConsentBki: smsCode,
|
|
4434
|
+
},
|
|
4435
|
+
});
|
|
4436
|
+
}
|
|
4437
|
+
onClose();
|
|
4438
|
+
}
|
|
4439
|
+
catch (ex) {
|
|
4440
|
+
console.log(ex);
|
|
4178
4441
|
}
|
|
4179
|
-
onClose();
|
|
4180
4442
|
};
|
|
4181
4443
|
const handleSubmitBkiConstent = (phone, profileId) => async (confirmStatus) => {
|
|
4182
4444
|
close();
|
|
@@ -4332,13 +4594,15 @@
|
|
|
4332
4594
|
const [, setTaskId] = useLocalStorage('taskId');
|
|
4333
4595
|
const [, setProfileId] = useLocalStorage('profileId');
|
|
4334
4596
|
const [, setParticipantId] = useLocalStorage('participantId');
|
|
4597
|
+
const [, setProgramId] = useLocalStorage('programId');
|
|
4335
4598
|
const esiaLoginDialog = useEsiaLoginDialog(nextStepLink);
|
|
4336
4599
|
const consentBkiDialog = useConsentBkiDialog(esiaLoginDialog.open);
|
|
4337
4600
|
const verifyPhoneDialog = useVerifyPhoneDialog();
|
|
4338
|
-
const saveUserData = useCallback((participantId, taskId, profileId) => {
|
|
4601
|
+
const saveUserData = useCallback(({ participantId, taskId, profileId, programId: programNumber }) => {
|
|
4339
4602
|
setParticipantId(participantId);
|
|
4340
4603
|
setTaskId(taskId);
|
|
4341
4604
|
setProfileId(profileId);
|
|
4605
|
+
setProgramId(programNumber);
|
|
4342
4606
|
}, []);
|
|
4343
4607
|
// eslint-disable-next-line consistent-return
|
|
4344
4608
|
const handleSubmit = useCallback(async (formData) => {
|
|
@@ -4395,7 +4659,7 @@
|
|
|
4395
4659
|
profileId,
|
|
4396
4660
|
formData: transformedForm,
|
|
4397
4661
|
}));
|
|
4398
|
-
saveUserData(participantId, taskId, profileId);
|
|
4662
|
+
saveUserData({ participantId, taskId, profileId, programId });
|
|
4399
4663
|
saveForm(formData);
|
|
4400
4664
|
};
|
|
4401
4665
|
const verifyPhoneContent = (phone, consents) => ({
|
|
@@ -4652,13 +4916,6 @@
|
|
|
4652
4916
|
|
|
4653
4917
|
const areArraysEqual = (as, bs) => as === bs || Boolean(as && bs && as?.length === bs?.length && as.every((_, i) => _ === bs[i]));
|
|
4654
4918
|
|
|
4655
|
-
const defaultDiscriminator = (_) => _;
|
|
4656
|
-
const maxBy = (discriminator = defaultDiscriminator) => (list) => list.reduceRight((a, b) => (discriminator(a) > discriminator(b) ? a : b));
|
|
4657
|
-
const max = maxBy();
|
|
4658
|
-
|
|
4659
|
-
const minBy = (discriminator = defaultDiscriminator) => maxBy((_) => -discriminator(_));
|
|
4660
|
-
const min = minBy();
|
|
4661
|
-
|
|
4662
4919
|
const getItemWidth = (container) => (itemCount) => container.scrollWidth / itemCount;
|
|
4663
4920
|
const scrollBy = (container) => (itemCount, delta) => {
|
|
4664
4921
|
container.scrollBy({ left: delta * getItemWidth(container)(itemCount), behavior: 'smooth' });
|
|
@@ -5000,39 +5257,12 @@
|
|
|
5000
5257
|
return (jsx(BlockWrapper, { className: style('!bg-transparent', alignStyle, className), defaultPadding: "p-0", ...rest, children: renderButtonsSection(buttons) }));
|
|
5001
5258
|
});
|
|
5002
5259
|
|
|
5003
|
-
const CalculatorLayout = JSX(({ className, title, children, ...rest }) => (jsxs(BlockWrapper, { className: style('space-y-xl', className), defaultPadding: "p-4xl", ...rest, children: [title ? jsx(Heading, { className: "text-center", title: title }) : null, children] })));
|
|
5004
|
-
|
|
5005
|
-
const CalculatorStyle = {
|
|
5006
|
-
wrapper: 'flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl',
|
|
5007
|
-
input: 'flex flex-col lg:max-w-80 lg:w-1/2 gap-2xl',
|
|
5008
|
-
result: 'flex flex-col gap-y-xl min-w-52',
|
|
5009
|
-
};
|
|
5010
|
-
|
|
5011
|
-
const FormatValue = JSX(({ value, fractionDigits, fixed, prefix, postfix }) => (jsx(Text, { size: "text-h3", children: typeof value === 'number'
|
|
5012
|
-
? [prefix, toLocalNumberFormat(fractionDigits, { fixed })(value), postfix]
|
|
5013
|
-
.filter(Boolean)
|
|
5014
|
-
.join(' ')
|
|
5015
|
-
: value })));
|
|
5016
|
-
|
|
5017
|
-
const CalculatorValueStyle = 'flex justify-between @xl:flex-col';
|
|
5018
|
-
const CalculatorValue = JSX(({ className, title, value, color = 'text-secondary-text', ...rest }) => (jsxs("div", { className: style(CalculatorValueStyle, className), children: [title ? (jsx(Text, { size: "text-l", font: "font-light", color: color, children: title })) : null, value ? jsx(FormatValue, { value: value, ...rest }) : jsx(Text, { size: "text-h3", children: "-" })] })));
|
|
5019
|
-
|
|
5020
|
-
const renderFootnote = (text, key) => text ? (jsx(Paragraph, { size: "text-xs", font: "font-light", color: "text-secondary-text", children: text }, String(key))) : null;
|
|
5021
|
-
|
|
5022
5260
|
const Rate = JSX(({ rate = 0, title = 'Ставка', unit, fractionDigits = 2, depositeName, isShowDepositeName, color = 'text-secondary-text', }) => (jsxs("div", { children: [jsx(Text, { size: "text-l", font: "font-light", color: color, children: title }), jsxs("div", { className: "relative", children: [jsxs("div", { className: "flex @xl:justify-center gradient-color-text", children: [jsx("span", { className: "font-mohave text-title-huge -mt-m tracking-[-15px]", children: toLocalNumberFormat(fractionDigits, { fixed: true })(rate) }), unit ? jsx("span", { className: "text-7xl mt-5", children: unit }) : null] }), depositeName && isShowDepositeName ? (jsx("div", { className: "absolute bottom-2 w-full text-left whitespace-nowrap", children: depositeName })) : null] })] })));
|
|
5023
5261
|
|
|
5024
5262
|
const UnknownRate = JSX(({ title = 'Ставка' }) => (jsxs("div", { className: "space-y-s min-w-96", children: [jsx(Text, { size: "text-l", font: "font-light", color: "text-secondary-text", children: title }), jsx(Icon, { className: "w-10 h-auto lg:w-40", name: "PercentIcon" }), jsx("div", { className: "w-64", children: jsx(Paragraph, { size: "text-xl", font: "font-light", color: "text-primary-text", children: "\u041F\u0440\u043E\u0446\u0435\u043D\u0442\u043D\u0430\u044F \u0441\u0442\u0430\u0432\u043A\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u0430, \u0432\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B" }) })] })));
|
|
5025
5263
|
|
|
5026
5264
|
const renderRate = ({ title = 'Ставка', rate = 0, unit = '%', fractionDigits = 2, color = 'text-secondary-text', children, ...rest }) => rate ? (jsxs("div", { className: "flex flex-col", children: [jsx("div", { className: "hidden lg:block min-w-96", children: jsx(Rate, { title: title, rate: rate, unit: unit, fractionDigits: fractionDigits, color: color, ...rest }) }), jsx(CalculatorValue, { className: "lg:hidden", title: title, value: rate, postfix: unit, fractionDigits: fractionDigits, fixed: true, color: color, ...rest }), children] })) : (jsx(UnknownRate, { title: title, ...rest }));
|
|
5027
5265
|
|
|
5028
|
-
const DEFAULT_MONEY_STEP = 1000;
|
|
5029
|
-
const renderWantedSumInput = ({ isShowItems = true, step = DEFAULT_MONEY_STEP, postfix = '₽', ...rest }) => (jsx(InputRange, { items: isShowItems
|
|
5030
|
-
? [
|
|
5031
|
-
`От ${toLocalNumberFormat(1)(rest.min || 0)} ${postfix}`,
|
|
5032
|
-
`До ${toLocalNumberFormat(1)(rest.max || 0)} ${postfix}`,
|
|
5033
|
-
]
|
|
5034
|
-
: [], step: step, ...rest }));
|
|
5035
|
-
|
|
5036
5266
|
const DEFAULT_BONUS_CALCULATOR_PARAMS$1 = {
|
|
5037
5267
|
minSumTravel: 6000,
|
|
5038
5268
|
maxSumTravel: 200000,
|
|
@@ -5045,13 +5275,13 @@
|
|
|
5045
5275
|
travelBonusRate: 0.015,
|
|
5046
5276
|
restBonusRate: 0.01,
|
|
5047
5277
|
};
|
|
5048
|
-
const MONTHS_IN_YEAR
|
|
5278
|
+
const MONTHS_IN_YEAR = 12;
|
|
5049
5279
|
const getBonus = (params, bonusTravelValue, bonusOtherValue) => {
|
|
5050
5280
|
const { maxBonus = 5000, prefMonthsNum = DEFAULT_BONUS_CALCULATOR_PARAMS$1.prefMonthsNum, prefTravelBonusRate = DEFAULT_BONUS_CALCULATOR_PARAMS$1.prefTravelBonusRate, prefRestBonusRate = 0.01, travelBonusRate = 0.015, restBonusRate = 0.01, } = params;
|
|
5051
5281
|
const prefBonus = Math.min(Math.round(prefTravelBonusRate * bonusTravelValue) +
|
|
5052
5282
|
Math.round(prefRestBonusRate * bonusOtherValue), maxBonus);
|
|
5053
5283
|
const bonus = Math.min(Math.round(travelBonusRate * bonusTravelValue) + Math.round(restBonusRate * bonusOtherValue), maxBonus);
|
|
5054
|
-
const yearBonus = prefBonus * prefMonthsNum + bonus * (MONTHS_IN_YEAR
|
|
5284
|
+
const yearBonus = prefBonus * prefMonthsNum + bonus * (MONTHS_IN_YEAR - prefMonthsNum);
|
|
5055
5285
|
return [prefBonus, yearBonus];
|
|
5056
5286
|
};
|
|
5057
5287
|
|
|
@@ -5107,29 +5337,14 @@
|
|
|
5107
5337
|
fractionDigits: 0,
|
|
5108
5338
|
unit: '',
|
|
5109
5339
|
color: 'text-primary-text',
|
|
5110
|
-
})
|
|
5111
|
-
: null }), jsxs("div", { className: CalculatorStyle.result, children: [yearBonus >= 0 ? (jsx(CalculatorValue, { title: "\u0411\u0430\u043B\u043B\u043E\u0432 \u0437\u0430 \u0433\u043E\u0434", value: yearBonus, color: "text-primary-text" })) : null, renderButtonsSection(buttons, { isVertical: true }), renderFootnote(footnote)] })] }) }));
|
|
5112
|
-
});
|
|
5113
|
-
|
|
5114
|
-
const MONTHS_IN_YEAR = 12;
|
|
5115
|
-
const MONTHLY_INTEREST_RATE = MONTHS_IN_YEAR * 100;
|
|
5116
|
-
const DEFAULT_MIN_MONTHS = 1;
|
|
5117
|
-
const DEFAULT_MAX_MONTHS = 60;
|
|
5118
|
-
const DEFAULT_MONTHS = Math.round((DEFAULT_MAX_MONTHS - DEFAULT_MIN_MONTHS) / 2);
|
|
5119
|
-
|
|
5120
|
-
const getMoneyDefaultValue = (defaultParams, defaultMoney = 0) => defaultParams?.sum ? defaultParams.sum : defaultMoney;
|
|
5121
|
-
const getMonthsDefaultValue = (defaultParams, defaultMonth = 0) => defaultParams?.period &&
|
|
5122
|
-
defaultParams.period >= DEFAULT_MIN_MONTHS &&
|
|
5123
|
-
defaultParams.period <= DEFAULT_MAX_MONTHS
|
|
5124
|
-
? defaultParams.period
|
|
5125
|
-
: defaultMonth;
|
|
5340
|
+
})
|
|
5341
|
+
: null }), jsxs("div", { className: CalculatorStyle.result, children: [yearBonus >= 0 ? (jsx(CalculatorValue, { title: "\u0411\u0430\u043B\u043B\u043E\u0432 \u0437\u0430 \u0433\u043E\u0434", value: yearBonus, color: "text-primary-text" })) : null, renderButtonsSection(buttons, { isVertical: true }), renderFootnote(footnote)] })] }) }));
|
|
5342
|
+
});
|
|
5126
5343
|
|
|
5127
5344
|
const STEP_DAYS = 1;
|
|
5128
5345
|
const renderDaysInput = (props) => (jsx(InputRange, { items: [`От ${daysText(props.min || 0)}`, `До ${daysText(props.max || 0)}`], step: STEP_DAYS, ...props }));
|
|
5129
5346
|
const daysText = (days) => `${days} ${Number(days) % 10 === 1 ? 'дня' : 'дней'}`;
|
|
5130
5347
|
|
|
5131
|
-
const renderBinaryRadioButtonGroup = ({ items, title, mobileTitle = title, orientation = 'horizontal', value, onChange, ...rest }) => (jsxs("div", { className: "grid gap-s whitespace-nowrap", children: [title ? (jsx("div", { className: "hidden @5xl:block", role: "radiogroup", "aria-label": title, children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: title }) })) : null, mobileTitle ? (jsx("div", { className: "@5xl:hidden", role: "radiogroup", "aria-label": mobileTitle, children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: mobileTitle }) })) : null, jsx(RadioButtonGroup, { orientation: orientation, items: items, value: items[value ? 0 : 1].id, onChange: (_) => onChange && onChange(_ === items[0].id), ...rest })] }));
|
|
5132
|
-
|
|
5133
5348
|
const renderPayout = (props) => renderBinaryRadioButtonGroup({
|
|
5134
5349
|
...props,
|
|
5135
5350
|
items: [
|
|
@@ -5141,22 +5356,6 @@
|
|
|
5141
5356
|
const CAPITALIZATION = ' (c капитализацией)';
|
|
5142
5357
|
const renderDepositResult = ({ income, finalSum, postfix = '₽', buttons = [], footnotes = [], isCapitalization = false, }) => (jsxs("div", { className: CalculatorStyle.result, children: [jsx(CalculatorValue, { title: `Доход в конце срока${isCapitalization ? CAPITALIZATION : ''}`, value: income, postfix: postfix, prefix: "+" }), jsx(CalculatorValue, { title: `Сумма в конце срока${isCapitalization ? CAPITALIZATION : ''}`, value: finalSum, postfix: postfix }), renderButtonsSection(buttons, { isVertical: true }), footnotes?.map(renderFootnote)] }));
|
|
5143
5358
|
|
|
5144
|
-
const getLimitRangeByKeys = ([minKey, maxKey], limitParams, rateRows = []) => limitParams && limitParams[minKey] && limitParams[maxKey]
|
|
5145
|
-
? {
|
|
5146
|
-
[minKey]: limitParams[minKey],
|
|
5147
|
-
[maxKey]: limitParams[maxKey],
|
|
5148
|
-
}
|
|
5149
|
-
: getRangeByKeys([minKey, maxKey], rateRows);
|
|
5150
|
-
const getRangeByKeys = ([minKey, maxKey], rows = []) => ({
|
|
5151
|
-
[minKey]: rows.length
|
|
5152
|
-
? min(rows.filter((row) => typeof row[minKey] === 'number').map((row) => row[minKey]))
|
|
5153
|
-
: 0,
|
|
5154
|
-
[maxKey]: rows.length
|
|
5155
|
-
? max(rows.filter((row) => typeof row[minKey] === 'number').map((row) => row[maxKey]))
|
|
5156
|
-
: 0,
|
|
5157
|
-
});
|
|
5158
|
-
const checkRangeByKeys = (value, [minKey, maxKey], sourceBookRow) => value >= sourceBookRow[minKey] && value <= sourceBookRow[maxKey];
|
|
5159
|
-
|
|
5160
5359
|
const DEPOSIT_RATES_SERVICE_MAP = {
|
|
5161
5360
|
UL: 'businessdepositrates',
|
|
5162
5361
|
IP: 'selfemployeddepositrates',
|
|
@@ -5166,320 +5365,104 @@
|
|
|
5166
5365
|
const { data } = useAsyncData(serviceName ? `${API_BASE_URI}/depositrates/${serviceName}` : null, fetchJSONUnsafe);
|
|
5167
5366
|
return Array.isArray(data) ? data : [];
|
|
5168
5367
|
}
|
|
5169
|
-
|
|
5170
|
-
const BUSINESS_MIN_DAYS = 1;
|
|
5171
|
-
const BUSINESS_MAX_DAYS = 1095;
|
|
5172
|
-
const BUSINESS_OPERATING_MIN_DAYS = 90;
|
|
5173
|
-
const BUSINESS_OPERATING_MAX_DAYS = 730;
|
|
5174
|
-
const DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS = {
|
|
5175
|
-
minSum: 1000,
|
|
5176
|
-
maxSum: 100000001,
|
|
5177
|
-
minDays: BUSINESS_MIN_DAYS,
|
|
5178
|
-
maxDays: BUSINESS_MAX_DAYS,
|
|
5179
|
-
rate: 0,
|
|
5180
|
-
isMonthlyInterestPayment: true,
|
|
5181
|
-
isReplenished: false,
|
|
5182
|
-
isPartialWithdrawal: false,
|
|
5183
|
-
depositeName: "Депозит 'Стабильный'",
|
|
5184
|
-
};
|
|
5185
|
-
const useBusinessDepositParams = (userInputParams, rateParams) => {
|
|
5186
|
-
const { daysValue, moneyValue, isPartialWithdrawal, isReplenished, isMonthlyInterestPayment } = userInputParams;
|
|
5187
|
-
const isOperatingDeposit = isReplenished || isPartialWithdrawal;
|
|
5188
|
-
const isDisabledOperatingDeposit = daysValue < BUSINESS_OPERATING_MIN_DAYS || daysValue > BUSINESS_OPERATING_MAX_DAYS;
|
|
5189
|
-
const rateRows = useBusinessDepositRates(rateParams);
|
|
5190
|
-
const businessDepositCalculatorSourceBookParams = rateRows?.find((_) => {
|
|
5191
|
-
return (isMonthlyInterestPayment === _.isMonthlyInterestPayment &&
|
|
5192
|
-
checkIsOperatingDeposit(isOperatingDeposit, _) &&
|
|
5193
|
-
checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
|
|
5194
|
-
checkRangeByKeys(daysValue, ['minDays', 'maxDays'], _));
|
|
5195
|
-
}) || DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS;
|
|
5196
|
-
const { rate } = businessDepositCalculatorSourceBookParams;
|
|
5197
|
-
const income = getDepositIncome$1(rate, userInputParams);
|
|
5198
|
-
const finalSum = moneyValue + income;
|
|
5199
|
-
const sourceBookRows = rateRows || [DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS];
|
|
5200
|
-
return {
|
|
5201
|
-
...businessDepositCalculatorSourceBookParams,
|
|
5202
|
-
...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
|
|
5203
|
-
...getRangeByKeys(['minDays', 'maxDays'], sourceBookRows),
|
|
5204
|
-
...userInputParams,
|
|
5205
|
-
isDisabledOperatingDeposit,
|
|
5206
|
-
income,
|
|
5207
|
-
finalSum,
|
|
5208
|
-
};
|
|
5209
|
-
};
|
|
5210
|
-
const checkIsOperatingDeposit = (isOperatingDeposit, sourceBookRow) => isOperatingDeposit
|
|
5211
|
-
? sourceBookRow.isReplenished && sourceBookRow.isPartialWithdrawal
|
|
5212
|
-
: !sourceBookRow.isReplenished && !sourceBookRow.isPartialWithdrawal;
|
|
5213
|
-
const getDepositIncome$1 = (rate, userInputParams) => {
|
|
5214
|
-
const { isMonthlyInterestPayment, moneyValue, daysValue } = userInputParams;
|
|
5215
|
-
/*
|
|
5216
|
-
Приблизительный расчёт, не учитывающий разницу в количестве дней в месяцах. Месяц принят за 30 дней, год за 365 дней.
|
|
5217
|
-
*/
|
|
5218
|
-
if (isMonthlyInterestPayment) {
|
|
5219
|
-
return Math.round(moneyValue * Math.pow((1200 + rate) / 1200, daysValue / 30) - moneyValue);
|
|
5220
|
-
}
|
|
5221
|
-
else {
|
|
5222
|
-
return Math.round((moneyValue * rate * daysValue) / 365 / 100);
|
|
5223
|
-
}
|
|
5224
|
-
};
|
|
5225
|
-
|
|
5226
|
-
const BUSINESS_DEFAULT_SUM = 100000;
|
|
5227
|
-
const BUSINESS_DEFAULT_DAYS = 60;
|
|
5228
|
-
const CalculatorBusinessDeposit = UniBlock(({ className = '', title, buttons, footnote, bottomFootnote, isShowDepositeName, defaultParams, rateParams, ...rest }) => {
|
|
5229
|
-
const [userInputParams, { field }] = useForm({
|
|
5230
|
-
moneyValue: getMoneyDefaultValue(defaultParams, BUSINESS_DEFAULT_SUM),
|
|
5231
|
-
daysValue: getMonthsDefaultValue(defaultParams, BUSINESS_DEFAULT_DAYS),
|
|
5232
|
-
isReplenished: Boolean(defaultParams?.isReplenished),
|
|
5233
|
-
isPartialWithdrawal: Boolean(defaultParams?.isPartialWithdrawal),
|
|
5234
|
-
isMonthlyInterestPayment: Boolean(defaultParams?.isMonthlyInterestPayment),
|
|
5235
|
-
});
|
|
5236
|
-
const calculatorParams = useBusinessDepositParams(userInputParams, rateParams);
|
|
5237
|
-
const { income, finalSum, rate, depositeName } = calculatorParams;
|
|
5238
|
-
return (jsx(CalculatorLayout, { className: className, title: title, ...rest, children: jsxs("section", { className: style(CalculatorStyle.wrapper, className), children: [jsxs("div", { className: CalculatorStyle.input, children: [renderWantedSumInput({
|
|
5239
|
-
title: 'Сумма, ₽',
|
|
5240
|
-
min: calculatorParams.minSum,
|
|
5241
|
-
max: calculatorParams.maxSum,
|
|
5242
|
-
...field('moneyValue'),
|
|
5243
|
-
value: calculatorParams.moneyValue,
|
|
5244
|
-
}), renderDaysInput({
|
|
5245
|
-
title: 'Срок, дней',
|
|
5246
|
-
min: calculatorParams.minDays,
|
|
5247
|
-
max: calculatorParams.maxDays,
|
|
5248
|
-
...field('daysValue'),
|
|
5249
|
-
value: calculatorParams.daysValue,
|
|
5250
|
-
}), jsxs("div", { className: "flex flex-col sm:flex-row gap-y-m gap-x-5xl", children: [renderBusinessDepositParamsForm(calculatorParams, field), renderPayout({
|
|
5251
|
-
title: 'Выплата процентов',
|
|
5252
|
-
orientation: 'vertical',
|
|
5253
|
-
...field('isMonthlyInterestPayment'),
|
|
5254
|
-
className: 'sm:flex-col',
|
|
5255
|
-
})] })] }), renderRate({
|
|
5256
|
-
rate,
|
|
5257
|
-
depositeName,
|
|
5258
|
-
isShowDepositeName,
|
|
5259
|
-
}), renderDepositResult({
|
|
5260
|
-
income,
|
|
5261
|
-
finalSum,
|
|
5262
|
-
buttons,
|
|
5263
|
-
footnotes: [footnote, bottomFootnote],
|
|
5264
|
-
})] }) }));
|
|
5265
|
-
});
|
|
5266
|
-
const renderBusinessDepositParamsForm = (calculatorParams, field) => (jsxs("div", { className: "space-y-s", children: [jsx(Text, { color: "text-secondary-text", font: "font-light", children: "\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B" }), jsxs("div", { className: "flex flex-col gap-y-lg sm:gap-y-s", children: [jsx(Checkbox, { text: "\u041F\u043E\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435", disabled: calculatorParams.isDisabledOperatingDeposit, ...field('isReplenished'), value: calculatorParams.isReplenished }), jsx(Checkbox, { disabled: calculatorParams.isDisabledOperatingDeposit, text: "\u0427\u0430\u0441\u0442\u0438\u0447\u043D\u043E\u0435 \u0441\u043D\u044F\u0442\u0438\u0435", ...field('isPartialWithdrawal'), value: calculatorParams.isPartialWithdrawal })] })] }));
|
|
5267
|
-
|
|
5268
|
-
const getDefaultParamsMin = (rateRows) => getDefaultParams([(i, acc) => i < acc, (i, prev) => i?.maxSum > prev?.maxSum], rateRows);
|
|
5269
|
-
const getDefaultParamsMax = (rateRows = [], isNewClient = false) => getDefaultParams([(i, acc) => i > acc, (i, prev) => i?.minSum < prev?.minSum], rateRows?.filter((_) => isNewClient === Boolean(_?.isNewClient)));
|
|
5270
|
-
const getDefaultParams = (comparators, rateRows) => {
|
|
5271
|
-
if (!rateRows?.length) {
|
|
5272
|
-
return undefined;
|
|
5273
|
-
}
|
|
5274
|
-
const rates = rateRows?.reduce((acc, i) => {
|
|
5275
|
-
if (comparators[0](i.rate, acc[0].rate)) {
|
|
5276
|
-
return [i];
|
|
5277
|
-
}
|
|
5278
|
-
else if (i.rate === acc[0].rate) {
|
|
5279
|
-
return [...acc, i];
|
|
5280
|
-
}
|
|
5281
|
-
return acc;
|
|
5282
|
-
}, [rateRows[0]]);
|
|
5283
|
-
if (rates.length > 1) {
|
|
5284
|
-
return rates.reduce((prev, i) => (comparators[1](i, prev) ? i : prev), rates[0]);
|
|
5285
|
-
}
|
|
5286
|
-
return rates[0];
|
|
5287
|
-
};
|
|
5288
|
-
|
|
5289
|
-
const STEP_MONTHS = 1;
|
|
5290
|
-
const renderMonthsInput = ({ min = 0, max = 0, availableMonths, ...rest }) => (jsx(InputRange, { items: [`От ${monthText(min)}`, `До ${monthText(max)}`], step: STEP_MONTHS, ...(availableMonths?.length ? { list: availableMonths } : { min, max }), ...rest }));
|
|
5291
|
-
const monthText = (month) => `${month} ${Number(month) % 10 === 1 ? 'месяца' : 'месяцев'}`;
|
|
5292
|
-
|
|
5293
|
-
const renderPaymentType = (props) => renderBinaryRadioButtonGroup({
|
|
5294
|
-
...props,
|
|
5295
|
-
className: 'sm:flex-col',
|
|
5296
|
-
items: [
|
|
5297
|
-
{ id: 'annuity', text: 'Аннуитетный' },
|
|
5298
|
-
{ id: 'differential', text: 'Дифференцированный' },
|
|
5299
|
-
],
|
|
5300
|
-
});
|
|
5301
|
-
|
|
5302
|
-
const setDefaultParamsCalc = ({ field, defParams, calcParams, map, monthsValue = 'maxMonths', }) => {
|
|
5303
|
-
Object.entries(map).forEach(([key, value]) => {
|
|
5304
|
-
field?.(key)?.onChange?.(defParams?.[value]);
|
|
5305
|
-
});
|
|
5306
|
-
field?.('monthsValue')?.onChange?.(clamp(defParams?.[monthsValue], calcParams.minMonths, calcParams.maxMonths));
|
|
5307
|
-
};
|
|
5308
|
-
|
|
5309
|
-
/**
|
|
5310
|
-
* Формулы расчёта аннуитетных и дифференцированных платежей:
|
|
5311
|
-
* https://finuslugi.ru/potrebitelskie_kredity/stat_annuitetnye_i_differentsirovannye_platezhi
|
|
5312
|
-
*/
|
|
5313
|
-
const getMonthlyPayment = (rate, params) => {
|
|
5314
|
-
const { isAnnuity, moneyValue, monthsValue, moneyExtra } = params;
|
|
5315
|
-
if (rate === 0) {
|
|
5316
|
-
return 0;
|
|
5317
|
-
}
|
|
5318
|
-
else if (isAnnuity) {
|
|
5319
|
-
const i = rate / MONTHLY_INTEREST_RATE; // Используется значение ставки в процентах
|
|
5320
|
-
if (moneyExtra) {
|
|
5321
|
-
return (moneyValue + moneyExtra) * (i + i / (Math.pow(1 + i, monthsValue) - 1));
|
|
5322
|
-
}
|
|
5323
|
-
else {
|
|
5324
|
-
return moneyValue * (i + i / (Math.pow(1 + i, monthsValue) - 1));
|
|
5325
|
-
}
|
|
5326
|
-
}
|
|
5327
|
-
else {
|
|
5328
|
-
return Math.round(moneyValue / monthsValue) + moneyValue * (rate / (MONTHS_IN_YEAR * 100)); // Используется значение ставки (rate) в процентах, делённое на сто.
|
|
5329
|
-
}
|
|
5330
|
-
};
|
|
5331
|
-
|
|
5332
|
-
const DEFAULT_MIN_SUM$2 = 10000;
|
|
5333
|
-
const DEFAULT_MAX_SUM$1 = 5000000;
|
|
5334
|
-
const DEFAULT_CREDIT_CALCULATOR_PARAMS = {
|
|
5335
|
-
minSum: DEFAULT_MIN_SUM$2,
|
|
5336
|
-
maxSum: DEFAULT_MAX_SUM$1,
|
|
5337
|
-
minMonths: DEFAULT_MIN_MONTHS,
|
|
5338
|
-
maxMonths: DEFAULT_MAX_MONTHS,
|
|
5339
|
-
rate: 0,
|
|
5340
|
-
isSalaryClient: false,
|
|
5341
|
-
isPensionClient: false,
|
|
5342
|
-
isStateEmployee: false,
|
|
5343
|
-
isInsurance: true,
|
|
5344
|
-
};
|
|
5345
|
-
|
|
5346
|
-
const checkCreditSourceBookRowCommonParams = (props) => checkRowParam$1({
|
|
5347
|
-
...props,
|
|
5348
|
-
fieldKey: 'isSalaryClient',
|
|
5349
|
-
viewSettingFieldKey: 'isShowSalaryClient',
|
|
5350
|
-
}) &&
|
|
5351
|
-
checkRowParam$1({
|
|
5352
|
-
...props,
|
|
5353
|
-
fieldKey: 'isStateEmployee',
|
|
5354
|
-
viewSettingFieldKey: 'isShowStateEmployee',
|
|
5355
|
-
}) &&
|
|
5356
|
-
checkRowParam$1({
|
|
5357
|
-
...props,
|
|
5358
|
-
fieldKey: 'isPensionClient',
|
|
5359
|
-
viewSettingFieldKey: 'isShowPensionClient',
|
|
5360
|
-
}) &&
|
|
5361
|
-
checkRowParam$1({
|
|
5362
|
-
...props,
|
|
5363
|
-
fieldKey: 'isInsurance',
|
|
5364
|
-
viewSettingFieldKey: 'isShowInsurance',
|
|
5365
|
-
});
|
|
5366
|
-
const checkRowParam$1 = ({ row, userInputParams, paramsViewSettings, fieldKey, viewSettingFieldKey, }) => {
|
|
5367
|
-
const isExclude = paramsViewSettings ? !paramsViewSettings[viewSettingFieldKey] : false;
|
|
5368
|
-
return isExclude || userInputParams[fieldKey] === row[fieldKey];
|
|
5369
|
-
};
|
|
5370
|
-
|
|
5371
|
-
const getCreditCalculatorLimitParams = ({ limitRows, userInputParams, paramsViewSettings, }) => limitRows?.find((row) => checkCreditSourceBookRowCommonParams({
|
|
5372
|
-
row,
|
|
5373
|
-
userInputParams,
|
|
5374
|
-
paramsViewSettings,
|
|
5375
|
-
}));
|
|
5376
|
-
|
|
5377
|
-
const getCreditCalculatorRateParams = ({ rateRows = [], userInputParams, paramsViewSettings, moneyValue, monthsValue, }) => rateRows?.find((row) => checkCreditSourceBookRowCommonParams({
|
|
5378
|
-
row,
|
|
5379
|
-
userInputParams,
|
|
5380
|
-
paramsViewSettings,
|
|
5381
|
-
}) &&
|
|
5382
|
-
checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], row) &&
|
|
5383
|
-
checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], row)) || DEFAULT_CREDIT_CALCULATOR_PARAMS;
|
|
5384
|
-
|
|
5385
|
-
const getCreditCalculatorParams = (userInputParams, calcSource, paramsViewSettings) => {
|
|
5386
|
-
const { moneyValue, monthsValue } = userInputParams;
|
|
5387
|
-
const rateRows = calcSource?.rateRows || [DEFAULT_CREDIT_CALCULATOR_PARAMS];
|
|
5388
|
-
const limitRows = calcSource?.limitRows || [];
|
|
5389
|
-
const creditCalculatorSourceBookLimitParams = getCreditCalculatorLimitParams({
|
|
5390
|
-
limitRows,
|
|
5391
|
-
userInputParams,
|
|
5392
|
-
paramsViewSettings,
|
|
5393
|
-
});
|
|
5394
|
-
const { minSum, maxSum } = getLimitRangeByKeys(['minSum', 'maxSum'], creditCalculatorSourceBookLimitParams, rateRows);
|
|
5395
|
-
const { minMonths, maxMonths } = getLimitRangeByKeys(['minMonths', 'maxMonths'], creditCalculatorSourceBookLimitParams, rateRows);
|
|
5396
|
-
const creditCalculatorRateParams = getCreditCalculatorRateParams({
|
|
5397
|
-
rateRows,
|
|
5398
|
-
userInputParams,
|
|
5399
|
-
paramsViewSettings,
|
|
5400
|
-
moneyValue,
|
|
5401
|
-
monthsValue,
|
|
5402
|
-
});
|
|
5403
|
-
const { rate } = creditCalculatorRateParams;
|
|
5404
|
-
const monthlyPayment = getMonthlyPayment(rate, userInputParams);
|
|
5368
|
+
|
|
5369
|
+
const BUSINESS_MIN_DAYS = 1;
|
|
5370
|
+
const BUSINESS_MAX_DAYS = 1095;
|
|
5371
|
+
const BUSINESS_OPERATING_MIN_DAYS = 90;
|
|
5372
|
+
const BUSINESS_OPERATING_MAX_DAYS = 730;
|
|
5373
|
+
const DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS = {
|
|
5374
|
+
minSum: 1000,
|
|
5375
|
+
maxSum: 100000001,
|
|
5376
|
+
minDays: BUSINESS_MIN_DAYS,
|
|
5377
|
+
maxDays: BUSINESS_MAX_DAYS,
|
|
5378
|
+
rate: 0,
|
|
5379
|
+
isMonthlyInterestPayment: true,
|
|
5380
|
+
isReplenished: false,
|
|
5381
|
+
isPartialWithdrawal: false,
|
|
5382
|
+
depositeName: "Депозит 'Стабильный'",
|
|
5383
|
+
};
|
|
5384
|
+
const useBusinessDepositParams = (userInputParams, rateParams) => {
|
|
5385
|
+
const { daysValue, moneyValue, isPartialWithdrawal, isReplenished, isMonthlyInterestPayment } = userInputParams;
|
|
5386
|
+
const isOperatingDeposit = isReplenished || isPartialWithdrawal;
|
|
5387
|
+
const isDisabledOperatingDeposit = daysValue < BUSINESS_OPERATING_MIN_DAYS || daysValue > BUSINESS_OPERATING_MAX_DAYS;
|
|
5388
|
+
const rateRows = useBusinessDepositRates(rateParams);
|
|
5389
|
+
const businessDepositCalculatorSourceBookParams = rateRows?.find((_) => {
|
|
5390
|
+
return (isMonthlyInterestPayment === _.isMonthlyInterestPayment &&
|
|
5391
|
+
checkIsOperatingDeposit(isOperatingDeposit, _) &&
|
|
5392
|
+
checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
|
|
5393
|
+
checkRangeByKeys(daysValue, ['minDays', 'maxDays'], _));
|
|
5394
|
+
}) || DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS;
|
|
5395
|
+
const { rate } = businessDepositCalculatorSourceBookParams;
|
|
5396
|
+
const income = getDepositIncome$1(rate, userInputParams);
|
|
5397
|
+
const finalSum = moneyValue + income;
|
|
5398
|
+
const sourceBookRows = rateRows || [DEFAULT_BUSINESS_DEPOSIT_CALCULATOR_PARAMS];
|
|
5405
5399
|
return {
|
|
5406
|
-
...
|
|
5400
|
+
...businessDepositCalculatorSourceBookParams,
|
|
5401
|
+
...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
|
|
5402
|
+
...getRangeByKeys(['minDays', 'maxDays'], sourceBookRows),
|
|
5407
5403
|
...userInputParams,
|
|
5408
|
-
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
maxMonths,
|
|
5412
|
-
moneyValue,
|
|
5413
|
-
monthsValue,
|
|
5414
|
-
monthlyPayment,
|
|
5404
|
+
isDisabledOperatingDeposit,
|
|
5405
|
+
income,
|
|
5406
|
+
finalSum,
|
|
5415
5407
|
};
|
|
5416
5408
|
};
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
const
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
|
|
5409
|
+
const checkIsOperatingDeposit = (isOperatingDeposit, sourceBookRow) => isOperatingDeposit
|
|
5410
|
+
? sourceBookRow.isReplenished && sourceBookRow.isPartialWithdrawal
|
|
5411
|
+
: !sourceBookRow.isReplenished && !sourceBookRow.isPartialWithdrawal;
|
|
5412
|
+
const getDepositIncome$1 = (rate, userInputParams) => {
|
|
5413
|
+
const { isMonthlyInterestPayment, moneyValue, daysValue } = userInputParams;
|
|
5414
|
+
/*
|
|
5415
|
+
Приблизительный расчёт, не учитывающий разницу в количестве дней в месяцах. Месяц принят за 30 дней, год за 365 дней.
|
|
5416
|
+
*/
|
|
5417
|
+
if (isMonthlyInterestPayment) {
|
|
5418
|
+
return Math.round(moneyValue * Math.pow((1200 + rate) / 1200, daysValue / 30) - moneyValue);
|
|
5419
|
+
}
|
|
5420
|
+
else {
|
|
5421
|
+
return Math.round((moneyValue * rate * daysValue) / 365 / 100);
|
|
5422
|
+
}
|
|
5427
5423
|
};
|
|
5428
|
-
|
|
5429
|
-
|
|
5430
|
-
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
|
-
|
|
5434
|
-
|
|
5435
|
-
|
|
5436
|
-
|
|
5437
|
-
|
|
5438
|
-
});
|
|
5439
|
-
registerSubmit?.(onSubmit);
|
|
5440
|
-
const calcParams = getCreditCalculatorParams(userInputParams, calcSource, paramsViewSettings);
|
|
5441
|
-
const paymentTypeElement = renderPaymentType({
|
|
5442
|
-
title: 'Тип платежа',
|
|
5443
|
-
orientation: 'vertical',
|
|
5444
|
-
...field('isAnnuity'),
|
|
5424
|
+
|
|
5425
|
+
const BUSINESS_DEFAULT_SUM = 100000;
|
|
5426
|
+
const BUSINESS_DEFAULT_DAYS = 60;
|
|
5427
|
+
const CalculatorBusinessDeposit = UniBlock(({ className = '', title, buttons, footnote, bottomFootnote, isShowDepositeName, defaultParams, rateParams, ...rest }) => {
|
|
5428
|
+
const [userInputParams, { field }] = useForm({
|
|
5429
|
+
moneyValue: getMoneyDefaultValue(defaultParams, BUSINESS_DEFAULT_SUM),
|
|
5430
|
+
daysValue: getMonthsDefaultValue(defaultParams, BUSINESS_DEFAULT_DAYS),
|
|
5431
|
+
isReplenished: Boolean(defaultParams?.isReplenished),
|
|
5432
|
+
isPartialWithdrawal: Boolean(defaultParams?.isPartialWithdrawal),
|
|
5433
|
+
isMonthlyInterestPayment: Boolean(defaultParams?.isMonthlyInterestPayment),
|
|
5445
5434
|
});
|
|
5446
|
-
const
|
|
5447
|
-
const {
|
|
5448
|
-
useEffect(() => {
|
|
5449
|
-
setMoneyValue &&
|
|
5450
|
-
setMoneyValue(clamp(userInputParams.moneyValue, calcParams.minSum, calcParams.maxSum));
|
|
5451
|
-
}, [calcParams.minSum, calcParams.maxSum]);
|
|
5452
|
-
useEffect(() => {
|
|
5453
|
-
setMonthsValue &&
|
|
5454
|
-
setMonthsValue(clamp(userInputParams.monthsValue, calcParams.minMonths, calcParams.maxMonths));
|
|
5455
|
-
}, [calcParams.minMonths, calcParams.maxMonths]);
|
|
5456
|
-
useEffect(() => {
|
|
5457
|
-
if (!isDefaultParams(defaultParams) && defaultParamsCals) {
|
|
5458
|
-
setDefaultParamsCalc({
|
|
5459
|
-
field,
|
|
5460
|
-
defParams: defaultParamsCals,
|
|
5461
|
-
calcParams,
|
|
5462
|
-
map: MAP$1,
|
|
5463
|
-
monthsValue: 'minMonths',
|
|
5464
|
-
});
|
|
5465
|
-
}
|
|
5466
|
-
}, [calcSource, defaultParams]);
|
|
5435
|
+
const calculatorParams = useBusinessDepositParams(userInputParams, rateParams);
|
|
5436
|
+
const { income, finalSum, rate, depositeName } = calculatorParams;
|
|
5467
5437
|
return (jsx(CalculatorLayout, { className: className, title: title, ...rest, children: jsxs("section", { className: style(CalculatorStyle.wrapper, className), children: [jsxs("div", { className: CalculatorStyle.input, children: [renderWantedSumInput({
|
|
5468
|
-
title: '
|
|
5469
|
-
|
|
5470
|
-
|
|
5471
|
-
max: calcParams.maxSum,
|
|
5438
|
+
title: 'Сумма, ₽',
|
|
5439
|
+
min: calculatorParams.minSum,
|
|
5440
|
+
max: calculatorParams.maxSum,
|
|
5472
5441
|
...field('moneyValue'),
|
|
5473
|
-
value:
|
|
5474
|
-
}),
|
|
5475
|
-
title: '
|
|
5476
|
-
min:
|
|
5477
|
-
max:
|
|
5478
|
-
...field('
|
|
5479
|
-
value:
|
|
5480
|
-
}),
|
|
5442
|
+
value: calculatorParams.moneyValue,
|
|
5443
|
+
}), renderDaysInput({
|
|
5444
|
+
title: 'Срок, дней',
|
|
5445
|
+
min: calculatorParams.minDays,
|
|
5446
|
+
max: calculatorParams.maxDays,
|
|
5447
|
+
...field('daysValue'),
|
|
5448
|
+
value: calculatorParams.daysValue,
|
|
5449
|
+
}), jsxs("div", { className: "flex flex-col sm:flex-row gap-y-m gap-x-5xl", children: [renderBusinessDepositParamsForm(calculatorParams, field), renderPayout({
|
|
5450
|
+
title: 'Выплата процентов',
|
|
5451
|
+
orientation: 'vertical',
|
|
5452
|
+
...field('isMonthlyInterestPayment'),
|
|
5453
|
+
className: 'sm:flex-col',
|
|
5454
|
+
})] })] }), renderRate({
|
|
5455
|
+
rate,
|
|
5456
|
+
depositeName,
|
|
5457
|
+
isShowDepositeName,
|
|
5458
|
+
}), renderDepositResult({
|
|
5459
|
+
income,
|
|
5460
|
+
finalSum,
|
|
5461
|
+
buttons,
|
|
5462
|
+
footnotes: [footnote, bottomFootnote],
|
|
5463
|
+
})] }) }));
|
|
5481
5464
|
});
|
|
5482
|
-
const
|
|
5465
|
+
const renderBusinessDepositParamsForm = (calculatorParams, field) => (jsxs("div", { className: "space-y-s", children: [jsx(Text, { color: "text-secondary-text", font: "font-light", children: "\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B" }), jsxs("div", { className: "flex flex-col gap-y-lg sm:gap-y-s", children: [jsx(Checkbox, { text: "\u041F\u043E\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435", disabled: calculatorParams.isDisabledOperatingDeposit, ...field('isReplenished'), value: calculatorParams.isReplenished }), jsx(Checkbox, { disabled: calculatorParams.isDisabledOperatingDeposit, text: "\u0427\u0430\u0441\u0442\u0438\u0447\u043D\u043E\u0435 \u0441\u043D\u044F\u0442\u0438\u0435", ...field('isPartialWithdrawal'), value: calculatorParams.isPartialWithdrawal })] })] }));
|
|
5483
5466
|
|
|
5484
5467
|
const arrayByRange = (start, stop, step = 1) => Array.from({ length: Math.abs(stop - start) / step + 1 }, (value, index) => stop >= start ? start + index * step : start - index * step);
|
|
5485
5468
|
|
|
@@ -6133,10 +6116,10 @@
|
|
|
6133
6116
|
}
|
|
6134
6117
|
}), [options?.parent]);
|
|
6135
6118
|
return (jsxs(BlockWrapper, { className: style('flex flex-col', className), defaultPadding: "p-2xl", ...rest, children: [isIcon(icon) ? (jsx("div", { className: "self-center", children: jsx(Img, { image: icon }) })) : null, title ? (jsx(Heading, { className: style('pt-xs', align), headingType: "h5", title: title })) : null, button?.text ? jsx(LinkButton, { className: "w-full mt-m mb-lg", ...button }) : null, hiddenCells.length ? (jsx(Foldable, { renderFoldableSection: () => (jsxs("div", { children: [visibleCells, jsx(FoldableSection, { isUnfolded: isVisible, children: hiddenCells })] })), renderFoldButton: cardCells.length >= visibleCellsCount
|
|
6136
|
-
? renderFoldButton$
|
|
6119
|
+
? renderFoldButton$2(options?.parent, data, isVisible)
|
|
6137
6120
|
: null })) : (jsx("div", { children: visibleCells }))] }));
|
|
6138
6121
|
});
|
|
6139
|
-
const renderFoldButton$
|
|
6122
|
+
const renderFoldButton$2 = (parent, data, isUnfolded = false) => () => (jsxs("button", { className: "w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center", onClick: () => {
|
|
6140
6123
|
if (parent !== undefined) {
|
|
6141
6124
|
defaultEventBus.fire('fold', { type: 'fold', isUnfolded: !isUnfolded, parent });
|
|
6142
6125
|
}
|
|
@@ -6194,6 +6177,16 @@
|
|
|
6194
6177
|
|
|
6195
6178
|
const sendSignalToProcess = (body) => doRequest('/user-data/sendSignalToProcess', 'POST', body);
|
|
6196
6179
|
|
|
6180
|
+
const useInterval = (handler, period) => {
|
|
6181
|
+
const timer = useRef(null);
|
|
6182
|
+
const clearTimer = useCallback(() => timer.current && clearInterval(timer.current), []);
|
|
6183
|
+
useEffect(() => {
|
|
6184
|
+
timer.current = setInterval(() => handler(clearTimer), period);
|
|
6185
|
+
return clearTimer;
|
|
6186
|
+
}, [handler, period]);
|
|
6187
|
+
return clearTimer;
|
|
6188
|
+
};
|
|
6189
|
+
|
|
6197
6190
|
const InfoCard = JSX(({ __html, icon = 'InfoCircleIcon', iconVersion = 'black', link }) => (jsxs("div", { className: "flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m", children: [jsx("div", { className: "rounded-full bg-white p-xs", children: jsx(Icon, { name: icon, width: "24", height: "24", iconVersion: iconVersion }) }), jsxs("div", { className: "", children: [jsx(RichText, { __html: __html }), link?.text ? jsx(LinkButton, { className: "text-primary-main", children: link.text }) : null] })] })));
|
|
6198
6191
|
|
|
6199
6192
|
const TimerCircle = JSX(({ interval = 0, intervalExpireAction = () => null, title, __html }) => {
|
|
@@ -6210,7 +6203,9 @@
|
|
|
6210
6203
|
} }), jsx("div", { className: "z-10 flex items-center justify-center px-4 py-2 rounded-full w-20 h-20 bg-white text-primary-text text-m", children: jsx(Timer, { interval: interval, time: time, setTime: setTimeWithHandleExpire }) })] }), __html ? jsx(RichText, { __html: __html }) : null] })] }));
|
|
6211
6204
|
});
|
|
6212
6205
|
|
|
6213
|
-
const CreditCardFormStatus = JSX(({ title, description: dsc, infoCard, sectionInfoTitle, sectionInfo, sectionAdditionalTitle, sectionInfoAdditional, buttonText, interval,
|
|
6206
|
+
const CreditCardFormStatus = JSX(({ title, description: dsc, infoCard, sectionInfoTitle, sectionInfo, sectionAdditionalTitle, sectionInfoAdditional, buttonText, interval, intervalExpireAction = () => {
|
|
6207
|
+
return;
|
|
6208
|
+
}, ...props }) => (jsxs(BlockWrapper, { ...props, children: [jsxs("div", { className: "flex flex-col md:flex-row items-center", children: [jsx(Headline, { headlineVersion: "M", title: title, description: dsc, align: "text-left", padding: "p-xl", className: "w-full" }), interval ? (jsx(TimerCircle, { interval: interval, intervalExpireAction: intervalExpireAction })) : null] }), jsx(SectionInfo$1, { title: sectionInfoTitle, items: sectionInfo }), jsx(SectionInfo$1, { title: sectionAdditionalTitle, items: sectionInfoAdditional, countColumns: true }), infoCard?.__html ? (jsx(InfoCard, { __html: infoCard?.__html, icon: infoCard?.icon, link: {
|
|
6214
6209
|
text: infoCard?.link?.text,
|
|
6215
6210
|
} })) : null, buttonText ? (jsx(LinkButton, { href: "/natural", text: buttonText, version: "primary", className: "w-full mt-lg" })) : null] })));
|
|
6216
6211
|
const SectionInfo$1 = ({ title, items, countColumns = false, }) => {
|
|
@@ -6224,9 +6219,9 @@
|
|
|
6224
6219
|
|
|
6225
6220
|
const FailedStatusContent$1 = JSX(() => (jsx(CreditCardFormStatus, { title: "\u0411\u043B\u0430\u0433\u043E\u0434\u0430\u0440\u0438\u043C \u0412\u0430\u0441 \u0437\u0430 \u043E\u0436\u0438\u0434\u0430\u043D\u0438\u0435", description: "\u0412 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0438\u0439 \u043C\u043E\u043C\u0435\u043D\u0442 \u0411\u0430\u043D\u043A \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u043E\u0434\u043E\u0431\u0440\u0438\u0442\u044C \u0412\u0430\u0448\u0443 \u0437\u0430\u044F\u0432\u043A\u0443 \u043D\u0430 \u043A\u0440\u0435\u0434\u0438\u0442. \u041F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u043F\u043E\u0434\u0430\u0442\u044C \u0437\u0430\u044F\u0432\u043A\u0443 \u043F\u043E\u0437\u0436\u0435. \u0421\u043F\u0430\u0441\u0438\u0431\u043E \u0437\u0430 \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0435 \u0432 \u0410\u041E \u00AB\u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u00BB.", buttonText: "\u0412\u0435\u0440\u043D\u0443\u0442\u044C\u0441\u044F \u043D\u0430 \u0433\u043B\u0430\u0432\u043D\u0443\u044E" })));
|
|
6226
6221
|
|
|
6227
|
-
const PendingStatusContent$1 = JSX(() => {
|
|
6222
|
+
const PendingStatusContent$1 = JSX(({ handleExpireTimer }) => {
|
|
6228
6223
|
const [leadForm] = useLocalStorage('leadForm');
|
|
6229
|
-
return (jsx(CreditCardFormStatus, { interval: 300, title: "\u0417\u0430\u044F\u0432\u043A\u0430 \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0430", description: "\u041D\u0435 \u0437\u0430\u043A\u0440\u044B\u0432\u0430\u0439\u0442\u0435 \u043E\u043A\u043D\u043E, \u0441\u043A\u043E\u0440\u043E \u0441\u043E\u043E\u0431\u0449\u0438\u043C \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442", sectionInfoTitle: "\u0417\u0430\u044F\u0432\u043B\u0435\u043D\u043D\u044B\u0435 \u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u043E \u043A\u0440\u0435\u0434\u0438\u0442\u0443", sectionInfo: [
|
|
6224
|
+
return (jsx(CreditCardFormStatus, { interval: 300, intervalExpireAction: handleExpireTimer, title: "\u0417\u0430\u044F\u0432\u043A\u0430 \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0430", description: "\u041D\u0435 \u0437\u0430\u043A\u0440\u044B\u0432\u0430\u0439\u0442\u0435 \u043E\u043A\u043D\u043E, \u0441\u043A\u043E\u0440\u043E \u0441\u043E\u043E\u0431\u0449\u0438\u043C \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442", sectionInfoTitle: "\u0417\u0430\u044F\u0432\u043B\u0435\u043D\u043D\u044B\u0435 \u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u043E \u043A\u0440\u0435\u0434\u0438\u0442\u0443", sectionInfo: [
|
|
6230
6225
|
{
|
|
6231
6226
|
label: 'Название продукта',
|
|
6232
6227
|
description: 'Кредитная карта',
|
|
@@ -6296,20 +6291,21 @@
|
|
|
6296
6291
|
await sendSignalToProcess({ signalType, taskId });
|
|
6297
6292
|
}
|
|
6298
6293
|
})();
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
}
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6294
|
+
}, [taskId]);
|
|
6295
|
+
const trackStatus = useCallback(async (stopInterval) => {
|
|
6296
|
+
const res = await getTaskStatus({ taskId });
|
|
6297
|
+
if (res && res?.statusCd !== STATUS_TYPE.process) {
|
|
6298
|
+
stopInterval();
|
|
6299
|
+
setStatus(res.statusCd);
|
|
6300
|
+
}
|
|
6301
|
+
}, [taskId]);
|
|
6302
|
+
useInterval(trackStatus, 30000);
|
|
6303
|
+
const handleExpire = () => setStatus(STATUS_TYPE.rework);
|
|
6304
|
+
return renderStatus$1(status, handleExpire);
|
|
6309
6305
|
});
|
|
6310
|
-
const renderStatus$1 = (status) => {
|
|
6306
|
+
const renderStatus$1 = (status, handleExpire) => {
|
|
6311
6307
|
const statusesMap = {
|
|
6312
|
-
IN_PROCESS: jsx(PendingStatusContent$1, {}),
|
|
6308
|
+
IN_PROCESS: jsx(PendingStatusContent$1, { handleExpireTimer: handleExpire }),
|
|
6313
6309
|
CANCELLED: jsx(FailedStatusContent$1, {}),
|
|
6314
6310
|
APPROVED: jsx(SuccessStatusContent$1, {}),
|
|
6315
6311
|
REVISION: jsx(ReworkStatusContent$1, {}),
|
|
@@ -6461,12 +6457,12 @@
|
|
|
6461
6457
|
: null;
|
|
6462
6458
|
};
|
|
6463
6459
|
|
|
6464
|
-
const renderInputs$1 = ({ field, inputs }) => inputs.map(getField(field,
|
|
6460
|
+
const renderInputs$1 = ({ field, inputs, params }) => inputs.map(getField(field, params));
|
|
6465
6461
|
|
|
6466
|
-
const renderStep$1 = ({ sections, field, step }) => sections?.map(({ inputs: origInputs = [], columns, title }, i) => {
|
|
6462
|
+
const renderStep$1 = ({ sections, field, step, params }) => sections?.map(({ inputs: origInputs = [], columns, title }, i) => {
|
|
6467
6463
|
const inputs = calculateInputs$1(getValue$3(field))(origInputs, step);
|
|
6468
6464
|
const filteredInputs = inputs.filter((_) => !checkCondition$1(_, getValue$3(field)));
|
|
6469
|
-
return (jsxs("div", { className: style(inputColumnStyles(columns), 'grid gap-x-m'), children: [renderInfo$2(filteredInputs), renderTitle(title), renderInputs$1({ field, inputs })] }, `section-${i}`));
|
|
6465
|
+
return (jsxs("div", { className: style(inputColumnStyles(columns), 'grid gap-x-m'), children: [renderInfo$2(filteredInputs), renderTitle(title), renderInputs$1({ field, inputs, params })] }, `section-${i}`));
|
|
6470
6466
|
});
|
|
6471
6467
|
const getValue$3 = (field) => (name) => field(name)?.value;
|
|
6472
6468
|
|
|
@@ -6686,11 +6682,7 @@
|
|
|
6686
6682
|
const CreditCardFormStep = JSX(({ step, sections, onPrevStep, onNextStep, isFormFinished, finishForm }) => {
|
|
6687
6683
|
const [localStorageData, saveStep] = useLocalStorage('leadForm');
|
|
6688
6684
|
const initialState = getInitialFormState$1(step, localStorageData);
|
|
6689
|
-
const customSubmit = useRef(undefined);
|
|
6690
6685
|
const inputs = (sections?.flatMap((_) => _?.inputs) || []);
|
|
6691
|
-
const registerSubmit = useCallback((submit) => {
|
|
6692
|
-
customSubmit.current = submit;
|
|
6693
|
-
}, []);
|
|
6694
6686
|
const { handleSubmit } = useCreditCardFormAPI({
|
|
6695
6687
|
step,
|
|
6696
6688
|
inputs,
|
|
@@ -6699,16 +6691,9 @@
|
|
|
6699
6691
|
finishForm,
|
|
6700
6692
|
});
|
|
6701
6693
|
const [, { field, onSubmit }] = useForm(initialState, {
|
|
6702
|
-
onSubmit:
|
|
6703
|
-
handleSubmit({ ...formData, ...customSubmit.current?.(ev) });
|
|
6704
|
-
},
|
|
6694
|
+
onSubmit: handleSubmit,
|
|
6705
6695
|
});
|
|
6706
|
-
return isFormFinished ? (jsx(CreditCardFormStatusTracker, {})) : (jsxs("form", { onSubmit: onSubmit, className: "space-y-m", children: [renderStep$1({
|
|
6707
|
-
sections,
|
|
6708
|
-
field,
|
|
6709
|
-
step,
|
|
6710
|
-
registerSubmit,
|
|
6711
|
-
}), jsx(StepsNavigationButtons$1, { step: step, onPrevStep: onPrevStep })] }));
|
|
6696
|
+
return isFormFinished ? (jsx(CreditCardFormStatusTracker, {})) : (jsxs("form", { onSubmit: onSubmit, className: "space-y-m", children: [renderStep$1({ sections, field, step }), jsx(StepsNavigationButtons$1, { step: step, onPrevStep: onPrevStep })] }));
|
|
6712
6697
|
});
|
|
6713
6698
|
|
|
6714
6699
|
/* eslint-disable max-lines */
|
|
@@ -7051,8 +7036,8 @@
|
|
|
7051
7036
|
],
|
|
7052
7037
|
];
|
|
7053
7038
|
|
|
7054
|
-
const
|
|
7055
|
-
const
|
|
7039
|
+
const STEPS$1 = 6;
|
|
7040
|
+
const TITLES = [
|
|
7056
7041
|
'Параметры карты',
|
|
7057
7042
|
'Персональные данные',
|
|
7058
7043
|
'Данные о трудоустройстве',
|
|
@@ -7066,7 +7051,7 @@
|
|
|
7066
7051
|
const scrollToTop = useCallback(() => formContainerRef?.current?.scrollIntoView({ behavior: 'smooth' }), [formContainerRef]);
|
|
7067
7052
|
useEffect(updateRefreshToken, []);
|
|
7068
7053
|
const handleNextStep = useCallback(() => {
|
|
7069
|
-
setStep((_) => Math.min(_ + 1,
|
|
7054
|
+
setStep((_) => Math.min(_ + 1, STEPS$1));
|
|
7070
7055
|
scrollToTop();
|
|
7071
7056
|
}, []);
|
|
7072
7057
|
const handlePrevStep = useCallback(() => {
|
|
@@ -7076,7 +7061,7 @@
|
|
|
7076
7061
|
}, []);
|
|
7077
7062
|
const sections = useMemo(() => stepsSectionsMap$1[step], [step]);
|
|
7078
7063
|
const [isFormFinished, setIsFormFinished] = useState(false);
|
|
7079
|
-
return (jsx(BlockWrapper, { className: style('bg-transparent', className), defaultPadding: "p-0", ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isFormFinished ? null : (jsx(CreditCardFormProgress, { stepsTitles:
|
|
7064
|
+
return (jsx(BlockWrapper, { className: style('bg-transparent', className), defaultPadding: "p-0", ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isFormFinished ? null : (jsx(CreditCardFormProgress, { stepsTitles: TITLES, step: step, totalSteps: STEPS$1 })), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: jsx(CreditCardFormStep, { step: step, sections: sections, onNextStep: handleNextStep, onPrevStep: handlePrevStep, isFormFinished: isFormFinished, finishForm: setIsFormFinished }, String(step)) })] }) }));
|
|
7080
7065
|
});
|
|
7081
7066
|
|
|
7082
7067
|
const CreditFormProgress = JSX(({ step = 1, totalSteps = 5, stepsTitles = [] }) => {
|
|
@@ -7186,16 +7171,15 @@
|
|
|
7186
7171
|
await sendSignalToProcess({ signalType, taskId });
|
|
7187
7172
|
}
|
|
7188
7173
|
})();
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
|
|
7192
|
-
|
|
7193
|
-
|
|
7194
|
-
|
|
7195
|
-
|
|
7196
|
-
|
|
7197
|
-
|
|
7198
|
-
}, []);
|
|
7174
|
+
}, [taskId]);
|
|
7175
|
+
const trackStatus = useCallback(async (stopInterval) => {
|
|
7176
|
+
const res = await getTaskStatus({ taskId });
|
|
7177
|
+
if (res && res?.statusCd !== STATUS_TYPE.process) {
|
|
7178
|
+
stopInterval();
|
|
7179
|
+
setStatus(res.statusCd);
|
|
7180
|
+
}
|
|
7181
|
+
}, [taskId]);
|
|
7182
|
+
useInterval(trackStatus, 30000);
|
|
7199
7183
|
const handleExpire = () => setStatus(STATUS_TYPE.rework);
|
|
7200
7184
|
return renderStatus(status, handleExpire);
|
|
7201
7185
|
});
|
|
@@ -7211,13 +7195,15 @@
|
|
|
7211
7195
|
|
|
7212
7196
|
const formStateMap = [
|
|
7213
7197
|
{
|
|
7214
|
-
|
|
7215
|
-
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
|
|
7219
|
-
|
|
7220
|
-
|
|
7198
|
+
calculator: {
|
|
7199
|
+
moneyValue: 0,
|
|
7200
|
+
monthsValue: 0,
|
|
7201
|
+
isAnnuity: false,
|
|
7202
|
+
isInsurance: false,
|
|
7203
|
+
isSalaryClient: false,
|
|
7204
|
+
isPensionClient: false,
|
|
7205
|
+
isStateEmployee: false,
|
|
7206
|
+
},
|
|
7221
7207
|
},
|
|
7222
7208
|
{
|
|
7223
7209
|
surname: '',
|
|
@@ -7343,11 +7329,11 @@
|
|
|
7343
7329
|
: null;
|
|
7344
7330
|
};
|
|
7345
7331
|
|
|
7346
|
-
const renderInputs = ({ field, inputs }) => inputs.map(getField(field,
|
|
7332
|
+
const renderInputs = ({ field, inputs, params }) => inputs.map(getField(field, params));
|
|
7347
7333
|
|
|
7348
|
-
const renderStep = ({ sections, field, step }) => sections?.map(({ inputs: origInputs = [], columns, title }, i) => {
|
|
7334
|
+
const renderStep = ({ sections, field, step, params }) => sections?.map(({ inputs: origInputs = [], columns, title }, i) => {
|
|
7349
7335
|
const inputs = calculateInputs(getValue$1(field))(origInputs, step);
|
|
7350
|
-
return (jsxs("div", { className: style(inputColumnStyles(columns), 'grid gap-x-m'), children: [renderInfo$1(inputs), renderTitle(title), renderInputs({ field, inputs })] }, `section-${i}`));
|
|
7336
|
+
return (jsxs("div", { className: style(inputColumnStyles(columns), 'grid gap-x-m'), children: [renderInfo$1(inputs), renderTitle(title), renderInputs({ field, inputs, params })] }, `section-${i}`));
|
|
7351
7337
|
});
|
|
7352
7338
|
const getValue$1 = (field) => (name) => field(name)?.value;
|
|
7353
7339
|
|
|
@@ -7357,6 +7343,19 @@
|
|
|
7357
7343
|
return (jsxs("div", { className: 'flex justify-between gap-m', children: [jsx(Button, { onClick: onPrevStep, type: "button", version: "secondary", disabled: isFirstStep, children: "\u041D\u0430\u0437\u0430\u0434" }), jsx(Button, { type: "submit", children: isFinalStep ? 'Отправить заявку' : 'Далее' })] }));
|
|
7358
7344
|
});
|
|
7359
7345
|
|
|
7346
|
+
const PAYMENT_TYPE_DATA = {
|
|
7347
|
+
annuity: { key: 'ANNUITY', value: 'Аннуитетный' },
|
|
7348
|
+
differential: { key: 'DIFFERENTIAL', value: 'Дифференцированный ' },
|
|
7349
|
+
};
|
|
7350
|
+
const getCalcData = (formData) => {
|
|
7351
|
+
const { moneyValue, monthsValue, isAnnuity } = formData?.calculator ?? {};
|
|
7352
|
+
return {
|
|
7353
|
+
loanAmount: moneyValue,
|
|
7354
|
+
creditPeriod: monthsValue,
|
|
7355
|
+
paymentTypeCd: PAYMENT_TYPE_DATA[isAnnuity ? 'annuity' : 'differential'],
|
|
7356
|
+
};
|
|
7357
|
+
};
|
|
7358
|
+
|
|
7360
7359
|
const getFifthStepData = (formData) => {
|
|
7361
7360
|
const { addressRetail } = formData;
|
|
7362
7361
|
return {
|
|
@@ -7419,7 +7418,6 @@
|
|
|
7419
7418
|
generalSeniority: experience5Years,
|
|
7420
7419
|
jobsNumber,
|
|
7421
7420
|
lastWorkDuration: lastJobExperience,
|
|
7422
|
-
payrollCardRshbFlg: true,
|
|
7423
7421
|
positionCd: positionOrganization,
|
|
7424
7422
|
participantContacts: getParticipantContacts({
|
|
7425
7423
|
organizationPhone: organizationPhone && formatPhone(organizationPhone),
|
|
@@ -7452,16 +7450,11 @@
|
|
|
7452
7450
|
};
|
|
7453
7451
|
};
|
|
7454
7452
|
|
|
7455
|
-
const PAYMENT_TYPE_DATA = {
|
|
7456
|
-
annuity: { key: 'ANNUITY', value: 'Аннуитетный' },
|
|
7457
|
-
differential: { key: 'DIFFERENTIAL', value: 'Дифференцированный ' },
|
|
7458
|
-
};
|
|
7459
7453
|
const getZeroStepData = (formData) => {
|
|
7460
|
-
const {
|
|
7454
|
+
const { isInsurance, isSalaryClient } = formData?.calculator ?? {};
|
|
7461
7455
|
return {
|
|
7462
|
-
|
|
7463
|
-
|
|
7464
|
-
paymentTypeCd: PAYMENT_TYPE_DATA[isAnnuity ? 'annuity' : 'differential'],
|
|
7456
|
+
payrollCardRshbFlg: isInsurance,
|
|
7457
|
+
consentInsuranceFlg: isSalaryClient,
|
|
7465
7458
|
};
|
|
7466
7459
|
};
|
|
7467
7460
|
|
|
@@ -7487,7 +7480,7 @@
|
|
|
7487
7480
|
...getCurrentStepData(step, formData),
|
|
7488
7481
|
},
|
|
7489
7482
|
],
|
|
7490
|
-
...
|
|
7483
|
+
...getCalcData(formData),
|
|
7491
7484
|
...getFifthStepData(formData),
|
|
7492
7485
|
esiaAccountTypeCd: {
|
|
7493
7486
|
key: formData?.esiaAccountTypeCd?.key,
|
|
@@ -7498,7 +7491,7 @@
|
|
|
7498
7491
|
const getCurrentStepData = (step, formData) => {
|
|
7499
7492
|
switch (step) {
|
|
7500
7493
|
case 0:
|
|
7501
|
-
return
|
|
7494
|
+
return getZeroStepData(formData);
|
|
7502
7495
|
case 1:
|
|
7503
7496
|
return getFirstStepData(formData);
|
|
7504
7497
|
case 2:
|
|
@@ -7548,14 +7541,12 @@
|
|
|
7548
7541
|
};
|
|
7549
7542
|
const getValue = (formData) => (name) => formData[name];
|
|
7550
7543
|
|
|
7551
|
-
const CreditFormStep = JSX(({ step, sections, onPrevStep, onNextStep,
|
|
7544
|
+
const CreditFormStep = JSX(({ step, sections, onPrevStep, onNextStep, isFormFinished, finishForm, programsSource }) => {
|
|
7552
7545
|
const [localStorageData, saveStep] = useLocalStorage('leadForm');
|
|
7546
|
+
const [programId] = useLocalStorage('programId');
|
|
7547
|
+
const calcData = programsSource?.[programId ?? '']; // Need normalizator useForm, to be save defaultParams
|
|
7553
7548
|
const initialState = getInitialFormState(step, localStorageData);
|
|
7554
|
-
const customSubmit = useRef(undefined);
|
|
7555
7549
|
const inputs = (sections?.flatMap((_) => _?.inputs) || []);
|
|
7556
|
-
const registerSubmit = useCallback((submit) => {
|
|
7557
|
-
customSubmit.current = submit;
|
|
7558
|
-
}, []);
|
|
7559
7550
|
const { handleSubmit } = useCreditFormAPI({
|
|
7560
7551
|
step,
|
|
7561
7552
|
inputs,
|
|
@@ -7564,18 +7555,24 @@
|
|
|
7564
7555
|
finishForm,
|
|
7565
7556
|
});
|
|
7566
7557
|
const [, { field, onSubmit }] = useForm(initialState, {
|
|
7567
|
-
onSubmit:
|
|
7568
|
-
handleSubmit({ ...formData, ...customSubmit.current?.(ev) });
|
|
7569
|
-
},
|
|
7558
|
+
onSubmit: handleSubmit,
|
|
7570
7559
|
});
|
|
7571
|
-
return isFormFinished ? (jsx(CreditFormStatusTracker, {})) : (jsxs("form", { onSubmit: onSubmit, className: "space-y-m", children: [renderStep
|
|
7560
|
+
return isFormFinished ? (jsx(CreditFormStatusTracker, {})) : (jsxs("form", { onSubmit: onSubmit, className: "space-y-m", children: [renderStep({ sections, field, step, params: { calcData } }), jsx(StepsNavigationButtons, { step: step, onPrevStep: onPrevStep })] }));
|
|
7572
7561
|
});
|
|
7573
7562
|
|
|
7574
7563
|
/* eslint-disable max-lines */
|
|
7575
7564
|
/* eslint-disable max-len */
|
|
7576
7565
|
const stepsSectionsMap = [
|
|
7577
7566
|
[
|
|
7578
|
-
|
|
7567
|
+
{
|
|
7568
|
+
columns: 1,
|
|
7569
|
+
inputs: [
|
|
7570
|
+
{
|
|
7571
|
+
fieldType: 'common',
|
|
7572
|
+
name: 'calculator',
|
|
7573
|
+
},
|
|
7574
|
+
],
|
|
7575
|
+
},
|
|
7579
7576
|
],
|
|
7580
7577
|
[
|
|
7581
7578
|
{
|
|
@@ -7845,8 +7842,8 @@
|
|
|
7845
7842
|
],
|
|
7846
7843
|
];
|
|
7847
7844
|
|
|
7848
|
-
const
|
|
7849
|
-
const
|
|
7845
|
+
const STEPS = 5;
|
|
7846
|
+
const STEP_TITLES = [
|
|
7850
7847
|
'',
|
|
7851
7848
|
'Персональные данные',
|
|
7852
7849
|
'Данные о трудоустройстве',
|
|
@@ -7854,13 +7851,13 @@
|
|
|
7854
7851
|
'Дополнительные сведения',
|
|
7855
7852
|
'Отделение Банка',
|
|
7856
7853
|
];
|
|
7857
|
-
const CreditForm =
|
|
7854
|
+
const CreditForm = UniBlock(({ className, programsSource, ...rest }) => {
|
|
7858
7855
|
const [step, setStep] = useState(0);
|
|
7859
7856
|
const formContainerRef = useRef(null);
|
|
7860
7857
|
const scrollToTop = useCallback(() => formContainerRef?.current?.scrollIntoView({ behavior: 'smooth' }), [formContainerRef]);
|
|
7861
7858
|
useEffect(updateRefreshToken, []);
|
|
7862
7859
|
const handleNextStep = useCallback(() => {
|
|
7863
|
-
setStep((_) => Math.min(_ + 1,
|
|
7860
|
+
setStep((_) => Math.min(_ + 1, STEPS));
|
|
7864
7861
|
scrollToTop();
|
|
7865
7862
|
}, []);
|
|
7866
7863
|
const handlePrevStep = useCallback(() => {
|
|
@@ -7871,20 +7868,7 @@
|
|
|
7871
7868
|
const sections = useMemo(() => stepsSectionsMap[step], [step]);
|
|
7872
7869
|
const isStartStep = step === 0;
|
|
7873
7870
|
const [isFormFinished, setIsFormFinished] = useState(false);
|
|
7874
|
-
return (jsx(BlockWrapper, { className: style('bg-transparent', className), defaultPadding: "p-0", ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isStartStep || isFormFinished ? null : (jsx(CreditFormProgress, { stepsTitles:
|
|
7875
|
-
? ({ registerSubmit, field }) => (jsx(CalculatorCredit, { ...{
|
|
7876
|
-
defaultParams: {
|
|
7877
|
-
sum: field('moneyValue').value,
|
|
7878
|
-
period: field('monthsValue').value,
|
|
7879
|
-
isAnnuity: field('isAnnuity').value,
|
|
7880
|
-
},
|
|
7881
|
-
title: 'Калькулятор кредита',
|
|
7882
|
-
footnote: 'Расчёт является предварительным. Точные условия будут предоставлены в отделении Банка.',
|
|
7883
|
-
calcSource: {
|
|
7884
|
-
$ref: '/wcms-resources/credit-calculator-data.json',
|
|
7885
|
-
},
|
|
7886
|
-
}, registerSubmit: registerSubmit }))
|
|
7887
|
-
: undefined }, String(step)) })] }) }));
|
|
7871
|
+
return (jsx(BlockWrapper, { className: style('bg-transparent', className), defaultPadding: "p-0", ...rest, children: jsxs("div", { ref: formContainerRef, className: "container grid grid-cols-12", children: [isStartStep || isFormFinished ? null : (jsx(CreditFormProgress, { stepsTitles: STEP_TITLES, step: step, totalSteps: STEPS })), jsx("div", { className: "py-lg px-5xl mt-2xs bg-white col-span-12", children: jsx(CreditFormStep, { step: step, sections: sections, onNextStep: handleNextStep, onPrevStep: handlePrevStep, isFormFinished: isFormFinished, finishForm: setIsFormFinished, programsSource: programsSource }, String(step)) })] }) }));
|
|
7888
7872
|
});
|
|
7889
7873
|
|
|
7890
7874
|
const isRateRow = (rateRow) => typeof rateRow?.minMonths === 'number' && typeof rateRow?.maxMonths === 'number';
|
|
@@ -8431,7 +8415,7 @@
|
|
|
8431
8415
|
return (jsx(BlockWrapper, { className: style('w-full border-0 border-b border-solid border-main-divider last:border-b-0', className), defaultPadding: "p-0", tag: "div", version: "transparent", role: role, ...rest, children: jsx(Foldable, { isFoldButtonOnTop: isFoldButtonOnTop, unfoldedByDefault: isExpanded, renderFoldableSection: ({ isUnfolded }) => (jsx(FoldableSection, { className: style('gap-lg', getFoldableStyles(isMobile)), isUnfolded: isUnfolded, children: renderChildren({
|
|
8432
8416
|
...rest,
|
|
8433
8417
|
extraProps: { className: 'w-full', padding: 'p-0' },
|
|
8434
|
-
}) })), renderFoldButton: ({ isUnfolded, onToggle }) => renderFoldButton({
|
|
8418
|
+
}) })), renderFoldButton: ({ isUnfolded, onToggle }) => renderFoldButton$1({
|
|
8435
8419
|
foldButtonVersion,
|
|
8436
8420
|
label,
|
|
8437
8421
|
labelIcon,
|
|
@@ -8443,7 +8427,7 @@
|
|
|
8443
8427
|
}, {
|
|
8444
8428
|
childrenTypes: { exclude: ['RollupItem'] },
|
|
8445
8429
|
});
|
|
8446
|
-
const renderFoldButton = ({ foldButtonVersion, label: defaultLabel, labelIcon, labelIconBgVersion, isUnfolded, onToggle, isMobile = false, }) => {
|
|
8430
|
+
const renderFoldButton$1 = ({ foldButtonVersion, label: defaultLabel, labelIcon, labelIconBgVersion, isUnfolded, onToggle, isMobile = false, }) => {
|
|
8447
8431
|
const label = defaultLabel || (isUnfolded ? 'Скрыть' : 'Развернуть');
|
|
8448
8432
|
const icon = getIconName(isUnfolded, isMobile);
|
|
8449
8433
|
return foldButtonVersion === 'accordion' ? (jsx(AccordionFoldButton, { label: label, labelIcon: labelIcon, labelIconBgVersion: labelIconBgVersion, icon: icon, onToggle: onToggle })) : (jsx(DefaultFoldButton, { label: label, icon: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', onClick: onToggle }));
|
|
@@ -8676,6 +8660,8 @@
|
|
|
8676
8660
|
return (jsx(BlockWrapper, { className: style('min-h-80', className), padding: "p-0", version: version, ...rest, children: jsxs(BaseTile, { className: "h-full", padding: padding, defaultPadding: "p-6xl", title: jsx(Heading, { headingType: headingType, title: title, className: style('whitespace-pre-wrap', align) }), rightImage: img, buttons: renderButtonsSection(buttons, { className: 'flex-wrap' }), children: [description ? (jsx(Text, { size: "text-xl", "font-weight": "font-light", children: description })) : null, jsxs("div", { className: style('gap-m', 'flex flex-1 flex-col', 'flex-col items-start @xl:flex-row @xl:items-center'), children: [__html ? jsx(RichText, { __html: __html, itemSize: "list-m" }) : null, jsx(Text, { size: "text-m", "font-weight": "font-light", color: "text-secondary-text", children: additionalDescription }), qr?.src ? (jsx("div", { className: style('flex justify-center bg-white rounded-md @xl:-order-1', containerStyle), children: jsx(Img, { className: "w-fit", image: qr }) })) : null, image?.src ? jsx(Img, { className: "lg:hidden", image: image }) : null] })] }) }));
|
|
8677
8661
|
});
|
|
8678
8662
|
|
|
8663
|
+
const getVersion = (isPrimary, type) => isPrimary && type !== 'underlined' ? 'primary' : 'secondary';
|
|
8664
|
+
|
|
8679
8665
|
const getBadgeCount = (blocks = [], filter = {}) => blocks.filter(({ content = {} }) => targetMatchPattern(filter, content)).length;
|
|
8680
8666
|
|
|
8681
8667
|
const scalarCmp = (a, b) => a === b;
|
|
@@ -8821,6 +8807,63 @@
|
|
|
8821
8807
|
childSchema: (content) => content?.filtrationSchema || {},
|
|
8822
8808
|
});
|
|
8823
8809
|
|
|
8810
|
+
const renderButtonsGroup = (data, activeButton, onButtonClick) => {
|
|
8811
|
+
const allButtonVersion = getVersion(activeButton === 'all');
|
|
8812
|
+
const businessButtonVersion = getVersion(activeButton === 'business');
|
|
8813
|
+
const handleClick = (e, key, branches) => {
|
|
8814
|
+
const filteredBranches = e.currentTarget === e.target && key === 'business' ? filterBranches(branches) : branches;
|
|
8815
|
+
onButtonClick(key);
|
|
8816
|
+
return filteredBranches;
|
|
8817
|
+
};
|
|
8818
|
+
const filterBranches = (branches) => branches.filter((branch) => branch.workSchedule &&
|
|
8819
|
+
branch.workSchedule.businessScheduleVisibleTag &&
|
|
8820
|
+
!branch.workSchedule.businessScheduleDescription);
|
|
8821
|
+
return (jsxs("div", { className: "flex gap-lg flex-col sm:flex-row pb-lg", children: [jsx(Button, { "data-id": "all", onClick: (e) => handleClick(e, 'all', data), version: allButtonVersion, children: "\u0414\u043B\u044F \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043B\u0438\u0446" }), jsx(Button, { "data-id": "business", onClick: (e) => handleClick(e, 'business', data), version: businessButtonVersion, children: "\u0414\u043B\u044F \u044E\u0440\u0438\u0434\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043B\u0438\u0446" })] }));
|
|
8822
|
+
};
|
|
8823
|
+
|
|
8824
|
+
const renderDescriptionBlock$1 = ({ __html, list, richVersion }) => __html || list?.length ? (jsxs("div", { className: "mb-2xl border-b sm:border border-main-divider sm:rounded-md", children: [__html ? (jsx("div", { className: "mb-2xl", children: jsx(RichText, { __html: __html, richVersion: richVersion }) })) : null, list?.length ? (jsx("div", { className: "flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl", children: list.map((item, i) => (jsxs("div", { className: "flex gap-xs items-center", children: [item?.image ? jsx(Img, { image: item.image }) : null, item?.text ? (jsx(Text, { size: "text-m", font: "font-light", children: item.text })) : null] }, String(i)))) })) : null] })) : null;
|
|
8825
|
+
|
|
8826
|
+
const COMMON_FILTERS_STYLES = 'flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl';
|
|
8827
|
+
const renderFiltrationForm = ({ filters, field: { field, reset }, onlyOffice, labels, }) => {
|
|
8828
|
+
const visibleFiltersNum = onlyOffice ? 5 : 6;
|
|
8829
|
+
const filtersCheckbox = (filters || []).map((key) => (jsx(Checkbox, { text: labels[key], ...field(key) }, key)));
|
|
8830
|
+
const [visibleFilters, hiddenFilters] = visibleFiltersNum > 0
|
|
8831
|
+
? [filtersCheckbox.slice(0, visibleFiltersNum), filtersCheckbox.slice(visibleFiltersNum)]
|
|
8832
|
+
: [filtersCheckbox, []];
|
|
8833
|
+
return (jsx("div", { children: filters?.length ? (jsx("div", { children: jsx(Foldable, { renderFoldableSection: ({ isUnfolded }) => (jsxs("div", { children: [jsx("div", { className: COMMON_FILTERS_STYLES, children: visibleFilters }), jsx(FoldableSection, { className: COMMON_FILTERS_STYLES, isUnfolded: isUnfolded, children: hiddenFilters })] })), renderFoldButton: renderFoldButton(reset, onlyOffice) }) })) : null }));
|
|
8834
|
+
};
|
|
8835
|
+
const renderFoldButton = (reset, onlyOffice = false) => ({ isUnfolded, onToggle }) => {
|
|
8836
|
+
const labels = ['Больше фильтров', 'Меньше фильтров'];
|
|
8837
|
+
const icons = ['ArrowDownIcon', 'ArrowUpIcon'];
|
|
8838
|
+
return (jsxs("div", { className: "flex space-x-lg", children: [onlyOffice ? (jsx(LinkButton, { version: "transparent", className: "text-secondary-text [&>*]:p-0", appendRight: jsx(Icon, { name: icons[Number(isUnfolded)], width: "16", height: "16" }), text: labels[Number(isUnfolded)], onClick: onToggle })) : null, jsx(LinkButton, { version: "transparent", className: "text-secondary-text [&>*]:p-0", onClick: reset, children: renderBtnInner() })] }));
|
|
8839
|
+
};
|
|
8840
|
+
const renderBtnInner = () => (jsxs("div", { className: "flex items-center", children: ["\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440", jsx(Icon, { name: "CloseIcon", width: "16", height: "16", className: "ml-2xs" })] }));
|
|
8841
|
+
|
|
8842
|
+
const renderHeading = (title, lengthItems) => (jsx("div", { className: "flex flex-col sm:flex-row gap-xs mb-2xl", children: jsxs(Heading, { headingType: "h3", children: [jsx("span", { suppressHydrationWarning: true, children: title }), lengthItems ? (jsx(Text, { size: "text-h2", color: "text-secondary-text", children: jsx("span", { suppressHydrationWarning: true, children: ` (${lengthItems})` }) })) : null] }) }));
|
|
8843
|
+
|
|
8844
|
+
const defaultEmptyFunction = () => void 0;
|
|
8845
|
+
const filtersVisibleStyles = (activeButton) => activeButton === 'all' ? 'block' : 'hidden';
|
|
8846
|
+
const OfficesAtmsMapLayout = JSX(({ className, data = [], isLoad, remoteWorkplaces = [], renderCard = defaultEmptyFunction, renderRemoteWorkplaceCard = defaultEmptyFunction, getBalloon = defaultEmptyFunction, getBalloonRemoteWorkplaces = defaultEmptyFunction, descriptionData, title, }) => {
|
|
8847
|
+
const onlyOffice = title?.includes('Офис');
|
|
8848
|
+
const [filtrationState, { field, reset }] = useForm(INITIAL_FILTRATION_STATE$1);
|
|
8849
|
+
const { filteredItems, points, filteredRemoteWorkplaces, lengthItems } = useOfficesAtmsMapData({
|
|
8850
|
+
data,
|
|
8851
|
+
remoteWorkplaces,
|
|
8852
|
+
filtrationState,
|
|
8853
|
+
getBalloon,
|
|
8854
|
+
getBalloonRemoteWorkplaces,
|
|
8855
|
+
});
|
|
8856
|
+
const [activeButton, setActiveButton] = useState('all');
|
|
8857
|
+
const filterOptions = {
|
|
8858
|
+
filters: getFiltersWithNonEmptyData([...data, ...remoteWorkplaces]),
|
|
8859
|
+
field: { field, reset },
|
|
8860
|
+
onlyOffice,
|
|
8861
|
+
labels: FILTRATION_LABELS,
|
|
8862
|
+
};
|
|
8863
|
+
return (jsxs("div", { className: style('space-y-1', className), children: [jsxs("div", { className: "bg-white", children: [jsxs("div", { className: "p-3xl pb-0", children: [renderHeading(title, lengthItems), descriptionData ? renderDescriptionBlock$1(descriptionData) : null, onlyOffice && renderButtonsGroup(data, activeButton, setActiveButton), jsx("div", { className: style('pb-3xl', filtersVisibleStyles(activeButton)), children: renderFiltrationForm(filterOptions) })] }), jsx("div", { className: "h-[600px]", children: jsx(ClientOnly, { children: jsx(YandexMap, { points: points, isLoad: isLoad, className: "h-full" }) }) })] }), jsxs(ClientOnly, { children: [filteredItems.map(renderCard), filteredRemoteWorkplaces.map(renderRemoteWorkplaceCard)] })] }));
|
|
8864
|
+
});
|
|
8865
|
+
const getFiltersWithNonEmptyData = (data) => Object.keys(INITIAL_FILTRATION_STATE$1).filter((_) => data.filter((item) => FILTRATION_PREDICATES$1[_](item)).length);
|
|
8866
|
+
|
|
8824
8867
|
const renderAtmCard = ({ location, address, billAcceptorType, terminalType, billAcceptorEnable, atmCode = '', atmAccess = '', workTime, }, i) => {
|
|
8825
8868
|
const additionalInfo = [
|
|
8826
8869
|
{
|
|
@@ -9953,7 +9996,7 @@
|
|
|
9953
9996
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
9954
9997
|
});
|
|
9955
9998
|
|
|
9956
|
-
const packageVersion = "0.14.
|
|
9999
|
+
const packageVersion = "0.14.683";
|
|
9957
10000
|
|
|
9958
10001
|
exports.Blocks = Blocks;
|
|
9959
10002
|
exports.ContentPage = ContentPage;
|