@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
package/bundle/bundle.umd.js
CHANGED
|
@@ -987,144 +987,6 @@
|
|
|
987
987
|
});
|
|
988
988
|
const randomNumber = (min = 0, max = 0) => Math.floor(Math.random() * (max - min) + min);
|
|
989
989
|
|
|
990
|
-
const API_BASE_URI$1 = '/api/v1';
|
|
991
|
-
const RETAIL_API_BASE_URI = '/light-api-cash/v1';
|
|
992
|
-
|
|
993
|
-
const formatDate = (date, toTimeStamp = false) => {
|
|
994
|
-
if (typeof date === 'string') {
|
|
995
|
-
return date.split('-').reverse().join('.');
|
|
996
|
-
}
|
|
997
|
-
else {
|
|
998
|
-
const day = String(date.getDate()).padStart(2, '0');
|
|
999
|
-
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
1000
|
-
const year = String(date.getFullYear());
|
|
1001
|
-
return toTimeStamp ? `${year}-${month}-${day}` : `${day}.${month}.${year}`;
|
|
1002
|
-
}
|
|
1003
|
-
};
|
|
1004
|
-
|
|
1005
|
-
const formatPhone = (phone) => phone?.replace(/[^+\d]/g, '');
|
|
1006
|
-
|
|
1007
|
-
const getSubmitBody = (body, isNaturalPerson, router) => {
|
|
1008
|
-
const { typeForm, region, phone = '', email, birthday, desiredMeetingDate, inn, fullRegion, addressBranch, secondaryPhone = '', bankEmpolee, applicationDate, partnerName, ...staticBody } = body;
|
|
1009
|
-
return {
|
|
1010
|
-
typeForm,
|
|
1011
|
-
...getRegion$1(region, isNaturalPerson),
|
|
1012
|
-
...getEmail(email, isNaturalPerson),
|
|
1013
|
-
...getPhone(phone),
|
|
1014
|
-
...getFormatDate(desiredMeetingDate, 'desiredMeetingDate'),
|
|
1015
|
-
...(isNaturalPerson ? getFormatDate(birthday) : { inn }),
|
|
1016
|
-
...(typeForm === 'FEEDBACK'
|
|
1017
|
-
? {}
|
|
1018
|
-
: {
|
|
1019
|
-
addressBranch,
|
|
1020
|
-
bankEmpolee,
|
|
1021
|
-
applicationDate,
|
|
1022
|
-
...getSecondaryPhone(secondaryPhone),
|
|
1023
|
-
}),
|
|
1024
|
-
...addPageSlug(typeForm, router),
|
|
1025
|
-
...formatPFForm(typeForm, {
|
|
1026
|
-
fullRegion,
|
|
1027
|
-
partnerName,
|
|
1028
|
-
}),
|
|
1029
|
-
...staticBody,
|
|
1030
|
-
};
|
|
1031
|
-
};
|
|
1032
|
-
const getPhoneBody = (phone) => {
|
|
1033
|
-
return {
|
|
1034
|
-
...getPhone(phone),
|
|
1035
|
-
};
|
|
1036
|
-
};
|
|
1037
|
-
const getPhone = (phone) => (phone ? { phone: formatPhone(phone) } : {});
|
|
1038
|
-
const getFormatDate = (date, key = 'birthday') => date ? { [key]: formatDate(date) } : {};
|
|
1039
|
-
const getRegion$1 = (region, isNaturalPerson = true) => ({
|
|
1040
|
-
[isNaturalPerson ? 'regionBranch' : 'region']: region,
|
|
1041
|
-
});
|
|
1042
|
-
const getEmail = (email, isNaturalPerson = true) => ({
|
|
1043
|
-
[isNaturalPerson ? 'email' : 'mail']: email,
|
|
1044
|
-
});
|
|
1045
|
-
const getSecondaryPhone = (secondaryPhone = '') => !secondaryPhone || secondaryPhone === '+7 ('
|
|
1046
|
-
? {}
|
|
1047
|
-
: { secondaryPhoneNumber: formatPhone(secondaryPhone) };
|
|
1048
|
-
const formatPFForm = (typeForm, data) => typeForm === 'PF'
|
|
1049
|
-
? {
|
|
1050
|
-
region: data?.fullRegion,
|
|
1051
|
-
partner: data?.partnerName,
|
|
1052
|
-
}
|
|
1053
|
-
: {};
|
|
1054
|
-
const addPageSlug = (typeForm, router) => typeForm === 'UNIVERSAL'
|
|
1055
|
-
? {
|
|
1056
|
-
typeForm: router?.pathname?.split('/')?.at(-1) || '/',
|
|
1057
|
-
}
|
|
1058
|
-
: {};
|
|
1059
|
-
|
|
1060
|
-
function LeadServiceAPI() {
|
|
1061
|
-
async function send(body, router, isIndividualType = false) {
|
|
1062
|
-
const { serviceDirection } = body;
|
|
1063
|
-
const isNaturalPerson = isIndividualType && serviceDirection !== 'Юридическое лицо / ИП';
|
|
1064
|
-
const url = `${API_BASE_URI$1}${isNaturalPerson ? '/lead' : '/sendcorporatelead'}`;
|
|
1065
|
-
const submitBody = getSubmitBody(body, isNaturalPerson, router);
|
|
1066
|
-
try {
|
|
1067
|
-
const response = await LeadServiceFetch(url, submitBody);
|
|
1068
|
-
if (!response?.ok) {
|
|
1069
|
-
return null;
|
|
1070
|
-
}
|
|
1071
|
-
return await response.json();
|
|
1072
|
-
}
|
|
1073
|
-
catch (e) {
|
|
1074
|
-
return null;
|
|
1075
|
-
}
|
|
1076
|
-
}
|
|
1077
|
-
async function sendCode({ phone }) {
|
|
1078
|
-
const submitBody = getPhoneBody(phone);
|
|
1079
|
-
try {
|
|
1080
|
-
const response = LeadServiceFetch(`${API_BASE_URI$1}/initCorporateLead`, submitBody).then(async (res) => {
|
|
1081
|
-
if (!res.ok) {
|
|
1082
|
-
throw new Error(`Ошибка HTTP: ${res.status}`);
|
|
1083
|
-
}
|
|
1084
|
-
return await res.text();
|
|
1085
|
-
});
|
|
1086
|
-
return await response;
|
|
1087
|
-
}
|
|
1088
|
-
catch (e) {
|
|
1089
|
-
return null;
|
|
1090
|
-
}
|
|
1091
|
-
}
|
|
1092
|
-
async function checkCode({ reqId, code, body }) {
|
|
1093
|
-
const submitBody = {
|
|
1094
|
-
requestId: reqId,
|
|
1095
|
-
confimationCode: code,
|
|
1096
|
-
leadRequest: getSubmitBody(body, false),
|
|
1097
|
-
};
|
|
1098
|
-
try {
|
|
1099
|
-
const response = await LeadServiceFetch(`${API_BASE_URI$1}/confirmCorporateLead`, submitBody);
|
|
1100
|
-
return await response.json();
|
|
1101
|
-
}
|
|
1102
|
-
catch (e) {
|
|
1103
|
-
return null;
|
|
1104
|
-
}
|
|
1105
|
-
}
|
|
1106
|
-
return {
|
|
1107
|
-
send,
|
|
1108
|
-
sendCode,
|
|
1109
|
-
checkCode,
|
|
1110
|
-
};
|
|
1111
|
-
}
|
|
1112
|
-
const LeadServiceFetch = (url, submitBody) => fetch(url, {
|
|
1113
|
-
method: 'POST',
|
|
1114
|
-
headers: { 'Content-Type': 'application/json' },
|
|
1115
|
-
mode: 'cors',
|
|
1116
|
-
body: JSON.stringify(submitBody),
|
|
1117
|
-
});
|
|
1118
|
-
|
|
1119
|
-
const handleAspects = async ({ aspectsAttributes, aspects, ev }) => {
|
|
1120
|
-
for (const { aspectName, params } of aspectsAttributes ?? []) {
|
|
1121
|
-
const aspectFn = aspects[aspectName ?? ''];
|
|
1122
|
-
if (aspectFn) {
|
|
1123
|
-
await aspectFn(ev, params);
|
|
1124
|
-
}
|
|
1125
|
-
}
|
|
1126
|
-
};
|
|
1127
|
-
|
|
1128
990
|
function locationNavigator() {
|
|
1129
991
|
return locationNavigator._impl();
|
|
1130
992
|
}
|
|
@@ -1317,6 +1179,138 @@
|
|
|
1317
1179
|
|
|
1318
1180
|
const getConsentDataProcessing = (inputs) => inputs?.find((_) => _?.name === 'consentDataProcessing');
|
|
1319
1181
|
|
|
1182
|
+
const cyrillicPattern = /^[а-яё-]*$/i;
|
|
1183
|
+
const isCyrillic = (_ = '') => cyrillicPattern.test(_);
|
|
1184
|
+
|
|
1185
|
+
const required = validator((_) => _ !== null && _ !== undefined && _ !== '');
|
|
1186
|
+
|
|
1187
|
+
const ERROR_MESSAGE$1 = 'Некорректно заполненное поле';
|
|
1188
|
+
const defaultValidator = (errorMsg) => required(errorMsg ?? ERROR_MESSAGE$1);
|
|
1189
|
+
const defaultSelectValidator = (errorMsg) => validator((_) => _?.key && _?.key !== '')(errorMsg ?? ERROR_MESSAGE$1);
|
|
1190
|
+
const nameValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length > 1 && isCyrillic(_))(errorMsg ?? ERROR_MESSAGE$1);
|
|
1191
|
+
const innValidator = (errorMsg) => validator((_) => isValidInnLength(_))(errorMsg);
|
|
1192
|
+
const innDadataValidator = (errorMsg) => validator((_) => Boolean(_?.text) && isValidInnLength(_.text))(errorMsg);
|
|
1193
|
+
const phoneValidate = (email) => /^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(email);
|
|
1194
|
+
const russianPhoneValidate = (email) => /^(\+7)?[\s-]?\(?[3489][0-9]{2}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(email);
|
|
1195
|
+
const phoneValidator = (errorMsg) => validator(phoneValidate)(errorMsg);
|
|
1196
|
+
const russianPhoneValidator = (errorMsg) => validator(russianPhoneValidate)(errorMsg);
|
|
1197
|
+
const agreementValidator = validator((_) => typeof _ === 'boolean' && _)('Согласие обязательно');
|
|
1198
|
+
const emailValidate = (email) => /^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(email);
|
|
1199
|
+
const emailValidator = (errorMsg) => validator((_) => emailValidate(_))(errorMsg);
|
|
1200
|
+
const isValidInnLength = (value) => typeof value === 'string' && (value.length === 10 || value.length === 12);
|
|
1201
|
+
|
|
1202
|
+
const validatorObj$1 = {
|
|
1203
|
+
fullName: defaultValidator(),
|
|
1204
|
+
addressBranch: defaultSelectValidator(),
|
|
1205
|
+
desiredMeetingDate: defaultValidator(),
|
|
1206
|
+
product: defaultValidator(),
|
|
1207
|
+
localities: defaultValidator(),
|
|
1208
|
+
partnerComments: defaultValidator(),
|
|
1209
|
+
collectionCount: defaultValidator(),
|
|
1210
|
+
acquiringType: defaultSelectValidator(),
|
|
1211
|
+
serviceType: defaultSelectValidator(),
|
|
1212
|
+
annualRevenue: defaultValidator(),
|
|
1213
|
+
feedbackMethod: defaultSelectValidator(),
|
|
1214
|
+
serviceDirection: defaultSelectValidator(),
|
|
1215
|
+
secondaryPhone: phoneValidator('Укажите номер телефона'),
|
|
1216
|
+
region: defaultSelectValidator(),
|
|
1217
|
+
situationDescription: defaultValidator(),
|
|
1218
|
+
sufferedFrom: defaultValidator(),
|
|
1219
|
+
applierType: defaultValidator(),
|
|
1220
|
+
surname: nameValidator('Укажите свою фамилию на кириллице'),
|
|
1221
|
+
name: nameValidator('Укажите своё имя на кириллице (без сокращений)'),
|
|
1222
|
+
middleName: nameValidator('Укажите своё отчество на кириллице'),
|
|
1223
|
+
birthday: defaultValidator('Укажите дату рождения'),
|
|
1224
|
+
phone: phoneValidator('Укажите номер телефона'),
|
|
1225
|
+
email: emailValidator('Укажите электронную почту'),
|
|
1226
|
+
inn: innValidator('Укажите ИНН'),
|
|
1227
|
+
comment: defaultValidator(),
|
|
1228
|
+
typeForm: defaultValidator(),
|
|
1229
|
+
consentToReceiveMaterials: agreementValidator,
|
|
1230
|
+
consentDataProcessing: agreementValidator,
|
|
1231
|
+
partnerSymbolCode: defaultValidator('Укажите идентификатор партнёра'),
|
|
1232
|
+
dadataPartyInnSelect: innDadataValidator('Укажите ИНН'),
|
|
1233
|
+
dadataPartyNameSelect: defaultValidator('Укажите наименование организации'),
|
|
1234
|
+
callbackTime: defaultValidator(),
|
|
1235
|
+
questionProduct: defaultValidator(),
|
|
1236
|
+
russianPhone: russianPhoneValidator('Укажите номер телефона'),
|
|
1237
|
+
};
|
|
1238
|
+
const getFormValidator = (fieldDefs, externalValidatorObj = {}) => {
|
|
1239
|
+
const requiredFields = fieldDefs.filter((_) => Boolean(_?.required && _?.name));
|
|
1240
|
+
const validator = { ...validatorObj$1, ...externalValidatorObj };
|
|
1241
|
+
const hasConditions = requiredFields.some((_) => _.condition?.values);
|
|
1242
|
+
const requiredFieldValidatorsMap = Object.fromEntries(requiredFields
|
|
1243
|
+
.filter(byNonEmptyValidator(validator))
|
|
1244
|
+
.map(({ name }) => [name, validator[name ?? '']]));
|
|
1245
|
+
return (formState) => hasConditions
|
|
1246
|
+
? Object.fromEntries(requiredFields
|
|
1247
|
+
.filter(byNonEmptyValidator(validator))
|
|
1248
|
+
.filter(byCondition(formState))
|
|
1249
|
+
.map(({ name }) => [name, validator[name ?? '']]))
|
|
1250
|
+
: requiredFieldValidatorsMap;
|
|
1251
|
+
};
|
|
1252
|
+
const byNonEmptyValidator = (validator = {}) => ({ name }) => Boolean(validator[name ?? '']);
|
|
1253
|
+
const byCondition = (formState) => (fieldDef) => !fieldDef?.condition ||
|
|
1254
|
+
fieldDef.condition.values.some((_) => {
|
|
1255
|
+
const dependencyValue = formState?.[fieldDef?.condition?.name ?? ''];
|
|
1256
|
+
return _ === (dependencyValue?.key ?? dependencyValue);
|
|
1257
|
+
});
|
|
1258
|
+
|
|
1259
|
+
const noop = () => {
|
|
1260
|
+
// Do nothing
|
|
1261
|
+
};
|
|
1262
|
+
|
|
1263
|
+
const themeStyle$1 = {
|
|
1264
|
+
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'),
|
|
1265
|
+
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'),
|
|
1266
|
+
};
|
|
1267
|
+
const embeddedStyle = style('group/btn-embedded', 'bg-transparent border border-transparent outline-none');
|
|
1268
|
+
const disabledStyle = style('bg-main-gray text-main-disabled cursor-not-allowed');
|
|
1269
|
+
const Button = JSX(({ className, type = 'button', version = 'primary', shape = 'default', embedded, disabled, role, ariaLabel, data, dataTheme, children, wcmsIgnore, onClick = noop, }) => {
|
|
1270
|
+
const handleClick = useCallback(role !== 'tab' ? handlerDecorator(onClick) : onClick, [
|
|
1271
|
+
role,
|
|
1272
|
+
onClick,
|
|
1273
|
+
]);
|
|
1274
|
+
const aspectsAttrs = useMemo(() => getAspectsAttributes(data), [data]);
|
|
1275
|
+
const isRound = shape === 'round';
|
|
1276
|
+
return (jsx("button", { className: style('font-sans flex items-center gap-xs', {
|
|
1277
|
+
[themeStyle$1[version]]: !disabled && !embedded,
|
|
1278
|
+
[embeddedStyle]: embedded,
|
|
1279
|
+
[disabledStyle]: disabled,
|
|
1280
|
+
}, embedded ? 'justify-between' : 'justify-center', embedded || isRound ? 'p-0' : 'px-9 py-4', {
|
|
1281
|
+
'rounded-md': shape === 'default',
|
|
1282
|
+
'rounded-full': isRound,
|
|
1283
|
+
}, 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 }));
|
|
1284
|
+
});
|
|
1285
|
+
|
|
1286
|
+
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" }) })));
|
|
1287
|
+
|
|
1288
|
+
const DIALOG_STYLE = {
|
|
1289
|
+
sm: 'max-w-sm top-1/3',
|
|
1290
|
+
lg: 'max-w-lg',
|
|
1291
|
+
'4xl': 'max-w-4xl',
|
|
1292
|
+
none: 'mt-0',
|
|
1293
|
+
};
|
|
1294
|
+
const DIALOG_POSITION = {
|
|
1295
|
+
center: 'relative mx-auto',
|
|
1296
|
+
corner: 'absolute bottom-0 right-0',
|
|
1297
|
+
};
|
|
1298
|
+
const Dialog = JSX(({ head, maxWidth = '4xl', children, onClose, onClick, position = 'center' }) => {
|
|
1299
|
+
const isMobileMode = useMobileMode();
|
|
1300
|
+
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 })] }));
|
|
1301
|
+
});
|
|
1302
|
+
|
|
1303
|
+
const ResponseTypeDialog = JSX(({ ok, typeForm, onClose, errorMessage }) => {
|
|
1304
|
+
const statusIcon = ok ? 'ResponseOKIcon' : 'ResponseFailIcon';
|
|
1305
|
+
const responseOKDescription = typeForm === 'ANTIFRAUD'
|
|
1306
|
+
? `Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы
|
|
1307
|
+
можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка
|
|
1308
|
+
не звонят с использованием мессенджеров.`
|
|
1309
|
+
: 'Совсем скоро мы с вами свяжемся';
|
|
1310
|
+
const responseFailDescription = errorMessage || 'Пожалуйста, повторите позднее';
|
|
1311
|
+
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" })] }) }));
|
|
1312
|
+
});
|
|
1313
|
+
|
|
1320
1314
|
// TODO Базовая функицональность всех Control - надо вынести и привязать к required флагу
|
|
1321
1315
|
const getRequiredLabel = ({ label, errors }) => label && errors ? `${label}*` : label;
|
|
1322
1316
|
|
|
@@ -1338,10 +1332,6 @@
|
|
|
1338
1332
|
return debouncedCallback;
|
|
1339
1333
|
};
|
|
1340
1334
|
|
|
1341
|
-
const noop = () => {
|
|
1342
|
-
// Do nothing
|
|
1343
|
-
};
|
|
1344
|
-
|
|
1345
1335
|
const renderLabel$1 = (label) => label ? (jsx(Text, { size: "text-m", color: "text-primary-text", font: "font-light", children: label })) : null;
|
|
1346
1336
|
|
|
1347
1337
|
function useEventListener(target, type, listener, options) {
|
|
@@ -1423,7 +1413,7 @@
|
|
|
1423
1413
|
return formatOption(value) || placeholder;
|
|
1424
1414
|
};
|
|
1425
1415
|
|
|
1426
|
-
const renderSelectContainer = ({ isBorder = true, valid = true, isDisabled = false, isOpen = false, onOpen, onClose, isManualInput = false, query = '', value, placeholder = '', iconVersion = 'black', options = [], }) => {
|
|
1416
|
+
const renderSelectContainer = ({ isBorder = true, valid = true, isDisabled = false, isOpen = false, onOpen = noop, onClose, isManualInput = false, query = '', value, placeholder = '', iconVersion = 'black', options = [], }) => {
|
|
1427
1417
|
const isIconHidden = getIconHidden(isManualInput, options, query);
|
|
1428
1418
|
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$1(isOpen, iconVersion)] }));
|
|
1429
1419
|
};
|
|
@@ -1530,32 +1520,460 @@
|
|
|
1530
1520
|
: null] })] }));
|
|
1531
1521
|
});
|
|
1532
1522
|
|
|
1533
|
-
const SelectControl = JSX(({ className = '', label, error, errors, ...rest }) => (jsxs("div", { className: className, children: [jsx(Select, { ...rest, valid: !error, label: getRequiredLabel({ label, errors }) }), renderErrorText(error)] })));
|
|
1523
|
+
const SelectControl = JSX(({ className = '', label, error, errors, ...rest }) => (jsxs("div", { className: className, children: [jsx(Select, { ...rest, valid: !error, label: getRequiredLabel({ label, errors }) }), renderErrorText(error)] })));
|
|
1524
|
+
|
|
1525
|
+
const CLIENT_KEY = 'client';
|
|
1526
|
+
const REPRESENTATIVE_KEY = 'representative';
|
|
1527
|
+
const APPLIER_TYPES = [
|
|
1528
|
+
{
|
|
1529
|
+
key: CLIENT_KEY,
|
|
1530
|
+
text: 'Клиент',
|
|
1531
|
+
},
|
|
1532
|
+
{
|
|
1533
|
+
key: REPRESENTATIVE_KEY,
|
|
1534
|
+
text: 'Представитель клиента',
|
|
1535
|
+
},
|
|
1536
|
+
];
|
|
1537
|
+
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') })));
|
|
1538
|
+
|
|
1539
|
+
const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
|
|
1540
|
+
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) => {
|
|
1541
|
+
const resultOptions = { ...commonOptions, ...options };
|
|
1542
|
+
return (jsx("path", { d: d, fill: pathFill || 'currentColor', stroke: resultOptions.stroke, strokeLinecap: resultOptions.strokeLinecap, strokeLinejoin: resultOptions.strokeLinejoin, strokeWidth: resultOptions.strokeWidth, strokeMiterlimit: resultOptions.strokeMiterlimit }, i));
|
|
1543
|
+
}) }));
|
|
1544
|
+
});
|
|
1545
|
+
|
|
1546
|
+
const defaultCheckStyle = 'appearance-none w-5 h-5 border-solid flex-none';
|
|
1547
|
+
|
|
1548
|
+
const CHECK_PATHS = [
|
|
1549
|
+
{
|
|
1550
|
+
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',
|
|
1551
|
+
fillRule: 'evenodd',
|
|
1552
|
+
clipRule: 'evenodd',
|
|
1553
|
+
fill: 'white',
|
|
1554
|
+
},
|
|
1555
|
+
];
|
|
1556
|
+
const Checkbox = JSX(({ className, value, text, disabled, isRadio, onChange }) => {
|
|
1557
|
+
const handleChange = useCallback((e) => {
|
|
1558
|
+
if (disabled) {
|
|
1559
|
+
return;
|
|
1560
|
+
}
|
|
1561
|
+
e.preventDefault();
|
|
1562
|
+
onChange && onChange(!value);
|
|
1563
|
+
}, [onChange, disabled, value]);
|
|
1564
|
+
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" }));
|
|
1565
|
+
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$3(text)] }) }));
|
|
1566
|
+
});
|
|
1567
|
+
const renderText$3 = (text) => text ? (jsx("div", { className: "ml-s", children: jsx(Text, { size: "text-l", font: "font-light", children: text }) })) : null;
|
|
1568
|
+
const getCursorStyle = (disabled = false) => (disabled ? 'cursor-not-allowed' : 'cursor-pointer');
|
|
1569
|
+
const role = (isRadio = false) => (isRadio ? 'radio' : 'checkbox');
|
|
1570
|
+
const checkboxStyle = (value = false) => style('rounded border', { 'bg-primary-main': value });
|
|
1571
|
+
|
|
1572
|
+
const orientationStyleMap = {
|
|
1573
|
+
horizontal: '@lg:flex-row',
|
|
1574
|
+
vertical: '',
|
|
1575
|
+
};
|
|
1576
|
+
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)))) })] })));
|
|
1577
|
+
|
|
1578
|
+
const VED_TYPES = [
|
|
1579
|
+
{ id: 'currencyControl', text: 'Валютный контроль' },
|
|
1580
|
+
{ id: 'documentOperations', text: 'Документарные операции' },
|
|
1581
|
+
{ id: 'conversionTransactions', text: 'Конверсионные операции' },
|
|
1582
|
+
{ id: 'otherIssues', text: 'Иные вопросы ВЭД' },
|
|
1583
|
+
];
|
|
1584
|
+
const VedField = JSX(({ field, input }) => {
|
|
1585
|
+
const handleChange = useCallback((_) => {
|
|
1586
|
+
if (_ !== 'currencyControl') {
|
|
1587
|
+
field('inn').onChange?.('');
|
|
1588
|
+
field('region').onChange?.('');
|
|
1589
|
+
}
|
|
1590
|
+
}, []);
|
|
1591
|
+
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 }) }) }));
|
|
1592
|
+
});
|
|
1593
|
+
|
|
1594
|
+
const ACQUIRING_TYPES = [
|
|
1595
|
+
{
|
|
1596
|
+
text: 'Торговый эквайринг',
|
|
1597
|
+
key: 'trade',
|
|
1598
|
+
},
|
|
1599
|
+
{
|
|
1600
|
+
text: 'СБП-эквайринг',
|
|
1601
|
+
key: 'sbp',
|
|
1602
|
+
},
|
|
1603
|
+
{
|
|
1604
|
+
text: 'Интернет-эквайринг',
|
|
1605
|
+
key: 'internet',
|
|
1606
|
+
},
|
|
1607
|
+
{
|
|
1608
|
+
text: 'SoftPOS',
|
|
1609
|
+
key: 'softpos',
|
|
1610
|
+
},
|
|
1611
|
+
{
|
|
1612
|
+
text: 'Все виды эквайринга',
|
|
1613
|
+
key: 'all',
|
|
1614
|
+
},
|
|
1615
|
+
];
|
|
1616
|
+
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 ?? '') })));
|
|
1617
|
+
const isAcquiringTrade = (key = '') => Boolean(key === 'trade' || key === 'all');
|
|
1618
|
+
|
|
1619
|
+
const getPartnerComments = (data) => {
|
|
1620
|
+
const { acquiringType, onlineCheckout = false, posTerminal = false, term, amount, annualRevenue, } = data;
|
|
1621
|
+
if (acquiringType) {
|
|
1622
|
+
return `Вид эквайринга=${acquiringType?.text || ''}${isAcquiringTrade(acquiringType?.key)
|
|
1623
|
+
? `/Онлайн касса=${onlineCheckout}/POS-терминал=${posTerminal}`
|
|
1624
|
+
: '/Онлайн касса=false/POS-терминал=false'}`;
|
|
1625
|
+
}
|
|
1626
|
+
else {
|
|
1627
|
+
return `Сумма=${amount}/Срок=${term}/Выручка=${annualRevenue}`;
|
|
1628
|
+
}
|
|
1629
|
+
};
|
|
1630
|
+
|
|
1631
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
1632
|
+
const getFormatData = (data) => {
|
|
1633
|
+
const { acquiringType, onlineCheckout, posTerminal, amount, term, annualRevenue, serviceType, vedTypes, region, inn, sufferedFrom, situationDescription, applierType, isPremium, dadataPartyNameSelect, partnerSymbolCode, dadataPartyInnSelect, ...usedData } = data;
|
|
1634
|
+
const partnerComments = acquiringType || annualRevenue ? getPartnerComments(data) : null;
|
|
1635
|
+
const formatData = {
|
|
1636
|
+
...usedData,
|
|
1637
|
+
...getVedTypes(vedTypes),
|
|
1638
|
+
...getRegion$1(region),
|
|
1639
|
+
...(inn && { inn }),
|
|
1640
|
+
...(partnerComments ? { partnerComments } : {}),
|
|
1641
|
+
...(serviceType ? { typeForm: serviceType } : {}),
|
|
1642
|
+
...getIncidentComment(sufferedFrom?.text, situationDescription),
|
|
1643
|
+
...getIsClient(applierType),
|
|
1644
|
+
...getDadataValues([
|
|
1645
|
+
[dadataPartyInnSelect, 'inn'],
|
|
1646
|
+
[dadataPartyNameSelect, 'fullName'],
|
|
1647
|
+
]),
|
|
1648
|
+
};
|
|
1649
|
+
return Object.fromEntries(Object.entries(formatData)?.map(([k, v]) => [k, v?.key || v]));
|
|
1650
|
+
};
|
|
1651
|
+
const getIsClient = (applierType) => applierType?.key ? { isClient: applierType?.key === CLIENT_KEY } : {};
|
|
1652
|
+
const getIncidentComment = (sufferedFrom, situationDescription) => sufferedFrom || situationDescription
|
|
1653
|
+
? { comment: `${sufferedFrom || ''};${situationDescription || ''}` }
|
|
1654
|
+
: {};
|
|
1655
|
+
const getRegion$1 = (region) => region?.key || region?.text ? { region: region?.text || region?.key } : {};
|
|
1656
|
+
const getVedTypes = (vedTypes) => vedTypes
|
|
1657
|
+
? {
|
|
1658
|
+
vedTypes: Object.fromEntries(VED_TYPES.map(({ id }) => [id, id === vedTypes])),
|
|
1659
|
+
}
|
|
1660
|
+
: {};
|
|
1661
|
+
const getDadataValues = (fields) => fields.reduce((acc, [field, name]) => {
|
|
1662
|
+
if (field?.text && name) {
|
|
1663
|
+
acc[name] = field.text;
|
|
1664
|
+
}
|
|
1665
|
+
return acc;
|
|
1666
|
+
}, {});
|
|
1667
|
+
|
|
1668
|
+
const SERVICE_TYPES = [{ key: 'ULTRASERVICE', text: 'Ультра' }];
|
|
1669
|
+
const SERVICE_DIRECTIONS = [
|
|
1670
|
+
{ key: 'Физическое лицо' },
|
|
1671
|
+
{ key: 'Юридическое лицо / ИП' },
|
|
1672
|
+
];
|
|
1673
|
+
const FEEDBACK_METHOD = [
|
|
1674
|
+
{ key: 'phone', text: 'Телефонный звонок' },
|
|
1675
|
+
{ key: 'email', text: 'Электронное сообщение' },
|
|
1676
|
+
];
|
|
1677
|
+
|
|
1678
|
+
const initialFormState$1 = {
|
|
1679
|
+
typeForm: '',
|
|
1680
|
+
region: { key: '', text: '' },
|
|
1681
|
+
addressBranch: { key: '', text: '' },
|
|
1682
|
+
surname: '',
|
|
1683
|
+
name: '',
|
|
1684
|
+
phone: '',
|
|
1685
|
+
secondaryPhone: '',
|
|
1686
|
+
comment: '',
|
|
1687
|
+
product: '',
|
|
1688
|
+
partnerComments: '',
|
|
1689
|
+
annualRevenue: '',
|
|
1690
|
+
term: 12,
|
|
1691
|
+
amount: 100000,
|
|
1692
|
+
acquiringType: ACQUIRING_TYPES[0],
|
|
1693
|
+
serviceType: SERVICE_TYPES[0],
|
|
1694
|
+
feedbackMethod: FEEDBACK_METHOD[0],
|
|
1695
|
+
serviceDirection: SERVICE_DIRECTIONS[0],
|
|
1696
|
+
vedTypes: VED_TYPES[0].id,
|
|
1697
|
+
birthday: undefined,
|
|
1698
|
+
isClient: false,
|
|
1699
|
+
onlineCheckout: false,
|
|
1700
|
+
posTerminal: false,
|
|
1701
|
+
consentToReceiveMaterials: false,
|
|
1702
|
+
consentDataProcessing: false,
|
|
1703
|
+
addressRetail: { key: '', text: '' },
|
|
1704
|
+
};
|
|
1705
|
+
const getInitialFormState$2 = (inputs, typeForm = '') => {
|
|
1706
|
+
const formState = Object.fromEntries(inputs.map((_) => [
|
|
1707
|
+
_.name,
|
|
1708
|
+
(_?.name === 'vedTypes' && _?.defaultValue) || initialFormState$1[_.name || ''],
|
|
1709
|
+
]));
|
|
1710
|
+
return { ...formState, typeForm: { key: typeForm, text: '' } };
|
|
1711
|
+
};
|
|
1712
|
+
|
|
1713
|
+
const getUserTimezoneOffset = () => {
|
|
1714
|
+
const offset = new Date().getTimezoneOffset();
|
|
1715
|
+
const absOffset = Math.abs(offset);
|
|
1716
|
+
const hours = Math.floor(absOffset / 60);
|
|
1717
|
+
const minutes = absOffset % 60;
|
|
1718
|
+
const sign = offset < 0 ? '+' : '-';
|
|
1719
|
+
return `GMT${sign}${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}`;
|
|
1720
|
+
};
|
|
1721
|
+
|
|
1722
|
+
const API_BASE_URI$1 = '/api/v1';
|
|
1723
|
+
const RETAIL_API_BASE_URI = '/light-api-cash/v1';
|
|
1724
|
+
|
|
1725
|
+
const formatDate = (date, toTimeStamp = false) => {
|
|
1726
|
+
if (typeof date === 'string') {
|
|
1727
|
+
return date.split('-').reverse().join('.');
|
|
1728
|
+
}
|
|
1729
|
+
else {
|
|
1730
|
+
const day = String(date.getDate()).padStart(2, '0');
|
|
1731
|
+
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
1732
|
+
const year = String(date.getFullYear());
|
|
1733
|
+
return toTimeStamp ? `${year}-${month}-${day}` : `${day}.${month}.${year}`;
|
|
1734
|
+
}
|
|
1735
|
+
};
|
|
1736
|
+
|
|
1737
|
+
const formatPhone = (phone) => phone?.replace(/[^+\d]/g, '');
|
|
1738
|
+
|
|
1739
|
+
const getSubmitBody = (body, isNaturalPerson, router) => {
|
|
1740
|
+
const { typeForm, region, phone = '', email, birthday, desiredMeetingDate, inn, fullRegion, addressBranch, secondaryPhone = '', bankEmpolee, applicationDate, partnerName, russianPhone, ...staticBody } = body;
|
|
1741
|
+
return {
|
|
1742
|
+
typeForm,
|
|
1743
|
+
...getRegion(region, isNaturalPerson),
|
|
1744
|
+
...getEmail(email, isNaturalPerson),
|
|
1745
|
+
...getPhone(phone),
|
|
1746
|
+
...getPhone(russianPhone),
|
|
1747
|
+
...getFormatDate(desiredMeetingDate, 'desiredMeetingDate'),
|
|
1748
|
+
...(isNaturalPerson ? getFormatDate(birthday) : { inn }),
|
|
1749
|
+
...(typeForm === 'FEEDBACK'
|
|
1750
|
+
? {}
|
|
1751
|
+
: {
|
|
1752
|
+
addressBranch,
|
|
1753
|
+
bankEmpolee,
|
|
1754
|
+
applicationDate,
|
|
1755
|
+
...getSecondaryPhone(secondaryPhone),
|
|
1756
|
+
}),
|
|
1757
|
+
...addPageSlug(typeForm, router),
|
|
1758
|
+
...formatPFForm(typeForm, {
|
|
1759
|
+
fullRegion,
|
|
1760
|
+
partnerName,
|
|
1761
|
+
}),
|
|
1762
|
+
...staticBody,
|
|
1763
|
+
};
|
|
1764
|
+
};
|
|
1765
|
+
const getPhoneBody = (phone) => {
|
|
1766
|
+
return {
|
|
1767
|
+
...getPhone(phone),
|
|
1768
|
+
};
|
|
1769
|
+
};
|
|
1770
|
+
const getPhone = (phone) => (phone ? { phone: formatPhone(phone) } : {});
|
|
1771
|
+
const getFormatDate = (date, key = 'birthday') => date ? { [key]: formatDate(date) } : {};
|
|
1772
|
+
const getRegion = (region, isNaturalPerson = true) => ({
|
|
1773
|
+
[isNaturalPerson ? 'regionBranch' : 'region']: region,
|
|
1774
|
+
});
|
|
1775
|
+
const getEmail = (email, isNaturalPerson = true) => ({
|
|
1776
|
+
[isNaturalPerson ? 'email' : 'mail']: email,
|
|
1777
|
+
});
|
|
1778
|
+
const getSecondaryPhone = (secondaryPhone = '') => !secondaryPhone || secondaryPhone === '+7 ('
|
|
1779
|
+
? {}
|
|
1780
|
+
: { secondaryPhoneNumber: formatPhone(secondaryPhone) };
|
|
1781
|
+
const formatPFForm = (typeForm, data) => typeForm === 'PF'
|
|
1782
|
+
? {
|
|
1783
|
+
region: data?.fullRegion,
|
|
1784
|
+
partner: data?.partnerName,
|
|
1785
|
+
}
|
|
1786
|
+
: {};
|
|
1787
|
+
const addPageSlug = (typeForm, router) => typeForm === 'UNIVERSAL'
|
|
1788
|
+
? {
|
|
1789
|
+
typeForm: router?.pathname?.split('/')?.at(-1) || '/',
|
|
1790
|
+
}
|
|
1791
|
+
: {};
|
|
1792
|
+
|
|
1793
|
+
function LeadServiceAPI() {
|
|
1794
|
+
async function send(body, router, isIndividualType = false) {
|
|
1795
|
+
const { serviceDirection } = body;
|
|
1796
|
+
const isNaturalPerson = isIndividualType && serviceDirection !== 'Юридическое лицо / ИП';
|
|
1797
|
+
const url = `${API_BASE_URI$1}${isNaturalPerson ? '/lead' : '/sendcorporatelead'}`;
|
|
1798
|
+
const submitBody = getSubmitBody(body, isNaturalPerson, router);
|
|
1799
|
+
try {
|
|
1800
|
+
const response = await LeadServiceFetch(url, submitBody);
|
|
1801
|
+
if (!response?.ok) {
|
|
1802
|
+
return null;
|
|
1803
|
+
}
|
|
1804
|
+
return await response.json();
|
|
1805
|
+
}
|
|
1806
|
+
catch (e) {
|
|
1807
|
+
return null;
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
async function sendCode({ phone }) {
|
|
1811
|
+
const submitBody = getPhoneBody(phone);
|
|
1812
|
+
try {
|
|
1813
|
+
const response = LeadServiceFetch(`${API_BASE_URI$1}/initCorporateLead`, submitBody).then(async (res) => {
|
|
1814
|
+
if (!res.ok) {
|
|
1815
|
+
throw new Error(`Ошибка HTTP: ${res.status}`);
|
|
1816
|
+
}
|
|
1817
|
+
return await res.text();
|
|
1818
|
+
});
|
|
1819
|
+
return await response;
|
|
1820
|
+
}
|
|
1821
|
+
catch (e) {
|
|
1822
|
+
return null;
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
async function checkCode({ reqId, code, body }) {
|
|
1826
|
+
const submitBody = {
|
|
1827
|
+
requestId: reqId,
|
|
1828
|
+
confimationCode: code,
|
|
1829
|
+
leadRequest: getSubmitBody(body, false),
|
|
1830
|
+
};
|
|
1831
|
+
try {
|
|
1832
|
+
const response = await LeadServiceFetch(`${API_BASE_URI$1}/confirmCorporateLead`, submitBody);
|
|
1833
|
+
return await response.json();
|
|
1834
|
+
}
|
|
1835
|
+
catch (e) {
|
|
1836
|
+
return null;
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
async function sendPhoneCallRequest(body, isNaturalPerson = false) {
|
|
1840
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1841
|
+
const submitBody = getSubmitBody(body, isNaturalPerson);
|
|
1842
|
+
const formatSubmitBody = getFormatCallbackSubmitBody(submitBody);
|
|
1843
|
+
try {
|
|
1844
|
+
const response = await LeadServiceFetch(`${API_BASE_URI$1}/callback`, formatSubmitBody);
|
|
1845
|
+
if (!response?.ok) {
|
|
1846
|
+
return null;
|
|
1847
|
+
}
|
|
1848
|
+
return await response.json();
|
|
1849
|
+
}
|
|
1850
|
+
catch (e) {
|
|
1851
|
+
return null;
|
|
1852
|
+
}
|
|
1853
|
+
}
|
|
1854
|
+
return {
|
|
1855
|
+
send,
|
|
1856
|
+
sendCode,
|
|
1857
|
+
checkCode,
|
|
1858
|
+
sendPhoneCallRequest,
|
|
1859
|
+
};
|
|
1860
|
+
}
|
|
1861
|
+
const LeadServiceFetch = (url, submitBody) => fetch(url, {
|
|
1862
|
+
method: 'POST',
|
|
1863
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1864
|
+
mode: 'cors',
|
|
1865
|
+
body: JSON.stringify(submitBody),
|
|
1866
|
+
});
|
|
1867
|
+
const getFormatCallbackSubmitBody = (submitBody) => {
|
|
1868
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1869
|
+
const { typeForm, consentDataProcessing, phone, ...rest } = submitBody;
|
|
1870
|
+
return {
|
|
1871
|
+
...rest,
|
|
1872
|
+
phone: phone?.startsWith('+') ? phone.slice(1) : phone,
|
|
1873
|
+
clientTimezone: getUserTimezoneOffset(),
|
|
1874
|
+
};
|
|
1875
|
+
};
|
|
1876
|
+
|
|
1877
|
+
const handleAspects = async ({ aspectsAttributes, aspects, ev }) => {
|
|
1878
|
+
for (const { aspectName, params } of aspectsAttributes ?? []) {
|
|
1879
|
+
const aspectFn = aspects[aspectName ?? ''];
|
|
1880
|
+
if (aspectFn) {
|
|
1881
|
+
await aspectFn(ev, params);
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1884
|
+
};
|
|
1885
|
+
|
|
1886
|
+
const API$2 = LeadServiceAPI();
|
|
1887
|
+
const handleInitCorporateLead = async ({ formatData = {}, typeForm, responseTypeDialog, verifyPhoneDialog, data = [], aspects = {}, ev, }) => {
|
|
1888
|
+
const { phone } = formatData;
|
|
1889
|
+
const response = await API$2.sendCode({ phone: String(phone) });
|
|
1890
|
+
if (!response) {
|
|
1891
|
+
responseTypeDialog.open({ ok: Boolean(response), typeForm });
|
|
1892
|
+
return;
|
|
1893
|
+
}
|
|
1894
|
+
verifyPhoneDialog.open({
|
|
1895
|
+
phone,
|
|
1896
|
+
formatData,
|
|
1897
|
+
reqId: String(response),
|
|
1898
|
+
onSuccess: () => {
|
|
1899
|
+
verifyPhoneDialog.close();
|
|
1900
|
+
responseTypeDialog.open({ ok: true, typeForm });
|
|
1901
|
+
handleAspects({ aspectsAttributes: data, aspects, ev });
|
|
1902
|
+
},
|
|
1903
|
+
});
|
|
1904
|
+
};
|
|
1905
|
+
const handleCallback = async ({ formatData, data, aspects = {}, ev, typeForm, responseTypeDialog, onSuccess = noop, }) => {
|
|
1906
|
+
const response = await API$2.sendPhoneCallRequest(formatData);
|
|
1907
|
+
onSuccess();
|
|
1908
|
+
if (response?.status === 'success') {
|
|
1909
|
+
responseTypeDialog.open({ ok: true, typeForm });
|
|
1910
|
+
handleAspects({ aspectsAttributes: data, aspects, ev });
|
|
1911
|
+
}
|
|
1912
|
+
else if (response?.status === 'error') {
|
|
1913
|
+
responseTypeDialog.open({
|
|
1914
|
+
ok: false,
|
|
1915
|
+
errorMessage: 'Ваша заявка уже в работе. Дождитесь звонка от сотрудника Банка',
|
|
1916
|
+
});
|
|
1917
|
+
}
|
|
1918
|
+
else {
|
|
1919
|
+
responseTypeDialog.open({ ok: Boolean(response) });
|
|
1920
|
+
if (response) {
|
|
1921
|
+
handleAspects({ aspectsAttributes: data, aspects, ev });
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
};
|
|
1925
|
+
const handleDefault = async ({ formatData, data, aspects = {}, ev, router, responseTypeDialog, }) => {
|
|
1926
|
+
const ok = Boolean(await API$2.send(formatData, router, false)); // или проверять endpoint === 'lead'
|
|
1927
|
+
responseTypeDialog.open({ ok });
|
|
1928
|
+
if (ok) {
|
|
1929
|
+
handleAspects({ aspectsAttributes: data, aspects, ev });
|
|
1930
|
+
}
|
|
1931
|
+
};
|
|
1932
|
+
|
|
1933
|
+
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, {
|
|
1934
|
+
'backdrop-blur': blur,
|
|
1935
|
+
}), 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" }) })));
|
|
1936
|
+
|
|
1937
|
+
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] })));
|
|
1938
|
+
|
|
1939
|
+
const withValidator = (props, validator) => {
|
|
1940
|
+
const { value, isDirty } = props;
|
|
1941
|
+
const errors = isDirty ? validator(value) : [];
|
|
1942
|
+
return {
|
|
1943
|
+
...props,
|
|
1944
|
+
errors,
|
|
1945
|
+
error: errors[0],
|
|
1946
|
+
};
|
|
1947
|
+
};
|
|
1948
|
+
|
|
1949
|
+
const themeStyle = {
|
|
1950
|
+
primary: themeStyle$1.primary,
|
|
1951
|
+
secondary: themeStyle$1.secondary,
|
|
1952
|
+
white: 'text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main',
|
|
1953
|
+
link: 'text-primary-main',
|
|
1954
|
+
gray: themeStyle$1.secondary,
|
|
1955
|
+
transparent: '',
|
|
1956
|
+
'': '',
|
|
1957
|
+
};
|
|
1958
|
+
const Link = JSX((props) => {
|
|
1959
|
+
const link = useLink();
|
|
1960
|
+
const { className, href, target, text, aboveText, version = 'link', rel, ariaLabel, data, children, onClick, } = link(props);
|
|
1961
|
+
const buttonLike = version !== 'link';
|
|
1962
|
+
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', {
|
|
1963
|
+
[themeStyle[version]]: Boolean(version),
|
|
1964
|
+
[aboveText ? 'px-9 py-2.5' : 'px-9 py-4']: buttonLike,
|
|
1965
|
+
'rounded-md': buttonLike,
|
|
1966
|
+
}, className), href: href, target: target, rel: rel, "aria-label": ariaLabel ?? `Ссылка на ${text}`, role: href ? 'link' : 'button', onClick: onClick, ...getAspectsAttributes(data), children: children ?? renderText$2(text, aboveText) }));
|
|
1967
|
+
});
|
|
1968
|
+
const renderText$2 = (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;
|
|
1969
|
+
|
|
1970
|
+
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] })));
|
|
1534
1971
|
|
|
1535
|
-
const
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
{
|
|
1541
|
-
text: 'СБП-эквайринг',
|
|
1542
|
-
key: 'sbp',
|
|
1543
|
-
},
|
|
1544
|
-
{
|
|
1545
|
-
text: 'Интернет-эквайринг',
|
|
1546
|
-
key: 'internet',
|
|
1547
|
-
},
|
|
1548
|
-
{
|
|
1549
|
-
text: 'SoftPOS',
|
|
1550
|
-
key: 'softpos',
|
|
1551
|
-
},
|
|
1552
|
-
{
|
|
1553
|
-
text: 'Все виды эквайринга',
|
|
1554
|
-
key: 'all',
|
|
1555
|
-
},
|
|
1556
|
-
];
|
|
1557
|
-
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 ?? '') })));
|
|
1558
|
-
const isAcquiringTrade = (key = '') => Boolean(key === 'trade' || key === 'all');
|
|
1972
|
+
const agreementText = 'Нажимая кнопку, вы подтверждаете согласие с ';
|
|
1973
|
+
const agreementTextPF = 'Нажимая на кнопку, вы подтверждаете, что клиент дал согласие на ';
|
|
1974
|
+
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 : 'Отправить заявку' })] }));
|
|
1975
|
+
|
|
1976
|
+
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" })] })] })] }));
|
|
1559
1977
|
|
|
1560
1978
|
const isFilled = (_) => _ !== null && _ !== undefined;
|
|
1561
1979
|
|
|
@@ -1729,20 +2147,6 @@
|
|
|
1729
2147
|
|
|
1730
2148
|
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 ?? '') })));
|
|
1731
2149
|
|
|
1732
|
-
const CLIENT_KEY = 'client';
|
|
1733
|
-
const REPRESENTATIVE_KEY = 'representative';
|
|
1734
|
-
const APPLIER_TYPES = [
|
|
1735
|
-
{
|
|
1736
|
-
key: CLIENT_KEY,
|
|
1737
|
-
text: 'Клиент',
|
|
1738
|
-
},
|
|
1739
|
-
{
|
|
1740
|
-
key: REPRESENTATIVE_KEY,
|
|
1741
|
-
text: 'Представитель клиента',
|
|
1742
|
-
},
|
|
1743
|
-
];
|
|
1744
|
-
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') })));
|
|
1745
|
-
|
|
1746
2150
|
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 ?? '') })));
|
|
1747
2151
|
|
|
1748
2152
|
const useElementSpace = (ref, heightEl) => {
|
|
@@ -2038,6 +2442,26 @@
|
|
|
2038
2442
|
|
|
2039
2443
|
const BirthdayField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: input?.label || 'Дата рождения', ...field(input?.name ?? '') })));
|
|
2040
2444
|
|
|
2445
|
+
const CALLBACK_TIME = [
|
|
2446
|
+
{
|
|
2447
|
+
key: 'Перезвонить сейчас',
|
|
2448
|
+
text: 'Перезвонить сейчас',
|
|
2449
|
+
},
|
|
2450
|
+
{
|
|
2451
|
+
key: 'Перезвонить через час',
|
|
2452
|
+
text: 'Перезвонить через час',
|
|
2453
|
+
},
|
|
2454
|
+
{
|
|
2455
|
+
key: 'Перезвонить через два часа',
|
|
2456
|
+
text: 'Перезвонить через два часа',
|
|
2457
|
+
},
|
|
2458
|
+
{
|
|
2459
|
+
key: 'Перезвонить завтра',
|
|
2460
|
+
text: 'Перезвонить завтра',
|
|
2461
|
+
},
|
|
2462
|
+
];
|
|
2463
|
+
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 ?? '') })));
|
|
2464
|
+
|
|
2041
2465
|
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 ?? '') })));
|
|
2042
2466
|
|
|
2043
2467
|
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 })));
|
|
@@ -2177,16 +2601,6 @@
|
|
|
2177
2601
|
return jsx(InputControl, { label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...field(input?.name ?? ''), ...input });
|
|
2178
2602
|
});
|
|
2179
2603
|
|
|
2180
|
-
const SERVICE_TYPES = [{ key: 'ULTRASERVICE', text: 'Ультра' }];
|
|
2181
|
-
const SERVICE_DIRECTIONS = [
|
|
2182
|
-
{ key: 'Физическое лицо' },
|
|
2183
|
-
{ key: 'Юридическое лицо / ИП' },
|
|
2184
|
-
];
|
|
2185
|
-
const FEEDBACK_METHOD = [
|
|
2186
|
-
{ key: 'phone', text: 'Телефонный звонок' },
|
|
2187
|
-
{ key: 'email', text: 'Электронное сообщение' },
|
|
2188
|
-
];
|
|
2189
|
-
|
|
2190
2604
|
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 ?? '') })));
|
|
2191
2605
|
|
|
2192
2606
|
const FullNameField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u0424\u0418\u041E", ...field(input?.name ?? ''), ...input })));
|
|
@@ -2203,39 +2617,6 @@
|
|
|
2203
2617
|
|
|
2204
2618
|
const InnField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u0418\u041D\u041D", isInteger: true, maxLength: 12, ...input, ...field(input?.name ?? '') })));
|
|
2205
2619
|
|
|
2206
|
-
const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
|
|
2207
|
-
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) => {
|
|
2208
|
-
const resultOptions = { ...commonOptions, ...options };
|
|
2209
|
-
return (jsx("path", { d: d, fill: pathFill || 'currentColor', stroke: resultOptions.stroke, strokeLinecap: resultOptions.strokeLinecap, strokeLinejoin: resultOptions.strokeLinejoin, strokeWidth: resultOptions.strokeWidth, strokeMiterlimit: resultOptions.strokeMiterlimit }, i));
|
|
2210
|
-
}) }));
|
|
2211
|
-
});
|
|
2212
|
-
|
|
2213
|
-
const defaultCheckStyle = 'appearance-none w-5 h-5 border-solid flex-none';
|
|
2214
|
-
|
|
2215
|
-
const CHECK_PATHS = [
|
|
2216
|
-
{
|
|
2217
|
-
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',
|
|
2218
|
-
fillRule: 'evenodd',
|
|
2219
|
-
clipRule: 'evenodd',
|
|
2220
|
-
fill: 'white',
|
|
2221
|
-
},
|
|
2222
|
-
];
|
|
2223
|
-
const Checkbox = JSX(({ className, value, text, disabled, isRadio, onChange }) => {
|
|
2224
|
-
const handleChange = useCallback((e) => {
|
|
2225
|
-
if (disabled) {
|
|
2226
|
-
return;
|
|
2227
|
-
}
|
|
2228
|
-
e.preventDefault();
|
|
2229
|
-
onChange && onChange(!value);
|
|
2230
|
-
}, [onChange, disabled, value]);
|
|
2231
|
-
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" }));
|
|
2232
|
-
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$3(text)] }) }));
|
|
2233
|
-
});
|
|
2234
|
-
const renderText$3 = (text) => text ? (jsx("div", { className: "ml-s", children: jsx(Text, { size: "text-l", font: "font-light", children: text }) })) : null;
|
|
2235
|
-
const getCursorStyle = (disabled = false) => (disabled ? 'cursor-not-allowed' : 'cursor-pointer');
|
|
2236
|
-
const role = (isRadio = false) => (isRadio ? 'radio' : 'checkbox');
|
|
2237
|
-
const checkboxStyle = (value = false) => style('rounded border', { 'bg-primary-main': value });
|
|
2238
|
-
|
|
2239
2620
|
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)] })));
|
|
2240
2621
|
|
|
2241
2622
|
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"' })));
|
|
@@ -2338,106 +2719,36 @@
|
|
|
2338
2719
|
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 ?? '') })));
|
|
2339
2720
|
const arrayToOptions = (array) => (array ?? []).map((_) => ({ key: _, value: _ }));
|
|
2340
2721
|
|
|
2341
|
-
const
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
const RegionField = JSX(({ field, input, params }) => {
|
|
2353
|
-
const url = getRegionUrl(params?.typeForm);
|
|
2354
|
-
const regions = useRegions(url);
|
|
2355
|
-
return (jsx(SelectControl, { label: input?.label || 'Филиал', placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B", isSearch: true, options: useMemo(() => regions?.map(({ code = '', name = '' }) => ({ key: code, text: name })), [regions]), ...field(input?.name ?? '') }));
|
|
2356
|
-
});
|
|
2357
|
-
|
|
2358
|
-
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') })));
|
|
2359
|
-
|
|
2360
|
-
const withValidator = (props, validator) => {
|
|
2361
|
-
const { value, isDirty } = props;
|
|
2362
|
-
const errors = isDirty ? validator(value) : [];
|
|
2363
|
-
return {
|
|
2364
|
-
...props,
|
|
2365
|
-
errors,
|
|
2366
|
-
error: errors[0],
|
|
2367
|
-
};
|
|
2368
|
-
};
|
|
2369
|
-
|
|
2370
|
-
const cyrillicPattern = /^[а-яё-]*$/i;
|
|
2371
|
-
const isCyrillic = (_ = '') => cyrillicPattern.test(_);
|
|
2372
|
-
|
|
2373
|
-
const required = validator((_) => _ !== null && _ !== undefined && _ !== '');
|
|
2374
|
-
|
|
2375
|
-
const ERROR_MESSAGE$1 = 'Некорректно заполненное поле';
|
|
2376
|
-
const defaultValidator = (errorMsg) => required(errorMsg ?? ERROR_MESSAGE$1);
|
|
2377
|
-
const defaultSelectValidator = (errorMsg) => validator((_) => _?.key && _?.key !== '')(errorMsg ?? ERROR_MESSAGE$1);
|
|
2378
|
-
const nameValidator = (errorMsg) => validator((_) => typeof _ === 'string' && _.length > 1 && isCyrillic(_))(errorMsg ?? ERROR_MESSAGE$1);
|
|
2379
|
-
const innValidator = (errorMsg) => validator((_) => isValidInnLength(_))(errorMsg);
|
|
2380
|
-
const innDadataValidator = (errorMsg) => validator((_) => Boolean(_?.text) && isValidInnLength(_.text))(errorMsg);
|
|
2381
|
-
const phoneValidate = (email) => /^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(email);
|
|
2382
|
-
const phoneValidator = (errorMsg) => validator(phoneValidate)(errorMsg);
|
|
2383
|
-
const agreementValidator = validator((_) => typeof _ === 'boolean' && _)('Согласие обязательно');
|
|
2384
|
-
const emailValidate = (email) => /^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(email);
|
|
2385
|
-
const emailValidator = (errorMsg) => validator((_) => emailValidate(_))(errorMsg);
|
|
2386
|
-
const isValidInnLength = (value) => typeof value === 'string' && (value.length === 10 || value.length === 12);
|
|
2722
|
+
const QUESTION_PRODUCT_TYPES = [
|
|
2723
|
+
{
|
|
2724
|
+
key: 'Вопрос по действующему продукту',
|
|
2725
|
+
text: 'Вопрос по действующему продукту',
|
|
2726
|
+
},
|
|
2727
|
+
{
|
|
2728
|
+
key: 'Оформление нового продукта',
|
|
2729
|
+
text: 'Оформление нового продукта',
|
|
2730
|
+
},
|
|
2731
|
+
];
|
|
2732
|
+
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 ?? '') })));
|
|
2387
2733
|
|
|
2388
|
-
const
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
surname: nameValidator('Укажите свою фамилию на кириллице'),
|
|
2407
|
-
name: nameValidator('Укажите своё имя на кириллице (без сокращений)'),
|
|
2408
|
-
middleName: nameValidator('Укажите своё отчество на кириллице'),
|
|
2409
|
-
birthday: defaultValidator('Укажите дату рождения'),
|
|
2410
|
-
phone: phoneValidator('Укажите номер телефона'),
|
|
2411
|
-
email: emailValidator('Укажите электронную почту'),
|
|
2412
|
-
inn: innValidator('Укажите ИНН'),
|
|
2413
|
-
comment: defaultValidator(),
|
|
2414
|
-
typeForm: defaultValidator(),
|
|
2415
|
-
consentToReceiveMaterials: agreementValidator,
|
|
2416
|
-
consentDataProcessing: agreementValidator,
|
|
2417
|
-
partnerSymbolCode: defaultValidator('Укажите идентификатор партнёра'),
|
|
2418
|
-
dadataPartyInnSelect: innDadataValidator('Укажите ИНН'),
|
|
2419
|
-
dadataPartyNameSelect: defaultValidator('Укажите наименование организации'),
|
|
2420
|
-
};
|
|
2421
|
-
const getFormValidator = (fieldDefs, externalValidatorObj = {}) => {
|
|
2422
|
-
const requiredFields = fieldDefs.filter((_) => Boolean(_?.required && _?.name));
|
|
2423
|
-
const validator = { ...validatorObj$1, ...externalValidatorObj };
|
|
2424
|
-
const hasConditions = requiredFields.some((_) => _.condition?.values);
|
|
2425
|
-
const requiredFieldValidatorsMap = Object.fromEntries(requiredFields
|
|
2426
|
-
.filter(byNonEmptyValidator(validator))
|
|
2427
|
-
.map(({ name }) => [name, validator[name ?? '']]));
|
|
2428
|
-
return (formState) => hasConditions
|
|
2429
|
-
? Object.fromEntries(requiredFields
|
|
2430
|
-
.filter(byNonEmptyValidator(validator))
|
|
2431
|
-
.filter(byCondition(formState))
|
|
2432
|
-
.map(({ name }) => [name, validator[name ?? '']]))
|
|
2433
|
-
: requiredFieldValidatorsMap;
|
|
2434
|
-
};
|
|
2435
|
-
const byNonEmptyValidator = (validator = {}) => ({ name }) => Boolean(validator[name ?? '']);
|
|
2436
|
-
const byCondition = (formState) => (fieldDef) => !fieldDef?.condition ||
|
|
2437
|
-
fieldDef.condition.values.some((_) => {
|
|
2438
|
-
const dependencyValue = formState?.[fieldDef?.condition?.name ?? ''];
|
|
2439
|
-
return _ === (dependencyValue?.key ?? dependencyValue);
|
|
2440
|
-
});
|
|
2734
|
+
const REGIONS_URL = `${API_BASE_URI$1}/regions`;
|
|
2735
|
+
const EMPTY_REGIONS = [];
|
|
2736
|
+
// TODO Почему url можно менять? Разве смысл не в инкапсуляции api url. Тоже под рефакторинг попадает
|
|
2737
|
+
function useRegions(url = REGIONS_URL) {
|
|
2738
|
+
const { data } = useAsyncData(url, fetchJSONUnsafe);
|
|
2739
|
+
return Array.isArray(data) ? data : EMPTY_REGIONS;
|
|
2740
|
+
}
|
|
2741
|
+
|
|
2742
|
+
const OUT_SERVICE_URL = `${API_BASE_URI$1}/outservice/outserviceregions`;
|
|
2743
|
+
const getRegionUrl = (typeForm) => typeForm === 'OUTSERVICE' ? OUT_SERVICE_URL : undefined;
|
|
2744
|
+
|
|
2745
|
+
const RegionField = JSX(({ field, input, params }) => {
|
|
2746
|
+
const url = getRegionUrl(params?.typeForm);
|
|
2747
|
+
const regions = useRegions(url);
|
|
2748
|
+
return (jsx(SelectControl, { label: input?.label || 'Филиал', placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B", isSearch: true, options: useMemo(() => regions?.map(({ code = '', name = '' }) => ({ key: code, text: name })), [regions]), ...field(input?.name ?? '') }));
|
|
2749
|
+
});
|
|
2750
|
+
|
|
2751
|
+
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') })));
|
|
2441
2752
|
|
|
2442
2753
|
const SecondaryPhoneField = JSX(({ field }) => {
|
|
2443
2754
|
const fieldPhone = field('secondaryPhone');
|
|
@@ -2479,28 +2790,6 @@
|
|
|
2479
2790
|
|
|
2480
2791
|
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 ?? '') })));
|
|
2481
2792
|
|
|
2482
|
-
const orientationStyleMap = {
|
|
2483
|
-
horizontal: '@lg:flex-row',
|
|
2484
|
-
vertical: '',
|
|
2485
|
-
};
|
|
2486
|
-
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)))) })] })));
|
|
2487
|
-
|
|
2488
|
-
const VED_TYPES = [
|
|
2489
|
-
{ id: 'currencyControl', text: 'Валютный контроль' },
|
|
2490
|
-
{ id: 'documentOperations', text: 'Документарные операции' },
|
|
2491
|
-
{ id: 'conversionTransactions', text: 'Конверсионные операции' },
|
|
2492
|
-
{ id: 'otherIssues', text: 'Иные вопросы ВЭД' },
|
|
2493
|
-
];
|
|
2494
|
-
const VedField = JSX(({ field, input }) => {
|
|
2495
|
-
const handleChange = useCallback((_) => {
|
|
2496
|
-
if (_ !== 'currencyControl') {
|
|
2497
|
-
field('inn').onChange?.('');
|
|
2498
|
-
field('region').onChange?.('');
|
|
2499
|
-
}
|
|
2500
|
-
}, []);
|
|
2501
|
-
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 }) }) }));
|
|
2502
|
-
});
|
|
2503
|
-
|
|
2504
2793
|
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 ?? '') })));
|
|
2505
2794
|
|
|
2506
2795
|
const RefWrapper = JSX(({ onFieldRef = noop, children }) => {
|
|
@@ -2566,6 +2855,9 @@
|
|
|
2566
2855
|
partnerName: (props) => jsx(PartnerNameField, { ...props, source: AGENTS_REF }),
|
|
2567
2856
|
dadataPartyNameSelect: DadataPartySelectField,
|
|
2568
2857
|
dadataPartyInnSelect: DadataPartySelectField,
|
|
2858
|
+
questionProduct: QuestionProductField,
|
|
2859
|
+
callbackTime: CallbackTimeField,
|
|
2860
|
+
russianPhone: PhoneField,
|
|
2569
2861
|
};
|
|
2570
2862
|
const getField = (field, params, externalInputs = {}) => (input, i) => {
|
|
2571
2863
|
const fieldsRegister = {
|
|
@@ -2580,167 +2872,7 @@
|
|
|
2580
2872
|
|
|
2581
2873
|
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;
|
|
2582
2874
|
|
|
2583
|
-
const
|
|
2584
|
-
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'),
|
|
2585
|
-
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'),
|
|
2586
|
-
};
|
|
2587
|
-
const embeddedStyle = style('group/btn-embedded', 'bg-transparent border border-transparent outline-none');
|
|
2588
|
-
const disabledStyle = style('bg-main-gray text-main-disabled cursor-not-allowed');
|
|
2589
|
-
const Button = JSX(({ className, type = 'button', version = 'primary', shape = 'default', embedded, disabled, role, ariaLabel, data, dataTheme, children, wcmsIgnore, onClick = noop, }) => {
|
|
2590
|
-
const handleClick = useCallback(role !== 'tab' ? handlerDecorator(onClick) : onClick, [
|
|
2591
|
-
role,
|
|
2592
|
-
onClick,
|
|
2593
|
-
]);
|
|
2594
|
-
const aspectsAttrs = useMemo(() => getAspectsAttributes(data), [data]);
|
|
2595
|
-
const isRound = shape === 'round';
|
|
2596
|
-
return (jsx("button", { className: style('font-sans flex items-center gap-xs', {
|
|
2597
|
-
[themeStyle$1[version]]: !disabled && !embedded,
|
|
2598
|
-
[embeddedStyle]: embedded,
|
|
2599
|
-
[disabledStyle]: disabled,
|
|
2600
|
-
}, embedded ? 'justify-between' : 'justify-center', embedded || isRound ? 'p-0' : 'px-9 py-4', {
|
|
2601
|
-
'rounded-md': shape === 'default',
|
|
2602
|
-
'rounded-full': isRound,
|
|
2603
|
-
}, 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 }));
|
|
2604
|
-
});
|
|
2605
|
-
|
|
2606
|
-
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" }) })));
|
|
2607
|
-
|
|
2608
|
-
const DIALOG_STYLE = {
|
|
2609
|
-
sm: 'max-w-sm top-1/3',
|
|
2610
|
-
lg: 'max-w-lg',
|
|
2611
|
-
'4xl': 'max-w-4xl',
|
|
2612
|
-
none: 'mt-0',
|
|
2613
|
-
};
|
|
2614
|
-
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 })] })));
|
|
2615
|
-
|
|
2616
|
-
const ResponseTypeDialog = JSX(({ ok, typeForm, onClose }) => {
|
|
2617
|
-
const statusIcon = ok ? 'ResponseOKIcon' : 'ResponseFailIcon';
|
|
2618
|
-
const responseOKDescription = typeForm === 'ANTIFRAUD'
|
|
2619
|
-
? `Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы
|
|
2620
|
-
можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка
|
|
2621
|
-
не звонят с использованием мессенджеров.`
|
|
2622
|
-
: 'Совсем скоро мы с вами свяжемся';
|
|
2623
|
-
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" })] }) }));
|
|
2624
|
-
});
|
|
2625
|
-
|
|
2626
|
-
const getPartnerComments = (data) => {
|
|
2627
|
-
const { acquiringType, onlineCheckout = false, posTerminal = false, term, amount, annualRevenue, } = data;
|
|
2628
|
-
if (acquiringType) {
|
|
2629
|
-
return `Вид эквайринга=${acquiringType?.text || ''}${isAcquiringTrade(acquiringType?.key)
|
|
2630
|
-
? `/Онлайн касса=${onlineCheckout}/POS-терминал=${posTerminal}`
|
|
2631
|
-
: '/Онлайн касса=false/POS-терминал=false'}`;
|
|
2632
|
-
}
|
|
2633
|
-
else {
|
|
2634
|
-
return `Сумма=${amount}/Срок=${term}/Выручка=${annualRevenue}`;
|
|
2635
|
-
}
|
|
2636
|
-
};
|
|
2637
|
-
|
|
2638
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2639
|
-
const getFormatData = (data) => {
|
|
2640
|
-
const { acquiringType, onlineCheckout, posTerminal, amount, term, annualRevenue, serviceType, vedTypes, region, inn, sufferedFrom, situationDescription, applierType, isPremium, dadataPartyNameSelect, partnerSymbolCode, dadataPartyInnSelect, ...usedData } = data;
|
|
2641
|
-
const partnerComments = acquiringType || annualRevenue ? getPartnerComments(data) : null;
|
|
2642
|
-
const formatData = {
|
|
2643
|
-
...usedData,
|
|
2644
|
-
...getVedTypes(vedTypes),
|
|
2645
|
-
...getRegion(region),
|
|
2646
|
-
...(inn && { inn }),
|
|
2647
|
-
...(partnerComments ? { partnerComments } : {}),
|
|
2648
|
-
...(serviceType ? { typeForm: serviceType } : {}),
|
|
2649
|
-
...getIncidentComment(sufferedFrom?.text, situationDescription),
|
|
2650
|
-
...getIsClient(applierType),
|
|
2651
|
-
...getDadataValues([
|
|
2652
|
-
[dadataPartyInnSelect, 'inn'],
|
|
2653
|
-
[dadataPartyNameSelect, 'fullName'],
|
|
2654
|
-
]),
|
|
2655
|
-
};
|
|
2656
|
-
return Object.fromEntries(Object.entries(formatData)?.map(([k, v]) => [k, v?.key || v]));
|
|
2657
|
-
};
|
|
2658
|
-
const getIsClient = (applierType) => applierType?.key ? { isClient: applierType?.key === CLIENT_KEY } : {};
|
|
2659
|
-
const getIncidentComment = (sufferedFrom, situationDescription) => sufferedFrom || situationDescription
|
|
2660
|
-
? { comment: `${sufferedFrom || ''};${situationDescription || ''}` }
|
|
2661
|
-
: {};
|
|
2662
|
-
const getRegion = (region) => region?.key || region?.text ? { region: region?.text || region?.key } : {};
|
|
2663
|
-
const getVedTypes = (vedTypes) => vedTypes
|
|
2664
|
-
? {
|
|
2665
|
-
vedTypes: Object.fromEntries(VED_TYPES.map(({ id }) => [id, id === vedTypes])),
|
|
2666
|
-
}
|
|
2667
|
-
: {};
|
|
2668
|
-
const getDadataValues = (fields) => fields.reduce((acc, [field, name]) => {
|
|
2669
|
-
if (field?.text && name) {
|
|
2670
|
-
acc[name] = field.text;
|
|
2671
|
-
}
|
|
2672
|
-
return acc;
|
|
2673
|
-
}, {});
|
|
2674
|
-
|
|
2675
|
-
const initialFormState$1 = {
|
|
2676
|
-
typeForm: '',
|
|
2677
|
-
region: { key: '', text: '' },
|
|
2678
|
-
addressBranch: { key: '', text: '' },
|
|
2679
|
-
surname: '',
|
|
2680
|
-
name: '',
|
|
2681
|
-
phone: '',
|
|
2682
|
-
secondaryPhone: '',
|
|
2683
|
-
comment: '',
|
|
2684
|
-
product: '',
|
|
2685
|
-
partnerComments: '',
|
|
2686
|
-
annualRevenue: '',
|
|
2687
|
-
term: 12,
|
|
2688
|
-
amount: 100000,
|
|
2689
|
-
acquiringType: ACQUIRING_TYPES[0],
|
|
2690
|
-
serviceType: SERVICE_TYPES[0],
|
|
2691
|
-
feedbackMethod: FEEDBACK_METHOD[0],
|
|
2692
|
-
serviceDirection: SERVICE_DIRECTIONS[0],
|
|
2693
|
-
vedTypes: VED_TYPES[0].id,
|
|
2694
|
-
birthday: undefined,
|
|
2695
|
-
isClient: false,
|
|
2696
|
-
onlineCheckout: false,
|
|
2697
|
-
posTerminal: false,
|
|
2698
|
-
consentToReceiveMaterials: false,
|
|
2699
|
-
consentDataProcessing: false,
|
|
2700
|
-
addressRetail: { key: '', text: '' },
|
|
2701
|
-
};
|
|
2702
|
-
const getInitialFormState$2 = (inputs, typeForm = '') => {
|
|
2703
|
-
const formState = Object.fromEntries(inputs.map((_) => [
|
|
2704
|
-
_.name,
|
|
2705
|
-
(_?.name === 'vedTypes' && _?.defaultValue) || initialFormState$1[_.name || ''],
|
|
2706
|
-
]));
|
|
2707
|
-
return { ...formState, typeForm: { key: typeForm, text: '' } };
|
|
2708
|
-
};
|
|
2709
|
-
|
|
2710
|
-
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, {
|
|
2711
|
-
'backdrop-blur': blur,
|
|
2712
|
-
}), 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" }) })));
|
|
2713
|
-
|
|
2714
|
-
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] })));
|
|
2715
|
-
|
|
2716
|
-
const themeStyle = {
|
|
2717
|
-
primary: themeStyle$1.primary,
|
|
2718
|
-
secondary: themeStyle$1.secondary,
|
|
2719
|
-
white: 'text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main',
|
|
2720
|
-
link: 'text-primary-main',
|
|
2721
|
-
gray: themeStyle$1.secondary,
|
|
2722
|
-
transparent: '',
|
|
2723
|
-
'': '',
|
|
2724
|
-
};
|
|
2725
|
-
const Link = JSX((props) => {
|
|
2726
|
-
const link = useLink();
|
|
2727
|
-
const { className, href, target, text, aboveText, version = 'link', rel, ariaLabel, data, children, onClick, } = link(props);
|
|
2728
|
-
const buttonLike = version !== 'link';
|
|
2729
|
-
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', {
|
|
2730
|
-
[themeStyle[version]]: Boolean(version),
|
|
2731
|
-
[aboveText ? 'px-9 py-2.5' : 'px-9 py-4']: buttonLike,
|
|
2732
|
-
'rounded-md': buttonLike,
|
|
2733
|
-
}, className), href: href, target: target, rel: rel, "aria-label": ariaLabel ?? `Ссылка на ${text}`, role: href ? 'link' : 'button', onClick: onClick, ...getAspectsAttributes(data), children: children ?? renderText$2(text, aboveText) }));
|
|
2734
|
-
});
|
|
2735
|
-
const renderText$2 = (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;
|
|
2736
|
-
|
|
2737
|
-
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] })));
|
|
2738
|
-
|
|
2739
|
-
const agreementText = 'Нажимая кнопку, вы подтверждаете согласие с ';
|
|
2740
|
-
const agreementTextPF = 'Нажимая на кнопку, вы подтверждаете, что клиент дал согласие на ';
|
|
2741
|
-
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 : 'Отправить заявку' })] }));
|
|
2742
|
-
|
|
2743
|
-
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" })] })] })] }));
|
|
2875
|
+
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}`)));
|
|
2744
2876
|
|
|
2745
2877
|
const useInterval = (handler, period) => {
|
|
2746
2878
|
const timer = useRef(null);
|
|
@@ -2836,7 +2968,7 @@
|
|
|
2836
2968
|
const TIME_TO_RESEND$2 = 180;
|
|
2837
2969
|
const getTimer = (sendTime) => TIME_TO_RESEND$2 - Math.floor((Date.now() - sendTime) / 1000);
|
|
2838
2970
|
|
|
2839
|
-
const API$
|
|
2971
|
+
const API$1 = LeadServiceAPI();
|
|
2840
2972
|
const useVerifyPhoneDialogSubmit$1 = ({ values, onSuccess, formatData, reqId, }) => {
|
|
2841
2973
|
const timer = Math.max(getTimer(Date.now()), 0);
|
|
2842
2974
|
const [errorText, setErrorText] = useState('');
|
|
@@ -2847,7 +2979,7 @@
|
|
|
2847
2979
|
const handleSubmit = useCallback(async () => {
|
|
2848
2980
|
try {
|
|
2849
2981
|
startLoading();
|
|
2850
|
-
const response = await API$
|
|
2982
|
+
const response = await API$1.checkCode({
|
|
2851
2983
|
code: values.join(''),
|
|
2852
2984
|
body: formatData,
|
|
2853
2985
|
reqId,
|
|
@@ -2879,7 +3011,7 @@
|
|
|
2879
3011
|
};
|
|
2880
3012
|
};
|
|
2881
3013
|
|
|
2882
|
-
const API
|
|
3014
|
+
const API = LeadServiceAPI();
|
|
2883
3015
|
const CODE_LENGTH$1 = 4;
|
|
2884
3016
|
const TIME_TO_RESEND$1 = 180;
|
|
2885
3017
|
const VerifyPhoneDialog$1 = JSX(({ phone, onSuccess = noop, onClose = noop, formatData = {}, reqId }) => {
|
|
@@ -2894,7 +3026,7 @@
|
|
|
2894
3026
|
const phoneNumber = formatPhone(phone);
|
|
2895
3027
|
const restartTimer = useCountDownTimer({ seconds: timeNextReq, onTick: setTimeNextReq });
|
|
2896
3028
|
const handleSendCode = useCallback(async () => {
|
|
2897
|
-
const response = await API
|
|
3029
|
+
const response = await API.sendCode({ phone: phoneNumber });
|
|
2898
3030
|
if (response) {
|
|
2899
3031
|
setTimeNextReq(TIME_TO_RESEND$1);
|
|
2900
3032
|
restartTimer(TIME_TO_RESEND$1);
|
|
@@ -2905,10 +3037,12 @@
|
|
|
2905
3037
|
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 }));
|
|
2906
3038
|
});
|
|
2907
3039
|
|
|
2908
|
-
const
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
3040
|
+
const handlerMap = {
|
|
3041
|
+
initcorporatelead: handleInitCorporateLead,
|
|
3042
|
+
callback: handleCallback,
|
|
3043
|
+
default: handleDefault,
|
|
3044
|
+
};
|
|
3045
|
+
const ApplicationForm = UniBlock(({ className, title, typeForm = '', sections = [], button, link, endpoint, additionalParams, isContacts, data, onSuccess, ...rest }) => {
|
|
2912
3046
|
const inputs = useMemo(() => (sections?.flatMap((_) => _?.inputs) || []), [sections]);
|
|
2913
3047
|
const initialFormState = useMemo(() => getInitialFormState$2(inputs, typeForm), [inputs, typeForm]);
|
|
2914
3048
|
const router = useRouter();
|
|
@@ -2918,31 +3052,17 @@
|
|
|
2918
3052
|
const verifyPhoneDialog = useDialog(VerifyPhoneDialog$1);
|
|
2919
3053
|
const handleSubmit = useCallback(async (formData, ev) => {
|
|
2920
3054
|
const formatData = getFormatData({ ...formData, ...additionalParams });
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
onSuccess: () => {
|
|
2933
|
-
verifyPhoneDialog.close();
|
|
2934
|
-
responseTypeDialog.open({ ok: true, typeForm });
|
|
2935
|
-
handleAspects({ aspectsAttributes: data, aspects, ev });
|
|
2936
|
-
},
|
|
2937
|
-
});
|
|
2938
|
-
}
|
|
2939
|
-
else {
|
|
2940
|
-
const ok = Boolean(await API.send(formatData, router, endpoint === 'lead'));
|
|
2941
|
-
responseTypeDialog.open({ ok, typeForm });
|
|
2942
|
-
if (ok) {
|
|
2943
|
-
handleAspects({ aspectsAttributes: data, aspects, ev });
|
|
2944
|
-
}
|
|
2945
|
-
}
|
|
3055
|
+
await executeHandler(endpoint ?? 'default', {
|
|
3056
|
+
formatData,
|
|
3057
|
+
ev,
|
|
3058
|
+
typeForm,
|
|
3059
|
+
data,
|
|
3060
|
+
aspects,
|
|
3061
|
+
router,
|
|
3062
|
+
responseTypeDialog,
|
|
3063
|
+
verifyPhoneDialog,
|
|
3064
|
+
onSuccess,
|
|
3065
|
+
});
|
|
2946
3066
|
}, [typeForm]);
|
|
2947
3067
|
const [, { field, onSubmit }] = useForm(initialFormState, {
|
|
2948
3068
|
resetOnSubmit: true,
|
|
@@ -2958,7 +3078,10 @@
|
|
|
2958
3078
|
typeForm,
|
|
2959
3079
|
})] }), isContacts ? renderContacts() : null] }));
|
|
2960
3080
|
});
|
|
2961
|
-
const
|
|
3081
|
+
const executeHandler = async (endpoint, context) => {
|
|
3082
|
+
const handler = handlerMap[endpoint] || handlerMap.default;
|
|
3083
|
+
await handler(context);
|
|
3084
|
+
};
|
|
2962
3085
|
|
|
2963
3086
|
const NoConsentDialog = JSX(({ attempts, onClose = noop }) => {
|
|
2964
3087
|
const navigator = locationNavigator();
|
|
@@ -4512,7 +4635,7 @@
|
|
|
4512
4635
|
return [storedValue, setValue];
|
|
4513
4636
|
}
|
|
4514
4637
|
|
|
4515
|
-
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 }) })] })));
|
|
4638
|
+
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 }) })] })));
|
|
4516
4639
|
|
|
4517
4640
|
const getCardTypes = async (paymentSystemTypeCd, creditProgramId) => {
|
|
4518
4641
|
const data = await fetchRetailJSON('/dictionaryFiltered', 'POST', {
|
|
@@ -11049,23 +11172,23 @@
|
|
|
11049
11172
|
medium: 'w-10 h-10',
|
|
11050
11173
|
large: 'w-12 h-12',
|
|
11051
11174
|
};
|
|
11052
|
-
const HeaderSecondaryMenuButton = JSX(({ className, isRounded, buttonSize = 'default', isGrayBg = false, disabled, ariaLabel = 'Меню второго уровня', image, data, onClick, version, isLoading, dataTestId = '', }) => {
|
|
11175
|
+
const HeaderSecondaryMenuButton = JSX(({ className, isRounded, buttonSize = 'default', isGrayBg = false, disabled, ariaLabel = 'Меню второго уровня', image, data, onClick, version, isLoading, dataTestId = '', ref, }) => {
|
|
11053
11176
|
const grayBg = isGrayBg && !isRounded ? 'bg-main-divider' : '';
|
|
11054
11177
|
const bgColor = version === 'transparent' ? 'backdrop-opacity-30 bg-white/30' : grayBg;
|
|
11055
11178
|
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
|
|
11056
11179
|
? 'w-8 h-8 text-secondary-light hover:text-secondary-hove'
|
|
11057
|
-
: `${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', {
|
|
11180
|
+
: `${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', {
|
|
11058
11181
|
'bg-main-divider/20 rounded-full': isRounded,
|
|
11059
11182
|
}), imageClassName: "group-hover/btn:text-primary-hover group-hover/btn:invert-0" })) }));
|
|
11060
11183
|
});
|
|
11061
11184
|
const getDataTestIdAttribute = (dataTestId) => dataTestId ? { 'data-test-id': dataTestId } : null;
|
|
11062
11185
|
|
|
11063
|
-
const CHAT_BOT_ASPECT_NAME = 'openChatBot';
|
|
11186
|
+
const CHAT_BOT_ASPECT_NAME$1 = 'openChatBot';
|
|
11064
11187
|
const HeaderChatBotButton = JSX(({ iconVersion, className, ariaLabel = 'Чат', version, buttonSize = 'large' }) => {
|
|
11065
11188
|
const [isLoading, { setTrue: startLoad, setFalse: endLoad }] = useBool(false);
|
|
11066
11189
|
const aspects = useAspects();
|
|
11067
11190
|
const handleClick = useCallback((ev) => {
|
|
11068
|
-
const openChatBot = aspects[CHAT_BOT_ASPECT_NAME];
|
|
11191
|
+
const openChatBot = aspects[CHAT_BOT_ASPECT_NAME$1];
|
|
11069
11192
|
if (openChatBot) {
|
|
11070
11193
|
startLoad();
|
|
11071
11194
|
openChatBot(ev).finally(endLoad);
|
|
@@ -11074,7 +11197,12 @@
|
|
|
11074
11197
|
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" }));
|
|
11075
11198
|
});
|
|
11076
11199
|
|
|
11077
|
-
const DropdownMenu = ({ dropdownRef, items = [], activeItem, ariaLabel,
|
|
11200
|
+
const DropdownMenu = ({ dropdownRef, items = [], activeItem, ariaLabel, renderDropdownItem = renderDefaultDropdownItem, handlers, onItemClick, }) => {
|
|
11201
|
+
const isMobileMode = useMobileMode();
|
|
11202
|
+
return (jsx("div", { ref: dropdownRef, className: style('absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56 z-40', {
|
|
11203
|
+
'max-w-max': isMobileMode,
|
|
11204
|
+
}), "aria-label": ariaLabel, children: items?.map((item, i) => renderDropdownItem({ item, i, activeItem, handlers, closeDropdown: onItemClick })) }));
|
|
11205
|
+
};
|
|
11078
11206
|
const DropdownMenuItem = JSX(({ isActive, ...rest }) => {
|
|
11079
11207
|
const link = useLink();
|
|
11080
11208
|
const { text, href, target, onClick } = link(rest);
|
|
@@ -11082,9 +11210,9 @@
|
|
|
11082
11210
|
'text-primary-main': isActive,
|
|
11083
11211
|
}), href: href, target: target, onClick: onClick, role: "link", ...getAspectsAttributes(rest?.data), children: text }));
|
|
11084
11212
|
});
|
|
11085
|
-
const
|
|
11213
|
+
const renderDefaultDropdownItem = ({ item, i, activeItem }) => (jsx(DropdownMenuItem, { isActive: item === activeItem, ...item }, item?.text ?? String(i)));
|
|
11086
11214
|
|
|
11087
|
-
function useDropdownSubMenu({ items, activeItem, onClose, isOpen, onHover = false, }) {
|
|
11215
|
+
function useDropdownSubMenu({ items, activeItem, onClose, isOpen, onHover = false, renderDropdownItem, handlers, }) {
|
|
11088
11216
|
const popup = usePopupManager();
|
|
11089
11217
|
useEffect(() => {
|
|
11090
11218
|
if (isOpen) {
|
|
@@ -11107,7 +11235,7 @@
|
|
|
11107
11235
|
const parentElement = parentRef.current;
|
|
11108
11236
|
const { top, left, width, height } = parentElement.getBoundingClientRect();
|
|
11109
11237
|
popup.open({
|
|
11110
|
-
popup: jsx(DropdownMenu, { dropdownRef: popupRef, items: items, activeItem: activeItem }),
|
|
11238
|
+
popup: (jsx(DropdownMenu, { dropdownRef: popupRef, items: items, activeItem: activeItem, renderDropdownItem: renderDropdownItem, handlers: handlers, onItemClick: close })),
|
|
11111
11239
|
top: top + window.scrollY + height,
|
|
11112
11240
|
left,
|
|
11113
11241
|
width,
|
|
@@ -11137,6 +11265,92 @@
|
|
|
11137
11265
|
.map((_, i) => (jsx("div", { className: "w-[3px] h-[3px] rounded mr-2xs bg-primary-text group-hover/btn:bg-primary-hover group-data-transparent:bg-white" }, String(i)))) }) }));
|
|
11138
11266
|
});
|
|
11139
11267
|
|
|
11268
|
+
const button = {
|
|
11269
|
+
text: 'Отправить заявку',
|
|
11270
|
+
version: 'primary',
|
|
11271
|
+
};
|
|
11272
|
+
const link = {
|
|
11273
|
+
text: 'Согласен на обработку персональных данных',
|
|
11274
|
+
href: '/privacy-policy',
|
|
11275
|
+
target: '_blank',
|
|
11276
|
+
};
|
|
11277
|
+
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: [
|
|
11278
|
+
{
|
|
11279
|
+
inputs: [
|
|
11280
|
+
{ name: 'questionProduct', required: true },
|
|
11281
|
+
{ name: 'callbackTime', required: true, label: 'Когда перезвонить?' },
|
|
11282
|
+
{ name: 'russianPhone', required: true },
|
|
11283
|
+
{ name: 'consentDataProcessing', required: true },
|
|
11284
|
+
],
|
|
11285
|
+
},
|
|
11286
|
+
], button: button, link: link, onSuccess: onClose }) }) }) }));
|
|
11287
|
+
|
|
11288
|
+
const CHAT_BOT_ASPECT_NAME = 'openChatBot';
|
|
11289
|
+
const HeaderQuickActionsMenu = JSX(({ iconVersion, className, ariaLabel = 'Чат', version, buttonSize = 'large' }) => {
|
|
11290
|
+
const [isOpenDropdown, { setFalse, toggle }] = useBool(false);
|
|
11291
|
+
const quickActionsList = transformQuickActions(projectSettings.QUICK_ACTIONS ?? []);
|
|
11292
|
+
const customHandlers = useHandlers();
|
|
11293
|
+
const isMobileMode = useMobileMode();
|
|
11294
|
+
const dropdownMenu = useDropdownSubMenu({
|
|
11295
|
+
items: quickActionsList,
|
|
11296
|
+
onClose: setFalse,
|
|
11297
|
+
isOpen: isOpenDropdown,
|
|
11298
|
+
onHover: !isMobileMode,
|
|
11299
|
+
renderDropdownItem: renderQuickActionsDropdown,
|
|
11300
|
+
handlers: customHandlers,
|
|
11301
|
+
});
|
|
11302
|
+
useEffect(() => {
|
|
11303
|
+
if (isMobileMode) {
|
|
11304
|
+
return;
|
|
11305
|
+
}
|
|
11306
|
+
dropdownMenu.current?.addEventListener('mouseenter', toggle);
|
|
11307
|
+
dropdownMenu.current?.addEventListener('mouseleave', setFalse);
|
|
11308
|
+
// eslint-disable-next-line consistent-return
|
|
11309
|
+
return () => {
|
|
11310
|
+
dropdownMenu.current?.removeEventListener('mouseenter', toggle);
|
|
11311
|
+
dropdownMenu.current?.removeEventListener('mouseleave', setFalse);
|
|
11312
|
+
};
|
|
11313
|
+
}, []);
|
|
11314
|
+
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 }) }));
|
|
11315
|
+
});
|
|
11316
|
+
const renderQuickActionsDropdown = ({ item, handlers, closeDropdown = noop, }) => {
|
|
11317
|
+
const quickActionsMapping = {
|
|
11318
|
+
call: {
|
|
11319
|
+
handler: () => {
|
|
11320
|
+
handlers?.call();
|
|
11321
|
+
closeDropdown();
|
|
11322
|
+
},
|
|
11323
|
+
text: 'Заказать звонок',
|
|
11324
|
+
},
|
|
11325
|
+
chat: {
|
|
11326
|
+
handler: () => {
|
|
11327
|
+
handlers?.chat();
|
|
11328
|
+
closeDropdown();
|
|
11329
|
+
},
|
|
11330
|
+
text: 'Написать в чат',
|
|
11331
|
+
},
|
|
11332
|
+
};
|
|
11333
|
+
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 ?? ''));
|
|
11334
|
+
};
|
|
11335
|
+
const transformQuickActions = (items) => items.map((item) => ({ text: item }));
|
|
11336
|
+
const useHandlers = () => {
|
|
11337
|
+
const phoneCallRequestDialog = useDialog(PhoneCallRequestDialog);
|
|
11338
|
+
const handleCallClick = useCallback(() => {
|
|
11339
|
+
phoneCallRequestDialog.open({ onClose: () => phoneCallRequestDialog.close() });
|
|
11340
|
+
}, []);
|
|
11341
|
+
const aspects = useAspects();
|
|
11342
|
+
const handleChatClick = useCallback((ev) => {
|
|
11343
|
+
const openChatBot = aspects[CHAT_BOT_ASPECT_NAME];
|
|
11344
|
+
if (openChatBot && ev) {
|
|
11345
|
+
openChatBot(ev).finally();
|
|
11346
|
+
}
|
|
11347
|
+
}, []);
|
|
11348
|
+
return {
|
|
11349
|
+
call: handleCallClick,
|
|
11350
|
+
chat: handleChatClick,
|
|
11351
|
+
};
|
|
11352
|
+
};
|
|
11353
|
+
|
|
11140
11354
|
const HeaderItem = JSX(({ className = '', active, dataItemName, children, data, ...rest }) => {
|
|
11141
11355
|
const link = useLink();
|
|
11142
11356
|
const { href, target, text, onClick } = link(rest);
|
|
@@ -11195,7 +11409,7 @@
|
|
|
11195
11409
|
? handleIntersectionActivation$1(index)
|
|
11196
11410
|
: handleIntersectionDeactivation$1(index));
|
|
11197
11411
|
}), [subItems]);
|
|
11198
|
-
return (jsxs("nav", { className: "mt-s flex gap-s items-center justify-between", children: [jsx("div", { ref: subItemsListRef, className: "overflow-hidden whitespace-nowrap pb-s mt-xs space-x-lg", role: "menu", children: subItems.map((_, i) => (jsx(HeaderSubMenuItem, { className: visibleItemsCount - 1 < i ? 'invisible' : '', active: _ === activeSubItem, activeItem: activeSubItem, observerOptions: observerOptions, onVisibilityChange: subItemsVisibilityHandlers[i], data: _.dataHeader, ..._ }, String(i)))) }), dropDownMenuItems.length ? (jsx(HeaderMoreMenuItem, { items: dropDownMenuItems, activeItem: activeSubItem, ariaLabel: dropdownMenuAriaLabel })) : null, projectSettings.CHAT_BOT ? (jsx(HeaderChatBotButton, { version: version, iconVersion: iconVersion, ariaLabel: chatBotAriaLabel })) : null, jsx(InternetBankButton, { version: version, ...internetBankButton })] }));
|
|
11412
|
+
return (jsxs("nav", { className: "mt-s flex gap-s items-center justify-between", children: [jsx("div", { ref: subItemsListRef, className: "overflow-hidden whitespace-nowrap pb-s mt-xs space-x-lg", role: "menu", children: subItems.map((_, i) => (jsx(HeaderSubMenuItem, { className: visibleItemsCount - 1 < i ? 'invisible' : '', active: _ === activeSubItem, activeItem: activeSubItem, observerOptions: observerOptions, onVisibilityChange: subItemsVisibilityHandlers[i], data: _.dataHeader, ..._ }, String(i)))) }), dropDownMenuItems.length ? (jsx(HeaderMoreMenuItem, { items: dropDownMenuItems, activeItem: activeSubItem, ariaLabel: dropdownMenuAriaLabel })) : null, jsx("div", { children: projectSettings.QUICK_ACTIONS ? (jsx(HeaderQuickActionsMenu, { version: version, iconVersion: iconVersion, ariaLabel: chatBotAriaLabel })) : null }), projectSettings.CHAT_BOT && !projectSettings.QUICK_ACTIONS ? (jsx(HeaderChatBotButton, { version: version, iconVersion: iconVersion, ariaLabel: chatBotAriaLabel })) : null, jsx(InternetBankButton, { version: version, ...internetBankButton })] }));
|
|
11199
11413
|
});
|
|
11200
11414
|
const handleIntersectionActivation$1 = (index) => (prev) => Math.max(prev, index + 1);
|
|
11201
11415
|
const handleIntersectionDeactivation$1 = (index) => (prev) => Math.min(prev, index);
|
|
@@ -12230,7 +12444,7 @@
|
|
|
12230
12444
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
12231
12445
|
});
|
|
12232
12446
|
|
|
12233
|
-
const packageVersion = "0.14.
|
|
12447
|
+
const packageVersion = "0.14.934";
|
|
12234
12448
|
|
|
12235
12449
|
exports.Blocks = Blocks;
|
|
12236
12450
|
exports.ContentPage = ContentPage;
|