@redneckz/wildless-cms-uni-blocks 0.14.932 → 0.14.934
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 +768 -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/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/retail/utils/latinFieldsUtils.js +3 -1
- package/dist/retail/utils/latinFieldsUtils.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/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/icons/IconName.d.ts +4 -2
- package/lib/icons/IconName.js +2 -0
- package/lib/icons/IconName.js.map +1 -1
- package/lib/retail/utils/latinFieldsUtils.js +3 -1
- package/lib/retail/utils/latinFieldsUtils.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/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 +809 -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/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/retail/utils/latinFieldsUtils.js +3 -1
- package/mobile/dist/retail/utils/latinFieldsUtils.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/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/retail/utils/latinFieldsUtils.js +3 -1
- package/mobile/lib/retail/utils/latinFieldsUtils.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/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/retail/utils/latinFieldsUtils.ts +3 -1
- 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/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/retail/utils/latinFieldsUtils.ts +3 -1
- 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/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
|
@@ -8,33 +8,38 @@ import { Img } from '../Img/Img';
|
|
|
8
8
|
export interface ResponseNotificationProps extends OnCloseProps {
|
|
9
9
|
ok?: boolean;
|
|
10
10
|
typeForm?: string;
|
|
11
|
+
errorMessage?: string;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
export const ResponseTypeDialog = JSX<ResponseNotificationProps>(
|
|
14
|
-
|
|
14
|
+
export const ResponseTypeDialog = JSX<ResponseNotificationProps>(
|
|
15
|
+
({ ok, typeForm, onClose, errorMessage }) => {
|
|
16
|
+
const statusIcon = ok ? 'ResponseOKIcon' : 'ResponseFailIcon';
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
const responseOKDescription =
|
|
19
|
+
typeForm === 'ANTIFRAUD'
|
|
20
|
+
? `Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы
|
|
19
21
|
можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка
|
|
20
22
|
не звонят с использованием мессенджеров.`
|
|
21
|
-
|
|
23
|
+
: 'Совсем скоро мы с вами свяжемся';
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
25
|
+
const responseFailDescription = errorMessage || 'Пожалуйста, повторите позднее';
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<Dialog maxWidth="lg" onClose={onClose}>
|
|
29
|
+
<div className="flex flex-col gap-lg items-center rounded-md space-x-m">
|
|
30
|
+
<Img image={{ icon: statusIcon, iconVersion: 'normal' }} width="136" height="136" />
|
|
31
|
+
<Headline
|
|
32
|
+
className="w-full"
|
|
33
|
+
title={ok ? 'Ваша заявка отправлена' : 'Не удалось отправить заявку'}
|
|
34
|
+
description={ok ? responseOKDescription : responseFailDescription}
|
|
35
|
+
headlineVersion="XS"
|
|
36
|
+
isEmbedded={true}
|
|
37
|
+
/>
|
|
38
|
+
<Button type="button" onClick={onClose}>
|
|
39
|
+
Хорошо
|
|
40
|
+
</Button>
|
|
41
|
+
</div>
|
|
42
|
+
</Dialog>
|
|
43
|
+
);
|
|
44
|
+
},
|
|
45
|
+
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ControlProps } from '../../model/ControlProps';
|
|
2
2
|
import { type IconVersion } from '../../model/IconVersion';
|
|
3
3
|
import { type OnCloseProps } from '../../model/OnCloseProps';
|
|
4
|
+
import { noop } from '../../utils/noop';
|
|
4
5
|
import { style } from '../../utils/style';
|
|
5
6
|
import { type Option } from './Option';
|
|
6
7
|
import { renderIcon } from './renderIcon';
|
|
@@ -21,7 +22,7 @@ export const renderSelectContainer = ({
|
|
|
21
22
|
valid = true,
|
|
22
23
|
isDisabled = false,
|
|
23
24
|
isOpen = false,
|
|
24
|
-
onOpen,
|
|
25
|
+
onOpen = noop,
|
|
25
26
|
onClose,
|
|
26
27
|
isManualInput = false,
|
|
27
28
|
query = '',
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const getUserTimezoneOffset = (): string => {
|
|
2
|
+
const offset = new Date().getTimezoneOffset();
|
|
3
|
+
const absOffset = Math.abs(offset);
|
|
4
|
+
const hours = Math.floor(absOffset / 60);
|
|
5
|
+
const minutes = absOffset % 60;
|
|
6
|
+
const sign = offset < 0 ? '+' : '-';
|
|
7
|
+
|
|
8
|
+
return `GMT${sign}${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}`;
|
|
9
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redneckz/wildless-cms-uni-blocks",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.934",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ЦК",
|
|
@@ -204,7 +204,7 @@
|
|
|
204
204
|
"path": "lib/common.css"
|
|
205
205
|
},
|
|
206
206
|
{
|
|
207
|
-
"limit": "
|
|
207
|
+
"limit": "105 kB",
|
|
208
208
|
"path": "bundle/bundle.umd.min.js"
|
|
209
209
|
}
|
|
210
210
|
],
|
package/src/ProjectSettings.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type JSONRecord, type JSONScalar } from '@redneckz/json-op';
|
|
2
2
|
import { type Router } from '../external/useRouter';
|
|
3
|
+
import { getUserTimezoneOffset } from '../utils/getTimezone';
|
|
3
4
|
import { API_BASE_URI } from './apiBaseUrl';
|
|
4
5
|
import { getPhoneBody, getSubmitBody } from './getSubmitBody';
|
|
5
6
|
|
|
@@ -14,6 +15,8 @@ export type LeadRequest = Record<string, JSONRecord | JSONScalar | null> & {
|
|
|
14
15
|
secondaryPhoneNumber?: string;
|
|
15
16
|
partnerSymbolCode?: string;
|
|
16
17
|
partnerName?: string;
|
|
18
|
+
consentDataProcessing?: string;
|
|
19
|
+
russianPhone?: string;
|
|
17
20
|
};
|
|
18
21
|
|
|
19
22
|
export type CheckCodeProps = {
|
|
@@ -88,7 +91,6 @@ export function LeadServiceAPI() {
|
|
|
88
91
|
confimationCode: code,
|
|
89
92
|
leadRequest: getSubmitBody(body, false),
|
|
90
93
|
};
|
|
91
|
-
|
|
92
94
|
try {
|
|
93
95
|
const response = await LeadServiceFetch(`${API_BASE_URI}/confirmCorporateLead`, submitBody);
|
|
94
96
|
|
|
@@ -98,10 +100,30 @@ export function LeadServiceAPI() {
|
|
|
98
100
|
}
|
|
99
101
|
}
|
|
100
102
|
|
|
103
|
+
async function sendPhoneCallRequest(body: LeadRequest, isNaturalPerson = false) {
|
|
104
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
105
|
+
const submitBody = getSubmitBody(body, isNaturalPerson);
|
|
106
|
+
|
|
107
|
+
const formatSubmitBody = getFormatCallbackSubmitBody(submitBody);
|
|
108
|
+
|
|
109
|
+
try {
|
|
110
|
+
const response = await LeadServiceFetch(`${API_BASE_URI}/callback`, formatSubmitBody);
|
|
111
|
+
|
|
112
|
+
if (!response?.ok) {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return await response.json();
|
|
117
|
+
} catch (e) {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
101
122
|
return {
|
|
102
123
|
send,
|
|
103
124
|
sendCode,
|
|
104
125
|
checkCode,
|
|
126
|
+
sendPhoneCallRequest,
|
|
105
127
|
};
|
|
106
128
|
}
|
|
107
129
|
|
|
@@ -112,3 +134,14 @@ const LeadServiceFetch = (url: string, submitBody: SubmitBody) =>
|
|
|
112
134
|
mode: 'cors',
|
|
113
135
|
body: JSON.stringify(submitBody),
|
|
114
136
|
});
|
|
137
|
+
|
|
138
|
+
const getFormatCallbackSubmitBody = (submitBody: Partial<LeadRequest>): SubmitBody => {
|
|
139
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
140
|
+
const { typeForm, consentDataProcessing, phone, ...rest } = submitBody;
|
|
141
|
+
|
|
142
|
+
return {
|
|
143
|
+
...rest,
|
|
144
|
+
phone: phone?.startsWith('+') ? phone.slice(1) : phone,
|
|
145
|
+
clientTimezone: getUserTimezoneOffset(),
|
|
146
|
+
};
|
|
147
|
+
};
|
package/src/api/getSubmitBody.ts
CHANGED
|
@@ -24,6 +24,7 @@ export const getSubmitBody = (body: LeadRequest, isNaturalPerson: boolean, route
|
|
|
24
24
|
bankEmpolee,
|
|
25
25
|
applicationDate,
|
|
26
26
|
partnerName,
|
|
27
|
+
russianPhone,
|
|
27
28
|
...staticBody
|
|
28
29
|
} = body;
|
|
29
30
|
|
|
@@ -32,6 +33,7 @@ export const getSubmitBody = (body: LeadRequest, isNaturalPerson: boolean, route
|
|
|
32
33
|
...getRegion(region, isNaturalPerson),
|
|
33
34
|
...getEmail(email, isNaturalPerson),
|
|
34
35
|
...getPhone(phone),
|
|
36
|
+
...getPhone(russianPhone),
|
|
35
37
|
...getFormatDate(desiredMeetingDate as string, 'desiredMeetingDate'),
|
|
36
38
|
...(isNaturalPerson ? getFormatDate(birthday as string) : { inn }),
|
|
37
39
|
...(typeForm === 'FEEDBACK'
|
|
@@ -1,45 +1,43 @@
|
|
|
1
1
|
import { useCallback, useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
-
import { LeadServiceAPI } from '../../api/LeadServiceAPI';
|
|
3
2
|
import { useRouter } from '../../external/useRouter';
|
|
4
|
-
import { handleAspects } from '../../hooks/useAspects/handleAspects';
|
|
5
3
|
import { useAspects } from '../../hooks/useAspects/useAspects';
|
|
6
|
-
import { useForm
|
|
7
|
-
import { type FormTypeFieldDef } from '../../model/FormTypeFieldDef';
|
|
8
|
-
import { type SectionsProps } from '../../model/InputSectionsType';
|
|
4
|
+
import { useForm } from '../../hooks/useForm/useForm';
|
|
9
5
|
import { ApplicationFormLayout } from '../../ui-kit/ApplicationFormLayout/ApplicationFormLayout';
|
|
10
6
|
import { useDialog } from '../../ui-kit/DialogManager/useDialog';
|
|
11
7
|
import { getConsentDataProcessing } from '../../ui-kit/FormField/getConsentDataProcessing';
|
|
12
|
-
import { getField } from '../../ui-kit/FormField/getField';
|
|
13
8
|
import { getFormValidator } from '../../ui-kit/FormField/getObjectValidator';
|
|
14
|
-
import { inputColumnStyles } from '../../ui-kit/FormField/inputColumnStyle';
|
|
15
|
-
import { renderTitle } from '../../ui-kit/FormField/renderTitle';
|
|
16
9
|
import { type PreventableEventWithTarget } from '../../ui-kit/PreventableEvent';
|
|
17
10
|
import { ResponseTypeDialog } from '../../ui-kit/ResponseTypeDialog/ResponseTypeDialog';
|
|
18
11
|
import { UniBlock } from '../../UniBlock/UniBlock';
|
|
19
12
|
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
20
13
|
import { style } from '../../utils/style';
|
|
21
|
-
import {
|
|
22
|
-
type additionalParamsType,
|
|
23
|
-
type ApplicationFormContent,
|
|
24
|
-
type FieldDef,
|
|
25
|
-
} from './ApplicationFormContent';
|
|
14
|
+
import { type ApplicationFormContent, type FieldDef } from './ApplicationFormContent';
|
|
26
15
|
import { getFormatData } from './getFormatData';
|
|
27
16
|
import { getInitialFormState, type FormState } from './getInitialFormState';
|
|
17
|
+
import {
|
|
18
|
+
handleCallback,
|
|
19
|
+
handleDefault,
|
|
20
|
+
handleInitCorporateLead,
|
|
21
|
+
type HandlerProps,
|
|
22
|
+
} from './handlers';
|
|
28
23
|
import { renderAgreementSubmit } from './renderAgreementSubmit';
|
|
29
24
|
import { renderContacts } from './renderContacts';
|
|
25
|
+
import { renderSections } from './renderSections';
|
|
30
26
|
import { VerifyPhoneDialog } from './VerifyPhoneDialog';
|
|
31
27
|
|
|
32
|
-
export interface ApplicationFormProps extends ApplicationFormContent, UniBlockProps {
|
|
28
|
+
export interface ApplicationFormProps extends ApplicationFormContent, UniBlockProps {
|
|
29
|
+
onSuccess?: () => void;
|
|
30
|
+
}
|
|
33
31
|
|
|
34
|
-
type
|
|
35
|
-
typeForm: FormTypeFieldDef;
|
|
36
|
-
additionalParams?: additionalParamsType;
|
|
37
|
-
};
|
|
32
|
+
type Handler = (context: HandlerProps) => Promise<void>;
|
|
38
33
|
|
|
39
|
-
const
|
|
34
|
+
const handlerMap: Record<string, Handler> = {
|
|
35
|
+
initcorporatelead: handleInitCorporateLead,
|
|
36
|
+
callback: handleCallback,
|
|
37
|
+
default: handleDefault,
|
|
38
|
+
};
|
|
40
39
|
|
|
41
40
|
export const ApplicationForm = UniBlock<ApplicationFormProps>(
|
|
42
|
-
// eslint-disable-next-line max-lines-per-function
|
|
43
41
|
({
|
|
44
42
|
className,
|
|
45
43
|
title,
|
|
@@ -51,6 +49,7 @@ export const ApplicationForm = UniBlock<ApplicationFormProps>(
|
|
|
51
49
|
additionalParams,
|
|
52
50
|
isContacts,
|
|
53
51
|
data,
|
|
52
|
+
onSuccess,
|
|
54
53
|
...rest
|
|
55
54
|
}) => {
|
|
56
55
|
const inputs = useMemo(
|
|
@@ -71,35 +70,17 @@ export const ApplicationForm = UniBlock<ApplicationFormProps>(
|
|
|
71
70
|
async (formData: FormState, ev: PreventableEventWithTarget) => {
|
|
72
71
|
const formatData = getFormatData({ ...formData, ...additionalParams });
|
|
73
72
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
verifyPhoneDialog.open({
|
|
86
|
-
phone,
|
|
87
|
-
formatData,
|
|
88
|
-
reqId: String(response),
|
|
89
|
-
onSuccess: () => {
|
|
90
|
-
verifyPhoneDialog.close();
|
|
91
|
-
responseTypeDialog.open({ ok: true, typeForm });
|
|
92
|
-
handleAspects({ aspectsAttributes: data, aspects, ev });
|
|
93
|
-
},
|
|
94
|
-
});
|
|
95
|
-
} else {
|
|
96
|
-
const ok = Boolean(await API.send(formatData, router, endpoint === 'lead'));
|
|
97
|
-
|
|
98
|
-
responseTypeDialog.open({ ok, typeForm });
|
|
99
|
-
if (ok) {
|
|
100
|
-
handleAspects({ aspectsAttributes: data, aspects, ev });
|
|
101
|
-
}
|
|
102
|
-
}
|
|
73
|
+
await executeHandler(endpoint ?? 'default', {
|
|
74
|
+
formatData,
|
|
75
|
+
ev,
|
|
76
|
+
typeForm,
|
|
77
|
+
data,
|
|
78
|
+
aspects,
|
|
79
|
+
router,
|
|
80
|
+
responseTypeDialog,
|
|
81
|
+
verifyPhoneDialog,
|
|
82
|
+
onSuccess,
|
|
83
|
+
});
|
|
103
84
|
},
|
|
104
85
|
[typeForm],
|
|
105
86
|
);
|
|
@@ -133,14 +114,7 @@ export const ApplicationForm = UniBlock<ApplicationFormProps>(
|
|
|
133
114
|
},
|
|
134
115
|
);
|
|
135
116
|
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
) =>
|
|
141
|
-
sections.map((_, i) => (
|
|
142
|
-
<div key={`section-${i}`} className={style(inputColumnStyles(_.columns), 'grid')}>
|
|
143
|
-
{renderTitle(_.title)}
|
|
144
|
-
{(_?.inputs || [])?.map(getField<FieldDef>(field, { typeForm, ...additionalParams }))}
|
|
145
|
-
</div>
|
|
146
|
-
));
|
|
117
|
+
const executeHandler = async (endpoint: string, context: HandlerProps): Promise<void> => {
|
|
118
|
+
const handler = handlerMap[endpoint] || handlerMap.default;
|
|
119
|
+
await handler(context);
|
|
120
|
+
};
|
|
@@ -43,7 +43,7 @@ export type FieldDef = Required &
|
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
/** @hidden */
|
|
46
|
-
export type EndpointType = 'lead' | 'initcorporatelead' | 'sendcorporatelead';
|
|
46
|
+
export type EndpointType = 'lead' | 'initcorporatelead' | 'sendcorporatelead' | 'callback';
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
49
|
* @title Секция полей ввода
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { LeadServiceAPI, type LeadRequest } from '../../api/LeadServiceAPI';
|
|
2
|
+
import { type Router } from '../../external/useRouter';
|
|
3
|
+
import { handleAspects } from '../../hooks/useAspects/handleAspects';
|
|
4
|
+
import { type Aspects } from '../../hooks/useAspects/useAspects';
|
|
5
|
+
import { type AspectsDef } from '../../model/AspectsProps';
|
|
6
|
+
import { type PreventableEventWithTarget } from '../../ui-kit/PreventableEvent';
|
|
7
|
+
import { noop } from '../../utils/noop';
|
|
8
|
+
|
|
9
|
+
export type HandlerProps = {
|
|
10
|
+
formatData: LeadRequest;
|
|
11
|
+
data?: AspectsDef[];
|
|
12
|
+
aspects?: Aspects;
|
|
13
|
+
ev: PreventableEventWithTarget;
|
|
14
|
+
typeForm?: string;
|
|
15
|
+
router: Router;
|
|
16
|
+
verifyPhoneDialog?: any;
|
|
17
|
+
responseTypeDialog?: any;
|
|
18
|
+
onSuccess?: () => void;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const API = LeadServiceAPI();
|
|
22
|
+
|
|
23
|
+
export const handleInitCorporateLead = async ({
|
|
24
|
+
formatData = {},
|
|
25
|
+
typeForm,
|
|
26
|
+
responseTypeDialog,
|
|
27
|
+
verifyPhoneDialog,
|
|
28
|
+
data = [],
|
|
29
|
+
aspects = {},
|
|
30
|
+
ev,
|
|
31
|
+
}: HandlerProps) => {
|
|
32
|
+
const { phone } = formatData;
|
|
33
|
+
|
|
34
|
+
const response = await API.sendCode({ phone: String(phone) });
|
|
35
|
+
|
|
36
|
+
if (!response) {
|
|
37
|
+
responseTypeDialog.open({ ok: Boolean(response), typeForm });
|
|
38
|
+
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
verifyPhoneDialog.open({
|
|
43
|
+
phone,
|
|
44
|
+
formatData,
|
|
45
|
+
reqId: String(response),
|
|
46
|
+
onSuccess: () => {
|
|
47
|
+
verifyPhoneDialog.close();
|
|
48
|
+
responseTypeDialog.open({ ok: true, typeForm });
|
|
49
|
+
handleAspects({ aspectsAttributes: data, aspects, ev });
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const handleCallback = async ({
|
|
55
|
+
formatData,
|
|
56
|
+
data,
|
|
57
|
+
aspects = {},
|
|
58
|
+
ev,
|
|
59
|
+
typeForm,
|
|
60
|
+
responseTypeDialog,
|
|
61
|
+
onSuccess = noop,
|
|
62
|
+
}: HandlerProps) => {
|
|
63
|
+
const response = await API.sendPhoneCallRequest(formatData);
|
|
64
|
+
|
|
65
|
+
onSuccess();
|
|
66
|
+
|
|
67
|
+
if (response?.status === 'success') {
|
|
68
|
+
responseTypeDialog.open({ ok: true, typeForm });
|
|
69
|
+
handleAspects({ aspectsAttributes: data, aspects, ev });
|
|
70
|
+
} else if (response?.status === 'error') {
|
|
71
|
+
responseTypeDialog.open({
|
|
72
|
+
ok: false,
|
|
73
|
+
errorMessage: 'Ваша заявка уже в работе. Дождитесь звонка от сотрудника Банка',
|
|
74
|
+
});
|
|
75
|
+
} else {
|
|
76
|
+
responseTypeDialog.open({ ok: Boolean(response) });
|
|
77
|
+
if (response) {
|
|
78
|
+
handleAspects({ aspectsAttributes: data, aspects, ev });
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export const handleDefault = async ({
|
|
84
|
+
formatData,
|
|
85
|
+
data,
|
|
86
|
+
aspects = {},
|
|
87
|
+
ev,
|
|
88
|
+
router,
|
|
89
|
+
responseTypeDialog,
|
|
90
|
+
}: HandlerProps) => {
|
|
91
|
+
const ok = Boolean(await API.send(formatData, router, false)); // или проверять endpoint === 'lead'
|
|
92
|
+
|
|
93
|
+
responseTypeDialog.open({ ok });
|
|
94
|
+
if (ok) {
|
|
95
|
+
handleAspects({ aspectsAttributes: data, aspects, ev });
|
|
96
|
+
}
|
|
97
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { FormFieldRegisterer } from '../../hooks/useForm/useForm';
|
|
2
|
+
import type { FormTypeFieldDef } from '../../model/FormTypeFieldDef';
|
|
3
|
+
import type { SectionsProps } from '../../model/InputSectionsType';
|
|
4
|
+
import { getField } from '../../ui-kit/FormField/getField';
|
|
5
|
+
import { inputColumnStyles } from '../../ui-kit/FormField/inputColumnStyle';
|
|
6
|
+
import { renderTitle } from '../../ui-kit/FormField/renderTitle';
|
|
7
|
+
import { style } from '../../utils/style';
|
|
8
|
+
import type { additionalParamsType, FieldDef } from './ApplicationFormContent';
|
|
9
|
+
|
|
10
|
+
type renderSectionsType = {
|
|
11
|
+
typeForm: FormTypeFieldDef;
|
|
12
|
+
additionalParams?: additionalParamsType;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const renderSections = (
|
|
16
|
+
sections: SectionsProps[],
|
|
17
|
+
field: FormFieldRegisterer<Record<string, any>>,
|
|
18
|
+
{ typeForm, additionalParams }: renderSectionsType,
|
|
19
|
+
) =>
|
|
20
|
+
sections.map((_, i) => (
|
|
21
|
+
<div key={`section-${i}`} className={style(inputColumnStyles(_.columns), 'grid')}>
|
|
22
|
+
{renderTitle(_.title)}
|
|
23
|
+
{(_?.inputs || [])?.map(getField<FieldDef>(field, { typeForm, ...additionalParams }))}
|
|
24
|
+
</div>
|
|
25
|
+
));
|
|
@@ -1,31 +1,55 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useLink } from '../../hooks/useLink';
|
|
3
|
+
import { useMobileMode } from '../../hooks/useMobileMode';
|
|
3
4
|
import { type ComponentType } from '../../model/ComponentType';
|
|
4
5
|
import { type LinkProps } from '../../model/LinkProps';
|
|
6
|
+
import { type PreventableEventWithTarget } from '../../ui-kit/PreventableEvent';
|
|
5
7
|
import { getAspectsAttributes } from '../../utils/dataAttributes';
|
|
6
8
|
import { style } from '../../utils/style';
|
|
7
9
|
|
|
8
|
-
interface DropdownMenuProps extends ComponentType {
|
|
10
|
+
export interface DropdownMenuProps extends ComponentType {
|
|
9
11
|
dropdownRef?: { current: HTMLDivElement | null };
|
|
10
12
|
items?: LinkProps[];
|
|
11
13
|
activeItem?: LinkProps;
|
|
12
14
|
ariaLabel?: string;
|
|
15
|
+
renderDropdownItem?: ({ item, i, activeItem, handlers }: renderDropdownItemProps) => void;
|
|
16
|
+
handlers?: Record<string, (ev?: PreventableEventWithTarget) => void>;
|
|
17
|
+
onItemClick?: () => void;
|
|
13
18
|
}
|
|
14
19
|
|
|
20
|
+
export type renderDropdownItemProps = {
|
|
21
|
+
item?: LinkProps;
|
|
22
|
+
i?: number;
|
|
23
|
+
activeItem?: LinkProps;
|
|
24
|
+
handlers?: Record<string, (ev?: PreventableEventWithTarget) => void>;
|
|
25
|
+
closeDropdown?: () => void;
|
|
26
|
+
};
|
|
27
|
+
|
|
15
28
|
export const DropdownMenu = ({
|
|
16
29
|
dropdownRef,
|
|
17
30
|
items = [],
|
|
18
31
|
activeItem,
|
|
19
32
|
ariaLabel,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
33
|
+
renderDropdownItem = renderDefaultDropdownItem,
|
|
34
|
+
handlers,
|
|
35
|
+
onItemClick,
|
|
36
|
+
}: DropdownMenuProps) => {
|
|
37
|
+
const isMobileMode = useMobileMode();
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<div
|
|
41
|
+
ref={dropdownRef}
|
|
42
|
+
className={style('absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56 z-40', {
|
|
43
|
+
'max-w-max': isMobileMode,
|
|
44
|
+
})}
|
|
45
|
+
aria-label={ariaLabel}
|
|
46
|
+
>
|
|
47
|
+
{items?.map((item, i) =>
|
|
48
|
+
renderDropdownItem({ item, i, activeItem, handlers, closeDropdown: onItemClick }),
|
|
49
|
+
)}
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
29
53
|
|
|
30
54
|
export const DropdownMenuItem = JSX<LinkProps & { isActive?: boolean }>(({ isActive, ...rest }) => {
|
|
31
55
|
const link = useLink();
|
|
@@ -48,7 +72,6 @@ export const DropdownMenuItem = JSX<LinkProps & { isActive?: boolean }>(({ isAct
|
|
|
48
72
|
);
|
|
49
73
|
});
|
|
50
74
|
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
));
|
|
75
|
+
const renderDefaultDropdownItem = ({ item, i, activeItem }: renderDropdownItemProps) => (
|
|
76
|
+
<DropdownMenuItem key={item?.text ?? String(i)} isActive={item === activeItem} {...item} />
|
|
77
|
+
);
|
|
@@ -2,6 +2,7 @@ import '../../setup-fixture';
|
|
|
2
2
|
|
|
3
3
|
import { type BlockRendererOptions } from '../../BlockRenderer/BlockRendererOptions';
|
|
4
4
|
import { DialogManager } from '../../ui-kit/DialogManager/DialogManager';
|
|
5
|
+
import { PopupManager } from '../../ui-kit/PopupManager/PopupManager';
|
|
5
6
|
import { Header } from './Header';
|
|
6
7
|
import { type HeaderProps } from './HeaderProps';
|
|
7
8
|
|
|
@@ -22,6 +23,7 @@ export default {
|
|
|
22
23
|
<div>
|
|
23
24
|
<Header options={options} {...props} />
|
|
24
25
|
<DialogManager />
|
|
26
|
+
<PopupManager />
|
|
25
27
|
</div>
|
|
26
28
|
),
|
|
27
29
|
transparent: (
|