@redneckz/wildless-cms-uni-blocks 0.14.201 → 0.14.202
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.198.js +96 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +170 -210
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +1 -15
- package/bundle/components/ApplicationForm/EmbeddableForms.d.ts +0 -2
- package/bundle/components/ApplicationForm/RegionField.d.ts +2 -0
- package/bundle/components/ApplicationForm/formStyle.d.ts +1 -1
- package/bundle/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +12 -6
- package/bundle/components/ApplicationFormCustom/contants.d.ts +2 -0
- package/bundle/components/ApplicationFormCustom/getField.d.ts +2 -1
- package/bundle/components/ApplicationFormCustom/getObjectValidator.d.ts +1 -0
- package/bundle/ui-kit/Input/renderLabel.d.ts +2 -0
- package/bundle/ui-kit/Select/Select.d.ts +1 -0
- package/{lib/components/ApplicationForm → bundle/ui-kit/Select}/SelectControl.d.ts +1 -1
- package/dist/components/ApplicationForm/AddressBranchField.js +3 -2
- package/dist/components/ApplicationForm/AddressBranchField.js.map +1 -1
- package/dist/components/ApplicationForm/ApplicationFieldsetLayout.js +1 -1
- package/dist/components/ApplicationForm/ApplicationFieldsetLayout.js.map +1 -1
- package/dist/components/ApplicationForm/ApplicationForm.js +1 -1
- package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +1 -15
- package/dist/components/ApplicationForm/ApplicationFormFeedback.js +1 -1
- package/dist/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
- package/dist/components/ApplicationForm/ApplicationFormGrantSupport.js +1 -1
- package/dist/components/ApplicationForm/ApplicationFormGrantSupport.js.map +1 -1
- package/dist/components/ApplicationForm/ApplicationFormIndividuals.js +1 -1
- package/dist/components/ApplicationForm/ApplicationFormIndividuals.js.map +1 -1
- package/dist/components/ApplicationForm/ApplicationFormUltraPremium.js +1 -1
- package/dist/components/ApplicationForm/ApplicationFormUltraPremium.js.map +1 -1
- package/dist/components/ApplicationForm/ApplicationFormWed.js +1 -1
- package/dist/components/ApplicationForm/ApplicationFormWed.js.map +1 -1
- package/dist/components/ApplicationForm/EmbeddableForms.d.ts +0 -2
- package/dist/components/ApplicationForm/EmbeddableForms.js +0 -4
- package/dist/components/ApplicationForm/EmbeddableForms.js.map +1 -1
- package/dist/components/ApplicationForm/RegionField.d.ts +2 -0
- package/dist/components/ApplicationForm/RegionField.js +3 -3
- package/dist/components/ApplicationForm/RegionField.js.map +1 -1
- package/dist/components/ApplicationForm/RegionPremiumField.js +1 -1
- package/dist/components/ApplicationForm/RegionPremiumField.js.map +1 -1
- package/dist/components/ApplicationForm/formStyle.d.ts +1 -1
- package/dist/components/ApplicationForm/formStyle.js +1 -1
- package/dist/components/ApplicationForm/formStyle.js.map +1 -1
- package/dist/components/ApplicationForm/renderAcquiringRegion.js +1 -1
- package/dist/components/ApplicationForm/renderAcquiringRegion.js.map +1 -1
- package/dist/components/ApplicationForm/renderAgreementSubmit.js +1 -1
- package/dist/components/ApplicationForm/renderAgreementSubmit.js.map +1 -1
- package/dist/components/ApplicationForm/renderQuestionsInterested.js +1 -1
- package/dist/components/ApplicationForm/renderQuestionsInterested.js.map +1 -1
- package/dist/components/ApplicationForm/renderUserData.js +1 -1
- package/dist/components/ApplicationForm/renderUserData.js.map +1 -1
- package/dist/components/ApplicationForm/renderWedDataOrganization.js +1 -1
- package/dist/components/ApplicationForm/renderWedDataOrganization.js.map +1 -1
- package/dist/components/ApplicationFormCustom/ApplicationFormCustom.js +4 -3
- package/dist/components/ApplicationFormCustom/ApplicationFormCustom.js.map +1 -1
- package/dist/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +12 -6
- package/dist/components/ApplicationFormCustom/ApplicationFormCustomContent.js +1 -0
- package/dist/components/ApplicationFormCustom/ApplicationFormCustomContent.js.map +1 -1
- package/dist/components/ApplicationFormCustom/contants.d.ts +2 -0
- package/dist/components/ApplicationFormCustom/contants.js +7 -0
- package/dist/components/ApplicationFormCustom/contants.js.map +1 -0
- package/dist/components/ApplicationFormCustom/getField.d.ts +2 -1
- package/dist/components/ApplicationFormCustom/getField.js +13 -13
- package/dist/components/ApplicationFormCustom/getField.js.map +1 -1
- package/dist/components/ApplicationFormCustom/getInitialFormState.js +1 -0
- package/dist/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
- package/dist/components/ApplicationFormCustom/getObjectValidator.d.ts +1 -0
- package/dist/components/ApplicationFormCustom/getObjectValidator.js +6 -4
- package/dist/components/ApplicationFormCustom/getObjectValidator.js.map +1 -1
- package/dist/ui-kit/DatePicker/DatePicker.js +2 -2
- package/dist/ui-kit/DatePicker/DatePicker.js.map +1 -1
- package/dist/ui-kit/DatePicker/DatePickerControl.js +9 -0
- package/dist/ui-kit/DatePicker/DatePickerControl.js.map +1 -0
- package/dist/ui-kit/Input/Input.js +2 -3
- package/dist/ui-kit/Input/Input.js.map +1 -1
- package/dist/ui-kit/Input/renderErrorText.js +1 -1
- package/dist/ui-kit/Input/renderLabel.d.ts +2 -0
- package/dist/ui-kit/Input/renderLabel.js +7 -0
- package/dist/ui-kit/Input/renderLabel.js.map +1 -0
- package/dist/ui-kit/Select/Select.d.ts +1 -0
- package/dist/ui-kit/Select/Select.js +8 -5
- package/dist/ui-kit/Select/Select.js.map +1 -1
- package/dist/{components/ApplicationForm → ui-kit/Select}/SelectControl.d.ts +1 -1
- package/dist/{components/ApplicationForm → ui-kit/Select}/SelectControl.js +2 -2
- package/dist/ui-kit/Select/SelectControl.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/ApplicationForm/AddressBranchField.js +3 -2
- package/lib/components/ApplicationForm/AddressBranchField.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationFieldsetLayout.js +1 -1
- package/lib/components/ApplicationForm/ApplicationFieldsetLayout.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationForm.fixture.d.ts +0 -2
- package/lib/components/ApplicationForm/ApplicationForm.fixture.mobile.d.ts +0 -2
- package/lib/components/ApplicationForm/ApplicationForm.js +1 -1
- package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +1 -15
- package/lib/components/ApplicationForm/ApplicationFormFeedback.js +1 -1
- package/lib/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationFormGrantSupport.js +1 -1
- package/lib/components/ApplicationForm/ApplicationFormGrantSupport.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationFormIndividuals.js +1 -1
- package/lib/components/ApplicationForm/ApplicationFormIndividuals.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationFormUltraPremium.js +1 -1
- package/lib/components/ApplicationForm/ApplicationFormUltraPremium.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationFormWed.js +1 -1
- package/lib/components/ApplicationForm/ApplicationFormWed.js.map +1 -1
- package/lib/components/ApplicationForm/EmbeddableForms.d.ts +0 -2
- package/lib/components/ApplicationForm/EmbeddableForms.js +0 -4
- package/lib/components/ApplicationForm/EmbeddableForms.js.map +1 -1
- package/lib/components/ApplicationForm/RegionField.d.ts +2 -0
- package/lib/components/ApplicationForm/RegionField.js +3 -3
- package/lib/components/ApplicationForm/RegionField.js.map +1 -1
- package/lib/components/ApplicationForm/RegionPremiumField.js +1 -1
- package/lib/components/ApplicationForm/RegionPremiumField.js.map +1 -1
- package/lib/components/ApplicationForm/formStyle.d.ts +1 -1
- package/lib/components/ApplicationForm/formStyle.js +1 -1
- package/lib/components/ApplicationForm/formStyle.js.map +1 -1
- package/lib/components/ApplicationForm/renderAcquiringRegion.js +1 -1
- package/lib/components/ApplicationForm/renderAcquiringRegion.js.map +1 -1
- package/lib/components/ApplicationForm/renderAgreementSubmit.js +1 -1
- package/lib/components/ApplicationForm/renderAgreementSubmit.js.map +1 -1
- package/lib/components/ApplicationForm/renderQuestionsInterested.js +1 -1
- package/lib/components/ApplicationForm/renderQuestionsInterested.js.map +1 -1
- package/lib/components/ApplicationForm/renderUserData.js +1 -1
- package/lib/components/ApplicationForm/renderUserData.js.map +1 -1
- package/lib/components/ApplicationForm/renderWedDataOrganization.js +1 -1
- package/lib/components/ApplicationForm/renderWedDataOrganization.js.map +1 -1
- package/lib/components/ApplicationFormCustom/ApplicationFormCustom.fixture.d.ts +3 -2
- package/lib/components/ApplicationFormCustom/ApplicationFormCustom.js +4 -3
- package/lib/components/ApplicationFormCustom/ApplicationFormCustom.js.map +1 -1
- package/lib/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +12 -6
- package/lib/components/ApplicationFormCustom/ApplicationFormCustomContent.js +1 -0
- package/lib/components/ApplicationFormCustom/ApplicationFormCustomContent.js.map +1 -1
- package/lib/components/ApplicationFormCustom/contants.d.ts +2 -0
- package/lib/components/ApplicationFormCustom/contants.js +5 -0
- package/lib/components/ApplicationFormCustom/contants.js.map +1 -0
- package/lib/components/ApplicationFormCustom/getField.d.ts +1 -1
- package/lib/components/ApplicationFormCustom/getField.js +13 -13
- package/lib/components/ApplicationFormCustom/getField.js.map +1 -1
- package/lib/components/ApplicationFormCustom/getInitialFormState.js +1 -0
- package/lib/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
- package/lib/components/ApplicationFormCustom/getObjectValidator.d.ts +1 -0
- package/lib/components/ApplicationFormCustom/getObjectValidator.js +6 -4
- package/lib/components/ApplicationFormCustom/getObjectValidator.js.map +1 -1
- package/lib/ui-kit/DatePicker/DatePicker.js +2 -2
- package/lib/ui-kit/DatePicker/DatePicker.js.map +1 -1
- package/lib/ui-kit/DatePicker/DatePickerControl.js +7 -0
- package/lib/ui-kit/DatePicker/DatePickerControl.js.map +1 -0
- package/lib/ui-kit/Input/Input.js +2 -3
- package/lib/ui-kit/Input/Input.js.map +1 -1
- package/lib/ui-kit/Input/renderErrorText.js +1 -1
- package/lib/ui-kit/Input/renderLabel.d.ts +1 -0
- package/lib/ui-kit/Input/renderLabel.js +4 -0
- package/lib/ui-kit/Input/renderLabel.js.map +1 -0
- package/lib/ui-kit/Select/Select.d.ts +1 -0
- package/lib/ui-kit/Select/Select.js +8 -5
- package/lib/ui-kit/Select/Select.js.map +1 -1
- package/{mobile/bundle/components/ApplicationForm → lib/ui-kit/Select}/SelectControl.d.ts +1 -1
- package/lib/{components/ApplicationForm → ui-kit/Select}/SelectControl.js +2 -2
- package/lib/ui-kit/Select/SelectControl.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +170 -210
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +1 -15
- package/mobile/bundle/components/ApplicationForm/EmbeddableForms.d.ts +0 -2
- package/mobile/bundle/components/ApplicationForm/RegionField.d.ts +2 -0
- package/mobile/bundle/components/ApplicationForm/formStyle.d.ts +1 -1
- package/mobile/bundle/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +12 -6
- package/mobile/bundle/components/ApplicationFormCustom/contants.d.ts +2 -0
- package/mobile/bundle/components/ApplicationFormCustom/getField.d.ts +2 -1
- package/mobile/bundle/components/ApplicationFormCustom/getObjectValidator.d.ts +1 -0
- package/mobile/bundle/ui-kit/Input/renderLabel.d.ts +2 -0
- package/mobile/bundle/ui-kit/Select/Select.d.ts +1 -0
- package/{bundle/components/ApplicationForm → mobile/bundle/ui-kit/Select}/SelectControl.d.ts +1 -1
- package/mobile/dist/components/ApplicationForm/AddressBranchField.js +3 -2
- package/mobile/dist/components/ApplicationForm/AddressBranchField.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFieldsetLayout.js +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFieldsetLayout.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +1 -15
- package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.js +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormGrantSupport.js +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormGrantSupport.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormIndividuals.js +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormIndividuals.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormUltraPremium.js +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormUltraPremium.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormWed.js +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormWed.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/EmbeddableForms.d.ts +0 -2
- package/mobile/dist/components/ApplicationForm/EmbeddableForms.js +0 -4
- package/mobile/dist/components/ApplicationForm/EmbeddableForms.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/RegionField.d.ts +2 -0
- package/mobile/dist/components/ApplicationForm/RegionField.js +3 -3
- package/mobile/dist/components/ApplicationForm/RegionField.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/RegionPremiumField.js +1 -1
- package/mobile/dist/components/ApplicationForm/RegionPremiumField.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/formStyle.d.ts +1 -1
- package/mobile/dist/components/ApplicationForm/formStyle.js +1 -1
- package/mobile/dist/components/ApplicationForm/formStyle.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/renderAcquiringRegion.js +1 -1
- package/mobile/dist/components/ApplicationForm/renderAcquiringRegion.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/renderAgreementSubmit.js +1 -1
- package/mobile/dist/components/ApplicationForm/renderAgreementSubmit.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/renderQuestionsInterested.js +1 -1
- package/mobile/dist/components/ApplicationForm/renderQuestionsInterested.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/renderUserData.js +1 -1
- package/mobile/dist/components/ApplicationForm/renderUserData.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/renderWedDataOrganization.js +1 -1
- package/mobile/dist/components/ApplicationForm/renderWedDataOrganization.js.map +1 -1
- package/mobile/dist/components/ApplicationFormCustom/ApplicationFormCustom.js +4 -3
- package/mobile/dist/components/ApplicationFormCustom/ApplicationFormCustom.js.map +1 -1
- package/mobile/dist/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +12 -6
- package/mobile/dist/components/ApplicationFormCustom/ApplicationFormCustomContent.js +1 -0
- package/mobile/dist/components/ApplicationFormCustom/ApplicationFormCustomContent.js.map +1 -1
- package/mobile/dist/components/ApplicationFormCustom/contants.d.ts +2 -0
- package/mobile/dist/components/ApplicationFormCustom/contants.js +7 -0
- package/mobile/dist/components/ApplicationFormCustom/contants.js.map +1 -0
- package/mobile/dist/components/ApplicationFormCustom/getField.d.ts +2 -1
- package/mobile/dist/components/ApplicationFormCustom/getField.js +13 -13
- package/mobile/dist/components/ApplicationFormCustom/getField.js.map +1 -1
- package/mobile/dist/components/ApplicationFormCustom/getInitialFormState.js +1 -0
- package/mobile/dist/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
- package/mobile/dist/components/ApplicationFormCustom/getObjectValidator.d.ts +1 -0
- package/mobile/dist/components/ApplicationFormCustom/getObjectValidator.js +6 -4
- package/mobile/dist/components/ApplicationFormCustom/getObjectValidator.js.map +1 -1
- package/mobile/dist/ui-kit/DatePicker/DatePicker.js +2 -2
- package/mobile/dist/ui-kit/DatePicker/DatePicker.js.map +1 -1
- package/mobile/dist/ui-kit/DatePicker/DatePickerControl.js +9 -0
- package/mobile/dist/ui-kit/DatePicker/DatePickerControl.js.map +1 -0
- package/mobile/dist/ui-kit/Input/Input.js +2 -3
- package/mobile/dist/ui-kit/Input/Input.js.map +1 -1
- package/mobile/dist/ui-kit/Input/renderErrorText.js +1 -1
- package/mobile/dist/ui-kit/Input/renderLabel.d.ts +2 -0
- package/mobile/dist/ui-kit/Input/renderLabel.js +7 -0
- package/mobile/dist/ui-kit/Input/renderLabel.js.map +1 -0
- package/mobile/dist/ui-kit/Select/Select.d.ts +1 -0
- package/mobile/dist/ui-kit/Select/Select.js +8 -5
- package/mobile/dist/ui-kit/Select/Select.js.map +1 -1
- package/mobile/dist/ui-kit/Select/SelectControl.d.ts +9 -0
- package/mobile/dist/{components/ApplicationForm → ui-kit/Select}/SelectControl.js +2 -2
- package/mobile/dist/ui-kit/Select/SelectControl.js.map +1 -0
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationForm/AddressBranchField.js +3 -2
- package/mobile/lib/components/ApplicationForm/AddressBranchField.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFieldsetLayout.js +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFieldsetLayout.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +1 -15
- package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.js +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormGrantSupport.js +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormGrantSupport.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormIndividuals.js +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormIndividuals.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormUltraPremium.js +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormUltraPremium.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormWed.js +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormWed.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/EmbeddableForms.d.ts +0 -2
- package/mobile/lib/components/ApplicationForm/EmbeddableForms.js +0 -4
- package/mobile/lib/components/ApplicationForm/EmbeddableForms.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/RegionField.d.ts +2 -0
- package/mobile/lib/components/ApplicationForm/RegionField.js +3 -3
- package/mobile/lib/components/ApplicationForm/RegionField.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/RegionPremiumField.js +1 -1
- package/mobile/lib/components/ApplicationForm/RegionPremiumField.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/formStyle.d.ts +1 -1
- package/mobile/lib/components/ApplicationForm/formStyle.js +1 -1
- package/mobile/lib/components/ApplicationForm/formStyle.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/renderAcquiringRegion.js +1 -1
- package/mobile/lib/components/ApplicationForm/renderAcquiringRegion.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/renderAgreementSubmit.js +1 -1
- package/mobile/lib/components/ApplicationForm/renderAgreementSubmit.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/renderQuestionsInterested.js +1 -1
- package/mobile/lib/components/ApplicationForm/renderQuestionsInterested.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/renderUserData.js +1 -1
- package/mobile/lib/components/ApplicationForm/renderUserData.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/renderWedDataOrganization.js +1 -1
- package/mobile/lib/components/ApplicationForm/renderWedDataOrganization.js.map +1 -1
- package/mobile/lib/components/ApplicationFormCustom/ApplicationFormCustom.js +4 -3
- package/mobile/lib/components/ApplicationFormCustom/ApplicationFormCustom.js.map +1 -1
- package/mobile/lib/components/ApplicationFormCustom/ApplicationFormCustomContent.d.ts +12 -6
- package/mobile/lib/components/ApplicationFormCustom/ApplicationFormCustomContent.js +1 -0
- package/mobile/lib/components/ApplicationFormCustom/ApplicationFormCustomContent.js.map +1 -1
- package/mobile/lib/components/ApplicationFormCustom/contants.d.ts +2 -0
- package/mobile/lib/components/ApplicationFormCustom/contants.js +5 -0
- package/mobile/lib/components/ApplicationFormCustom/contants.js.map +1 -0
- package/mobile/lib/components/ApplicationFormCustom/getField.d.ts +2 -1
- package/mobile/lib/components/ApplicationFormCustom/getField.js +13 -13
- package/mobile/lib/components/ApplicationFormCustom/getField.js.map +1 -1
- package/mobile/lib/components/ApplicationFormCustom/getInitialFormState.js +1 -0
- package/mobile/lib/components/ApplicationFormCustom/getInitialFormState.js.map +1 -1
- package/mobile/lib/components/ApplicationFormCustom/getObjectValidator.d.ts +1 -0
- package/mobile/lib/components/ApplicationFormCustom/getObjectValidator.js +6 -4
- package/mobile/lib/components/ApplicationFormCustom/getObjectValidator.js.map +1 -1
- package/mobile/lib/ui-kit/DatePicker/DatePicker.js +2 -2
- package/mobile/lib/ui-kit/DatePicker/DatePicker.js.map +1 -1
- package/mobile/lib/ui-kit/DatePicker/DatePickerControl.js +7 -0
- package/mobile/lib/ui-kit/DatePicker/DatePickerControl.js.map +1 -0
- package/mobile/lib/ui-kit/Input/Input.js +2 -3
- package/mobile/lib/ui-kit/Input/Input.js.map +1 -1
- package/mobile/lib/ui-kit/Input/renderErrorText.js +1 -1
- package/mobile/lib/ui-kit/Input/renderLabel.d.ts +2 -0
- package/mobile/lib/ui-kit/Input/renderLabel.js +4 -0
- package/mobile/lib/ui-kit/Input/renderLabel.js.map +1 -0
- package/mobile/lib/ui-kit/Select/Select.d.ts +1 -0
- package/mobile/lib/ui-kit/Select/Select.js +8 -5
- package/mobile/lib/ui-kit/Select/Select.js.map +1 -1
- package/mobile/lib/ui-kit/Select/SelectControl.d.ts +9 -0
- package/mobile/lib/{components/ApplicationForm → ui-kit/Select}/SelectControl.js +2 -2
- package/mobile/lib/ui-kit/Select/SelectControl.js.map +1 -0
- package/mobile/src/components/ApplicationForm/AddressBranchField.tsx +18 -19
- package/mobile/src/components/ApplicationForm/ApplicationFieldsetLayout.tsx +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +0 -20
- package/mobile/src/components/ApplicationForm/ApplicationFormFeedback.tsx +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationFormGrantSupport.tsx +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationFormIndividuals.tsx +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationFormUltraPremium.tsx +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationFormWed.tsx +1 -1
- package/mobile/src/components/ApplicationForm/EmbeddableForms.tsx +0 -4
- package/mobile/src/components/ApplicationForm/RegionField.tsx +5 -3
- package/mobile/src/components/ApplicationForm/RegionPremiumField.tsx +1 -1
- package/mobile/src/components/ApplicationForm/formStyle.ts +1 -1
- package/mobile/src/components/ApplicationForm/renderAcquiringRegion.tsx +1 -1
- package/mobile/src/components/ApplicationForm/renderAgreementSubmit.tsx +1 -1
- package/mobile/src/components/ApplicationForm/renderQuestionsInterested.tsx +1 -1
- package/mobile/src/components/ApplicationForm/renderUserData.tsx +1 -1
- package/mobile/src/components/ApplicationForm/renderWedDataOrganization.tsx +1 -1
- package/mobile/src/components/ApplicationFormCustom/ApplicationFormCustom.example.json +158 -68
- package/mobile/src/components/ApplicationFormCustom/ApplicationFormCustom.tsx +19 -8
- package/mobile/src/components/ApplicationFormCustom/ApplicationFormCustom.ui.json +1 -0
- package/mobile/src/components/ApplicationFormCustom/ApplicationFormCustomContent.ts +24 -7
- package/mobile/src/components/ApplicationFormCustom/contants.tsx +6 -0
- package/mobile/src/components/ApplicationFormCustom/getField.tsx +25 -19
- package/mobile/src/components/ApplicationFormCustom/getInitialFormState.tsx +1 -0
- package/mobile/src/components/ApplicationFormCustom/getObjectValidator.tsx +7 -3
- package/mobile/src/ui-kit/DatePicker/DatePicker.tsx +35 -35
- package/mobile/src/ui-kit/DatePicker/DatePickerControl.tsx +26 -0
- package/mobile/src/ui-kit/Input/Input.tsx +3 -11
- package/mobile/src/ui-kit/Input/renderErrorText.tsx +1 -1
- package/mobile/src/ui-kit/Input/renderLabel.tsx +8 -0
- package/mobile/src/ui-kit/Select/Select.tsx +18 -20
- package/mobile/src/{components/ApplicationForm → ui-kit/Select}/SelectControl.tsx +2 -2
- package/package.json +1 -1
- package/src/components/ApplicationForm/AddressBranchField.tsx +18 -19
- package/src/components/ApplicationForm/ApplicationFieldsetLayout.tsx +1 -1
- package/src/components/ApplicationForm/ApplicationForm.example.json +1 -1
- package/src/components/ApplicationForm/ApplicationForm.fixture.mobile.tsx +0 -25
- package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +0 -24
- package/src/components/ApplicationForm/ApplicationForm.tsx +1 -1
- package/src/components/ApplicationForm/ApplicationFormContent.ts +0 -20
- package/src/components/ApplicationForm/ApplicationFormFeedback.tsx +1 -1
- package/src/components/ApplicationForm/ApplicationFormGrantSupport.tsx +1 -1
- package/src/components/ApplicationForm/ApplicationFormIndividuals.tsx +1 -1
- package/src/components/ApplicationForm/ApplicationFormUltraPremium.tsx +1 -1
- package/src/components/ApplicationForm/ApplicationFormWed.tsx +1 -1
- package/src/components/ApplicationForm/EmbeddableForms.tsx +0 -4
- package/src/components/ApplicationForm/RegionField.tsx +5 -3
- package/src/components/ApplicationForm/RegionPremiumField.tsx +1 -1
- package/src/components/ApplicationForm/formStyle.ts +1 -1
- package/src/components/ApplicationForm/renderAcquiringRegion.tsx +1 -1
- package/src/components/ApplicationForm/renderAgreementSubmit.tsx +1 -1
- package/src/components/ApplicationForm/renderQuestionsInterested.tsx +1 -1
- package/src/components/ApplicationForm/renderUserData.tsx +1 -1
- package/src/components/ApplicationForm/renderWedDataOrganization.tsx +1 -1
- package/src/components/ApplicationFormCustom/ApplicationFormCustom.example.json +158 -68
- package/src/components/ApplicationFormCustom/ApplicationFormCustom.fixture.tsx +101 -64
- package/src/components/ApplicationFormCustom/ApplicationFormCustom.tsx +19 -8
- package/src/components/ApplicationFormCustom/ApplicationFormCustom.ui.json +1 -0
- package/src/components/ApplicationFormCustom/ApplicationFormCustomContent.ts +24 -7
- package/src/components/ApplicationFormCustom/contants.tsx +6 -0
- package/src/components/ApplicationFormCustom/getField.tsx +25 -19
- package/src/components/ApplicationFormCustom/getInitialFormState.tsx +1 -0
- package/src/components/ApplicationFormCustom/getObjectValidator.tsx +7 -3
- package/src/ui-kit/DatePicker/DatePicker.tsx +35 -35
- package/src/ui-kit/DatePicker/DatePickerControl.tsx +26 -0
- package/src/ui-kit/Input/Input.tsx +3 -11
- package/src/ui-kit/Input/renderErrorText.tsx +1 -1
- package/src/ui-kit/Input/renderLabel.tsx +8 -0
- package/src/ui-kit/Select/Select.tsx +18 -20
- package/src/{components/ApplicationForm → ui-kit/Select}/SelectControl.tsx +2 -2
- package/bundle/components/ApplicationForm/ApplicationFormBusinessCard.d.ts +0 -11
- package/bundle/components/ApplicationForm/ApplicationFormSelfCollection.d.ts +0 -10
- package/bundle/components/ApplicationFormCustom/columnStyle.d.ts +0 -2
- package/dist/components/ApplicationForm/ApplicationFormBusinessCard.d.ts +0 -11
- package/dist/components/ApplicationForm/ApplicationFormBusinessCard.js +0 -40
- package/dist/components/ApplicationForm/ApplicationFormBusinessCard.js.map +0 -1
- package/dist/components/ApplicationForm/ApplicationFormSelfCollection.d.ts +0 -10
- package/dist/components/ApplicationForm/ApplicationFormSelfCollection.js +0 -37
- package/dist/components/ApplicationForm/ApplicationFormSelfCollection.js.map +0 -1
- package/dist/components/ApplicationForm/DatePickerControl.js +0 -10
- package/dist/components/ApplicationForm/DatePickerControl.js.map +0 -1
- package/dist/components/ApplicationForm/SelectControl.js.map +0 -1
- package/dist/components/ApplicationFormCustom/columnStyle.d.ts +0 -2
- package/dist/components/ApplicationFormCustom/columnStyle.js +0 -7
- package/dist/components/ApplicationFormCustom/columnStyle.js.map +0 -1
- package/lib/components/ApplicationForm/ApplicationFormBusinessCard.d.ts +0 -11
- package/lib/components/ApplicationForm/ApplicationFormBusinessCard.js +0 -38
- package/lib/components/ApplicationForm/ApplicationFormBusinessCard.js.map +0 -1
- package/lib/components/ApplicationForm/ApplicationFormSelfCollection.d.ts +0 -10
- package/lib/components/ApplicationForm/ApplicationFormSelfCollection.js +0 -35
- package/lib/components/ApplicationForm/ApplicationFormSelfCollection.js.map +0 -1
- package/lib/components/ApplicationForm/DatePickerControl.js +0 -8
- package/lib/components/ApplicationForm/DatePickerControl.js.map +0 -1
- package/lib/components/ApplicationForm/SelectControl.js.map +0 -1
- package/lib/components/ApplicationFormCustom/columnStyle.d.ts +0 -2
- package/lib/components/ApplicationFormCustom/columnStyle.js +0 -5
- package/lib/components/ApplicationFormCustom/columnStyle.js.map +0 -1
- package/mobile/bundle/components/ApplicationForm/ApplicationFormBusinessCard.d.ts +0 -11
- package/mobile/bundle/components/ApplicationForm/ApplicationFormSelfCollection.d.ts +0 -10
- package/mobile/bundle/components/ApplicationFormCustom/columnStyle.d.ts +0 -2
- package/mobile/dist/components/ApplicationForm/ApplicationFormBusinessCard.d.ts +0 -11
- package/mobile/dist/components/ApplicationForm/ApplicationFormBusinessCard.js +0 -40
- package/mobile/dist/components/ApplicationForm/ApplicationFormBusinessCard.js.map +0 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormSelfCollection.d.ts +0 -10
- package/mobile/dist/components/ApplicationForm/ApplicationFormSelfCollection.js +0 -37
- package/mobile/dist/components/ApplicationForm/ApplicationFormSelfCollection.js.map +0 -1
- package/mobile/dist/components/ApplicationForm/DatePickerControl.js +0 -10
- package/mobile/dist/components/ApplicationForm/DatePickerControl.js.map +0 -1
- package/mobile/dist/components/ApplicationForm/SelectControl.d.ts +0 -9
- package/mobile/dist/components/ApplicationForm/SelectControl.js.map +0 -1
- package/mobile/dist/components/ApplicationFormCustom/columnStyle.d.ts +0 -2
- package/mobile/dist/components/ApplicationFormCustom/columnStyle.js +0 -7
- package/mobile/dist/components/ApplicationFormCustom/columnStyle.js.map +0 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormBusinessCard.d.ts +0 -11
- package/mobile/lib/components/ApplicationForm/ApplicationFormBusinessCard.js +0 -38
- package/mobile/lib/components/ApplicationForm/ApplicationFormBusinessCard.js.map +0 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormSelfCollection.d.ts +0 -10
- package/mobile/lib/components/ApplicationForm/ApplicationFormSelfCollection.js +0 -35
- package/mobile/lib/components/ApplicationForm/ApplicationFormSelfCollection.js.map +0 -1
- package/mobile/lib/components/ApplicationForm/DatePickerControl.js +0 -8
- package/mobile/lib/components/ApplicationForm/DatePickerControl.js.map +0 -1
- package/mobile/lib/components/ApplicationForm/SelectControl.d.ts +0 -9
- package/mobile/lib/components/ApplicationForm/SelectControl.js.map +0 -1
- package/mobile/lib/components/ApplicationFormCustom/columnStyle.d.ts +0 -2
- package/mobile/lib/components/ApplicationFormCustom/columnStyle.js +0 -5
- package/mobile/lib/components/ApplicationFormCustom/columnStyle.js.map +0 -1
- package/mobile/src/components/ApplicationForm/ApplicationFormBusinessCard.tsx +0 -75
- package/mobile/src/components/ApplicationForm/ApplicationFormSelfCollection.tsx +0 -64
- package/mobile/src/components/ApplicationForm/DatePickerControl.tsx +0 -30
- package/mobile/src/components/ApplicationFormCustom/columnStyle.tsx +0 -6
- package/src/components/ApplicationForm/ApplicationFormBusinessCard.tsx +0 -75
- package/src/components/ApplicationForm/ApplicationFormSelfCollection.tsx +0 -64
- package/src/components/ApplicationForm/DatePickerControl.tsx +0 -30
- package/src/components/ApplicationFormCustom/columnStyle.tsx +0 -6
- /package/bundle/{components/ApplicationForm → ui-kit/DatePicker}/DatePickerControl.d.ts +0 -0
- /package/dist/{components/ApplicationForm → ui-kit/DatePicker}/DatePickerControl.d.ts +0 -0
- /package/lib/{components/ApplicationForm → ui-kit/DatePicker}/DatePickerControl.d.ts +0 -0
- /package/mobile/bundle/{components/ApplicationForm → ui-kit/DatePicker}/DatePickerControl.d.ts +0 -0
- /package/mobile/dist/{components/ApplicationForm → ui-kit/DatePicker}/DatePickerControl.d.ts +0 -0
- /package/mobile/lib/{components/ApplicationForm → ui-kit/DatePicker}/DatePickerControl.d.ts +0 -0
package/bundle/bundle.umd.js
CHANGED
|
@@ -539,13 +539,13 @@
|
|
|
539
539
|
const handleClick = useCallback(() => {
|
|
540
540
|
router.back();
|
|
541
541
|
}, []);
|
|
542
|
-
return (jsxs("div", { className: getStyle(padding, defaultPadding, className), children: [backwardButton ? renderBackwardButton(version, handleClick) : null, title ? jsx("div", { className: "relative h-full", children: title }) : null, jsxs("div", { className: style('grow relative flex flex-col @xl:flex-row gap-3xl w-full', leftImage ? 'self-start @xl:w-auto' : ''), children: [renderImageContainer(leftImage, { imageAlign, className: 'mx-auto' }), jsxs("div", { className: style('grid gap-3xl', rightImage ? '@xl:grid-cols-2' : '', leftImage ? '' : 'grow', 'h-full', //? fix issue https://github.com/redneckz/temp_wcms/issues/1254
|
|
542
|
+
return (jsxs("div", { className: getStyle$1(padding, defaultPadding, className), children: [backwardButton ? renderBackwardButton(version, handleClick) : null, title ? jsx("div", { className: "relative h-full", children: title }) : null, jsxs("div", { className: style('grow relative flex flex-col @xl:flex-row gap-3xl w-full', leftImage ? 'self-start @xl:w-auto' : ''), children: [renderImageContainer(leftImage, { imageAlign, className: 'mx-auto' }), jsxs("div", { className: style('grid gap-3xl', rightImage ? '@xl:grid-cols-2' : '', leftImage ? '' : 'grow', 'h-full', //? fix issue https://github.com/redneckz/temp_wcms/issues/1254
|
|
543
543
|
'auto-rows-[max-content_1fr]'), children: [jsxs("div", { className: "grow space-y-lg min-w-fit", children: [insetTitle, children] }), renderUnitBlock(renderChildren({ ...rest, extraProps: { className: '@container-normal' } })), renderImageContainer(rightImage, {
|
|
544
544
|
className: style('@xl:justify-self-end @xl:col-start-2', buttons ? rowSpanStyle(isImageAlwaysOnRight) : '', positionStyle(isImageAlwaysOnRight), imageSecondaryStyle(isImageSecondary)),
|
|
545
545
|
imageAlign,
|
|
546
546
|
}), renderButtons(buttons)] })] })] }));
|
|
547
547
|
});
|
|
548
|
-
const getStyle = (padding = '', defaultPadding = '', className = '') => style('relative flex flex-col gap-3xl overflow-hidden', padding || defaultPadding, className);
|
|
548
|
+
const getStyle$1 = (padding = '', defaultPadding = '', className = '') => style('relative flex flex-col gap-3xl overflow-hidden', padding || defaultPadding, className);
|
|
549
549
|
const rowSpanStyle = (isImageAlwaysOnRight) => isImageAlwaysOnRight ? 'row-span-2' : '@xl:row-span-2';
|
|
550
550
|
const positionStyle = (isImageAlwaysOnRight) => isImageAlwaysOnRight ? 'col-start-2 self-center' : '';
|
|
551
551
|
const renderButtons = (buttons) => buttons ? jsx("div", { className: "self-end", children: buttons }) : null;
|
|
@@ -917,13 +917,15 @@
|
|
|
917
917
|
[];
|
|
918
918
|
|
|
919
919
|
const isValidationSuccess = (info) => !info?.length;
|
|
920
|
-
const validator
|
|
920
|
+
const validator = (predicate) => (message) => (_) => predicate(_) ? [] : [message];
|
|
921
921
|
|
|
922
922
|
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] })));
|
|
923
923
|
|
|
924
|
-
const formStyle$1 = 'container space-y-
|
|
924
|
+
const formStyle$1 = 'container space-y-m';
|
|
925
925
|
const oneColumnFormStyle = 'w-full max-w-xl space-y-s m-auto';
|
|
926
926
|
|
|
927
|
+
const renderLabel = (label) => label ? (jsx(Text, { size: "text-m", color: "text-primary-text", font: "font-light", children: label })) : null;
|
|
928
|
+
|
|
927
929
|
const Input = JSX(({ key, className = '', id, name, type = 'text', label, placeholder, value = '', valid = true, children, onChange, onFocus, onBlur, pattern, autoFocus = false, isTextarea = false, }) => {
|
|
928
930
|
const inputRef = useRef(null);
|
|
929
931
|
const handleChange = useCallback((e) => {
|
|
@@ -937,14 +939,13 @@
|
|
|
937
939
|
const defaultStyle = 'w-full border rounded-md text-primary-text outline-none p-m';
|
|
938
940
|
const paddingStyle = children ? 'pr-3xl' : '';
|
|
939
941
|
const validStyle = getValidStyle(valid);
|
|
940
|
-
return (jsxs("div", { className: style('relative', className), children: [jsxs("label", { children: [
|
|
942
|
+
return (jsxs("div", { className: style('relative', className), children: [jsxs("label", { className: "space-y-xs", children: [renderLabel(label), isTextarea ? (jsx("textarea", { className: style('block resize-y min-h-24', defaultStyle, validStyle), id: style('textarea', id), name: name || id, placeholder: placeholder, value: value, onInput: handleChange, onFocus: onFocus, onBlur: onBlur }, key)) : (jsx("input", { type: type, className: style('h-14', defaultStyle, paddingStyle, validStyle), ref: inputRef, id: id, name: name || id, placeholder: placeholder, value: value, onInput: handleChange, onFocus: onFocus, onBlur: onBlur, pattern: pattern }, key))] }), children] }));
|
|
941
943
|
});
|
|
942
|
-
const renderLabel$1 = (label) => (jsx("div", { className: "mb-xs", children: jsx(Text, { size: "text-m", font: "font-light", children: label }) }));
|
|
943
944
|
const getValidStyle = (valid) => valid
|
|
944
945
|
? 'border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text'
|
|
945
946
|
: 'border-error';
|
|
946
947
|
|
|
947
|
-
const renderErrorText = (error) => (jsx("div", { className: "h-
|
|
948
|
+
const renderErrorText = (error) => (jsx("div", { className: "h-6", children: error ? (jsx(Text, { size: "text-xs", font: "font-light", color: "text-error", children: error })) : null }));
|
|
948
949
|
|
|
949
950
|
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)] })));
|
|
950
951
|
|
|
@@ -958,7 +959,7 @@
|
|
|
958
959
|
};
|
|
959
960
|
};
|
|
960
961
|
|
|
961
|
-
const ApplicationFieldsetLayout = JSX(({ title, children }) => (jsxs("fieldset", { className: "grid @xl:flex @xl:justify-between gap-
|
|
962
|
+
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] })));
|
|
962
963
|
const formChildrenStyle = '@xl:w-1/2 space-y-s';
|
|
963
964
|
|
|
964
965
|
const isPlaceholder = (_) => _ === '_';
|
|
@@ -982,111 +983,20 @@
|
|
|
982
983
|
|
|
983
984
|
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)] })));
|
|
984
985
|
|
|
985
|
-
const pattern = (regexp) => validator
|
|
986
|
+
const pattern = (regexp) => validator((_) => typeof _ === 'string' && regexp.test(_));
|
|
986
987
|
|
|
987
|
-
const required = validator
|
|
988
|
+
const required = validator((_) => _ !== null && _ !== undefined && _ !== '');
|
|
988
989
|
|
|
989
990
|
const ERROR_MESSAGE = 'Некорректно заполненное поле';
|
|
990
991
|
const defaultValidator = required(ERROR_MESSAGE);
|
|
991
|
-
const defaultSelectValidator = validator
|
|
992
|
-
const nameValidator = validator
|
|
993
|
-
const innValidator = validator
|
|
992
|
+
const defaultSelectValidator = validator((_) => _?.key && _?.key !== '')(ERROR_MESSAGE);
|
|
993
|
+
const nameValidator = validator((_) => typeof _ === 'string' && _.length > 1)(ERROR_MESSAGE);
|
|
994
|
+
const innValidator = validator((_) => typeof _ === 'string' && (_.length === 10 || _.length === 12))(ERROR_MESSAGE);
|
|
994
995
|
const phoneValidator = pattern(/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/)(ERROR_MESSAGE);
|
|
995
|
-
const checkboxValidator = validator
|
|
996
|
+
const checkboxValidator = validator((_) => typeof _ === 'boolean' && _)(ERROR_MESSAGE);
|
|
996
997
|
|
|
997
998
|
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) })] })] }));
|
|
998
999
|
|
|
999
|
-
const ACQUIRING_TYPES = [
|
|
1000
|
-
{
|
|
1001
|
-
text: 'Торговый эквайринг',
|
|
1002
|
-
key: 'trade',
|
|
1003
|
-
},
|
|
1004
|
-
{
|
|
1005
|
-
text: 'СБП-эквайринг',
|
|
1006
|
-
key: 'sbp',
|
|
1007
|
-
},
|
|
1008
|
-
{
|
|
1009
|
-
text: 'Интернет-эквайринг',
|
|
1010
|
-
key: 'internet',
|
|
1011
|
-
},
|
|
1012
|
-
{
|
|
1013
|
-
text: 'Все виды эквайринга',
|
|
1014
|
-
key: 'all',
|
|
1015
|
-
},
|
|
1016
|
-
];
|
|
1017
|
-
|
|
1018
|
-
const isFilled = (_) => _ !== null && _ !== undefined;
|
|
1019
|
-
|
|
1020
|
-
const defaultCache = new Map();
|
|
1021
|
-
const applyCache = (fetcher, cache = defaultCache) => (args) => {
|
|
1022
|
-
const key = computeKey(args);
|
|
1023
|
-
const cachedData = cache.get(key);
|
|
1024
|
-
if (key && isFilled(cachedData)) {
|
|
1025
|
-
return cachedData;
|
|
1026
|
-
}
|
|
1027
|
-
const data = fetcher(...args);
|
|
1028
|
-
if (key && isFilled(data)) {
|
|
1029
|
-
cache.set(key, Promise.resolve(data));
|
|
1030
|
-
}
|
|
1031
|
-
return data;
|
|
1032
|
-
};
|
|
1033
|
-
const isKey = (args) => Boolean(args?.every(_ => (Array.isArray(_) ? isKey(_) : !_ || typeof _ === 'string')));
|
|
1034
|
-
const computeKey = (args) => (isKey(args) ? args.toString() : '');
|
|
1035
|
-
|
|
1036
|
-
const isFallbackKey = (args) => Boolean(args && Array.isArray(args) && args.length === 1 && typeof args[0] === 'string');
|
|
1037
|
-
function useAsyncData(key, fetcher, { fallback, cache } = {}) {
|
|
1038
|
-
const args = useMemo(() => keyToArgs(key), [key]);
|
|
1039
|
-
const [data, setData] = useState(undefined);
|
|
1040
|
-
const [error, setError] = useState(undefined);
|
|
1041
|
-
useEffect(() => {
|
|
1042
|
-
const isEmptyKey = !args.some(isFilled);
|
|
1043
|
-
if (isEmptyKey) {
|
|
1044
|
-
return;
|
|
1045
|
-
}
|
|
1046
|
-
let canceled = false;
|
|
1047
|
-
const setResult = (newData, err) => {
|
|
1048
|
-
if (!canceled) {
|
|
1049
|
-
setData(newData);
|
|
1050
|
-
setError(err);
|
|
1051
|
-
}
|
|
1052
|
-
};
|
|
1053
|
-
(async () => {
|
|
1054
|
-
try {
|
|
1055
|
-
setResult(await applyCache(fetcher, cache)(args));
|
|
1056
|
-
}
|
|
1057
|
-
catch (err) {
|
|
1058
|
-
setResult(undefined, err);
|
|
1059
|
-
}
|
|
1060
|
-
})();
|
|
1061
|
-
return () => {
|
|
1062
|
-
canceled = true;
|
|
1063
|
-
};
|
|
1064
|
-
}, [fetcher, cache, args]);
|
|
1065
|
-
const fallbackData = fallback && isFallbackKey(args) && fallback[args[0]];
|
|
1066
|
-
return {
|
|
1067
|
-
data: !data && fallbackData ? fallbackData : data,
|
|
1068
|
-
error,
|
|
1069
|
-
mutate: () => Promise.resolve(undefined) // TODO Clean up cache
|
|
1070
|
-
};
|
|
1071
|
-
}
|
|
1072
|
-
function keyToArgs(key) {
|
|
1073
|
-
if (Array.isArray(key)) {
|
|
1074
|
-
return key;
|
|
1075
|
-
}
|
|
1076
|
-
else if (key instanceof Function) {
|
|
1077
|
-
return keyToArgs(key());
|
|
1078
|
-
}
|
|
1079
|
-
else {
|
|
1080
|
-
return [key];
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
|
|
1084
|
-
const REGIONS_URL$1 = '/api/v1/regions';
|
|
1085
|
-
function useRegions() {
|
|
1086
|
-
const { data } = useAsyncData(REGIONS_URL$1, fetchJSONUnsafe);
|
|
1087
|
-
return data || [];
|
|
1088
|
-
}
|
|
1089
|
-
|
|
1090
1000
|
function useBool(defaultValue = false) {
|
|
1091
1001
|
const [value, setValue] = useState(defaultValue);
|
|
1092
1002
|
const setTrue = useCallback(() => setValue(true), []);
|
|
@@ -1167,9 +1077,13 @@
|
|
|
1167
1077
|
return inputRef;
|
|
1168
1078
|
}
|
|
1169
1079
|
|
|
1170
|
-
const Select = JSX(
|
|
1080
|
+
const Select = JSX(
|
|
1081
|
+
// eslint-disable-next-line complexity
|
|
1082
|
+
({ className, label, options = [], value, valid = true, isBorder = true, placeholder = '', isSearch = false, iconVersion, onChange, disabled, }) => {
|
|
1171
1083
|
const [isOpen, { setFalse: close, setTrue: open }] = useBool();
|
|
1172
1084
|
const [query, setQuery] = useState('');
|
|
1085
|
+
const isDisabled = disabled || options.length === 0;
|
|
1086
|
+
const hasOpen = isOpen && !isDisabled;
|
|
1173
1087
|
const handleClose = useCallback(() => {
|
|
1174
1088
|
setQuery('');
|
|
1175
1089
|
close();
|
|
@@ -1183,17 +1097,127 @@
|
|
|
1183
1097
|
onClose: handleClose,
|
|
1184
1098
|
iconVersion,
|
|
1185
1099
|
});
|
|
1186
|
-
return (jsxs("div", { className: className, children: [renderLabel(label), jsxs("div", { className: style('relative',
|
|
1100
|
+
return (jsxs("div", { className: style('space-y-xs', className), children: [renderLabel(label), jsxs("div", { className: style('relative', hasOpen ? 'z-20' : 'z-10'), ref: inputRef, children: [jsxs("div", { className: style('h-14 text-l flex justify-between items-center text-primary-text relative z-10', getStyle(isBorder, valid, isDisabled)), onClick: hasOpen ? handleClose : open, children: [jsx("p", { className: "p-m pr-8 flex items-center overflow-hidden text-ellipsis", children: formatOption(value) || placeholder }), renderIcon$1(hasOpen, iconVersion)] }), isSearch && hasOpen ? (jsx("div", { className: style('absolute top-0 w-full z-20'), children: jsx(Input, { type: "text", autoFocus: true, value: query, onChange: setQuery }) })) : null] })] }));
|
|
1187
1101
|
});
|
|
1188
|
-
const renderLabel = (label) => label ? (jsx("div", { className: "mb-xs", children: jsx(Text, { size: "text-m", color: "text-primary-text", font: "font-light", children: label }) })) : null;
|
|
1189
1102
|
const renderIcon$1 = (isOpen, iconVersion) => (jsx(Icon, { className: style('absolute right-3', isOpen ? '' : 'rotate-180'), iconVersion: iconVersion, name: "ArrowUpIcon", width: "16", height: "16" }));
|
|
1190
|
-
const
|
|
1103
|
+
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');
|
|
1191
1104
|
|
|
1192
1105
|
const SelectControl = JSX(({ className = '', label, error, ...rest }) => (jsxs("div", { className: className, children: [jsx(Select, { ...rest, valid: !error, label: rest?.errors ? `${label}*` : label }), renderErrorText(error)] })));
|
|
1193
1106
|
|
|
1107
|
+
const ACQUIRING_TYPES = [
|
|
1108
|
+
{
|
|
1109
|
+
text: 'Торговый эквайринг',
|
|
1110
|
+
key: 'trade',
|
|
1111
|
+
},
|
|
1112
|
+
{
|
|
1113
|
+
text: 'СБП-эквайринг',
|
|
1114
|
+
key: 'sbp',
|
|
1115
|
+
},
|
|
1116
|
+
{
|
|
1117
|
+
text: 'Интернет-эквайринг',
|
|
1118
|
+
key: 'internet',
|
|
1119
|
+
},
|
|
1120
|
+
{
|
|
1121
|
+
text: 'Все виды эквайринга',
|
|
1122
|
+
key: 'all',
|
|
1123
|
+
},
|
|
1124
|
+
];
|
|
1125
|
+
|
|
1126
|
+
const isFilled = (_) => _ !== null && _ !== undefined;
|
|
1127
|
+
|
|
1128
|
+
const defaultCache = new Map();
|
|
1129
|
+
const applyCache = (fetcher, cache = defaultCache) => (args) => {
|
|
1130
|
+
const key = computeKey(args);
|
|
1131
|
+
const cachedData = cache.get(key);
|
|
1132
|
+
if (key && isFilled(cachedData)) {
|
|
1133
|
+
return cachedData;
|
|
1134
|
+
}
|
|
1135
|
+
const data = fetcher(...args);
|
|
1136
|
+
if (key && isFilled(data)) {
|
|
1137
|
+
cache.set(key, Promise.resolve(data));
|
|
1138
|
+
}
|
|
1139
|
+
return data;
|
|
1140
|
+
};
|
|
1141
|
+
const isKey = (args) => Boolean(args?.every(_ => (Array.isArray(_) ? isKey(_) : !_ || typeof _ === 'string')));
|
|
1142
|
+
const computeKey = (args) => (isKey(args) ? args.toString() : '');
|
|
1143
|
+
|
|
1144
|
+
const isFallbackKey = (args) => Boolean(args && Array.isArray(args) && args.length === 1 && typeof args[0] === 'string');
|
|
1145
|
+
function useAsyncData(key, fetcher, { fallback, cache } = {}) {
|
|
1146
|
+
const args = useMemo(() => keyToArgs(key), [key]);
|
|
1147
|
+
const [data, setData] = useState(undefined);
|
|
1148
|
+
const [error, setError] = useState(undefined);
|
|
1149
|
+
useEffect(() => {
|
|
1150
|
+
const isEmptyKey = !args.some(isFilled);
|
|
1151
|
+
if (isEmptyKey) {
|
|
1152
|
+
return;
|
|
1153
|
+
}
|
|
1154
|
+
let canceled = false;
|
|
1155
|
+
const setResult = (newData, err) => {
|
|
1156
|
+
if (!canceled) {
|
|
1157
|
+
setData(newData);
|
|
1158
|
+
setError(err);
|
|
1159
|
+
}
|
|
1160
|
+
};
|
|
1161
|
+
(async () => {
|
|
1162
|
+
try {
|
|
1163
|
+
setResult(await applyCache(fetcher, cache)(args));
|
|
1164
|
+
}
|
|
1165
|
+
catch (err) {
|
|
1166
|
+
setResult(undefined, err);
|
|
1167
|
+
}
|
|
1168
|
+
})();
|
|
1169
|
+
return () => {
|
|
1170
|
+
canceled = true;
|
|
1171
|
+
};
|
|
1172
|
+
}, [fetcher, cache, args]);
|
|
1173
|
+
const fallbackData = fallback && isFallbackKey(args) && fallback[args[0]];
|
|
1174
|
+
return {
|
|
1175
|
+
data: !data && fallbackData ? fallbackData : data,
|
|
1176
|
+
error,
|
|
1177
|
+
mutate: () => Promise.resolve(undefined) // TODO Clean up cache
|
|
1178
|
+
};
|
|
1179
|
+
}
|
|
1180
|
+
function keyToArgs(key) {
|
|
1181
|
+
if (Array.isArray(key)) {
|
|
1182
|
+
return key;
|
|
1183
|
+
}
|
|
1184
|
+
else if (key instanceof Function) {
|
|
1185
|
+
return keyToArgs(key());
|
|
1186
|
+
}
|
|
1187
|
+
else {
|
|
1188
|
+
return [key];
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
const REGIONS_URL$1 = '/api/v1/regions';
|
|
1193
|
+
function useRegions() {
|
|
1194
|
+
const { data } = useAsyncData(REGIONS_URL$1, fetchJSONUnsafe);
|
|
1195
|
+
return data || [];
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
const getNamesFromInput = (inputs) => Object.values(inputs).map((_) => _.name);
|
|
1199
|
+
|
|
1200
|
+
const validatorObj = {
|
|
1201
|
+
typeForm: defaultValidator,
|
|
1202
|
+
surname: nameValidator,
|
|
1203
|
+
name: nameValidator,
|
|
1204
|
+
region: defaultSelectValidator,
|
|
1205
|
+
phone: phoneValidator,
|
|
1206
|
+
birthday: defaultValidator,
|
|
1207
|
+
email: defaultValidator,
|
|
1208
|
+
fullName: defaultValidator,
|
|
1209
|
+
inn: innValidator,
|
|
1210
|
+
comment: defaultValidator,
|
|
1211
|
+
consentDataProcessing: checkboxValidator,
|
|
1212
|
+
};
|
|
1213
|
+
const getObjectValidator = (inputs) => {
|
|
1214
|
+
const requiredInputs = getNamesFromInput(inputs.filter((_) => ('required' in _ ? _.required : false)));
|
|
1215
|
+
return Object.fromEntries(requiredInputs.map((_) => [_, validatorObj?.[_]]));
|
|
1216
|
+
};
|
|
1217
|
+
|
|
1194
1218
|
const RegionField = JSX(({ field }) => {
|
|
1195
1219
|
const regions = useRegions();
|
|
1196
|
-
return (jsx(SelectControl, { className: "w-full", 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: regions.map(({ code = '', name = '' }) => ({ key: code, text: name })), ...withValidator(field('region'),
|
|
1220
|
+
return (jsx(SelectControl, { className: "w-full", 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: regions.map(({ code = '', name = '' }) => ({ key: code, text: name })), ...withValidator(field('region'), validatorObj.region) }));
|
|
1197
1221
|
});
|
|
1198
1222
|
|
|
1199
1223
|
const renderAcquiringRegion = ({ field, title }) => (jsxs(ApplicationFieldsetLayout, { title: title, children: [jsx("div", { className: formChildrenStyle, children: 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, ...withValidator(field('acquiringType'), defaultValidator) }) }), jsx("div", { className: formChildrenStyle, children: jsx(RegionField, { field: field }) })] }));
|
|
@@ -1230,7 +1254,7 @@
|
|
|
1230
1254
|
|
|
1231
1255
|
const renderSubmitButton = (button, className) => (jsx(Button, { className: style('w-full @xl:w-auto', className), type: "submit", children: button?.text ? button.text : 'Отправить заявку' }));
|
|
1232
1256
|
|
|
1233
|
-
const initialFormState$
|
|
1257
|
+
const initialFormState$7 = {
|
|
1234
1258
|
typeForm: { key: 'acqr', text: 'Предупреждение о мошенничестве' },
|
|
1235
1259
|
acquiringType: { key: 'trade', text: 'Торговый эквайринг' },
|
|
1236
1260
|
fullName: '',
|
|
@@ -1262,35 +1286,12 @@
|
|
|
1262
1286
|
};
|
|
1263
1287
|
isValidationSuccess(acquiringValidator(formState)) && onSubmit(submitData, false);
|
|
1264
1288
|
}, [onSubmit]);
|
|
1265
|
-
const [, { field, ...formProps }] = useForm(initialFormState$
|
|
1289
|
+
const [, { field, ...formProps }] = useForm(initialFormState$7, { onSubmit: handleSubmit });
|
|
1266
1290
|
const isSlideCheckboxes = getSlideCheckboxes(field('acquiringType').value?.key);
|
|
1267
1291
|
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 })] }));
|
|
1268
1292
|
});
|
|
1269
1293
|
const getSlideCheckboxes = (type) => type === 'all' || type === 'trade';
|
|
1270
1294
|
|
|
1271
|
-
const initialFormState$8 = {
|
|
1272
|
-
typeForm: { key: 'bcrd', text: 'Заявка на бизнес-карту' },
|
|
1273
|
-
name: '',
|
|
1274
|
-
phone: '',
|
|
1275
|
-
inn: '',
|
|
1276
|
-
email: '',
|
|
1277
|
-
};
|
|
1278
|
-
const businessCardValidator = objectValidator({
|
|
1279
|
-
region: defaultValidator,
|
|
1280
|
-
name: nameValidator,
|
|
1281
|
-
phone: phoneValidator,
|
|
1282
|
-
inn: innValidator,
|
|
1283
|
-
email: defaultValidator,
|
|
1284
|
-
});
|
|
1285
|
-
const ApplicationFormBusinessCard = JSX((props) => {
|
|
1286
|
-
const { button, link, onSubmit } = props;
|
|
1287
|
-
const handleSubmit = useCallback((formState) => {
|
|
1288
|
-
isValidationSuccess(businessCardValidator(formState)) && onSubmit(formState);
|
|
1289
|
-
}, [onSubmit]);
|
|
1290
|
-
const [, { field, ...formProps }] = useForm(initialFormState$8, { onSubmit: handleSubmit });
|
|
1291
|
-
return (jsxs("form", { className: formStyle$1, onSubmit: formProps.onSubmit, children: [jsx(RegionField, { field: field }), jsxs(ApplicationFieldsetLayout, { children: [jsxs("div", { className: formChildrenStyle, children: [jsx(InputControl, { label: "\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0435 \u043B\u0438\u0446\u043E", ...withValidator(field('name'), nameValidator) }), jsx(InputControl, { label: "\u0418\u041D\u041D", ...withValidator(field('inn'), innValidator) })] }), jsxs("div", { className: formChildrenStyle, children: [jsx(PhoneInputControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) }), jsx(InputControl, { label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...withValidator(field('email'), defaultValidator) })] })] }), renderSubmitButton(button), jsx(Footnote, { link: link })] }));
|
|
1292
|
-
});
|
|
1293
|
-
|
|
1294
1295
|
const BRANCHES_URL = '/api/v1/branches';
|
|
1295
1296
|
const EMPTY_VALUE$3 = [];
|
|
1296
1297
|
function useBranches(regionCode) {
|
|
@@ -1308,7 +1309,8 @@
|
|
|
1308
1309
|
return data || [];
|
|
1309
1310
|
}
|
|
1310
1311
|
|
|
1311
|
-
const AddressBranchField = JSX(({ field,
|
|
1312
|
+
const AddressBranchField = JSX(({ field, isPremium = false }) => {
|
|
1313
|
+
const regionKey = field('region')?.value?.key;
|
|
1312
1314
|
const addressBranch = isPremium
|
|
1313
1315
|
? usePremiumBranchesByRegions().find((_) => _?.region === regionKey)?.branches
|
|
1314
1316
|
: useBranches(regionKey).filter((branch) => branch?.address);
|
|
@@ -1387,7 +1389,7 @@
|
|
|
1387
1389
|
|
|
1388
1390
|
const renderCreditParameters = (field, title) => (jsxs(ApplicationFieldsetLayout, { title: title, children: [jsx("div", { className: formChildrenStyle, children: jsx(InputRange, { title: "\u0421\u0443\u043C\u043C\u0430, \u20BD", items: ITEMS_CREDIT_AMOUNT, min: MIN_CREDIT_AMOUNT, max: MAX_CREDIT_AMOUNT, ...field('amount') }) }), jsx("div", { className: formChildrenStyle, children: 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') }) })] }));
|
|
1389
1391
|
|
|
1390
|
-
const initialFormState$
|
|
1392
|
+
const initialFormState$6 = {
|
|
1391
1393
|
typeForm: { key: 'cred', text: 'Кредит' },
|
|
1392
1394
|
amount: MIN_CREDIT_AMOUNT,
|
|
1393
1395
|
term: 12,
|
|
@@ -1416,13 +1418,13 @@
|
|
|
1416
1418
|
partnerComments: `Сумма=${amount}/Срок=${term}/Выручка=${annualRevenue}`,
|
|
1417
1419
|
});
|
|
1418
1420
|
}, [onSubmit]);
|
|
1419
|
-
const [formState, { field, ...formProps }] = useForm(initialFormState$
|
|
1421
|
+
const [formState, { field, ...formProps }] = useForm(initialFormState$6, {
|
|
1420
1422
|
onSubmit: handleSubmit,
|
|
1421
1423
|
});
|
|
1422
1424
|
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 })] }));
|
|
1423
1425
|
});
|
|
1424
1426
|
|
|
1425
|
-
const initialFormState$
|
|
1427
|
+
const initialFormState$5 = {
|
|
1426
1428
|
typeForm: { key: 'dpst', text: 'Заявка на депозит' },
|
|
1427
1429
|
name: '',
|
|
1428
1430
|
phone: '',
|
|
@@ -1435,7 +1437,7 @@
|
|
|
1435
1437
|
const handleSubmit = useCallback((formState) => {
|
|
1436
1438
|
isValidationSuccess(depositValidator(formState)) && onSubmit(formState);
|
|
1437
1439
|
}, [onSubmit]);
|
|
1438
|
-
const [, { field, ...formProps }] = useForm(initialFormState$
|
|
1440
|
+
const [, { field, ...formProps }] = useForm(initialFormState$5, {
|
|
1439
1441
|
onSubmit: handleSubmit,
|
|
1440
1442
|
resetOnSubmit: false,
|
|
1441
1443
|
});
|
|
@@ -1490,7 +1492,7 @@
|
|
|
1490
1492
|
const role = (isRadio) => (isRadio ? 'radio' : 'checkbox');
|
|
1491
1493
|
const checkboxStyle = (value) => style('rounded border', value ? 'bg-primary-main' : '');
|
|
1492
1494
|
|
|
1493
|
-
const agreementText = 'Нажимая кнопку, вы подтверждаете согласие с';
|
|
1495
|
+
const agreementText = 'Нажимая кнопку, вы подтверждаете согласие с ';
|
|
1494
1496
|
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)] }));
|
|
1495
1497
|
|
|
1496
1498
|
const formatDate = (date, toTimeStamp = false) => {
|
|
@@ -1642,11 +1644,11 @@
|
|
|
1642
1644
|
selectedMonth,
|
|
1643
1645
|
showCalendar,
|
|
1644
1646
|
});
|
|
1645
|
-
return (jsxs("div", { className: style(
|
|
1647
|
+
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] })] }));
|
|
1646
1648
|
});
|
|
1647
1649
|
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" })] }));
|
|
1648
1650
|
|
|
1649
|
-
const DatePickerControl = JSX(({ className, label,
|
|
1651
|
+
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)] })));
|
|
1650
1652
|
|
|
1651
1653
|
const initialUserFormState = {
|
|
1652
1654
|
surname: '',
|
|
@@ -1655,7 +1657,7 @@
|
|
|
1655
1657
|
};
|
|
1656
1658
|
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] }));
|
|
1657
1659
|
|
|
1658
|
-
const initialFormState$
|
|
1660
|
+
const initialFormState$4 = {
|
|
1659
1661
|
...initialUserFormState,
|
|
1660
1662
|
typeForm: { key: 'FEEDBACK', text: 'Задать вопрос по продуктам и услугам' },
|
|
1661
1663
|
serviceDirection: { key: 'Физическое лицо' },
|
|
@@ -1681,7 +1683,7 @@
|
|
|
1681
1683
|
const handleSubmit = useCallback((feedbackFormState) => {
|
|
1682
1684
|
handleSubmitFeedback(feedbackFormState, onSubmit);
|
|
1683
1685
|
}, [onSubmit]);
|
|
1684
|
-
const [formState, { field, ...formProps }] = useForm(initialFormState$
|
|
1686
|
+
const [formState, { field, ...formProps }] = useForm(initialFormState$4, {
|
|
1685
1687
|
onSubmit: handleSubmit,
|
|
1686
1688
|
});
|
|
1687
1689
|
const isQualityService = field('typeForm').value?.key === 'FEEDBACK_QS';
|
|
@@ -1723,7 +1725,7 @@
|
|
|
1723
1725
|
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] }));
|
|
1724
1726
|
});
|
|
1725
1727
|
|
|
1726
|
-
const initialFormState$
|
|
1728
|
+
const initialFormState$3 = {
|
|
1727
1729
|
...initialUserFormState,
|
|
1728
1730
|
phone: '',
|
|
1729
1731
|
email: '',
|
|
@@ -1747,29 +1749,8 @@
|
|
|
1747
1749
|
product,
|
|
1748
1750
|
}, true);
|
|
1749
1751
|
}, [onSubmit]);
|
|
1750
|
-
const [, { field, ...formProps }] = useForm(initialFormState$4, { onSubmit: handleSubmit });
|
|
1751
|
-
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)] }));
|
|
1752
|
-
});
|
|
1753
|
-
|
|
1754
|
-
const initialFormState$3 = {
|
|
1755
|
-
typeForm: { key: 'SELFCOLLECTION', text: 'Самоинкассация' },
|
|
1756
|
-
fullName: '',
|
|
1757
|
-
phone: '',
|
|
1758
|
-
consentDataProcessing: false,
|
|
1759
|
-
};
|
|
1760
|
-
const feedbackValidator = objectValidator({
|
|
1761
|
-
typeForm: defaultValidator,
|
|
1762
|
-
region: defaultValidator,
|
|
1763
|
-
fullName: defaultValidator,
|
|
1764
|
-
phone: phoneValidator,
|
|
1765
|
-
consentDataProcessing: checkboxValidator,
|
|
1766
|
-
});
|
|
1767
|
-
const ApplicationFormSelfCollection = JSX(({ button, link, onSubmit }) => {
|
|
1768
|
-
const handleSubmit = useCallback((formState) => {
|
|
1769
|
-
isValidationSuccess(feedbackValidator(formState)) && onSubmit(formState, false);
|
|
1770
|
-
}, [onSubmit]);
|
|
1771
1752
|
const [, { field, ...formProps }] = useForm(initialFormState$3, { onSubmit: handleSubmit });
|
|
1772
|
-
return (
|
|
1753
|
+
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)] }));
|
|
1773
1754
|
});
|
|
1774
1755
|
|
|
1775
1756
|
const RegionPremiumField = JSX(({ field }) => {
|
|
@@ -1819,12 +1800,12 @@
|
|
|
1819
1800
|
|
|
1820
1801
|
const renderQuestionsInterested = (field) => {
|
|
1821
1802
|
const { value, onChange } = field('vedTypes');
|
|
1822
|
-
return (jsx(ApplicationFieldsetLayout, { children: jsxs("div", { className: "gap-
|
|
1803
|
+
return (jsx(ApplicationFieldsetLayout, { children: jsxs("div", { className: "gap-m grid @xl:flex @xl:items-center", children: [jsx(Radio, { name: "vedTypes", text: "\u0412\u0430\u043B\u044E\u0442\u043D\u044B\u0439 \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u044C", value: "currencyControl", checked: value === 'currencyControl', onChange: (_) => onChange && onChange(_) }), jsx(Radio, { name: "vedTypes", text: "\u0414\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0440\u043D\u044B\u0435 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438", value: "documentOperations", checked: value === 'documentOperations', onChange: (_) => onChange && onChange(_) }), jsx(Radio, { name: "vedTypes", text: "\u041A\u043E\u043D\u0432\u0435\u0440\u0441\u0438\u043E\u043D\u043D\u044B\u0435 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438", value: "conversionTransactions", checked: value === 'conversionTransactions', onChange: (_) => onChange && onChange(_) }), jsx(Radio, { name: "vedTypes", text: "\u0418\u043D\u044B\u0435 \u0432\u043E\u043F\u0440\u043E\u0441\u044B \u0412\u042D\u0414", value: "otherIssues", checked: value === 'otherIssues', onChange: (_) => onChange && onChange(_) })] }) }));
|
|
1823
1804
|
};
|
|
1824
1805
|
|
|
1825
1806
|
const renderWedDataOrganization = ({ field }) => {
|
|
1826
1807
|
const isCurrencyControl = field('vedTypes').value === 'currencyControl';
|
|
1827
|
-
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-
|
|
1808
|
+
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(PhoneInputControl, { 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] })] }));
|
|
1828
1809
|
};
|
|
1829
1810
|
|
|
1830
1811
|
const initialFormState$1 = {
|
|
@@ -1874,11 +1855,10 @@
|
|
|
1874
1855
|
isValidationSuccess(getValidator(vedTypes)(formState)) && onSubmit(data);
|
|
1875
1856
|
}, [onSubmit]);
|
|
1876
1857
|
const [, { field, ...formProps }] = useForm(initialFormState$1, { onSubmit: handleSubmit });
|
|
1877
|
-
return (jsxs("form", { className: "container space-y-
|
|
1858
|
+
return (jsxs("form", { className: "container space-y-m", onSubmit: formProps.onSubmit, children: [renderQuestionsInterested(field), jsx(Heading, { headingType: "h6", title: "\u0414\u0430\u043D\u043D\u044B\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", className: "@xl:text-center" }), renderWedDataOrganization({ field }), jsx(InputControl, { label: "\u041E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0435", placeholder: "\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0438\u043D\u0442\u0435\u0440\u0435\u0441\u0443\u044E\u0449\u0438\u0439 \u0432\u0430\u0441 \u0432\u043E\u043F\u0440\u043E\u0441, \u043C\u0435\u0441\u0442\u043E \u0432\u0435\u0434\u0435\u043D\u0438\u044F \u0431\u0438\u0437\u043D\u0435\u0441\u0430 \u0438 \u0443\u0434\u043E\u0431\u043D\u043E\u0435 \u0432\u0440\u0435\u043C\u044F \u0434\u043B\u044F \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u043D\u043E\u0433\u043E \u0437\u0432\u043E\u043D\u043A\u0430", ...field('partnerComments'), isTextarea: true }), renderSubmitButton(button), jsx(Footnote, { link: link }), jsx(Heading, { headingType: "h6", title: "\u0418\u043B\u0438 \u0441\u0432\u044F\u0436\u0438\u0442\u0435\u0441\u044C \u0441 \u043D\u0430\u043C\u0438 \u0443\u0434\u043E\u0431\u043D\u044B\u043C \u0441\u043F\u043E\u0441\u043E\u0431\u043E\u043C", className: "@xl:text-center" }), renderContacts()] }));
|
|
1878
1859
|
});
|
|
1879
1860
|
|
|
1880
1861
|
const EmbeddableForms = {
|
|
1881
|
-
ApplicationFormBusinessCard,
|
|
1882
1862
|
ApplicationFormWed,
|
|
1883
1863
|
ApplicationFormDeposit,
|
|
1884
1864
|
ApplicationFormCredit,
|
|
@@ -1886,7 +1866,6 @@
|
|
|
1886
1866
|
ApplicationFormGrantSupport,
|
|
1887
1867
|
ApplicationFormIndividuals,
|
|
1888
1868
|
ApplicationFormFeedback,
|
|
1889
|
-
ApplicationFormSelfCollection,
|
|
1890
1869
|
ApplicationFormUltraPremium,
|
|
1891
1870
|
};
|
|
1892
1871
|
|
|
@@ -1899,7 +1878,7 @@
|
|
|
1899
1878
|
setResponseType(status);
|
|
1900
1879
|
return status;
|
|
1901
1880
|
}, []);
|
|
1902
|
-
return (jsx(BlockWrapper, { className: className, defaultPadding: "p-6xl", ...rest, children: jsxs("div", { className: "container max-w-[978px] space-y-
|
|
1881
|
+
return (jsx(BlockWrapper, { className: className, defaultPadding: "p-6xl", ...rest, children: jsxs("div", { className: "container max-w-[978px] space-y-m", children: [formBlock?.title ? (jsx(Heading, { headingType: "h3", title: formBlock.title, className: "@xl:text-center" })) : null, formBlock ? renderEmbeddedForm(formBlock, handleSubmit) : null, responseType ? jsx(ResponseNotification, { responseType: responseType }) : null] }) }));
|
|
1903
1882
|
});
|
|
1904
1883
|
const renderEmbeddedForm = (formBlock, handleSubmit) => {
|
|
1905
1884
|
const type = formBlock?.formType;
|
|
@@ -1918,33 +1897,27 @@
|
|
|
1918
1897
|
|
|
1919
1898
|
const getFormatData = (data) => Object.fromEntries(Object.entries(data).map(([k, v]) => [k, (k === 'region' ? v?.text : v?.key) || v]));
|
|
1920
1899
|
|
|
1921
|
-
const columnStyle = {
|
|
1922
|
-
1: 'space-y-s max-w-2xl mx-auto',
|
|
1923
|
-
2: 'grid @xl:grid-cols-2 gap-s',
|
|
1924
|
-
};
|
|
1925
|
-
|
|
1926
1900
|
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)] })));
|
|
1927
1901
|
|
|
1928
|
-
const getField = (input,
|
|
1902
|
+
const getField = (field) => (input, index) => {
|
|
1929
1903
|
const { required } = input;
|
|
1930
1904
|
const InputsMap = {
|
|
1931
|
-
surname: (jsx(InputControl, { label: "\u0424\u0430\u043C\u0438\u043B\u0438\u044F", ...getValidation(field('surname'),
|
|
1932
|
-
name: jsx(InputControl, { label: "\u0418\u043C\u044F", ...getValidation(field('name'),
|
|
1905
|
+
surname: (jsx(InputControl, { label: "\u0424\u0430\u043C\u0438\u043B\u0438\u044F", ...getValidation(field('surname'), validatorObj.surname, required) })),
|
|
1906
|
+
name: (jsx(InputControl, { label: "\u0418\u043C\u044F", ...getValidation(field('name'), validatorObj.name, required) })),
|
|
1933
1907
|
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') })),
|
|
1934
|
-
phone: (jsx(PhoneInputControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...getValidation(field('phone'),
|
|
1935
|
-
email: (jsx(InputControl, { label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...getValidation(field('email'),
|
|
1936
|
-
|
|
1937
|
-
|
|
1908
|
+
phone: (jsx(PhoneInputControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...getValidation(field('phone'), validatorObj.phone, required) })),
|
|
1909
|
+
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) })),
|
|
1910
|
+
fullName: (jsx(InputControl, { label: "\u0424\u0418\u041E", ...getValidation(field('fullName'), validatorObj.fullName, required) })),
|
|
1911
|
+
inn: jsx(InputControl, { label: "\u0418\u041D\u041D", ...getValidation(field('inn'), validatorObj.inn, required) }),
|
|
1912
|
+
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 })),
|
|
1913
|
+
region: jsx(RegionField, { field: field, input: input }),
|
|
1914
|
+
birthday: (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...getValidation(field('birthday'), validatorObj.birthday, required) })),
|
|
1938
1915
|
client: (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"' })),
|
|
1939
|
-
birthday: (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0440\u043E\u0436\u0434\u0435\u043D\u0438\u044F", ...getValidation(field('birthday'), defaultValidator, required) })),
|
|
1940
|
-
legend: (jsx("legend", { className: "w-full col-span-2", children: jsx(Heading, { title: input.label, headingType: "h6", className: "@xl:text-center" }) })),
|
|
1941
1916
|
};
|
|
1942
|
-
return InputsMap[input.name];
|
|
1917
|
+
return jsx("div", { children: InputsMap[input.name] }, String(index));
|
|
1943
1918
|
};
|
|
1944
1919
|
const getValidation = (field, validator, required = false) => required ? withValidator(field, validator) : field;
|
|
1945
1920
|
|
|
1946
|
-
const getNamesFromInput = (inputs) => Object.values(inputs).map((_) => _.name);
|
|
1947
|
-
|
|
1948
1921
|
const initialFormState = {
|
|
1949
1922
|
typeForm: { key: '', text: '' },
|
|
1950
1923
|
region: { key: '', text: '' },
|
|
@@ -1956,30 +1929,16 @@
|
|
|
1956
1929
|
birthday: undefined,
|
|
1957
1930
|
comment: '',
|
|
1958
1931
|
consentDataProcessing: false,
|
|
1932
|
+
product: '',
|
|
1959
1933
|
};
|
|
1960
1934
|
const getInitialFormState = (inputs, typeForm = '') => {
|
|
1961
1935
|
const formState = Object.fromEntries(getNamesFromInput(inputs).map((_) => [_, initialFormState[_]]));
|
|
1962
1936
|
return { ...formState, typeForm: { key: typeForm, text: '' } };
|
|
1963
1937
|
};
|
|
1964
1938
|
|
|
1965
|
-
const validator = {
|
|
1966
|
-
typeForm: defaultValidator,
|
|
1967
|
-
surname: nameValidator,
|
|
1968
|
-
name: nameValidator,
|
|
1969
|
-
region: defaultValidator,
|
|
1970
|
-
phone: phoneValidator,
|
|
1971
|
-
birthday: defaultValidator,
|
|
1972
|
-
email: defaultValidator,
|
|
1973
|
-
comment: defaultValidator,
|
|
1974
|
-
consentDataProcessing: checkboxValidator,
|
|
1975
|
-
};
|
|
1976
|
-
const getObjectValidator = (inputs) => {
|
|
1977
|
-
const requiredInputs = getNamesFromInput(inputs.filter((_) => ('required' in _ ? _.required : false)));
|
|
1978
|
-
return Object.fromEntries(requiredInputs.map((_) => [_, validator?.[_]]));
|
|
1979
|
-
};
|
|
1980
|
-
|
|
1981
1939
|
const API = LeadServiceAPI();
|
|
1982
|
-
const ApplicationFormCustom = JSX(({ className, title, typeForm = '',
|
|
1940
|
+
const ApplicationFormCustom = JSX(({ className, title, typeForm = '', sections = [], button, link, endpoint }) => {
|
|
1941
|
+
const inputs = (sections?.flatMap((_) => _?.inputs) || []);
|
|
1983
1942
|
const initialFormState = getInitialFormState(inputs, typeForm);
|
|
1984
1943
|
const [responseType, setResponseType] = useState('');
|
|
1985
1944
|
const feedbackValidator = objectValidator(getObjectValidator(inputs));
|
|
@@ -1994,8 +1953,9 @@
|
|
|
1994
1953
|
}, []);
|
|
1995
1954
|
const [, { field, onSubmit }] = useForm(initialFormState, { onSubmit: handleSubmit });
|
|
1996
1955
|
const fieldName = getConsentDataProcessing(inputs)?.name;
|
|
1997
|
-
return (jsx(ApplicationFormLayout, { className: style(formStyle$1, className), title: title, responseType: responseType, children: jsxs("form", { className:
|
|
1956
|
+
return (jsx(ApplicationFormLayout, { className: style(formStyle$1, 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))] }, `section-${i}`))), renderAgreementSubmit(fieldName ? field('consentDataProcessing') : undefined, link, button)] }) }));
|
|
1998
1957
|
});
|
|
1958
|
+
const inputColumnStyles = (column) => column === 2 ? '@xl:grid-cols-2' : '';
|
|
1999
1959
|
const getConsentDataProcessing = (inputs) => inputs.find((_) => _?.name === 'consentDataProcessing');
|
|
2000
1960
|
|
|
2001
1961
|
/** @deprecated */
|
|
@@ -6075,7 +6035,7 @@
|
|
|
6075
6035
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
6076
6036
|
});
|
|
6077
6037
|
|
|
6078
|
-
const packageVersion = "0.14.
|
|
6038
|
+
const packageVersion = "0.14.201";
|
|
6079
6039
|
|
|
6080
6040
|
exports.Blocks = Blocks;
|
|
6081
6041
|
exports.ContentPage = ContentPage;
|