@redneckz/wildless-cms-uni-blocks 0.14.594 → 0.14.596
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/EventBus/EventBus.d.ts +17 -4
- package/bundle/EventBus/defaultEventBus.d.ts +2 -13
- package/bundle/EventBus/useSubject.d.ts +2 -0
- package/bundle/EventBus/useSubjectState.d.ts +2 -0
- package/bundle/bundle.umd.js +148 -105
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/CarouselTariffsCard/CardCellsSection.d.ts +9 -0
- package/bundle/components/CarouselTariffsCard/carouselTariffsCardEventBus.d.ts +9 -0
- package/bundle/hooks/useLocation.d.ts +2 -1
- package/bundle/hooks/useReducer.d.ts +4 -0
- package/bundle/model/DefaultControlType.d.ts +7 -0
- package/bundle/ui-kit/DatePicker/DatePickerControl.d.ts +3 -7
- package/bundle/ui-kit/Foldable/Foldable.d.ts +11 -1
- package/bundle/ui-kit/Input/InputProps.d.ts +2 -6
- package/bundle/ui-kit/LocationDialog/SelectedLocation.d.ts +5 -0
- package/bundle/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +3 -5
- package/bundle/ui-kit/RadioButtonGroup/RadioButtonGroupControl.d.ts +2 -0
- package/bundle/ui-kit/Select/Select.d.ts +4 -7
- package/bundle/ui-kit/Select/SelectControl.d.ts +1 -8
- package/bundle/utils/getRequiredLabel.d.ts +2 -0
- package/dist/EventBus/EventBus.d.ts +17 -4
- package/dist/EventBus/EventBus.js +29 -10
- package/dist/EventBus/EventBus.js.map +1 -1
- package/dist/EventBus/defaultEventBus.d.ts +2 -13
- package/dist/EventBus/defaultEventBus.js.map +1 -1
- package/dist/EventBus/useSubject.d.ts +2 -0
- package/dist/EventBus/useSubject.js +17 -0
- package/dist/EventBus/useSubject.js.map +1 -0
- package/dist/EventBus/useSubjectState.d.ts +2 -0
- package/dist/EventBus/useSubjectState.js +10 -0
- package/dist/EventBus/useSubjectState.js.map +1 -0
- package/dist/components/CarouselTariffsCard/CardCellsSection.d.ts +9 -0
- package/dist/components/CarouselTariffsCard/CardCellsSection.js +18 -0
- package/dist/components/CarouselTariffsCard/CardCellsSection.js.map +1 -0
- package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +11 -25
- package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/dist/components/CarouselTariffsCard/carouselTariffsCardEventBus.d.ts +9 -0
- package/dist/components/CarouselTariffsCard/carouselTariffsCardEventBus.js +5 -0
- package/dist/components/CarouselTariffsCard/carouselTariffsCardEventBus.js.map +1 -0
- package/dist/components/ExchangeRateTile/ExchangeRateTile.js +1 -1
- package/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
- package/dist/components/Header/HeaderSecondaryMenu.js +1 -1
- package/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/dist/components/OfficesAtmsMap/AtmsMap.js +1 -1
- package/dist/components/OfficesAtmsMap/AtmsMap.js.map +1 -1
- package/dist/components/OfficesAtmsMap/OfficesMap.js +1 -1
- package/dist/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
- package/dist/components/StickyBottomMenu/BurgerMenuDialog.js +1 -1
- package/dist/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
- package/dist/hooks/useLocation.d.ts +2 -1
- package/dist/hooks/useLocation.js +27 -33
- package/dist/hooks/useLocation.js.map +1 -1
- package/dist/hooks/useReducer.d.ts +4 -0
- package/dist/hooks/useReducer.js +12 -0
- package/dist/hooks/useReducer.js.map +1 -0
- package/dist/hooks/useRegions.js +3 -1
- package/dist/hooks/useRegions.js.map +1 -1
- package/dist/model/DefaultControlType.d.ts +7 -0
- package/dist/{components/CarouselTariffsCard/CarouselTariffsCardAction.js → model/DefaultControlType.js} +1 -1
- package/dist/model/DefaultControlType.js.map +1 -0
- package/dist/ui-kit/Calculator/renderBinaryRadioButtonGroup.js +1 -1
- package/dist/ui-kit/Calculator/renderBinaryRadioButtonGroup.js.map +1 -1
- package/dist/ui-kit/DatePicker/DatePickerControl.d.ts +3 -7
- package/dist/ui-kit/DatePicker/DatePickerControl.js +2 -1
- package/dist/ui-kit/DatePicker/DatePickerControl.js.map +1 -1
- package/dist/ui-kit/DialogManager/useDialogManager.js +3 -3
- package/dist/ui-kit/DialogManager/useDialogManager.js.map +1 -1
- package/dist/ui-kit/DialogManager/useDialogsList.js +1 -1
- package/dist/ui-kit/DialogManager/useDialogsList.js.map +1 -1
- package/dist/ui-kit/Foldable/Foldable.d.ts +11 -1
- package/dist/ui-kit/Foldable/Foldable.js +10 -2
- package/dist/ui-kit/Foldable/Foldable.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/SexField.js +5 -4
- package/dist/ui-kit/FormField/Fields/SexField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/VedField.js +1 -1
- package/dist/ui-kit/FormField/Fields/VedField.js.map +1 -1
- package/dist/ui-kit/FormField/constants.js +1 -0
- package/dist/ui-kit/FormField/constants.js.map +1 -1
- package/dist/ui-kit/FormField/getValidation.js +1 -0
- package/dist/ui-kit/FormField/getValidation.js.map +1 -1
- package/dist/ui-kit/Input/InputControl.js +2 -2
- package/dist/ui-kit/Input/InputControl.js.map +1 -1
- package/dist/ui-kit/Input/InputPhoneControl.js +2 -1
- package/dist/ui-kit/Input/InputPhoneControl.js.map +1 -1
- package/dist/ui-kit/Input/InputProps.d.ts +2 -6
- package/dist/ui-kit/Input/InputSnilsControl.js +2 -1
- package/dist/ui-kit/Input/InputSnilsControl.js.map +1 -1
- package/dist/ui-kit/LocationDialog/LocationDialog.js +9 -12
- package/dist/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
- package/dist/ui-kit/LocationDialog/SelectedLocation.d.ts +5 -0
- package/dist/ui-kit/LocationDialog/SelectedLocation.js +15 -0
- package/dist/ui-kit/LocationDialog/SelectedLocation.js.map +1 -0
- package/dist/ui-kit/PopupManager/PopupManager.js +1 -1
- package/dist/ui-kit/PopupManager/PopupManager.js.map +1 -1
- package/dist/ui-kit/PopupManager/usePopupManager.js +3 -3
- package/dist/ui-kit/PopupManager/usePopupManager.js.map +1 -1
- package/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +3 -5
- package/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.js +1 -1
- package/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
- package/dist/ui-kit/RadioButtonGroup/RadioButtonGroupControl.d.ts +2 -0
- package/dist/ui-kit/RadioButtonGroup/RadioButtonGroupControl.js +10 -0
- package/dist/ui-kit/RadioButtonGroup/RadioButtonGroupControl.js.map +1 -0
- package/dist/ui-kit/Select/Select.d.ts +4 -7
- package/dist/ui-kit/Select/Select.js +3 -4
- package/dist/ui-kit/Select/Select.js.map +1 -1
- package/dist/ui-kit/Select/SelectControl.d.ts +1 -8
- package/dist/ui-kit/Select/SelectControl.js +2 -1
- package/dist/ui-kit/Select/SelectControl.js.map +1 -1
- package/dist/utils/getRequiredLabel.d.ts +2 -0
- package/dist/utils/getRequiredLabel.js +5 -0
- package/dist/utils/getRequiredLabel.js.map +1 -0
- package/lib/EventBus/EventBus.d.ts +17 -4
- package/lib/EventBus/EventBus.js +29 -10
- package/lib/EventBus/EventBus.js.map +1 -1
- package/lib/EventBus/defaultEventBus.d.ts +2 -13
- package/lib/EventBus/defaultEventBus.js.map +1 -1
- package/lib/EventBus/useSubject.d.ts +2 -0
- package/lib/EventBus/useSubject.js +14 -0
- package/lib/EventBus/useSubject.js.map +1 -0
- package/lib/EventBus/useSubjectState.d.ts +2 -0
- package/lib/EventBus/useSubjectState.js +7 -0
- package/lib/EventBus/useSubjectState.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/CarouselTariffsCard/CardCellsSection.d.ts +9 -0
- package/lib/components/CarouselTariffsCard/CardCellsSection.js +16 -0
- package/lib/components/CarouselTariffsCard/CardCellsSection.js.map +1 -0
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +12 -26
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/lib/components/CarouselTariffsCard/carouselTariffsCardEventBus.d.ts +9 -0
- package/lib/components/CarouselTariffsCard/carouselTariffsCardEventBus.js +3 -0
- package/lib/components/CarouselTariffsCard/carouselTariffsCardEventBus.js.map +1 -0
- package/lib/components/ExchangeRateTile/ExchangeRateTile.js +2 -2
- package/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
- package/lib/components/Header/HeaderSecondaryMenu.js +2 -2
- package/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/lib/components/OfficesAtmsMap/AtmsMap.js +2 -2
- package/lib/components/OfficesAtmsMap/AtmsMap.js.map +1 -1
- package/lib/components/OfficesAtmsMap/OfficesMap.js +2 -2
- package/lib/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
- package/lib/components/StickyBottomMenu/BurgerMenuDialog.js +2 -2
- package/lib/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
- package/lib/hooks/useLocation.d.ts +2 -1
- package/lib/hooks/useLocation.js +26 -33
- package/lib/hooks/useLocation.js.map +1 -1
- package/lib/hooks/useReducer.d.ts +4 -0
- package/lib/hooks/useReducer.js +9 -0
- package/lib/hooks/useReducer.js.map +1 -0
- package/lib/hooks/useRegions.js +3 -1
- package/lib/hooks/useRegions.js.map +1 -1
- package/lib/model/DefaultControlType.d.ts +7 -0
- package/lib/model/DefaultControlType.js +2 -0
- package/lib/model/DefaultControlType.js.map +1 -0
- package/lib/ui-kit/Calculator/renderBinaryRadioButtonGroup.js +1 -1
- package/lib/ui-kit/Calculator/renderBinaryRadioButtonGroup.js.map +1 -1
- package/lib/ui-kit/DatePicker/DatePickerControl.d.ts +3 -7
- package/lib/ui-kit/DatePicker/DatePickerControl.js +2 -1
- package/lib/ui-kit/DatePicker/DatePickerControl.js.map +1 -1
- package/lib/ui-kit/DialogManager/useDialogManager.js +3 -3
- package/lib/ui-kit/DialogManager/useDialogManager.js.map +1 -1
- package/lib/ui-kit/DialogManager/useDialogsList.js +1 -1
- package/lib/ui-kit/DialogManager/useDialogsList.js.map +1 -1
- package/lib/ui-kit/Foldable/Foldable.d.ts +11 -1
- package/lib/ui-kit/Foldable/Foldable.js +10 -2
- package/lib/ui-kit/Foldable/Foldable.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/SexField.js +5 -4
- package/lib/ui-kit/FormField/Fields/SexField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/VedField.js +1 -1
- package/lib/ui-kit/FormField/Fields/VedField.js.map +1 -1
- package/lib/ui-kit/FormField/constants.js +1 -0
- package/lib/ui-kit/FormField/constants.js.map +1 -1
- package/lib/ui-kit/FormField/getValidation.js +1 -0
- package/lib/ui-kit/FormField/getValidation.js.map +1 -1
- package/lib/ui-kit/Input/InputControl.js +2 -2
- package/lib/ui-kit/Input/InputControl.js.map +1 -1
- package/lib/ui-kit/Input/InputPhoneControl.js +2 -1
- package/lib/ui-kit/Input/InputPhoneControl.js.map +1 -1
- package/lib/ui-kit/Input/InputProps.d.ts +2 -6
- package/lib/ui-kit/Input/InputSnilsControl.js +2 -1
- package/lib/ui-kit/Input/InputSnilsControl.js.map +1 -1
- package/lib/ui-kit/LocationDialog/LocationDialog.js +10 -13
- package/lib/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
- package/lib/ui-kit/LocationDialog/SelectedLocation.d.ts +5 -0
- package/lib/ui-kit/LocationDialog/SelectedLocation.js +13 -0
- package/lib/ui-kit/LocationDialog/SelectedLocation.js.map +1 -0
- package/lib/ui-kit/PopupManager/PopupManager.js +1 -1
- package/lib/ui-kit/PopupManager/PopupManager.js.map +1 -1
- package/lib/ui-kit/PopupManager/usePopupManager.js +3 -3
- package/lib/ui-kit/PopupManager/usePopupManager.js.map +1 -1
- package/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +3 -5
- package/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.js +1 -1
- package/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
- package/lib/ui-kit/RadioButtonGroup/RadioButtonGroupControl.d.ts +2 -0
- package/lib/ui-kit/RadioButtonGroup/RadioButtonGroupControl.js +8 -0
- package/lib/ui-kit/RadioButtonGroup/RadioButtonGroupControl.js.map +1 -0
- package/lib/ui-kit/Select/Select.d.ts +4 -7
- package/lib/ui-kit/Select/Select.js +3 -4
- package/lib/ui-kit/Select/Select.js.map +1 -1
- package/lib/ui-kit/Select/SelectControl.d.ts +1 -8
- package/lib/ui-kit/Select/SelectControl.js +2 -1
- package/lib/ui-kit/Select/SelectControl.js.map +1 -1
- package/lib/utils/getRequiredLabel.d.ts +2 -0
- package/lib/utils/getRequiredLabel.js +2 -0
- package/lib/utils/getRequiredLabel.js.map +1 -0
- package/mobile/bundle/EventBus/EventBus.d.ts +17 -4
- package/mobile/bundle/EventBus/defaultEventBus.d.ts +2 -13
- package/mobile/bundle/EventBus/useSubject.d.ts +2 -0
- package/mobile/bundle/EventBus/useSubjectState.d.ts +2 -0
- package/mobile/bundle/bundle.umd.js +148 -105
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/CarouselTariffsCard/CardCellsSection.d.ts +9 -0
- package/mobile/bundle/components/CarouselTariffsCard/carouselTariffsCardEventBus.d.ts +9 -0
- package/mobile/bundle/hooks/useLocation.d.ts +2 -1
- package/mobile/bundle/hooks/useReducer.d.ts +4 -0
- package/mobile/bundle/model/DefaultControlType.d.ts +7 -0
- package/mobile/bundle/ui-kit/DatePicker/DatePickerControl.d.ts +3 -7
- package/mobile/bundle/ui-kit/Foldable/Foldable.d.ts +11 -1
- package/mobile/bundle/ui-kit/Input/InputProps.d.ts +2 -6
- package/mobile/bundle/ui-kit/LocationDialog/SelectedLocation.d.ts +5 -0
- package/mobile/bundle/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +3 -5
- package/mobile/bundle/ui-kit/RadioButtonGroup/RadioButtonGroupControl.d.ts +2 -0
- package/mobile/bundle/ui-kit/Select/Select.d.ts +4 -7
- package/mobile/bundle/ui-kit/Select/SelectControl.d.ts +1 -8
- package/mobile/bundle/utils/getRequiredLabel.d.ts +2 -0
- package/mobile/dist/EventBus/EventBus.d.ts +17 -4
- package/mobile/dist/EventBus/EventBus.js +29 -10
- package/mobile/dist/EventBus/EventBus.js.map +1 -1
- package/mobile/dist/EventBus/defaultEventBus.d.ts +2 -13
- package/mobile/dist/EventBus/defaultEventBus.js.map +1 -1
- package/mobile/dist/EventBus/useSubject.d.ts +2 -0
- package/mobile/dist/EventBus/useSubject.js +17 -0
- package/mobile/dist/EventBus/useSubject.js.map +1 -0
- package/mobile/dist/EventBus/useSubjectState.d.ts +2 -0
- package/mobile/dist/EventBus/useSubjectState.js +10 -0
- package/mobile/dist/EventBus/useSubjectState.js.map +1 -0
- package/mobile/dist/components/CarouselTariffsCard/CardCellsSection.d.ts +9 -0
- package/mobile/dist/components/CarouselTariffsCard/CardCellsSection.js +18 -0
- package/mobile/dist/components/CarouselTariffsCard/CardCellsSection.js.map +1 -0
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +11 -25
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/mobile/dist/components/CarouselTariffsCard/carouselTariffsCardEventBus.d.ts +9 -0
- package/mobile/dist/components/CarouselTariffsCard/carouselTariffsCardEventBus.js +5 -0
- package/mobile/dist/components/CarouselTariffsCard/carouselTariffsCardEventBus.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js +1 -1
- package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
- package/mobile/dist/components/Header/HeaderSecondaryMenu.js +1 -1
- package/mobile/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/AtmsMap.js +1 -1
- package/mobile/dist/components/OfficesAtmsMap/AtmsMap.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/OfficesMap.js +1 -1
- package/mobile/dist/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/BurgerMenuDialog.js +1 -1
- package/mobile/dist/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
- package/mobile/dist/hooks/useLocation.d.ts +2 -1
- package/mobile/dist/hooks/useLocation.js +27 -33
- package/mobile/dist/hooks/useLocation.js.map +1 -1
- package/mobile/dist/hooks/useReducer.d.ts +4 -0
- package/mobile/dist/hooks/useReducer.js +12 -0
- package/mobile/dist/hooks/useReducer.js.map +1 -0
- package/mobile/dist/hooks/useRegions.js +3 -1
- package/mobile/dist/hooks/useRegions.js.map +1 -1
- package/mobile/dist/model/DefaultControlType.d.ts +7 -0
- package/mobile/dist/{components/CarouselTariffsCard/CarouselTariffsCardAction.js → model/DefaultControlType.js} +1 -1
- package/mobile/dist/model/DefaultControlType.js.map +1 -0
- package/mobile/dist/ui-kit/Calculator/renderBinaryRadioButtonGroup.js +1 -1
- package/mobile/dist/ui-kit/Calculator/renderBinaryRadioButtonGroup.js.map +1 -1
- package/mobile/dist/ui-kit/DatePicker/DatePickerControl.d.ts +3 -7
- package/mobile/dist/ui-kit/DatePicker/DatePickerControl.js +2 -1
- package/mobile/dist/ui-kit/DatePicker/DatePickerControl.js.map +1 -1
- package/mobile/dist/ui-kit/DialogManager/useDialogManager.js +3 -3
- package/mobile/dist/ui-kit/DialogManager/useDialogManager.js.map +1 -1
- package/mobile/dist/ui-kit/DialogManager/useDialogsList.js +1 -1
- package/mobile/dist/ui-kit/DialogManager/useDialogsList.js.map +1 -1
- package/mobile/dist/ui-kit/Foldable/Foldable.d.ts +11 -1
- package/mobile/dist/ui-kit/Foldable/Foldable.js +10 -2
- package/mobile/dist/ui-kit/Foldable/Foldable.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/SexField.js +5 -4
- package/mobile/dist/ui-kit/FormField/Fields/SexField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/VedField.js +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/VedField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/constants.js +1 -0
- package/mobile/dist/ui-kit/FormField/constants.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/getValidation.js +1 -0
- package/mobile/dist/ui-kit/FormField/getValidation.js.map +1 -1
- package/mobile/dist/ui-kit/Input/InputControl.js +2 -2
- package/mobile/dist/ui-kit/Input/InputControl.js.map +1 -1
- package/mobile/dist/ui-kit/Input/InputPhoneControl.js +2 -1
- package/mobile/dist/ui-kit/Input/InputPhoneControl.js.map +1 -1
- package/mobile/dist/ui-kit/Input/InputProps.d.ts +2 -6
- package/mobile/dist/ui-kit/Input/InputSnilsControl.js +2 -1
- package/mobile/dist/ui-kit/Input/InputSnilsControl.js.map +1 -1
- package/mobile/dist/ui-kit/LocationDialog/LocationDialog.js +9 -12
- package/mobile/dist/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
- package/mobile/dist/ui-kit/LocationDialog/SelectedLocation.d.ts +5 -0
- package/mobile/dist/ui-kit/LocationDialog/SelectedLocation.js +15 -0
- package/mobile/dist/ui-kit/LocationDialog/SelectedLocation.js.map +1 -0
- package/mobile/dist/ui-kit/PopupManager/PopupManager.js +1 -1
- package/mobile/dist/ui-kit/PopupManager/PopupManager.js.map +1 -1
- package/mobile/dist/ui-kit/PopupManager/usePopupManager.js +3 -3
- package/mobile/dist/ui-kit/PopupManager/usePopupManager.js.map +1 -1
- package/mobile/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +3 -5
- package/mobile/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.js +1 -1
- package/mobile/dist/ui-kit/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
- package/mobile/dist/ui-kit/RadioButtonGroup/RadioButtonGroupControl.d.ts +2 -0
- package/mobile/dist/ui-kit/RadioButtonGroup/RadioButtonGroupControl.js +10 -0
- package/mobile/dist/ui-kit/RadioButtonGroup/RadioButtonGroupControl.js.map +1 -0
- package/mobile/dist/ui-kit/Select/Select.d.ts +4 -7
- package/mobile/dist/ui-kit/Select/Select.js +3 -4
- package/mobile/dist/ui-kit/Select/Select.js.map +1 -1
- package/mobile/dist/ui-kit/Select/SelectControl.d.ts +1 -8
- package/mobile/dist/ui-kit/Select/SelectControl.js +2 -1
- package/mobile/dist/ui-kit/Select/SelectControl.js.map +1 -1
- package/mobile/dist/utils/getRequiredLabel.d.ts +2 -0
- package/mobile/dist/utils/getRequiredLabel.js +5 -0
- package/mobile/dist/utils/getRequiredLabel.js.map +1 -0
- package/mobile/lib/EventBus/EventBus.d.ts +17 -4
- package/mobile/lib/EventBus/EventBus.js +29 -10
- package/mobile/lib/EventBus/EventBus.js.map +1 -1
- package/mobile/lib/EventBus/defaultEventBus.d.ts +2 -13
- package/mobile/lib/EventBus/defaultEventBus.js.map +1 -1
- package/mobile/lib/EventBus/useSubject.d.ts +2 -0
- package/mobile/lib/EventBus/useSubject.js +14 -0
- package/mobile/lib/EventBus/useSubject.js.map +1 -0
- package/mobile/lib/EventBus/useSubjectState.d.ts +2 -0
- package/mobile/lib/EventBus/useSubjectState.js +7 -0
- package/mobile/lib/EventBus/useSubjectState.js.map +1 -0
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/CarouselTariffsCard/CardCellsSection.d.ts +9 -0
- package/mobile/lib/components/CarouselTariffsCard/CardCellsSection.js +16 -0
- package/mobile/lib/components/CarouselTariffsCard/CardCellsSection.js.map +1 -0
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +12 -26
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/mobile/lib/components/CarouselTariffsCard/carouselTariffsCardEventBus.d.ts +9 -0
- package/mobile/lib/components/CarouselTariffsCard/carouselTariffsCardEventBus.js +3 -0
- package/mobile/lib/components/CarouselTariffsCard/carouselTariffsCardEventBus.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js +2 -2
- package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
- package/mobile/lib/components/Header/HeaderSecondaryMenu.js +2 -2
- package/mobile/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/AtmsMap.js +2 -2
- package/mobile/lib/components/OfficesAtmsMap/AtmsMap.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/OfficesMap.js +2 -2
- package/mobile/lib/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/BurgerMenuDialog.js +2 -2
- package/mobile/lib/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
- package/mobile/lib/hooks/useLocation.d.ts +2 -1
- package/mobile/lib/hooks/useLocation.js +26 -33
- package/mobile/lib/hooks/useLocation.js.map +1 -1
- package/mobile/lib/hooks/useReducer.d.ts +4 -0
- package/mobile/lib/hooks/useReducer.js +9 -0
- package/mobile/lib/hooks/useReducer.js.map +1 -0
- package/mobile/lib/hooks/useRegions.js +3 -1
- package/mobile/lib/hooks/useRegions.js.map +1 -1
- package/mobile/lib/model/DefaultControlType.d.ts +7 -0
- package/mobile/lib/model/DefaultControlType.js +2 -0
- package/mobile/lib/model/DefaultControlType.js.map +1 -0
- package/mobile/lib/ui-kit/Calculator/renderBinaryRadioButtonGroup.js +1 -1
- package/mobile/lib/ui-kit/Calculator/renderBinaryRadioButtonGroup.js.map +1 -1
- package/mobile/lib/ui-kit/DatePicker/DatePickerControl.d.ts +3 -7
- package/mobile/lib/ui-kit/DatePicker/DatePickerControl.js +2 -1
- package/mobile/lib/ui-kit/DatePicker/DatePickerControl.js.map +1 -1
- package/mobile/lib/ui-kit/DialogManager/useDialogManager.js +3 -3
- package/mobile/lib/ui-kit/DialogManager/useDialogManager.js.map +1 -1
- package/mobile/lib/ui-kit/DialogManager/useDialogsList.js +1 -1
- package/mobile/lib/ui-kit/DialogManager/useDialogsList.js.map +1 -1
- package/mobile/lib/ui-kit/Foldable/Foldable.d.ts +11 -1
- package/mobile/lib/ui-kit/Foldable/Foldable.js +10 -2
- package/mobile/lib/ui-kit/Foldable/Foldable.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/SexField.js +5 -4
- package/mobile/lib/ui-kit/FormField/Fields/SexField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/VedField.js +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/VedField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/constants.js +1 -0
- package/mobile/lib/ui-kit/FormField/constants.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/getValidation.js +1 -0
- package/mobile/lib/ui-kit/FormField/getValidation.js.map +1 -1
- package/mobile/lib/ui-kit/Input/InputControl.js +2 -2
- package/mobile/lib/ui-kit/Input/InputControl.js.map +1 -1
- package/mobile/lib/ui-kit/Input/InputPhoneControl.js +2 -1
- package/mobile/lib/ui-kit/Input/InputPhoneControl.js.map +1 -1
- package/mobile/lib/ui-kit/Input/InputProps.d.ts +2 -6
- package/mobile/lib/ui-kit/Input/InputSnilsControl.js +2 -1
- package/mobile/lib/ui-kit/Input/InputSnilsControl.js.map +1 -1
- package/mobile/lib/ui-kit/LocationDialog/LocationDialog.js +10 -13
- package/mobile/lib/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
- package/mobile/lib/ui-kit/LocationDialog/SelectedLocation.d.ts +5 -0
- package/mobile/lib/ui-kit/LocationDialog/SelectedLocation.js +13 -0
- package/mobile/lib/ui-kit/LocationDialog/SelectedLocation.js.map +1 -0
- package/mobile/lib/ui-kit/PopupManager/PopupManager.js +1 -1
- package/mobile/lib/ui-kit/PopupManager/PopupManager.js.map +1 -1
- package/mobile/lib/ui-kit/PopupManager/usePopupManager.js +3 -3
- package/mobile/lib/ui-kit/PopupManager/usePopupManager.js.map +1 -1
- package/mobile/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.d.ts +3 -5
- package/mobile/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.js +1 -1
- package/mobile/lib/ui-kit/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
- package/mobile/lib/ui-kit/RadioButtonGroup/RadioButtonGroupControl.d.ts +2 -0
- package/mobile/lib/ui-kit/RadioButtonGroup/RadioButtonGroupControl.js +8 -0
- package/mobile/lib/ui-kit/RadioButtonGroup/RadioButtonGroupControl.js.map +1 -0
- package/mobile/lib/ui-kit/Select/Select.d.ts +4 -7
- package/mobile/lib/ui-kit/Select/Select.js +3 -4
- package/mobile/lib/ui-kit/Select/Select.js.map +1 -1
- package/mobile/lib/ui-kit/Select/SelectControl.d.ts +1 -8
- package/mobile/lib/ui-kit/Select/SelectControl.js +2 -1
- package/mobile/lib/ui-kit/Select/SelectControl.js.map +1 -1
- package/mobile/lib/utils/getRequiredLabel.d.ts +2 -0
- package/mobile/lib/utils/getRequiredLabel.js +2 -0
- package/mobile/lib/utils/getRequiredLabel.js.map +1 -0
- package/mobile/src/EventBus/EventBus.ts +51 -15
- package/mobile/src/EventBus/defaultEventBus.ts +2 -14
- package/mobile/src/EventBus/useSubject.ts +19 -0
- package/mobile/src/EventBus/useSubjectState.ts +13 -0
- package/mobile/src/components/CarouselTariffsCard/CardCellsSection.tsx +54 -0
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +23 -66
- package/mobile/src/components/CarouselTariffsCard/carouselTariffsCardEventBus.ts +11 -0
- package/mobile/src/components/ExchangeRateTile/ExchangeRateTile.tsx +2 -2
- package/mobile/src/components/Header/HeaderSecondaryMenu.tsx +2 -2
- package/mobile/src/components/OfficesAtmsMap/AtmsMap.tsx +2 -3
- package/mobile/src/components/OfficesAtmsMap/OfficesMap.tsx +2 -2
- package/mobile/src/components/StickyBottomMenu/BurgerMenuDialog.tsx +2 -2
- package/mobile/src/hooks/useLocation.ts +30 -44
- package/mobile/src/hooks/useReducer.ts +21 -0
- package/mobile/src/hooks/useRegions.ts +4 -1
- package/mobile/src/model/DefaultControlType.ts +7 -0
- package/mobile/src/ui-kit/Calculator/renderBinaryRadioButtonGroup.tsx +1 -1
- package/mobile/src/ui-kit/DatePicker/DatePickerControl.tsx +6 -14
- package/mobile/src/ui-kit/DialogManager/useDialogManager.ts +3 -3
- package/mobile/src/ui-kit/DialogManager/useDialogsList.ts +1 -1
- package/mobile/src/ui-kit/Foldable/Foldable.tsx +21 -5
- package/mobile/src/ui-kit/FormField/Fields/SexField.tsx +13 -11
- package/mobile/src/ui-kit/FormField/Fields/VedField.tsx +1 -1
- package/mobile/src/ui-kit/FormField/constants.tsx +1 -0
- package/mobile/src/ui-kit/FormField/getValidation.tsx +1 -0
- package/mobile/src/ui-kit/Input/InputControl.tsx +2 -3
- package/mobile/src/ui-kit/Input/InputPhoneControl.tsx +2 -1
- package/mobile/src/ui-kit/Input/InputProps.ts +2 -6
- package/mobile/src/ui-kit/Input/InputSnilsControl.tsx +2 -1
- package/mobile/src/ui-kit/LocationDialog/LocationDialog.tsx +13 -25
- package/mobile/src/ui-kit/LocationDialog/SelectedLocation.tsx +27 -0
- package/mobile/src/ui-kit/PopupManager/PopupManager.tsx +1 -1
- package/mobile/src/ui-kit/PopupManager/usePopupManager.tsx +3 -3
- package/mobile/src/ui-kit/RadioButtonGroup/RadioButtonGroup.tsx +9 -10
- package/mobile/src/ui-kit/RadioButtonGroup/RadioButtonGroupControl.tsx +18 -0
- package/mobile/src/ui-kit/Select/Select.tsx +8 -10
- package/mobile/src/ui-kit/Select/SelectControl.tsx +4 -10
- package/mobile/src/utils/getRequiredLabel.ts +4 -0
- package/package.json +1 -1
- package/src/EventBus/EventBus.ts +51 -15
- package/src/EventBus/defaultEventBus.ts +2 -14
- package/src/EventBus/useSubject.ts +19 -0
- package/src/EventBus/useSubjectState.ts +13 -0
- package/src/components/CarouselTariffsCard/CardCellsSection.tsx +54 -0
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +23 -66
- package/src/components/CarouselTariffsCard/carouselTariffsCardEventBus.ts +11 -0
- package/src/components/ExchangeRateTile/ExchangeRateTile.tsx +2 -2
- package/src/components/Header/HeaderSecondaryMenu.tsx +2 -2
- package/src/components/OfficesAtmsMap/AtmsMap.tsx +2 -3
- package/src/components/OfficesAtmsMap/OfficesMap.tsx +2 -2
- package/src/components/StickyBottomMenu/BurgerMenuDialog.tsx +2 -2
- package/src/hooks/useLocation.ts +30 -44
- package/src/hooks/useReducer.ts +21 -0
- package/src/hooks/useRegions.ts +4 -1
- package/src/model/DefaultControlType.ts +7 -0
- package/src/ui-kit/Calculator/renderBinaryRadioButtonGroup.tsx +1 -1
- package/src/ui-kit/DatePicker/DatePickerControl.tsx +6 -14
- package/src/ui-kit/DialogManager/useDialogManager.ts +3 -3
- package/src/ui-kit/DialogManager/useDialogsList.ts +1 -1
- package/src/ui-kit/Foldable/Foldable.tsx +21 -5
- package/src/ui-kit/FormField/Fields/SexField.tsx +13 -11
- package/src/ui-kit/FormField/Fields/VedField.tsx +1 -1
- package/src/ui-kit/FormField/constants.tsx +1 -0
- package/src/ui-kit/FormField/getValidation.tsx +1 -0
- package/src/ui-kit/Input/InputControl.tsx +2 -3
- package/src/ui-kit/Input/InputPhoneControl.tsx +2 -1
- package/src/ui-kit/Input/InputProps.ts +2 -6
- package/src/ui-kit/Input/InputSnilsControl.tsx +2 -1
- package/src/ui-kit/LocationDialog/LocationDialog.tsx +13 -25
- package/src/ui-kit/LocationDialog/SelectedLocation.tsx +27 -0
- package/src/ui-kit/PopupManager/PopupManager.tsx +1 -1
- package/src/ui-kit/PopupManager/usePopupManager.tsx +3 -3
- package/src/ui-kit/RadioButtonGroup/RadioButtonGroup.fixture.tsx +2 -2
- package/src/ui-kit/RadioButtonGroup/RadioButtonGroup.tsx +9 -10
- package/src/ui-kit/RadioButtonGroup/RadioButtonGroupControl.tsx +18 -0
- package/src/ui-kit/Select/Select.tsx +8 -10
- package/src/ui-kit/Select/SelectControl.tsx +4 -10
- package/src/utils/getRequiredLabel.ts +4 -0
- package/bundle/EventBus/useLatestEvent.d.ts +0 -2
- package/bundle/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +0 -6
- package/dist/EventBus/useLatestEvent.d.ts +0 -2
- package/dist/EventBus/useLatestEvent.js +0 -11
- package/dist/EventBus/useLatestEvent.js.map +0 -1
- package/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +0 -6
- package/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.js.map +0 -1
- package/lib/EventBus/useLatestEvent.d.ts +0 -2
- package/lib/EventBus/useLatestEvent.js +0 -8
- package/lib/EventBus/useLatestEvent.js.map +0 -1
- package/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +0 -6
- package/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.js +0 -2
- package/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.js.map +0 -1
- package/mobile/bundle/EventBus/useLatestEvent.d.ts +0 -2
- package/mobile/bundle/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +0 -6
- package/mobile/dist/EventBus/useLatestEvent.d.ts +0 -2
- package/mobile/dist/EventBus/useLatestEvent.js +0 -11
- package/mobile/dist/EventBus/useLatestEvent.js.map +0 -1
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +0 -6
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.js.map +0 -1
- package/mobile/lib/EventBus/useLatestEvent.d.ts +0 -2
- package/mobile/lib/EventBus/useLatestEvent.js +0 -8
- package/mobile/lib/EventBus/useLatestEvent.js.map +0 -1
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +0 -6
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.js +0 -2
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.js.map +0 -1
- package/mobile/src/EventBus/useLatestEvent.ts +0 -16
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCardAction.ts +0 -6
- package/src/EventBus/useLatestEvent.ts +0 -16
- package/src/components/CarouselTariffsCard/CarouselTariffsCardAction.ts +0 -6
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
|
|
1
|
+
export declare type Subscriber<Event> = (ev: Event) => void;
|
|
2
|
+
declare type Cleanup = () => void;
|
|
3
|
+
export interface EventBusObservable<EM extends Record<string, any>> {
|
|
4
|
+
subscribe<K extends keyof EM>(type: K, listener: Subscriber<EM[K]>): Cleanup;
|
|
5
|
+
}
|
|
6
|
+
export interface EventBusEmitter<EM extends Record<string, any>> {
|
|
7
|
+
fire<K extends keyof EM>(type: K, event: EM[K]): void;
|
|
8
|
+
subject<K extends keyof EM>(type: K, event: EM[K]): Cleanup;
|
|
9
|
+
}
|
|
10
|
+
export declare class EventBus<EM extends Record<string, any>> implements EventBusObservable<EM>, EventBusEmitter<EM> {
|
|
11
|
+
private subscribersMap;
|
|
3
12
|
private subjectsStateMap;
|
|
4
|
-
|
|
13
|
+
readonly emitter: EventBusEmitter<EM>;
|
|
14
|
+
readonly observable: EventBusObservable<EM>;
|
|
15
|
+
subscribe<K extends keyof EM>(type: K, listener: Subscriber<EM[K]>): Cleanup;
|
|
5
16
|
private unsubscribe;
|
|
6
17
|
fire<K extends keyof EM>(type: K, event: EM[K]): void;
|
|
7
|
-
subject<K extends keyof EM>(type: K, event: EM[K]):
|
|
18
|
+
subject<K extends keyof EM>(type: K, event: EM[K]): Cleanup;
|
|
19
|
+
private fireSubscribers;
|
|
8
20
|
}
|
|
21
|
+
export {};
|
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
import { type CarouselTariffsCardAction } from '../components/CarouselTariffsCard/CarouselTariffsCardAction';
|
|
2
|
-
import { type Tab } from '../components/TabsLayout/TabsLayoutContent';
|
|
3
1
|
import { type Region } from '../hooks/useRegions';
|
|
4
2
|
import { type DialogAction } from '../ui-kit/DialogManager/DialogAction';
|
|
5
3
|
import { type PopupAction } from '../ui-kit/PopupManager/PopupAction';
|
|
6
4
|
import { EventBus } from './EventBus';
|
|
7
|
-
|
|
8
|
-
type?: Tab['type'];
|
|
9
|
-
groupName?: string;
|
|
10
|
-
label?: string;
|
|
11
|
-
}
|
|
12
|
-
interface GlobalEventMap {
|
|
5
|
+
export declare const defaultEventBus: EventBus<{
|
|
13
6
|
location: Region;
|
|
14
7
|
dialog: DialogAction;
|
|
15
8
|
popup: PopupAction;
|
|
16
|
-
|
|
17
|
-
fold: CarouselTariffsCardAction;
|
|
18
|
-
}
|
|
19
|
-
export declare const defaultEventBus: EventBus<GlobalEventMap>;
|
|
20
|
-
export {};
|
|
9
|
+
}>;
|
package/bundle/bundle.umd.js
CHANGED
|
@@ -403,39 +403,58 @@
|
|
|
403
403
|
].join(' ');
|
|
404
404
|
|
|
405
405
|
class EventBus {
|
|
406
|
-
|
|
406
|
+
subscribersMap = {};
|
|
407
407
|
subjectsStateMap = {};
|
|
408
|
+
emitter = this;
|
|
409
|
+
observable = this;
|
|
408
410
|
subscribe(type, listener) {
|
|
409
|
-
this.
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
listener(latestEvent);
|
|
413
|
-
}
|
|
411
|
+
this.subscribersMap[type] ||= [];
|
|
412
|
+
this.subscribersMap[type]?.push(listener);
|
|
413
|
+
this.fireSubscribers([listener], this.subjectsStateMap[type]);
|
|
414
414
|
return () => {
|
|
415
415
|
this.unsubscribe(type, listener);
|
|
416
416
|
};
|
|
417
417
|
}
|
|
418
418
|
unsubscribe(type, listener) {
|
|
419
|
-
|
|
419
|
+
const index = this.subscribersMap[type]?.indexOf(listener);
|
|
420
|
+
if (index && index !== -1) {
|
|
421
|
+
this.subscribersMap[type]?.splice(index, 1);
|
|
422
|
+
}
|
|
420
423
|
}
|
|
421
424
|
fire(type, event) {
|
|
422
425
|
const isSubjectDeclared = type in this.subjectsStateMap;
|
|
423
426
|
if (isSubjectDeclared) {
|
|
424
|
-
this.
|
|
427
|
+
this.subject(type, event);
|
|
428
|
+
}
|
|
429
|
+
else {
|
|
430
|
+
this.fireSubscribers(this.subscribersMap[type], event);
|
|
425
431
|
}
|
|
426
|
-
this.subscribers[type]?.forEach((s) => s(event));
|
|
427
432
|
}
|
|
428
433
|
subject(type, event) {
|
|
429
|
-
this.subjectsStateMap[type]
|
|
434
|
+
if (this.subjectsStateMap[type] !== event) {
|
|
435
|
+
this.subjectsStateMap[type] = event;
|
|
436
|
+
this.fireSubscribers(this.subscribersMap[type], event);
|
|
437
|
+
}
|
|
438
|
+
return () => {
|
|
439
|
+
delete this.subjectsStateMap[type];
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
fireSubscribers(subscribers, event) {
|
|
443
|
+
if (!subscribers || !event) {
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
for (const _ of subscribers) {
|
|
447
|
+
_(event);
|
|
448
|
+
}
|
|
430
449
|
}
|
|
431
450
|
}
|
|
432
451
|
|
|
433
452
|
const defaultEventBus = new EventBus();
|
|
434
453
|
|
|
435
454
|
const useDialogManager = () => ({
|
|
436
|
-
open: (dialog, options = {}) => defaultEventBus.fire('dialog', { type: 'open', dialog, ...options }),
|
|
437
|
-
close: () => defaultEventBus.fire('dialog', { type: 'close' }),
|
|
438
|
-
closeAll: () => defaultEventBus.fire('dialog', { type: 'close', all: true }),
|
|
455
|
+
open: (dialog, options = {}) => defaultEventBus.emitter.fire('dialog', { type: 'open', dialog, ...options }),
|
|
456
|
+
close: () => defaultEventBus.emitter.fire('dialog', { type: 'close' }),
|
|
457
|
+
closeAll: () => defaultEventBus.emitter.fire('dialog', { type: 'close', all: true }),
|
|
439
458
|
});
|
|
440
459
|
|
|
441
460
|
const adjustBase = (href, basePath = '') => href.replace(basePath, '') || '/';
|
|
@@ -1090,6 +1109,7 @@
|
|
|
1090
1109
|
{ key: 'phone', text: 'Телефонный звонок' },
|
|
1091
1110
|
{ key: 'email', text: 'Электронное сообщение' },
|
|
1092
1111
|
];
|
|
1112
|
+
// TODO Тоже надо рефакторить - файлик constants
|
|
1093
1113
|
const OUT_SERVICE_URL = '/api/v1/outservice/outserviceregions';
|
|
1094
1114
|
|
|
1095
1115
|
const getRegionUrl = (typeForm) => typeForm === 'OUTSERVICE' ? OUT_SERVICE_URL : undefined;
|
|
@@ -1162,6 +1182,8 @@
|
|
|
1162
1182
|
return targetRef;
|
|
1163
1183
|
}
|
|
1164
1184
|
|
|
1185
|
+
const getRequiredLabel = ({ label, errors }) => label && errors ? `${label}*` : label;
|
|
1186
|
+
|
|
1165
1187
|
const noop = () => {
|
|
1166
1188
|
// Do nothing
|
|
1167
1189
|
};
|
|
@@ -1265,9 +1287,9 @@
|
|
|
1265
1287
|
};
|
|
1266
1288
|
|
|
1267
1289
|
const usePopupManager = () => ({
|
|
1268
|
-
open: (popup, options) => defaultEventBus.fire('popup', { type: 'open', popup, ...options }),
|
|
1269
|
-
update: (popup, options) => defaultEventBus.fire('popup', { type: 'update', popup, ...options }),
|
|
1270
|
-
close: () => defaultEventBus.fire('popup', { type: 'close' }),
|
|
1290
|
+
open: (popup, options) => defaultEventBus.emitter.fire('popup', { type: 'open', popup, ...options }),
|
|
1291
|
+
update: (popup, options) => defaultEventBus.emitter.fire('popup', { type: 'update', popup, ...options }),
|
|
1292
|
+
close: () => defaultEventBus.emitter.fire('popup', { type: 'close' }),
|
|
1271
1293
|
});
|
|
1272
1294
|
|
|
1273
1295
|
const InputPopup = JSX(({ options, onChange }) => (jsx("div", { className: "bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl", role: "list", children: options?.map((item, key) => (jsx("div", { className: "flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative", role: "listitem", onMouseDown: () => onChange(item.processedValue), children: jsx("span", { className: "min-h-6", children: item.processedValue }) }, key.toString()))) })));
|
|
@@ -1333,9 +1355,8 @@
|
|
|
1333
1355
|
value,
|
|
1334
1356
|
onChange,
|
|
1335
1357
|
});
|
|
1336
|
-
return (jsxs("div", { className: style('shrink-0 w-full', className), ref: popupRef, onBlur: close, onFocus: open, children: [jsx("div", { ref: inputRef, children: jsx(Input, { type: type || 'text', "aria-label": label, label:
|
|
1358
|
+
return (jsxs("div", { className: style('shrink-0 w-full', className), ref: popupRef, onBlur: close, onFocus: open, children: [jsx("div", { ref: inputRef, children: jsx(Input, { type: type || 'text', "aria-label": label, label: getRequiredLabel({ label, errors }), valid: Boolean(!error), value: value, onChange: onChange, onBlur: onBlur, isTextarea: isTextarea, placeholder: getPlaceholder(placeholder, errors, label) }) }), renderErrorText(error)] }));
|
|
1337
1359
|
});
|
|
1338
|
-
const getLabel = (errors, label) => (label && errors ? `${label}*` : label);
|
|
1339
1360
|
const getPlaceholder = (placeholder, errors, label) => errors && !label ? `${placeholder}*` : placeholder;
|
|
1340
1361
|
|
|
1341
1362
|
const formatOption = (_) => _?.text || _?.key || '';
|
|
@@ -1383,12 +1404,10 @@
|
|
|
1383
1404
|
return inputRef;
|
|
1384
1405
|
}
|
|
1385
1406
|
|
|
1386
|
-
const Select = JSX(
|
|
1387
|
-
// eslint-disable-next-line complexity
|
|
1388
|
-
({ className, label, options = [], value, valid = true, isBorder = true, placeholder = '', isSearch = false, iconVersion = 'black', onChange, disabled, }) => {
|
|
1407
|
+
const Select = JSX(({ className, label, options = [], value, valid = true, isBorder = true, placeholder = '', isSearch = false, iconVersion = 'black', onChange, disabled = false, }) => {
|
|
1389
1408
|
const [isOpen, { setFalse: close, setTrue: open }] = useBool();
|
|
1390
1409
|
const [query, setQuery] = useState('');
|
|
1391
|
-
const isDisabled = disabled
|
|
1410
|
+
const isDisabled = getDisabled(disabled, options.length);
|
|
1392
1411
|
const hasOpen = isOpen && !isDisabled;
|
|
1393
1412
|
const handleClose = useCallback(() => {
|
|
1394
1413
|
setQuery('');
|
|
@@ -1407,8 +1426,9 @@
|
|
|
1407
1426
|
});
|
|
1408
1427
|
const renderIcon$1 = (isOpen, iconVersion) => (jsx(Icon, { className: style('absolute right-0 flex self-center', { 'rotate-180': !isOpen }), iconVersion: iconVersion, name: "ArrowUpIcon", width: "16", height: "16" }));
|
|
1409
1428
|
const getStyle = (isBorder, valid, disabled) => style(isBorder ? 'border rounded-md ' : '', isBorder && !disabled ? 'hover:border-primary-hover' : '', disabled ? 'bg-main-divider' : 'cursor-pointer ', valid ? 'border-gray' : 'border-error');
|
|
1429
|
+
const getDisabled = (disabled, length) => disabled || length === 0;
|
|
1410
1430
|
|
|
1411
|
-
const SelectControl = JSX(({ className = '', label, error, ...rest }) => (jsxs("div", { className: className, children: [jsx(Select, { ...rest, valid: !error, label:
|
|
1431
|
+
const SelectControl = JSX(({ className = '', label, error, errors, ...rest }) => (jsxs("div", { className: className, children: [jsx(Select, { ...rest, valid: !error, label: getRequiredLabel({ label, errors }) }), renderErrorText(error)] })));
|
|
1412
1432
|
|
|
1413
1433
|
const getNamesFromInput = (inputs) => Object.values(inputs.filter((_) => _))?.map((_) => _.name);
|
|
1414
1434
|
|
|
@@ -1533,6 +1553,7 @@
|
|
|
1533
1553
|
};
|
|
1534
1554
|
};
|
|
1535
1555
|
|
|
1556
|
+
// TODO Зачем это?
|
|
1536
1557
|
const getValidation = (field, validator, required = false) => required ? withValidator(field, validator) : field;
|
|
1537
1558
|
|
|
1538
1559
|
const ACQUIRING_TYPES = [
|
|
@@ -1912,7 +1933,7 @@
|
|
|
1912
1933
|
});
|
|
1913
1934
|
const renderDatePickerForm = (handleChangeVisibleCalendar, value, valid) => (jsxs("div", { onClick: handleChangeVisibleCalendar, className: style(formStyle, valid ? 'border-gray' : 'border-error'), children: [jsx(Paragraph, { children: value && formatDate(value) }), jsx(Icon, { ...ICON_PROPS, name: "CalendarIcon" })] }));
|
|
1914
1935
|
|
|
1915
|
-
const DatePickerControl = JSX(({ className, label, error, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(DatePicker, { label: label
|
|
1936
|
+
const DatePickerControl = JSX(({ className, label, error, errors, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(DatePicker, { label: getRequiredLabel({ label, errors }), valid: Boolean(!error), ...rest }), renderErrorText(error)] })));
|
|
1916
1937
|
|
|
1917
1938
|
const BeginDateField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u043D\u0430\u0447\u0430\u043B\u0430 \u0440\u0430\u0431\u043E\u0442\u044B \u043D\u0430 \u0442\u0435\u043A\u0443\u0449\u0435\u043C \u043C\u0435\u0441\u0442\u0435", ...getValidation(field('beginDate'), validatorObj.beginDate, input?.required), ...input })));
|
|
1918
1939
|
|
|
@@ -2017,9 +2038,11 @@
|
|
|
2017
2038
|
const LegalFormField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041E\u041F\u0424", placeholder: "\u041E\u041E\u041E, \u041F\u0410\u041E \u0438 \u0434\u0440.", ...getValidation(field('legalForm'), validatorObj.legalForm, input?.required), ...input })));
|
|
2018
2039
|
|
|
2019
2040
|
const REGIONS_URL = '/api/v1/regions';
|
|
2041
|
+
const EMPTY_REGIONS = [];
|
|
2042
|
+
// TODO Почему url можно менять? Разве смысл не в инкапсуляции api url. Тоже под рефакторинг попадает
|
|
2020
2043
|
function useRegions(url = REGIONS_URL) {
|
|
2021
2044
|
const { data } = useAsyncData(url, fetchJSONUnsafe);
|
|
2022
|
-
return Array.isArray(data) ? data :
|
|
2045
|
+
return Array.isArray(data) ? data : EMPTY_REGIONS;
|
|
2023
2046
|
}
|
|
2024
2047
|
|
|
2025
2048
|
const LocalitiesField = JSX(({ field, input }) => {
|
|
@@ -2084,7 +2107,7 @@
|
|
|
2084
2107
|
return (jsx(Input, { ...inputProps, onChange: handleChange, onFocus: (ev) => handleChange(ev?.target?.value || ''), onBlur: (ev) => handleBlur(ev?.target?.value || ''), children: children }));
|
|
2085
2108
|
});
|
|
2086
2109
|
|
|
2087
|
-
const InputPhoneControl = JSX(({ className, label, error, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(PhoneInput, { "aria-label": label, label: rest?.errors
|
|
2110
|
+
const InputPhoneControl = JSX(({ className, label, error, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(PhoneInput, { "aria-label": label, label: getRequiredLabel({ label, errors: rest?.errors }), valid: Boolean(!error), placeholder: "+7 (___) ___-__-__", ...rest }), renderErrorText(error)] })));
|
|
2088
2111
|
|
|
2089
2112
|
const PhoneField = JSX(({ field, input }) => (jsx(InputPhoneControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...getValidation(field('phone'), validatorObj.phone, input?.required), ...input })));
|
|
2090
2113
|
|
|
@@ -2127,15 +2150,16 @@
|
|
|
2127
2150
|
horizontal: '@lg:flex-row',
|
|
2128
2151
|
vertical: '',
|
|
2129
2152
|
};
|
|
2130
|
-
const RadioButtonGroup = JSX(({
|
|
2153
|
+
const RadioButtonGroup = JSX(({ label, items, value, className, onChange: onChangeCheckedItem, disabled = false, orientation = 'horizontal', }) => (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 && onChangeCheckedItem(id), disabled: disabled }, String(id)))) })] })));
|
|
2154
|
+
|
|
2155
|
+
const RadioButtonGroupControl = JSX(({ className, label, onChange, error, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(RadioButtonGroup, { label: getRequiredLabel({ label, errors: rest?.errors }), onChange: (_) => onChange && onChange(_), ...rest }), renderErrorText(error)] })));
|
|
2131
2156
|
|
|
2132
2157
|
const SEX_TYPES = [
|
|
2133
2158
|
{ id: 'male', text: 'Мужской' },
|
|
2134
2159
|
{ id: 'female', text: 'Женский' },
|
|
2135
2160
|
];
|
|
2136
|
-
const SexField = JSX(({ field }) => {
|
|
2137
|
-
|
|
2138
|
-
return (jsx(RadioButtonGroup, { title: "\u041F\u043E\u043B", orientation: "horizontal", items: SEX_TYPES, checkedItem: value, onChange: (_) => onChange && onChange(_) }));
|
|
2161
|
+
const SexField = JSX(({ field, input }) => {
|
|
2162
|
+
return (jsx("div", { children: jsx(RadioButtonGroupControl, { label: "\u041F\u043E\u043B", orientation: "horizontal", items: SEX_TYPES, ...getValidation(field('sex'), validatorObj.sex, input?.required) }) }));
|
|
2139
2163
|
});
|
|
2140
2164
|
|
|
2141
2165
|
const isPlaceholder = (_) => _ === '_';
|
|
@@ -2168,7 +2192,7 @@
|
|
|
2168
2192
|
return (jsx(Input, { ...inputProps, onChange: handleChange, onFocus: (ev) => handleChange(ev?.target?.value || ''), onBlur: (ev) => handleBlur(ev?.target?.value || ''), children: children }));
|
|
2169
2193
|
});
|
|
2170
2194
|
|
|
2171
|
-
const InputSnilsControl = JSX(({ className, label, value, error, onChange, onBlur, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(SnilsInput, { "aria-label": label, label: rest?.errors
|
|
2195
|
+
const InputSnilsControl = JSX(({ className, label, value, error, onChange, onBlur, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(SnilsInput, { "aria-label": label, label: getRequiredLabel({ label, errors: rest?.errors }), valid: Boolean(!error), value: value, onChange: onChange, onBlur: onBlur, placeholder: "___-___-___ __" }), renderErrorText(error)] })));
|
|
2172
2196
|
|
|
2173
2197
|
const SnilsField = JSX(({ field, input }) => (jsx(InputSnilsControl, { label: "\u0421\u041D\u0418\u041B\u0421", ...getValidation(field('snils'), validatorObj.snils, input?.required), ...input })));
|
|
2174
2198
|
|
|
@@ -2197,7 +2221,7 @@
|
|
|
2197
2221
|
field?.('region')?.onChange?.('');
|
|
2198
2222
|
}
|
|
2199
2223
|
}, [value]);
|
|
2200
|
-
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,
|
|
2224
|
+
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, value: value, onChange: (_) => onChange && onChange(_) }) }));
|
|
2201
2225
|
});
|
|
2202
2226
|
|
|
2203
2227
|
function isRenderField({ input, field, }) {
|
|
@@ -2542,6 +2566,14 @@
|
|
|
2542
2566
|
return { ...formState, typeForm: { key: typeForm, text: '' } };
|
|
2543
2567
|
};
|
|
2544
2568
|
|
|
2569
|
+
const FoldableWrapper = JSX(({ className, children }) => (jsx("div", { className: className, role: "group", children: children })));
|
|
2570
|
+
/**
|
|
2571
|
+
* Какой то бесполезный компонент. Его можно заменить на useBool
|
|
2572
|
+
* Лучше оставить только обёрточный div с необходимой атрибутикой
|
|
2573
|
+
* и сделать пассивный компонент
|
|
2574
|
+
*
|
|
2575
|
+
* @deprecated
|
|
2576
|
+
*/
|
|
2545
2577
|
const Foldable = JSX(({ className = '', isFoldButtonOnTop = false, unfoldedByDefault = false, renderFoldableSection, renderFoldButton, }) => {
|
|
2546
2578
|
const [isUnfolded, setIsUnfolded] = useState(unfoldedByDefault);
|
|
2547
2579
|
const onToggle = useCallback(() => {
|
|
@@ -2549,7 +2581,7 @@
|
|
|
2549
2581
|
}, []);
|
|
2550
2582
|
const sectionNode = renderFoldableSection({ isUnfolded, onToggle });
|
|
2551
2583
|
const buttonNode = renderFoldButton ? renderFoldButton({ isUnfolded, onToggle }) : null;
|
|
2552
|
-
return isFoldButtonOnTop ? (jsxs(
|
|
2584
|
+
return isFoldButtonOnTop ? (jsxs(FoldableWrapper, { className: className, children: [buttonNode, sectionNode] })) : (jsxs(FoldableWrapper, { className: className, children: [sectionNode, buttonNode] }));
|
|
2553
2585
|
});
|
|
2554
2586
|
|
|
2555
2587
|
function useResizeObserver(callback, deps) {
|
|
@@ -3642,7 +3674,7 @@
|
|
|
3642
3674
|
const renderDaysInput = (props) => (jsx(InputRange, { items: [`От ${daysText(props.min || 0)}`, `До ${daysText(props.max || 0)}`], step: STEP_DAYS, ...props }));
|
|
3643
3675
|
const daysText = (days) => `${days} ${Number(days) % 10 === 1 ? 'дня' : 'дней'}`;
|
|
3644
3676
|
|
|
3645
|
-
const renderBinaryRadioButtonGroup = ({ items, title, mobileTitle = title, orientation = 'horizontal', value, onChange, ...rest }) => (jsxs("div", { className: "grid gap-s whitespace-nowrap", children: [title ? (jsx("div", { className: "hidden @5xl:block", role: "radiogroup", "aria-label": title, children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: title }) })) : null, mobileTitle ? (jsx("div", { className: "@5xl:hidden", role: "radiogroup", "aria-label": mobileTitle, children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: mobileTitle }) })) : null, jsx(RadioButtonGroup, { orientation: orientation, items: items,
|
|
3677
|
+
const renderBinaryRadioButtonGroup = ({ items, title, mobileTitle = title, orientation = 'horizontal', value, onChange, ...rest }) => (jsxs("div", { className: "grid gap-s whitespace-nowrap", children: [title ? (jsx("div", { className: "hidden @5xl:block", role: "radiogroup", "aria-label": title, children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: title }) })) : null, mobileTitle ? (jsx("div", { className: "@5xl:hidden", role: "radiogroup", "aria-label": mobileTitle, children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: mobileTitle }) })) : null, jsx(RadioButtonGroup, { orientation: orientation, items: items, value: items[value ? 0 : 1].id, onChange: (_) => onChange && onChange(_ === items[0].id), ...rest })] }));
|
|
3646
3678
|
|
|
3647
3679
|
const renderPayout = (props) => renderBinaryRadioButtonGroup({
|
|
3648
3680
|
...props,
|
|
@@ -4639,31 +4671,37 @@
|
|
|
4639
4671
|
const CarouselRecommendationCard = JSX(({ className, padding, description, additionalDescription, href, icon, isDotted, __html, socialMedia = [], target, title, align = 'text-left', benefits, imageOptions: { directionRight = true, isImageAlwaysOnRight = ImageAlwaysOnRight, isImageSecondary = false, } = {}, data, ...rest }) => (jsx(BlockWrapper, { className: style('relative min-h-28 group-data-gray:bg-main-divider/50', className), defaultPadding: "p-0", ...rest, children: jsx(LinkWrapper, { href: href, target: target, className: "h-full", data: getAspectsWithInclude(data), children: jsxs(BaseTile, { className: "h-full", defaultPadding: "p-2xl", padding: padding, insetTitle: jsx(Headline, { title: title, description: description, headlineVersion: "XS", isEmbedded: true, align: align }), ...leftOrRightImage(isIcon(icon) ? jsx(Img, { image: icon }) : null, directionRight), buttons: socialMedia.length ? (jsx(SocialMedia, { media: socialMedia, stretched: true, showButtonText: true, version: rest?.version })) : null, isImageAlwaysOnRight: isImageAlwaysOnRight, isImageSecondary: isImageSecondary, imageAlign: "center", children: [jsx(BenefitsList, { benefits: benefits }), __html ? jsx(RichText, { __html: __html, isDotted: isDotted, itemSize: "list-s" }) : null, renderAdditionalDescription(additionalDescription, align)] }) }) })));
|
|
4640
4672
|
const renderAdditionalDescription = (additionalDescription, align) => additionalDescription ? (jsx(Paragraph, { size: "text-m", font: "font-light", color: "text-secondary-text group-data-secondary:text-white/80", align: align, children: additionalDescription })) : null;
|
|
4641
4673
|
|
|
4674
|
+
const useSubjectState = (eventBus, type, initialState) => {
|
|
4675
|
+
const [state, setState] = useState(initialState);
|
|
4676
|
+
useEffect(() => eventBus.subscribe(type, setState), [eventBus, type]);
|
|
4677
|
+
return state;
|
|
4678
|
+
};
|
|
4679
|
+
|
|
4642
4680
|
const renderCardInfo = (cell, i) => {
|
|
4643
4681
|
const { title, description, buttons } = cell;
|
|
4644
4682
|
return (jsxs("div", { className: "py-lg border-b border-main-divider", children: [title ? (jsx("div", { className: "opacity-80", children: jsx(Text, { size: "text-m", color: "text-secondary-text", children: title }) })) : null, description ? (jsx("div", { className: "mt-2xs", children: jsx(Text, { size: "text-xl", color: "text-primary-text", children: description }) })) : null, buttons?.length ? (jsx("div", { className: "text-primary-main", children: renderButtonsSection(buttons) })) : null] }, String(i)));
|
|
4645
4683
|
};
|
|
4646
4684
|
|
|
4647
|
-
const
|
|
4648
|
-
const
|
|
4649
|
-
const [visibleCells, hiddenCells] = visibleCellsCount > 0
|
|
4650
|
-
? [
|
|
4651
|
-
: [
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4685
|
+
const CardCellsSection = JSX((props) => {
|
|
4686
|
+
const { cardCells = [], visibleCellsCount = 1, isUnfolded } = props;
|
|
4687
|
+
const [visibleCells, hiddenCells] = visibleCellsCount > 0 && cardCells.length >= visibleCellsCount
|
|
4688
|
+
? [cardCells.slice(0, visibleCellsCount), cardCells.slice(visibleCellsCount)]
|
|
4689
|
+
: [cardCells, []];
|
|
4690
|
+
return hiddenCells.length ? (jsxs(FoldableWrapper, { children: [jsxs("div", { children: [visibleCells.map(renderCardInfo), jsx(FoldableSection, { isUnfolded: isUnfolded, children: hiddenCells.map(renderCardInfo) })] }), jsx(FoldButton, { ...props })] })) : (jsx("div", { children: visibleCells.map(renderCardInfo) }));
|
|
4691
|
+
});
|
|
4692
|
+
const FoldButton = JSX(({ isUnfolded, data, onToggle }) => (jsxs("button", { type: "button", className: "w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center", ...(isUnfolded ? getAspectsAttributes(data) : {}), onClick: onToggle, children: [jsx("div", { children: isUnfolded ? 'Скрыть' : 'Подробнее о тарифе' }), jsx(Icon, { className: "text-primary-text", name: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" })] })));
|
|
4693
|
+
|
|
4694
|
+
const carouselTariffsCardEventBus = new EventBus();
|
|
4695
|
+
|
|
4696
|
+
const CarouselTariffsCard = JSX(({ className, title, align = 'text-center', icon, button, visibleCellsCount = 1, cardCells = [], options, data, ...rest }) => {
|
|
4697
|
+
const { isUnfolded, parent: firedParent } = useSubjectState(carouselTariffsCardEventBus.observable, 'fold', {});
|
|
4698
|
+
const isVisible = isUnfolded && firedParent === options?.parent;
|
|
4699
|
+
const toggle = useCallback(() => carouselTariffsCardEventBus.emitter.fire('fold', {
|
|
4700
|
+
isUnfolded: !isVisible,
|
|
4701
|
+
parent: options?.parent,
|
|
4702
|
+
}), [isVisible, options?.parent]);
|
|
4703
|
+
return (jsxs(BlockWrapper, { className: style('flex flex-col', className), defaultPadding: "p-2xl", ...rest, children: [isIcon(icon) ? (jsx("div", { className: "self-center", children: jsx(Img, { image: icon }) })) : null, title ? (jsx(Heading, { className: style('pt-xs', align), headingType: "h5", title: title })) : null, button?.text ? jsx(LinkButton, { className: "w-full mt-m mb-lg", ...button }) : null, jsx(CardCellsSection, { cardCells: cardCells, visibleCellsCount: visibleCellsCount, isUnfolded: isVisible, data: data, onToggle: toggle })] }));
|
|
4704
|
+
});
|
|
4667
4705
|
|
|
4668
4706
|
const ContactsBlock = JSX(({ className, contacts, info, version = 'secondary', ...rest }) => (jsxs(BlockWrapper, { className: style('flex', className), defaultPadding: "p-6xl", version: version, ...rest, children: [info?.length ? renderBlocks(info) : null, contacts?.length ? renderBlocks(contacts) : null] })));
|
|
4669
4707
|
const renderBlocks = (info) => (jsx("div", { className: "flex gap-5xl grow basis-0", children: info.map((column, i) => renderBlocksColumn({ column, i })) }));
|
|
@@ -4835,47 +4873,46 @@
|
|
|
4835
4873
|
};
|
|
4836
4874
|
const ErrorBlock = JSX(({ className = '', title, description, error, button, ...rest }) => (jsxs(BlockWrapper, { className: style('flex flex-col justify-center items-center', className), defaultPadding: style('p-6xl'), version: "transparent", ...rest, children: [jsx("div", { className: "flex justify-center", children: renderErrorContent(error) }), jsx(Headline, { title: title, description: description, headlineVersion: "XL", isEmbedded: true, className: "mb-2xl last:mb-0" }), button?.text ? (jsx(LinkButton, { version: button?.version, text: button?.text, ...button })) : null] })));
|
|
4837
4875
|
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4876
|
+
function useSubject(eventBus, type, initialState) {
|
|
4877
|
+
useEffect(() => {
|
|
4878
|
+
const state = initialState instanceof Function ? initialState() : initialState;
|
|
4879
|
+
if (state instanceof Promise) {
|
|
4880
|
+
state.then((_) => eventBus.subject(type, _), console.warn);
|
|
4881
|
+
}
|
|
4882
|
+
else {
|
|
4883
|
+
eventBus.subject(type, state);
|
|
4884
|
+
}
|
|
4885
|
+
}, [eventBus, type]);
|
|
4886
|
+
return useCallback((_) => eventBus.fire(type, _), [eventBus, type]);
|
|
4887
|
+
}
|
|
4844
4888
|
|
|
4845
4889
|
const REGION_URL = '/api/v1/region';
|
|
4846
4890
|
const LOCATION_STORAGE_KEY = 'location';
|
|
4847
4891
|
function useLocation(defaultLocation = 'Москва') {
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4892
|
+
useEffect(() => defaultEventBus.subscribe('location', storeLocation), []);
|
|
4893
|
+
return useSubject(defaultEventBus.emitter, 'location', restoreLocation(defaultLocation));
|
|
4894
|
+
}
|
|
4895
|
+
function useLocationState(defaultLocation = 'Москва') {
|
|
4896
|
+
return useSubjectState(defaultEventBus.observable, 'location', { name: defaultLocation });
|
|
4897
|
+
}
|
|
4898
|
+
function restoreLocation(defaultLocation) {
|
|
4899
|
+
return async () => {
|
|
4900
|
+
if (!globalThis.localStorage?.hasItem(LOCATION_STORAGE_KEY)) {
|
|
4901
|
+
storeLocation(await fetchJSON(REGION_URL));
|
|
4857
4902
|
}
|
|
4858
|
-
|
|
4859
|
-
|
|
4903
|
+
const storedLocation = globalThis.localStorage?.getItem(LOCATION_STORAGE_KEY);
|
|
4904
|
+
try {
|
|
4905
|
+
return storedLocation && JSON.parse(storedLocation);
|
|
4906
|
+
}
|
|
4907
|
+
catch (ex) {
|
|
4908
|
+
// Do nothing
|
|
4909
|
+
}
|
|
4910
|
+
return { name: defaultLocation };
|
|
4911
|
+
};
|
|
4912
|
+
}
|
|
4913
|
+
function storeLocation(_) {
|
|
4914
|
+
_ && globalThis.localStorage?.setItem(LOCATION_STORAGE_KEY, JSON.stringify(_));
|
|
4860
4915
|
}
|
|
4861
|
-
const hasStoredLocation = () => Boolean(globalThis.localStorage?.getItem(LOCATION_STORAGE_KEY));
|
|
4862
|
-
const restoreLocation = () => {
|
|
4863
|
-
try {
|
|
4864
|
-
const data = globalThis.localStorage?.getItem(LOCATION_STORAGE_KEY);
|
|
4865
|
-
return data && JSON.parse(data);
|
|
4866
|
-
}
|
|
4867
|
-
catch (ex) {
|
|
4868
|
-
return null;
|
|
4869
|
-
}
|
|
4870
|
-
};
|
|
4871
|
-
const storeLocation = (_) => {
|
|
4872
|
-
try {
|
|
4873
|
-
globalThis.localStorage?.setItem(LOCATION_STORAGE_KEY, JSON.stringify(_));
|
|
4874
|
-
}
|
|
4875
|
-
catch (ex) {
|
|
4876
|
-
// Do nothing
|
|
4877
|
-
}
|
|
4878
|
-
};
|
|
4879
4916
|
|
|
4880
4917
|
var Currency;
|
|
4881
4918
|
(function (Currency) {
|
|
@@ -5017,7 +5054,7 @@
|
|
|
5017
5054
|
}
|
|
5018
5055
|
|
|
5019
5056
|
const ExchangeRateTile = JSX(({ className = '', title = 'Курсы обмена валют', button, ...rest }) => {
|
|
5020
|
-
const
|
|
5057
|
+
const currentLocation = useLocationState();
|
|
5021
5058
|
const exchangeRates = useFetchExchangeRateData(currentLocation);
|
|
5022
5059
|
const currencyRates = getCurrencyRates(exchangeRates?.exchangeRate?.currencies);
|
|
5023
5060
|
const currencyRatesBuy = currencyRates.filter((_) => _.buyExchangeRate);
|
|
@@ -5556,27 +5593,33 @@
|
|
|
5556
5593
|
return (jsxs("form", { className: `font-sans relative ${className}`, children: [jsx("div", { className: "absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none", children: searchTerm ? null : (jsx("label", { htmlFor: "search-bar-input", className: `text-secondary-text `, children: "\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0444\u0438\u043B\u0438\u0430\u043B\u0430\u043C" })) }), jsx("input", { id: "search-bar-input", className: style(inputValidStyle, `h-12 pl-m w-full peer text-l text-black rounded-md box-border`), value: searchTerm, onChange: (e) => onSearch(e.target.value.toLowerCase()), type: "text", name: "location-search-bar-input" })] }));
|
|
5557
5594
|
});
|
|
5558
5595
|
|
|
5559
|
-
const
|
|
5560
|
-
|
|
5561
|
-
const [currentLocation, selectCurrentLocation] = useLocation(branches?.default);
|
|
5596
|
+
const SelectedLocation = JSX(({ defaultLocation }) => {
|
|
5597
|
+
const currentLocation = useLocationState(defaultLocation);
|
|
5562
5598
|
const link = useLink();
|
|
5563
5599
|
const { href } = link({ href: `/branches/${currentLocation.slug}` });
|
|
5600
|
+
return currentLocation ? (jsx("div", { className: "mb-s", children: jsxs(Paragraph, { size: "text-l", color: "text-primary-text", children: ["\u0421\u0435\u0439\u0447\u0430\u0441 \u0432\u044B\u0431\u0440\u0430\u043D:", jsx(LinkWrapper, { href: href, className: "inline mx-2xs text-primary-main", children: currentLocation.name })] }) })) : null;
|
|
5601
|
+
});
|
|
5602
|
+
|
|
5603
|
+
const SEARCH_TERM_MIN_LENGTH = 3;
|
|
5604
|
+
const LocationDialog = JSX(({ foreignOffices, branches }) => {
|
|
5605
|
+
const selectLocation = useLocation(branches?.default);
|
|
5564
5606
|
const [query, setQuery] = useState('');
|
|
5565
|
-
const
|
|
5566
|
-
const
|
|
5607
|
+
const rawRegions = useRegions();
|
|
5608
|
+
const regions = useMemo(() => cleanUpRegions(rawRegions).sort((a, b) => (a.name ?? '').localeCompare(b.name ?? '')), [rawRegions]);
|
|
5609
|
+
const regionsGroupByLetter = useMemo(() => groupBy(regions, regionFirstLetter), [regions]);
|
|
5567
5610
|
const { close } = useDialogManager();
|
|
5568
5611
|
const handleChangeLocation = useCallback((region) => {
|
|
5569
|
-
|
|
5612
|
+
selectLocation(region);
|
|
5570
5613
|
close();
|
|
5571
5614
|
}, []);
|
|
5572
|
-
return (jsxs(Dialog, { className: "pb-20", head: jsxs("div", { children: [jsx(Text, { size: "text-h4", color: "text-primary-text", children: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B" }),
|
|
5615
|
+
return (jsxs(Dialog, { className: "pb-20", head: jsxs("div", { children: [jsx(Text, { size: "text-h4", color: "text-primary-text", children: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B" }), jsx(SelectedLocation, { defaultLocation: branches?.default }), jsx(SearchBar, { onSearch: setQuery, searchTerm: query })] }), children: [query && query.length >= SEARCH_TERM_MIN_LENGTH ? (jsx("div", { children: regions
|
|
5573
5616
|
.filter(({ name }) => name && jaroWinklerDistance(name.toLowerCase())(query.toLowerCase()) >= 0.8)
|
|
5574
5617
|
.map(renderRegion(branches?.dataSelect, handleChangeLocation)) })) : (jsx("div", { className: "columns-1 sm:columns-3 md:columns-4 lg:columns-5", children: Array.from(regionsGroupByLetter.entries()).map(renderRegionGroup(handleChangeLocation, branches?.dataSelect)) })), renderForeignOffices(foreignOffices)] }));
|
|
5575
5618
|
});
|
|
5576
|
-
const regionFirstLetter = (region) => region.name?.charAt(0)
|
|
5619
|
+
const regionFirstLetter = (region) => region.name?.charAt(0) ?? '';
|
|
5577
5620
|
const cleanUpRegions = (regions) => regions.map((region) => ({
|
|
5578
5621
|
...region,
|
|
5579
|
-
name: region.name?.replace(/республика|область|край'/gi, '').trim()
|
|
5622
|
+
name: region.name?.replace(/республика|область|край'/gi, '').trim() ?? '',
|
|
5580
5623
|
}));
|
|
5581
5624
|
|
|
5582
5625
|
const useLocationDialog = (props) => {
|
|
@@ -5604,7 +5647,7 @@
|
|
|
5604
5647
|
|
|
5605
5648
|
const HeaderSecondaryMenu = JSX(({ className, version, ...rest }) => {
|
|
5606
5649
|
const iconVersion = version === 'transparent' ? 'white' : 'black';
|
|
5607
|
-
const
|
|
5650
|
+
const currentLocation = useLocationState(rest?.branches?.default);
|
|
5608
5651
|
const searchDialog = useSearchDialog(rest);
|
|
5609
5652
|
const locationDialog = useLocationDialog(rest);
|
|
5610
5653
|
const openSearchDialog = useCallback(() => searchDialog.open(), [searchDialog]);
|
|
@@ -6443,7 +6486,7 @@
|
|
|
6443
6486
|
designDisabledPeople: (item) => Boolean(item.designDisabledPeople),
|
|
6444
6487
|
};
|
|
6445
6488
|
const AtmsMap = JSX(({ descriptionData, className }) => {
|
|
6446
|
-
const
|
|
6489
|
+
const currentLocation = useLocationState();
|
|
6447
6490
|
const regionCode = currentLocation?.code ?? '000';
|
|
6448
6491
|
const { data: officesData, isLoad } = useAtms(regionCode);
|
|
6449
6492
|
return (jsx(OfficesAtmsMapLayout, { className: className, filterItems: filterItems, data: officesData, isLoad: isLoad, initFilterState: INITIAL_FILTRATION_STATE, renderCard: renderAtmCard, getBalloon: getAtmPoint, title: `Банкоматы филиала ${currentLocation?.name}`, descriptionData: descriptionData }));
|
|
@@ -6662,7 +6705,7 @@
|
|
|
6662
6705
|
};
|
|
6663
6706
|
|
|
6664
6707
|
const OfficesMap = JSX(({ className }) => {
|
|
6665
|
-
const
|
|
6708
|
+
const currentLocation = useLocationState();
|
|
6666
6709
|
const regionCode = currentLocation?.code ?? '000';
|
|
6667
6710
|
const { data, isLoad } = useOffices(regionCode);
|
|
6668
6711
|
return (jsx(OfficesAtmsMapLayout, { className: className, data: data?.branches, isLoad: isLoad, remoteWorkplaces: data?.remoteWorkplaces, renderCard: renderOfficeCard, renderRemoteWorkplaceCard: renderRemoteWorkplaceCard, getBalloon: getOfficePoint, getBalloonRemoteWorkplaces: getRemoteWorkplacePoint, title: `Офисы филиала ${currentLocation?.name}` }));
|
|
@@ -7346,7 +7389,7 @@
|
|
|
7346
7389
|
onClose && onClose(dialogs[dialogs.length - 1]);
|
|
7347
7390
|
pop();
|
|
7348
7391
|
}, [dialogs, onClose]);
|
|
7349
|
-
useEffect(() => defaultEventBus.subscribe('dialog', (action) => {
|
|
7392
|
+
useEffect(() => defaultEventBus.observable.subscribe('dialog', (action) => {
|
|
7350
7393
|
switch (action.type) {
|
|
7351
7394
|
case 'open':
|
|
7352
7395
|
push(action);
|
|
@@ -7403,7 +7446,7 @@
|
|
|
7403
7446
|
const close = useCallback(() => {
|
|
7404
7447
|
setPopup(null);
|
|
7405
7448
|
}, []);
|
|
7406
|
-
useEffect(() => defaultEventBus.subscribe('popup', (action) => {
|
|
7449
|
+
useEffect(() => defaultEventBus.observable.subscribe('popup', (action) => {
|
|
7407
7450
|
switch (action.type) {
|
|
7408
7451
|
case 'open':
|
|
7409
7452
|
case 'update':
|
|
@@ -7458,7 +7501,7 @@
|
|
|
7458
7501
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
7459
7502
|
});
|
|
7460
7503
|
|
|
7461
|
-
const packageVersion = "0.14.
|
|
7504
|
+
const packageVersion = "0.14.595";
|
|
7462
7505
|
|
|
7463
7506
|
exports.Blocks = Blocks;
|
|
7464
7507
|
exports.ContentPage = ContentPage;
|