@redneckz/wildless-cms-uni-blocks 0.14.595 → 0.14.597
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/api/dadataHints/dadataHintsType.d.ts +20 -4
- package/bundle/api/dadataHints/hintsListsOptions.d.ts +2 -24
- package/bundle/bundle.umd.js +208 -109
- 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/FormField/Fields/DulIssuedByField.d.ts +2 -0
- package/bundle/ui-kit/FormField/Fields/DulSubdivisionCodeField.d.ts +2 -0
- package/bundle/ui-kit/Input/InputPopup.d.ts +1 -1
- package/bundle/ui-kit/Input/InputProps.d.ts +3 -0
- package/bundle/ui-kit/Input/useInputPopup.d.ts +4 -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/api/dadataHints/dadataHints.js +15 -8
- package/dist/api/dadataHints/dadataHints.js.map +1 -1
- package/dist/api/dadataHints/dadataHintsType.d.ts +20 -4
- package/dist/api/dadataHints/hintsListsOptions.d.ts +2 -24
- package/dist/api/dadataHints/hintsListsOptions.js +31 -9
- package/dist/api/dadataHints/hintsListsOptions.js.map +1 -1
- 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/Fields/DulIssuedByField.d.ts +2 -0
- package/dist/ui-kit/FormField/Fields/DulIssuedByField.js +16 -0
- package/dist/ui-kit/FormField/Fields/DulIssuedByField.js.map +1 -0
- package/dist/ui-kit/FormField/Fields/DulSubdivisionCodeField.d.ts +2 -0
- package/dist/ui-kit/FormField/Fields/DulSubdivisionCodeField.js +15 -0
- package/dist/ui-kit/FormField/Fields/DulSubdivisionCodeField.js.map +1 -0
- package/dist/ui-kit/FormField/Fields/InnField.js +8 -1
- package/dist/ui-kit/FormField/Fields/InnField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/OrganizationNameField.js +8 -1
- package/dist/ui-kit/FormField/Fields/OrganizationNameField.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/getField.js +4 -4
- package/dist/ui-kit/FormField/getField.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 +3 -1
- package/dist/ui-kit/Input/InputControl.js.map +1 -1
- package/dist/ui-kit/Input/InputPopup.d.ts +1 -1
- package/dist/ui-kit/Input/InputPopup.js +1 -1
- package/dist/ui-kit/Input/InputPopup.js.map +1 -1
- package/dist/ui-kit/Input/InputProps.d.ts +3 -0
- package/dist/ui-kit/Input/useInputPopup.d.ts +4 -1
- package/dist/ui-kit/Input/useInputPopup.js +7 -4
- package/dist/ui-kit/Input/useInputPopup.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/api/dadataHints/dadataHints.js +15 -8
- package/lib/api/dadataHints/dadataHints.js.map +1 -1
- package/lib/api/dadataHints/dadataHintsType.d.ts +20 -4
- package/lib/api/dadataHints/hintsListsOptions.d.ts +2 -24
- package/lib/api/dadataHints/hintsListsOptions.js +26 -4
- package/lib/api/dadataHints/hintsListsOptions.js.map +1 -1
- 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/Fields/DulIssuedByField.d.ts +2 -0
- package/lib/ui-kit/FormField/Fields/DulIssuedByField.js +14 -0
- package/lib/ui-kit/FormField/Fields/DulIssuedByField.js.map +1 -0
- package/lib/ui-kit/FormField/Fields/DulSubdivisionCodeField.d.ts +2 -0
- package/lib/ui-kit/FormField/Fields/DulSubdivisionCodeField.js +13 -0
- package/lib/ui-kit/FormField/Fields/DulSubdivisionCodeField.js.map +1 -0
- package/lib/ui-kit/FormField/Fields/InnField.js +8 -1
- package/lib/ui-kit/FormField/Fields/InnField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/OrganizationNameField.js +8 -1
- package/lib/ui-kit/FormField/Fields/OrganizationNameField.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/getField.js +4 -4
- package/lib/ui-kit/FormField/getField.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 +3 -1
- package/lib/ui-kit/Input/InputControl.js.map +1 -1
- package/lib/ui-kit/Input/InputPopup.d.ts +1 -1
- package/lib/ui-kit/Input/InputPopup.js +1 -1
- package/lib/ui-kit/Input/InputPopup.js.map +1 -1
- package/lib/ui-kit/Input/InputProps.d.ts +3 -0
- package/lib/ui-kit/Input/useInputPopup.d.ts +4 -1
- package/lib/ui-kit/Input/useInputPopup.js +7 -4
- package/lib/ui-kit/Input/useInputPopup.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/api/dadataHints/dadataHintsType.d.ts +20 -4
- package/mobile/bundle/api/dadataHints/hintsListsOptions.d.ts +2 -24
- package/mobile/bundle/bundle.umd.js +208 -109
- 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/FormField/Fields/DulIssuedByField.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/Fields/DulSubdivisionCodeField.d.ts +2 -0
- package/mobile/bundle/ui-kit/Input/InputPopup.d.ts +1 -1
- package/mobile/bundle/ui-kit/Input/InputProps.d.ts +3 -0
- package/mobile/bundle/ui-kit/Input/useInputPopup.d.ts +4 -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/api/dadataHints/dadataHints.js +15 -8
- package/mobile/dist/api/dadataHints/dadataHints.js.map +1 -1
- package/mobile/dist/api/dadataHints/dadataHintsType.d.ts +20 -4
- package/mobile/dist/api/dadataHints/hintsListsOptions.d.ts +2 -24
- package/mobile/dist/api/dadataHints/hintsListsOptions.js +31 -9
- package/mobile/dist/api/dadataHints/hintsListsOptions.js.map +1 -1
- 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/Fields/DulIssuedByField.d.ts +2 -0
- package/mobile/dist/ui-kit/FormField/Fields/DulIssuedByField.js +16 -0
- package/mobile/dist/ui-kit/FormField/Fields/DulIssuedByField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/DulSubdivisionCodeField.d.ts +2 -0
- package/mobile/dist/ui-kit/FormField/Fields/DulSubdivisionCodeField.js +15 -0
- package/mobile/dist/ui-kit/FormField/Fields/DulSubdivisionCodeField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/InnField.js +8 -1
- package/mobile/dist/ui-kit/FormField/Fields/InnField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/OrganizationNameField.js +8 -1
- package/mobile/dist/ui-kit/FormField/Fields/OrganizationNameField.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/getField.js +4 -4
- package/mobile/dist/ui-kit/FormField/getField.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 +3 -1
- package/mobile/dist/ui-kit/Input/InputControl.js.map +1 -1
- package/mobile/dist/ui-kit/Input/InputPopup.d.ts +1 -1
- package/mobile/dist/ui-kit/Input/InputPopup.js +1 -1
- package/mobile/dist/ui-kit/Input/InputPopup.js.map +1 -1
- package/mobile/dist/ui-kit/Input/InputProps.d.ts +3 -0
- package/mobile/dist/ui-kit/Input/useInputPopup.d.ts +4 -1
- package/mobile/dist/ui-kit/Input/useInputPopup.js +7 -4
- package/mobile/dist/ui-kit/Input/useInputPopup.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/api/dadataHints/dadataHints.js +15 -8
- package/mobile/lib/api/dadataHints/dadataHints.js.map +1 -1
- package/mobile/lib/api/dadataHints/dadataHintsType.d.ts +20 -4
- package/mobile/lib/api/dadataHints/hintsListsOptions.d.ts +2 -24
- package/mobile/lib/api/dadataHints/hintsListsOptions.js +26 -4
- package/mobile/lib/api/dadataHints/hintsListsOptions.js.map +1 -1
- 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/Fields/DulIssuedByField.d.ts +2 -0
- package/mobile/lib/ui-kit/FormField/Fields/DulIssuedByField.js +14 -0
- package/mobile/lib/ui-kit/FormField/Fields/DulIssuedByField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/DulSubdivisionCodeField.d.ts +2 -0
- package/mobile/lib/ui-kit/FormField/Fields/DulSubdivisionCodeField.js +13 -0
- package/mobile/lib/ui-kit/FormField/Fields/DulSubdivisionCodeField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/InnField.js +8 -1
- package/mobile/lib/ui-kit/FormField/Fields/InnField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/OrganizationNameField.js +8 -1
- package/mobile/lib/ui-kit/FormField/Fields/OrganizationNameField.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/getField.js +4 -4
- package/mobile/lib/ui-kit/FormField/getField.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 +3 -1
- package/mobile/lib/ui-kit/Input/InputControl.js.map +1 -1
- package/mobile/lib/ui-kit/Input/InputPopup.d.ts +1 -1
- package/mobile/lib/ui-kit/Input/InputPopup.js +1 -1
- package/mobile/lib/ui-kit/Input/InputPopup.js.map +1 -1
- package/mobile/lib/ui-kit/Input/InputProps.d.ts +3 -0
- package/mobile/lib/ui-kit/Input/useInputPopup.d.ts +4 -1
- package/mobile/lib/ui-kit/Input/useInputPopup.js +7 -4
- package/mobile/lib/ui-kit/Input/useInputPopup.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/api/dadataHints/dadataHints.ts +27 -10
- package/mobile/src/api/dadataHints/dadataHintsType.ts +21 -4
- package/mobile/src/api/dadataHints/hintsListsOptions.ts +34 -4
- 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/Fields/DulIssuedByField.tsx +26 -0
- package/mobile/src/ui-kit/FormField/Fields/DulSubdivisionCodeField.tsx +27 -0
- package/mobile/src/ui-kit/FormField/Fields/InnField.tsx +18 -7
- package/mobile/src/ui-kit/FormField/Fields/OrganizationNameField.tsx +17 -7
- package/mobile/src/ui-kit/FormField/constants.tsx +1 -0
- package/mobile/src/ui-kit/FormField/getField.tsx +4 -4
- package/mobile/src/ui-kit/FormField/getValidation.tsx +1 -0
- package/mobile/src/ui-kit/Input/InputControl.tsx +4 -0
- package/mobile/src/ui-kit/Input/InputPopup.tsx +2 -2
- package/mobile/src/ui-kit/Input/InputProps.ts +3 -0
- package/mobile/src/ui-kit/Input/useInputPopup.tsx +17 -5
- 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/api/dadataHints/dadataHints.ts +27 -10
- package/src/api/dadataHints/dadataHintsType.ts +21 -4
- package/src/api/dadataHints/hintsListsOptions.ts +34 -4
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.fixture.tsx +10 -15
- 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/Fields/DulIssuedByField.tsx +26 -0
- package/src/ui-kit/FormField/Fields/DulSubdivisionCodeField.tsx +27 -0
- package/src/ui-kit/FormField/Fields/InnField.tsx +18 -7
- package/src/ui-kit/FormField/Fields/OrganizationNameField.tsx +17 -7
- package/src/ui-kit/FormField/constants.tsx +1 -0
- package/src/ui-kit/FormField/getField.tsx +4 -4
- package/src/ui-kit/FormField/getValidation.tsx +1 -0
- package/src/ui-kit/Input/InputControl.tsx +4 -0
- package/src/ui-kit/Input/InputPopup.tsx +2 -2
- package/src/ui-kit/Input/InputProps.ts +3 -0
- package/src/ui-kit/Input/useInputPopup.tsx +17 -5
- 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/bundle/ui-kit/FormField/Fields/DulIssuedBy.d.ts +0 -2
- package/bundle/ui-kit/FormField/Fields/DulSubdivisionCode.d.ts +0 -2
- 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/dist/ui-kit/FormField/Fields/DulIssuedBy.d.ts +0 -2
- package/dist/ui-kit/FormField/Fields/DulIssuedBy.js +0 -9
- package/dist/ui-kit/FormField/Fields/DulIssuedBy.js.map +0 -1
- package/dist/ui-kit/FormField/Fields/DulSubdivisionCode.d.ts +0 -2
- package/dist/ui-kit/FormField/Fields/DulSubdivisionCode.js +0 -9
- package/dist/ui-kit/FormField/Fields/DulSubdivisionCode.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/lib/ui-kit/FormField/Fields/DulIssuedBy.d.ts +0 -2
- package/lib/ui-kit/FormField/Fields/DulIssuedBy.js +0 -7
- package/lib/ui-kit/FormField/Fields/DulIssuedBy.js.map +0 -1
- package/lib/ui-kit/FormField/Fields/DulSubdivisionCode.d.ts +0 -2
- package/lib/ui-kit/FormField/Fields/DulSubdivisionCode.js +0 -7
- package/lib/ui-kit/FormField/Fields/DulSubdivisionCode.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/bundle/ui-kit/FormField/Fields/DulIssuedBy.d.ts +0 -2
- package/mobile/bundle/ui-kit/FormField/Fields/DulSubdivisionCode.d.ts +0 -2
- 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/dist/ui-kit/FormField/Fields/DulIssuedBy.d.ts +0 -2
- package/mobile/dist/ui-kit/FormField/Fields/DulIssuedBy.js +0 -9
- package/mobile/dist/ui-kit/FormField/Fields/DulIssuedBy.js.map +0 -1
- package/mobile/dist/ui-kit/FormField/Fields/DulSubdivisionCode.d.ts +0 -2
- package/mobile/dist/ui-kit/FormField/Fields/DulSubdivisionCode.js +0 -9
- package/mobile/dist/ui-kit/FormField/Fields/DulSubdivisionCode.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/lib/ui-kit/FormField/Fields/DulIssuedBy.d.ts +0 -2
- package/mobile/lib/ui-kit/FormField/Fields/DulIssuedBy.js +0 -7
- package/mobile/lib/ui-kit/FormField/Fields/DulIssuedBy.js.map +0 -1
- package/mobile/lib/ui-kit/FormField/Fields/DulSubdivisionCode.d.ts +0 -2
- package/mobile/lib/ui-kit/FormField/Fields/DulSubdivisionCode.js +0 -7
- package/mobile/lib/ui-kit/FormField/Fields/DulSubdivisionCode.js.map +0 -1
- package/mobile/src/EventBus/useLatestEvent.ts +0 -16
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCardAction.ts +0 -6
- package/mobile/src/ui-kit/FormField/Fields/DulIssuedBy.tsx +0 -12
- package/mobile/src/ui-kit/FormField/Fields/DulSubdivisionCode.tsx +0 -17
- package/src/EventBus/useLatestEvent.ts +0 -16
- package/src/components/CarouselTariffsCard/CarouselTariffsCardAction.ts +0 -6
- package/src/ui-kit/FormField/Fields/DulIssuedBy.tsx +0 -12
- package/src/ui-kit/FormField/Fields/DulSubdivisionCode.tsx +0 -17
|
@@ -411,39 +411,58 @@
|
|
|
411
411
|
].join(' ');
|
|
412
412
|
|
|
413
413
|
class EventBus {
|
|
414
|
-
|
|
414
|
+
subscribersMap = {};
|
|
415
415
|
subjectsStateMap = {};
|
|
416
|
+
emitter = this;
|
|
417
|
+
observable = this;
|
|
416
418
|
subscribe(type, listener) {
|
|
417
|
-
this.
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
listener(latestEvent);
|
|
421
|
-
}
|
|
419
|
+
this.subscribersMap[type] ||= [];
|
|
420
|
+
this.subscribersMap[type]?.push(listener);
|
|
421
|
+
this.fireSubscribers([listener], this.subjectsStateMap[type]);
|
|
422
422
|
return () => {
|
|
423
423
|
this.unsubscribe(type, listener);
|
|
424
424
|
};
|
|
425
425
|
}
|
|
426
426
|
unsubscribe(type, listener) {
|
|
427
|
-
|
|
427
|
+
const index = this.subscribersMap[type]?.indexOf(listener);
|
|
428
|
+
if (index && index !== -1) {
|
|
429
|
+
this.subscribersMap[type]?.splice(index, 1);
|
|
430
|
+
}
|
|
428
431
|
}
|
|
429
432
|
fire(type, event) {
|
|
430
433
|
const isSubjectDeclared = type in this.subjectsStateMap;
|
|
431
434
|
if (isSubjectDeclared) {
|
|
432
|
-
this.
|
|
435
|
+
this.subject(type, event);
|
|
436
|
+
}
|
|
437
|
+
else {
|
|
438
|
+
this.fireSubscribers(this.subscribersMap[type], event);
|
|
433
439
|
}
|
|
434
|
-
this.subscribers[type]?.forEach((s) => s(event));
|
|
435
440
|
}
|
|
436
441
|
subject(type, event) {
|
|
437
|
-
this.subjectsStateMap[type]
|
|
442
|
+
if (this.subjectsStateMap[type] !== event) {
|
|
443
|
+
this.subjectsStateMap[type] = event;
|
|
444
|
+
this.fireSubscribers(this.subscribersMap[type], event);
|
|
445
|
+
}
|
|
446
|
+
return () => {
|
|
447
|
+
delete this.subjectsStateMap[type];
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
fireSubscribers(subscribers, event) {
|
|
451
|
+
if (!subscribers || !event) {
|
|
452
|
+
return;
|
|
453
|
+
}
|
|
454
|
+
for (const _ of subscribers) {
|
|
455
|
+
_(event);
|
|
456
|
+
}
|
|
438
457
|
}
|
|
439
458
|
}
|
|
440
459
|
|
|
441
460
|
const defaultEventBus = new EventBus();
|
|
442
461
|
|
|
443
462
|
const useDialogManager = () => ({
|
|
444
|
-
open: (dialog, options = {}) => defaultEventBus.fire('dialog', { type: 'open', dialog, ...options }),
|
|
445
|
-
close: () => defaultEventBus.fire('dialog', { type: 'close' }),
|
|
446
|
-
closeAll: () => defaultEventBus.fire('dialog', { type: 'close', all: true }),
|
|
463
|
+
open: (dialog, options = {}) => defaultEventBus.emitter.fire('dialog', { type: 'open', dialog, ...options }),
|
|
464
|
+
close: () => defaultEventBus.emitter.fire('dialog', { type: 'close' }),
|
|
465
|
+
closeAll: () => defaultEventBus.emitter.fire('dialog', { type: 'close', all: true }),
|
|
447
466
|
});
|
|
448
467
|
|
|
449
468
|
const adjustBase = (href, basePath = '') => href.replace(basePath, '') || '/';
|
|
@@ -1098,6 +1117,7 @@
|
|
|
1098
1117
|
{ key: 'phone', text: 'Телефонный звонок' },
|
|
1099
1118
|
{ key: 'email', text: 'Электронное сообщение' },
|
|
1100
1119
|
];
|
|
1120
|
+
// TODO Тоже надо рефакторить - файлик constants
|
|
1101
1121
|
const OUT_SERVICE_URL = '/api/v1/outservice/outserviceregions';
|
|
1102
1122
|
|
|
1103
1123
|
const getRegionUrl = (typeForm) => typeForm === 'OUTSERVICE' ? OUT_SERVICE_URL : undefined;
|
|
@@ -1201,15 +1221,22 @@
|
|
|
1201
1221
|
const defaultStyle$1 = 'w-full border rounded-md text-primary-text outline-none p-m';
|
|
1202
1222
|
|
|
1203
1223
|
const DEFAULT_HINTS_COUNT = 10;
|
|
1204
|
-
const
|
|
1224
|
+
const defaultResponseItemHandler = (item) => item?.value || '';
|
|
1225
|
+
const getResponseHandler = (itemHandler) => (response) => {
|
|
1205
1226
|
const responseData = response?.suggestions || [];
|
|
1206
|
-
return responseData.map((item) =>
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1227
|
+
return responseData.map((item) => {
|
|
1228
|
+
const value = itemHandler(item);
|
|
1229
|
+
return {
|
|
1230
|
+
...item,
|
|
1231
|
+
processedValue: value,
|
|
1232
|
+
};
|
|
1233
|
+
});
|
|
1210
1234
|
};
|
|
1211
1235
|
const getDaDataHints = (options) => {
|
|
1212
|
-
const { url, query, requestData = {} } = options;
|
|
1236
|
+
const { url, query, queryPrefix, requestData = {}, responseItemHandler = defaultResponseItemHandler, } = options;
|
|
1237
|
+
const responseHandler = getResponseHandler(responseItemHandler);
|
|
1238
|
+
const queryPrefixValue = queryPrefix ? `${queryPrefix}, ` : '';
|
|
1239
|
+
const combinedQuery = `${queryPrefixValue}${query}`;
|
|
1213
1240
|
const result = fetch(`/api/v1/suggestions/${url}`, {
|
|
1214
1241
|
method: 'POST',
|
|
1215
1242
|
mode: 'cors',
|
|
@@ -1219,11 +1246,11 @@
|
|
|
1219
1246
|
body: JSON.stringify({
|
|
1220
1247
|
count: DEFAULT_HINTS_COUNT,
|
|
1221
1248
|
...requestData,
|
|
1222
|
-
query,
|
|
1249
|
+
query: combinedQuery,
|
|
1223
1250
|
}),
|
|
1224
1251
|
})
|
|
1225
1252
|
.then((response) => response.json())
|
|
1226
|
-
.then(
|
|
1253
|
+
.then(responseHandler);
|
|
1227
1254
|
return result;
|
|
1228
1255
|
};
|
|
1229
1256
|
|
|
@@ -1251,11 +1278,33 @@
|
|
|
1251
1278
|
const EMAIL_HINTS_LIST_OPTIONS = {
|
|
1252
1279
|
url: 'suggest/email',
|
|
1253
1280
|
};
|
|
1281
|
+
const PASSPORT_FMS_HINTS_LIST_OPTIONS = {
|
|
1282
|
+
url: 'suggest/fms_unit',
|
|
1283
|
+
};
|
|
1284
|
+
const PASSPORT_CODE_HINTS_LIST_OPTIONS = {
|
|
1285
|
+
url: 'suggest/fms_unit',
|
|
1286
|
+
responseItemHandler: (item) => item?.data?.code?.replace('-', '') || '',
|
|
1287
|
+
};
|
|
1288
|
+
const ORGANIZATION_NAME_HINTS_LIST_OPTIONS = {
|
|
1289
|
+
url: 'suggest/party',
|
|
1290
|
+
};
|
|
1291
|
+
const ORGANIZATION_INN_HINTS_LIST_OPTIONS = {
|
|
1292
|
+
url: 'suggest/party',
|
|
1293
|
+
responseItemHandler: (item) => item?.data?.inn || '',
|
|
1294
|
+
};
|
|
1295
|
+
const ADDRESS_HINTS_LIST_OPTIONS = {
|
|
1296
|
+
url: 'suggest/address',
|
|
1297
|
+
};
|
|
1254
1298
|
const hintsListsOptions = {
|
|
1255
1299
|
name: NAME_HINTS_LIST_OPTIONS,
|
|
1256
1300
|
surname: SURNAME_HINTS_LIST_OPTIONS,
|
|
1257
1301
|
middleName: PATRONYMIC_HINTS_LIST_OPTIONS,
|
|
1258
1302
|
email: EMAIL_HINTS_LIST_OPTIONS,
|
|
1303
|
+
dulSubdivisionCode: PASSPORT_CODE_HINTS_LIST_OPTIONS,
|
|
1304
|
+
dulIssuedBy: PASSPORT_FMS_HINTS_LIST_OPTIONS,
|
|
1305
|
+
organizationName: ORGANIZATION_NAME_HINTS_LIST_OPTIONS,
|
|
1306
|
+
inn: ORGANIZATION_INN_HINTS_LIST_OPTIONS,
|
|
1307
|
+
participantAddress: ADDRESS_HINTS_LIST_OPTIONS,
|
|
1259
1308
|
};
|
|
1260
1309
|
|
|
1261
1310
|
const debounce = (fn, delay = 600) => {
|
|
@@ -1275,14 +1324,14 @@
|
|
|
1275
1324
|
};
|
|
1276
1325
|
|
|
1277
1326
|
const usePopupManager = () => ({
|
|
1278
|
-
open: (popup, options) => defaultEventBus.fire('popup', { type: 'open', popup, ...options }),
|
|
1279
|
-
update: (popup, options) => defaultEventBus.fire('popup', { type: 'update', popup, ...options }),
|
|
1280
|
-
close: () => defaultEventBus.fire('popup', { type: 'close' }),
|
|
1327
|
+
open: (popup, options) => defaultEventBus.emitter.fire('popup', { type: 'open', popup, ...options }),
|
|
1328
|
+
update: (popup, options) => defaultEventBus.emitter.fire('popup', { type: 'update', popup, ...options }),
|
|
1329
|
+
close: () => defaultEventBus.emitter.fire('popup', { type: 'close' }),
|
|
1281
1330
|
});
|
|
1282
1331
|
|
|
1283
|
-
const InputPopup = JSX(({ options, onChange }) => (jsx("div", { className: "bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl", role: "list", children: options?.map((item, key) => (jsx("div", { className: "flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative", role: "listitem", onMouseDown: () => onChange(item
|
|
1332
|
+
const InputPopup = JSX(({ options, onChange }) => (jsx("div", { className: "bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl", role: "list", children: options?.map((item, key) => (jsx("div", { className: "flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative", role: "listitem", onMouseDown: () => onChange(item), children: jsx("span", { className: "min-h-6", children: item.processedValue }) }, key.toString()))) })));
|
|
1284
1333
|
|
|
1285
|
-
function useInputPopup({ isOpen, value, name, onChange }) {
|
|
1334
|
+
function useInputPopup({ isOpen, value, name, onChange, onDaDataChange, daDataQueryPrefix, }) {
|
|
1286
1335
|
const prevInputValue = useRef(value);
|
|
1287
1336
|
const currentInputValue = useRef(value);
|
|
1288
1337
|
const [hintsList, setHintsList] = useState([]);
|
|
@@ -1294,8 +1343,9 @@
|
|
|
1294
1343
|
}, [value]);
|
|
1295
1344
|
const handleChange = useCallback((option) => {
|
|
1296
1345
|
close();
|
|
1297
|
-
currentInputValue.current = option;
|
|
1298
|
-
onChange && onChange(option);
|
|
1346
|
+
currentInputValue.current = option.processedValue;
|
|
1347
|
+
onChange && onChange(option.processedValue);
|
|
1348
|
+
onDaDataChange && onDaDataChange(option);
|
|
1299
1349
|
}, [close, onChange]);
|
|
1300
1350
|
const inputRef = useRef(null);
|
|
1301
1351
|
const getHintsList = useMemo(() => async (searchValue) => {
|
|
@@ -1304,15 +1354,17 @@
|
|
|
1304
1354
|
}
|
|
1305
1355
|
const result = await getDaDataHints({
|
|
1306
1356
|
url: defaultHintsListOptions.url,
|
|
1357
|
+
responseItemHandler: defaultHintsListOptions.responseItemHandler,
|
|
1307
1358
|
requestData: {
|
|
1308
1359
|
...defaultHintsListOptions?.requestData,
|
|
1309
1360
|
},
|
|
1310
1361
|
query: searchValue,
|
|
1362
|
+
queryPrefix: daDataQueryPrefix,
|
|
1311
1363
|
});
|
|
1312
1364
|
if (result?.length) {
|
|
1313
1365
|
setHintsList(result);
|
|
1314
1366
|
}
|
|
1315
|
-
}, []);
|
|
1367
|
+
}, [daDataQueryPrefix]);
|
|
1316
1368
|
const debouncedGetHintsList = useMemo(() => debounce(getHintsList, 300), [getHintsList]);
|
|
1317
1369
|
useEffect(() => {
|
|
1318
1370
|
if (!isOpen || !inputRef.current || currentInputValue.current === value) {
|
|
@@ -1334,14 +1386,16 @@
|
|
|
1334
1386
|
return inputRef;
|
|
1335
1387
|
}
|
|
1336
1388
|
|
|
1337
|
-
const InputControl = JSX(({ className, label, value = '', placeholder, error, errors, onChange = noop, onBlur, isTextarea, type, name = '', dadata = false, }) => {
|
|
1389
|
+
const InputControl = JSX(({ className, label, value = '', placeholder, error, errors, onChange = noop, onDaDataChange, onBlur, isTextarea, type, name = '', daDataQueryPrefix, dadata = false, }) => {
|
|
1338
1390
|
const [isOpen, { setFalse: close, setTrue: open }] = useBool();
|
|
1339
1391
|
const popupRef = useOutsideClick(close);
|
|
1340
1392
|
const inputRef = useInputPopup({
|
|
1341
1393
|
isOpen: isOpen && dadata,
|
|
1342
1394
|
name,
|
|
1343
1395
|
value,
|
|
1396
|
+
daDataQueryPrefix,
|
|
1344
1397
|
onChange,
|
|
1398
|
+
onDaDataChange,
|
|
1345
1399
|
});
|
|
1346
1400
|
return (jsxs("div", { className: style('shrink-0 w-full', className), ref: popupRef, onBlur: close, onFocus: open, children: [jsx("div", { ref: inputRef, children: jsx(Input, { type: type || 'text', "aria-label": label, label: getRequiredLabel({ label, errors }), valid: Boolean(!error), value: value, onChange: onChange, onBlur: onBlur, isTextarea: isTextarea, placeholder: getPlaceholder(placeholder, errors, label) }) }), renderErrorText(error)] }));
|
|
1347
1401
|
});
|
|
@@ -1541,6 +1595,7 @@
|
|
|
1541
1595
|
};
|
|
1542
1596
|
};
|
|
1543
1597
|
|
|
1598
|
+
// TODO Зачем это?
|
|
1544
1599
|
const getValidation = (field, validator, required = false) => required ? withValidator(field, validator) : field;
|
|
1545
1600
|
|
|
1546
1601
|
const ACQUIRING_TYPES = [
|
|
@@ -1957,13 +2012,24 @@
|
|
|
1957
2012
|
|
|
1958
2013
|
const DulIssueDateField = JSX(({ field, input }) => (jsx(DatePickerControl, { label: "\u0414\u0430\u0442\u0430 \u0432\u044B\u0434\u0430\u0447\u0438", ...getValidation(field('dulIssueDateField'), validatorObj.dulIssueDateField, input?.required) })));
|
|
1959
2014
|
|
|
1960
|
-
const
|
|
2015
|
+
const DulIssuedByField = JSX(({ field, input }) => {
|
|
2016
|
+
const { value: dulSubdivisionCode, onChange: changeDulSubdivisionCode } = field('dulSubdivisionCode');
|
|
2017
|
+
const onDaDataChange = useCallback((item) => {
|
|
2018
|
+
changeDulSubdivisionCode?.(item?.data?.code?.replace('-', ''));
|
|
2019
|
+
}, []);
|
|
2020
|
+
return (jsx(InputControl, { label: "\u041A\u0435\u043C \u0432\u044B\u0434\u0430\u043D", ...input, ...getValidation(field('dulIssuedBy'), validatorObj.dulIssuedBy, input?.required), onDaDataChange: onDaDataChange, daDataQueryPrefix: dulSubdivisionCode }));
|
|
2021
|
+
});
|
|
1961
2022
|
|
|
1962
2023
|
const DulNumberField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041D\u043E\u043C\u0435\u0440 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430", type: "number", ...getValidation(field('dulNumber'), validatorObj.dulNumber, input?.required) })));
|
|
1963
2024
|
|
|
1964
2025
|
const DulSerieField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u0421\u0435\u0440\u0438\u044F \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430", type: "number", ...getValidation(field('dulSerie'), validatorObj.dulSerie, input?.required) })));
|
|
1965
2026
|
|
|
1966
|
-
const
|
|
2027
|
+
const DulSubdivisionCodeField = JSX(({ field, input }) => {
|
|
2028
|
+
const onDaDataChange = useCallback((item) => {
|
|
2029
|
+
field?.('dulIssuedBy')?.onChange?.(item?.data?.name);
|
|
2030
|
+
}, []);
|
|
2031
|
+
return (jsx(InputControl, { label: "\u041A\u043E\u0434 \u043F\u043E\u0434\u0440\u0430\u0437\u0434\u0435\u043B\u0435\u043D\u0438\u044F", type: "number", ...input, ...getValidation(field('dulSubdivisionCode'), validatorObj.dulSubdivisionCode, input?.required), onDaDataChange: onDaDataChange }));
|
|
2032
|
+
});
|
|
1967
2033
|
|
|
1968
2034
|
const EducationField = JSX(({ field, input }) => {
|
|
1969
2035
|
const { data: education } = useLeadFormData('EDUCATION_LEVEL');
|
|
@@ -2014,7 +2080,13 @@
|
|
|
2014
2080
|
return (jsx(SelectField, { field: field, source: housing, label: "\u0422\u0438\u043F \u0436\u0438\u043B\u044C\u044F", fieldName: "housing", input: input }));
|
|
2015
2081
|
});
|
|
2016
2082
|
|
|
2017
|
-
const InnField = JSX(({ field, input }) =>
|
|
2083
|
+
const InnField = JSX(({ field, input }) => {
|
|
2084
|
+
const onDaDataChange = useCallback((item) => {
|
|
2085
|
+
field?.('organizationName')?.onChange?.(item.data?.name?.short_with_opf);
|
|
2086
|
+
field?.('legalForm')?.onChange?.(item.data?.opf?.short);
|
|
2087
|
+
}, []);
|
|
2088
|
+
return (jsx(InputControl, { label: "\u0418\u041D\u041D", type: "number", ...input, ...getValidation(field('inn'), validatorObj.inn, input?.required), onDaDataChange: onDaDataChange }));
|
|
2089
|
+
});
|
|
2018
2090
|
|
|
2019
2091
|
const IsClientField = JSX(({ field }) => (jsx(CheckboxWithError, { ...field('isClient'), text: '\u042F\u0432\u043B\u044F\u044E\u0441\u044C \u043A\u043B\u0438\u0435\u043D\u0442\u043E\u043C \u0431\u0430\u043D\u043A\u0430 \u0410\u041E "\u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A"' })));
|
|
2020
2092
|
|
|
@@ -2025,9 +2097,11 @@
|
|
|
2025
2097
|
const LegalFormField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041E\u041F\u0424", placeholder: "\u041E\u041E\u041E, \u041F\u0410\u041E \u0438 \u0434\u0440.", ...getValidation(field('legalForm'), validatorObj.legalForm, input?.required), ...input })));
|
|
2026
2098
|
|
|
2027
2099
|
const REGIONS_URL = '/api/v1/regions';
|
|
2100
|
+
const EMPTY_REGIONS = [];
|
|
2101
|
+
// TODO Почему url можно менять? Разве смысл не в инкапсуляции api url. Тоже под рефакторинг попадает
|
|
2028
2102
|
function useRegions(url = REGIONS_URL) {
|
|
2029
2103
|
const { data } = useAsyncData(url, fetchJSONUnsafe);
|
|
2030
|
-
return Array.isArray(data) ? data :
|
|
2104
|
+
return Array.isArray(data) ? data : EMPTY_REGIONS;
|
|
2031
2105
|
}
|
|
2032
2106
|
|
|
2033
2107
|
const LocalitiesField = JSX(({ field, input }) => {
|
|
@@ -2057,7 +2131,13 @@
|
|
|
2057
2131
|
return (jsx(SelectField, { field: field, source: organization, label: "\u0422\u0438\u043F \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", fieldName: "organization", input: input }));
|
|
2058
2132
|
});
|
|
2059
2133
|
|
|
2060
|
-
const OrganizationNameField = JSX(({ field, input }) =>
|
|
2134
|
+
const OrganizationNameField = JSX(({ field, input }) => {
|
|
2135
|
+
const onDaDataChange = useCallback((item) => {
|
|
2136
|
+
field?.('inn')?.onChange?.(item.data?.inn);
|
|
2137
|
+
field?.('legalForm')?.onChange?.(item.data?.opf?.short);
|
|
2138
|
+
}, []);
|
|
2139
|
+
return (jsx(InputControl, { label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...input, ...getValidation(field('organizationName'), validatorObj.organizationName, input?.required), onDaDataChange: onDaDataChange }));
|
|
2140
|
+
});
|
|
2061
2141
|
|
|
2062
2142
|
const ParticipantAddressField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u0410\u0434\u0440\u0435\u0441", ...getValidation(field('participantAddress'), validatorObj.participantAddress, input?.required), ...input })));
|
|
2063
2143
|
|
|
@@ -2292,8 +2372,8 @@
|
|
|
2292
2372
|
dulSerie: jsx(DulSerieField, { field: field, input: input }),
|
|
2293
2373
|
dulNumber: jsx(DulNumberField, { field: field, input: input }),
|
|
2294
2374
|
dulIssueDateField: jsx(DulIssueDateField, { field: field, input: input }),
|
|
2295
|
-
dulSubdivisionCode: jsx(
|
|
2296
|
-
dulIssuedBy: jsx(
|
|
2375
|
+
dulSubdivisionCode: jsx(DulSubdivisionCodeField, { field: field, input: input }),
|
|
2376
|
+
dulIssuedBy: jsx(DulIssuedByField, { field: field, input: input }),
|
|
2297
2377
|
participantAddress: jsx(ParticipantAddressField, { field: field, input: input }),
|
|
2298
2378
|
participantDateRegistration: jsx(ParticipantDateRegistrationField, { field: field, input: input }),
|
|
2299
2379
|
};
|
|
@@ -2551,6 +2631,14 @@
|
|
|
2551
2631
|
return { ...formState, typeForm: { key: typeForm, text: '' } };
|
|
2552
2632
|
};
|
|
2553
2633
|
|
|
2634
|
+
const FoldableWrapper = JSX(({ className, children }) => (jsx("div", { className: className, role: "group", children: children })));
|
|
2635
|
+
/**
|
|
2636
|
+
* Какой то бесполезный компонент. Его можно заменить на useBool
|
|
2637
|
+
* Лучше оставить только обёрточный div с необходимой атрибутикой
|
|
2638
|
+
* и сделать пассивный компонент
|
|
2639
|
+
*
|
|
2640
|
+
* @deprecated
|
|
2641
|
+
*/
|
|
2554
2642
|
const Foldable = JSX(({ className = '', isFoldButtonOnTop = false, unfoldedByDefault = false, renderFoldableSection, renderFoldButton, }) => {
|
|
2555
2643
|
const [isUnfolded, setIsUnfolded] = useState(unfoldedByDefault);
|
|
2556
2644
|
const onToggle = useCallback(() => {
|
|
@@ -2558,7 +2646,7 @@
|
|
|
2558
2646
|
}, []);
|
|
2559
2647
|
const sectionNode = renderFoldableSection({ isUnfolded, onToggle });
|
|
2560
2648
|
const buttonNode = renderFoldButton ? renderFoldButton({ isUnfolded, onToggle }) : null;
|
|
2561
|
-
return isFoldButtonOnTop ? (jsxs(
|
|
2649
|
+
return isFoldButtonOnTop ? (jsxs(FoldableWrapper, { className: className, children: [buttonNode, sectionNode] })) : (jsxs(FoldableWrapper, { className: className, children: [sectionNode, buttonNode] }));
|
|
2562
2650
|
});
|
|
2563
2651
|
|
|
2564
2652
|
function useResizeObserver(callback, deps) {
|
|
@@ -4636,31 +4724,37 @@
|
|
|
4636
4724
|
const CarouselRecommendationCard = JSX(({ className, padding, description, additionalDescription, href, icon, isDotted, __html, socialMedia = [], target, title, align = 'text-left', benefits, imageOptions: { directionRight = true, isImageAlwaysOnRight = ImageAlwaysOnRight, isImageSecondary = false, } = {}, data, ...rest }) => (jsx(BlockWrapper, { className: style('relative min-h-28 group-data-gray:bg-main-divider/50', className), defaultPadding: "p-0", ...rest, children: jsx(LinkWrapper, { href: href, target: target, className: "h-full", data: getAspectsWithInclude(data), children: jsxs(BaseTile, { className: "h-full", defaultPadding: "p-2xl", padding: padding, insetTitle: jsx(Headline, { title: title, description: description, headlineVersion: "XS", isEmbedded: true, align: align }), ...leftOrRightImage(isIcon(icon) ? jsx(Img, { image: icon }) : null, directionRight), buttons: socialMedia.length ? (jsx(SocialMedia, { media: socialMedia, stretched: true, showButtonText: true, version: rest?.version })) : null, isImageAlwaysOnRight: isImageAlwaysOnRight, isImageSecondary: isImageSecondary, imageAlign: "center", children: [jsx(BenefitsList, { benefits: benefits }), __html ? jsx(RichText, { __html: __html, isDotted: isDotted, itemSize: "list-s" }) : null, renderAdditionalDescription(additionalDescription, align)] }) }) })));
|
|
4637
4725
|
const renderAdditionalDescription = (additionalDescription, align) => additionalDescription ? (jsx(Paragraph, { size: "text-m", font: "font-light", color: "text-secondary-text group-data-secondary:text-white/80", align: align, children: additionalDescription })) : null;
|
|
4638
4726
|
|
|
4727
|
+
const useSubjectState = (eventBus, type, initialState) => {
|
|
4728
|
+
const [state, setState] = useState(initialState);
|
|
4729
|
+
useEffect(() => eventBus.subscribe(type, setState), [eventBus, type]);
|
|
4730
|
+
return state;
|
|
4731
|
+
};
|
|
4732
|
+
|
|
4639
4733
|
const renderCardInfo = (cell, i) => {
|
|
4640
4734
|
const { title, description, buttons } = cell;
|
|
4641
4735
|
return (jsxs("div", { className: "py-lg border-b border-main-divider", children: [title ? (jsx("div", { className: "opacity-80", children: jsx(Text, { size: "text-m", color: "text-secondary-text", children: title }) })) : null, description ? (jsx("div", { className: "mt-2xs", children: jsx(Text, { size: "text-xl", color: "text-primary-text", children: description }) })) : null, buttons?.length ? (jsx("div", { className: "text-primary-main", children: renderButtonsSection(buttons) })) : null] }, String(i)));
|
|
4642
4736
|
};
|
|
4643
4737
|
|
|
4644
|
-
const
|
|
4645
|
-
const
|
|
4646
|
-
const [visibleCells, hiddenCells] = visibleCellsCount > 0
|
|
4647
|
-
? [
|
|
4648
|
-
: [
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4738
|
+
const CardCellsSection = JSX((props) => {
|
|
4739
|
+
const { cardCells = [], visibleCellsCount = 1, isUnfolded } = props;
|
|
4740
|
+
const [visibleCells, hiddenCells] = visibleCellsCount > 0 && cardCells.length >= visibleCellsCount
|
|
4741
|
+
? [cardCells.slice(0, visibleCellsCount), cardCells.slice(visibleCellsCount)]
|
|
4742
|
+
: [cardCells, []];
|
|
4743
|
+
return hiddenCells.length ? (jsxs(FoldableWrapper, { children: [jsxs("div", { children: [visibleCells.map(renderCardInfo), jsx(FoldableSection, { isUnfolded: isUnfolded, children: hiddenCells.map(renderCardInfo) })] }), jsx(FoldButton, { ...props })] })) : (jsx("div", { children: visibleCells.map(renderCardInfo) }));
|
|
4744
|
+
});
|
|
4745
|
+
const FoldButton = JSX(({ isUnfolded, data, onToggle }) => (jsxs("button", { type: "button", className: "w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center", ...(isUnfolded ? getAspectsAttributes(data) : {}), onClick: onToggle, children: [jsx("div", { children: isUnfolded ? 'Скрыть' : 'Подробнее о тарифе' }), jsx(Icon, { className: "text-primary-text", name: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" })] })));
|
|
4746
|
+
|
|
4747
|
+
const carouselTariffsCardEventBus = new EventBus();
|
|
4748
|
+
|
|
4749
|
+
const CarouselTariffsCard = JSX(({ className, title, align = 'text-center', icon, button, visibleCellsCount = 1, cardCells = [], options, data, ...rest }) => {
|
|
4750
|
+
const { isUnfolded, parent: firedParent } = useSubjectState(carouselTariffsCardEventBus.observable, 'fold', {});
|
|
4751
|
+
const isVisible = isUnfolded && firedParent === options?.parent;
|
|
4752
|
+
const toggle = useCallback(() => carouselTariffsCardEventBus.emitter.fire('fold', {
|
|
4753
|
+
isUnfolded: !isVisible,
|
|
4754
|
+
parent: options?.parent,
|
|
4755
|
+
}), [isVisible, options?.parent]);
|
|
4756
|
+
return (jsxs(BlockWrapper, { className: style('flex flex-col', className), defaultPadding: "p-2xl", ...rest, children: [isIcon(icon) ? (jsx("div", { className: "self-center", children: jsx(Img, { image: icon }) })) : null, title ? (jsx(Heading, { className: style('pt-xs', align), headingType: "h5", title: title })) : null, button?.text ? jsx(LinkButton, { className: "w-full mt-m mb-lg", ...button }) : null, jsx(CardCellsSection, { cardCells: cardCells, visibleCellsCount: visibleCellsCount, isUnfolded: isVisible, data: data, onToggle: toggle })] }));
|
|
4757
|
+
});
|
|
4664
4758
|
|
|
4665
4759
|
const isRateRow = (rateRow) => typeof rateRow?.minMonths === 'number' && typeof rateRow?.maxMonths === 'number';
|
|
4666
4760
|
|
|
@@ -4827,47 +4921,46 @@
|
|
|
4827
4921
|
};
|
|
4828
4922
|
const ErrorBlock = JSX(({ className = '', title, description, error, button, ...rest }) => (jsxs(BlockWrapper, { className: style('flex flex-col justify-center items-center', className), defaultPadding: style('p-6xl'), version: "transparent", ...rest, children: [jsx("div", { className: "flex justify-center", children: renderErrorContent(error) }), jsx(Headline, { title: title, description: description, headlineVersion: "XL", isEmbedded: true, className: "mb-2xl last:mb-0" }), button?.text ? (jsx(LinkButton, { version: button?.version, text: button?.text, ...button })) : null] })));
|
|
4829
4923
|
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4924
|
+
function useSubject(eventBus, type, initialState) {
|
|
4925
|
+
useEffect(() => {
|
|
4926
|
+
const state = initialState instanceof Function ? initialState() : initialState;
|
|
4927
|
+
if (state instanceof Promise) {
|
|
4928
|
+
state.then((_) => eventBus.subject(type, _), console.warn);
|
|
4929
|
+
}
|
|
4930
|
+
else {
|
|
4931
|
+
eventBus.subject(type, state);
|
|
4932
|
+
}
|
|
4933
|
+
}, [eventBus, type]);
|
|
4934
|
+
return useCallback((_) => eventBus.fire(type, _), [eventBus, type]);
|
|
4935
|
+
}
|
|
4836
4936
|
|
|
4837
4937
|
const REGION_URL = '/api/v1/region';
|
|
4838
4938
|
const LOCATION_STORAGE_KEY = 'location';
|
|
4839
4939
|
function useLocation(defaultLocation = 'Москва') {
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4940
|
+
useEffect(() => defaultEventBus.subscribe('location', storeLocation), []);
|
|
4941
|
+
return useSubject(defaultEventBus.emitter, 'location', restoreLocation(defaultLocation));
|
|
4942
|
+
}
|
|
4943
|
+
function useLocationState(defaultLocation = 'Москва') {
|
|
4944
|
+
return useSubjectState(defaultEventBus.observable, 'location', { name: defaultLocation });
|
|
4945
|
+
}
|
|
4946
|
+
function restoreLocation(defaultLocation) {
|
|
4947
|
+
return async () => {
|
|
4948
|
+
if (!globalThis.localStorage?.hasItem(LOCATION_STORAGE_KEY)) {
|
|
4949
|
+
storeLocation(await fetchJSON(REGION_URL));
|
|
4950
|
+
}
|
|
4951
|
+
const storedLocation = globalThis.localStorage?.getItem(LOCATION_STORAGE_KEY);
|
|
4952
|
+
try {
|
|
4953
|
+
return storedLocation && JSON.parse(storedLocation);
|
|
4954
|
+
}
|
|
4955
|
+
catch (ex) {
|
|
4956
|
+
// Do nothing
|
|
4849
4957
|
}
|
|
4850
|
-
|
|
4851
|
-
|
|
4958
|
+
return { name: defaultLocation };
|
|
4959
|
+
};
|
|
4960
|
+
}
|
|
4961
|
+
function storeLocation(_) {
|
|
4962
|
+
_ && globalThis.localStorage?.setItem(LOCATION_STORAGE_KEY, JSON.stringify(_));
|
|
4852
4963
|
}
|
|
4853
|
-
const hasStoredLocation = () => Boolean(globalThis.localStorage?.getItem(LOCATION_STORAGE_KEY));
|
|
4854
|
-
const restoreLocation = () => {
|
|
4855
|
-
try {
|
|
4856
|
-
const data = globalThis.localStorage?.getItem(LOCATION_STORAGE_KEY);
|
|
4857
|
-
return data && JSON.parse(data);
|
|
4858
|
-
}
|
|
4859
|
-
catch (ex) {
|
|
4860
|
-
return null;
|
|
4861
|
-
}
|
|
4862
|
-
};
|
|
4863
|
-
const storeLocation = (_) => {
|
|
4864
|
-
try {
|
|
4865
|
-
globalThis.localStorage?.setItem(LOCATION_STORAGE_KEY, JSON.stringify(_));
|
|
4866
|
-
}
|
|
4867
|
-
catch (ex) {
|
|
4868
|
-
// Do nothing
|
|
4869
|
-
}
|
|
4870
|
-
};
|
|
4871
4964
|
|
|
4872
4965
|
var Currency;
|
|
4873
4966
|
(function (Currency) {
|
|
@@ -5009,7 +5102,7 @@
|
|
|
5009
5102
|
}
|
|
5010
5103
|
|
|
5011
5104
|
const ExchangeRateTile = JSX(({ className = '', title = 'Курсы обмена валют', button, ...rest }) => {
|
|
5012
|
-
const
|
|
5105
|
+
const currentLocation = useLocationState();
|
|
5013
5106
|
const exchangeRates = useFetchExchangeRateData(currentLocation);
|
|
5014
5107
|
const currencyRates = getCurrencyRates(exchangeRates?.exchangeRate?.currencies);
|
|
5015
5108
|
const currencyRatesBuy = currencyRates.filter((_) => _.buyExchangeRate);
|
|
@@ -5862,7 +5955,7 @@
|
|
|
5862
5955
|
designDisabledPeople: (item) => Boolean(item.designDisabledPeople),
|
|
5863
5956
|
};
|
|
5864
5957
|
const AtmsMap = JSX(({ descriptionData, className }) => {
|
|
5865
|
-
const
|
|
5958
|
+
const currentLocation = useLocationState();
|
|
5866
5959
|
const regionCode = currentLocation?.code ?? '000';
|
|
5867
5960
|
const { data: officesData, isLoad } = useAtms(regionCode);
|
|
5868
5961
|
return (jsx(OfficesAtmsMapLayout, { className: className, filterItems: filterItems, data: officesData, isLoad: isLoad, initFilterState: INITIAL_FILTRATION_STATE, renderCard: renderAtmCard, getBalloon: getAtmPoint, title: `Банкоматы филиала ${currentLocation?.name}`, descriptionData: descriptionData }));
|
|
@@ -6081,7 +6174,7 @@
|
|
|
6081
6174
|
};
|
|
6082
6175
|
|
|
6083
6176
|
const OfficesMap = JSX(({ className }) => {
|
|
6084
|
-
const
|
|
6177
|
+
const currentLocation = useLocationState();
|
|
6085
6178
|
const regionCode = currentLocation?.code ?? '000';
|
|
6086
6179
|
const { data, isLoad } = useOffices(regionCode);
|
|
6087
6180
|
return (jsx(OfficesAtmsMapLayout, { className: className, data: data?.branches, isLoad: isLoad, remoteWorkplaces: data?.remoteWorkplaces, renderCard: renderOfficeCard, renderRemoteWorkplaceCard: renderRemoteWorkplaceCard, getBalloon: getOfficePoint, getBalloonRemoteWorkplaces: getRemoteWorkplacePoint, title: `Офисы филиала ${currentLocation?.name}` }));
|
|
@@ -6329,7 +6422,7 @@
|
|
|
6329
6422
|
onClose && onClose(dialogs[dialogs.length - 1]);
|
|
6330
6423
|
pop();
|
|
6331
6424
|
}, [dialogs, onClose]);
|
|
6332
|
-
useEffect(() => defaultEventBus.subscribe('dialog', (action) => {
|
|
6425
|
+
useEffect(() => defaultEventBus.observable.subscribe('dialog', (action) => {
|
|
6333
6426
|
switch (action.type) {
|
|
6334
6427
|
case 'open':
|
|
6335
6428
|
push(action);
|
|
@@ -6438,27 +6531,33 @@
|
|
|
6438
6531
|
return (jsxs("form", { className: `font-sans relative ${className}`, children: [jsx("div", { className: "absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none", children: searchTerm ? null : (jsx("label", { htmlFor: "search-bar-input", className: `text-secondary-text `, children: "\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0444\u0438\u043B\u0438\u0430\u043B\u0430\u043C" })) }), jsx("input", { id: "search-bar-input", className: style(inputValidStyle, `h-12 pl-m w-full peer text-l text-black rounded-md box-border`), value: searchTerm, onChange: (e) => onSearch(e.target.value.toLowerCase()), type: "text", name: "location-search-bar-input" })] }));
|
|
6439
6532
|
});
|
|
6440
6533
|
|
|
6441
|
-
const
|
|
6442
|
-
|
|
6443
|
-
const [currentLocation, selectCurrentLocation] = useLocation(branches?.default);
|
|
6534
|
+
const SelectedLocation = JSX(({ defaultLocation }) => {
|
|
6535
|
+
const currentLocation = useLocationState(defaultLocation);
|
|
6444
6536
|
const link = useLink();
|
|
6445
6537
|
const { href } = link({ href: `/branches/${currentLocation.slug}` });
|
|
6538
|
+
return currentLocation ? (jsx("div", { className: "mb-s", children: jsxs(Paragraph, { size: "text-l", color: "text-primary-text", children: ["\u0421\u0435\u0439\u0447\u0430\u0441 \u0432\u044B\u0431\u0440\u0430\u043D:", jsx(LinkWrapper, { href: href, className: "inline mx-2xs text-primary-main", children: currentLocation.name })] }) })) : null;
|
|
6539
|
+
});
|
|
6540
|
+
|
|
6541
|
+
const SEARCH_TERM_MIN_LENGTH = 3;
|
|
6542
|
+
const LocationDialog = JSX(({ foreignOffices, branches }) => {
|
|
6543
|
+
const selectLocation = useLocation(branches?.default);
|
|
6446
6544
|
const [query, setQuery] = useState('');
|
|
6447
|
-
const
|
|
6448
|
-
const
|
|
6545
|
+
const rawRegions = useRegions();
|
|
6546
|
+
const regions = useMemo(() => cleanUpRegions(rawRegions).sort((a, b) => (a.name ?? '').localeCompare(b.name ?? '')), [rawRegions]);
|
|
6547
|
+
const regionsGroupByLetter = useMemo(() => groupBy(regions, regionFirstLetter), [regions]);
|
|
6449
6548
|
const { close } = useDialogManager();
|
|
6450
6549
|
const handleChangeLocation = useCallback((region) => {
|
|
6451
|
-
|
|
6550
|
+
selectLocation(region);
|
|
6452
6551
|
close();
|
|
6453
6552
|
}, []);
|
|
6454
|
-
return (jsxs(Dialog, { className: "pb-20", head: jsxs("div", { children: [jsx(Text, { size: "text-h4", color: "text-primary-text", children: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B" }),
|
|
6553
|
+
return (jsxs(Dialog, { className: "pb-20", head: jsxs("div", { children: [jsx(Text, { size: "text-h4", color: "text-primary-text", children: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B" }), jsx(SelectedLocation, { defaultLocation: branches?.default }), jsx(SearchBar, { onSearch: setQuery, searchTerm: query })] }), children: [query && query.length >= SEARCH_TERM_MIN_LENGTH ? (jsx("div", { children: regions
|
|
6455
6554
|
.filter(({ name }) => name && jaroWinklerDistance(name.toLowerCase())(query.toLowerCase()) >= 0.8)
|
|
6456
6555
|
.map(renderRegion(branches?.dataSelect, handleChangeLocation)) })) : (jsx("div", { className: "columns-1 sm:columns-3 md:columns-4 lg:columns-5", children: Array.from(regionsGroupByLetter.entries()).map(renderRegionGroup(handleChangeLocation, branches?.dataSelect)) })), renderForeignOffices(foreignOffices)] }));
|
|
6457
6556
|
});
|
|
6458
|
-
const regionFirstLetter = (region) => region.name?.charAt(0)
|
|
6557
|
+
const regionFirstLetter = (region) => region.name?.charAt(0) ?? '';
|
|
6459
6558
|
const cleanUpRegions = (regions) => regions.map((region) => ({
|
|
6460
6559
|
...region,
|
|
6461
|
-
name: region.name?.replace(/республика|область|край'/gi, '').trim()
|
|
6560
|
+
name: region.name?.replace(/республика|область|край'/gi, '').trim() ?? '',
|
|
6462
6561
|
}));
|
|
6463
6562
|
|
|
6464
6563
|
const useLocationDialog = (props) => {
|
|
@@ -6471,7 +6570,7 @@
|
|
|
6471
6570
|
|
|
6472
6571
|
const BurgerMenuDialog = JSX(({ menuRef, menuItem, locationDialogProps, closeAll }) => {
|
|
6473
6572
|
const locationDialog = useLocationDialog(locationDialogProps || {});
|
|
6474
|
-
const
|
|
6573
|
+
const { name: location } = useLocationState();
|
|
6475
6574
|
const menuDimensions = menuRef?.current?.getBoundingClientRect();
|
|
6476
6575
|
const basePath = getBasePath(env.SITE_URL);
|
|
6477
6576
|
const handleIframeLoad = () => {
|
|
@@ -7031,7 +7130,7 @@
|
|
|
7031
7130
|
const close = useCallback(() => {
|
|
7032
7131
|
setPopup(null);
|
|
7033
7132
|
}, []);
|
|
7034
|
-
useEffect(() => defaultEventBus.subscribe('popup', (action) => {
|
|
7133
|
+
useEffect(() => defaultEventBus.observable.subscribe('popup', (action) => {
|
|
7035
7134
|
switch (action.type) {
|
|
7036
7135
|
case 'open':
|
|
7037
7136
|
case 'update':
|
|
@@ -7086,7 +7185,7 @@
|
|
|
7086
7185
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
7087
7186
|
});
|
|
7088
7187
|
|
|
7089
|
-
const packageVersion = "0.14.
|
|
7188
|
+
const packageVersion = "0.14.596";
|
|
7090
7189
|
|
|
7091
7190
|
exports.Blocks = Blocks;
|
|
7092
7191
|
exports.ContentPage = ContentPage;
|