@redneckz/wildless-cms-uni-blocks 0.14.933 → 0.14.935
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/ProjectSettings.d.ts +1 -0
- package/bundle/api/LeadServiceAPI.d.ts +3 -0
- package/bundle/api/getSubmitBody.d.ts +600 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +766 -552
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationForm/ApplicationForm.d.ts +1 -0
- package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +1 -1
- package/bundle/components/ApplicationForm/handlers.d.ts +19 -0
- package/bundle/components/ApplicationForm/renderSections.d.ts +10 -0
- package/bundle/components/Header/DropdownMenu.d.ts +13 -3
- package/bundle/components/Header/HeaderQuickActionsMenu.d.ts +17 -0
- package/bundle/components/Header/HeaderSecondaryMenuButton.d.ts +1 -0
- package/bundle/components/Header/useDropdownSubMenu.d.ts +3 -2
- package/bundle/icons/IconName.d.ts +4 -2
- package/bundle/ui-kit/DialogManager/Dialog.d.ts +2 -0
- package/bundle/ui-kit/FormField/Fields/CallbackTimeField.d.ts +2 -0
- package/bundle/ui-kit/FormField/Fields/QuestionProductField.d.ts +2 -0
- package/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/bundle/ui-kit/FormField/validators.d.ts +1 -0
- package/bundle/ui-kit/InfoCard/InfoCard.d.ts +2 -0
- package/bundle/ui-kit/PhoneCallRequestDialog/PhoneCallRequestDialog.d.ts +6 -0
- package/bundle/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -0
- package/bundle/utils/getTimezone.d.ts +1 -0
- package/cosmos-static/icons/CallbackIcon.svg +1 -0
- package/cosmos-static/icons/sprites.svg +1 -0
- package/dist/ProjectSettings.d.ts +1 -0
- package/dist/ProjectSettings.js.map +1 -1
- package/dist/api/LeadServiceAPI.d.ts +3 -0
- package/dist/api/LeadServiceAPI.js +26 -0
- package/dist/api/LeadServiceAPI.js.map +1 -1
- package/dist/api/getSubmitBody.d.ts +600 -0
- package/dist/api/getSubmitBody.js +2 -1
- package/dist/api/getSubmitBody.js.map +1 -1
- package/dist/components/ApplicationForm/ApplicationForm.d.ts +1 -0
- package/dist/components/ApplicationForm/ApplicationForm.js +24 -36
- package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +1 -1
- package/dist/components/ApplicationForm/handlers.d.ts +19 -0
- package/dist/components/ApplicationForm/handlers.js +55 -0
- package/dist/components/ApplicationForm/handlers.js.map +1 -0
- package/dist/components/ApplicationForm/renderSections.d.ts +10 -0
- package/dist/components/ApplicationForm/renderSections.js +10 -0
- package/dist/components/ApplicationForm/renderSections.js.map +1 -0
- package/dist/components/Header/DropdownMenu.d.ts +13 -3
- package/dist/components/Header/DropdownMenu.js +8 -2
- package/dist/components/Header/DropdownMenu.js.map +1 -1
- package/dist/components/Header/HeaderQuickActionsMenu.d.ts +17 -0
- package/dist/components/Header/HeaderQuickActionsMenu.js +82 -0
- package/dist/components/Header/HeaderQuickActionsMenu.js.map +1 -0
- package/dist/components/Header/HeaderSecondaryMenuButton.d.ts +1 -0
- package/dist/components/Header/HeaderSecondaryMenuButton.js +2 -2
- package/dist/components/Header/HeaderSecondaryMenuButton.js.map +1 -1
- package/dist/components/Header/HeaderSubMenu.js +2 -1
- package/dist/components/Header/HeaderSubMenu.js.map +1 -1
- package/dist/components/Header/HeaderTop.js +3 -1
- package/dist/components/Header/HeaderTop.js.map +1 -1
- package/dist/components/Header/useDropdownSubMenu.d.ts +3 -2
- package/dist/components/Header/useDropdownSubMenu.js +2 -2
- package/dist/components/Header/useDropdownSubMenu.js.map +1 -1
- package/dist/icons/IconName.d.ts +4 -2
- package/dist/icons/IconName.js +2 -0
- package/dist/icons/IconName.js.map +1 -1
- package/dist/ui-kit/DialogManager/Dialog.d.ts +2 -0
- package/dist/ui-kit/DialogManager/Dialog.js +9 -1
- package/dist/ui-kit/DialogManager/Dialog.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/CallbackTimeField.d.ts +2 -0
- package/dist/ui-kit/FormField/Fields/CallbackTimeField.js +25 -0
- package/dist/ui-kit/FormField/Fields/CallbackTimeField.js.map +1 -0
- package/dist/ui-kit/FormField/Fields/QuestionProductField.d.ts +2 -0
- package/dist/ui-kit/FormField/Fields/QuestionProductField.js +17 -0
- package/dist/ui-kit/FormField/Fields/QuestionProductField.js.map +1 -0
- package/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/dist/ui-kit/FormField/getField.js +5 -0
- package/dist/ui-kit/FormField/getField.js.map +1 -1
- package/dist/ui-kit/FormField/getObjectValidator.js +3 -0
- package/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/dist/ui-kit/FormField/validators.d.ts +1 -0
- package/dist/ui-kit/FormField/validators.js +4 -1
- package/dist/ui-kit/FormField/validators.js.map +1 -1
- package/dist/ui-kit/InfoCard/InfoCard.d.ts +2 -0
- package/dist/ui-kit/InfoCard/InfoCard.js +2 -1
- package/dist/ui-kit/InfoCard/InfoCard.js.map +1 -1
- package/dist/ui-kit/PhoneCallRequestDialog/PhoneCallRequestDialog.d.ts +6 -0
- package/dist/ui-kit/PhoneCallRequestDialog/PhoneCallRequestDialog.js +27 -0
- package/dist/ui-kit/PhoneCallRequestDialog/PhoneCallRequestDialog.js.map +1 -0
- package/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -0
- package/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js +3 -2
- package/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js.map +1 -1
- package/dist/ui-kit/Select/renderSelectContainer.js +2 -1
- package/dist/ui-kit/Select/renderSelectContainer.js.map +1 -1
- package/dist/utils/getTimezone.d.ts +1 -0
- package/dist/utils/getTimezone.js +12 -0
- package/dist/utils/getTimezone.js.map +1 -0
- package/lib/ProjectSettings.d.ts +1 -0
- package/lib/ProjectSettings.js.map +1 -1
- package/lib/api/LeadServiceAPI.d.ts +3 -0
- package/lib/api/LeadServiceAPI.js +26 -0
- package/lib/api/LeadServiceAPI.js.map +1 -1
- package/lib/api/getSubmitBody.d.ts +600 -0
- package/lib/api/getSubmitBody.js +2 -1
- package/lib/api/getSubmitBody.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/ApplicationForm/ApplicationForm.d.ts +1 -0
- package/lib/components/ApplicationForm/ApplicationForm.js +23 -35
- package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +1 -1
- package/lib/components/ApplicationForm/handlers.d.ts +19 -0
- package/lib/components/ApplicationForm/handlers.js +50 -0
- package/lib/components/ApplicationForm/handlers.js.map +1 -0
- package/lib/components/ApplicationForm/renderSections.d.ts +10 -0
- package/lib/components/ApplicationForm/renderSections.js +7 -0
- package/lib/components/ApplicationForm/renderSections.js.map +1 -0
- package/lib/components/Header/DropdownMenu.d.ts +13 -3
- package/lib/components/Header/DropdownMenu.js +8 -2
- package/lib/components/Header/DropdownMenu.js.map +1 -1
- package/lib/components/Header/HeaderQuickActionsMenu.d.ts +17 -0
- package/lib/components/Header/HeaderQuickActionsMenu.js +79 -0
- package/lib/components/Header/HeaderQuickActionsMenu.js.map +1 -0
- package/lib/components/Header/HeaderSecondaryMenuButton.d.ts +1 -0
- package/lib/components/Header/HeaderSecondaryMenuButton.js +2 -2
- package/lib/components/Header/HeaderSecondaryMenuButton.js.map +1 -1
- package/lib/components/Header/HeaderSubMenu.js +2 -1
- package/lib/components/Header/HeaderSubMenu.js.map +1 -1
- package/lib/components/Header/HeaderTop.js +3 -1
- package/lib/components/Header/HeaderTop.js.map +1 -1
- package/lib/components/Header/useDropdownSubMenu.d.ts +3 -2
- package/lib/components/Header/useDropdownSubMenu.js +2 -2
- package/lib/components/Header/useDropdownSubMenu.js.map +1 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapLayout.d.ts +1 -1
- package/lib/icons/IconName.d.ts +4 -2
- package/lib/icons/IconName.js +2 -0
- package/lib/icons/IconName.js.map +1 -1
- package/lib/ui-kit/DialogManager/Dialog.d.ts +2 -0
- package/lib/ui-kit/DialogManager/Dialog.js +9 -1
- package/lib/ui-kit/DialogManager/Dialog.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/CallbackTimeField.d.ts +2 -0
- package/lib/ui-kit/FormField/Fields/CallbackTimeField.js +23 -0
- package/lib/ui-kit/FormField/Fields/CallbackTimeField.js.map +1 -0
- package/lib/ui-kit/FormField/Fields/QuestionProductField.d.ts +2 -0
- package/lib/ui-kit/FormField/Fields/QuestionProductField.js +15 -0
- package/lib/ui-kit/FormField/Fields/QuestionProductField.js.map +1 -0
- package/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/lib/ui-kit/FormField/getField.js +5 -0
- package/lib/ui-kit/FormField/getField.js.map +1 -1
- package/lib/ui-kit/FormField/getObjectValidator.js +4 -1
- package/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/lib/ui-kit/FormField/validators.d.ts +1 -0
- package/lib/ui-kit/FormField/validators.js +2 -0
- package/lib/ui-kit/FormField/validators.js.map +1 -1
- package/lib/ui-kit/InfoCard/InfoCard.d.ts +2 -0
- package/lib/ui-kit/InfoCard/InfoCard.js +2 -1
- package/lib/ui-kit/InfoCard/InfoCard.js.map +1 -1
- package/lib/ui-kit/PhoneCallRequestDialog/PhoneCallRequestDialog.d.ts +6 -0
- package/lib/ui-kit/PhoneCallRequestDialog/PhoneCallRequestDialog.fixture.d.ts +5 -0
- package/lib/ui-kit/PhoneCallRequestDialog/PhoneCallRequestDialog.js +24 -0
- package/lib/ui-kit/PhoneCallRequestDialog/PhoneCallRequestDialog.js.map +1 -0
- package/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -0
- package/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js +3 -2
- package/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js.map +1 -1
- package/lib/ui-kit/Select/renderSelectContainer.js +2 -1
- package/lib/ui-kit/Select/renderSelectContainer.js.map +1 -1
- package/lib/utils/getTimezone.d.ts +1 -0
- package/lib/utils/getTimezone.js +9 -0
- package/lib/utils/getTimezone.js.map +1 -0
- package/mobile/bundle/ProjectSettings.d.ts +1 -0
- package/mobile/bundle/api/LeadServiceAPI.d.ts +3 -0
- package/mobile/bundle/api/getSubmitBody.d.ts +600 -0
- package/mobile/bundle/bundle.umd.js +807 -542
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationForm/ApplicationForm.d.ts +1 -0
- package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +1 -1
- package/mobile/bundle/components/ApplicationForm/handlers.d.ts +19 -0
- package/mobile/bundle/components/ApplicationForm/renderSections.d.ts +10 -0
- package/mobile/bundle/components/Header/DropdownMenu.d.ts +13 -3
- package/mobile/bundle/components/Header/HeaderQuickActionsMenu.d.ts +17 -0
- package/mobile/bundle/components/Header/HeaderSecondaryMenuButton.d.ts +1 -0
- package/mobile/bundle/components/Header/useDropdownSubMenu.d.ts +3 -2
- package/mobile/bundle/icons/IconName.d.ts +4 -2
- package/mobile/bundle/ui-kit/DialogManager/Dialog.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/Fields/CallbackTimeField.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/Fields/QuestionProductField.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/bundle/ui-kit/FormField/validators.d.ts +1 -0
- package/mobile/bundle/ui-kit/InfoCard/InfoCard.d.ts +2 -0
- package/mobile/bundle/ui-kit/PhoneCallRequestDialog/PhoneCallRequestDialog.d.ts +6 -0
- package/mobile/bundle/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -0
- package/mobile/bundle/utils/getTimezone.d.ts +1 -0
- package/mobile/dist/ProjectSettings.d.ts +1 -0
- package/mobile/dist/ProjectSettings.js.map +1 -1
- package/mobile/dist/api/LeadServiceAPI.d.ts +3 -0
- package/mobile/dist/api/LeadServiceAPI.js +26 -0
- package/mobile/dist/api/LeadServiceAPI.js.map +1 -1
- package/mobile/dist/api/getSubmitBody.d.ts +600 -0
- package/mobile/dist/api/getSubmitBody.js +2 -1
- package/mobile/dist/api/getSubmitBody.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationForm.d.ts +1 -0
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js +24 -36
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +1 -1
- package/mobile/dist/components/ApplicationForm/handlers.d.ts +19 -0
- package/mobile/dist/components/ApplicationForm/handlers.js +55 -0
- package/mobile/dist/components/ApplicationForm/handlers.js.map +1 -0
- package/mobile/dist/components/ApplicationForm/renderSections.d.ts +10 -0
- package/mobile/dist/components/ApplicationForm/renderSections.js +10 -0
- package/mobile/dist/components/ApplicationForm/renderSections.js.map +1 -0
- package/mobile/dist/components/Header/DropdownMenu.d.ts +13 -3
- package/mobile/dist/components/Header/DropdownMenu.js +8 -2
- package/mobile/dist/components/Header/DropdownMenu.js.map +1 -1
- package/mobile/dist/components/Header/HeaderQuickActionsMenu.d.ts +17 -0
- package/mobile/dist/components/Header/HeaderQuickActionsMenu.js +82 -0
- package/mobile/dist/components/Header/HeaderQuickActionsMenu.js.map +1 -0
- package/mobile/dist/components/Header/HeaderSecondaryMenuButton.d.ts +1 -0
- package/mobile/dist/components/Header/HeaderSecondaryMenuButton.js +2 -2
- package/mobile/dist/components/Header/HeaderSecondaryMenuButton.js.map +1 -1
- package/mobile/dist/components/Header/HeaderSubMenu.js +2 -1
- package/mobile/dist/components/Header/HeaderSubMenu.js.map +1 -1
- package/mobile/dist/components/Header/HeaderTop.js +3 -1
- package/mobile/dist/components/Header/HeaderTop.js.map +1 -1
- package/mobile/dist/components/Header/useDropdownSubMenu.d.ts +3 -2
- package/mobile/dist/components/Header/useDropdownSubMenu.js +2 -2
- package/mobile/dist/components/Header/useDropdownSubMenu.js.map +1 -1
- package/mobile/dist/icons/IconName.d.ts +4 -2
- package/mobile/dist/icons/IconName.js +2 -0
- package/mobile/dist/icons/IconName.js.map +1 -1
- package/mobile/dist/ui-kit/DialogManager/Dialog.d.ts +2 -0
- package/mobile/dist/ui-kit/DialogManager/Dialog.js +9 -1
- package/mobile/dist/ui-kit/DialogManager/Dialog.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/CallbackTimeField.d.ts +2 -0
- package/mobile/dist/ui-kit/FormField/Fields/CallbackTimeField.js +25 -0
- package/mobile/dist/ui-kit/FormField/Fields/CallbackTimeField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/QuestionProductField.d.ts +2 -0
- package/mobile/dist/ui-kit/FormField/Fields/QuestionProductField.js +17 -0
- package/mobile/dist/ui-kit/FormField/Fields/QuestionProductField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/dist/ui-kit/FormField/getField.js +5 -0
- package/mobile/dist/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js +3 -0
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/validators.d.ts +1 -0
- package/mobile/dist/ui-kit/FormField/validators.js +4 -1
- package/mobile/dist/ui-kit/FormField/validators.js.map +1 -1
- package/mobile/dist/ui-kit/InfoCard/InfoCard.d.ts +2 -0
- package/mobile/dist/ui-kit/InfoCard/InfoCard.js +2 -1
- package/mobile/dist/ui-kit/InfoCard/InfoCard.js.map +1 -1
- package/mobile/dist/ui-kit/PhoneCallRequestDialog/PhoneCallRequestDialog.d.ts +6 -0
- package/mobile/dist/ui-kit/PhoneCallRequestDialog/PhoneCallRequestDialog.js +27 -0
- package/mobile/dist/ui-kit/PhoneCallRequestDialog/PhoneCallRequestDialog.js.map +1 -0
- package/mobile/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -0
- package/mobile/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js +3 -2
- package/mobile/dist/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js.map +1 -1
- package/mobile/dist/ui-kit/Select/renderSelectContainer.js +2 -1
- package/mobile/dist/ui-kit/Select/renderSelectContainer.js.map +1 -1
- package/mobile/dist/utils/getTimezone.d.ts +1 -0
- package/mobile/dist/utils/getTimezone.js +12 -0
- package/mobile/dist/utils/getTimezone.js.map +1 -0
- package/mobile/lib/ProjectSettings.d.ts +1 -0
- package/mobile/lib/ProjectSettings.js.map +1 -1
- package/mobile/lib/api/LeadServiceAPI.d.ts +3 -0
- package/mobile/lib/api/LeadServiceAPI.js +26 -0
- package/mobile/lib/api/LeadServiceAPI.js.map +1 -1
- package/mobile/lib/api/getSubmitBody.d.ts +600 -0
- package/mobile/lib/api/getSubmitBody.js +2 -1
- package/mobile/lib/api/getSubmitBody.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationForm.d.ts +1 -0
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js +23 -35
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +1 -1
- package/mobile/lib/components/ApplicationForm/handlers.d.ts +19 -0
- package/mobile/lib/components/ApplicationForm/handlers.js +50 -0
- package/mobile/lib/components/ApplicationForm/handlers.js.map +1 -0
- package/mobile/lib/components/ApplicationForm/renderSections.d.ts +10 -0
- package/mobile/lib/components/ApplicationForm/renderSections.js +7 -0
- package/mobile/lib/components/ApplicationForm/renderSections.js.map +1 -0
- package/mobile/lib/components/Header/DropdownMenu.d.ts +13 -3
- package/mobile/lib/components/Header/DropdownMenu.js +8 -2
- package/mobile/lib/components/Header/DropdownMenu.js.map +1 -1
- package/mobile/lib/components/Header/HeaderQuickActionsMenu.d.ts +17 -0
- package/mobile/lib/components/Header/HeaderQuickActionsMenu.js +79 -0
- package/mobile/lib/components/Header/HeaderQuickActionsMenu.js.map +1 -0
- package/mobile/lib/components/Header/HeaderSecondaryMenuButton.d.ts +1 -0
- package/mobile/lib/components/Header/HeaderSecondaryMenuButton.js +2 -2
- package/mobile/lib/components/Header/HeaderSecondaryMenuButton.js.map +1 -1
- package/mobile/lib/components/Header/HeaderSubMenu.js +2 -1
- package/mobile/lib/components/Header/HeaderSubMenu.js.map +1 -1
- package/mobile/lib/components/Header/HeaderTop.js +3 -1
- package/mobile/lib/components/Header/HeaderTop.js.map +1 -1
- package/mobile/lib/components/Header/useDropdownSubMenu.d.ts +3 -2
- package/mobile/lib/components/Header/useDropdownSubMenu.js +2 -2
- package/mobile/lib/components/Header/useDropdownSubMenu.js.map +1 -1
- package/mobile/lib/icons/IconName.d.ts +4 -2
- package/mobile/lib/icons/IconName.js +2 -0
- package/mobile/lib/icons/IconName.js.map +1 -1
- package/mobile/lib/ui-kit/DialogManager/Dialog.d.ts +2 -0
- package/mobile/lib/ui-kit/DialogManager/Dialog.js +9 -1
- package/mobile/lib/ui-kit/DialogManager/Dialog.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/CallbackTimeField.d.ts +2 -0
- package/mobile/lib/ui-kit/FormField/Fields/CallbackTimeField.js +23 -0
- package/mobile/lib/ui-kit/FormField/Fields/CallbackTimeField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/QuestionProductField.d.ts +2 -0
- package/mobile/lib/ui-kit/FormField/Fields/QuestionProductField.js +15 -0
- package/mobile/lib/ui-kit/FormField/Fields/QuestionProductField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/lib/ui-kit/FormField/getField.js +5 -0
- package/mobile/lib/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js +4 -1
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/validators.d.ts +1 -0
- package/mobile/lib/ui-kit/FormField/validators.js +2 -0
- package/mobile/lib/ui-kit/FormField/validators.js.map +1 -1
- package/mobile/lib/ui-kit/InfoCard/InfoCard.d.ts +2 -0
- package/mobile/lib/ui-kit/InfoCard/InfoCard.js +2 -1
- package/mobile/lib/ui-kit/InfoCard/InfoCard.js.map +1 -1
- package/mobile/lib/ui-kit/PhoneCallRequestDialog/PhoneCallRequestDialog.d.ts +6 -0
- package/mobile/lib/ui-kit/PhoneCallRequestDialog/PhoneCallRequestDialog.js +24 -0
- package/mobile/lib/ui-kit/PhoneCallRequestDialog/PhoneCallRequestDialog.js.map +1 -0
- package/mobile/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.d.ts +1 -0
- package/mobile/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js +3 -2
- package/mobile/lib/ui-kit/ResponseTypeDialog/ResponseTypeDialog.js.map +1 -1
- package/mobile/lib/ui-kit/Select/renderSelectContainer.js +2 -1
- package/mobile/lib/ui-kit/Select/renderSelectContainer.js.map +1 -1
- package/mobile/lib/utils/getTimezone.d.ts +1 -0
- package/mobile/lib/utils/getTimezone.js +9 -0
- package/mobile/lib/utils/getTimezone.js.map +1 -0
- package/mobile/src/ProjectSettings.ts +1 -0
- package/mobile/src/api/LeadServiceAPI.ts +34 -1
- package/mobile/src/api/getSubmitBody.ts +2 -0
- package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +34 -60
- package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +1 -1
- package/mobile/src/components/ApplicationForm/handlers.ts +97 -0
- package/mobile/src/components/ApplicationForm/renderSections.tsx +25 -0
- package/mobile/src/components/Header/DropdownMenu.tsx +37 -14
- package/mobile/src/components/Header/HeaderQuickActionsMenu.tsx +134 -0
- package/mobile/src/components/Header/HeaderSecondaryMenuButton.tsx +3 -0
- package/mobile/src/components/Header/HeaderSubMenu.tsx +12 -1
- package/mobile/src/components/Header/HeaderTop.tsx +21 -6
- package/mobile/src/components/Header/useDropdownSubMenu.tsx +14 -3
- package/mobile/src/icons/CallbackIcon.svg +3 -0
- package/mobile/src/icons/IconName.ts +4 -4
- package/mobile/src/ui-kit/DialogManager/Dialog.tsx +34 -17
- package/mobile/src/ui-kit/FormField/Fields/CallbackTimeField.tsx +32 -0
- package/mobile/src/ui-kit/FormField/Fields/QuestionProductField.tsx +25 -0
- package/mobile/src/ui-kit/FormField/NameFieldDef.ts +4 -2
- package/mobile/src/ui-kit/FormField/getField.tsx +5 -0
- package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +4 -0
- package/mobile/src/ui-kit/FormField/validators.ts +6 -0
- package/mobile/src/ui-kit/InfoCard/InfoCard.tsx +9 -2
- package/mobile/src/ui-kit/PhoneCallRequestDialog/PhoneCallRequestDialog.tsx +49 -0
- package/mobile/src/ui-kit/ResponseTypeDialog/ResponseTypeDialog.tsx +29 -24
- package/mobile/src/ui-kit/Select/renderSelectContainer.tsx +2 -1
- package/mobile/src/utils/getTimezone.ts +9 -0
- package/package.json +2 -2
- package/src/ProjectSettings.ts +1 -0
- package/src/api/LeadServiceAPI.ts +34 -1
- package/src/api/getSubmitBody.ts +2 -0
- package/src/components/ApplicationForm/ApplicationForm.tsx +34 -60
- package/src/components/ApplicationForm/ApplicationFormContent.ts +1 -1
- package/src/components/ApplicationForm/handlers.ts +97 -0
- package/src/components/ApplicationForm/renderSections.tsx +25 -0
- package/src/components/Header/DropdownMenu.tsx +37 -14
- package/src/components/Header/Header.fixture.mobile.tsx +2 -0
- package/src/components/Header/HeaderQuickActionsMenu.tsx +134 -0
- package/src/components/Header/HeaderSecondaryMenuButton.tsx +3 -0
- package/src/components/Header/HeaderSubMenu.tsx +12 -1
- package/src/components/Header/HeaderTop.tsx +21 -6
- package/src/components/Header/useDropdownSubMenu.tsx +14 -3
- package/src/icons/CallbackIcon.svg +3 -0
- package/src/icons/IconName.ts +4 -4
- package/src/ui-kit/DialogManager/Dialog.tsx +34 -17
- package/src/ui-kit/FormField/Fields/CallbackTimeField.tsx +32 -0
- package/src/ui-kit/FormField/Fields/QuestionProductField.tsx +25 -0
- package/src/ui-kit/FormField/NameFieldDef.ts +4 -2
- package/src/ui-kit/FormField/getField.tsx +5 -0
- package/src/ui-kit/FormField/getObjectValidator.tsx +4 -0
- package/src/ui-kit/FormField/validators.ts +6 -0
- package/src/ui-kit/InfoCard/InfoCard.tsx +9 -2
- package/src/ui-kit/PhoneCallRequestDialog/PhoneCallRequestDialog.fixture.tsx +7 -0
- package/src/ui-kit/PhoneCallRequestDialog/PhoneCallRequestDialog.tsx +49 -0
- package/src/ui-kit/ResponseTypeDialog/ResponseTypeDialog.tsx +29 -24
- package/src/ui-kit/Select/renderSelectContainer.tsx +2 -1
- package/src/utils/getTimezone.ts +9 -0
|
@@ -995,144 +995,6 @@
|
|
|
995
995
|
});
|
|
996
996
|
const randomNumber = (min = 0, max = 0) => Math.floor(Math.random() * (max - min) + min);
|
|
997
997
|
|
|
998
|
-
const API_BASE_URI$1 = '/api/v1';
|
|
999
|
-
const RETAIL_API_BASE_URI = '/light-api-cash/v1';
|
|
1000
|
-
|
|
1001
|
-
const formatDate = (date, toTimeStamp = false) => {
|
|
1002
|
-
if (typeof date === 'string') {
|
|
1003
|
-
return date.split('-').reverse().join('.');
|
|
1004
|
-
}
|
|
1005
|
-
else {
|
|
1006
|
-
const day = String(date.getDate()).padStart(2, '0');
|
|
1007
|
-
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
1008
|
-
const year = String(date.getFullYear());
|
|
1009
|
-
return toTimeStamp ? `${year}-${month}-${day}` : `${day}.${month}.${year}`;
|
|
1010
|
-
}
|
|
1011
|
-
};
|
|
1012
|
-
|
|
1013
|
-
const formatPhone = (phone) => phone?.replace(/[^+\d]/g, '');
|
|
1014
|
-
|
|
1015
|
-
const getSubmitBody = (body, isNaturalPerson, router) => {
|
|
1016
|
-
const { typeForm, region, phone = '', email, birthday, desiredMeetingDate, inn, fullRegion, addressBranch, secondaryPhone = '', bankEmpolee, applicationDate, partnerName, ...staticBody } = body;
|
|
1017
|
-
return {
|
|
1018
|
-
typeForm,
|
|
1019
|
-
...getRegion$1(region, isNaturalPerson),
|
|
1020
|
-
...getEmail(email, isNaturalPerson),
|
|
1021
|
-
...getPhone(phone),
|
|
1022
|
-
...getFormatDate(desiredMeetingDate, 'desiredMeetingDate'),
|
|
1023
|
-
...(isNaturalPerson ? getFormatDate(birthday) : { inn }),
|
|
1024
|
-
...(typeForm === 'FEEDBACK'
|
|
1025
|
-
? {}
|
|
1026
|
-
: {
|
|
1027
|
-
addressBranch,
|
|
1028
|
-
bankEmpolee,
|
|
1029
|
-
applicationDate,
|
|
1030
|
-
...getSecondaryPhone(secondaryPhone),
|
|
1031
|
-
}),
|
|
1032
|
-
...addPageSlug(typeForm, router),
|
|
1033
|
-
...formatPFForm(typeForm, {
|
|
1034
|
-
fullRegion,
|
|
1035
|
-
partnerName,
|
|
1036
|
-
}),
|
|
1037
|
-
...staticBody,
|
|
1038
|
-
};
|
|
1039
|
-
};
|
|
1040
|
-
const getPhoneBody = (phone) => {
|
|
1041
|
-
return {
|
|
1042
|
-
...getPhone(phone),
|
|
1043
|
-
};
|
|
1044
|
-
};
|
|
1045
|
-
const getPhone = (phone) => (phone ? { phone: formatPhone(phone) } : {});
|
|
1046
|
-
const getFormatDate = (date, key = 'birthday') => date ? { [key]: formatDate(date) } : {};
|
|
1047
|
-
const getRegion$1 = (region, isNaturalPerson = true) => ({
|
|
1048
|
-
[isNaturalPerson ? 'regionBranch' : 'region']: region,
|
|
1049
|
-
});
|
|
1050
|
-
const getEmail = (email, isNaturalPerson = true) => ({
|
|
1051
|
-
[isNaturalPerson ? 'email' : 'mail']: email,
|
|
1052
|
-
});
|
|
1053
|
-
const getSecondaryPhone = (secondaryPhone = '') => !secondaryPhone || secondaryPhone === '+7 ('
|
|
1054
|
-
? {}
|
|
1055
|
-
: { secondaryPhoneNumber: formatPhone(secondaryPhone) };
|
|
1056
|
-
const formatPFForm = (typeForm, data) => typeForm === 'PF'
|
|
1057
|
-
? {
|
|
1058
|
-
region: data?.fullRegion,
|
|
1059
|
-
partner: data?.partnerName,
|
|
1060
|
-
}
|
|
1061
|
-
: {};
|
|
1062
|
-
const addPageSlug = (typeForm, router) => typeForm === 'UNIVERSAL'
|
|
1063
|
-
? {
|
|
1064
|
-
typeForm: router?.pathname?.split('/')?.at(-1) || '/',
|
|
1065
|
-
}
|
|
1066
|
-
: {};
|
|
1067
|
-
|
|
1068
|
-
function LeadServiceAPI() {
|
|
1069
|
-
async function send(body, router, isIndividualType = false) {
|
|
1070
|
-
const { serviceDirection } = body;
|
|
1071
|
-
const isNaturalPerson = isIndividualType && serviceDirection !== 'Юридическое лицо / ИП';
|
|
1072
|
-
const url = `${API_BASE_URI$1}${isNaturalPerson ? '/lead' : '/sendcorporatelead'}`;
|
|
1073
|
-
const submitBody = getSubmitBody(body, isNaturalPerson, router);
|
|
1074
|
-
try {
|
|
1075
|
-
const response = await LeadServiceFetch(url, submitBody);
|
|
1076
|
-
if (!response?.ok) {
|
|
1077
|
-
return null;
|
|
1078
|
-
}
|
|
1079
|
-
return await response.json();
|
|
1080
|
-
}
|
|
1081
|
-
catch (e) {
|
|
1082
|
-
return null;
|
|
1083
|
-
}
|
|
1084
|
-
}
|
|
1085
|
-
async function sendCode({ phone }) {
|
|
1086
|
-
const submitBody = getPhoneBody(phone);
|
|
1087
|
-
try {
|
|
1088
|
-
const response = LeadServiceFetch(`${API_BASE_URI$1}/initCorporateLead`, submitBody).then(async (res) => {
|
|
1089
|
-
if (!res.ok) {
|
|
1090
|
-
throw new Error(`Ошибка HTTP: ${res.status}`);
|
|
1091
|
-
}
|
|
1092
|
-
return await res.text();
|
|
1093
|
-
});
|
|
1094
|
-
return await response;
|
|
1095
|
-
}
|
|
1096
|
-
catch (e) {
|
|
1097
|
-
return null;
|
|
1098
|
-
}
|
|
1099
|
-
}
|
|
1100
|
-
async function checkCode({ reqId, code, body }) {
|
|
1101
|
-
const submitBody = {
|
|
1102
|
-
requestId: reqId,
|
|
1103
|
-
confimationCode: code,
|
|
1104
|
-
leadRequest: getSubmitBody(body, false),
|
|
1105
|
-
};
|
|
1106
|
-
try {
|
|
1107
|
-
const response = await LeadServiceFetch(`${API_BASE_URI$1}/confirmCorporateLead`, submitBody);
|
|
1108
|
-
return await response.json();
|
|
1109
|
-
}
|
|
1110
|
-
catch (e) {
|
|
1111
|
-
return null;
|
|
1112
|
-
}
|
|
1113
|
-
}
|
|
1114
|
-
return {
|
|
1115
|
-
send,
|
|
1116
|
-
sendCode,
|
|
1117
|
-
checkCode,
|
|
1118
|
-
};
|
|
1119
|
-
}
|
|
1120
|
-
const LeadServiceFetch = (url, submitBody) => fetch(url, {
|
|
1121
|
-
method: 'POST',
|
|
1122
|
-
headers: { 'Content-Type': 'application/json' },
|
|
1123
|
-
mode: 'cors',
|
|
1124
|
-
body: JSON.stringify(submitBody),
|
|
1125
|
-
});
|
|
1126
|
-
|
|
1127
|
-
const handleAspects = async ({ aspectsAttributes, aspects, ev }) => {
|
|
1128
|
-
for (const { aspectName, params } of aspectsAttributes ?? []) {
|
|
1129
|
-
const aspectFn = aspects[aspectName ?? ''];
|
|
1130
|
-
if (aspectFn) {
|
|
1131
|
-
await aspectFn(ev, params);
|
|
1132
|
-
}
|
|
1133
|
-
}
|
|
1134
|
-
};
|
|
1135
|
-
|
|
1136
998
|
function locationNavigator() {
|
|
1137
999
|
return locationNavigator._impl();
|
|
1138
1000
|
}
|
|
@@ -1325,6 +1187,138 @@
|
|
|
1325
1187
|
|
|
1326
1188
|
const getConsentDataProcessing = (inputs) => inputs?.find((_) => _?.name === 'consentDataProcessing');
|
|
1327
1189
|
|
|
1190
|
+
const cyrillicPattern = /^[а-яё-]*$/i;
|
|
1191
|
+
const isCyrillic = (_ = '') => cyrillicPattern.test(_);
|
|
1192
|
+
|
|
1193
|
+
const required = validator((_) => _ !== null && _ !== undefined && _ !== '');
|
|
1194
|
+
|
|
1195
|
+
const ERROR_MESSAGE$1 = 'Некорректно заполненное поле';
|
|
1196
|
+
const defaultValidator = (errorMsg) => required(errorMsg ?? ERROR_MESSAGE$1);
|
|
1197
|
+
const defaultSelectValidator = (errorMsg) => validator((_) => _?.key && _?.key !== '')(errorMsg ?? ERROR_MESSAGE$1);
|
|
1198
|
+
const nameValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length > 1 && isCyrillic(_))(errorMsg ?? ERROR_MESSAGE$1);
|
|
1199
|
+
const innValidator = (errorMsg) => validator((_) => isValidInnLength(_))(errorMsg);
|
|
1200
|
+
const innDadataValidator = (errorMsg) => validator((_) => Boolean(_?.text) && isValidInnLength(_.text))(errorMsg);
|
|
1201
|
+
const phoneValidate = (email) => /^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(email);
|
|
1202
|
+
const russianPhoneValidate = (email) => /^(\+7)?[\s-]?\(?[3489][0-9]{2}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(email);
|
|
1203
|
+
const phoneValidator = (errorMsg) => validator(phoneValidate)(errorMsg);
|
|
1204
|
+
const russianPhoneValidator = (errorMsg) => validator(russianPhoneValidate)(errorMsg);
|
|
1205
|
+
const agreementValidator = validator((_) => typeof _ === 'boolean' && _)('Согласие обязательно');
|
|
1206
|
+
const emailValidate = (email) => /^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(email);
|
|
1207
|
+
const emailValidator = (errorMsg) => validator((_) => emailValidate(_))(errorMsg);
|
|
1208
|
+
const isValidInnLength = (value) => typeof value === 'string' && (value.length === 10 || value.length === 12);
|
|
1209
|
+
|
|
1210
|
+
const validatorObj$1 = {
|
|
1211
|
+
fullName: defaultValidator(),
|
|
1212
|
+
addressBranch: defaultSelectValidator(),
|
|
1213
|
+
desiredMeetingDate: defaultValidator(),
|
|
1214
|
+
product: defaultValidator(),
|
|
1215
|
+
localities: defaultValidator(),
|
|
1216
|
+
partnerComments: defaultValidator(),
|
|
1217
|
+
collectionCount: defaultValidator(),
|
|
1218
|
+
acquiringType: defaultSelectValidator(),
|
|
1219
|
+
serviceType: defaultSelectValidator(),
|
|
1220
|
+
annualRevenue: defaultValidator(),
|
|
1221
|
+
feedbackMethod: defaultSelectValidator(),
|
|
1222
|
+
serviceDirection: defaultSelectValidator(),
|
|
1223
|
+
secondaryPhone: phoneValidator('Укажите номер телефона'),
|
|
1224
|
+
region: defaultSelectValidator(),
|
|
1225
|
+
situationDescription: defaultValidator(),
|
|
1226
|
+
sufferedFrom: defaultValidator(),
|
|
1227
|
+
applierType: defaultValidator(),
|
|
1228
|
+
surname: nameValidator('Укажите свою фамилию на кириллице'),
|
|
1229
|
+
name: nameValidator('Укажите своё имя на кириллице (без сокращений)'),
|
|
1230
|
+
middleName: nameValidator('Укажите своё отчество на кириллице'),
|
|
1231
|
+
birthday: defaultValidator('Укажите дату рождения'),
|
|
1232
|
+
phone: phoneValidator('Укажите номер телефона'),
|
|
1233
|
+
email: emailValidator('Укажите электронную почту'),
|
|
1234
|
+
inn: innValidator('Укажите ИНН'),
|
|
1235
|
+
comment: defaultValidator(),
|
|
1236
|
+
typeForm: defaultValidator(),
|
|
1237
|
+
consentToReceiveMaterials: agreementValidator,
|
|
1238
|
+
consentDataProcessing: agreementValidator,
|
|
1239
|
+
partnerSymbolCode: defaultValidator('Укажите идентификатор партнёра'),
|
|
1240
|
+
dadataPartyInnSelect: innDadataValidator('Укажите ИНН'),
|
|
1241
|
+
dadataPartyNameSelect: defaultValidator('Укажите наименование организации'),
|
|
1242
|
+
callbackTime: defaultValidator(),
|
|
1243
|
+
questionProduct: defaultValidator(),
|
|
1244
|
+
russianPhone: russianPhoneValidator('Укажите номер телефона'),
|
|
1245
|
+
};
|
|
1246
|
+
const getFormValidator = (fieldDefs, externalValidatorObj = {}) => {
|
|
1247
|
+
const requiredFields = fieldDefs.filter((_) => Boolean(_?.required && _?.name));
|
|
1248
|
+
const validator = { ...validatorObj$1, ...externalValidatorObj };
|
|
1249
|
+
const hasConditions = requiredFields.some((_) => _.condition?.values);
|
|
1250
|
+
const requiredFieldValidatorsMap = Object.fromEntries(requiredFields
|
|
1251
|
+
.filter(byNonEmptyValidator(validator))
|
|
1252
|
+
.map(({ name }) => [name, validator[name ?? '']]));
|
|
1253
|
+
return (formState) => hasConditions
|
|
1254
|
+
? Object.fromEntries(requiredFields
|
|
1255
|
+
.filter(byNonEmptyValidator(validator))
|
|
1256
|
+
.filter(byCondition(formState))
|
|
1257
|
+
.map(({ name }) => [name, validator[name ?? '']]))
|
|
1258
|
+
: requiredFieldValidatorsMap;
|
|
1259
|
+
};
|
|
1260
|
+
const byNonEmptyValidator = (validator = {}) => ({ name }) => Boolean(validator[name ?? '']);
|
|
1261
|
+
const byCondition = (formState) => (fieldDef) => !fieldDef?.condition ||
|
|
1262
|
+
fieldDef.condition.values.some((_) => {
|
|
1263
|
+
const dependencyValue = formState?.[fieldDef?.condition?.name ?? ''];
|
|
1264
|
+
return _ === (dependencyValue?.key ?? dependencyValue);
|
|
1265
|
+
});
|
|
1266
|
+
|
|
1267
|
+
const noop = () => {
|
|
1268
|
+
// Do nothing
|
|
1269
|
+
};
|
|
1270
|
+
|
|
1271
|
+
const themeStyle$1 = {
|
|
1272
|
+
primary: style('text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active', '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'),
|
|
1273
|
+
secondary: style('text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active', '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'),
|
|
1274
|
+
};
|
|
1275
|
+
const embeddedStyle = style('group/btn-embedded', 'bg-transparent border border-transparent outline-none');
|
|
1276
|
+
const disabledStyle = style('bg-main-gray text-main-disabled cursor-not-allowed');
|
|
1277
|
+
const Button = JSX(({ className, type = 'button', version = 'primary', shape = 'default', embedded, disabled, role, ariaLabel, data, dataTheme, children, wcmsIgnore, onClick = noop, }) => {
|
|
1278
|
+
const handleClick = useCallback(role !== 'tab' ? handlerDecorator(onClick) : onClick, [
|
|
1279
|
+
role,
|
|
1280
|
+
onClick,
|
|
1281
|
+
]);
|
|
1282
|
+
const aspectsAttrs = useMemo(() => getAspectsAttributes(data), [data]);
|
|
1283
|
+
const isRound = shape === 'round';
|
|
1284
|
+
return (jsx("button", { className: style('font-sans flex items-center gap-xs', {
|
|
1285
|
+
[themeStyle$1[version]]: !disabled && !embedded,
|
|
1286
|
+
[embeddedStyle]: embedded,
|
|
1287
|
+
[disabledStyle]: disabled,
|
|
1288
|
+
}, embedded ? 'justify-between' : 'justify-center', embedded || isRound ? 'p-0' : 'px-9 py-4', {
|
|
1289
|
+
'rounded-md': shape === 'default',
|
|
1290
|
+
'rounded-full': isRound,
|
|
1291
|
+
}, className), type: type, role: role, "aria-label": ariaLabel, disabled: disabled, "aria-disabled": disabled ? 'true' : undefined, "data-theme": dataTheme, "data-wcms-ignore": wcmsIgnore, ...aspectsAttrs, onClick: handleClick, children: children }));
|
|
1292
|
+
});
|
|
1293
|
+
|
|
1294
|
+
const CloseButton = JSX(({ className, onClose }) => (jsx("button", { className: style('flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none', className), onClick: onClose, title: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C", type: "button", children: jsx(Icon, { name: "CloseIcon", width: "20", height: "20", iconVersion: "gray" }) })));
|
|
1295
|
+
|
|
1296
|
+
const DIALOG_STYLE = {
|
|
1297
|
+
sm: 'max-w-sm top-1/3',
|
|
1298
|
+
lg: 'max-w-lg',
|
|
1299
|
+
'4xl': 'max-w-4xl',
|
|
1300
|
+
none: 'mt-0',
|
|
1301
|
+
};
|
|
1302
|
+
const DIALOG_POSITION = {
|
|
1303
|
+
center: 'relative mx-auto',
|
|
1304
|
+
corner: 'absolute bottom-0 right-0',
|
|
1305
|
+
};
|
|
1306
|
+
const Dialog = JSX(({ head, maxWidth = '4xl', children, onClose, onClick, position = 'center' }) => {
|
|
1307
|
+
const isMobileMode = useMobileMode();
|
|
1308
|
+
return (jsxs("div", { className: style('bg-white p-lg pb-6xl my-6xl rounded-lg w-full', DIALOG_STYLE[maxWidth], DIALOG_POSITION[position], { 'mr-3xl': !isMobileMode && position === 'corner' }, { 'mb-12': isMobileMode }), role: "dialog", title: "\u0414\u0438\u0430\u043B\u043E\u0433", onClick: onClick, children: [jsxs("div", { className: "sticky py-xl top-0 bg-white z-10", children: [jsx(CloseButton, { className: "absolute top-0 right-0 z-10", onClose: onClose }), jsx("div", { className: "container", children: head })] }), jsx("div", { className: "container", children: children })] }));
|
|
1309
|
+
});
|
|
1310
|
+
|
|
1311
|
+
const ResponseTypeDialog = JSX(({ ok, typeForm, onClose, errorMessage }) => {
|
|
1312
|
+
const statusIcon = ok ? 'ResponseOKIcon' : 'ResponseFailIcon';
|
|
1313
|
+
const responseOKDescription = typeForm === 'ANTIFRAUD'
|
|
1314
|
+
? `Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы
|
|
1315
|
+
можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка
|
|
1316
|
+
не звонят с использованием мессенджеров.`
|
|
1317
|
+
: 'Совсем скоро мы с вами свяжемся';
|
|
1318
|
+
const responseFailDescription = errorMessage || 'Пожалуйста, повторите позднее';
|
|
1319
|
+
return (jsx(Dialog, { maxWidth: "lg", onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-lg items-center rounded-md space-x-m", children: [jsx(Img, { image: { icon: statusIcon, iconVersion: 'normal' }, width: "136", height: "136" }), jsx(Headline, { className: "w-full", title: ok ? 'Ваша заявка отправлена' : 'Не удалось отправить заявку', description: ok ? responseOKDescription : responseFailDescription, headlineVersion: "XS", isEmbedded: true }), jsx(Button, { type: "button", onClick: onClose, children: "\u0425\u043E\u0440\u043E\u0448\u043E" })] }) }));
|
|
1320
|
+
});
|
|
1321
|
+
|
|
1328
1322
|
// TODO Базовая функицональность всех Control - надо вынести и привязать к required флагу
|
|
1329
1323
|
const getRequiredLabel = ({ label, errors }) => label && errors ? `${label}*` : label;
|
|
1330
1324
|
|
|
@@ -1346,10 +1340,6 @@
|
|
|
1346
1340
|
return debouncedCallback;
|
|
1347
1341
|
};
|
|
1348
1342
|
|
|
1349
|
-
const noop = () => {
|
|
1350
|
-
// Do nothing
|
|
1351
|
-
};
|
|
1352
|
-
|
|
1353
1343
|
const renderLabel$1 = (label) => label ? (jsx(Text, { size: "text-m", color: "text-primary-text", font: "font-light", children: label })) : null;
|
|
1354
1344
|
|
|
1355
1345
|
function useEventListener(target, type, listener, options) {
|
|
@@ -1431,7 +1421,7 @@
|
|
|
1431
1421
|
return formatOption(value) || placeholder;
|
|
1432
1422
|
};
|
|
1433
1423
|
|
|
1434
|
-
const renderSelectContainer = ({ isBorder = true, valid = true, isDisabled = false, isOpen = false, onOpen, onClose, isManualInput = false, query = '', value, placeholder = '', iconVersion = 'black', options = [], }) => {
|
|
1424
|
+
const renderSelectContainer = ({ isBorder = true, valid = true, isDisabled = false, isOpen = false, onOpen = noop, onClose, isManualInput = false, query = '', value, placeholder = '', iconVersion = 'black', options = [], }) => {
|
|
1435
1425
|
const isIconHidden = getIconHidden(isManualInput, options, query);
|
|
1436
1426
|
return (jsxs("div", { className: style({ 'border rounded-md': isBorder }, { 'hover:border-primary-hover': isBorder && !isDisabled }, isDisabled ? 'bg-main-divider' : 'cursor-pointer ', valid ? 'border-gray' : 'border-error', 'h-14 [&>*]:p-m pr-6 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden'), onClick: isOpen ? onClose : onOpen, children: [jsx("p", { className: "line-clamp-2 text-ellipsis", children: renderOptionText({ isManualInput, query, value, placeholder }) }), isIconHidden ? '' : renderIcon$2(isOpen, iconVersion)] }));
|
|
1437
1427
|
};
|
|
@@ -1538,32 +1528,460 @@
|
|
|
1538
1528
|
: null] })] }));
|
|
1539
1529
|
});
|
|
1540
1530
|
|
|
1541
|
-
const SelectControl = JSX(({ className = '', label, error, errors, ...rest }) => (jsxs("div", { className: className, children: [jsx(Select, { ...rest, valid: !error, label: getRequiredLabel({ label, errors }) }), renderErrorText(error)] })));
|
|
1531
|
+
const SelectControl = JSX(({ className = '', label, error, errors, ...rest }) => (jsxs("div", { className: className, children: [jsx(Select, { ...rest, valid: !error, label: getRequiredLabel({ label, errors }) }), renderErrorText(error)] })));
|
|
1532
|
+
|
|
1533
|
+
const CLIENT_KEY = 'client';
|
|
1534
|
+
const REPRESENTATIVE_KEY = 'representative';
|
|
1535
|
+
const APPLIER_TYPES = [
|
|
1536
|
+
{
|
|
1537
|
+
key: CLIENT_KEY,
|
|
1538
|
+
text: 'Клиент',
|
|
1539
|
+
},
|
|
1540
|
+
{
|
|
1541
|
+
key: REPRESENTATIVE_KEY,
|
|
1542
|
+
text: 'Представитель клиента',
|
|
1543
|
+
},
|
|
1544
|
+
];
|
|
1545
|
+
const ApplierTypeField = JSX(({ field, input }) => (jsx(SelectControl, { label: "\u0422\u0438\u043F \u043E\u0431\u0440\u0430\u0442\u0438\u0432\u0448\u0435\u0433\u043E\u0441\u044F", ...input, options: APPLIER_TYPES, ...field('applierType') })));
|
|
1546
|
+
|
|
1547
|
+
const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
|
|
1548
|
+
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) => {
|
|
1549
|
+
const resultOptions = { ...commonOptions, ...options };
|
|
1550
|
+
return (jsx("path", { d: d, fill: pathFill || 'currentColor', stroke: resultOptions.stroke, strokeLinecap: resultOptions.strokeLinecap, strokeLinejoin: resultOptions.strokeLinejoin, strokeWidth: resultOptions.strokeWidth, strokeMiterlimit: resultOptions.strokeMiterlimit }, i));
|
|
1551
|
+
}) }));
|
|
1552
|
+
});
|
|
1553
|
+
|
|
1554
|
+
const defaultCheckStyle = 'appearance-none w-5 h-5 border-solid flex-none';
|
|
1555
|
+
|
|
1556
|
+
const CHECK_PATHS = [
|
|
1557
|
+
{
|
|
1558
|
+
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',
|
|
1559
|
+
fillRule: 'evenodd',
|
|
1560
|
+
clipRule: 'evenodd',
|
|
1561
|
+
fill: 'white',
|
|
1562
|
+
},
|
|
1563
|
+
];
|
|
1564
|
+
const Checkbox = JSX(({ className, value, text, disabled, isRadio, onChange }) => {
|
|
1565
|
+
const handleChange = useCallback((e) => {
|
|
1566
|
+
if (disabled) {
|
|
1567
|
+
return;
|
|
1568
|
+
}
|
|
1569
|
+
e.preventDefault();
|
|
1570
|
+
onChange && onChange(!value);
|
|
1571
|
+
}, [onChange, disabled, value]);
|
|
1572
|
+
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" }));
|
|
1573
|
+
return (jsx("div", { className: className, children: jsxs("label", { className: style('flex items-center relative group/box', getCursorStyle(disabled)), onClick: handleChange, children: [jsx("div", { className: style(defaultCheckStyle, 'm-0', isRadio ? 'rounded-full border-2' : checkboxStyle(value), !disabled && 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), "aria-label": text }), value ? icon : null, renderText$4(text)] }) }));
|
|
1574
|
+
});
|
|
1575
|
+
const renderText$4 = (text) => text ? (jsx("div", { className: "ml-s", children: jsx(Text, { size: "text-l", font: "font-light", children: text }) })) : null;
|
|
1576
|
+
const getCursorStyle = (disabled = false) => (disabled ? 'cursor-not-allowed' : 'cursor-pointer');
|
|
1577
|
+
const role = (isRadio = false) => (isRadio ? 'radio' : 'checkbox');
|
|
1578
|
+
const checkboxStyle = (value = false) => style('rounded border', { 'bg-primary-main': value });
|
|
1579
|
+
|
|
1580
|
+
const orientationStyleMap = {
|
|
1581
|
+
horizontal: '@lg:flex-row',
|
|
1582
|
+
vertical: '',
|
|
1583
|
+
};
|
|
1584
|
+
const RadioButtonGroup = JSX(({ label, items, value, className, disabled = false, orientation = 'horizontal', onChange: onChangeCheckedItem, }) => (jsxs("div", { className: "grid gap-xs whitespace-nowrap", children: [label ? (jsx("div", { role: "radiogroup", "aria-label": label, children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: label }) })) : null, jsx("div", { className: style('flex flex-col gap-s', orientationStyleMap[orientation], className), role: "radiogroup", "aria-label": "\u0413\u0440\u0443\u043F\u043F\u0430 \u043A\u043D\u043E\u043F\u043E\u043A", children: items?.map(({ id, text }) => (jsx(Checkbox, { isRadio: true, text: text, value: value === id, onChange: () => onChangeCheckedItem?.(id), disabled: disabled }, String(id)))) })] })));
|
|
1585
|
+
|
|
1586
|
+
const VED_TYPES = [
|
|
1587
|
+
{ id: 'currencyControl', text: 'Валютный контроль' },
|
|
1588
|
+
{ id: 'documentOperations', text: 'Документарные операции' },
|
|
1589
|
+
{ id: 'conversionTransactions', text: 'Конверсионные операции' },
|
|
1590
|
+
{ id: 'otherIssues', text: 'Иные вопросы ВЭД' },
|
|
1591
|
+
];
|
|
1592
|
+
const VedField = JSX(({ field, input }) => {
|
|
1593
|
+
const handleChange = useCallback((_) => {
|
|
1594
|
+
if (_ !== 'currencyControl') {
|
|
1595
|
+
field('inn').onChange?.('');
|
|
1596
|
+
field('region').onChange?.('');
|
|
1597
|
+
}
|
|
1598
|
+
}, []);
|
|
1599
|
+
return (jsx("div", { className: "py-m gap-m grid @xl:flex @xl:items-center", children: jsx(RadioButtonGroup, { className: "whitespace-normal", orientation: "horizontal", items: VED_TYPES, ...field(input?.name ?? '', { onChange: handleChange }) }) }));
|
|
1600
|
+
});
|
|
1601
|
+
|
|
1602
|
+
const ACQUIRING_TYPES = [
|
|
1603
|
+
{
|
|
1604
|
+
text: 'Торговый эквайринг',
|
|
1605
|
+
key: 'trade',
|
|
1606
|
+
},
|
|
1607
|
+
{
|
|
1608
|
+
text: 'СБП-эквайринг',
|
|
1609
|
+
key: 'sbp',
|
|
1610
|
+
},
|
|
1611
|
+
{
|
|
1612
|
+
text: 'Интернет-эквайринг',
|
|
1613
|
+
key: 'internet',
|
|
1614
|
+
},
|
|
1615
|
+
{
|
|
1616
|
+
text: 'SoftPOS',
|
|
1617
|
+
key: 'softpos',
|
|
1618
|
+
},
|
|
1619
|
+
{
|
|
1620
|
+
text: 'Все виды эквайринга',
|
|
1621
|
+
key: 'all',
|
|
1622
|
+
},
|
|
1623
|
+
];
|
|
1624
|
+
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, ...field(input?.name ?? '') })));
|
|
1625
|
+
const isAcquiringTrade = (key = '') => Boolean(key === 'trade' || key === 'all');
|
|
1626
|
+
|
|
1627
|
+
const getPartnerComments = (data) => {
|
|
1628
|
+
const { acquiringType, onlineCheckout = false, posTerminal = false, term, amount, annualRevenue, } = data;
|
|
1629
|
+
if (acquiringType) {
|
|
1630
|
+
return `Вид эквайринга=${acquiringType?.text || ''}${isAcquiringTrade(acquiringType?.key)
|
|
1631
|
+
? `/Онлайн касса=${onlineCheckout}/POS-терминал=${posTerminal}`
|
|
1632
|
+
: '/Онлайн касса=false/POS-терминал=false'}`;
|
|
1633
|
+
}
|
|
1634
|
+
else {
|
|
1635
|
+
return `Сумма=${amount}/Срок=${term}/Выручка=${annualRevenue}`;
|
|
1636
|
+
}
|
|
1637
|
+
};
|
|
1638
|
+
|
|
1639
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
1640
|
+
const getFormatData = (data) => {
|
|
1641
|
+
const { acquiringType, onlineCheckout, posTerminal, amount, term, annualRevenue, serviceType, vedTypes, region, inn, sufferedFrom, situationDescription, applierType, isPremium, dadataPartyNameSelect, partnerSymbolCode, dadataPartyInnSelect, ...usedData } = data;
|
|
1642
|
+
const partnerComments = acquiringType || annualRevenue ? getPartnerComments(data) : null;
|
|
1643
|
+
const formatData = {
|
|
1644
|
+
...usedData,
|
|
1645
|
+
...getVedTypes(vedTypes),
|
|
1646
|
+
...getRegion$1(region),
|
|
1647
|
+
...(inn && { inn }),
|
|
1648
|
+
...(partnerComments ? { partnerComments } : {}),
|
|
1649
|
+
...(serviceType ? { typeForm: serviceType } : {}),
|
|
1650
|
+
...getIncidentComment(sufferedFrom?.text, situationDescription),
|
|
1651
|
+
...getIsClient(applierType),
|
|
1652
|
+
...getDadataValues([
|
|
1653
|
+
[dadataPartyInnSelect, 'inn'],
|
|
1654
|
+
[dadataPartyNameSelect, 'fullName'],
|
|
1655
|
+
]),
|
|
1656
|
+
};
|
|
1657
|
+
return Object.fromEntries(Object.entries(formatData)?.map(([k, v]) => [k, v?.key || v]));
|
|
1658
|
+
};
|
|
1659
|
+
const getIsClient = (applierType) => applierType?.key ? { isClient: applierType?.key === CLIENT_KEY } : {};
|
|
1660
|
+
const getIncidentComment = (sufferedFrom, situationDescription) => sufferedFrom || situationDescription
|
|
1661
|
+
? { comment: `${sufferedFrom || ''};${situationDescription || ''}` }
|
|
1662
|
+
: {};
|
|
1663
|
+
const getRegion$1 = (region) => region?.key || region?.text ? { region: region?.text || region?.key } : {};
|
|
1664
|
+
const getVedTypes = (vedTypes) => vedTypes
|
|
1665
|
+
? {
|
|
1666
|
+
vedTypes: Object.fromEntries(VED_TYPES.map(({ id }) => [id, id === vedTypes])),
|
|
1667
|
+
}
|
|
1668
|
+
: {};
|
|
1669
|
+
const getDadataValues = (fields) => fields.reduce((acc, [field, name]) => {
|
|
1670
|
+
if (field?.text && name) {
|
|
1671
|
+
acc[name] = field.text;
|
|
1672
|
+
}
|
|
1673
|
+
return acc;
|
|
1674
|
+
}, {});
|
|
1675
|
+
|
|
1676
|
+
const SERVICE_TYPES = [{ key: 'ULTRASERVICE', text: 'Ультра' }];
|
|
1677
|
+
const SERVICE_DIRECTIONS = [
|
|
1678
|
+
{ key: 'Физическое лицо' },
|
|
1679
|
+
{ key: 'Юридическое лицо / ИП' },
|
|
1680
|
+
];
|
|
1681
|
+
const FEEDBACK_METHOD = [
|
|
1682
|
+
{ key: 'phone', text: 'Телефонный звонок' },
|
|
1683
|
+
{ key: 'email', text: 'Электронное сообщение' },
|
|
1684
|
+
];
|
|
1685
|
+
|
|
1686
|
+
const initialFormState$1 = {
|
|
1687
|
+
typeForm: '',
|
|
1688
|
+
region: { key: '', text: '' },
|
|
1689
|
+
addressBranch: { key: '', text: '' },
|
|
1690
|
+
surname: '',
|
|
1691
|
+
name: '',
|
|
1692
|
+
phone: '',
|
|
1693
|
+
secondaryPhone: '',
|
|
1694
|
+
comment: '',
|
|
1695
|
+
product: '',
|
|
1696
|
+
partnerComments: '',
|
|
1697
|
+
annualRevenue: '',
|
|
1698
|
+
term: 12,
|
|
1699
|
+
amount: 100000,
|
|
1700
|
+
acquiringType: ACQUIRING_TYPES[0],
|
|
1701
|
+
serviceType: SERVICE_TYPES[0],
|
|
1702
|
+
feedbackMethod: FEEDBACK_METHOD[0],
|
|
1703
|
+
serviceDirection: SERVICE_DIRECTIONS[0],
|
|
1704
|
+
vedTypes: VED_TYPES[0].id,
|
|
1705
|
+
birthday: undefined,
|
|
1706
|
+
isClient: false,
|
|
1707
|
+
onlineCheckout: false,
|
|
1708
|
+
posTerminal: false,
|
|
1709
|
+
consentToReceiveMaterials: false,
|
|
1710
|
+
consentDataProcessing: false,
|
|
1711
|
+
addressRetail: { key: '', text: '' },
|
|
1712
|
+
};
|
|
1713
|
+
const getInitialFormState$2 = (inputs, typeForm = '') => {
|
|
1714
|
+
const formState = Object.fromEntries(inputs.map((_) => [
|
|
1715
|
+
_.name,
|
|
1716
|
+
(_?.name === 'vedTypes' && _?.defaultValue) || initialFormState$1[_.name || ''],
|
|
1717
|
+
]));
|
|
1718
|
+
return { ...formState, typeForm: { key: typeForm, text: '' } };
|
|
1719
|
+
};
|
|
1720
|
+
|
|
1721
|
+
const getUserTimezoneOffset = () => {
|
|
1722
|
+
const offset = new Date().getTimezoneOffset();
|
|
1723
|
+
const absOffset = Math.abs(offset);
|
|
1724
|
+
const hours = Math.floor(absOffset / 60);
|
|
1725
|
+
const minutes = absOffset % 60;
|
|
1726
|
+
const sign = offset < 0 ? '+' : '-';
|
|
1727
|
+
return `GMT${sign}${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}`;
|
|
1728
|
+
};
|
|
1729
|
+
|
|
1730
|
+
const API_BASE_URI$1 = '/api/v1';
|
|
1731
|
+
const RETAIL_API_BASE_URI = '/light-api-cash/v1';
|
|
1732
|
+
|
|
1733
|
+
const formatDate = (date, toTimeStamp = false) => {
|
|
1734
|
+
if (typeof date === 'string') {
|
|
1735
|
+
return date.split('-').reverse().join('.');
|
|
1736
|
+
}
|
|
1737
|
+
else {
|
|
1738
|
+
const day = String(date.getDate()).padStart(2, '0');
|
|
1739
|
+
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
1740
|
+
const year = String(date.getFullYear());
|
|
1741
|
+
return toTimeStamp ? `${year}-${month}-${day}` : `${day}.${month}.${year}`;
|
|
1742
|
+
}
|
|
1743
|
+
};
|
|
1744
|
+
|
|
1745
|
+
const formatPhone = (phone) => phone?.replace(/[^+\d]/g, '');
|
|
1746
|
+
|
|
1747
|
+
const getSubmitBody = (body, isNaturalPerson, router) => {
|
|
1748
|
+
const { typeForm, region, phone = '', email, birthday, desiredMeetingDate, inn, fullRegion, addressBranch, secondaryPhone = '', bankEmpolee, applicationDate, partnerName, russianPhone, ...staticBody } = body;
|
|
1749
|
+
return {
|
|
1750
|
+
typeForm,
|
|
1751
|
+
...getRegion(region, isNaturalPerson),
|
|
1752
|
+
...getEmail(email, isNaturalPerson),
|
|
1753
|
+
...getPhone(phone),
|
|
1754
|
+
...getPhone(russianPhone),
|
|
1755
|
+
...getFormatDate(desiredMeetingDate, 'desiredMeetingDate'),
|
|
1756
|
+
...(isNaturalPerson ? getFormatDate(birthday) : { inn }),
|
|
1757
|
+
...(typeForm === 'FEEDBACK'
|
|
1758
|
+
? {}
|
|
1759
|
+
: {
|
|
1760
|
+
addressBranch,
|
|
1761
|
+
bankEmpolee,
|
|
1762
|
+
applicationDate,
|
|
1763
|
+
...getSecondaryPhone(secondaryPhone),
|
|
1764
|
+
}),
|
|
1765
|
+
...addPageSlug(typeForm, router),
|
|
1766
|
+
...formatPFForm(typeForm, {
|
|
1767
|
+
fullRegion,
|
|
1768
|
+
partnerName,
|
|
1769
|
+
}),
|
|
1770
|
+
...staticBody,
|
|
1771
|
+
};
|
|
1772
|
+
};
|
|
1773
|
+
const getPhoneBody = (phone) => {
|
|
1774
|
+
return {
|
|
1775
|
+
...getPhone(phone),
|
|
1776
|
+
};
|
|
1777
|
+
};
|
|
1778
|
+
const getPhone = (phone) => (phone ? { phone: formatPhone(phone) } : {});
|
|
1779
|
+
const getFormatDate = (date, key = 'birthday') => date ? { [key]: formatDate(date) } : {};
|
|
1780
|
+
const getRegion = (region, isNaturalPerson = true) => ({
|
|
1781
|
+
[isNaturalPerson ? 'regionBranch' : 'region']: region,
|
|
1782
|
+
});
|
|
1783
|
+
const getEmail = (email, isNaturalPerson = true) => ({
|
|
1784
|
+
[isNaturalPerson ? 'email' : 'mail']: email,
|
|
1785
|
+
});
|
|
1786
|
+
const getSecondaryPhone = (secondaryPhone = '') => !secondaryPhone || secondaryPhone === '+7 ('
|
|
1787
|
+
? {}
|
|
1788
|
+
: { secondaryPhoneNumber: formatPhone(secondaryPhone) };
|
|
1789
|
+
const formatPFForm = (typeForm, data) => typeForm === 'PF'
|
|
1790
|
+
? {
|
|
1791
|
+
region: data?.fullRegion,
|
|
1792
|
+
partner: data?.partnerName,
|
|
1793
|
+
}
|
|
1794
|
+
: {};
|
|
1795
|
+
const addPageSlug = (typeForm, router) => typeForm === 'UNIVERSAL'
|
|
1796
|
+
? {
|
|
1797
|
+
typeForm: router?.pathname?.split('/')?.at(-1) || '/',
|
|
1798
|
+
}
|
|
1799
|
+
: {};
|
|
1800
|
+
|
|
1801
|
+
function LeadServiceAPI() {
|
|
1802
|
+
async function send(body, router, isIndividualType = false) {
|
|
1803
|
+
const { serviceDirection } = body;
|
|
1804
|
+
const isNaturalPerson = isIndividualType && serviceDirection !== 'Юридическое лицо / ИП';
|
|
1805
|
+
const url = `${API_BASE_URI$1}${isNaturalPerson ? '/lead' : '/sendcorporatelead'}`;
|
|
1806
|
+
const submitBody = getSubmitBody(body, isNaturalPerson, router);
|
|
1807
|
+
try {
|
|
1808
|
+
const response = await LeadServiceFetch(url, submitBody);
|
|
1809
|
+
if (!response?.ok) {
|
|
1810
|
+
return null;
|
|
1811
|
+
}
|
|
1812
|
+
return await response.json();
|
|
1813
|
+
}
|
|
1814
|
+
catch (e) {
|
|
1815
|
+
return null;
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1818
|
+
async function sendCode({ phone }) {
|
|
1819
|
+
const submitBody = getPhoneBody(phone);
|
|
1820
|
+
try {
|
|
1821
|
+
const response = LeadServiceFetch(`${API_BASE_URI$1}/initCorporateLead`, submitBody).then(async (res) => {
|
|
1822
|
+
if (!res.ok) {
|
|
1823
|
+
throw new Error(`Ошибка HTTP: ${res.status}`);
|
|
1824
|
+
}
|
|
1825
|
+
return await res.text();
|
|
1826
|
+
});
|
|
1827
|
+
return await response;
|
|
1828
|
+
}
|
|
1829
|
+
catch (e) {
|
|
1830
|
+
return null;
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
async function checkCode({ reqId, code, body }) {
|
|
1834
|
+
const submitBody = {
|
|
1835
|
+
requestId: reqId,
|
|
1836
|
+
confimationCode: code,
|
|
1837
|
+
leadRequest: getSubmitBody(body, false),
|
|
1838
|
+
};
|
|
1839
|
+
try {
|
|
1840
|
+
const response = await LeadServiceFetch(`${API_BASE_URI$1}/confirmCorporateLead`, submitBody);
|
|
1841
|
+
return await response.json();
|
|
1842
|
+
}
|
|
1843
|
+
catch (e) {
|
|
1844
|
+
return null;
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
async function sendPhoneCallRequest(body, isNaturalPerson = false) {
|
|
1848
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1849
|
+
const submitBody = getSubmitBody(body, isNaturalPerson);
|
|
1850
|
+
const formatSubmitBody = getFormatCallbackSubmitBody(submitBody);
|
|
1851
|
+
try {
|
|
1852
|
+
const response = await LeadServiceFetch(`${API_BASE_URI$1}/callback`, formatSubmitBody);
|
|
1853
|
+
if (!response?.ok) {
|
|
1854
|
+
return null;
|
|
1855
|
+
}
|
|
1856
|
+
return await response.json();
|
|
1857
|
+
}
|
|
1858
|
+
catch (e) {
|
|
1859
|
+
return null;
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
return {
|
|
1863
|
+
send,
|
|
1864
|
+
sendCode,
|
|
1865
|
+
checkCode,
|
|
1866
|
+
sendPhoneCallRequest,
|
|
1867
|
+
};
|
|
1868
|
+
}
|
|
1869
|
+
const LeadServiceFetch = (url, submitBody) => fetch(url, {
|
|
1870
|
+
method: 'POST',
|
|
1871
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1872
|
+
mode: 'cors',
|
|
1873
|
+
body: JSON.stringify(submitBody),
|
|
1874
|
+
});
|
|
1875
|
+
const getFormatCallbackSubmitBody = (submitBody) => {
|
|
1876
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1877
|
+
const { typeForm, consentDataProcessing, phone, ...rest } = submitBody;
|
|
1878
|
+
return {
|
|
1879
|
+
...rest,
|
|
1880
|
+
phone: phone?.startsWith('+') ? phone.slice(1) : phone,
|
|
1881
|
+
clientTimezone: getUserTimezoneOffset(),
|
|
1882
|
+
};
|
|
1883
|
+
};
|
|
1884
|
+
|
|
1885
|
+
const handleAspects = async ({ aspectsAttributes, aspects, ev }) => {
|
|
1886
|
+
for (const { aspectName, params } of aspectsAttributes ?? []) {
|
|
1887
|
+
const aspectFn = aspects[aspectName ?? ''];
|
|
1888
|
+
if (aspectFn) {
|
|
1889
|
+
await aspectFn(ev, params);
|
|
1890
|
+
}
|
|
1891
|
+
}
|
|
1892
|
+
};
|
|
1893
|
+
|
|
1894
|
+
const API$2 = LeadServiceAPI();
|
|
1895
|
+
const handleInitCorporateLead = async ({ formatData = {}, typeForm, responseTypeDialog, verifyPhoneDialog, data = [], aspects = {}, ev, }) => {
|
|
1896
|
+
const { phone } = formatData;
|
|
1897
|
+
const response = await API$2.sendCode({ phone: String(phone) });
|
|
1898
|
+
if (!response) {
|
|
1899
|
+
responseTypeDialog.open({ ok: Boolean(response), typeForm });
|
|
1900
|
+
return;
|
|
1901
|
+
}
|
|
1902
|
+
verifyPhoneDialog.open({
|
|
1903
|
+
phone,
|
|
1904
|
+
formatData,
|
|
1905
|
+
reqId: String(response),
|
|
1906
|
+
onSuccess: () => {
|
|
1907
|
+
verifyPhoneDialog.close();
|
|
1908
|
+
responseTypeDialog.open({ ok: true, typeForm });
|
|
1909
|
+
handleAspects({ aspectsAttributes: data, aspects, ev });
|
|
1910
|
+
},
|
|
1911
|
+
});
|
|
1912
|
+
};
|
|
1913
|
+
const handleCallback = async ({ formatData, data, aspects = {}, ev, typeForm, responseTypeDialog, onSuccess = noop, }) => {
|
|
1914
|
+
const response = await API$2.sendPhoneCallRequest(formatData);
|
|
1915
|
+
onSuccess();
|
|
1916
|
+
if (response?.status === 'success') {
|
|
1917
|
+
responseTypeDialog.open({ ok: true, typeForm });
|
|
1918
|
+
handleAspects({ aspectsAttributes: data, aspects, ev });
|
|
1919
|
+
}
|
|
1920
|
+
else if (response?.status === 'error') {
|
|
1921
|
+
responseTypeDialog.open({
|
|
1922
|
+
ok: false,
|
|
1923
|
+
errorMessage: 'Ваша заявка уже в работе. Дождитесь звонка от сотрудника Банка',
|
|
1924
|
+
});
|
|
1925
|
+
}
|
|
1926
|
+
else {
|
|
1927
|
+
responseTypeDialog.open({ ok: Boolean(response) });
|
|
1928
|
+
if (response) {
|
|
1929
|
+
handleAspects({ aspectsAttributes: data, aspects, ev });
|
|
1930
|
+
}
|
|
1931
|
+
}
|
|
1932
|
+
};
|
|
1933
|
+
const handleDefault = async ({ formatData, data, aspects = {}, ev, router, responseTypeDialog, }) => {
|
|
1934
|
+
const ok = Boolean(await API$2.send(formatData, router, false)); // или проверять endpoint === 'lead'
|
|
1935
|
+
responseTypeDialog.open({ ok });
|
|
1936
|
+
if (ok) {
|
|
1937
|
+
handleAspects({ aspectsAttributes: data, aspects, ev });
|
|
1938
|
+
}
|
|
1939
|
+
};
|
|
1940
|
+
|
|
1941
|
+
const Loader = JSX(({ color = 'text-primary-main', position = 'absolute', blur = true, size = 'big' }) => (jsx("div", { className: style('flex justify-center items-center h-full w-full z-50', position, {
|
|
1942
|
+
'backdrop-blur': blur,
|
|
1943
|
+
}), children: jsx("div", { className: style('inline-block', 'animate-spin rounded-full', 'border-solid border-current', 'border-r-transparent', size === 'extraSmall' && 'border-2 h-4 w-4', size === 'small' && 'border-4 h-8 w-8', size === 'big' && 'border-8 h-28 w-28', color), role: "status" }) })));
|
|
1944
|
+
|
|
1945
|
+
const SubmitButton$1 = JSX(({ isLoading, disabled, children, className, ...rest }) => (jsxs(Button, { type: "submit", className: style('relative', className), disabled: isLoading || disabled, ...rest, children: [isLoading ? jsx(Loader, { blur: true, size: "small" }) : null, children] })));
|
|
1946
|
+
|
|
1947
|
+
const withValidator = (props, validator) => {
|
|
1948
|
+
const { value, isDirty } = props;
|
|
1949
|
+
const errors = isDirty ? validator(value) : [];
|
|
1950
|
+
return {
|
|
1951
|
+
...props,
|
|
1952
|
+
errors,
|
|
1953
|
+
error: errors[0],
|
|
1954
|
+
};
|
|
1955
|
+
};
|
|
1956
|
+
|
|
1957
|
+
const themeStyle = {
|
|
1958
|
+
primary: themeStyle$1.primary,
|
|
1959
|
+
secondary: themeStyle$1.secondary,
|
|
1960
|
+
white: 'text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main',
|
|
1961
|
+
link: 'text-primary-main',
|
|
1962
|
+
gray: themeStyle$1.secondary,
|
|
1963
|
+
transparent: '',
|
|
1964
|
+
'': '',
|
|
1965
|
+
};
|
|
1966
|
+
const Link = JSX((props) => {
|
|
1967
|
+
const link = useLink();
|
|
1968
|
+
const { className, href, target, text, aboveText, version = 'link', rel, ariaLabel, data, children, onClick, } = link(props);
|
|
1969
|
+
const buttonLike = version !== 'link';
|
|
1970
|
+
return (jsx("a", { className: style('group/btn inline-flex items-center h-fit', 'font-sans no-underline select-none', 'border border-transparent focus:border-primary-text focus:border', 'cursor-pointer', {
|
|
1971
|
+
[themeStyle[version]]: Boolean(version),
|
|
1972
|
+
[aboveText ? 'px-9 py-2.5' : 'px-9 py-4']: buttonLike,
|
|
1973
|
+
'rounded-md': buttonLike,
|
|
1974
|
+
}, className), href: href, target: target, rel: rel, "aria-label": ariaLabel ?? `Ссылка на ${text}`, role: href ? 'link' : 'button', onClick: onClick, ...getAspectsAttributes(data), children: children ?? renderText$3(text, aboveText) }));
|
|
1975
|
+
});
|
|
1976
|
+
const renderText$3 = (text, aboveText) => text || aboveText ? (jsxs("div", { className: "whitespace-pre", children: [aboveText ? jsx("div", { className: "font-light text-left text-xs", children: aboveText }) : null, jsx("div", { className: style('text-left', { 'text-s -mt-3xs': Boolean(aboveText) }), children: text })] })) : null;
|
|
1977
|
+
|
|
1978
|
+
const Footnote = JSX(({ text, link }) => (jsxs(Paragraph, { size: "text-l", font: "font-light", color: "text-secondary-text", children: [text ? jsx(Text, { children: text }) : null, link ? (jsx(Link, { ...link, ariaLabel: "\u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043D\u043D\u044B\u0445", children: link.text })) : null] })));
|
|
1542
1979
|
|
|
1543
|
-
const
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
{
|
|
1549
|
-
text: 'СБП-эквайринг',
|
|
1550
|
-
key: 'sbp',
|
|
1551
|
-
},
|
|
1552
|
-
{
|
|
1553
|
-
text: 'Интернет-эквайринг',
|
|
1554
|
-
key: 'internet',
|
|
1555
|
-
},
|
|
1556
|
-
{
|
|
1557
|
-
text: 'SoftPOS',
|
|
1558
|
-
key: 'softpos',
|
|
1559
|
-
},
|
|
1560
|
-
{
|
|
1561
|
-
text: 'Все виды эквайринга',
|
|
1562
|
-
key: 'all',
|
|
1563
|
-
},
|
|
1564
|
-
];
|
|
1565
|
-
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, ...field(input?.name ?? '') })));
|
|
1566
|
-
const isAcquiringTrade = (key = '') => Boolean(key === 'trade' || key === 'all');
|
|
1980
|
+
const agreementText = 'Нажимая кнопку, вы подтверждаете согласие с ';
|
|
1981
|
+
const agreementTextPF = 'Нажимая на кнопку, вы подтверждаете, что клиент дал согласие на ';
|
|
1982
|
+
const renderAgreementSubmit = ({ consentDataProcessing, link, button, typeForm, }) => (jsxs("div", { className: "flex col-span-2 gap-xs flex-col w-full items-baseline", children: [consentDataProcessing ? (jsxs("div", { children: [jsxs("div", { className: "flex gap-3 items-center", children: [jsx(Checkbox, { ...consentDataProcessing }), jsx(Footnote, { link: link })] }), renderErrorText(withValidator(consentDataProcessing, agreementValidator).error)] })) : (jsx(Footnote, { text: typeForm === 'PF' ? agreementTextPF : agreementText, link: link })), jsx(SubmitButton$1, { className: "w-full @xl:w-auto", children: button?.text ? button.text : 'Отправить заявку' })] }));
|
|
1983
|
+
|
|
1984
|
+
const renderContacts = () => (jsxs("div", { className: "space-y-m", children: [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" }), jsxs("div", { className: "flex sm:justify-center 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": "\u0442\u0435\u043B\u0435\u0444\u043E\u043D 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": "\u043F\u043E\u0447\u0442\u0430 ved@rshb.ru", href: `mailto:ved@rshb.ru`, children: [jsx(Img, { image: { icon: 'MailIcon' }, width: "24", height: "24" }), jsx("span", { children: "ved@rshb.ru" })] })] })] }));
|
|
1567
1985
|
|
|
1568
1986
|
const isFilled = (_) => _ !== null && _ !== undefined;
|
|
1569
1987
|
|
|
@@ -1737,20 +2155,6 @@
|
|
|
1737
2155
|
|
|
1738
2156
|
const ApplicationDateField = JSX(({ field, input }) => (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(input?.name ?? '') })));
|
|
1739
2157
|
|
|
1740
|
-
const CLIENT_KEY = 'client';
|
|
1741
|
-
const REPRESENTATIVE_KEY = 'representative';
|
|
1742
|
-
const APPLIER_TYPES = [
|
|
1743
|
-
{
|
|
1744
|
-
key: CLIENT_KEY,
|
|
1745
|
-
text: 'Клиент',
|
|
1746
|
-
},
|
|
1747
|
-
{
|
|
1748
|
-
key: REPRESENTATIVE_KEY,
|
|
1749
|
-
text: 'Представитель клиента',
|
|
1750
|
-
},
|
|
1751
|
-
];
|
|
1752
|
-
const ApplierTypeField = JSX(({ field, input }) => (jsx(SelectControl, { label: "\u0422\u0438\u043F \u043E\u0431\u0440\u0430\u0442\u0438\u0432\u0448\u0435\u0433\u043E\u0441\u044F", ...input, options: APPLIER_TYPES, ...field('applierType') })));
|
|
1753
|
-
|
|
1754
2158
|
const BankEmpoleeField = JSX(({ field, input }) => (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(input?.name ?? '') })));
|
|
1755
2159
|
|
|
1756
2160
|
const useElementSpace = (ref, heightEl) => {
|
|
@@ -2046,6 +2450,26 @@
|
|
|
2046
2450
|
|
|
2047
2451
|
const BirthdayField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: input?.label || 'Дата рождения', ...field(input?.name ?? '') })));
|
|
2048
2452
|
|
|
2453
|
+
const CALLBACK_TIME = [
|
|
2454
|
+
{
|
|
2455
|
+
key: 'Перезвонить сейчас',
|
|
2456
|
+
text: 'Перезвонить сейчас',
|
|
2457
|
+
},
|
|
2458
|
+
{
|
|
2459
|
+
key: 'Перезвонить через час',
|
|
2460
|
+
text: 'Перезвонить через час',
|
|
2461
|
+
},
|
|
2462
|
+
{
|
|
2463
|
+
key: 'Перезвонить через два часа',
|
|
2464
|
+
text: 'Перезвонить через два часа',
|
|
2465
|
+
},
|
|
2466
|
+
{
|
|
2467
|
+
key: 'Перезвонить завтра',
|
|
2468
|
+
text: 'Перезвонить завтра',
|
|
2469
|
+
},
|
|
2470
|
+
];
|
|
2471
|
+
const CallbackTimeField = JSX(({ field, input }) => (jsx(SelectControl, { label: "\u041A\u043E\u0433\u0434\u0430 \u043F\u0435\u0440\u0435\u0437\u0432\u043E\u043D\u0438\u0442\u044C?", ...input, options: CALLBACK_TIME, ...field(input?.name ?? '') })));
|
|
2472
|
+
|
|
2049
2473
|
const CollectionCountField = JSX(({ field, input }) => (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", isInteger: true, ...field(input?.name ?? '') })));
|
|
2050
2474
|
|
|
2051
2475
|
const CommentField = JSX(({ field, input }) => (jsx(InputControl, { className: "col-span-2", ...field(input?.name ?? ''), placeholder: "\u0412\u0430\u0448\u0435 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435", isTextarea: true })));
|
|
@@ -2185,16 +2609,6 @@
|
|
|
2185
2609
|
return jsx(InputControl, { label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...field(input?.name ?? ''), ...input });
|
|
2186
2610
|
});
|
|
2187
2611
|
|
|
2188
|
-
const SERVICE_TYPES = [{ key: 'ULTRASERVICE', text: 'Ультра' }];
|
|
2189
|
-
const SERVICE_DIRECTIONS = [
|
|
2190
|
-
{ key: 'Физическое лицо' },
|
|
2191
|
-
{ key: 'Юридическое лицо / ИП' },
|
|
2192
|
-
];
|
|
2193
|
-
const FEEDBACK_METHOD = [
|
|
2194
|
-
{ key: 'phone', text: 'Телефонный звонок' },
|
|
2195
|
-
{ key: 'email', text: 'Электронное сообщение' },
|
|
2196
|
-
];
|
|
2197
|
-
|
|
2198
2612
|
const FeedbackMethodField = JSX(({ field, input }) => (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, ...field(input?.name ?? '') })));
|
|
2199
2613
|
|
|
2200
2614
|
const FullNameField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u0424\u0418\u041E", ...field(input?.name ?? ''), ...input })));
|
|
@@ -2211,39 +2625,6 @@
|
|
|
2211
2625
|
|
|
2212
2626
|
const InnField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u0418\u041D\u041D", isInteger: true, maxLength: 12, ...input, ...field(input?.name ?? '') })));
|
|
2213
2627
|
|
|
2214
|
-
const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
|
|
2215
|
-
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) => {
|
|
2216
|
-
const resultOptions = { ...commonOptions, ...options };
|
|
2217
|
-
return (jsx("path", { d: d, fill: pathFill || 'currentColor', stroke: resultOptions.stroke, strokeLinecap: resultOptions.strokeLinecap, strokeLinejoin: resultOptions.strokeLinejoin, strokeWidth: resultOptions.strokeWidth, strokeMiterlimit: resultOptions.strokeMiterlimit }, i));
|
|
2218
|
-
}) }));
|
|
2219
|
-
});
|
|
2220
|
-
|
|
2221
|
-
const defaultCheckStyle = 'appearance-none w-5 h-5 border-solid flex-none';
|
|
2222
|
-
|
|
2223
|
-
const CHECK_PATHS = [
|
|
2224
|
-
{
|
|
2225
|
-
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',
|
|
2226
|
-
fillRule: 'evenodd',
|
|
2227
|
-
clipRule: 'evenodd',
|
|
2228
|
-
fill: 'white',
|
|
2229
|
-
},
|
|
2230
|
-
];
|
|
2231
|
-
const Checkbox = JSX(({ className, value, text, disabled, isRadio, onChange }) => {
|
|
2232
|
-
const handleChange = useCallback((e) => {
|
|
2233
|
-
if (disabled) {
|
|
2234
|
-
return;
|
|
2235
|
-
}
|
|
2236
|
-
e.preventDefault();
|
|
2237
|
-
onChange && onChange(!value);
|
|
2238
|
-
}, [onChange, disabled, value]);
|
|
2239
|
-
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" }));
|
|
2240
|
-
return (jsx("div", { className: className, children: jsxs("label", { className: style('flex items-center relative group/box', getCursorStyle(disabled)), onClick: handleChange, children: [jsx("div", { className: style(defaultCheckStyle, 'm-0', isRadio ? 'rounded-full border-2' : checkboxStyle(value), !disabled && 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), "aria-label": text }), value ? icon : null, renderText$4(text)] }) }));
|
|
2241
|
-
});
|
|
2242
|
-
const renderText$4 = (text) => text ? (jsx("div", { className: "ml-s", children: jsx(Text, { size: "text-l", font: "font-light", children: text }) })) : null;
|
|
2243
|
-
const getCursorStyle = (disabled = false) => (disabled ? 'cursor-not-allowed' : 'cursor-pointer');
|
|
2244
|
-
const role = (isRadio = false) => (isRadio ? 'radio' : 'checkbox');
|
|
2245
|
-
const checkboxStyle = (value = false) => style('rounded border', { 'bg-primary-main': value });
|
|
2246
|
-
|
|
2247
2628
|
const CheckboxWithError = JSX(({ className, text, value, key, disabled, error, onChange }) => (jsxs("div", { className: style('shrink-0', className), children: [jsx(Checkbox, { text: text, value: value, disabled: disabled, onChange: onChange }, key), renderErrorText(error)] })));
|
|
2248
2629
|
|
|
2249
2630
|
const IsClientField = JSX(({ field, input }) => (jsx(CheckboxWithError, { ...field(input?.name ?? ''), 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"' })));
|
|
@@ -2346,6 +2727,18 @@
|
|
|
2346
2727
|
const ProductField = UniBlock(({ field, input, source }) => (jsx(SelectControl, { placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043F\u0440\u043E\u0434\u0443\u043A\u0442", label: "\u041F\u0440\u043E\u0434\u0443\u043A\u0442", options: arrayToOptions(source?.productList), ...field(input?.name ?? '') })));
|
|
2347
2728
|
const arrayToOptions = (array) => (array ?? []).map((_) => ({ key: _, value: _ }));
|
|
2348
2729
|
|
|
2730
|
+
const QUESTION_PRODUCT_TYPES = [
|
|
2731
|
+
{
|
|
2732
|
+
key: 'Вопрос по действующему продукту',
|
|
2733
|
+
text: 'Вопрос по действующему продукту',
|
|
2734
|
+
},
|
|
2735
|
+
{
|
|
2736
|
+
key: 'Оформление нового продукта',
|
|
2737
|
+
text: 'Оформление нового продукта',
|
|
2738
|
+
},
|
|
2739
|
+
];
|
|
2740
|
+
const QuestionProductField = JSX(({ field, input }) => (jsx(SelectControl, { label: "\u041A\u0430\u043A\u043E\u0439 \u0443 \u0432\u0430\u0441 \u0432\u043E\u043F\u0440\u043E\u0441?", options: QUESTION_PRODUCT_TYPES, ...field(input?.name ?? '') })));
|
|
2741
|
+
|
|
2349
2742
|
const REGIONS_URL = `${API_BASE_URI$1}/regions`;
|
|
2350
2743
|
const EMPTY_REGIONS = [];
|
|
2351
2744
|
// TODO Почему url можно менять? Разве смысл не в инкапсуляции api url. Тоже под рефакторинг попадает
|
|
@@ -2365,88 +2758,6 @@
|
|
|
2365
2758
|
|
|
2366
2759
|
const RepresentativeNameField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u0424\u0418\u041E \u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u0435\u043B\u044F", ...input, ...field('representativeName') })));
|
|
2367
2760
|
|
|
2368
|
-
const withValidator = (props, validator) => {
|
|
2369
|
-
const { value, isDirty } = props;
|
|
2370
|
-
const errors = isDirty ? validator(value) : [];
|
|
2371
|
-
return {
|
|
2372
|
-
...props,
|
|
2373
|
-
errors,
|
|
2374
|
-
error: errors[0],
|
|
2375
|
-
};
|
|
2376
|
-
};
|
|
2377
|
-
|
|
2378
|
-
const cyrillicPattern = /^[а-яё-]*$/i;
|
|
2379
|
-
const isCyrillic = (_ = '') => cyrillicPattern.test(_);
|
|
2380
|
-
|
|
2381
|
-
const required = validator((_) => _ !== null && _ !== undefined && _ !== '');
|
|
2382
|
-
|
|
2383
|
-
const ERROR_MESSAGE$1 = 'Некорректно заполненное поле';
|
|
2384
|
-
const defaultValidator = (errorMsg) => required(errorMsg ?? ERROR_MESSAGE$1);
|
|
2385
|
-
const defaultSelectValidator = (errorMsg) => validator((_) => _?.key && _?.key !== '')(errorMsg ?? ERROR_MESSAGE$1);
|
|
2386
|
-
const nameValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length > 1 && isCyrillic(_))(errorMsg ?? ERROR_MESSAGE$1);
|
|
2387
|
-
const innValidator = (errorMsg) => validator((_) => isValidInnLength(_))(errorMsg);
|
|
2388
|
-
const innDadataValidator = (errorMsg) => validator((_) => Boolean(_?.text) && isValidInnLength(_.text))(errorMsg);
|
|
2389
|
-
const phoneValidate = (email) => /^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(email);
|
|
2390
|
-
const phoneValidator = (errorMsg) => validator(phoneValidate)(errorMsg);
|
|
2391
|
-
const agreementValidator = validator((_) => typeof _ === 'boolean' && _)('Согласие обязательно');
|
|
2392
|
-
const emailValidate = (email) => /^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(email);
|
|
2393
|
-
const emailValidator = (errorMsg) => validator((_) => emailValidate(_))(errorMsg);
|
|
2394
|
-
const isValidInnLength = (value) => typeof value === 'string' && (value.length === 10 || value.length === 12);
|
|
2395
|
-
|
|
2396
|
-
const validatorObj$1 = {
|
|
2397
|
-
fullName: defaultValidator(),
|
|
2398
|
-
addressBranch: defaultSelectValidator(),
|
|
2399
|
-
desiredMeetingDate: defaultValidator(),
|
|
2400
|
-
product: defaultValidator(),
|
|
2401
|
-
localities: defaultValidator(),
|
|
2402
|
-
partnerComments: defaultValidator(),
|
|
2403
|
-
collectionCount: defaultValidator(),
|
|
2404
|
-
acquiringType: defaultSelectValidator(),
|
|
2405
|
-
serviceType: defaultSelectValidator(),
|
|
2406
|
-
annualRevenue: defaultValidator(),
|
|
2407
|
-
feedbackMethod: defaultSelectValidator(),
|
|
2408
|
-
serviceDirection: defaultSelectValidator(),
|
|
2409
|
-
secondaryPhone: phoneValidator('Укажите номер телефона'),
|
|
2410
|
-
region: defaultSelectValidator(),
|
|
2411
|
-
situationDescription: defaultValidator(),
|
|
2412
|
-
sufferedFrom: defaultValidator(),
|
|
2413
|
-
applierType: defaultValidator(),
|
|
2414
|
-
surname: nameValidator('Укажите свою фамилию на кириллице'),
|
|
2415
|
-
name: nameValidator('Укажите своё имя на кириллице (без сокращений)'),
|
|
2416
|
-
middleName: nameValidator('Укажите своё отчество на кириллице'),
|
|
2417
|
-
birthday: defaultValidator('Укажите дату рождения'),
|
|
2418
|
-
phone: phoneValidator('Укажите номер телефона'),
|
|
2419
|
-
email: emailValidator('Укажите электронную почту'),
|
|
2420
|
-
inn: innValidator('Укажите ИНН'),
|
|
2421
|
-
comment: defaultValidator(),
|
|
2422
|
-
typeForm: defaultValidator(),
|
|
2423
|
-
consentToReceiveMaterials: agreementValidator,
|
|
2424
|
-
consentDataProcessing: agreementValidator,
|
|
2425
|
-
partnerSymbolCode: defaultValidator('Укажите идентификатор партнёра'),
|
|
2426
|
-
dadataPartyInnSelect: innDadataValidator('Укажите ИНН'),
|
|
2427
|
-
dadataPartyNameSelect: defaultValidator('Укажите наименование организации'),
|
|
2428
|
-
};
|
|
2429
|
-
const getFormValidator = (fieldDefs, externalValidatorObj = {}) => {
|
|
2430
|
-
const requiredFields = fieldDefs.filter((_) => Boolean(_?.required && _?.name));
|
|
2431
|
-
const validator = { ...validatorObj$1, ...externalValidatorObj };
|
|
2432
|
-
const hasConditions = requiredFields.some((_) => _.condition?.values);
|
|
2433
|
-
const requiredFieldValidatorsMap = Object.fromEntries(requiredFields
|
|
2434
|
-
.filter(byNonEmptyValidator(validator))
|
|
2435
|
-
.map(({ name }) => [name, validator[name ?? '']]));
|
|
2436
|
-
return (formState) => hasConditions
|
|
2437
|
-
? Object.fromEntries(requiredFields
|
|
2438
|
-
.filter(byNonEmptyValidator(validator))
|
|
2439
|
-
.filter(byCondition(formState))
|
|
2440
|
-
.map(({ name }) => [name, validator[name ?? '']]))
|
|
2441
|
-
: requiredFieldValidatorsMap;
|
|
2442
|
-
};
|
|
2443
|
-
const byNonEmptyValidator = (validator = {}) => ({ name }) => Boolean(validator[name ?? '']);
|
|
2444
|
-
const byCondition = (formState) => (fieldDef) => !fieldDef?.condition ||
|
|
2445
|
-
fieldDef.condition.values.some((_) => {
|
|
2446
|
-
const dependencyValue = formState?.[fieldDef?.condition?.name ?? ''];
|
|
2447
|
-
return _ === (dependencyValue?.key ?? dependencyValue);
|
|
2448
|
-
});
|
|
2449
|
-
|
|
2450
2761
|
const SecondaryPhoneField = JSX(({ field }) => {
|
|
2451
2762
|
const fieldPhone = field('secondaryPhone');
|
|
2452
2763
|
return (jsx(InputPhoneControl, { label: "\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u044B\u0439 \u0442\u0435\u043B\u0435\u0444\u043E\u043D", ...(!fieldPhone.value || fieldPhone.value === '+7 ('
|
|
@@ -2474,40 +2785,18 @@
|
|
|
2474
2785
|
{
|
|
2475
2786
|
key: 'chs',
|
|
2476
2787
|
text: 'От стихийного бедствия ЧС',
|
|
2477
|
-
},
|
|
2478
|
-
];
|
|
2479
|
-
const SufferedFromField = JSX(({ field, input }) => (jsx(SelectControl, { label: "\u041F\u043E\u0441\u0442\u0440\u0430\u0434\u0430\u043B \u0432", ...input, options: SUFFERED_FROM_TYPES, ...field('sufferedFrom') })));
|
|
2480
|
-
|
|
2481
|
-
const SurnameField$1 = JSX(({ field, input }) => (jsx(InputControl, { label: "\u0424\u0430\u043C\u0438\u043B\u0438\u044F", maxLength: 60, disabled: isEsiaAuthorize(field, input), ...field(input?.name ?? ''), ...input })));
|
|
2482
|
-
|
|
2483
|
-
const MIN_CREDIT_TERM = 1;
|
|
2484
|
-
const MAX_CREDIT_TERM = 180;
|
|
2485
|
-
const ITEMS_CREDIT_TERM = ['От 1 мес', 'До 15 лет'];
|
|
2486
|
-
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') })));
|
|
2487
|
-
|
|
2488
|
-
const UltraPremiumField = JSX(({ field, input }) => (jsx(SelectControl, { label: "\u0422\u0438\u043F \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u044F", options: SERVICE_TYPES, ...field(input?.name ?? '') })));
|
|
2489
|
-
|
|
2490
|
-
const orientationStyleMap = {
|
|
2491
|
-
horizontal: '@lg:flex-row',
|
|
2492
|
-
vertical: '',
|
|
2493
|
-
};
|
|
2494
|
-
const RadioButtonGroup = JSX(({ label, items, value, className, disabled = false, orientation = 'horizontal', onChange: onChangeCheckedItem, }) => (jsxs("div", { className: "grid gap-xs whitespace-nowrap", children: [label ? (jsx("div", { role: "radiogroup", "aria-label": label, children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: label }) })) : null, jsx("div", { className: style('flex flex-col gap-s', orientationStyleMap[orientation], className), role: "radiogroup", "aria-label": "\u0413\u0440\u0443\u043F\u043F\u0430 \u043A\u043D\u043E\u043F\u043E\u043A", children: items?.map(({ id, text }) => (jsx(Checkbox, { isRadio: true, text: text, value: value === id, onChange: () => onChangeCheckedItem?.(id), disabled: disabled }, String(id)))) })] })));
|
|
2495
|
-
|
|
2496
|
-
const VED_TYPES = [
|
|
2497
|
-
{ id: 'currencyControl', text: 'Валютный контроль' },
|
|
2498
|
-
{ id: 'documentOperations', text: 'Документарные операции' },
|
|
2499
|
-
{ id: 'conversionTransactions', text: 'Конверсионные операции' },
|
|
2500
|
-
{ id: 'otherIssues', text: 'Иные вопросы ВЭД' },
|
|
2788
|
+
},
|
|
2501
2789
|
];
|
|
2502
|
-
const
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2790
|
+
const SufferedFromField = JSX(({ field, input }) => (jsx(SelectControl, { label: "\u041F\u043E\u0441\u0442\u0440\u0430\u0434\u0430\u043B \u0432", ...input, options: SUFFERED_FROM_TYPES, ...field('sufferedFrom') })));
|
|
2791
|
+
|
|
2792
|
+
const SurnameField$1 = JSX(({ field, input }) => (jsx(InputControl, { label: "\u0424\u0430\u043C\u0438\u043B\u0438\u044F", maxLength: 60, disabled: isEsiaAuthorize(field, input), ...field(input?.name ?? ''), ...input })));
|
|
2793
|
+
|
|
2794
|
+
const MIN_CREDIT_TERM = 1;
|
|
2795
|
+
const MAX_CREDIT_TERM = 180;
|
|
2796
|
+
const ITEMS_CREDIT_TERM = ['От 1 мес', 'До 15 лет'];
|
|
2797
|
+
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') })));
|
|
2798
|
+
|
|
2799
|
+
const UltraPremiumField = JSX(({ field, input }) => (jsx(SelectControl, { label: "\u0422\u0438\u043F \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u044F", options: SERVICE_TYPES, ...field(input?.name ?? '') })));
|
|
2511
2800
|
|
|
2512
2801
|
const ConsentToReceiveMaterialsField = JSX(({ field, input }) => (jsx(Checkbox, { text: "\u0421\u043E\u0433\u043B\u0430\u0441\u0435\u043D \u043D\u0430 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0435 \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0445 \u0438 \u0430\u043D\u0430\u043B\u0438\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u043E\u0432 \u043F\u043E \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0447\u0442\u0435", ...field(input?.name ?? '') })));
|
|
2513
2802
|
|
|
@@ -2574,6 +2863,9 @@
|
|
|
2574
2863
|
partnerName: (props) => jsx(PartnerNameField, { ...props, source: AGENTS_REF }),
|
|
2575
2864
|
dadataPartyNameSelect: DadataPartySelectField,
|
|
2576
2865
|
dadataPartyInnSelect: DadataPartySelectField,
|
|
2866
|
+
questionProduct: QuestionProductField,
|
|
2867
|
+
callbackTime: CallbackTimeField,
|
|
2868
|
+
russianPhone: PhoneField,
|
|
2577
2869
|
};
|
|
2578
2870
|
const getField = (field, params, externalInputs = {}) => (input, i) => {
|
|
2579
2871
|
const fieldsRegister = {
|
|
@@ -2588,167 +2880,7 @@
|
|
|
2588
2880
|
|
|
2589
2881
|
const renderTitle = (title) => title ? (jsx("div", { className: "@xl:text-center @xl:col-span-2 mb-m", children: jsx(Text, { size: "text-h6", children: title }) })) : null;
|
|
2590
2882
|
|
|
2591
|
-
const
|
|
2592
|
-
primary: style('text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active', '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'),
|
|
2593
|
-
secondary: style('text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active', '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'),
|
|
2594
|
-
};
|
|
2595
|
-
const embeddedStyle = style('group/btn-embedded', 'bg-transparent border border-transparent outline-none');
|
|
2596
|
-
const disabledStyle = style('bg-main-gray text-main-disabled cursor-not-allowed');
|
|
2597
|
-
const Button = JSX(({ className, type = 'button', version = 'primary', shape = 'default', embedded, disabled, role, ariaLabel, data, dataTheme, children, wcmsIgnore, onClick = noop, }) => {
|
|
2598
|
-
const handleClick = useCallback(role !== 'tab' ? handlerDecorator(onClick) : onClick, [
|
|
2599
|
-
role,
|
|
2600
|
-
onClick,
|
|
2601
|
-
]);
|
|
2602
|
-
const aspectsAttrs = useMemo(() => getAspectsAttributes(data), [data]);
|
|
2603
|
-
const isRound = shape === 'round';
|
|
2604
|
-
return (jsx("button", { className: style('font-sans flex items-center gap-xs', {
|
|
2605
|
-
[themeStyle$1[version]]: !disabled && !embedded,
|
|
2606
|
-
[embeddedStyle]: embedded,
|
|
2607
|
-
[disabledStyle]: disabled,
|
|
2608
|
-
}, embedded ? 'justify-between' : 'justify-center', embedded || isRound ? 'p-0' : 'px-9 py-4', {
|
|
2609
|
-
'rounded-md': shape === 'default',
|
|
2610
|
-
'rounded-full': isRound,
|
|
2611
|
-
}, className), type: type, role: role, "aria-label": ariaLabel, disabled: disabled, "aria-disabled": disabled ? 'true' : undefined, "data-theme": dataTheme, "data-wcms-ignore": wcmsIgnore, ...aspectsAttrs, onClick: handleClick, children: children }));
|
|
2612
|
-
});
|
|
2613
|
-
|
|
2614
|
-
const CloseButton = JSX(({ className, onClose }) => (jsx("button", { className: style('flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none', className), onClick: onClose, title: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C", type: "button", children: jsx(Icon, { name: "CloseIcon", width: "20", height: "20", iconVersion: "gray" }) })));
|
|
2615
|
-
|
|
2616
|
-
const DIALOG_STYLE = {
|
|
2617
|
-
sm: 'max-w-sm top-1/3',
|
|
2618
|
-
lg: 'max-w-lg',
|
|
2619
|
-
'4xl': 'max-w-4xl',
|
|
2620
|
-
none: 'mt-0',
|
|
2621
|
-
};
|
|
2622
|
-
const Dialog = JSX(({ head, maxWidth = '4xl', children, onClose, onClick }) => (jsxs("div", { className: style('relative bg-white p-lg pb-6xl my-6xl mx-auto rounded-lg w-full', DIALOG_STYLE[maxWidth]), role: "dialog", title: "\u0414\u0438\u0430\u043B\u043E\u0433", onClick: onClick, children: [jsxs("div", { className: "sticky py-xl top-0 bg-white z-10", children: [jsx(CloseButton, { className: "absolute top-0 right-0 z-10", onClose: onClose }), jsx("div", { className: "container", children: head })] }), jsx("div", { className: "container", children: children })] })));
|
|
2623
|
-
|
|
2624
|
-
const ResponseTypeDialog = JSX(({ ok, typeForm, onClose }) => {
|
|
2625
|
-
const statusIcon = ok ? 'ResponseOKIcon' : 'ResponseFailIcon';
|
|
2626
|
-
const responseOKDescription = typeForm === 'ANTIFRAUD'
|
|
2627
|
-
? `Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы
|
|
2628
|
-
можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка
|
|
2629
|
-
не звонят с использованием мессенджеров.`
|
|
2630
|
-
: 'Совсем скоро мы с вами свяжемся';
|
|
2631
|
-
return (jsx(Dialog, { maxWidth: "lg", onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-lg items-center rounded-md space-x-m", children: [jsx(Img, { image: { icon: statusIcon, iconVersion: 'normal' }, width: "136", height: "136" }), jsx(Headline, { className: "w-full", title: ok ? 'Ваша заявка отправлена' : 'Не удалось отправить заявку', description: ok ? responseOKDescription : 'Пожалуйста, повторите позднее', headlineVersion: "XS", isEmbedded: true }), jsx(Button, { type: "button", onClick: onClose, children: "\u0425\u043E\u0440\u043E\u0448\u043E" })] }) }));
|
|
2632
|
-
});
|
|
2633
|
-
|
|
2634
|
-
const getPartnerComments = (data) => {
|
|
2635
|
-
const { acquiringType, onlineCheckout = false, posTerminal = false, term, amount, annualRevenue, } = data;
|
|
2636
|
-
if (acquiringType) {
|
|
2637
|
-
return `Вид эквайринга=${acquiringType?.text || ''}${isAcquiringTrade(acquiringType?.key)
|
|
2638
|
-
? `/Онлайн касса=${onlineCheckout}/POS-терминал=${posTerminal}`
|
|
2639
|
-
: '/Онлайн касса=false/POS-терминал=false'}`;
|
|
2640
|
-
}
|
|
2641
|
-
else {
|
|
2642
|
-
return `Сумма=${amount}/Срок=${term}/Выручка=${annualRevenue}`;
|
|
2643
|
-
}
|
|
2644
|
-
};
|
|
2645
|
-
|
|
2646
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2647
|
-
const getFormatData = (data) => {
|
|
2648
|
-
const { acquiringType, onlineCheckout, posTerminal, amount, term, annualRevenue, serviceType, vedTypes, region, inn, sufferedFrom, situationDescription, applierType, isPremium, dadataPartyNameSelect, partnerSymbolCode, dadataPartyInnSelect, ...usedData } = data;
|
|
2649
|
-
const partnerComments = acquiringType || annualRevenue ? getPartnerComments(data) : null;
|
|
2650
|
-
const formatData = {
|
|
2651
|
-
...usedData,
|
|
2652
|
-
...getVedTypes(vedTypes),
|
|
2653
|
-
...getRegion(region),
|
|
2654
|
-
...(inn && { inn }),
|
|
2655
|
-
...(partnerComments ? { partnerComments } : {}),
|
|
2656
|
-
...(serviceType ? { typeForm: serviceType } : {}),
|
|
2657
|
-
...getIncidentComment(sufferedFrom?.text, situationDescription),
|
|
2658
|
-
...getIsClient(applierType),
|
|
2659
|
-
...getDadataValues([
|
|
2660
|
-
[dadataPartyInnSelect, 'inn'],
|
|
2661
|
-
[dadataPartyNameSelect, 'fullName'],
|
|
2662
|
-
]),
|
|
2663
|
-
};
|
|
2664
|
-
return Object.fromEntries(Object.entries(formatData)?.map(([k, v]) => [k, v?.key || v]));
|
|
2665
|
-
};
|
|
2666
|
-
const getIsClient = (applierType) => applierType?.key ? { isClient: applierType?.key === CLIENT_KEY } : {};
|
|
2667
|
-
const getIncidentComment = (sufferedFrom, situationDescription) => sufferedFrom || situationDescription
|
|
2668
|
-
? { comment: `${sufferedFrom || ''};${situationDescription || ''}` }
|
|
2669
|
-
: {};
|
|
2670
|
-
const getRegion = (region) => region?.key || region?.text ? { region: region?.text || region?.key } : {};
|
|
2671
|
-
const getVedTypes = (vedTypes) => vedTypes
|
|
2672
|
-
? {
|
|
2673
|
-
vedTypes: Object.fromEntries(VED_TYPES.map(({ id }) => [id, id === vedTypes])),
|
|
2674
|
-
}
|
|
2675
|
-
: {};
|
|
2676
|
-
const getDadataValues = (fields) => fields.reduce((acc, [field, name]) => {
|
|
2677
|
-
if (field?.text && name) {
|
|
2678
|
-
acc[name] = field.text;
|
|
2679
|
-
}
|
|
2680
|
-
return acc;
|
|
2681
|
-
}, {});
|
|
2682
|
-
|
|
2683
|
-
const initialFormState$1 = {
|
|
2684
|
-
typeForm: '',
|
|
2685
|
-
region: { key: '', text: '' },
|
|
2686
|
-
addressBranch: { key: '', text: '' },
|
|
2687
|
-
surname: '',
|
|
2688
|
-
name: '',
|
|
2689
|
-
phone: '',
|
|
2690
|
-
secondaryPhone: '',
|
|
2691
|
-
comment: '',
|
|
2692
|
-
product: '',
|
|
2693
|
-
partnerComments: '',
|
|
2694
|
-
annualRevenue: '',
|
|
2695
|
-
term: 12,
|
|
2696
|
-
amount: 100000,
|
|
2697
|
-
acquiringType: ACQUIRING_TYPES[0],
|
|
2698
|
-
serviceType: SERVICE_TYPES[0],
|
|
2699
|
-
feedbackMethod: FEEDBACK_METHOD[0],
|
|
2700
|
-
serviceDirection: SERVICE_DIRECTIONS[0],
|
|
2701
|
-
vedTypes: VED_TYPES[0].id,
|
|
2702
|
-
birthday: undefined,
|
|
2703
|
-
isClient: false,
|
|
2704
|
-
onlineCheckout: false,
|
|
2705
|
-
posTerminal: false,
|
|
2706
|
-
consentToReceiveMaterials: false,
|
|
2707
|
-
consentDataProcessing: false,
|
|
2708
|
-
addressRetail: { key: '', text: '' },
|
|
2709
|
-
};
|
|
2710
|
-
const getInitialFormState$2 = (inputs, typeForm = '') => {
|
|
2711
|
-
const formState = Object.fromEntries(inputs.map((_) => [
|
|
2712
|
-
_.name,
|
|
2713
|
-
(_?.name === 'vedTypes' && _?.defaultValue) || initialFormState$1[_.name || ''],
|
|
2714
|
-
]));
|
|
2715
|
-
return { ...formState, typeForm: { key: typeForm, text: '' } };
|
|
2716
|
-
};
|
|
2717
|
-
|
|
2718
|
-
const Loader = JSX(({ color = 'text-primary-main', position = 'absolute', blur = true, size = 'big' }) => (jsx("div", { className: style('flex justify-center items-center h-full w-full z-50', position, {
|
|
2719
|
-
'backdrop-blur': blur,
|
|
2720
|
-
}), children: jsx("div", { className: style('inline-block', 'animate-spin rounded-full', 'border-solid border-current', 'border-r-transparent', size === 'extraSmall' && 'border-2 h-4 w-4', size === 'small' && 'border-4 h-8 w-8', size === 'big' && 'border-8 h-28 w-28', color), role: "status" }) })));
|
|
2721
|
-
|
|
2722
|
-
const SubmitButton$1 = JSX(({ isLoading, disabled, children, className, ...rest }) => (jsxs(Button, { type: "submit", className: style('relative', className), disabled: isLoading || disabled, ...rest, children: [isLoading ? jsx(Loader, { blur: true, size: "small" }) : null, children] })));
|
|
2723
|
-
|
|
2724
|
-
const themeStyle = {
|
|
2725
|
-
primary: themeStyle$1.primary,
|
|
2726
|
-
secondary: themeStyle$1.secondary,
|
|
2727
|
-
white: 'text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main',
|
|
2728
|
-
link: 'text-primary-main',
|
|
2729
|
-
gray: themeStyle$1.secondary,
|
|
2730
|
-
transparent: '',
|
|
2731
|
-
'': '',
|
|
2732
|
-
};
|
|
2733
|
-
const Link = JSX((props) => {
|
|
2734
|
-
const link = useLink();
|
|
2735
|
-
const { className, href, target, text, aboveText, version = 'link', rel, ariaLabel, data, children, onClick, } = link(props);
|
|
2736
|
-
const buttonLike = version !== 'link';
|
|
2737
|
-
return (jsx("a", { className: style('group/btn inline-flex items-center h-fit', 'font-sans no-underline select-none', 'border border-transparent focus:border-primary-text focus:border', 'cursor-pointer', {
|
|
2738
|
-
[themeStyle[version]]: Boolean(version),
|
|
2739
|
-
[aboveText ? 'px-9 py-2.5' : 'px-9 py-4']: buttonLike,
|
|
2740
|
-
'rounded-md': buttonLike,
|
|
2741
|
-
}, className), href: href, target: target, rel: rel, "aria-label": ariaLabel ?? `Ссылка на ${text}`, role: href ? 'link' : 'button', onClick: onClick, ...getAspectsAttributes(data), children: children ?? renderText$3(text, aboveText) }));
|
|
2742
|
-
});
|
|
2743
|
-
const renderText$3 = (text, aboveText) => text || aboveText ? (jsxs("div", { className: "whitespace-pre", children: [aboveText ? jsx("div", { className: "font-light text-left text-xs", children: aboveText }) : null, jsx("div", { className: style('text-left', { 'text-s -mt-3xs': Boolean(aboveText) }), children: text })] })) : null;
|
|
2744
|
-
|
|
2745
|
-
const Footnote = JSX(({ text, link }) => (jsxs(Paragraph, { size: "text-l", font: "font-light", color: "text-secondary-text", children: [text ? jsx(Text, { children: text }) : null, link ? (jsx(Link, { ...link, ariaLabel: "\u0443\u0441\u043B\u043E\u0432\u0438\u044F \u043F\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043D\u043D\u044B\u0445", children: link.text })) : null] })));
|
|
2746
|
-
|
|
2747
|
-
const agreementText = 'Нажимая кнопку, вы подтверждаете согласие с ';
|
|
2748
|
-
const agreementTextPF = 'Нажимая на кнопку, вы подтверждаете, что клиент дал согласие на ';
|
|
2749
|
-
const renderAgreementSubmit = ({ consentDataProcessing, link, button, typeForm, }) => (jsxs("div", { className: "flex col-span-2 gap-xs flex-col w-full items-baseline", children: [consentDataProcessing ? (jsxs("div", { children: [jsxs("div", { className: "flex gap-3 items-center", children: [jsx(Checkbox, { ...consentDataProcessing }), jsx(Footnote, { link: link })] }), renderErrorText(withValidator(consentDataProcessing, agreementValidator).error)] })) : (jsx(Footnote, { text: typeForm === 'PF' ? agreementTextPF : agreementText, link: link })), jsx(SubmitButton$1, { className: "w-full @xl:w-auto", children: button?.text ? button.text : 'Отправить заявку' })] }));
|
|
2750
|
-
|
|
2751
|
-
const renderContacts = () => (jsxs("div", { className: "space-y-m", children: [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" }), jsxs("div", { className: "flex sm:justify-center 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": "\u0442\u0435\u043B\u0435\u0444\u043E\u043D 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": "\u043F\u043E\u0447\u0442\u0430 ved@rshb.ru", href: `mailto:ved@rshb.ru`, children: [jsx(Img, { image: { icon: 'MailIcon' }, width: "24", height: "24" }), jsx("span", { children: "ved@rshb.ru" })] })] })] }));
|
|
2883
|
+
const renderSections = (sections, field, { typeForm, additionalParams }) => sections.map((_, i) => (jsxs("div", { className: style(inputColumnStyles(_.columns), 'grid'), children: [renderTitle(_.title), (_?.inputs || [])?.map(getField(field, { typeForm, ...additionalParams }))] }, `section-${i}`)));
|
|
2752
2884
|
|
|
2753
2885
|
const useInterval = (handler, period) => {
|
|
2754
2886
|
const timer = useRef(null);
|
|
@@ -2844,7 +2976,7 @@
|
|
|
2844
2976
|
const TIME_TO_RESEND$2 = 180;
|
|
2845
2977
|
const getTimer = (sendTime) => TIME_TO_RESEND$2 - Math.floor((Date.now() - sendTime) / 1000);
|
|
2846
2978
|
|
|
2847
|
-
const API$
|
|
2979
|
+
const API$1 = LeadServiceAPI();
|
|
2848
2980
|
const useVerifyPhoneDialogSubmit$1 = ({ values, onSuccess, formatData, reqId, }) => {
|
|
2849
2981
|
const timer = Math.max(getTimer(Date.now()), 0);
|
|
2850
2982
|
const [errorText, setErrorText] = useState('');
|
|
@@ -2855,7 +2987,7 @@
|
|
|
2855
2987
|
const handleSubmit = useCallback(async () => {
|
|
2856
2988
|
try {
|
|
2857
2989
|
startLoading();
|
|
2858
|
-
const response = await API$
|
|
2990
|
+
const response = await API$1.checkCode({
|
|
2859
2991
|
code: values.join(''),
|
|
2860
2992
|
body: formatData,
|
|
2861
2993
|
reqId,
|
|
@@ -2887,7 +3019,7 @@
|
|
|
2887
3019
|
};
|
|
2888
3020
|
};
|
|
2889
3021
|
|
|
2890
|
-
const API
|
|
3022
|
+
const API = LeadServiceAPI();
|
|
2891
3023
|
const CODE_LENGTH$1 = 4;
|
|
2892
3024
|
const TIME_TO_RESEND$1 = 180;
|
|
2893
3025
|
const VerifyPhoneDialog$1 = JSX(({ phone, onSuccess = noop, onClose = noop, formatData = {}, reqId }) => {
|
|
@@ -2902,7 +3034,7 @@
|
|
|
2902
3034
|
const phoneNumber = formatPhone(phone);
|
|
2903
3035
|
const restartTimer = useCountDownTimer({ seconds: timeNextReq, onTick: setTimeNextReq });
|
|
2904
3036
|
const handleSendCode = useCallback(async () => {
|
|
2905
|
-
const response = await API
|
|
3037
|
+
const response = await API.sendCode({ phone: phoneNumber });
|
|
2906
3038
|
if (response) {
|
|
2907
3039
|
setTimeNextReq(TIME_TO_RESEND$1);
|
|
2908
3040
|
restartTimer(TIME_TO_RESEND$1);
|
|
@@ -2913,10 +3045,12 @@
|
|
|
2913
3045
|
return (jsx(VerifyPhoneDialogLayout, { isSubmitButtonDisabled: isSubmitButtonDisabled, onSubmit: handleSubmit, onSendCode: handleSendCode, timeNextReq: timeNextReq, values: values, onChange: setValues, phone: phone, isLoading: isLoading, errorText: errorText, hasError: hasError, onClose: onClose }));
|
|
2914
3046
|
});
|
|
2915
3047
|
|
|
2916
|
-
const
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
3048
|
+
const handlerMap = {
|
|
3049
|
+
initcorporatelead: handleInitCorporateLead,
|
|
3050
|
+
callback: handleCallback,
|
|
3051
|
+
default: handleDefault,
|
|
3052
|
+
};
|
|
3053
|
+
const ApplicationForm = UniBlock(({ className, title, typeForm = '', sections = [], button, link, endpoint, additionalParams, isContacts, data, onSuccess, ...rest }) => {
|
|
2920
3054
|
const inputs = useMemo(() => (sections?.flatMap((_) => _?.inputs) || []), [sections]);
|
|
2921
3055
|
const initialFormState = useMemo(() => getInitialFormState$2(inputs, typeForm), [inputs, typeForm]);
|
|
2922
3056
|
const router = useRouter();
|
|
@@ -2926,31 +3060,17 @@
|
|
|
2926
3060
|
const verifyPhoneDialog = useDialog(VerifyPhoneDialog$1);
|
|
2927
3061
|
const handleSubmit = useCallback(async (formData, ev) => {
|
|
2928
3062
|
const formatData = getFormatData({ ...formData, ...additionalParams });
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
onSuccess: () => {
|
|
2941
|
-
verifyPhoneDialog.close();
|
|
2942
|
-
responseTypeDialog.open({ ok: true, typeForm });
|
|
2943
|
-
handleAspects({ aspectsAttributes: data, aspects, ev });
|
|
2944
|
-
},
|
|
2945
|
-
});
|
|
2946
|
-
}
|
|
2947
|
-
else {
|
|
2948
|
-
const ok = Boolean(await API.send(formatData, router, endpoint === 'lead'));
|
|
2949
|
-
responseTypeDialog.open({ ok, typeForm });
|
|
2950
|
-
if (ok) {
|
|
2951
|
-
handleAspects({ aspectsAttributes: data, aspects, ev });
|
|
2952
|
-
}
|
|
2953
|
-
}
|
|
3063
|
+
await executeHandler(endpoint ?? 'default', {
|
|
3064
|
+
formatData,
|
|
3065
|
+
ev,
|
|
3066
|
+
typeForm,
|
|
3067
|
+
data,
|
|
3068
|
+
aspects,
|
|
3069
|
+
router,
|
|
3070
|
+
responseTypeDialog,
|
|
3071
|
+
verifyPhoneDialog,
|
|
3072
|
+
onSuccess,
|
|
3073
|
+
});
|
|
2954
3074
|
}, [typeForm]);
|
|
2955
3075
|
const [, { field, onSubmit }] = useForm(initialFormState, {
|
|
2956
3076
|
resetOnSubmit: true,
|
|
@@ -2966,7 +3086,10 @@
|
|
|
2966
3086
|
typeForm,
|
|
2967
3087
|
})] }), isContacts ? renderContacts() : null] }));
|
|
2968
3088
|
});
|
|
2969
|
-
const
|
|
3089
|
+
const executeHandler = async (endpoint, context) => {
|
|
3090
|
+
const handler = handlerMap[endpoint] || handlerMap.default;
|
|
3091
|
+
await handler(context);
|
|
3092
|
+
};
|
|
2970
3093
|
|
|
2971
3094
|
const NoConsentDialog = JSX(({ attempts, onClose = noop }) => {
|
|
2972
3095
|
const navigator = locationNavigator();
|
|
@@ -4520,7 +4643,7 @@
|
|
|
4520
4643
|
return [storedValue, setValue];
|
|
4521
4644
|
}
|
|
4522
4645
|
|
|
4523
|
-
const InfoCard = JSX(({ __html, icon = 'InfoCircleIcon', iconVersion = 'black' }) => (jsxs("div", { className: "flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m", children: [jsx("div", { className: "rounded-full bg-white p-xs", children: jsx(Icon, { name: icon, width: "24", height: "24", iconVersion: iconVersion }) }), jsx("div", { className: "", children: jsx(RichText, { __html: __html }) })] })));
|
|
4646
|
+
const InfoCard = JSX(({ __html, icon = 'InfoCircleIcon', iconVersion = 'black', image }) => (jsxs("div", { className: "flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m", children: [jsx("div", { className: "rounded-full bg-white p-xs", children: image ? (jsx(Img, { image: image, className: "block w-max" })) : (jsx(Icon, { name: icon, width: "24", height: "24", iconVersion: iconVersion })) }), jsx("div", { className: "", children: jsx(RichText, { __html: __html }) })] })));
|
|
4524
4647
|
|
|
4525
4648
|
const getCardTypes = async (paymentSystemTypeCd, creditProgramId) => {
|
|
4526
4649
|
const data = await fetchRetailJSON('/dictionaryFiltered', 'POST', {
|
|
@@ -10804,23 +10927,23 @@
|
|
|
10804
10927
|
medium: 'w-10 h-10',
|
|
10805
10928
|
large: 'w-12 h-12',
|
|
10806
10929
|
};
|
|
10807
|
-
const HeaderSecondaryMenuButton = JSX(({ className, isRounded, buttonSize = 'default', isGrayBg = false, disabled, ariaLabel = 'Меню второго уровня', image, data, onClick, version, isLoading, dataTestId = '', }) => {
|
|
10930
|
+
const HeaderSecondaryMenuButton = JSX(({ className, isRounded, buttonSize = 'default', isGrayBg = false, disabled, ariaLabel = 'Меню второго уровня', image, data, onClick, version, isLoading, dataTestId = '', ref, }) => {
|
|
10808
10931
|
const grayBg = isGrayBg && !isRounded ? 'bg-main-divider' : '';
|
|
10809
10932
|
const bgColor = version === 'transparent' ? 'backdrop-opacity-30 bg-white/30' : grayBg;
|
|
10810
10933
|
return (jsx("button", { className: style('group/btn border-0 flex shrink-0 items-center', isGrayBg ? 'p-s rounded-full' : 'p-0 bg-inherit', bgColor, isRounded
|
|
10811
10934
|
? 'w-8 h-8 text-secondary-light hover:text-secondary-hove'
|
|
10812
|
-
: `${BUTTON_SIZE_STYLE[buttonSize]} text-primary-text hover:text-primary-main`, 'group-data-transparent:text-white', className), type: "button", disabled: disabled, "aria-label": ariaLabel, onClick: onClick, ...getDataTestIdAttribute(dataTestId), ...getAspectsAttributes(data), children: isLoading ? (jsx("div", { className: "w-full h-full rounded-full border-4 border-r-transparent animate-spin text-primary-main" })) : (jsx(Img, { image: image, className: style('h-full', {
|
|
10935
|
+
: `${BUTTON_SIZE_STYLE[buttonSize]} text-primary-text hover:text-primary-main`, 'group-data-transparent:text-white', className), type: "button", disabled: disabled, "aria-label": ariaLabel, onClick: onClick, ...getDataTestIdAttribute(dataTestId), ...getAspectsAttributes(data), ref: ref, children: isLoading ? (jsx("div", { className: "w-full h-full rounded-full border-4 border-r-transparent animate-spin text-primary-main" })) : (jsx(Img, { image: image, className: style('h-full', {
|
|
10813
10936
|
'bg-main-divider/20 rounded-full': isRounded,
|
|
10814
10937
|
}), imageClassName: "group-hover/btn:text-primary-hover group-hover/btn:invert-0" })) }));
|
|
10815
10938
|
});
|
|
10816
10939
|
const getDataTestIdAttribute = (dataTestId) => dataTestId ? { 'data-test-id': dataTestId } : null;
|
|
10817
10940
|
|
|
10818
|
-
const CHAT_BOT_ASPECT_NAME = 'openChatBot';
|
|
10941
|
+
const CHAT_BOT_ASPECT_NAME$1 = 'openChatBot';
|
|
10819
10942
|
const HeaderChatBotButton = JSX(({ iconVersion, className, ariaLabel = 'Чат', version, buttonSize = 'large' }) => {
|
|
10820
10943
|
const [isLoading, { setTrue: startLoad, setFalse: endLoad }] = useBool(false);
|
|
10821
10944
|
const aspects = useAspects();
|
|
10822
10945
|
const handleClick = useCallback((ev) => {
|
|
10823
|
-
const openChatBot = aspects[CHAT_BOT_ASPECT_NAME];
|
|
10946
|
+
const openChatBot = aspects[CHAT_BOT_ASPECT_NAME$1];
|
|
10824
10947
|
if (openChatBot) {
|
|
10825
10948
|
startLoad();
|
|
10826
10949
|
openChatBot(ev).finally(endLoad);
|
|
@@ -10829,6 +10952,147 @@
|
|
|
10829
10952
|
return (jsx(HeaderSecondaryMenuButton, { className: className, image: { icon: 'ChatBotIcon', iconVersion }, ariaLabel: ariaLabel, onClick: handleClick, buttonSize: buttonSize, isGrayBg: true, version: version, isLoading: isLoading, disabled: isLoading, dataTestId: "chat icon" }));
|
|
10830
10953
|
});
|
|
10831
10954
|
|
|
10955
|
+
const button = {
|
|
10956
|
+
text: 'Отправить заявку',
|
|
10957
|
+
version: 'primary',
|
|
10958
|
+
};
|
|
10959
|
+
const link = {
|
|
10960
|
+
text: 'Согласен на обработку персональных данных',
|
|
10961
|
+
href: '/privacy-policy',
|
|
10962
|
+
target: '_blank',
|
|
10963
|
+
};
|
|
10964
|
+
const PhoneCallRequestDialog = ({ onClose = noop }) => (jsx(Dialog, { onClose: onClose, position: "corner", children: jsx("div", { className: "flex flex-col gap-lg items-center rounded-md space-x-m", children: jsx("div", { className: "container grid grid-cols-12", children: jsx(ApplicationForm, { className: "col-span-12 pt-0", endpoint: "callback", title: "\u0417\u0430\u043A\u0430\u0437\u0430\u0442\u044C \u043E\u0431\u0440\u0430\u0442\u043D\u044B\u0439 \u0437\u0432\u043E\u043D\u043E\u043A", sections: [
|
|
10965
|
+
{
|
|
10966
|
+
inputs: [
|
|
10967
|
+
{ name: 'questionProduct', required: true },
|
|
10968
|
+
{ name: 'callbackTime', required: true, label: 'Когда перезвонить?' },
|
|
10969
|
+
{ name: 'russianPhone', required: true },
|
|
10970
|
+
{ name: 'consentDataProcessing', required: true },
|
|
10971
|
+
],
|
|
10972
|
+
},
|
|
10973
|
+
], button: button, link: link, onSuccess: onClose }) }) }) }));
|
|
10974
|
+
|
|
10975
|
+
const DropdownMenu = ({ dropdownRef, items = [], activeItem, ariaLabel, renderDropdownItem = renderDefaultDropdownItem, handlers, onItemClick, }) => {
|
|
10976
|
+
const isMobileMode = useMobileMode();
|
|
10977
|
+
return (jsx("div", { ref: dropdownRef, className: style('absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56 z-40', {
|
|
10978
|
+
'max-w-max': isMobileMode,
|
|
10979
|
+
}), "aria-label": ariaLabel, children: items?.map((item, i) => renderDropdownItem({ item, i, activeItem, handlers, closeDropdown: onItemClick })) }));
|
|
10980
|
+
};
|
|
10981
|
+
const DropdownMenuItem = JSX(({ isActive, ...rest }) => {
|
|
10982
|
+
const link = useLink();
|
|
10983
|
+
const { text, href, target, onClick } = link(rest);
|
|
10984
|
+
return (jsx("a", { className: style('text-l font-light pb-m hover:text-primary-main', {
|
|
10985
|
+
'text-primary-main': isActive,
|
|
10986
|
+
}), href: href, target: target, onClick: onClick, role: "link", ...getAspectsAttributes(rest?.data), children: text }));
|
|
10987
|
+
});
|
|
10988
|
+
const renderDefaultDropdownItem = ({ item, i, activeItem }) => (jsx(DropdownMenuItem, { isActive: item === activeItem, ...item }, item?.text ?? String(i)));
|
|
10989
|
+
|
|
10990
|
+
function useDropdownSubMenu({ items, activeItem, onClose, isOpen, onHover = false, renderDropdownItem, handlers, }) {
|
|
10991
|
+
const popup = usePopupManager();
|
|
10992
|
+
useEffect(() => {
|
|
10993
|
+
if (isOpen) {
|
|
10994
|
+
popup.close();
|
|
10995
|
+
onClose?.();
|
|
10996
|
+
}
|
|
10997
|
+
}, [isOpen]);
|
|
10998
|
+
const close = useCallback(() => {
|
|
10999
|
+
popup.close();
|
|
11000
|
+
onClose?.();
|
|
11001
|
+
}, [onClose]);
|
|
11002
|
+
const parentRef = useRef(null);
|
|
11003
|
+
const hoverRef = useRef(null);
|
|
11004
|
+
const clickOutsideRef = useOutsideClick(close);
|
|
11005
|
+
const popupRef = onHover ? hoverRef : clickOutsideRef;
|
|
11006
|
+
useEffect(() => {
|
|
11007
|
+
if (!isOpen || !parentRef.current || !items?.length) {
|
|
11008
|
+
return;
|
|
11009
|
+
}
|
|
11010
|
+
const parentElement = parentRef.current;
|
|
11011
|
+
const { top, left, width, height } = parentElement.getBoundingClientRect();
|
|
11012
|
+
popup.open({
|
|
11013
|
+
popup: (jsx(DropdownMenu, { dropdownRef: popupRef, items: items, activeItem: activeItem, renderDropdownItem: renderDropdownItem, handlers: handlers, onItemClick: close })),
|
|
11014
|
+
top: top + window.scrollY + height,
|
|
11015
|
+
left,
|
|
11016
|
+
width,
|
|
11017
|
+
});
|
|
11018
|
+
}, [isOpen, items, close]);
|
|
11019
|
+
useEffect(() => {
|
|
11020
|
+
if (onHover) {
|
|
11021
|
+
popupRef.current?.addEventListener('mouseleave', close);
|
|
11022
|
+
}
|
|
11023
|
+
return () => {
|
|
11024
|
+
popupRef.current?.removeEventListener('mouseleave', close);
|
|
11025
|
+
};
|
|
11026
|
+
}, [onHover, popupRef.current, isOpen]);
|
|
11027
|
+
return parentRef;
|
|
11028
|
+
}
|
|
11029
|
+
|
|
11030
|
+
const CHAT_BOT_ASPECT_NAME = 'openChatBot';
|
|
11031
|
+
const HeaderQuickActionsMenu = JSX(({ iconVersion, className, ariaLabel = 'Чат', version, buttonSize = 'large' }) => {
|
|
11032
|
+
const [isOpenDropdown, { setFalse, toggle }] = useBool(false);
|
|
11033
|
+
const quickActionsList = transformQuickActions(projectSettings.QUICK_ACTIONS ?? []);
|
|
11034
|
+
const customHandlers = useHandlers();
|
|
11035
|
+
const isMobileMode = useMobileMode();
|
|
11036
|
+
const dropdownMenu = useDropdownSubMenu({
|
|
11037
|
+
items: quickActionsList,
|
|
11038
|
+
onClose: setFalse,
|
|
11039
|
+
isOpen: isOpenDropdown,
|
|
11040
|
+
onHover: !isMobileMode,
|
|
11041
|
+
renderDropdownItem: renderQuickActionsDropdown,
|
|
11042
|
+
handlers: customHandlers,
|
|
11043
|
+
});
|
|
11044
|
+
useEffect(() => {
|
|
11045
|
+
if (isMobileMode) {
|
|
11046
|
+
return;
|
|
11047
|
+
}
|
|
11048
|
+
dropdownMenu.current?.addEventListener('mouseenter', toggle);
|
|
11049
|
+
dropdownMenu.current?.addEventListener('mouseleave', setFalse);
|
|
11050
|
+
// eslint-disable-next-line consistent-return
|
|
11051
|
+
return () => {
|
|
11052
|
+
dropdownMenu.current?.removeEventListener('mouseenter', toggle);
|
|
11053
|
+
dropdownMenu.current?.removeEventListener('mouseleave', setFalse);
|
|
11054
|
+
};
|
|
11055
|
+
}, []);
|
|
11056
|
+
return (jsx("div", { ref: dropdownMenu, children: jsx(HeaderSecondaryMenuButton, { image: { icon: 'CallbackIcon', iconVersion }, ariaLabel: ariaLabel, buttonSize: buttonSize, isGrayBg: true, version: version, className: style(isOpenDropdown ? 'shadow-blue-gray' : '', className), onClick: toggle }) }));
|
|
11057
|
+
});
|
|
11058
|
+
const renderQuickActionsDropdown = ({ item, handlers, closeDropdown = noop, }) => {
|
|
11059
|
+
const quickActionsMapping = {
|
|
11060
|
+
call: {
|
|
11061
|
+
handler: () => {
|
|
11062
|
+
handlers?.call();
|
|
11063
|
+
closeDropdown();
|
|
11064
|
+
},
|
|
11065
|
+
text: 'Заказать звонок',
|
|
11066
|
+
},
|
|
11067
|
+
chat: {
|
|
11068
|
+
handler: () => {
|
|
11069
|
+
handlers?.chat();
|
|
11070
|
+
closeDropdown();
|
|
11071
|
+
},
|
|
11072
|
+
text: 'Написать в чат',
|
|
11073
|
+
},
|
|
11074
|
+
};
|
|
11075
|
+
return (jsx("button", { className: style('text-l font-light pb-m hover:text-primary-main text-left'), role: "link", onClick: quickActionsMapping[item?.text ?? ''].handler, children: quickActionsMapping[item?.text ?? ''].text }, item?.text ?? ''));
|
|
11076
|
+
};
|
|
11077
|
+
const transformQuickActions = (items) => items.map((item) => ({ text: item }));
|
|
11078
|
+
const useHandlers = () => {
|
|
11079
|
+
const phoneCallRequestDialog = useDialog(PhoneCallRequestDialog);
|
|
11080
|
+
const handleCallClick = useCallback(() => {
|
|
11081
|
+
phoneCallRequestDialog.open({ onClose: () => phoneCallRequestDialog.close() });
|
|
11082
|
+
}, []);
|
|
11083
|
+
const aspects = useAspects();
|
|
11084
|
+
const handleChatClick = useCallback((ev) => {
|
|
11085
|
+
const openChatBot = aspects[CHAT_BOT_ASPECT_NAME];
|
|
11086
|
+
if (openChatBot && ev) {
|
|
11087
|
+
openChatBot(ev).finally();
|
|
11088
|
+
}
|
|
11089
|
+
}, []);
|
|
11090
|
+
return {
|
|
11091
|
+
call: handleCallClick,
|
|
11092
|
+
chat: handleChatClick,
|
|
11093
|
+
};
|
|
11094
|
+
};
|
|
11095
|
+
|
|
10832
11096
|
const BUTTON_STYLE = {
|
|
10833
11097
|
default: 'bg-main-divider text-primary-main rounded hover:text-primary-main',
|
|
10834
11098
|
transparent: 'backdrop-opacity-30 bg-white/30 hover:text-primary-hover text-white',
|
|
@@ -10848,9 +11112,10 @@
|
|
|
10848
11112
|
const onClick = useCallback(() => {
|
|
10849
11113
|
router.back();
|
|
10850
11114
|
}, [router]);
|
|
10851
|
-
return (jsxs("div", { className: "flex items-center justify-between w-full", children: [alwaysShowLogo || isRootLocation ? (jsx("div", { children: jsx(Logo, { className: "my-2xs", bgColor: bgColor, logo: logoProps, data: dataHeader, showTitle: false }) })) : (renderBackButton(onClick, backwardButton)),
|
|
11115
|
+
return (jsxs("div", { className: "flex items-center justify-between w-full", children: [alwaysShowLogo || isRootLocation ? (jsx("div", { children: jsx(Logo, { className: "my-2xs", bgColor: bgColor, logo: logoProps, data: dataHeader, showTitle: false }) })) : (renderBackButton(onClick, backwardButton)), renderButtons({ version, iconVersion, internetBankButton })] }));
|
|
10852
11116
|
});
|
|
10853
11117
|
const renderBackButton = (onClick, text) => text ? (jsxs("button", { className: "flex items-center text-l my-2xs", onClick: onClick, type: "button", "aria-label": "\u041A\u043D\u043E\u043F\u043A\u0430 \u043D\u0430\u0437\u0430\u0434", children: [jsx(Icon, { name: "ChevronLeftIcon", iconVersion: "black", width: "24", height: "24" }), text] })) : null;
|
|
11118
|
+
const renderButtons = ({ version, iconVersion, internetBankButton }) => (jsxs("div", { className: "flex gap-lg items-center", children: [projectSettings.QUICK_ACTIONS ? (jsx(HeaderQuickActionsMenu, { version: version, iconVersion: iconVersion })) : null, projectSettings.CHAT_BOT && !projectSettings.QUICK_ACTIONS ? (jsx(HeaderChatBotButton, { version: version, iconVersion: iconVersion, buttonSize: "medium" })) : null, jsx(InternetBankButton, { version: version, ...internetBankButton })] }));
|
|
10854
11119
|
|
|
10855
11120
|
const BG_COLOR_TO_BLOCK_VERSION = {
|
|
10856
11121
|
'bg-white': 'primary',
|
|
@@ -11961,7 +12226,7 @@
|
|
|
11961
12226
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
11962
12227
|
});
|
|
11963
12228
|
|
|
11964
|
-
const packageVersion = "0.14.
|
|
12229
|
+
const packageVersion = "0.14.934";
|
|
11965
12230
|
|
|
11966
12231
|
exports.Blocks = Blocks;
|
|
11967
12232
|
exports.ContentPage = ContentPage;
|