@redneckz/wildless-cms-uni-blocks 0.14.595 → 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 +131 -89
- 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/ui-kit/Foldable/Foldable.d.ts +11 -1
- package/bundle/ui-kit/LocationDialog/SelectedLocation.d.ts +5 -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/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/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/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/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/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/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/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/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 +131 -89
- 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/ui-kit/Foldable/Foldable.d.ts +11 -1
- package/mobile/bundle/ui-kit/LocationDialog/SelectedLocation.d.ts +5 -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/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/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/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/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/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/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/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/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/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/constants.tsx +1 -0
- package/mobile/src/ui-kit/FormField/getValidation.tsx +1 -0
- 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/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/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/constants.tsx +1 -0
- package/src/ui-kit/FormField/getValidation.tsx +1 -0
- 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/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 +0 -2
- 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 +0 -2
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCardAction.js.map +0 -1
- package/mobile/lib/EventBus/useLatestEvent.d.ts +0 -2
- package/mobile/lib/EventBus/useLatestEvent.js +0 -8
- package/mobile/lib/EventBus/useLatestEvent.js.map +0 -1
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.d.ts +0 -6
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.js +0 -2
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCardAction.js.map +0 -1
- package/mobile/src/EventBus/useLatestEvent.ts +0 -16
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCardAction.ts +0 -6
- package/src/EventBus/useLatestEvent.ts +0 -16
- package/src/components/CarouselTariffsCard/CarouselTariffsCardAction.ts +0 -6
|
@@ -1,28 +1,22 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { type AspectsDef } from '../../model/AspectsProps';
|
|
5
|
-
import { type Slot } from '../../model/ContentPageDef';
|
|
6
|
-
import { type VNode } from '../../model/VNode';
|
|
2
|
+
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { useSubjectState } from '../../EventBus/useSubjectState';
|
|
7
4
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
8
|
-
import { Foldable } from '../../ui-kit/Foldable/Foldable';
|
|
9
|
-
import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection';
|
|
10
5
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
11
|
-
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
12
6
|
import { Img } from '../../ui-kit/Img/Img';
|
|
13
7
|
import { LinkButton } from '../../ui-kit/LinkButton/LinkButton';
|
|
14
8
|
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
15
|
-
import { getAspectsAttributes } from '../../utils/dataAttributes';
|
|
16
9
|
import { isIcon } from '../../utils/isIcon';
|
|
17
10
|
import { style } from '../../utils/style';
|
|
11
|
+
import { CardCellsSection } from './CardCellsSection';
|
|
18
12
|
import { type CarouselTariffsCardContent } from './CarouselTariffsCardContent';
|
|
19
|
-
import {
|
|
13
|
+
import { carouselTariffsCardEventBus } from './carouselTariffsCardEventBus';
|
|
20
14
|
|
|
21
15
|
export interface CarouselTariffsCardProps extends CarouselTariffsCardContent, UniBlockProps {}
|
|
22
16
|
|
|
23
17
|
export const CarouselTariffsCard = JSX<CarouselTariffsCardProps>(
|
|
24
18
|
({
|
|
25
|
-
className
|
|
19
|
+
className,
|
|
26
20
|
title,
|
|
27
21
|
align = 'text-center',
|
|
28
22
|
icon,
|
|
@@ -33,22 +27,20 @@ export const CarouselTariffsCard = JSX<CarouselTariffsCardProps>(
|
|
|
33
27
|
data,
|
|
34
28
|
...rest
|
|
35
29
|
}) => {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const [isVisible, setIsVisible] = useState(false);
|
|
30
|
+
const { isUnfolded, parent: firedParent } = useSubjectState(
|
|
31
|
+
carouselTariffsCardEventBus.observable,
|
|
32
|
+
'fold',
|
|
33
|
+
{},
|
|
34
|
+
);
|
|
35
|
+
const isVisible = isUnfolded && firedParent === options?.parent;
|
|
43
36
|
|
|
44
|
-
|
|
37
|
+
const toggle = useCallback(
|
|
45
38
|
() =>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
39
|
+
carouselTariffsCardEventBus.emitter.fire('fold', {
|
|
40
|
+
isUnfolded: !isVisible,
|
|
41
|
+
parent: options?.parent,
|
|
50
42
|
}),
|
|
51
|
-
[options?.parent],
|
|
43
|
+
[isVisible, options?.parent],
|
|
52
44
|
);
|
|
53
45
|
|
|
54
46
|
return (
|
|
@@ -62,49 +54,14 @@ export const CarouselTariffsCard = JSX<CarouselTariffsCardProps>(
|
|
|
62
54
|
<Heading className={style('pt-xs', align)} headingType="h5" title={title} />
|
|
63
55
|
) : null}
|
|
64
56
|
{button?.text ? <LinkButton className="w-full mt-m mb-lg" {...button} /> : null}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
)}
|
|
73
|
-
renderFoldButton={
|
|
74
|
-
cardCells.length >= visibleCellsCount
|
|
75
|
-
? renderFoldButton(options?.parent, data, isVisible)
|
|
76
|
-
: null
|
|
77
|
-
}
|
|
78
|
-
/>
|
|
79
|
-
) : (
|
|
80
|
-
<div>{visibleCells}</div>
|
|
81
|
-
)}
|
|
57
|
+
<CardCellsSection
|
|
58
|
+
cardCells={cardCells}
|
|
59
|
+
visibleCellsCount={visibleCellsCount}
|
|
60
|
+
isUnfolded={isVisible}
|
|
61
|
+
data={data}
|
|
62
|
+
onToggle={toggle}
|
|
63
|
+
/>
|
|
82
64
|
</BlockWrapper>
|
|
83
65
|
);
|
|
84
66
|
},
|
|
85
67
|
);
|
|
86
|
-
|
|
87
|
-
const renderFoldButton =
|
|
88
|
-
(parent?: Slot, data?: AspectsDef[], isUnfolded = false) =>
|
|
89
|
-
(): VNode =>
|
|
90
|
-
(
|
|
91
|
-
<button
|
|
92
|
-
className="w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center"
|
|
93
|
-
onClick={() => {
|
|
94
|
-
if (parent !== undefined) {
|
|
95
|
-
defaultEventBus.fire('fold', { type: 'fold', isUnfolded: !isUnfolded, parent });
|
|
96
|
-
}
|
|
97
|
-
}}
|
|
98
|
-
type="button"
|
|
99
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
100
|
-
{...(isUnfolded ? getAspectsAttributes(data) : {})}
|
|
101
|
-
>
|
|
102
|
-
<div>{isUnfolded ? 'Скрыть' : 'Подробнее о тарифе'}</div>
|
|
103
|
-
<Icon
|
|
104
|
-
className="text-primary-text"
|
|
105
|
-
name={isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon'}
|
|
106
|
-
width="16"
|
|
107
|
-
height="16"
|
|
108
|
-
/>
|
|
109
|
-
</button>
|
|
110
|
-
);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EventBus } from '../../EventBus/EventBus';
|
|
2
|
+
import { type Slot } from '../../model/ContentPageDef';
|
|
3
|
+
|
|
4
|
+
export type CarouselTariffsCardFoldAction = {
|
|
5
|
+
isUnfolded?: boolean;
|
|
6
|
+
parent?: Slot;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const carouselTariffsCardEventBus = new EventBus<{
|
|
10
|
+
fold: CarouselTariffsCardFoldAction;
|
|
11
|
+
}>();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { useLocationState } from '../../hooks/useLocation';
|
|
3
3
|
import { BaseTile } from '../../ui-kit/BaseTile/BaseTile';
|
|
4
4
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
5
5
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
@@ -19,7 +19,7 @@ export interface ExchangeRateTileProps extends ExchangeRateTileContent, UniBlock
|
|
|
19
19
|
|
|
20
20
|
export const ExchangeRateTile = JSX<ExchangeRateTileProps>(
|
|
21
21
|
({ className = '', title = 'Курсы обмена валют', button, ...rest }) => {
|
|
22
|
-
const
|
|
22
|
+
const currentLocation = useLocationState();
|
|
23
23
|
const exchangeRates = useFetchExchangeRateData(currentLocation);
|
|
24
24
|
|
|
25
25
|
const currencyRates = getCurrencyRates(exchangeRates?.exchangeRate?.currencies);
|
|
@@ -4,7 +4,7 @@ import { type SearchHeaderProps } from '../../data/CommonData';
|
|
|
4
4
|
import { type HeaderData } from '../../data/HeaderData';
|
|
5
5
|
import { type NavigationData } from '../../data/NavigationData';
|
|
6
6
|
import { getAspectsWithInclude } from '../../hooks/useAspects/aspects/getAspectsWithInclude';
|
|
7
|
-
import {
|
|
7
|
+
import { useLocationState } from '../../hooks/useLocation';
|
|
8
8
|
import { type BlockVersion } from '../../model/BlockVersion';
|
|
9
9
|
import { type IconVersion } from '../../model/IconVersion';
|
|
10
10
|
import { useLocationDialog } from '../../ui-kit/LocationDialog/useLocationDialog';
|
|
@@ -22,7 +22,7 @@ export const HeaderSecondaryMenu = JSX<HeaderSecondaryMenuProps>(
|
|
|
22
22
|
({ className, version, ...rest }) => {
|
|
23
23
|
const iconVersion: IconVersion = version === 'transparent' ? 'white' : 'black';
|
|
24
24
|
|
|
25
|
-
const
|
|
25
|
+
const currentLocation = useLocationState(rest?.branches?.default);
|
|
26
26
|
|
|
27
27
|
const searchDialog = useSearchDialog(rest);
|
|
28
28
|
const locationDialog = useLocationDialog(rest);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { useLocationState } from '../../hooks/useLocation';
|
|
3
3
|
import { type AtmsDef } from './OfficesAtmsMapContent';
|
|
4
4
|
import { OfficesAtmsMapLayout } from './OfficesAtmsMapLayout';
|
|
5
5
|
import { type Atm } from './OfficesAtmsMapProps';
|
|
@@ -30,8 +30,7 @@ export interface AtmsMapProps {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export const AtmsMap = JSX<AtmsMapProps>(({ descriptionData, className }) => {
|
|
33
|
-
const
|
|
34
|
-
|
|
33
|
+
const currentLocation = useLocationState();
|
|
35
34
|
const regionCode = currentLocation?.code ?? '000';
|
|
36
35
|
|
|
37
36
|
const { data: officesData, isLoad } = useAtms(regionCode);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { useLocationState } from '../../hooks/useLocation';
|
|
3
3
|
import { OfficesAtmsMapLayout } from './OfficesAtmsMapLayout';
|
|
4
4
|
import { getOfficePoint, renderOfficeCard } from './renderOfficeCard';
|
|
5
5
|
import { getRemoteWorkplacePoint, renderRemoteWorkplaceCard } from './renderRemoteWorkplaceCard';
|
|
@@ -10,7 +10,7 @@ export interface OfficesMapProps {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export const OfficesMap = JSX<OfficesMapProps>(({ className }) => {
|
|
13
|
-
const
|
|
13
|
+
const currentLocation = useLocationState();
|
|
14
14
|
const regionCode = currentLocation?.code ?? '000';
|
|
15
15
|
const { data, isLoad } = useOffices(regionCode);
|
|
16
16
|
|
|
@@ -4,7 +4,7 @@ import { type HeaderData } from '../../data/HeaderData';
|
|
|
4
4
|
import { type JSONRefObject } from '../../data/JSONRefObject';
|
|
5
5
|
import { type StickyMenuItem } from '../../data/StickyMobileData';
|
|
6
6
|
import { env } from '../../Env';
|
|
7
|
-
import {
|
|
7
|
+
import { useLocationState } from '../../hooks/useLocation';
|
|
8
8
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
9
9
|
import { useLocationDialog } from '../../ui-kit/LocationDialog/useLocationDialog';
|
|
10
10
|
import { getBasePath } from '../../utils/getBasePath';
|
|
@@ -22,7 +22,7 @@ export interface BurgerMenuDialogProps {
|
|
|
22
22
|
export const BurgerMenuDialog = JSX<BurgerMenuDialogProps>(
|
|
23
23
|
({ menuRef, menuItem, locationDialogProps, closeAll }) => {
|
|
24
24
|
const locationDialog = useLocationDialog(locationDialogProps || {});
|
|
25
|
-
const
|
|
25
|
+
const { name: location } = useLocationState();
|
|
26
26
|
const menuDimensions = menuRef?.current?.getBoundingClientRect();
|
|
27
27
|
const basePath = getBasePath(env.SITE_URL);
|
|
28
28
|
|
|
@@ -1,54 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
|
|
1
|
+
import { useEffect } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
2
|
import { defaultEventBus } from '../EventBus/defaultEventBus';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { useSubject } from '../EventBus/useSubject';
|
|
4
|
+
import { useSubjectState } from '../EventBus/useSubjectState';
|
|
5
|
+
import { fetchJSON } from '../utils/fetchJSON';
|
|
6
6
|
import { type Region } from './useRegions';
|
|
7
7
|
|
|
8
8
|
const REGION_URL = '/api/v1/region';
|
|
9
9
|
const LOCATION_STORAGE_KEY = 'location';
|
|
10
10
|
|
|
11
|
-
export function useLocation(defaultLocation = 'Москва'):
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
11
|
+
export function useLocation(defaultLocation = 'Москва'): (_: Region) => void {
|
|
12
|
+
useEffect(() => defaultEventBus.subscribe('location', storeLocation), []);
|
|
13
|
+
|
|
14
|
+
return useSubject(defaultEventBus.emitter, 'location', restoreLocation(defaultLocation));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function useLocationState(defaultLocation = 'Москва'): Region {
|
|
18
|
+
return useSubjectState(defaultEventBus.observable, 'location', { name: defaultLocation });
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function restoreLocation(defaultLocation: string) {
|
|
22
|
+
return async (): Promise<Region> => {
|
|
23
|
+
if (!globalThis.localStorage?.hasItem(LOCATION_STORAGE_KEY)) {
|
|
24
|
+
storeLocation(await fetchJSON<Region>(REGION_URL));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const storedLocation = globalThis.localStorage?.getItem(LOCATION_STORAGE_KEY);
|
|
28
|
+
try {
|
|
29
|
+
return storedLocation && JSON.parse(storedLocation);
|
|
30
|
+
} catch (ex) {
|
|
31
|
+
// Do nothing
|
|
30
32
|
}
|
|
31
|
-
}, [data]);
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
return { name: defaultLocation };
|
|
35
|
+
};
|
|
34
36
|
}
|
|
35
37
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
try {
|
|
40
|
-
const data = globalThis.localStorage?.getItem(LOCATION_STORAGE_KEY);
|
|
41
|
-
|
|
42
|
-
return data && JSON.parse(data);
|
|
43
|
-
} catch (ex) {
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const storeLocation = (_: Region) => {
|
|
49
|
-
try {
|
|
50
|
-
globalThis.localStorage?.setItem(LOCATION_STORAGE_KEY, JSON.stringify(_));
|
|
51
|
-
} catch (ex) {
|
|
52
|
-
// Do nothing
|
|
53
|
-
}
|
|
54
|
-
};
|
|
38
|
+
function storeLocation(_: Region | null | undefined) {
|
|
39
|
+
_ && globalThis.localStorage?.setItem(LOCATION_STORAGE_KEY, JSON.stringify(_));
|
|
40
|
+
}
|
|
@@ -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
|
}
|
|
@@ -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
|
);
|
|
@@ -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,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
|
});
|