@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
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
|
|
3
|
+
export type NotUndefined = object | null;
|
|
4
|
+
export type Reducer<S, A extends NotUndefined> = (state: S, action: A) => S;
|
|
5
|
+
export type Dispatch<A extends NotUndefined> = (action: A) => void;
|
|
6
|
+
|
|
7
|
+
export function useReducer<S, A extends NotUndefined>(
|
|
8
|
+
reducer: Reducer<S, A>,
|
|
9
|
+
initialArg: S,
|
|
10
|
+
): [state: S, dispatch: Dispatch<A>] {
|
|
11
|
+
const [state, setState] = useState(initialArg);
|
|
12
|
+
|
|
13
|
+
const dispatch = useCallback(
|
|
14
|
+
(action: A) => {
|
|
15
|
+
setState((_) => reducer(_, action));
|
|
16
|
+
},
|
|
17
|
+
[reducer],
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
return [state, dispatch];
|
|
21
|
+
}
|
|
@@ -11,8 +11,11 @@ export interface Region {
|
|
|
11
11
|
localities?: string[];
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
const EMPTY_REGIONS: Region[] = [];
|
|
15
|
+
|
|
16
|
+
// TODO Почему url можно менять? Разве смысл не в инкапсуляции api url. Тоже под рефакторинг попадает
|
|
14
17
|
export function useRegions(url: string = REGIONS_URL): Region[] {
|
|
15
18
|
const { data } = useAsyncData(url, fetchJSONUnsafe as FetchJSONUnsafeType<Region[]>);
|
|
16
19
|
|
|
17
|
-
return Array.isArray(data) ? data :
|
|
20
|
+
return Array.isArray(data) ? data : EMPTY_REGIONS;
|
|
18
21
|
}
|
|
@@ -44,7 +44,7 @@ export const renderBinaryRadioButtonGroup = ({
|
|
|
44
44
|
<RadioButtonGroup
|
|
45
45
|
orientation={orientation}
|
|
46
46
|
items={items}
|
|
47
|
-
|
|
47
|
+
value={items[value ? 0 : 1].id}
|
|
48
48
|
onChange={(_) => onChange && onChange(_ === items[0].id)}
|
|
49
49
|
{...rest}
|
|
50
50
|
/>
|
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { type DefaultControlType } from '../../model/DefaultControlType';
|
|
3
|
+
import { getRequiredLabel } from '../../utils/getRequiredLabel';
|
|
2
4
|
import { style } from '../../utils/style';
|
|
5
|
+
import { type ControlProps } from '../ControlProps';
|
|
3
6
|
import { renderErrorText } from '../Input/renderErrorText';
|
|
4
7
|
import { DatePicker } from './DatePicker';
|
|
5
8
|
|
|
6
|
-
export interface DatePickerControlProps {
|
|
7
|
-
className?: string;
|
|
8
|
-
label: string;
|
|
9
|
-
value?: Date;
|
|
10
|
-
error?: string;
|
|
11
|
-
errors?: string[];
|
|
12
|
-
onChange?: (value: Date) => void;
|
|
13
|
-
}
|
|
9
|
+
export interface DatePickerControlProps extends DefaultControlType, ControlProps<Date> {}
|
|
14
10
|
|
|
15
11
|
export const DatePickerControl = JSX<DatePickerControlProps>(
|
|
16
|
-
({ className, label, error, ...rest }) => (
|
|
12
|
+
({ className, label, error, errors, ...rest }) => (
|
|
17
13
|
<div className={style('shrink-0 w-full', className)}>
|
|
18
|
-
<DatePicker
|
|
19
|
-
label={label && rest?.errors ? `${label}*` : label}
|
|
20
|
-
valid={Boolean(!error)}
|
|
21
|
-
{...rest}
|
|
22
|
-
/>
|
|
14
|
+
<DatePicker label={getRequiredLabel({ label, errors })} valid={Boolean(!error)} {...rest} />
|
|
23
15
|
{renderErrorText(error)}
|
|
24
16
|
</div>
|
|
25
17
|
),
|
|
@@ -8,7 +8,7 @@ export interface DialogOptions {
|
|
|
8
8
|
|
|
9
9
|
export const useDialogManager = () => ({
|
|
10
10
|
open: (dialog: VNode, options: DialogOptions = {}) =>
|
|
11
|
-
defaultEventBus.fire('dialog', { type: 'open', dialog, ...options }),
|
|
12
|
-
close: () => defaultEventBus.fire('dialog', { type: 'close' }),
|
|
13
|
-
closeAll: () => defaultEventBus.fire('dialog', { type: 'close', all: true }),
|
|
11
|
+
defaultEventBus.emitter.fire('dialog', { type: 'open', dialog, ...options }),
|
|
12
|
+
close: () => defaultEventBus.emitter.fire('dialog', { type: 'close' }),
|
|
13
|
+
closeAll: () => defaultEventBus.emitter.fire('dialog', { type: 'close', all: true }),
|
|
14
14
|
});
|
|
@@ -3,14 +3,30 @@ import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
|
3
3
|
import { type VNode } from '../../model/VNode';
|
|
4
4
|
import { type FoldablePartProps } from './FoldablePartProps';
|
|
5
5
|
|
|
6
|
-
export interface
|
|
6
|
+
export interface FoldableWrapperProps {
|
|
7
7
|
className?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface FoldableProps extends FoldableWrapperProps {
|
|
8
11
|
unfoldedByDefault?: boolean;
|
|
9
12
|
isFoldButtonOnTop?: boolean;
|
|
10
13
|
renderFoldableSection: (props: FoldablePartProps) => VNode;
|
|
11
14
|
renderFoldButton?: ((props: FoldablePartProps) => VNode) | null;
|
|
12
15
|
}
|
|
13
16
|
|
|
17
|
+
export const FoldableWrapper = JSX<FoldableWrapperProps>(({ className, children }) => (
|
|
18
|
+
<div className={className} role="group">
|
|
19
|
+
{children}
|
|
20
|
+
</div>
|
|
21
|
+
));
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Какой то бесполезный компонент. Его можно заменить на useBool
|
|
25
|
+
* Лучше оставить только обёрточный div с необходимой атрибутикой
|
|
26
|
+
* и сделать пассивный компонент
|
|
27
|
+
*
|
|
28
|
+
* @deprecated
|
|
29
|
+
*/
|
|
14
30
|
export const Foldable = JSX<FoldableProps>(
|
|
15
31
|
({
|
|
16
32
|
className = '',
|
|
@@ -29,15 +45,15 @@ export const Foldable = JSX<FoldableProps>(
|
|
|
29
45
|
const buttonNode = renderFoldButton ? renderFoldButton({ isUnfolded, onToggle }) : null;
|
|
30
46
|
|
|
31
47
|
return isFoldButtonOnTop ? (
|
|
32
|
-
<
|
|
48
|
+
<FoldableWrapper className={className}>
|
|
33
49
|
{buttonNode}
|
|
34
50
|
{sectionNode}
|
|
35
|
-
</
|
|
51
|
+
</FoldableWrapper>
|
|
36
52
|
) : (
|
|
37
|
-
<
|
|
53
|
+
<FoldableWrapper className={className}>
|
|
38
54
|
{sectionNode}
|
|
39
55
|
{buttonNode}
|
|
40
|
-
</
|
|
56
|
+
</FoldableWrapper>
|
|
41
57
|
);
|
|
42
58
|
},
|
|
43
59
|
);
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { type RadioButtonItem } from '../../RadioButtonGroup/RadioButtonGroup';
|
|
3
|
+
import { RadioButtonGroupControl } from '../../RadioButtonGroup/RadioButtonGroupControl';
|
|
3
4
|
import { type CustomFieldProps } from '../CustomFieldProps';
|
|
5
|
+
import { validatorObj } from '../getObjectValidator';
|
|
6
|
+
import { getValidation } from '../getValidation';
|
|
4
7
|
|
|
5
8
|
export const SEX_TYPES: RadioButtonItem[] = [
|
|
6
9
|
{ id: 'male', text: 'Мужской' },
|
|
7
10
|
{ id: 'female', text: 'Женский' },
|
|
8
11
|
];
|
|
9
12
|
|
|
10
|
-
export const SexField = JSX<CustomFieldProps>(({ field }) => {
|
|
11
|
-
const { value, onChange } = field('sex');
|
|
12
|
-
|
|
13
|
+
export const SexField = JSX<CustomFieldProps>(({ field, input }) => {
|
|
13
14
|
return (
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
<div>
|
|
16
|
+
<RadioButtonGroupControl
|
|
17
|
+
label="Пол"
|
|
18
|
+
orientation="horizontal"
|
|
19
|
+
items={SEX_TYPES}
|
|
20
|
+
{...getValidation(field('sex'), validatorObj.sex, input?.required)}
|
|
21
|
+
/>
|
|
22
|
+
</div>
|
|
21
23
|
);
|
|
22
24
|
});
|
|
@@ -2,5 +2,6 @@ import { type FieldProps } from '../../hooks/useForm';
|
|
|
2
2
|
import { type Validator } from '../../validation/validator';
|
|
3
3
|
import { withValidator } from '../../validation/withValidator';
|
|
4
4
|
|
|
5
|
+
// TODO Зачем это?
|
|
5
6
|
export const getValidation = (field: FieldProps<any>, validator: Validator, required = false) =>
|
|
6
7
|
required ? withValidator(field, validator) : field;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
|
|
3
3
|
import { useOutsideClick } from '@redneckz/uni-jsx/lib/hooks/useOutsideClick';
|
|
4
|
+
import { getRequiredLabel } from '../../utils/getRequiredLabel';
|
|
4
5
|
import { noop } from '../../utils/noop';
|
|
5
6
|
import { style } from '../../utils/style';
|
|
6
7
|
import { Input } from './Input';
|
|
@@ -44,7 +45,7 @@ export const InputControl = JSX<InputProps>(
|
|
|
44
45
|
<Input
|
|
45
46
|
type={type || 'text'}
|
|
46
47
|
aria-label={label}
|
|
47
|
-
label={
|
|
48
|
+
label={getRequiredLabel({ label, errors })}
|
|
48
49
|
valid={Boolean(!error)}
|
|
49
50
|
value={value}
|
|
50
51
|
onChange={onChange}
|
|
@@ -59,7 +60,5 @@ export const InputControl = JSX<InputProps>(
|
|
|
59
60
|
},
|
|
60
61
|
);
|
|
61
62
|
|
|
62
|
-
const getLabel = (errors?: string[], label?: string) => (label && errors ? `${label}*` : label);
|
|
63
|
-
|
|
64
63
|
const getPlaceholder = (placeholder?: string, errors?: string[], label?: string) =>
|
|
65
64
|
errors && !label ? `${placeholder}*` : placeholder;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { getRequiredLabel } from '../../utils/getRequiredLabel';
|
|
2
3
|
import { style } from '../../utils/style';
|
|
3
4
|
import { PhoneInput } from '../PhoneInput/PhoneInput';
|
|
4
5
|
import { type InputProps } from './InputProps';
|
|
@@ -8,7 +9,7 @@ export const InputPhoneControl = JSX<InputProps>(({ className, label, error, ...
|
|
|
8
9
|
<div className={style('shrink-0 w-full', className)}>
|
|
9
10
|
<PhoneInput
|
|
10
11
|
aria-label={label}
|
|
11
|
-
label={
|
|
12
|
+
label={getRequiredLabel({ label, errors: rest?.errors })}
|
|
12
13
|
valid={Boolean(!error)}
|
|
13
14
|
placeholder="+7 (___) ___-__-__"
|
|
14
15
|
{...rest}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type DefaultControlType } from '../../model/DefaultControlType';
|
|
2
2
|
import { type InputTypes } from '../../model/InputTypes';
|
|
3
3
|
import { type ControlProps } from '../ControlProps';
|
|
4
4
|
import { type PreventableEventWithTarget } from '../PreventableEvent';
|
|
5
5
|
|
|
6
|
-
export interface InputProps<V = string> extends ControlProps<V
|
|
7
|
-
className?: string;
|
|
6
|
+
export interface InputProps<V = string> extends DefaultControlType, ControlProps<V> {
|
|
8
7
|
id?: string;
|
|
9
8
|
name?: string;
|
|
10
9
|
type?: InputTypes;
|
|
11
|
-
placeholder?: string;
|
|
12
10
|
pattern?: string;
|
|
13
11
|
onFocus?: (ev: PreventableEventWithTarget) => void;
|
|
14
12
|
onBlur?: (ev?: PreventableEventWithTarget) => void;
|
|
@@ -16,7 +14,5 @@ export interface InputProps<V = string> extends ControlProps<V>, LabelProps {
|
|
|
16
14
|
disabled?: boolean;
|
|
17
15
|
autoFocus?: boolean;
|
|
18
16
|
isTextarea?: boolean;
|
|
19
|
-
error?: string;
|
|
20
|
-
errors?: string[];
|
|
21
17
|
dadata?: boolean;
|
|
22
18
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { getRequiredLabel } from '../../utils/getRequiredLabel';
|
|
2
3
|
import { style } from '../../utils/style';
|
|
3
4
|
import { SnilsInput } from '../SnilsInput/SnilsInput';
|
|
4
5
|
import { type InputProps } from './InputProps';
|
|
@@ -9,7 +10,7 @@ export const InputSnilsControl = JSX<InputProps>(
|
|
|
9
10
|
<div className={style('shrink-0 w-full', className)}>
|
|
10
11
|
<SnilsInput
|
|
11
12
|
aria-label={label}
|
|
12
|
-
label={
|
|
13
|
+
label={getRequiredLabel({ label, errors: rest?.errors })}
|
|
13
14
|
valid={Boolean(!error)}
|
|
14
15
|
value={value}
|
|
15
16
|
onChange={onChange}
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
import { useCallback, useMemo, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { type BranchesHeader, type ForeignOfficeProps } from '../../data/HeaderData';
|
|
4
|
-
import { useLink } from '../../hooks/useLink';
|
|
5
4
|
import { useLocation } from '../../hooks/useLocation';
|
|
6
5
|
import { useRegions, type Region } from '../../hooks/useRegions';
|
|
7
6
|
import { groupBy } from '../../utils/groupBy';
|
|
8
7
|
import { jaroWinklerDistance } from '../../utils/jaroWinklerDistance';
|
|
9
8
|
import { Dialog } from '../DialogManager/Dialog';
|
|
10
9
|
import { useDialogManager } from '../DialogManager/useDialogManager';
|
|
11
|
-
import { LinkWrapper } from '../LinkWrapper/LinkWrapper';
|
|
12
|
-
import { Paragraph } from '../Paragraph/Paragraph';
|
|
13
10
|
import { Text } from '../Text/Text';
|
|
14
11
|
import { renderForeignOffices } from './renderForeignOffices';
|
|
15
12
|
import { renderRegion } from './renderRegion';
|
|
16
13
|
import { renderRegionGroup } from './renderRegionGroup';
|
|
17
14
|
import { SearchBar } from './SearchBar';
|
|
15
|
+
import { SelectedLocation } from './SelectedLocation';
|
|
18
16
|
|
|
19
17
|
const SEARCH_TERM_MIN_LENGTH = 3;
|
|
20
18
|
|
|
@@ -24,22 +22,21 @@ export interface LocationDialogProps {
|
|
|
24
22
|
}
|
|
25
23
|
|
|
26
24
|
export const LocationDialog = JSX<LocationDialogProps>(({ foreignOffices, branches }) => {
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
const link = useLink();
|
|
30
|
-
const { href } = link({ href: `/branches/${currentLocation.slug}` });
|
|
25
|
+
const selectLocation = useLocation(branches?.default);
|
|
31
26
|
|
|
32
27
|
const [query, setQuery] = useState('');
|
|
33
28
|
|
|
34
|
-
const
|
|
35
|
-
|
|
29
|
+
const rawRegions = useRegions();
|
|
30
|
+
const regions = useMemo(
|
|
31
|
+
() => cleanUpRegions(rawRegions).sort((a, b) => (a.name ?? '').localeCompare(b.name ?? '')),
|
|
32
|
+
[rawRegions],
|
|
36
33
|
);
|
|
37
|
-
const regionsGroupByLetter
|
|
34
|
+
const regionsGroupByLetter = useMemo(() => groupBy(regions, regionFirstLetter), [regions]);
|
|
38
35
|
|
|
39
36
|
const { close } = useDialogManager();
|
|
40
37
|
|
|
41
38
|
const handleChangeLocation = useCallback((region: Region) => {
|
|
42
|
-
|
|
39
|
+
selectLocation(region);
|
|
43
40
|
close();
|
|
44
41
|
}, []);
|
|
45
42
|
|
|
@@ -51,16 +48,7 @@ export const LocationDialog = JSX<LocationDialogProps>(({ foreignOffices, branch
|
|
|
51
48
|
<Text size="text-h4" color="text-primary-text">
|
|
52
49
|
Выберите филиал
|
|
53
50
|
</Text>
|
|
54
|
-
{
|
|
55
|
-
<div className="mb-s">
|
|
56
|
-
<Paragraph size="text-l" color="text-primary-text">
|
|
57
|
-
Сейчас выбран:
|
|
58
|
-
<LinkWrapper href={href} className="inline mx-2xs text-primary-main">
|
|
59
|
-
{currentLocation.name}
|
|
60
|
-
</LinkWrapper>
|
|
61
|
-
</Paragraph>
|
|
62
|
-
</div>
|
|
63
|
-
) : null}
|
|
51
|
+
<SelectedLocation defaultLocation={branches?.default} />
|
|
64
52
|
<SearchBar onSearch={setQuery} searchTerm={query} />
|
|
65
53
|
</div>
|
|
66
54
|
}
|
|
@@ -86,10 +74,10 @@ export const LocationDialog = JSX<LocationDialogProps>(({ foreignOffices, branch
|
|
|
86
74
|
);
|
|
87
75
|
});
|
|
88
76
|
|
|
89
|
-
const regionFirstLetter = (region: Region) => region.name?.charAt(0)
|
|
77
|
+
const regionFirstLetter = (region: Region) => region.name?.charAt(0) ?? '';
|
|
90
78
|
|
|
91
|
-
const cleanUpRegions = (regions: Region[]) =>
|
|
79
|
+
const cleanUpRegions = (regions: Region[]): Region[] =>
|
|
92
80
|
regions.map((region) => ({
|
|
93
81
|
...region,
|
|
94
|
-
name: region.name?.replace(/республика|область|край'/gi, '').trim()
|
|
82
|
+
name: region.name?.replace(/республика|область|край'/gi, '').trim() ?? '',
|
|
95
83
|
}));
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useLink } from '../../hooks/useLink';
|
|
3
|
+
import { useLocationState } from '../../hooks/useLocation';
|
|
4
|
+
import { LinkWrapper } from '../LinkWrapper/LinkWrapper';
|
|
5
|
+
import { Paragraph } from '../Paragraph/Paragraph';
|
|
6
|
+
|
|
7
|
+
interface SelectedLocationProps {
|
|
8
|
+
defaultLocation?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const SelectedLocation = JSX<SelectedLocationProps>(({ defaultLocation }) => {
|
|
12
|
+
const currentLocation = useLocationState(defaultLocation);
|
|
13
|
+
|
|
14
|
+
const link = useLink();
|
|
15
|
+
const { href } = link({ href: `/branches/${currentLocation.slug}` });
|
|
16
|
+
|
|
17
|
+
return currentLocation ? (
|
|
18
|
+
<div className="mb-s">
|
|
19
|
+
<Paragraph size="text-l" color="text-primary-text">
|
|
20
|
+
Сейчас выбран:
|
|
21
|
+
<LinkWrapper href={href} className="inline mx-2xs text-primary-main">
|
|
22
|
+
{currentLocation.name}
|
|
23
|
+
</LinkWrapper>
|
|
24
|
+
</Paragraph>
|
|
25
|
+
</div>
|
|
26
|
+
) : null;
|
|
27
|
+
});
|
|
@@ -4,8 +4,8 @@ import { type PopupOptions } from './PopupAction';
|
|
|
4
4
|
|
|
5
5
|
export const usePopupManager = () => ({
|
|
6
6
|
open: (popup: VNode, options: PopupOptions) =>
|
|
7
|
-
defaultEventBus.fire('popup', { type: 'open', popup, ...options }),
|
|
7
|
+
defaultEventBus.emitter.fire('popup', { type: 'open', popup, ...options }),
|
|
8
8
|
update: (popup: VNode, options: PopupOptions) =>
|
|
9
|
-
defaultEventBus.fire('popup', { type: 'update', popup, ...options }),
|
|
10
|
-
close: () => defaultEventBus.fire('popup', { type: 'close' }),
|
|
9
|
+
defaultEventBus.emitter.fire('popup', { type: 'update', popup, ...options }),
|
|
10
|
+
close: () => defaultEventBus.emitter.fire('popup', { type: 'close' }),
|
|
11
11
|
});
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { type DefaultControlType } from '../../model/DefaultControlType';
|
|
2
3
|
import { type TextProps } from '../../model/HeadlineType';
|
|
3
4
|
import { type ListOrientation } from '../../model/ListOrientation';
|
|
4
5
|
import { style } from '../../utils/style';
|
|
5
6
|
import { Checkbox } from '../Checkbox/Checkbox';
|
|
7
|
+
import { type ControlProps } from '../ControlProps';
|
|
6
8
|
import { Text } from '../Text/Text';
|
|
7
9
|
|
|
8
10
|
export type RadioButtonItem = TextProps & {
|
|
9
11
|
id: string;
|
|
10
12
|
};
|
|
11
13
|
|
|
12
|
-
interface RadioButtonGroupProps {
|
|
13
|
-
title?: string;
|
|
14
|
+
export interface RadioButtonGroupProps extends DefaultControlType, ControlProps<string> {
|
|
14
15
|
items?: RadioButtonItem[];
|
|
15
|
-
checkedItem?: string;
|
|
16
|
-
className?: string;
|
|
17
16
|
onChange?: (id: string) => void;
|
|
18
17
|
disabled?: boolean;
|
|
19
18
|
orientation?: ListOrientation;
|
|
@@ -26,19 +25,19 @@ const orientationStyleMap: Record<ListOrientation, string> = {
|
|
|
26
25
|
|
|
27
26
|
export const RadioButtonGroup = JSX<RadioButtonGroupProps>(
|
|
28
27
|
({
|
|
29
|
-
|
|
28
|
+
label,
|
|
30
29
|
items,
|
|
31
|
-
|
|
30
|
+
value,
|
|
32
31
|
className,
|
|
33
32
|
onChange: onChangeCheckedItem,
|
|
34
33
|
disabled = false,
|
|
35
34
|
orientation = 'horizontal',
|
|
36
35
|
}) => (
|
|
37
36
|
<div className="grid gap-xs whitespace-nowrap">
|
|
38
|
-
{
|
|
39
|
-
<div role="radiogroup" aria-label={
|
|
37
|
+
{label ? (
|
|
38
|
+
<div role="radiogroup" aria-label={label}>
|
|
40
39
|
<Text color="text-secondary-text" font="font-light">
|
|
41
|
-
{
|
|
40
|
+
{label}
|
|
42
41
|
</Text>
|
|
43
42
|
</div>
|
|
44
43
|
) : null}
|
|
@@ -52,7 +51,7 @@ export const RadioButtonGroup = JSX<RadioButtonGroupProps>(
|
|
|
52
51
|
key={String(id)}
|
|
53
52
|
isRadio
|
|
54
53
|
text={text}
|
|
55
|
-
value={
|
|
54
|
+
value={value === id}
|
|
56
55
|
onChange={() => onChangeCheckedItem && onChangeCheckedItem(id)}
|
|
57
56
|
disabled={disabled}
|
|
58
57
|
/>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { getRequiredLabel } from '../../utils/getRequiredLabel';
|
|
3
|
+
import { style } from '../../utils/style';
|
|
4
|
+
import { renderErrorText } from '../Input/renderErrorText';
|
|
5
|
+
import { RadioButtonGroup, type RadioButtonGroupProps } from './RadioButtonGroup';
|
|
6
|
+
|
|
7
|
+
export const RadioButtonGroupControl = JSX<RadioButtonGroupProps>(
|
|
8
|
+
({ className, label, onChange, error, ...rest }) => (
|
|
9
|
+
<div className={style('shrink-0 w-full', className)}>
|
|
10
|
+
<RadioButtonGroup
|
|
11
|
+
label={getRequiredLabel({ label, errors: rest?.errors })}
|
|
12
|
+
onChange={(_) => onChange && onChange(_)}
|
|
13
|
+
{...rest}
|
|
14
|
+
/>
|
|
15
|
+
{renderErrorText(error)}
|
|
16
|
+
</div>
|
|
17
|
+
),
|
|
18
|
+
);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { useBool } from '@redneckz/uni-jsx/lib/hooks/useBool';
|
|
4
|
-
import { type
|
|
4
|
+
import { type DefaultControlType } from '../../model/DefaultControlType';
|
|
5
5
|
import { type IconVersion } from '../../model/IconVersion';
|
|
6
6
|
import { style } from '../../utils/style';
|
|
7
|
+
import { type ControlProps } from '../ControlProps';
|
|
7
8
|
import { Icon } from '../Icon/Icon';
|
|
8
9
|
import { Input } from '../Input/Input';
|
|
9
10
|
import { renderLabel } from '../Input/renderLabel';
|
|
@@ -11,21 +12,16 @@ import { formatOption } from './formatOption';
|
|
|
11
12
|
import { type Option } from './Option';
|
|
12
13
|
import { useSelectPopup } from './useSelectPopup';
|
|
13
14
|
|
|
14
|
-
export
|
|
15
|
-
className?: string;
|
|
15
|
+
export interface SelectProps extends DefaultControlType, ControlProps<Option> {
|
|
16
16
|
options?: Option[];
|
|
17
|
-
value?: Option;
|
|
18
17
|
valid?: boolean;
|
|
19
18
|
isBorder?: boolean;
|
|
20
|
-
placeholder?: string;
|
|
21
19
|
isSearch?: boolean;
|
|
22
|
-
onChange?: (value: Option) => void;
|
|
23
20
|
iconVersion?: IconVersion;
|
|
24
21
|
disabled?: boolean;
|
|
25
|
-
}
|
|
22
|
+
}
|
|
26
23
|
|
|
27
24
|
export const Select = JSX<SelectProps>(
|
|
28
|
-
// eslint-disable-next-line complexity
|
|
29
25
|
({
|
|
30
26
|
className,
|
|
31
27
|
label,
|
|
@@ -37,11 +33,11 @@ export const Select = JSX<SelectProps>(
|
|
|
37
33
|
isSearch = false,
|
|
38
34
|
iconVersion = 'black',
|
|
39
35
|
onChange,
|
|
40
|
-
disabled,
|
|
36
|
+
disabled = false,
|
|
41
37
|
}) => {
|
|
42
38
|
const [isOpen, { setFalse: close, setTrue: open }] = useBool();
|
|
43
39
|
const [query, setQuery] = useState('');
|
|
44
|
-
const isDisabled = disabled
|
|
40
|
+
const isDisabled = getDisabled(disabled, options.length);
|
|
45
41
|
const hasOpen = isOpen && !isDisabled;
|
|
46
42
|
|
|
47
43
|
const handleClose = useCallback(() => {
|
|
@@ -101,3 +97,5 @@ const getStyle = (isBorder: boolean, valid: boolean, disabled: boolean) =>
|
|
|
101
97
|
disabled ? 'bg-main-divider' : 'cursor-pointer ',
|
|
102
98
|
valid ? 'border-gray' : 'border-error',
|
|
103
99
|
);
|
|
100
|
+
|
|
101
|
+
const getDisabled = (disabled: boolean, length: number) => disabled || length === 0;
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { getRequiredLabel } from '../../utils/getRequiredLabel';
|
|
2
3
|
import { renderErrorText } from '../Input/renderErrorText';
|
|
3
4
|
import { Select, type SelectProps } from './Select';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
label
|
|
7
|
-
error?: string;
|
|
8
|
-
errors?: string[];
|
|
9
|
-
className?: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const SelectControl = JSX<SelectControlProps>(
|
|
13
|
-
({ className = '', label, error, ...rest }) => (
|
|
6
|
+
export const SelectControl = JSX<SelectProps>(
|
|
7
|
+
({ className = '', label, error, errors, ...rest }) => (
|
|
14
8
|
<div className={className}>
|
|
15
|
-
<Select {...rest} valid={!error} label={
|
|
9
|
+
<Select {...rest} valid={!error} label={getRequiredLabel({ label, errors })} />
|
|
16
10
|
{renderErrorText(error)}
|
|
17
11
|
</div>
|
|
18
12
|
),
|