@redneckz/wildless-cms-uni-blocks 0.6.34 → 0.6.36
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/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +214 -71
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Calculator/constants.d.ts +3 -0
- package/bundle/components/Calculator/useDepositCalculatorParams.d.ts +22 -0
- package/bundle/components/CarouselProgramsCard/CarouselProgramsCard.d.ts +5 -0
- package/bundle/components/CarouselProgramsCard/CarouselProgramsCardContent.d.ts +12 -0
- package/bundle/components/Header/HeaderSecondaryMenu.d.ts +1 -0
- package/bundle/components/Header/HeaderSubMenuItem.d.ts +2 -1
- package/bundle/hooks/useIntersectionObserver.d.ts +7 -1
- package/bundle/services/sitemap/SitemapProps.d.ts +1 -2
- package/bundle/ui-kit/Button/ArrowButton.d.ts +2 -0
- package/bundle/ui-kit/SwipeListControl/SwipeListContainer.d.ts +19 -0
- package/bundle/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +7 -4
- package/bundle/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +3 -3
- package/bundle/ui-kit/SwipeListControl/SwipeListItem.d.ts +14 -0
- package/bundle/ui-kit/SwipeListControl/scrollBy.d.ts +1 -0
- package/bundle/ui-kit/SwipeListControl/scrollToEnd.d.ts +1 -0
- package/bundle/ui-kit/SwipeListControl/scrollToStart.d.ts +1 -0
- package/bundle/ui-kit/SwipeListControl/useSwipeListScroll.d.ts +17 -0
- package/bundle/utils/areArraysEqual.d.ts +1 -0
- package/bundle/utils/mapChildren.d.ts +2 -0
- package/bundle/utils/maxBy.d.ts +2 -2
- package/bundle/utils/minBy.d.ts +1 -0
- package/dist/components/Blocks.js +3 -1
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/Calculator/DepositCalculatorForm.js +13 -11
- package/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/constants.d.ts +3 -0
- package/dist/components/Calculator/constants.js +10 -1
- package/dist/components/Calculator/constants.js.map +1 -1
- package/dist/components/Calculator/useDepositCalculatorParams.d.ts +22 -0
- package/dist/components/Calculator/useDepositCalculatorParams.js +28 -0
- package/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -0
- package/dist/components/Carousel/Carousel.js +14 -15
- package/dist/components/Carousel/Carousel.js.map +1 -1
- package/dist/components/CarouselProgramsCard/CarouselProgramsCard.d.ts +5 -0
- package/dist/components/CarouselProgramsCard/CarouselProgramsCard.js +12 -0
- package/dist/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -0
- package/dist/components/CarouselProgramsCard/CarouselProgramsCardContent.d.ts +12 -0
- package/dist/components/CarouselProgramsCard/CarouselProgramsCardContent.js +2 -0
- package/dist/components/CarouselProgramsCard/CarouselProgramsCardContent.js.map +1 -0
- package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +7 -13
- package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/dist/components/ComparisonTable/ComparisonTable.mobile.js +1 -1
- package/dist/components/ComparisonTable/ComparisonTable.mobile.js.map +1 -1
- package/dist/components/Gallery/Gallery.mobile.js +1 -1
- package/dist/components/Header/Header.js +2 -2
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/Header/HeaderSecondaryMenu.d.ts +1 -0
- package/dist/components/Header/HeaderSecondaryMenu.js +2 -2
- package/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/dist/components/Header/HeaderSubMenu.js +1 -1
- package/dist/components/Header/HeaderSubMenu.js.map +1 -1
- package/dist/components/Header/HeaderSubMenuItem.d.ts +2 -1
- package/dist/components/Header/HeaderSubMenuItem.js.map +1 -1
- package/dist/components/OtherProductsItem/OtherProductsItem.js +1 -1
- package/dist/components/OtherProductsItem/OtherProductsItem.js.map +1 -1
- package/dist/components/RollupItem/RollupItem.js +10 -1
- package/dist/components/RollupItem/RollupItem.js.map +1 -1
- package/dist/components/VerticalLayout/VerticalLayout.js +5 -3
- package/dist/components/VerticalLayout/VerticalLayout.js.map +1 -1
- package/dist/hooks/useIntersectionObserver.d.ts +7 -1
- package/dist/hooks/useIntersectionObserver.js +10 -1
- package/dist/hooks/useIntersectionObserver.js.map +1 -1
- package/dist/hooks/useLink.js +1 -1
- package/dist/hooks/useLink.js.map +1 -1
- package/dist/services/sitemap/SitemapProps.d.ts +1 -2
- package/dist/ui-kit/BlockWrapper.js +1 -11
- package/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/dist/ui-kit/Button/ArrowButton.d.ts +2 -0
- package/dist/ui-kit/Button/ArrowButton.js +3 -1
- package/dist/ui-kit/Button/ArrowButton.js.map +1 -1
- package/dist/ui-kit/Foldable/FoldableSection.js +1 -1
- package/dist/ui-kit/Foldable/FoldableSection.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.d.ts +19 -0
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.js +35 -0
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -0
- package/dist/ui-kit/SwipeListControl/SwipeListControl.js +17 -38
- package/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +7 -4
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +10 -27
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +3 -3
- package/dist/ui-kit/SwipeListControl/SwipeListItem.d.ts +14 -0
- package/dist/ui-kit/SwipeListControl/SwipeListItem.js +16 -0
- package/dist/ui-kit/SwipeListControl/SwipeListItem.js.map +1 -0
- package/dist/ui-kit/SwipeListControl/scrollBy.d.ts +1 -0
- package/dist/ui-kit/SwipeListControl/scrollBy.js +8 -0
- package/dist/ui-kit/SwipeListControl/scrollBy.js.map +1 -0
- package/dist/ui-kit/SwipeListControl/scrollToEnd.d.ts +1 -0
- package/dist/ui-kit/SwipeListControl/scrollToEnd.js +7 -0
- package/dist/ui-kit/SwipeListControl/scrollToEnd.js.map +1 -0
- package/dist/ui-kit/SwipeListControl/scrollToStart.d.ts +1 -0
- package/dist/ui-kit/SwipeListControl/scrollToStart.js +7 -0
- package/dist/ui-kit/SwipeListControl/scrollToStart.js.map +1 -0
- package/dist/ui-kit/SwipeListControl/useSwipeListScroll.d.ts +17 -0
- package/dist/ui-kit/SwipeListControl/useSwipeListScroll.js +57 -0
- package/dist/ui-kit/SwipeListControl/useSwipeListScroll.js.map +1 -0
- package/dist/utils/areArraysEqual.d.ts +1 -0
- package/dist/utils/areArraysEqual.js +5 -0
- package/dist/utils/areArraysEqual.js.map +1 -0
- package/dist/utils/mapChildren.d.ts +2 -0
- package/dist/utils/mapChildren.js +10 -0
- package/dist/utils/mapChildren.js.map +1 -0
- package/dist/utils/maxBy.d.ts +2 -2
- package/dist/utils/maxBy.js +4 -4
- package/dist/utils/maxBy.js.map +1 -1
- package/dist/utils/minBy.d.ts +1 -0
- package/dist/utils/minBy.js +6 -0
- package/dist/utils/minBy.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/Blocks.js +3 -1
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/Calculator/DepositCalculatorForm.js +14 -12
- package/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/constants.d.ts +3 -0
- package/lib/components/Calculator/constants.js +9 -0
- package/lib/components/Calculator/constants.js.map +1 -1
- package/lib/components/Calculator/useDepositCalculatorParams.d.ts +22 -0
- package/lib/components/Calculator/useDepositCalculatorParams.js +25 -0
- package/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -0
- package/lib/components/Carousel/Carousel.fixture.d.ts +1 -0
- package/lib/components/Carousel/Carousel.js +14 -15
- package/lib/components/Carousel/Carousel.js.map +1 -1
- package/lib/components/CarouselProgramsCard/CarouselProgramsCard.d.ts +5 -0
- package/lib/components/CarouselProgramsCard/CarouselProgramsCard.fixture.d.ts +8 -0
- package/lib/components/CarouselProgramsCard/CarouselProgramsCard.js +10 -0
- package/lib/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -0
- package/lib/components/CarouselProgramsCard/CarouselProgramsCardContent.d.ts +12 -0
- package/lib/components/CarouselProgramsCard/CarouselProgramsCardContent.js +2 -0
- package/lib/components/CarouselProgramsCard/CarouselProgramsCardContent.js.map +1 -0
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.fixture.d.ts +1 -1
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +7 -13
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/lib/components/ComparisonTable/ComparisonTable.mobile.js +1 -1
- package/lib/components/ComparisonTable/ComparisonTable.mobile.js.map +1 -1
- package/lib/components/Gallery/Gallery.mobile.js +1 -1
- package/lib/components/Header/Header.js +2 -2
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/Header/HeaderSecondaryMenu.d.ts +1 -0
- package/lib/components/Header/HeaderSecondaryMenu.js +2 -2
- package/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/lib/components/Header/HeaderSubMenu.js +1 -1
- package/lib/components/Header/HeaderSubMenu.js.map +1 -1
- package/lib/components/Header/HeaderSubMenuItem.d.ts +2 -1
- package/lib/components/Header/HeaderSubMenuItem.js +1 -1
- package/lib/components/Header/HeaderSubMenuItem.js.map +1 -1
- package/lib/components/OtherProductsItem/OtherProductsItem.js +1 -1
- package/lib/components/OtherProductsItem/OtherProductsItem.js.map +1 -1
- package/lib/components/RollupItem/RollupItem.js +10 -1
- package/lib/components/RollupItem/RollupItem.js.map +1 -1
- package/lib/components/VerticalLayout/VerticalLayout.js +5 -3
- package/lib/components/VerticalLayout/VerticalLayout.js.map +1 -1
- package/lib/hooks/useIntersectionObserver.d.ts +7 -1
- package/lib/hooks/useIntersectionObserver.js +11 -2
- package/lib/hooks/useIntersectionObserver.js.map +1 -1
- package/lib/hooks/useLink.js +2 -2
- package/lib/hooks/useLink.js.map +1 -1
- package/lib/services/sitemap/SitemapProps.d.ts +1 -2
- package/lib/ui-kit/BlockWrapper.js +1 -11
- package/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/lib/ui-kit/Button/ArrowButton.d.ts +2 -0
- package/lib/ui-kit/Button/ArrowButton.js +2 -0
- package/lib/ui-kit/Button/ArrowButton.js.map +1 -1
- package/lib/ui-kit/Foldable/FoldableSection.js +1 -1
- package/lib/ui-kit/Foldable/FoldableSection.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.d.ts +19 -0
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.js +33 -0
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -0
- package/lib/ui-kit/SwipeListControl/SwipeListControl.js +17 -38
- package/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +7 -4
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +10 -27
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +3 -3
- package/lib/ui-kit/SwipeListControl/SwipeListItem.d.ts +14 -0
- package/lib/ui-kit/SwipeListControl/SwipeListItem.js +14 -0
- package/lib/ui-kit/SwipeListControl/SwipeListItem.js.map +1 -0
- package/lib/ui-kit/SwipeListControl/scrollBy.d.ts +1 -0
- package/lib/ui-kit/SwipeListControl/scrollBy.js +5 -0
- package/lib/ui-kit/SwipeListControl/scrollBy.js.map +1 -0
- package/lib/ui-kit/SwipeListControl/scrollToEnd.d.ts +1 -0
- package/lib/ui-kit/SwipeListControl/scrollToEnd.js +4 -0
- package/lib/ui-kit/SwipeListControl/scrollToEnd.js.map +1 -0
- package/lib/ui-kit/SwipeListControl/scrollToStart.d.ts +1 -0
- package/lib/ui-kit/SwipeListControl/scrollToStart.js +4 -0
- package/lib/ui-kit/SwipeListControl/scrollToStart.js.map +1 -0
- package/lib/ui-kit/SwipeListControl/useSwipeListScroll.d.ts +17 -0
- package/lib/ui-kit/SwipeListControl/useSwipeListScroll.js +54 -0
- package/lib/ui-kit/SwipeListControl/useSwipeListScroll.js.map +1 -0
- package/lib/utils/areArraysEqual.d.ts +1 -0
- package/lib/utils/areArraysEqual.js +2 -0
- package/lib/utils/areArraysEqual.js.map +1 -0
- package/lib/utils/mapChildren.d.ts +2 -0
- package/lib/utils/mapChildren.js +7 -0
- package/lib/utils/mapChildren.js.map +1 -0
- package/lib/utils/maxBy.d.ts +2 -2
- package/lib/utils/maxBy.js +2 -2
- package/lib/utils/maxBy.js.map +1 -1
- package/lib/utils/minBy.d.ts +1 -0
- package/lib/utils/minBy.js +3 -0
- package/lib/utils/minBy.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +141 -140
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Calculator/constants.d.ts +3 -0
- package/mobile/bundle/components/Calculator/useDepositCalculatorParams.d.ts +22 -0
- package/mobile/bundle/components/CarouselProgramsCard/CarouselProgramsCard.d.ts +5 -0
- package/mobile/bundle/components/CarouselProgramsCard/CarouselProgramsCardContent.d.ts +12 -0
- package/mobile/bundle/components/Header/HeaderSecondaryMenu.d.ts +1 -0
- package/mobile/bundle/components/Header/HeaderSubMenuItem.d.ts +2 -1
- package/mobile/bundle/hooks/useIntersectionObserver.d.ts +7 -1
- package/mobile/bundle/services/sitemap/SitemapProps.d.ts +1 -2
- package/mobile/bundle/ui-kit/Button/ArrowButton.d.ts +2 -0
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListContainer.d.ts +19 -0
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +7 -4
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +3 -3
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListItem.d.ts +14 -0
- package/mobile/bundle/ui-kit/SwipeListControl/scrollBy.d.ts +1 -0
- package/mobile/bundle/ui-kit/SwipeListControl/scrollToEnd.d.ts +1 -0
- package/mobile/bundle/ui-kit/SwipeListControl/scrollToStart.d.ts +1 -0
- package/mobile/bundle/ui-kit/SwipeListControl/useSwipeListScroll.d.ts +17 -0
- package/mobile/bundle/utils/areArraysEqual.d.ts +1 -0
- package/mobile/bundle/utils/mapChildren.d.ts +2 -0
- package/mobile/bundle/utils/maxBy.d.ts +2 -2
- package/mobile/bundle/utils/minBy.d.ts +1 -0
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js +13 -11
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/constants.d.ts +3 -0
- package/mobile/dist/components/Calculator/constants.js +10 -1
- package/mobile/dist/components/Calculator/constants.js.map +1 -1
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.d.ts +22 -0
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.js +28 -0
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -0
- package/mobile/dist/components/Carousel/Carousel.js +14 -15
- package/mobile/dist/components/Carousel/Carousel.js.map +1 -1
- package/mobile/dist/components/CarouselProgramsCard/CarouselProgramsCard.d.ts +5 -0
- package/mobile/dist/components/CarouselProgramsCard/CarouselProgramsCard.js +12 -0
- package/mobile/dist/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -0
- package/mobile/dist/components/CarouselProgramsCard/CarouselProgramsCardContent.d.ts +12 -0
- package/mobile/dist/components/CarouselProgramsCard/CarouselProgramsCardContent.js +2 -0
- package/mobile/dist/components/CarouselProgramsCard/CarouselProgramsCardContent.js.map +1 -0
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +7 -13
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/mobile/dist/components/ComparisonTable/ComparisonTable.js +1 -1
- package/mobile/dist/components/ComparisonTable/ComparisonTable.js.map +1 -1
- package/mobile/dist/components/Gallery/Gallery.js +1 -1
- package/mobile/dist/components/Header/HeaderSecondaryMenu.d.ts +1 -0
- package/mobile/dist/components/Header/HeaderSecondaryMenu.js +2 -2
- package/mobile/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/mobile/dist/components/Header/HeaderSubMenu.js +1 -1
- package/mobile/dist/components/Header/HeaderSubMenu.js.map +1 -1
- package/mobile/dist/components/Header/HeaderSubMenuItem.d.ts +2 -1
- package/mobile/dist/components/Header/HeaderSubMenuItem.js.map +1 -1
- package/mobile/dist/components/OtherProductsItem/OtherProductsItem.js +1 -1
- package/mobile/dist/components/OtherProductsItem/OtherProductsItem.js.map +1 -1
- package/mobile/dist/components/RollupItem/RollupItem.js +10 -1
- package/mobile/dist/components/RollupItem/RollupItem.js.map +1 -1
- package/mobile/dist/components/VerticalLayout/VerticalLayout.js +5 -3
- package/mobile/dist/components/VerticalLayout/VerticalLayout.js.map +1 -1
- package/mobile/dist/hooks/useIntersectionObserver.d.ts +7 -1
- package/mobile/dist/hooks/useIntersectionObserver.js +10 -1
- package/mobile/dist/hooks/useIntersectionObserver.js.map +1 -1
- package/mobile/dist/hooks/useLink.js +1 -1
- package/mobile/dist/hooks/useLink.js.map +1 -1
- package/mobile/dist/services/sitemap/SitemapProps.d.ts +1 -2
- package/mobile/dist/ui-kit/BlockWrapper.js +1 -11
- package/mobile/dist/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/dist/ui-kit/Button/ArrowButton.d.ts +2 -0
- package/mobile/dist/ui-kit/Button/ArrowButton.js +3 -1
- package/mobile/dist/ui-kit/Button/ArrowButton.js.map +1 -1
- package/mobile/dist/ui-kit/Foldable/FoldableSection.js +1 -1
- package/mobile/dist/ui-kit/Foldable/FoldableSection.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.d.ts +19 -0
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js +35 -0
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js +17 -38
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +7 -4
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +10 -27
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +3 -3
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListItem.d.ts +14 -0
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListItem.js +16 -0
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListItem.js.map +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/scrollBy.d.ts +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/scrollBy.js +8 -0
- package/mobile/dist/ui-kit/SwipeListControl/scrollBy.js.map +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/scrollToEnd.d.ts +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/scrollToEnd.js +7 -0
- package/mobile/dist/ui-kit/SwipeListControl/scrollToEnd.js.map +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/scrollToStart.d.ts +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/scrollToStart.js +7 -0
- package/mobile/dist/ui-kit/SwipeListControl/scrollToStart.js.map +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/useSwipeListScroll.d.ts +17 -0
- package/mobile/dist/ui-kit/SwipeListControl/useSwipeListScroll.js +57 -0
- package/mobile/dist/ui-kit/SwipeListControl/useSwipeListScroll.js.map +1 -0
- package/mobile/dist/utils/areArraysEqual.d.ts +1 -0
- package/mobile/dist/utils/areArraysEqual.js +5 -0
- package/mobile/dist/utils/areArraysEqual.js.map +1 -0
- package/mobile/dist/utils/mapChildren.d.ts +2 -0
- package/mobile/dist/utils/mapChildren.js +10 -0
- package/mobile/dist/utils/mapChildren.js.map +1 -0
- package/mobile/dist/utils/maxBy.d.ts +2 -2
- package/mobile/dist/utils/maxBy.js +4 -4
- package/mobile/dist/utils/maxBy.js.map +1 -1
- package/mobile/dist/utils/minBy.d.ts +1 -0
- package/mobile/dist/utils/minBy.js +6 -0
- package/mobile/dist/utils/minBy.js.map +1 -0
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js +14 -12
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/constants.d.ts +3 -0
- package/mobile/lib/components/Calculator/constants.js +9 -0
- package/mobile/lib/components/Calculator/constants.js.map +1 -1
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.d.ts +22 -0
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.js +25 -0
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -0
- package/mobile/lib/components/Carousel/Carousel.js +14 -15
- package/mobile/lib/components/Carousel/Carousel.js.map +1 -1
- package/mobile/lib/components/CarouselProgramsCard/CarouselProgramsCard.d.ts +5 -0
- package/mobile/lib/components/CarouselProgramsCard/CarouselProgramsCard.js +10 -0
- package/mobile/lib/components/CarouselProgramsCard/CarouselProgramsCard.js.map +1 -0
- package/mobile/lib/components/CarouselProgramsCard/CarouselProgramsCardContent.d.ts +12 -0
- package/mobile/lib/components/CarouselProgramsCard/CarouselProgramsCardContent.js +2 -0
- package/mobile/lib/components/CarouselProgramsCard/CarouselProgramsCardContent.js.map +1 -0
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +7 -13
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/mobile/lib/components/ComparisonTable/ComparisonTable.js +1 -1
- package/mobile/lib/components/ComparisonTable/ComparisonTable.js.map +1 -1
- package/mobile/lib/components/Gallery/Gallery.js +1 -1
- package/mobile/lib/components/Header/HeaderSecondaryMenu.d.ts +1 -0
- package/mobile/lib/components/Header/HeaderSecondaryMenu.js +2 -2
- package/mobile/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
- package/mobile/lib/components/Header/HeaderSubMenu.js +1 -1
- package/mobile/lib/components/Header/HeaderSubMenu.js.map +1 -1
- package/mobile/lib/components/Header/HeaderSubMenuItem.d.ts +2 -1
- package/mobile/lib/components/Header/HeaderSubMenuItem.js +1 -1
- package/mobile/lib/components/Header/HeaderSubMenuItem.js.map +1 -1
- package/mobile/lib/components/OtherProductsItem/OtherProductsItem.js +1 -1
- package/mobile/lib/components/OtherProductsItem/OtherProductsItem.js.map +1 -1
- package/mobile/lib/components/RollupItem/RollupItem.js +10 -1
- package/mobile/lib/components/RollupItem/RollupItem.js.map +1 -1
- package/mobile/lib/components/VerticalLayout/VerticalLayout.js +5 -3
- package/mobile/lib/components/VerticalLayout/VerticalLayout.js.map +1 -1
- package/mobile/lib/hooks/useIntersectionObserver.d.ts +7 -1
- package/mobile/lib/hooks/useIntersectionObserver.js +11 -2
- package/mobile/lib/hooks/useIntersectionObserver.js.map +1 -1
- package/mobile/lib/hooks/useLink.js +2 -2
- package/mobile/lib/hooks/useLink.js.map +1 -1
- package/mobile/lib/services/sitemap/SitemapProps.d.ts +1 -2
- package/mobile/lib/ui-kit/BlockWrapper.js +1 -11
- package/mobile/lib/ui-kit/BlockWrapper.js.map +1 -1
- package/mobile/lib/ui-kit/Button/ArrowButton.d.ts +2 -0
- package/mobile/lib/ui-kit/Button/ArrowButton.js +2 -0
- package/mobile/lib/ui-kit/Button/ArrowButton.js.map +1 -1
- package/mobile/lib/ui-kit/Foldable/FoldableSection.js +1 -1
- package/mobile/lib/ui-kit/Foldable/FoldableSection.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.d.ts +19 -0
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js +33 -0
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js +17 -38
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +7 -4
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +10 -27
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +3 -3
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListItem.d.ts +14 -0
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListItem.js +14 -0
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListItem.js.map +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/scrollBy.d.ts +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/scrollBy.js +5 -0
- package/mobile/lib/ui-kit/SwipeListControl/scrollBy.js.map +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/scrollToEnd.d.ts +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/scrollToEnd.js +4 -0
- package/mobile/lib/ui-kit/SwipeListControl/scrollToEnd.js.map +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/scrollToStart.d.ts +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/scrollToStart.js +4 -0
- package/mobile/lib/ui-kit/SwipeListControl/scrollToStart.js.map +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/useSwipeListScroll.d.ts +17 -0
- package/mobile/lib/ui-kit/SwipeListControl/useSwipeListScroll.js +54 -0
- package/mobile/lib/ui-kit/SwipeListControl/useSwipeListScroll.js.map +1 -0
- package/mobile/lib/utils/areArraysEqual.d.ts +1 -0
- package/mobile/lib/utils/areArraysEqual.js +2 -0
- package/mobile/lib/utils/areArraysEqual.js.map +1 -0
- package/mobile/lib/utils/mapChildren.d.ts +2 -0
- package/mobile/lib/utils/mapChildren.js +7 -0
- package/mobile/lib/utils/mapChildren.js.map +1 -0
- package/mobile/lib/utils/maxBy.d.ts +2 -2
- package/mobile/lib/utils/maxBy.js +2 -2
- package/mobile/lib/utils/maxBy.js.map +1 -1
- package/mobile/lib/utils/minBy.d.ts +1 -0
- package/mobile/lib/utils/minBy.js +3 -0
- package/mobile/lib/utils/minBy.js.map +1 -0
- package/mobile/src/common.css +0 -7
- package/mobile/src/components/Calculator/DepositCalculatorForm.tsx +17 -22
- package/mobile/src/components/Calculator/constants.ts +11 -0
- package/mobile/src/components/Calculator/useDepositCalculatorParams.ts +64 -0
- package/mobile/src/components/Carousel/Carousel.tsx +41 -23
- package/mobile/src/components/CarouselProgramsCard/CarouselProgramsCard.example.json +25 -0
- package/mobile/src/components/CarouselProgramsCard/CarouselProgramsCard.tsx +36 -0
- package/mobile/src/components/CarouselProgramsCard/CarouselProgramsCard.ui.json +1 -0
- package/mobile/src/components/CarouselProgramsCard/CarouselProgramsCardContent.ts +13 -0
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +44 -43
- package/mobile/src/components/ComparisonTable/ComparisonTable.tsx +1 -1
- package/mobile/src/components/Gallery/Gallery.tsx +1 -1
- package/mobile/src/components/Header/HeaderSecondaryMenu.tsx +12 -9
- package/mobile/src/components/Header/HeaderSubMenu.tsx +2 -4
- package/mobile/src/components/Header/HeaderSubMenuItem.tsx +5 -2
- package/mobile/src/components/OtherProductsItem/OtherProductsItem.tsx +1 -1
- package/mobile/src/components/RollupItem/RollupItem.tsx +10 -1
- package/mobile/src/components/VerticalLayout/VerticalLayout.tsx +5 -3
- package/mobile/src/hooks/useIntersectionObserver.ts +23 -2
- package/mobile/src/hooks/useLink.ts +2 -2
- package/mobile/src/services/sitemap/SitemapProps.ts +1 -2
- package/mobile/src/ui-kit/BlockWrapper.tsx +1 -16
- package/mobile/src/ui-kit/Button/ArrowButton.tsx +13 -0
- package/mobile/src/ui-kit/Foldable/FoldableSection.tsx +3 -1
- package/mobile/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +97 -0
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControl.tsx +31 -55
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +25 -59
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControlProps.ts +3 -3
- package/mobile/src/ui-kit/SwipeListControl/SwipeListItem.tsx +44 -0
- package/mobile/src/ui-kit/SwipeListControl/scrollBy.ts +10 -0
- package/mobile/src/ui-kit/SwipeListControl/scrollToEnd.ts +3 -0
- package/mobile/src/ui-kit/SwipeListControl/scrollToStart.ts +3 -0
- package/mobile/src/ui-kit/SwipeListControl/useSwipeListScroll.ts +84 -0
- package/mobile/src/utils/areArraysEqual.ts +2 -0
- package/mobile/src/utils/mapChildren.ts +11 -0
- package/mobile/src/utils/maxBy.ts +3 -4
- package/mobile/src/utils/minBy.ts +5 -0
- package/package.json +2 -2
- package/src/common.css +0 -7
- package/src/components/Blocks.ts +3 -1
- package/src/components/Calculator/Calculator.fixture.tsx +0 -5
- package/src/components/Calculator/DepositCalculatorForm.tsx +17 -22
- package/src/components/Calculator/constants.ts +11 -0
- package/src/components/Calculator/useDepositCalculatorParams.ts +64 -0
- package/src/components/Carousel/Carousel.fixture.tsx +20 -0
- package/src/components/Carousel/Carousel.tsx +41 -23
- package/src/components/CarouselProgramsCard/CarouselProgramsCard.example.json +25 -0
- package/src/components/CarouselProgramsCard/CarouselProgramsCard.fixture.tsx +38 -0
- package/src/components/CarouselProgramsCard/CarouselProgramsCard.tsx +36 -0
- package/src/components/CarouselProgramsCard/CarouselProgramsCard.ui.json +1 -0
- package/src/components/CarouselProgramsCard/CarouselProgramsCardContent.ts +13 -0
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.fixture.tsx +2 -2
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +44 -43
- package/src/components/ComparisonTable/ComparisonTable.mobile.tsx +1 -1
- package/src/components/Gallery/Gallery.mobile.tsx +1 -1
- package/src/components/Header/Header.tsx +2 -1
- package/src/components/Header/HeaderSecondaryMenu.tsx +12 -9
- package/src/components/Header/HeaderSubMenu.tsx +2 -4
- package/src/components/Header/HeaderSubMenuItem.tsx +5 -2
- package/src/components/OtherProductsItem/OtherProductsItem.tsx +1 -1
- package/src/components/RollupItem/RollupItem.tsx +10 -1
- package/src/components/VerticalLayout/VerticalLayout.tsx +5 -3
- package/src/hooks/useIntersectionObserver.ts +23 -2
- package/src/hooks/useLink.ts +2 -2
- package/src/services/sitemap/SitemapProps.ts +1 -2
- package/src/ui-kit/BlockWrapper.tsx +1 -16
- package/src/ui-kit/Button/ArrowButton.tsx +13 -0
- package/src/ui-kit/Foldable/FoldableSection.tsx +3 -1
- package/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +97 -0
- package/src/ui-kit/SwipeListControl/SwipeListControl.tsx +31 -55
- package/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +25 -59
- package/src/ui-kit/SwipeListControl/SwipeListControlProps.ts +3 -3
- package/src/ui-kit/SwipeListControl/SwipeListItem.tsx +44 -0
- package/src/ui-kit/SwipeListControl/scrollBy.ts +10 -0
- package/src/ui-kit/SwipeListControl/scrollToEnd.ts +3 -0
- package/src/ui-kit/SwipeListControl/scrollToStart.ts +3 -0
- package/src/ui-kit/SwipeListControl/useSwipeListScroll.ts +84 -0
- package/src/utils/areArraysEqual.ts +2 -0
- package/src/utils/mapChildren.ts +11 -0
- package/src/utils/maxBy.ts +3 -4
- package/src/utils/minBy.ts +5 -0
- package/bundle/components/Carousel/CarouselContainer.d.ts +0 -10
- package/bundle/ui-kit/SwipeListControl/SwipeListControlItem.d.ts +0 -9
- package/bundle/ui-kit/SwipeListControl/SwipeListControlList.d.ts +0 -11
- package/bundle/ui-kit/SwipeListControl/constants.d.ts +0 -2
- package/bundle/ui-kit/SwipeListControl/utils/getContainerStyle.d.ts +0 -1
- package/bundle/ui-kit/SwipeListControl/utils/getIndexParts.d.ts +0 -4
- package/bundle/ui-kit/SwipeListControl/utils/getScrollPoints.d.ts +0 -8
- package/dist/components/Carousel/CarouselContainer.d.ts +0 -10
- package/dist/components/Carousel/CarouselContainer.js +0 -14
- package/dist/components/Carousel/CarouselContainer.js.map +0 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControlItem.d.ts +0 -9
- package/dist/ui-kit/SwipeListControl/SwipeListControlItem.js +0 -8
- package/dist/ui-kit/SwipeListControl/SwipeListControlItem.js.map +0 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControlList.d.ts +0 -11
- package/dist/ui-kit/SwipeListControl/SwipeListControlList.js +0 -11
- package/dist/ui-kit/SwipeListControl/SwipeListControlList.js.map +0 -1
- package/dist/ui-kit/SwipeListControl/constants.d.ts +0 -2
- package/dist/ui-kit/SwipeListControl/constants.js +0 -12
- package/dist/ui-kit/SwipeListControl/constants.js.map +0 -1
- package/dist/ui-kit/SwipeListControl/utils/getContainerStyle.d.ts +0 -1
- package/dist/ui-kit/SwipeListControl/utils/getContainerStyle.js +0 -13
- package/dist/ui-kit/SwipeListControl/utils/getContainerStyle.js.map +0 -1
- package/dist/ui-kit/SwipeListControl/utils/getIndexParts.d.ts +0 -4
- package/dist/ui-kit/SwipeListControl/utils/getIndexParts.js +0 -19
- package/dist/ui-kit/SwipeListControl/utils/getIndexParts.js.map +0 -1
- package/dist/ui-kit/SwipeListControl/utils/getScrollPoints.d.ts +0 -8
- package/dist/ui-kit/SwipeListControl/utils/getScrollPoints.js +0 -33
- package/dist/ui-kit/SwipeListControl/utils/getScrollPoints.js.map +0 -1
- package/lib/components/Carousel/CarouselContainer.d.ts +0 -10
- package/lib/components/Carousel/CarouselContainer.js +0 -12
- package/lib/components/Carousel/CarouselContainer.js.map +0 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControlItem.d.ts +0 -9
- package/lib/ui-kit/SwipeListControl/SwipeListControlItem.js +0 -6
- package/lib/ui-kit/SwipeListControl/SwipeListControlItem.js.map +0 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControlList.d.ts +0 -11
- package/lib/ui-kit/SwipeListControl/SwipeListControlList.js +0 -9
- package/lib/ui-kit/SwipeListControl/SwipeListControlList.js.map +0 -1
- package/lib/ui-kit/SwipeListControl/constants.d.ts +0 -2
- package/lib/ui-kit/SwipeListControl/constants.js +0 -10
- package/lib/ui-kit/SwipeListControl/constants.js.map +0 -1
- package/lib/ui-kit/SwipeListControl/utils/getContainerStyle.d.ts +0 -1
- package/lib/ui-kit/SwipeListControl/utils/getContainerStyle.js +0 -10
- package/lib/ui-kit/SwipeListControl/utils/getContainerStyle.js.map +0 -1
- package/lib/ui-kit/SwipeListControl/utils/getIndexParts.d.ts +0 -7
- package/lib/ui-kit/SwipeListControl/utils/getIndexParts.js +0 -16
- package/lib/ui-kit/SwipeListControl/utils/getIndexParts.js.map +0 -1
- package/lib/ui-kit/SwipeListControl/utils/getScrollPoints.d.ts +0 -11
- package/lib/ui-kit/SwipeListControl/utils/getScrollPoints.js +0 -30
- package/lib/ui-kit/SwipeListControl/utils/getScrollPoints.js.map +0 -1
- package/mobile/bundle/components/Carousel/CarouselContainer.d.ts +0 -10
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListControlItem.d.ts +0 -9
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListControlList.d.ts +0 -11
- package/mobile/bundle/ui-kit/SwipeListControl/constants.d.ts +0 -2
- package/mobile/bundle/ui-kit/SwipeListControl/utils/getContainerStyle.d.ts +0 -1
- package/mobile/bundle/ui-kit/SwipeListControl/utils/getIndexParts.d.ts +0 -4
- package/mobile/bundle/ui-kit/SwipeListControl/utils/getScrollPoints.d.ts +0 -8
- package/mobile/dist/components/Carousel/CarouselContainer.d.ts +0 -10
- package/mobile/dist/components/Carousel/CarouselContainer.js +0 -14
- package/mobile/dist/components/Carousel/CarouselContainer.js.map +0 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlItem.d.ts +0 -9
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlItem.js +0 -8
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlItem.js.map +0 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlList.d.ts +0 -11
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlList.js +0 -11
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlList.js.map +0 -1
- package/mobile/dist/ui-kit/SwipeListControl/constants.d.ts +0 -2
- package/mobile/dist/ui-kit/SwipeListControl/constants.js +0 -12
- package/mobile/dist/ui-kit/SwipeListControl/constants.js.map +0 -1
- package/mobile/dist/ui-kit/SwipeListControl/utils/getContainerStyle.d.ts +0 -1
- package/mobile/dist/ui-kit/SwipeListControl/utils/getContainerStyle.js +0 -13
- package/mobile/dist/ui-kit/SwipeListControl/utils/getContainerStyle.js.map +0 -1
- package/mobile/dist/ui-kit/SwipeListControl/utils/getIndexParts.d.ts +0 -4
- package/mobile/dist/ui-kit/SwipeListControl/utils/getIndexParts.js +0 -19
- package/mobile/dist/ui-kit/SwipeListControl/utils/getIndexParts.js.map +0 -1
- package/mobile/dist/ui-kit/SwipeListControl/utils/getScrollPoints.d.ts +0 -8
- package/mobile/dist/ui-kit/SwipeListControl/utils/getScrollPoints.js +0 -33
- package/mobile/dist/ui-kit/SwipeListControl/utils/getScrollPoints.js.map +0 -1
- package/mobile/lib/components/Carousel/CarouselContainer.d.ts +0 -10
- package/mobile/lib/components/Carousel/CarouselContainer.js +0 -12
- package/mobile/lib/components/Carousel/CarouselContainer.js.map +0 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlItem.d.ts +0 -9
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlItem.js +0 -6
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlItem.js.map +0 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlList.d.ts +0 -11
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlList.js +0 -9
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlList.js.map +0 -1
- package/mobile/lib/ui-kit/SwipeListControl/constants.d.ts +0 -2
- package/mobile/lib/ui-kit/SwipeListControl/constants.js +0 -10
- package/mobile/lib/ui-kit/SwipeListControl/constants.js.map +0 -1
- package/mobile/lib/ui-kit/SwipeListControl/utils/getContainerStyle.d.ts +0 -1
- package/mobile/lib/ui-kit/SwipeListControl/utils/getContainerStyle.js +0 -10
- package/mobile/lib/ui-kit/SwipeListControl/utils/getContainerStyle.js.map +0 -1
- package/mobile/lib/ui-kit/SwipeListControl/utils/getIndexParts.d.ts +0 -4
- package/mobile/lib/ui-kit/SwipeListControl/utils/getIndexParts.js +0 -16
- package/mobile/lib/ui-kit/SwipeListControl/utils/getIndexParts.js.map +0 -1
- package/mobile/lib/ui-kit/SwipeListControl/utils/getScrollPoints.d.ts +0 -8
- package/mobile/lib/ui-kit/SwipeListControl/utils/getScrollPoints.js +0 -30
- package/mobile/lib/ui-kit/SwipeListControl/utils/getScrollPoints.js.map +0 -1
- package/mobile/src/components/Carousel/CarouselContainer.tsx +0 -34
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControlItem.tsx +0 -24
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControlList.tsx +0 -50
- package/mobile/src/ui-kit/SwipeListControl/constants.ts +0 -10
- package/mobile/src/ui-kit/SwipeListControl/utils/getContainerStyle.ts +0 -9
- package/mobile/src/ui-kit/SwipeListControl/utils/getIndexParts.ts +0 -25
- package/mobile/src/ui-kit/SwipeListControl/utils/getScrollPoints.ts +0 -49
- package/src/components/Carousel/CarouselContainer.tsx +0 -34
- package/src/ui-kit/SwipeListControl/SwipeListControlItem.tsx +0 -24
- package/src/ui-kit/SwipeListControl/SwipeListControlList.tsx +0 -50
- package/src/ui-kit/SwipeListControl/constants.ts +0 -10
- package/src/ui-kit/SwipeListControl/utils/getContainerStyle.ts +0 -9
- package/src/ui-kit/SwipeListControl/utils/getIndexParts.ts +0 -25
- package/src/ui-kit/SwipeListControl/utils/getScrollPoints.ts +0 -49
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
useIntersectionObserver,
|
|
5
|
+
type IntersectionObserverOptions,
|
|
6
|
+
} from '../../hooks/useIntersectionObserver';
|
|
4
7
|
import type { BgColorVersion } from '../../model/BgColorVersion';
|
|
5
8
|
import type { LinkProps } from '../../model/LinkProps';
|
|
6
9
|
import { HeaderItem } from '../../ui-kit/HeaderItem/HeaderItem';
|
|
@@ -9,7 +12,7 @@ export interface HeaderSubMenuItemProps extends LinkProps {
|
|
|
9
12
|
className?: string;
|
|
10
13
|
active?: boolean;
|
|
11
14
|
bgColor?: BgColorVersion;
|
|
12
|
-
observerOptions?:
|
|
15
|
+
observerOptions?: IntersectionObserverOptions;
|
|
13
16
|
onVisibilityChange?: (isIntersecting: boolean) => void;
|
|
14
17
|
}
|
|
15
18
|
|
|
@@ -35,7 +35,7 @@ export const OtherProductsItem: JSXBlock<OtherProductsItemProps> = JSX<OtherProd
|
|
|
35
35
|
<DefaultFoldButton
|
|
36
36
|
label={label}
|
|
37
37
|
icon={icons[Number(isUnfolded)]}
|
|
38
|
-
dataTheme={rest.options?.page?.colorPalette
|
|
38
|
+
dataTheme={colorPalette || rest.options?.page?.colorPalette}
|
|
39
39
|
onClick={onToggle}
|
|
40
40
|
/>
|
|
41
41
|
)}
|
|
@@ -55,7 +55,16 @@ export const RollupItem: JSXBlock<RollupItemProps> = JSX<RollupItemProps>(
|
|
|
55
55
|
),
|
|
56
56
|
);
|
|
57
57
|
|
|
58
|
-
RollupItem.childrenTypes =
|
|
58
|
+
RollupItem.childrenTypes = {
|
|
59
|
+
exclude: [
|
|
60
|
+
'RollupItem',
|
|
61
|
+
'Accordion',
|
|
62
|
+
'AccordionItem',
|
|
63
|
+
'OtherProducts',
|
|
64
|
+
'OtherProductsItem',
|
|
65
|
+
'VerticalLayout',
|
|
66
|
+
],
|
|
67
|
+
};
|
|
59
68
|
|
|
60
69
|
const renderFoldButton = ({ isUnfolded, onToggle, label, version }: RollupFoldablePartProps) => {
|
|
61
70
|
const iconsPrimary: IconName[] = ['PlusIcon', 'MinusIcon'];
|
|
@@ -31,15 +31,17 @@ const backgroundStyleMap: Record<BlockVersionWithTransparent, string> = {
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
export const VerticalLayout: JSXBlock<VerticalLayoutProps> = JSX<VerticalLayoutProps>(
|
|
34
|
-
({ className = '', gap = '', align
|
|
34
|
+
({ className = '', gap = '', align, version = 'transparent', ...rest }) => (
|
|
35
35
|
<BlockWrapper
|
|
36
36
|
className={[
|
|
37
37
|
'flex flex-col',
|
|
38
38
|
gapStyleMap[gap],
|
|
39
|
-
alignStyle[align],
|
|
39
|
+
align && alignStyle[align],
|
|
40
40
|
backgroundStyleMap[version],
|
|
41
41
|
className,
|
|
42
|
-
]
|
|
42
|
+
]
|
|
43
|
+
.filter(Boolean)
|
|
44
|
+
.join(' ')}
|
|
43
45
|
{...rest}
|
|
44
46
|
>
|
|
45
47
|
{renderChildren(rest)}
|
|
@@ -1,11 +1,23 @@
|
|
|
1
|
-
import { useEffect, useRef } from '@redneckz/uni-jsx/lib/hooks';
|
|
1
|
+
import { useEffect, useMemo, useRef } from '@redneckz/uni-jsx/lib/hooks';
|
|
2
|
+
|
|
3
|
+
export interface IntersectionObserverOptions<E extends Element = Element> {
|
|
4
|
+
sensitivity?: number; // from 0 to 1
|
|
5
|
+
rootRef?: { current: E | null };
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const SENSITIVITY_SCALE = 10;
|
|
2
9
|
|
|
3
10
|
export function useIntersectionObserver<R extends Element>(
|
|
4
11
|
observerCallback: IntersectionObserverCallback,
|
|
5
|
-
|
|
12
|
+
{ sensitivity, rootRef }: IntersectionObserverOptions = {},
|
|
6
13
|
) {
|
|
7
14
|
const ref = useRef<R | null>(null);
|
|
8
15
|
|
|
16
|
+
const observerOptions = useMemo(
|
|
17
|
+
() => ({ threshold: sensitivityToThreshold(sensitivity), root: rootRef?.current }),
|
|
18
|
+
[sensitivity, rootRef?.current],
|
|
19
|
+
);
|
|
20
|
+
|
|
9
21
|
useEffect(() => {
|
|
10
22
|
if (!ref.current) {
|
|
11
23
|
return undefined;
|
|
@@ -21,3 +33,12 @@ export function useIntersectionObserver<R extends Element>(
|
|
|
21
33
|
|
|
22
34
|
return ref;
|
|
23
35
|
}
|
|
36
|
+
|
|
37
|
+
function sensitivityToThreshold(sensitivity = 0): number[] {
|
|
38
|
+
const thresholdsCount = Math.round(sensitivity * SENSITIVITY_SCALE);
|
|
39
|
+
|
|
40
|
+
return new Array(thresholdsCount)
|
|
41
|
+
.fill(0)
|
|
42
|
+
.map((_, thi) => Math.min(thi / thresholdsCount), 1)
|
|
43
|
+
.concat(1);
|
|
44
|
+
}
|
package/src/hooks/useLink.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LinkProps } from '../model/LinkProps';
|
|
2
2
|
import { adjustHref } from '../utils/adjustHref';
|
|
3
|
-
import { isURL } from '../utils/url';
|
|
3
|
+
import { isHash, isURL } from '../utils/url';
|
|
4
4
|
import { handlerDecorator } from './handlerDecorator';
|
|
5
5
|
import { useRouter } from './useRouter';
|
|
6
6
|
|
|
@@ -24,7 +24,7 @@ export function useLink(): <L extends Partial<LinkProps & ClickHandler>>(
|
|
|
24
24
|
props.onClick && props.onClick(ev);
|
|
25
25
|
const isLocalHref = href && !isURL(href);
|
|
26
26
|
const isLocalTarget = !props.target || props.target === '_self';
|
|
27
|
-
if (isLocalHref && isLocalTarget) {
|
|
27
|
+
if (isLocalHref && isLocalTarget && !isHash(href)) {
|
|
28
28
|
ev?.preventDefault();
|
|
29
29
|
router.push(href);
|
|
30
30
|
}
|
|
@@ -20,13 +20,12 @@ export interface DispositionItem extends LinkProps {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export interface SitemapDataProps {
|
|
23
|
-
/** @title Основное меню */
|
|
24
23
|
topItems?: TopMenuItem[];
|
|
25
|
-
/** @title Дополнительное меню */
|
|
26
24
|
dispositions?: DispositionItem[];
|
|
27
25
|
logo?: {
|
|
28
26
|
image?: Picture;
|
|
29
27
|
title?: string;
|
|
30
28
|
};
|
|
31
29
|
defaultLocation?: string;
|
|
30
|
+
officesLink?: string;
|
|
32
31
|
}
|
|
@@ -11,15 +11,6 @@ interface BlockWrapperProps extends UniBlockProps {
|
|
|
11
11
|
role?: string;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
const THRESHOLD_ACCURACY = 100; // Decimals number (100 is for two decimals number, 0.**)
|
|
15
|
-
const THRESHOLD_ARRAY_LENGTH = 18;
|
|
16
|
-
const THRESHOLD_ARRAY_START_VALUE =
|
|
17
|
-
(THRESHOLD_ACCURACY - THRESHOLD_ARRAY_LENGTH) / THRESHOLD_ACCURACY;
|
|
18
|
-
|
|
19
|
-
const OBSERVER_OPTIONS = {
|
|
20
|
-
threshold: new Array(THRESHOLD_ARRAY_LENGTH).fill(0).map(getIntersectionThreshold),
|
|
21
|
-
};
|
|
22
|
-
|
|
23
14
|
export const BlockWrapper = JSX<BlockWrapperProps>(
|
|
24
15
|
({ className, block, tag = 'section', role, children }) => {
|
|
25
16
|
const Tag: any = tag;
|
|
@@ -33,7 +24,7 @@ export const BlockWrapper = JSX<BlockWrapperProps>(
|
|
|
33
24
|
() => changeHashOnObserve({ anchor, anchorClickRef }),
|
|
34
25
|
[anchor],
|
|
35
26
|
);
|
|
36
|
-
const ref = useIntersectionObserver(observerCallback,
|
|
27
|
+
const ref = useIntersectionObserver(observerCallback, { sensitivity: 1 });
|
|
37
28
|
|
|
38
29
|
useEffect(
|
|
39
30
|
() =>
|
|
@@ -65,12 +56,6 @@ export const BlockWrapper = JSX<BlockWrapperProps>(
|
|
|
65
56
|
},
|
|
66
57
|
);
|
|
67
58
|
|
|
68
|
-
function getIntersectionThreshold(_: number, i: number): number {
|
|
69
|
-
const value = (i + 1) / THRESHOLD_ACCURACY + THRESHOLD_ARRAY_START_VALUE;
|
|
70
|
-
|
|
71
|
-
return Math.round(value * THRESHOLD_ACCURACY) / THRESHOLD_ACCURACY;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
59
|
function changeHash(label?: string) {
|
|
75
60
|
if (label) {
|
|
76
61
|
globalThis.document.location.hash = label;
|
|
@@ -24,3 +24,16 @@ export const ArrowButton = JSX<ButtonProps>(({ className, disabled, ...rest }) =
|
|
|
24
24
|
/>
|
|
25
25
|
</Button>
|
|
26
26
|
));
|
|
27
|
+
|
|
28
|
+
export const ScrollLeftButton = JSX<ButtonProps>((props) => (
|
|
29
|
+
<ArrowButton {...props} ariaLabel="Пролистать влево" data-block-control="scroll-left" />
|
|
30
|
+
));
|
|
31
|
+
|
|
32
|
+
export const ScrollRightButton = JSX<ButtonProps>((props) => (
|
|
33
|
+
<ArrowButton
|
|
34
|
+
{...props}
|
|
35
|
+
className={`${props.className || ''} rotate-180`}
|
|
36
|
+
ariaLabel="Пролистать вправо"
|
|
37
|
+
data-block-control="scroll-right"
|
|
38
|
+
/>
|
|
39
|
+
));
|
|
@@ -21,7 +21,9 @@ export const FoldableSection = JSX<FoldableSectionProps>(
|
|
|
21
21
|
return (
|
|
22
22
|
<div
|
|
23
23
|
ref={containerRef}
|
|
24
|
-
className={`transition-max-h duration-300 overflow-hidden
|
|
24
|
+
className={`transition-max-h duration-300 overflow-hidden ${
|
|
25
|
+
containerRef.current || !isUnfolded ? 'max-h-0' : ''
|
|
26
|
+
} ${className}`}
|
|
25
27
|
>
|
|
26
28
|
{children}
|
|
27
29
|
</div>
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useCallback, useRef } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import type { IntersectionObserverOptions } from '../../hooks/useIntersectionObserver';
|
|
4
|
+
import { mapChildren } from '../../utils/mapChildren';
|
|
5
|
+
import type { SwipeContainerProps } from './SwipeListControlProps';
|
|
6
|
+
import { SwipeListItem } from './SwipeListItem';
|
|
7
|
+
|
|
8
|
+
type ItemsVisibilityList = Array<IntersectionObserverEntry | undefined>;
|
|
9
|
+
|
|
10
|
+
type SwipeListItemWidthAuto = 0;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @title Список
|
|
14
|
+
*/
|
|
15
|
+
interface SwipeListContainerProps extends SwipeContainerProps {
|
|
16
|
+
className?: string;
|
|
17
|
+
containerRef?: { current: HTMLDivElement | null };
|
|
18
|
+
activeIndex?: number;
|
|
19
|
+
visibleItemCount?: SwipeListItemWidthAuto | 1 | 2 | 3;
|
|
20
|
+
snapAlign?: 'snap-start' | 'snap-center' | 'snap-end';
|
|
21
|
+
onVisibleItemsChange?: (itemsVisibilityList: ItemsVisibilityList) => void;
|
|
22
|
+
onVisibleIndicesChange?: (indices: number[]) => void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const childStyleMap = ['min-w-[100%]', 'min-w-[50%]', 'min-w-[33.33%]'];
|
|
26
|
+
|
|
27
|
+
export const SwipeListContainer = JSX<SwipeListContainerProps>(
|
|
28
|
+
({
|
|
29
|
+
className = '',
|
|
30
|
+
containerRef,
|
|
31
|
+
activeIndex,
|
|
32
|
+
visibleItemCount,
|
|
33
|
+
gap = 0,
|
|
34
|
+
padding = 0,
|
|
35
|
+
snapAlign = 'snap-center',
|
|
36
|
+
children,
|
|
37
|
+
onVisibleItemsChange,
|
|
38
|
+
onVisibleIndicesChange,
|
|
39
|
+
}) => {
|
|
40
|
+
const observerOptions: IntersectionObserverOptions = {
|
|
41
|
+
sensitivity: 1,
|
|
42
|
+
rootRef: containerRef,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const itemsVisibilityListRef = useRef<ItemsVisibilityList>([]);
|
|
46
|
+
const handleIntersection = useCallback(
|
|
47
|
+
(idx: number, entry: IntersectionObserverEntry) => {
|
|
48
|
+
const itemsVisibilityList = [...(itemsVisibilityListRef.current || [])];
|
|
49
|
+
itemsVisibilityList[idx] = entry;
|
|
50
|
+
itemsVisibilityListRef.current = itemsVisibilityList;
|
|
51
|
+
|
|
52
|
+
onVisibleItemsChange && onVisibleItemsChange(itemsVisibilityList);
|
|
53
|
+
onVisibleIndicesChange && onVisibleIndicesChange(getVisibleIndices(itemsVisibilityList));
|
|
54
|
+
},
|
|
55
|
+
[onVisibleItemsChange, onVisibleIndicesChange],
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<div
|
|
60
|
+
className={`box-border overflow-auto flex horizontal-list no-scrollbar ${className}`}
|
|
61
|
+
style={{ ...getContainerStyle(padding), gap: `${gap}px` }}
|
|
62
|
+
role="list"
|
|
63
|
+
ref={containerRef}
|
|
64
|
+
>
|
|
65
|
+
{mapChildren((child, idx) => (
|
|
66
|
+
<SwipeListItem
|
|
67
|
+
key={String(idx)}
|
|
68
|
+
className={`${snapAlign} ${
|
|
69
|
+
visibleItemCount ? childStyleMap[visibleItemCount - 1] : ''
|
|
70
|
+
}`}
|
|
71
|
+
style={getContainerStyle(padding / 4)}
|
|
72
|
+
activeIndex={activeIndex}
|
|
73
|
+
idx={idx}
|
|
74
|
+
observerOptions={observerOptions}
|
|
75
|
+
onIntersection={handleIntersection}
|
|
76
|
+
>
|
|
77
|
+
{child}
|
|
78
|
+
</SwipeListItem>
|
|
79
|
+
))(children)}
|
|
80
|
+
</div>
|
|
81
|
+
);
|
|
82
|
+
},
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
// Styles used to compensate outer container padding to get rid of clipping effect
|
|
86
|
+
const getContainerStyle = (padding: number): Record<string, string> => ({
|
|
87
|
+
marginLeft: `${-padding}px`,
|
|
88
|
+
marginRight: `${-padding}px`,
|
|
89
|
+
paddingLeft: `${padding}px`,
|
|
90
|
+
paddingRight: `${padding}px`,
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
const getVisibleIndices = (itemsVisibilityList: ItemsVisibilityList) =>
|
|
94
|
+
itemsVisibilityList
|
|
95
|
+
.map((_, i): [IntersectionObserverEntry | undefined, number] => [_, i])
|
|
96
|
+
.filter(([_]) => _ && _.intersectionRatio >= 0.9)
|
|
97
|
+
.map(([, i]) => i);
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import {
|
|
3
|
-
import { DEFAULT_GAP, DEFAULT_PADDING } from './constants';
|
|
2
|
+
import { SwipeListContainer } from './SwipeListContainer';
|
|
4
3
|
import { SwipeListControlDots } from './SwipeListControlDots';
|
|
5
|
-
import { SwipeListControlList } from './SwipeListControlList';
|
|
6
|
-
import type { SwipeListControlListProps } from './SwipeListControlList';
|
|
7
4
|
import type { SwipeListControlProps } from './SwipeListControlProps';
|
|
8
|
-
import {
|
|
9
|
-
|
|
5
|
+
import { useSwipeListScroll } from './useSwipeListScroll';
|
|
6
|
+
|
|
7
|
+
const DEFAULT_GAP = 14;
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
Horizontal padding used on a container above SwipeListControl.
|
|
11
|
+
Same value used on a SwipeListControlChildren container to compensate it
|
|
12
|
+
and get rid of a clipping effect caused by overflow: hidden.
|
|
13
|
+
*/
|
|
14
|
+
const DEFAULT_PADDING = 16;
|
|
10
15
|
|
|
11
16
|
export const SwipeListControl = JSX<SwipeListControlProps>(
|
|
12
17
|
({
|
|
@@ -14,65 +19,36 @@ export const SwipeListControl = JSX<SwipeListControlProps>(
|
|
|
14
19
|
gap = DEFAULT_GAP,
|
|
15
20
|
padding = DEFAULT_PADDING,
|
|
16
21
|
showDots = true,
|
|
17
|
-
onSlideChange,
|
|
18
22
|
children,
|
|
23
|
+
onVisibleIndicesChange,
|
|
19
24
|
}) => {
|
|
20
|
-
const
|
|
21
|
-
const [indexFraction, setIndexFraction] = useState(0);
|
|
22
|
-
|
|
23
|
-
const dotsProps = {
|
|
24
|
-
activeIndex,
|
|
25
|
-
indexFraction,
|
|
26
|
-
showDots,
|
|
27
|
-
children,
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const handleScroll: SwipeListControlListProps['onScroll'] = useCallback(
|
|
31
|
-
(e) => {
|
|
32
|
-
const {
|
|
33
|
-
scrollLeft,
|
|
34
|
-
clientWidth,
|
|
35
|
-
childElementCount,
|
|
36
|
-
scrollWidth,
|
|
37
|
-
children: childrenCollection,
|
|
38
|
-
} = e?.currentTarget as HTMLElement;
|
|
39
|
-
if (!childrenCollection[0]) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
25
|
+
const itemCount = Array.isArray(children) ? children.length : 0;
|
|
42
26
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
padding,
|
|
49
|
-
clientWidth,
|
|
50
|
-
scrollWidth,
|
|
51
|
-
childElementCount,
|
|
52
|
-
itemWidth,
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
const { index, fraction } = getIndexParts(scrollLeft, scrollPoints);
|
|
56
|
-
if (index !== activeIndex && onSlideChange) {
|
|
57
|
-
onSlideChange();
|
|
58
|
-
}
|
|
59
|
-
setActiveIndex(index);
|
|
60
|
-
setIndexFraction(fraction);
|
|
61
|
-
},
|
|
62
|
-
[gap, padding, activeIndex, onSlideChange],
|
|
63
|
-
);
|
|
27
|
+
const [containerRef, scroll] = useSwipeListScroll<HTMLDivElement>({
|
|
28
|
+
itemCount,
|
|
29
|
+
onVisibleIndicesChange,
|
|
30
|
+
});
|
|
31
|
+
const [activeIndex] = scroll.visibleIndicesRange;
|
|
64
32
|
|
|
65
33
|
return (
|
|
66
34
|
<div className={className}>
|
|
67
|
-
<
|
|
35
|
+
<SwipeListContainer
|
|
36
|
+
containerRef={containerRef}
|
|
37
|
+
activeIndex={activeIndex}
|
|
38
|
+
visibleItemCount={1}
|
|
68
39
|
gap={gap}
|
|
69
40
|
padding={padding}
|
|
70
|
-
|
|
71
|
-
onScroll={handleScroll}
|
|
41
|
+
onVisibleIndicesChange={scroll.handleVisibleIndicesChange}
|
|
72
42
|
>
|
|
73
43
|
{children}
|
|
74
|
-
</
|
|
75
|
-
|
|
44
|
+
</SwipeListContainer>
|
|
45
|
+
{showDots ? (
|
|
46
|
+
<SwipeListControlDots
|
|
47
|
+
containerRef={containerRef}
|
|
48
|
+
activeIndex={activeIndex}
|
|
49
|
+
dotCount={itemCount}
|
|
50
|
+
/>
|
|
51
|
+
) : null}
|
|
76
52
|
</div>
|
|
77
53
|
);
|
|
78
54
|
},
|
|
@@ -1,70 +1,36 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
2
|
|
|
4
|
-
const
|
|
5
|
-
const BASE_DOT_WIDTH = 6;
|
|
6
|
-
const ACTIVE_DOT_WIDTH_CHANGE = 16;
|
|
7
|
-
const BASE_DOT_OPACITY = 0.3;
|
|
8
|
-
const ACTIVE_DOT_OPACITY_CHANGE = 0.7;
|
|
3
|
+
const dotStyle = 'cursor-pointer bg-primary-main h-2 rounded-full transition-width duration-300';
|
|
9
4
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
interface SwipeListControlDotsProps {
|
|
6
|
+
containerRef?: { current: HTMLDivElement | null };
|
|
7
|
+
activeIndex?: number;
|
|
8
|
+
dotCount?: number;
|
|
14
9
|
}
|
|
15
10
|
|
|
16
11
|
export const SwipeListControlDots = JSX<SwipeListControlDotsProps>(
|
|
17
|
-
({
|
|
18
|
-
const handleClick =
|
|
19
|
-
(idx
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
[activeIndex],
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
return showDots && children ? (
|
|
12
|
+
({ containerRef, activeIndex, dotCount = 0 }) => {
|
|
13
|
+
const handleClick = (idx: number) => {
|
|
14
|
+
if (idx !== activeIndex && containerRef?.current) {
|
|
15
|
+
containerRef.current.children[idx]?.scrollIntoView({
|
|
16
|
+
behavior: 'smooth',
|
|
17
|
+
block: 'nearest',
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
return dotCount ? (
|
|
33
23
|
<div className="flex gap-2 mx-auto mt-5 w-fit">
|
|
34
|
-
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
))
|
|
44
|
-
) : (
|
|
45
|
-
<div className={DOT_STYLES} style={createDotStyle(1)} />
|
|
46
|
-
)}
|
|
24
|
+
{new Array(dotCount).fill(null).map((_, idx: number) => (
|
|
25
|
+
<div
|
|
26
|
+
key={String(idx)}
|
|
27
|
+
className={`${dotStyle} ${idx === activeIndex ? 'w-6' : 'w-2 opacity-30'}`}
|
|
28
|
+
role="button"
|
|
29
|
+
aria-hidden
|
|
30
|
+
onClick={() => handleClick(idx)}
|
|
31
|
+
/>
|
|
32
|
+
))}
|
|
47
33
|
</div>
|
|
48
34
|
) : null;
|
|
49
35
|
},
|
|
50
36
|
);
|
|
51
|
-
|
|
52
|
-
const getDotStyles = (
|
|
53
|
-
currentIdx: number,
|
|
54
|
-
activeIndex: number,
|
|
55
|
-
indexFraction: number,
|
|
56
|
-
): Record<string, string> | undefined => {
|
|
57
|
-
if (currentIdx < activeIndex || currentIdx > activeIndex + 1) {
|
|
58
|
-
return undefined;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const leftIndexMod = 1 - indexFraction;
|
|
62
|
-
const rightIndexMod = indexFraction;
|
|
63
|
-
|
|
64
|
-
return createDotStyle(currentIdx === activeIndex ? leftIndexMod : rightIndexMod);
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
const createDotStyle = (indexModifier: number): Record<string, string> => ({
|
|
68
|
-
opacity: `${BASE_DOT_OPACITY + ACTIVE_DOT_OPACITY_CHANGE * indexModifier}`,
|
|
69
|
-
width: `${BASE_DOT_WIDTH + ACTIVE_DOT_WIDTH_CHANGE * indexModifier}px`,
|
|
70
|
-
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @title Контейнер
|
|
3
3
|
*/
|
|
4
|
-
export interface
|
|
4
|
+
export interface SwipeContainerProps {
|
|
5
5
|
/** @title Расстояние между элементами */
|
|
6
6
|
gap?: number;
|
|
7
7
|
/** @title Отступы */
|
|
@@ -11,9 +11,9 @@ export interface SwipeContainer {
|
|
|
11
11
|
/**
|
|
12
12
|
* @title Swipe-контроллер
|
|
13
13
|
*/
|
|
14
|
-
export interface SwipeListControlProps extends
|
|
14
|
+
export interface SwipeListControlProps extends SwipeContainerProps {
|
|
15
15
|
className?: string;
|
|
16
16
|
/** @title Точки-индикаторы */
|
|
17
17
|
showDots?: boolean;
|
|
18
|
-
|
|
18
|
+
onVisibleIndicesChange?: (indices: number[]) => void;
|
|
19
19
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import {
|
|
4
|
+
useIntersectionObserver,
|
|
5
|
+
type IntersectionObserverOptions,
|
|
6
|
+
} from '../../hooks/useIntersectionObserver';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @title Элемент списка
|
|
10
|
+
*/
|
|
11
|
+
interface SwipeListControlItemProps {
|
|
12
|
+
className?: string;
|
|
13
|
+
style?: Record<string, string>;
|
|
14
|
+
idx?: number;
|
|
15
|
+
activeIndex?: number;
|
|
16
|
+
observerOptions?: IntersectionObserverOptions;
|
|
17
|
+
onIntersection?: (idx: number, entry: IntersectionObserverEntry) => void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const SwipeListItem = JSX<SwipeListControlItemProps>(
|
|
21
|
+
({ className = '', style, idx, activeIndex, observerOptions, children, onIntersection }) => {
|
|
22
|
+
const observerCallback = useCallback(
|
|
23
|
+
(entries: IntersectionObserverEntry[]) => {
|
|
24
|
+
if (entries.length && onIntersection) {
|
|
25
|
+
onIntersection(idx || 0, entries[entries.length - 1]);
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
[onIntersection, idx],
|
|
29
|
+
);
|
|
30
|
+
const ref = useIntersectionObserver<HTMLDivElement>(observerCallback, observerOptions);
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<div
|
|
34
|
+
className={`inline-block snap-always box-border ${className}`}
|
|
35
|
+
style={style}
|
|
36
|
+
role="listitem"
|
|
37
|
+
aria-current={Boolean(idx === activeIndex)}
|
|
38
|
+
ref={ref}
|
|
39
|
+
>
|
|
40
|
+
{children}
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
},
|
|
44
|
+
);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const getItemWidth =
|
|
2
|
+
(container: HTMLElement) =>
|
|
3
|
+
(itemCount: number): number =>
|
|
4
|
+
container.scrollWidth / itemCount;
|
|
5
|
+
|
|
6
|
+
export const scrollBy =
|
|
7
|
+
(container: HTMLElement) =>
|
|
8
|
+
(itemCount: number, delta: -1 | 1): void => {
|
|
9
|
+
container.scrollBy({ left: delta * getItemWidth(container)(itemCount), behavior: 'smooth' });
|
|
10
|
+
};
|