@redneckz/wildless-cms-uni-blocks 0.14.211 → 0.14.213
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/bin/migration-scripts/0.14.169.js +3 -2
- package/bin/migration-scripts/0.14.213.js +235 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +525 -625
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +1 -44
- package/bundle/components/ApplicationForm/ApplicationFormFeedback.d.ts +5 -2
- package/bundle/components/ApplicationForm/ApplicationFormsProps.d.ts +1 -2
- package/bundle/components/ApplicationForm/EmbeddableForms.d.ts +0 -5
- package/bundle/components/ApplicationFormCustom/AcquiringField.d.ts +5 -0
- package/bundle/components/ApplicationFormCustom/AddressBranchField.d.ts +6 -0
- package/bundle/components/ApplicationFormCustom/AmountField.d.ts +2 -0
- package/bundle/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +7 -4
- package/bundle/components/ApplicationFormCustom/CommentField.d.ts +2 -0
- package/bundle/components/ApplicationFormCustom/CustomFieldProps.d.ts +6 -0
- package/bundle/components/ApplicationFormCustom/OnlineCheckoutField.d.ts +2 -0
- package/bundle/components/ApplicationFormCustom/PosTerminalField.d.ts +2 -0
- package/bundle/components/ApplicationFormCustom/RegionField.d.ts +2 -0
- package/bundle/components/ApplicationFormCustom/RegionPremiumField.d.ts +2 -0
- package/bundle/components/ApplicationFormCustom/TermField.d.ts +2 -0
- package/bundle/components/ApplicationFormCustom/UltraPremiumField.d.ts +4 -0
- package/bundle/components/ApplicationFormCustom/getField.d.ts +4 -2
- package/bundle/components/ApplicationFormCustom/getInitialFormState.d.ts +6 -0
- package/bundle/components/ApplicationFormCustom/getPartnerComments.d.ts +2 -0
- package/bundle/ui-kit/Input/InputPhoneControl.d.ts +2 -0
- package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +1 -44
- package/dist/components/ApplicationForm/ApplicationFormFeedback.d.ts +5 -2
- package/dist/components/ApplicationForm/ApplicationFormFeedback.js +9 -7
- package/dist/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
- package/dist/components/ApplicationForm/ApplicationFormsProps.d.ts +1 -2
- package/dist/components/ApplicationForm/EmbeddableForms.d.ts +0 -5
- package/dist/components/ApplicationForm/EmbeddableForms.js +0 -10
- package/dist/components/ApplicationForm/EmbeddableForms.js.map +1 -1
- package/dist/components/ApplicationForm/renderWedDataOrganization.js +3 -3
- package/dist/components/ApplicationForm/renderWedDataOrganization.js.map +1 -1
- package/dist/components/ApplicationFormCustom/AcquiringField.d.ts +5 -0
- package/dist/components/ApplicationFormCustom/AcquiringField.js +29 -0
- package/dist/components/ApplicationFormCustom/AcquiringField.js.map +1 -0
- package/dist/components/ApplicationFormCustom/AddressBranchField.d.ts +6 -0
- package/dist/components/{ApplicationForm → ApplicationFormCustom}/AddressBranchField.js +12 -5
- package/dist/components/ApplicationFormCustom/AddressBranchField.js.map +1 -0
- package/dist/components/ApplicationFormCustom/AmountField.d.ts +2 -0
- package/dist/components/ApplicationFormCustom/AmountField.js +10 -0
- package/dist/components/ApplicationFormCustom/AmountField.js.map +1 -0
- package/dist/components/ApplicationFormCustom/ApplicationFormCustom.js +4 -4
- package/dist/components/ApplicationFormCustom/ApplicationFormCustom.js.map +1 -1
- package/dist/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +7 -4
- package/dist/components/ApplicationFormCustom/CommentField.d.ts +2 -0
- package/dist/components/ApplicationFormCustom/CommentField.js +9 -0
- package/dist/components/ApplicationFormCustom/CommentField.js.map +1 -0
- package/dist/components/ApplicationFormCustom/CustomFieldProps.d.ts +6 -0
- package/dist/components/{ApplicationForm/models.js → ApplicationFormCustom/CustomFieldProps.js} +1 -1
- package/dist/components/ApplicationFormCustom/CustomFieldProps.js.map +1 -0
- package/dist/components/ApplicationFormCustom/OnlineCheckoutField.d.ts +2 -0
- package/dist/components/ApplicationFormCustom/OnlineCheckoutField.js +8 -0
- package/dist/components/ApplicationFormCustom/OnlineCheckoutField.js.map +1 -0
- package/dist/components/ApplicationFormCustom/PosTerminalField.d.ts +2 -0
- package/dist/components/ApplicationFormCustom/PosTerminalField.js +8 -0
- package/dist/components/ApplicationFormCustom/PosTerminalField.js.map +1 -0
- package/dist/components/ApplicationFormCustom/RegionField.d.ts +2 -0
- package/dist/components/ApplicationFormCustom/RegionField.js +14 -0
- package/dist/components/ApplicationFormCustom/RegionField.js.map +1 -0
- package/dist/components/ApplicationFormCustom/RegionPremiumField.d.ts +2 -0
- package/{mobile/dist/components/ApplicationForm → dist/components/ApplicationFormCustom}/RegionPremiumField.js +7 -6
- package/dist/components/ApplicationFormCustom/RegionPremiumField.js.map +1 -0
- package/dist/components/ApplicationFormCustom/TermField.d.ts +2 -0
- package/dist/components/ApplicationFormCustom/TermField.js +10 -0
- package/dist/components/ApplicationFormCustom/TermField.js.map +1 -0
- package/dist/components/ApplicationFormCustom/UltraPremiumField.d.ts +4 -0
- package/dist/components/ApplicationFormCustom/UltraPremiumField.js +13 -0
- package/dist/components/ApplicationFormCustom/UltraPremiumField.js.map +1 -0
- package/dist/components/ApplicationFormCustom/getField.d.ts +4 -2
- package/dist/components/ApplicationFormCustom/getField.js +35 -14
- package/dist/components/ApplicationFormCustom/getField.js.map +1 -1
- package/dist/components/ApplicationFormCustom/getFormatData.js +15 -0
- package/dist/components/ApplicationFormCustom/getFormatData.js.map +1 -0
- package/dist/components/ApplicationFormCustom/getInitialFormState.d.ts +6 -0
- package/dist/components/ApplicationFormCustom/getInitialFormState.js +18 -3
- package/dist/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
- package/dist/components/ApplicationFormCustom/getObjectValidator.js +4 -0
- package/dist/components/ApplicationFormCustom/getObjectValidator.js.map +1 -1
- package/dist/components/ApplicationFormCustom/getPartnerComments.d.ts +2 -0
- package/dist/components/ApplicationFormCustom/getPartnerComments.js +16 -0
- package/dist/components/ApplicationFormCustom/getPartnerComments.js.map +1 -0
- package/dist/ui-kit/Input/InputPhoneControl.d.ts +2 -0
- package/{mobile/dist/components/ApplicationForm/PhoneInputControl.js → dist/ui-kit/Input/InputPhoneControl.js} +5 -5
- package/dist/ui-kit/Input/InputPhoneControl.js.map +1 -0
- package/dist/ui-kit/Pagination/PaginationContainer.js +2 -2
- package/dist/ui-kit/Pagination/PaginationContainer.js.map +1 -1
- package/dist/ui-kit/Pagination/shouldRenderPage.js +4 -4
- package/lib/components/ApplicationForm/ApplicationForm.fixture.d.ts +0 -5
- package/lib/components/ApplicationForm/ApplicationForm.fixture.mobile.d.ts +0 -5
- package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +1 -44
- package/lib/components/ApplicationForm/ApplicationFormFeedback.d.ts +5 -2
- package/lib/components/ApplicationForm/ApplicationFormFeedback.js +9 -7
- package/lib/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationFormsProps.d.ts +1 -2
- package/lib/components/ApplicationForm/EmbeddableForms.d.ts +0 -5
- package/lib/components/ApplicationForm/EmbeddableForms.js +0 -10
- package/lib/components/ApplicationForm/EmbeddableForms.js.map +1 -1
- package/lib/components/ApplicationForm/renderWedDataOrganization.js +3 -3
- package/lib/components/ApplicationForm/renderWedDataOrganization.js.map +1 -1
- package/lib/components/ApplicationFormCustom/AcquiringField.d.ts +5 -0
- package/lib/components/ApplicationFormCustom/AcquiringField.js +26 -0
- package/lib/components/ApplicationFormCustom/AcquiringField.js.map +1 -0
- package/lib/components/ApplicationFormCustom/AddressBranchField.d.ts +6 -0
- package/{mobile/lib/components/ApplicationForm → lib/components/ApplicationFormCustom}/AddressBranchField.js +12 -5
- package/lib/components/ApplicationFormCustom/AddressBranchField.js.map +1 -0
- package/lib/components/ApplicationFormCustom/AmountField.d.ts +2 -0
- package/lib/components/ApplicationFormCustom/AmountField.js +8 -0
- package/lib/components/ApplicationFormCustom/AmountField.js.map +1 -0
- package/lib/components/ApplicationFormCustom/ApplicationFormCustom.fixture.d.ts +5 -0
- package/lib/components/ApplicationFormCustom/ApplicationFormCustom.js +4 -4
- package/lib/components/ApplicationFormCustom/ApplicationFormCustom.js.map +1 -1
- package/lib/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +7 -4
- package/lib/components/ApplicationFormCustom/CommentField.d.ts +2 -0
- package/lib/components/ApplicationFormCustom/CommentField.js +7 -0
- package/lib/components/ApplicationFormCustom/CommentField.js.map +1 -0
- package/lib/components/ApplicationFormCustom/CustomFieldProps.d.ts +6 -0
- package/lib/components/ApplicationFormCustom/CustomFieldProps.js +2 -0
- package/lib/components/ApplicationFormCustom/CustomFieldProps.js.map +1 -0
- package/lib/components/ApplicationFormCustom/OnlineCheckoutField.d.ts +2 -0
- package/lib/components/ApplicationFormCustom/OnlineCheckoutField.js +6 -0
- package/lib/components/ApplicationFormCustom/OnlineCheckoutField.js.map +1 -0
- package/lib/components/ApplicationFormCustom/PosTerminalField.d.ts +2 -0
- package/lib/components/ApplicationFormCustom/PosTerminalField.js +6 -0
- package/lib/components/ApplicationFormCustom/PosTerminalField.js.map +1 -0
- package/lib/components/ApplicationFormCustom/RegionField.d.ts +2 -0
- package/lib/components/ApplicationFormCustom/RegionField.js +12 -0
- package/lib/components/ApplicationFormCustom/RegionField.js.map +1 -0
- package/lib/components/ApplicationFormCustom/RegionPremiumField.d.ts +2 -0
- package/{mobile/lib/components/ApplicationForm → lib/components/ApplicationFormCustom}/RegionPremiumField.js +7 -6
- package/lib/components/ApplicationFormCustom/RegionPremiumField.js.map +1 -0
- package/lib/components/ApplicationFormCustom/TermField.d.ts +2 -0
- package/lib/components/ApplicationFormCustom/TermField.js +8 -0
- package/lib/components/ApplicationFormCustom/TermField.js.map +1 -0
- package/lib/components/ApplicationFormCustom/UltraPremiumField.d.ts +4 -0
- package/lib/components/ApplicationFormCustom/UltraPremiumField.js +11 -0
- package/lib/components/ApplicationFormCustom/UltraPremiumField.js.map +1 -0
- package/lib/components/ApplicationFormCustom/getField.d.ts +4 -2
- package/lib/components/ApplicationFormCustom/getField.js +28 -8
- package/lib/components/ApplicationFormCustom/getField.js.map +1 -1
- package/lib/components/ApplicationFormCustom/getFormatData.js +12 -0
- package/lib/components/ApplicationFormCustom/getFormatData.js.map +1 -0
- package/lib/components/ApplicationFormCustom/getInitialFormState.d.ts +6 -0
- package/lib/components/ApplicationFormCustom/getInitialFormState.js +18 -3
- package/lib/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
- package/lib/components/ApplicationFormCustom/getObjectValidator.js +4 -0
- package/lib/components/ApplicationFormCustom/getObjectValidator.js.map +1 -1
- package/lib/components/ApplicationFormCustom/getPartnerComments.d.ts +2 -0
- package/lib/components/ApplicationFormCustom/getPartnerComments.js +13 -0
- package/lib/components/ApplicationFormCustom/getPartnerComments.js.map +1 -0
- package/lib/ui-kit/Input/InputPhoneControl.d.ts +2 -0
- package/lib/{components/ApplicationForm/PhoneInputControl.js → ui-kit/Input/InputPhoneControl.js} +4 -4
- package/lib/ui-kit/Input/InputPhoneControl.js.map +1 -0
- package/lib/ui-kit/Pagination/PaginationContainer.js +2 -2
- package/lib/ui-kit/Pagination/PaginationContainer.js.map +1 -1
- package/lib/ui-kit/Pagination/shouldRenderPage.js +4 -4
- package/mobile/bundle/bundle.umd.js +519 -619
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +1 -44
- package/mobile/bundle/components/ApplicationForm/ApplicationFormFeedback.d.ts +5 -2
- package/mobile/bundle/components/ApplicationForm/ApplicationFormsProps.d.ts +1 -2
- package/mobile/bundle/components/ApplicationForm/EmbeddableForms.d.ts +0 -5
- package/mobile/bundle/components/ApplicationFormCustom/AcquiringField.d.ts +5 -0
- package/mobile/bundle/components/ApplicationFormCustom/AddressBranchField.d.ts +6 -0
- package/mobile/bundle/components/ApplicationFormCustom/AmountField.d.ts +2 -0
- package/mobile/bundle/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +7 -4
- package/mobile/bundle/components/ApplicationFormCustom/CommentField.d.ts +2 -0
- package/mobile/bundle/components/ApplicationFormCustom/CustomFieldProps.d.ts +6 -0
- package/mobile/bundle/components/ApplicationFormCustom/OnlineCheckoutField.d.ts +2 -0
- package/mobile/bundle/components/ApplicationFormCustom/PosTerminalField.d.ts +2 -0
- package/mobile/bundle/components/ApplicationFormCustom/RegionField.d.ts +2 -0
- package/mobile/bundle/components/ApplicationFormCustom/RegionPremiumField.d.ts +2 -0
- package/mobile/bundle/components/ApplicationFormCustom/TermField.d.ts +2 -0
- package/mobile/bundle/components/ApplicationFormCustom/UltraPremiumField.d.ts +4 -0
- package/mobile/bundle/components/ApplicationFormCustom/getField.d.ts +4 -2
- package/mobile/bundle/components/ApplicationFormCustom/getInitialFormState.d.ts +6 -0
- package/mobile/bundle/components/ApplicationFormCustom/getPartnerComments.d.ts +2 -0
- package/mobile/bundle/ui-kit/Input/InputPhoneControl.d.ts +2 -0
- package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +1 -44
- package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.d.ts +5 -2
- package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.js +9 -7
- package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormsProps.d.ts +1 -2
- package/mobile/dist/components/ApplicationForm/EmbeddableForms.d.ts +0 -5
- package/mobile/dist/components/ApplicationForm/EmbeddableForms.js +0 -10
- package/mobile/dist/components/ApplicationForm/EmbeddableForms.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/renderWedDataOrganization.js +3 -3
- package/mobile/dist/components/ApplicationForm/renderWedDataOrganization.js.map +1 -1
- package/mobile/dist/components/ApplicationFormCustom/AcquiringField.d.ts +5 -0
- package/mobile/dist/components/ApplicationFormCustom/AcquiringField.js +29 -0
- package/mobile/dist/components/ApplicationFormCustom/AcquiringField.js.map +1 -0
- package/mobile/dist/components/ApplicationFormCustom/AddressBranchField.d.ts +6 -0
- package/mobile/dist/components/{ApplicationForm → ApplicationFormCustom}/AddressBranchField.js +12 -5
- package/mobile/dist/components/ApplicationFormCustom/AddressBranchField.js.map +1 -0
- package/mobile/dist/components/ApplicationFormCustom/AmountField.d.ts +2 -0
- package/mobile/dist/components/ApplicationFormCustom/AmountField.js +10 -0
- package/mobile/dist/components/ApplicationFormCustom/AmountField.js.map +1 -0
- package/mobile/dist/components/ApplicationFormCustom/ApplicationFormCustom.js +4 -4
- package/mobile/dist/components/ApplicationFormCustom/ApplicationFormCustom.js.map +1 -1
- package/mobile/dist/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +7 -4
- package/mobile/dist/components/ApplicationFormCustom/CommentField.d.ts +2 -0
- package/mobile/dist/components/ApplicationFormCustom/CommentField.js +9 -0
- package/mobile/dist/components/ApplicationFormCustom/CommentField.js.map +1 -0
- package/mobile/dist/components/ApplicationFormCustom/CustomFieldProps.d.ts +6 -0
- package/mobile/dist/components/{ApplicationForm/models.js → ApplicationFormCustom/CustomFieldProps.js} +1 -1
- package/mobile/dist/components/ApplicationFormCustom/CustomFieldProps.js.map +1 -0
- package/mobile/dist/components/ApplicationFormCustom/OnlineCheckoutField.d.ts +2 -0
- package/mobile/dist/components/ApplicationFormCustom/OnlineCheckoutField.js +8 -0
- package/mobile/dist/components/ApplicationFormCustom/OnlineCheckoutField.js.map +1 -0
- package/mobile/dist/components/ApplicationFormCustom/PosTerminalField.d.ts +2 -0
- package/mobile/dist/components/ApplicationFormCustom/PosTerminalField.js +8 -0
- package/mobile/dist/components/ApplicationFormCustom/PosTerminalField.js.map +1 -0
- package/mobile/dist/components/ApplicationFormCustom/RegionField.d.ts +2 -0
- package/mobile/dist/components/ApplicationFormCustom/RegionField.js +14 -0
- package/mobile/dist/components/ApplicationFormCustom/RegionField.js.map +1 -0
- package/mobile/dist/components/ApplicationFormCustom/RegionPremiumField.d.ts +2 -0
- package/{dist/components/ApplicationForm → mobile/dist/components/ApplicationFormCustom}/RegionPremiumField.js +7 -6
- package/mobile/dist/components/ApplicationFormCustom/RegionPremiumField.js.map +1 -0
- package/mobile/dist/components/ApplicationFormCustom/TermField.d.ts +2 -0
- package/mobile/dist/components/ApplicationFormCustom/TermField.js +10 -0
- package/mobile/dist/components/ApplicationFormCustom/TermField.js.map +1 -0
- package/mobile/dist/components/ApplicationFormCustom/UltraPremiumField.d.ts +4 -0
- package/mobile/dist/components/ApplicationFormCustom/UltraPremiumField.js +13 -0
- package/mobile/dist/components/ApplicationFormCustom/UltraPremiumField.js.map +1 -0
- package/mobile/dist/components/ApplicationFormCustom/getField.d.ts +4 -2
- package/mobile/dist/components/ApplicationFormCustom/getField.js +35 -14
- package/mobile/dist/components/ApplicationFormCustom/getField.js.map +1 -1
- package/mobile/dist/components/ApplicationFormCustom/getFormatData.js +15 -0
- package/mobile/dist/components/ApplicationFormCustom/getFormatData.js.map +1 -0
- package/mobile/dist/components/ApplicationFormCustom/getInitialFormState.d.ts +6 -0
- package/mobile/dist/components/ApplicationFormCustom/getInitialFormState.js +18 -3
- package/mobile/dist/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
- package/mobile/dist/components/ApplicationFormCustom/getObjectValidator.js +4 -0
- package/mobile/dist/components/ApplicationFormCustom/getObjectValidator.js.map +1 -1
- package/mobile/dist/components/ApplicationFormCustom/getPartnerComments.d.ts +2 -0
- package/mobile/dist/components/ApplicationFormCustom/getPartnerComments.js +16 -0
- package/mobile/dist/components/ApplicationFormCustom/getPartnerComments.js.map +1 -0
- package/mobile/dist/ui-kit/Input/InputPhoneControl.d.ts +2 -0
- package/{dist/components/ApplicationForm/PhoneInputControl.js → mobile/dist/ui-kit/Input/InputPhoneControl.js} +5 -5
- package/mobile/dist/ui-kit/Input/InputPhoneControl.js.map +1 -0
- package/mobile/dist/ui-kit/Pagination/PaginationContainer.js +2 -2
- package/mobile/dist/ui-kit/Pagination/PaginationContainer.js.map +1 -1
- package/mobile/dist/ui-kit/Pagination/shouldRenderPage.js +4 -4
- package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +1 -44
- package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.d.ts +5 -2
- package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.js +9 -7
- package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormsProps.d.ts +1 -2
- package/mobile/lib/components/ApplicationForm/EmbeddableForms.d.ts +0 -5
- package/mobile/lib/components/ApplicationForm/EmbeddableForms.js +0 -10
- package/mobile/lib/components/ApplicationForm/EmbeddableForms.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/renderWedDataOrganization.js +3 -3
- package/mobile/lib/components/ApplicationForm/renderWedDataOrganization.js.map +1 -1
- package/mobile/lib/components/ApplicationFormCustom/AcquiringField.d.ts +5 -0
- package/mobile/lib/components/ApplicationFormCustom/AcquiringField.js +26 -0
- package/mobile/lib/components/ApplicationFormCustom/AcquiringField.js.map +1 -0
- package/mobile/lib/components/ApplicationFormCustom/AddressBranchField.d.ts +6 -0
- package/{lib/components/ApplicationForm → mobile/lib/components/ApplicationFormCustom}/AddressBranchField.js +12 -5
- package/mobile/lib/components/ApplicationFormCustom/AddressBranchField.js.map +1 -0
- package/mobile/lib/components/ApplicationFormCustom/AmountField.d.ts +2 -0
- package/mobile/lib/components/ApplicationFormCustom/AmountField.js +8 -0
- package/mobile/lib/components/ApplicationFormCustom/AmountField.js.map +1 -0
- package/mobile/lib/components/ApplicationFormCustom/ApplicationFormCustom.js +4 -4
- package/mobile/lib/components/ApplicationFormCustom/ApplicationFormCustom.js.map +1 -1
- package/mobile/lib/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +7 -4
- package/mobile/lib/components/ApplicationFormCustom/CommentField.d.ts +2 -0
- package/mobile/lib/components/ApplicationFormCustom/CommentField.js +7 -0
- package/mobile/lib/components/ApplicationFormCustom/CommentField.js.map +1 -0
- package/mobile/lib/components/ApplicationFormCustom/CustomFieldProps.d.ts +6 -0
- package/mobile/lib/components/ApplicationFormCustom/CustomFieldProps.js +2 -0
- package/mobile/lib/components/ApplicationFormCustom/CustomFieldProps.js.map +1 -0
- package/mobile/lib/components/ApplicationFormCustom/OnlineCheckoutField.d.ts +2 -0
- package/mobile/lib/components/ApplicationFormCustom/OnlineCheckoutField.js +6 -0
- package/mobile/lib/components/ApplicationFormCustom/OnlineCheckoutField.js.map +1 -0
- package/mobile/lib/components/ApplicationFormCustom/PosTerminalField.d.ts +2 -0
- package/mobile/lib/components/ApplicationFormCustom/PosTerminalField.js +6 -0
- package/mobile/lib/components/ApplicationFormCustom/PosTerminalField.js.map +1 -0
- package/mobile/lib/components/ApplicationFormCustom/RegionField.d.ts +2 -0
- package/mobile/lib/components/ApplicationFormCustom/RegionField.js +12 -0
- package/mobile/lib/components/ApplicationFormCustom/RegionField.js.map +1 -0
- package/mobile/lib/components/ApplicationFormCustom/RegionPremiumField.d.ts +2 -0
- package/{lib/components/ApplicationForm → mobile/lib/components/ApplicationFormCustom}/RegionPremiumField.js +7 -6
- package/mobile/lib/components/ApplicationFormCustom/RegionPremiumField.js.map +1 -0
- package/mobile/lib/components/ApplicationFormCustom/TermField.d.ts +2 -0
- package/mobile/lib/components/ApplicationFormCustom/TermField.js +8 -0
- package/mobile/lib/components/ApplicationFormCustom/TermField.js.map +1 -0
- package/mobile/lib/components/ApplicationFormCustom/UltraPremiumField.d.ts +4 -0
- package/mobile/lib/components/ApplicationFormCustom/UltraPremiumField.js +11 -0
- package/mobile/lib/components/ApplicationFormCustom/UltraPremiumField.js.map +1 -0
- package/mobile/lib/components/ApplicationFormCustom/getField.d.ts +4 -2
- package/mobile/lib/components/ApplicationFormCustom/getField.js +28 -8
- package/mobile/lib/components/ApplicationFormCustom/getField.js.map +1 -1
- package/mobile/lib/components/ApplicationFormCustom/getFormatData.js +12 -0
- package/mobile/lib/components/ApplicationFormCustom/getFormatData.js.map +1 -0
- package/mobile/lib/components/ApplicationFormCustom/getInitialFormState.d.ts +6 -0
- package/mobile/lib/components/ApplicationFormCustom/getInitialFormState.js +18 -3
- package/mobile/lib/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
- package/mobile/lib/components/ApplicationFormCustom/getObjectValidator.js +4 -0
- package/mobile/lib/components/ApplicationFormCustom/getObjectValidator.js.map +1 -1
- package/mobile/lib/components/ApplicationFormCustom/getPartnerComments.d.ts +2 -0
- package/mobile/lib/components/ApplicationFormCustom/getPartnerComments.js +13 -0
- package/mobile/lib/components/ApplicationFormCustom/getPartnerComments.js.map +1 -0
- package/mobile/lib/ui-kit/Input/InputPhoneControl.d.ts +2 -0
- package/mobile/lib/{components/ApplicationForm/PhoneInputControl.js → ui-kit/Input/InputPhoneControl.js} +4 -4
- package/mobile/lib/ui-kit/Input/InputPhoneControl.js.map +1 -0
- package/mobile/lib/ui-kit/Pagination/PaginationContainer.js +2 -2
- package/mobile/lib/ui-kit/Pagination/PaginationContainer.js.map +1 -1
- package/mobile/lib/ui-kit/Pagination/shouldRenderPage.js +4 -4
- package/mobile/src/components/ApplicationForm/ApplicationForm.ui.json +0 -6
- package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +1 -60
- package/mobile/src/components/ApplicationForm/ApplicationFormFeedback.tsx +27 -13
- package/mobile/src/components/ApplicationForm/ApplicationFormsProps.ts +1 -2
- package/mobile/src/components/ApplicationForm/EmbeddableForms.tsx +0 -10
- package/mobile/src/components/ApplicationForm/renderWedDataOrganization.tsx +3 -3
- package/mobile/src/components/ApplicationFormCustom/AcquiringField.tsx +36 -0
- package/{src/components/ApplicationForm → mobile/src/components/ApplicationFormCustom}/AddressBranchField.tsx +15 -9
- package/mobile/src/components/ApplicationFormCustom/AmountField.tsx +17 -0
- package/mobile/src/components/ApplicationFormCustom/ApplicationFormCustom.example.json +221 -21
- package/mobile/src/components/ApplicationFormCustom/ApplicationFormCustom.tsx +13 -4
- package/mobile/src/components/ApplicationFormCustom/ApplicationFormCustom.ui.json +12 -1
- package/mobile/src/components/ApplicationFormCustom/ApplicationFormCustomContent.ts +18 -4
- package/mobile/src/components/ApplicationFormCustom/CommentField.tsx +14 -0
- package/mobile/src/components/ApplicationFormCustom/CustomFieldProps.ts +7 -0
- package/mobile/src/components/ApplicationFormCustom/OnlineCheckoutField.tsx +10 -0
- package/mobile/src/components/ApplicationFormCustom/PosTerminalField.tsx +10 -0
- package/mobile/src/components/ApplicationFormCustom/RegionField.tsx +24 -0
- package/mobile/src/components/ApplicationFormCustom/RegionPremiumField.tsx +29 -0
- package/mobile/src/components/ApplicationFormCustom/TermField.tsx +17 -0
- package/mobile/src/components/ApplicationFormCustom/UltraPremiumField.tsx +19 -0
- package/mobile/src/components/ApplicationFormCustom/getField.tsx +97 -69
- package/mobile/src/components/ApplicationFormCustom/getFormatData.tsx +25 -0
- package/mobile/src/components/ApplicationFormCustom/getInitialFormState.tsx +24 -3
- package/mobile/src/components/ApplicationFormCustom/getObjectValidator.tsx +4 -0
- package/mobile/src/components/ApplicationFormCustom/getPartnerComments.tsx +22 -0
- package/mobile/src/{components/ApplicationForm/PhoneInputControl.tsx → ui-kit/Input/InputPhoneControl.tsx} +4 -4
- package/mobile/src/ui-kit/Pagination/PaginationContainer.tsx +4 -4
- package/mobile/src/ui-kit/Pagination/shouldRenderPage.ts +4 -4
- package/package.json +1 -1
- package/src/components/ApplicationForm/ApplicationForm.fixture.mobile.tsx +1 -59
- package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +2 -61
- package/src/components/ApplicationForm/ApplicationForm.ui.json +0 -6
- package/src/components/ApplicationForm/ApplicationFormContent.ts +1 -60
- package/src/components/ApplicationForm/ApplicationFormFeedback.tsx +27 -13
- package/src/components/ApplicationForm/ApplicationFormsProps.ts +1 -2
- package/src/components/ApplicationForm/EmbeddableForms.tsx +0 -10
- package/src/components/ApplicationForm/renderWedDataOrganization.tsx +3 -3
- package/src/components/ApplicationFormCustom/AcquiringField.tsx +36 -0
- package/{mobile/src/components/ApplicationForm → src/components/ApplicationFormCustom}/AddressBranchField.tsx +15 -9
- package/src/components/ApplicationFormCustom/AmountField.tsx +17 -0
- package/src/components/ApplicationFormCustom/ApplicationFormCustom.example.json +221 -21
- package/src/components/ApplicationFormCustom/ApplicationFormCustom.fixture.tsx +175 -11
- package/src/components/ApplicationFormCustom/ApplicationFormCustom.tsx +13 -4
- package/src/components/ApplicationFormCustom/ApplicationFormCustom.ui.json +12 -1
- package/src/components/ApplicationFormCustom/ApplicationFormCustomContent.ts +18 -4
- package/src/components/ApplicationFormCustom/CommentField.tsx +14 -0
- package/src/components/ApplicationFormCustom/CustomFieldProps.ts +7 -0
- package/src/components/ApplicationFormCustom/OnlineCheckoutField.tsx +10 -0
- package/src/components/ApplicationFormCustom/PosTerminalField.tsx +10 -0
- package/src/components/ApplicationFormCustom/RegionField.tsx +24 -0
- package/src/components/ApplicationFormCustom/RegionPremiumField.tsx +29 -0
- package/src/components/ApplicationFormCustom/TermField.tsx +17 -0
- package/src/components/ApplicationFormCustom/UltraPremiumField.tsx +19 -0
- package/src/components/ApplicationFormCustom/getField.tsx +97 -69
- package/src/components/ApplicationFormCustom/getFormatData.tsx +25 -0
- package/src/components/ApplicationFormCustom/getInitialFormState.tsx +24 -3
- package/src/components/ApplicationFormCustom/getObjectValidator.tsx +4 -0
- package/src/components/ApplicationFormCustom/getPartnerComments.tsx +22 -0
- package/src/{components/ApplicationForm/PhoneInputControl.tsx → ui-kit/Input/InputPhoneControl.tsx} +4 -4
- package/src/ui-kit/Pagination/PaginationContainer.tsx +4 -4
- package/src/ui-kit/Pagination/shouldRenderPage.ts +4 -4
- package/bundle/components/ApplicationForm/AddressBranchField.d.ts +0 -8
- package/bundle/components/ApplicationForm/ApplicationFormAcquiring.d.ts +0 -14
- package/bundle/components/ApplicationForm/ApplicationFormCredit.d.ts +0 -16
- package/bundle/components/ApplicationForm/ApplicationFormDeposit.d.ts +0 -2
- package/bundle/components/ApplicationForm/ApplicationFormIndividuals.d.ts +0 -8
- package/bundle/components/ApplicationForm/ApplicationFormUltraPremium.d.ts +0 -14
- package/bundle/components/ApplicationForm/CreditParameters.d.ts +0 -6
- package/bundle/components/ApplicationForm/PhoneInputControl.d.ts +0 -2
- package/bundle/components/ApplicationForm/RegionField.d.ts +0 -8
- package/bundle/components/ApplicationForm/RegionPremiumField.d.ts +0 -6
- package/bundle/components/ApplicationForm/acquiringTypes.d.ts +0 -2
- package/bundle/components/ApplicationForm/models.d.ts +0 -5
- package/bundle/components/ApplicationForm/renderAcquiringDataOrganization.d.ts +0 -4
- package/bundle/components/ApplicationForm/renderAcquiringRegion.d.ts +0 -9
- package/bundle/components/ApplicationForm/renderCreditDataOrganization.d.ts +0 -4
- package/bundle/components/ApplicationForm/renderCreditParameters.d.ts +0 -4
- package/bundle/components/ApplicationForm/renderRegionDepartment.d.ts +0 -9
- package/bundle/components/ApplicationForm/renderUserData.d.ts +0 -15
- package/dist/components/ApplicationForm/AddressBranchField.d.ts +0 -8
- package/dist/components/ApplicationForm/AddressBranchField.js.map +0 -1
- package/dist/components/ApplicationForm/ApplicationFormAcquiring.d.ts +0 -14
- package/dist/components/ApplicationForm/ApplicationFormAcquiring.js +0 -53
- package/dist/components/ApplicationForm/ApplicationFormAcquiring.js.map +0 -1
- package/dist/components/ApplicationForm/ApplicationFormCredit.d.ts +0 -16
- package/dist/components/ApplicationForm/ApplicationFormCredit.js +0 -53
- package/dist/components/ApplicationForm/ApplicationFormCredit.js.map +0 -1
- package/dist/components/ApplicationForm/ApplicationFormDeposit.d.ts +0 -2
- package/dist/components/ApplicationForm/ApplicationFormDeposit.js +0 -36
- package/dist/components/ApplicationForm/ApplicationFormDeposit.js.map +0 -1
- package/dist/components/ApplicationForm/ApplicationFormIndividuals.d.ts +0 -8
- package/dist/components/ApplicationForm/ApplicationFormIndividuals.js +0 -45
- package/dist/components/ApplicationForm/ApplicationFormIndividuals.js.map +0 -1
- package/dist/components/ApplicationForm/ApplicationFormUltraPremium.d.ts +0 -14
- package/dist/components/ApplicationForm/ApplicationFormUltraPremium.js +0 -51
- package/dist/components/ApplicationForm/ApplicationFormUltraPremium.js.map +0 -1
- package/dist/components/ApplicationForm/CreditParameters.d.ts +0 -6
- package/dist/components/ApplicationForm/CreditParameters.js +0 -9
- package/dist/components/ApplicationForm/CreditParameters.js.map +0 -1
- package/dist/components/ApplicationForm/PhoneInputControl.d.ts +0 -2
- package/dist/components/ApplicationForm/PhoneInputControl.js.map +0 -1
- package/dist/components/ApplicationForm/RegionField.d.ts +0 -8
- package/dist/components/ApplicationForm/RegionField.js +0 -13
- package/dist/components/ApplicationForm/RegionField.js.map +0 -1
- package/dist/components/ApplicationForm/RegionPremiumField.d.ts +0 -6
- package/dist/components/ApplicationForm/RegionPremiumField.js.map +0 -1
- package/dist/components/ApplicationForm/acquiringTypes.d.ts +0 -2
- package/dist/components/ApplicationForm/acquiringTypes.js +0 -21
- package/dist/components/ApplicationForm/acquiringTypes.js.map +0 -1
- package/dist/components/ApplicationForm/getFormatData.js +0 -5
- package/dist/components/ApplicationForm/getFormatData.js.map +0 -1
- package/dist/components/ApplicationForm/models.d.ts +0 -5
- package/dist/components/ApplicationForm/models.js.map +0 -1
- package/dist/components/ApplicationForm/renderAcquiringDataOrganization.d.ts +0 -4
- package/dist/components/ApplicationForm/renderAcquiringDataOrganization.js +0 -11
- package/dist/components/ApplicationForm/renderAcquiringDataOrganization.js.map +0 -1
- package/dist/components/ApplicationForm/renderAcquiringRegion.d.ts +0 -9
- package/dist/components/ApplicationForm/renderAcquiringRegion.js +0 -12
- package/dist/components/ApplicationForm/renderAcquiringRegion.js.map +0 -1
- package/dist/components/ApplicationForm/renderCreditDataOrganization.d.ts +0 -4
- package/dist/components/ApplicationForm/renderCreditDataOrganization.js +0 -11
- package/dist/components/ApplicationForm/renderCreditDataOrganization.js.map +0 -1
- package/dist/components/ApplicationForm/renderCreditParameters.d.ts +0 -4
- package/dist/components/ApplicationForm/renderCreditParameters.js +0 -9
- package/dist/components/ApplicationForm/renderCreditParameters.js.map +0 -1
- package/dist/components/ApplicationForm/renderRegionDepartment.d.ts +0 -9
- package/dist/components/ApplicationForm/renderRegionDepartment.js +0 -9
- package/dist/components/ApplicationForm/renderRegionDepartment.js.map +0 -1
- package/dist/components/ApplicationForm/renderUserData.d.ts +0 -15
- package/dist/components/ApplicationForm/renderUserData.js +0 -15
- package/dist/components/ApplicationForm/renderUserData.js.map +0 -1
- package/lib/components/ApplicationForm/AddressBranchField.d.ts +0 -8
- package/lib/components/ApplicationForm/AddressBranchField.js.map +0 -1
- package/lib/components/ApplicationForm/ApplicationFormAcquiring.d.ts +0 -14
- package/lib/components/ApplicationForm/ApplicationFormAcquiring.js +0 -51
- package/lib/components/ApplicationForm/ApplicationFormAcquiring.js.map +0 -1
- package/lib/components/ApplicationForm/ApplicationFormCredit.d.ts +0 -16
- package/lib/components/ApplicationForm/ApplicationFormCredit.js +0 -51
- package/lib/components/ApplicationForm/ApplicationFormCredit.js.map +0 -1
- package/lib/components/ApplicationForm/ApplicationFormDeposit.d.ts +0 -2
- package/lib/components/ApplicationForm/ApplicationFormDeposit.js +0 -34
- package/lib/components/ApplicationForm/ApplicationFormDeposit.js.map +0 -1
- package/lib/components/ApplicationForm/ApplicationFormIndividuals.d.ts +0 -8
- package/lib/components/ApplicationForm/ApplicationFormIndividuals.js +0 -43
- package/lib/components/ApplicationForm/ApplicationFormIndividuals.js.map +0 -1
- package/lib/components/ApplicationForm/ApplicationFormUltraPremium.d.ts +0 -14
- package/lib/components/ApplicationForm/ApplicationFormUltraPremium.js +0 -49
- package/lib/components/ApplicationForm/ApplicationFormUltraPremium.js.map +0 -1
- package/lib/components/ApplicationForm/CreditParameters.d.ts +0 -6
- package/lib/components/ApplicationForm/CreditParameters.js +0 -7
- package/lib/components/ApplicationForm/CreditParameters.js.map +0 -1
- package/lib/components/ApplicationForm/PhoneInputControl.d.ts +0 -2
- package/lib/components/ApplicationForm/PhoneInputControl.js.map +0 -1
- package/lib/components/ApplicationForm/RegionField.d.ts +0 -8
- package/lib/components/ApplicationForm/RegionField.js +0 -11
- package/lib/components/ApplicationForm/RegionField.js.map +0 -1
- package/lib/components/ApplicationForm/RegionPremiumField.d.ts +0 -6
- package/lib/components/ApplicationForm/RegionPremiumField.js.map +0 -1
- package/lib/components/ApplicationForm/acquiringTypes.d.ts +0 -2
- package/lib/components/ApplicationForm/acquiringTypes.js +0 -19
- package/lib/components/ApplicationForm/acquiringTypes.js.map +0 -1
- package/lib/components/ApplicationForm/getFormatData.js +0 -2
- package/lib/components/ApplicationForm/getFormatData.js.map +0 -1
- package/lib/components/ApplicationForm/models.d.ts +0 -5
- package/lib/components/ApplicationForm/models.js +0 -2
- package/lib/components/ApplicationForm/models.js.map +0 -1
- package/lib/components/ApplicationForm/renderAcquiringDataOrganization.d.ts +0 -3
- package/lib/components/ApplicationForm/renderAcquiringDataOrganization.js +0 -8
- package/lib/components/ApplicationForm/renderAcquiringDataOrganization.js.map +0 -1
- package/lib/components/ApplicationForm/renderAcquiringRegion.d.ts +0 -8
- package/lib/components/ApplicationForm/renderAcquiringRegion.js +0 -9
- package/lib/components/ApplicationForm/renderAcquiringRegion.js.map +0 -1
- package/lib/components/ApplicationForm/renderCreditDataOrganization.d.ts +0 -3
- package/lib/components/ApplicationForm/renderCreditDataOrganization.js +0 -8
- package/lib/components/ApplicationForm/renderCreditDataOrganization.js.map +0 -1
- package/lib/components/ApplicationForm/renderCreditParameters.d.ts +0 -3
- package/lib/components/ApplicationForm/renderCreditParameters.js +0 -6
- package/lib/components/ApplicationForm/renderCreditParameters.js.map +0 -1
- package/lib/components/ApplicationForm/renderRegionDepartment.d.ts +0 -9
- package/lib/components/ApplicationForm/renderRegionDepartment.js +0 -6
- package/lib/components/ApplicationForm/renderRegionDepartment.js.map +0 -1
- package/lib/components/ApplicationForm/renderUserData.d.ts +0 -14
- package/lib/components/ApplicationForm/renderUserData.js +0 -12
- package/lib/components/ApplicationForm/renderUserData.js.map +0 -1
- package/mobile/bundle/components/ApplicationForm/AddressBranchField.d.ts +0 -8
- package/mobile/bundle/components/ApplicationForm/ApplicationFormAcquiring.d.ts +0 -14
- package/mobile/bundle/components/ApplicationForm/ApplicationFormCredit.d.ts +0 -16
- package/mobile/bundle/components/ApplicationForm/ApplicationFormDeposit.d.ts +0 -2
- package/mobile/bundle/components/ApplicationForm/ApplicationFormIndividuals.d.ts +0 -8
- package/mobile/bundle/components/ApplicationForm/ApplicationFormUltraPremium.d.ts +0 -14
- package/mobile/bundle/components/ApplicationForm/CreditParameters.d.ts +0 -6
- package/mobile/bundle/components/ApplicationForm/PhoneInputControl.d.ts +0 -2
- package/mobile/bundle/components/ApplicationForm/RegionField.d.ts +0 -8
- package/mobile/bundle/components/ApplicationForm/RegionPremiumField.d.ts +0 -6
- package/mobile/bundle/components/ApplicationForm/acquiringTypes.d.ts +0 -2
- package/mobile/bundle/components/ApplicationForm/models.d.ts +0 -5
- package/mobile/bundle/components/ApplicationForm/renderAcquiringDataOrganization.d.ts +0 -4
- package/mobile/bundle/components/ApplicationForm/renderAcquiringRegion.d.ts +0 -9
- package/mobile/bundle/components/ApplicationForm/renderCreditDataOrganization.d.ts +0 -4
- package/mobile/bundle/components/ApplicationForm/renderCreditParameters.d.ts +0 -4
- package/mobile/bundle/components/ApplicationForm/renderRegionDepartment.d.ts +0 -9
- package/mobile/bundle/components/ApplicationForm/renderUserData.d.ts +0 -15
- package/mobile/dist/components/ApplicationForm/AddressBranchField.d.ts +0 -8
- package/mobile/dist/components/ApplicationForm/AddressBranchField.js.map +0 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormAcquiring.d.ts +0 -14
- package/mobile/dist/components/ApplicationForm/ApplicationFormAcquiring.js +0 -53
- package/mobile/dist/components/ApplicationForm/ApplicationFormAcquiring.js.map +0 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormCredit.d.ts +0 -16
- package/mobile/dist/components/ApplicationForm/ApplicationFormCredit.js +0 -53
- package/mobile/dist/components/ApplicationForm/ApplicationFormCredit.js.map +0 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormDeposit.d.ts +0 -2
- package/mobile/dist/components/ApplicationForm/ApplicationFormDeposit.js +0 -36
- package/mobile/dist/components/ApplicationForm/ApplicationFormDeposit.js.map +0 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormIndividuals.d.ts +0 -8
- package/mobile/dist/components/ApplicationForm/ApplicationFormIndividuals.js +0 -45
- package/mobile/dist/components/ApplicationForm/ApplicationFormIndividuals.js.map +0 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormUltraPremium.d.ts +0 -14
- package/mobile/dist/components/ApplicationForm/ApplicationFormUltraPremium.js +0 -51
- package/mobile/dist/components/ApplicationForm/ApplicationFormUltraPremium.js.map +0 -1
- package/mobile/dist/components/ApplicationForm/CreditParameters.d.ts +0 -6
- package/mobile/dist/components/ApplicationForm/CreditParameters.js +0 -9
- package/mobile/dist/components/ApplicationForm/CreditParameters.js.map +0 -1
- package/mobile/dist/components/ApplicationForm/PhoneInputControl.d.ts +0 -2
- package/mobile/dist/components/ApplicationForm/PhoneInputControl.js.map +0 -1
- package/mobile/dist/components/ApplicationForm/RegionField.d.ts +0 -8
- package/mobile/dist/components/ApplicationForm/RegionField.js +0 -13
- package/mobile/dist/components/ApplicationForm/RegionField.js.map +0 -1
- package/mobile/dist/components/ApplicationForm/RegionPremiumField.d.ts +0 -6
- package/mobile/dist/components/ApplicationForm/RegionPremiumField.js.map +0 -1
- package/mobile/dist/components/ApplicationForm/acquiringTypes.d.ts +0 -2
- package/mobile/dist/components/ApplicationForm/acquiringTypes.js +0 -21
- package/mobile/dist/components/ApplicationForm/acquiringTypes.js.map +0 -1
- package/mobile/dist/components/ApplicationForm/getFormatData.js +0 -5
- package/mobile/dist/components/ApplicationForm/getFormatData.js.map +0 -1
- package/mobile/dist/components/ApplicationForm/models.d.ts +0 -5
- package/mobile/dist/components/ApplicationForm/models.js.map +0 -1
- package/mobile/dist/components/ApplicationForm/renderAcquiringDataOrganization.d.ts +0 -4
- package/mobile/dist/components/ApplicationForm/renderAcquiringDataOrganization.js +0 -11
- package/mobile/dist/components/ApplicationForm/renderAcquiringDataOrganization.js.map +0 -1
- package/mobile/dist/components/ApplicationForm/renderAcquiringRegion.d.ts +0 -9
- package/mobile/dist/components/ApplicationForm/renderAcquiringRegion.js +0 -12
- package/mobile/dist/components/ApplicationForm/renderAcquiringRegion.js.map +0 -1
- package/mobile/dist/components/ApplicationForm/renderCreditDataOrganization.d.ts +0 -4
- package/mobile/dist/components/ApplicationForm/renderCreditDataOrganization.js +0 -11
- package/mobile/dist/components/ApplicationForm/renderCreditDataOrganization.js.map +0 -1
- package/mobile/dist/components/ApplicationForm/renderCreditParameters.d.ts +0 -4
- package/mobile/dist/components/ApplicationForm/renderCreditParameters.js +0 -9
- package/mobile/dist/components/ApplicationForm/renderCreditParameters.js.map +0 -1
- package/mobile/dist/components/ApplicationForm/renderRegionDepartment.d.ts +0 -9
- package/mobile/dist/components/ApplicationForm/renderRegionDepartment.js +0 -9
- package/mobile/dist/components/ApplicationForm/renderRegionDepartment.js.map +0 -1
- package/mobile/dist/components/ApplicationForm/renderUserData.d.ts +0 -15
- package/mobile/dist/components/ApplicationForm/renderUserData.js +0 -15
- package/mobile/dist/components/ApplicationForm/renderUserData.js.map +0 -1
- package/mobile/lib/components/ApplicationForm/AddressBranchField.d.ts +0 -8
- package/mobile/lib/components/ApplicationForm/AddressBranchField.js.map +0 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormAcquiring.d.ts +0 -14
- package/mobile/lib/components/ApplicationForm/ApplicationFormAcquiring.js +0 -51
- package/mobile/lib/components/ApplicationForm/ApplicationFormAcquiring.js.map +0 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormCredit.d.ts +0 -16
- package/mobile/lib/components/ApplicationForm/ApplicationFormCredit.js +0 -51
- package/mobile/lib/components/ApplicationForm/ApplicationFormCredit.js.map +0 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormDeposit.d.ts +0 -2
- package/mobile/lib/components/ApplicationForm/ApplicationFormDeposit.js +0 -34
- package/mobile/lib/components/ApplicationForm/ApplicationFormDeposit.js.map +0 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormIndividuals.d.ts +0 -8
- package/mobile/lib/components/ApplicationForm/ApplicationFormIndividuals.js +0 -43
- package/mobile/lib/components/ApplicationForm/ApplicationFormIndividuals.js.map +0 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormUltraPremium.d.ts +0 -14
- package/mobile/lib/components/ApplicationForm/ApplicationFormUltraPremium.js +0 -49
- package/mobile/lib/components/ApplicationForm/ApplicationFormUltraPremium.js.map +0 -1
- package/mobile/lib/components/ApplicationForm/CreditParameters.d.ts +0 -6
- package/mobile/lib/components/ApplicationForm/CreditParameters.js +0 -7
- package/mobile/lib/components/ApplicationForm/CreditParameters.js.map +0 -1
- package/mobile/lib/components/ApplicationForm/PhoneInputControl.d.ts +0 -2
- package/mobile/lib/components/ApplicationForm/PhoneInputControl.js.map +0 -1
- package/mobile/lib/components/ApplicationForm/RegionField.d.ts +0 -8
- package/mobile/lib/components/ApplicationForm/RegionField.js +0 -11
- package/mobile/lib/components/ApplicationForm/RegionField.js.map +0 -1
- package/mobile/lib/components/ApplicationForm/RegionPremiumField.d.ts +0 -6
- package/mobile/lib/components/ApplicationForm/RegionPremiumField.js.map +0 -1
- package/mobile/lib/components/ApplicationForm/acquiringTypes.d.ts +0 -2
- package/mobile/lib/components/ApplicationForm/acquiringTypes.js +0 -19
- package/mobile/lib/components/ApplicationForm/acquiringTypes.js.map +0 -1
- package/mobile/lib/components/ApplicationForm/getFormatData.js +0 -2
- package/mobile/lib/components/ApplicationForm/getFormatData.js.map +0 -1
- package/mobile/lib/components/ApplicationForm/models.d.ts +0 -5
- package/mobile/lib/components/ApplicationForm/models.js +0 -2
- package/mobile/lib/components/ApplicationForm/models.js.map +0 -1
- package/mobile/lib/components/ApplicationForm/renderAcquiringDataOrganization.d.ts +0 -4
- package/mobile/lib/components/ApplicationForm/renderAcquiringDataOrganization.js +0 -8
- package/mobile/lib/components/ApplicationForm/renderAcquiringDataOrganization.js.map +0 -1
- package/mobile/lib/components/ApplicationForm/renderAcquiringRegion.d.ts +0 -9
- package/mobile/lib/components/ApplicationForm/renderAcquiringRegion.js +0 -9
- package/mobile/lib/components/ApplicationForm/renderAcquiringRegion.js.map +0 -1
- package/mobile/lib/components/ApplicationForm/renderCreditDataOrganization.d.ts +0 -4
- package/mobile/lib/components/ApplicationForm/renderCreditDataOrganization.js +0 -8
- package/mobile/lib/components/ApplicationForm/renderCreditDataOrganization.js.map +0 -1
- package/mobile/lib/components/ApplicationForm/renderCreditParameters.d.ts +0 -4
- package/mobile/lib/components/ApplicationForm/renderCreditParameters.js +0 -6
- package/mobile/lib/components/ApplicationForm/renderCreditParameters.js.map +0 -1
- package/mobile/lib/components/ApplicationForm/renderRegionDepartment.d.ts +0 -9
- package/mobile/lib/components/ApplicationForm/renderRegionDepartment.js +0 -6
- package/mobile/lib/components/ApplicationForm/renderRegionDepartment.js.map +0 -1
- package/mobile/lib/components/ApplicationForm/renderUserData.d.ts +0 -15
- package/mobile/lib/components/ApplicationForm/renderUserData.js +0 -12
- package/mobile/lib/components/ApplicationForm/renderUserData.js.map +0 -1
- package/mobile/src/components/ApplicationForm/ApplicationFormAcquiring.tsx +0 -90
- package/mobile/src/components/ApplicationForm/ApplicationFormCredit.tsx +0 -89
- package/mobile/src/components/ApplicationForm/ApplicationFormDeposit.tsx +0 -59
- package/mobile/src/components/ApplicationForm/ApplicationFormIndividuals.tsx +0 -83
- package/mobile/src/components/ApplicationForm/ApplicationFormUltraPremium.tsx +0 -112
- package/mobile/src/components/ApplicationForm/CreditParameters.ts +0 -6
- package/mobile/src/components/ApplicationForm/RegionField.tsx +0 -27
- package/mobile/src/components/ApplicationForm/RegionPremiumField.tsx +0 -28
- package/mobile/src/components/ApplicationForm/acquiringTypes.ts +0 -21
- package/mobile/src/components/ApplicationForm/getFormatData.tsx +0 -4
- package/mobile/src/components/ApplicationForm/models.ts +0 -5
- package/mobile/src/components/ApplicationForm/renderAcquiringDataOrganization.tsx +0 -26
- package/mobile/src/components/ApplicationForm/renderAcquiringRegion.tsx +0 -29
- package/mobile/src/components/ApplicationForm/renderCreditDataOrganization.tsx +0 -34
- package/mobile/src/components/ApplicationForm/renderCreditParameters.tsx +0 -38
- package/mobile/src/components/ApplicationForm/renderRegionDepartment.tsx +0 -21
- package/mobile/src/components/ApplicationForm/renderUserData.tsx +0 -36
- package/src/components/ApplicationForm/ApplicationFormAcquiring.tsx +0 -90
- package/src/components/ApplicationForm/ApplicationFormCredit.tsx +0 -89
- package/src/components/ApplicationForm/ApplicationFormDeposit.tsx +0 -59
- package/src/components/ApplicationForm/ApplicationFormIndividuals.tsx +0 -83
- package/src/components/ApplicationForm/ApplicationFormUltraPremium.tsx +0 -112
- package/src/components/ApplicationForm/CreditParameters.ts +0 -6
- package/src/components/ApplicationForm/RegionField.tsx +0 -27
- package/src/components/ApplicationForm/RegionPremiumField.tsx +0 -28
- package/src/components/ApplicationForm/acquiringTypes.ts +0 -21
- package/src/components/ApplicationForm/getFormatData.tsx +0 -4
- package/src/components/ApplicationForm/models.ts +0 -5
- package/src/components/ApplicationForm/renderAcquiringDataOrganization.tsx +0 -26
- package/src/components/ApplicationForm/renderAcquiringRegion.tsx +0 -29
- package/src/components/ApplicationForm/renderCreditDataOrganization.tsx +0 -34
- package/src/components/ApplicationForm/renderCreditParameters.tsx +0 -38
- package/src/components/ApplicationForm/renderRegionDepartment.tsx +0 -21
- package/src/components/ApplicationForm/renderUserData.tsx +0 -36
- /package/bundle/components/{ApplicationForm → ApplicationFormCustom}/getFormatData.d.ts +0 -0
- /package/dist/components/{ApplicationForm → ApplicationFormCustom}/getFormatData.d.ts +0 -0
- /package/lib/components/{ApplicationForm → ApplicationFormCustom}/getFormatData.d.ts +0 -0
- /package/mobile/bundle/components/{ApplicationForm → ApplicationFormCustom}/getFormatData.d.ts +0 -0
- /package/mobile/dist/components/{ApplicationForm → ApplicationFormCustom}/getFormatData.d.ts +0 -0
- /package/mobile/lib/components/{ApplicationForm → ApplicationFormCustom}/getFormatData.d.ts +0 -0
package/bundle/bundle.umd.js
CHANGED
|
@@ -916,19 +916,27 @@
|
|
|
916
916
|
];
|
|
917
917
|
};
|
|
918
918
|
|
|
919
|
-
const
|
|
920
|
-
|
|
921
|
-
const objectValidator = (validatorsMap) => (o) => (o &&
|
|
922
|
-
Object.entries(validatorsMap).flatMap(([key, validator]) => validator(o[key]))) ||
|
|
923
|
-
[];
|
|
924
|
-
|
|
925
|
-
const isValidationSuccess = (info) => !info?.length;
|
|
926
|
-
const validator = (predicate) => (message) => (_) => predicate(_) ? [] : [message];
|
|
919
|
+
const renderErrorText = (error) => (jsx("div", { className: "h-6", children: error ? (jsx(Text, { size: "text-xs", font: "font-light", color: "text-error", children: error })) : null }));
|
|
927
920
|
|
|
928
|
-
|
|
921
|
+
function useBool(defaultValue = false) {
|
|
922
|
+
const [value, setValue] = useState(defaultValue);
|
|
923
|
+
const setTrue = useCallback(() => setValue(true), []);
|
|
924
|
+
const setFalse = useCallback(() => setValue(false), []);
|
|
925
|
+
const toggle = useCallback(() => setValue(_ => !_), []);
|
|
926
|
+
return [value, { setValue, setTrue, setFalse, toggle }];
|
|
927
|
+
}
|
|
929
928
|
|
|
930
|
-
const
|
|
931
|
-
|
|
929
|
+
const formatDate = (date, toTimeStamp = false) => {
|
|
930
|
+
if (typeof date === 'string') {
|
|
931
|
+
return date.split('-').reverse().join('.');
|
|
932
|
+
}
|
|
933
|
+
else {
|
|
934
|
+
const day = String(date.getDate()).padStart(2, '0');
|
|
935
|
+
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
936
|
+
const year = toTimeStamp ? String(date.getFullYear()) : String(date.getFullYear()).slice(-2);
|
|
937
|
+
return toTimeStamp ? `${year}-${month}-${day}` : `${day}.${month}.${year}`;
|
|
938
|
+
}
|
|
939
|
+
};
|
|
932
940
|
|
|
933
941
|
const renderLabel = (label) => label ? (jsx(Text, { size: "text-m", color: "text-primary-text", font: "font-light", children: label })) : null;
|
|
934
942
|
|
|
@@ -951,66 +959,6 @@
|
|
|
951
959
|
? 'border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text'
|
|
952
960
|
: 'border-error';
|
|
953
961
|
|
|
954
|
-
const renderErrorText = (error) => (jsx("div", { className: "h-6", children: error ? (jsx(Text, { size: "text-xs", font: "font-light", color: "text-error", children: error })) : null }));
|
|
955
|
-
|
|
956
|
-
const InputControl = JSX(({ className, label, value = '', placeholder, error, onChange, onBlur, isTextarea, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(Input, { type: "text", "aria-label": label, label: label && rest?.errors ? `${label}*` : label, valid: Boolean(!error), value: value, onChange: onChange, onBlur: onBlur, isTextarea: isTextarea, placeholder: rest?.errors && !label ? `${placeholder}*` : placeholder }), renderErrorText(error)] })));
|
|
957
|
-
|
|
958
|
-
const withValidator = (props, validator) => {
|
|
959
|
-
const { value, isDirty } = props;
|
|
960
|
-
const errors = isDirty ? validator(value) : [];
|
|
961
|
-
return {
|
|
962
|
-
...props,
|
|
963
|
-
errors,
|
|
964
|
-
error: errors[0],
|
|
965
|
-
};
|
|
966
|
-
};
|
|
967
|
-
|
|
968
|
-
const ApplicationFieldsetLayout = JSX(({ title, children }) => (jsxs("fieldset", { className: "grid @xl:flex @xl:justify-between gap-m border-b border-b-main-divider @xl:border-none", children: [title ? (jsx("legend", { className: "w-full", children: jsx(Heading, { title: title, headingType: "h6", className: "@xl:text-center" }) })) : null, children] })));
|
|
969
|
-
const formChildrenStyle = '@xl:w-1/2 space-y-s';
|
|
970
|
-
|
|
971
|
-
const isPlaceholder = (_) => _ === '_';
|
|
972
|
-
const isDigit = (_) => /\d/.test(_);
|
|
973
|
-
const isWildcard = (_) => isPlaceholder(_) || isDigit(_);
|
|
974
|
-
const phonePattern = [...'+7 (___) ___-__-__'];
|
|
975
|
-
const firstPlaceholderIndex = phonePattern.findIndex(isPlaceholder);
|
|
976
|
-
const phoneWildcardIndicies = phonePattern.map((_, i) => isWildcard(_) ? phonePattern.slice(0, i).filter(isWildcard).length : -1);
|
|
977
|
-
function normalizePhone(phone) {
|
|
978
|
-
const phoneNumbers = phone.replace(/\D/g, '');
|
|
979
|
-
const applyPlaceholder = (_, i) => isDigit(_) ? _ : phoneNumbers.charAt(phoneWildcardIndicies[i]) || _;
|
|
980
|
-
const result = phonePattern.map(applyPlaceholder);
|
|
981
|
-
const resultLength = phoneWildcardIndicies.indexOf(phoneNumbers.length - 1) + 1;
|
|
982
|
-
return (resultLength ? result.slice(0, Math.max(firstPlaceholderIndex, resultLength)) : result).join('');
|
|
983
|
-
}
|
|
984
|
-
|
|
985
|
-
const PhoneInput = JSX(({ children, onChange, ...inputProps }) => {
|
|
986
|
-
const handleChange = useCallback((value) => onChange && onChange(normalizePhone(value)), [onChange]);
|
|
987
|
-
return (jsx(Input, { onChange: handleChange, onFocus: (event) => handleChange(event?.target?.value || ''), ...inputProps, children: children }));
|
|
988
|
-
});
|
|
989
|
-
|
|
990
|
-
const PhoneInputControl = JSX(({ className, label, value, error, onChange, onBlur, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(PhoneInput, { "aria-label": label, label: rest?.errors ? `${label}*` : label, valid: Boolean(!error), value: value, onChange: onChange, onBlur: onBlur, placeholder: "+7 (___) ___-__-__" }), renderErrorText(error)] })));
|
|
991
|
-
|
|
992
|
-
const pattern = (regexp) => validator((_) => typeof _ === 'string' && regexp.test(_));
|
|
993
|
-
|
|
994
|
-
const required = validator((_) => _ !== null && _ !== undefined && _ !== '');
|
|
995
|
-
|
|
996
|
-
const ERROR_MESSAGE = 'Некорректно заполненное поле';
|
|
997
|
-
const defaultValidator = required(ERROR_MESSAGE);
|
|
998
|
-
const defaultSelectValidator = validator((_) => _?.key && _?.key !== '')(ERROR_MESSAGE);
|
|
999
|
-
const nameValidator = validator((_) => typeof _ === 'string' && _.length > 1)(ERROR_MESSAGE);
|
|
1000
|
-
const innValidator = validator((_) => typeof _ === 'string' && (_.length === 10 || _.length === 12))(ERROR_MESSAGE);
|
|
1001
|
-
const phoneValidator = pattern(/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/)(ERROR_MESSAGE);
|
|
1002
|
-
const checkboxValidator = validator((_) => typeof _ === 'boolean' && _)(ERROR_MESSAGE);
|
|
1003
|
-
|
|
1004
|
-
const renderAcquiringDataOrganization = (field, title) => (jsxs(ApplicationFieldsetLayout, { title: title, children: [jsxs("div", { className: formChildrenStyle, children: [jsx(InputControl, { label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...withValidator(field('fullName'), defaultValidator) }), jsx(InputControl, { label: "\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0435 \u043B\u0438\u0446\u043E", ...withValidator(field('name'), nameValidator) })] }), jsxs("div", { className: formChildrenStyle, children: [jsx(InputControl, { label: "\u0418\u041D\u041D", ...withValidator(field('inn'), innValidator) }), jsx(PhoneInputControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) })] })] }));
|
|
1005
|
-
|
|
1006
|
-
function useBool(defaultValue = false) {
|
|
1007
|
-
const [value, setValue] = useState(defaultValue);
|
|
1008
|
-
const setTrue = useCallback(() => setValue(true), []);
|
|
1009
|
-
const setFalse = useCallback(() => setValue(false), []);
|
|
1010
|
-
const toggle = useCallback(() => setValue(_ => !_), []);
|
|
1011
|
-
return [value, { setValue, setTrue, setFalse, toggle }];
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
962
|
const formatOption = (_) => _?.text || _?.key || '';
|
|
1015
963
|
|
|
1016
964
|
function useEventListener(target, type, listener, options) {
|
|
@@ -1108,196 +1056,256 @@
|
|
|
1108
1056
|
const renderIcon$1 = (isOpen, iconVersion) => (jsx(Icon, { className: style('absolute right-3 flex self-center', isOpen ? '' : 'rotate-180'), iconVersion: iconVersion, name: "ArrowUpIcon", width: "16", height: "16" }));
|
|
1109
1057
|
const getStyle = (isBorder, valid, disabled) => style(isBorder ? 'border rounded-md ' : '', isBorder && !disabled ? 'hover:border-primary-hover' : '', disabled ? 'bg-main-divider' : 'cursor-pointer ', valid ? 'border-gray' : 'border-error');
|
|
1110
1058
|
|
|
1111
|
-
const
|
|
1112
|
-
|
|
1113
|
-
const ACQUIRING_TYPES = [
|
|
1114
|
-
{
|
|
1115
|
-
text: 'Торговый эквайринг',
|
|
1116
|
-
key: 'trade',
|
|
1117
|
-
},
|
|
1118
|
-
{
|
|
1119
|
-
text: 'СБП-эквайринг',
|
|
1120
|
-
key: 'sbp',
|
|
1121
|
-
},
|
|
1122
|
-
{
|
|
1123
|
-
text: 'Интернет-эквайринг',
|
|
1124
|
-
key: 'internet',
|
|
1125
|
-
},
|
|
1126
|
-
{
|
|
1127
|
-
text: 'Все виды эквайринга',
|
|
1128
|
-
key: 'all',
|
|
1129
|
-
},
|
|
1130
|
-
];
|
|
1131
|
-
|
|
1132
|
-
const isFilled = (_) => _ !== null && _ !== undefined;
|
|
1133
|
-
|
|
1134
|
-
const defaultCache = new Map();
|
|
1135
|
-
const applyCache = (fetcher, cache = defaultCache) => (args) => {
|
|
1136
|
-
const key = computeKey(args);
|
|
1137
|
-
const cachedData = cache.get(key);
|
|
1138
|
-
if (key && isFilled(cachedData)) {
|
|
1139
|
-
return cachedData;
|
|
1140
|
-
}
|
|
1141
|
-
const data = fetcher(...args);
|
|
1142
|
-
if (key && isFilled(data)) {
|
|
1143
|
-
cache.set(key, Promise.resolve(data));
|
|
1144
|
-
}
|
|
1145
|
-
return data;
|
|
1146
|
-
};
|
|
1147
|
-
const isKey = (args) => Boolean(args?.every(_ => (Array.isArray(_) ? isKey(_) : !_ || typeof _ === 'string')));
|
|
1148
|
-
const computeKey = (args) => (isKey(args) ? args.toString() : '');
|
|
1149
|
-
|
|
1150
|
-
const isFallbackKey = (args) => Boolean(args && Array.isArray(args) && args.length === 1 && typeof args[0] === 'string');
|
|
1151
|
-
function useAsyncData(key, fetcher, { fallback, cache } = {}) {
|
|
1152
|
-
const args = useMemo(() => keyToArgs(key), [key]);
|
|
1153
|
-
const [data, setData] = useState(undefined);
|
|
1154
|
-
const [error, setError] = useState(undefined);
|
|
1155
|
-
useEffect(() => {
|
|
1156
|
-
const isEmptyKey = !args.some(isFilled);
|
|
1157
|
-
if (isEmptyKey) {
|
|
1158
|
-
return;
|
|
1159
|
-
}
|
|
1160
|
-
let canceled = false;
|
|
1161
|
-
const setResult = (newData, err) => {
|
|
1162
|
-
if (!canceled) {
|
|
1163
|
-
setData(newData);
|
|
1164
|
-
setError(err);
|
|
1165
|
-
}
|
|
1166
|
-
};
|
|
1167
|
-
(async () => {
|
|
1168
|
-
try {
|
|
1169
|
-
setResult(await applyCache(fetcher, cache)(args));
|
|
1170
|
-
}
|
|
1171
|
-
catch (err) {
|
|
1172
|
-
setResult(undefined, err);
|
|
1173
|
-
}
|
|
1174
|
-
})();
|
|
1175
|
-
return () => {
|
|
1176
|
-
canceled = true;
|
|
1177
|
-
};
|
|
1178
|
-
}, [fetcher, cache, args]);
|
|
1179
|
-
const fallbackData = fallback && isFallbackKey(args) && fallback[args[0]];
|
|
1180
|
-
return {
|
|
1181
|
-
data: !data && fallbackData ? fallbackData : data,
|
|
1182
|
-
error,
|
|
1183
|
-
mutate: () => Promise.resolve(undefined) // TODO Clean up cache
|
|
1184
|
-
};
|
|
1185
|
-
}
|
|
1186
|
-
function keyToArgs(key) {
|
|
1187
|
-
if (Array.isArray(key)) {
|
|
1188
|
-
return key;
|
|
1189
|
-
}
|
|
1190
|
-
else if (key instanceof Function) {
|
|
1191
|
-
return keyToArgs(key());
|
|
1192
|
-
}
|
|
1193
|
-
else {
|
|
1194
|
-
return [key];
|
|
1195
|
-
}
|
|
1196
|
-
}
|
|
1197
|
-
|
|
1198
|
-
const REGIONS_URL$1 = '/api/v1/regions';
|
|
1199
|
-
function useRegions() {
|
|
1200
|
-
const { data } = useAsyncData(REGIONS_URL$1, fetchJSONUnsafe);
|
|
1201
|
-
return data || [];
|
|
1202
|
-
}
|
|
1203
|
-
|
|
1204
|
-
const getNamesFromInput = (inputs) => Object.values(inputs).map((_) => _.name);
|
|
1205
|
-
|
|
1206
|
-
const validatorObj = {
|
|
1207
|
-
typeForm: defaultValidator,
|
|
1208
|
-
surname: nameValidator,
|
|
1209
|
-
name: nameValidator,
|
|
1210
|
-
region: defaultSelectValidator,
|
|
1211
|
-
phone: phoneValidator,
|
|
1212
|
-
birthday: defaultValidator,
|
|
1213
|
-
email: defaultValidator,
|
|
1214
|
-
fullName: defaultValidator,
|
|
1215
|
-
inn: innValidator,
|
|
1216
|
-
partnerComments: defaultValidator,
|
|
1217
|
-
comment: defaultValidator,
|
|
1218
|
-
consentDataProcessing: checkboxValidator,
|
|
1059
|
+
const noop = () => {
|
|
1060
|
+
// Do nothing
|
|
1219
1061
|
};
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1062
|
+
|
|
1063
|
+
const DAY_COUNT = 6;
|
|
1064
|
+
const WEEK_COUNT = 7;
|
|
1065
|
+
const renderCalendarCells = ({ today, firstDayOfWeek, totalDays, currentMonth, currentYear, min, max, onDateClick, }) => {
|
|
1066
|
+
const calendarCells = [];
|
|
1067
|
+
let dayCounter = 1;
|
|
1068
|
+
for (let i = 0; i < DAY_COUNT; i++) {
|
|
1069
|
+
const rowCells = [];
|
|
1070
|
+
for (let j = 0; j < WEEK_COUNT; j++) {
|
|
1071
|
+
if (i === 0 && j < firstDayOfWeek) {
|
|
1072
|
+
rowCells.push(jsx("td", {}, `empty-${j}`));
|
|
1073
|
+
}
|
|
1074
|
+
else if (dayCounter > totalDays) {
|
|
1075
|
+
rowCells.push(jsx("td", {}, `empty-${j}`));
|
|
1076
|
+
}
|
|
1077
|
+
else {
|
|
1078
|
+
const currentDate = new Date(currentYear, currentMonth, dayCounter);
|
|
1079
|
+
const isToday = checkIsToday(currentDate, today);
|
|
1080
|
+
const isDisabled = checkIsDisabled(currentDate, min, max);
|
|
1081
|
+
rowCells.push(jsx("td", { children: jsx("div", { className: getDayStyles(isToday, isDisabled), onClick: () => !isDisabled && onDateClick(currentDate), children: dayCounter }) }, `day-${dayCounter}`));
|
|
1082
|
+
dayCounter++;
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
calendarCells.push(jsx("tr", { children: rowCells }, `row-${i}`));
|
|
1086
|
+
}
|
|
1087
|
+
return calendarCells;
|
|
1223
1088
|
};
|
|
1089
|
+
const checkIsToday = (currentDate, today) => today && currentDate.toDateString() === today.toDateString();
|
|
1090
|
+
const checkIsDisabled = (currentDate, min, max) => (min && currentDate.getTime() < min.getTime()) || (max && currentDate.getTime() > max.getTime());
|
|
1091
|
+
const getDayStyles = (isToday, isDisabled) => style('p-s text-center rounded-md border', isToday ? '' : 'border-transparent hover:bg-gray', isDisabled ? 'text-gray hover:bg-transparent' : 'cursor-pointer');
|
|
1224
1092
|
|
|
1225
|
-
const
|
|
1226
|
-
|
|
1227
|
-
|
|
1093
|
+
const WEEK_DAYS = ['Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс'];
|
|
1094
|
+
const Calendar = JSX(({ today, currentMonth, currentYear, min, max, onDateSelect = noop }) => {
|
|
1095
|
+
const handleDateClick = useCallback((date) => onDateSelect(date), []);
|
|
1096
|
+
const { firstDayOfWeek, totalDays } = useMemo(() => ({
|
|
1097
|
+
firstDayOfWeek: new Date(currentYear, currentMonth, 1).getDay() - 1,
|
|
1098
|
+
totalDays: new Date(currentYear, currentMonth + 1, 0).getDate(),
|
|
1099
|
+
}), [currentYear, currentMonth]);
|
|
1100
|
+
return (jsxs("table", { className: "mx-auto", children: [jsx("thead", { className: "text-gray font-light", children: jsx("tr", { children: WEEK_DAYS.map((day, index) => (jsx("th", { className: "p-s", children: day }, String(index)))) }) }), jsx("tbody", { children: renderCalendarCells({
|
|
1101
|
+
firstDayOfWeek,
|
|
1102
|
+
today,
|
|
1103
|
+
totalDays,
|
|
1104
|
+
currentYear,
|
|
1105
|
+
currentMonth,
|
|
1106
|
+
min,
|
|
1107
|
+
max,
|
|
1108
|
+
onDateClick: handleDateClick,
|
|
1109
|
+
}) })] }));
|
|
1228
1110
|
});
|
|
1229
1111
|
|
|
1230
|
-
const
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1112
|
+
const months = [
|
|
1113
|
+
'Январь',
|
|
1114
|
+
'Февраль',
|
|
1115
|
+
'Март',
|
|
1116
|
+
'Апрель',
|
|
1117
|
+
'Май',
|
|
1118
|
+
'Июнь',
|
|
1119
|
+
'Июль',
|
|
1120
|
+
'Август',
|
|
1121
|
+
'Сентябрь',
|
|
1122
|
+
'Октябрь',
|
|
1123
|
+
'Ноябрь',
|
|
1124
|
+
'Декабрь',
|
|
1125
|
+
];
|
|
1243
1126
|
|
|
1244
|
-
const
|
|
1245
|
-
const
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1127
|
+
const START_YEAR = 1940;
|
|
1128
|
+
const getYears = () => Array.from({ length: new Date().getFullYear() - START_YEAR + 1 }, (_, i) => START_YEAR + i);
|
|
1129
|
+
|
|
1130
|
+
const MONTHS_COUNT = 11;
|
|
1131
|
+
const MONTHS_OPTIONS = months.map((key) => ({ key }));
|
|
1132
|
+
const YEARS_OPTIONS = getYears()
|
|
1133
|
+
.reverse()
|
|
1134
|
+
.map((key) => ({ key: String(key) }));
|
|
1135
|
+
const useDatePickerManager = ({ onShowCalendar, showCalendar, selectedMonth, onMonthSelect, onYearSelect, selectedYear, }) => {
|
|
1136
|
+
const close = useCallback(() => showCalendar && onShowCalendar(false), [showCalendar]);
|
|
1137
|
+
const ref = useOutsideClick(close);
|
|
1138
|
+
const handleChangeVisibleCalendar = useCallback(() => onShowCalendar(!showCalendar), [showCalendar]);
|
|
1139
|
+
const handleNextMonth = useCallback(() => {
|
|
1140
|
+
if (selectedMonth + 1 <= MONTHS_COUNT) {
|
|
1141
|
+
onMonthSelect(selectedMonth + 1);
|
|
1142
|
+
}
|
|
1143
|
+
else {
|
|
1144
|
+
onMonthSelect(0);
|
|
1145
|
+
onYearSelect(selectedYear + 1);
|
|
1146
|
+
}
|
|
1147
|
+
}, [selectedMonth]);
|
|
1148
|
+
const handlePrevMonth = useCallback(() => {
|
|
1149
|
+
if (selectedMonth - 1 >= 0) {
|
|
1150
|
+
onMonthSelect(selectedMonth - 1);
|
|
1151
|
+
}
|
|
1152
|
+
else {
|
|
1153
|
+
onMonthSelect(11);
|
|
1154
|
+
onYearSelect(selectedYear - 1);
|
|
1155
|
+
}
|
|
1156
|
+
}, [selectedMonth]);
|
|
1157
|
+
const handleSelectMonth = useCallback(({ key }) => onMonthSelect(months.indexOf(key)), []);
|
|
1158
|
+
const handleSelectYear = useCallback(({ key }) => onYearSelect(Number(key)), []);
|
|
1159
|
+
return {
|
|
1160
|
+
handleChangeVisibleCalendar,
|
|
1161
|
+
handleNextMonth,
|
|
1162
|
+
handlePrevMonth,
|
|
1163
|
+
handleSelectMonth,
|
|
1164
|
+
handleSelectYear,
|
|
1165
|
+
monthsOptions: MONTHS_OPTIONS,
|
|
1166
|
+
yearsOptions: YEARS_OPTIONS,
|
|
1167
|
+
ref,
|
|
1168
|
+
};
|
|
1249
1169
|
};
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1170
|
+
|
|
1171
|
+
const ICON_PROPS = {
|
|
1172
|
+
name: 'ArrowUpIcon',
|
|
1173
|
+
iconVersion: 'black',
|
|
1174
|
+
width: '24',
|
|
1175
|
+
height: '24',
|
|
1253
1176
|
};
|
|
1254
|
-
const
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1177
|
+
const SELECT_PROPS = {
|
|
1178
|
+
className: 'min-w-32',
|
|
1179
|
+
iconVersion: 'black',
|
|
1180
|
+
isBorder: false,
|
|
1181
|
+
};
|
|
1182
|
+
const formStyle$1 = 'flex justify-between items-center h-14 px-m py-s border rounded-md cursor-pointer ' +
|
|
1183
|
+
'hover:border-black active:border-black focus:border-black';
|
|
1184
|
+
const DatePicker = JSX(({ className = '', label = '', value, valid = true, minDate, maxDate, onChange }) => {
|
|
1185
|
+
const [showCalendar, { setValue }] = useBool(false);
|
|
1186
|
+
const [selectedMonth, setSelectedMonth] = useState(value?.getMonth() || new Date().getMonth());
|
|
1187
|
+
const [selectedYear, setSelectedYear] = useState(value?.getFullYear() || new Date().getFullYear());
|
|
1188
|
+
const { handlePrevMonth, handleNextMonth, handleSelectMonth, handleSelectYear, monthsOptions, yearsOptions, handleChangeVisibleCalendar, ref, } = useDatePickerManager({
|
|
1189
|
+
onYearSelect: setSelectedYear,
|
|
1190
|
+
onMonthSelect: setSelectedMonth,
|
|
1191
|
+
onShowCalendar: setValue,
|
|
1192
|
+
selectedYear,
|
|
1193
|
+
selectedMonth,
|
|
1194
|
+
showCalendar,
|
|
1195
|
+
});
|
|
1196
|
+
return (jsxs("div", { className: style('space-y-xs', className), ref: ref, children: [renderLabel(label), jsxs("div", { className: "relative", children: [renderDatePickerForm(handleChangeVisibleCalendar, value, valid), showCalendar ? (jsxs("div", { className: "absolute bg-white z-20 select-none", children: [jsxs("div", { className: "flex gap-s", children: [jsx("div", { className: "my-auto", onClick: handlePrevMonth, children: jsx(Icon, { ...ICON_PROPS, className: "-rotate-90 cursor-pointer" }) }), jsx(Select, { onChange: handleSelectMonth, value: { key: months[selectedMonth] }, options: monthsOptions, ...SELECT_PROPS }), jsx(Select, { onChange: handleSelectYear, value: { key: String(selectedYear) }, options: yearsOptions, ...SELECT_PROPS }), jsx("div", { className: "my-auto", onClick: handleNextMonth, children: jsx(Icon, { ...ICON_PROPS, className: "rotate-90 cursor-pointer" }) })] }), jsx(Calendar, { today: value, currentMonth: selectedMonth, currentYear: selectedYear, onDateSelect: onChange, min: minDate, max: maxDate })] })) : null] })] }));
|
|
1260
1197
|
});
|
|
1198
|
+
const renderDatePickerForm = (handleChangeVisibleCalendar, value, valid) => (jsxs("div", { onClick: handleChangeVisibleCalendar, className: style(formStyle$1, valid ? 'border-gray' : 'border-error'), children: [jsx(Paragraph, { children: value && formatDate(value) }), jsx(Icon, { ...ICON_PROPS, name: "CalendarIcon" })] }));
|
|
1261
1199
|
|
|
1262
|
-
const
|
|
1200
|
+
const DatePickerControl = JSX(({ className, label, error, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(DatePicker, { label: label && rest?.errors ? `${label}*` : label, valid: Boolean(!error), ...rest }), renderErrorText(error)] })));
|
|
1263
1201
|
|
|
1264
|
-
const
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
const { button, link, onSubmit } = props;
|
|
1284
|
-
const handleSubmit = useCallback((formState) => {
|
|
1285
|
-
const { acquiringType, onlineCheckout, posTerminal, ...usedForm } = formState;
|
|
1286
|
-
const isTradeAcquiring = getSlideCheckboxes(acquiringType?.key);
|
|
1287
|
-
const partnerComments = `Вид эквайринга=${acquiringType?.text || ''}${isTradeAcquiring
|
|
1288
|
-
? `/Онлайн касса=${onlineCheckout}/POS-терминал=${posTerminal}`
|
|
1289
|
-
: '/Онлайн касса=false/POS-терминал=false'}`;
|
|
1290
|
-
const submitData = {
|
|
1291
|
-
partnerComments,
|
|
1292
|
-
...usedForm,
|
|
1293
|
-
};
|
|
1294
|
-
isValidationSuccess(acquiringValidator(formState)) && onSubmit(submitData, false);
|
|
1295
|
-
}, [onSubmit]);
|
|
1296
|
-
const [, { field, ...formProps }] = useForm(initialFormState$7, { onSubmit: handleSubmit });
|
|
1297
|
-
const isSlideCheckboxes = getSlideCheckboxes(field('acquiringType').value?.key);
|
|
1298
|
-
return (jsxs("form", { className: formStyle$1, onSubmit: formProps.onSubmit, children: [renderAcquiringRegion({ field, title: 'Вид эквайринга и регион' }), renderAcquiringDataOrganization(field, 'Данные организации'), isSlideCheckboxes ? (jsxs("div", { role: "radiogroup", children: [jsx(SlideCheckbox, { type: "radio", text: "\u0425\u043E\u0447\u0443 \u043E\u043D\u043B\u0430\u0439\u043D-\u043A\u0430\u0441\u0441\u0443", ...field('onlineCheckout') }), jsx(SlideCheckbox, { type: "radio", text: "\u0425\u043E\u0447\u0443 \u043A\u0443\u043F\u0438\u0442\u044C POS-\u0442\u0435\u0440\u043C\u0438\u043D\u0430\u043B", ...field('posTerminal') })] })) : null, renderSubmitButton(button), jsx(Footnote, { link: link })] }));
|
|
1202
|
+
const InputControl = JSX(({ className, label, value = '', placeholder, error, onChange, onBlur, isTextarea, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(Input, { type: "text", "aria-label": label, label: label && rest?.errors ? `${label}*` : label, valid: Boolean(!error), value: value, onChange: onChange, onBlur: onBlur, isTextarea: isTextarea, placeholder: rest?.errors && !label ? `${placeholder}*` : placeholder }), renderErrorText(error)] })));
|
|
1203
|
+
|
|
1204
|
+
const isPlaceholder = (_) => _ === '_';
|
|
1205
|
+
const isDigit = (_) => /\d/.test(_);
|
|
1206
|
+
const isWildcard = (_) => isPlaceholder(_) || isDigit(_);
|
|
1207
|
+
const phonePattern = [...'+7 (___) ___-__-__'];
|
|
1208
|
+
const firstPlaceholderIndex = phonePattern.findIndex(isPlaceholder);
|
|
1209
|
+
const phoneWildcardIndicies = phonePattern.map((_, i) => isWildcard(_) ? phonePattern.slice(0, i).filter(isWildcard).length : -1);
|
|
1210
|
+
function normalizePhone(phone) {
|
|
1211
|
+
const phoneNumbers = phone.replace(/\D/g, '');
|
|
1212
|
+
const applyPlaceholder = (_, i) => isDigit(_) ? _ : phoneNumbers.charAt(phoneWildcardIndicies[i]) || _;
|
|
1213
|
+
const result = phonePattern.map(applyPlaceholder);
|
|
1214
|
+
const resultLength = phoneWildcardIndicies.indexOf(phoneNumbers.length - 1) + 1;
|
|
1215
|
+
return (resultLength ? result.slice(0, Math.max(firstPlaceholderIndex, resultLength)) : result).join('');
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
const PhoneInput = JSX(({ children, onChange, ...inputProps }) => {
|
|
1219
|
+
const handleChange = useCallback((value) => onChange && onChange(normalizePhone(value)), [onChange]);
|
|
1220
|
+
return (jsx(Input, { onChange: handleChange, onFocus: (event) => handleChange(event?.target?.value || ''), ...inputProps, children: children }));
|
|
1299
1221
|
});
|
|
1300
|
-
|
|
1222
|
+
|
|
1223
|
+
const InputPhoneControl = JSX(({ className, label, value, error, onChange, onBlur, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(PhoneInput, { "aria-label": label, label: rest?.errors ? `${label}*` : label, valid: Boolean(!error), value: value, onChange: onChange, onBlur: onBlur, placeholder: "+7 (___) ___-__-__" }), renderErrorText(error)] })));
|
|
1224
|
+
|
|
1225
|
+
const SelectControl = JSX(({ className = '', label, error, ...rest }) => (jsxs("div", { className: className, children: [jsx(Select, { ...rest, valid: !error, label: rest?.errors ? `${label}*` : label }), renderErrorText(error)] })));
|
|
1226
|
+
|
|
1227
|
+
const objectValidator = (validatorsMap) => (o) => (o &&
|
|
1228
|
+
Object.entries(validatorsMap).flatMap(([key, validator]) => validator(o[key]))) ||
|
|
1229
|
+
[];
|
|
1230
|
+
|
|
1231
|
+
const isValidationSuccess = (info) => !info?.length;
|
|
1232
|
+
const validator = (predicate) => (message) => (_) => predicate(_) ? [] : [message];
|
|
1233
|
+
|
|
1234
|
+
const withValidator = (props, validator) => {
|
|
1235
|
+
const { value, isDirty } = props;
|
|
1236
|
+
const errors = isDirty ? validator(value) : [];
|
|
1237
|
+
return {
|
|
1238
|
+
...props,
|
|
1239
|
+
errors,
|
|
1240
|
+
error: errors[0],
|
|
1241
|
+
};
|
|
1242
|
+
};
|
|
1243
|
+
|
|
1244
|
+
const isFilled = (_) => _ !== null && _ !== undefined;
|
|
1245
|
+
|
|
1246
|
+
const defaultCache = new Map();
|
|
1247
|
+
const applyCache = (fetcher, cache = defaultCache) => (args) => {
|
|
1248
|
+
const key = computeKey(args);
|
|
1249
|
+
const cachedData = cache.get(key);
|
|
1250
|
+
if (key && isFilled(cachedData)) {
|
|
1251
|
+
return cachedData;
|
|
1252
|
+
}
|
|
1253
|
+
const data = fetcher(...args);
|
|
1254
|
+
if (key && isFilled(data)) {
|
|
1255
|
+
cache.set(key, Promise.resolve(data));
|
|
1256
|
+
}
|
|
1257
|
+
return data;
|
|
1258
|
+
};
|
|
1259
|
+
const isKey = (args) => Boolean(args?.every(_ => (Array.isArray(_) ? isKey(_) : !_ || typeof _ === 'string')));
|
|
1260
|
+
const computeKey = (args) => (isKey(args) ? args.toString() : '');
|
|
1261
|
+
|
|
1262
|
+
const isFallbackKey = (args) => Boolean(args && Array.isArray(args) && args.length === 1 && typeof args[0] === 'string');
|
|
1263
|
+
function useAsyncData(key, fetcher, { fallback, cache } = {}) {
|
|
1264
|
+
const args = useMemo(() => keyToArgs(key), [key]);
|
|
1265
|
+
const [data, setData] = useState(undefined);
|
|
1266
|
+
const [error, setError] = useState(undefined);
|
|
1267
|
+
useEffect(() => {
|
|
1268
|
+
const isEmptyKey = !args.some(isFilled);
|
|
1269
|
+
if (isEmptyKey) {
|
|
1270
|
+
return;
|
|
1271
|
+
}
|
|
1272
|
+
let canceled = false;
|
|
1273
|
+
const setResult = (newData, err) => {
|
|
1274
|
+
if (!canceled) {
|
|
1275
|
+
setData(newData);
|
|
1276
|
+
setError(err);
|
|
1277
|
+
}
|
|
1278
|
+
};
|
|
1279
|
+
(async () => {
|
|
1280
|
+
try {
|
|
1281
|
+
setResult(await applyCache(fetcher, cache)(args));
|
|
1282
|
+
}
|
|
1283
|
+
catch (err) {
|
|
1284
|
+
setResult(undefined, err);
|
|
1285
|
+
}
|
|
1286
|
+
})();
|
|
1287
|
+
return () => {
|
|
1288
|
+
canceled = true;
|
|
1289
|
+
};
|
|
1290
|
+
}, [fetcher, cache, args]);
|
|
1291
|
+
const fallbackData = fallback && isFallbackKey(args) && fallback[args[0]];
|
|
1292
|
+
return {
|
|
1293
|
+
data: !data && fallbackData ? fallbackData : data,
|
|
1294
|
+
error,
|
|
1295
|
+
mutate: () => Promise.resolve(undefined) // TODO Clean up cache
|
|
1296
|
+
};
|
|
1297
|
+
}
|
|
1298
|
+
function keyToArgs(key) {
|
|
1299
|
+
if (Array.isArray(key)) {
|
|
1300
|
+
return key;
|
|
1301
|
+
}
|
|
1302
|
+
else if (key instanceof Function) {
|
|
1303
|
+
return keyToArgs(key());
|
|
1304
|
+
}
|
|
1305
|
+
else {
|
|
1306
|
+
return [key];
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1301
1309
|
|
|
1302
1310
|
const BRANCHES_URL = '/api/v1/branches';
|
|
1303
1311
|
const EMPTY_VALUE$3 = [];
|
|
@@ -1310,31 +1318,100 @@
|
|
|
1310
1318
|
return result || EMPTY_VALUE$3;
|
|
1311
1319
|
};
|
|
1312
1320
|
|
|
1313
|
-
const REGIONS_URL = '/api/v1/premiumBranchesByRegions';
|
|
1321
|
+
const REGIONS_URL$1 = '/api/v1/premiumBranchesByRegions';
|
|
1314
1322
|
function usePremiumBranchesByRegions() {
|
|
1315
|
-
const { data } = useAsyncData(REGIONS_URL, fetchJSONUnsafe);
|
|
1323
|
+
const { data } = useAsyncData(REGIONS_URL$1, fetchJSONUnsafe);
|
|
1316
1324
|
return data || [];
|
|
1317
1325
|
}
|
|
1318
1326
|
|
|
1319
|
-
const
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
return (jsx(SelectControl, { label: "\u0410\u0434\u0440\u0435\u0441", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441", options: (addressBranch || []).map(({ address = '' }) => ({
|
|
1325
|
-
key: address,
|
|
1326
|
-
text: address,
|
|
1327
|
-
})), ...withValidator(field('addressBranch'), defaultSelectValidator) }));
|
|
1327
|
+
const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
|
|
1328
|
+
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: className, viewBox: viewBox, fill: fill, width: width, height: height, children: paths.map(({ d, fill: pathFill, ...options }, i) => {
|
|
1329
|
+
const resultOptions = { ...commonOptions, ...options };
|
|
1330
|
+
return (jsx("path", { d: d, fill: pathFill || 'currentColor', stroke: resultOptions.stroke, strokeLinecap: resultOptions.strokeLinecap, strokeLinejoin: resultOptions.strokeLinejoin, strokeWidth: resultOptions.strokeWidth, strokeMiterlimit: resultOptions.strokeMiterlimit }, i));
|
|
1331
|
+
}) }));
|
|
1328
1332
|
});
|
|
1329
1333
|
|
|
1330
|
-
const
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1334
|
+
const CHECK_PATHS = [
|
|
1335
|
+
{
|
|
1336
|
+
d: 'M10.207.793a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414 0l-2.5-2.5a1 1 0 0 1 1.414-1.414L3.5 6.086 8.793.793a1 1 0 0 1 1.414 0Z',
|
|
1337
|
+
fillRule: 'evenodd',
|
|
1338
|
+
clipRule: 'evenodd',
|
|
1339
|
+
fill: 'white',
|
|
1340
|
+
},
|
|
1341
|
+
];
|
|
1342
|
+
const Checkbox = JSX(({ className, value, text, disabled, isRadio, onChange }) => {
|
|
1343
|
+
const handleChange = useCallback((e) => {
|
|
1344
|
+
if (disabled) {
|
|
1345
|
+
return;
|
|
1346
|
+
}
|
|
1347
|
+
e.preventDefault();
|
|
1348
|
+
onChange && onChange(!value);
|
|
1349
|
+
}, [onChange, disabled, value]);
|
|
1350
|
+
const icon = isRadio ? (jsx("div", { className: "absolute left-1 w-3 h-3 rounded-full bg-primary-main" })) : (jsx(SVG, { paths: CHECK_PATHS, className: "absolute left-1 ml-px block", width: "11", height: "9", fill: "white", viewBox: "0 0 11 9" }));
|
|
1351
|
+
return (jsx("div", { className: className, children: jsxs("label", { className: "flex items-center relative cursor-pointer group/box", onClick: handleChange, children: [jsx("div", { className: style('appearance-none w-5 h-5 border-solid cursor-pointer m-0', isRadio ? 'rounded-full border-2' : checkboxStyle(value), value ? 'border-primary-main' : 'border-gray', disabled ? 'bg-main-disabled' : 'group-hover/box:border-primary-hover'), role: role(isRadio), "aria-checked": Boolean(value), "aria-disabled": Boolean(disabled) }), value ? icon : null, text ? (jsx("div", { className: "ml-s", children: jsx(Text, { size: "text-l", font: "font-light", children: text }) })) : null] }) }));
|
|
1352
|
+
});
|
|
1353
|
+
const role = (isRadio) => (isRadio ? 'radio' : 'checkbox');
|
|
1354
|
+
const checkboxStyle = (value) => style('rounded border', value ? 'bg-primary-main' : '');
|
|
1355
|
+
|
|
1356
|
+
const CheckboxWithError = JSX(({ className, text, value, key, disabled, error, onChange }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(Checkbox, { text: text, value: value, disabled: disabled, onChange: onChange }, key), renderErrorText(error)] })));
|
|
1357
|
+
|
|
1358
|
+
const pattern = (regexp) => validator((_) => typeof _ === 'string' && regexp.test(_));
|
|
1359
|
+
|
|
1360
|
+
const required = validator((_) => _ !== null && _ !== undefined && _ !== '');
|
|
1361
|
+
|
|
1362
|
+
const ERROR_MESSAGE = 'Некорректно заполненное поле';
|
|
1363
|
+
const defaultValidator = required(ERROR_MESSAGE);
|
|
1364
|
+
const defaultSelectValidator = validator((_) => _?.key && _?.key !== '')(ERROR_MESSAGE);
|
|
1365
|
+
const nameValidator = validator((_) => typeof _ === 'string' && _.length > 1)(ERROR_MESSAGE);
|
|
1366
|
+
const innValidator = validator((_) => typeof _ === 'string' && (_.length === 10 || _.length === 12))(ERROR_MESSAGE);
|
|
1367
|
+
const phoneValidator = pattern(/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/)(ERROR_MESSAGE);
|
|
1368
|
+
const checkboxValidator = validator((_) => typeof _ === 'boolean' && _)(ERROR_MESSAGE);
|
|
1336
1369
|
|
|
1337
|
-
const
|
|
1370
|
+
const getNamesFromInput = (inputs) => Object.values(inputs).map((_) => _.name);
|
|
1371
|
+
|
|
1372
|
+
const validatorObj = {
|
|
1373
|
+
typeForm: defaultValidator,
|
|
1374
|
+
surname: nameValidator,
|
|
1375
|
+
name: nameValidator,
|
|
1376
|
+
region: defaultSelectValidator,
|
|
1377
|
+
addressBranch: defaultSelectValidator,
|
|
1378
|
+
phone: phoneValidator,
|
|
1379
|
+
birthday: defaultValidator,
|
|
1380
|
+
email: defaultValidator,
|
|
1381
|
+
fullName: defaultValidator,
|
|
1382
|
+
inn: innValidator,
|
|
1383
|
+
partnerComments: defaultValidator,
|
|
1384
|
+
comment: defaultValidator,
|
|
1385
|
+
acquiringType: defaultSelectValidator,
|
|
1386
|
+
serviceType: defaultSelectValidator,
|
|
1387
|
+
consentDataProcessing: checkboxValidator,
|
|
1388
|
+
annualRevenue: defaultValidator,
|
|
1389
|
+
};
|
|
1390
|
+
const getObjectValidator = (inputs) => {
|
|
1391
|
+
const requiredInputs = getNamesFromInput(inputs.filter((_) => ('required' in _ ? _.required : false)));
|
|
1392
|
+
return Object.fromEntries(requiredInputs.map((_) => [_, validatorObj?.[_]]));
|
|
1393
|
+
};
|
|
1394
|
+
|
|
1395
|
+
const ACQUIRING_TYPES = [
|
|
1396
|
+
{
|
|
1397
|
+
text: 'Торговый эквайринг',
|
|
1398
|
+
key: 'trade',
|
|
1399
|
+
},
|
|
1400
|
+
{
|
|
1401
|
+
text: 'СБП-эквайринг',
|
|
1402
|
+
key: 'sbp',
|
|
1403
|
+
},
|
|
1404
|
+
{
|
|
1405
|
+
text: 'Интернет-эквайринг',
|
|
1406
|
+
key: 'internet',
|
|
1407
|
+
},
|
|
1408
|
+
{
|
|
1409
|
+
text: 'Все виды эквайринга',
|
|
1410
|
+
key: 'all',
|
|
1411
|
+
},
|
|
1412
|
+
];
|
|
1413
|
+
const AcquiringField = JSX(({ field, input }) => (jsx(SelectControl, { label: "\u0412\u0438\u0434 \u044D\u043A\u0432\u0430\u0439\u0440\u0438\u043D\u0433\u0430", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u044D\u043A\u0432\u0430\u0439\u0440\u0438\u043D\u0433", options: ACQUIRING_TYPES, ...getValidation(field('acquiringType'), validatorObj.acquiringType, input?.required) })));
|
|
1414
|
+
const isAcquiringTrade = (key = '') => Boolean(key === 'trade' || key === 'all');
|
|
1338
1415
|
|
|
1339
1416
|
const useNormalizedInput = (props, { normalize, format }) => {
|
|
1340
1417
|
const { value, onFocus, onBlur, onChange } = props;
|
|
@@ -1394,278 +1471,163 @@
|
|
|
1394
1471
|
const closestValue = (list) => (_) => list.reduce((prev, curr) => (Math.abs(curr - _) < Math.abs(prev - _) ? curr : prev));
|
|
1395
1472
|
const renderRangeCaption = (items) => (jsx("div", { className: "flex justify-between my-xs", children: items.map((item, i) => (jsx(Text, { size: "text-s", font: "font-light", color: "text-secondary-text", children: item }, String(i)))) }));
|
|
1396
1473
|
|
|
1397
|
-
const
|
|
1398
|
-
|
|
1399
|
-
const
|
|
1400
|
-
|
|
1401
|
-
amount: MIN_CREDIT_AMOUNT,
|
|
1402
|
-
term: 12,
|
|
1403
|
-
fullName: '',
|
|
1404
|
-
inn: '',
|
|
1405
|
-
name: '',
|
|
1406
|
-
phone: '',
|
|
1407
|
-
email: '',
|
|
1408
|
-
annualRevenue: '',
|
|
1409
|
-
};
|
|
1410
|
-
const creditValidator$1 = objectValidator({
|
|
1411
|
-
fullName: defaultValidator,
|
|
1412
|
-
annualRevenue: defaultValidator,
|
|
1413
|
-
inn: innValidator,
|
|
1414
|
-
name: nameValidator,
|
|
1415
|
-
phone: phoneValidator,
|
|
1416
|
-
region: defaultValidator,
|
|
1417
|
-
});
|
|
1418
|
-
const ApplicationFormCredit = JSX(({ button, link, onSubmit }) => {
|
|
1419
|
-
const handleSubmit = useCallback((formState) => {
|
|
1420
|
-
const { amount, term, addressBranch, annualRevenue, ...usedFields } = formState;
|
|
1421
|
-
isValidationSuccess(creditValidator$1(formState)) &&
|
|
1422
|
-
onSubmit({
|
|
1423
|
-
...usedFields,
|
|
1424
|
-
addressBranch: addressBranch?.text || '',
|
|
1425
|
-
partnerComments: `Сумма=${amount}/Срок=${term}/Выручка=${annualRevenue}`,
|
|
1426
|
-
});
|
|
1427
|
-
}, [onSubmit]);
|
|
1428
|
-
const [formState, { field, ...formProps }] = useForm(initialFormState$6, {
|
|
1429
|
-
onSubmit: handleSubmit,
|
|
1430
|
-
});
|
|
1431
|
-
return (jsxs("form", { className: formStyle$1, onSubmit: formProps.onSubmit, children: [renderCreditParameters(field, 'Параметры'), renderCreditDataOrganization(field, 'Данные организации'), jsxs(ApplicationFieldsetLayout, { title: "\u041E\u0444\u0438\u0441 \u0431\u0430\u043D\u043A\u0430", children: [jsx("div", { className: formChildrenStyle, children: jsx(RegionField, { field: field }) }), jsx("div", { className: formChildrenStyle, children: jsx(AddressBranchField, { field: field, regionKey: formState.region?.key }) })] }), renderSubmitButton(button), jsx(Footnote, { link: link })] }));
|
|
1432
|
-
});
|
|
1474
|
+
const MIN_CREDIT_AMOUNT = 1000;
|
|
1475
|
+
const MAX_CREDIT_AMOUNT = 1000000000;
|
|
1476
|
+
const ITEMS_CREDIT_AMOUNT = ['От 1 000 ₽', 'До 1 000 000 000 ₽'];
|
|
1477
|
+
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') })));
|
|
1433
1478
|
|
|
1434
|
-
const
|
|
1435
|
-
typeForm: { key: 'dpst', text: 'Заявка на депозит' },
|
|
1436
|
-
name: '',
|
|
1437
|
-
phone: '',
|
|
1438
|
-
};
|
|
1439
|
-
const depositValidator = objectValidator({
|
|
1440
|
-
name: nameValidator,
|
|
1441
|
-
phone: phoneValidator,
|
|
1442
|
-
});
|
|
1443
|
-
const ApplicationFormDeposit = JSX(({ button, link, onSubmit }) => {
|
|
1444
|
-
const handleSubmit = useCallback((formState) => {
|
|
1445
|
-
isValidationSuccess(depositValidator(formState)) && onSubmit(formState);
|
|
1446
|
-
}, [onSubmit]);
|
|
1447
|
-
const [, { field, ...formProps }] = useForm(initialFormState$5, {
|
|
1448
|
-
onSubmit: handleSubmit,
|
|
1449
|
-
resetOnSubmit: false,
|
|
1450
|
-
});
|
|
1451
|
-
return (jsx("form", { className: formStyle$1, onSubmit: formProps.onSubmit, children: jsx(ApplicationFieldsetLayout, { title: "\u041E\u0441\u0442\u0430\u0432\u044C\u0442\u0435 \u0437\u0430\u044F\u0432\u043A\u0443 \u0438 \u043C\u044B \u043E\u0442\u0432\u0435\u0442\u0438\u043C \u043D\u0430 \u043B\u044E\u0431\u044B\u0435 \u0432\u043E\u043F\u0440\u043E\u0441\u044B \u043F\u043E \u0434\u0435\u043F\u043E\u0437\u0438\u0442\u0430\u043C", children: jsxs("div", { className: oneColumnFormStyle, children: [jsx(InputControl, { label: "\u0418\u043C\u044F", ...withValidator(field('name'), nameValidator) }), jsx(PhoneInputControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) }), renderSubmitButton(button), jsx(Footnote, { link: link })] }) }) }));
|
|
1452
|
-
});
|
|
1479
|
+
const CommentField = JSX(({ field, input }) => (jsx(InputControl, { className: "col-span-2", ...getValidation(field('comment'), validatorObj.comment, input?.required), placeholder: "\u0412\u0430\u0448\u0435 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435", isTextarea: true })));
|
|
1453
1480
|
|
|
1454
|
-
const
|
|
1455
|
-
{
|
|
1456
|
-
text: 'Задать вопрос по продуктам и услугам',
|
|
1457
|
-
key: 'FEEDBACK',
|
|
1458
|
-
},
|
|
1459
|
-
{
|
|
1460
|
-
text: 'Качество обслуживания',
|
|
1461
|
-
key: 'FEEDBACK_QS',
|
|
1462
|
-
},
|
|
1463
|
-
];
|
|
1464
|
-
const FEEDBACK_METHOD = [
|
|
1465
|
-
{ key: 'phone', text: 'Телефонный звонок' },
|
|
1466
|
-
{ key: 'email', text: 'Электронное сообщение' },
|
|
1467
|
-
];
|
|
1468
|
-
const SERVICE_DIRECTIONS = [
|
|
1469
|
-
{ key: 'Физическое лицо' },
|
|
1470
|
-
{ key: 'Юридическое лицо / ИП' },
|
|
1471
|
-
];
|
|
1481
|
+
const SlideCheckbox = JSX(({ value = false, text, type = 'checkbox', onChange }) => (jsxs("div", { role: type, "aria-checked": value, className: "flex justify-start items-center w-full cursor-pointer mb-s", onClick: () => onChange && onChange(!value), children: [jsx("div", { className: style('relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl', value ? 'bg-primary-main' : 'bg-main-divider'), children: jsx("div", { className: style('absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full', value ? 'left-1/2' : 'left-[5%]') }) }), text ? (jsx(Text, { size: "text-l", font: "font-light", color: "text-primary-text", children: text })) : null] })));
|
|
1472
1482
|
|
|
1473
|
-
const
|
|
1474
|
-
return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: className, viewBox: viewBox, fill: fill, width: width, height: height, children: paths.map(({ d, fill: pathFill, ...options }, i) => {
|
|
1475
|
-
const resultOptions = { ...commonOptions, ...options };
|
|
1476
|
-
return (jsx("path", { d: d, fill: pathFill || 'currentColor', stroke: resultOptions.stroke, strokeLinecap: resultOptions.strokeLinecap, strokeLinejoin: resultOptions.strokeLinejoin, strokeWidth: resultOptions.strokeWidth, strokeMiterlimit: resultOptions.strokeMiterlimit }, i));
|
|
1477
|
-
}) }));
|
|
1478
|
-
});
|
|
1483
|
+
const OnlineCheckoutField = JSX(({ field }) => isAcquiringTrade(field('acquiringType')?.value?.key) ? (jsx(SlideCheckbox, { type: "radio", text: "\u0425\u043E\u0447\u0443 \u043E\u043D\u043B\u0430\u0439\u043D-\u043A\u0430\u0441\u0441\u0443", ...field('onlineCheckout') })) : null);
|
|
1479
1484
|
|
|
1480
|
-
const
|
|
1481
|
-
{
|
|
1482
|
-
d: 'M10.207.793a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414 0l-2.5-2.5a1 1 0 0 1 1.414-1.414L3.5 6.086 8.793.793a1 1 0 0 1 1.414 0Z',
|
|
1483
|
-
fillRule: 'evenodd',
|
|
1484
|
-
clipRule: 'evenodd',
|
|
1485
|
-
fill: 'white',
|
|
1486
|
-
},
|
|
1487
|
-
];
|
|
1488
|
-
const Checkbox = JSX(({ className, value, text, disabled, isRadio, onChange }) => {
|
|
1489
|
-
const handleChange = useCallback((e) => {
|
|
1490
|
-
if (disabled) {
|
|
1491
|
-
return;
|
|
1492
|
-
}
|
|
1493
|
-
e.preventDefault();
|
|
1494
|
-
onChange && onChange(!value);
|
|
1495
|
-
}, [onChange, disabled, value]);
|
|
1496
|
-
const icon = isRadio ? (jsx("div", { className: "absolute left-1 w-3 h-3 rounded-full bg-primary-main" })) : (jsx(SVG, { paths: CHECK_PATHS, className: "absolute left-1 ml-px block", width: "11", height: "9", fill: "white", viewBox: "0 0 11 9" }));
|
|
1497
|
-
return (jsx("div", { className: className, children: jsxs("label", { className: "flex items-center relative cursor-pointer group/box", onClick: handleChange, children: [jsx("div", { className: style('appearance-none w-5 h-5 border-solid cursor-pointer m-0', isRadio ? 'rounded-full border-2' : checkboxStyle(value), value ? 'border-primary-main' : 'border-gray', disabled ? 'bg-main-disabled' : 'group-hover/box:border-primary-hover'), role: role(isRadio), "aria-checked": Boolean(value), "aria-disabled": Boolean(disabled) }), value ? icon : null, text ? (jsx("div", { className: "ml-s", children: jsx(Text, { size: "text-l", font: "font-light", children: text }) })) : null] }) }));
|
|
1498
|
-
});
|
|
1499
|
-
const role = (isRadio) => (isRadio ? 'radio' : 'checkbox');
|
|
1500
|
-
const checkboxStyle = (value) => style('rounded border', value ? 'bg-primary-main' : '');
|
|
1485
|
+
const PosTerminalField = JSX(({ field }) => isAcquiringTrade(field('acquiringType')?.value?.key) ? (jsx(SlideCheckbox, { type: "radio", text: "\u0425\u043E\u0447\u0443 \u043A\u0443\u043F\u0438\u0442\u044C POS-\u0442\u0435\u0440\u043C\u0438\u043D\u0430\u043B", ...field('posTerminal') })) : null);
|
|
1501
1486
|
|
|
1502
|
-
const
|
|
1503
|
-
|
|
1487
|
+
const REGIONS_URL = '/api/v1/regions';
|
|
1488
|
+
function useRegions() {
|
|
1489
|
+
const { data } = useAsyncData(REGIONS_URL, fetchJSONUnsafe);
|
|
1490
|
+
return data || [];
|
|
1491
|
+
}
|
|
1504
1492
|
|
|
1505
|
-
const
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
else {
|
|
1510
|
-
const day = String(date.getDate()).padStart(2, '0');
|
|
1511
|
-
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
1512
|
-
const year = toTimeStamp ? String(date.getFullYear()) : String(date.getFullYear()).slice(-2);
|
|
1513
|
-
return toTimeStamp ? `${year}-${month}-${day}` : `${day}.${month}.${year}`;
|
|
1514
|
-
}
|
|
1515
|
-
};
|
|
1493
|
+
const RegionField = JSX(({ field, input }) => {
|
|
1494
|
+
const regions = useRegions();
|
|
1495
|
+
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) }));
|
|
1496
|
+
});
|
|
1516
1497
|
|
|
1517
|
-
const
|
|
1518
|
-
|
|
1519
|
-
|
|
1498
|
+
const RegionPremiumField = JSX(({ field, input }) => {
|
|
1499
|
+
const branchByRegions = usePremiumBranchesByRegions();
|
|
1500
|
+
const regions = useMemo(() => branchByRegions.map(({ region }) => ({
|
|
1501
|
+
key: region,
|
|
1502
|
+
text: region,
|
|
1503
|
+
})), []);
|
|
1504
|
+
return (jsx(SelectControl, { label: "\u0420\u0435\u0433\u0438\u043E\u043D", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0433\u0438\u043E\u043D", options: regions, ...getValidation(field('region'), validatorObj.region, input?.required) }));
|
|
1505
|
+
});
|
|
1520
1506
|
|
|
1521
|
-
const
|
|
1522
|
-
const
|
|
1523
|
-
const
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
}
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1507
|
+
const MIN_CREDIT_TERM = 1;
|
|
1508
|
+
const MAX_CREDIT_TERM = 180;
|
|
1509
|
+
const ITEMS_CREDIT_TERM = ['От 1 мес', 'До 15 лет'];
|
|
1510
|
+
const TermField = JSX(({ field }) => (jsx(InputRange, { title: "\u0421\u0440\u043E\u043A, \u043C\u0435\u0441\u044F\u0446\u0435\u0432", items: ITEMS_CREDIT_TERM, min: MIN_CREDIT_TERM, max: MAX_CREDIT_TERM, ...field('term') })));
|
|
1511
|
+
|
|
1512
|
+
const SERVICE_TYPES = [
|
|
1513
|
+
{ key: 'ULTRASERVICE', text: 'Ультра' },
|
|
1514
|
+
{ key: 'PREMIUMSERVICE', text: 'Премиум' },
|
|
1515
|
+
];
|
|
1516
|
+
const UltraPremiumField = JSX(({ field }) => (jsx(SelectControl, { label: "\u0422\u0438\u043F \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u044F", options: SERVICE_TYPES, ...withValidator(field('serviceType'), defaultValidator) })));
|
|
1517
|
+
|
|
1518
|
+
const getField =
|
|
1519
|
+
// eslint-disable-next-line max-lines-per-function
|
|
1520
|
+
(field, typeForm) => (input, index) => {
|
|
1521
|
+
const { required, ...rest } = input;
|
|
1522
|
+
const isPremium = typeForm === 'ULTRASERVICE' || typeForm === 'PREMIUMSERVICE';
|
|
1523
|
+
const InputsMap = {
|
|
1524
|
+
surname: (jsx(InputControl, { label: "\u0424\u0430\u043C\u0438\u043B\u0438\u044F", ...getValidation(field('surname'), validatorObj.surname, required) })),
|
|
1525
|
+
name: (jsx(InputControl, { label: "\u0418\u043C\u044F", ...getValidation(field('name'), validatorObj.name, required), ...rest })),
|
|
1526
|
+
middleName: (jsx(InputControl, { label: "\u041E\u0442\u0447\u0435\u0441\u0442\u0432\u043E (\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E, \u043F\u0440\u0438 \u043D\u0430\u043B\u0438\u0447\u0438\u0438)", ...field('middleName') })),
|
|
1527
|
+
phone: (jsx(InputPhoneControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...getValidation(field('phone'), validatorObj.phone, required) })),
|
|
1528
|
+
email: (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) })),
|
|
1529
|
+
fullName: (jsx(InputControl, { label: "\u0424\u0418\u041E", ...getValidation(field('fullName'), validatorObj.fullName, required), ...rest })),
|
|
1530
|
+
inn: (jsx(InputControl, { label: "\u0418\u041D\u041D", ...getValidation(field('inn'), validatorObj.inn, required) })),
|
|
1531
|
+
comment: jsx(CommentField, { field: field, input: input }),
|
|
1532
|
+
region: isPremium ? (jsx(RegionPremiumField, { field: field })) : (jsx(RegionField, { field: field, input: input })),
|
|
1533
|
+
addressBranch: jsx(AddressBranchField, { field: field, input: input, isPremium: isPremium }),
|
|
1534
|
+
birthday: (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...getValidation(field('birthday'), validatorObj.birthday, required) })),
|
|
1535
|
+
isClient: (jsx(CheckboxWithError, { ...field('isClient'), text: '\u042F\u0432\u043B\u044F\u044E\u0441\u044C \u043A\u043B\u0438\u0435\u043D\u0442\u043E\u043C \u0431\u0430\u043D\u043A\u0430 \u0410\u041E "\u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A"' })),
|
|
1536
|
+
partnerComments: (jsx(InputControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043E\u0431\u044A\u0435\u043A\u0442\u043E\u0432 \u0438\u043D\u043A\u0430\u0441\u0441\u0430\u0446\u0438\u0438", ...getValidation(field('partnerComments'), validatorObj.partnerComments, required) })),
|
|
1537
|
+
acquiringType: jsx(AcquiringField, { field: field, input: input }),
|
|
1538
|
+
onlineCheckout: jsx(OnlineCheckoutField, { field: field }),
|
|
1539
|
+
posTerminal: jsx(PosTerminalField, { field: field }),
|
|
1540
|
+
serviceType: jsx(UltraPremiumField, { field: field }),
|
|
1541
|
+
term: jsx(TermField, { field: field }),
|
|
1542
|
+
amount: jsx(AmountField, { field: field }),
|
|
1543
|
+
annualRevenue: (jsx(InputControl, { label: "\u0413\u043E\u0434\u043E\u0432\u0430\u044F \u0432\u044B\u0440\u0443\u0447\u043A\u0430, \u20BD", ...getValidation(field('annualRevenue'), validatorObj.annualRevenue, required) })),
|
|
1544
|
+
};
|
|
1545
|
+
return jsx("div", { children: InputsMap[input.name] }, String(index));
|
|
1546
1546
|
};
|
|
1547
|
-
const
|
|
1548
|
-
const checkIsDisabled = (currentDate, min, max) => (min && currentDate.getTime() < min.getTime()) || (max && currentDate.getTime() > max.getTime());
|
|
1549
|
-
const getDayStyles = (isToday, isDisabled) => style('p-s text-center rounded-md border', isToday ? '' : 'border-transparent hover:bg-gray', isDisabled ? 'text-gray hover:bg-transparent' : 'cursor-pointer');
|
|
1547
|
+
const getValidation = (field, validator, required = false) => required ? withValidator(field, validator) : field;
|
|
1550
1548
|
|
|
1551
|
-
const
|
|
1552
|
-
|
|
1553
|
-
const
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
onDateClick: handleDateClick,
|
|
1567
|
-
}) })] }));
|
|
1549
|
+
const AddressBranchField = JSX(({ field, input, isPremium = false }) => {
|
|
1550
|
+
const regionKey = field('region')?.value?.text;
|
|
1551
|
+
const addressBranch = isPremium
|
|
1552
|
+
? usePremiumBranchesByRegions().find((_) => _?.region === regionKey)?.branches
|
|
1553
|
+
: useBranches(regionKey).filter((branch) => branch?.address);
|
|
1554
|
+
const { value, onChange } = field?.('addressBranch') || {};
|
|
1555
|
+
useEffect(() => {
|
|
1556
|
+
if (value?.key !== '') {
|
|
1557
|
+
onChange?.('');
|
|
1558
|
+
}
|
|
1559
|
+
}, [value]);
|
|
1560
|
+
return (jsx(SelectControl, { label: "\u0410\u0434\u0440\u0435\u0441", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441", options: (addressBranch || []).map(({ address = '' }) => ({
|
|
1561
|
+
key: address,
|
|
1562
|
+
text: address,
|
|
1563
|
+
})), ...getValidation(field('addressBranch'), validatorObj.addressBranch, input?.required) }));
|
|
1568
1564
|
});
|
|
1569
1565
|
|
|
1570
|
-
const
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1566
|
+
const ApplicationFieldsetLayout = JSX(({ title, children }) => (jsxs("fieldset", { className: "grid @xl:flex @xl:justify-between gap-m border-b border-b-main-divider @xl:border-none", children: [title ? (jsx("legend", { className: "w-full", children: jsx(Heading, { title: title, headingType: "h6", className: "@xl:text-center" }) })) : null, children] })));
|
|
1567
|
+
|
|
1568
|
+
const FEEDBACK_TYPES = [
|
|
1569
|
+
{
|
|
1570
|
+
text: 'Задать вопрос по продуктам и услугам',
|
|
1571
|
+
key: 'FEEDBACK',
|
|
1572
|
+
},
|
|
1573
|
+
{
|
|
1574
|
+
text: 'Качество обслуживания',
|
|
1575
|
+
key: 'FEEDBACK_QS',
|
|
1576
|
+
},
|
|
1577
|
+
];
|
|
1578
|
+
const FEEDBACK_METHOD = [
|
|
1579
|
+
{ key: 'phone', text: 'Телефонный звонок' },
|
|
1580
|
+
{ key: 'email', text: 'Электронное сообщение' },
|
|
1581
|
+
];
|
|
1582
|
+
const SERVICE_DIRECTIONS = [
|
|
1583
|
+
{ key: 'Физическое лицо' },
|
|
1584
|
+
{ key: 'Юридическое лицо / ИП' },
|
|
1583
1585
|
];
|
|
1584
1586
|
|
|
1585
|
-
const
|
|
1586
|
-
const
|
|
1587
|
+
const formStyle = 'container space-y-m';
|
|
1588
|
+
const oneColumnFormStyle = 'w-full max-w-xl space-y-s m-auto';
|
|
1587
1589
|
|
|
1588
|
-
const
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
onMonthSelect(selectedMonth + 1);
|
|
1600
|
-
}
|
|
1601
|
-
else {
|
|
1602
|
-
onMonthSelect(0);
|
|
1603
|
-
onYearSelect(selectedYear + 1);
|
|
1604
|
-
}
|
|
1605
|
-
}, [selectedMonth]);
|
|
1606
|
-
const handlePrevMonth = useCallback(() => {
|
|
1607
|
-
if (selectedMonth - 1 >= 0) {
|
|
1608
|
-
onMonthSelect(selectedMonth - 1);
|
|
1609
|
-
}
|
|
1610
|
-
else {
|
|
1611
|
-
onMonthSelect(11);
|
|
1612
|
-
onYearSelect(selectedYear - 1);
|
|
1613
|
-
}
|
|
1614
|
-
}, [selectedMonth]);
|
|
1615
|
-
const handleSelectMonth = useCallback(({ key }) => onMonthSelect(months.indexOf(key)), []);
|
|
1616
|
-
const handleSelectYear = useCallback(({ key }) => onYearSelect(Number(key)), []);
|
|
1617
|
-
return {
|
|
1618
|
-
handleChangeVisibleCalendar,
|
|
1619
|
-
handleNextMonth,
|
|
1620
|
-
handlePrevMonth,
|
|
1621
|
-
handleSelectMonth,
|
|
1622
|
-
handleSelectYear,
|
|
1623
|
-
monthsOptions: MONTHS_OPTIONS,
|
|
1624
|
-
yearsOptions: YEARS_OPTIONS,
|
|
1625
|
-
ref,
|
|
1590
|
+
const Footnote = JSX(({ text, link }) => (jsxs(Paragraph, { size: "text-s", font: "font-light", color: "text-secondary-text", children: [jsx(Text, { children: text }), link ? (jsx(LinkButton, { href: link.href, ariaLabel: "\u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043D\u043D\u044B\u0445", target: link.target || '', className: "text-primary-main", children: jsx(Text, { children: link.text }) })) : null] })));
|
|
1591
|
+
|
|
1592
|
+
function useButton() {
|
|
1593
|
+
return (props) => ({
|
|
1594
|
+
...props,
|
|
1595
|
+
onClick: handlerDecorator(handleClick(props), props),
|
|
1596
|
+
});
|
|
1597
|
+
}
|
|
1598
|
+
function handleClick({ disabled, onClick }) {
|
|
1599
|
+
return (ev) => {
|
|
1600
|
+
!disabled && onClick && onClick(ev);
|
|
1626
1601
|
};
|
|
1627
|
-
}
|
|
1602
|
+
}
|
|
1628
1603
|
|
|
1629
|
-
const
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1604
|
+
const activeButtonStyleMap = 'text-white bg-primary-active';
|
|
1605
|
+
const disabledButtonStyle = 'bg-main-gray text-main-disabled cursor-not-allowed';
|
|
1606
|
+
const buttonStyleMap = {
|
|
1607
|
+
primary: 'text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active',
|
|
1608
|
+
secondary: 'text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active',
|
|
1634
1609
|
};
|
|
1635
|
-
const
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
isBorder: false,
|
|
1610
|
+
const secondaryButtonStyleMap = {
|
|
1611
|
+
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'),
|
|
1612
|
+
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'),
|
|
1639
1613
|
};
|
|
1640
|
-
const
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
const { handlePrevMonth, handleNextMonth, handleSelectMonth, handleSelectYear, monthsOptions, yearsOptions, handleChangeVisibleCalendar, ref, } = useDatePickerManager({
|
|
1647
|
-
onYearSelect: setSelectedYear,
|
|
1648
|
-
onMonthSelect: setSelectedMonth,
|
|
1649
|
-
onShowCalendar: setValue,
|
|
1650
|
-
selectedYear,
|
|
1651
|
-
selectedMonth,
|
|
1652
|
-
showCalendar,
|
|
1653
|
-
});
|
|
1654
|
-
return (jsxs("div", { className: style('space-y-xs', className), ref: ref, children: [renderLabel(label), jsxs("div", { className: "relative", children: [renderDatePickerForm(handleChangeVisibleCalendar, value, valid), showCalendar ? (jsxs("div", { className: "absolute bg-white z-20 select-none", children: [jsxs("div", { className: "flex gap-s", children: [jsx("div", { className: "my-auto", onClick: handlePrevMonth, children: jsx(Icon, { ...ICON_PROPS, className: "-rotate-90 cursor-pointer" }) }), jsx(Select, { onChange: handleSelectMonth, value: { key: months[selectedMonth] }, options: monthsOptions, ...SELECT_PROPS }), jsx(Select, { onChange: handleSelectYear, value: { key: String(selectedYear) }, options: yearsOptions, ...SELECT_PROPS }), jsx("div", { className: "my-auto", onClick: handleNextMonth, children: jsx(Icon, { ...ICON_PROPS, className: "rotate-90 cursor-pointer" }) })] }), jsx(Calendar, { today: value, currentMonth: selectedMonth, currentYear: selectedYear, onDateSelect: onChange, min: minDate, max: maxDate })] })) : null] })] }));
|
|
1614
|
+
const Button = JSX(({ children, ...props }) => {
|
|
1615
|
+
const button = useButton();
|
|
1616
|
+
const { className, version = 'primary', active, disabled, type = 'button', rounded = true, role, onClick, } = button(props);
|
|
1617
|
+
return (jsx("button", { className: style('font-sans px-9 py-4', 'flex justify-center items-center gap-xs', active ? activeButtonStyleMap : '', disabled ? disabledButtonStyle : '', !active && !disabled
|
|
1618
|
+
? style(buttonStyleMap[version], secondaryButtonStyleMap[version])
|
|
1619
|
+
: '', rounded ? 'rounded-md' : '', className), type: type, role: role, onClick: onClick, children: children }));
|
|
1655
1620
|
});
|
|
1656
|
-
const renderDatePickerForm = (handleChangeVisibleCalendar, value, valid) => (jsxs("div", { onClick: handleChangeVisibleCalendar, className: style(formStyle, valid ? 'border-gray' : 'border-error'), children: [jsx(Paragraph, { children: value && formatDate(value) }), jsx(Icon, { ...ICON_PROPS, name: "CalendarIcon" })] }));
|
|
1657
1621
|
|
|
1658
|
-
const
|
|
1622
|
+
const renderSubmitButton = (button, className) => (jsx(Button, { className: style('w-full @xl:w-auto', className), type: "submit", children: button?.text ? button.text : 'Отправить заявку' }));
|
|
1659
1623
|
|
|
1660
|
-
const
|
|
1624
|
+
const agreementText = 'Нажимая кнопку, вы подтверждаете согласие с ';
|
|
1625
|
+
const renderAgreementSubmit = (consentDataProcessing, link, button) => (jsxs("div", { className: "flex col-span-2 gap-m flex-col lg:flex-row w-full justify-between items-baseline", children: [consentDataProcessing ? (jsxs("div", { children: [jsxs("div", { className: "flex gap-3", children: [jsx(Checkbox, { ...consentDataProcessing }), jsx(Footnote, { link: link })] }), renderErrorText(withValidator(consentDataProcessing, checkboxValidator).error)] })) : (jsx(Footnote, { text: agreementText, link: link })), renderSubmitButton(button)] }));
|
|
1626
|
+
|
|
1627
|
+
const initialFormState$2 = {
|
|
1661
1628
|
surname: '',
|
|
1662
1629
|
name: '',
|
|
1663
1630
|
middleName: '',
|
|
1664
|
-
};
|
|
1665
|
-
const renderUserData = (field, isBirthday = true) => (jsxs("div", { className: "space-y-s", children: [jsx(InputControl, { label: "\u0424\u0430\u043C\u0438\u043B\u0438\u044F", ...withValidator(field('surname'), nameValidator) }), jsx(InputControl, { label: "\u0418\u043C\u044F", ...withValidator(field('name'), nameValidator) }), jsx(InputControl, { label: "\u041E\u0442\u0447\u0435\u0441\u0442\u0432\u043E (\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E, \u043F\u0440\u0438 \u043D\u0430\u043B\u0438\u0447\u0438\u0438)", ...field('middleName') }), isBirthday ? (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...withValidator(field('birthday'), defaultValidator) })) : null] }));
|
|
1666
|
-
|
|
1667
|
-
const initialFormState$4 = {
|
|
1668
|
-
...initialUserFormState,
|
|
1669
1631
|
typeForm: { key: 'FEEDBACK', text: 'Задать вопрос по продуктам и услугам' },
|
|
1670
1632
|
serviceDirection: { key: 'Физическое лицо' },
|
|
1671
1633
|
birthday: undefined,
|
|
@@ -1690,12 +1652,12 @@
|
|
|
1690
1652
|
const handleSubmit = useCallback((feedbackFormState) => {
|
|
1691
1653
|
handleSubmitFeedback(feedbackFormState, onSubmit);
|
|
1692
1654
|
}, [onSubmit]);
|
|
1693
|
-
const [
|
|
1655
|
+
const [, { field, ...formProps }] = useForm(initialFormState$2, {
|
|
1694
1656
|
onSubmit: handleSubmit,
|
|
1695
1657
|
});
|
|
1696
1658
|
const isQualityService = field('typeForm').value?.key === 'FEEDBACK_QS';
|
|
1697
1659
|
const isLegalEntity = getLegalEntity(field('typeForm').value?.key, field('serviceDirection').value?.key);
|
|
1698
|
-
return (jsx("form", { className: formStyle
|
|
1660
|
+
return (jsx("form", { className: formStyle, onSubmit: formProps.onSubmit, children: jsx(ApplicationFieldsetLayout, { children: jsxs("div", { className: oneColumnFormStyle, children: [jsx(SelectControl, { label: "\u0422\u0435\u043C\u0430", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0442\u0435\u043C\u0443", options: FEEDBACK_TYPES, ...withValidator(field('typeForm'), defaultValidator) }), isQualityService ? (jsx(SelectControl, { label: "\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u044F", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435", options: SERVICE_DIRECTIONS, ...withValidator(field('serviceDirection'), defaultValidator) })) : null, jsx(RegionField, { field: field }), isQualityService ? jsx(AddressBranchField, { field: field }) : null, jsxs("div", { className: "space-y-s", children: [jsx(InputControl, { label: "\u0424\u0430\u043C\u0438\u043B\u0438\u044F", ...withValidator(field('surname'), nameValidator) }), jsx(InputControl, { label: "\u0418\u043C\u044F", ...withValidator(field('name'), nameValidator) }), jsx(InputControl, { label: "\u041E\u0442\u0447\u0435\u0441\u0442\u0432\u043E (\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E, \u043F\u0440\u0438 \u043D\u0430\u043B\u0438\u0447\u0438\u0438)", ...field('middleName') }), jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...withValidator(field('birthday'), defaultValidator) })] }), isLegalEntity ? (jsxs("div", { children: [jsx(InputControl, { label: "\u0418\u041D\u041D", ...withValidator(field('inn'), innValidator) }), jsx(InputControl, { label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...field('fullName') })] })) : null, jsx(SelectControl, { label: "\u0421\u043F\u043E\u0441\u043E\u0431 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u044F \u043E\u0442\u0432\u0435\u0442\u0430", options: FEEDBACK_METHOD, ...withValidator(field('feedbackMethod'), defaultValidator) }), jsx(InputPhoneControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) }), isQualityService ? (jsxs("div", { children: [jsx(InputPhoneControl, { label: "\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0439 \u0442\u0435\u043B\u0435\u0444\u043E\u043D", ...(!field('secondaryPhone').value || field('secondaryPhone').value === '+7 ('
|
|
1699
1661
|
? field('secondaryPhone')
|
|
1700
1662
|
: withValidator(field('secondaryPhone'), phoneValidator)) }), jsx(InputControl, { label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...withValidator(field('email'), defaultValidator) }), jsx(InputControl, { label: "\u0424\u0418\u041E \u0438\u043B\u0438 \u0434\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u0432\u0448\u0435\u0433\u043E \u0412\u0430\u0441 \u0441\u043E\u0442\u0440\u0443\u0434\u043D\u0438\u043A\u0430 \u0411\u0430\u043D\u043A\u0430", ...field('bankEmpolee') }), 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') })] })) : (jsx(InputControl, { label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...withValidator(field('email'), defaultValidator) })), jsx(InputControl, { ...withValidator(field('comment'), defaultValidator), placeholder: "\u0412\u0430\u0448\u0435 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435", isTextarea: true }), renderAgreementSubmit(field('consentDataProcessing'), link, button)] }) }) }));
|
|
1701
1663
|
});
|
|
@@ -1732,75 +1694,6 @@
|
|
|
1732
1694
|
return (jsxs("div", { className: "container space-y-s", children: [regions ? (jsx(SelectControl, { label: "\u0412\u0430\u0448 \u0440\u0435\u0433\u0438\u043E\u043D", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0433\u0438\u043E\u043D", isSearch: true, options: regions.map(({ name = '' }) => ({ key: name, text: name })), value: region, onChange: setRegion })) : null, regionHref ? (jsx("div", { className: "text-center", children: jsx(LinkButton, { href: regionHref, target: "_blank", className: style('p-m w-full @xl:w-auto', buttonStyle), children: button?.text ? button.text : 'Перейти' }) })) : null] }));
|
|
1733
1695
|
});
|
|
1734
1696
|
|
|
1735
|
-
const initialFormState$3 = {
|
|
1736
|
-
...initialUserFormState,
|
|
1737
|
-
phone: '',
|
|
1738
|
-
email: '',
|
|
1739
|
-
birthday: undefined,
|
|
1740
|
-
consentDataProcessing: false,
|
|
1741
|
-
};
|
|
1742
|
-
const individualsValidator = objectValidator({
|
|
1743
|
-
surname: nameValidator,
|
|
1744
|
-
name: nameValidator,
|
|
1745
|
-
phone: phoneValidator,
|
|
1746
|
-
email: defaultValidator,
|
|
1747
|
-
birthday: defaultValidator,
|
|
1748
|
-
consentDataProcessing: checkboxValidator,
|
|
1749
|
-
});
|
|
1750
|
-
const ApplicationFormIndividuals = JSX((props) => {
|
|
1751
|
-
const { button, link, product = '', onSubmit } = props;
|
|
1752
|
-
const handleSubmit = useCallback((formState) => {
|
|
1753
|
-
isValidationSuccess(individualsValidator(formState)) &&
|
|
1754
|
-
onSubmit({
|
|
1755
|
-
...formState,
|
|
1756
|
-
product,
|
|
1757
|
-
}, true);
|
|
1758
|
-
}, [onSubmit]);
|
|
1759
|
-
const [, { field, ...formProps }] = useForm(initialFormState$3, { onSubmit: handleSubmit });
|
|
1760
|
-
return (jsxs("form", { className: formStyle$1, onSubmit: formProps.onSubmit, children: [jsxs(ApplicationFieldsetLayout, { children: [jsxs("div", { className: formChildrenStyle, children: [jsx(InputControl, { label: "\u0424\u0430\u043C\u0438\u043B\u0438\u044F", ...withValidator(field('surname'), nameValidator) }), jsx(InputControl, { label: "\u041E\u0442\u0447\u0435\u0441\u0442\u0432\u043E (\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E, \u043F\u0440\u0438 \u043D\u0430\u043B\u0438\u0447\u0438\u0438)", ...field('middleName') }), jsx(PhoneInputControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) })] }), jsxs("div", { className: formChildrenStyle, children: [jsx(InputControl, { label: "\u0418\u043C\u044F", ...withValidator(field('name'), nameValidator) }), jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...withValidator(field('birthday'), defaultValidator) }), jsx(InputControl, { label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...withValidator(field('email'), defaultValidator) })] })] }), renderAgreementSubmit(field('consentDataProcessing'), link, button)] }));
|
|
1761
|
-
});
|
|
1762
|
-
|
|
1763
|
-
const RegionPremiumField = JSX(({ field }) => {
|
|
1764
|
-
const branchByRegions = usePremiumBranchesByRegions();
|
|
1765
|
-
const regions = branchByRegions.map(({ region }) => ({
|
|
1766
|
-
key: region,
|
|
1767
|
-
text: region,
|
|
1768
|
-
}));
|
|
1769
|
-
return (jsx(SelectControl, { label: "\u0420\u0435\u0433\u0438\u043E\u043D", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0433\u0438\u043E\u043D", options: regions, ...withValidator(field('region'), defaultValidator) }));
|
|
1770
|
-
});
|
|
1771
|
-
|
|
1772
|
-
const SERVICE_TYPES = [
|
|
1773
|
-
{ key: 'ULTRASERVICE', text: 'Ультра' },
|
|
1774
|
-
{ key: 'PREMIUMSERVICE', text: 'Премиум' },
|
|
1775
|
-
];
|
|
1776
|
-
const initialFormState$2 = {
|
|
1777
|
-
typeForm: SERVICE_TYPES[0],
|
|
1778
|
-
...initialUserFormState,
|
|
1779
|
-
email: '',
|
|
1780
|
-
phone: '',
|
|
1781
|
-
comment: '',
|
|
1782
|
-
consentDataProcessing: false,
|
|
1783
|
-
};
|
|
1784
|
-
const creditValidator = objectValidator({
|
|
1785
|
-
typeForm: defaultValidator,
|
|
1786
|
-
surname: defaultValidator,
|
|
1787
|
-
name: nameValidator,
|
|
1788
|
-
phone: phoneValidator,
|
|
1789
|
-
email: defaultValidator,
|
|
1790
|
-
addressBranch: defaultValidator,
|
|
1791
|
-
consentDataProcessing: checkboxValidator,
|
|
1792
|
-
});
|
|
1793
|
-
const ApplicationFormUltraPremium = JSX(({ button, link, onSubmit, defaultType = 'PREMIUMSERVICE' }) => {
|
|
1794
|
-
const handleSubmit = useCallback((formState) => {
|
|
1795
|
-
const isValid = isValidationSuccess(creditValidator(formState));
|
|
1796
|
-
isValid && onSubmit(formState, true);
|
|
1797
|
-
}, [onSubmit]);
|
|
1798
|
-
const [formState, { field, ...formProps }] = useForm({ ...initialFormState$2, typeForm: getDefaultFormType(defaultType) }, { onSubmit: handleSubmit });
|
|
1799
|
-
const regionKey = formState?.region?.key;
|
|
1800
|
-
return (jsxs("form", { className: formStyle$1, onSubmit: formProps.onSubmit, children: [jsxs(ApplicationFieldsetLayout, { title: "\u0412\u0430\u0448\u0438 \u0434\u0430\u043D\u043D\u044B\u0435", children: [jsxs("div", { className: formChildrenStyle, children: [jsx(InputControl, { label: "\u0424\u0430\u043C\u0438\u043B\u0438\u044F", ...withValidator(field('surname'), nameValidator) }), jsx(InputControl, { label: "\u041E\u0442\u0447\u0435\u0441\u0442\u0432\u043E (\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E, \u043F\u0440\u0438 \u043D\u0430\u043B\u0438\u0447\u0438\u0438)", ...field('middleName') }), jsx(InputControl, { label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...withValidator(field('email'), defaultValidator) })] }), jsxs("div", { className: formChildrenStyle, children: [jsx(InputControl, { label: "\u0418\u043C\u044F", ...withValidator(field('name'), nameValidator) }), jsx(PhoneInputControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) }), jsx(SelectControl, { label: "\u0422\u0438\u043F \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u044F", options: SERVICE_TYPES, ...withValidator(field('typeForm'), defaultValidator) })] })] }), jsxs(ApplicationFieldsetLayout, { title: "\u041E\u0444\u0438\u0441 \u0431\u0430\u043D\u043A\u0430", children: [jsx("div", { className: formChildrenStyle, children: jsx(RegionPremiumField, { field: field }) }), jsx("div", { className: formChildrenStyle, children: jsx(AddressBranchField, { field: field, regionKey: regionKey, isPremium: true }) })] }), jsx(InputControl, { ...field('comment'), placeholder: "\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439, \u0443\u0434\u043E\u0431\u043D\u043E\u0435 \u0432\u0440\u0435\u043C\u044F \u0438 \u043F\u0440\u043E\u0447\u0435\u0435", isTextarea: true }), renderAgreementSubmit(field('consentDataProcessing'), link, button)] }));
|
|
1801
|
-
});
|
|
1802
|
-
const getDefaultFormType = (defaultType) => SERVICE_TYPES.find((_) => _.key === defaultType);
|
|
1803
|
-
|
|
1804
1697
|
const renderContacts = () => (jsxs("div", { className: "flex gap-xl", children: [jsxs("a", { className: "flex gap-s items-center text-primary-text no-underline", href: `tel:8 (800) 200-78-70`, "aria-label": "8 (800) 200-78-70", children: [jsx(Img, { image: { icon: 'PhoneIcon' }, width: "24", height: "24" }), jsx("span", { children: "8 (800) 200-78-70" })] }), jsxs("a", { className: "flex gap-s items-center text-primary-text no-underline", "aria-label": "ved@rshb.ru", href: `mailto:ved@rshb.ru`, children: [jsx(Img, { image: { icon: 'MailIcon' }, width: "24", height: "24" }), jsx("span", { children: "ved@rshb.ru" })] })] }));
|
|
1805
1698
|
|
|
1806
1699
|
const Radio = JSX(({ name, text, value, checked, onChange, className }) => (jsx("div", { className: className, children: jsxs("label", { className: "font-sans flex gap-s items-center relative cursor-pointer", children: [jsx("input", { className: "appearance-none flex justify-center items-center shrink-0 w-5 h-5 border border-gray hover:border-primary-hover\n checked:border-2 checked:!border-primary-main focus:checked:border-primary-main focus:border-primary-text active:border-primary-text\n after:block after:w-2.5 after:h-2.5 after:rounded-full checked:after:bg-primary-main outline-none rounded-full cursor-pointer", type: "radio", value: value, name: name, checked: checked, onChange: (_) => onChange(_.target.value), role: "radio" }), text ? jsx(Text, { color: "text-primary-text", children: text }) : null] }) })));
|
|
@@ -1812,7 +1705,7 @@
|
|
|
1812
1705
|
|
|
1813
1706
|
const renderWedDataOrganization = ({ field }) => {
|
|
1814
1707
|
const isCurrencyControl = field('vedTypes').value === 'currencyControl';
|
|
1815
|
-
return (jsxs("div", { className: "space-y-s", children: [isCurrencyControl ? jsx(RegionField, { field: field }) : null, jsxs("div", { className: "grid @xl:grid-cols-2 @xl:gap-x-m gap-s", children: [isCurrencyControl ? (jsx(InputControl, { label: "\u0418\u041D\u041D", ...withValidator(field('inn'), innValidator) })) : null, jsx(InputControl, { label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...withValidator(field('fullName'), defaultValidator) }), jsx(InputControl, { label: "\u0424\u0418\u041E", ...withValidator(field('name'), nameValidator) }), jsx(
|
|
1708
|
+
return (jsxs("div", { className: "space-y-s", children: [isCurrencyControl ? jsx(RegionField, { field: field }) : null, jsxs("div", { className: "grid @xl:grid-cols-2 @xl:gap-x-m gap-s", children: [isCurrencyControl ? (jsx(InputControl, { label: "\u0418\u041D\u041D", ...withValidator(field('inn'), innValidator) })) : null, jsx(InputControl, { label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...withValidator(field('fullName'), defaultValidator) }), jsx(InputControl, { label: "\u0424\u0418\u041E", ...withValidator(field('name'), nameValidator) }), jsx(InputPhoneControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) }), !isCurrencyControl ? jsx(InputControl, { label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...field('email') }) : null] })] }));
|
|
1816
1709
|
};
|
|
1817
1710
|
|
|
1818
1711
|
const initialFormState$1 = {
|
|
@@ -1867,13 +1760,8 @@
|
|
|
1867
1760
|
|
|
1868
1761
|
const EmbeddableForms = {
|
|
1869
1762
|
ApplicationFormWed,
|
|
1870
|
-
ApplicationFormDeposit,
|
|
1871
|
-
ApplicationFormCredit,
|
|
1872
|
-
ApplicationFormAcquiring,
|
|
1873
1763
|
ApplicationFormGrantSupport,
|
|
1874
|
-
ApplicationFormIndividuals,
|
|
1875
1764
|
ApplicationFormFeedback,
|
|
1876
|
-
ApplicationFormUltraPremium,
|
|
1877
1765
|
};
|
|
1878
1766
|
|
|
1879
1767
|
const API$1 = LeadServiceAPI();
|
|
@@ -1902,50 +1790,62 @@
|
|
|
1902
1790
|
return (jsx(BlockWrapper, { className: className, defaultPadding: "p-6xl", ...rest, children: jsxs("div", { className: "container max-w-[978px] space-y-lg", children: [title ? jsx(Heading, { headingType: "h3", title: title, className: "@xl:text-center" }) : null, children, responseType ? jsx(ResponseNotification, { responseType: responseType }) : null] }) }));
|
|
1903
1791
|
});
|
|
1904
1792
|
|
|
1905
|
-
const
|
|
1906
|
-
|
|
1907
|
-
|
|
1793
|
+
const getPartnerComments = (data) => {
|
|
1794
|
+
const { acquiringType, onlineCheckout = false, posTerminal = false, term, amount, annualRevenue, } = data;
|
|
1795
|
+
if (acquiringType) {
|
|
1796
|
+
return `Вид эквайринга=${acquiringType?.text || ''}${isAcquiringTrade(acquiringType?.key)
|
|
1797
|
+
? `/Онлайн касса=${onlineCheckout}/POS-терминал=${posTerminal}`
|
|
1798
|
+
: '/Онлайн касса=false/POS-терминал=false'}`;
|
|
1799
|
+
}
|
|
1800
|
+
else {
|
|
1801
|
+
return `Сумма=${amount}/Срок=${term}/Выручка=${annualRevenue}`;
|
|
1802
|
+
}
|
|
1803
|
+
};
|
|
1908
1804
|
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
const
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
inn: jsx(InputControl, { label: "\u0418\u041D\u041D", ...getValidation(field('inn'), validatorObj.inn, required) }),
|
|
1919
|
-
comment: (jsx(InputControl, { className: "col-span-2", ...getValidation(field('comment'), validatorObj.comment, required), placeholder: "\u0412\u0430\u0448\u0435 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435", isTextarea: true })),
|
|
1920
|
-
region: jsx(RegionField, { field: field, input: input }),
|
|
1921
|
-
birthday: (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...getValidation(field('birthday'), validatorObj.birthday, required) })),
|
|
1922
|
-
isClient: (jsx(CheckboxWithError, { ...field('isClient'), text: '\u042F\u0432\u043B\u044F\u044E\u0441\u044C \u043A\u043B\u0438\u0435\u043D\u0442\u043E\u043C \u0431\u0430\u043D\u043A\u0430 \u0410\u041E "\u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A"' })),
|
|
1923
|
-
partnerComments: (jsx(InputControl, { label: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043E\u0431\u044A\u0435\u043A\u0442\u043E\u0432 \u0438\u043D\u043A\u0430\u0441\u0441\u0430\u0446\u0438\u0438", ...getValidation(field('partnerComments'), validatorObj.partnerComments, required) })),
|
|
1924
|
-
};
|
|
1925
|
-
return jsx("div", { children: InputsMap[input.name] }, String(index));
|
|
1805
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
1806
|
+
const getFormatData = (data) => {
|
|
1807
|
+
const { acquiringType, onlineCheckout, posTerminal, amount, term, annualRevenue, serviceType, ...usedData } = data;
|
|
1808
|
+
const partnerComments = acquiringType || annualRevenue ? getPartnerComments(data) : null;
|
|
1809
|
+
const formatData = { ...usedData, ...(partnerComments ? { partnerComments } : {}) };
|
|
1810
|
+
return Object.fromEntries(Object.entries(formatData).map(([k, v]) => [
|
|
1811
|
+
k,
|
|
1812
|
+
(k === 'region' ? v?.text : v?.key) || v,
|
|
1813
|
+
]));
|
|
1926
1814
|
};
|
|
1927
|
-
const getValidation = (field, validator, required = false) => required ? withValidator(field, validator) : field;
|
|
1928
1815
|
|
|
1929
1816
|
const initialFormState = {
|
|
1930
|
-
typeForm:
|
|
1817
|
+
typeForm: '',
|
|
1931
1818
|
region: { key: '', text: '' },
|
|
1819
|
+
addressBranch: { key: '', text: '' },
|
|
1932
1820
|
surname: '',
|
|
1933
1821
|
name: '',
|
|
1934
1822
|
middleName: '',
|
|
1935
1823
|
phone: '',
|
|
1936
1824
|
email: '',
|
|
1937
|
-
birthday: undefined,
|
|
1938
1825
|
comment: '',
|
|
1939
|
-
consentDataProcessing: false,
|
|
1940
1826
|
product: '',
|
|
1827
|
+
partnerComments: '',
|
|
1828
|
+
annualRevenue: '',
|
|
1829
|
+
term: 12,
|
|
1830
|
+
amount: 1000,
|
|
1831
|
+
acquiringType: ACQUIRING_TYPES[0],
|
|
1832
|
+
serviceType: SERVICE_TYPES[0],
|
|
1833
|
+
birthday: undefined,
|
|
1834
|
+
isClient: false,
|
|
1835
|
+
onlineCheckout: false,
|
|
1836
|
+
posTerminal: false,
|
|
1837
|
+
consentDataProcessing: false,
|
|
1941
1838
|
};
|
|
1942
1839
|
const getInitialFormState = (inputs, typeForm = '') => {
|
|
1943
1840
|
const formState = Object.fromEntries(getNamesFromInput(inputs).map((_) => [_, initialFormState[_]]));
|
|
1841
|
+
if (formState?.serviceType && typeForm === 'PREMIUMSERVICE') {
|
|
1842
|
+
formState.serviceType = SERVICE_TYPES[1];
|
|
1843
|
+
}
|
|
1944
1844
|
return { ...formState, typeForm: { key: typeForm, text: '' } };
|
|
1945
1845
|
};
|
|
1946
1846
|
|
|
1947
1847
|
const API = LeadServiceAPI();
|
|
1948
|
-
const ApplicationFormCustom = JSX(({ className, title, typeForm = '', sections = [], button, link, endpoint }) => {
|
|
1848
|
+
const ApplicationFormCustom = JSX(({ className, title, typeForm = '', sections = [], button, link, endpoint, additionalParams, }) => {
|
|
1949
1849
|
const inputs = (sections?.flatMap((_) => _?.inputs) || []);
|
|
1950
1850
|
const initialFormState = getInitialFormState(inputs, typeForm);
|
|
1951
1851
|
const [responseType, setResponseType] = useState('');
|
|
@@ -1954,14 +1854,14 @@
|
|
|
1954
1854
|
if (!isValidationSuccess(feedbackValidator(data))) {
|
|
1955
1855
|
return 'Fail';
|
|
1956
1856
|
}
|
|
1957
|
-
const formatData = getFormatData(data);
|
|
1857
|
+
const formatData = getFormatData({ ...data, ...additionalParams });
|
|
1958
1858
|
const status = (await API.send(formatData, endpoint === 'lead')) ? 'OK' : 'Fail';
|
|
1959
1859
|
setResponseType(status);
|
|
1960
1860
|
return status;
|
|
1961
1861
|
}, []);
|
|
1962
1862
|
const [, { field, onSubmit }] = useForm(initialFormState, { onSubmit: handleSubmit });
|
|
1963
1863
|
const fieldName = getConsentDataProcessing(inputs)?.name;
|
|
1964
|
-
return (jsx(ApplicationFormLayout, { className: style(formStyle
|
|
1864
|
+
return (jsx(ApplicationFormLayout, { className: style(formStyle, className), title: title, responseType: responseType, children: jsxs("form", { className: "", onSubmit: onSubmit, children: [sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid gap-x-m'), children: [_?.title ? jsx("div", { className: "@xl:text-center @xl:col-span-2", children: _.title }) : null, _?.inputs?.map(getField(field, typeForm))] }, `section-${i}`))), renderAgreementSubmit(fieldName ? field('consentDataProcessing') : undefined, link, button)] }) }));
|
|
1965
1865
|
});
|
|
1966
1866
|
const inputColumnStyles = (column) => column === 2 ? '@xl:grid-cols-2' : '';
|
|
1967
1867
|
const getConsentDataProcessing = (inputs) => inputs.find((_) => _?.name === 'consentDataProcessing');
|
|
@@ -3554,10 +3454,10 @@
|
|
|
3554
3454
|
|
|
3555
3455
|
const paginationBlockStyle = 'py-m px-lg rounded-md cursor-pointer hover:bg-primary-hover hover:text-white';
|
|
3556
3456
|
|
|
3557
|
-
const checkPageRange = (page, currentPage, totalPages) => (currentPage <=
|
|
3558
|
-
(currentPage >= totalPages - 1 && page >= totalPages -
|
|
3559
|
-
const shouldRenderPage = (page, currentPage, totalPages) => (page < currentPage && page >= currentPage -
|
|
3560
|
-
(page <= currentPage +
|
|
3457
|
+
const checkPageRange = (page, currentPage, totalPages) => (currentPage <= 2 && page <= currentPage + 2) ||
|
|
3458
|
+
(currentPage >= totalPages - 1 && page >= totalPages - 3);
|
|
3459
|
+
const shouldRenderPage = (page, currentPage, totalPages) => (page < currentPage && page >= currentPage - 1) ||
|
|
3460
|
+
(page <= currentPage + 1 && page > currentPage) ||
|
|
3561
3461
|
checkPageRange(page, currentPage, totalPages);
|
|
3562
3462
|
|
|
3563
3463
|
const renderPages = (pagesParams, index) => {
|
|
@@ -3585,13 +3485,13 @@
|
|
|
3585
3485
|
}
|
|
3586
3486
|
}, [currentPage]);
|
|
3587
3487
|
const handleNextPage = useCallback(() => {
|
|
3588
|
-
if (currentPage < totalPages
|
|
3488
|
+
if (currentPage < totalPages) {
|
|
3589
3489
|
onPageChange(currentPage + 1);
|
|
3590
3490
|
}
|
|
3591
3491
|
}, [currentPage, totalPages]);
|
|
3592
3492
|
const handleFirstPage = useCallback(() => onPageChange(1), []);
|
|
3593
3493
|
const handleLastPage = useCallback(() => onPageChange(totalPages), [totalPages]);
|
|
3594
|
-
return (jsxs("div", { className: "flex gap-m items-center", children: [jsx("div", { onClick: handlePrevPage, children: jsx(Icon, { name: "ArrowLeftIcon", iconVersion: "black", imageClassName: getIconStyle(currentPage === 1), ...ICON_SIZE$1 }) }), jsxs("div", { className: "flex gap-
|
|
3494
|
+
return (jsxs("div", { className: "flex gap-m items-center", children: [jsx("div", { onClick: handlePrevPage, children: jsx(Icon, { name: "ArrowLeftIcon", iconVersion: "black", imageClassName: getIconStyle(currentPage === 1), ...ICON_SIZE$1 }) }), jsxs("div", { className: "flex gap-2xs", children: [currentPage > 1 ? (jsx("div", { onClick: handleFirstPage, className: paginationBlockStyle, "aria-label": "\u0421\u0442\u0440\u0430\u043D\u0438\u0446\u0430 1", children: "1" })) : null, currentPage > 3 ? jsx("div", { className: "py-m px-s", children: "..." }) : null, pages.map(renderPages), currentPage < totalPages - 2 ? jsx("div", { className: "py-m px-s", children: "..." }) : null, currentPage < totalPages ? (jsx("div", { onClick: handleLastPage, className: paginationBlockStyle, "aria-label": `Страница ${totalPages}`, children: totalPages })) : null] }), jsx("div", { onClick: handleNextPage, children: jsx(Icon, { className: "rotate-180", name: "ArrowLeftIcon", iconVersion: "black", imageClassName: getIconStyle(currentPage === totalPages), ...ICON_SIZE$1 }) })] }));
|
|
3595
3495
|
};
|
|
3596
3496
|
const getIconStyle = (condition) => condition ? 'opacity-20' : 'cursor-pointer hover:opacity-60';
|
|
3597
3497
|
|
|
@@ -6054,7 +5954,7 @@
|
|
|
6054
5954
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
6055
5955
|
});
|
|
6056
5956
|
|
|
6057
|
-
const packageVersion = "0.14.
|
|
5957
|
+
const packageVersion = "0.14.212";
|
|
6058
5958
|
|
|
6059
5959
|
exports.Blocks = Blocks;
|
|
6060
5960
|
exports.ContentPage = ContentPage;
|