@ubnt/store.core 11.9.3-alpha.17 → 11.9.3-alpha.18
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 +4 -0
- package/lib/assets/ai-theta-pro.jpg +0 -0
- package/lib/assets/ai-theta-pro2.jpg +0 -0
- package/lib/assets/ai-theta.jpg +0 -0
- package/lib/assets/ai-theta2.jpg +0 -0
- package/lib/assets/ai-theta3.jpg +0 -0
- package/lib/assets/ai-turret.jpg +0 -0
- package/lib/assets/ai-turret2.jpg +0 -0
- package/lib/assets/bullet2.svg +2 -4
- package/lib/assets/bullet3.svg +4 -2
- package/lib/assets/door-hub-mini.jpg +0 -0
- package/lib/assets/door-hub-mini2.jpg +0 -0
- package/lib/assets/door-hub.jpg +0 -0
- package/lib/assets/door-hub2.jpg +0 -0
- package/lib/assets/envr.png +0 -0
- package/lib/assets/envr2.png +0 -0
- package/lib/assets/express.jpg +0 -0
- package/lib/assets/express2.jpg +0 -0
- package/lib/assets/express7.jpg +0 -0
- package/lib/assets/express72.jpg +0 -0
- package/lib/assets/floodlight.svg +2 -9
- package/lib/assets/floodlight2.svg +9 -2
- package/lib/assets/g2-reader.jpg +0 -0
- package/lib/assets/g2-reader2.jpg +0 -0
- package/lib/assets/g3-reader-pro.jpg +0 -0
- package/lib/assets/g3-reader-pro2.jpg +0 -0
- package/lib/assets/g3-starter-kit.jpg +0 -0
- package/lib/assets/g3-starter-kit2.jpg +0 -0
- package/lib/assets/g4-instant.jpg +0 -0
- package/lib/assets/g4-instant2.jpg +0 -0
- package/lib/assets/g4-ptz.jpg +0 -0
- package/lib/assets/g4-ptz2.jpg +0 -0
- package/lib/assets/g5-bullet.jpg +0 -0
- package/lib/assets/g5-bullet2.jpg +0 -0
- package/lib/assets/g5-dome.jpg +0 -0
- package/lib/assets/g5-dome2.jpg +0 -0
- package/lib/assets/globe.svg +2 -9
- package/lib/assets/globe2.svg +9 -2
- package/lib/assets/power.svg +1 -4
- package/lib/assets/power2.svg +4 -1
- package/lib/assets/ptz2.svg +2 -2
- package/lib/assets/ptz3.svg +2 -2
- package/lib/assets/rack.svg +1 -4
- package/lib/assets/rack2.svg +4 -1
- package/lib/assets/ucgFiber.jpg +0 -0
- package/lib/assets/ucgFiber2.jpg +0 -0
- 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/udr2.jpg +0 -0
- package/lib/assets/udr3.jpg +0 -0
- package/lib/assets/udr7.jpg +0 -0
- package/lib/assets/udr72.jpg +0 -0
- package/lib/components/Header/Header.js +1 -1
- package/lib/components/Header/Header.mjs +1 -1
- package/lib/components/Header/ProHeader/ProHeader.js +1 -1
- package/lib/components/Header/ProHeader/ProHeader.mjs +1 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.js +1 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.mjs +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTable.styles.d.ts +3 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTable.styles.js +3 -0
- package/lib/components/ModelCompareV4/CompareTable/CompareTable.styles.js.map +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTable.styles.mjs +3 -0
- package/lib/components/ModelCompareV4/CompareTable/CompareTable.styles.mjs.map +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/CompareTableMarkup.js +11 -19
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/CompareTableMarkup.js.map +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/CompareTableMarkup.mjs +11 -19
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/CompareTableMarkup.mjs.map +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/ProductHeader/ProductHeader.js +9 -6
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/ProductHeader/ProductHeader.js.map +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/ProductHeader/ProductHeader.mjs +9 -6
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/ProductHeader/ProductHeader.mjs.map +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/StickyGrid/StickyGridBody.js +1 -0
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/StickyGrid/StickyGridBody.js.map +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/StickyGrid/StickyGridBody.mjs +1 -0
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/StickyGrid/StickyGridBody.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.mjs +1 -1
- package/lib/components/ResourceCalculatorV1/assets/consoles/envr.png.js +1 -1
- package/lib/components/ResourceCalculatorV1/assets/consoles/envr.png.mjs +2 -2
- package/lib/constants/icons/header/globe.svg.js +1 -1
- package/lib/constants/icons/header/globe.svg.mjs +2 -2
- package/lib/constants/icons/header/index.js +1 -1
- package/lib/constants/icons/header/index.mjs +1 -1
- package/lib/constants/icons/menu/floodlight.svg.js +5 -5
- package/lib/constants/icons/menu/floodlight.svg.mjs +2 -2
- package/lib/constants/icons/menu/index.js +9 -9
- package/lib/constants/icons/menu/index.mjs +3 -3
- package/lib/constants/icons/menu/power.svg.js +5 -5
- package/lib/constants/icons/menu/power.svg.mjs +2 -2
- package/lib/constants/icons/menu/rack.svg.js +5 -5
- package/lib/constants/icons/menu/rack.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Assets-V4/VideoRecorders/envr.png.js +1 -1
- package/lib/constants/modelCompareData/assets/Assets-V4/VideoRecorders/envr.png.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Bullet/bullet.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/Bullet/bullet.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Bullet/g5-bullet.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Bullet/g5-bullet.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/CameraSecurity/ai-theta-pro.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/CameraSecurity/ai-theta-pro.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/CameraSecurity/ai-theta.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/CameraSecurity/ai-theta.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Compact/g4-instant.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Compact/g4-instant.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/express.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/express.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/express7.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/express7.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/ucgFiber.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/ucgFiber.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/ucgMax.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/ucgMax.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/ucgUltra.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/ucgUltra.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/udr.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/udr.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/udr7.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/udr7.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/express.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Consoles/express.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/express7.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Consoles/express7.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/ucgFiber.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Consoles/ucgFiber.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/ucgMax.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Consoles/ucgMax.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/ucgUltra.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Consoles/ucgUltra.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/udr.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Consoles/udr.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/udr7.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Consoles/udr7.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DomeTurret/ai-turret.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DomeTurret/ai-turret.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DomeTurret/g5-dome.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DomeTurret/g5-dome.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/door-hub-mini.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/door-hub-mini.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/door-hub.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/door-hub.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/g2-reader.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g2-reader.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-reader-pro.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-reader-pro.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-starter-kit.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-starter-kit.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Interior/ai-theta-pro.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Interior/ai-theta-pro.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Interior/ai-theta.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Interior/ai-theta.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/PTZ/g4-ptz.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/PTZ/g4-ptz.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/floodlight.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/floodlight.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/globe.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/globe.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/power.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/power.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/bullet.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/bullet.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/bullet/g5-bullet.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/bullet/g5-bullet.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/compact/g4-instant.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/compact/g4-instant.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/ai-turret.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/ai-turret.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/g5-dome.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/g5-dome.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/door-hub-mini.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/door-hub-mini.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/door-hub.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/door-hub.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g2-reader.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g2-reader.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-reader-pro.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-reader-pro.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-starter-kit.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-starter-kit.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/interior-design/ai-theta.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/interior-design/ai-theta.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/ptz/g4-ptz.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/ptz/g4-ptz.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/ptz.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/ptz.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/ptz.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/ptz.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/rack.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/rack.svg.mjs +2 -2
- package/lib/constants/modelCompareData/data/CameraSecurity.js +5 -5
- package/lib/constants/modelCompareData/data/CameraSecurity.mjs +3 -3
- package/lib/constants/modelCompareData/data/CloudGateways.js +15 -15
- package/lib/constants/modelCompareData/data/CloudGateways.mjs +10 -10
- package/lib/constants/modelCompareData/data/DreamMachineConsolev4.js +12 -12
- package/lib/constants/modelCompareData/data/DreamMachineConsolev4.mjs +8 -8
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Bullet.js +1 -1
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Bullet.mjs +1 -1
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Ptz.js +1 -1
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Ptz.mjs +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/bullet.js +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/bullet.mjs +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/ptz.js +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/ptz.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/aiTurret.js +2 -2
- package/lib/constants/modelCompareData/data/products/aiTurret.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/doorHub.js +2 -2
- package/lib/constants/modelCompareData/data/products/doorHub.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/doorHubMini.js +2 -2
- package/lib/constants/modelCompareData/data/products/doorHubMini.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/envrSpotlight.js +1 -1
- package/lib/constants/modelCompareData/data/products/envrSpotlight.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/express.js +1 -1
- package/lib/constants/modelCompareData/data/products/express.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/express7.js +1 -1
- package/lib/constants/modelCompareData/data/products/express7.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/g2Reader.js +2 -2
- package/lib/constants/modelCompareData/data/products/g2Reader.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g3ReaderPro.js +2 -2
- package/lib/constants/modelCompareData/data/products/g3ReaderPro.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g3StarterKit.js +2 -2
- package/lib/constants/modelCompareData/data/products/g3StarterKit.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g4Instant.js +2 -2
- package/lib/constants/modelCompareData/data/products/g4Instant.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g4Ptz.js +2 -2
- package/lib/constants/modelCompareData/data/products/g4Ptz.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g5Bullet.js +2 -2
- package/lib/constants/modelCompareData/data/products/g5Bullet.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g5Dome.js +2 -2
- package/lib/constants/modelCompareData/data/products/g5Dome.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/theta.js +2 -2
- package/lib/constants/modelCompareData/data/products/theta.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/thetaPro.js +1 -1
- package/lib/constants/modelCompareData/data/products/thetaPro.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/ucgFiber.js +1 -1
- package/lib/constants/modelCompareData/data/products/ucgFiber.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/ucgMax.js +1 -1
- package/lib/constants/modelCompareData/data/products/ucgMax.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/ucgUltra.js +1 -1
- package/lib/constants/modelCompareData/data/products/ucgUltra.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/udr.js +1 -1
- package/lib/constants/modelCompareData/data/products/udr.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/udr7.js +1 -1
- package/lib/constants/modelCompareData/data/products/udr7.mjs +1 -1
- package/lib/constants/modelCompareData/data/properties/accessPowerMethod.js +1 -1
- package/lib/constants/modelCompareData/data/properties/accessPowerMethod.mjs +1 -1
- package/lib/constants/modelCompareData/data/properties/availability.js +1 -1
- package/lib/constants/modelCompareData/data/properties/availability.mjs +1 -1
- package/lib/constants/modelCompareData/data/properties/builtInFloodlight.js +1 -1
- package/lib/constants/modelCompareData/data/properties/builtInFloodlight.mjs +1 -1
- package/lib/constants/modelCompareData/data/properties/dcPowerOutput.js +1 -1
- package/lib/constants/modelCompareData/data/properties/dcPowerOutput.mjs +1 -1
- package/lib/constants/modelCompareData/data/properties/mounting.js +1 -1
- package/lib/constants/modelCompareData/data/properties/mounting.mjs +1 -1
- package/lib/constants/modelCompareData/data/properties/webMode.js +1 -1
- package/lib/constants/modelCompareData/data/properties/webMode.mjs +1 -1
- package/lib/contexts/MenuContext/mapping.js +3 -3
- package/lib/contexts/MenuContext/mapping.mjs +2 -2
- package/lib/contexts/MicrositeMenuContext/mapping.js +3 -3
- package/lib/contexts/MicrositeMenuContext/mapping.mjs +2 -2
- package/package.json +1 -1
package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/CompareTableMarkup.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompareTableMarkup.mjs","sources":["../../../../../src/components/ModelCompareV4/CompareTable/CompareTableMarkup/CompareTableMarkup.tsx"],"sourcesContent":["import { Tooltip } from \"@ubnt/ui-components/Tooltip\";\nimport {\n Fragment,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { useWindowSize } from \"react-use\";\n\nimport { CONTAINER_WIDTH } from \"../../../../constants/layout\";\nimport ndaaBadge from \"../../../../constants/modelCompareData/assets/ndaa-compliant.png\";\nimport tooltipIcon from \"../../../../constants/modelCompareData/assets/tooltip-info.svg\";\nimport { emptyColumn } from \"../../../../constants/modelCompareData/data/products/emptyColumn\";\nimport { useModelCompareTranslation } from \"../../../../constants/modelCompareData/translations/useModelCompareTranslation\";\nimport type { MutatedProduct } from \"../../../../constants/modelCompareData/types\";\nimport { useMenu } from \"../../../../contexts/MenuContext\";\nimport { LanguageDirectionType } from \"../../../../contexts/MenuContext/utils\";\nimport { Reveal } from \"../../../Reveal/Reveal\";\nimport { StyleableSvgImage } from \"../../../StyleableSvgImage\";\nimport * as S from \"../CompareTable.styles\";\nimport { TOOLTIP_CLASS_NAME } from \"../CompareTable.styles\";\nimport { getNumberOfColumns } from \"../helpers/getNumberOfColumns\";\nimport { useButtonRenderer } from \"../helpers/RenderButton\";\nimport type { Position } from \"../helpers/useTrackColumnPositions\";\nimport { useTrackColumnPositions } from \"../helpers/useTrackColumnPositions\";\nimport type { CompareTableMarkupProps } from \"./CompareTableMarkup.types\";\nimport { CompanyLogo } from \"./components/CompanyLogo/CompanyLogo\";\nimport { ModelCompareOverflowScrollButton } from \"./components/CompareTableOverflowScrollButton\";\nimport { EmptyColumnHeader } from \"./components/EmptyColumnHeader/EmptyColumnHeader\";\nimport { FootNotes } from \"./components/FootNotes/FootNotes\";\nimport { HeaderShadow } from \"./components/HeaderShadow\";\nimport { Notes } from \"./components/Notes/Notes\";\nimport { ProductHeader } from \"./components/ProductHeader/ProductHeader\";\nimport { PropertyValueGridItem } from \"./components/PropertyValueGridItem\";\nimport {\n StickyGrid,\n StickyGridBody,\n StickyGridHeader,\n StickyGridOverlay,\n} from \"./components/StickyGrid\";\n\nconst SMOOTH_SIZE_REDUCTION = 4;\nexport const MIGRATION_TABLE_BREAKPOINT = 800;\n\nexport const CompareTableMarkup = ({\n products,\n properties,\n columnWidth = 338,\n propertyColumnWidth = 230,\n headerStickOffset,\n overlayTopOffset,\n showBuyButton,\n onLinkClick,\n linkToStoreTitleClick,\n showBadges,\n setSelectedProducts,\n hasBeenObserved,\n selectedProductsLimit,\n setExternalState,\n selectedProducts,\n currAvailableProducts,\n isOverviewPage,\n isStaticTable,\n isMigrationTable,\n}: CompareTableMarkupProps) => {\n const { storeId } = useMenu();\n const { formatMessage } = useModelCompareTranslation();\n const renderButton = useButtonRenderer();\n const { width: screenWidth } = useWindowSize();\n const isLessThanOrEqualToFiveProducts = currAvailableProducts.length <= 5;\n const [headerItemsAreSticking, setHeaderItemsAreSticking] = useState(false);\n const [columnPositions, setColumnPositions] = useState<Position[]>([]);\n const [, triggerRender] = useState(0);\n\n const gridBodyRef = useRef<HTMLDivElement | null>(null);\n const productHeaderRefs = useRef<(HTMLDivElement | null)[]>([]);\n\n // #############################################################################\n // Grid calculations\n // #############################################################################\n const isSmallScreen = useMemo(\n () => screenWidth < S.MOBILE_BREAKPOINT,\n [screenWidth],\n );\n\n const isMigrationTableMobileVersion = useMemo(\n () => screenWidth < MIGRATION_TABLE_BREAKPOINT && isMigrationTable,\n [screenWidth, isMigrationTable],\n );\n\n const isGreaterThanDesktopWidth = useMemo(\n () => screenWidth > CONTAINER_WIDTH.DESKTOP,\n [screenWidth],\n );\n\n const leftColumnWidth = useMemo(\n () =>\n isSmallScreen || isMigrationTableMobileVersion\n ? 0\n : Math.min(screenWidth / SMOOTH_SIZE_REDUCTION, propertyColumnWidth),\n [\n isSmallScreen,\n propertyColumnWidth,\n screenWidth,\n isMigrationTableMobileVersion,\n ],\n );\n\n const maxImageHeight = useMemo(\n () => Math.max(...products.map(({ image }) => image.height)),\n [products],\n );\n\n const stickOffset = useMemo(\n () => (headerStickOffset ? headerStickOffset({ maxImageHeight }) : 0),\n [headerStickOffset, maxImageHeight],\n );\n\n const numberOfColumns = useMemo(\n () =>\n isStaticTable\n ? products.length\n : getNumberOfColumns({\n selectedProducts,\n selectedProductsLimit,\n products,\n }),\n [selectedProducts, selectedProductsLimit, products, isStaticTable],\n );\n\n const templateColumnWidth = useMemo(() => {\n const isMigrationDesktop =\n isMigrationTable && !isMigrationTableMobileVersion;\n\n if (isMigrationDesktop) return \"1fr\";\n if (isMigrationTableMobileVersion || isSmallScreen) return \"100%\";\n if (isGreaterThanDesktopWidth) return \"1fr\";\n\n return `${columnWidth}px`;\n }, [\n isSmallScreen,\n columnWidth,\n isGreaterThanDesktopWidth,\n isMigrationTable,\n isMigrationTableMobileVersion,\n ]);\n\n /**\n * 1 sticky left column\n * N non-sticky product columns\n */\n const templateColumns = useMemo(\n () =>\n `${leftColumnWidth}px repeat(${numberOfColumns}, ${templateColumnWidth})`,\n [leftColumnWidth, numberOfColumns, templateColumnWidth],\n );\n\n const hasNotes = useMemo(() => {\n return products.some(({ notes }) => !!notes?.length);\n }, [products]);\n\n const hasFootnotes = useMemo(() => {\n return products.some(({ footnotes }) => footnotes?.length);\n }, [products]);\n\n // #############################################################################\n // Column button\n // #############################################################################\n const getComingSoonButtonText = useCallback(\n (product: MutatedProduct) => {\n const buttonText = product.comingSoonButtonText;\n\n if (typeof buttonText === \"string\") {\n return formatMessage(buttonText);\n }\n\n if (typeof buttonText === \"function\" && !!buttonText(storeId)) {\n const foundKey = buttonText(storeId);\n\n if (foundKey) {\n return formatMessage(foundKey);\n }\n }\n\n return formatMessage(\"Coming Soon\");\n },\n [formatMessage, storeId],\n );\n\n const hasMultipleProductsSelected = useMemo(\n () => products.filter(({ id }) => id !== emptyColumn.id).length > 1,\n [products],\n );\n\n // #############################################################################\n // Sets position of columns for spotlight\n // #############################################################################\n\n useTrackColumnPositions(\n productHeaderRefs,\n useCallback((positions) => {\n setColumnPositions(positions);\n }, []),\n isMigrationTable,\n );\n\n useEffect(() => {\n if (!isMigrationTable) return;\n\n const handleResize = () => {\n triggerRender((n) => n + 1);\n };\n\n window.addEventListener(\"resize\", handleResize);\n return () => window.removeEventListener(\"resize\", handleResize);\n }, [isMigrationTable]);\n\n // #############################################################################\n // Removes overflowX of `body` so spotlights don't cause horizontal scrolling\n // #############################################################################\n\n const originalOverflowXRef = useRef<string | null>(null);\n\n useEffect(() => {\n if (isMigrationTableMobileVersion) {\n if (originalOverflowXRef.current === null) {\n originalOverflowXRef.current = document.body.style.overflowX;\n }\n\n document.body.style.overflowX = \"hidden\";\n\n return () => {\n if (originalOverflowXRef.current !== null) {\n document.body.style.overflowX = originalOverflowXRef.current;\n originalOverflowXRef.current = null;\n }\n };\n }\n\n return () => {};\n }, [isMigrationTable, isSmallScreen, isMigrationTableMobileVersion]);\n\n return (\n // APPLY left to right override in all cases rather than redo the model compare for Arabic\n <section dir={LanguageDirectionType.ltr}>\n <StickyGrid templateColumns={templateColumns}>\n <StickyGridHeader\n removePositionSticky={isMigrationTable}\n stickOffset={stickOffset}\n onStickyStateChange={setHeaderItemsAreSticking}\n nonScrollChildren={({ grid: { isAtMinX }, isStuck }) => {\n if (!isMigrationTable)\n return (\n <HeaderShadow\n leftColumnWidth={leftColumnWidth}\n shadowLeftColumn={isAtMinX}\n show={isStuck}\n />\n );\n return null;\n }}\n >\n <S.PlaceholderGridItem stickX={!isMigrationTable} />\n {products.map((product, index) => {\n const headerElement = productHeaderRefs.current[index];\n const gridBodyElement = gridBodyRef.current;\n const headerRect = headerElement?.getBoundingClientRect();\n const gridBodyRect = gridBodyElement?.getBoundingClientRect();\n const greatestProductHeaderHeight = Math.max(\n ...productHeaderRefs.current\n .map((header) => header?.getBoundingClientRect().height)\n .filter(\n (height): height is number => typeof height === \"number\",\n ),\n );\n\n const sharedSpotlightValues = {\n $isSmallScreen: isMigrationTableMobileVersion,\n $coverWidth:\n (document.documentElement.clientWidth -\n (headerRect?.width ?? 0)) /\n 2,\n $columnCoordinates: {\n x: columnPositions[index]?.left ?? 0,\n y: columnPositions[index]?.top ?? 0,\n },\n $spotlightDimensions: {\n width: headerRect?.width ?? 0,\n height:\n greatestProductHeaderHeight + (gridBodyRect?.height ?? 0),\n },\n };\n\n return product.propertyValues.length ? (\n <S.Container key={`${product.id}-${index}`}>\n {isMigrationTable && (\n <S.CompanyLogoWrapper>\n <Reveal index={index} playAnimation={hasBeenObserved}>\n <CompanyLogo company={product.competitorCompany} />\n </Reveal>\n </S.CompanyLogoWrapper>\n )}\n {isMigrationTable &&\n createPortal(\n headerElement && gridBodyElement && product.isSpotlit ? (\n <>\n <S.SpotlightCover {...sharedSpotlightValues} />\n <S.SpotlightCover\n $isRightCover\n {...sharedSpotlightValues}\n />\n <Reveal index={index} playAnimation={hasBeenObserved}>\n <S.NDAABadge\n src={ndaaBadge as string}\n alt={`The ${formatMessage(product.title)} is NDAA Compliant`}\n $columnCoordinates={\n sharedSpotlightValues.$columnCoordinates\n }\n $spotlightWidth={\n sharedSpotlightValues.$spotlightDimensions.width\n }\n />\n <S.Spotlight\n $spotlightDimensions={\n sharedSpotlightValues.$spotlightDimensions\n }\n $columnCoordinates={\n sharedSpotlightValues.$columnCoordinates\n }\n />\n </Reveal>\n </>\n ) : null,\n document.body,\n )}\n\n <ProductHeader\n ref={(el) => (productHeaderRefs.current[index] = el)}\n key={`${product.id}-${index}`}\n isStaticProduct={\n isStaticTable || (!isOverviewPage && index === 0)\n }\n product={product}\n setSelectedProducts={setSelectedProducts}\n index={index}\n setExternalState={setExternalState}\n selectedProducts={selectedProducts}\n linkToStoreTitleClick={linkToStoreTitleClick}\n hasBeenObserved={hasBeenObserved}\n isLessThanOrEqualToFiveProducts={\n isLessThanOrEqualToFiveProducts\n }\n hasMultipleProductsSelected={hasMultipleProductsSelected}\n isSmallScreen={isSmallScreen || isMigrationTableMobileVersion}\n onLinkClick={onLinkClick}\n showBadges={showBadges}\n isMigrationTable={isMigrationTable}\n />\n </S.Container>\n ) : (\n <EmptyColumnHeader\n key={`${product.id}-${index}`}\n product={product}\n index={index}\n hasBeenObserved={hasBeenObserved}\n maxImageHeight={maxImageHeight}\n headerItemsAreSticking={headerItemsAreSticking}\n />\n );\n })}\n </StickyGridHeader>\n\n <StickyGridBody ref={gridBodyRef}>\n {properties.map((property) => (\n <Fragment key={property.id}>\n <S.PropertyTitleGridItem stickX={!isMigrationTable}>\n {!!leftColumnWidth && (\n <S.PropertyTitleGridItemContent>\n <S.PropertyIcon>\n <StyleableSvgImage\n width={30}\n height={30}\n src={property.icon}\n />\n </S.PropertyIcon>\n <S.PropertyTitle>\n {property.title.split(\"\\n\").map((part, i, arr) => (\n <Fragment key={i}>\n {part}\n {i < arr.length - 1 && <br />}\n </Fragment>\n ))}\n </S.PropertyTitle>\n {property.tooltip && (\n <S.PropertyTooltip>\n <S.TooltipStyles maxWidth={property.tooltipWidth} />\n <Tooltip\n tooltipClassName={TOOLTIP_CLASS_NAME}\n description={\n <S.PropertyTooltipContent\n dangerouslySetInnerHTML={{\n __html: property.tooltip,\n }}\n />\n }\n portal\n motif=\"dark\"\n isInteractive\n position=\"right\"\n width={property.tooltipWidth}\n >\n <S.PropertyTooltipHoverArea />\n <S.TooltipIcon\n width={20}\n height={20}\n src={tooltipIcon}\n />\n </Tooltip>\n </S.PropertyTooltip>\n )}\n </S.PropertyTitleGridItemContent>\n )}\n </S.PropertyTitleGridItem>\n\n {products.map((product, index) => {\n const isLastProduct = index === products.length - 1;\n const productProperty = product.propertyValues?.find(\n (product) => product.propertyId === property.id,\n );\n\n return (\n <PropertyValueGridItem\n isLastProduct={isLastProduct}\n key={`${product.id}-${index}`}\n productProperty={productProperty}\n property={property}\n includeProperty={\n isSmallScreen || isMigrationTableMobileVersion\n }\n index={index}\n isMigrationTable={isMigrationTable}\n isSpotlightProduct={!!product.isSpotlit}\n />\n );\n })}\n </Fragment>\n ))}\n\n {/**\n * Notes\n */}\n {hasNotes && <Notes products={products} />}\n\n {/**\n * Buy button\n */}\n <S.EmptyPropertyTitleGridItem stickX />\n {products.map((product, index) =>\n renderButton({\n product,\n index,\n getComingSoonButtonText,\n showBuyButton,\n onLinkClick,\n }),\n )}\n\n {/**\n * Footnotes\n */}\n {hasFootnotes && <FootNotes products={products} />}\n </StickyGridBody>\n\n <StickyGridOverlay\n style={{ left: `${leftColumnWidth}px` }}\n topOffset={overlayTopOffset}\n >\n {({ isAtMinX }) => (\n <ModelCompareOverflowScrollButton\n isVisible={!isAtMinX}\n color={leftColumnWidth > 0 ? \"rgb(23 49 73 / 0.1)\" : \"white\"}\n rotationDegrees={180}\n onClickColumnDiff={-1}\n totalColumns={products.length}\n totalDeadSpace={leftColumnWidth}\n isSmallScreen={isSmallScreen || isMigrationTableMobileVersion}\n isMigrationTable={isMigrationTable}\n />\n )}\n </StickyGridOverlay>\n\n <StickyGridOverlay style={{ right: 0 }} topOffset={overlayTopOffset}>\n {({ isAtMaxX }) => (\n <ModelCompareOverflowScrollButton\n isLeftButton={false}\n isVisible={!isAtMaxX}\n color=\"white\"\n rotationDegrees={0}\n onClickColumnDiff={1}\n totalColumns={products.length}\n totalDeadSpace={leftColumnWidth}\n isSmallScreen={isSmallScreen || isMigrationTable}\n isMigrationTable={isMigrationTable}\n />\n )}\n </StickyGridOverlay>\n </StickyGrid>\n </section>\n );\n};\n"],"names":["SMOOTH_SIZE_REDUCTION","MIGRATION_TABLE_BREAKPOINT","CompareTableMarkup","products","properties","columnWidth","propertyColumnWidth","headerStickOffset","overlayTopOffset","showBuyButton","onLinkClick","linkToStoreTitleClick","showBadges","setSelectedProducts","hasBeenObserved","selectedProductsLimit","setExternalState","selectedProducts","currAvailableProducts","isOverviewPage","isStaticTable","isMigrationTable","storeId","useMenu","formatMessage","useModelCompareTranslation","renderButton","useButtonRenderer","width","screenWidth","useWindowSize","isLessThanOrEqualToFiveProducts","length","headerItemsAreSticking","setHeaderItemsAreSticking","useState","columnPositions","setColumnPositions","triggerRender","gridBodyRef","useRef","productHeaderRefs","isSmallScreen","useMemo","S.MOBILE_BREAKPOINT","isMigrationTableMobileVersion","isGreaterThanDesktopWidth","CONTAINER_WIDTH","DESKTOP","leftColumnWidth","Math","min","maxImageHeight","max","map","image","height","stickOffset","numberOfColumns","getNumberOfColumns","templateColumnWidth","isMigrationDesktop","templateColumns","hasNotes","some","notes","hasFootnotes","footnotes","getComingSoonButtonText","useCallback","product","buttonText","comingSoonButtonText","foundKey","hasMultipleProductsSelected","filter","id","emptyColumn","useTrackColumnPositions","positions","useEffect","handleResize","n","window","addEventListener","removeEventListener","originalOverflowXRef","current","document","body","style","overflowX","dir","LanguageDirectionType","ltr","children","jsxs","StickyGrid","StickyGridHeader","removePositionSticky","onStickyStateChange","nonScrollChildren","grid","isAtMinX","isStuck","jsx","HeaderShadow","shadowLeftColumn","show","S.PlaceholderGridItem","stickX","index","headerElement","gridBodyElement","headerRect","getBoundingClientRect","gridBodyRect","greatestProductHeaderHeight","header","sharedSpotlightValues","$isSmallScreen","$coverWidth","documentElement","clientWidth","$columnCoordinates","x","left","y","top","$spotlightDimensions","propertyValues","S.Container","S.CompanyLogoWrapper","Reveal","playAnimation","CompanyLogo","company","competitorCompany","createPortal","isSpotlit","Fragment","S.SpotlightCover","$isRightCover","S.NDAABadge","src","ndaaBadge","alt","title","$spotlightWidth","S.Spotlight","ProductHeader","ref","el","isStaticProduct","EmptyColumnHeader","StickyGridBody","property","S.PropertyTitleGridItem","S.PropertyTitleGridItemContent","S.PropertyIcon","StyleableSvgImage","icon","S.PropertyTitle","split","part","i","arr","tooltip","S.PropertyTooltip","S.TooltipStyles","maxWidth","tooltipWidth","Tooltip","tooltipClassName","TOOLTIP_CLASS_NAME","description","S.PropertyTooltipContent","dangerouslySetInnerHTML","__html","portal","motif","isInteractive","position","S.PropertyTooltipHoverArea","S.TooltipIcon","tooltipIcon","isLastProduct","productProperty","find","propertyId","PropertyValueGridItem","includeProperty","isSpotlightProduct","Notes","S.EmptyPropertyTitleGridItem","FootNotes","StickyGridOverlay","topOffset","ModelCompareOverflowScrollButton","isVisible","color","rotationDegrees","onClickColumnDiff","totalColumns","totalDeadSpace","right","isAtMaxX","isLeftButton"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAMA,qBAAwB,GAAA,CAAA;AACvB,MAAMC,0BAA6B,GAAA,GAAA;AAEnC,MAAMC,qBAAqBA,CAAC;EACjCC,QAAA;EACAC,UAAA;EACAC,WAAc,GAAA,GAAA;EACdC,mBAAsB,GAAA,GAAA;EACtBC,iBAAA;EACAC,gBAAA;EACAC,aAAA;EACAC,WAAA;EACAC,qBAAA;EACAC,UAAA;EACAC,mBAAA;EACAC,eAAA;EACAC,qBAAA;EACAC,gBAAA;EACAC,gBA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iG,KAAA,EAAOvJ,eAAkB,GAAA,CAAA,GAAI,qBAAwB,GAAA,OAAA;YACrDwJ,eAAiB,EAAA,GAAA;YACjBC,iBAAmB,EAAA,CAAA,CAAA;YACnBC,cAAcxM,QAAS,CAAA6B,MAAA;YACvB4K,cAAgB,EAAA3J,eAAA;YAChBP,eAAeA,aAAiB,IAAAG,6BAAA;YAChCxB;UAAA,CAAA;QACF,CAEJ,CAAA,EAEC,eAAAoF,GAAA,CAAA2F,iBAAA,EAAA;UAAkB1G,KAAO,EAAA;YAAEmH,KAAO,EAAA;UAAA,CAAK;UAAAR,SAAA,EAAW7L,gBAChD;UAAAuF,QAAA,EAAAA,CAAC;YAAE+G;UACF,CAAA,KAAA,eAAArG,GAAA,CAAC6F,gCAAA,EAAA;YACCS,YAAc,EAAA,KAAA;YACdR,WAAW,CAACO,QAAA;YACZN,KAAM,EAAA,OAAA;YACNC,eAAiB,EAAA,CAAA;YACjBC,iBAAmB,EAAA,CAAA;YACnBC,cAAcxM,QAAS,CAAA6B,MAAA;YACvB4K,cAAgB,EAAA3J,eAAA;YAChBP,eAAeA,aAAiB,IAAArB,gBAAA;YAChCA;UAAA,CAAA;QAGN,CAAA,CAAA;MAAA,CACF;IACF,CAAA;EAAA;AAEJ,CAAA;"}
|
|
1
|
+
{"version":3,"file":"CompareTableMarkup.mjs","sources":["../../../../../src/components/ModelCompareV4/CompareTable/CompareTableMarkup/CompareTableMarkup.tsx"],"sourcesContent":["import { Tooltip } from \"@ubnt/ui-components/Tooltip\";\nimport {\n Fragment,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { useWindowSize } from \"react-use\";\n\nimport { CONTAINER_WIDTH } from \"../../../../constants/layout\";\nimport ndaaBadge from \"../../../../constants/modelCompareData/assets/ndaa-compliant.png\";\nimport tooltipIcon from \"../../../../constants/modelCompareData/assets/tooltip-info.svg\";\nimport { emptyColumn } from \"../../../../constants/modelCompareData/data/products/emptyColumn\";\nimport { useModelCompareTranslation } from \"../../../../constants/modelCompareData/translations/useModelCompareTranslation\";\nimport type { MutatedProduct } from \"../../../../constants/modelCompareData/types\";\nimport { useMenu } from \"../../../../contexts/MenuContext\";\nimport { LanguageDirectionType } from \"../../../../contexts/MenuContext/utils\";\nimport { StyleableSvgImage } from \"../../../StyleableSvgImage\";\nimport * as S from \"../CompareTable.styles\";\nimport { TOOLTIP_CLASS_NAME } from \"../CompareTable.styles\";\nimport { getNumberOfColumns } from \"../helpers/getNumberOfColumns\";\nimport { useButtonRenderer } from \"../helpers/RenderButton\";\nimport type { Position } from \"../helpers/useTrackColumnPositions\";\nimport { useTrackColumnPositions } from \"../helpers/useTrackColumnPositions\";\nimport type { CompareTableMarkupProps } from \"./CompareTableMarkup.types\";\nimport { CompanyLogo } from \"./components/CompanyLogo/CompanyLogo\";\nimport { ModelCompareOverflowScrollButton } from \"./components/CompareTableOverflowScrollButton\";\nimport { EmptyColumnHeader } from \"./components/EmptyColumnHeader/EmptyColumnHeader\";\nimport { FootNotes } from \"./components/FootNotes/FootNotes\";\nimport { HeaderShadow } from \"./components/HeaderShadow\";\nimport { Notes } from \"./components/Notes/Notes\";\nimport { ProductHeader } from \"./components/ProductHeader/ProductHeader\";\nimport { PropertyValueGridItem } from \"./components/PropertyValueGridItem\";\nimport {\n StickyGrid,\n StickyGridBody,\n StickyGridHeader,\n StickyGridOverlay,\n} from \"./components/StickyGrid\";\n\nconst SMOOTH_SIZE_REDUCTION = 4;\nexport const MIGRATION_TABLE_BREAKPOINT = 800;\n\nexport const CompareTableMarkup = ({\n products,\n properties,\n columnWidth = 338,\n propertyColumnWidth = 230,\n headerStickOffset,\n overlayTopOffset,\n showBuyButton,\n onLinkClick,\n linkToStoreTitleClick,\n showBadges,\n setSelectedProducts,\n hasBeenObserved,\n selectedProductsLimit,\n setExternalState,\n selectedProducts,\n currAvailableProducts,\n isOverviewPage,\n isStaticTable,\n isMigrationTable,\n}: CompareTableMarkupProps) => {\n const { storeId } = useMenu();\n const { formatMessage } = useModelCompareTranslation();\n const renderButton = useButtonRenderer();\n const { width: screenWidth } = useWindowSize();\n const isLessThanOrEqualToFiveProducts = currAvailableProducts.length <= 5;\n const [headerItemsAreSticking, setHeaderItemsAreSticking] = useState(false);\n const [columnPositions, setColumnPositions] = useState<Position[]>([]);\n const [, triggerRender] = useState(0);\n\n const gridBodyRef = useRef<HTMLDivElement | null>(null);\n const productHeaderRefs = useRef<(HTMLDivElement | null)[]>([]);\n\n // #############################################################################\n // Grid calculations\n // #############################################################################\n const isSmallScreen = useMemo(\n () => screenWidth < S.MOBILE_BREAKPOINT,\n [screenWidth],\n );\n\n const isMigrationTableMobileVersion = useMemo(\n () => screenWidth < MIGRATION_TABLE_BREAKPOINT && isMigrationTable,\n [screenWidth, isMigrationTable],\n );\n\n const isGreaterThanDesktopWidth = useMemo(\n () => screenWidth > CONTAINER_WIDTH.DESKTOP,\n [screenWidth],\n );\n\n const leftColumnWidth = useMemo(\n () =>\n isSmallScreen || isMigrationTableMobileVersion\n ? 0\n : Math.min(screenWidth / SMOOTH_SIZE_REDUCTION, propertyColumnWidth),\n [\n isSmallScreen,\n propertyColumnWidth,\n screenWidth,\n isMigrationTableMobileVersion,\n ],\n );\n\n const maxImageHeight = useMemo(\n () => Math.max(...products.map(({ image }) => image.height)),\n [products],\n );\n\n const stickOffset = useMemo(\n () => (headerStickOffset ? headerStickOffset({ maxImageHeight }) : 0),\n [headerStickOffset, maxImageHeight],\n );\n\n const numberOfColumns = useMemo(\n () =>\n isStaticTable\n ? products.length\n : getNumberOfColumns({\n selectedProducts,\n selectedProductsLimit,\n products,\n }),\n [selectedProducts, selectedProductsLimit, products, isStaticTable],\n );\n\n const templateColumnWidth = useMemo(() => {\n const isMigrationDesktop =\n isMigrationTable && !isMigrationTableMobileVersion;\n\n if (isMigrationDesktop) return \"1fr\";\n if (isMigrationTableMobileVersion || isSmallScreen) return \"100%\";\n if (isGreaterThanDesktopWidth) return \"1fr\";\n\n return `${columnWidth}px`;\n }, [\n isSmallScreen,\n columnWidth,\n isGreaterThanDesktopWidth,\n isMigrationTable,\n isMigrationTableMobileVersion,\n ]);\n\n /**\n * 1 sticky left column\n * N non-sticky product columns\n */\n const templateColumns = useMemo(\n () =>\n `${leftColumnWidth}px repeat(${numberOfColumns}, ${templateColumnWidth})`,\n [leftColumnWidth, numberOfColumns, templateColumnWidth],\n );\n\n const hasNotes = useMemo(() => {\n return products.some(({ notes }) => !!notes?.length);\n }, [products]);\n\n const hasFootnotes = useMemo(() => {\n return products.some(({ footnotes }) => footnotes?.length);\n }, [products]);\n\n // #############################################################################\n // Column button\n // #############################################################################\n const getComingSoonButtonText = useCallback(\n (product: MutatedProduct) => {\n const buttonText = product.comingSoonButtonText;\n\n if (typeof buttonText === \"string\") {\n return formatMessage(buttonText);\n }\n\n if (typeof buttonText === \"function\" && !!buttonText(storeId)) {\n const foundKey = buttonText(storeId);\n\n if (foundKey) {\n return formatMessage(foundKey);\n }\n }\n\n return formatMessage(\"Coming Soon\");\n },\n [formatMessage, storeId],\n );\n\n const hasMultipleProductsSelected = useMemo(\n () => products.filter(({ id }) => id !== emptyColumn.id).length > 1,\n [products],\n );\n\n // #############################################################################\n // Sets position of columns for spotlight\n // #############################################################################\n\n useTrackColumnPositions(\n productHeaderRefs,\n useCallback((positions) => {\n setColumnPositions(positions);\n }, []),\n isMigrationTable,\n );\n\n useEffect(() => {\n if (!isMigrationTable) return;\n\n const handleResize = () => {\n triggerRender((n) => n + 1);\n };\n\n window.addEventListener(\"resize\", handleResize);\n return () => window.removeEventListener(\"resize\", handleResize);\n }, [isMigrationTable]);\n\n // #############################################################################\n // Removes overflowX of `body` so spotlights don't cause horizontal scrolling\n // #############################################################################\n\n const originalOverflowXRef = useRef<string | null>(null);\n\n useEffect(() => {\n if (isMigrationTableMobileVersion) {\n if (originalOverflowXRef.current === null) {\n originalOverflowXRef.current = document.body.style.overflowX;\n }\n\n document.body.style.overflowX = \"hidden\";\n\n return () => {\n if (originalOverflowXRef.current !== null) {\n document.body.style.overflowX = originalOverflowXRef.current;\n originalOverflowXRef.current = null;\n }\n };\n }\n\n return () => {};\n }, [isMigrationTable, isSmallScreen, isMigrationTableMobileVersion]);\n\n return (\n // APPLY left to right override in all cases rather than redo the model compare for Arabic\n <section dir={LanguageDirectionType.ltr}>\n <StickyGrid templateColumns={templateColumns}>\n <StickyGridHeader\n removePositionSticky={isMigrationTable}\n stickOffset={stickOffset}\n onStickyStateChange={setHeaderItemsAreSticking}\n nonScrollChildren={({ grid: { isAtMinX }, isStuck }) => {\n if (!isMigrationTable)\n return (\n <HeaderShadow\n leftColumnWidth={leftColumnWidth}\n shadowLeftColumn={isAtMinX}\n show={isStuck}\n />\n );\n return null;\n }}\n >\n <S.PlaceholderGridItem stickX={!isMigrationTable} />\n {products.map((product, index) => {\n const headerElement = productHeaderRefs.current[index];\n const gridBodyElement = gridBodyRef.current;\n const headerRect = headerElement?.getBoundingClientRect();\n const gridBodyRect = gridBodyElement?.getBoundingClientRect();\n const greatestProductHeaderHeight = Math.max(\n ...productHeaderRefs.current\n .map((header) => header?.getBoundingClientRect().height)\n .filter(\n (height): height is number => typeof height === \"number\",\n ),\n );\n\n const sharedSpotlightValues = {\n $isSmallScreen: isMigrationTableMobileVersion,\n $coverWidth:\n (document.documentElement.clientWidth -\n (headerRect?.width ?? 0)) /\n 2,\n $columnCoordinates: {\n x: columnPositions[index]?.left ?? 0,\n y: columnPositions[index]?.top ?? 0,\n },\n $spotlightDimensions: {\n width: headerRect?.width ?? 0,\n height:\n greatestProductHeaderHeight + (gridBodyRect?.height ?? 0),\n },\n };\n\n return product.propertyValues.length ? (\n <S.Container\n key={`${product.id}-${index}`}\n $isMigrationTable={isMigrationTable}\n >\n {isMigrationTable && (\n <S.CompanyLogoWrapper>\n <CompanyLogo company={product.competitorCompany} />\n </S.CompanyLogoWrapper>\n )}\n {isMigrationTable &&\n createPortal(\n headerElement && gridBodyElement && product.isSpotlit ? (\n <>\n <S.SpotlightCover {...sharedSpotlightValues} />\n <S.SpotlightCover\n $isRightCover\n {...sharedSpotlightValues}\n />\n\n <S.NDAABadge\n src={ndaaBadge as string}\n alt={`The ${formatMessage(product.title)} is NDAA Compliant`}\n $columnCoordinates={\n sharedSpotlightValues.$columnCoordinates\n }\n $spotlightWidth={\n sharedSpotlightValues.$spotlightDimensions.width\n }\n />\n <S.Spotlight\n $spotlightDimensions={\n sharedSpotlightValues.$spotlightDimensions\n }\n $columnCoordinates={\n sharedSpotlightValues.$columnCoordinates\n }\n />\n </>\n ) : null,\n document.body,\n )}\n\n <ProductHeader\n ref={(el) => (productHeaderRefs.current[index] = el)}\n key={`${product.id}-${index}`}\n isStaticProduct={\n isStaticTable || (!isOverviewPage && index === 0)\n }\n product={product}\n setSelectedProducts={setSelectedProducts}\n index={index}\n setExternalState={setExternalState}\n selectedProducts={selectedProducts}\n linkToStoreTitleClick={linkToStoreTitleClick}\n hasBeenObserved={hasBeenObserved}\n isLessThanOrEqualToFiveProducts={\n isLessThanOrEqualToFiveProducts\n }\n hasMultipleProductsSelected={hasMultipleProductsSelected}\n isSmallScreen={isSmallScreen || isMigrationTableMobileVersion}\n onLinkClick={onLinkClick}\n showBadges={showBadges}\n isMigrationTable={isMigrationTable}\n />\n </S.Container>\n ) : (\n <EmptyColumnHeader\n key={`${product.id}-${index}`}\n product={product}\n index={index}\n hasBeenObserved={hasBeenObserved}\n maxImageHeight={maxImageHeight}\n headerItemsAreSticking={headerItemsAreSticking}\n />\n );\n })}\n </StickyGridHeader>\n\n <StickyGridBody ref={gridBodyRef}>\n {properties.map((property) => (\n <Fragment key={property.id}>\n <S.PropertyTitleGridItem stickX={!isMigrationTable}>\n {!!leftColumnWidth && (\n <S.PropertyTitleGridItemContent>\n <S.PropertyIcon>\n <StyleableSvgImage\n width={30}\n height={30}\n src={property.icon}\n />\n </S.PropertyIcon>\n <S.PropertyTitle>\n {property.title.split(\"\\n\").map((part, i, arr) => (\n <Fragment key={i}>\n {part}\n {i < arr.length - 1 && <br />}\n </Fragment>\n ))}\n </S.PropertyTitle>\n {property.tooltip && (\n <S.PropertyTooltip>\n <S.TooltipStyles maxWidth={property.tooltipWidth} />\n <Tooltip\n tooltipClassName={TOOLTIP_CLASS_NAME}\n description={\n <S.PropertyTooltipContent\n dangerouslySetInnerHTML={{\n __html: property.tooltip,\n }}\n />\n }\n portal\n motif=\"dark\"\n isInteractive\n position=\"right\"\n width={property.tooltipWidth}\n >\n <S.PropertyTooltipHoverArea />\n <S.TooltipIcon\n width={20}\n height={20}\n src={tooltipIcon}\n />\n </Tooltip>\n </S.PropertyTooltip>\n )}\n </S.PropertyTitleGridItemContent>\n )}\n </S.PropertyTitleGridItem>\n\n {products.map((product, index) => {\n const isLastProduct = index === products.length - 1;\n const productProperty = product.propertyValues?.find(\n (product) => product.propertyId === property.id,\n );\n\n return (\n <PropertyValueGridItem\n isLastProduct={isLastProduct}\n key={`${product.id}-${index}`}\n productProperty={productProperty}\n property={property}\n includeProperty={\n isSmallScreen || isMigrationTableMobileVersion\n }\n index={index}\n isMigrationTable={isMigrationTable}\n isSpotlightProduct={!!product.isSpotlit}\n />\n );\n })}\n </Fragment>\n ))}\n\n {/**\n * Notes\n */}\n {hasNotes && <Notes products={products} />}\n\n {/**\n * Buy button\n */}\n <S.EmptyPropertyTitleGridItem stickX />\n {products.map((product, index) =>\n renderButton({\n product,\n index,\n getComingSoonButtonText,\n showBuyButton,\n onLinkClick,\n }),\n )}\n\n {/**\n * Footnotes\n */}\n {hasFootnotes && <FootNotes products={products} />}\n </StickyGridBody>\n\n <StickyGridOverlay\n style={{ left: `${leftColumnWidth}px` }}\n topOffset={overlayTopOffset}\n >\n {({ isAtMinX }) => (\n <ModelCompareOverflowScrollButton\n isVisible={!isAtMinX}\n color={leftColumnWidth > 0 ? \"rgb(23 49 73 / 0.1)\" : \"white\"}\n rotationDegrees={180}\n onClickColumnDiff={-1}\n totalColumns={products.length}\n totalDeadSpace={leftColumnWidth}\n isSmallScreen={isSmallScreen || isMigrationTableMobileVersion}\n isMigrationTable={isMigrationTable}\n />\n )}\n </StickyGridOverlay>\n\n <StickyGridOverlay style={{ right: 0 }} topOffset={overlayTopOffset}>\n {({ isAtMaxX }) => (\n <ModelCompareOverflowScrollButton\n isLeftButton={false}\n isVisible={!isAtMaxX}\n color=\"white\"\n rotationDegrees={0}\n onClickColumnDiff={1}\n totalColumns={products.length}\n totalDeadSpace={leftColumnWidth}\n isSmallScreen={isSmallScreen || isMigrationTable}\n isMigrationTable={isMigrationTable}\n />\n )}\n </StickyGridOverlay>\n </StickyGrid>\n </section>\n );\n};\n"],"names":["SMOOTH_SIZE_REDUCTION","MIGRATION_TABLE_BREAKPOINT","CompareTableMarkup","products","properties","columnWidth","propertyColumnWidth","headerStickOffset","overlayTopOffset","showBuyButton","onLinkClick","linkToStoreTitleClick","showBadges","setSelectedProducts","hasBeenObserved","selectedProductsLimit","setExternalState","selectedProducts","currAvailableProducts","isOverviewPage","isStaticTable","isMigrationTable","storeId","useMenu","formatMessage","useModelCompareTranslation","renderButton","useButtonRenderer","width","screenWidth","useWindowSize","isLessThanOrEqualToFiveProducts","length","headerItemsAreSticking","setHeaderItemsAreSticking","useState","columnPositions","setColumnPositions","triggerRender","gridBodyRef","useRef","productHeaderRefs","isSmallScreen","useMemo","S.MOBILE_BREAKPOINT","isMigrationTableMobileVersion","isGreaterThanDesktopWidth","CONTAINER_WIDTH","DESKTOP","leftColumnWidth","Math","min","maxImageHeight","max","map","image","height","stickOffset","numberOfColumns","getNumberOfColumns","templateColumnWidth","isMigrationDesktop","templateColumns","hasNotes","some","notes","hasFootnotes","footnotes","getComingSoonButtonText","useCallback","product","buttonText","comingSoonButtonText","foundKey","hasMultipleProductsSelected","filter","id","emptyColumn","useTrackColumnPositions","positions","useEffect","handleResize","n","window","addEventListener","removeEventListener","originalOverflowXRef","current","document","body","style","overflowX","dir","LanguageDirectionType","ltr","children","jsxs","StickyGrid","StickyGridHeader","removePositionSticky","onStickyStateChange","nonScrollChildren","grid","isAtMinX","isStuck","jsx","HeaderShadow","shadowLeftColumn","show","S.PlaceholderGridItem","stickX","index","headerElement","gridBodyElement","headerRect","getBoundingClientRect","gridBodyRect","greatestProductHeaderHeight","header","sharedSpotlightValues","$isSmallScreen","$coverWidth","documentElement","clientWidth","$columnCoordinates","x","left","y","top","$spotlightDimensions","propertyValues","S.Container","$isMigrationTable","S.CompanyLogoWrapper","CompanyLogo","company","competitorCompany","createPortal","isSpotlit","Fragment","S.SpotlightCover","$isRightCover","S.NDAABadge","src","ndaaBadge","alt","title","$spotlightWidth","S.Spotlight","ProductHeader","ref","el","isStaticProduct","EmptyColumnHeader","StickyGridBody","property","S.PropertyTitleGridItem","S.PropertyTitleGridItemContent","S.PropertyIcon","StyleableSvgImage","icon","S.PropertyTitle","split","part","i","arr","tooltip","S.PropertyTooltip","S.TooltipStyles","maxWidth","tooltipWidth","Tooltip","tooltipClassName","TOOLTIP_CLASS_NAME","description","S.PropertyTooltipContent","dangerouslySetInnerHTML","__html","portal","motif","isInteractive","position","S.PropertyTooltipHoverArea","S.TooltipIcon","tooltipIcon","isLastProduct","productProperty","find","propertyId","PropertyValueGridItem","includeProperty","isSpotlightProduct","Notes","S.EmptyPropertyTitleGridItem","FootNotes","StickyGridOverlay","topOffset","ModelCompareOverflowScrollButton","isVisible","color","rotationDegrees","onClickColumnDiff","totalColumns","totalDeadSpace","right","isAtMaxX","isLeftButton"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,MAAMA,qBAAwB,GAAA,CAAA;AACvB,MAAMC,0BAA6B,GAAA,GAAA;AAEnC,MAAMC,qBAAqBA,CAAC;EACjCC,QAAA;EACAC,UAAA;EACAC,WAAc,GAAA,GAAA;EACdC,mBAAsB,GAAA,GAAA;EACtBC,iBAAA;EACAC,gBAAA;EACAC,aAAA;EACAC,WAAA;EACAC,qBAAA;EACAC,UAAA;EACAC,mBAAA;EACAC,eAAA;EACAC,qBAAA;EACAC,gBA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vB2K,cAAgB,EAAA1J,eAAA;YAChBP,eAAeA,aAAiB,IAAAG,6BAAA;YAChCxB;UAAA,CAAA;QACF,CAEJ,CAAA,EAEC,eAAAoF,GAAA,CAAA0F,iBAAA,EAAA;UAAkBzG,KAAO,EAAA;YAAEkH,KAAO,EAAA;UAAA,CAAK;UAAAR,SAAA,EAAW5L,gBAChD;UAAAuF,QAAA,EAAAA,CAAC;YAAE8G;UACF,CAAA,KAAA,eAAApG,GAAA,CAAC4F,gCAAA,EAAA;YACCS,YAAc,EAAA,KAAA;YACdR,WAAW,CAACO,QAAA;YACZN,KAAM,EAAA,OAAA;YACNC,eAAiB,EAAA,CAAA;YACjBC,iBAAmB,EAAA,CAAA;YACnBC,cAAcvM,QAAS,CAAA6B,MAAA;YACvB2K,cAAgB,EAAA1J,eAAA;YAChBP,eAAeA,aAAiB,IAAArB,gBAAA;YAChCA;UAAA,CAAA;QAGN,CAAA,CAAA;MAAA,CACF;IACF,CAAA;EAAA;AAEJ,CAAA;"}
|
|
@@ -80,11 +80,8 @@ const ProductHeader = React.forwardRef(({
|
|
|
80
80
|
document.removeEventListener("scroll", scrollHandler);
|
|
81
81
|
};
|
|
82
82
|
}, []);
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
playAnimation: hasBeenObserved,
|
|
86
|
-
backgroundColor: isMigrationTable ? "transparent" : theme.theme.colors.white,
|
|
87
|
-
children: /* @__PURE__ */jsxRuntime.jsx("div", {
|
|
83
|
+
const renderProductHeader = () => {
|
|
84
|
+
return /* @__PURE__ */jsxRuntime.jsx("div", {
|
|
88
85
|
ref,
|
|
89
86
|
children: /* @__PURE__ */jsxRuntime.jsxs(CompareTable_styles.HeaderGridItem, {
|
|
90
87
|
$hasTransparentBackground: isMigrationTable,
|
|
@@ -144,7 +141,13 @@ const ProductHeader = React.forwardRef(({
|
|
|
144
141
|
})]
|
|
145
142
|
})]
|
|
146
143
|
})
|
|
147
|
-
})
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
return isMigrationTable ? renderProductHeader() : /* @__PURE__ */jsxRuntime.jsx(Reveal.Reveal, {
|
|
147
|
+
index,
|
|
148
|
+
playAnimation: hasBeenObserved,
|
|
149
|
+
backgroundColor: theme.theme.colors.white,
|
|
150
|
+
children: renderProductHeader()
|
|
148
151
|
});
|
|
149
152
|
});
|
|
150
153
|
ProductHeader.displayName = "ProductHeader";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductHeader.js","sources":["../../../../../../../src/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/ProductHeader/ProductHeader.tsx"],"sourcesContent":["import { Tooltip } from \"@ubnt/ui-components/Tooltip\";\nimport type { ForwardedRef } from \"react\";\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\nimport closeIcon from \"../../../../../../constants/modelCompareData/assets/close.svg\";\nimport { useModelCompareTranslation } from \"../../../../../../constants/modelCompareData/translations/useModelCompareTranslation\";\nimport { theme } from \"../../../../../../constants/theme\";\nimport { useMenu } from \"../../../../../../contexts/MenuContext/context\";\nimport { imageSrc } from \"../../../../../../utils/asset\";\nimport { HEADER_HEIGHT } from \"../../../../../Header/Header.styles\";\nimport { Reveal } from \"../../../../../Reveal/Reveal\";\nimport { StyleableSvgImage } from \"../../../../../StyleableSvgImage\";\nimport * as S from \"../../../CompareTable.styles\";\nimport { getStoreHref } from \"../../../helpers/getStoreHref\";\nimport { Badges } from \"../Badges/Badges\";\nimport type { ProductHeaderProps } from \"./ProductHeader.types\";\n\nexport const ProductHeader = forwardRef(\n (\n {\n product,\n setSelectedProducts,\n index,\n setExternalState,\n selectedProducts,\n linkToStoreTitleClick,\n hasBeenObserved,\n isLessThanOrEqualToFiveProducts,\n hasMultipleProductsSelected,\n isSmallScreen,\n showBadges,\n isStaticProduct,\n isMigrationTable,\n }: ProductHeaderProps,\n ref: ForwardedRef<HTMLDivElement>,\n ) => {\n const { formatMessage } = useModelCompareTranslation();\n const { createSiteUrl, languageDirection, storeId } = useMenu();\n const [productTitleWidth, setProductTitleWidth] = useState<\n number | undefined\n >(undefined);\n const [toolTipIsPositionedTop, setToolTipIsPositionedTop] = useState(true);\n\n const productTitleRef = useRef<HTMLButtonElement | null>(null);\n const productMetaRef = useRef<HTMLDivElement | null>(null);\n\n const storeHref = useMemo(\n () => getStoreHref({ product, createSiteUrl, storeId }),\n [product, createSiteUrl, storeId],\n );\n\n const techspecsHref = useMemo(\n () => product.techspecsPath && createSiteUrl(product.techspecsPath),\n [createSiteUrl, product.techspecsPath],\n );\n\n const productTitleHref = useMemo(\n () => (linkToStoreTitleClick ? storeHref : techspecsHref),\n [linkToStoreTitleClick, storeHref, techspecsHref],\n );\n\n const removeHandler = useCallback(() => {\n const updatedProducts =\n selectedProducts &&\n selectedProducts.filter(\n (selectedProduct) => selectedProduct.productId !== product.id,\n );\n\n if (setExternalState && updatedProducts) {\n setExternalState(updatedProducts);\n }\n\n if (updatedProducts && setSelectedProducts) {\n setSelectedProducts(updatedProducts);\n }\n }, [product.id, selectedProducts, setExternalState, setSelectedProducts]);\n\n useEffect(() => {\n if (!productTitleRef.current) return;\n\n setProductTitleWidth(\n productTitleRef.current.getBoundingClientRect().width,\n );\n }, [productTitleRef]);\n\n useEffect(() => {\n const scrollHandler = () => {\n const APPROXIMATE_TOOLTIP_HEIGHT = 45;\n if (productMetaRef.current)\n setToolTipIsPositionedTop(\n productMetaRef.current.getBoundingClientRect().top >\n HEADER_HEIGHT + APPROXIMATE_TOOLTIP_HEIGHT,\n );\n };\n\n document.addEventListener(\"scroll\", scrollHandler);\n\n return () => {\n document.removeEventListener(\"scroll\", scrollHandler);\n };\n }, []);\n\n return (\n <Reveal\n index={index}\n playAnimation={hasBeenObserved}\n backgroundColor={isMigrationTable ? \"transparent\" : theme.colors.white}\n >\n <div ref={ref}>\n <S.HeaderGridItem $hasTransparentBackground={isMigrationTable}>\n {!isLessThanOrEqualToFiveProducts &&\n hasMultipleProductsSelected &&\n !isStaticProduct && (\n <S.RemoveProductButton\n type=\"button\"\n $isSmallScreen={isSmallScreen}\n onClick={removeHandler}\n >\n <StyleableSvgImage src={closeIcon} width={16} height={16} />\n </S.RemoveProductButton>\n )}\n <S.ProductImageWrap height={product.image.height}>\n <S.ProductImage\n loading=\"lazy\"\n decoding=\"async\"\n src={imageSrc(product.image.src)}\n width={product.image.width}\n alt={formatMessage(product.title)}\n />\n </S.ProductImageWrap>\n <S.ProductMeta ref={productMetaRef}>\n {(linkToStoreTitleClick && storeHref) ||\n (!linkToStoreTitleClick && techspecsHref) ? (\n <>\n {/* Instantiates global styles for ProductHeader's tooltip */}\n <S.ProductHeaderTooltipStyles />\n <Tooltip\n key={`tooltip-${product.id}`}\n motif=\"light\"\n position={toolTipIsPositionedTop ? \"top\" : \"bottom\"}\n tooltipClassName={S.PRODUCT_HEADER_TOOLTIP_CLASSNAME}\n portal\n isInteractive\n description={\n <S.ProductHeaderTooltipLink\n href={productTitleHref}\n target=\"__blank\"\n >\n {formatMessage(\"modelCompare.reviewIn.tooltip\")} Tech\n Specs\n </S.ProductHeaderTooltipLink>\n }\n >\n <S.ProductHeaderTooltipHoverArea\n $width={productTitleWidth}\n $tooltipIsPositionedTop={toolTipIsPositionedTop}\n />\n <S.ProductTitleLink ref={productTitleRef}>\n {formatMessage(product.title)}\n </S.ProductTitleLink>\n </Tooltip>\n </>\n ) : (\n <S.ProductTitle $isMigrationTable={isMigrationTable}>\n {formatMessage(product.title)}\n </S.ProductTitle>\n )}\n {!!product?.productNote && (\n <S.ProductNote>\n {formatMessage(product.productNote)}\n </S.ProductNote>\n )}\n {product.description ? (\n <S.ProductDescription\n $maxWidth={product.descriptionMaxWidth}\n $direction={languageDirection}\n >\n {formatMessage(product.description)}\n </S.ProductDescription>\n ) : null}\n {showBadges && (\n <S.BadgeWrapper>{<Badges product={product} />}</S.BadgeWrapper>\n )}\n </S.ProductMeta>\n </S.HeaderGridItem>\n </div>\n </Reveal>\n );\n },\n);\n\nProductHeader.displayName = \"ProductHeader\";\n"],"names":["ProductHeader","forwardRef","product","setSelectedProducts","index","setExternalState","selectedProducts","linkToStoreTitleClick","hasBeenObserved","isLessThanOrEqualToFiveProducts","hasMultipleProductsSelected","isSmallScreen","showBadges","isStaticProduct","isMigrationTable","ref","formatMessage","useModelCompareTranslation","createSiteUrl","languageDirection","storeId","useMenu","productTitleWidth","setProductTitleWidth","useState","toolTipIsPositionedTop","setToolTipIsPositionedTop","productTitleRef","useRef","productMetaRef","storeHref","useMemo","getStoreHref","techspecsHref","techspecsPath","productTitleHref","removeHandler","useCallback","updatedProducts","filter","selectedProduct","productId","id","useEffect","current","getBoundingClientRect","width","scrollHandler","APPROXIMATE_TOOLTIP_HEIGHT","top","HEADER_HEIGHT","document","addEventListener","removeEventListener","jsx","Reveal","playAnimation","backgroundColor","theme","colors","white","children","jsxs","S.HeaderGridItem","$hasTransparentBackground","S.RemoveProductButton","RemoveProductButton","type","$isSmallScreen","onClick","StyleableSvgImage","src","closeIcon","height","S.ProductImageWrap","ProductImageWrap","image","S.ProductImage","ProductImage","loading","decoding","imageSrc","alt","title","S.ProductMeta","Fragment","S.ProductHeaderTooltipStyles","Tooltip","motif","position","tooltipClassName","S.PRODUCT_HEADER_TOOLTIP_CLASSNAME","PRODUCT_HEADER_TOOLTIP_CLASSNAME","portal","isInteractive","description","S.ProductHeaderTooltipLink","ProductHeaderTooltipLink","href","target","S.ProductHeaderTooltipHoverArea","ProductHeaderTooltipHoverArea","$width","$tooltipIsPositionedTop","S.ProductTitleLink","S.ProductTitle","ProductTitle","$isMigrationTable","productNote","S.ProductNote","ProductNote","S.ProductDescription","ProductDescription","$maxWidth","descriptionMaxWidth","$direction","S.BadgeWrapper","Badges","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAwBO,MAAMA,aAAgB,GAAAC,KAAA,CAAAA,UAAA,CAC3B,CACE;EACEC,OAAA;EACAC,mBAAA;EACAC,KAAA;EACAC,gBAAA;EACAC,gBAAA;EACAC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H,mBAAA;YACnBC,UAAY,EAAAhG,iBAAA;YAEX0C,QAAA,EAAA7C,aAAA,CAAcd,QAAQ6F,WAAW;UAAA,CAAA,CAElC,GAAA,IAAA,EACHnF,UAAA,kCACEwG,mBAAAA,CAAAA,YAAE,EAAF;YAAgBvD,QAAC,EAAAP,eAAAA,UAAAA,CAAAA,GAAA,CAAA+D,MAAA,CAAAA,MAAA,EAAA;cAAOnH;aAAkB;UAAG,CAAA,CAAA;QAElD,CAAA,CAAA;MAAA,CACF;IACF,CAAA;EAAA,CACF,CAAA;AAAA,CAGN,CAAA;AAEAF,aAAA,CAAcsH,WAAc,GAAA,eAAA;"}
|
|
1
|
+
{"version":3,"file":"ProductHeader.js","sources":["../../../../../../../src/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/ProductHeader/ProductHeader.tsx"],"sourcesContent":["import { Tooltip } from \"@ubnt/ui-components/Tooltip\";\nimport type { ForwardedRef } from \"react\";\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\nimport closeIcon from \"../../../../../../constants/modelCompareData/assets/close.svg\";\nimport { useModelCompareTranslation } from \"../../../../../../constants/modelCompareData/translations/useModelCompareTranslation\";\nimport { theme } from \"../../../../../../constants/theme\";\nimport { useMenu } from \"../../../../../../contexts/MenuContext/context\";\nimport { imageSrc } from \"../../../../../../utils/asset\";\nimport { HEADER_HEIGHT } from \"../../../../../Header/Header.styles\";\nimport { Reveal } from \"../../../../../Reveal/Reveal\";\nimport { StyleableSvgImage } from \"../../../../../StyleableSvgImage\";\nimport * as S from \"../../../CompareTable.styles\";\nimport { getStoreHref } from \"../../../helpers/getStoreHref\";\nimport { Badges } from \"../Badges/Badges\";\nimport type { ProductHeaderProps } from \"./ProductHeader.types\";\n\nexport const ProductHeader = forwardRef(\n (\n {\n product,\n setSelectedProducts,\n index,\n setExternalState,\n selectedProducts,\n linkToStoreTitleClick,\n hasBeenObserved,\n isLessThanOrEqualToFiveProducts,\n hasMultipleProductsSelected,\n isSmallScreen,\n showBadges,\n isStaticProduct,\n isMigrationTable,\n }: ProductHeaderProps,\n ref: ForwardedRef<HTMLDivElement>,\n ) => {\n const { formatMessage } = useModelCompareTranslation();\n const { createSiteUrl, languageDirection, storeId } = useMenu();\n const [productTitleWidth, setProductTitleWidth] = useState<\n number | undefined\n >(undefined);\n const [toolTipIsPositionedTop, setToolTipIsPositionedTop] = useState(true);\n\n const productTitleRef = useRef<HTMLButtonElement | null>(null);\n const productMetaRef = useRef<HTMLDivElement | null>(null);\n\n const storeHref = useMemo(\n () => getStoreHref({ product, createSiteUrl, storeId }),\n [product, createSiteUrl, storeId],\n );\n\n const techspecsHref = useMemo(\n () => product.techspecsPath && createSiteUrl(product.techspecsPath),\n [createSiteUrl, product.techspecsPath],\n );\n\n const productTitleHref = useMemo(\n () => (linkToStoreTitleClick ? storeHref : techspecsHref),\n [linkToStoreTitleClick, storeHref, techspecsHref],\n );\n\n const removeHandler = useCallback(() => {\n const updatedProducts =\n selectedProducts &&\n selectedProducts.filter(\n (selectedProduct) => selectedProduct.productId !== product.id,\n );\n\n if (setExternalState && updatedProducts) {\n setExternalState(updatedProducts);\n }\n\n if (updatedProducts && setSelectedProducts) {\n setSelectedProducts(updatedProducts);\n }\n }, [product.id, selectedProducts, setExternalState, setSelectedProducts]);\n\n useEffect(() => {\n if (!productTitleRef.current) return;\n\n setProductTitleWidth(\n productTitleRef.current.getBoundingClientRect().width,\n );\n }, [productTitleRef]);\n\n useEffect(() => {\n const scrollHandler = () => {\n const APPROXIMATE_TOOLTIP_HEIGHT = 45;\n if (productMetaRef.current)\n setToolTipIsPositionedTop(\n productMetaRef.current.getBoundingClientRect().top >\n HEADER_HEIGHT + APPROXIMATE_TOOLTIP_HEIGHT,\n );\n };\n\n document.addEventListener(\"scroll\", scrollHandler);\n\n return () => {\n document.removeEventListener(\"scroll\", scrollHandler);\n };\n }, []);\n\n const renderProductHeader = () => {\n return (\n <div ref={ref}>\n <S.HeaderGridItem $hasTransparentBackground={isMigrationTable}>\n {!isLessThanOrEqualToFiveProducts &&\n hasMultipleProductsSelected &&\n !isStaticProduct && (\n <S.RemoveProductButton\n type=\"button\"\n $isSmallScreen={isSmallScreen}\n onClick={removeHandler}\n >\n <StyleableSvgImage src={closeIcon} width={16} height={16} />\n </S.RemoveProductButton>\n )}\n <S.ProductImageWrap height={product.image.height}>\n <S.ProductImage\n loading=\"lazy\"\n decoding=\"async\"\n src={imageSrc(product.image.src)}\n width={product.image.width}\n alt={formatMessage(product.title)}\n />\n </S.ProductImageWrap>\n <S.ProductMeta ref={productMetaRef}>\n {(linkToStoreTitleClick && storeHref) ||\n (!linkToStoreTitleClick && techspecsHref) ? (\n <>\n {/* Instantiates global styles for ProductHeader's tooltip */}\n <S.ProductHeaderTooltipStyles />\n <Tooltip\n key={`tooltip-${product.id}`}\n motif=\"light\"\n position={toolTipIsPositionedTop ? \"top\" : \"bottom\"}\n tooltipClassName={S.PRODUCT_HEADER_TOOLTIP_CLASSNAME}\n portal\n isInteractive\n description={\n <S.ProductHeaderTooltipLink\n href={productTitleHref}\n target=\"__blank\"\n >\n {formatMessage(\"modelCompare.reviewIn.tooltip\")} Tech\n Specs\n </S.ProductHeaderTooltipLink>\n }\n >\n <S.ProductHeaderTooltipHoverArea\n $width={productTitleWidth}\n $tooltipIsPositionedTop={toolTipIsPositionedTop}\n />\n <S.ProductTitleLink ref={productTitleRef}>\n {formatMessage(product.title)}\n </S.ProductTitleLink>\n </Tooltip>\n </>\n ) : (\n <S.ProductTitle $isMigrationTable={isMigrationTable}>\n {formatMessage(product.title)}\n </S.ProductTitle>\n )}\n {!!product?.productNote && (\n <S.ProductNote>\n {formatMessage(product.productNote)}\n </S.ProductNote>\n )}\n {product.description ? (\n <S.ProductDescription\n $maxWidth={product.descriptionMaxWidth}\n $direction={languageDirection}\n >\n {formatMessage(product.description)}\n </S.ProductDescription>\n ) : null}\n {showBadges && (\n <S.BadgeWrapper>{<Badges product={product} />}</S.BadgeWrapper>\n )}\n </S.ProductMeta>\n </S.HeaderGridItem>\n </div>\n );\n };\n\n return isMigrationTable ? (\n renderProductHeader()\n ) : (\n <Reveal\n index={index}\n playAnimation={hasBeenObserved}\n backgroundColor={theme.colors.white}\n >\n {renderProductHeader()}\n </Reveal>\n );\n },\n);\n\nProductHeader.displayName = \"ProductHeader\";\n"],"names":["ProductHeader","forwardRef","product","setSelectedProducts","index","setExternalState","selectedProducts","linkToStoreTitleClick","hasBeenObserved","isLessThanOrEqualToFiveProducts","hasMultipleProductsSelected","isSmallScreen","showBadges","isStaticProduct","isMigrationTable","ref","formatMessage","useModelCompareTranslation","createSiteUrl","languageDirection","storeId","useMenu","productTitleWidth","setProductTitleWidth","useState","toolTipIsPositionedTop","setToolTipIsPositionedTop","productTitleRef","useRef","productMetaRef","storeHref","useMemo","getStoreHref","techspecsHref","techspecsPath","productTitleHref","removeHandler","useCallback","updatedProducts","filter","selectedProduct","productId","id","useEffect","current","getBoundingClientRect","width","scrollHandler","APPROXIMATE_TOOLTIP_HEIGHT","top","HEADER_HEIGHT","document","addEventListener","removeEventListener","renderProductHeader","jsx","children","jsxs","S.HeaderGridItem","$hasTransparentBackground","S.RemoveProductButton","RemoveProductButton","type","$isSmallScreen","onClick","StyleableSvgImage","src","closeIcon","height","S.ProductImageWrap","ProductImageWrap","image","S.ProductImage","ProductImage","loading","decoding","imageSrc","alt","title","S.ProductMeta","Fragment","S.ProductHeaderTooltipStyles","Tooltip","motif","position","tooltipClassName","S.PRODUCT_HEADER_TOOLTIP_CLASSNAME","PRODUCT_HEADER_TOOLTIP_CLASSNAME","portal","isInteractive","description","S.ProductHeaderTooltipLink","ProductHeaderTooltipLink","href","target","S.ProductHeaderTooltipHoverArea","ProductHeaderTooltipHoverArea","$width","$tooltipIsPositionedTop","S.ProductTitleLink","S.ProductTitle","ProductTitle","$isMigrationTable","productNote","S.ProductNote","ProductNote","S.ProductDescription","ProductDescription","$maxWidth","descriptionMaxWidth","$direction","S.BadgeWrapper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ACCC,WAAW1G,OAAQ,CAAA2G,mBAAA;YACnBC,UAAY,EAAA3F,iBAAA;YAEXqC,QAAA,EAAAxC,aAAA,CAAcd,QAAQwF,WAAW;UAAA,CAAA,CAElC,GAAA,IAAA,EACH9E,UAAA,kCACEmG,mBAAAA,CAAAA,YAAE,EAAF;YAAgBvD,QAAC,EAAAD,eAAAA,UAAAA,CAAAA,GAAA,CAAAyD,MAAA,CAAAA,MAAA,EAAA;cAAO9G;aAAkB;UAAG,CAAA,CAAA;QAElD,CAAA,CAAA;MAAA,CACF;IACF,CAAA,CAAA;EAEJ,CAAA;EAEO,OAAAY,gBAAA,GACLwC,qBAEA,kBAAAC,UAAA,CAAAA,GAAA,CAAC0D,MAAA,CAAAA,MAAA,EAAA;IACC7G,KAAA;IACA8G,aAAe,EAAA1G,eAAA;IACf2G,eAAA,EAAiBC,KAAAA,CAAAA,MAAMC,MAAO,CAAAC,KAAA;IAE7B9D,QAAoB,EAAAF,mBAAA,CAAA;EAAA,CACvB,CAAA;AAAA,CAGN,CAAA;AAEAtD,aAAA,CAAcuH,WAAc,GAAA,eAAA;"}
|
|
@@ -72,11 +72,8 @@ const ProductHeader = forwardRef(({
|
|
|
72
72
|
document.removeEventListener("scroll", scrollHandler);
|
|
73
73
|
};
|
|
74
74
|
}, []);
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
playAnimation: hasBeenObserved,
|
|
78
|
-
backgroundColor: isMigrationTable ? "transparent" : theme.colors.white,
|
|
79
|
-
children: /* @__PURE__ */jsx("div", {
|
|
75
|
+
const renderProductHeader = () => {
|
|
76
|
+
return /* @__PURE__ */jsx("div", {
|
|
80
77
|
ref,
|
|
81
78
|
children: /* @__PURE__ */jsxs(HeaderGridItem, {
|
|
82
79
|
$hasTransparentBackground: isMigrationTable,
|
|
@@ -136,7 +133,13 @@ const ProductHeader = forwardRef(({
|
|
|
136
133
|
})]
|
|
137
134
|
})]
|
|
138
135
|
})
|
|
139
|
-
})
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
return isMigrationTable ? renderProductHeader() : /* @__PURE__ */jsx(Reveal, {
|
|
139
|
+
index,
|
|
140
|
+
playAnimation: hasBeenObserved,
|
|
141
|
+
backgroundColor: theme.colors.white,
|
|
142
|
+
children: renderProductHeader()
|
|
140
143
|
});
|
|
141
144
|
});
|
|
142
145
|
ProductHeader.displayName = "ProductHeader";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductHeader.mjs","sources":["../../../../../../../src/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/ProductHeader/ProductHeader.tsx"],"sourcesContent":["import { Tooltip } from \"@ubnt/ui-components/Tooltip\";\nimport type { ForwardedRef } from \"react\";\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\nimport closeIcon from \"../../../../../../constants/modelCompareData/assets/close.svg\";\nimport { useModelCompareTranslation } from \"../../../../../../constants/modelCompareData/translations/useModelCompareTranslation\";\nimport { theme } from \"../../../../../../constants/theme\";\nimport { useMenu } from \"../../../../../../contexts/MenuContext/context\";\nimport { imageSrc } from \"../../../../../../utils/asset\";\nimport { HEADER_HEIGHT } from \"../../../../../Header/Header.styles\";\nimport { Reveal } from \"../../../../../Reveal/Reveal\";\nimport { StyleableSvgImage } from \"../../../../../StyleableSvgImage\";\nimport * as S from \"../../../CompareTable.styles\";\nimport { getStoreHref } from \"../../../helpers/getStoreHref\";\nimport { Badges } from \"../Badges/Badges\";\nimport type { ProductHeaderProps } from \"./ProductHeader.types\";\n\nexport const ProductHeader = forwardRef(\n (\n {\n product,\n setSelectedProducts,\n index,\n setExternalState,\n selectedProducts,\n linkToStoreTitleClick,\n hasBeenObserved,\n isLessThanOrEqualToFiveProducts,\n hasMultipleProductsSelected,\n isSmallScreen,\n showBadges,\n isStaticProduct,\n isMigrationTable,\n }: ProductHeaderProps,\n ref: ForwardedRef<HTMLDivElement>,\n ) => {\n const { formatMessage } = useModelCompareTranslation();\n const { createSiteUrl, languageDirection, storeId } = useMenu();\n const [productTitleWidth, setProductTitleWidth] = useState<\n number | undefined\n >(undefined);\n const [toolTipIsPositionedTop, setToolTipIsPositionedTop] = useState(true);\n\n const productTitleRef = useRef<HTMLButtonElement | null>(null);\n const productMetaRef = useRef<HTMLDivElement | null>(null);\n\n const storeHref = useMemo(\n () => getStoreHref({ product, createSiteUrl, storeId }),\n [product, createSiteUrl, storeId],\n );\n\n const techspecsHref = useMemo(\n () => product.techspecsPath && createSiteUrl(product.techspecsPath),\n [createSiteUrl, product.techspecsPath],\n );\n\n const productTitleHref = useMemo(\n () => (linkToStoreTitleClick ? storeHref : techspecsHref),\n [linkToStoreTitleClick, storeHref, techspecsHref],\n );\n\n const removeHandler = useCallback(() => {\n const updatedProducts =\n selectedProducts &&\n selectedProducts.filter(\n (selectedProduct) => selectedProduct.productId !== product.id,\n );\n\n if (setExternalState && updatedProducts) {\n setExternalState(updatedProducts);\n }\n\n if (updatedProducts && setSelectedProducts) {\n setSelectedProducts(updatedProducts);\n }\n }, [product.id, selectedProducts, setExternalState, setSelectedProducts]);\n\n useEffect(() => {\n if (!productTitleRef.current) return;\n\n setProductTitleWidth(\n productTitleRef.current.getBoundingClientRect().width,\n );\n }, [productTitleRef]);\n\n useEffect(() => {\n const scrollHandler = () => {\n const APPROXIMATE_TOOLTIP_HEIGHT = 45;\n if (productMetaRef.current)\n setToolTipIsPositionedTop(\n productMetaRef.current.getBoundingClientRect().top >\n HEADER_HEIGHT + APPROXIMATE_TOOLTIP_HEIGHT,\n );\n };\n\n document.addEventListener(\"scroll\", scrollHandler);\n\n return () => {\n document.removeEventListener(\"scroll\", scrollHandler);\n };\n }, []);\n\n return (\n <Reveal\n index={index}\n playAnimation={hasBeenObserved}\n backgroundColor={isMigrationTable ? \"transparent\" : theme.colors.white}\n >\n <div ref={ref}>\n <S.HeaderGridItem $hasTransparentBackground={isMigrationTable}>\n {!isLessThanOrEqualToFiveProducts &&\n hasMultipleProductsSelected &&\n !isStaticProduct && (\n <S.RemoveProductButton\n type=\"button\"\n $isSmallScreen={isSmallScreen}\n onClick={removeHandler}\n >\n <StyleableSvgImage src={closeIcon} width={16} height={16} />\n </S.RemoveProductButton>\n )}\n <S.ProductImageWrap height={product.image.height}>\n <S.ProductImage\n loading=\"lazy\"\n decoding=\"async\"\n src={imageSrc(product.image.src)}\n width={product.image.width}\n alt={formatMessage(product.title)}\n />\n </S.ProductImageWrap>\n <S.ProductMeta ref={productMetaRef}>\n {(linkToStoreTitleClick && storeHref) ||\n (!linkToStoreTitleClick && techspecsHref) ? (\n <>\n {/* Instantiates global styles for ProductHeader's tooltip */}\n <S.ProductHeaderTooltipStyles />\n <Tooltip\n key={`tooltip-${product.id}`}\n motif=\"light\"\n position={toolTipIsPositionedTop ? \"top\" : \"bottom\"}\n tooltipClassName={S.PRODUCT_HEADER_TOOLTIP_CLASSNAME}\n portal\n isInteractive\n description={\n <S.ProductHeaderTooltipLink\n href={productTitleHref}\n target=\"__blank\"\n >\n {formatMessage(\"modelCompare.reviewIn.tooltip\")} Tech\n Specs\n </S.ProductHeaderTooltipLink>\n }\n >\n <S.ProductHeaderTooltipHoverArea\n $width={productTitleWidth}\n $tooltipIsPositionedTop={toolTipIsPositionedTop}\n />\n <S.ProductTitleLink ref={productTitleRef}>\n {formatMessage(product.title)}\n </S.ProductTitleLink>\n </Tooltip>\n </>\n ) : (\n <S.ProductTitle $isMigrationTable={isMigrationTable}>\n {formatMessage(product.title)}\n </S.ProductTitle>\n )}\n {!!product?.productNote && (\n <S.ProductNote>\n {formatMessage(product.productNote)}\n </S.ProductNote>\n )}\n {product.description ? (\n <S.ProductDescription\n $maxWidth={product.descriptionMaxWidth}\n $direction={languageDirection}\n >\n {formatMessage(product.description)}\n </S.ProductDescription>\n ) : null}\n {showBadges && (\n <S.BadgeWrapper>{<Badges product={product} />}</S.BadgeWrapper>\n )}\n </S.ProductMeta>\n </S.HeaderGridItem>\n </div>\n </Reveal>\n );\n },\n);\n\nProductHeader.displayName = \"ProductHeader\";\n"],"names":["ProductHeader","forwardRef","product","setSelectedProducts","index","setExternalState","selectedProducts","linkToStoreTitleClick","hasBeenObserved","isLessThanOrEqualToFiveProducts","hasMultipleProductsSelected","isSmallScreen","showBadges","isStaticProduct","isMigrationTable","ref","formatMessage","useModelCompareTranslation","createSiteUrl","languageDirection","storeId","useMenu","productTitleWidth","setProductTitleWidth","useState","toolTipIsPositionedTop","setToolTipIsPositionedTop","productTitleRef","useRef","productMetaRef","storeHref","useMemo","getStoreHref","techspecsHref","techspecsPath","productTitleHref","removeHandler","useCallback","updatedProducts","filter","selectedProduct","productId","id","useEffect","current","getBoundingClientRect","width","scrollHandler","APPROXIMATE_TOOLTIP_HEIGHT","top","HEADER_HEIGHT","document","addEventListener","removeEventListener","jsx","Reveal","playAnimation","backgroundColor","theme","colors","white","children","jsxs","S.HeaderGridItem","$hasTransparentBackground","S.RemoveProductButton","type","$isSmallScreen","onClick","StyleableSvgImage","src","closeIcon","height","S.ProductImageWrap","image","S.ProductImage","loading","decoding","imageSrc","alt","title","S.ProductMeta","Fragment","S.ProductHeaderTooltipStyles","Tooltip","motif","position","tooltipClassName","S.PRODUCT_HEADER_TOOLTIP_CLASSNAME","portal","isInteractive","description","S.ProductHeaderTooltipLink","href","target","S.ProductHeaderTooltipHoverArea","$width","$tooltipIsPositionedTop","S.ProductTitleLink","S.ProductTitle","$isMigrationTable","productNote","S.ProductNote","S.ProductDescription","$maxWidth","descriptionMaxWidth","$direction","S.BadgeWrapper","Badges","displayName"],"mappings":";;;;;;;;;;;;;;;;;AAwBO,MAAMA,aAAgB,GAAAC,UAAA,CAC3B,CACE;EACEC,OAAA;EACAC,mBAAA;EACAC,KAAA;EACAC,gBAAA;EACAC,gBAAA;EACAC,qBAAA;EACAC,eAAA;EACAC,+BAAA;EACAC,2BAAA;EACAC,aAAA;EACAC,UAAA;EACAC,eAAA;EACAC;GAEFC,GACG,KAAA;EACG,MAAA;IAAEC;EAAc,CAAA,GAAIC,0B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C,QAAA,EAAA7C,aAAA,CAAcd,OAAQ,CAAA8E,KAAK;cAC9B,CAAA,CAAA;YAAA,CAAA,EAtBK,WAAW9E,QAAQwC,EAAE,EAAA,CAAA;UAwB9B,CAAA,CAAA,GAEC,eAAAY,GAAA,CAAA6C,YAAA,EAAA;YAAeC,mBAAmBtF,gBAChC;YAAA+C,QAAA,EAAA7C,aAAA,CAAcd,OAAQ,CAAA8E,KAAK;UAC9B,CAAA,CAAA,EAED,CAAC,CAAC9E,OAAA,EAASmG,WACV,IAAA,eAAA/C,GAAA,CAACgD,WAAE,EAAF;YACEzC,QAAA,EAAA7C,aAAA,CAAcd,OAAQ,CAAAmG,WAAW;WACpC,CAAA,EAEDnG,QAAQyF,WACP,GAAA,eAAArC,GAAA,CAACiD,kBAAE,EAAF;YACCC,WAAWtG,OAAQ,CAAAuG,mBAAA;YACnBC,UAAY,EAAAvF,iBAAA;YAEX0C,QAAA,EAAA7C,aAAA,CAAcd,QAAQyF,WAAW;UAAA,CAAA,CAElC,GAAA,IAAA,EACH/E,UAAA,uBACE+F,YAAE,EAAF;YAAgB9C,QAAC,EAAA,eAAAP,GAAA,CAAAsD,MAAA,EAAA;cAAO1G;aAAkB;UAAG,CAAA,CAAA;QAElD,CAAA,CAAA;MAAA,CACF;IACF,CAAA;EAAA,CACF,CAAA;AAAA,CAGN,CAAA;AAEAF,aAAA,CAAc6G,WAAc,GAAA,eAAA;"}
|
|
1
|
+
{"version":3,"file":"ProductHeader.mjs","sources":["../../../../../../../src/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/ProductHeader/ProductHeader.tsx"],"sourcesContent":["import { Tooltip } from \"@ubnt/ui-components/Tooltip\";\nimport type { ForwardedRef } from \"react\";\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\nimport closeIcon from \"../../../../../../constants/modelCompareData/assets/close.svg\";\nimport { useModelCompareTranslation } from \"../../../../../../constants/modelCompareData/translations/useModelCompareTranslation\";\nimport { theme } from \"../../../../../../constants/theme\";\nimport { useMenu } from \"../../../../../../contexts/MenuContext/context\";\nimport { imageSrc } from \"../../../../../../utils/asset\";\nimport { HEADER_HEIGHT } from \"../../../../../Header/Header.styles\";\nimport { Reveal } from \"../../../../../Reveal/Reveal\";\nimport { StyleableSvgImage } from \"../../../../../StyleableSvgImage\";\nimport * as S from \"../../../CompareTable.styles\";\nimport { getStoreHref } from \"../../../helpers/getStoreHref\";\nimport { Badges } from \"../Badges/Badges\";\nimport type { ProductHeaderProps } from \"./ProductHeader.types\";\n\nexport const ProductHeader = forwardRef(\n (\n {\n product,\n setSelectedProducts,\n index,\n setExternalState,\n selectedProducts,\n linkToStoreTitleClick,\n hasBeenObserved,\n isLessThanOrEqualToFiveProducts,\n hasMultipleProductsSelected,\n isSmallScreen,\n showBadges,\n isStaticProduct,\n isMigrationTable,\n }: ProductHeaderProps,\n ref: ForwardedRef<HTMLDivElement>,\n ) => {\n const { formatMessage } = useModelCompareTranslation();\n const { createSiteUrl, languageDirection, storeId } = useMenu();\n const [productTitleWidth, setProductTitleWidth] = useState<\n number | undefined\n >(undefined);\n const [toolTipIsPositionedTop, setToolTipIsPositionedTop] = useState(true);\n\n const productTitleRef = useRef<HTMLButtonElement | null>(null);\n const productMetaRef = useRef<HTMLDivElement | null>(null);\n\n const storeHref = useMemo(\n () => getStoreHref({ product, createSiteUrl, storeId }),\n [product, createSiteUrl, storeId],\n );\n\n const techspecsHref = useMemo(\n () => product.techspecsPath && createSiteUrl(product.techspecsPath),\n [createSiteUrl, product.techspecsPath],\n );\n\n const productTitleHref = useMemo(\n () => (linkToStoreTitleClick ? storeHref : techspecsHref),\n [linkToStoreTitleClick, storeHref, techspecsHref],\n );\n\n const removeHandler = useCallback(() => {\n const updatedProducts =\n selectedProducts &&\n selectedProducts.filter(\n (selectedProduct) => selectedProduct.productId !== product.id,\n );\n\n if (setExternalState && updatedProducts) {\n setExternalState(updatedProducts);\n }\n\n if (updatedProducts && setSelectedProducts) {\n setSelectedProducts(updatedProducts);\n }\n }, [product.id, selectedProducts, setExternalState, setSelectedProducts]);\n\n useEffect(() => {\n if (!productTitleRef.current) return;\n\n setProductTitleWidth(\n productTitleRef.current.getBoundingClientRect().width,\n );\n }, [productTitleRef]);\n\n useEffect(() => {\n const scrollHandler = () => {\n const APPROXIMATE_TOOLTIP_HEIGHT = 45;\n if (productMetaRef.current)\n setToolTipIsPositionedTop(\n productMetaRef.current.getBoundingClientRect().top >\n HEADER_HEIGHT + APPROXIMATE_TOOLTIP_HEIGHT,\n );\n };\n\n document.addEventListener(\"scroll\", scrollHandler);\n\n return () => {\n document.removeEventListener(\"scroll\", scrollHandler);\n };\n }, []);\n\n const renderProductHeader = () => {\n return (\n <div ref={ref}>\n <S.HeaderGridItem $hasTransparentBackground={isMigrationTable}>\n {!isLessThanOrEqualToFiveProducts &&\n hasMultipleProductsSelected &&\n !isStaticProduct && (\n <S.RemoveProductButton\n type=\"button\"\n $isSmallScreen={isSmallScreen}\n onClick={removeHandler}\n >\n <StyleableSvgImage src={closeIcon} width={16} height={16} />\n </S.RemoveProductButton>\n )}\n <S.ProductImageWrap height={product.image.height}>\n <S.ProductImage\n loading=\"lazy\"\n decoding=\"async\"\n src={imageSrc(product.image.src)}\n width={product.image.width}\n alt={formatMessage(product.title)}\n />\n </S.ProductImageWrap>\n <S.ProductMeta ref={productMetaRef}>\n {(linkToStoreTitleClick && storeHref) ||\n (!linkToStoreTitleClick && techspecsHref) ? (\n <>\n {/* Instantiates global styles for ProductHeader's tooltip */}\n <S.ProductHeaderTooltipStyles />\n <Tooltip\n key={`tooltip-${product.id}`}\n motif=\"light\"\n position={toolTipIsPositionedTop ? \"top\" : \"bottom\"}\n tooltipClassName={S.PRODUCT_HEADER_TOOLTIP_CLASSNAME}\n portal\n isInteractive\n description={\n <S.ProductHeaderTooltipLink\n href={productTitleHref}\n target=\"__blank\"\n >\n {formatMessage(\"modelCompare.reviewIn.tooltip\")} Tech\n Specs\n </S.ProductHeaderTooltipLink>\n }\n >\n <S.ProductHeaderTooltipHoverArea\n $width={productTitleWidth}\n $tooltipIsPositionedTop={toolTipIsPositionedTop}\n />\n <S.ProductTitleLink ref={productTitleRef}>\n {formatMessage(product.title)}\n </S.ProductTitleLink>\n </Tooltip>\n </>\n ) : (\n <S.ProductTitle $isMigrationTable={isMigrationTable}>\n {formatMessage(product.title)}\n </S.ProductTitle>\n )}\n {!!product?.productNote && (\n <S.ProductNote>\n {formatMessage(product.productNote)}\n </S.ProductNote>\n )}\n {product.description ? (\n <S.ProductDescription\n $maxWidth={product.descriptionMaxWidth}\n $direction={languageDirection}\n >\n {formatMessage(product.description)}\n </S.ProductDescription>\n ) : null}\n {showBadges && (\n <S.BadgeWrapper>{<Badges product={product} />}</S.BadgeWrapper>\n )}\n </S.ProductMeta>\n </S.HeaderGridItem>\n </div>\n );\n };\n\n return isMigrationTable ? (\n renderProductHeader()\n ) : (\n <Reveal\n index={index}\n playAnimation={hasBeenObserved}\n backgroundColor={theme.colors.white}\n >\n {renderProductHeader()}\n </Reveal>\n );\n },\n);\n\nProductHeader.displayName = \"ProductHeader\";\n"],"names":["ProductHeader","forwardRef","product","setSelectedProducts","index","setExternalState","selectedProducts","linkToStoreTitleClick","hasBeenObserved","isLessThanOrEqualToFiveProducts","hasMultipleProductsSelected","isSmallScreen","showBadges","isStaticProduct","isMigrationTable","ref","formatMessage","useModelCompareTranslation","createSiteUrl","languageDirection","storeId","useMenu","productTitleWidth","setProductTitleWidth","useState","toolTipIsPositionedTop","setToolTipIsPositionedTop","productTitleRef","useRef","productMetaRef","storeHref","useMemo","getStoreHref","techspecsHref","techspecsPath","productTitleHref","removeHandler","useCallback","updatedProducts","filter","selectedProduct","productId","id","useEffect","current","getBoundingClientRect","width","scrollHandler","APPROXIMATE_TOOLTIP_HEIGHT","top","HEADER_HEIGHT","document","addEventListener","removeEventListener","renderProductHeader","jsx","children","jsxs","S.HeaderGridItem","$hasTransparentBackground","S.RemoveProductButton","type","$isSmallScreen","onClick","StyleableSvgImage","src","closeIcon","height","S.ProductImageWrap","image","S.ProductImage","loading","decoding","imageSrc","alt","title","S.ProductMeta","Fragment","S.ProductHeaderTooltipStyles","Tooltip","motif","position","tooltipClassName","S.PRODUCT_HEADER_TOOLTIP_CLASSNAME","portal","isInteractive","description","S.ProductHeaderTooltipLink","href","target","S.ProductHeaderTooltipHoverArea","$width","$tooltipIsPositionedTop","S.ProductTitleLink","S.ProductTitle","$isMigrationTable","productNote","S.ProductNote","S.ProductDescription","$maxWidth","descriptionMaxWidth","$direction","S.BadgeWrapper","Badges","Reveal","playAnimation","backgroundColor","theme","colors","white","displayName"],"mappings":";;;;;;;;;;;;;;;;;AAwBO,MAAMA,aAAgB,GAAAC,UAAA,CAC3B,CACE;EACEC,OAAA;EACAC,mBAAA;EACAC,KAAA;EACAC,gBAAA;EACAC,gBAAA;EACAC,qBAAA;EACAC,eAAA;EACAC,+BAAA;EACAC,2BAAA;EACAC,aAAA;EACAC,UAAA;EACAC,eAAA;EACAC;GAEFC,GACG,KAAA;EACG,MAAA;IAAEC;EAAc,CAAA,GAAIC,0BAA2B,CAAA,CAAA;EACrD,MAAM;IAAEC,aAAA;IAAeC,iBAAmB;IAAAC;EAAA,IAAYC,OAAQ,CAAA,CAAA;EAC9D,MAAM,CAACC,iBAAA,EAAmBC,oBAAoB,CAAA,GAAIC,SAEhD,KAAS,CAAA,CAAA;EACX,MAAM,CAACC,sBAAA,EAAwBC,yBAAyB,CAAA,GAAIF,SAAS,IAAI,CAAA;EAEnE,MAAAG,eAAA,GAAkBC,OAAiC,IAAI,CAAA;EACvD,MAAAC,cAAA,GAAiBD,OAA8B,IAAI,CAAA;EAEzD,MAAME,SAAY,GAAAC,OAAA,CAChB,MAAMC,YAAa,CAAA;IAAE9B,OAAS;IAAAgB,aAAA;IAAeE;GAAS,CAAA,EACtD,CAAClB,OAAS,EAAAgB,aAAA,EAAeE,OAAO,CAClC,CAAA;EAEA,MAAMa,aAAgB,GAAAF,OAAA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;YAAgB9C,QAAC,EAAA,eAAAD,GAAA,CAAAgD,MAAA,EAAA;cAAOrG;aAAkB;UAAG,CAAA,CAAA;QAElD,CAAA,CAAA;MAAA,CACF;IACF,CAAA,CAAA;EAEJ,CAAA;EAEO,OAAAY,gBAAA,GACLwC,qBAEA,kBAAAC,GAAA,CAACiD,MAAA,EAAA;IACCpG,KAAA;IACAqG,aAAe,EAAAjG,eAAA;IACfkG,eAAA,EAAiBC,MAAMC,MAAO,CAAAC,KAAA;IAE7BrD,QAAoB,EAAAF,mBAAA,CAAA;EAAA,CACvB,CAAA;AAAA,CAGN,CAAA;AAEAtD,aAAA,CAAc8G,WAAc,GAAA,eAAA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StickyGridBody.js","sources":["../../../../../../../src/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/StickyGrid/StickyGridBody.tsx"],"sourcesContent":["import type { ForwardedRef, ReactNode } from \"react\";\nimport { forwardRef, useRef } from \"react\";\nimport styled from \"styled-components\";\n\nimport { mergeRefs } from \"../../../helpers/mergeRefs\";\nimport { useScrollGroupItem } from \"../ScrollGroup\";\nimport { useStickyGrid } from \"./context\";\n\nexport const StickyGridBody = forwardRef(\n (\n { children }: { children: ReactNode },\n forwardedRef: ForwardedRef<HTMLDivElement>,\n ) => {\n const { templateColumns, gap } = useStickyGrid();\n\n const contentRef = useRef<HTMLDivElement>(null);\n useScrollGroupItem({ refObject: contentRef });\n\n return (\n <StyledStickyContent\n ref={mergeRefs(forwardedRef, contentRef)}\n $templateColumns={templateColumns}\n $gap={gap}\n >\n {children}\n </StyledStickyContent>\n );\n },\n);\n\nconst StyledStickyContent = styled.div<{\n $templateColumns: string;\n $gap?: string;\n}>`\n display: grid;\n gap: ${({ $gap }) => $gap ?? 0};\n grid-template-columns: ${({ $templateColumns }) => $templateColumns};\n width: 100%;\n\n overflow: auto;\n overscroll-behavior-x: none;\n scrollbar-width: none;\n &::-webkit-scrollbar {\n display: none;\n }\n`;\n\nStickyGridBody.displayName = \"StickyGridBody\";\n"],"names":["StickyGridBody","forwardRef","children","forwardedRef","templateColumns","gap","useStickyGrid","contentRef","useRef","useScrollGroupItem","refObject","jsx","StyledStickyContent","ref","mergeRefs","$templateColumns","$gap","styled","div","displayName"],"mappings":";;;;;;;;;;;;;;;;AAQO,MAAMA,cAAiB,GAAAC,KAAA,CAAAA,UAAA,CAC5B,CACE;EAAEC;AAAS,CAAA,EACXC,YACG,KAAA;EACH,MAAM;IAAEC,eAAA;IAAiBC;EAAI,CAAA,GAAIC,qBAAc,CAAA,CAAA;EAEzC,MAAAC,UAAA,GAAaC,aAAuB,IAAI,CAAA;EAC3BC,qCAAA,CAAA;IAAEC,SAAW,EAAAH;GAAY,CAAA;EAG1C,sBAAAI,UAAA,CAAAA,GAAA,CAACC,mBAAA,EAAA;IACCC,GAAA,EAAKC,SAAAA,CAAAA,SAAU,CAAAX,YAAA,EAAcI,UAAU,CAAA;IACvCQ,gBAAkB,EAAAX,eAAA;IAClBY,IAAM,EAAAX,GAAA;IAELH;EAAA,CACH,CAAA;AAAA,CAGN,CAAA;AAEA,MAAMU,sBAAsBK,eAAO,CAAA,SAAA,CAAA,CAAAC,GAAA;AAAA;AAAA,SAK1B,CAAC;EAAEF;CAAK,KAAMA,QAAQ,CAAC;AAAA,2BACL,CAAC;EAAED;AAAiB,CAAA,KAAMA,gBAAgB;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;
|
|
1
|
+
{"version":3,"file":"StickyGridBody.js","sources":["../../../../../../../src/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/StickyGrid/StickyGridBody.tsx"],"sourcesContent":["import type { ForwardedRef, ReactNode } from \"react\";\nimport { forwardRef, useRef } from \"react\";\nimport styled from \"styled-components\";\n\nimport { mergeRefs } from \"../../../helpers/mergeRefs\";\nimport { useScrollGroupItem } from \"../ScrollGroup\";\nimport { useStickyGrid } from \"./context\";\n\nexport const StickyGridBody = forwardRef(\n (\n { children }: { children: ReactNode },\n forwardedRef: ForwardedRef<HTMLDivElement>,\n ) => {\n const { templateColumns, gap } = useStickyGrid();\n\n const contentRef = useRef<HTMLDivElement>(null);\n useScrollGroupItem({ refObject: contentRef });\n\n return (\n <StyledStickyContent\n ref={mergeRefs(forwardedRef, contentRef)}\n $templateColumns={templateColumns}\n $gap={gap}\n >\n {children}\n </StyledStickyContent>\n );\n },\n);\n\nconst StyledStickyContent = styled.div<{\n $templateColumns: string;\n $gap?: string;\n}>`\n display: grid;\n gap: ${({ $gap }) => $gap ?? 0};\n grid-template-columns: ${({ $templateColumns }) => $templateColumns};\n width: 100%;\n min-height: 100%;\n\n overflow: auto;\n overscroll-behavior-x: none;\n scrollbar-width: none;\n &::-webkit-scrollbar {\n display: none;\n }\n`;\n\nStickyGridBody.displayName = \"StickyGridBody\";\n"],"names":["StickyGridBody","forwardRef","children","forwardedRef","templateColumns","gap","useStickyGrid","contentRef","useRef","useScrollGroupItem","refObject","jsx","StyledStickyContent","ref","mergeRefs","$templateColumns","$gap","styled","div","displayName"],"mappings":";;;;;;;;;;;;;;;;AAQO,MAAMA,cAAiB,GAAAC,KAAA,CAAAA,UAAA,CAC5B,CACE;EAAEC;AAAS,CAAA,EACXC,YACG,KAAA;EACH,MAAM;IAAEC,eAAA;IAAiBC;EAAI,CAAA,GAAIC,qBAAc,CAAA,CAAA;EAEzC,MAAAC,UAAA,GAAaC,aAAuB,IAAI,CAAA;EAC3BC,qCAAA,CAAA;IAAEC,SAAW,EAAAH;GAAY,CAAA;EAG1C,sBAAAI,UAAA,CAAAA,GAAA,CAACC,mBAAA,EAAA;IACCC,GAAA,EAAKC,SAAAA,CAAAA,SAAU,CAAAX,YAAA,EAAcI,UAAU,CAAA;IACvCQ,gBAAkB,EAAAX,eAAA;IAClBY,IAAM,EAAAX,GAAA;IAELH;EAAA,CACH,CAAA;AAAA,CAGN,CAAA;AAEA,MAAMU,sBAAsBK,eAAO,CAAA,SAAA,CAAA,CAAAC,GAAA;AAAA;AAAA,SAK1B,CAAC;EAAEF;CAAK,KAAMA,QAAQ,CAAC;AAAA,2BACL,CAAC;EAAED;AAAiB,CAAA,KAAMA,gBAAgB;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAYrEf,cAAA,CAAemB,WAAc,GAAA,gBAAA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StickyGridBody.mjs","sources":["../../../../../../../src/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/StickyGrid/StickyGridBody.tsx"],"sourcesContent":["import type { ForwardedRef, ReactNode } from \"react\";\nimport { forwardRef, useRef } from \"react\";\nimport styled from \"styled-components\";\n\nimport { mergeRefs } from \"../../../helpers/mergeRefs\";\nimport { useScrollGroupItem } from \"../ScrollGroup\";\nimport { useStickyGrid } from \"./context\";\n\nexport const StickyGridBody = forwardRef(\n (\n { children }: { children: ReactNode },\n forwardedRef: ForwardedRef<HTMLDivElement>,\n ) => {\n const { templateColumns, gap } = useStickyGrid();\n\n const contentRef = useRef<HTMLDivElement>(null);\n useScrollGroupItem({ refObject: contentRef });\n\n return (\n <StyledStickyContent\n ref={mergeRefs(forwardedRef, contentRef)}\n $templateColumns={templateColumns}\n $gap={gap}\n >\n {children}\n </StyledStickyContent>\n );\n },\n);\n\nconst StyledStickyContent = styled.div<{\n $templateColumns: string;\n $gap?: string;\n}>`\n display: grid;\n gap: ${({ $gap }) => $gap ?? 0};\n grid-template-columns: ${({ $templateColumns }) => $templateColumns};\n width: 100%;\n\n overflow: auto;\n overscroll-behavior-x: none;\n scrollbar-width: none;\n &::-webkit-scrollbar {\n display: none;\n }\n`;\n\nStickyGridBody.displayName = \"StickyGridBody\";\n"],"names":["StickyGridBody","forwardRef","children","forwardedRef","templateColumns","gap","useStickyGrid","contentRef","useRef","useScrollGroupItem","refObject","jsx","StyledStickyContent","ref","mergeRefs","$templateColumns","$gap","styled","div","displayName"],"mappings":";;;;;;;;AAQO,MAAMA,cAAiB,GAAAC,UAAA,CAC5B,CACE;EAAEC;AAAS,CAAA,EACXC,YACG,KAAA;EACH,MAAM;IAAEC,eAAA;IAAiBC;EAAI,CAAA,GAAIC,aAAc,CAAA,CAAA;EAEzC,MAAAC,UAAA,GAAaC,OAAuB,IAAI,CAAA;EAC3BC,kBAAA,CAAA;IAAEC,SAAW,EAAAH;GAAY,CAAA;EAG1C,sBAAAI,GAAA,CAACC,mBAAA,EAAA;IACCC,GAAA,EAAKC,SAAU,CAAAX,YAAA,EAAcI,UAAU,CAAA;IACvCQ,gBAAkB,EAAAX,eAAA;IAClBY,IAAM,EAAAX,GAAA;IAELH;EAAA,CACH,CAAA;AAAA,CAGN,CAAA;AAEA,MAAMU,sBAAsBK,MAAO,CAAAC,GAAA;AAAA;AAAA,SAK1B,CAAC;EAAEF;CAAK,KAAMA,QAAQ,CAAC;AAAA,2BACL,CAAC;EAAED;AAAiB,CAAA,KAAMA,gBAAgB;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;
|
|
1
|
+
{"version":3,"file":"StickyGridBody.mjs","sources":["../../../../../../../src/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/StickyGrid/StickyGridBody.tsx"],"sourcesContent":["import type { ForwardedRef, ReactNode } from \"react\";\nimport { forwardRef, useRef } from \"react\";\nimport styled from \"styled-components\";\n\nimport { mergeRefs } from \"../../../helpers/mergeRefs\";\nimport { useScrollGroupItem } from \"../ScrollGroup\";\nimport { useStickyGrid } from \"./context\";\n\nexport const StickyGridBody = forwardRef(\n (\n { children }: { children: ReactNode },\n forwardedRef: ForwardedRef<HTMLDivElement>,\n ) => {\n const { templateColumns, gap } = useStickyGrid();\n\n const contentRef = useRef<HTMLDivElement>(null);\n useScrollGroupItem({ refObject: contentRef });\n\n return (\n <StyledStickyContent\n ref={mergeRefs(forwardedRef, contentRef)}\n $templateColumns={templateColumns}\n $gap={gap}\n >\n {children}\n </StyledStickyContent>\n );\n },\n);\n\nconst StyledStickyContent = styled.div<{\n $templateColumns: string;\n $gap?: string;\n}>`\n display: grid;\n gap: ${({ $gap }) => $gap ?? 0};\n grid-template-columns: ${({ $templateColumns }) => $templateColumns};\n width: 100%;\n min-height: 100%;\n\n overflow: auto;\n overscroll-behavior-x: none;\n scrollbar-width: none;\n &::-webkit-scrollbar {\n display: none;\n }\n`;\n\nStickyGridBody.displayName = \"StickyGridBody\";\n"],"names":["StickyGridBody","forwardRef","children","forwardedRef","templateColumns","gap","useStickyGrid","contentRef","useRef","useScrollGroupItem","refObject","jsx","StyledStickyContent","ref","mergeRefs","$templateColumns","$gap","styled","div","displayName"],"mappings":";;;;;;;;AAQO,MAAMA,cAAiB,GAAAC,UAAA,CAC5B,CACE;EAAEC;AAAS,CAAA,EACXC,YACG,KAAA;EACH,MAAM;IAAEC,eAAA;IAAiBC;EAAI,CAAA,GAAIC,aAAc,CAAA,CAAA;EAEzC,MAAAC,UAAA,GAAaC,OAAuB,IAAI,CAAA;EAC3BC,kBAAA,CAAA;IAAEC,SAAW,EAAAH;GAAY,CAAA;EAG1C,sBAAAI,GAAA,CAACC,mBAAA,EAAA;IACCC,GAAA,EAAKC,SAAU,CAAAX,YAAA,EAAcI,UAAU,CAAA;IACvCQ,gBAAkB,EAAAX,eAAA;IAClBY,IAAM,EAAAX,GAAA;IAELH;EAAA,CACH,CAAA;AAAA,CAGN,CAAA;AAEA,MAAMU,sBAAsBK,MAAO,CAAAC,GAAA;AAAA;AAAA,SAK1B,CAAC;EAAEF;CAAK,KAAMA,QAAQ,CAAC;AAAA,2BACL,CAAC;EAAED;AAAiB,CAAA,KAAMA,gBAAgB;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAYrEf,cAAA,CAAemB,WAAc,GAAA,gBAAA;"}
|
|
@@ -13,7 +13,7 @@ var ComputeResourceCalculator_types = require('./ComputeResourceCalculator.types
|
|
|
13
13
|
var udmProMax = require("../../../assets/udm-pro-max.png");
|
|
14
14
|
var udmPro = require("../../../assets/udm-pro.png");
|
|
15
15
|
var ucgMax = require("../../../assets/ucg-max.png");
|
|
16
|
-
var envr = require("../../../assets/
|
|
16
|
+
var envr = require("../../../assets/envr.png");
|
|
17
17
|
var unvrPro = require("../../../assets/unvr-pro.png");
|
|
18
18
|
var unvr = require("../../../assets/unvr.png");
|
|
19
19
|
var ckg2 = require("../../../assets/unifi-cloudkey-plus.png");
|
|
@@ -11,7 +11,7 @@ import { FeatureId, DeviceId } from './ComputeResourceCalculator.types.mjs';
|
|
|
11
11
|
import udmProMax__default from "../../../assets/udm-pro-max.png";
|
|
12
12
|
import udmPro__default from "../../../assets/udm-pro.png";
|
|
13
13
|
import ucgMax__default from "../../../assets/ucg-max.png";
|
|
14
|
-
import envr__default from "../../../assets/
|
|
14
|
+
import envr__default from "../../../assets/envr.png";
|
|
15
15
|
import unvrPro__default from "../../../assets/unvr-pro.png";
|
|
16
16
|
import unvr__default from "../../../assets/unvr.png";
|
|
17
17
|
import ckg2__default from "../../../assets/unifi-cloudkey-plus.png";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "../../../../assets/
|
|
2
|
-
export { default } from "../../../../assets/
|
|
1
|
+
export * from "../../../../assets/envr.png";
|
|
2
|
+
export { default } from "../../../../assets/envr.png";
|
|
3
3
|
//# sourceMappingURL=envr.png.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "../../../assets/
|
|
2
|
-
export { default } from "../../../assets/
|
|
1
|
+
export * from "../../../assets/globe.svg";
|
|
2
|
+
export { default } from "../../../assets/globe.svg";
|
|
3
3
|
//# sourceMappingURL=globe.svg.mjs.map
|
|
@@ -7,7 +7,7 @@ require('./logoUnifi.svg.js');
|
|
|
7
7
|
require('./logoUisp.svg.js');
|
|
8
8
|
require('./arrow.svg.js');
|
|
9
9
|
var accountLogo = require("../../../assets/account.svg");
|
|
10
|
-
var globe = require("../../../assets/
|
|
10
|
+
var globe = require("../../../assets/globe.svg");
|
|
11
11
|
var _externalAssets_BPYvPCPi = require("../../../assets/logo.svg");
|
|
12
12
|
var logoUnifi = require("../../../assets/logoUnifi.svg");
|
|
13
13
|
var _externalAssets_TKrekyEi = require("../../../assets/logoUisp.svg");
|
|
@@ -5,7 +5,7 @@ import './logoUnifi.svg.mjs';
|
|
|
5
5
|
import './logoUisp.svg.mjs';
|
|
6
6
|
import './arrow.svg.mjs';
|
|
7
7
|
export { default as account } from "../../../assets/account.svg";
|
|
8
|
-
export { default as globe } from "../../../assets/
|
|
8
|
+
export { default as globe } from "../../../assets/globe.svg";
|
|
9
9
|
export { default as logo } from "../../../assets/logo.svg";
|
|
10
10
|
export { default as logoUnifi } from "../../../assets/logoUnifi.svg";
|
|
11
11
|
export { default as logoUisp } from "../../../assets/logoUisp.svg";
|
|
@@ -3,24 +3,24 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var
|
|
6
|
+
var _externalAssets_D9OBvcup = require("../../../assets/floodlight.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_D9OBvcup__default = /*#__PURE__*/_interopDefault(_externalAssets_D9OBvcup);
|
|
13
13
|
Object.defineProperty(exports, "default", {
|
|
14
14
|
enumerable: true,
|
|
15
15
|
get: function () {
|
|
16
|
-
return
|
|
16
|
+
return _externalAssets_D9OBvcup__default["default"];
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
-
Object.keys(
|
|
19
|
+
Object.keys(_externalAssets_D9OBvcup).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_D9OBvcup[k];
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "../../../assets/
|
|
2
|
-
export { default } from "../../../assets/
|
|
1
|
+
export * from "../../../assets/floodlight.svg";
|
|
2
|
+
export { default } from "../../../assets/floodlight.svg";
|
|
3
3
|
//# sourceMappingURL=floodlight.svg.mjs.map
|