@ubnt/store.core 11.9.2 → 11.9.3-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +941 -21
- package/lib/assets/ai-360.jpg +0 -0
- package/lib/assets/ai-3602.jpg +0 -0
- package/lib/assets/ai-pro.png +0 -0
- package/lib/assets/ai-theta.jpg +0 -0
- package/lib/assets/ai-theta2.jpg +0 -0
- package/lib/assets/ai-turret.jpg +0 -0
- package/lib/assets/ai-turret2.jpg +0 -0
- package/lib/assets/compact.svg +2 -2
- package/lib/assets/compact2.svg +2 -2
- package/lib/assets/dS2CD2086G2IU.png +0 -0
- package/lib/assets/dS2CD2683G2IZS.png +0 -0
- package/lib/assets/door-hub.jpg +0 -0
- package/lib/assets/door-hub2.jpg +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/g2-reader.jpg +0 -0
- package/lib/assets/g2-reader2.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/g5-bullet.jpg +0 -0
- package/lib/assets/g5-bullet2.jpg +0 -0
- package/lib/assets/g5-ptz.jpg +0 -0
- package/lib/assets/g5-ptz2.jpg +0 -0
- package/lib/assets/g6-bullet.png +0 -0
- package/lib/assets/intercom.jpg +0 -0
- package/lib/assets/intercom2.jpg +0 -0
- package/lib/assets/ucgUltra.jpg +0 -0
- package/lib/assets/ucgUltra2.jpg +0 -0
- package/lib/assets/udmPro.jpg +0 -0
- package/lib/assets/udmPro2.jpg +0 -0
- package/lib/assets/udmProMax.jpg +0 -0
- package/lib/assets/udmProMax2.jpg +0 -0
- package/lib/assets/udmProSpecial.jpg +0 -0
- package/lib/assets/udmProSpecial2.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/AccountFrame/AccountFrame.js +0 -1
- package/lib/components/Header/AccountFrame/AccountFrame.js.map +1 -1
- package/lib/components/Header/AccountFrame/AccountFrame.mjs +0 -1
- package/lib/components/Header/AccountFrame/AccountFrame.mjs.map +1 -1
- package/lib/components/Header/AccountFrame/AccountFrame.styles.d.ts +4 -8
- package/lib/components/Header/AccountFrame/AccountFrame.styles.js +7 -2
- package/lib/components/Header/AccountFrame/AccountFrame.styles.js.map +1 -1
- package/lib/components/Header/AccountFrame/AccountFrame.styles.mjs +7 -2
- package/lib/components/Header/AccountFrame/AccountFrame.styles.mjs.map +1 -1
- package/lib/components/Header/Header.stories.d.ts +2 -2
- package/lib/components/Header/Header.types.d.ts +2 -2
- package/lib/components/Header/Header.types.js.map +1 -1
- package/lib/components/Header/Header.types.mjs.map +1 -1
- package/lib/components/Header/LanguageFrame/LanguageFrame.js +19 -8
- package/lib/components/Header/LanguageFrame/LanguageFrame.js.map +1 -1
- package/lib/components/Header/LanguageFrame/LanguageFrame.mjs +20 -9
- package/lib/components/Header/LanguageFrame/LanguageFrame.mjs.map +1 -1
- package/lib/components/Header/LanguageFrame/LanguageFrame.styles.d.ts +1 -0
- package/lib/components/Header/LanguageFrame/LanguageFrame.styles.js +8 -1
- package/lib/components/Header/LanguageFrame/LanguageFrame.styles.js.map +1 -1
- package/lib/components/Header/LanguageFrame/LanguageFrame.styles.mjs +8 -2
- package/lib/components/Header/LanguageFrame/LanguageFrame.styles.mjs.map +1 -1
- package/lib/components/Header/LanguageFrame/LanguageFrame.types.d.ts +1 -1
- package/lib/components/Header/MenuItem/MenuItem.js +8 -0
- package/lib/components/Header/MenuItem/MenuItem.js.map +1 -1
- package/lib/components/Header/MenuItem/MenuItem.mjs +8 -0
- package/lib/components/Header/MenuItem/MenuItem.mjs.map +1 -1
- package/lib/components/Header/MenuItem/MenuItem.types.d.ts +1 -1
- package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.styles.js +1 -0
- package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.styles.js.map +1 -1
- package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.styles.mjs +1 -0
- package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.styles.mjs.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.d.ts +1 -1
- package/lib/components/MicrositeHeader/MicrositeHeader.types.d.ts +4 -2
- package/lib/components/MicrositeHeader/components/DropdownMenu/DropdownMenu.js +28 -0
- package/lib/components/MicrositeHeader/components/DropdownMenu/DropdownMenu.js.map +1 -1
- package/lib/components/MicrositeHeader/components/DropdownMenu/DropdownMenu.mjs +28 -0
- package/lib/components/MicrositeHeader/components/DropdownMenu/DropdownMenu.mjs.map +1 -1
- package/lib/components/MicrositeHeader/components/DropdownMenu/DropdownMenu.styles.js +13 -2
- package/lib/components/MicrositeHeader/components/DropdownMenu/DropdownMenu.styles.js.map +1 -1
- package/lib/components/MicrositeHeader/components/DropdownMenu/DropdownMenu.styles.mjs +13 -2
- package/lib/components/MicrositeHeader/components/DropdownMenu/DropdownMenu.styles.mjs.map +1 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.js +25 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.js.map +1 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.mjs +26 -2
- package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.mjs.map +1 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.styles.js +20 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.styles.js.map +1 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.styles.mjs +20 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.styles.mjs.map +1 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/_components/NavigationItem/NavigationItem.d.ts +3 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/_components/NavigationItem/NavigationItem.js +16 -0
- package/lib/components/MicrositeHeader/components/HeaderContent/_components/NavigationItem/NavigationItem.js.map +1 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/_components/NavigationItem/NavigationItem.mjs +16 -0
- package/lib/components/MicrositeHeader/components/HeaderContent/_components/NavigationItem/NavigationItem.mjs.map +1 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/_components/SubNavigation/SubNavigation.d.ts +1 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/_components/SubNavigation/SubNavigation.js +12 -0
- package/lib/components/MicrositeHeader/components/HeaderContent/_components/SubNavigation/SubNavigation.js.map +1 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/_components/SubNavigation/SubNavigation.mjs +12 -0
- package/lib/components/MicrositeHeader/components/HeaderContent/_components/SubNavigation/SubNavigation.mjs.map +1 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/_components/SubNavigation/SubNavigation.styles.js +3 -0
- package/lib/components/MicrositeHeader/components/HeaderContent/_components/SubNavigation/SubNavigation.styles.js.map +1 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/_components/SubNavigation/SubNavigation.styles.mjs +3 -0
- package/lib/components/MicrositeHeader/components/HeaderContent/_components/SubNavigation/SubNavigation.styles.mjs.map +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTable.d.ts +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTable.js +4 -2
- package/lib/components/ModelCompareV4/CompareTable/CompareTable.js.map +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTable.mjs +4 -2
- package/lib/components/ModelCompareV4/CompareTable/CompareTable.mjs.map +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTable.styles.d.ts +30 -3
- package/lib/components/ModelCompareV4/CompareTable/CompareTable.styles.js +58 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTable.styles.js.map +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTable.styles.mjs +57 -2
- package/lib/components/ModelCompareV4/CompareTable/CompareTable.styles.mjs.map +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTable.types.d.ts +1 -0
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/CompareTableMarkup.d.ts +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/CompareTableMarkup.js +102 -26
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/CompareTableMarkup.js.map +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/CompareTableMarkup.mjs +105 -29
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/CompareTableMarkup.mjs.map +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/CompareTableMarkup.types.d.ts +1 -0
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/ProductHeader/ProductHeader.d.ts +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/ProductHeader/ProductHeader.js +65 -57
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/ProductHeader/ProductHeader.js.map +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/ProductHeader/ProductHeader.mjs +66 -58
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/ProductHeader/ProductHeader.mjs.map +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/ProductHeader/ProductHeader.types.d.ts +1 -0
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/PropertyValueGridItem.js +3 -0
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/PropertyValueGridItem.js.map +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/PropertyValueGridItem.mjs +3 -0
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/PropertyValueGridItem.mjs.map +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/StickyGrid/StickyGridBody.d.ts +2 -2
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/StickyGrid/StickyGridBody.js +6 -4
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/StickyGrid/StickyGridBody.js.map +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/StickyGrid/StickyGridBody.mjs +7 -5
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/StickyGrid/StickyGridBody.mjs.map +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/StickyGrid/StickyGridHeader.d.ts +2 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/StickyGrid/StickyGridHeader.js +6 -2
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/StickyGrid/StickyGridHeader.js.map +1 -1
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/StickyGrid/StickyGridHeader.mjs +6 -2
- package/lib/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/StickyGrid/StickyGridHeader.mjs.map +1 -1
- package/lib/components/ModelCompareV4/CompareTable/helpers/mergeRefs.d.ts +2 -0
- package/lib/components/ModelCompareV4/CompareTable/helpers/mergeRefs.js +16 -0
- package/lib/components/ModelCompareV4/CompareTable/helpers/mergeRefs.js.map +1 -0
- package/lib/components/ModelCompareV4/CompareTable/helpers/mergeRefs.mjs +15 -0
- package/lib/components/ModelCompareV4/CompareTable/helpers/mergeRefs.mjs.map +1 -0
- package/lib/components/ModelCompareV4/CompareTable/helpers/useTrackColumnPositions.d.ts +6 -0
- package/lib/components/ModelCompareV4/CompareTable/helpers/useTrackColumnPositions.js +38 -0
- package/lib/components/ModelCompareV4/CompareTable/helpers/useTrackColumnPositions.js.map +1 -0
- package/lib/components/ModelCompareV4/CompareTable/helpers/useTrackColumnPositions.mjs +36 -0
- package/lib/components/ModelCompareV4/CompareTable/helpers/useTrackColumnPositions.mjs.map +1 -0
- package/lib/components/ModelCompareV4/ModelCompareV4.js +3 -2
- package/lib/components/ModelCompareV4/ModelCompareV4.js.map +1 -1
- package/lib/components/ModelCompareV4/ModelCompareV4.mjs +3 -2
- package/lib/components/ModelCompareV4/ModelCompareV4.mjs.map +1 -1
- package/lib/constants/modelCompareData/assets/Assets-V4/Hikvision/dS2CD2086G2IU.png.js +27 -0
- package/lib/constants/modelCompareData/assets/Assets-V4/Hikvision/dS2CD2086G2IU.png.js.map +1 -0
- package/lib/constants/modelCompareData/assets/Assets-V4/Hikvision/dS2CD2086G2IU.png.mjs +3 -0
- package/lib/constants/modelCompareData/assets/Assets-V4/Hikvision/dS2CD2086G2IU.png.mjs.map +1 -0
- package/lib/constants/modelCompareData/assets/Assets-V4/Hikvision/dS2CD2683G2IZS.png.js +27 -0
- package/lib/constants/modelCompareData/assets/Assets-V4/Hikvision/dS2CD2683G2IZS.png.js.map +1 -0
- package/lib/constants/modelCompareData/assets/Assets-V4/Hikvision/dS2CD2683G2IZS.png.mjs +3 -0
- package/lib/constants/modelCompareData/assets/Assets-V4/Hikvision/dS2CD2683G2IZS.png.mjs.map +1 -0
- package/lib/constants/modelCompareData/assets/Assets-V4/PhysicalSecurity/ai-pro.png.js +27 -0
- package/lib/constants/modelCompareData/assets/Assets-V4/PhysicalSecurity/ai-pro.png.js.map +1 -0
- package/lib/constants/modelCompareData/assets/Assets-V4/PhysicalSecurity/ai-pro.png.mjs +3 -0
- package/lib/constants/modelCompareData/assets/Assets-V4/PhysicalSecurity/ai-pro.png.mjs.map +1 -0
- package/lib/constants/modelCompareData/assets/Assets-V4/PhysicalSecurity/g6-bullet.png.js +27 -0
- package/lib/constants/modelCompareData/assets/Assets-V4/PhysicalSecurity/g6-bullet.png.js.map +1 -0
- package/lib/constants/modelCompareData/assets/Assets-V4/PhysicalSecurity/g6-bullet.png.mjs +3 -0
- package/lib/constants/modelCompareData/assets/Assets-V4/PhysicalSecurity/g6-bullet.png.mjs.map +1 -0
- 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/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/ucgUltra.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/ucgUltra.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/udmPro.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/udmPro.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/udmProMax.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/udmProMax.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/udmProSpecial.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/Consoles/bigCompare/udmProSpecial.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/ucgUltra.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Consoles/ucgUltra.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/udmPro.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Consoles/udmPro.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/udmProMax.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Consoles/udmProMax.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Consoles/udmProSpecial.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Consoles/udmProSpecial.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-360.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DomeTurret/ai-360.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/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-starter-kit.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-starter-kit.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/intercom.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/intercom.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/g5-ptz.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/PTZ/g5-ptz.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/compact.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/compact.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-360.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/dome-and-turret/ai-360.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/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-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/door-access/intercom.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/intercom.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/g5-ptz.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/ptz/g5-ptz.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/compact.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/compact.svg.mjs +2 -2
- package/lib/constants/modelCompareData/data/CloudGateways.js +18 -18
- package/lib/constants/modelCompareData/data/CloudGateways.mjs +12 -12
- package/lib/constants/modelCompareData/data/DreamMachineConsolev4.js +18 -18
- package/lib/constants/modelCompareData/data/DreamMachineConsolev4.mjs +12 -12
- package/lib/constants/modelCompareData/data/index.d.ts +1 -0
- package/lib/constants/modelCompareData/data/index.js +2 -0
- package/lib/constants/modelCompareData/data/index.js.map +1 -1
- package/lib/constants/modelCompareData/data/index.mjs +1 -0
- package/lib/constants/modelCompareData/data/index.mjs.map +1 -1
- package/lib/constants/modelCompareData/data/migration-tables/HikvisionBullet.d.ts +2 -0
- package/lib/constants/modelCompareData/data/migration-tables/HikvisionBullet.js +17 -0
- package/lib/constants/modelCompareData/data/migration-tables/HikvisionBullet.js.map +1 -0
- package/lib/constants/modelCompareData/data/migration-tables/HikvisionBullet.mjs +15 -0
- package/lib/constants/modelCompareData/data/migration-tables/HikvisionBullet.mjs.map +1 -0
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Compact.js +1 -1
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Compact.mjs +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/compact.js +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/compact.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/ai360.js +2 -2
- package/lib/constants/modelCompareData/data/products/ai360.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/aiProSpotlight.d.ts +2 -0
- package/lib/constants/modelCompareData/data/products/aiProSpotlight.js +23 -0
- package/lib/constants/modelCompareData/data/products/aiProSpotlight.js.map +1 -0
- package/lib/constants/modelCompareData/data/products/aiProSpotlight.mjs +15 -0
- package/lib/constants/modelCompareData/data/products/aiProSpotlight.mjs.map +1 -0
- 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/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/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/g5Bullet.js +2 -2
- package/lib/constants/modelCompareData/data/products/g5Bullet.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g5Ptz.js +2 -2
- package/lib/constants/modelCompareData/data/products/g5Ptz.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g6BulletSpotlight.d.ts +2 -0
- package/lib/constants/modelCompareData/data/products/g6BulletSpotlight.js +23 -0
- package/lib/constants/modelCompareData/data/products/g6BulletSpotlight.js.map +1 -0
- package/lib/constants/modelCompareData/data/products/g6BulletSpotlight.mjs +15 -0
- package/lib/constants/modelCompareData/data/products/g6BulletSpotlight.mjs.map +1 -0
- package/lib/constants/modelCompareData/data/products/hikvision/dS2CD2086G2IU.d.ts +2 -0
- package/lib/constants/modelCompareData/data/products/hikvision/dS2CD2086G2IU.js +119 -0
- package/lib/constants/modelCompareData/data/products/hikvision/dS2CD2086G2IU.js.map +1 -0
- package/lib/constants/modelCompareData/data/products/hikvision/dS2CD2086G2IU.mjs +111 -0
- package/lib/constants/modelCompareData/data/products/hikvision/dS2CD2086G2IU.mjs.map +1 -0
- package/lib/constants/modelCompareData/data/products/hikvision/dS2CD2683G2IZS.d.ts +2 -0
- package/lib/constants/modelCompareData/data/products/hikvision/dS2CD2683G2IZS.js +119 -0
- package/lib/constants/modelCompareData/data/products/hikvision/dS2CD2683G2IZS.js.map +1 -0
- package/lib/constants/modelCompareData/data/products/hikvision/dS2CD2683G2IZS.mjs +111 -0
- package/lib/constants/modelCompareData/data/products/hikvision/dS2CD2683G2IZS.mjs.map +1 -0
- package/lib/constants/modelCompareData/data/products/intercom.js +2 -2
- package/lib/constants/modelCompareData/data/products/intercom.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/ucCastLite.js.map +1 -1
- package/lib/constants/modelCompareData/data/products/ucCastLite.mjs.map +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/udmPro.js +1 -1
- package/lib/constants/modelCompareData/data/products/udmPro.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/udmProMax.js +1 -1
- package/lib/constants/modelCompareData/data/products/udmProMax.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/udmProSpecial.js +1 -1
- package/lib/constants/modelCompareData/data/products/udmProSpecial.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/translations/ar.json.js +0 -2
- package/lib/constants/modelCompareData/translations/ar.json.js.map +1 -1
- package/lib/constants/modelCompareData/translations/ar.json.mjs +0 -2
- package/lib/constants/modelCompareData/translations/ar.json.mjs.map +1 -1
- package/lib/constants/modelCompareData/translations/de.json.js +0 -2
- package/lib/constants/modelCompareData/translations/de.json.js.map +1 -1
- package/lib/constants/modelCompareData/translations/de.json.mjs +0 -2
- package/lib/constants/modelCompareData/translations/de.json.mjs.map +1 -1
- package/lib/constants/modelCompareData/translations/el.json.js +0 -2
- package/lib/constants/modelCompareData/translations/el.json.js.map +1 -1
- package/lib/constants/modelCompareData/translations/el.json.mjs +0 -2
- package/lib/constants/modelCompareData/translations/el.json.mjs.map +1 -1
- package/lib/constants/modelCompareData/translations/en.json.js +10 -2
- package/lib/constants/modelCompareData/translations/en.json.js.map +1 -1
- package/lib/constants/modelCompareData/translations/en.json.mjs +10 -2
- package/lib/constants/modelCompareData/translations/en.json.mjs.map +1 -1
- package/lib/constants/modelCompareData/translations/es.json.js +0 -2
- package/lib/constants/modelCompareData/translations/es.json.js.map +1 -1
- package/lib/constants/modelCompareData/translations/es.json.mjs +0 -2
- package/lib/constants/modelCompareData/translations/es.json.mjs.map +1 -1
- package/lib/constants/modelCompareData/translations/fr.json.js +0 -2
- package/lib/constants/modelCompareData/translations/fr.json.js.map +1 -1
- package/lib/constants/modelCompareData/translations/fr.json.mjs +0 -2
- package/lib/constants/modelCompareData/translations/fr.json.mjs.map +1 -1
- package/lib/constants/modelCompareData/translations/it.json.js +0 -2
- package/lib/constants/modelCompareData/translations/it.json.js.map +1 -1
- package/lib/constants/modelCompareData/translations/it.json.mjs +0 -2
- package/lib/constants/modelCompareData/translations/it.json.mjs.map +1 -1
- package/lib/constants/modelCompareData/translations/ja.json.js +0 -2
- package/lib/constants/modelCompareData/translations/ja.json.js.map +1 -1
- package/lib/constants/modelCompareData/translations/ja.json.mjs +0 -2
- package/lib/constants/modelCompareData/translations/ja.json.mjs.map +1 -1
- package/lib/constants/modelCompareData/translations/pt-BR.json.js +0 -2
- package/lib/constants/modelCompareData/translations/pt-BR.json.js.map +1 -1
- package/lib/constants/modelCompareData/translations/pt-BR.json.mjs +0 -2
- package/lib/constants/modelCompareData/translations/pt-BR.json.mjs.map +1 -1
- package/lib/constants/modelCompareData/translations/useModelCompareTranslation.d.ts +2 -2
- package/lib/constants/modelCompareData/translations/zh-Hans.json.js +0 -2
- package/lib/constants/modelCompareData/translations/zh-Hans.json.js.map +1 -1
- package/lib/constants/modelCompareData/translations/zh-Hans.json.mjs +0 -2
- package/lib/constants/modelCompareData/translations/zh-Hans.json.mjs.map +1 -1
- package/lib/constants/modelCompareData/translations/zh-Hant-TW.json.js +0 -2
- package/lib/constants/modelCompareData/translations/zh-Hant-TW.json.js.map +1 -1
- package/lib/constants/modelCompareData/translations/zh-Hant-TW.json.mjs +0 -2
- package/lib/constants/modelCompareData/translations/zh-Hant-TW.json.mjs.map +1 -1
- package/lib/constants/modelCompareData/types.d.ts +5 -1
- package/lib/constants/modelCompareData/types.js +2 -0
- package/lib/constants/modelCompareData/types.js.map +1 -1
- package/lib/constants/modelCompareData/types.mjs +2 -0
- package/lib/constants/modelCompareData/types.mjs.map +1 -1
- package/lib/constants/proStoreCategories/mapping/index.js +1 -1
- package/lib/constants/proStoreCategories/mapping/index.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/index.mjs +1 -1
- package/lib/constants/proStoreCategories/mapping/index.mjs.map +1 -1
- package/lib/contexts/MenuContext/utils.d.ts +10 -0
- package/lib/contexts/MenuContext/utils.js +28 -0
- package/lib/contexts/MenuContext/utils.js.map +1 -1
- package/lib/contexts/MenuContext/utils.mjs +27 -1
- package/lib/contexts/MenuContext/utils.mjs.map +1 -1
- package/lib/utils/address.d.ts +1 -85
- package/lib/utils/address.js +0 -4
- package/lib/utils/address.js.map +1 -1
- package/lib/utils/address.mjs +0 -4
- package/lib/utils/address.mjs.map +1 -1
- package/package.json +41 -41
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { Tooltip } from '@ubnt/ui-components/Tooltip';
|
|
3
|
-
import { useState, useRef, useMemo, useCallback, useEffect } from 'react';
|
|
3
|
+
import { forwardRef, useState, useRef, useMemo, useCallback, useEffect } from 'react';
|
|
4
4
|
import '../../../../../../constants/modelCompareData/assets/close.svg.mjs';
|
|
5
5
|
import { useModelCompareTranslation } from '../../../../../../constants/modelCompareData/translations/useModelCompareTranslation.mjs';
|
|
6
|
+
import { theme } from '../../../../../../constants/theme.mjs';
|
|
6
7
|
import { useMenu } from '../../../../../../contexts/MenuContext/context.mjs';
|
|
7
8
|
import { imageSrc } from '../../../../../../utils/asset.mjs';
|
|
8
9
|
import { HEADER_HEIGHT } from '../../../../../Header/Header.styles.mjs';
|
|
@@ -14,7 +15,7 @@ import { Badges } from '../Badges/Badges.mjs';
|
|
|
14
15
|
import { StyleableSvgImage } from '../../../../../StyleableSvgImage/StyleableSvgImage.mjs';
|
|
15
16
|
import closeIcon__default from "../../../../../../assets/close3.svg";
|
|
16
17
|
"use strict";
|
|
17
|
-
const ProductHeader = ({
|
|
18
|
+
const ProductHeader = forwardRef(({
|
|
18
19
|
product,
|
|
19
20
|
setSelectedProducts,
|
|
20
21
|
index,
|
|
@@ -26,8 +27,9 @@ const ProductHeader = ({
|
|
|
26
27
|
hasMultipleProductsSelected,
|
|
27
28
|
isSmallScreen,
|
|
28
29
|
showBadges,
|
|
29
|
-
isStaticProduct
|
|
30
|
-
|
|
30
|
+
isStaticProduct,
|
|
31
|
+
isMigrationTable
|
|
32
|
+
}, ref) => {
|
|
31
33
|
const {
|
|
32
34
|
formatMessage
|
|
33
35
|
} = useModelCompareTranslation();
|
|
@@ -73,63 +75,69 @@ const ProductHeader = ({
|
|
|
73
75
|
return /* @__PURE__ */jsx(Reveal, {
|
|
74
76
|
index,
|
|
75
77
|
playAnimation: hasBeenObserved,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
children: /* @__PURE__ */jsx(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
loading: "lazy",
|
|
90
|
-
decoding: "async",
|
|
91
|
-
src: imageSrc(product.image.src),
|
|
92
|
-
width: product.image.width,
|
|
93
|
-
alt: formatMessage(product.title)
|
|
94
|
-
})
|
|
95
|
-
}), /* @__PURE__ */jsxs(ProductMeta, {
|
|
96
|
-
ref: productMetaRef,
|
|
97
|
-
children: [linkToStoreTitleClick && storeHref || !linkToStoreTitleClick && techspecsHref ? /* @__PURE__ */jsxs(Fragment, {
|
|
98
|
-
children: [/* @__PURE__ */jsx(ProductHeaderTooltipStyles, {}), /* @__PURE__ */jsxs(Tooltip, {
|
|
99
|
-
motif: "light",
|
|
100
|
-
position: toolTipIsPositionedTop ? "top" : "bottom",
|
|
101
|
-
tooltipClassName: PRODUCT_HEADER_TOOLTIP_CLASSNAME,
|
|
102
|
-
portal: true,
|
|
103
|
-
isInteractive: true,
|
|
104
|
-
description: /* @__PURE__ */jsxs(ProductHeaderTooltipLink, {
|
|
105
|
-
href: productTitleHref,
|
|
106
|
-
target: "__blank",
|
|
107
|
-
children: [formatMessage("modelCompare.reviewIn.tooltip"), " Tech Specs"]
|
|
108
|
-
}),
|
|
109
|
-
children: [/* @__PURE__ */jsx(ProductHeaderTooltipHoverArea, {
|
|
110
|
-
$width: productTitleWidth,
|
|
111
|
-
$tooltipIsPositionedTop: toolTipIsPositionedTop
|
|
112
|
-
}), /* @__PURE__ */jsx(ProductTitleLink, {
|
|
113
|
-
ref: productTitleRef,
|
|
114
|
-
children: formatMessage(product.title)
|
|
115
|
-
})]
|
|
116
|
-
}, `tooltip-${product.id}`)]
|
|
117
|
-
}) : /* @__PURE__ */jsx(ProductTitle, {
|
|
118
|
-
children: formatMessage(product.title)
|
|
119
|
-
}), !!product?.productNote && /* @__PURE__ */jsx(ProductNote, {
|
|
120
|
-
children: formatMessage(product.productNote)
|
|
121
|
-
}), product.description ? /* @__PURE__ */jsx(ProductDescription, {
|
|
122
|
-
$maxWidth: product.descriptionMaxWidth,
|
|
123
|
-
$direction: languageDirection,
|
|
124
|
-
children: formatMessage(product.description)
|
|
125
|
-
}) : null, showBadges && /* @__PURE__ */jsx(BadgeWrapper, {
|
|
126
|
-
children: /* @__PURE__ */jsx(Badges, {
|
|
127
|
-
product
|
|
78
|
+
backgroundColor: isMigrationTable ? "transparent" : theme.colors.white,
|
|
79
|
+
children: /* @__PURE__ */jsx("div", {
|
|
80
|
+
ref,
|
|
81
|
+
children: /* @__PURE__ */jsxs(HeaderGridItem, {
|
|
82
|
+
$hasTransparentBackground: isMigrationTable,
|
|
83
|
+
children: [!isLessThanOrEqualToFiveProducts && hasMultipleProductsSelected && !isStaticProduct && /* @__PURE__ */jsx(RemoveProductButton, {
|
|
84
|
+
type: "button",
|
|
85
|
+
$isSmallScreen: isSmallScreen,
|
|
86
|
+
onClick: removeHandler,
|
|
87
|
+
children: /* @__PURE__ */jsx(StyleableSvgImage, {
|
|
88
|
+
src: closeIcon__default,
|
|
89
|
+
width: 16,
|
|
90
|
+
height: 16
|
|
128
91
|
})
|
|
92
|
+
}), /* @__PURE__ */jsx(ProductImageWrap, {
|
|
93
|
+
height: product.image.height,
|
|
94
|
+
children: /* @__PURE__ */jsx(ProductImage, {
|
|
95
|
+
loading: "lazy",
|
|
96
|
+
decoding: "async",
|
|
97
|
+
src: imageSrc(product.image.src),
|
|
98
|
+
width: product.image.width,
|
|
99
|
+
alt: formatMessage(product.title)
|
|
100
|
+
})
|
|
101
|
+
}), /* @__PURE__ */jsxs(ProductMeta, {
|
|
102
|
+
ref: productMetaRef,
|
|
103
|
+
children: [linkToStoreTitleClick && storeHref || !linkToStoreTitleClick && techspecsHref ? /* @__PURE__ */jsxs(Fragment, {
|
|
104
|
+
children: [/* @__PURE__ */jsx(ProductHeaderTooltipStyles, {}), /* @__PURE__ */jsxs(Tooltip, {
|
|
105
|
+
motif: "light",
|
|
106
|
+
position: toolTipIsPositionedTop ? "top" : "bottom",
|
|
107
|
+
tooltipClassName: PRODUCT_HEADER_TOOLTIP_CLASSNAME,
|
|
108
|
+
portal: true,
|
|
109
|
+
isInteractive: true,
|
|
110
|
+
description: /* @__PURE__ */jsxs(ProductHeaderTooltipLink, {
|
|
111
|
+
href: productTitleHref,
|
|
112
|
+
target: "__blank",
|
|
113
|
+
children: [formatMessage("modelCompare.reviewIn.tooltip"), " Tech Specs"]
|
|
114
|
+
}),
|
|
115
|
+
children: [/* @__PURE__ */jsx(ProductHeaderTooltipHoverArea, {
|
|
116
|
+
$width: productTitleWidth,
|
|
117
|
+
$tooltipIsPositionedTop: toolTipIsPositionedTop
|
|
118
|
+
}), /* @__PURE__ */jsx(ProductTitleLink, {
|
|
119
|
+
ref: productTitleRef,
|
|
120
|
+
children: formatMessage(product.title)
|
|
121
|
+
})]
|
|
122
|
+
}, `tooltip-${product.id}`)]
|
|
123
|
+
}) : /* @__PURE__ */jsx(ProductTitle, {
|
|
124
|
+
children: formatMessage(product.title)
|
|
125
|
+
}), !!product?.productNote && /* @__PURE__ */jsx(ProductNote, {
|
|
126
|
+
children: formatMessage(product.productNote)
|
|
127
|
+
}), product.description ? /* @__PURE__ */jsx(ProductDescription, {
|
|
128
|
+
$maxWidth: product.descriptionMaxWidth,
|
|
129
|
+
$direction: languageDirection,
|
|
130
|
+
children: formatMessage(product.description)
|
|
131
|
+
}) : null, showBadges && /* @__PURE__ */jsx(BadgeWrapper, {
|
|
132
|
+
children: /* @__PURE__ */jsx(Badges, {
|
|
133
|
+
product
|
|
134
|
+
})
|
|
135
|
+
})]
|
|
129
136
|
})]
|
|
130
|
-
})
|
|
137
|
+
})
|
|
131
138
|
})
|
|
132
139
|
});
|
|
133
|
-
};
|
|
140
|
+
});
|
|
141
|
+
ProductHeader.displayName = "ProductHeader";
|
|
134
142
|
export { ProductHeader };
|
|
135
143
|
//# sourceMappingURL=ProductHeader.mjs.map
|
|
@@ -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 { useCallback, useEffect, useMemo, useRef, useState } from \"react\";\n\nimport closeIcon from \"../../../../../../constants/modelCompareData/assets/close.svg\";\nimport { useModelCompareTranslation } from \"../../../../../../constants/modelCompareData/translations/useModelCompareTranslation\";\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 = ({\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}: ProductHeaderProps) => {\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(productTitleRef.current.getBoundingClientRect().width);\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 index={index} playAnimation={hasBeenObserved}>\n <S.HeaderGridItem>\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 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>{formatMessage(product.title)}</S.ProductTitle>\n )}\n {!!product?.productNote && (\n <S.ProductNote>{formatMessage(product.productNote)}</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 </Reveal>\n );\n};\n"],"names":["ProductHeader","product","setSelectedProducts","index","setExternalState","selectedProducts","linkToStoreTitleClick","hasBeenObserved","isLessThanOrEqualToFiveProducts","hasMultipleProductsSelected","isSmallScreen","showBadges","isStaticProduct","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","children","jsxs","S.HeaderGridItem","S.RemoveProductButton","type","$isSmallScreen","onClick","StyleableSvgImage","src","closeIcon","height","S.ProductImageWrap","image","S.ProductImage","loading","decoding","imageSrc","alt","title","S.ProductMeta","ref","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","productNote","S.ProductNote","S.ProductDescription","$maxWidth","descriptionMaxWidth","$direction","S.BadgeWrapper","Badges"],"mappings":";;;;;;;;;;;;;;;;AAeO,MAAMA,gBAAgBA,CAAC;EAC5BC,OAAA;EACAC,mBAAA;EACAC,KAAA;EACAC,gBAAA;EACAC,gBAAA;EACAC,qBAAA;EACAC,eAAA;EACAC,+BAAA;EACAC,2BAAA;EACAC,aAAA;EACAC,UAAA;EACAC;AACF,CAA0B,KAAA;EAClB,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;IAAE5B,OA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AAA,EACHzE,UAAA,uBACEwF,YAAE,EAAF;UAAgB7C,QAAC,EAAA,eAAAH,GAAA,CAAAiD,MAAA,EAAA;YAAOnG;WAAkB;QAAG,CAAA,CAAA;MAElD,CAAA,CAAA;IAAA,CACF;EACF,CAAA,CAAA;AAEJ,CAAA;"}
|
|
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>{formatMessage(product.title)}</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","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,0BAA2B,CAAA,CAAA;EACrD,MAAM;IAAEC,aAAA;IAAeC,iBAAmB;IAAAC;EAAA,IAAYC,OAAQ,CAAA,CAAA;EAC9D,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,EAAE,EAAA,CAAA;WAwB9B,CAAA,GAAA,mBAECyD,YAAE,EAAF;YAAgBtC,QAAc,EAAA7C,aAAA,CAAAd,OAAA,CAAQ8E,KAAK;WAAE,CAAA,EAE/C,CAAC,CAAC9E,OAAA,EAASkG,WACV,IAAA,eAAA9C,GAAA,CAAC+C,WAAE,EAAF;YACExC,QAAA,EAAA7C,aAAA,CAAcd,OAAQ,CAAAkG,WAAW;WACpC,CAAA,EAEDlG,QAAQyF,WACP,GAAA,eAAArC,GAAA,CAACgD,kBAAE,EAAF;YACCC,WAAWrG,OAAQ,CAAAsG,mBAAA;YACnBC,UAAY,EAAAtF,iBAAA;YAEX0C,QAAA,EAAA7C,aAAA,CAAcd,QAAQyF,WAAW;UAAA,CAAA,CAElC,GAAA,IAAA,EACH/E,UAAA,uBACE8F,YAAE,EAAF;YAAgB7C,QAAC,EAAA,eAAAP,GAAA,CAAAqD,MAAA,EAAA;cAAOzG;aAAkB;UAAG,CAAA,CAAA;QAElD,CAAA,CAAA;MAAA,CACF;IACF,CAAA;EAAA,CACF,CAAA;AAAA,CAGN,CAAA;AAEAF,aAAA,CAAc4G,WAAc,GAAA,eAAA;"}
|
|
@@ -77,6 +77,7 @@ function PropertyValueGridItem({
|
|
|
77
77
|
$isLastProduct: isLastProduct,
|
|
78
78
|
children: /* @__PURE__ */jsxRuntime.jsx(Reveal.Reveal, {
|
|
79
79
|
index,
|
|
80
|
+
backgroundColor: "none",
|
|
80
81
|
children: /* @__PURE__ */jsxRuntime.jsx(PropertyValueComponent, {
|
|
81
82
|
productProperty
|
|
82
83
|
})
|
|
@@ -177,6 +178,8 @@ const GridItem = styled__default["default"](StickyGridItem.StickyGridItem)`
|
|
|
177
178
|
padding: 16px;
|
|
178
179
|
border-bottom: ${borderStyles};
|
|
179
180
|
border-left: ${borderStyles};
|
|
181
|
+
z-index: 999;
|
|
182
|
+
background: transparent;
|
|
180
183
|
|
|
181
184
|
${({
|
|
182
185
|
$isLastProduct
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyValueGridItem.js","sources":["../../../../../../src/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/PropertyValueGridItem.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useMedia } from \"react-use\";\nimport styled, { css } from \"styled-components\";\n\nimport { BREAKPOINTS } from \"../../../../../constants/layout\";\nimport checkIconSvg from \"../../../../../constants/modelCompareData/assets/check.svg\";\nimport minusIconSvg from \"../../../../../constants/modelCompareData/assets/minus.svg\";\nimport type {\n MutatedProperty,\n MutatedPropertyValue,\n} from \"../../../../../constants/modelCompareData/types\";\nimport { MutatedPropertyType } from \"../../../../../constants/modelCompareData/types\";\nimport { theme } from \"../../../../../constants/theme\";\nimport { useMenu } from \"../../../../../contexts/MenuContext\";\nimport { Reveal } from \"../../../../Reveal\";\nimport { StyleableSvgImage } from \"../../../../StyleableSvgImage\";\nimport { MOBILE_BREAKPOINT } from \"../../CompareTable.styles\";\nimport { StickyGridItem } from \"./StickyGrid\";\n\nexport function PropertyValueGridItem({\n productProperty,\n includeProperty,\n property,\n isLastProduct,\n index,\n}: {\n productProperty?: MutatedPropertyValue;\n includeProperty: boolean;\n property: MutatedProperty;\n isLastProduct: boolean;\n index: number;\n}) {\n const isMobile = useMedia(`(max-width: ${MOBILE_BREAKPOINT}px)`);\n\n if (includeProperty) {\n return (\n <InlineGridItem>\n {isMobile ? (\n <>\n <PropertyIcon>\n <StyleableSvgImage width={30} height={30} src={property.icon} />\n </PropertyIcon>\n <PropertyTitle>{property.title}</PropertyTitle>\n <Spacer />\n <Value\n $disableOverflow={\n productProperty?.value.type === MutatedPropertyType.Boolean\n }\n >\n <PropertyValueComponent productProperty={productProperty} />\n </Value>\n </>\n ) : (\n <Reveal index={index}>\n <PropertyIcon>\n <StyleableSvgImage width={30} height={30} src={property.icon} />\n </PropertyIcon>\n <PropertyTitle>{property.title}</PropertyTitle>\n <Spacer />\n <Value\n $disableOverflow={\n productProperty?.value.type === MutatedPropertyType.Boolean\n }\n >\n <PropertyValueComponent productProperty={productProperty} />\n </Value>\n </Reveal>\n )}\n </InlineGridItem>\n );\n }\n\n return (\n <GridItem $isLastProduct={isLastProduct}>\n <Reveal index={index}>\n <PropertyValueComponent productProperty={productProperty} />\n </Reveal>\n </GridItem>\n );\n}\n\nfunction PropertyValueComponent({\n productProperty,\n}: {\n productProperty?: MutatedPropertyValue;\n}) {\n const { languageDirection, storeId } = useMenu();\n\n const asterisks = useMemo(() => {\n const count = productProperty?.value.asterisk || 0;\n return count > 0 ? \"*\".repeat(count) : null;\n }, [productProperty?.value.asterisk]);\n\n if (!productProperty?.value) return null;\n\n const { type, value } = productProperty.value;\n\n switch (type) {\n case MutatedPropertyType.Custom:\n return (\n <>\n {value}\n {asterisks}\n </>\n );\n\n case MutatedPropertyType.Boolean:\n return (\n <BooleanWrap>\n <StyleableSvgImage\n width={value ? 16 : 11}\n height={value ? 12 : 8}\n src={value ? checkIconSvg : minusIconSvg}\n />\n {asterisks && <BooleanAsterisks>{asterisks}</BooleanAsterisks>}\n </BooleanWrap>\n );\n\n case MutatedPropertyType.String: {\n const value =\n typeof productProperty.value.value === \"string\"\n ? productProperty.value.value\n : productProperty.value.value(storeId);\n\n return (\n <Stack>\n {value.split(\"\\n\").map((row, i, arr) => {\n const isLastRow = i === arr.length - 1;\n return (\n <div dir={languageDirection} key={i}>\n {row}\n {isLastRow && asterisks}\n </div>\n );\n })}\n </Stack>\n );\n }\n default:\n return null;\n }\n}\n\nconst Stack = styled.div`\n display: flex;\n flex-direction: column;\n gap: 4px;\n font-size: 14px;\n font-weight: 400;\n line-height: 16.8px;\n letter-spacing: -0.28px;\n color: ${theme.colors.black65};\n\n @media ${BREAKPOINTS.MOBILE_AND_DOWN} {\n font-size: 12px;\n }\n`;\n\nconst Value = styled.div<{ $disableOverflow?: boolean }>`\n text-align: right;\n\n ${({ $disableOverflow }) =>\n !$disableOverflow &&\n css`\n overflow: hidden;\n `}\n text-overflow: ellipsis;\n min-width: min-content;\n\n div {\n ${({ $disableOverflow }) =>\n !$disableOverflow &&\n css`\n overflow: hidden;\n `}\n\n text-overflow: ellipsis;\n }\n`;\n\nconst borderStyles = `1px solid ${theme.colors.athensGreyDark}`;\n\nconst GridItem = styled(StickyGridItem)<{ $isLastProduct: boolean }>`\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 14px;\n color: #000000a6;\n text-align: center;\n padding: 16px;\n border-bottom: ${borderStyles};\n border-left: ${borderStyles};\n\n ${({ $isLastProduct }) =>\n $isLastProduct &&\n css`\n border-right: ${borderStyles};\n `}\n`;\n\nconst InlineGridItem = styled(StickyGridItem)`\n display: flex;\n gap: 8px;\n align-items: center;\n padding: 16px;\n overflow: hidden;\n border-bottom: 1px solid ${theme.colors.athensGreyDark};\n`;\n\nconst PropertyTitle = styled.div`\n font-size: 14px;\n font-weight: ${theme.fontWeight.bold};\n max-width: 45%;\n line-height: ${17 / 14};\n`;\n\nconst PropertyIcon = styled.div`\n width: 30px;\n height: 30px;\n`;\n\nconst Spacer = styled.div`\n flex: 1;\n`;\n\nconst BooleanWrap = styled.div`\n position: relative;\n overflow: visible;\n\n @media (max-width: ${MOBILE_BREAKPOINT}px) {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 5.5px;\n }\n`;\n\nconst BooleanAsterisks = styled.div`\n position: absolute;\n font-size: 14px;\n line-height: 16.8px;\n\n top: -4.5px;\n left: calc(100% + 5.5px);\n\n @media (max-width: ${MOBILE_BREAKPOINT}px) {\n position: static;\n\n margin-top: -4.5px;\n }\n`;\n"],"names":["PropertyValueGridItem","productProperty","includeProperty","property","isLastProduct","index","isMobile","useMedia","MOBILE_BREAKPOINT","jsx","InlineGridItem","children","jsxs","Fragment","PropertyIcon","StyleableSvgImage","width","height","src","icon","PropertyTitle","title","Spacer","Value","$disableOverflow","value","type","MutatedPropertyType","Boolean","PropertyValueComponent","Reveal","GridItem","$isLastProduct","languageDirection","storeId","useMenu","asterisks","useMemo","count","asterisk","repeat","Custom","BooleanWrap","checkIconSvg","minusIconSvg","BooleanAsterisks","String","Stack","split","map","row","i","arr","isLastRow","length","dir","styled","div","theme","colors","black65","BREAKPOINTS","MOBILE_AND_DOWN","css","borderStyles","athensGreyDark","StickyGridItem","fontWeight","bold"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBO,SAASA,qBAAsBA,CAAA;EACpCC,eAAA;EACAC,eAAA;EACAC,QAAA;EACAC,aAAA;EACAC;AACF,CAMG,EAAA;EACD,MAAMC,QAAW,GAAAC,QAAAA,CAAAA,QAAA,CAAS,eAAeC,mBAAiB,CAAAA,iBAAA,KAAK,CAAA;EAE/D,IAAIN,eAAiB,EAAA;IAEjB,sBAAAO,UAAA,CAAAA,GAAA,CAACC,cACE,EAAA;MAAAC,QAAA,EAAAL,QAAA,GAAA,eAEGM,eAAA,CAAAC,UAAAA,CAAAA,QAAA,EAAA;QAAAF,QAAA,EAAA,CAAA,eAACF,UAAA,CAAAA,GAAA,CAAAK,YAAA,EAAA;UACCH,QAAC,EAAAF,eAAAA,UAAAA,CAAAA,GAAA,CAAAM,iBAAAA,CAAAA,iBAAA,EAAA;YAAkBC,KAAO,EAAA,EAAA;YAAIC,QAAQ,EAAI;YAAAC,GAAA,EAAKf,QAAS,CAAAgB;UAAA,CAAM;QAChE,CAAA,CAAA,EACAV,eAAAA,UAAAA,CAAAA,GAAA,CAACW,aAAe,EAAA;UAAAT,QAAA,EAAAR,QAAA,CAASkB;QAAM,CAAA,CAAA,EAAA,8BAC9BC,MAAO,EAAA,EAAA,CAAA,EAAA,eACRb,UAAA,CAAAA,GAAA,CAACc,KAAA,EAAA;UACCC,gBACE,EAAAvB,eAAA,EAAiBwB,KAAM,CAAAC,IAAA,KAASC,KAAoB,CAAAA,mBAAA,CAAAC,OAAA;UAGtDjB,QAAA,iBAAAF,UAAA,CAAAA,GAAA,CAACoB;YAAuB5B;UAAkC,CAAA;QAAA,CAAA,CAAA;MAE9D,CAAA,CAAA,GAAA,e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AA;AAAA,mBAQnBF,YAAY;AAAA,iBACdA,YAAY;;AAAA,IAEzB,CAAC;EAAEhC;CAAe,KAClBA,cACA,IAAA+B,MAAA,CAAAA,GAAA;AAAA,sBACkBC,YAAY;AAAA,KAC7B;AAAA,CAAA;AAGL,MAAMtD,cAAA,GAAiB8C,2BAAOU,6BAAc,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAMfR,KAAA,CAAAA,KAAA,CAAMC,OAAOM,cAAc;AAAA,CAAA;AAGxD,MAAM7C,gBAAgBoC,eAAO,CAAA,SAAA,CAAA,CAAAC,GAAA;AAAA;AAAA,iBAEZC,KAAA,CAAAA,KAAA,CAAMS,WAAWC,IAAI;AAAA;AAAA,iBAErB,KAAK,EAAE;AAAA,CAAA;AAGxB,MAAMtD,eAAe0C,eAAO,CAAA,SAAA,CAAA,CAAAC,GAAA;AAAA;AAAA;AAAA,CAAA;AAK5B,MAAMnC,SAASkC,eAAO,CAAA,SAAA,CAAA,CAAAC,GAAA;AAAA;AAAA,CAAA;AAItB,MAAMf,cAAcc,eAAO,CAAA,SAAA,CAAA,CAAAC,GAAA;AAAA;AAAA;;AAAA,uBAIJjD,qCAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAQxC,MAAMqC,mBAAmBW,eAAO,CAAA,SAAA,CAAA,CAAAC,GAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAAA,uBAQTjD,qCAAiB;AAAA;;AAAA;AAAA;AAAA,CAAA;"}
|
|
1
|
+
{"version":3,"file":"PropertyValueGridItem.js","sources":["../../../../../../src/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/PropertyValueGridItem.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useMedia } from \"react-use\";\nimport styled, { css } from \"styled-components\";\n\nimport { BREAKPOINTS } from \"../../../../../constants/layout\";\nimport checkIconSvg from \"../../../../../constants/modelCompareData/assets/check.svg\";\nimport minusIconSvg from \"../../../../../constants/modelCompareData/assets/minus.svg\";\nimport type {\n MutatedProperty,\n MutatedPropertyValue,\n} from \"../../../../../constants/modelCompareData/types\";\nimport { MutatedPropertyType } from \"../../../../../constants/modelCompareData/types\";\nimport { theme } from \"../../../../../constants/theme\";\nimport { useMenu } from \"../../../../../contexts/MenuContext\";\nimport { Reveal } from \"../../../../Reveal\";\nimport { StyleableSvgImage } from \"../../../../StyleableSvgImage\";\nimport { MOBILE_BREAKPOINT } from \"../../CompareTable.styles\";\nimport { StickyGridItem } from \"./StickyGrid\";\n\nexport function PropertyValueGridItem({\n productProperty,\n includeProperty,\n property,\n isLastProduct,\n index,\n}: {\n productProperty?: MutatedPropertyValue;\n includeProperty: boolean;\n property: MutatedProperty;\n isLastProduct: boolean;\n index: number;\n}) {\n const isMobile = useMedia(`(max-width: ${MOBILE_BREAKPOINT}px)`);\n\n if (includeProperty) {\n return (\n <InlineGridItem>\n {isMobile ? (\n <>\n <PropertyIcon>\n <StyleableSvgImage width={30} height={30} src={property.icon} />\n </PropertyIcon>\n <PropertyTitle>{property.title}</PropertyTitle>\n <Spacer />\n <Value\n $disableOverflow={\n productProperty?.value.type === MutatedPropertyType.Boolean\n }\n >\n <PropertyValueComponent productProperty={productProperty} />\n </Value>\n </>\n ) : (\n <Reveal index={index}>\n <PropertyIcon>\n <StyleableSvgImage width={30} height={30} src={property.icon} />\n </PropertyIcon>\n <PropertyTitle>{property.title}</PropertyTitle>\n <Spacer />\n <Value\n $disableOverflow={\n productProperty?.value.type === MutatedPropertyType.Boolean\n }\n >\n <PropertyValueComponent productProperty={productProperty} />\n </Value>\n </Reveal>\n )}\n </InlineGridItem>\n );\n }\n\n return (\n <GridItem $isLastProduct={isLastProduct}>\n <Reveal index={index} backgroundColor=\"none\">\n <PropertyValueComponent productProperty={productProperty} />\n </Reveal>\n </GridItem>\n );\n}\n\nfunction PropertyValueComponent({\n productProperty,\n}: {\n productProperty?: MutatedPropertyValue;\n}) {\n const { languageDirection, storeId } = useMenu();\n\n const asterisks = useMemo(() => {\n const count = productProperty?.value.asterisk || 0;\n return count > 0 ? \"*\".repeat(count) : null;\n }, [productProperty?.value.asterisk]);\n\n if (!productProperty?.value) return null;\n\n const { type, value } = productProperty.value;\n\n switch (type) {\n case MutatedPropertyType.Custom:\n return (\n <>\n {value}\n {asterisks}\n </>\n );\n\n case MutatedPropertyType.Boolean:\n return (\n <BooleanWrap>\n <StyleableSvgImage\n width={value ? 16 : 11}\n height={value ? 12 : 8}\n src={value ? checkIconSvg : minusIconSvg}\n />\n {asterisks && <BooleanAsterisks>{asterisks}</BooleanAsterisks>}\n </BooleanWrap>\n );\n\n case MutatedPropertyType.String: {\n const value =\n typeof productProperty.value.value === \"string\"\n ? productProperty.value.value\n : productProperty.value.value(storeId);\n\n return (\n <Stack>\n {value.split(\"\\n\").map((row, i, arr) => {\n const isLastRow = i === arr.length - 1;\n return (\n <div dir={languageDirection} key={i}>\n {row}\n {isLastRow && asterisks}\n </div>\n );\n })}\n </Stack>\n );\n }\n default:\n return null;\n }\n}\n\nconst Stack = styled.div`\n display: flex;\n flex-direction: column;\n gap: 4px;\n font-size: 14px;\n font-weight: 400;\n line-height: 16.8px;\n letter-spacing: -0.28px;\n color: ${theme.colors.black65};\n\n @media ${BREAKPOINTS.MOBILE_AND_DOWN} {\n font-size: 12px;\n }\n`;\n\nconst Value = styled.div<{ $disableOverflow?: boolean }>`\n text-align: right;\n\n ${({ $disableOverflow }) =>\n !$disableOverflow &&\n css`\n overflow: hidden;\n `}\n text-overflow: ellipsis;\n min-width: min-content;\n\n div {\n ${({ $disableOverflow }) =>\n !$disableOverflow &&\n css`\n overflow: hidden;\n `}\n\n text-overflow: ellipsis;\n }\n`;\n\nconst borderStyles = `1px solid ${theme.colors.athensGreyDark}`;\n\nconst GridItem = styled(StickyGridItem)<{ $isLastProduct: boolean }>`\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 14px;\n color: #000000a6;\n text-align: center;\n padding: 16px;\n border-bottom: ${borderStyles};\n border-left: ${borderStyles};\n z-index: 999;\n background: transparent;\n\n ${({ $isLastProduct }) =>\n $isLastProduct &&\n css`\n border-right: ${borderStyles};\n `}\n`;\n\nconst InlineGridItem = styled(StickyGridItem)`\n display: flex;\n gap: 8px;\n align-items: center;\n padding: 16px;\n overflow: hidden;\n border-bottom: 1px solid ${theme.colors.athensGreyDark};\n`;\n\nconst PropertyTitle = styled.div`\n font-size: 14px;\n font-weight: ${theme.fontWeight.bold};\n max-width: 45%;\n line-height: ${17 / 14};\n`;\n\nconst PropertyIcon = styled.div`\n width: 30px;\n height: 30px;\n`;\n\nconst Spacer = styled.div`\n flex: 1;\n`;\n\nconst BooleanWrap = styled.div`\n position: relative;\n overflow: visible;\n\n @media (max-width: ${MOBILE_BREAKPOINT}px) {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 5.5px;\n }\n`;\n\nconst BooleanAsterisks = styled.div`\n position: absolute;\n font-size: 14px;\n line-height: 16.8px;\n\n top: -4.5px;\n left: calc(100% + 5.5px);\n\n @media (max-width: ${MOBILE_BREAKPOINT}px) {\n position: static;\n\n margin-top: -4.5px;\n }\n`;\n"],"names":["PropertyValueGridItem","productProperty","includeProperty","property","isLastProduct","index","isMobile","useMedia","MOBILE_BREAKPOINT","jsx","InlineGridItem","children","jsxs","Fragment","PropertyIcon","StyleableSvgImage","width","height","src","icon","PropertyTitle","title","Spacer","Value","$disableOverflow","value","type","MutatedPropertyType","Boolean","PropertyValueComponent","Reveal","GridItem","$isLastProduct","backgroundColor","languageDirection","storeId","useMenu","asterisks","useMemo","count","asterisk","repeat","Custom","BooleanWrap","checkIconSvg","minusIconSvg","BooleanAsterisks","String","Stack","split","map","row","i","arr","isLastRow","length","dir","styled","div","theme","colors","black65","BREAKPOINTS","MOBILE_AND_DOWN","css","borderStyles","athensGreyDark","StickyGridItem","fontWeight","bold"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBO,SAASA,qBAAsBA,CAAA;EACpCC,eAAA;EACAC,eAAA;EACAC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AAA,6BAMfR,KAAA,CAAAA,KAAA,CAAMC,OAAOM,cAAc;AAAA,CAAA;AAGxD,MAAM9C,gBAAgBqC,eAAO,CAAA,SAAA,CAAA,CAAAC,GAAA;AAAA;AAAA,iBAEZC,KAAA,CAAAA,KAAA,CAAMS,WAAWC,IAAI;AAAA;AAAA,iBAErB,KAAK,EAAE;AAAA,CAAA;AAGxB,MAAMvD,eAAe2C,eAAO,CAAA,SAAA,CAAA,CAAAC,GAAA;AAAA;AAAA;AAAA,CAAA;AAK5B,MAAMpC,SAASmC,eAAO,CAAA,SAAA,CAAA,CAAAC,GAAA;AAAA;AAAA,CAAA;AAItB,MAAMf,cAAcc,eAAO,CAAA,SAAA,CAAA,CAAAC,GAAA;AAAA;AAAA;;AAAA,uBAIJlD,qCAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAQxC,MAAMsC,mBAAmBW,eAAO,CAAA,SAAA,CAAA,CAAAC,GAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAAA,uBAQTlD,qCAAiB;AAAA;;AAAA;AAAA;AAAA,CAAA;"}
|
|
@@ -67,6 +67,7 @@ function PropertyValueGridItem({
|
|
|
67
67
|
$isLastProduct: isLastProduct,
|
|
68
68
|
children: /* @__PURE__ */jsx(Reveal, {
|
|
69
69
|
index,
|
|
70
|
+
backgroundColor: "none",
|
|
70
71
|
children: /* @__PURE__ */jsx(PropertyValueComponent, {
|
|
71
72
|
productProperty
|
|
72
73
|
})
|
|
@@ -167,6 +168,8 @@ const GridItem = styled(StickyGridItem)`
|
|
|
167
168
|
padding: 16px;
|
|
168
169
|
border-bottom: ${borderStyles};
|
|
169
170
|
border-left: ${borderStyles};
|
|
171
|
+
z-index: 999;
|
|
172
|
+
background: transparent;
|
|
170
173
|
|
|
171
174
|
${({
|
|
172
175
|
$isLastProduct
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyValueGridItem.mjs","sources":["../../../../../../src/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/PropertyValueGridItem.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useMedia } from \"react-use\";\nimport styled, { css } from \"styled-components\";\n\nimport { BREAKPOINTS } from \"../../../../../constants/layout\";\nimport checkIconSvg from \"../../../../../constants/modelCompareData/assets/check.svg\";\nimport minusIconSvg from \"../../../../../constants/modelCompareData/assets/minus.svg\";\nimport type {\n MutatedProperty,\n MutatedPropertyValue,\n} from \"../../../../../constants/modelCompareData/types\";\nimport { MutatedPropertyType } from \"../../../../../constants/modelCompareData/types\";\nimport { theme } from \"../../../../../constants/theme\";\nimport { useMenu } from \"../../../../../contexts/MenuContext\";\nimport { Reveal } from \"../../../../Reveal\";\nimport { StyleableSvgImage } from \"../../../../StyleableSvgImage\";\nimport { MOBILE_BREAKPOINT } from \"../../CompareTable.styles\";\nimport { StickyGridItem } from \"./StickyGrid\";\n\nexport function PropertyValueGridItem({\n productProperty,\n includeProperty,\n property,\n isLastProduct,\n index,\n}: {\n productProperty?: MutatedPropertyValue;\n includeProperty: boolean;\n property: MutatedProperty;\n isLastProduct: boolean;\n index: number;\n}) {\n const isMobile = useMedia(`(max-width: ${MOBILE_BREAKPOINT}px)`);\n\n if (includeProperty) {\n return (\n <InlineGridItem>\n {isMobile ? (\n <>\n <PropertyIcon>\n <StyleableSvgImage width={30} height={30} src={property.icon} />\n </PropertyIcon>\n <PropertyTitle>{property.title}</PropertyTitle>\n <Spacer />\n <Value\n $disableOverflow={\n productProperty?.value.type === MutatedPropertyType.Boolean\n }\n >\n <PropertyValueComponent productProperty={productProperty} />\n </Value>\n </>\n ) : (\n <Reveal index={index}>\n <PropertyIcon>\n <StyleableSvgImage width={30} height={30} src={property.icon} />\n </PropertyIcon>\n <PropertyTitle>{property.title}</PropertyTitle>\n <Spacer />\n <Value\n $disableOverflow={\n productProperty?.value.type === MutatedPropertyType.Boolean\n }\n >\n <PropertyValueComponent productProperty={productProperty} />\n </Value>\n </Reveal>\n )}\n </InlineGridItem>\n );\n }\n\n return (\n <GridItem $isLastProduct={isLastProduct}>\n <Reveal index={index}>\n <PropertyValueComponent productProperty={productProperty} />\n </Reveal>\n </GridItem>\n );\n}\n\nfunction PropertyValueComponent({\n productProperty,\n}: {\n productProperty?: MutatedPropertyValue;\n}) {\n const { languageDirection, storeId } = useMenu();\n\n const asterisks = useMemo(() => {\n const count = productProperty?.value.asterisk || 0;\n return count > 0 ? \"*\".repeat(count) : null;\n }, [productProperty?.value.asterisk]);\n\n if (!productProperty?.value) return null;\n\n const { type, value } = productProperty.value;\n\n switch (type) {\n case MutatedPropertyType.Custom:\n return (\n <>\n {value}\n {asterisks}\n </>\n );\n\n case MutatedPropertyType.Boolean:\n return (\n <BooleanWrap>\n <StyleableSvgImage\n width={value ? 16 : 11}\n height={value ? 12 : 8}\n src={value ? checkIconSvg : minusIconSvg}\n />\n {asterisks && <BooleanAsterisks>{asterisks}</BooleanAsterisks>}\n </BooleanWrap>\n );\n\n case MutatedPropertyType.String: {\n const value =\n typeof productProperty.value.value === \"string\"\n ? productProperty.value.value\n : productProperty.value.value(storeId);\n\n return (\n <Stack>\n {value.split(\"\\n\").map((row, i, arr) => {\n const isLastRow = i === arr.length - 1;\n return (\n <div dir={languageDirection} key={i}>\n {row}\n {isLastRow && asterisks}\n </div>\n );\n })}\n </Stack>\n );\n }\n default:\n return null;\n }\n}\n\nconst Stack = styled.div`\n display: flex;\n flex-direction: column;\n gap: 4px;\n font-size: 14px;\n font-weight: 400;\n line-height: 16.8px;\n letter-spacing: -0.28px;\n color: ${theme.colors.black65};\n\n @media ${BREAKPOINTS.MOBILE_AND_DOWN} {\n font-size: 12px;\n }\n`;\n\nconst Value = styled.div<{ $disableOverflow?: boolean }>`\n text-align: right;\n\n ${({ $disableOverflow }) =>\n !$disableOverflow &&\n css`\n overflow: hidden;\n `}\n text-overflow: ellipsis;\n min-width: min-content;\n\n div {\n ${({ $disableOverflow }) =>\n !$disableOverflow &&\n css`\n overflow: hidden;\n `}\n\n text-overflow: ellipsis;\n }\n`;\n\nconst borderStyles = `1px solid ${theme.colors.athensGreyDark}`;\n\nconst GridItem = styled(StickyGridItem)<{ $isLastProduct: boolean }>`\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 14px;\n color: #000000a6;\n text-align: center;\n padding: 16px;\n border-bottom: ${borderStyles};\n border-left: ${borderStyles};\n\n ${({ $isLastProduct }) =>\n $isLastProduct &&\n css`\n border-right: ${borderStyles};\n `}\n`;\n\nconst InlineGridItem = styled(StickyGridItem)`\n display: flex;\n gap: 8px;\n align-items: center;\n padding: 16px;\n overflow: hidden;\n border-bottom: 1px solid ${theme.colors.athensGreyDark};\n`;\n\nconst PropertyTitle = styled.div`\n font-size: 14px;\n font-weight: ${theme.fontWeight.bold};\n max-width: 45%;\n line-height: ${17 / 14};\n`;\n\nconst PropertyIcon = styled.div`\n width: 30px;\n height: 30px;\n`;\n\nconst Spacer = styled.div`\n flex: 1;\n`;\n\nconst BooleanWrap = styled.div`\n position: relative;\n overflow: visible;\n\n @media (max-width: ${MOBILE_BREAKPOINT}px) {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 5.5px;\n }\n`;\n\nconst BooleanAsterisks = styled.div`\n position: absolute;\n font-size: 14px;\n line-height: 16.8px;\n\n top: -4.5px;\n left: calc(100% + 5.5px);\n\n @media (max-width: ${MOBILE_BREAKPOINT}px) {\n position: static;\n\n margin-top: -4.5px;\n }\n`;\n"],"names":["PropertyValueGridItem","productProperty","includeProperty","property","isLastProduct","index","isMobile","useMedia","MOBILE_BREAKPOINT","jsx","InlineGridItem","children","jsxs","Fragment","PropertyIcon","StyleableSvgImage","width","height","src","icon","PropertyTitle","title","Spacer","Value","$disableOverflow","value","type","MutatedPropertyType","Boolean","PropertyValueComponent","Reveal","GridItem","$isLastProduct","languageDirection","storeId","useMenu","asterisks","useMemo","count","asterisk","repeat","Custom","BooleanWrap","checkIconSvg","minusIconSvg","BooleanAsterisks","String","Stack","split","map","row","i","arr","isLastRow","length","dir","styled","div","theme","colors","black65","BREAKPOINTS","MOBILE_AND_DOWN","css","borderStyles","athensGreyDark","StickyGridItem","fontWeight","bold"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAmBO,SAASA,qBAAsBA,CAAA;EACpCC,eAAA;EACAC,eAAA;EACAC,QAAA;EACAC,aAAA;EACAC;AACF,CAMG,EAAA;EACD,MAAMC,QAAW,GAAAC,QAAA,CAAS,eAAeC,iBAAiB,KAAK,CAAA;EAE/D,IAAIN,eAAiB,EAAA;IAEjB,sBAAAO,GAAA,CAACC,cACE,EAAA;MAAAC,QAAA,EAAAL,QAAA,GAAA,eAEGM,IAAA,CAAAC,QAAA,EAAA;QAAAF,QAAA,EAAA,CAAA,eAACF,GAAA,CAAAK,YAAA,EAAA;UACCH,QAAC,EAAA,eAAAF,GAAA,CAAAM,iBAAA,EAAA;YAAkBC,KAAO,EAAA,EAAA;YAAIC,QAAQ,EAAI;YAAAC,GAAA,EAAKf,QAAS,CAAAgB;UAAA,CAAM;QAChE,CAAA,CAAA,EACA,eAAAV,GAAA,CAACW,aAAe,EAAA;UAAAT,QAAA,EAAAR,QAAA,CAASkB;QAAM,CAAA,CAAA,EAAA,mBAC9BC,MAAO,EAAA,EAAA,CAAA,EAAA,eACRb,GAAA,CAACc,KAAA,EAAA;UACCC,gBACE,EAAAvB,eAAA,EAAiBwB,KAAM,CAAAC,IAAA,KAASC,mBAAoB,CAAAC,OAAA;UAGtDjB,QAAA,iBAAAF,GAAA,CAACoB;YAAuB5B;UAAkC,CAAA;QAAA,CAAA,CAAA;MAE9D,CAAA,CAAA,GAAA,eAECW,IAAA,CAAAkB,MAAA,EAAA;QAAOzB,KACN;QAAAM,QAAA,EAAA,CAAA,eAACF,GAAA,CAAAK,YAAA,EAAA;UACCH,QAAC,EAAA,eAAAF,GAAA,CAAAM,iBAAA,EAAA;YAAkBC,KAAO,EAAA,EAAA;YAAIC,QAAQ,EAAI;YAAAC,GAAA,EAAKf,QAAS,CAAAgB;UAAA,CAAM;Q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W,MAAO,CAAAC,GAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAAA,uBAQTjD,iBAAiB;AAAA;;AAAA;AAAA;AAAA,CAAA;"}
|
|
1
|
+
{"version":3,"file":"PropertyValueGridItem.mjs","sources":["../../../../../../src/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/PropertyValueGridItem.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useMedia } from \"react-use\";\nimport styled, { css } from \"styled-components\";\n\nimport { BREAKPOINTS } from \"../../../../../constants/layout\";\nimport checkIconSvg from \"../../../../../constants/modelCompareData/assets/check.svg\";\nimport minusIconSvg from \"../../../../../constants/modelCompareData/assets/minus.svg\";\nimport type {\n MutatedProperty,\n MutatedPropertyValue,\n} from \"../../../../../constants/modelCompareData/types\";\nimport { MutatedPropertyType } from \"../../../../../constants/modelCompareData/types\";\nimport { theme } from \"../../../../../constants/theme\";\nimport { useMenu } from \"../../../../../contexts/MenuContext\";\nimport { Reveal } from \"../../../../Reveal\";\nimport { StyleableSvgImage } from \"../../../../StyleableSvgImage\";\nimport { MOBILE_BREAKPOINT } from \"../../CompareTable.styles\";\nimport { StickyGridItem } from \"./StickyGrid\";\n\nexport function PropertyValueGridItem({\n productProperty,\n includeProperty,\n property,\n isLastProduct,\n index,\n}: {\n productProperty?: MutatedPropertyValue;\n includeProperty: boolean;\n property: MutatedProperty;\n isLastProduct: boolean;\n index: number;\n}) {\n const isMobile = useMedia(`(max-width: ${MOBILE_BREAKPOINT}px)`);\n\n if (includeProperty) {\n return (\n <InlineGridItem>\n {isMobile ? (\n <>\n <PropertyIcon>\n <StyleableSvgImage width={30} height={30} src={property.icon} />\n </PropertyIcon>\n <PropertyTitle>{property.title}</PropertyTitle>\n <Spacer />\n <Value\n $disableOverflow={\n productProperty?.value.type === MutatedPropertyType.Boolean\n }\n >\n <PropertyValueComponent productProperty={productProperty} />\n </Value>\n </>\n ) : (\n <Reveal index={index}>\n <PropertyIcon>\n <StyleableSvgImage width={30} height={30} src={property.icon} />\n </PropertyIcon>\n <PropertyTitle>{property.title}</PropertyTitle>\n <Spacer />\n <Value\n $disableOverflow={\n productProperty?.value.type === MutatedPropertyType.Boolean\n }\n >\n <PropertyValueComponent productProperty={productProperty} />\n </Value>\n </Reveal>\n )}\n </InlineGridItem>\n );\n }\n\n return (\n <GridItem $isLastProduct={isLastProduct}>\n <Reveal index={index} backgroundColor=\"none\">\n <PropertyValueComponent productProperty={productProperty} />\n </Reveal>\n </GridItem>\n );\n}\n\nfunction PropertyValueComponent({\n productProperty,\n}: {\n productProperty?: MutatedPropertyValue;\n}) {\n const { languageDirection, storeId } = useMenu();\n\n const asterisks = useMemo(() => {\n const count = productProperty?.value.asterisk || 0;\n return count > 0 ? \"*\".repeat(count) : null;\n }, [productProperty?.value.asterisk]);\n\n if (!productProperty?.value) return null;\n\n const { type, value } = productProperty.value;\n\n switch (type) {\n case MutatedPropertyType.Custom:\n return (\n <>\n {value}\n {asterisks}\n </>\n );\n\n case MutatedPropertyType.Boolean:\n return (\n <BooleanWrap>\n <StyleableSvgImage\n width={value ? 16 : 11}\n height={value ? 12 : 8}\n src={value ? checkIconSvg : minusIconSvg}\n />\n {asterisks && <BooleanAsterisks>{asterisks}</BooleanAsterisks>}\n </BooleanWrap>\n );\n\n case MutatedPropertyType.String: {\n const value =\n typeof productProperty.value.value === \"string\"\n ? productProperty.value.value\n : productProperty.value.value(storeId);\n\n return (\n <Stack>\n {value.split(\"\\n\").map((row, i, arr) => {\n const isLastRow = i === arr.length - 1;\n return (\n <div dir={languageDirection} key={i}>\n {row}\n {isLastRow && asterisks}\n </div>\n );\n })}\n </Stack>\n );\n }\n default:\n return null;\n }\n}\n\nconst Stack = styled.div`\n display: flex;\n flex-direction: column;\n gap: 4px;\n font-size: 14px;\n font-weight: 400;\n line-height: 16.8px;\n letter-spacing: -0.28px;\n color: ${theme.colors.black65};\n\n @media ${BREAKPOINTS.MOBILE_AND_DOWN} {\n font-size: 12px;\n }\n`;\n\nconst Value = styled.div<{ $disableOverflow?: boolean }>`\n text-align: right;\n\n ${({ $disableOverflow }) =>\n !$disableOverflow &&\n css`\n overflow: hidden;\n `}\n text-overflow: ellipsis;\n min-width: min-content;\n\n div {\n ${({ $disableOverflow }) =>\n !$disableOverflow &&\n css`\n overflow: hidden;\n `}\n\n text-overflow: ellipsis;\n }\n`;\n\nconst borderStyles = `1px solid ${theme.colors.athensGreyDark}`;\n\nconst GridItem = styled(StickyGridItem)<{ $isLastProduct: boolean }>`\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 14px;\n color: #000000a6;\n text-align: center;\n padding: 16px;\n border-bottom: ${borderStyles};\n border-left: ${borderStyles};\n z-index: 999;\n background: transparent;\n\n ${({ $isLastProduct }) =>\n $isLastProduct &&\n css`\n border-right: ${borderStyles};\n `}\n`;\n\nconst InlineGridItem = styled(StickyGridItem)`\n display: flex;\n gap: 8px;\n align-items: center;\n padding: 16px;\n overflow: hidden;\n border-bottom: 1px solid ${theme.colors.athensGreyDark};\n`;\n\nconst PropertyTitle = styled.div`\n font-size: 14px;\n font-weight: ${theme.fontWeight.bold};\n max-width: 45%;\n line-height: ${17 / 14};\n`;\n\nconst PropertyIcon = styled.div`\n width: 30px;\n height: 30px;\n`;\n\nconst Spacer = styled.div`\n flex: 1;\n`;\n\nconst BooleanWrap = styled.div`\n position: relative;\n overflow: visible;\n\n @media (max-width: ${MOBILE_BREAKPOINT}px) {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 5.5px;\n }\n`;\n\nconst BooleanAsterisks = styled.div`\n position: absolute;\n font-size: 14px;\n line-height: 16.8px;\n\n top: -4.5px;\n left: calc(100% + 5.5px);\n\n @media (max-width: ${MOBILE_BREAKPOINT}px) {\n position: static;\n\n margin-top: -4.5px;\n }\n`;\n"],"names":["PropertyValueGridItem","productProperty","includeProperty","property","isLastProduct","index","isMobile","useMedia","MOBILE_BREAKPOINT","jsx","InlineGridItem","children","jsxs","Fragment","PropertyIcon","StyleableSvgImage","width","height","src","icon","PropertyTitle","title","Spacer","Value","$disableOverflow","value","type","MutatedPropertyType","Boolean","PropertyValueComponent","Reveal","GridItem","$isLastProduct","backgroundColor","languageDirection","storeId","useMenu","asterisks","useMemo","count","asterisk","repeat","Custom","BooleanWrap","checkIconSvg","minusIconSvg","BooleanAsterisks","String","Stack","split","map","row","i","arr","isLastRow","length","dir","styled","div","theme","colors","black65","BREAKPOINTS","MOBILE_AND_DOWN","css","borderStyles","athensGreyDark","StickyGridItem","fontWeight","bold"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAmBO,SAASA,qBAAsBA,CAAA;EACpCC,eAAA;EACAC,eAAA;EACAC,QAAA;EACAC,aAAA;EACAC;AACF,CAMG,EAAA;EACD,MAAMC,QAAW,GAAAC,QAAA,CAAS,eAAeC,iBAAiB,KAAK,CAAA;EAE/D,IAAIN,eAAiB,EAAA;IAEjB,sBAAAO,GAAA,CAACC,cACE,EAAA;MAAAC,QAAA,EAAAL,QAAA,GAAA,eAEGM,IAAA,CAAAC,QAAA,EAAA;QAAAF,QAAA,EAAA,CAAA,eAACF,GAAA,CAAAK,YAAA,EAAA;UACCH,QAAC,EAAA,eAAAF,GAAA,CAAAM,iBAAA,EAAA;YAAkBC,KAAO,EAAA,EAAA;YAAIC,QAAQ,EAAI;YAAAC,GAAA,EAAKf,QAAS,CAAAgB;UAAA,CAAM;QAChE,CAAA,CAAA,EACA,eAAAV,GAAA,CAACW,aAAe,EAAA;UAAAT,QAAA,EAAAR,QAAA,CAASkB;QAAM,CAAA,CAAA,EAAA,mBAC9BC,MAAO,EAAA,EAAA,CAAA,EAAA,eACRb,GAAA,CAACc,KAAA,EAAA;UACCC,gBACE,EAAAvB,eAAA,EAAiBwB,KAAM,CAAAC,IAAA,KAASC,mBAAoB,CAAAC,OAAA;UAGtDjB,QAAA,iBAAAF,GAAA,CAACoB;YAAuB5B;UAAkC,CAAA;QAAA,CAAA,CAAA;MAE9D,CAAA,CAAA,GAAA,eAECW,IAAA,CAAAkB,MA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AAMvD,eAAe2C,MAAO,CAAAC,GAAA;AAAA;AAAA;AAAA,CAAA;AAK5B,MAAMpC,SAASmC,MAAO,CAAAC,GAAA;AAAA;AAAA,CAAA;AAItB,MAAMf,cAAcc,MAAO,CAAAC,GAAA;AAAA;AAAA;;AAAA,uBAIJlD,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAQxC,MAAMsC,mBAAmBW,MAAO,CAAAC,GAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAAA,uBAQTlD,iBAAiB;AAAA;;AAAA;AAAA;AAAA,CAAA;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
export declare
|
|
2
|
+
export declare const StickyGridBody: import("react").ForwardRefExoticComponent<{
|
|
3
3
|
children: ReactNode;
|
|
4
|
-
})
|
|
4
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var styled = require('styled-components');
|
|
6
|
+
var mergeRefs = require('../../../helpers/mergeRefs.js');
|
|
6
7
|
require('../ScrollGroup/index.js');
|
|
7
8
|
var context = require('./context.js');
|
|
8
9
|
var useScrollGroupItem = require('../ScrollGroup/useScrollGroupItem.js');
|
|
@@ -13,9 +14,9 @@ function _interopDefault(e) {
|
|
|
13
14
|
}
|
|
14
15
|
var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
15
16
|
"use strict";
|
|
16
|
-
|
|
17
|
+
const StickyGridBody = React.forwardRef(({
|
|
17
18
|
children
|
|
18
|
-
}) {
|
|
19
|
+
}, forwardedRef) => {
|
|
19
20
|
const {
|
|
20
21
|
templateColumns,
|
|
21
22
|
gap
|
|
@@ -25,12 +26,12 @@ function StickyGridBody({
|
|
|
25
26
|
refObject: contentRef
|
|
26
27
|
});
|
|
27
28
|
return /* @__PURE__ */jsxRuntime.jsx(StyledStickyContent, {
|
|
28
|
-
ref: contentRef,
|
|
29
|
+
ref: mergeRefs.mergeRefs(forwardedRef, contentRef),
|
|
29
30
|
$templateColumns: templateColumns,
|
|
30
31
|
$gap: gap,
|
|
31
32
|
children
|
|
32
33
|
});
|
|
33
|
-
}
|
|
34
|
+
});
|
|
34
35
|
const StyledStickyContent = styled__default["default"].div`
|
|
35
36
|
display: grid;
|
|
36
37
|
gap: ${({
|
|
@@ -48,5 +49,6 @@ const StyledStickyContent = styled__default["default"].div`
|
|
|
48
49
|
display: none;
|
|
49
50
|
}
|
|
50
51
|
`;
|
|
52
|
+
StickyGridBody.displayName = "StickyGridBody";
|
|
51
53
|
exports.StickyGridBody = StickyGridBody;
|
|
52
54
|
//# sourceMappingURL=StickyGridBody.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StickyGridBody.js","sources":["../../../../../../../src/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/StickyGrid/StickyGridBody.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { useRef } from \"react\";\nimport styled from \"styled-components\";\n\nimport { useScrollGroupItem } from \"../ScrollGroup\";\nimport { useStickyGrid } from \"./context\";\n\nexport
|
|
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;AAWrEf,cAAA,CAAemB,WAAc,GAAA,gBAAA;"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useRef } from 'react';
|
|
2
|
+
import { forwardRef, useRef } from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
+
import { mergeRefs } from '../../../helpers/mergeRefs.mjs';
|
|
4
5
|
import '../ScrollGroup/index.mjs';
|
|
5
6
|
import { useStickyGrid } from './context.mjs';
|
|
6
7
|
import { useScrollGroupItem } from '../ScrollGroup/useScrollGroupItem.mjs';
|
|
7
8
|
"use strict";
|
|
8
|
-
|
|
9
|
+
const StickyGridBody = forwardRef(({
|
|
9
10
|
children
|
|
10
|
-
}) {
|
|
11
|
+
}, forwardedRef) => {
|
|
11
12
|
const {
|
|
12
13
|
templateColumns,
|
|
13
14
|
gap
|
|
@@ -17,12 +18,12 @@ function StickyGridBody({
|
|
|
17
18
|
refObject: contentRef
|
|
18
19
|
});
|
|
19
20
|
return /* @__PURE__ */jsx(StyledStickyContent, {
|
|
20
|
-
ref: contentRef,
|
|
21
|
+
ref: mergeRefs(forwardedRef, contentRef),
|
|
21
22
|
$templateColumns: templateColumns,
|
|
22
23
|
$gap: gap,
|
|
23
24
|
children
|
|
24
25
|
});
|
|
25
|
-
}
|
|
26
|
+
});
|
|
26
27
|
const StyledStickyContent = styled.div`
|
|
27
28
|
display: grid;
|
|
28
29
|
gap: ${({
|
|
@@ -40,5 +41,6 @@ const StyledStickyContent = styled.div`
|
|
|
40
41
|
display: none;
|
|
41
42
|
}
|
|
42
43
|
`;
|
|
44
|
+
StickyGridBody.displayName = "StickyGridBody";
|
|
43
45
|
export { StickyGridBody };
|
|
44
46
|
//# sourceMappingURL=StickyGridBody.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StickyGridBody.mjs","sources":["../../../../../../../src/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/StickyGrid/StickyGridBody.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { useRef } from \"react\";\nimport styled from \"styled-components\";\n\nimport { useScrollGroupItem } from \"../ScrollGroup\";\nimport { useStickyGrid } from \"./context\";\n\nexport
|
|
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;AAWrEf,cAAA,CAAemB,WAAc,GAAA,gBAAA;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import type { StickyGridContextType } from "./context";
|
|
3
|
-
export declare function StickyGridHeader({ children, nonScrollChildren, stickOffset, onStickyStateChange, }: {
|
|
3
|
+
export declare function StickyGridHeader({ children, nonScrollChildren, stickOffset, onStickyStateChange, removePositionSticky, }: {
|
|
4
4
|
children: ReactNode;
|
|
5
5
|
nonScrollChildren?: (context: {
|
|
6
6
|
grid: StickyGridContextType;
|
|
@@ -8,4 +8,5 @@ export declare function StickyGridHeader({ children, nonScrollChildren, stickOff
|
|
|
8
8
|
}) => ReactNode;
|
|
9
9
|
stickOffset?: number;
|
|
10
10
|
onStickyStateChange?: (isStuck: boolean) => void;
|
|
11
|
+
removePositionSticky?: boolean;
|
|
11
12
|
}): JSX.Element;
|
|
@@ -17,7 +17,8 @@ function StickyGridHeader({
|
|
|
17
17
|
children,
|
|
18
18
|
nonScrollChildren,
|
|
19
19
|
stickOffset,
|
|
20
|
-
onStickyStateChange
|
|
20
|
+
onStickyStateChange,
|
|
21
|
+
removePositionSticky
|
|
21
22
|
}) {
|
|
22
23
|
const grid = context.useStickyGrid();
|
|
23
24
|
const {
|
|
@@ -70,6 +71,7 @@ function StickyGridHeader({
|
|
|
70
71
|
return /* @__PURE__ */jsxRuntime.jsxs(HeaderWrap, {
|
|
71
72
|
ref: wrapperRef,
|
|
72
73
|
$stickOffset: stickOffset,
|
|
74
|
+
$removePositionSticky: removePositionSticky,
|
|
73
75
|
children: [/* @__PURE__ */jsxRuntime.jsx(StyledStickyHeader, {
|
|
74
76
|
ref: contentRef,
|
|
75
77
|
$templateColumns: templateColumns,
|
|
@@ -83,7 +85,9 @@ function StickyGridHeader({
|
|
|
83
85
|
}
|
|
84
86
|
const HeaderWrap = styled__default["default"].div`
|
|
85
87
|
width: 100%;
|
|
86
|
-
position:
|
|
88
|
+
position: ${({
|
|
89
|
+
$removePositionSticky
|
|
90
|
+
}) => $removePositionSticky ? "unset" : "sticky"};
|
|
87
91
|
top: -${({
|
|
88
92
|
$stickOffset
|
|
89
93
|
}) => $stickOffset ?? 0}px;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StickyGridHeader.js","sources":["../../../../../../../src/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/StickyGrid/StickyGridHeader.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { useEffect, useMemo, useRef, useState } from \"react\";\nimport styled from \"styled-components\";\n\nimport { useScrollGroupItem } from \"../ScrollGroup\";\nimport type { StickyGridContextType } from \"./context\";\nimport { useStickyGrid } from \"./context\";\n\nexport function StickyGridHeader({\n children,\n nonScrollChildren,\n stickOffset,\n onStickyStateChange,\n}: {\n children: ReactNode;\n nonScrollChildren?: (context: {\n grid: StickyGridContextType;\n isStuck: boolean;\n }) => ReactNode;\n stickOffset?: number;\n onStickyStateChange?: (isStuck: boolean) => void;\n}) {\n const grid = useStickyGrid();\n const { templateColumns, gap } = grid;\n const wrapperRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n useScrollGroupItem({ refObject: contentRef });\n const [elementHeight, setElementHeight] = useState<number | null>(null);\n const [isStuck, setIsStuck] = useState(false);\n\n useEffect(() => {\n onStickyStateChange?.(isStuck);\n }, [isStuck, onStickyStateChange]);\n\n // We need this so we can update the value of element.offsetHeight, which allows StickyGridHeader to set isStuck at the correct scroll position no matter where the observer is painted on the layout\n useEffect(() => {\n const element = wrapperRef.current;\n if (!element) return;\n\n const updateHeight = () => setElementHeight(element.offsetHeight);\n\n const resizeObserver = new ResizeObserver(updateHeight);\n\n resizeObserver.observe(element);\n\n // Set initial height immediately\n updateHeight();\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [wrapperRef]);\n\n const THRESHOLD = useMemo(() => {\n if (!elementHeight || !stickOffset) return 1;\n const value = (elementHeight - stickOffset) / elementHeight;\n const INTERSECTION_RATIO_BUFFER = 1.00001; // `value` is very accurate, but is consistently lesser than entry.intersectionRatio. This constant slightly increases the value of `THRESHOLD` so that `THRESHOLD` can be greater than entry.intersectionRatio\n\n return Math.max(0, Math.min(1, value * INTERSECTION_RATIO_BUFFER)); // We need to return a value between 0 and 1\n }, [elementHeight, stickOffset]);\n\n useEffect(() => {\n if (!wrapperRef.current) {\n setIsStuck(false);\n return;\n }\n\n const observer = new IntersectionObserver(\n ([entry]) => {\n if (!entry) return;\n setIsStuck(entry.intersectionRatio < THRESHOLD);\n },\n { threshold: THRESHOLD },\n );\n\n observer.observe(wrapperRef.current);\n\n return () => {\n observer.disconnect();\n };\n }, [THRESHOLD]);\n\n return (\n <HeaderWrap
|
|
1
|
+
{"version":3,"file":"StickyGridHeader.js","sources":["../../../../../../../src/components/ModelCompareV4/CompareTable/CompareTableMarkup/components/StickyGrid/StickyGridHeader.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { useEffect, useMemo, useRef, useState } from \"react\";\nimport styled from \"styled-components\";\n\nimport { useScrollGroupItem } from \"../ScrollGroup\";\nimport type { StickyGridContextType } from \"./context\";\nimport { useStickyGrid } from \"./context\";\n\nexport function StickyGridHeader({\n children,\n nonScrollChildren,\n stickOffset,\n onStickyStateChange,\n removePositionSticky,\n}: {\n children: ReactNode;\n nonScrollChildren?: (context: {\n grid: StickyGridContextType;\n isStuck: boolean;\n }) => ReactNode;\n stickOffset?: number;\n onStickyStateChange?: (isStuck: boolean) => void;\n removePositionSticky?: boolean;\n}) {\n const grid = useStickyGrid();\n const { templateColumns, gap } = grid;\n const wrapperRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n useScrollGroupItem({ refObject: contentRef });\n const [elementHeight, setElementHeight] = useState<number | null>(null);\n const [isStuck, setIsStuck] = useState(false);\n\n useEffect(() => {\n onStickyStateChange?.(isStuck);\n }, [isStuck, onStickyStateChange]);\n\n // We need this so we can update the value of element.offsetHeight, which allows StickyGridHeader to set isStuck at the correct scroll position no matter where the observer is painted on the layout\n useEffect(() => {\n const element = wrapperRef.current;\n if (!element) return;\n\n const updateHeight = () => setElementHeight(element.offsetHeight);\n\n const resizeObserver = new ResizeObserver(updateHeight);\n\n resizeObserver.observe(element);\n\n // Set initial height immediately\n updateHeight();\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [wrapperRef]);\n\n const THRESHOLD = useMemo(() => {\n if (!elementHeight || !stickOffset) return 1;\n const value = (elementHeight - stickOffset) / elementHeight;\n const INTERSECTION_RATIO_BUFFER = 1.00001; // `value` is very accurate, but is consistently lesser than entry.intersectionRatio. This constant slightly increases the value of `THRESHOLD` so that `THRESHOLD` can be greater than entry.intersectionRatio\n\n return Math.max(0, Math.min(1, value * INTERSECTION_RATIO_BUFFER)); // We need to return a value between 0 and 1\n }, [elementHeight, stickOffset]);\n\n useEffect(() => {\n if (!wrapperRef.current) {\n setIsStuck(false);\n return;\n }\n\n const observer = new IntersectionObserver(\n ([entry]) => {\n if (!entry) return;\n setIsStuck(entry.intersectionRatio < THRESHOLD);\n },\n { threshold: THRESHOLD },\n );\n\n observer.observe(wrapperRef.current);\n\n return () => {\n observer.disconnect();\n };\n }, [THRESHOLD]);\n\n return (\n <HeaderWrap\n ref={wrapperRef}\n $stickOffset={stickOffset}\n $removePositionSticky={removePositionSticky}\n >\n <StyledStickyHeader\n ref={contentRef}\n $templateColumns={templateColumns}\n $gap={gap}\n >\n {children}\n </StyledStickyHeader>\n {nonScrollChildren?.({ grid, isStuck })}\n </HeaderWrap>\n );\n}\n\nconst HeaderWrap = styled.div<{\n $stickOffset?: number;\n $removePositionSticky?: boolean;\n}>`\n width: 100%;\n position: ${({ $removePositionSticky }) =>\n $removePositionSticky ? \"unset\" : \"sticky\"};\n top: -${({ $stickOffset }) => $stickOffset ?? 0}px;\n z-index: 2;\n transition: box-shadow 0.25s;\n`;\n\nconst StyledStickyHeader = styled.div<{\n $templateColumns: string;\n $gap?: string;\n}>`\n display: grid;\n\n gap: ${({ $gap }) => $gap ?? 0};\n grid-template-columns: ${({ $templateColumns }) => $templateColumns};\n width: 100%;\n position: sticky;\n z-index: 2;\n\n transition: box-shadow 0.25s;\n\n overflow: auto;\n overscroll-behavior-x: none;\n scrollbar-width: none;\n &::-webkit-scrollbar {\n display: none;\n }\n`;\n"],"names":["StickyGridHeader","children","nonScrollChildren","stickOffset","onStickyStateChange","removePositionSticky","grid","useStickyGrid","templateColumns","gap","wrapperRef","useRef","contentRef","useScrollGroupItem","refObject","elementHeight","setElementHeight","useState","isStuck","setIsStuck","useEffect","element","current","updateHeight","offsetHeight","resizeObserver","ResizeObserver","observe","disconnect","THRESHOLD","useMemo","value","INTERSECTION_RATIO_BUFFER","Math","max","min","observer","IntersectionObserver","entry","intersectionRatio","threshold","jsxs","HeaderWrap","ref","$stickOffset","$removePositionSticky","jsx","StyledStickyHeader","$templateColumns","$gap","styled","div"],"mappings":";;;;;;;;;;;;;;;AAQO,SAASA,gBAAiBA,CAAA;EAC/BC,QAAA;EACAC,iBAAA;EACAC,WAAA;EACAC,mBAAA;EACAC;AACF,CASG,EAAA;EACD,MA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