@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
|
@@ -411,39 +411,58 @@
|
|
|
411
411
|
].join(' ');
|
|
412
412
|
|
|
413
413
|
class EventBus {
|
|
414
|
-
|
|
414
|
+
subscribersMap = {};
|
|
415
415
|
subjectsStateMap = {};
|
|
416
|
+
emitter = this;
|
|
417
|
+
observable = this;
|
|
416
418
|
subscribe(type, listener) {
|
|
417
|
-
this.
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
listener(latestEvent);
|
|
421
|
-
}
|
|
419
|
+
this.subscribersMap[type] ||= [];
|
|
420
|
+
this.subscribersMap[type]?.push(listener);
|
|
421
|
+
this.fireSubscribers([listener], this.subjectsStateMap[type]);
|
|
422
422
|
return () => {
|
|
423
423
|
this.unsubscribe(type, listener);
|
|
424
424
|
};
|
|
425
425
|
}
|
|
426
426
|
unsubscribe(type, listener) {
|
|
427
|
-
|
|
427
|
+
const index = this.subscribersMap[type]?.indexOf(listener);
|
|
428
|
+
if (index && index !== -1) {
|
|
429
|
+
this.subscribersMap[type]?.splice(index, 1);
|
|
430
|
+
}
|
|
428
431
|
}
|
|
429
432
|
fire(type, event) {
|
|
430
433
|
const isSubjectDeclared = type in this.subjectsStateMap;
|
|
431
434
|
if (isSubjectDeclared) {
|
|
432
|
-
this.
|
|
435
|
+
this.subject(type, event);
|
|
436
|
+
}
|
|
437
|
+
else {
|
|
438
|
+
this.fireSubscribers(this.subscribersMap[type], event);
|
|
433
439
|
}
|
|
434
|
-
this.subscribers[type]?.forEach((s) => s(event));
|
|
435
440
|
}
|
|
436
441
|
subject(type, event) {
|
|
437
|
-
this.subjectsStateMap[type]
|
|
442
|
+
if (this.subjectsStateMap[type] !== event) {
|
|
443
|
+
this.subjectsStateMap[type] = event;
|
|
444
|
+
this.fireSubscribers(this.subscribersMap[type], event);
|
|
445
|
+
}
|
|
446
|
+
return () => {
|
|
447
|
+
delete this.subjectsStateMap[type];
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
fireSubscribers(subscribers, event) {
|
|
451
|
+
if (!subscribers || !event) {
|
|
452
|
+
return;
|
|
453
|
+
}
|
|
454
|
+
for (const _ of subscribers) {
|
|
455
|
+
_(event);
|
|
456
|
+
}
|
|
438
457
|
}
|
|
439
458
|
}
|
|
440
459
|
|
|
441
460
|
const defaultEventBus = new EventBus();
|
|
442
461
|
|
|
443
462
|
const useDialogManager = () => ({
|
|
444
|
-
open: (dialog, options = {}) => defaultEventBus.fire('dialog', { type: 'open', dialog, ...options }),
|
|
445
|
-
close: () => defaultEventBus.fire('dialog', { type: 'close' }),
|
|
446
|
-
closeAll: () => defaultEventBus.fire('dialog', { type: 'close', all: true }),
|
|
463
|
+
open: (dialog, options = {}) => defaultEventBus.emitter.fire('dialog', { type: 'open', dialog, ...options }),
|
|
464
|
+
close: () => defaultEventBus.emitter.fire('dialog', { type: 'close' }),
|
|
465
|
+
closeAll: () => defaultEventBus.emitter.fire('dialog', { type: 'close', all: true }),
|
|
447
466
|
});
|
|
448
467
|
|
|
449
468
|
const adjustBase = (href, basePath = '') => href.replace(basePath, '') || '/';
|
|
@@ -1098,6 +1117,7 @@
|
|
|
1098
1117
|
{ key: 'phone', text: 'Телефонный звонок' },
|
|
1099
1118
|
{ key: 'email', text: 'Электронное сообщение' },
|
|
1100
1119
|
];
|
|
1120
|
+
// TODO Тоже надо рефакторить - файлик constants
|
|
1101
1121
|
const OUT_SERVICE_URL = '/api/v1/outservice/outserviceregions';
|
|
1102
1122
|
|
|
1103
1123
|
const getRegionUrl = (typeForm) => typeForm === 'OUTSERVICE' ? OUT_SERVICE_URL : undefined;
|
|
@@ -1170,6 +1190,8 @@
|
|
|
1170
1190
|
return targetRef;
|
|
1171
1191
|
}
|
|
1172
1192
|
|
|
1193
|
+
const getRequiredLabel = ({ label, errors }) => label && errors ? `${label}*` : label;
|
|
1194
|
+
|
|
1173
1195
|
const noop = () => {
|
|
1174
1196
|
// Do nothing
|
|
1175
1197
|
};
|
|
@@ -1273,9 +1295,9 @@
|
|
|
1273
1295
|
};
|
|
1274
1296
|
|
|
1275
1297
|
const usePopupManager = () => ({
|
|
1276
|
-
open: (popup, options) => defaultEventBus.fire('popup', { type: 'open', popup, ...options }),
|
|
1277
|
-
update: (popup, options) => defaultEventBus.fire('popup', { type: 'update', popup, ...options }),
|
|
1278
|
-
close: () => defaultEventBus.fire('popup', { type: 'close' }),
|
|
1298
|
+
open: (popup, options) => defaultEventBus.emitter.fire('popup', { type: 'open', popup, ...options }),
|
|
1299
|
+
update: (popup, options) => defaultEventBus.emitter.fire('popup', { type: 'update', popup, ...options }),
|
|
1300
|
+
close: () => defaultEventBus.emitter.fire('popup', { type: 'close' }),
|
|
1279
1301
|
});
|
|
1280
1302
|
|
|
1281
1303
|
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()))) })));
|
|
@@ -1341,9 +1363,8 @@
|
|
|
1341
1363
|
value,
|
|
1342
1364
|
onChange,
|
|
1343
1365
|
});
|
|
1344
|
-
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:
|
|
1366
|
+
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)] }));
|
|
1345
1367
|
});
|
|
1346
|
-
const getLabel = (errors, label) => (label && errors ? `${label}*` : label);
|
|
1347
1368
|
const getPlaceholder = (placeholder, errors, label) => errors && !label ? `${placeholder}*` : placeholder;
|
|
1348
1369
|
|
|
1349
1370
|
const formatOption = (_) => _?.text || _?.key || '';
|
|
@@ -1391,12 +1412,10 @@
|
|
|
1391
1412
|
return inputRef;
|
|
1392
1413
|
}
|
|
1393
1414
|
|
|
1394
|
-
const Select = JSX(
|
|
1395
|
-
// eslint-disable-next-line complexity
|
|
1396
|
-
({ className, label, options = [], value, valid = true, isBorder = true, placeholder = '', isSearch = false, iconVersion = 'black', onChange, disabled, }) => {
|
|
1415
|
+
const Select = JSX(({ className, label, options = [], value, valid = true, isBorder = true, placeholder = '', isSearch = false, iconVersion = 'black', onChange, disabled = false, }) => {
|
|
1397
1416
|
const [isOpen, { setFalse: close, setTrue: open }] = useBool();
|
|
1398
1417
|
const [query, setQuery] = useState('');
|
|
1399
|
-
const isDisabled = disabled
|
|
1418
|
+
const isDisabled = getDisabled(disabled, options.length);
|
|
1400
1419
|
const hasOpen = isOpen && !isDisabled;
|
|
1401
1420
|
const handleClose = useCallback(() => {
|
|
1402
1421
|
setQuery('');
|
|
@@ -1415,8 +1434,9 @@
|
|
|
1415
1434
|
});
|
|
1416
1435
|
const renderIcon$2 = (isOpen, iconVersion) => (jsx(Icon, { className: style('absolute right-0 flex self-center', { 'rotate-180': !isOpen }), iconVersion: iconVersion, name: "ArrowUpIcon", width: "16", height: "16" }));
|
|
1417
1436
|
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');
|
|
1437
|
+
const getDisabled = (disabled, length) => disabled || length === 0;
|
|
1418
1438
|
|
|
1419
|
-
const SelectControl = JSX(({ className = '', label, error, ...rest }) => (jsxs("div", { className: className, children: [jsx(Select, { ...rest, valid: !error, label:
|
|
1439
|
+
const SelectControl = JSX(({ className = '', label, error, errors, ...rest }) => (jsxs("div", { className: className, children: [jsx(Select, { ...rest, valid: !error, label: getRequiredLabel({ label, errors }) }), renderErrorText(error)] })));
|
|
1420
1440
|
|
|
1421
1441
|
const getNamesFromInput = (inputs) => Object.values(inputs.filter((_) => _))?.map((_) => _.name);
|
|
1422
1442
|
|
|
@@ -1541,6 +1561,7 @@
|
|
|
1541
1561
|
};
|
|
1542
1562
|
};
|
|
1543
1563
|
|
|
1564
|
+
// TODO Зачем это?
|
|
1544
1565
|
const getValidation = (field, validator, required = false) => required ? withValidator(field, validator) : field;
|
|
1545
1566
|
|
|
1546
1567
|
const ACQUIRING_TYPES = [
|
|
@@ -1920,7 +1941,7 @@
|
|
|
1920
1941
|
});
|
|
1921
1942
|
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" })] }));
|
|
1922
1943
|
|
|
1923
|
-
const DatePickerControl = JSX(({ className, label, error, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(DatePicker, { label: label
|
|
1944
|
+
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)] })));
|
|
1924
1945
|
|
|
1925
1946
|
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 })));
|
|
1926
1947
|
|
|
@@ -2025,9 +2046,11 @@
|
|
|
2025
2046
|
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 })));
|
|
2026
2047
|
|
|
2027
2048
|
const REGIONS_URL = '/api/v1/regions';
|
|
2049
|
+
const EMPTY_REGIONS = [];
|
|
2050
|
+
// TODO Почему url можно менять? Разве смысл не в инкапсуляции api url. Тоже под рефакторинг попадает
|
|
2028
2051
|
function useRegions(url = REGIONS_URL) {
|
|
2029
2052
|
const { data } = useAsyncData(url, fetchJSONUnsafe);
|
|
2030
|
-
return Array.isArray(data) ? data :
|
|
2053
|
+
return Array.isArray(data) ? data : EMPTY_REGIONS;
|
|
2031
2054
|
}
|
|
2032
2055
|
|
|
2033
2056
|
const LocalitiesField = JSX(({ field, input }) => {
|
|
@@ -2092,7 +2115,7 @@
|
|
|
2092
2115
|
return (jsx(Input, { ...inputProps, onChange: handleChange, onFocus: (ev) => handleChange(ev?.target?.value || ''), onBlur: (ev) => handleBlur(ev?.target?.value || ''), children: children }));
|
|
2093
2116
|
});
|
|
2094
2117
|
|
|
2095
|
-
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
|
|
2118
|
+
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)] })));
|
|
2096
2119
|
|
|
2097
2120
|
const PhoneField = JSX(({ field, input }) => (jsx(InputPhoneControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...getValidation(field('phone'), validatorObj.phone, input?.required), ...input })));
|
|
2098
2121
|
|
|
@@ -2135,15 +2158,16 @@
|
|
|
2135
2158
|
horizontal: '@lg:flex-row',
|
|
2136
2159
|
vertical: '',
|
|
2137
2160
|
};
|
|
2138
|
-
const RadioButtonGroup = JSX(({
|
|
2161
|
+
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)))) })] })));
|
|
2162
|
+
|
|
2163
|
+
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)] })));
|
|
2139
2164
|
|
|
2140
2165
|
const SEX_TYPES = [
|
|
2141
2166
|
{ id: 'male', text: 'Мужской' },
|
|
2142
2167
|
{ id: 'female', text: 'Женский' },
|
|
2143
2168
|
];
|
|
2144
|
-
const SexField = JSX(({ field }) => {
|
|
2145
|
-
|
|
2146
|
-
return (jsx(RadioButtonGroup, { title: "\u041F\u043E\u043B", orientation: "horizontal", items: SEX_TYPES, checkedItem: value, onChange: (_) => onChange && onChange(_) }));
|
|
2169
|
+
const SexField = JSX(({ field, input }) => {
|
|
2170
|
+
return (jsx("div", { children: jsx(RadioButtonGroupControl, { label: "\u041F\u043E\u043B", orientation: "horizontal", items: SEX_TYPES, ...getValidation(field('sex'), validatorObj.sex, input?.required) }) }));
|
|
2147
2171
|
});
|
|
2148
2172
|
|
|
2149
2173
|
const isPlaceholder = (_) => _ === '_';
|
|
@@ -2176,7 +2200,7 @@
|
|
|
2176
2200
|
return (jsx(Input, { ...inputProps, onChange: handleChange, onFocus: (ev) => handleChange(ev?.target?.value || ''), onBlur: (ev) => handleBlur(ev?.target?.value || ''), children: children }));
|
|
2177
2201
|
});
|
|
2178
2202
|
|
|
2179
|
-
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
|
|
2203
|
+
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)] })));
|
|
2180
2204
|
|
|
2181
2205
|
const SnilsField = JSX(({ field, input }) => (jsx(InputSnilsControl, { label: "\u0421\u041D\u0418\u041B\u0421", ...getValidation(field('snils'), validatorObj.snils, input?.required), ...input })));
|
|
2182
2206
|
|
|
@@ -2205,7 +2229,7 @@
|
|
|
2205
2229
|
field?.('region')?.onChange?.('');
|
|
2206
2230
|
}
|
|
2207
2231
|
}, [value]);
|
|
2208
|
-
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,
|
|
2232
|
+
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(_) }) }));
|
|
2209
2233
|
});
|
|
2210
2234
|
|
|
2211
2235
|
function isRenderField({ input, field, }) {
|
|
@@ -2550,6 +2574,14 @@
|
|
|
2550
2574
|
return { ...formState, typeForm: { key: typeForm, text: '' } };
|
|
2551
2575
|
};
|
|
2552
2576
|
|
|
2577
|
+
const FoldableWrapper = JSX(({ className, children }) => (jsx("div", { className: className, role: "group", children: children })));
|
|
2578
|
+
/**
|
|
2579
|
+
* Какой то бесполезный компонент. Его можно заменить на useBool
|
|
2580
|
+
* Лучше оставить только обёрточный div с необходимой атрибутикой
|
|
2581
|
+
* и сделать пассивный компонент
|
|
2582
|
+
*
|
|
2583
|
+
* @deprecated
|
|
2584
|
+
*/
|
|
2553
2585
|
const Foldable = JSX(({ className = '', isFoldButtonOnTop = false, unfoldedByDefault = false, renderFoldableSection, renderFoldButton, }) => {
|
|
2554
2586
|
const [isUnfolded, setIsUnfolded] = useState(unfoldedByDefault);
|
|
2555
2587
|
const onToggle = useCallback(() => {
|
|
@@ -2557,7 +2589,7 @@
|
|
|
2557
2589
|
}, []);
|
|
2558
2590
|
const sectionNode = renderFoldableSection({ isUnfolded, onToggle });
|
|
2559
2591
|
const buttonNode = renderFoldButton ? renderFoldButton({ isUnfolded, onToggle }) : null;
|
|
2560
|
-
return isFoldButtonOnTop ? (jsxs(
|
|
2592
|
+
return isFoldButtonOnTop ? (jsxs(FoldableWrapper, { className: className, children: [buttonNode, sectionNode] })) : (jsxs(FoldableWrapper, { className: className, children: [sectionNode, buttonNode] }));
|
|
2561
2593
|
});
|
|
2562
2594
|
|
|
2563
2595
|
function useResizeObserver(callback, deps) {
|
|
@@ -3638,7 +3670,7 @@
|
|
|
3638
3670
|
const renderDaysInput = (props) => (jsx(InputRange, { items: [`От ${daysText(props.min || 0)}`, `До ${daysText(props.max || 0)}`], step: STEP_DAYS, ...props }));
|
|
3639
3671
|
const daysText = (days) => `${days} ${Number(days) % 10 === 1 ? 'дня' : 'дней'}`;
|
|
3640
3672
|
|
|
3641
|
-
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,
|
|
3673
|
+
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 })] }));
|
|
3642
3674
|
|
|
3643
3675
|
const renderPayout = (props) => renderBinaryRadioButtonGroup({
|
|
3644
3676
|
...props,
|
|
@@ -4635,31 +4667,37 @@
|
|
|
4635
4667
|
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)] }) }) })));
|
|
4636
4668
|
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;
|
|
4637
4669
|
|
|
4670
|
+
const useSubjectState = (eventBus, type, initialState) => {
|
|
4671
|
+
const [state, setState] = useState(initialState);
|
|
4672
|
+
useEffect(() => eventBus.subscribe(type, setState), [eventBus, type]);
|
|
4673
|
+
return state;
|
|
4674
|
+
};
|
|
4675
|
+
|
|
4638
4676
|
const renderCardInfo = (cell, i) => {
|
|
4639
4677
|
const { title, description, buttons } = cell;
|
|
4640
4678
|
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)));
|
|
4641
4679
|
};
|
|
4642
4680
|
|
|
4643
|
-
const
|
|
4644
|
-
const
|
|
4645
|
-
const [visibleCells, hiddenCells] = visibleCellsCount > 0
|
|
4646
|
-
? [
|
|
4647
|
-
: [
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4681
|
+
const CardCellsSection = JSX((props) => {
|
|
4682
|
+
const { cardCells = [], visibleCellsCount = 1, isUnfolded } = props;
|
|
4683
|
+
const [visibleCells, hiddenCells] = visibleCellsCount > 0 && cardCells.length >= visibleCellsCount
|
|
4684
|
+
? [cardCells.slice(0, visibleCellsCount), cardCells.slice(visibleCellsCount)]
|
|
4685
|
+
: [cardCells, []];
|
|
4686
|
+
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) }));
|
|
4687
|
+
});
|
|
4688
|
+
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" })] })));
|
|
4689
|
+
|
|
4690
|
+
const carouselTariffsCardEventBus = new EventBus();
|
|
4691
|
+
|
|
4692
|
+
const CarouselTariffsCard = JSX(({ className, title, align = 'text-center', icon, button, visibleCellsCount = 1, cardCells = [], options, data, ...rest }) => {
|
|
4693
|
+
const { isUnfolded, parent: firedParent } = useSubjectState(carouselTariffsCardEventBus.observable, 'fold', {});
|
|
4694
|
+
const isVisible = isUnfolded && firedParent === options?.parent;
|
|
4695
|
+
const toggle = useCallback(() => carouselTariffsCardEventBus.emitter.fire('fold', {
|
|
4696
|
+
isUnfolded: !isVisible,
|
|
4697
|
+
parent: options?.parent,
|
|
4698
|
+
}), [isVisible, options?.parent]);
|
|
4699
|
+
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 })] }));
|
|
4700
|
+
});
|
|
4663
4701
|
|
|
4664
4702
|
const isRateRow = (rateRow) => typeof rateRow?.minMonths === 'number' && typeof rateRow?.maxMonths === 'number';
|
|
4665
4703
|
|
|
@@ -4826,47 +4864,46 @@
|
|
|
4826
4864
|
};
|
|
4827
4865
|
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] })));
|
|
4828
4866
|
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4867
|
+
function useSubject(eventBus, type, initialState) {
|
|
4868
|
+
useEffect(() => {
|
|
4869
|
+
const state = initialState instanceof Function ? initialState() : initialState;
|
|
4870
|
+
if (state instanceof Promise) {
|
|
4871
|
+
state.then((_) => eventBus.subject(type, _), console.warn);
|
|
4872
|
+
}
|
|
4873
|
+
else {
|
|
4874
|
+
eventBus.subject(type, state);
|
|
4875
|
+
}
|
|
4876
|
+
}, [eventBus, type]);
|
|
4877
|
+
return useCallback((_) => eventBus.fire(type, _), [eventBus, type]);
|
|
4878
|
+
}
|
|
4835
4879
|
|
|
4836
4880
|
const REGION_URL = '/api/v1/region';
|
|
4837
4881
|
const LOCATION_STORAGE_KEY = 'location';
|
|
4838
4882
|
function useLocation(defaultLocation = 'Москва') {
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4883
|
+
useEffect(() => defaultEventBus.subscribe('location', storeLocation), []);
|
|
4884
|
+
return useSubject(defaultEventBus.emitter, 'location', restoreLocation(defaultLocation));
|
|
4885
|
+
}
|
|
4886
|
+
function useLocationState(defaultLocation = 'Москва') {
|
|
4887
|
+
return useSubjectState(defaultEventBus.observable, 'location', { name: defaultLocation });
|
|
4888
|
+
}
|
|
4889
|
+
function restoreLocation(defaultLocation) {
|
|
4890
|
+
return async () => {
|
|
4891
|
+
if (!globalThis.localStorage?.hasItem(LOCATION_STORAGE_KEY)) {
|
|
4892
|
+
storeLocation(await fetchJSON(REGION_URL));
|
|
4848
4893
|
}
|
|
4849
|
-
|
|
4850
|
-
|
|
4894
|
+
const storedLocation = globalThis.localStorage?.getItem(LOCATION_STORAGE_KEY);
|
|
4895
|
+
try {
|
|
4896
|
+
return storedLocation && JSON.parse(storedLocation);
|
|
4897
|
+
}
|
|
4898
|
+
catch (ex) {
|
|
4899
|
+
// Do nothing
|
|
4900
|
+
}
|
|
4901
|
+
return { name: defaultLocation };
|
|
4902
|
+
};
|
|
4903
|
+
}
|
|
4904
|
+
function storeLocation(_) {
|
|
4905
|
+
_ && globalThis.localStorage?.setItem(LOCATION_STORAGE_KEY, JSON.stringify(_));
|
|
4851
4906
|
}
|
|
4852
|
-
const hasStoredLocation = () => Boolean(globalThis.localStorage?.getItem(LOCATION_STORAGE_KEY));
|
|
4853
|
-
const restoreLocation = () => {
|
|
4854
|
-
try {
|
|
4855
|
-
const data = globalThis.localStorage?.getItem(LOCATION_STORAGE_KEY);
|
|
4856
|
-
return data && JSON.parse(data);
|
|
4857
|
-
}
|
|
4858
|
-
catch (ex) {
|
|
4859
|
-
return null;
|
|
4860
|
-
}
|
|
4861
|
-
};
|
|
4862
|
-
const storeLocation = (_) => {
|
|
4863
|
-
try {
|
|
4864
|
-
globalThis.localStorage?.setItem(LOCATION_STORAGE_KEY, JSON.stringify(_));
|
|
4865
|
-
}
|
|
4866
|
-
catch (ex) {
|
|
4867
|
-
// Do nothing
|
|
4868
|
-
}
|
|
4869
|
-
};
|
|
4870
4907
|
|
|
4871
4908
|
var Currency;
|
|
4872
4909
|
(function (Currency) {
|
|
@@ -5008,7 +5045,7 @@
|
|
|
5008
5045
|
}
|
|
5009
5046
|
|
|
5010
5047
|
const ExchangeRateTile = JSX(({ className = '', title = 'Курсы обмена валют', button, ...rest }) => {
|
|
5011
|
-
const
|
|
5048
|
+
const currentLocation = useLocationState();
|
|
5012
5049
|
const exchangeRates = useFetchExchangeRateData(currentLocation);
|
|
5013
5050
|
const currencyRates = getCurrencyRates(exchangeRates?.exchangeRate?.currencies);
|
|
5014
5051
|
const currencyRatesBuy = currencyRates.filter((_) => _.buyExchangeRate);
|
|
@@ -5861,7 +5898,7 @@
|
|
|
5861
5898
|
designDisabledPeople: (item) => Boolean(item.designDisabledPeople),
|
|
5862
5899
|
};
|
|
5863
5900
|
const AtmsMap = JSX(({ descriptionData, className }) => {
|
|
5864
|
-
const
|
|
5901
|
+
const currentLocation = useLocationState();
|
|
5865
5902
|
const regionCode = currentLocation?.code ?? '000';
|
|
5866
5903
|
const { data: officesData, isLoad } = useAtms(regionCode);
|
|
5867
5904
|
return (jsx(OfficesAtmsMapLayout, { className: className, filterItems: filterItems, data: officesData, isLoad: isLoad, initFilterState: INITIAL_FILTRATION_STATE, renderCard: renderAtmCard, getBalloon: getAtmPoint, title: `Банкоматы филиала ${currentLocation?.name}`, descriptionData: descriptionData }));
|
|
@@ -6080,7 +6117,7 @@
|
|
|
6080
6117
|
};
|
|
6081
6118
|
|
|
6082
6119
|
const OfficesMap = JSX(({ className }) => {
|
|
6083
|
-
const
|
|
6120
|
+
const currentLocation = useLocationState();
|
|
6084
6121
|
const regionCode = currentLocation?.code ?? '000';
|
|
6085
6122
|
const { data, isLoad } = useOffices(regionCode);
|
|
6086
6123
|
return (jsx(OfficesAtmsMapLayout, { className: className, data: data?.branches, isLoad: isLoad, remoteWorkplaces: data?.remoteWorkplaces, renderCard: renderOfficeCard, renderRemoteWorkplaceCard: renderRemoteWorkplaceCard, getBalloon: getOfficePoint, getBalloonRemoteWorkplaces: getRemoteWorkplacePoint, title: `Офисы филиала ${currentLocation?.name}` }));
|
|
@@ -6328,7 +6365,7 @@
|
|
|
6328
6365
|
onClose && onClose(dialogs[dialogs.length - 1]);
|
|
6329
6366
|
pop();
|
|
6330
6367
|
}, [dialogs, onClose]);
|
|
6331
|
-
useEffect(() => defaultEventBus.subscribe('dialog', (action) => {
|
|
6368
|
+
useEffect(() => defaultEventBus.observable.subscribe('dialog', (action) => {
|
|
6332
6369
|
switch (action.type) {
|
|
6333
6370
|
case 'open':
|
|
6334
6371
|
push(action);
|
|
@@ -6437,27 +6474,33 @@
|
|
|
6437
6474
|
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" })] }));
|
|
6438
6475
|
});
|
|
6439
6476
|
|
|
6440
|
-
const
|
|
6441
|
-
|
|
6442
|
-
const [currentLocation, selectCurrentLocation] = useLocation(branches?.default);
|
|
6477
|
+
const SelectedLocation = JSX(({ defaultLocation }) => {
|
|
6478
|
+
const currentLocation = useLocationState(defaultLocation);
|
|
6443
6479
|
const link = useLink();
|
|
6444
6480
|
const { href } = link({ href: `/branches/${currentLocation.slug}` });
|
|
6481
|
+
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;
|
|
6482
|
+
});
|
|
6483
|
+
|
|
6484
|
+
const SEARCH_TERM_MIN_LENGTH = 3;
|
|
6485
|
+
const LocationDialog = JSX(({ foreignOffices, branches }) => {
|
|
6486
|
+
const selectLocation = useLocation(branches?.default);
|
|
6445
6487
|
const [query, setQuery] = useState('');
|
|
6446
|
-
const
|
|
6447
|
-
const
|
|
6488
|
+
const rawRegions = useRegions();
|
|
6489
|
+
const regions = useMemo(() => cleanUpRegions(rawRegions).sort((a, b) => (a.name ?? '').localeCompare(b.name ?? '')), [rawRegions]);
|
|
6490
|
+
const regionsGroupByLetter = useMemo(() => groupBy(regions, regionFirstLetter), [regions]);
|
|
6448
6491
|
const { close } = useDialogManager();
|
|
6449
6492
|
const handleChangeLocation = useCallback((region) => {
|
|
6450
|
-
|
|
6493
|
+
selectLocation(region);
|
|
6451
6494
|
close();
|
|
6452
6495
|
}, []);
|
|
6453
|
-
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" }),
|
|
6496
|
+
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
|
|
6454
6497
|
.filter(({ name }) => name && jaroWinklerDistance(name.toLowerCase())(query.toLowerCase()) >= 0.8)
|
|
6455
6498
|
.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)] }));
|
|
6456
6499
|
});
|
|
6457
|
-
const regionFirstLetter = (region) => region.name?.charAt(0)
|
|
6500
|
+
const regionFirstLetter = (region) => region.name?.charAt(0) ?? '';
|
|
6458
6501
|
const cleanUpRegions = (regions) => regions.map((region) => ({
|
|
6459
6502
|
...region,
|
|
6460
|
-
name: region.name?.replace(/республика|область|край'/gi, '').trim()
|
|
6503
|
+
name: region.name?.replace(/республика|область|край'/gi, '').trim() ?? '',
|
|
6461
6504
|
}));
|
|
6462
6505
|
|
|
6463
6506
|
const useLocationDialog = (props) => {
|
|
@@ -6470,7 +6513,7 @@
|
|
|
6470
6513
|
|
|
6471
6514
|
const BurgerMenuDialog = JSX(({ menuRef, menuItem, locationDialogProps, closeAll }) => {
|
|
6472
6515
|
const locationDialog = useLocationDialog(locationDialogProps || {});
|
|
6473
|
-
const
|
|
6516
|
+
const { name: location } = useLocationState();
|
|
6474
6517
|
const menuDimensions = menuRef?.current?.getBoundingClientRect();
|
|
6475
6518
|
const basePath = getBasePath(env.SITE_URL);
|
|
6476
6519
|
const handleIframeLoad = () => {
|
|
@@ -7030,7 +7073,7 @@
|
|
|
7030
7073
|
const close = useCallback(() => {
|
|
7031
7074
|
setPopup(null);
|
|
7032
7075
|
}, []);
|
|
7033
|
-
useEffect(() => defaultEventBus.subscribe('popup', (action) => {
|
|
7076
|
+
useEffect(() => defaultEventBus.observable.subscribe('popup', (action) => {
|
|
7034
7077
|
switch (action.type) {
|
|
7035
7078
|
case 'open':
|
|
7036
7079
|
case 'update':
|
|
@@ -7085,7 +7128,7 @@
|
|
|
7085
7128
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
7086
7129
|
});
|
|
7087
7130
|
|
|
7088
|
-
const packageVersion = "0.14.
|
|
7131
|
+
const packageVersion = "0.14.595";
|
|
7089
7132
|
|
|
7090
7133
|
exports.Blocks = Blocks;
|
|
7091
7134
|
exports.ContentPage = ContentPage;
|