@redneckz/wildless-cms-uni-blocks 0.14.548 → 0.14.549
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/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +147 -94
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +3 -3
- package/bundle/components/ApplicationForm/CustomFieldProps.d.ts +1 -0
- package/bundle/components/ApplicationForm/LocalitiesField.d.ts +2 -0
- package/bundle/components/ApplicationForm/PartnerCommentsField.d.ts +1 -1
- package/bundle/components/ApplicationForm/ProductField.d.ts +2 -0
- package/bundle/components/ApplicationForm/SecondaryPhoneField.d.ts +2 -0
- package/bundle/components/ApplicationForm/{contants.d.ts → constants.d.ts} +2 -0
- package/bundle/components/ApplicationForm/getField.d.ts +0 -4
- package/bundle/components/ApplicationForm/getRegionUrl.d.ts +1 -0
- package/bundle/components/ApplicationForm/isRenderField.d.ts +6 -0
- package/bundle/components/CalculatorDeposit/CalculatorDepositContent.d.ts +11 -2
- package/bundle/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +2 -1
- package/bundle/components/CalculatorDeposit/isRubles.d.ts +1 -0
- package/bundle/components/CalculatorDeposit/utils.d.ts +17 -0
- package/bundle/hooks/useForm.d.ts +2 -1
- package/bundle/hooks/useRegions.d.ts +2 -1
- package/bundle/ui-kit/Calculator/getDefaultParams.d.ts +1 -2
- package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +3 -3
- package/dist/components/ApplicationForm/CustomFieldProps.d.ts +1 -0
- package/dist/components/ApplicationForm/FeedbackMethodField.js +2 -2
- package/dist/components/ApplicationForm/FeedbackMethodField.js.map +1 -1
- package/dist/components/ApplicationForm/FeedbackTypeField.js +3 -3
- package/dist/components/ApplicationForm/FeedbackTypeField.js.map +1 -1
- package/dist/components/ApplicationForm/LocalitiesField.d.ts +2 -0
- package/dist/components/ApplicationForm/LocalitiesField.js +24 -0
- package/dist/components/ApplicationForm/LocalitiesField.js.map +1 -0
- package/dist/components/ApplicationForm/PartnerCommentsField.d.ts +1 -1
- package/dist/components/ApplicationForm/PartnerCommentsField.js +6 -8
- package/dist/components/ApplicationForm/PartnerCommentsField.js.map +1 -1
- package/dist/components/ApplicationForm/ProductField.d.ts +2 -0
- package/dist/components/ApplicationForm/ProductField.js +10 -0
- package/dist/components/ApplicationForm/ProductField.js.map +1 -0
- package/dist/components/ApplicationForm/RegionField.js +2 -2
- package/dist/components/ApplicationForm/RegionField.js.map +1 -1
- package/dist/components/ApplicationForm/SecondaryPhoneField.d.ts +2 -0
- package/dist/components/ApplicationForm/SecondaryPhoneField.js +14 -0
- package/dist/components/ApplicationForm/SecondaryPhoneField.js.map +1 -0
- package/dist/components/ApplicationForm/ServiceDirectionField.js +2 -2
- package/dist/components/ApplicationForm/ServiceDirectionField.js.map +1 -1
- package/dist/components/ApplicationForm/UltraPremiumField.js +2 -2
- package/dist/components/ApplicationForm/UltraPremiumField.js.map +1 -1
- package/{lib/components/ApplicationForm/contants.d.ts → dist/components/ApplicationForm/constants.d.ts} +2 -0
- package/dist/components/ApplicationForm/constants.js +34 -0
- package/dist/components/ApplicationForm/constants.js.map +1 -0
- package/dist/components/ApplicationForm/getField.d.ts +0 -4
- package/dist/components/ApplicationForm/getField.js +13 -11
- package/dist/components/ApplicationForm/getField.js.map +1 -1
- package/dist/components/ApplicationForm/getInitialFormState.js +6 -6
- package/dist/components/ApplicationForm/getInitialFormState.js.map +1 -1
- package/dist/components/ApplicationForm/getObjectValidator.js +3 -0
- package/dist/components/ApplicationForm/getObjectValidator.js.map +1 -1
- package/dist/components/ApplicationForm/getRegionUrl.d.ts +1 -0
- package/dist/components/ApplicationForm/getRegionUrl.js +6 -0
- package/dist/components/ApplicationForm/getRegionUrl.js.map +1 -0
- package/dist/components/ApplicationForm/isRenderField.d.ts +6 -0
- package/dist/components/ApplicationForm/isRenderField.js +9 -0
- package/dist/components/ApplicationForm/isRenderField.js.map +1 -0
- package/dist/components/CalculatorDeposit/CalculatorDeposit.js +25 -47
- package/dist/components/CalculatorDeposit/CalculatorDeposit.js.map +1 -1
- package/dist/components/CalculatorDeposit/CalculatorDepositContent.d.ts +11 -2
- package/dist/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +2 -1
- package/dist/components/CalculatorDeposit/getDepositCalculatorParams.js +15 -11
- package/dist/components/CalculatorDeposit/getDepositCalculatorParams.js.map +1 -1
- package/dist/components/CalculatorDeposit/isRubles.d.ts +1 -0
- package/dist/components/CalculatorDeposit/isRubles.js +5 -0
- package/dist/components/CalculatorDeposit/isRubles.js.map +1 -0
- package/dist/components/CalculatorDeposit/renderDepositParamsForm.js +4 -3
- package/dist/components/CalculatorDeposit/renderDepositParamsForm.js.map +1 -1
- package/dist/components/CalculatorDeposit/utils.d.ts +17 -0
- package/dist/components/CalculatorDeposit/utils.js +32 -0
- package/dist/components/CalculatorDeposit/utils.js.map +1 -0
- package/dist/hooks/useForm.d.ts +2 -1
- package/dist/hooks/useForm.js +22 -12
- package/dist/hooks/useForm.js.map +1 -1
- package/dist/hooks/useRegions.d.ts +2 -1
- package/dist/hooks/useRegions.js +2 -2
- package/dist/hooks/useRegions.js.map +1 -1
- package/dist/ui-kit/Calculator/CalculatorStyle.js +1 -1
- package/dist/ui-kit/Calculator/getDefaultParams.d.ts +1 -2
- package/dist/ui-kit/Calculator/getDefaultParams.js +1 -1
- package/dist/ui-kit/Calculator/getDefaultParams.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/ApplicationForm/ApplicationForm.fixture.d.ts +1 -0
- package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +3 -3
- package/lib/components/ApplicationForm/CustomFieldProps.d.ts +1 -0
- package/lib/components/ApplicationForm/FeedbackMethodField.js +1 -1
- package/lib/components/ApplicationForm/FeedbackMethodField.js.map +1 -1
- package/lib/components/ApplicationForm/FeedbackTypeField.js +1 -1
- package/lib/components/ApplicationForm/FeedbackTypeField.js.map +1 -1
- package/lib/components/ApplicationForm/LocalitiesField.d.ts +2 -0
- package/lib/components/ApplicationForm/LocalitiesField.js +22 -0
- package/lib/components/ApplicationForm/LocalitiesField.js.map +1 -0
- package/lib/components/ApplicationForm/PartnerCommentsField.d.ts +1 -1
- package/lib/components/ApplicationForm/PartnerCommentsField.js +5 -7
- package/lib/components/ApplicationForm/PartnerCommentsField.js.map +1 -1
- package/lib/components/ApplicationForm/ProductField.d.ts +2 -0
- package/lib/components/ApplicationForm/ProductField.js +8 -0
- package/lib/components/ApplicationForm/ProductField.js.map +1 -0
- package/lib/components/ApplicationForm/RegionField.js +2 -2
- package/lib/components/ApplicationForm/RegionField.js.map +1 -1
- package/lib/components/ApplicationForm/SecondaryPhoneField.d.ts +2 -0
- package/lib/components/ApplicationForm/SecondaryPhoneField.js +12 -0
- package/lib/components/ApplicationForm/SecondaryPhoneField.js.map +1 -0
- package/lib/components/ApplicationForm/ServiceDirectionField.js +1 -1
- package/lib/components/ApplicationForm/ServiceDirectionField.js.map +1 -1
- package/lib/components/ApplicationForm/UltraPremiumField.js +1 -1
- package/lib/components/ApplicationForm/UltraPremiumField.js.map +1 -1
- package/{dist/components/ApplicationForm/contants.d.ts → lib/components/ApplicationForm/constants.d.ts} +2 -0
- package/lib/components/ApplicationForm/{contants.js → constants.js} +10 -1
- package/lib/components/ApplicationForm/constants.js.map +1 -0
- package/lib/components/ApplicationForm/getField.d.ts +0 -4
- package/lib/components/ApplicationForm/getField.js +11 -8
- package/lib/components/ApplicationForm/getField.js.map +1 -1
- package/lib/components/ApplicationForm/getInitialFormState.js +1 -1
- package/lib/components/ApplicationForm/getInitialFormState.js.map +1 -1
- package/lib/components/ApplicationForm/getObjectValidator.js +3 -0
- package/lib/components/ApplicationForm/getObjectValidator.js.map +1 -1
- package/lib/components/ApplicationForm/getRegionUrl.d.ts +1 -0
- package/lib/components/ApplicationForm/getRegionUrl.js +3 -0
- package/lib/components/ApplicationForm/getRegionUrl.js.map +1 -0
- package/lib/components/ApplicationForm/isRenderField.d.ts +6 -0
- package/lib/components/ApplicationForm/isRenderField.js +6 -0
- package/lib/components/ApplicationForm/isRenderField.js.map +1 -0
- package/lib/components/CalculatorDeposit/CalculatorDeposit.js +25 -47
- package/lib/components/CalculatorDeposit/CalculatorDeposit.js.map +1 -1
- package/lib/components/CalculatorDeposit/CalculatorDepositContent.d.ts +11 -2
- package/lib/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +2 -1
- package/lib/components/CalculatorDeposit/getDepositCalculatorParams.js +15 -11
- package/lib/components/CalculatorDeposit/getDepositCalculatorParams.js.map +1 -1
- package/lib/components/CalculatorDeposit/isRubles.d.ts +1 -0
- package/lib/components/CalculatorDeposit/isRubles.js +2 -0
- package/lib/components/CalculatorDeposit/isRubles.js.map +1 -0
- package/lib/components/CalculatorDeposit/renderDepositParamsForm.js +4 -3
- package/lib/components/CalculatorDeposit/renderDepositParamsForm.js.map +1 -1
- package/lib/components/CalculatorDeposit/utils.d.ts +17 -0
- package/lib/components/CalculatorDeposit/utils.js +25 -0
- package/lib/components/CalculatorDeposit/utils.js.map +1 -0
- package/lib/hooks/useForm.d.ts +2 -1
- package/lib/hooks/useForm.js +23 -13
- package/lib/hooks/useForm.js.map +1 -1
- package/lib/hooks/useRegions.d.ts +2 -1
- package/lib/hooks/useRegions.js +2 -2
- package/lib/hooks/useRegions.js.map +1 -1
- package/lib/ui-kit/Calculator/CalculatorStyle.js +1 -1
- package/lib/ui-kit/Calculator/getDefaultParams.d.ts +1 -2
- package/lib/ui-kit/Calculator/getDefaultParams.js +1 -1
- package/lib/ui-kit/Calculator/getDefaultParams.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +147 -94
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +3 -3
- package/mobile/bundle/components/ApplicationForm/CustomFieldProps.d.ts +1 -0
- package/mobile/bundle/components/ApplicationForm/LocalitiesField.d.ts +2 -0
- package/mobile/bundle/components/ApplicationForm/PartnerCommentsField.d.ts +1 -1
- package/mobile/bundle/components/ApplicationForm/ProductField.d.ts +2 -0
- package/mobile/bundle/components/ApplicationForm/SecondaryPhoneField.d.ts +2 -0
- package/mobile/bundle/components/ApplicationForm/{contants.d.ts → constants.d.ts} +2 -0
- package/mobile/bundle/components/ApplicationForm/getField.d.ts +0 -4
- package/mobile/bundle/components/ApplicationForm/getRegionUrl.d.ts +1 -0
- package/mobile/bundle/components/ApplicationForm/isRenderField.d.ts +6 -0
- package/mobile/bundle/components/CalculatorDeposit/CalculatorDepositContent.d.ts +11 -2
- package/mobile/bundle/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +2 -1
- package/mobile/bundle/components/CalculatorDeposit/isRubles.d.ts +1 -0
- package/mobile/bundle/components/CalculatorDeposit/utils.d.ts +17 -0
- package/mobile/bundle/hooks/useForm.d.ts +2 -1
- package/mobile/bundle/hooks/useRegions.d.ts +2 -1
- package/mobile/bundle/ui-kit/Calculator/getDefaultParams.d.ts +1 -2
- package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +3 -3
- package/mobile/dist/components/ApplicationForm/CustomFieldProps.d.ts +1 -0
- package/mobile/dist/components/ApplicationForm/FeedbackMethodField.js +2 -2
- package/mobile/dist/components/ApplicationForm/FeedbackMethodField.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/FeedbackTypeField.js +3 -3
- package/mobile/dist/components/ApplicationForm/FeedbackTypeField.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/LocalitiesField.d.ts +2 -0
- package/mobile/dist/components/ApplicationForm/LocalitiesField.js +24 -0
- package/mobile/dist/components/ApplicationForm/LocalitiesField.js.map +1 -0
- package/mobile/dist/components/ApplicationForm/PartnerCommentsField.d.ts +1 -1
- package/mobile/dist/components/ApplicationForm/PartnerCommentsField.js +6 -8
- package/mobile/dist/components/ApplicationForm/PartnerCommentsField.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/ProductField.d.ts +2 -0
- package/mobile/dist/components/ApplicationForm/ProductField.js +10 -0
- package/mobile/dist/components/ApplicationForm/ProductField.js.map +1 -0
- package/mobile/dist/components/ApplicationForm/RegionField.js +2 -2
- package/mobile/dist/components/ApplicationForm/RegionField.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/SecondaryPhoneField.d.ts +2 -0
- package/mobile/dist/components/ApplicationForm/SecondaryPhoneField.js +14 -0
- package/mobile/dist/components/ApplicationForm/SecondaryPhoneField.js.map +1 -0
- package/mobile/dist/components/ApplicationForm/ServiceDirectionField.js +2 -2
- package/mobile/dist/components/ApplicationForm/ServiceDirectionField.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/UltraPremiumField.js +2 -2
- package/mobile/dist/components/ApplicationForm/UltraPremiumField.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/constants.d.ts +7 -0
- package/mobile/dist/components/ApplicationForm/constants.js +34 -0
- package/mobile/dist/components/ApplicationForm/constants.js.map +1 -0
- package/mobile/dist/components/ApplicationForm/getField.d.ts +0 -4
- package/mobile/dist/components/ApplicationForm/getField.js +13 -11
- package/mobile/dist/components/ApplicationForm/getField.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/getInitialFormState.js +6 -6
- package/mobile/dist/components/ApplicationForm/getInitialFormState.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/getObjectValidator.js +3 -0
- package/mobile/dist/components/ApplicationForm/getObjectValidator.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/getRegionUrl.d.ts +1 -0
- package/mobile/dist/components/ApplicationForm/getRegionUrl.js +6 -0
- package/mobile/dist/components/ApplicationForm/getRegionUrl.js.map +1 -0
- package/mobile/dist/components/ApplicationForm/isRenderField.d.ts +6 -0
- package/mobile/dist/components/ApplicationForm/isRenderField.js +9 -0
- package/mobile/dist/components/ApplicationForm/isRenderField.js.map +1 -0
- package/mobile/dist/components/CalculatorDeposit/CalculatorDeposit.js +25 -47
- package/mobile/dist/components/CalculatorDeposit/CalculatorDeposit.js.map +1 -1
- package/mobile/dist/components/CalculatorDeposit/CalculatorDepositContent.d.ts +11 -2
- package/mobile/dist/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +2 -1
- package/mobile/dist/components/CalculatorDeposit/getDepositCalculatorParams.js +15 -11
- package/mobile/dist/components/CalculatorDeposit/getDepositCalculatorParams.js.map +1 -1
- package/mobile/dist/components/CalculatorDeposit/isRubles.d.ts +1 -0
- package/mobile/dist/components/CalculatorDeposit/isRubles.js +5 -0
- package/mobile/dist/components/CalculatorDeposit/isRubles.js.map +1 -0
- package/mobile/dist/components/CalculatorDeposit/renderDepositParamsForm.js +4 -3
- package/mobile/dist/components/CalculatorDeposit/renderDepositParamsForm.js.map +1 -1
- package/mobile/dist/components/CalculatorDeposit/utils.d.ts +17 -0
- package/mobile/dist/components/CalculatorDeposit/utils.js +32 -0
- package/mobile/dist/components/CalculatorDeposit/utils.js.map +1 -0
- package/mobile/dist/hooks/useForm.d.ts +2 -1
- package/mobile/dist/hooks/useForm.js +22 -12
- package/mobile/dist/hooks/useForm.js.map +1 -1
- package/mobile/dist/hooks/useRegions.d.ts +2 -1
- package/mobile/dist/hooks/useRegions.js +2 -2
- package/mobile/dist/hooks/useRegions.js.map +1 -1
- package/mobile/dist/ui-kit/Calculator/CalculatorStyle.js +1 -1
- package/mobile/dist/ui-kit/Calculator/getDefaultParams.d.ts +1 -2
- package/mobile/dist/ui-kit/Calculator/getDefaultParams.js +1 -1
- package/mobile/dist/ui-kit/Calculator/getDefaultParams.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +3 -3
- package/mobile/lib/components/ApplicationForm/CustomFieldProps.d.ts +1 -0
- package/mobile/lib/components/ApplicationForm/FeedbackMethodField.js +1 -1
- package/mobile/lib/components/ApplicationForm/FeedbackMethodField.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/FeedbackTypeField.js +1 -1
- package/mobile/lib/components/ApplicationForm/FeedbackTypeField.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/LocalitiesField.d.ts +2 -0
- package/mobile/lib/components/ApplicationForm/LocalitiesField.js +22 -0
- package/mobile/lib/components/ApplicationForm/LocalitiesField.js.map +1 -0
- package/mobile/lib/components/ApplicationForm/PartnerCommentsField.d.ts +1 -1
- package/mobile/lib/components/ApplicationForm/PartnerCommentsField.js +5 -7
- package/mobile/lib/components/ApplicationForm/PartnerCommentsField.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ProductField.d.ts +2 -0
- package/mobile/lib/components/ApplicationForm/ProductField.js +8 -0
- package/mobile/lib/components/ApplicationForm/ProductField.js.map +1 -0
- package/mobile/lib/components/ApplicationForm/RegionField.js +2 -2
- package/mobile/lib/components/ApplicationForm/RegionField.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/SecondaryPhoneField.d.ts +2 -0
- package/mobile/lib/components/ApplicationForm/SecondaryPhoneField.js +12 -0
- package/mobile/lib/components/ApplicationForm/SecondaryPhoneField.js.map +1 -0
- package/mobile/lib/components/ApplicationForm/ServiceDirectionField.js +1 -1
- package/mobile/lib/components/ApplicationForm/ServiceDirectionField.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/UltraPremiumField.js +1 -1
- package/mobile/lib/components/ApplicationForm/UltraPremiumField.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/constants.d.ts +7 -0
- package/mobile/lib/components/ApplicationForm/{contants.js → constants.js} +10 -1
- package/mobile/lib/components/ApplicationForm/constants.js.map +1 -0
- package/mobile/lib/components/ApplicationForm/getField.d.ts +0 -4
- package/mobile/lib/components/ApplicationForm/getField.js +11 -8
- package/mobile/lib/components/ApplicationForm/getField.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/getInitialFormState.js +1 -1
- package/mobile/lib/components/ApplicationForm/getInitialFormState.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/getObjectValidator.js +3 -0
- package/mobile/lib/components/ApplicationForm/getObjectValidator.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/getRegionUrl.d.ts +1 -0
- package/mobile/lib/components/ApplicationForm/getRegionUrl.js +3 -0
- package/mobile/lib/components/ApplicationForm/getRegionUrl.js.map +1 -0
- package/mobile/lib/components/ApplicationForm/isRenderField.d.ts +6 -0
- package/mobile/lib/components/ApplicationForm/isRenderField.js +6 -0
- package/mobile/lib/components/ApplicationForm/isRenderField.js.map +1 -0
- package/mobile/lib/components/CalculatorDeposit/CalculatorDeposit.js +25 -47
- package/mobile/lib/components/CalculatorDeposit/CalculatorDeposit.js.map +1 -1
- package/mobile/lib/components/CalculatorDeposit/CalculatorDepositContent.d.ts +11 -2
- package/mobile/lib/components/CalculatorDeposit/getDepositCalculatorParams.d.ts +2 -1
- package/mobile/lib/components/CalculatorDeposit/getDepositCalculatorParams.js +15 -11
- package/mobile/lib/components/CalculatorDeposit/getDepositCalculatorParams.js.map +1 -1
- package/mobile/lib/components/CalculatorDeposit/isRubles.d.ts +1 -0
- package/mobile/lib/components/CalculatorDeposit/isRubles.js +2 -0
- package/mobile/lib/components/CalculatorDeposit/isRubles.js.map +1 -0
- package/mobile/lib/components/CalculatorDeposit/renderDepositParamsForm.js +4 -3
- package/mobile/lib/components/CalculatorDeposit/renderDepositParamsForm.js.map +1 -1
- package/mobile/lib/components/CalculatorDeposit/utils.d.ts +17 -0
- package/mobile/lib/components/CalculatorDeposit/utils.js +25 -0
- package/mobile/lib/components/CalculatorDeposit/utils.js.map +1 -0
- package/mobile/lib/hooks/useForm.d.ts +2 -1
- package/mobile/lib/hooks/useForm.js +23 -13
- package/mobile/lib/hooks/useForm.js.map +1 -1
- package/mobile/lib/hooks/useRegions.d.ts +2 -1
- package/mobile/lib/hooks/useRegions.js +2 -2
- package/mobile/lib/hooks/useRegions.js.map +1 -1
- package/mobile/lib/ui-kit/Calculator/CalculatorStyle.js +1 -1
- package/mobile/lib/ui-kit/Calculator/getDefaultParams.d.ts +1 -2
- package/mobile/lib/ui-kit/Calculator/getDefaultParams.js +1 -1
- package/mobile/lib/ui-kit/Calculator/getDefaultParams.js.map +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +79 -0
- package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +6 -2
- package/mobile/src/components/ApplicationForm/CustomFieldProps.ts +1 -0
- package/mobile/src/components/ApplicationForm/FeedbackMethodField.tsx +1 -1
- package/mobile/src/components/ApplicationForm/FeedbackTypeField.tsx +1 -1
- package/mobile/src/components/ApplicationForm/LocalitiesField.tsx +34 -0
- package/mobile/src/components/ApplicationForm/PartnerCommentsField.tsx +10 -9
- package/mobile/src/components/ApplicationForm/ProductField.tsx +15 -0
- package/mobile/src/components/ApplicationForm/RegionField.tsx +2 -2
- package/mobile/src/components/ApplicationForm/SecondaryPhoneField.tsx +18 -0
- package/mobile/src/components/ApplicationForm/ServiceDirectionField.tsx +1 -1
- package/mobile/src/components/ApplicationForm/UltraPremiumField.tsx +1 -1
- package/mobile/src/components/ApplicationForm/{contants.tsx → constants.tsx} +11 -0
- package/mobile/src/components/ApplicationForm/getField.tsx +16 -23
- package/mobile/src/components/ApplicationForm/getInitialFormState.tsx +1 -1
- package/mobile/src/components/ApplicationForm/getObjectValidator.tsx +3 -0
- package/mobile/src/components/ApplicationForm/getRegionUrl.tsx +4 -0
- package/mobile/src/components/ApplicationForm/isRenderField.tsx +15 -0
- package/mobile/src/components/CalculatorDeposit/CalculatorDeposit.tsx +47 -71
- package/mobile/src/components/CalculatorDeposit/CalculatorDepositContent.ts +10 -1
- package/mobile/src/components/CalculatorDeposit/getDepositCalculatorParams.ts +14 -9
- package/mobile/src/components/CalculatorDeposit/isRubles.tsx +1 -0
- package/mobile/src/components/CalculatorDeposit/renderDepositParamsForm.tsx +5 -2
- package/mobile/src/components/CalculatorDeposit/utils.tsx +37 -0
- package/mobile/src/hooks/useForm.ts +33 -16
- package/mobile/src/hooks/useRegions.ts +3 -2
- package/mobile/src/ui-kit/Calculator/CalculatorStyle.tsx +1 -1
- package/mobile/src/ui-kit/Calculator/getDefaultParams.tsx +3 -3
- package/package.json +1 -1
- package/src/components/ApplicationForm/ApplicationForm.example.json +79 -0
- package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +34 -0
- package/src/components/ApplicationForm/ApplicationFormContent.ts +6 -2
- package/src/components/ApplicationForm/CustomFieldProps.ts +1 -0
- package/src/components/ApplicationForm/FeedbackMethodField.tsx +1 -1
- package/src/components/ApplicationForm/FeedbackTypeField.tsx +1 -1
- package/src/components/ApplicationForm/LocalitiesField.tsx +34 -0
- package/src/components/ApplicationForm/PartnerCommentsField.tsx +10 -9
- package/src/components/ApplicationForm/ProductField.tsx +15 -0
- package/src/components/ApplicationForm/RegionField.tsx +2 -2
- package/src/components/ApplicationForm/SecondaryPhoneField.tsx +18 -0
- package/src/components/ApplicationForm/ServiceDirectionField.tsx +1 -1
- package/src/components/ApplicationForm/UltraPremiumField.tsx +1 -1
- package/src/components/ApplicationForm/{contants.tsx → constants.tsx} +11 -0
- package/src/components/ApplicationForm/getField.tsx +16 -23
- package/src/components/ApplicationForm/getInitialFormState.tsx +1 -1
- package/src/components/ApplicationForm/getObjectValidator.tsx +3 -0
- package/src/components/ApplicationForm/getRegionUrl.tsx +4 -0
- package/src/components/ApplicationForm/isRenderField.tsx +15 -0
- package/src/components/CalculatorDeposit/CalculatorDeposit.fixture.tsx +2 -0
- package/src/components/CalculatorDeposit/CalculatorDeposit.tsx +47 -71
- package/src/components/CalculatorDeposit/CalculatorDepositContent.ts +10 -1
- package/src/components/CalculatorDeposit/getDepositCalculatorParams.ts +14 -9
- package/src/components/CalculatorDeposit/isRubles.tsx +1 -0
- package/src/components/CalculatorDeposit/renderDepositParamsForm.tsx +5 -2
- package/src/components/CalculatorDeposit/utils.tsx +37 -0
- package/src/hooks/useForm.ts +33 -16
- package/src/hooks/useRegions.ts +3 -2
- package/src/ui-kit/Calculator/CalculatorStyle.tsx +1 -1
- package/src/ui-kit/Calculator/getDefaultParams.tsx +3 -3
- package/bundle/components/CalculatorDeposit/isNotRubles.d.ts +0 -1
- package/dist/components/ApplicationForm/contants.js +0 -25
- package/dist/components/ApplicationForm/contants.js.map +0 -1
- package/dist/components/CalculatorDeposit/isNotRubles.d.ts +0 -1
- package/dist/components/CalculatorDeposit/isNotRubles.js +0 -5
- package/dist/components/CalculatorDeposit/isNotRubles.js.map +0 -1
- package/lib/components/ApplicationForm/contants.js.map +0 -1
- package/lib/components/CalculatorDeposit/isNotRubles.d.ts +0 -1
- package/lib/components/CalculatorDeposit/isNotRubles.js +0 -2
- package/lib/components/CalculatorDeposit/isNotRubles.js.map +0 -1
- package/mobile/bundle/components/CalculatorDeposit/isNotRubles.d.ts +0 -1
- package/mobile/dist/components/ApplicationForm/contants.d.ts +0 -5
- package/mobile/dist/components/ApplicationForm/contants.js +0 -25
- package/mobile/dist/components/ApplicationForm/contants.js.map +0 -1
- package/mobile/dist/components/CalculatorDeposit/isNotRubles.d.ts +0 -1
- package/mobile/dist/components/CalculatorDeposit/isNotRubles.js +0 -5
- package/mobile/dist/components/CalculatorDeposit/isNotRubles.js.map +0 -1
- package/mobile/lib/components/ApplicationForm/contants.d.ts +0 -5
- package/mobile/lib/components/ApplicationForm/contants.js.map +0 -1
- package/mobile/lib/components/CalculatorDeposit/isNotRubles.d.ts +0 -1
- package/mobile/lib/components/CalculatorDeposit/isNotRubles.js +0 -2
- package/mobile/lib/components/CalculatorDeposit/isNotRubles.js.map +0 -1
- package/mobile/src/components/CalculatorDeposit/isNotRubles.tsx +0 -1
- package/src/components/CalculatorDeposit/isNotRubles.tsx +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable max-lines, max-lines-per-function */
|
|
2
|
-
import {
|
|
2
|
+
import { useCallback, useEffect } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { type JSONRefObject } from '../../data/JSONRefObject';
|
|
4
4
|
import { useForm } from '../../hooks/useForm';
|
|
5
5
|
import { Button } from '../../ui-kit/Button/Button';
|
|
@@ -18,20 +18,25 @@ import { type Option } from '../../ui-kit/Select/Option';
|
|
|
18
18
|
import { SelectControl } from '../../ui-kit/Select/SelectControl';
|
|
19
19
|
import { UniBlock } from '../../UniBlock/UniBlock';
|
|
20
20
|
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
21
|
-
import { clamp } from '../../utils/clamp';
|
|
22
21
|
import { style } from '../../utils/style';
|
|
23
22
|
import { isDefaultParams } from '../CalculatorCredit/isDefaultParams';
|
|
24
|
-
import {
|
|
25
|
-
import { type CalculatorDepositContent } from './CalculatorDepositContent';
|
|
23
|
+
import { type CalculatorDepositContent, type DepositParams } from './CalculatorDepositContent';
|
|
26
24
|
import {
|
|
27
25
|
getDepositCalculatorParams,
|
|
28
26
|
type DepositCalculatorData,
|
|
29
|
-
type DepositCalculatorRowsData,
|
|
30
27
|
type DepositCalculatorSourceBookParams,
|
|
31
28
|
type TariffsButtonContent,
|
|
32
29
|
} from './getDepositCalculatorParams';
|
|
30
|
+
import { isRubles } from './isRubles';
|
|
33
31
|
import { renderDepositParamsForm } from './renderDepositParamsForm';
|
|
34
32
|
import { renderDepositResult } from './renderDepositResult';
|
|
33
|
+
import {
|
|
34
|
+
getRows,
|
|
35
|
+
normalizeCurrency,
|
|
36
|
+
normalizeMoneyValue,
|
|
37
|
+
normalizeMonthValue,
|
|
38
|
+
normalizeReplenishWithdrawn,
|
|
39
|
+
} from './utils';
|
|
35
40
|
|
|
36
41
|
const MAP = {
|
|
37
42
|
isMonthlyInterestPayment: 'isMonthlyInterestPayment',
|
|
@@ -47,6 +52,7 @@ const DEFAULT_CURRENCY: Option = {
|
|
|
47
52
|
};
|
|
48
53
|
|
|
49
54
|
const DEPOSIT_DEFAULT_SUM = 20000;
|
|
55
|
+
const DEPOSIT_DEFAULT_MONTHS = 1;
|
|
50
56
|
|
|
51
57
|
export interface CalculatorDepositProps extends CalculatorDepositContent, UniBlockProps {
|
|
52
58
|
className?: string;
|
|
@@ -65,81 +71,57 @@ export const CalculatorDeposit = UniBlock<CalculatorDepositProps>(
|
|
|
65
71
|
}) => {
|
|
66
72
|
const { rows } = calcSource ?? {};
|
|
67
73
|
const currencyOptions = rows?.map((_) => _.currency) ?? [DEFAULT_CURRENCY];
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
74
|
+
const normalize = useCallback(
|
|
75
|
+
(_: DepositParams) =>
|
|
76
|
+
!rows
|
|
77
|
+
? _
|
|
78
|
+
: {
|
|
79
|
+
..._,
|
|
80
|
+
...normalizeReplenishWithdrawn(_),
|
|
81
|
+
...normalizeMoneyValue(_, rows),
|
|
82
|
+
...normalizeMonthValue(_, rows),
|
|
83
|
+
...normalizeCurrency(_, rows),
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
[rows],
|
|
87
|
+
);
|
|
88
|
+
const [userInputParams, { field }] = useForm(
|
|
89
|
+
{
|
|
90
|
+
moneyValue: getMoneyDefaultValue(defaultParams, DEPOSIT_DEFAULT_SUM),
|
|
91
|
+
monthsValue: getMonthsDefaultValue(defaultParams, DEPOSIT_DEFAULT_MONTHS),
|
|
92
|
+
isMonthlyInterestPayment: Boolean(defaultParams?.isMonthlyInterestPayment),
|
|
93
|
+
isRemoteRegistration: Boolean(defaultParams?.isRemoteRegistration),
|
|
94
|
+
isReplenish: Boolean(defaultParams?.isReplenish),
|
|
95
|
+
isWithdrawn: Boolean(defaultParams?.isWithdrawn),
|
|
96
|
+
isNewClient: Boolean(defaultParams?.isNewClient),
|
|
97
|
+
currency: DEFAULT_CURRENCY,
|
|
98
|
+
},
|
|
99
|
+
{ normalize },
|
|
89
100
|
);
|
|
90
101
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
102
|
+
const currencyValue = field?.('currency')?.value ?? DEFAULT_CURRENCY;
|
|
103
|
+
const isNewClient = field?.('isNewClient')?.value;
|
|
104
|
+
const row = getRows(rows, currencyValue);
|
|
105
|
+
const calcParams = getDepositCalculatorParams(userInputParams, row, paramsViewSettings);
|
|
106
|
+
const { rate, income, finalSum, type = '' } = calcParams;
|
|
96
107
|
|
|
97
108
|
const handleDefaultParamsCals = () => {
|
|
98
109
|
setDefaultParamsCalc({
|
|
99
110
|
field,
|
|
100
|
-
defParams:
|
|
111
|
+
defParams: getDefaultParamsMax(row, isNewClient) as DepositCalculatorSourceBookParams,
|
|
101
112
|
calcParams,
|
|
102
113
|
monthsValue: 'minMonths',
|
|
103
114
|
map: MAP,
|
|
104
115
|
});
|
|
105
116
|
};
|
|
106
117
|
|
|
107
|
-
const { defaultMonth, rate, income, finalSum, type = '' } = calcParams;
|
|
108
|
-
|
|
109
|
-
useEffect(() => {
|
|
110
|
-
setDefParams(getDefaultParamsMax(row));
|
|
111
|
-
}, [currencyValue, rows]);
|
|
112
|
-
|
|
113
|
-
useEffect(() => {
|
|
114
|
-
!userInputParams.monthsValue && setMonthsValue && setMonthsValue(defaultMonth);
|
|
115
|
-
}, [defaultMonth]);
|
|
116
|
-
|
|
117
|
-
useEffect(() => {
|
|
118
|
-
setMoneyValue &&
|
|
119
|
-
setMoneyValue(clamp(userInputParams.moneyValue, calcParams.minSum, calcParams.maxSum));
|
|
120
|
-
}, [calcParams.minSum, calcParams.maxSum, row]);
|
|
121
|
-
|
|
122
118
|
useEffect(() => {
|
|
123
|
-
if (!isDefaultParams(defaultParams) &&
|
|
119
|
+
if (!isDefaultParams(defaultParams) && row) {
|
|
124
120
|
handleDefaultParamsCals();
|
|
125
121
|
}
|
|
126
|
-
}, [
|
|
122
|
+
}, [defaultParams, rows]);
|
|
127
123
|
|
|
128
|
-
|
|
129
|
-
setMoneyValue?.(clamp(userInputParams.moneyValue, calcParams.minSum, calcParams.maxSum));
|
|
130
|
-
if (isNotRubles(currencyValue?.key)) {
|
|
131
|
-
field?.('isReplenish')?.onChange?.(false);
|
|
132
|
-
field?.('isWithdrawn')?.onChange?.(false);
|
|
133
|
-
}
|
|
134
|
-
}, [currencyValue]);
|
|
135
|
-
|
|
136
|
-
useEffect(() => {
|
|
137
|
-
if (!isDefaultParams(defaultParams) && defParams) {
|
|
138
|
-
handleDefaultParamsCals();
|
|
139
|
-
}
|
|
140
|
-
}, [defaultParams, row, defParams]);
|
|
141
|
-
|
|
142
|
-
const isMaxRate = rate === defParams?.rate;
|
|
124
|
+
const isMaxRate = rate === getDefaultParamsMax(row, isNewClient)?.rate;
|
|
143
125
|
|
|
144
126
|
return (
|
|
145
127
|
<CalculatorLayout className={className} title={title} {...rest}>
|
|
@@ -188,7 +170,7 @@ export const CalculatorDeposit = UniBlock<CalculatorDepositProps>(
|
|
|
188
170
|
},
|
|
189
171
|
);
|
|
190
172
|
|
|
191
|
-
const getStep = (key = '') => (
|
|
173
|
+
const getStep = (key = '') => (isRubles(key) ? 1000 : 100);
|
|
192
174
|
|
|
193
175
|
const getTariffButton = (buttons: TariffsButtonContent[] = [], btnType = '') => {
|
|
194
176
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -203,9 +185,3 @@ const renderMaxRateButton = (handleDefaultParamsCals: () => void, isMaxRate = fa
|
|
|
203
185
|
Показать максимальную ставку
|
|
204
186
|
</Button>
|
|
205
187
|
);
|
|
206
|
-
|
|
207
|
-
const getRows = (rows?: DepositCalculatorRowsData[], currencyValue?: Option) => {
|
|
208
|
-
const { rates } = rows?.find((_) => _?.currency.key === currencyValue?.key) ?? {};
|
|
209
|
-
|
|
210
|
-
return rates ?? rows?.[0]?.rates;
|
|
211
|
-
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
+
type CalcValueProps,
|
|
2
3
|
type CommonCalculatorProps,
|
|
3
4
|
type CommonDefaultParams,
|
|
4
5
|
} from '../../ui-kit/Calculator/CalculatorProps';
|
|
6
|
+
import { type Option } from '../../ui-kit/Select/Option';
|
|
5
7
|
import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
|
|
6
8
|
|
|
7
9
|
export interface CalculatorDepositParamsViewSettings {
|
|
@@ -19,10 +21,12 @@ export interface CalculatorDepositParamsViewSettings {
|
|
|
19
21
|
isShowReplenish?: boolean;
|
|
20
22
|
/** @title Снятие */
|
|
21
23
|
isShowWithdrawn?: boolean;
|
|
24
|
+
/** @title Новый клиент */
|
|
25
|
+
isShowNewClient?: boolean;
|
|
22
26
|
}
|
|
23
27
|
|
|
24
28
|
export interface CommonDepositParams {
|
|
25
|
-
/** @title Возможность
|
|
29
|
+
/** @title Возможность пополнять */
|
|
26
30
|
isReplenish?: boolean;
|
|
27
31
|
/** @title Возможно снимать */
|
|
28
32
|
isWithdrawn?: boolean;
|
|
@@ -30,11 +34,16 @@ export interface CommonDepositParams {
|
|
|
30
34
|
isMonthlyInterestPayment?: boolean;
|
|
31
35
|
/** @title Дистанционное оформление */
|
|
32
36
|
isRemoteRegistration?: boolean;
|
|
37
|
+
/** @title Новый клиент */
|
|
38
|
+
isNewClient?: boolean;
|
|
39
|
+
/** @title Валюта */
|
|
40
|
+
currency?: Option;
|
|
33
41
|
/** @hidden */
|
|
34
42
|
type?: string;
|
|
35
43
|
}
|
|
36
44
|
|
|
37
45
|
export interface DepositDefaultParams extends CommonDefaultParams, CommonDepositParams {}
|
|
46
|
+
export interface DepositParams extends DepositDefaultParams, CalcValueProps {}
|
|
38
47
|
|
|
39
48
|
/**
|
|
40
49
|
* @title Калькулятор вкладов
|
|
@@ -27,7 +27,9 @@ const DEFAULT_DEPOSIT_CALCULATOR_PARAMS: DepositCalculatorSourceBookParams = {
|
|
|
27
27
|
|
|
28
28
|
export interface DepositCalculatorSourceBookParams
|
|
29
29
|
extends CommonDepositParams,
|
|
30
|
-
CalcDefaultParamsProps {
|
|
30
|
+
CalcDefaultParamsProps {
|
|
31
|
+
currency?: Option;
|
|
32
|
+
}
|
|
31
33
|
|
|
32
34
|
export interface DepositCalculatorUserInputParams extends CommonDepositParams, CalcValueProps {}
|
|
33
35
|
|
|
@@ -47,7 +49,7 @@ export type TariffsButtonContent = LinkButtonContent & {
|
|
|
47
49
|
|
|
48
50
|
export type DepositCalculatorRowsData = {
|
|
49
51
|
currency: Option;
|
|
50
|
-
rates
|
|
52
|
+
rates: DepositCalculatorSourceBookParams[];
|
|
51
53
|
};
|
|
52
54
|
|
|
53
55
|
export type DepositCalculatorData = {
|
|
@@ -66,35 +68,38 @@ export const getDepositCalculatorParams = (
|
|
|
66
68
|
const isExcludeRemoteRegistration = !paramsViewSettings?.isShowRemoteRegistration;
|
|
67
69
|
const isExcludeReplenish = !paramsViewSettings?.isShowReplenish;
|
|
68
70
|
const isExcludeWithdrawn = !paramsViewSettings?.isShowWithdrawn;
|
|
71
|
+
const isExcludeNewClient = !paramsViewSettings?.isShowNewClient;
|
|
69
72
|
const depositCalculatorSourceBookParams =
|
|
70
|
-
rows?.find(
|
|
71
|
-
|
|
73
|
+
rows?.find((row) =>
|
|
74
|
+
[
|
|
72
75
|
checkRowByParam({
|
|
73
76
|
row,
|
|
74
77
|
userInputParams,
|
|
75
78
|
paramKey: 'isReplenish',
|
|
76
79
|
isExclude: isExcludeReplenish,
|
|
77
|
-
})
|
|
80
|
+
}),
|
|
78
81
|
checkRowByParam({
|
|
79
82
|
row,
|
|
80
83
|
userInputParams,
|
|
81
84
|
paramKey: 'isWithdrawn',
|
|
82
85
|
isExclude: isExcludeWithdrawn,
|
|
83
|
-
})
|
|
86
|
+
}),
|
|
84
87
|
checkRowByParam({
|
|
85
88
|
row,
|
|
86
89
|
userInputParams,
|
|
87
90
|
paramKey: 'isMonthlyInterestPayment',
|
|
88
91
|
isExclude: isExcludeMonthlyInterestPayment,
|
|
89
|
-
})
|
|
92
|
+
}),
|
|
90
93
|
checkRowByParam({
|
|
91
94
|
row,
|
|
92
95
|
userInputParams,
|
|
93
96
|
paramKey: 'isRemoteRegistration',
|
|
94
97
|
isExclude: isExcludeRemoteRegistration,
|
|
95
|
-
})
|
|
96
|
-
|
|
98
|
+
}),
|
|
99
|
+
isExcludeNewClient || userInputParams?.['isNewClient'] === row?.['isNewClient'],
|
|
100
|
+
checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], row),
|
|
97
101
|
checkRangeByKeys(monthsValue || defaultMonth, ['minMonths', 'maxMonths'], row),
|
|
102
|
+
].every(Boolean),
|
|
98
103
|
) || DEFAULT_DEPOSIT_CALCULATOR_PARAMS;
|
|
99
104
|
|
|
100
105
|
const { rate } = depositCalculatorSourceBookParams;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const isRubles = (currency = 'rub') => currency === 'rub';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type FormFieldRegisterer } from '../../hooks/useForm';
|
|
2
2
|
import { renderBinaryRadioButtonGroup } from '../../ui-kit/Calculator/renderBinaryRadioButtonGroup';
|
|
3
3
|
import { renderPayout } from '../../ui-kit/Calculator/renderPayout';
|
|
4
|
+
import { Checkbox } from '../../ui-kit/Checkbox/Checkbox';
|
|
4
5
|
import { type CalculatorDepositParamsViewSettings } from './CalculatorDepositContent';
|
|
5
6
|
import { type DepositCalculatorParams } from './getDepositCalculatorParams';
|
|
6
7
|
import { renderRegistrationType } from './renderRegistrationType';
|
|
@@ -41,7 +42,7 @@ export const renderDepositParamsForm = (
|
|
|
41
42
|
})
|
|
42
43
|
: null}
|
|
43
44
|
</div>
|
|
44
|
-
{
|
|
45
|
+
{renderSeparator(params.isShowReplenish || params.isShowWithdrawn)}
|
|
45
46
|
<div className="flex gap-lg">
|
|
46
47
|
{params.isShowMonthlyInterestPayment
|
|
47
48
|
? renderPayout({
|
|
@@ -60,9 +61,11 @@ export const renderDepositParamsForm = (
|
|
|
60
61
|
})
|
|
61
62
|
: null}
|
|
62
63
|
</div>
|
|
64
|
+
{renderSeparator(params.isShowNewClient)}
|
|
65
|
+
{params.isShowNewClient ? <Checkbox text="Новый вкладчик" {...field('isNewClient')} /> : null}
|
|
63
66
|
</div>
|
|
64
67
|
);
|
|
65
68
|
};
|
|
66
69
|
|
|
67
|
-
const
|
|
70
|
+
const renderSeparator = (isShow = false) =>
|
|
68
71
|
isShow ? <div className="border-b border-main-divider w-full"></div> : null;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { getRangeByKeys } from '../../ui-kit/Calculator/rangeHelpers';
|
|
2
|
+
import { type Option } from '../../ui-kit/Select/Option';
|
|
3
|
+
import { clamp } from '../../utils/clamp';
|
|
4
|
+
import { type DepositParams } from './CalculatorDepositContent';
|
|
5
|
+
import { type DepositCalculatorRowsData } from './getDepositCalculatorParams';
|
|
6
|
+
import { isRubles } from './isRubles';
|
|
7
|
+
|
|
8
|
+
export const normalizeMonthValue = (_: DepositParams, rows?: DepositCalculatorRowsData[]) => {
|
|
9
|
+
const { minMonths, maxMonths } = getRangeByKeys(
|
|
10
|
+
['minMonths', 'maxMonths'],
|
|
11
|
+
getRows(rows, _?.currency),
|
|
12
|
+
);
|
|
13
|
+
const monthsValue = _.monthsValue || Math.round((minMonths + maxMonths) / 2);
|
|
14
|
+
|
|
15
|
+
return { monthsValue: clamp(monthsValue, minMonths, maxMonths) };
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const normalizeMoneyValue = (_: DepositParams, rows?: DepositCalculatorRowsData[]) => {
|
|
19
|
+
const { minSum, maxSum } = getRangeByKeys(['minSum', 'maxSum'], getRows(rows, _?.currency));
|
|
20
|
+
const moneyValue = _.moneyValue || minSum;
|
|
21
|
+
|
|
22
|
+
return { moneyValue: clamp(moneyValue, minSum, maxSum) };
|
|
23
|
+
};
|
|
24
|
+
export const normalizeCurrency = (_: DepositParams, rows?: DepositCalculatorRowsData[]) => ({
|
|
25
|
+
currency: _?.currency ?? rows?.map((row) => row.currency)?.[0],
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export const normalizeReplenishWithdrawn = (_: DepositParams) => {
|
|
29
|
+
const _isRubles = isRubles(_?.currency?.key);
|
|
30
|
+
|
|
31
|
+
return { isReplenish: _isRubles && _?.isReplenish, isWithdrawn: _isRubles && _?.isWithdrawn };
|
|
32
|
+
};
|
|
33
|
+
export const getRows = (rows?: DepositCalculatorRowsData[], currencyValue?: Option) => {
|
|
34
|
+
const { rates } = rows?.find((_) => _?.currency.key === currencyValue?.key) ?? {};
|
|
35
|
+
|
|
36
|
+
return rates ?? rows?.[0]?.rates;
|
|
37
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useCallback,
|
|
1
|
+
import { useCallback, useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
2
|
import { type ControlProps } from '../ui-kit/ControlProps';
|
|
3
3
|
import { type PreventableEvent, type PreventableEventWithTarget } from '../ui-kit/PreventableEvent';
|
|
4
4
|
import { identity } from '../utils/fp/identity';
|
|
@@ -25,45 +25,59 @@ export interface FormOperatorProps<FormState extends Record<string, any>> {
|
|
|
25
25
|
onSubmit?: (ev: PreventableEvent) => void;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
// eslint-disable-next-line max-lines-per-function
|
|
28
29
|
export const useForm = <FormState extends Record<string, any>>(
|
|
29
30
|
initialState: FormState,
|
|
30
31
|
{
|
|
31
32
|
resetOnSubmit,
|
|
32
33
|
onSubmit,
|
|
34
|
+
normalize,
|
|
33
35
|
}: {
|
|
34
36
|
resetOnSubmit?: boolean;
|
|
35
37
|
onSubmit?: (_: FormState, ev: PreventableEventWithTarget) => void;
|
|
38
|
+
normalize?: (_: FormState) => FormState;
|
|
36
39
|
} = {},
|
|
37
40
|
): [FormState, FormOperatorProps<FormState>] => {
|
|
38
|
-
const [formState,
|
|
39
|
-
|
|
41
|
+
const [formState, setFormStateUnsafe] = useState<FormState>(initialState);
|
|
42
|
+
const setFormState = useCallback(
|
|
43
|
+
normalize
|
|
44
|
+
? (_: FormState | ((prev: FormState) => FormState)) =>
|
|
45
|
+
setFormStateUnsafe(
|
|
46
|
+
_ instanceof Function
|
|
47
|
+
? (prev) => {
|
|
48
|
+
const _normalize = normalize(_(prev));
|
|
49
|
+
|
|
50
|
+
return shellowCompare(prev, _normalize) ? prev : _normalize;
|
|
51
|
+
}
|
|
52
|
+
: normalize(_),
|
|
53
|
+
)
|
|
54
|
+
: setFormStateUnsafe,
|
|
55
|
+
[normalize],
|
|
56
|
+
);
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
if (normalize) {
|
|
59
|
+
setFormStateUnsafe(normalize);
|
|
60
|
+
}
|
|
61
|
+
}, [normalize]);
|
|
40
62
|
const [isDirtyForm, setDirtyForm] = useState(false);
|
|
41
63
|
const [dirtyFieldsMap, setDirtyFieldsMap] = useState<Partial<Record<keyof FormState, boolean>>>(
|
|
42
64
|
{},
|
|
43
65
|
);
|
|
44
66
|
|
|
45
|
-
const handlersMap = useRef<Partial<Record<keyof FormState, (value: any) => void>>>({});
|
|
46
|
-
|
|
47
67
|
const field: FormFieldRegisterer<FormState> = useCallback(
|
|
48
68
|
(fieldName, options) => {
|
|
49
69
|
const { parse = identity, format = identity } = options || {};
|
|
50
70
|
|
|
51
|
-
if (!handlersMap.current) {
|
|
52
|
-
handlersMap.current = {};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
handlersMap.current[fieldName] ||= (value) => {
|
|
56
|
-
setFormState((prev) => ({ ...prev, [fieldName]: parse(value) }));
|
|
57
|
-
setDirtyFieldsMap((prev) => ({ ...prev, [fieldName]: true }));
|
|
58
|
-
};
|
|
59
|
-
|
|
60
71
|
return {
|
|
61
72
|
value: format(formState[fieldName]) as any,
|
|
62
73
|
isDirty: isDirtyForm || dirtyFieldsMap[fieldName],
|
|
63
|
-
onChange:
|
|
74
|
+
onChange: (value) => {
|
|
75
|
+
setFormState((prev) => ({ ...prev, [fieldName]: parse(value) }));
|
|
76
|
+
setDirtyFieldsMap((prev) => ({ ...prev, [fieldName]: true }));
|
|
77
|
+
},
|
|
64
78
|
};
|
|
65
79
|
},
|
|
66
|
-
[
|
|
80
|
+
[setFormState, isDirtyForm, dirtyFieldsMap],
|
|
67
81
|
);
|
|
68
82
|
|
|
69
83
|
const update = useCallback((_: FormState) => {
|
|
@@ -99,3 +113,6 @@ export const useForm = <FormState extends Record<string, any>>(
|
|
|
99
113
|
},
|
|
100
114
|
];
|
|
101
115
|
};
|
|
116
|
+
|
|
117
|
+
const shellowCompare = (a: Record<string, any>, b: Record<string, any>): boolean =>
|
|
118
|
+
Object.keys({ ...a, ...b }).every((key) => a[key] === b[key]);
|
|
@@ -8,10 +8,11 @@ export interface Region {
|
|
|
8
8
|
code?: string;
|
|
9
9
|
name?: string;
|
|
10
10
|
slug?: string;
|
|
11
|
+
localities?: string[];
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
export function useRegions(): Region[] {
|
|
14
|
-
const { data } = useAsyncData(
|
|
14
|
+
export function useRegions(url: string = REGIONS_URL): Region[] {
|
|
15
|
+
const { data } = useAsyncData(url, fetchJSONUnsafe as FetchJSONUnsafeType<Region[]>);
|
|
15
16
|
|
|
16
17
|
return Array.isArray(data) ? data : [];
|
|
17
18
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const CalculatorStyle = {
|
|
2
2
|
wrapper: 'flex flex-col justify-between @4xl:flex-row gap-x-4xl gap-y-7 @xl:gap-y-4xl',
|
|
3
3
|
input: 'flex flex-col lg:max-w-80 lg:w-1/2 gap-2xl',
|
|
4
|
-
result: 'flex flex-col gap-y-xl min-w-
|
|
4
|
+
result: 'flex flex-col gap-y-xl min-w-52',
|
|
5
5
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type CreditCalculatorSourceBookParams } from '../../components/CalculatorCredit/CalculatorCreditContent';
|
|
2
1
|
import { type DepositCalculatorSourceBookParams } from '../../components/CalculatorDeposit/getDepositCalculatorParams';
|
|
3
2
|
import { type CalcDefaultParamsProps } from './CalculatorProps';
|
|
4
3
|
|
|
@@ -8,11 +7,12 @@ export const getDefaultParamsMin = (rateRows?: CalcDefaultParamsProps[]) =>
|
|
|
8
7
|
rateRows,
|
|
9
8
|
);
|
|
10
9
|
export const getDefaultParamsMax = (
|
|
11
|
-
rateRows
|
|
10
|
+
rateRows: DepositCalculatorSourceBookParams[] = [],
|
|
11
|
+
isNewClient = false,
|
|
12
12
|
) =>
|
|
13
13
|
getDefaultParams(
|
|
14
14
|
[(i: number, acc: number) => i > acc, (i, prev) => i?.minSum < prev?.minSum],
|
|
15
|
-
rateRows,
|
|
15
|
+
rateRows?.filter((_) => isNewClient === Boolean(_?.isNewClient)),
|
|
16
16
|
);
|
|
17
17
|
|
|
18
18
|
const getDefaultParams = (
|
package/package.json
CHANGED
|
@@ -826,5 +826,84 @@
|
|
|
826
826
|
}
|
|
827
827
|
}
|
|
828
828
|
}
|
|
829
|
+
],
|
|
830
|
+
[
|
|
831
|
+
"Выездной менеджер ФЛ",
|
|
832
|
+
{
|
|
833
|
+
"content": {
|
|
834
|
+
"version": "primary",
|
|
835
|
+
"padding": "",
|
|
836
|
+
"title": "Заявка на консультацию",
|
|
837
|
+
"typeForm": "OUTSERVICE",
|
|
838
|
+
"endpoint": "lead",
|
|
839
|
+
"sections": [
|
|
840
|
+
{
|
|
841
|
+
"inputs": [
|
|
842
|
+
{
|
|
843
|
+
"fieldType": "common",
|
|
844
|
+
"name": "product",
|
|
845
|
+
"required": true
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
"fieldType": "common",
|
|
849
|
+
"name": "region",
|
|
850
|
+
"required": true
|
|
851
|
+
},
|
|
852
|
+
{
|
|
853
|
+
"fieldType": "common",
|
|
854
|
+
"name": "localities",
|
|
855
|
+
"required": true
|
|
856
|
+
},
|
|
857
|
+
{
|
|
858
|
+
"fieldType": "common",
|
|
859
|
+
"name": "fullName",
|
|
860
|
+
"required": true
|
|
861
|
+
}
|
|
862
|
+
]
|
|
863
|
+
},
|
|
864
|
+
{
|
|
865
|
+
"columns": 2,
|
|
866
|
+
"inputs": [
|
|
867
|
+
{
|
|
868
|
+
"fieldType": "common",
|
|
869
|
+
"name": "birthday",
|
|
870
|
+
"required": true
|
|
871
|
+
},
|
|
872
|
+
{
|
|
873
|
+
"fieldType": "common",
|
|
874
|
+
"name": "phone",
|
|
875
|
+
"required": true
|
|
876
|
+
},
|
|
877
|
+
{
|
|
878
|
+
"fieldType": "common",
|
|
879
|
+
"name": "email"
|
|
880
|
+
},
|
|
881
|
+
{
|
|
882
|
+
"fieldType": "common",
|
|
883
|
+
"name": "desiredMeetingDate"
|
|
884
|
+
}
|
|
885
|
+
]
|
|
886
|
+
},
|
|
887
|
+
{
|
|
888
|
+
"inputs": [
|
|
889
|
+
{
|
|
890
|
+
"fieldType": "common",
|
|
891
|
+
"name": "consentDataProcessing",
|
|
892
|
+
"required": true
|
|
893
|
+
}
|
|
894
|
+
]
|
|
895
|
+
}
|
|
896
|
+
],
|
|
897
|
+
"button": {
|
|
898
|
+
"text": "Отправить заявку",
|
|
899
|
+
"version": "primary"
|
|
900
|
+
},
|
|
901
|
+
"link": {
|
|
902
|
+
"text": "Согласен на обработку персональных данных",
|
|
903
|
+
"href": "/privacy-policy",
|
|
904
|
+
"target": "_blank"
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
}
|
|
829
908
|
]
|
|
830
909
|
]
|
|
@@ -651,4 +651,38 @@ export default {
|
|
|
651
651
|
<DialogManager />
|
|
652
652
|
</div>
|
|
653
653
|
),
|
|
654
|
+
outservice: (
|
|
655
|
+
<div className="container grid grid-cols-12">
|
|
656
|
+
<ApplicationForm
|
|
657
|
+
className="col-span-12"
|
|
658
|
+
title="Заявка на консультацию OUTSEVICE"
|
|
659
|
+
typeForm="OUTSERVICE"
|
|
660
|
+
endpoint="lead"
|
|
661
|
+
sections={[
|
|
662
|
+
{
|
|
663
|
+
inputs: [
|
|
664
|
+
{ fieldType: 'common', name: 'product', required: true },
|
|
665
|
+
{ fieldType: 'common', name: 'region', required: true },
|
|
666
|
+
{ fieldType: 'common', name: 'localities', required: true },
|
|
667
|
+
{ fieldType: 'common', name: 'fullName', required: true },
|
|
668
|
+
],
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
columns: 2,
|
|
672
|
+
inputs: [
|
|
673
|
+
{ fieldType: 'common', name: 'birthday', required: true },
|
|
674
|
+
{ fieldType: 'common', name: 'phone', required: true },
|
|
675
|
+
{ fieldType: 'common', name: 'email' },
|
|
676
|
+
{ fieldType: 'common', name: 'desiredMeetingDate' },
|
|
677
|
+
],
|
|
678
|
+
},
|
|
679
|
+
{ inputs: [{ fieldType: 'common', name: 'consentDataProcessing', required: true }] },
|
|
680
|
+
]}
|
|
681
|
+
button={button}
|
|
682
|
+
link={link}
|
|
683
|
+
/>
|
|
684
|
+
<PopupManager />
|
|
685
|
+
<DialogManager />
|
|
686
|
+
</div>
|
|
687
|
+
),
|
|
654
688
|
};
|
|
@@ -17,7 +17,7 @@ export type SubmitButtonProps = TextProps & {
|
|
|
17
17
|
/**
|
|
18
18
|
* @title Название поля ввода
|
|
19
19
|
* @required
|
|
20
|
-
* @enumNames ["Фамилия", "Имя", "Отчество", "Email", "Телефон", "ФИО", "ИНН", "Комментарий", "Регион", "Адрес", "Тип формы", "День рождения", "Клиент банка", "Согласие на получение материалов", "Тип эквайринга", "Онлайн касса", "POS-терминал", "Направление обслуживания", "Ультра/Премиум", "Тип обратной связи", "Способ получения ответа", "Банковский служащий", "Дата и время обращени", "Дополнительный телефон", "ВЭД", "Срок (месяцев)", "Сумма ₽", "Годовой доход", "Количество объектов инкассации", "Комментарий партнёров", "Согласие на обработку"]
|
|
20
|
+
* @enumNames ["Фамилия", "Имя", "Отчество", "Email", "Телефон", "ФИО", "ИНН", "Комментарий", "Регион", "Регион выездной сервис", "Адрес", "Тип формы", "День рождения", "Клиент банка", "Согласие на получение материалов", "Тип эквайринга", "Онлайн касса", "POS-терминал", "Направление обслуживания", "Ультра/Премиум", "Тип обратной связи", "Способ получения ответа", "Банковский служащий", "Дата и время обращени", "Дополнительный телефон", "ВЭД", "Срок (месяцев)", "Сумма ₽", "Годовой доход", "Количество объектов инкассации", "День встречи", "Продукт", "Комментарий партнёров", "Согласие на обработку"]
|
|
21
21
|
*/
|
|
22
22
|
export type NameFieldDef =
|
|
23
23
|
| 'surname'
|
|
@@ -49,6 +49,9 @@ export type NameFieldDef =
|
|
|
49
49
|
| 'amount'
|
|
50
50
|
| 'annualRevenue'
|
|
51
51
|
| 'collectionCount'
|
|
52
|
+
| 'desiredMeetingDate'
|
|
53
|
+
| 'product'
|
|
54
|
+
| 'localities'
|
|
52
55
|
| 'partnerComments'
|
|
53
56
|
| 'consentDataProcessing';
|
|
54
57
|
|
|
@@ -115,7 +118,8 @@ type TypeFormFieldDef =
|
|
|
115
118
|
| 'KVED'
|
|
116
119
|
| 'ULTRASERVICE'
|
|
117
120
|
| 'PREMIUMSERVICE'
|
|
118
|
-
| 'FEEDBACK'
|
|
121
|
+
| 'FEEDBACK'
|
|
122
|
+
| 'OUTSERVICE';
|
|
119
123
|
|
|
120
124
|
/**
|
|
121
125
|
* @title Количество колонок
|