@ubnt/store.core 9.6.0-alpha.9 → 9.7.0-alpha.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 +25 -0
- package/lib/assets/attention.svg +5 -5
- package/lib/assets/attention2.svg +5 -5
- package/lib/assets/minus4.svg +8 -8
- package/lib/assets/minus5.svg +8 -8
- package/lib/assets/pause.svg +3 -3
- package/lib/assets/pause2.svg +3 -3
- package/lib/assets/plus2.svg +4 -1
- package/lib/assets/plus3.svg +1 -4
- package/lib/assets/plus5.svg +9 -9
- package/lib/assets/plus6.svg +9 -9
- 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/assets/udmProMax.jpg +0 -0
- package/lib/assets/udmProMax2.jpg +0 -0
- package/lib/components/FeaturesSection_deprecated/AllFeaturesButton/AllFeaturesButton.js +1 -1
- package/lib/components/FeaturesSection_deprecated/AllFeaturesButton/AllFeaturesButton.mjs +1 -1
- package/lib/components/FeaturesSection_deprecated/assets/plus.svg.js +1 -1
- package/lib/components/FeaturesSection_deprecated/assets/plus.svg.mjs +2 -2
- package/lib/components/Header/CartModalV2/Item/Item.js +3 -3
- package/lib/components/Header/CartModalV2/Item/Item.mjs +2 -2
- package/lib/components/MicrositeVideoSlideshow/MicrositeVideoSlideshow.js +1 -1
- 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/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/bigCompare/udmProMax.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProMax.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/Consoles/udmProMax.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/udmProMax.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/data/CloudGateways.js +9 -9
- package/lib/components/ModelCompareV3/data/CloudGateways.mjs +6 -6
- package/lib/components/ModelCompareV3/data/products/ucgMax.js +1 -1
- package/lib/components/ModelCompareV3/data/products/ucgMax.mjs +1 -1
- package/lib/components/ModelCompareV3/data/products/ucgUltra.js +1 -1
- package/lib/components/ModelCompareV3/data/products/ucgUltra.mjs +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProMax.js +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProMax.mjs +1 -1
- package/lib/components/ModelCompareV3/translations/en.json.js +2 -2
- package/lib/components/ModelCompareV3/translations/en.json.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.mjs +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.js +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.mjs +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.js +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.mjs +2 -2
- package/lib/components/ScrollWrapper/ScrollWrapper.js +6 -7
- package/lib/components/ScrollWrapper/ScrollWrapper.js.map +1 -1
- package/lib/components/ScrollWrapper/ScrollWrapper.mjs +6 -7
- package/lib/components/ScrollWrapper/ScrollWrapper.mjs.map +1 -1
- package/lib/components/Tooltip/Tooltip.js +16 -2
- package/lib/components/Tooltip/Tooltip.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.mjs +17 -3
- package/lib/components/Tooltip/Tooltip.mjs.map +1 -1
- package/lib/components/Tooltip/Tooltip.styles.d.ts +1 -0
- package/lib/components/Tooltip/Tooltip.styles.js +6 -0
- package/lib/components/Tooltip/Tooltip.styles.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.styles.mjs +6 -1
- package/lib/components/Tooltip/Tooltip.styles.mjs.map +1 -1
- package/lib/components/VideoPlayerNew/VideoPlayer.js +1 -1
- package/lib/components/VideoPlayerNew/VideoPlayer.mjs +1 -1
- package/lib/components/VideoPlayerNew/assets/pause.svg.js +1 -1
- package/lib/components/VideoPlayerNew/assets/pause.svg.mjs +2 -2
- package/lib/constants/icons/generic/index.js +3 -3
- package/lib/constants/icons/generic/index.mjs +1 -1
- package/lib/constants/icons/generic/plus.svg.js +5 -5
- package/lib/constants/icons/generic/plus.svg.mjs +2 -2
- package/lib/utils/money/allocators/productAmount.d.ts +5 -9
- package/lib/utils/money/allocators/productAmount.js +64 -23
- package/lib/utils/money/allocators/productAmount.js.map +1 -1
- package/lib/utils/money/allocators/productAmount.mjs +64 -23
- package/lib/utils/money/allocators/productAmount.mjs.map +1 -1
- package/lib/utils/money/types.d.ts +6 -2
- package/package.json +19 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollWrapper.mjs","sources":["../../../src/components/ScrollWrapper/ScrollWrapper.tsx"],"sourcesContent":["/* eslint-disable @next/next/no-img-element */\nimport { 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}: 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 // Added to make sure it stays in the effect\n windowSize;\n }, [onScrollChange, refScrollX, refScrollY, windowSize]);\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 // Added to make sure it stays in the effect\n windowSize;\n containerSize.width;\n }, [containerSize.width, direction, scrollX, scrollY, windowSize, items]);\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 // 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 >\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","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","jsxs","S.OuterContainer","$align","$direction","$showFadeStart","$showFadeEnd","$fillType","$fillColor","$gradientSize","jsx","S.ScrollContainer","ref","$gap","map","S.Item","render","id","S.LeftArrowIcon","$show","$first","$accentColor","$arrowFadeColor","$circleArrowBackground","onClick","$arrowGap","S.ArrowIconSvg","$arrowColor","S.RightArrowIcon"],"mappings":";;;;;;;;AAUA,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;AACF,CAAuB,EAAA;EAIf,MAAAC,YAAA,GAAeC,OAA8B,IAAI,CAAA;EACvD,MAAM,CAACC,mBAAA,EAAqBC,aAAa,CAAA,GAAIC,UAA2B,CAAA,CAAA;EAEpDC,mBAAA,CAAAL,YAAA,EAAc,CAAC,CAACF,iBAAiB,CAAA;EAGrDQ,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,YAAY,MAAc;IAChD,MAAAC,aAAA,GAAgBV,aAAaO,OAAS,EAAAI,aAAA,KACtClC,gCAAgC,EAAA,CACtC;IAEA,IAAI,CAACiC,aAAe,EAAA;MACX,OAAA,CAAA;IACT;IAEO,OAAAA,aAAA,CAAcE,sBAA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,EAAA7H,qBAAA;MACxB8H,OAAA,EAASA,CAAA,KAAM1C,gBAAA,CAAiB,IAAI,CAAA;MACpC2C,SAAW,EAAA9H,QAAA;MAEXsD,QAAA,iBAAAyD,GAAA,CAACgB,YAAE,EAAF;QACCC,WAAa,EAAAvI,UAAA;QACb0B,KAAO,EAAAd,SAAA,EAAWc,KAAU,KAAApB,qBAAA,GAAwB,EAAK,GAAA,CAAA,CAAA;QACzDmD,MAAQ,EAAA7C,SAAA,EAAW6C,MAAW,KAAAnD,qBAAA,GAAwB,EAAK,GAAA,EAAA,CAAA;QAC3DsG,GAAK,EAAAJ;MAAA,CACP;IAAA,CACF,CAAA,EAAA,eAEAc,GAAA,CAACkB,cAAE,EAAF;MACCT,KAAA,EAAO5C,eAAe,CAAC1E,UAAA;MACvB0G,SAAW,EAAAtH,QAAA;MACXuH,UAAY,EAAAtH,SAAA;MACZmI,YAAc,EAAAlI,WAAA;MACdiH,UAAY,EAAArH,SAAA;MACZuI,eAAiB,EAAA9H,cAAA;MACjB+H,sBAAwB,EAAA7H,qBAAA;MACxB8H,OAAA,EAASA,CAAA,KAAM1C,gBAAA,CAAiB,KAAK,CAAA;MACrC2C,SAAW,EAAA9H,QAAA;MAEXsD,QAAA,iBAAAyD,GAAA,CAACgB,YAAE,EAAF;QACCC,WAAa,EAAAvI,UAAA;QACb0B,KAAO,EAAAd,SAAA,EAAWc,KAAU,KAAApB,qBAAA,GAAwB,EAAK,GAAA,CAAA,CAAA;QACzDmD,MAAQ,EAAA7C,SAAA,EAAW6C,MAAW,KAAAnD,qBAAA,GAAwB,EAAK,GAAA,EAAA,CAAA;QAC3DsG,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":["/* eslint-disable @next/next/no-img-element */\nimport { 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\n// TODO remove support for \"direction\" - we don't use vertical anywhere and it's adding pointless complexity\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}: 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 // Added to make sure it stays in the effect\n windowSize;\n }, [onScrollChange, refScrollX, refScrollY, windowSize]);\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 // Added to make sure it stays in the effect\n windowSize;\n containerSize.width;\n }, [containerSize.width, direction, scrollX, scrollY, windowSize, items]);\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 containerRef.current.scrollTo({\n top: offset.top,\n left: offset.left,\n behavior: \"smooth\",\n });\n } else {\n containerRef.current.scrollTo({\n left: 0,\n top: 0,\n behavior: \"smooth\",\n });\n }\n }, 200);\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 // 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 >\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","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","jsxs","S.OuterContainer","$align","$direction","$showFadeStart","$showFadeEnd","$fillType","$fillColor","$gradientSize","jsx","S.ScrollContainer","ref","$gap","map","S.Item","render","id","S.LeftArrowIcon","$show","$first","$accentColor","$arrowFadeColor","$circleArrowBackground","onClick","$arrowGap","S.ArrowIconSvg","$arrowColor","S.RightArrowIcon"],"mappings":";;;;;;;;AAUA,MAAMA,gCAAmC,GAAA,uBAAA;AAEzC,MAAMC,mBAAsB,GAAA,EAAA;AAGf,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;AACF,CAAuB,EAAA;EAIf,MAAAC,YAAA,GAAeC,OAA8B,IAAI,CAAA;EACvD,MAAM,CAACC,mBAAA,EAAqBC,aAAa,CAAA,GAAIC,UAA2B,CAAA,CAAA;EAEpDC,mBAAA,CAAAL,YAAA,EAAc,CAAC,CAACF,iBAAiB,CAAA;EAGrDQ,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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tooltipClassName
|
|
16
16
|
} = props;
|
|
17
17
|
const [isOpen, setIsOpen] = react.useState();
|
|
18
|
+
const [isHidden, setIsHidden] = react.useState(true);
|
|
19
|
+
react.useEffect(() => {
|
|
20
|
+
if (isOpen) {
|
|
21
|
+
setTimeout(() => {
|
|
22
|
+
setIsHidden(false);
|
|
23
|
+
}, 80);
|
|
24
|
+
} else {
|
|
25
|
+
setIsHidden(true);
|
|
26
|
+
}
|
|
27
|
+
}, [isOpen]);
|
|
18
28
|
react.useEffect(() => {
|
|
19
29
|
setIsOpen(false);
|
|
20
30
|
scrollY;
|
|
@@ -24,13 +34,17 @@ const Tooltip = props => {
|
|
|
24
34
|
setIsOpen(false);
|
|
25
35
|
}
|
|
26
36
|
});
|
|
27
|
-
const
|
|
37
|
+
const classNameList = [Tooltip_styles.TOOLTIP_CLASS_NAME, tooltipClassName];
|
|
38
|
+
if (isHidden) {
|
|
39
|
+
classNameList.push(Tooltip_styles.TOOLTIP_CLASS_NAME_HIDDEN);
|
|
40
|
+
}
|
|
41
|
+
const tooltipClassNames = classNameList.join(" ");
|
|
28
42
|
return /* @__PURE__ */jsxRuntime.jsxs(Tooltip_styles.Tooltip, {
|
|
29
|
-
tooltipClassName: `${Tooltip_styles.TOOLTIP_CLASS_NAME}${tooltipExtraClassName}`,
|
|
30
43
|
ref: tooltipRef,
|
|
31
44
|
isOpen,
|
|
32
45
|
onClick: () => setIsOpen(!isOpen),
|
|
33
46
|
...props,
|
|
47
|
+
tooltipClassName: tooltipClassNames,
|
|
34
48
|
children: [/* @__PURE__ */jsxRuntime.jsx(Tooltip_styles.TooltipStyles, {}), children]
|
|
35
49
|
});
|
|
36
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import type { TooltipProps } from \"@ubnt/ui-components/Tooltip\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { useClickAway, useWindowScroll } from \"react-use\";\n\nimport * as S from \"./Tooltip.styles\";\nimport {
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import type { TooltipProps } from \"@ubnt/ui-components/Tooltip\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { useClickAway, useWindowScroll } from \"react-use\";\n\nimport * as S from \"./Tooltip.styles\";\nimport {\n TOOLTIP_CLASS_NAME,\n TOOLTIP_CLASS_NAME_HIDDEN,\n} from \"./Tooltip.styles\";\n\nexport const Tooltip = (props: TooltipProps) => {\n const tooltipRef = useRef<HTMLDivElement>(null);\n const { y: scrollY } = useWindowScroll();\n\n const { children, tooltipClassName } = props;\n\n const [isOpen, setIsOpen] = useState<boolean>();\n\n const [isHidden, setIsHidden] = useState<boolean>(true);\n\n // Hide tooltip when isOpen changes from true to false for a short time\n // Fixes the issue when tooltip is shown on the right side for a short time and then moves to bottom\n useEffect(() => {\n if (isOpen) {\n setTimeout(() => {\n setIsHidden(false);\n }, 80);\n } else {\n setIsHidden(true);\n }\n }, [isOpen]);\n\n // Hide tooltip when scrolling\n useEffect(() => {\n setIsOpen(false);\n scrollY;\n }, [scrollY]);\n\n useClickAway(tooltipRef, () => {\n if (isOpen) {\n setIsOpen(false);\n }\n });\n\n const classNameList = [TOOLTIP_CLASS_NAME, tooltipClassName];\n\n if (isHidden) {\n classNameList.push(TOOLTIP_CLASS_NAME_HIDDEN);\n }\n const tooltipClassNames = classNameList.join(\" \");\n\n return (\n <S.Tooltip\n ref={tooltipRef}\n isOpen={isOpen}\n onClick={() => setIsOpen(!isOpen)}\n {...props}\n tooltipClassName={tooltipClassNames}\n >\n <S.TooltipStyles />\n {children}\n </S.Tooltip>\n );\n};\n"],"names":["Tooltip","props","tooltipRef","useRef","y","scrollY","useWindowScroll","children","tooltipClassName","isOpen","setIsOpen","useState","isHidden","setIsHidden","useEffect","setTimeout","useClickAway","classNameList","TOOLTIP_CLASS_NAME","push","TOOLTIP_CLASS_NA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F;IACCyB,GAAK,EAAAvB,UAAA;IACLO,MAAA;IACAiB,OAAS,EAAAA,CAAA,KAAMhB,SAAU,CAAA,CAACD,MAAM,CAAA;IAC/B,GAAGR,KAAA;IACJO,gBAAkB,EAAAa,iBAAA;IAElBd,QAAA,EAAA,CAAA,eAACoB,UAAA,CAAAA,GAAA,CAAAC,8BAAA,EAAgB,CAAA,EAChBrB,QAAA;EAAA,CAAA,CACH;AAEJ,CAAA;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useRef, useState, useEffect } from 'react';
|
|
3
3
|
import { useWindowScroll, useClickAway } from 'react-use';
|
|
4
|
-
import { Tooltip as Tooltip$1,
|
|
4
|
+
import { TOOLTIP_CLASS_NAME, TOOLTIP_CLASS_NAME_HIDDEN, Tooltip as Tooltip$1, TooltipStyles } from './Tooltip.styles.mjs';
|
|
5
5
|
"use strict";
|
|
6
6
|
const Tooltip = props => {
|
|
7
7
|
const tooltipRef = useRef(null);
|
|
@@ -13,6 +13,16 @@ const Tooltip = props => {
|
|
|
13
13
|
tooltipClassName
|
|
14
14
|
} = props;
|
|
15
15
|
const [isOpen, setIsOpen] = useState();
|
|
16
|
+
const [isHidden, setIsHidden] = useState(true);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if (isOpen) {
|
|
19
|
+
setTimeout(() => {
|
|
20
|
+
setIsHidden(false);
|
|
21
|
+
}, 80);
|
|
22
|
+
} else {
|
|
23
|
+
setIsHidden(true);
|
|
24
|
+
}
|
|
25
|
+
}, [isOpen]);
|
|
16
26
|
useEffect(() => {
|
|
17
27
|
setIsOpen(false);
|
|
18
28
|
scrollY;
|
|
@@ -22,13 +32,17 @@ const Tooltip = props => {
|
|
|
22
32
|
setIsOpen(false);
|
|
23
33
|
}
|
|
24
34
|
});
|
|
25
|
-
const
|
|
35
|
+
const classNameList = [TOOLTIP_CLASS_NAME, tooltipClassName];
|
|
36
|
+
if (isHidden) {
|
|
37
|
+
classNameList.push(TOOLTIP_CLASS_NAME_HIDDEN);
|
|
38
|
+
}
|
|
39
|
+
const tooltipClassNames = classNameList.join(" ");
|
|
26
40
|
return /* @__PURE__ */jsxs(Tooltip$1, {
|
|
27
|
-
tooltipClassName: `${TOOLTIP_CLASS_NAME}${tooltipExtraClassName}`,
|
|
28
41
|
ref: tooltipRef,
|
|
29
42
|
isOpen,
|
|
30
43
|
onClick: () => setIsOpen(!isOpen),
|
|
31
44
|
...props,
|
|
45
|
+
tooltipClassName: tooltipClassNames,
|
|
32
46
|
children: [/* @__PURE__ */jsx(TooltipStyles, {}), children]
|
|
33
47
|
});
|
|
34
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.mjs","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import type { TooltipProps } from \"@ubnt/ui-components/Tooltip\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { useClickAway, useWindowScroll } from \"react-use\";\n\nimport * as S from \"./Tooltip.styles\";\nimport {
|
|
1
|
+
{"version":3,"file":"Tooltip.mjs","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["import type { TooltipProps } from \"@ubnt/ui-components/Tooltip\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { useClickAway, useWindowScroll } from \"react-use\";\n\nimport * as S from \"./Tooltip.styles\";\nimport {\n TOOLTIP_CLASS_NAME,\n TOOLTIP_CLASS_NAME_HIDDEN,\n} from \"./Tooltip.styles\";\n\nexport const Tooltip = (props: TooltipProps) => {\n const tooltipRef = useRef<HTMLDivElement>(null);\n const { y: scrollY } = useWindowScroll();\n\n const { children, tooltipClassName } = props;\n\n const [isOpen, setIsOpen] = useState<boolean>();\n\n const [isHidden, setIsHidden] = useState<boolean>(true);\n\n // Hide tooltip when isOpen changes from true to false for a short time\n // Fixes the issue when tooltip is shown on the right side for a short time and then moves to bottom\n useEffect(() => {\n if (isOpen) {\n setTimeout(() => {\n setIsHidden(false);\n }, 80);\n } else {\n setIsHidden(true);\n }\n }, [isOpen]);\n\n // Hide tooltip when scrolling\n useEffect(() => {\n setIsOpen(false);\n scrollY;\n }, [scrollY]);\n\n useClickAway(tooltipRef, () => {\n if (isOpen) {\n setIsOpen(false);\n }\n });\n\n const classNameList = [TOOLTIP_CLASS_NAME, tooltipClassName];\n\n if (isHidden) {\n classNameList.push(TOOLTIP_CLASS_NAME_HIDDEN);\n }\n const tooltipClassNames = classNameList.join(\" \");\n\n return (\n <S.Tooltip\n ref={tooltipRef}\n isOpen={isOpen}\n onClick={() => setIsOpen(!isOpen)}\n {...props}\n tooltipClassName={tooltipClassNames}\n >\n <S.TooltipStyles />\n {children}\n </S.Tooltip>\n );\n};\n"],"names":["Tooltip","props","tooltipRef","useRef","y","scrollY","useWindowScroll","children","tooltipClassName","isOpen","setIsOpen","useState","isHidden","setIsHidden","useEffect","setTimeout","useClickAway","classNameList","TOOLTIP_CLASS_NAME","push","TOOLTIP_CLASS_NAME_HIDDEN","tooltipClassNames","join","jsxs","S.Tooltip","ref","onClick","jsx","S.TooltipStyles"],"mappings":";;;;;AAUa,MAAAA,OAAA,GAAWC,KAAwB,IAAA;EACxC,MAAAC,UAAA,GAAaC,OAAuB,IAAI,CAAA;EAC9C,MAAM;IAAEC,CAAA,EAAGC;EAAQ,CAAA,GAAIC,eAAgB,CAAA,CAAA;EAEjC,MAAA;IAAEC,QAAU;IAAAC;EAAqB,CAAA,GAAAP,KAAA;EAEvC,MAAM,CAACQ,MAAA,EAAQC,SAAS,CAAA,GAAIC,QAAkB,CAAA,CAAA;EAE9C,MAAM,CAACC,QAAA,EAAUC,WAAW,CAAA,GAAIF,SAAkB,IAAI,CAAA;EAItDG,SAAA,CAAU,MAAM;IACd,IAAIL,MAAQ,EAAA;MACVM,UAAA,CAAW,MAAM;QACfF,WAAA,CAAY,KAAK,CAAA;SAChB,EAAE,CAAA;IAAA,CACA,MAAA;MACLA,WAAA,CAAY,IAAI,CAAA;IAClB;EAAA,CACF,EAAG,CAACJ,MAAM,CAAC,CAAA;EAGXK,SAAA,CAAU,MAAM;IACdJ,SAAA,CAAU,KAAK,CAAA;IACfL,OAAA;EAAA,CACF,EAAG,CAACA,OAAO,CAAC,CAAA;EAEZW,YAAA,CAAad,YAAY,MAAM;IAC7B,IAAIO,MAAQ,EAAA;MACVC,SAAA,CAAU,KAAK,CAAA;IACjB;EAAA,CACD,CAAA;EAEK,MAAAO,aAAA,GAAgB,CAACC,kBAAA,EAAoBV,gBAAgB,CAAA;EAE3D,IAAII,QAAU,EAAA;IACZK,aAAA,CAAcE,KAAKC,yBAAyB,CAAA;EAC9C;EACM,MAAAC,iBAAA,GAAoBJ,aAAc,CAAAK,IAAA,CAAK,GAAG,CAAA;EAG9C,sBAAAC,IAAA,CAACC,SAAE,EAAF;IACCC,GAAK,EAAAvB,UAAA;IACLO,MAAA;IACAiB,OAAS,EAAAA,CAAA,KAAMhB,SAAU,CAAA,CAACD,MAAM,CAAA;IAC/B,GAAGR,KAAA;IACJO,gBAAkB,EAAAa,iBAAA;IAElBd,QAAA,EAAA,CAAA,eAACoB,GAAA,CAAAC,eAAA,EAAgB,CAAA,EAChBrB,QAAA;EAAA,CAAA,CACH;AAEJ,CAAA;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const TOOLTIP_CLASS_NAME = "custom-tooltip";
|
|
2
|
+
export declare const TOOLTIP_CLASS_NAME_HIDDEN = "custom-tooltip--hidden";
|
|
2
3
|
export declare const Tooltip: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<{
|
|
3
4
|
message?: import("react").ReactNode;
|
|
4
5
|
tooltipMessageClassName?: string;
|
|
@@ -11,6 +11,7 @@ function _interopDefault(e) {
|
|
|
11
11
|
var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
12
12
|
"use strict";
|
|
13
13
|
const TOOLTIP_CLASS_NAME = "custom-tooltip";
|
|
14
|
+
const TOOLTIP_CLASS_NAME_HIDDEN = "custom-tooltip--hidden";
|
|
14
15
|
const Tooltip = styled__default["default"](Tooltip$1.Tooltip)`
|
|
15
16
|
display: flex;
|
|
16
17
|
`;
|
|
@@ -37,8 +38,13 @@ const TooltipStyles = styled.createGlobalStyle`
|
|
|
37
38
|
box-shadow: -4px -4px 4px -4px rgb(33 35 39 / .08);
|
|
38
39
|
}
|
|
39
40
|
}
|
|
41
|
+
|
|
42
|
+
.${TOOLTIP_CLASS_NAME_HIDDEN} {
|
|
43
|
+
opacity: 0;
|
|
44
|
+
}
|
|
40
45
|
`;
|
|
41
46
|
exports.TOOLTIP_CLASS_NAME = TOOLTIP_CLASS_NAME;
|
|
47
|
+
exports.TOOLTIP_CLASS_NAME_HIDDEN = TOOLTIP_CLASS_NAME_HIDDEN;
|
|
42
48
|
exports.Tooltip = Tooltip;
|
|
43
49
|
exports.TooltipStyles = TooltipStyles;
|
|
44
50
|
//# sourceMappingURL=Tooltip.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.styles.js","sources":["../../../src/components/Tooltip/Tooltip.styles.tsx"],"sourcesContent":["import { Tooltip as BaseTooltip } from \"@ubnt/ui-components/Tooltip\";\nimport styled, { createGlobalStyle } from \"styled-components\";\n\nimport { theme } from \"../../constants/theme\";\n\nexport const TOOLTIP_CLASS_NAME = \"custom-tooltip\";\n\nexport const Tooltip = styled(BaseTooltip)`\n display: flex;\n`;\n\nexport const TooltipStyles = createGlobalStyle`\n .${TOOLTIP_CLASS_NAME} {\n white-space: nowrap;\n z-index: ${theme.zIndex.header + 1}!important;\n border-radius: 8px;\n color: #808893;\n font-size: 14px;\n line-height: 20px;\n box-shadow: 0 0 1px 0 rgb(33 35 39 / 0.08), 0 12px 48px 0 rgb(33 35 39 / 0.12);\n background-color: #fff;\n padding: 16px;\n\n * {\n color: #808893;\n font-size: 14px;\n line-height: 20px;\n }\n\n &::before {\n background-color: #fff;\n box-shadow: -4px -4px 4px -4px rgb(33 35 39 / .08);\n }\n }\n`;\n"],"names":["TOOLTIP_CLASS_NAME","Tooltip","styled","BaseTooltip","TooltipStyles","createGlobalStyle","theme","zIndex","header"],"mappings":";;;;;;;;;;;;AAKO,MAAMA,kBAAqB,GAAA,gBAAA;
|
|
1
|
+
{"version":3,"file":"Tooltip.styles.js","sources":["../../../src/components/Tooltip/Tooltip.styles.tsx"],"sourcesContent":["import { Tooltip as BaseTooltip } from \"@ubnt/ui-components/Tooltip\";\nimport styled, { createGlobalStyle } from \"styled-components\";\n\nimport { theme } from \"../../constants/theme\";\n\nexport const TOOLTIP_CLASS_NAME = \"custom-tooltip\";\nexport const TOOLTIP_CLASS_NAME_HIDDEN = \"custom-tooltip--hidden\";\n\nexport const Tooltip = styled(BaseTooltip)`\n display: flex;\n`;\n\nexport const TooltipStyles = createGlobalStyle`\n .${TOOLTIP_CLASS_NAME} {\n white-space: nowrap;\n z-index: ${theme.zIndex.header + 1}!important;\n border-radius: 8px;\n color: #808893;\n font-size: 14px;\n line-height: 20px;\n box-shadow: 0 0 1px 0 rgb(33 35 39 / 0.08), 0 12px 48px 0 rgb(33 35 39 / 0.12);\n background-color: #fff;\n padding: 16px;\n\n * {\n color: #808893;\n font-size: 14px;\n line-height: 20px;\n }\n\n &::before {\n background-color: #fff;\n box-shadow: -4px -4px 4px -4px rgb(33 35 39 / .08);\n }\n }\n\n .${TOOLTIP_CLASS_NAME_HIDDEN} {\n opacity: 0;\n }\n`;\n"],"names":["TOOLTIP_CLASS_NAME","TOOLTIP_CLASS_NAME_HIDDEN","Tooltip","styled","BaseTooltip","TooltipStyles","createGlobalStyle","theme","zIndex","header"],"mappings":";;;;;;;;;;;;AAKO,MAAMA,kBAAqB,GAAA,gBAAA;AAC3B,MAAMC,yBAA4B,GAAA,wBAAA;AAE5B,MAAAC,OAAA,GAAUC,eAAAA,CAAAA,SAAAA,EAAOC,SAAAA,CAAAA,OAAW,CAAA;AAAA;AAAA,CAAA;AAIlC,MAAMC,aAAgB,GAAAC,MAAAA,CAAAA,iBAAA;AAAA,KACxBN,kBAAkB;AAAA;AAAA,eAERO,WAAA,CAAMC,MAAO,CAAAC,MAAA,GAAS,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAqBjCR,yBAAyB;AAAA;AAAA;AAAA,CAAA;;;;"}
|
|
@@ -3,6 +3,7 @@ import styled, { createGlobalStyle } from 'styled-components';
|
|
|
3
3
|
import { theme } from '../../constants/theme.mjs';
|
|
4
4
|
"use strict";
|
|
5
5
|
const TOOLTIP_CLASS_NAME = "custom-tooltip";
|
|
6
|
+
const TOOLTIP_CLASS_NAME_HIDDEN = "custom-tooltip--hidden";
|
|
6
7
|
const Tooltip = styled(Tooltip$1)`
|
|
7
8
|
display: flex;
|
|
8
9
|
`;
|
|
@@ -29,6 +30,10 @@ const TooltipStyles = createGlobalStyle`
|
|
|
29
30
|
box-shadow: -4px -4px 4px -4px rgb(33 35 39 / .08);
|
|
30
31
|
}
|
|
31
32
|
}
|
|
33
|
+
|
|
34
|
+
.${TOOLTIP_CLASS_NAME_HIDDEN} {
|
|
35
|
+
opacity: 0;
|
|
36
|
+
}
|
|
32
37
|
`;
|
|
33
|
-
export { TOOLTIP_CLASS_NAME, Tooltip, TooltipStyles };
|
|
38
|
+
export { TOOLTIP_CLASS_NAME, TOOLTIP_CLASS_NAME_HIDDEN, Tooltip, TooltipStyles };
|
|
34
39
|
//# sourceMappingURL=Tooltip.styles.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.styles.mjs","sources":["../../../src/components/Tooltip/Tooltip.styles.tsx"],"sourcesContent":["import { Tooltip as BaseTooltip } from \"@ubnt/ui-components/Tooltip\";\nimport styled, { createGlobalStyle } from \"styled-components\";\n\nimport { theme } from \"../../constants/theme\";\n\nexport const TOOLTIP_CLASS_NAME = \"custom-tooltip\";\n\nexport const Tooltip = styled(BaseTooltip)`\n display: flex;\n`;\n\nexport const TooltipStyles = createGlobalStyle`\n .${TOOLTIP_CLASS_NAME} {\n white-space: nowrap;\n z-index: ${theme.zIndex.header + 1}!important;\n border-radius: 8px;\n color: #808893;\n font-size: 14px;\n line-height: 20px;\n box-shadow: 0 0 1px 0 rgb(33 35 39 / 0.08), 0 12px 48px 0 rgb(33 35 39 / 0.12);\n background-color: #fff;\n padding: 16px;\n\n * {\n color: #808893;\n font-size: 14px;\n line-height: 20px;\n }\n\n &::before {\n background-color: #fff;\n box-shadow: -4px -4px 4px -4px rgb(33 35 39 / .08);\n }\n }\n`;\n"],"names":["TOOLTIP_CLASS_NAME","Tooltip","styled","BaseTooltip","TooltipStyles","createGlobalStyle","theme","zIndex","header"],"mappings":";;;;AAKO,MAAMA,kBAAqB,GAAA,gBAAA;
|
|
1
|
+
{"version":3,"file":"Tooltip.styles.mjs","sources":["../../../src/components/Tooltip/Tooltip.styles.tsx"],"sourcesContent":["import { Tooltip as BaseTooltip } from \"@ubnt/ui-components/Tooltip\";\nimport styled, { createGlobalStyle } from \"styled-components\";\n\nimport { theme } from \"../../constants/theme\";\n\nexport const TOOLTIP_CLASS_NAME = \"custom-tooltip\";\nexport const TOOLTIP_CLASS_NAME_HIDDEN = \"custom-tooltip--hidden\";\n\nexport const Tooltip = styled(BaseTooltip)`\n display: flex;\n`;\n\nexport const TooltipStyles = createGlobalStyle`\n .${TOOLTIP_CLASS_NAME} {\n white-space: nowrap;\n z-index: ${theme.zIndex.header + 1}!important;\n border-radius: 8px;\n color: #808893;\n font-size: 14px;\n line-height: 20px;\n box-shadow: 0 0 1px 0 rgb(33 35 39 / 0.08), 0 12px 48px 0 rgb(33 35 39 / 0.12);\n background-color: #fff;\n padding: 16px;\n\n * {\n color: #808893;\n font-size: 14px;\n line-height: 20px;\n }\n\n &::before {\n background-color: #fff;\n box-shadow: -4px -4px 4px -4px rgb(33 35 39 / .08);\n }\n }\n\n .${TOOLTIP_CLASS_NAME_HIDDEN} {\n opacity: 0;\n }\n`;\n"],"names":["TOOLTIP_CLASS_NAME","TOOLTIP_CLASS_NAME_HIDDEN","Tooltip","styled","BaseTooltip","TooltipStyles","createGlobalStyle","theme","zIndex","header"],"mappings":";;;;AAKO,MAAMA,kBAAqB,GAAA,gBAAA;AAC3B,MAAMC,yBAA4B,GAAA,wBAAA;AAE5B,MAAAC,OAAA,GAAUC,OAAOC,SAAW,CAAA;AAAA;AAAA,CAAA;AAIlC,MAAMC,aAAgB,GAAAC,iBAAA;AAAA,KACxBN,kBAAkB;AAAA;AAAA,eAERO,KAAA,CAAMC,MAAO,CAAAC,MAAA,GAAS,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAqBjCR,yBAAyB;AAAA;AAAA;AAAA,CAAA;"}
|
|
@@ -14,7 +14,7 @@ require('./assets/volume-on.svg.js');
|
|
|
14
14
|
var VideoPlayer_styles = require('./VideoPlayer.styles.js');
|
|
15
15
|
var CloseIcon = require("../../assets/close2.svg");
|
|
16
16
|
var BackIcon = require("../../assets/back.svg");
|
|
17
|
-
var PauseIcon = require("../../assets/
|
|
17
|
+
var PauseIcon = require("../../assets/pause.svg");
|
|
18
18
|
var PlayIcon = require("../../assets/play.svg");
|
|
19
19
|
var VolumeOffIcon = require("../../assets/volume-off.svg");
|
|
20
20
|
var VolumeOnIcon = require("../../assets/volume-on.svg");
|
|
@@ -12,7 +12,7 @@ import './assets/volume-on.svg.mjs';
|
|
|
12
12
|
import { Wrap, IconWrap, Icon, Video, ControlWrap, TimelineWrap, Timeline, Controls, LeftSide, IconButton, VolumeWrap, VolumeSliderWrap, VolumeSlider, Time, Center, RightSide } from './VideoPlayer.styles.mjs';
|
|
13
13
|
import CloseIcon__default from "../../assets/close2.svg";
|
|
14
14
|
import BackIcon__default from "../../assets/back.svg";
|
|
15
|
-
import PauseIcon__default from "../../assets/
|
|
15
|
+
import PauseIcon__default from "../../assets/pause.svg";
|
|
16
16
|
import PlayIcon__default from "../../assets/play.svg";
|
|
17
17
|
import VolumeOffIcon__default from "../../assets/volume-off.svg";
|
|
18
18
|
import VolumeOnIcon__default from "../../assets/volume-on.svg";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "../../../assets/
|
|
2
|
-
export { default } from "../../../assets/
|
|
1
|
+
export * from "../../../assets/pause.svg";
|
|
2
|
+
export { default } from "../../../assets/pause.svg";
|
|
3
3
|
//# sourceMappingURL=pause.svg.mjs.map
|
|
@@ -20,7 +20,7 @@ var _externalAssets_BAXELvSy = require("../../../assets/collapseArrow.svg");
|
|
|
20
20
|
var _externalAssets_CzDCu21b = require("../../../assets/hamburger.svg");
|
|
21
21
|
var _externalAssets_CrL$Ujdd = require("../../../assets/minus2.svg");
|
|
22
22
|
var _externalAssets_DSmVXVR0 = require("../../../assets/playCircle.svg");
|
|
23
|
-
var
|
|
23
|
+
var _externalAssets_CVKiTNEM = require("../../../assets/plus3.svg");
|
|
24
24
|
var _externalAssets_g50k1DIN = require("../../../assets/search.svg");
|
|
25
25
|
var _externalAssets_DjBpKbb4 = require("../../../assets/playback2.svg");
|
|
26
26
|
var _externalAssets_CwVZcmz1 = require("../../../assets/filter.svg");
|
|
@@ -37,7 +37,7 @@ var _externalAssets_BAXELvSy__default = /*#__PURE__*/_interopDefault(_externalAs
|
|
|
37
37
|
var _externalAssets_CzDCu21b__default = /*#__PURE__*/_interopDefault(_externalAssets_CzDCu21b);
|
|
38
38
|
var _externalAssets_CrL$Ujdd__default = /*#__PURE__*/_interopDefault(_externalAssets_CrL$Ujdd);
|
|
39
39
|
var _externalAssets_DSmVXVR0__default = /*#__PURE__*/_interopDefault(_externalAssets_DSmVXVR0);
|
|
40
|
-
var
|
|
40
|
+
var _externalAssets_CVKiTNEM__default = /*#__PURE__*/_interopDefault(_externalAssets_CVKiTNEM);
|
|
41
41
|
var _externalAssets_g50k1DIN__default = /*#__PURE__*/_interopDefault(_externalAssets_g50k1DIN);
|
|
42
42
|
var _externalAssets_DjBpKbb4__default = /*#__PURE__*/_interopDefault(_externalAssets_DjBpKbb4);
|
|
43
43
|
var _externalAssets_CwVZcmz1__default = /*#__PURE__*/_interopDefault(_externalAssets_CwVZcmz1);
|
|
@@ -93,7 +93,7 @@ Object.defineProperty(exports, "playCircle", {
|
|
|
93
93
|
Object.defineProperty(exports, "plus", {
|
|
94
94
|
enumerable: true,
|
|
95
95
|
get: function () {
|
|
96
|
-
return
|
|
96
|
+
return _externalAssets_CVKiTNEM__default["default"];
|
|
97
97
|
}
|
|
98
98
|
});
|
|
99
99
|
Object.defineProperty(exports, "search", {
|
|
@@ -18,7 +18,7 @@ export { default as collapseArrow } from "../../../assets/collapseArrow.svg";
|
|
|
18
18
|
export { default as hamburger } from "../../../assets/hamburger.svg";
|
|
19
19
|
export { default as minus } from "../../../assets/minus2.svg";
|
|
20
20
|
export { default as playCircle } from "../../../assets/playCircle.svg";
|
|
21
|
-
export { default as plus } from "../../../assets/
|
|
21
|
+
export { default as plus } from "../../../assets/plus3.svg";
|
|
22
22
|
export { default as search } from "../../../assets/search.svg";
|
|
23
23
|
export { default as playback } from "../../../assets/playback2.svg";
|
|
24
24
|
export { default as filter } from "../../../assets/filter.svg";
|
|
@@ -3,24 +3,24 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var
|
|
6
|
+
var _externalAssets_CVKiTNEM = require("../../../assets/plus3.svg");
|
|
7
7
|
function _interopDefault(e) {
|
|
8
8
|
return e && e.__esModule ? e : {
|
|
9
9
|
default: e
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
|
-
var
|
|
12
|
+
var _externalAssets_CVKiTNEM__default = /*#__PURE__*/_interopDefault(_externalAssets_CVKiTNEM);
|
|
13
13
|
Object.defineProperty(exports, "default", {
|
|
14
14
|
enumerable: true,
|
|
15
15
|
get: function () {
|
|
16
|
-
return
|
|
16
|
+
return _externalAssets_CVKiTNEM__default["default"];
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
-
Object.keys(
|
|
19
|
+
Object.keys(_externalAssets_CVKiTNEM).forEach(function (k) {
|
|
20
20
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
21
21
|
enumerable: true,
|
|
22
22
|
get: function () {
|
|
23
|
-
return
|
|
23
|
+
return _externalAssets_CVKiTNEM[k];
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "../../../assets/
|
|
2
|
-
export { default } from "../../../assets/
|
|
1
|
+
export * from "../../../assets/plus3.svg";
|
|
2
|
+
export { default } from "../../../assets/plus3.svg";
|
|
3
3
|
//# sourceMappingURL=plus.svg.mjs.map
|
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Cents, FullLineItemSummary } from "../types";
|
|
3
|
-
import { FixedAmountAllocator } from "./fixedAmount";
|
|
1
|
+
import type { FullLineItemSummary } from "../types";
|
|
4
2
|
/**
|
|
5
3
|
* Helper class to distribute a total amount for a product
|
|
6
4
|
*/
|
|
7
5
|
export declare class ProductAmountAllocator {
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
#private;
|
|
7
|
+
/**
|
|
8
|
+
* Remaining quantity to allocate
|
|
9
|
+
*/
|
|
10
10
|
quantity: number;
|
|
11
|
-
discountAmount: FixedAmountAllocator;
|
|
12
|
-
taxableAmount: FixedAmountAllocator;
|
|
13
|
-
tax: FixedAmountAllocator;
|
|
14
|
-
total: FixedAmountAllocator;
|
|
15
11
|
constructor(productSummary: FullLineItemSummary);
|
|
16
12
|
allocateQty(quantity: number): FullLineItemSummary;
|
|
17
13
|
}
|
|
@@ -14,56 +14,97 @@ var __publicField = (obj, key, value) => {
|
|
|
14
14
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
15
15
|
return value;
|
|
16
16
|
};
|
|
17
|
+
var __accessCheck = (obj, member, msg) => {
|
|
18
|
+
if (!member.has(obj)) throw TypeError("Cannot " + msg);
|
|
19
|
+
};
|
|
20
|
+
var __privateGet = (obj, member, getter) => {
|
|
21
|
+
__accessCheck(obj, member, "read from private field");
|
|
22
|
+
return getter ? getter.call(obj) : member.get(obj);
|
|
23
|
+
};
|
|
24
|
+
var __privateAdd = (obj, member, value) => {
|
|
25
|
+
if (member.has(obj)) throw TypeError("Cannot add the same private member more than once");
|
|
26
|
+
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
27
|
+
};
|
|
28
|
+
var __privateSet = (obj, member, value, setter) => {
|
|
29
|
+
__accessCheck(obj, member, "write to private field");
|
|
30
|
+
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
31
|
+
return value;
|
|
32
|
+
};
|
|
33
|
+
var _itemPrice, _currency, _subtotal, _discountAmount, _taxableAmount, _tax, _total;
|
|
17
34
|
class ProductAmountAllocator {
|
|
18
35
|
constructor(productSummary) {
|
|
19
|
-
|
|
20
|
-
|
|
36
|
+
// #############################################################################
|
|
37
|
+
// Fixed values
|
|
38
|
+
// #############################################################################
|
|
39
|
+
__privateAdd(this, _itemPrice, void 0);
|
|
40
|
+
__privateAdd(this, _currency, void 0);
|
|
41
|
+
// #############################################################################
|
|
42
|
+
/**
|
|
43
|
+
* Remaining quantity to allocate
|
|
44
|
+
*/
|
|
21
45
|
__publicField(this, "quantity");
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
46
|
+
// #############################################################################
|
|
47
|
+
// Specific amount allocators
|
|
48
|
+
// #############################################################################
|
|
49
|
+
__privateAdd(this, _subtotal, void 0);
|
|
50
|
+
__privateAdd(this, _discountAmount, void 0);
|
|
51
|
+
__privateAdd(this, _taxableAmount, void 0);
|
|
52
|
+
__privateAdd(this, _tax, void 0);
|
|
53
|
+
__privateAdd(this, _total, void 0);
|
|
26
54
|
const currency = productSummary.currency;
|
|
27
55
|
const priceForAllocation = productSummary.itemPrice * productSummary.quantity;
|
|
28
|
-
this
|
|
29
|
-
this
|
|
56
|
+
__privateSet(this, _itemPrice, productSummary.itemPrice);
|
|
57
|
+
__privateSet(this, _currency, currency);
|
|
30
58
|
this.quantity = productSummary.quantity;
|
|
31
|
-
this
|
|
59
|
+
__privateSet(this, _subtotal, new fixedAmount.FixedAmountAllocator({
|
|
60
|
+
initialAllocateAmount: productSummary.subtotal,
|
|
61
|
+
initialTotalAmount: priceForAllocation,
|
|
62
|
+
currency
|
|
63
|
+
}));
|
|
64
|
+
__privateSet(this, _discountAmount, new fixedAmount.FixedAmountAllocator({
|
|
32
65
|
initialAllocateAmount: productSummary.discountAmount,
|
|
33
66
|
initialTotalAmount: priceForAllocation,
|
|
34
67
|
currency
|
|
35
|
-
});
|
|
36
|
-
this
|
|
68
|
+
}));
|
|
69
|
+
__privateSet(this, _taxableAmount, new fixedAmount.FixedAmountAllocator({
|
|
37
70
|
initialAllocateAmount: productSummary.taxableAmount,
|
|
38
71
|
initialTotalAmount: priceForAllocation,
|
|
39
72
|
currency
|
|
40
|
-
});
|
|
41
|
-
this
|
|
73
|
+
}));
|
|
74
|
+
__privateSet(this, _tax, new fixedAmount.FixedAmountAllocator({
|
|
42
75
|
initialAllocateAmount: productSummary.tax,
|
|
43
76
|
initialTotalAmount: priceForAllocation,
|
|
44
77
|
currency
|
|
45
|
-
});
|
|
46
|
-
this
|
|
78
|
+
}));
|
|
79
|
+
__privateSet(this, _total, new fixedAmount.FixedAmountAllocator({
|
|
47
80
|
initialAllocateAmount: productSummary.total,
|
|
48
81
|
initialTotalAmount: priceForAllocation,
|
|
49
82
|
currency
|
|
50
|
-
});
|
|
83
|
+
}));
|
|
51
84
|
}
|
|
52
85
|
allocateQty(quantity) {
|
|
53
86
|
let quantityNormalized = Math.max(quantity, 0);
|
|
54
87
|
quantityNormalized = this.quantity - quantityNormalized >= 0 ? quantityNormalized : 0;
|
|
55
88
|
this.quantity = Math.max(this.quantity - quantityNormalized, 0);
|
|
56
|
-
const itemQuantityPrice = this
|
|
89
|
+
const itemQuantityPrice = __privateGet(this, _itemPrice) * quantityNormalized;
|
|
57
90
|
return {
|
|
58
|
-
itemPrice: this
|
|
59
|
-
currency: this
|
|
91
|
+
itemPrice: __privateGet(this, _itemPrice),
|
|
92
|
+
currency: __privateGet(this, _currency),
|
|
60
93
|
quantity: quantityNormalized,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
94
|
+
subtotal: misc.amount(__privateGet(this, _subtotal).allocate(itemQuantityPrice, __privateGet(this, _currency))),
|
|
95
|
+
discountAmount: misc.amount(__privateGet(this, _discountAmount).allocate(itemQuantityPrice, __privateGet(this, _currency))),
|
|
96
|
+
taxableAmount: misc.amount(__privateGet(this, _taxableAmount).allocate(itemQuantityPrice, __privateGet(this, _currency))),
|
|
97
|
+
tax: misc.amount(__privateGet(this, _tax).allocate(itemQuantityPrice, __privateGet(this, _currency))),
|
|
98
|
+
total: misc.amount(__privateGet(this, _total).allocate(itemQuantityPrice, __privateGet(this, _currency)))
|
|
65
99
|
};
|
|
66
100
|
}
|
|
67
101
|
}
|
|
102
|
+
_itemPrice = new WeakMap();
|
|
103
|
+
_currency = new WeakMap();
|
|
104
|
+
_subtotal = new WeakMap();
|
|
105
|
+
_discountAmount = new WeakMap();
|
|
106
|
+
_taxableAmount = new WeakMap();
|
|
107
|
+
_tax = new WeakMap();
|
|
108
|
+
_total = new WeakMap();
|
|
68
109
|
exports.ProductAmountAllocator = ProductAmountAllocator;
|
|
69
110
|
//# sourceMappingURL=productAmount.js.map
|