@ubnt/store.core 9.61.0-new-design → 9.61.0
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/CHANGELOG.md +1 -129
- package/lib/_virtual/_virtual_multi-entry.js +10 -13
- package/lib/_virtual/_virtual_multi-entry.js.map +1 -1
- package/lib/_virtual/_virtual_multi-entry.mjs +11 -13
- package/lib/_virtual/_virtual_multi-entry.mjs.map +1 -1
- package/lib/apis/smartcat.d.ts +2 -12
- package/lib/apis/smartcat.js +4 -27
- package/lib/apis/smartcat.js.map +1 -1
- package/lib/apis/smartcat.mjs +4 -27
- package/lib/apis/smartcat.mjs.map +1 -1
- package/lib/assets/close2.svg +2 -3
- package/lib/assets/close3.svg +3 -2
- package/lib/assets/icons/menu/{icon-location-pin.svg.js → icon-globe.svg.js} +6 -6
- package/lib/assets/icons/menu/icon-globe.svg.js.map +1 -0
- package/lib/assets/icons/menu/icon-globe.svg.mjs +3 -0
- package/lib/assets/icons/menu/icon-globe.svg.mjs.map +1 -0
- package/lib/assets/logoUnifi.svg +2 -10
- package/lib/assets/pause.svg +3 -3
- package/lib/assets/pause2.svg +3 -3
- package/lib/assets/poe2.svg +2 -3
- package/lib/assets/poe3.svg +3 -2
- package/lib/assets/port.svg +2 -4
- package/lib/assets/port2.svg +4 -2
- package/lib/assets/ucgMax.jpg +0 -0
- package/lib/assets/ucgMax2.jpg +0 -0
- package/lib/assets/ucgUltra.jpg +0 -0
- package/lib/assets/ucgUltra2.jpg +0 -0
- package/lib/components/Accordion/Accordion.js +4 -4
- package/lib/components/Avatar/Avatar.js +2 -2
- package/lib/components/BackInStock/BackInStock.types.d.ts +0 -1
- package/lib/components/Button/Button.js +5 -12
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/Button/Button.mjs +1 -8
- package/lib/components/Button/Button.mjs.map +1 -1
- package/lib/components/Button/CartButton.d.ts +1 -3
- package/lib/components/Button/CartButton.js +6 -11
- package/lib/components/Button/CartButton.js.map +1 -1
- package/lib/components/Button/CartButton.mjs +4 -8
- package/lib/components/Button/CartButton.mjs.map +1 -1
- package/lib/components/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/lib/components/ButtonGroup/ButtonGroup.js +9 -16
- package/lib/components/ButtonGroup/ButtonGroup.js.map +1 -1
- package/lib/components/ButtonGroup/ButtonGroup.mjs +9 -16
- package/lib/components/ButtonGroup/ButtonGroup.mjs.map +1 -1
- package/lib/components/ButtonGroup/ButtonGroup.styles.d.ts +6 -10
- package/lib/components/ButtonGroup/ButtonGroup.styles.js +20 -60
- package/lib/components/ButtonGroup/ButtonGroup.styles.js.map +1 -1
- package/lib/components/ButtonGroup/ButtonGroup.styles.mjs +20 -60
- package/lib/components/ButtonGroup/ButtonGroup.styles.mjs.map +1 -1
- package/lib/components/ButtonGroup/ButtonGroup.types.d.ts +0 -5
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.d.ts +1 -1
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.js +4 -16
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.js.map +1 -1
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.mjs +5 -17
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.mjs.map +1 -1
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.styles.d.ts +1 -5
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.styles.js +17 -82
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.styles.js.map +1 -1
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.styles.mjs +17 -82
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.styles.mjs.map +1 -1
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.types.d.ts +0 -4
- package/lib/components/CardSection/Card/Card.js +6 -6
- package/lib/components/CardSection/CardSection.js +2 -2
- package/lib/components/CardSection/CardSection.styles.d.ts +1 -1
- package/lib/components/CartIcon/CartIcon.js +2 -2
- package/lib/components/CategoryTabs/CategoryTabs.styles.d.ts +2 -4
- package/lib/components/CategoryTabs/CategoryTabs.styles.js +5 -8
- package/lib/components/CategoryTabs/CategoryTabs.styles.js.map +1 -1
- package/lib/components/CategoryTabs/CategoryTabs.styles.mjs +6 -7
- package/lib/components/CategoryTabs/CategoryTabs.styles.mjs.map +1 -1
- package/lib/components/Checkbox/Checkbox.js +4 -4
- package/lib/components/CloserLookSection/CloserLookSection.js +11 -11
- package/lib/components/CloserLookSection/RecommendedAddons/RecommendedAddons.js +5 -5
- package/lib/components/Compare/Compare.styles.d.ts +5 -5
- package/lib/components/Container/Container.d.ts +1 -1
- package/lib/components/Container/Container.js +4 -5
- package/lib/components/Container/Container.js.map +1 -1
- package/lib/components/Container/Container.mjs +4 -5
- package/lib/components/Container/Container.mjs.map +1 -1
- package/lib/components/Container/index.stories.d.ts +5 -5
- package/lib/components/CustomImage/CustomImage.js +12 -12
- package/lib/components/Explore/Explore.js +5 -5
- package/lib/components/Explore/ExploreData.js +12 -12
- package/lib/components/Explore/ExploreData.js.map +1 -1
- package/lib/components/Explore/ExploreData.mjs +12 -12
- package/lib/components/Explore/ExploreData.mjs.map +1 -1
- package/lib/components/FeaturesSection_deprecated/Features/Features.js +2 -2
- package/lib/components/FeaturesSection_deprecated/FeaturesSection.js +23 -23
- package/lib/components/FeaturesSection_deprecated/FeaturesSection.mjs +1 -1
- package/lib/components/FeaturesSection_deprecated/assets/close.svg.js +1 -1
- package/lib/components/FeaturesSection_deprecated/assets/close.svg.mjs +2 -2
- package/lib/components/Footer/Footer.js +2 -2
- package/lib/components/Footer/hooks/useFooterContent.js +5 -5
- package/lib/components/Gallery/Gallery.context.js +17 -17
- package/lib/components/Gallery/Gallery.js +9 -9
- package/lib/components/Gallery/GalleryControls/GalleryControls.js +4 -4
- package/lib/components/Gallery/GalleryItem/GalleryItem.js +8 -8
- package/lib/components/Gallery/GalleryThumbnails/GalleryThumbnails.js +8 -8
- package/lib/components/GridGallery/GridGallery.js +8 -8
- package/lib/components/GridGallery/GridModal/GridModal.js +6 -6
- package/lib/components/Header/AccountFrame/AccountFrame.js +11 -11
- package/lib/components/Header/AccountFrame/Mobile/Mobile.js +4 -4
- package/lib/components/Header/AccountMenu/AccountMenu.js +20 -30
- package/lib/components/Header/AccountMenu/AccountMenu.js.map +1 -1
- package/lib/components/Header/AccountMenu/AccountMenu.mjs +3 -13
- package/lib/components/Header/AccountMenu/AccountMenu.mjs.map +1 -1
- package/lib/components/Header/CartModal/Empty/Empty.js +3 -3
- package/lib/components/Header/CartModalV2/CartModal.js +5 -5
- package/lib/components/Header/CartModalV2/Item/Item.js +4 -4
- package/lib/components/Header/CartModalV2/Item/Item.styles.d.ts +1 -1
- package/lib/components/Header/Header.js +43 -43
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/Header/Header.mjs +9 -9
- package/lib/components/Header/Header.mjs.map +1 -1
- package/lib/components/Header/Header.styles.d.ts +12 -7
- package/lib/components/Header/Header.styles.js +32 -10
- package/lib/components/Header/Header.styles.js.map +1 -1
- package/lib/components/Header/Header.styles.mjs +31 -10
- package/lib/components/Header/Header.styles.mjs.map +1 -1
- package/lib/components/Header/Header.types.d.ts +5 -29
- package/lib/components/Header/Header.types.js +1 -2
- package/lib/components/Header/Header.types.js.map +1 -1
- package/lib/components/Header/Header.types.mjs +1 -2
- package/lib/components/Header/Header.types.mjs.map +1 -1
- package/lib/components/Header/IsolatedHeader.d.ts +0 -1
- package/lib/components/Header/IsolatedHeader.js +50 -50
- package/lib/components/Header/IsolatedHeader.js.map +1 -1
- package/lib/components/Header/IsolatedHeader.mjs +46 -47
- package/lib/components/Header/IsolatedHeader.mjs.map +1 -1
- package/lib/components/Header/LanguageFrame/LanguageFrame.js +6 -6
- package/lib/components/Header/MenuItem/MenuItem.styles.d.ts +1 -1
- package/lib/components/Header/MenuItem/MenuItem.styles.js +3 -3
- package/lib/components/Header/MenuItem/MenuItem.styles.js.map +1 -1
- package/lib/components/Header/MenuItem/MenuItem.styles.mjs +3 -3
- package/lib/components/Header/MenuItem/MenuItem.styles.mjs.map +1 -1
- package/lib/components/Header/MenuItem/MenuItem.types.d.ts +0 -1
- package/lib/components/Header/Navigation/Carousel/Carousel.js +5 -5
- package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.js +12 -12
- package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.styles.d.ts +1 -1
- package/lib/components/Header/Navigation/MobileMenu/MobileMenu.js +6 -6
- package/lib/components/Header/Navigation/MobileMenu/MobileMenu.styles.d.ts +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.d.ts +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.js +109 -116
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.js.map +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.mjs +104 -111
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.mjs.map +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.d.ts +0 -9
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.js +1 -15
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.js.map +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.mjs +2 -13
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.mjs.map +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.types.d.ts +6 -12
- package/lib/components/Header/Overlay/Overlay.js +3 -3
- package/lib/components/Header/ProHeader/ProHeader.d.ts +5 -9
- package/lib/components/Header/ProHeader/ProHeader.js +189 -270
- package/lib/components/Header/ProHeader/ProHeader.js.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.mjs +171 -251
- package/lib/components/Header/ProHeader/ProHeader.mjs.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.styles.d.ts +25 -30
- package/lib/components/Header/ProHeader/ProHeader.styles.js +66 -119
- package/lib/components/Header/ProHeader/ProHeader.styles.js.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.styles.mjs +65 -112
- package/lib/components/Header/ProHeader/ProHeader.styles.mjs.map +1 -1
- package/lib/components/Header/translations/ar.json.js +1 -4
- package/lib/components/Header/translations/ar.json.js.map +1 -1
- package/lib/components/Header/translations/ar.json.mjs +2 -4
- package/lib/components/Header/translations/ar.json.mjs.map +1 -1
- package/lib/components/Header/translations/de.json.js +1 -4
- package/lib/components/Header/translations/de.json.js.map +1 -1
- package/lib/components/Header/translations/de.json.mjs +2 -4
- package/lib/components/Header/translations/de.json.mjs.map +1 -1
- package/lib/components/Header/translations/el.json.js +1 -4
- package/lib/components/Header/translations/el.json.js.map +1 -1
- package/lib/components/Header/translations/el.json.mjs +2 -4
- package/lib/components/Header/translations/el.json.mjs.map +1 -1
- package/lib/components/Header/translations/en.json.js +1 -7
- package/lib/components/Header/translations/en.json.js.map +1 -1
- package/lib/components/Header/translations/en.json.mjs +2 -6
- package/lib/components/Header/translations/en.json.mjs.map +1 -1
- package/lib/components/Header/translations/es.json.js +1 -4
- package/lib/components/Header/translations/es.json.js.map +1 -1
- package/lib/components/Header/translations/es.json.mjs +2 -4
- package/lib/components/Header/translations/es.json.mjs.map +1 -1
- package/lib/components/Header/translations/fr.json.js +1 -4
- package/lib/components/Header/translations/fr.json.js.map +1 -1
- package/lib/components/Header/translations/fr.json.mjs +2 -4
- package/lib/components/Header/translations/fr.json.mjs.map +1 -1
- package/lib/components/Header/translations/it.json.js +1 -4
- package/lib/components/Header/translations/it.json.js.map +1 -1
- package/lib/components/Header/translations/it.json.mjs +2 -4
- package/lib/components/Header/translations/it.json.mjs.map +1 -1
- package/lib/components/Header/translations/ja.json.js +1 -4
- package/lib/components/Header/translations/ja.json.js.map +1 -1
- package/lib/components/Header/translations/ja.json.mjs +2 -4
- package/lib/components/Header/translations/ja.json.mjs.map +1 -1
- package/lib/components/Header/translations/pt-BR.json.js +1 -4
- package/lib/components/Header/translations/pt-BR.json.js.map +1 -1
- package/lib/components/Header/translations/pt-BR.json.mjs +2 -4
- package/lib/components/Header/translations/pt-BR.json.mjs.map +1 -1
- package/lib/components/Header/translations/zh-Hans.json.js +1 -4
- package/lib/components/Header/translations/zh-Hans.json.js.map +1 -1
- package/lib/components/Header/translations/zh-Hans.json.mjs +2 -4
- package/lib/components/Header/translations/zh-Hans.json.mjs.map +1 -1
- package/lib/components/Header/translations/zh-Hant-TW.json.js +1 -4
- package/lib/components/Header/translations/zh-Hant-TW.json.js.map +1 -1
- package/lib/components/Header/translations/zh-Hant-TW.json.mjs +2 -4
- package/lib/components/Header/translations/zh-Hant-TW.json.mjs.map +1 -1
- package/lib/components/Hero/Hero.js +5 -5
- package/lib/components/Hero/Hero.styles.d.ts +2 -2
- package/lib/components/HeroFadeGallery/HeroFadeGallery.styles.d.ts +1 -1
- package/lib/components/HeroVideo/HeroVideo.js +5 -5
- package/lib/components/HowToUseSection/HowToUseSection.styles.d.ts +2 -2
- package/lib/components/ImageCarousel/ImageCarousel.js +30 -30
- package/lib/components/ImageSequence/ImageSequence.js +8 -8
- package/lib/components/LandingPage/Cards/Card/Card.js +4 -4
- package/lib/components/LandingPage/Cards/Cards.js +10 -10
- package/lib/components/LandingPage/LandingPage.js +2 -2
- package/lib/components/LandingPagePro/LandingPagePro.js +13 -13
- package/lib/components/LandingPagePro/LandingPagePro.styles.d.ts +1 -1
- package/lib/components/LandingPageSearch/LandingPageSearch.js +2 -2
- package/lib/components/LandingPageSearch/Modal/Modal.js +9 -9
- package/lib/components/LandingPageSidebar/LandingPageSidebar.js +12 -12
- package/lib/components/LayoutRenderer/LayoutRenderer.js +8 -8
- package/lib/components/LayoutRenderer/LayoutRenderer.styles.d.ts +1 -1
- package/lib/components/LayoutRendererV1/LayoutRenderer.styles.d.ts +3 -3
- package/lib/components/LayoutRendererV2/LayoutRenderer.styles.d.ts +3 -3
- package/lib/components/LoaderDots/LoaderDots.d.ts +1 -1
- package/lib/components/LoaderDots/LoaderDots.js +1 -3
- package/lib/components/LoaderDots/LoaderDots.js.map +1 -1
- package/lib/components/LoaderDots/LoaderDots.mjs +1 -3
- package/lib/components/LoaderDots/LoaderDots.mjs.map +1 -1
- package/lib/components/LoaderDots/LoaderDots.styles.d.ts +1 -2
- package/lib/components/LoaderDots/LoaderDots.styles.js +1 -11
- package/lib/components/LoaderDots/LoaderDots.styles.js.map +1 -1
- package/lib/components/LoaderDots/LoaderDots.styles.mjs +1 -11
- package/lib/components/LoaderDots/LoaderDots.styles.mjs.map +1 -1
- package/lib/components/LoaderDots/LoaderDots.types.d.ts +0 -2
- package/lib/components/MeetUniFiVideoPlayer/EpisodeCard/EpisodeCard.js +7 -7
- package/lib/components/MeetUniFiVideoPlayer/MeetUniFiVideoPlayer.js +18 -18
- package/lib/components/MeetUniFiVideoPlayer/MeetUniFiVideoPlayer.styles.d.ts +1 -1
- package/lib/components/MicrositeColumnFeatureProgressBar/MicrositeColumnFeatureProgressBar.js +2 -2
- package/lib/components/MicrositeFeatureChecklist/MicrositeFeatureChecklist.js +3 -3
- package/lib/components/MicrositeFeatureProgressBar/MicrositeFeatureProgressBar.js +3 -3
- package/lib/components/MicrositeHero/MicrositeHero.js +18 -18
- package/lib/components/MicrositeIntroductionBlock/MicrositeIntroductionBlock.js +4 -4
- package/lib/components/MicrositeMediaGrid/MicrositeMediaGrid.js +9 -9
- package/lib/components/MicrositeProductGrid/MicrositeProductGrid.js +8 -8
- package/lib/components/MicrositeProductLearnMoreBlock/MicrositeProductLearnMoreBlockWrap.js +2 -2
- package/lib/components/MicrositeSectionWrap/MicrositeSectionWrap.styles.d.ts +1 -1
- package/lib/components/MicrositeSubSubNavigation/MicrositeSubSubNavigation.js +3 -3
- package/lib/components/MicrositeVideoSlideshow/MicrositeVideoSlideshow.js +13 -13
- package/lib/components/MicrositeVideoSlideshow/MicrositeVideoSlideshow.mjs +1 -1
- package/lib/components/MicrositeVideoSlideshow/assets/pause.svg.js +1 -1
- package/lib/components/MicrositeVideoSlideshow/assets/pause.svg.mjs +2 -2
- package/lib/components/Microsites/MicrositePageContext.js +2 -2
- package/lib/components/Microsites/MicrositeProductPage.js +3 -3
- package/lib/components/Microsites/context/MicrositeProductPageContext.js +3 -3
- package/lib/components/MobileModal/MobileModal.js +4 -4
- package/lib/components/Modal/Modal.js +3 -3
- package/lib/components/ModelCompareV3/ModelCompareOverflowScrollButton.js +3 -3
- package/lib/components/ModelCompareV3/ModelComparePropertyValueGridItem.js +2 -2
- package/lib/components/ModelCompareV3/ModelCompareV3.js +14 -14
- package/lib/components/ModelCompareV3/ProductGroupsGrid.js +3 -3
- package/lib/components/ModelCompareV3/ScrollGroup/ScrollGroup.js +5 -5
- package/lib/components/ModelCompareV3/ScrollGroup/context.js +3 -3
- package/lib/components/ModelCompareV3/ScrollGroup/useScrollGroupItem.js +8 -8
- package/lib/components/ModelCompareV3/ScrollGroup/useScrollGroupSetScroll.js +2 -2
- package/lib/components/ModelCompareV3/ScrollGroup/useScrollGroupTo.js +2 -2
- package/lib/components/ModelCompareV3/StickyGrid/StickyGrid.js +7 -7
- package/lib/components/ModelCompareV3/StickyGrid/StickyGridBody.js +2 -2
- package/lib/components/ModelCompareV3/StickyGrid/StickyGridHeader.js +5 -5
- package/lib/components/ModelCompareV3/StickyGrid/StickyGridItem.js +2 -2
- package/lib/components/ModelCompareV3/StickyGrid/context.js +3 -3
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgMax.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgMax.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgUltra.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/ucgUltra.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/ucgMax.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/ucgMax.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/ucgUltra.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/ucgUltra.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/poe.svg.js +1 -1
- package/lib/components/ModelCompareV3/assets/poe.svg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/port.svg.js +1 -1
- package/lib/components/ModelCompareV3/assets/port.svg.mjs +2 -2
- package/lib/components/ModelCompareV3/data/CloudGateways.js +6 -6
- package/lib/components/ModelCompareV3/data/CloudGateways.mjs +4 -4
- package/lib/components/ModelCompareV3/data/products/cloudKeyEnterprise.js +2 -4
- package/lib/components/ModelCompareV3/data/products/cloudKeyEnterprise.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/cloudKeyEnterprise.mjs +2 -4
- package/lib/components/ModelCompareV3/data/products/cloudKeyEnterprise.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/cloudKeyG2Plus.js +2 -2
- package/lib/components/ModelCompareV3/data/products/cloudKeyG2Plus.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/cloudKeyG2Plus.mjs +2 -2
- package/lib/components/ModelCompareV3/data/products/cloudKeyG2Plus.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/express.js +3 -3
- package/lib/components/ModelCompareV3/data/products/express.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/express.mjs +3 -3
- package/lib/components/ModelCompareV3/data/products/express.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/gatewayEnterprise.js +2 -4
- package/lib/components/ModelCompareV3/data/products/gatewayEnterprise.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/gatewayEnterprise.mjs +2 -4
- package/lib/components/ModelCompareV3/data/products/gatewayEnterprise.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/gatewayLite.js +2 -4
- package/lib/components/ModelCompareV3/data/products/gatewayLite.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/gatewayLite.mjs +2 -4
- package/lib/components/ModelCompareV3/data/products/gatewayLite.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/gatewayMax.js +2 -4
- package/lib/components/ModelCompareV3/data/products/gatewayMax.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/gatewayMax.mjs +2 -4
- package/lib/components/ModelCompareV3/data/products/gatewayMax.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/gatewayProfessional.js +2 -4
- package/lib/components/ModelCompareV3/data/products/gatewayProfessional.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/gatewayProfessional.mjs +2 -4
- package/lib/components/ModelCompareV3/data/products/gatewayProfessional.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/officialUniFiHosting.js +1 -3
- package/lib/components/ModelCompareV3/data/products/officialUniFiHosting.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/officialUniFiHosting.mjs +1 -3
- package/lib/components/ModelCompareV3/data/products/officialUniFiHosting.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/ucgMax.js +2 -2
- package/lib/components/ModelCompareV3/data/products/ucgMax.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/ucgMax.mjs +2 -2
- package/lib/components/ModelCompareV3/data/products/ucgMax.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/ucgUltra.js +4 -4
- package/lib/components/ModelCompareV3/data/products/ucgUltra.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/ucgUltra.mjs +4 -4
- package/lib/components/ModelCompareV3/data/products/ucgUltra.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udmPro.js +3 -3
- package/lib/components/ModelCompareV3/data/products/udmPro.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udmPro.mjs +3 -3
- package/lib/components/ModelCompareV3/data/products/udmPro.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProMax.js +3 -3
- package/lib/components/ModelCompareV3/data/products/udmProMax.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProMax.mjs +3 -3
- package/lib/components/ModelCompareV3/data/products/udmProMax.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProSpecial.js +3 -3
- package/lib/components/ModelCompareV3/data/products/udmProSpecial.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProSpecial.mjs +3 -3
- package/lib/components/ModelCompareV3/data/products/udmProSpecial.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udr.js +41 -5
- package/lib/components/ModelCompareV3/data/products/udr.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udr.mjs +21 -5
- package/lib/components/ModelCompareV3/data/products/udr.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udw.js +3 -3
- package/lib/components/ModelCompareV3/data/products/udw.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udw.mjs +3 -3
- package/lib/components/ModelCompareV3/data/products/udw.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/properties/powerMethodPoe.js +1 -1
- package/lib/components/ModelCompareV3/data/properties/powerMethodPoe.mjs +1 -1
- package/lib/components/ModelCompareV3/data/properties/readerPowerMethod.js +1 -1
- package/lib/components/ModelCompareV3/data/properties/readerPowerMethod.mjs +1 -1
- package/lib/components/ModelCompareV3/data/properties/redundantRj45Port.js +1 -1
- package/lib/components/ModelCompareV3/data/properties/redundantRj45Port.mjs +1 -1
- package/lib/components/Pagination/Pagination.js +3 -3
- package/lib/components/PriceRangeSlider/PriceRangeSlider.js +16 -16
- package/lib/components/ProductCard/ProductCard.js +7 -7
- package/lib/components/ProductCardPopup/ProductCardPopup.js +8 -8
- package/lib/components/ProductCompare/ProductCompare.js +7 -7
- package/lib/components/ProductDetails/ProductDetails.js +5 -5
- package/lib/components/ProductGrid/ProductGrid.js +10 -10
- package/lib/components/ProductKeyFeatures/ProductKeyFeatures.js +3 -3
- package/lib/components/ProductSectionNavigation/ProductSectionNavigation.styles.d.ts +1 -1
- package/lib/components/ProductSectionNavigationV2/ProductSectionNavigation.styles.d.ts +1 -1
- package/lib/components/ProductSectionTabs/ProductSectionTabs.js +2 -2
- package/lib/components/ProductTechSpecs/ProductTechSpecs.styles.d.ts +2 -2
- package/lib/components/ProductWizard/Options/Options.js +3 -3
- package/lib/components/ProductWizard/ProductWizard.js +2 -2
- package/lib/components/ProductWizardFootnotes/ProductWizardFootnotes.js +5 -5
- package/lib/components/ProgressCircle/ProgressCircle.js +4 -4
- package/lib/components/QuantityControls/QuantityControls.js +6 -6
- package/lib/components/QuantityControls/QuantityControls.js.map +1 -1
- package/lib/components/QuantityControls/QuantityControls.mjs +2 -2
- package/lib/components/QuantityControls/QuantityControls.mjs.map +1 -1
- package/lib/components/QuantityControls/QuantityControls.types.d.ts +1 -1
- package/lib/components/QuantityInput/QuantityInput.js +1 -6
- package/lib/components/QuantityInput/QuantityInput.js.map +1 -1
- package/lib/components/QuantityInput/QuantityInput.mjs +1 -6
- package/lib/components/QuantityInput/QuantityInput.mjs.map +1 -1
- package/lib/components/RelatedProducts/RelatedProducts.js +5 -5
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.js +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.js +36 -36
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.js +12 -12
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js +5 -5
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CheckboxSection.js +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.js +4 -4
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/SliderSection.js +3 -3
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.js +7 -7
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.js +6 -6
- package/lib/components/ResourceCalculatorV1/PoeCalculator/PoeCalculator.js +9 -9
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerConfigurator.js +10 -10
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.js +15 -15
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/RecommendedPoeSwitches/RecommendedPoeSwitches.js +4 -4
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/RecommendedPoeSwitches/RecommendedPoeSwitches.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/RecommendedPoeSwitches/assets/poe.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/RecommendedPoeSwitches/assets/poe.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/RecommendedPoeSwitches/assets/port.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/RecommendedPoeSwitches/assets/port.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ResourceCalculator.js +6 -6
- package/lib/components/ResourceCalculatorV1/translations/en.json.js +1 -1
- package/lib/components/ResourceCalculatorV1/translations/en.json.mjs +1 -1
- package/lib/components/ReverseLoopingVideo/ReverseLoopingVideo.js +5 -5
- package/lib/components/ScrollWrapper/ScrollWrapper.d.ts +1 -1
- package/lib/components/ScrollWrapper/ScrollWrapper.js +26 -34
- package/lib/components/ScrollWrapper/ScrollWrapper.js.map +1 -1
- package/lib/components/ScrollWrapper/ScrollWrapper.mjs +8 -16
- package/lib/components/ScrollWrapper/ScrollWrapper.mjs.map +1 -1
- package/lib/components/ScrollWrapper/ScrollWrapper.types.d.ts +0 -2
- package/lib/components/Search/Input/Input.d.ts +1 -1
- package/lib/components/Search/Input/Input.js +8 -8
- package/lib/components/Search/Input/Input.js.map +1 -1
- package/lib/components/Search/Input/Input.mjs +4 -4
- package/lib/components/Search/Input/Input.mjs.map +1 -1
- package/lib/components/Search/Input/Input.styles.js +1 -0
- package/lib/components/Search/Input/Input.styles.js.map +1 -1
- package/lib/components/Search/Input/Input.styles.mjs +1 -0
- package/lib/components/Search/Input/Input.styles.mjs.map +1 -1
- package/lib/components/Search/Input/Input.types.d.ts +2 -3
- package/lib/components/Search/Modal/Modal.js +3 -3
- package/lib/components/StorageSliders/Slider/Slider.js +3 -3
- package/lib/components/StorageSliders/StorageSliders.context.js +20 -20
- package/lib/components/StorageSliders/StorageSliders.js +4 -4
- package/lib/components/Tooltip/Tooltip.js +5 -5
- package/lib/components/VariantSelector/Variant/Compatibility/Compatibility.js +7 -7
- package/lib/components/VariantSelector/Variant/Variant.js +40 -40
- package/lib/components/VariantSelector/VariantSelector.js +16 -16
- package/lib/components/VideoPlayerNew/VideoPlayer.js +21 -21
- package/lib/components/VideoPlayerNew/VideoPlayer.mjs +2 -2
- package/lib/components/VideoPlayerNew/assets/close.svg.js +1 -1
- package/lib/components/VideoPlayerNew/assets/close.svg.mjs +2 -2
- package/lib/components/VideoPlayerNew/assets/pause.svg.js +1 -1
- package/lib/components/VideoPlayerNew/assets/pause.svg.mjs +2 -2
- package/lib/components/index.d.ts +0 -1
- package/lib/components/index.js +0 -2
- package/lib/components/index.js.map +1 -1
- package/lib/components/index.mjs +0 -2
- package/lib/components/index.mjs.map +1 -1
- package/lib/constants/proStoreCategories/mapping/filters.d.ts +0 -17
- package/lib/constants/proStoreCategories/mapping/filters.js +0 -17
- package/lib/constants/proStoreCategories/mapping/filters.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/filters.mjs +0 -17
- package/lib/constants/proStoreCategories/mapping/filters.mjs.map +1 -1
- package/lib/constants/proStoreCategories/mapping/index.d.ts +2 -4
- package/lib/constants/proStoreCategories/mapping/index.js +51 -50
- package/lib/constants/proStoreCategories/mapping/index.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/index.mjs +49 -49
- package/lib/constants/proStoreCategories/mapping/index.mjs.map +1 -1
- package/lib/constants/proStoreCategories/mapping/mapping.d.ts +0 -5
- package/lib/constants/proStoreCategories/mapping/redirects.js +3 -18
- package/lib/constants/proStoreCategories/mapping/redirects.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/redirects.mjs +3 -18
- package/lib/constants/proStoreCategories/mapping/redirects.mjs.map +1 -1
- package/lib/constants/proStoreCategories/mapping/unifi.d.ts +9 -9
- package/lib/constants/proStoreCategories/mapping/unifi.js +9 -9
- package/lib/constants/proStoreCategories/mapping/unifi.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/unifi.mjs +9 -9
- package/lib/constants/proStoreCategories/mapping/unifi.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/ar.json.js +3 -7
- package/lib/constants/proStoreCategories/translations/ar.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/ar.json.mjs +4 -7
- package/lib/constants/proStoreCategories/translations/ar.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/de.json.js +3 -7
- package/lib/constants/proStoreCategories/translations/de.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/de.json.mjs +4 -7
- package/lib/constants/proStoreCategories/translations/de.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/el.json.js +3 -7
- package/lib/constants/proStoreCategories/translations/el.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/el.json.mjs +4 -7
- package/lib/constants/proStoreCategories/translations/el.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/en.json.js +3 -7
- package/lib/constants/proStoreCategories/translations/en.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/en.json.mjs +4 -7
- package/lib/constants/proStoreCategories/translations/en.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/es.json.js +3 -7
- package/lib/constants/proStoreCategories/translations/es.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/es.json.mjs +4 -7
- package/lib/constants/proStoreCategories/translations/es.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/fr.json.js +3 -7
- package/lib/constants/proStoreCategories/translations/fr.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/fr.json.mjs +4 -7
- package/lib/constants/proStoreCategories/translations/fr.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/it.json.js +3 -7
- package/lib/constants/proStoreCategories/translations/it.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/it.json.mjs +4 -7
- package/lib/constants/proStoreCategories/translations/it.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/ja.json.js +3 -7
- package/lib/constants/proStoreCategories/translations/ja.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/ja.json.mjs +4 -7
- package/lib/constants/proStoreCategories/translations/ja.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/pt-BR.json.js +3 -7
- package/lib/constants/proStoreCategories/translations/pt-BR.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/pt-BR.json.mjs +4 -7
- package/lib/constants/proStoreCategories/translations/pt-BR.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hans.json.js +3 -7
- package/lib/constants/proStoreCategories/translations/zh-Hans.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hans.json.mjs +4 -7
- package/lib/constants/proStoreCategories/translations/zh-Hans.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.js +3 -7
- package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.mjs +4 -7
- package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.mjs.map +1 -1
- package/lib/constants/proStoreFilters/mapping.d.ts +3 -55
- package/lib/constants/proStoreFilters/mapping.js +10 -140
- package/lib/constants/proStoreFilters/mapping.js.map +1 -1
- package/lib/constants/proStoreFilters/mapping.mjs +10 -140
- package/lib/constants/proStoreFilters/mapping.mjs.map +1 -1
- package/lib/constants/theme.js +0 -4
- package/lib/constants/theme.js.map +1 -1
- package/lib/constants/theme.mjs +0 -4
- package/lib/constants/theme.mjs.map +1 -1
- package/lib/contexts/MenuContext/context.js +34 -34
- package/lib/contexts/MenuContext/context.js.map +1 -1
- package/lib/contexts/MenuContext/context.mjs +1 -1
- package/lib/contexts/MenuContext/context.mjs.map +1 -1
- package/lib/contexts/MenuContext/mapping.js.map +1 -1
- package/lib/contexts/MenuContext/mapping.mjs.map +1 -1
- package/lib/helpers/index.js +0 -1
- package/lib/helpers/index.js.map +1 -1
- package/lib/helpers/index.mjs +1 -1
- package/lib/helpers/proStoreCategories.js +2 -2
- package/lib/helpers/ux.d.ts +0 -8
- package/lib/helpers/ux.js +0 -15
- package/lib/helpers/ux.js.map +1 -1
- package/lib/helpers/ux.mjs +1 -15
- package/lib/helpers/ux.mjs.map +1 -1
- package/lib/hooks/useHasTouch.js +3 -3
- package/lib/hooks/useHddRetentionCalculator.js +5 -5
- package/lib/hooks/useHorizontalScroll.js +2 -2
- package/lib/hooks/useLockBodyScrollCustom.js +3 -3
- package/lib/hooks/useScrollToY.js +2 -2
- package/lib/hooks/useTestMediaElementVolumeSetter.js +3 -3
- package/lib/hooks/useTranslation.js +6 -6
- package/lib/utils/nextjs/ssr/registry.js +2 -2
- package/package.json +1 -1
- package/lib/assets/cart-secondary.svg +0 -5
- package/lib/assets/icon-location-pin.svg +0 -5
- package/lib/assets/icons/cart-secondary.svg.js +0 -27
- package/lib/assets/icons/cart-secondary.svg.js.map +0 -1
- package/lib/assets/icons/cart-secondary.svg.mjs +0 -3
- package/lib/assets/icons/cart-secondary.svg.mjs.map +0 -1
- package/lib/assets/icons/menu/icon-location-pin.svg.js.map +0 -1
- package/lib/assets/icons/menu/icon-location-pin.svg.mjs +0 -3
- package/lib/assets/icons/menu/icon-location-pin.svg.mjs.map +0 -1
- package/lib/components/ButtonGroupBasic/index.stories.d.ts +0 -6
- package/lib/components/Header/Header.stories.d.ts +0 -111
- package/lib/components/Header/LogoIcon/LogoIcon.d.ts +0 -7
- package/lib/components/Header/LogoIcon/LogoIcon.js +0 -46
- package/lib/components/Header/LogoIcon/LogoIcon.js.map +0 -1
- package/lib/components/Header/LogoIcon/LogoIcon.mjs +0 -36
- package/lib/components/Header/LogoIcon/LogoIcon.mjs.map +0 -1
- package/lib/components/Header/LogoIcon/index.d.ts +0 -1
- package/lib/components/Header/LogoIcon/index.js +0 -6
- package/lib/components/Header/LogoIcon/index.js.map +0 -1
- package/lib/components/Header/LogoIcon/index.mjs +0 -3
- package/lib/components/Header/LogoIcon/index.mjs.map +0 -1
- package/lib/components/ProductTechSpecsV2/ProductTechSpecs.d.ts +0 -2
- package/lib/components/ProductTechSpecsV2/ProductTechSpecs.js +0 -79
- package/lib/components/ProductTechSpecsV2/ProductTechSpecs.js.map +0 -1
- package/lib/components/ProductTechSpecsV2/ProductTechSpecs.mjs +0 -71
- package/lib/components/ProductTechSpecsV2/ProductTechSpecs.mjs.map +0 -1
- package/lib/components/ProductTechSpecsV2/ProductTechSpecs.stories.d.ts +0 -5
- package/lib/components/ProductTechSpecsV2/ProductTechSpecs.styles.d.ts +0 -11
- package/lib/components/ProductTechSpecsV2/ProductTechSpecs.styles.js +0 -86
- package/lib/components/ProductTechSpecsV2/ProductTechSpecs.styles.js.map +0 -1
- package/lib/components/ProductTechSpecsV2/ProductTechSpecs.styles.mjs +0 -72
- package/lib/components/ProductTechSpecsV2/ProductTechSpecs.styles.mjs.map +0 -1
- package/lib/components/ProductTechSpecsV2/ProductTechSpecs.types.d.ts +0 -12
- package/lib/components/ProductTechSpecsV2/index.d.ts +0 -1
- package/lib/components/ProductTechSpecsV2/index.js +0 -6
- package/lib/components/ProductTechSpecsV2/index.js.map +0 -1
- package/lib/components/ProductTechSpecsV2/index.mjs +0 -3
- package/lib/components/ProductTechSpecsV2/index.mjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var
|
|
4
|
+
var react = require('react');
|
|
5
5
|
var reactUse = require('react-use');
|
|
6
6
|
require('../../assets/icons/arrowRight.svg.js');
|
|
7
7
|
var useHorizontalScroll = require('../../hooks/useHorizontalScroll.js');
|
|
@@ -36,26 +36,24 @@ const ScrollWrapper = function ScrollWrapper2({
|
|
|
36
36
|
onScrollChange,
|
|
37
37
|
enableWheelScroll,
|
|
38
38
|
arrowIcon,
|
|
39
|
-
draggable
|
|
40
|
-
alignActive = "center",
|
|
41
|
-
disableScrollToActive
|
|
39
|
+
draggable
|
|
42
40
|
}) {
|
|
43
|
-
const containerRef =
|
|
41
|
+
const containerRef = react.useRef(null);
|
|
44
42
|
const [containerMeasureRef, containerSize] = reactUse.useMeasure();
|
|
45
43
|
useHorizontalScroll.useHorizontalScroll(containerRef, !!enableWheelScroll);
|
|
46
|
-
|
|
44
|
+
react.useEffect(() => {
|
|
47
45
|
if (containerRef.current) {
|
|
48
46
|
containerMeasureRef(containerRef.current);
|
|
49
47
|
}
|
|
50
48
|
}, [containerMeasureRef]);
|
|
51
|
-
const getContainerItemWidth =
|
|
49
|
+
const getContainerItemWidth = react.useCallback(() => {
|
|
52
50
|
const containerItem = containerRef.current?.querySelector(`.${SCROLL_CONTAINER_ITEM_CLASS_NAME}`);
|
|
53
51
|
if (!containerItem) {
|
|
54
52
|
return 0;
|
|
55
53
|
}
|
|
56
54
|
return containerItem.getBoundingClientRect().width;
|
|
57
55
|
}, []);
|
|
58
|
-
const getInvisibleItemOffset =
|
|
56
|
+
const getInvisibleItemOffset = react.useCallback(({
|
|
59
57
|
scrollDirection
|
|
60
58
|
}) => {
|
|
61
59
|
if (!containerRef.current) {
|
|
@@ -113,7 +111,7 @@ const ScrollWrapper = function ScrollWrapper2({
|
|
|
113
111
|
}
|
|
114
112
|
return 0;
|
|
115
113
|
}, [direction]);
|
|
116
|
-
const getVisibleItemsWidth =
|
|
114
|
+
const getVisibleItemsWidth = react.useCallback(() => {
|
|
117
115
|
if (!containerRef.current) {
|
|
118
116
|
return 0;
|
|
119
117
|
}
|
|
@@ -131,7 +129,7 @@ const ScrollWrapper = function ScrollWrapper2({
|
|
|
131
129
|
});
|
|
132
130
|
return visibleItemsWidth;
|
|
133
131
|
}, [direction, gap]);
|
|
134
|
-
const getActiveIndexOffset =
|
|
132
|
+
const getActiveIndexOffset = react.useCallback(index => {
|
|
135
133
|
const offset = {
|
|
136
134
|
left: void 0,
|
|
137
135
|
top: void 0
|
|
@@ -144,16 +142,10 @@ const ScrollWrapper = function ScrollWrapper2({
|
|
|
144
142
|
if (actNav) {
|
|
145
143
|
const actNavRect = actNav.getBoundingClientRect();
|
|
146
144
|
if (direction === "horizontal") {
|
|
147
|
-
if (
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
} else {
|
|
152
|
-
if (actNavRect.right > containerRect.right) {
|
|
153
|
-
offset.left = actNavRect.right - containerRect.right + containerRef.current.scrollLeft + (!hideArrows ? ScrollWrapper_styles.FADE_BUTTON_SIZE : 0) + containerRect.width / 2 - actNavRect.width / 2;
|
|
154
|
-
} else if (actNavRect.left < containerRect.left) {
|
|
155
|
-
offset.left = actNavRect.left - containerRect.left + containerRef.current.scrollLeft - (!hideArrows ? ScrollWrapper_styles.FADE_BUTTON_SIZE : 0) - containerRect.width / 2 + actNavRect.width / 2;
|
|
156
|
-
}
|
|
145
|
+
if (actNavRect.right > containerRect.right) {
|
|
146
|
+
offset.left = actNavRect.right - containerRect.right + containerRef.current.scrollLeft + (!hideArrows ? ScrollWrapper_styles.FADE_BUTTON_SIZE : 0) + containerRect.width / 2 - actNavRect.width / 2;
|
|
147
|
+
} else if (actNavRect.left < containerRect.left) {
|
|
148
|
+
offset.left = actNavRect.left - containerRect.left + containerRef.current.scrollLeft - (!hideArrows ? ScrollWrapper_styles.FADE_BUTTON_SIZE : 0) - containerRect.width / 2 + actNavRect.width / 2;
|
|
157
149
|
}
|
|
158
150
|
} else if (direction === "vertical") {
|
|
159
151
|
if (actNavRect.bottom > containerRect.bottom) {
|
|
@@ -164,15 +156,15 @@ const ScrollWrapper = function ScrollWrapper2({
|
|
|
164
156
|
}
|
|
165
157
|
}
|
|
166
158
|
return offset;
|
|
167
|
-
}, [direction,
|
|
159
|
+
}, [direction, hideArrows]);
|
|
168
160
|
const {
|
|
169
161
|
x: refScrollX,
|
|
170
162
|
y: refScrollY
|
|
171
163
|
} = reactUse.useScroll(containerRef);
|
|
172
164
|
const windowSize = reactUse.useWindowSize();
|
|
173
|
-
const [scrollX, setScrollX] =
|
|
174
|
-
const [scrollY, setScrollY] =
|
|
175
|
-
|
|
165
|
+
const [scrollX, setScrollX] = react.useState(0);
|
|
166
|
+
const [scrollY, setScrollY] = react.useState(0);
|
|
167
|
+
react.useEffect(() => {
|
|
176
168
|
if (!containerRef.current) return;
|
|
177
169
|
const initScrollX = containerRef.current.scrollLeft;
|
|
178
170
|
const initScrollY = containerRef.current.scrollTop;
|
|
@@ -184,7 +176,7 @@ const ScrollWrapper = function ScrollWrapper2({
|
|
|
184
176
|
scrollWidth: containerRef.current.scrollWidth
|
|
185
177
|
});
|
|
186
178
|
}, [onScrollChange]);
|
|
187
|
-
|
|
179
|
+
react.useEffect(() => {
|
|
188
180
|
setScrollX(refScrollX);
|
|
189
181
|
setScrollY(refScrollY);
|
|
190
182
|
onScrollChange?.({
|
|
@@ -197,9 +189,9 @@ const ScrollWrapper = function ScrollWrapper2({
|
|
|
197
189
|
windowSize,
|
|
198
190
|
// #############################################################################
|
|
199
191
|
onScrollChange, refScrollX, refScrollY]);
|
|
200
|
-
const [showFadeStart, setShowFadeStart] =
|
|
201
|
-
const [showFadeEnd, setShowFadeEnd] =
|
|
202
|
-
|
|
192
|
+
const [showFadeStart, setShowFadeStart] = react.useState(false);
|
|
193
|
+
const [showFadeEnd, setShowFadeEnd] = react.useState(false);
|
|
194
|
+
react.useEffect(() => {
|
|
203
195
|
if (!containerRef.current) return;
|
|
204
196
|
const width = containerRef.current.offsetWidth;
|
|
205
197
|
const height = containerRef.current.offsetHeight;
|
|
@@ -221,7 +213,7 @@ const ScrollWrapper = function ScrollWrapper2({
|
|
|
221
213
|
containerSize.width, windowSize,
|
|
222
214
|
// #############################################################################
|
|
223
215
|
direction, scrollX, scrollY, items]);
|
|
224
|
-
const handleArrowClick =
|
|
216
|
+
const handleArrowClick = react.useCallback(first => {
|
|
225
217
|
const container = containerRef.current;
|
|
226
218
|
if (!container) return;
|
|
227
219
|
const scrollDirection = first ? -1 : 1;
|
|
@@ -278,9 +270,9 @@ const ScrollWrapper = function ScrollWrapper2({
|
|
|
278
270
|
behavior: "smooth"
|
|
279
271
|
});
|
|
280
272
|
}, [direction, scrollX, scrollY, scrollStepType, gap, getContainerItemWidth, getVisibleItemsWidth, getInvisibleItemOffset]);
|
|
281
|
-
|
|
273
|
+
react.useEffect(() => {
|
|
282
274
|
window.setTimeout(() => {
|
|
283
|
-
if (!containerRef.current
|
|
275
|
+
if (!containerRef.current) return;
|
|
284
276
|
if (activeIndex !== void 0 && activeIndex > -1) {
|
|
285
277
|
const offset = getActiveIndexOffset(activeIndex);
|
|
286
278
|
if (offset.left !== void 0) {
|
|
@@ -297,12 +289,12 @@ const ScrollWrapper = function ScrollWrapper2({
|
|
|
297
289
|
});
|
|
298
290
|
}
|
|
299
291
|
}, 0);
|
|
300
|
-
}, [activeIndex, getActiveIndexOffset
|
|
301
|
-
const arrowIconSrc =
|
|
292
|
+
}, [activeIndex, getActiveIndexOffset]);
|
|
293
|
+
const arrowIconSrc = react.useMemo(() => {
|
|
302
294
|
const icon = arrowIcon?.icon ?? ArrowRightIcon__default["default"];
|
|
303
295
|
return typeof icon === "string" ? icon : icon.src;
|
|
304
296
|
}, [arrowIcon]);
|
|
305
|
-
|
|
297
|
+
react.useEffect(() => {
|
|
306
298
|
if (!draggable || !containerRef.current) return;
|
|
307
299
|
const container = containerRef.current;
|
|
308
300
|
let isDragging = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollWrapper.js","sources":["../../../src/components/ScrollWrapper/ScrollWrapper.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { useMeasure, useScroll, useWindowSize } from \"react-use\";\n\nimport ArrowRightIcon from \"../../assets/icons/arrowRight.svg\";\nimport { useHorizontalScroll } from \"../../hooks/useHorizontalScroll\";\nimport * as S from \"./ScrollWrapper.styles\";\nimport { FADE_BUTTON_SIZE } from \"./ScrollWrapper.styles\";\nimport type { ScrollWrapperProps } from \"./ScrollWrapper.types\";\n\nconst SCROLL_CONTAINER_ITEM_CLASS_NAME = \"scroll-container-item\";\n\nconst NEAR_BOUNDARY_WIDTH = 10;\n\nexport const ScrollWrapper = function ScrollWrapper({\n align,\n direction,\n items,\n fillType,\n fillColor,\n accentColor,\n arrowColor,\n scrollStepType = \"scrollScreen\",\n gap,\n className,\n arrowFadeColor,\n activeIndex,\n circleArrowBackground,\n arrowGap,\n gradientSize,\n hideArrows,\n onScrollChange,\n enableWheelScroll,\n arrowIcon,\n draggable,\n alignActive = \"center\",\n disableScrollToActive,\n}: ScrollWrapperProps) {\n // #############################################################################\n // Container ref\n // #############################################################################\n const containerRef = useRef<null | HTMLDivElement>(null);\n const [containerMeasureRef, containerSize] = useMeasure<HTMLDivElement>();\n\n useHorizontalScroll(containerRef, !!enableWheelScroll);\n\n // Set measure ref\n useEffect(() => {\n if (containerRef.current) {\n containerMeasureRef(containerRef.current);\n }\n }, [containerMeasureRef]);\n\n const getContainerItemWidth = useCallback((): number => {\n const containerItem = containerRef.current?.querySelector(\n `.${SCROLL_CONTAINER_ITEM_CLASS_NAME}`,\n );\n\n if (!containerItem) {\n return 0;\n }\n\n return containerItem.getBoundingClientRect().width;\n }, []);\n\n const getInvisibleItemOffset = useCallback(\n ({ scrollDirection }: { scrollDirection: 1 | -1 }): number => {\n if (!containerRef.current) {\n return 0; // If container is not available, return 0\n }\n\n const container = containerRef.current;\n const items = container.querySelectorAll(\n `.${SCROLL_CONTAINER_ITEM_CLASS_NAME}`,\n );\n const containerRect = container.getBoundingClientRect();\n const isHorizontal = direction === \"horizontal\";\n\n // Offset for gradient element, as it covers the last item\n const fadeSize = 20;\n\n if (isHorizontal) {\n const padding =\n scrollDirection === 1\n ? parseFloat(window.getComputedStyle(container)[\"paddingRight\"])\n : parseFloat(window.getComputedStyle(container)[\"paddingLeft\"]);\n const offset = Math.max(padding, fadeSize);\n const containerEdgeWithoutPadding =\n scrollDirection === 1\n ? containerRect[\"right\"] - offset\n : containerRect[\"left\"] + offset;\n\n if (scrollDirection === 1) {\n for (const item of Array.from(items)) {\n const itemRect = item.getBoundingClientRect();\n // Check if item is partially or fully invisible horizontally\n if (itemRect.right > containerEdgeWithoutPadding) {\n return Math.abs(itemRect.right - containerEdgeWithoutPadding);\n }\n }\n } else {\n for (let i = items.length - 1; i >= 0; i--) {\n const item = items[i];\n if (item) {\n const itemRect = item.getBoundingClientRect();\n // Check if item is partially or fully invisible horizontally\n if (itemRect.left < containerEdgeWithoutPadding) {\n return Math.abs(containerEdgeWithoutPadding - itemRect.left);\n }\n }\n }\n }\n } else {\n const padding =\n scrollDirection === 1\n ? parseFloat(window.getComputedStyle(container)[\"paddingBottom\"])\n : parseFloat(window.getComputedStyle(container)[\"paddingTop\"]);\n const offset = Math.max(padding, fadeSize);\n\n const containerEdgeWithoutPadding =\n scrollDirection === 1\n ? containerRect[\"bottom\"] - offset\n : containerRect[\"top\"] + offset;\n\n if (scrollDirection === 1) {\n for (const item of Array.from(items)) {\n const itemRect = item.getBoundingClientRect();\n // Check if item is partially or fully invisible vertically\n if (itemRect.bottom > containerEdgeWithoutPadding) {\n return Math.abs(itemRect.bottom - containerEdgeWithoutPadding);\n }\n }\n } else {\n for (let i = items.length - 1; i >= 0; i--) {\n const item = items[i];\n if (item) {\n const itemRect = item.getBoundingClientRect();\n // Check if item is partially or fully invisible vertically\n if (itemRect.top < containerEdgeWithoutPadding) {\n return Math.abs(containerEdgeWithoutPadding - itemRect.top);\n }\n }\n }\n }\n }\n\n // If all items are fully visible, return 0\n return 0;\n },\n [direction],\n );\n\n const getVisibleItemsWidth = useCallback((): number => {\n if (!containerRef.current) {\n return 0;\n }\n\n const containerRect = containerRef.current.getBoundingClientRect();\n const containerItems = containerRef.current.querySelectorAll(\n `.${SCROLL_CONTAINER_ITEM_CLASS_NAME}`,\n );\n\n let visibleItemsWidth = 0;\n\n containerItems.forEach((item) => {\n const itemRect = item.getBoundingClientRect();\n\n if (\n (direction === \"horizontal\" &&\n itemRect.left >= containerRect.left &&\n itemRect.right <= containerRect.right) ||\n (direction === \"vertical\" &&\n itemRect.top >= containerRect.top &&\n itemRect.bottom <= containerRect.bottom)\n ) {\n // Do not add gap for first item because gaps should always be \"gaps = items - 1\"\n if (visibleItemsWidth !== 0 && gap !== undefined) {\n visibleItemsWidth += gap;\n }\n\n visibleItemsWidth +=\n direction === \"horizontal\" ? itemRect.width : itemRect.height;\n }\n });\n\n return visibleItemsWidth;\n }, [direction, gap]);\n\n const getActiveIndexOffset = useCallback(\n (index: number): { left: number | undefined; top: number | undefined } => {\n const offset: { left: undefined | number; top: undefined | number } = {\n left: undefined,\n top: undefined,\n };\n if (!containerRef.current) {\n return offset;\n }\n\n const containerRect = containerRef.current.getBoundingClientRect();\n const actNav = containerRef.current.children[index] as HTMLElement;\n\n if (actNav) {\n const actNavRect = actNav.getBoundingClientRect();\n\n if (direction === \"horizontal\") {\n if (alignActive === \"left\") {\n // Align active item to the left\n if (\n actNavRect.left < containerRect.left ||\n actNavRect.right > containerRect.right\n ) {\n offset.left =\n actNavRect.left -\n containerRect.left +\n containerRef.current.scrollLeft;\n }\n } else {\n // Default behavior: Align active item to the center\n if (actNavRect.right > containerRect.right) {\n offset.left =\n actNavRect.right -\n containerRect.right +\n containerRef.current.scrollLeft +\n (!hideArrows ? FADE_BUTTON_SIZE : 0) +\n containerRect.width / 2 -\n actNavRect.width / 2;\n } else if (actNavRect.left < containerRect.left) {\n offset.left =\n actNavRect.left -\n containerRect.left +\n containerRef.current.scrollLeft -\n (!hideArrows ? FADE_BUTTON_SIZE : 0) -\n containerRect.width / 2 +\n actNavRect.width / 2;\n }\n }\n } else if (direction === \"vertical\") {\n if (actNavRect.bottom > containerRect.bottom) {\n offset.top =\n actNavRect.bottom -\n containerRect.bottom +\n containerRef.current.scrollTop +\n (!hideArrows ? FADE_BUTTON_SIZE : 0);\n } else if (actNavRect.top < containerRect.top) {\n offset.top =\n actNavRect.top -\n containerRect.top +\n containerRef.current.scrollTop +\n (!hideArrows ? FADE_BUTTON_SIZE : 0);\n }\n }\n }\n\n return offset;\n },\n [direction, alignActive, hideArrows],\n );\n\n // #############################################################################\n // Handle scrolling\n // #############################################################################\n const { x: refScrollX, y: refScrollY } = useScroll(containerRef);\n // Keep track of window size to detect resize\n const windowSize = useWindowSize();\n\n // Keep track of the current scroll position and size\n // State is needed due to initial not being tracked by useScroll\n const [scrollX, setScrollX] = useState(0);\n const [scrollY, setScrollY] = useState(0);\n\n // Set initial data\n useEffect(() => {\n if (!containerRef.current) return;\n\n const initScrollX = containerRef.current.scrollLeft;\n const initScrollY = containerRef.current.scrollTop;\n\n setScrollX(initScrollX);\n setScrollY(initScrollY);\n\n onScrollChange?.({\n scrollX: initScrollX,\n scrollY: initScrollY,\n scrollWidth: containerRef.current.scrollWidth,\n });\n }, [onScrollChange]);\n\n // Set scroll positions on scroll and resize\n useEffect(() => {\n setScrollX(refScrollX);\n setScrollY(refScrollY);\n\n onScrollChange?.({\n scrollX: refScrollX,\n scrollY: refScrollY,\n scrollWidth: containerRef.current?.scrollWidth ?? 0,\n });\n }, [\n // HACK: needed windowSize to retrigger the effect\n windowSize,\n // #############################################################################\n onScrollChange,\n refScrollX,\n refScrollY,\n ]);\n\n // #############################################################################\n // Parse fade display state\n // #############################################################################\n const [showFadeStart, setShowFadeStart] = useState(false);\n const [showFadeEnd, setShowFadeEnd] = useState(false);\n\n useEffect(() => {\n if (!containerRef.current) return;\n\n const width = containerRef.current.offsetWidth;\n const height = containerRef.current.offsetHeight;\n const scrollWidth = containerRef.current.scrollWidth;\n const scrollHeight = containerRef.current.scrollHeight;\n\n // 1px added to fix issue with 1 pixel (sometimes arrow doesn't disappear when it should)\n // happens only when scroll behavior is smooth\n const scrollXFixOffset = 1;\n\n switch (direction) {\n case \"horizontal\":\n setShowFadeStart(scrollX > 0);\n\n setShowFadeEnd(\n Math.ceil(scrollX + scrollXFixOffset) < scrollWidth - width,\n );\n break;\n case \"vertical\":\n setShowFadeStart(scrollY > 0);\n setShowFadeEnd(\n Math.ceil(scrollY + scrollXFixOffset) < scrollHeight - height,\n );\n break;\n }\n }, [\n // HACK: needed windowSize, containerSize.width to retrigger the effect\n containerSize.width,\n windowSize,\n // #############################################################################\n direction,\n scrollX,\n scrollY,\n items,\n ]);\n\n // #############################################################################\n // Handle arrow click scroll\n // #############################################################################\n const handleArrowClick = useCallback(\n (first: boolean) => {\n // Ensure the container reference is available\n const container = containerRef.current;\n if (!container) return;\n\n // Determine the scroll direction based on the `first` parameter\n const scrollDirection = first ? -1 : 1;\n\n // Destructure properties from the container for ease of use\n const {\n scrollWidth,\n scrollHeight,\n offsetWidth,\n offsetHeight,\n clientWidth,\n } = container;\n\n // Determine if the scrolling direction is horizontal or vertical\n const isHorizontal = direction === \"horizontal\";\n const scrollPosition = isHorizontal ? scrollX : scrollY;\n const scrollSize = isHorizontal ? scrollWidth : scrollHeight;\n\n // Calculate the scroll step based on the scrollStepType\n let scrollStep = 0;\n switch (scrollStepType) {\n case \"scrollScreen\":\n scrollStep = isHorizontal ? offsetWidth : offsetHeight;\n break;\n case \"itemWidth\":\n scrollStep = getContainerItemWidth();\n break;\n case \"visibleItemsWidth\":\n scrollStep = getVisibleItemsWidth();\n break;\n case \"nextItem\":\n scrollStep = getInvisibleItemOffset({\n scrollDirection,\n });\n break;\n }\n\n // Calculate the new scroll position\n const newScrollPosition =\n scrollPosition + scrollDirection * (scrollStep + (gap ?? 0));\n\n // Ensure the new scroll position is within bounds\n const newScrollPositionWithinBounds = Math.max(\n 0,\n Math.min(scrollSize - scrollStep, newScrollPosition),\n );\n\n // Calculate the possible scroll amount\n const possibleScroll = scrollSize - clientWidth;\n const nearBoundary = NEAR_BOUNDARY_WIDTH;\n\n // Scroll to the beginning if the new position is near the start\n if (newScrollPosition < nearBoundary || newScrollPosition < 0) {\n container.scrollTo({\n left: 0,\n top: 0,\n behavior: \"smooth\",\n });\n return;\n }\n\n // Scroll to the end if the new position is near the end\n if (\n possibleScroll - newScrollPosition < nearBoundary ||\n newScrollPosition > possibleScroll\n ) {\n container.scrollTo({\n left: possibleScroll,\n top: possibleScroll,\n behavior: \"smooth\",\n });\n return;\n }\n\n // Smooth scroll to the new position within bounds\n container.scrollTo({\n left: isHorizontal ? newScrollPositionWithinBounds : undefined,\n top: !isHorizontal ? newScrollPositionWithinBounds : undefined,\n behavior: \"smooth\",\n });\n },\n [\n direction,\n scrollX,\n scrollY,\n scrollStepType,\n gap,\n getContainerItemWidth,\n getVisibleItemsWidth,\n getInvisibleItemOffset,\n ],\n );\n\n // #############################################################################\n // Scroll to start or active index on mount\n // #############################################################################\n useEffect(() => {\n window.setTimeout(() => {\n if (!containerRef.current || disableScrollToActive) return;\n\n // Scroll into view, if activeIndex is provided\n if (activeIndex !== undefined && activeIndex > -1) {\n const offset = getActiveIndexOffset(activeIndex);\n\n if (offset.left !== undefined) {\n containerRef.current.scrollLeft = offset.left;\n }\n if (offset.top !== undefined) {\n containerRef.current.scrollTop = offset.top;\n }\n } else {\n containerRef.current.scrollTo({\n left: 0,\n top: 0,\n behavior: \"smooth\",\n });\n }\n }, 0);\n }, [activeIndex, getActiveIndexOffset, disableScrollToActive]);\n\n // #############################################################################\n // Arrow icon\n // #############################################################################\n const arrowIconSrc = useMemo(() => {\n const icon = arrowIcon?.icon ?? ArrowRightIcon;\n\n return typeof icon === \"string\" ? icon : icon.src;\n }, [arrowIcon]);\n\n // #############################################################################\n // Handle drag scroll\n // #############################################################################\n useEffect(() => {\n if (!draggable || !containerRef.current) return;\n\n const container = containerRef.current;\n let isDragging = false;\n let hasDragged = false;\n let startX = 0;\n let startY = 0;\n let scrollLeft = 0;\n let scrollTop = 0;\n\n const onPointerDown = (e: PointerEvent) => {\n if (e.pointerType !== \"mouse\" || e.buttons !== 1) return;\n\n isDragging = true;\n hasDragged = false;\n startX = e.pageX - container.offsetLeft;\n startY = e.pageY - container.offsetTop;\n scrollLeft = container.scrollLeft;\n scrollTop = container.scrollTop;\n document.body.style.cursor = \"grabbing\";\n container.style.cursor = \"grabbing\";\n };\n\n const onPointerMove = (e: PointerEvent) => {\n if (e.pointerType !== \"mouse\") return;\n\n if (!isDragging) return;\n\n e.preventDefault();\n hasDragged = true;\n\n const walkMultiplier = 1; // Adjust the multiplier for faster/slower scrolling\n\n const x = e.pageX - container.offsetLeft;\n const y = e.pageY - container.offsetTop;\n const walkX = (x - startX) * walkMultiplier;\n const walkY = (y - startY) * walkMultiplier;\n container.scrollLeft = scrollLeft - walkX;\n container.scrollTop = scrollTop - walkY;\n };\n\n const onPointerUp = (e: PointerEvent) => {\n if (e.pointerType !== \"mouse\") return;\n\n isDragging = false;\n document.body.style.cursor = \"unset\";\n container.style.cursor = \"unset\";\n };\n\n const onVisibilityChange = () => {\n isDragging = false;\n document.body.style.cursor = \"unset\";\n container.style.cursor = \"unset\";\n hasDragged = false;\n };\n\n const onClick = (e: MouseEvent) => {\n if (hasDragged) {\n e.preventDefault(); // Prevents anchor tag from navigating if dragging occurred\n e.stopPropagation();\n }\n };\n\n container.addEventListener(\"pointerdown\", onPointerDown);\n document.addEventListener(\"pointermove\", onPointerMove);\n document.addEventListener(\"pointerup\", onPointerUp);\n\n document.addEventListener(\"visibilitychange\", onVisibilityChange);\n\n // Prevent clicks on anchor tags after dragging\n container.querySelectorAll(\"a\").forEach((anchor) => {\n anchor.addEventListener(\"click\", onClick);\n });\n\n return () => {\n container.removeEventListener(\"pointerdown\", onPointerDown);\n document.removeEventListener(\"pointermove\", onPointerMove);\n document.removeEventListener(\"pointerup\", onPointerUp);\n\n document.removeEventListener(\"visibilitychange\", onVisibilityChange);\n\n container.querySelectorAll(\"a\").forEach((anchor) => {\n anchor.removeEventListener(\"click\", onClick);\n });\n };\n }, [draggable]);\n\n // #############################################################################\n // Render\n // #############################################################################\n return (\n <S.OuterContainer\n $align={align}\n $direction={direction}\n $showFadeStart={showFadeStart}\n $showFadeEnd={showFadeEnd}\n $fillType={fillType}\n $fillColor={fillColor}\n $gradientSize={gradientSize}\n className={className}\n >\n <S.ScrollContainer ref={containerRef} $direction={direction} $gap={gap}>\n {items.map((item, i) => (\n <S.Item\n key={item.id + i}\n className={SCROLL_CONTAINER_ITEM_CLASS_NAME}\n $draggable={!!draggable}\n >\n {item.render()}\n </S.Item>\n ))}\n </S.ScrollContainer>\n\n <S.LeftArrowIcon\n $show={showFadeStart && !hideArrows}\n $first\n $fillType={fillType}\n $fillColor={fillColor}\n $accentColor={accentColor}\n $direction={direction}\n $arrowFadeColor={arrowFadeColor}\n $circleArrowBackground={circleArrowBackground}\n onClick={() => handleArrowClick(true)}\n $arrowGap={arrowGap}\n >\n <S.ArrowIconSvg\n $arrowColor={arrowColor}\n width={arrowIcon?.width ?? (circleArrowBackground ? 10 : 8)}\n height={arrowIcon?.height ?? (circleArrowBackground ? 16 : 13)}\n src={arrowIconSrc}\n />\n </S.LeftArrowIcon>\n\n <S.RightArrowIcon\n $show={showFadeEnd && !hideArrows}\n $fillType={fillType}\n $fillColor={fillColor}\n $accentColor={accentColor}\n $direction={direction}\n $arrowFadeColor={arrowFadeColor}\n $circleArrowBackground={circleArrowBackground}\n onClick={() => handleArrowClick(false)}\n $arrowGap={arrowGap}\n >\n <S.ArrowIconSvg\n $arrowColor={arrowColor}\n width={arrowIcon?.width ?? (circleArrowBackground ? 10 : 8)}\n height={arrowIcon?.height ?? (circleArrowBackground ? 16 : 13)}\n src={arrowIconSrc}\n />\n </S.RightArrowIcon>\n </S.OuterContainer>\n );\n};\n"],"names":["SCROLL_CONTAINER_ITEM_CLASS_NAME","NEAR_BOUNDARY_WIDTH","ScrollWrapper","ScrollWrapper2","align","direction","items","fillType","fillColor","accentColor","arrowColor","scrollStepType","gap","className","arrowFadeColor","activeIndex","circleArrowBackground","arrowGap","gradientSize","hideArrows","onScrollChange","enableWheelScroll","arrowIcon","draggable","alignActive","disableScrollToActive","containerRef","useRef","containerMeasureRef","containerSize","useMeasure","useHorizontalScroll","useEffect","current","getContainerItemWidth","useCallback","containerItem","querySelector","getBoundingClientRect","width","getInvisibleItemOffset","scrollDirection","container","querySelectorAll","containerRect","isHorizontal","fadeSize","padding","parseFloat","window","getComputedStyle","offset","Math","max","containerEdgeWithoutPadding","item","Array","from","itemRect","right","abs","i","length","left","bottom","top","getVisibleItemsWidth","containerItems","visibleItemsWidth","forEach","height","getActiveIndexOffset","index","actNav","children","actNavRect","scrollLeft","FADE_BUTTON_SIZE","scrollTop","x","refScrollX","y","refScrollY","useScroll","windowSize","useWindowSize","scrollX","setScrollX","useState","scrollY","setScrollY","initScrollX","initScrollY","scrollWidth","showFadeStart","setShowFadeStart","showFadeEnd","setShowFadeEnd","offsetWidth","offsetHeight","scrollHeight","scrollXFixOffset","ceil","handleArrowClick","first","clientWidth","scrollPosition","scrollSize","scrollStep","newScrollPosition","newScrollPositionWithinBounds","min","possibleScroll","nearBoundary","scrollTo","behavior","setTimeout","arrowIconSrc","useMemo","icon","ArrowRightIcon","src","isDragging","hasDragged","startX","startY","onPointerDown","e","pointerType","buttons","pageX","offsetLeft","pageY","offsetTop","document","body","style","cursor","onPointerMove","preventDefault","walkMultiplier","walkX","walkY","onPointerUp","onVisibilityChange","onClick","stopPropagation","addEventListener","anchor","removeEventListener","jsxs","S.OuterContainer","OuterContainer","$align","$direction","$showFadeStart","$showFadeEnd","$fillType","$fillColor","$gradientSize","jsx","S.ScrollContainer","ScrollContainer","ref","$gap","map","S.Item","Item","$draggable","render","id","S.LeftArrowIcon","LeftArrowIcon","$show","$first","$accentColor","$arrowFadeColor","$circleArrowBackground","$arrowGap","S.ArrowIconSvg","ArrowIconSvg","$arrowColor","S.RightArrowIcon","RightArrowIcon"],"mappings":";;;;;;;;;;;;;;;;AASA,MAAMA,gCAAmC,GAAA,uBAAA;AAEzC,MAAMC,mBAAsB,GAAA,EAAA;AAEf,MAAAC,aAAA,GAAgB,SAASA,cAAcC,CAAA;EAClDC,KAAA;EACAC,SAAA;EACAC,KAAA;EACAC,QAAA;EACAC,SAAA;EACAC,WAAA;EACAC,UAAA;EACAC,cAAiB,GAAA,cAAA;EACjBC,GAAA;EACAC,SAAA;EACAC,cAAA;EACAC,WAAA;EACAC,qBAAA;EACAC,QAAA;EACAC,YAAA;EACAC,UAAA;EACAC,cAAA;EACAC,iBAAA;EACAC,SAAA;EACAC,SAAA;EACAC,WAAc,GAAA,QAAA;EACdC;AACF,CAAuB,EAAA;EAIf,MAAAC,YAAA,GAAeC,aAA8B,IAAI,CAAA;EACvD,MAAM,CAACC,mBAAA,EAAqBC,aAAa,CAAA,GAAIC,QAA2B,CAAAA,UAAA,CAAA,CAAA;EAEpDC,mBAAAA,CAAAA,mBAAA,CAAAL,YAAA,EAAc,CAAC,CAACL,iBAAiB,CAAA;EAGrDW,KAAAA,CAAAA,SAAA,CAAU,MAAM;IACd,IAAIN,aAAaO,OAAS,EAAA;MACxBL,mBAAA,CAAoBF,aAAaO,OAAO,CAAA;IAC1C;EAAA,CACF,EAAG,CAACL,mBAAmB,CAAC,CAAA;EAElB,MAAAM,qBAAA,GAAwBC,KAAAA,CAAAA,YAAY,MAAc;IAChD,MAAAC,aAAA,GAAgBV,aAAaO,OAAS,EAAAI,aAAA,CAC1C,IAAIrC,gCAAgC,EAAA,CACtC;IAEA,IAAI,CAACoC,aAAe,EAAA;MACX,OAAA,CAA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SAAW,EAAAjK,QAAA;MAEXyD,QAAA,iBAAAsF,UAAA,CAAAA,GAAA,CAACmB,oBAAE,CAAAC,YAAA,EAAF;QACCC,WAAa,EAAA3K,UAAA;QACb6B,KAAO,EAAAjB,SAAA,EAAWiB,KAAU,KAAAvB,qBAAA,GAAwB,EAAK,GAAA,CAAA,CAAA;QACzDsD,MAAQ,EAAAhD,SAAA,EAAWgD,MAAW,KAAAtD,qBAAA,GAAwB,EAAK,GAAA,EAAA,CAAA;QAC3DyG,GAAK,EAAAJ;MAAA,CACP;IAAA,CACF,CAAA,EAAA,eAEA2C,UAAA,CAAAA,GAAA,CAACsB,oBAAE,CAAAC,cAAA,EAAF;MACCV,KAAA,EAAO7E,eAAe,CAAC7E,UAAA;MACvB0I,SAAW,EAAAtJ,QAAA;MACXuJ,UAAY,EAAAtJ,SAAA;MACZuK,YAAc,EAAAtK,WAAA;MACdiJ,UAAY,EAAArJ,SAAA;MACZ2K,eAAiB,EAAAlK,cAAA;MACjBmK,sBAAwB,EAAAjK,qBAAA;MACxBiI,OAAA,EAASA,CAAA,KAAM1C,gBAAA,CAAiB,KAAK,CAAA;MACrC2E,SAAW,EAAAjK,QAAA;MAEXyD,QAAA,iBAAAsF,UAAA,CAAAA,GAAA,CAACmB,oBAAE,CAAAC,YAAA,EAAF;QACCC,WAAa,EAAA3K,UAAA;QACb6B,KAAO,EAAAjB,SAAA,EAAWiB,KAAU,KAAAvB,qBAAA,GAAwB,EAAK,GAAA,CAAA,CAAA;QACzDsD,MAAQ,EAAAhD,SAAA,EAAWgD,MAAW,KAAAtD,qBAAA,GAAwB,EAAK,GAAA,EAAA,CAAA;QAC3DyG,GAAK,EAAAJ;MAAA,CACP;IAAA,CACF,CAAA;EAAA,CAAA,CACF;AAEJ,CAAA;"}
|
|
1
|
+
{"version":3,"file":"ScrollWrapper.js","sources":["../../../src/components/ScrollWrapper/ScrollWrapper.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { useMeasure, useScroll, useWindowSize } from \"react-use\";\n\nimport ArrowRightIcon from \"../../assets/icons/arrowRight.svg\";\nimport { useHorizontalScroll } from \"../../hooks/useHorizontalScroll\";\nimport * as S from \"./ScrollWrapper.styles\";\nimport { FADE_BUTTON_SIZE } from \"./ScrollWrapper.styles\";\nimport type { ScrollWrapperProps } from \"./ScrollWrapper.types\";\n\nconst SCROLL_CONTAINER_ITEM_CLASS_NAME = \"scroll-container-item\";\n\nconst NEAR_BOUNDARY_WIDTH = 10;\n\nexport const ScrollWrapper = function ScrollWrapper({\n align,\n direction,\n items,\n fillType,\n fillColor,\n accentColor,\n arrowColor,\n scrollStepType = \"scrollScreen\",\n gap,\n className,\n arrowFadeColor,\n activeIndex,\n circleArrowBackground,\n arrowGap,\n gradientSize,\n hideArrows,\n onScrollChange,\n enableWheelScroll,\n arrowIcon,\n draggable,\n}: ScrollWrapperProps) {\n // #############################################################################\n // Container ref\n // #############################################################################\n const containerRef = useRef<null | HTMLDivElement>(null);\n const [containerMeasureRef, containerSize] = useMeasure<HTMLDivElement>();\n\n useHorizontalScroll(containerRef, !!enableWheelScroll);\n\n // Set measure ref\n useEffect(() => {\n if (containerRef.current) {\n containerMeasureRef(containerRef.current);\n }\n }, [containerMeasureRef]);\n\n const getContainerItemWidth = useCallback((): number => {\n const containerItem = containerRef.current?.querySelector(\n `.${SCROLL_CONTAINER_ITEM_CLASS_NAME}`,\n );\n\n if (!containerItem) {\n return 0;\n }\n\n return containerItem.getBoundingClientRect().width;\n }, []);\n\n const getInvisibleItemOffset = useCallback(\n ({ scrollDirection }: { scrollDirection: 1 | -1 }): number => {\n if (!containerRef.current) {\n return 0; // If container is not available, return 0\n }\n\n const container = containerRef.current;\n const items = container.querySelectorAll(\n `.${SCROLL_CONTAINER_ITEM_CLASS_NAME}`,\n );\n const containerRect = container.getBoundingClientRect();\n const isHorizontal = direction === \"horizontal\";\n\n // Offset for gradient element, as it covers the last item\n const fadeSize = 20;\n\n if (isHorizontal) {\n const padding =\n scrollDirection === 1\n ? parseFloat(window.getComputedStyle(container)[\"paddingRight\"])\n : parseFloat(window.getComputedStyle(container)[\"paddingLeft\"]);\n const offset = Math.max(padding, fadeSize);\n const containerEdgeWithoutPadding =\n scrollDirection === 1\n ? containerRect[\"right\"] - offset\n : containerRect[\"left\"] + offset;\n\n if (scrollDirection === 1) {\n for (const item of Array.from(items)) {\n const itemRect = item.getBoundingClientRect();\n // Check if item is partially or fully invisible horizontally\n if (itemRect.right > containerEdgeWithoutPadding) {\n return Math.abs(itemRect.right - containerEdgeWithoutPadding);\n }\n }\n } else {\n for (let i = items.length - 1; i >= 0; i--) {\n const item = items[i];\n if (item) {\n const itemRect = item.getBoundingClientRect();\n // Check if item is partially or fully invisible horizontally\n if (itemRect.left < containerEdgeWithoutPadding) {\n return Math.abs(containerEdgeWithoutPadding - itemRect.left);\n }\n }\n }\n }\n } else {\n const padding =\n scrollDirection === 1\n ? parseFloat(window.getComputedStyle(container)[\"paddingBottom\"])\n : parseFloat(window.getComputedStyle(container)[\"paddingTop\"]);\n const offset = Math.max(padding, fadeSize);\n\n const containerEdgeWithoutPadding =\n scrollDirection === 1\n ? containerRect[\"bottom\"] - offset\n : containerRect[\"top\"] + offset;\n\n if (scrollDirection === 1) {\n for (const item of Array.from(items)) {\n const itemRect = item.getBoundingClientRect();\n // Check if item is partially or fully invisible vertically\n if (itemRect.bottom > containerEdgeWithoutPadding) {\n return Math.abs(itemRect.bottom - containerEdgeWithoutPadding);\n }\n }\n } else {\n for (let i = items.length - 1; i >= 0; i--) {\n const item = items[i];\n if (item) {\n const itemRect = item.getBoundingClientRect();\n // Check if item is partially or fully invisible vertically\n if (itemRect.top < containerEdgeWithoutPadding) {\n return Math.abs(containerEdgeWithoutPadding - itemRect.top);\n }\n }\n }\n }\n }\n\n // If all items are fully visible, return 0\n return 0;\n },\n [direction],\n );\n\n const getVisibleItemsWidth = useCallback((): number => {\n if (!containerRef.current) {\n return 0;\n }\n\n const containerRect = containerRef.current.getBoundingClientRect();\n const containerItems = containerRef.current.querySelectorAll(\n `.${SCROLL_CONTAINER_ITEM_CLASS_NAME}`,\n );\n\n let visibleItemsWidth = 0;\n\n containerItems.forEach((item) => {\n const itemRect = item.getBoundingClientRect();\n\n if (\n (direction === \"horizontal\" &&\n itemRect.left >= containerRect.left &&\n itemRect.right <= containerRect.right) ||\n (direction === \"vertical\" &&\n itemRect.top >= containerRect.top &&\n itemRect.bottom <= containerRect.bottom)\n ) {\n // Do not add gap for first item because gaps should always be \"gaps = items - 1\"\n if (visibleItemsWidth !== 0 && gap !== undefined) {\n visibleItemsWidth += gap;\n }\n\n visibleItemsWidth +=\n direction === \"horizontal\" ? itemRect.width : itemRect.height;\n }\n });\n\n return visibleItemsWidth;\n }, [direction, gap]);\n\n const getActiveIndexOffset = useCallback(\n (index: number): { left: number | undefined; top: number | undefined } => {\n const offset: { left: undefined | number; top: undefined | number } = {\n left: undefined,\n top: undefined,\n };\n if (!containerRef.current) {\n return offset;\n }\n\n const containerRect = containerRef.current.getBoundingClientRect();\n const actNav = containerRef.current.children[index] as HTMLElement;\n\n if (actNav) {\n const actNavRect = actNav.getBoundingClientRect();\n\n if (direction === \"horizontal\") {\n if (actNavRect.right > containerRect.right) {\n offset.left =\n actNavRect.right -\n containerRect.right +\n containerRef.current.scrollLeft +\n (!hideArrows ? FADE_BUTTON_SIZE : 0) +\n containerRect.width / 2 -\n actNavRect.width / 2;\n } else if (actNavRect.left < containerRect.left) {\n offset.left =\n actNavRect.left -\n containerRect.left +\n containerRef.current.scrollLeft -\n (!hideArrows ? FADE_BUTTON_SIZE : 0) -\n containerRect.width / 2 +\n actNavRect.width / 2;\n }\n } else if (direction === \"vertical\") {\n if (actNavRect.bottom > containerRect.bottom) {\n offset.top =\n actNavRect.bottom -\n containerRect.bottom +\n containerRef.current.scrollTop +\n (!hideArrows ? FADE_BUTTON_SIZE : 0);\n } else if (actNavRect.top < containerRect.top) {\n offset.top =\n actNavRect.top -\n containerRect.top +\n containerRef.current.scrollTop +\n (!hideArrows ? FADE_BUTTON_SIZE : 0);\n }\n }\n }\n return offset;\n },\n [direction, hideArrows],\n );\n\n // #############################################################################\n // Handle scrolling\n // #############################################################################\n const { x: refScrollX, y: refScrollY } = useScroll(containerRef);\n // Keep track of window size to detect resize\n const windowSize = useWindowSize();\n\n // Keep track of the current scroll position and size\n // State is needed due to initial not being tracked by useScroll\n const [scrollX, setScrollX] = useState(0);\n const [scrollY, setScrollY] = useState(0);\n\n // Set initial data\n useEffect(() => {\n if (!containerRef.current) return;\n\n const initScrollX = containerRef.current.scrollLeft;\n const initScrollY = containerRef.current.scrollTop;\n\n setScrollX(initScrollX);\n setScrollY(initScrollY);\n\n onScrollChange?.({\n scrollX: initScrollX,\n scrollY: initScrollY,\n scrollWidth: containerRef.current.scrollWidth,\n });\n }, [onScrollChange]);\n\n // Set scroll positions on scroll and resize\n useEffect(() => {\n setScrollX(refScrollX);\n setScrollY(refScrollY);\n\n onScrollChange?.({\n scrollX: refScrollX,\n scrollY: refScrollY,\n scrollWidth: containerRef.current?.scrollWidth ?? 0,\n });\n }, [\n // HACK: needed windowSize to retrigger the effect\n windowSize,\n // #############################################################################\n onScrollChange,\n refScrollX,\n refScrollY,\n ]);\n\n // #############################################################################\n // Parse fade display state\n // #############################################################################\n const [showFadeStart, setShowFadeStart] = useState(false);\n const [showFadeEnd, setShowFadeEnd] = useState(false);\n\n useEffect(() => {\n if (!containerRef.current) return;\n\n const width = containerRef.current.offsetWidth;\n const height = containerRef.current.offsetHeight;\n const scrollWidth = containerRef.current.scrollWidth;\n const scrollHeight = containerRef.current.scrollHeight;\n\n // 1px added to fix issue with 1 pixel (sometimes arrow doesn't disappear when it should)\n // happens only when scroll behavior is smooth\n const scrollXFixOffset = 1;\n\n switch (direction) {\n case \"horizontal\":\n setShowFadeStart(scrollX > 0);\n\n setShowFadeEnd(\n Math.ceil(scrollX + scrollXFixOffset) < scrollWidth - width,\n );\n break;\n case \"vertical\":\n setShowFadeStart(scrollY > 0);\n setShowFadeEnd(\n Math.ceil(scrollY + scrollXFixOffset) < scrollHeight - height,\n );\n break;\n }\n }, [\n // HACK: needed windowSize, containerSize.width to retrigger the effect\n containerSize.width,\n windowSize,\n // #############################################################################\n direction,\n scrollX,\n scrollY,\n items,\n ]);\n\n // #############################################################################\n // Handle arrow click scroll\n // #############################################################################\n const handleArrowClick = useCallback(\n (first: boolean) => {\n // Ensure the container reference is available\n const container = containerRef.current;\n if (!container) return;\n\n // Determine the scroll direction based on the `first` parameter\n const scrollDirection = first ? -1 : 1;\n\n // Destructure properties from the container for ease of use\n const {\n scrollWidth,\n scrollHeight,\n offsetWidth,\n offsetHeight,\n clientWidth,\n } = container;\n\n // Determine if the scrolling direction is horizontal or vertical\n const isHorizontal = direction === \"horizontal\";\n const scrollPosition = isHorizontal ? scrollX : scrollY;\n const scrollSize = isHorizontal ? scrollWidth : scrollHeight;\n\n // Calculate the scroll step based on the scrollStepType\n let scrollStep = 0;\n switch (scrollStepType) {\n case \"scrollScreen\":\n scrollStep = isHorizontal ? offsetWidth : offsetHeight;\n break;\n case \"itemWidth\":\n scrollStep = getContainerItemWidth();\n break;\n case \"visibleItemsWidth\":\n scrollStep = getVisibleItemsWidth();\n break;\n case \"nextItem\":\n scrollStep = getInvisibleItemOffset({\n scrollDirection,\n });\n break;\n }\n\n // Calculate the new scroll position\n const newScrollPosition =\n scrollPosition + scrollDirection * (scrollStep + (gap ?? 0));\n\n // Ensure the new scroll position is within bounds\n const newScrollPositionWithinBounds = Math.max(\n 0,\n Math.min(scrollSize - scrollStep, newScrollPosition),\n );\n\n // Calculate the possible scroll amount\n const possibleScroll = scrollSize - clientWidth;\n const nearBoundary = NEAR_BOUNDARY_WIDTH;\n\n // Scroll to the beginning if the new position is near the start\n if (newScrollPosition < nearBoundary || newScrollPosition < 0) {\n container.scrollTo({\n left: 0,\n top: 0,\n behavior: \"smooth\",\n });\n return;\n }\n\n // Scroll to the end if the new position is near the end\n if (\n possibleScroll - newScrollPosition < nearBoundary ||\n newScrollPosition > possibleScroll\n ) {\n container.scrollTo({\n left: possibleScroll,\n top: possibleScroll,\n behavior: \"smooth\",\n });\n return;\n }\n\n // Smooth scroll to the new position within bounds\n container.scrollTo({\n left: isHorizontal ? newScrollPositionWithinBounds : undefined,\n top: !isHorizontal ? newScrollPositionWithinBounds : undefined,\n behavior: \"smooth\",\n });\n },\n [\n direction,\n scrollX,\n scrollY,\n scrollStepType,\n gap,\n getContainerItemWidth,\n getVisibleItemsWidth,\n getInvisibleItemOffset,\n ],\n );\n\n // #############################################################################\n // Scroll to start or active index on mount\n // #############################################################################\n useEffect(() => {\n window.setTimeout(() => {\n if (!containerRef.current) return;\n\n // Scroll into view, if activeIndex is provided\n if (activeIndex !== undefined && activeIndex > -1) {\n const offset = getActiveIndexOffset(activeIndex);\n\n if (offset.left !== undefined) {\n containerRef.current.scrollLeft = offset.left;\n }\n if (offset.top !== undefined) {\n containerRef.current.scrollTop = offset.top;\n }\n } else {\n containerRef.current.scrollTo({\n left: 0,\n top: 0,\n behavior: \"smooth\",\n });\n }\n }, 0);\n }, [activeIndex, getActiveIndexOffset]);\n\n // #############################################################################\n // Arrow icon\n // #############################################################################\n const arrowIconSrc = useMemo(() => {\n const icon = arrowIcon?.icon ?? ArrowRightIcon;\n\n return typeof icon === \"string\" ? icon : icon.src;\n }, [arrowIcon]);\n\n // #############################################################################\n // Handle drag scroll\n // #############################################################################\n useEffect(() => {\n if (!draggable || !containerRef.current) return;\n\n const container = containerRef.current;\n let isDragging = false;\n let hasDragged = false;\n let startX = 0;\n let startY = 0;\n let scrollLeft = 0;\n let scrollTop = 0;\n\n const onPointerDown = (e: PointerEvent) => {\n if (e.pointerType !== \"mouse\" || e.buttons !== 1) return;\n\n isDragging = true;\n hasDragged = false;\n startX = e.pageX - container.offsetLeft;\n startY = e.pageY - container.offsetTop;\n scrollLeft = container.scrollLeft;\n scrollTop = container.scrollTop;\n document.body.style.cursor = \"grabbing\";\n container.style.cursor = \"grabbing\";\n };\n\n const onPointerMove = (e: PointerEvent) => {\n if (e.pointerType !== \"mouse\") return;\n\n if (!isDragging) return;\n\n e.preventDefault();\n hasDragged = true;\n\n const walkMultiplier = 1; // Adjust the multiplier for faster/slower scrolling\n\n const x = e.pageX - container.offsetLeft;\n const y = e.pageY - container.offsetTop;\n const walkX = (x - startX) * walkMultiplier;\n const walkY = (y - startY) * walkMultiplier;\n container.scrollLeft = scrollLeft - walkX;\n container.scrollTop = scrollTop - walkY;\n };\n\n const onPointerUp = (e: PointerEvent) => {\n if (e.pointerType !== \"mouse\") return;\n\n isDragging = false;\n document.body.style.cursor = \"unset\";\n container.style.cursor = \"unset\";\n };\n\n const onVisibilityChange = () => {\n isDragging = false;\n document.body.style.cursor = \"unset\";\n container.style.cursor = \"unset\";\n hasDragged = false;\n };\n\n const onClick = (e: MouseEvent) => {\n if (hasDragged) {\n e.preventDefault(); // Prevents anchor tag from navigating if dragging occurred\n e.stopPropagation();\n }\n };\n\n container.addEventListener(\"pointerdown\", onPointerDown);\n document.addEventListener(\"pointermove\", onPointerMove);\n document.addEventListener(\"pointerup\", onPointerUp);\n\n document.addEventListener(\"visibilitychange\", onVisibilityChange);\n\n // Prevent clicks on anchor tags after dragging\n container.querySelectorAll(\"a\").forEach((anchor) => {\n anchor.addEventListener(\"click\", onClick);\n });\n\n return () => {\n container.removeEventListener(\"pointerdown\", onPointerDown);\n document.removeEventListener(\"pointermove\", onPointerMove);\n document.removeEventListener(\"pointerup\", onPointerUp);\n\n document.removeEventListener(\"visibilitychange\", onVisibilityChange);\n\n container.querySelectorAll(\"a\").forEach((anchor) => {\n anchor.removeEventListener(\"click\", onClick);\n });\n };\n }, [draggable]);\n\n // #############################################################################\n // Render\n // #############################################################################\n return (\n <S.OuterContainer\n $align={align}\n $direction={direction}\n $showFadeStart={showFadeStart}\n $showFadeEnd={showFadeEnd}\n $fillType={fillType}\n $fillColor={fillColor}\n $gradientSize={gradientSize}\n className={className}\n >\n <S.ScrollContainer ref={containerRef} $direction={direction} $gap={gap}>\n {items.map((item, i) => (\n <S.Item\n key={item.id + i}\n className={SCROLL_CONTAINER_ITEM_CLASS_NAME}\n $draggable={!!draggable}\n >\n {item.render()}\n </S.Item>\n ))}\n </S.ScrollContainer>\n\n <S.LeftArrowIcon\n $show={showFadeStart && !hideArrows}\n $first\n $fillType={fillType}\n $fillColor={fillColor}\n $accentColor={accentColor}\n $direction={direction}\n $arrowFadeColor={arrowFadeColor}\n $circleArrowBackground={circleArrowBackground}\n onClick={() => handleArrowClick(true)}\n $arrowGap={arrowGap}\n >\n <S.ArrowIconSvg\n $arrowColor={arrowColor}\n width={arrowIcon?.width ?? (circleArrowBackground ? 10 : 8)}\n height={arrowIcon?.height ?? (circleArrowBackground ? 16 : 13)}\n src={arrowIconSrc}\n />\n </S.LeftArrowIcon>\n\n <S.RightArrowIcon\n $show={showFadeEnd && !hideArrows}\n $fillType={fillType}\n $fillColor={fillColor}\n $accentColor={accentColor}\n $direction={direction}\n $arrowFadeColor={arrowFadeColor}\n $circleArrowBackground={circleArrowBackground}\n onClick={() => handleArrowClick(false)}\n $arrowGap={arrowGap}\n >\n <S.ArrowIconSvg\n $arrowColor={arrowColor}\n width={arrowIcon?.width ?? (circleArrowBackground ? 10 : 8)}\n height={arrowIcon?.height ?? (circleArrowBackground ? 16 : 13)}\n src={arrowIconSrc}\n />\n </S.RightArrowIcon>\n </S.OuterContainer>\n );\n};\n"],"names":["SCROLL_CONTAINER_ITEM_CLASS_NAME","NEAR_BOUNDARY_WIDTH","ScrollWrapper","ScrollWrapper2","align","direction","items","fillType","fillColor","accentColor","arrowColor","scrollStepType","gap","className","arrowFadeColor","activeIndex","circleArrowBackground","arrowGap","gradientSize","hideArrows","onScrollChange","enableWheelScroll","arrowIcon","draggable","containerRef","useRef","containerMeasureRef","containerSize","useMeasure","useHorizontalScroll","useEffect","current","getContainerItemWidth","useCallback","containerItem","querySelector","getBoundingClientRect","width","getInvisibleItemOffset","scrollDirection","container","querySelectorAll","containerRect","isHorizontal","fadeSize","padding","parseFloat","window","getComputedStyle","offset","Math","max","containerEdgeWithoutPadding","item","Array","from","itemRect","right","abs","i","length","left","bottom","top","getVisibleItemsWidth","containerItems","visibleItemsWidth","forEach","height","getActiveIndexOffset","index","actNav","children","actNavRect","scrollLeft","FADE_BUTTON_SIZE","scrollTop","x","refScrollX","y","refScrollY","useScroll","windowSize","useWindowSize","scrollX","setScrollX","useState","scrollY","setScrollY","initScrollX","initScrollY","scrollWidth","showFadeStart","setShowFadeStart","showFadeEnd","setShowFadeEnd","offsetWidth","offsetHeight","scrollHeight","scrollXFixOffset","ceil","handleArrowClick","first","clientWidth","scrollPosition","scrollSize","scrollStep","newScrollPosition","newScrollPositionWithinBounds","min","possibleScroll","nearBoundary","scrollTo","behavior","setTimeout","arrowIconSrc","useMemo","icon","ArrowRightIcon","src","isDragging","hasDragged","startX","startY","onPointerDown","e","pointerType","buttons","pageX","offsetLeft","pageY","offsetTop","document","body","style","cursor","onPointerMove","preventDefault","walkMultiplier","walkX","walkY","onPointerUp","onVisibilityChange","onClick","stopPropagation","addEventListener","anchor","removeEventListener","jsxs","S.OuterContainer","OuterContainer","$align","$direction","$showFadeStart","$showFadeEnd","$fillType","$fillColor","$gradientSize","jsx","S.ScrollContainer","ScrollContainer","ref","$gap","map","S.Item","Item","$draggable","render","id","S.LeftArrowIcon","LeftArrowIcon","$show","$first","$accentColor","$arrowFadeColor","$circleArrowBackground","$arrowGap","S.ArrowIconSvg","ArrowIconSvg","$arrowColor","S.RightArrowIcon","RightArrowIcon"],"mappings":";;;;;;;;;;;;;;;;AASA,MAAMA,gCAAmC,GAAA,uBAAA;AAEzC,MAAMC,mBAAsB,GAAA,EAAA;AAEf,MAAAC,aAAA,GAAgB,SAASA,cAAcC,CAAA;EAClDC,KAAA;EACAC,SAAA;EACAC,KAAA;EACAC,QAAA;EACAC,SAAA;EACAC,WAAA;EACAC,UAAA;EACAC,cAAiB,GAAA,cAAA;EACjBC,GAAA;EACAC,SAA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qBAAA,GAAwB,EAAK,GAAA,CAAA,CAAA;QACzDoD,MAAQ,EAAA9C,SAAA,EAAW8C,MAAW,KAAApD,qBAAA,GAAwB,EAAK,GAAA,EAAA,CAAA;QAC3DuG,GAAK,EAAAJ;MAAA,CACP;IAAA,CACF,CAAA;EAAA,CAAA,CACF;AAEJ,CAAA;"}
|
|
@@ -28,9 +28,7 @@ const ScrollWrapper = function ScrollWrapper2({
|
|
|
28
28
|
onScrollChange,
|
|
29
29
|
enableWheelScroll,
|
|
30
30
|
arrowIcon,
|
|
31
|
-
draggable
|
|
32
|
-
alignActive = "center",
|
|
33
|
-
disableScrollToActive
|
|
31
|
+
draggable
|
|
34
32
|
}) {
|
|
35
33
|
const containerRef = useRef(null);
|
|
36
34
|
const [containerMeasureRef, containerSize] = useMeasure();
|
|
@@ -136,16 +134,10 @@ const ScrollWrapper = function ScrollWrapper2({
|
|
|
136
134
|
if (actNav) {
|
|
137
135
|
const actNavRect = actNav.getBoundingClientRect();
|
|
138
136
|
if (direction === "horizontal") {
|
|
139
|
-
if (
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
} else {
|
|
144
|
-
if (actNavRect.right > containerRect.right) {
|
|
145
|
-
offset.left = actNavRect.right - containerRect.right + containerRef.current.scrollLeft + (!hideArrows ? FADE_BUTTON_SIZE : 0) + containerRect.width / 2 - actNavRect.width / 2;
|
|
146
|
-
} else if (actNavRect.left < containerRect.left) {
|
|
147
|
-
offset.left = actNavRect.left - containerRect.left + containerRef.current.scrollLeft - (!hideArrows ? FADE_BUTTON_SIZE : 0) - containerRect.width / 2 + actNavRect.width / 2;
|
|
148
|
-
}
|
|
137
|
+
if (actNavRect.right > containerRect.right) {
|
|
138
|
+
offset.left = actNavRect.right - containerRect.right + containerRef.current.scrollLeft + (!hideArrows ? FADE_BUTTON_SIZE : 0) + containerRect.width / 2 - actNavRect.width / 2;
|
|
139
|
+
} else if (actNavRect.left < containerRect.left) {
|
|
140
|
+
offset.left = actNavRect.left - containerRect.left + containerRef.current.scrollLeft - (!hideArrows ? FADE_BUTTON_SIZE : 0) - containerRect.width / 2 + actNavRect.width / 2;
|
|
149
141
|
}
|
|
150
142
|
} else if (direction === "vertical") {
|
|
151
143
|
if (actNavRect.bottom > containerRect.bottom) {
|
|
@@ -156,7 +148,7 @@ const ScrollWrapper = function ScrollWrapper2({
|
|
|
156
148
|
}
|
|
157
149
|
}
|
|
158
150
|
return offset;
|
|
159
|
-
}, [direction,
|
|
151
|
+
}, [direction, hideArrows]);
|
|
160
152
|
const {
|
|
161
153
|
x: refScrollX,
|
|
162
154
|
y: refScrollY
|
|
@@ -272,7 +264,7 @@ const ScrollWrapper = function ScrollWrapper2({
|
|
|
272
264
|
}, [direction, scrollX, scrollY, scrollStepType, gap, getContainerItemWidth, getVisibleItemsWidth, getInvisibleItemOffset]);
|
|
273
265
|
useEffect(() => {
|
|
274
266
|
window.setTimeout(() => {
|
|
275
|
-
if (!containerRef.current
|
|
267
|
+
if (!containerRef.current) return;
|
|
276
268
|
if (activeIndex !== void 0 && activeIndex > -1) {
|
|
277
269
|
const offset = getActiveIndexOffset(activeIndex);
|
|
278
270
|
if (offset.left !== void 0) {
|
|
@@ -289,7 +281,7 @@ const ScrollWrapper = function ScrollWrapper2({
|
|
|
289
281
|
});
|
|
290
282
|
}
|
|
291
283
|
}, 0);
|
|
292
|
-
}, [activeIndex, getActiveIndexOffset
|
|
284
|
+
}, [activeIndex, getActiveIndexOffset]);
|
|
293
285
|
const arrowIconSrc = useMemo(() => {
|
|
294
286
|
const icon = arrowIcon?.icon ?? ArrowRightIcon__default;
|
|
295
287
|
return typeof icon === "string" ? icon : icon.src;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollWrapper.mjs","sources":["../../../src/components/ScrollWrapper/ScrollWrapper.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { useMeasure, useScroll, useWindowSize } from \"react-use\";\n\nimport ArrowRightIcon from \"../../assets/icons/arrowRight.svg\";\nimport { useHorizontalScroll } from \"../../hooks/useHorizontalScroll\";\nimport * as S from \"./ScrollWrapper.styles\";\nimport { FADE_BUTTON_SIZE } from \"./ScrollWrapper.styles\";\nimport type { ScrollWrapperProps } from \"./ScrollWrapper.types\";\n\nconst SCROLL_CONTAINER_ITEM_CLASS_NAME = \"scroll-container-item\";\n\nconst NEAR_BOUNDARY_WIDTH = 10;\n\nexport const ScrollWrapper = function ScrollWrapper({\n align,\n direction,\n items,\n fillType,\n fillColor,\n accentColor,\n arrowColor,\n scrollStepType = \"scrollScreen\",\n gap,\n className,\n arrowFadeColor,\n activeIndex,\n circleArrowBackground,\n arrowGap,\n gradientSize,\n hideArrows,\n onScrollChange,\n enableWheelScroll,\n arrowIcon,\n draggable,\n alignActive = \"center\",\n disableScrollToActive,\n}: ScrollWrapperProps) {\n // #############################################################################\n // Container ref\n // #############################################################################\n const containerRef = useRef<null | HTMLDivElement>(null);\n const [containerMeasureRef, containerSize] = useMeasure<HTMLDivElement>();\n\n useHorizontalScroll(containerRef, !!enableWheelScroll);\n\n // Set measure ref\n useEffect(() => {\n if (containerRef.current) {\n containerMeasureRef(containerRef.current);\n }\n }, [containerMeasureRef]);\n\n const getContainerItemWidth = useCallback((): number => {\n const containerItem = containerRef.current?.querySelector(\n `.${SCROLL_CONTAINER_ITEM_CLASS_NAME}`,\n );\n\n if (!containerItem) {\n return 0;\n }\n\n return containerItem.getBoundingClientRect().width;\n }, []);\n\n const getInvisibleItemOffset = useCallback(\n ({ scrollDirection }: { scrollDirection: 1 | -1 }): number => {\n if (!containerRef.current) {\n return 0; // If container is not available, return 0\n }\n\n const container = containerRef.current;\n const items = container.querySelectorAll(\n `.${SCROLL_CONTAINER_ITEM_CLASS_NAME}`,\n );\n const containerRect = container.getBoundingClientRect();\n const isHorizontal = direction === \"horizontal\";\n\n // Offset for gradient element, as it covers the last item\n const fadeSize = 20;\n\n if (isHorizontal) {\n const padding =\n scrollDirection === 1\n ? parseFloat(window.getComputedStyle(container)[\"paddingRight\"])\n : parseFloat(window.getComputedStyle(container)[\"paddingLeft\"]);\n const offset = Math.max(padding, fadeSize);\n const containerEdgeWithoutPadding =\n scrollDirection === 1\n ? containerRect[\"right\"] - offset\n : containerRect[\"left\"] + offset;\n\n if (scrollDirection === 1) {\n for (const item of Array.from(items)) {\n const itemRect = item.getBoundingClientRect();\n // Check if item is partially or fully invisible horizontally\n if (itemRect.right > containerEdgeWithoutPadding) {\n return Math.abs(itemRect.right - containerEdgeWithoutPadding);\n }\n }\n } else {\n for (let i = items.length - 1; i >= 0; i--) {\n const item = items[i];\n if (item) {\n const itemRect = item.getBoundingClientRect();\n // Check if item is partially or fully invisible horizontally\n if (itemRect.left < containerEdgeWithoutPadding) {\n return Math.abs(containerEdgeWithoutPadding - itemRect.left);\n }\n }\n }\n }\n } else {\n const padding =\n scrollDirection === 1\n ? parseFloat(window.getComputedStyle(container)[\"paddingBottom\"])\n : parseFloat(window.getComputedStyle(container)[\"paddingTop\"]);\n const offset = Math.max(padding, fadeSize);\n\n const containerEdgeWithoutPadding =\n scrollDirection === 1\n ? containerRect[\"bottom\"] - offset\n : containerRect[\"top\"] + offset;\n\n if (scrollDirection === 1) {\n for (const item of Array.from(items)) {\n const itemRect = item.getBoundingClientRect();\n // Check if item is partially or fully invisible vertically\n if (itemRect.bottom > containerEdgeWithoutPadding) {\n return Math.abs(itemRect.bottom - containerEdgeWithoutPadding);\n }\n }\n } else {\n for (let i = items.length - 1; i >= 0; i--) {\n const item = items[i];\n if (item) {\n const itemRect = item.getBoundingClientRect();\n // Check if item is partially or fully invisible vertically\n if (itemRect.top < containerEdgeWithoutPadding) {\n return Math.abs(containerEdgeWithoutPadding - itemRect.top);\n }\n }\n }\n }\n }\n\n // If all items are fully visible, return 0\n return 0;\n },\n [direction],\n );\n\n const getVisibleItemsWidth = useCallback((): number => {\n if (!containerRef.current) {\n return 0;\n }\n\n const containerRect = containerRef.current.getBoundingClientRect();\n const containerItems = containerRef.current.querySelectorAll(\n `.${SCROLL_CONTAINER_ITEM_CLASS_NAME}`,\n );\n\n let visibleItemsWidth = 0;\n\n containerItems.forEach((item) => {\n const itemRect = item.getBoundingClientRect();\n\n if (\n (direction === \"horizontal\" &&\n itemRect.left >= containerRect.left &&\n itemRect.right <= containerRect.right) ||\n (direction === \"vertical\" &&\n itemRect.top >= containerRect.top &&\n itemRect.bottom <= containerRect.bottom)\n ) {\n // Do not add gap for first item because gaps should always be \"gaps = items - 1\"\n if (visibleItemsWidth !== 0 && gap !== undefined) {\n visibleItemsWidth += gap;\n }\n\n visibleItemsWidth +=\n direction === \"horizontal\" ? itemRect.width : itemRect.height;\n }\n });\n\n return visibleItemsWidth;\n }, [direction, gap]);\n\n const getActiveIndexOffset = useCallback(\n (index: number): { left: number | undefined; top: number | undefined } => {\n const offset: { left: undefined | number; top: undefined | number } = {\n left: undefined,\n top: undefined,\n };\n if (!containerRef.current) {\n return offset;\n }\n\n const containerRect = containerRef.current.getBoundingClientRect();\n const actNav = containerRef.current.children[index] as HTMLElement;\n\n if (actNav) {\n const actNavRect = actNav.getBoundingClientRect();\n\n if (direction === \"horizontal\") {\n if (alignActive === \"left\") {\n // Align active item to the left\n if (\n actNavRect.left < containerRect.left ||\n actNavRect.right > containerRect.right\n ) {\n offset.left =\n actNavRect.left -\n containerRect.left +\n containerRef.current.scrollLeft;\n }\n } else {\n // Default behavior: Align active item to the center\n if (actNavRect.right > containerRect.right) {\n offset.left =\n actNavRect.right -\n containerRect.right +\n containerRef.current.scrollLeft +\n (!hideArrows ? FADE_BUTTON_SIZE : 0) +\n containerRect.width / 2 -\n actNavRect.width / 2;\n } else if (actNavRect.left < containerRect.left) {\n offset.left =\n actNavRect.left -\n containerRect.left +\n containerRef.current.scrollLeft -\n (!hideArrows ? FADE_BUTTON_SIZE : 0) -\n containerRect.width / 2 +\n actNavRect.width / 2;\n }\n }\n } else if (direction === \"vertical\") {\n if (actNavRect.bottom > containerRect.bottom) {\n offset.top =\n actNavRect.bottom -\n containerRect.bottom +\n containerRef.current.scrollTop +\n (!hideArrows ? FADE_BUTTON_SIZE : 0);\n } else if (actNavRect.top < containerRect.top) {\n offset.top =\n actNavRect.top -\n containerRect.top +\n containerRef.current.scrollTop +\n (!hideArrows ? FADE_BUTTON_SIZE : 0);\n }\n }\n }\n\n return offset;\n },\n [direction, alignActive, hideArrows],\n );\n\n // #############################################################################\n // Handle scrolling\n // #############################################################################\n const { x: refScrollX, y: refScrollY } = useScroll(containerRef);\n // Keep track of window size to detect resize\n const windowSize = useWindowSize();\n\n // Keep track of the current scroll position and size\n // State is needed due to initial not being tracked by useScroll\n const [scrollX, setScrollX] = useState(0);\n const [scrollY, setScrollY] = useState(0);\n\n // Set initial data\n useEffect(() => {\n if (!containerRef.current) return;\n\n const initScrollX = containerRef.current.scrollLeft;\n const initScrollY = containerRef.current.scrollTop;\n\n setScrollX(initScrollX);\n setScrollY(initScrollY);\n\n onScrollChange?.({\n scrollX: initScrollX,\n scrollY: initScrollY,\n scrollWidth: containerRef.current.scrollWidth,\n });\n }, [onScrollChange]);\n\n // Set scroll positions on scroll and resize\n useEffect(() => {\n setScrollX(refScrollX);\n setScrollY(refScrollY);\n\n onScrollChange?.({\n scrollX: refScrollX,\n scrollY: refScrollY,\n scrollWidth: containerRef.current?.scrollWidth ?? 0,\n });\n }, [\n // HACK: needed windowSize to retrigger the effect\n windowSize,\n // #############################################################################\n onScrollChange,\n refScrollX,\n refScrollY,\n ]);\n\n // #############################################################################\n // Parse fade display state\n // #############################################################################\n const [showFadeStart, setShowFadeStart] = useState(false);\n const [showFadeEnd, setShowFadeEnd] = useState(false);\n\n useEffect(() => {\n if (!containerRef.current) return;\n\n const width = containerRef.current.offsetWidth;\n const height = containerRef.current.offsetHeight;\n const scrollWidth = containerRef.current.scrollWidth;\n const scrollHeight = containerRef.current.scrollHeight;\n\n // 1px added to fix issue with 1 pixel (sometimes arrow doesn't disappear when it should)\n // happens only when scroll behavior is smooth\n const scrollXFixOffset = 1;\n\n switch (direction) {\n case \"horizontal\":\n setShowFadeStart(scrollX > 0);\n\n setShowFadeEnd(\n Math.ceil(scrollX + scrollXFixOffset) < scrollWidth - width,\n );\n break;\n case \"vertical\":\n setShowFadeStart(scrollY > 0);\n setShowFadeEnd(\n Math.ceil(scrollY + scrollXFixOffset) < scrollHeight - height,\n );\n break;\n }\n }, [\n // HACK: needed windowSize, containerSize.width to retrigger the effect\n containerSize.width,\n windowSize,\n // #############################################################################\n direction,\n scrollX,\n scrollY,\n items,\n ]);\n\n // #############################################################################\n // Handle arrow click scroll\n // #############################################################################\n const handleArrowClick = useCallback(\n (first: boolean) => {\n // Ensure the container reference is available\n const container = containerRef.current;\n if (!container) return;\n\n // Determine the scroll direction based on the `first` parameter\n const scrollDirection = first ? -1 : 1;\n\n // Destructure properties from the container for ease of use\n const {\n scrollWidth,\n scrollHeight,\n offsetWidth,\n offsetHeight,\n clientWidth,\n } = container;\n\n // Determine if the scrolling direction is horizontal or vertical\n const isHorizontal = direction === \"horizontal\";\n const scrollPosition = isHorizontal ? scrollX : scrollY;\n const scrollSize = isHorizontal ? scrollWidth : scrollHeight;\n\n // Calculate the scroll step based on the scrollStepType\n let scrollStep = 0;\n switch (scrollStepType) {\n case \"scrollScreen\":\n scrollStep = isHorizontal ? offsetWidth : offsetHeight;\n break;\n case \"itemWidth\":\n scrollStep = getContainerItemWidth();\n break;\n case \"visibleItemsWidth\":\n scrollStep = getVisibleItemsWidth();\n break;\n case \"nextItem\":\n scrollStep = getInvisibleItemOffset({\n scrollDirection,\n });\n break;\n }\n\n // Calculate the new scroll position\n const newScrollPosition =\n scrollPosition + scrollDirection * (scrollStep + (gap ?? 0));\n\n // Ensure the new scroll position is within bounds\n const newScrollPositionWithinBounds = Math.max(\n 0,\n Math.min(scrollSize - scrollStep, newScrollPosition),\n );\n\n // Calculate the possible scroll amount\n const possibleScroll = scrollSize - clientWidth;\n const nearBoundary = NEAR_BOUNDARY_WIDTH;\n\n // Scroll to the beginning if the new position is near the start\n if (newScrollPosition < nearBoundary || newScrollPosition < 0) {\n container.scrollTo({\n left: 0,\n top: 0,\n behavior: \"smooth\",\n });\n return;\n }\n\n // Scroll to the end if the new position is near the end\n if (\n possibleScroll - newScrollPosition < nearBoundary ||\n newScrollPosition > possibleScroll\n ) {\n container.scrollTo({\n left: possibleScroll,\n top: possibleScroll,\n behavior: \"smooth\",\n });\n return;\n }\n\n // Smooth scroll to the new position within bounds\n container.scrollTo({\n left: isHorizontal ? newScrollPositionWithinBounds : undefined,\n top: !isHorizontal ? newScrollPositionWithinBounds : undefined,\n behavior: \"smooth\",\n });\n },\n [\n direction,\n scrollX,\n scrollY,\n scrollStepType,\n gap,\n getContainerItemWidth,\n getVisibleItemsWidth,\n getInvisibleItemOffset,\n ],\n );\n\n // #############################################################################\n // Scroll to start or active index on mount\n // #############################################################################\n useEffect(() => {\n window.setTimeout(() => {\n if (!containerRef.current || disableScrollToActive) return;\n\n // Scroll into view, if activeIndex is provided\n if (activeIndex !== undefined && activeIndex > -1) {\n const offset = getActiveIndexOffset(activeIndex);\n\n if (offset.left !== undefined) {\n containerRef.current.scrollLeft = offset.left;\n }\n if (offset.top !== undefined) {\n containerRef.current.scrollTop = offset.top;\n }\n } else {\n containerRef.current.scrollTo({\n left: 0,\n top: 0,\n behavior: \"smooth\",\n });\n }\n }, 0);\n }, [activeIndex, getActiveIndexOffset, disableScrollToActive]);\n\n // #############################################################################\n // Arrow icon\n // #############################################################################\n const arrowIconSrc = useMemo(() => {\n const icon = arrowIcon?.icon ?? ArrowRightIcon;\n\n return typeof icon === \"string\" ? icon : icon.src;\n }, [arrowIcon]);\n\n // #############################################################################\n // Handle drag scroll\n // #############################################################################\n useEffect(() => {\n if (!draggable || !containerRef.current) return;\n\n const container = containerRef.current;\n let isDragging = false;\n let hasDragged = false;\n let startX = 0;\n let startY = 0;\n let scrollLeft = 0;\n let scrollTop = 0;\n\n const onPointerDown = (e: PointerEvent) => {\n if (e.pointerType !== \"mouse\" || e.buttons !== 1) return;\n\n isDragging = true;\n hasDragged = false;\n startX = e.pageX - container.offsetLeft;\n startY = e.pageY - container.offsetTop;\n scrollLeft = container.scrollLeft;\n scrollTop = container.scrollTop;\n document.body.style.cursor = \"grabbing\";\n container.style.cursor = \"grabbing\";\n };\n\n const onPointerMove = (e: PointerEvent) => {\n if (e.pointerType !== \"mouse\") return;\n\n if (!isDragging) return;\n\n e.preventDefault();\n hasDragged = true;\n\n const walkMultiplier = 1; // Adjust the multiplier for faster/slower scrolling\n\n const x = e.pageX - container.offsetLeft;\n const y = e.pageY - container.offsetTop;\n const walkX = (x - startX) * walkMultiplier;\n const walkY = (y - startY) * walkMultiplier;\n container.scrollLeft = scrollLeft - walkX;\n container.scrollTop = scrollTop - walkY;\n };\n\n const onPointerUp = (e: PointerEvent) => {\n if (e.pointerType !== \"mouse\") return;\n\n isDragging = false;\n document.body.style.cursor = \"unset\";\n container.style.cursor = \"unset\";\n };\n\n const onVisibilityChange = () => {\n isDragging = false;\n document.body.style.cursor = \"unset\";\n container.style.cursor = \"unset\";\n hasDragged = false;\n };\n\n const onClick = (e: MouseEvent) => {\n if (hasDragged) {\n e.preventDefault(); // Prevents anchor tag from navigating if dragging occurred\n e.stopPropagation();\n }\n };\n\n container.addEventListener(\"pointerdown\", onPointerDown);\n document.addEventListener(\"pointermove\", onPointerMove);\n document.addEventListener(\"pointerup\", onPointerUp);\n\n document.addEventListener(\"visibilitychange\", onVisibilityChange);\n\n // Prevent clicks on anchor tags after dragging\n container.querySelectorAll(\"a\").forEach((anchor) => {\n anchor.addEventListener(\"click\", onClick);\n });\n\n return () => {\n container.removeEventListener(\"pointerdown\", onPointerDown);\n document.removeEventListener(\"pointermove\", onPointerMove);\n document.removeEventListener(\"pointerup\", onPointerUp);\n\n document.removeEventListener(\"visibilitychange\", onVisibilityChange);\n\n container.querySelectorAll(\"a\").forEach((anchor) => {\n anchor.removeEventListener(\"click\", onClick);\n });\n };\n }, [draggable]);\n\n // #############################################################################\n // Render\n // #############################################################################\n return (\n <S.OuterContainer\n $align={align}\n $direction={direction}\n $showFadeStart={showFadeStart}\n $showFadeEnd={showFadeEnd}\n $fillType={fillType}\n $fillColor={fillColor}\n $gradientSize={gradientSize}\n className={className}\n >\n <S.ScrollContainer ref={containerRef} $direction={direction} $gap={gap}>\n {items.map((item, i) => (\n <S.Item\n key={item.id + i}\n className={SCROLL_CONTAINER_ITEM_CLASS_NAME}\n $draggable={!!draggable}\n >\n {item.render()}\n </S.Item>\n ))}\n </S.ScrollContainer>\n\n <S.LeftArrowIcon\n $show={showFadeStart && !hideArrows}\n $first\n $fillType={fillType}\n $fillColor={fillColor}\n $accentColor={accentColor}\n $direction={direction}\n $arrowFadeColor={arrowFadeColor}\n $circleArrowBackground={circleArrowBackground}\n onClick={() => handleArrowClick(true)}\n $arrowGap={arrowGap}\n >\n <S.ArrowIconSvg\n $arrowColor={arrowColor}\n width={arrowIcon?.width ?? (circleArrowBackground ? 10 : 8)}\n height={arrowIcon?.height ?? (circleArrowBackground ? 16 : 13)}\n src={arrowIconSrc}\n />\n </S.LeftArrowIcon>\n\n <S.RightArrowIcon\n $show={showFadeEnd && !hideArrows}\n $fillType={fillType}\n $fillColor={fillColor}\n $accentColor={accentColor}\n $direction={direction}\n $arrowFadeColor={arrowFadeColor}\n $circleArrowBackground={circleArrowBackground}\n onClick={() => handleArrowClick(false)}\n $arrowGap={arrowGap}\n >\n <S.ArrowIconSvg\n $arrowColor={arrowColor}\n width={arrowIcon?.width ?? (circleArrowBackground ? 10 : 8)}\n height={arrowIcon?.height ?? (circleArrowBackground ? 16 : 13)}\n src={arrowIconSrc}\n />\n </S.RightArrowIcon>\n </S.OuterContainer>\n );\n};\n"],"names":["SCROLL_CONTAINER_ITEM_CLASS_NAME","NEAR_BOUNDARY_WIDTH","ScrollWrapper","ScrollWrapper2","align","direction","items","fillType","fillColor","accentColor","arrowColor","scrollStepType","gap","className","arrowFadeColor","activeIndex","circleArrowBackground","arrowGap","gradientSize","hideArrows","onScrollChange","enableWheelScroll","arrowIcon","draggable","alignActive","disableScrollToActive","containerRef","useRef","containerMeasureRef","containerSize","useMeasure","useHorizontalScroll","useEffect","current","getContainerItemWidth","useCallback","containerItem","querySelector","getBoundingClientRect","width","getInvisibleItemOffset","scrollDirection","container","querySelectorAll","containerRect","isHorizontal","fadeSize","padding","parseFloat","window","getComputedStyle","offset","Math","max","containerEdgeWithoutPadding","item","Array","from","itemRect","right","abs","i","length","left","bottom","top","getVisibleItemsWidth","containerItems","visibleItemsWidth","forEach","height","getActiveIndexOffset","index","actNav","children","actNavRect","scrollLeft","FADE_BUTTON_SIZE","scrollTop","x","refScrollX","y","refScrollY","useScroll","windowSize","useWindowSize","scrollX","setScrollX","useState","scrollY","setScrollY","initScrollX","initScrollY","scrollWidth","showFadeStart","setShowFadeStart","showFadeEnd","setShowFadeEnd","offsetWidth","offsetHeight","scrollHeight","scrollXFixOffset","ceil","handleArrowClick","first","clientWidth","scrollPosition","scrollSize","scrollStep","newScrollPosition","newScrollPositionWithinBounds","min","possibleScroll","nearBoundary","scrollTo","behavior","setTimeout","arrowIconSrc","useMemo","icon","ArrowRightIcon","src","isDragging","hasDragged","startX","startY","onPointerDown","e","pointerType","buttons","pageX","offsetLeft","pageY","offsetTop","document","body","style","cursor","onPointerMove","preventDefault","walkMultiplier","walkX","walkY","onPointerUp","onVisibilityChange","onClick","stopPropagation","addEventListener","anchor","removeEventListener","jsxs","S.OuterContainer","$align","$direction","$showFadeStart","$showFadeEnd","$fillType","$fillColor","$gradientSize","jsx","S.ScrollContainer","ref","$gap","map","S.Item","$draggable","render","id","S.LeftArrowIcon","$show","$first","$accentColor","$arrowFadeColor","$circleArrowBackground","$arrowGap","S.ArrowIconSvg","$arrowColor","S.RightArrowIcon"],"mappings":";;;;;;;;AASA,MAAMA,gCAAmC,GAAA,uBAAA;AAEzC,MAAMC,mBAAsB,GAAA,EAAA;AAEf,MAAAC,aAAA,GAAgB,SAASA,cAAcC,CAAA;EAClDC,K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,UAAA;QACb6B,KAAO,EAAAjB,SAAA,EAAWiB,KAAU,KAAAvB,qBAAA,GAAwB,EAAK,GAAA,CAAA,CAAA;QACzDsD,MAAQ,EAAAhD,SAAA,EAAWgD,MAAW,KAAAtD,qBAAA,GAAwB,EAAK,GAAA,EAAA,CAAA;QAC3DyG,GAAK,EAAAJ;MAAA,CACP;IAAA,CACF,CAAA;EAAA,CAAA,CACF;AAEJ,CAAA;"}
|
|
1
|
+
{"version":3,"file":"ScrollWrapper.mjs","sources":["../../../src/components/ScrollWrapper/ScrollWrapper.tsx"],"sourcesContent":["import { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { useMeasure, useScroll, useWindowSize } from \"react-use\";\n\nimport ArrowRightIcon from \"../../assets/icons/arrowRight.svg\";\nimport { useHorizontalScroll } from \"../../hooks/useHorizontalScroll\";\nimport * as S from \"./ScrollWrapper.styles\";\nimport { FADE_BUTTON_SIZE } from \"./ScrollWrapper.styles\";\nimport type { ScrollWrapperProps } from \"./ScrollWrapper.types\";\n\nconst SCROLL_CONTAINER_ITEM_CLASS_NAME = \"scroll-container-item\";\n\nconst NEAR_BOUNDARY_WIDTH = 10;\n\nexport const ScrollWrapper = function ScrollWrapper({\n align,\n direction,\n items,\n fillType,\n fillColor,\n accentColor,\n arrowColor,\n scrollStepType = \"scrollScreen\",\n gap,\n className,\n arrowFadeColor,\n activeIndex,\n circleArrowBackground,\n arrowGap,\n gradientSize,\n hideArrows,\n onScrollChange,\n enableWheelScroll,\n arrowIcon,\n draggable,\n}: ScrollWrapperProps) {\n // #############################################################################\n // Container ref\n // #############################################################################\n const containerRef = useRef<null | HTMLDivElement>(null);\n const [containerMeasureRef, containerSize] = useMeasure<HTMLDivElement>();\n\n useHorizontalScroll(containerRef, !!enableWheelScroll);\n\n // Set measure ref\n useEffect(() => {\n if (containerRef.current) {\n containerMeasureRef(containerRef.current);\n }\n }, [containerMeasureRef]);\n\n const getContainerItemWidth = useCallback((): number => {\n const containerItem = containerRef.current?.querySelector(\n `.${SCROLL_CONTAINER_ITEM_CLASS_NAME}`,\n );\n\n if (!containerItem) {\n return 0;\n }\n\n return containerItem.getBoundingClientRect().width;\n }, []);\n\n const getInvisibleItemOffset = useCallback(\n ({ scrollDirection }: { scrollDirection: 1 | -1 }): number => {\n if (!containerRef.current) {\n return 0; // If container is not available, return 0\n }\n\n const container = containerRef.current;\n const items = container.querySelectorAll(\n `.${SCROLL_CONTAINER_ITEM_CLASS_NAME}`,\n );\n const containerRect = container.getBoundingClientRect();\n const isHorizontal = direction === \"horizontal\";\n\n // Offset for gradient element, as it covers the last item\n const fadeSize = 20;\n\n if (isHorizontal) {\n const padding =\n scrollDirection === 1\n ? parseFloat(window.getComputedStyle(container)[\"paddingRight\"])\n : parseFloat(window.getComputedStyle(container)[\"paddingLeft\"]);\n const offset = Math.max(padding, fadeSize);\n const containerEdgeWithoutPadding =\n scrollDirection === 1\n ? containerRect[\"right\"] - offset\n : containerRect[\"left\"] + offset;\n\n if (scrollDirection === 1) {\n for (const item of Array.from(items)) {\n const itemRect = item.getBoundingClientRect();\n // Check if item is partially or fully invisible horizontally\n if (itemRect.right > containerEdgeWithoutPadding) {\n return Math.abs(itemRect.right - containerEdgeWithoutPadding);\n }\n }\n } else {\n for (let i = items.length - 1; i >= 0; i--) {\n const item = items[i];\n if (item) {\n const itemRect = item.getBoundingClientRect();\n // Check if item is partially or fully invisible horizontally\n if (itemRect.left < containerEdgeWithoutPadding) {\n return Math.abs(containerEdgeWithoutPadding - itemRect.left);\n }\n }\n }\n }\n } else {\n const padding =\n scrollDirection === 1\n ? parseFloat(window.getComputedStyle(container)[\"paddingBottom\"])\n : parseFloat(window.getComputedStyle(container)[\"paddingTop\"]);\n const offset = Math.max(padding, fadeSize);\n\n const containerEdgeWithoutPadding =\n scrollDirection === 1\n ? containerRect[\"bottom\"] - offset\n : containerRect[\"top\"] + offset;\n\n if (scrollDirection === 1) {\n for (const item of Array.from(items)) {\n const itemRect = item.getBoundingClientRect();\n // Check if item is partially or fully invisible vertically\n if (itemRect.bottom > containerEdgeWithoutPadding) {\n return Math.abs(itemRect.bottom - containerEdgeWithoutPadding);\n }\n }\n } else {\n for (let i = items.length - 1; i >= 0; i--) {\n const item = items[i];\n if (item) {\n const itemRect = item.getBoundingClientRect();\n // Check if item is partially or fully invisible vertically\n if (itemRect.top < containerEdgeWithoutPadding) {\n return Math.abs(containerEdgeWithoutPadding - itemRect.top);\n }\n }\n }\n }\n }\n\n // If all items are fully visible, return 0\n return 0;\n },\n [direction],\n );\n\n const getVisibleItemsWidth = useCallback((): number => {\n if (!containerRef.current) {\n return 0;\n }\n\n const containerRect = containerRef.current.getBoundingClientRect();\n const containerItems = containerRef.current.querySelectorAll(\n `.${SCROLL_CONTAINER_ITEM_CLASS_NAME}`,\n );\n\n let visibleItemsWidth = 0;\n\n containerItems.forEach((item) => {\n const itemRect = item.getBoundingClientRect();\n\n if (\n (direction === \"horizontal\" &&\n itemRect.left >= containerRect.left &&\n itemRect.right <= containerRect.right) ||\n (direction === \"vertical\" &&\n itemRect.top >= containerRect.top &&\n itemRect.bottom <= containerRect.bottom)\n ) {\n // Do not add gap for first item because gaps should always be \"gaps = items - 1\"\n if (visibleItemsWidth !== 0 && gap !== undefined) {\n visibleItemsWidth += gap;\n }\n\n visibleItemsWidth +=\n direction === \"horizontal\" ? itemRect.width : itemRect.height;\n }\n });\n\n return visibleItemsWidth;\n }, [direction, gap]);\n\n const getActiveIndexOffset = useCallback(\n (index: number): { left: number | undefined; top: number | undefined } => {\n const offset: { left: undefined | number; top: undefined | number } = {\n left: undefined,\n top: undefined,\n };\n if (!containerRef.current) {\n return offset;\n }\n\n const containerRect = containerRef.current.getBoundingClientRect();\n const actNav = containerRef.current.children[index] as HTMLElement;\n\n if (actNav) {\n const actNavRect = actNav.getBoundingClientRect();\n\n if (direction === \"horizontal\") {\n if (actNavRect.right > containerRect.right) {\n offset.left =\n actNavRect.right -\n containerRect.right +\n containerRef.current.scrollLeft +\n (!hideArrows ? FADE_BUTTON_SIZE : 0) +\n containerRect.width / 2 -\n actNavRect.width / 2;\n } else if (actNavRect.left < containerRect.left) {\n offset.left =\n actNavRect.left -\n containerRect.left +\n containerRef.current.scrollLeft -\n (!hideArrows ? FADE_BUTTON_SIZE : 0) -\n containerRect.width / 2 +\n actNavRect.width / 2;\n }\n } else if (direction === \"vertical\") {\n if (actNavRect.bottom > containerRect.bottom) {\n offset.top =\n actNavRect.bottom -\n containerRect.bottom +\n containerRef.current.scrollTop +\n (!hideArrows ? FADE_BUTTON_SIZE : 0);\n } else if (actNavRect.top < containerRect.top) {\n offset.top =\n actNavRect.top -\n containerRect.top +\n containerRef.current.scrollTop +\n (!hideArrows ? FADE_BUTTON_SIZE : 0);\n }\n }\n }\n return offset;\n },\n [direction, hideArrows],\n );\n\n // #############################################################################\n // Handle scrolling\n // #############################################################################\n const { x: refScrollX, y: refScrollY } = useScroll(containerRef);\n // Keep track of window size to detect resize\n const windowSize = useWindowSize();\n\n // Keep track of the current scroll position and size\n // State is needed due to initial not being tracked by useScroll\n const [scrollX, setScrollX] = useState(0);\n const [scrollY, setScrollY] = useState(0);\n\n // Set initial data\n useEffect(() => {\n if (!containerRef.current) return;\n\n const initScrollX = containerRef.current.scrollLeft;\n const initScrollY = containerRef.current.scrollTop;\n\n setScrollX(initScrollX);\n setScrollY(initScrollY);\n\n onScrollChange?.({\n scrollX: initScrollX,\n scrollY: initScrollY,\n scrollWidth: containerRef.current.scrollWidth,\n });\n }, [onScrollChange]);\n\n // Set scroll positions on scroll and resize\n useEffect(() => {\n setScrollX(refScrollX);\n setScrollY(refScrollY);\n\n onScrollChange?.({\n scrollX: refScrollX,\n scrollY: refScrollY,\n scrollWidth: containerRef.current?.scrollWidth ?? 0,\n });\n }, [\n // HACK: needed windowSize to retrigger the effect\n windowSize,\n // #############################################################################\n onScrollChange,\n refScrollX,\n refScrollY,\n ]);\n\n // #############################################################################\n // Parse fade display state\n // #############################################################################\n const [showFadeStart, setShowFadeStart] = useState(false);\n const [showFadeEnd, setShowFadeEnd] = useState(false);\n\n useEffect(() => {\n if (!containerRef.current) return;\n\n const width = containerRef.current.offsetWidth;\n const height = containerRef.current.offsetHeight;\n const scrollWidth = containerRef.current.scrollWidth;\n const scrollHeight = containerRef.current.scrollHeight;\n\n // 1px added to fix issue with 1 pixel (sometimes arrow doesn't disappear when it should)\n // happens only when scroll behavior is smooth\n const scrollXFixOffset = 1;\n\n switch (direction) {\n case \"horizontal\":\n setShowFadeStart(scrollX > 0);\n\n setShowFadeEnd(\n Math.ceil(scrollX + scrollXFixOffset) < scrollWidth - width,\n );\n break;\n case \"vertical\":\n setShowFadeStart(scrollY > 0);\n setShowFadeEnd(\n Math.ceil(scrollY + scrollXFixOffset) < scrollHeight - height,\n );\n break;\n }\n }, [\n // HACK: needed windowSize, containerSize.width to retrigger the effect\n containerSize.width,\n windowSize,\n // #############################################################################\n direction,\n scrollX,\n scrollY,\n items,\n ]);\n\n // #############################################################################\n // Handle arrow click scroll\n // #############################################################################\n const handleArrowClick = useCallback(\n (first: boolean) => {\n // Ensure the container reference is available\n const container = containerRef.current;\n if (!container) return;\n\n // Determine the scroll direction based on the `first` parameter\n const scrollDirection = first ? -1 : 1;\n\n // Destructure properties from the container for ease of use\n const {\n scrollWidth,\n scrollHeight,\n offsetWidth,\n offsetHeight,\n clientWidth,\n } = container;\n\n // Determine if the scrolling direction is horizontal or vertical\n const isHorizontal = direction === \"horizontal\";\n const scrollPosition = isHorizontal ? scrollX : scrollY;\n const scrollSize = isHorizontal ? scrollWidth : scrollHeight;\n\n // Calculate the scroll step based on the scrollStepType\n let scrollStep = 0;\n switch (scrollStepType) {\n case \"scrollScreen\":\n scrollStep = isHorizontal ? offsetWidth : offsetHeight;\n break;\n case \"itemWidth\":\n scrollStep = getContainerItemWidth();\n break;\n case \"visibleItemsWidth\":\n scrollStep = getVisibleItemsWidth();\n break;\n case \"nextItem\":\n scrollStep = getInvisibleItemOffset({\n scrollDirection,\n });\n break;\n }\n\n // Calculate the new scroll position\n const newScrollPosition =\n scrollPosition + scrollDirection * (scrollStep + (gap ?? 0));\n\n // Ensure the new scroll position is within bounds\n const newScrollPositionWithinBounds = Math.max(\n 0,\n Math.min(scrollSize - scrollStep, newScrollPosition),\n );\n\n // Calculate the possible scroll amount\n const possibleScroll = scrollSize - clientWidth;\n const nearBoundary = NEAR_BOUNDARY_WIDTH;\n\n // Scroll to the beginning if the new position is near the start\n if (newScrollPosition < nearBoundary || newScrollPosition < 0) {\n container.scrollTo({\n left: 0,\n top: 0,\n behavior: \"smooth\",\n });\n return;\n }\n\n // Scroll to the end if the new position is near the end\n if (\n possibleScroll - newScrollPosition < nearBoundary ||\n newScrollPosition > possibleScroll\n ) {\n container.scrollTo({\n left: possibleScroll,\n top: possibleScroll,\n behavior: \"smooth\",\n });\n return;\n }\n\n // Smooth scroll to the new position within bounds\n container.scrollTo({\n left: isHorizontal ? newScrollPositionWithinBounds : undefined,\n top: !isHorizontal ? newScrollPositionWithinBounds : undefined,\n behavior: \"smooth\",\n });\n },\n [\n direction,\n scrollX,\n scrollY,\n scrollStepType,\n gap,\n getContainerItemWidth,\n getVisibleItemsWidth,\n getInvisibleItemOffset,\n ],\n );\n\n // #############################################################################\n // Scroll to start or active index on mount\n // #############################################################################\n useEffect(() => {\n window.setTimeout(() => {\n if (!containerRef.current) return;\n\n // Scroll into view, if activeIndex is provided\n if (activeIndex !== undefined && activeIndex > -1) {\n const offset = getActiveIndexOffset(activeIndex);\n\n if (offset.left !== undefined) {\n containerRef.current.scrollLeft = offset.left;\n }\n if (offset.top !== undefined) {\n containerRef.current.scrollTop = offset.top;\n }\n } else {\n containerRef.current.scrollTo({\n left: 0,\n top: 0,\n behavior: \"smooth\",\n });\n }\n }, 0);\n }, [activeIndex, getActiveIndexOffset]);\n\n // #############################################################################\n // Arrow icon\n // #############################################################################\n const arrowIconSrc = useMemo(() => {\n const icon = arrowIcon?.icon ?? ArrowRightIcon;\n\n return typeof icon === \"string\" ? icon : icon.src;\n }, [arrowIcon]);\n\n // #############################################################################\n // Handle drag scroll\n // #############################################################################\n useEffect(() => {\n if (!draggable || !containerRef.current) return;\n\n const container = containerRef.current;\n let isDragging = false;\n let hasDragged = false;\n let startX = 0;\n let startY = 0;\n let scrollLeft = 0;\n let scrollTop = 0;\n\n const onPointerDown = (e: PointerEvent) => {\n if (e.pointerType !== \"mouse\" || e.buttons !== 1) return;\n\n isDragging = true;\n hasDragged = false;\n startX = e.pageX - container.offsetLeft;\n startY = e.pageY - container.offsetTop;\n scrollLeft = container.scrollLeft;\n scrollTop = container.scrollTop;\n document.body.style.cursor = \"grabbing\";\n container.style.cursor = \"grabbing\";\n };\n\n const onPointerMove = (e: PointerEvent) => {\n if (e.pointerType !== \"mouse\") return;\n\n if (!isDragging) return;\n\n e.preventDefault();\n hasDragged = true;\n\n const walkMultiplier = 1; // Adjust the multiplier for faster/slower scrolling\n\n const x = e.pageX - container.offsetLeft;\n const y = e.pageY - container.offsetTop;\n const walkX = (x - startX) * walkMultiplier;\n const walkY = (y - startY) * walkMultiplier;\n container.scrollLeft = scrollLeft - walkX;\n container.scrollTop = scrollTop - walkY;\n };\n\n const onPointerUp = (e: PointerEvent) => {\n if (e.pointerType !== \"mouse\") return;\n\n isDragging = false;\n document.body.style.cursor = \"unset\";\n container.style.cursor = \"unset\";\n };\n\n const onVisibilityChange = () => {\n isDragging = false;\n document.body.style.cursor = \"unset\";\n container.style.cursor = \"unset\";\n hasDragged = false;\n };\n\n const onClick = (e: MouseEvent) => {\n if (hasDragged) {\n e.preventDefault(); // Prevents anchor tag from navigating if dragging occurred\n e.stopPropagation();\n }\n };\n\n container.addEventListener(\"pointerdown\", onPointerDown);\n document.addEventListener(\"pointermove\", onPointerMove);\n document.addEventListener(\"pointerup\", onPointerUp);\n\n document.addEventListener(\"visibilitychange\", onVisibilityChange);\n\n // Prevent clicks on anchor tags after dragging\n container.querySelectorAll(\"a\").forEach((anchor) => {\n anchor.addEventListener(\"click\", onClick);\n });\n\n return () => {\n container.removeEventListener(\"pointerdown\", onPointerDown);\n document.removeEventListener(\"pointermove\", onPointerMove);\n document.removeEventListener(\"pointerup\", onPointerUp);\n\n document.removeEventListener(\"visibilitychange\", onVisibilityChange);\n\n container.querySelectorAll(\"a\").forEach((anchor) => {\n anchor.removeEventListener(\"click\", onClick);\n });\n };\n }, [draggable]);\n\n // #############################################################################\n // Render\n // #############################################################################\n return (\n <S.OuterContainer\n $align={align}\n $direction={direction}\n $showFadeStart={showFadeStart}\n $showFadeEnd={showFadeEnd}\n $fillType={fillType}\n $fillColor={fillColor}\n $gradientSize={gradientSize}\n className={className}\n >\n <S.ScrollContainer ref={containerRef} $direction={direction} $gap={gap}>\n {items.map((item, i) => (\n <S.Item\n key={item.id + i}\n className={SCROLL_CONTAINER_ITEM_CLASS_NAME}\n $draggable={!!draggable}\n >\n {item.render()}\n </S.Item>\n ))}\n </S.ScrollContainer>\n\n <S.LeftArrowIcon\n $show={showFadeStart && !hideArrows}\n $first\n $fillType={fillType}\n $fillColor={fillColor}\n $accentColor={accentColor}\n $direction={direction}\n $arrowFadeColor={arrowFadeColor}\n $circleArrowBackground={circleArrowBackground}\n onClick={() => handleArrowClick(true)}\n $arrowGap={arrowGap}\n >\n <S.ArrowIconSvg\n $arrowColor={arrowColor}\n width={arrowIcon?.width ?? (circleArrowBackground ? 10 : 8)}\n height={arrowIcon?.height ?? (circleArrowBackground ? 16 : 13)}\n src={arrowIconSrc}\n />\n </S.LeftArrowIcon>\n\n <S.RightArrowIcon\n $show={showFadeEnd && !hideArrows}\n $fillType={fillType}\n $fillColor={fillColor}\n $accentColor={accentColor}\n $direction={direction}\n $arrowFadeColor={arrowFadeColor}\n $circleArrowBackground={circleArrowBackground}\n onClick={() => handleArrowClick(false)}\n $arrowGap={arrowGap}\n >\n <S.ArrowIconSvg\n $arrowColor={arrowColor}\n width={arrowIcon?.width ?? (circleArrowBackground ? 10 : 8)}\n height={arrowIcon?.height ?? (circleArrowBackground ? 16 : 13)}\n src={arrowIconSrc}\n />\n </S.RightArrowIcon>\n </S.OuterContainer>\n );\n};\n"],"names":["SCROLL_CONTAINER_ITEM_CLASS_NAME","NEAR_BOUNDARY_WIDTH","ScrollWrapper","ScrollWrapper2","align","direction","items","fillType","fillColor","accentColor","arrowColor","scrollStepType","gap","className","arrowFadeColor","activeIndex","circleArrowBackground","arrowGap","gradientSize","hideArrows","onScrollChange","enableWheelScroll","arrowIcon","draggable","containerRef","useRef","containerMeasureRef","containerSize","useMeasure","useHorizontalScroll","useEffect","current","getContainerItemWidth","useCallback","containerItem","querySelector","getBoundingClientRect","width","getInvisibleItemOffset","scrollDirection","container","querySelectorAll","containerRect","isHorizontal","fadeSize","padding","parseFloat","window","getComputedStyle","offset","Math","max","containerEdgeWithoutPadding","item","Array","from","itemRect","right","abs","i","length","left","bottom","top","getVisibleItemsWidth","containerItems","visibleItemsWidth","forEach","height","getActiveIndexOffset","index","actNav","children","actNavRect","scrollLeft","FADE_BUTTON_SIZE","scrollTop","x","refScrollX","y","refScrollY","useScroll","windowSize","useWindowSize","scrollX","setScrollX","useState","scrollY","setScrollY","initScrollX","initScrollY","scrollWidth","showFadeStart","setShowFadeStart","showFadeEnd","setShowFadeEnd","offsetWidth","offsetHeight","scrollHeight","scrollXFixOffset","ceil","handleArrowClick","first","clientWidth","scrollPosition","scrollSize","scrollStep","newScrollPosition","newScrollPositionWithinBounds","min","possibleScroll","nearBoundary","scrollTo","behavior","setTimeout","arrowIconSrc","useMemo","icon","ArrowRightIcon","src","isDragging","hasDragged","startX","startY","onPointerDown","e","pointerType","buttons","pageX","offsetLeft","pageY","offsetTop","document","body","style","cursor","onPointerMove","preventDefault","walkMultiplier","walkX","walkY","onPointerUp","onVisibilityChange","onClick","stopPropagation","addEventListener","anchor","removeEventListener","jsxs","S.OuterContainer","$align","$direction","$showFadeStart","$showFadeEnd","$fillType","$fillColor","$gradientSize","jsx","S.ScrollContainer","ref","$gap","map","S.Item","$draggable","render","id","S.LeftArrowIcon","$show","$first","$acc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EAAK,GAAA,EAAA,CAAA;QAC3DuG,GAAK,EAAAJ;MAAA,CACP;IAAA,CACF,CAAA;EAAA,CAAA,CACF;AAEJ,CAAA;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { SearchInputProps } from "./Input.types";
|
|
2
|
-
export declare const SearchInput: ({ value, onValueChange, onCancelClick, showCancel, placeholder, height, width, onFocus, onBlur, onKeyPress, setInputRef, transparent, motif, loading, className,
|
|
2
|
+
export declare const SearchInput: ({ value, onValueChange, onCancelClick, showCancel, placeholder, height, width, onFocus, onBlur, onKeyPress, setInputRef, transparent, motif, loading, className, }: SearchInputProps) => JSX.Element;
|