@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
package/bundle/bundle.umd.js
CHANGED
|
@@ -403,39 +403,58 @@
|
|
|
403
403
|
].join(' ');
|
|
404
404
|
|
|
405
405
|
class EventBus {
|
|
406
|
-
|
|
406
|
+
subscribersMap = {};
|
|
407
407
|
subjectsStateMap = {};
|
|
408
|
+
emitter = this;
|
|
409
|
+
observable = this;
|
|
408
410
|
subscribe(type, listener) {
|
|
409
|
-
this.
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
listener(latestEvent);
|
|
413
|
-
}
|
|
411
|
+
this.subscribersMap[type] ||= [];
|
|
412
|
+
this.subscribersMap[type]?.push(listener);
|
|
413
|
+
this.fireSubscribers([listener], this.subjectsStateMap[type]);
|
|
414
414
|
return () => {
|
|
415
415
|
this.unsubscribe(type, listener);
|
|
416
416
|
};
|
|
417
417
|
}
|
|
418
418
|
unsubscribe(type, listener) {
|
|
419
|
-
|
|
419
|
+
const index = this.subscribersMap[type]?.indexOf(listener);
|
|
420
|
+
if (index && index !== -1) {
|
|
421
|
+
this.subscribersMap[type]?.splice(index, 1);
|
|
422
|
+
}
|
|
420
423
|
}
|
|
421
424
|
fire(type, event) {
|
|
422
425
|
const isSubjectDeclared = type in this.subjectsStateMap;
|
|
423
426
|
if (isSubjectDeclared) {
|
|
424
|
-
this.
|
|
427
|
+
this.subject(type, event);
|
|
428
|
+
}
|
|
429
|
+
else {
|
|
430
|
+
this.fireSubscribers(this.subscribersMap[type], event);
|
|
425
431
|
}
|
|
426
|
-
this.subscribers[type]?.forEach((s) => s(event));
|
|
427
432
|
}
|
|
428
433
|
subject(type, event) {
|
|
429
|
-
this.subjectsStateMap[type]
|
|
434
|
+
if (this.subjectsStateMap[type] !== event) {
|
|
435
|
+
this.subjectsStateMap[type] = event;
|
|
436
|
+
this.fireSubscribers(this.subscribersMap[type], event);
|
|
437
|
+
}
|
|
438
|
+
return () => {
|
|
439
|
+
delete this.subjectsStateMap[type];
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
fireSubscribers(subscribers, event) {
|
|
443
|
+
if (!subscribers || !event) {
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
for (const _ of subscribers) {
|
|
447
|
+
_(event);
|
|
448
|
+
}
|
|
430
449
|
}
|
|
431
450
|
}
|
|
432
451
|
|
|
433
452
|
const defaultEventBus = new EventBus();
|
|
434
453
|
|
|
435
454
|
const useDialogManager = () => ({
|
|
436
|
-
open: (dialog, options = {}) => defaultEventBus.fire('dialog', { type: 'open', dialog, ...options }),
|
|
437
|
-
close: () => defaultEventBus.fire('dialog', { type: 'close' }),
|
|
438
|
-
closeAll: () => defaultEventBus.fire('dialog', { type: 'close', all: true }),
|
|
455
|
+
open: (dialog, options = {}) => defaultEventBus.emitter.fire('dialog', { type: 'open', dialog, ...options }),
|
|
456
|
+
close: () => defaultEventBus.emitter.fire('dialog', { type: 'close' }),
|
|
457
|
+
closeAll: () => defaultEventBus.emitter.fire('dialog', { type: 'close', all: true }),
|
|
439
458
|
});
|
|
440
459
|
|
|
441
460
|
const adjustBase = (href, basePath = '') => href.replace(basePath, '') || '/';
|
|
@@ -1090,6 +1109,7 @@
|
|
|
1090
1109
|
{ key: 'phone', text: 'Телефонный звонок' },
|
|
1091
1110
|
{ key: 'email', text: 'Электронное сообщение' },
|
|
1092
1111
|
];
|
|
1112
|
+
// TODO Тоже надо рефакторить - файлик constants
|
|
1093
1113
|
const OUT_SERVICE_URL = '/api/v1/outservice/outserviceregions';
|
|
1094
1114
|
|
|
1095
1115
|
const getRegionUrl = (typeForm) => typeForm === 'OUTSERVICE' ? OUT_SERVICE_URL : undefined;
|
|
@@ -1193,15 +1213,22 @@
|
|
|
1193
1213
|
const defaultStyle$1 = 'w-full border rounded-md text-primary-text outline-none p-m';
|
|
1194
1214
|
|
|
1195
1215
|
const DEFAULT_HINTS_COUNT = 10;
|
|
1196
|
-
const
|
|
1216
|
+
const defaultResponseItemHandler = (item) => item?.value || '';
|
|
1217
|
+
const getResponseHandler = (itemHandler) => (response) => {
|
|
1197
1218
|
const responseData = response?.suggestions || [];
|
|
1198
|
-
return responseData.map((item) =>
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1219
|
+
return responseData.map((item) => {
|
|
1220
|
+
const value = itemHandler(item);
|
|
1221
|
+
return {
|
|
1222
|
+
...item,
|
|
1223
|
+
processedValue: value,
|
|
1224
|
+
};
|
|
1225
|
+
});
|
|
1202
1226
|
};
|
|
1203
1227
|
const getDaDataHints = (options) => {
|
|
1204
|
-
const { url, query, requestData = {} } = options;
|
|
1228
|
+
const { url, query, queryPrefix, requestData = {}, responseItemHandler = defaultResponseItemHandler, } = options;
|
|
1229
|
+
const responseHandler = getResponseHandler(responseItemHandler);
|
|
1230
|
+
const queryPrefixValue = queryPrefix ? `${queryPrefix}, ` : '';
|
|
1231
|
+
const combinedQuery = `${queryPrefixValue}${query}`;
|
|
1205
1232
|
const result = fetch(`/api/v1/suggestions/${url}`, {
|
|
1206
1233
|
method: 'POST',
|
|
1207
1234
|
mode: 'cors',
|
|
@@ -1211,11 +1238,11 @@
|
|
|
1211
1238
|
body: JSON.stringify({
|
|
1212
1239
|
count: DEFAULT_HINTS_COUNT,
|
|
1213
1240
|
...requestData,
|
|
1214
|
-
query,
|
|
1241
|
+
query: combinedQuery,
|
|
1215
1242
|
}),
|
|
1216
1243
|
})
|
|
1217
1244
|
.then((response) => response.json())
|
|
1218
|
-
.then(
|
|
1245
|
+
.then(responseHandler);
|
|
1219
1246
|
return result;
|
|
1220
1247
|
};
|
|
1221
1248
|
|
|
@@ -1243,11 +1270,33 @@
|
|
|
1243
1270
|
const EMAIL_HINTS_LIST_OPTIONS = {
|
|
1244
1271
|
url: 'suggest/email',
|
|
1245
1272
|
};
|
|
1273
|
+
const PASSPORT_FMS_HINTS_LIST_OPTIONS = {
|
|
1274
|
+
url: 'suggest/fms_unit',
|
|
1275
|
+
};
|
|
1276
|
+
const PASSPORT_CODE_HINTS_LIST_OPTIONS = {
|
|
1277
|
+
url: 'suggest/fms_unit',
|
|
1278
|
+
responseItemHandler: (item) => item?.data?.code?.replace('-', '') || '',
|
|
1279
|
+
};
|
|
1280
|
+
const ORGANIZATION_NAME_HINTS_LIST_OPTIONS = {
|
|
1281
|
+
url: 'suggest/party',
|
|
1282
|
+
};
|
|
1283
|
+
const ORGANIZATION_INN_HINTS_LIST_OPTIONS = {
|
|
1284
|
+
url: 'suggest/party',
|
|
1285
|
+
responseItemHandler: (item) => item?.data?.inn || '',
|
|
1286
|
+
};
|
|
1287
|
+
const ADDRESS_HINTS_LIST_OPTIONS = {
|
|
1288
|
+
url: 'suggest/address',
|
|
1289
|
+
};
|
|
1246
1290
|
const hintsListsOptions = {
|
|
1247
1291
|
name: NAME_HINTS_LIST_OPTIONS,
|
|
1248
1292
|
surname: SURNAME_HINTS_LIST_OPTIONS,
|
|
1249
1293
|
middleName: PATRONYMIC_HINTS_LIST_OPTIONS,
|
|
1250
1294
|
email: EMAIL_HINTS_LIST_OPTIONS,
|
|
1295
|
+
dulSubdivisionCode: PASSPORT_CODE_HINTS_LIST_OPTIONS,
|
|
1296
|
+
dulIssuedBy: PASSPORT_FMS_HINTS_LIST_OPTIONS,
|
|
1297
|
+
organizationName: ORGANIZATION_NAME_HINTS_LIST_OPTIONS,
|
|
1298
|
+
inn: ORGANIZATION_INN_HINTS_LIST_OPTIONS,
|
|
1299
|
+
participantAddress: ADDRESS_HINTS_LIST_OPTIONS,
|
|
1251
1300
|
};
|
|
1252
1301
|
|
|
1253
1302
|
const debounce = (fn, delay = 600) => {
|
|
@@ -1267,14 +1316,14 @@
|
|
|
1267
1316
|
};
|
|
1268
1317
|
|
|
1269
1318
|
const usePopupManager = () => ({
|
|
1270
|
-
open: (popup, options) => defaultEventBus.fire('popup', { type: 'open', popup, ...options }),
|
|
1271
|
-
update: (popup, options) => defaultEventBus.fire('popup', { type: 'update', popup, ...options }),
|
|
1272
|
-
close: () => defaultEventBus.fire('popup', { type: 'close' }),
|
|
1319
|
+
open: (popup, options) => defaultEventBus.emitter.fire('popup', { type: 'open', popup, ...options }),
|
|
1320
|
+
update: (popup, options) => defaultEventBus.emitter.fire('popup', { type: 'update', popup, ...options }),
|
|
1321
|
+
close: () => defaultEventBus.emitter.fire('popup', { type: 'close' }),
|
|
1273
1322
|
});
|
|
1274
1323
|
|
|
1275
|
-
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
|
|
1324
|
+
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()))) })));
|
|
1276
1325
|
|
|
1277
|
-
function useInputPopup({ isOpen, value, name, onChange }) {
|
|
1326
|
+
function useInputPopup({ isOpen, value, name, onChange, onDaDataChange, daDataQueryPrefix, }) {
|
|
1278
1327
|
const prevInputValue = useRef(value);
|
|
1279
1328
|
const currentInputValue = useRef(value);
|
|
1280
1329
|
const [hintsList, setHintsList] = useState([]);
|
|
@@ -1286,8 +1335,9 @@
|
|
|
1286
1335
|
}, [value]);
|
|
1287
1336
|
const handleChange = useCallback((option) => {
|
|
1288
1337
|
close();
|
|
1289
|
-
currentInputValue.current = option;
|
|
1290
|
-
onChange && onChange(option);
|
|
1338
|
+
currentInputValue.current = option.processedValue;
|
|
1339
|
+
onChange && onChange(option.processedValue);
|
|
1340
|
+
onDaDataChange && onDaDataChange(option);
|
|
1291
1341
|
}, [close, onChange]);
|
|
1292
1342
|
const inputRef = useRef(null);
|
|
1293
1343
|
const getHintsList = useMemo(() => async (searchValue) => {
|
|
@@ -1296,15 +1346,17 @@
|
|
|
1296
1346
|
}
|
|
1297
1347
|
const result = await getDaDataHints({
|
|
1298
1348
|
url: defaultHintsListOptions.url,
|
|
1349
|
+
responseItemHandler: defaultHintsListOptions.responseItemHandler,
|
|
1299
1350
|
requestData: {
|
|
1300
1351
|
...defaultHintsListOptions?.requestData,
|
|
1301
1352
|
},
|
|
1302
1353
|
query: searchValue,
|
|
1354
|
+
queryPrefix: daDataQueryPrefix,
|
|
1303
1355
|
});
|
|
1304
1356
|
if (result?.length) {
|
|
1305
1357
|
setHintsList(result);
|
|
1306
1358
|
}
|
|
1307
|
-
}, []);
|
|
1359
|
+
}, [daDataQueryPrefix]);
|
|
1308
1360
|
const debouncedGetHintsList = useMemo(() => debounce(getHintsList, 300), [getHintsList]);
|
|
1309
1361
|
useEffect(() => {
|
|
1310
1362
|
if (!isOpen || !inputRef.current || currentInputValue.current === value) {
|
|
@@ -1326,14 +1378,16 @@
|
|
|
1326
1378
|
return inputRef;
|
|
1327
1379
|
}
|
|
1328
1380
|
|
|
1329
|
-
const InputControl = JSX(({ className, label, value = '', placeholder, error, errors, onChange = noop, onBlur, isTextarea, type, name = '', dadata = false, }) => {
|
|
1381
|
+
const InputControl = JSX(({ className, label, value = '', placeholder, error, errors, onChange = noop, onDaDataChange, onBlur, isTextarea, type, name = '', daDataQueryPrefix, dadata = false, }) => {
|
|
1330
1382
|
const [isOpen, { setFalse: close, setTrue: open }] = useBool();
|
|
1331
1383
|
const popupRef = useOutsideClick(close);
|
|
1332
1384
|
const inputRef = useInputPopup({
|
|
1333
1385
|
isOpen: isOpen && dadata,
|
|
1334
1386
|
name,
|
|
1335
1387
|
value,
|
|
1388
|
+
daDataQueryPrefix,
|
|
1336
1389
|
onChange,
|
|
1390
|
+
onDaDataChange,
|
|
1337
1391
|
});
|
|
1338
1392
|
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)] }));
|
|
1339
1393
|
});
|
|
@@ -1533,6 +1587,7 @@
|
|
|
1533
1587
|
};
|
|
1534
1588
|
};
|
|
1535
1589
|
|
|
1590
|
+
// TODO Зачем это?
|
|
1536
1591
|
const getValidation = (field, validator, required = false) => required ? withValidator(field, validator) : field;
|
|
1537
1592
|
|
|
1538
1593
|
const ACQUIRING_TYPES = [
|
|
@@ -1949,13 +2004,24 @@
|
|
|
1949
2004
|
|
|
1950
2005
|
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) })));
|
|
1951
2006
|
|
|
1952
|
-
const
|
|
2007
|
+
const DulIssuedByField = JSX(({ field, input }) => {
|
|
2008
|
+
const { value: dulSubdivisionCode, onChange: changeDulSubdivisionCode } = field('dulSubdivisionCode');
|
|
2009
|
+
const onDaDataChange = useCallback((item) => {
|
|
2010
|
+
changeDulSubdivisionCode?.(item?.data?.code?.replace('-', ''));
|
|
2011
|
+
}, []);
|
|
2012
|
+
return (jsx(InputControl, { label: "\u041A\u0435\u043C \u0432\u044B\u0434\u0430\u043D", ...input, ...getValidation(field('dulIssuedBy'), validatorObj.dulIssuedBy, input?.required), onDaDataChange: onDaDataChange, daDataQueryPrefix: dulSubdivisionCode }));
|
|
2013
|
+
});
|
|
1953
2014
|
|
|
1954
2015
|
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) })));
|
|
1955
2016
|
|
|
1956
2017
|
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) })));
|
|
1957
2018
|
|
|
1958
|
-
const
|
|
2019
|
+
const DulSubdivisionCodeField = JSX(({ field, input }) => {
|
|
2020
|
+
const onDaDataChange = useCallback((item) => {
|
|
2021
|
+
field?.('dulIssuedBy')?.onChange?.(item?.data?.name);
|
|
2022
|
+
}, []);
|
|
2023
|
+
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 }));
|
|
2024
|
+
});
|
|
1959
2025
|
|
|
1960
2026
|
const EducationField = JSX(({ field, input }) => {
|
|
1961
2027
|
const { data: education } = useLeadFormData('EDUCATION_LEVEL');
|
|
@@ -2006,7 +2072,13 @@
|
|
|
2006
2072
|
return (jsx(SelectField, { field: field, source: housing, label: "\u0422\u0438\u043F \u0436\u0438\u043B\u044C\u044F", fieldName: "housing", input: input }));
|
|
2007
2073
|
});
|
|
2008
2074
|
|
|
2009
|
-
const InnField = JSX(({ field, input }) =>
|
|
2075
|
+
const InnField = JSX(({ field, input }) => {
|
|
2076
|
+
const onDaDataChange = useCallback((item) => {
|
|
2077
|
+
field?.('organizationName')?.onChange?.(item.data?.name?.short_with_opf);
|
|
2078
|
+
field?.('legalForm')?.onChange?.(item.data?.opf?.short);
|
|
2079
|
+
}, []);
|
|
2080
|
+
return (jsx(InputControl, { label: "\u0418\u041D\u041D", type: "number", ...input, ...getValidation(field('inn'), validatorObj.inn, input?.required), onDaDataChange: onDaDataChange }));
|
|
2081
|
+
});
|
|
2010
2082
|
|
|
2011
2083
|
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"' })));
|
|
2012
2084
|
|
|
@@ -2017,9 +2089,11 @@
|
|
|
2017
2089
|
const LegalFormField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u041E\u041F\u0424", placeholder: "\u041E\u041E\u041E, \u041F\u0410\u041E \u0438 \u0434\u0440.", ...getValidation(field('legalForm'), validatorObj.legalForm, input?.required), ...input })));
|
|
2018
2090
|
|
|
2019
2091
|
const REGIONS_URL = '/api/v1/regions';
|
|
2092
|
+
const EMPTY_REGIONS = [];
|
|
2093
|
+
// TODO Почему url можно менять? Разве смысл не в инкапсуляции api url. Тоже под рефакторинг попадает
|
|
2020
2094
|
function useRegions(url = REGIONS_URL) {
|
|
2021
2095
|
const { data } = useAsyncData(url, fetchJSONUnsafe);
|
|
2022
|
-
return Array.isArray(data) ? data :
|
|
2096
|
+
return Array.isArray(data) ? data : EMPTY_REGIONS;
|
|
2023
2097
|
}
|
|
2024
2098
|
|
|
2025
2099
|
const LocalitiesField = JSX(({ field, input }) => {
|
|
@@ -2049,7 +2123,13 @@
|
|
|
2049
2123
|
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 }));
|
|
2050
2124
|
});
|
|
2051
2125
|
|
|
2052
|
-
const OrganizationNameField = JSX(({ field, input }) =>
|
|
2126
|
+
const OrganizationNameField = JSX(({ field, input }) => {
|
|
2127
|
+
const onDaDataChange = useCallback((item) => {
|
|
2128
|
+
field?.('inn')?.onChange?.(item.data?.inn);
|
|
2129
|
+
field?.('legalForm')?.onChange?.(item.data?.opf?.short);
|
|
2130
|
+
}, []);
|
|
2131
|
+
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 }));
|
|
2132
|
+
});
|
|
2053
2133
|
|
|
2054
2134
|
const ParticipantAddressField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u0410\u0434\u0440\u0435\u0441", ...getValidation(field('participantAddress'), validatorObj.participantAddress, input?.required), ...input })));
|
|
2055
2135
|
|
|
@@ -2284,8 +2364,8 @@
|
|
|
2284
2364
|
dulSerie: jsx(DulSerieField, { field: field, input: input }),
|
|
2285
2365
|
dulNumber: jsx(DulNumberField, { field: field, input: input }),
|
|
2286
2366
|
dulIssueDateField: jsx(DulIssueDateField, { field: field, input: input }),
|
|
2287
|
-
dulSubdivisionCode: jsx(
|
|
2288
|
-
dulIssuedBy: jsx(
|
|
2367
|
+
dulSubdivisionCode: jsx(DulSubdivisionCodeField, { field: field, input: input }),
|
|
2368
|
+
dulIssuedBy: jsx(DulIssuedByField, { field: field, input: input }),
|
|
2289
2369
|
participantAddress: jsx(ParticipantAddressField, { field: field, input: input }),
|
|
2290
2370
|
participantDateRegistration: jsx(ParticipantDateRegistrationField, { field: field, input: input }),
|
|
2291
2371
|
};
|
|
@@ -2543,6 +2623,14 @@
|
|
|
2543
2623
|
return { ...formState, typeForm: { key: typeForm, text: '' } };
|
|
2544
2624
|
};
|
|
2545
2625
|
|
|
2626
|
+
const FoldableWrapper = JSX(({ className, children }) => (jsx("div", { className: className, role: "group", children: children })));
|
|
2627
|
+
/**
|
|
2628
|
+
* Какой то бесполезный компонент. Его можно заменить на useBool
|
|
2629
|
+
* Лучше оставить только обёрточный div с необходимой атрибутикой
|
|
2630
|
+
* и сделать пассивный компонент
|
|
2631
|
+
*
|
|
2632
|
+
* @deprecated
|
|
2633
|
+
*/
|
|
2546
2634
|
const Foldable = JSX(({ className = '', isFoldButtonOnTop = false, unfoldedByDefault = false, renderFoldableSection, renderFoldButton, }) => {
|
|
2547
2635
|
const [isUnfolded, setIsUnfolded] = useState(unfoldedByDefault);
|
|
2548
2636
|
const onToggle = useCallback(() => {
|
|
@@ -2550,7 +2638,7 @@
|
|
|
2550
2638
|
}, []);
|
|
2551
2639
|
const sectionNode = renderFoldableSection({ isUnfolded, onToggle });
|
|
2552
2640
|
const buttonNode = renderFoldButton ? renderFoldButton({ isUnfolded, onToggle }) : null;
|
|
2553
|
-
return isFoldButtonOnTop ? (jsxs(
|
|
2641
|
+
return isFoldButtonOnTop ? (jsxs(FoldableWrapper, { className: className, children: [buttonNode, sectionNode] })) : (jsxs(FoldableWrapper, { className: className, children: [sectionNode, buttonNode] }));
|
|
2554
2642
|
});
|
|
2555
2643
|
|
|
2556
2644
|
function useResizeObserver(callback, deps) {
|
|
@@ -4640,31 +4728,37 @@
|
|
|
4640
4728
|
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)] }) }) })));
|
|
4641
4729
|
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;
|
|
4642
4730
|
|
|
4731
|
+
const useSubjectState = (eventBus, type, initialState) => {
|
|
4732
|
+
const [state, setState] = useState(initialState);
|
|
4733
|
+
useEffect(() => eventBus.subscribe(type, setState), [eventBus, type]);
|
|
4734
|
+
return state;
|
|
4735
|
+
};
|
|
4736
|
+
|
|
4643
4737
|
const renderCardInfo = (cell, i) => {
|
|
4644
4738
|
const { title, description, buttons } = cell;
|
|
4645
4739
|
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)));
|
|
4646
4740
|
};
|
|
4647
4741
|
|
|
4648
|
-
const
|
|
4649
|
-
const
|
|
4650
|
-
const [visibleCells, hiddenCells] = visibleCellsCount > 0
|
|
4651
|
-
? [
|
|
4652
|
-
: [
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4742
|
+
const CardCellsSection = JSX((props) => {
|
|
4743
|
+
const { cardCells = [], visibleCellsCount = 1, isUnfolded } = props;
|
|
4744
|
+
const [visibleCells, hiddenCells] = visibleCellsCount > 0 && cardCells.length >= visibleCellsCount
|
|
4745
|
+
? [cardCells.slice(0, visibleCellsCount), cardCells.slice(visibleCellsCount)]
|
|
4746
|
+
: [cardCells, []];
|
|
4747
|
+
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) }));
|
|
4748
|
+
});
|
|
4749
|
+
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" })] })));
|
|
4750
|
+
|
|
4751
|
+
const carouselTariffsCardEventBus = new EventBus();
|
|
4752
|
+
|
|
4753
|
+
const CarouselTariffsCard = JSX(({ className, title, align = 'text-center', icon, button, visibleCellsCount = 1, cardCells = [], options, data, ...rest }) => {
|
|
4754
|
+
const { isUnfolded, parent: firedParent } = useSubjectState(carouselTariffsCardEventBus.observable, 'fold', {});
|
|
4755
|
+
const isVisible = isUnfolded && firedParent === options?.parent;
|
|
4756
|
+
const toggle = useCallback(() => carouselTariffsCardEventBus.emitter.fire('fold', {
|
|
4757
|
+
isUnfolded: !isVisible,
|
|
4758
|
+
parent: options?.parent,
|
|
4759
|
+
}), [isVisible, options?.parent]);
|
|
4760
|
+
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 })] }));
|
|
4761
|
+
});
|
|
4668
4762
|
|
|
4669
4763
|
const ContactsBlock = JSX(({ className, contacts, info, version = 'secondary', ...rest }) => (jsxs(BlockWrapper, { className: style('flex', className), defaultPadding: "p-6xl", version: version, ...rest, children: [info?.length ? renderBlocks(info) : null, contacts?.length ? renderBlocks(contacts) : null] })));
|
|
4670
4764
|
const renderBlocks = (info) => (jsx("div", { className: "flex gap-5xl grow basis-0", children: info.map((column, i) => renderBlocksColumn({ column, i })) }));
|
|
@@ -4836,47 +4930,46 @@
|
|
|
4836
4930
|
};
|
|
4837
4931
|
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] })));
|
|
4838
4932
|
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4933
|
+
function useSubject(eventBus, type, initialState) {
|
|
4934
|
+
useEffect(() => {
|
|
4935
|
+
const state = initialState instanceof Function ? initialState() : initialState;
|
|
4936
|
+
if (state instanceof Promise) {
|
|
4937
|
+
state.then((_) => eventBus.subject(type, _), console.warn);
|
|
4938
|
+
}
|
|
4939
|
+
else {
|
|
4940
|
+
eventBus.subject(type, state);
|
|
4941
|
+
}
|
|
4942
|
+
}, [eventBus, type]);
|
|
4943
|
+
return useCallback((_) => eventBus.fire(type, _), [eventBus, type]);
|
|
4944
|
+
}
|
|
4845
4945
|
|
|
4846
4946
|
const REGION_URL = '/api/v1/region';
|
|
4847
4947
|
const LOCATION_STORAGE_KEY = 'location';
|
|
4848
4948
|
function useLocation(defaultLocation = 'Москва') {
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4949
|
+
useEffect(() => defaultEventBus.subscribe('location', storeLocation), []);
|
|
4950
|
+
return useSubject(defaultEventBus.emitter, 'location', restoreLocation(defaultLocation));
|
|
4951
|
+
}
|
|
4952
|
+
function useLocationState(defaultLocation = 'Москва') {
|
|
4953
|
+
return useSubjectState(defaultEventBus.observable, 'location', { name: defaultLocation });
|
|
4954
|
+
}
|
|
4955
|
+
function restoreLocation(defaultLocation) {
|
|
4956
|
+
return async () => {
|
|
4957
|
+
if (!globalThis.localStorage?.hasItem(LOCATION_STORAGE_KEY)) {
|
|
4958
|
+
storeLocation(await fetchJSON(REGION_URL));
|
|
4959
|
+
}
|
|
4960
|
+
const storedLocation = globalThis.localStorage?.getItem(LOCATION_STORAGE_KEY);
|
|
4961
|
+
try {
|
|
4962
|
+
return storedLocation && JSON.parse(storedLocation);
|
|
4963
|
+
}
|
|
4964
|
+
catch (ex) {
|
|
4965
|
+
// Do nothing
|
|
4858
4966
|
}
|
|
4859
|
-
|
|
4860
|
-
|
|
4967
|
+
return { name: defaultLocation };
|
|
4968
|
+
};
|
|
4969
|
+
}
|
|
4970
|
+
function storeLocation(_) {
|
|
4971
|
+
_ && globalThis.localStorage?.setItem(LOCATION_STORAGE_KEY, JSON.stringify(_));
|
|
4861
4972
|
}
|
|
4862
|
-
const hasStoredLocation = () => Boolean(globalThis.localStorage?.getItem(LOCATION_STORAGE_KEY));
|
|
4863
|
-
const restoreLocation = () => {
|
|
4864
|
-
try {
|
|
4865
|
-
const data = globalThis.localStorage?.getItem(LOCATION_STORAGE_KEY);
|
|
4866
|
-
return data && JSON.parse(data);
|
|
4867
|
-
}
|
|
4868
|
-
catch (ex) {
|
|
4869
|
-
return null;
|
|
4870
|
-
}
|
|
4871
|
-
};
|
|
4872
|
-
const storeLocation = (_) => {
|
|
4873
|
-
try {
|
|
4874
|
-
globalThis.localStorage?.setItem(LOCATION_STORAGE_KEY, JSON.stringify(_));
|
|
4875
|
-
}
|
|
4876
|
-
catch (ex) {
|
|
4877
|
-
// Do nothing
|
|
4878
|
-
}
|
|
4879
|
-
};
|
|
4880
4973
|
|
|
4881
4974
|
var Currency;
|
|
4882
4975
|
(function (Currency) {
|
|
@@ -5018,7 +5111,7 @@
|
|
|
5018
5111
|
}
|
|
5019
5112
|
|
|
5020
5113
|
const ExchangeRateTile = JSX(({ className = '', title = 'Курсы обмена валют', button, ...rest }) => {
|
|
5021
|
-
const
|
|
5114
|
+
const currentLocation = useLocationState();
|
|
5022
5115
|
const exchangeRates = useFetchExchangeRateData(currentLocation);
|
|
5023
5116
|
const currencyRates = getCurrencyRates(exchangeRates?.exchangeRate?.currencies);
|
|
5024
5117
|
const currencyRatesBuy = currencyRates.filter((_) => _.buyExchangeRate);
|
|
@@ -5557,27 +5650,33 @@
|
|
|
5557
5650
|
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" })] }));
|
|
5558
5651
|
});
|
|
5559
5652
|
|
|
5560
|
-
const
|
|
5561
|
-
|
|
5562
|
-
const [currentLocation, selectCurrentLocation] = useLocation(branches?.default);
|
|
5653
|
+
const SelectedLocation = JSX(({ defaultLocation }) => {
|
|
5654
|
+
const currentLocation = useLocationState(defaultLocation);
|
|
5563
5655
|
const link = useLink();
|
|
5564
5656
|
const { href } = link({ href: `/branches/${currentLocation.slug}` });
|
|
5657
|
+
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;
|
|
5658
|
+
});
|
|
5659
|
+
|
|
5660
|
+
const SEARCH_TERM_MIN_LENGTH = 3;
|
|
5661
|
+
const LocationDialog = JSX(({ foreignOffices, branches }) => {
|
|
5662
|
+
const selectLocation = useLocation(branches?.default);
|
|
5565
5663
|
const [query, setQuery] = useState('');
|
|
5566
|
-
const
|
|
5567
|
-
const
|
|
5664
|
+
const rawRegions = useRegions();
|
|
5665
|
+
const regions = useMemo(() => cleanUpRegions(rawRegions).sort((a, b) => (a.name ?? '').localeCompare(b.name ?? '')), [rawRegions]);
|
|
5666
|
+
const regionsGroupByLetter = useMemo(() => groupBy(regions, regionFirstLetter), [regions]);
|
|
5568
5667
|
const { close } = useDialogManager();
|
|
5569
5668
|
const handleChangeLocation = useCallback((region) => {
|
|
5570
|
-
|
|
5669
|
+
selectLocation(region);
|
|
5571
5670
|
close();
|
|
5572
5671
|
}, []);
|
|
5573
|
-
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" }),
|
|
5672
|
+
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
|
|
5574
5673
|
.filter(({ name }) => name && jaroWinklerDistance(name.toLowerCase())(query.toLowerCase()) >= 0.8)
|
|
5575
5674
|
.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)] }));
|
|
5576
5675
|
});
|
|
5577
|
-
const regionFirstLetter = (region) => region.name?.charAt(0)
|
|
5676
|
+
const regionFirstLetter = (region) => region.name?.charAt(0) ?? '';
|
|
5578
5677
|
const cleanUpRegions = (regions) => regions.map((region) => ({
|
|
5579
5678
|
...region,
|
|
5580
|
-
name: region.name?.replace(/республика|область|край'/gi, '').trim()
|
|
5679
|
+
name: region.name?.replace(/республика|область|край'/gi, '').trim() ?? '',
|
|
5581
5680
|
}));
|
|
5582
5681
|
|
|
5583
5682
|
const useLocationDialog = (props) => {
|
|
@@ -5605,7 +5704,7 @@
|
|
|
5605
5704
|
|
|
5606
5705
|
const HeaderSecondaryMenu = JSX(({ className, version, ...rest }) => {
|
|
5607
5706
|
const iconVersion = version === 'transparent' ? 'white' : 'black';
|
|
5608
|
-
const
|
|
5707
|
+
const currentLocation = useLocationState(rest?.branches?.default);
|
|
5609
5708
|
const searchDialog = useSearchDialog(rest);
|
|
5610
5709
|
const locationDialog = useLocationDialog(rest);
|
|
5611
5710
|
const openSearchDialog = useCallback(() => searchDialog.open(), [searchDialog]);
|
|
@@ -6444,7 +6543,7 @@
|
|
|
6444
6543
|
designDisabledPeople: (item) => Boolean(item.designDisabledPeople),
|
|
6445
6544
|
};
|
|
6446
6545
|
const AtmsMap = JSX(({ descriptionData, className }) => {
|
|
6447
|
-
const
|
|
6546
|
+
const currentLocation = useLocationState();
|
|
6448
6547
|
const regionCode = currentLocation?.code ?? '000';
|
|
6449
6548
|
const { data: officesData, isLoad } = useAtms(regionCode);
|
|
6450
6549
|
return (jsx(OfficesAtmsMapLayout, { className: className, filterItems: filterItems, data: officesData, isLoad: isLoad, initFilterState: INITIAL_FILTRATION_STATE, renderCard: renderAtmCard, getBalloon: getAtmPoint, title: `Банкоматы филиала ${currentLocation?.name}`, descriptionData: descriptionData }));
|
|
@@ -6663,7 +6762,7 @@
|
|
|
6663
6762
|
};
|
|
6664
6763
|
|
|
6665
6764
|
const OfficesMap = JSX(({ className }) => {
|
|
6666
|
-
const
|
|
6765
|
+
const currentLocation = useLocationState();
|
|
6667
6766
|
const regionCode = currentLocation?.code ?? '000';
|
|
6668
6767
|
const { data, isLoad } = useOffices(regionCode);
|
|
6669
6768
|
return (jsx(OfficesAtmsMapLayout, { className: className, data: data?.branches, isLoad: isLoad, remoteWorkplaces: data?.remoteWorkplaces, renderCard: renderOfficeCard, renderRemoteWorkplaceCard: renderRemoteWorkplaceCard, getBalloon: getOfficePoint, getBalloonRemoteWorkplaces: getRemoteWorkplacePoint, title: `Офисы филиала ${currentLocation?.name}` }));
|
|
@@ -7347,7 +7446,7 @@
|
|
|
7347
7446
|
onClose && onClose(dialogs[dialogs.length - 1]);
|
|
7348
7447
|
pop();
|
|
7349
7448
|
}, [dialogs, onClose]);
|
|
7350
|
-
useEffect(() => defaultEventBus.subscribe('dialog', (action) => {
|
|
7449
|
+
useEffect(() => defaultEventBus.observable.subscribe('dialog', (action) => {
|
|
7351
7450
|
switch (action.type) {
|
|
7352
7451
|
case 'open':
|
|
7353
7452
|
push(action);
|
|
@@ -7404,7 +7503,7 @@
|
|
|
7404
7503
|
const close = useCallback(() => {
|
|
7405
7504
|
setPopup(null);
|
|
7406
7505
|
}, []);
|
|
7407
|
-
useEffect(() => defaultEventBus.subscribe('popup', (action) => {
|
|
7506
|
+
useEffect(() => defaultEventBus.observable.subscribe('popup', (action) => {
|
|
7408
7507
|
switch (action.type) {
|
|
7409
7508
|
case 'open':
|
|
7410
7509
|
case 'update':
|
|
@@ -7459,7 +7558,7 @@
|
|
|
7459
7558
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
7460
7559
|
});
|
|
7461
7560
|
|
|
7462
|
-
const packageVersion = "0.14.
|
|
7561
|
+
const packageVersion = "0.14.596";
|
|
7463
7562
|
|
|
7464
7563
|
exports.Blocks = Blocks;
|
|
7465
7564
|
exports.ContentPage = ContentPage;
|