@ubnt/store.core 10.17.0-alpha.32 → 10.17.0-alpha.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/lib/assets/ai-360.jpg +0 -0
- package/lib/assets/ai-3602.jpg +0 -0
- package/lib/assets/ai-lpr.jpg +0 -0
- package/lib/assets/ai-lpr2.jpg +0 -0
- package/lib/assets/ai-theta-pro.jpg +0 -0
- package/lib/assets/ai-theta-pro2.jpg +0 -0
- package/lib/assets/ai-theta.jpg +0 -0
- package/lib/assets/ai-theta3.jpg +0 -0
- package/lib/assets/compact.svg +2 -2
- package/lib/assets/compact2.svg +2 -2
- package/lib/assets/door-hub-mini.jpg +0 -0
- package/lib/assets/door-hub-mini2.jpg +0 -0
- package/lib/assets/door-hub.jpg +0 -0
- package/lib/assets/door-hub2.jpg +0 -0
- package/lib/assets/floodlight.svg +2 -9
- package/lib/assets/floodlight2.svg +9 -2
- package/lib/assets/g2-reader-pro.jpg +0 -0
- package/lib/assets/g2-reader-pro2.jpg +0 -0
- package/lib/assets/g3-reader-flex.jpg +0 -0
- package/lib/assets/g3-reader-flex2.jpg +0 -0
- package/lib/assets/g3-reader-pro.jpg +0 -0
- package/lib/assets/g3-reader-pro2.jpg +0 -0
- package/lib/assets/g3-reader.jpg +0 -0
- package/lib/assets/g3-reader2.jpg +0 -0
- package/lib/assets/g3-starter-kit-pro.jpg +0 -0
- package/lib/assets/g3-starter-kit-pro2.jpg +0 -0
- package/lib/assets/g5-bullet.jpg +0 -0
- package/lib/assets/g5-bullet2.jpg +0 -0
- package/lib/assets/globe.svg +2 -9
- package/lib/assets/globe2.svg +9 -2
- package/lib/assets/pause.svg +3 -3
- package/lib/assets/pause2.svg +3 -3
- package/lib/assets/power.svg +1 -4
- package/lib/assets/power2.svg +4 -1
- package/lib/assets/ptz2.svg +2 -2
- package/lib/assets/ptz3.svg +2 -2
- package/lib/assets/rack.svg +1 -4
- package/lib/assets/rack2.svg +4 -1
- package/lib/components/Header/Header.js +1 -1
- package/lib/components/Header/Header.mjs +1 -1
- package/lib/components/Header/ProHeader/ProHeader.js +1 -1
- package/lib/components/Header/ProHeader/ProHeader.mjs +1 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.js +1 -1
- package/lib/components/MicrositeHeader/components/HeaderContent/HeaderContent.mjs +1 -1
- package/lib/components/MicrositeVideoSlideshow/MicrositeVideoSlideshow.js +1 -1
- package/lib/components/MicrositeVideoSlideshow/MicrositeVideoSlideshow.mjs +1 -1
- package/lib/components/MicrositeVideoSlideshow/assets/pause.svg.js +1 -1
- package/lib/components/MicrositeVideoSlideshow/assets/pause.svg.mjs +2 -2
- package/lib/components/ModelCompareV4/ProductList/ProductList.js +34 -3
- package/lib/components/ModelCompareV4/ProductList/ProductList.js.map +1 -1
- package/lib/components/ModelCompareV4/ProductList/ProductList.mjs +35 -4
- package/lib/components/ModelCompareV4/ProductList/ProductList.mjs.map +1 -1
- package/lib/components/ModelCompareV4/ProductList/ProductList.styles.d.ts +3 -0
- package/lib/components/ModelCompareV4/ProductList/ProductList.styles.js +19 -5
- package/lib/components/ModelCompareV4/ProductList/ProductList.styles.js.map +1 -1
- package/lib/components/ModelCompareV4/ProductList/ProductList.styles.mjs +18 -6
- package/lib/components/ModelCompareV4/ProductList/ProductList.styles.mjs.map +1 -1
- package/lib/components/ModelCompareV4/ProductList/components/ScrollButton/ScrollButton.d.ts +7 -0
- package/lib/components/ModelCompareV4/ProductList/components/ScrollButton/ScrollButton.js +58 -0
- package/lib/components/ModelCompareV4/ProductList/components/ScrollButton/ScrollButton.js.map +1 -0
- package/lib/components/ModelCompareV4/ProductList/components/ScrollButton/ScrollButton.mjs +50 -0
- package/lib/components/ModelCompareV4/ProductList/components/ScrollButton/ScrollButton.mjs.map +1 -0
- package/lib/components/ModelCompareV4/ProductList/components/ScrollButton/ScrollButton.styles.d.ts +11 -0
- package/lib/components/ModelCompareV4/ProductList/components/ScrollButton/ScrollButton.styles.js +77 -0
- package/lib/components/ModelCompareV4/ProductList/components/ScrollButton/ScrollButton.styles.js.map +1 -0
- package/lib/components/ModelCompareV4/ProductList/components/ScrollButton/ScrollButton.styles.mjs +68 -0
- package/lib/components/ModelCompareV4/ProductList/components/ScrollButton/ScrollButton.styles.mjs.map +1 -0
- package/lib/components/ModelCompareV4/ProductList/useIsAtMaxScroll.d.ts +5 -0
- package/lib/components/ModelCompareV4/ProductList/useIsAtMaxScroll.js +22 -0
- package/lib/components/ModelCompareV4/ProductList/useIsAtMaxScroll.js.map +1 -0
- package/lib/components/ModelCompareV4/ProductList/useIsAtMaxScroll.mjs +20 -0
- package/lib/components/ModelCompareV4/ProductList/useIsAtMaxScroll.mjs.map +1 -0
- package/lib/components/VideoPlayerNew/VideoPlayer.js +1 -1
- package/lib/components/VideoPlayerNew/VideoPlayer.mjs +1 -1
- package/lib/components/VideoPlayerNew/assets/pause.svg.js +1 -1
- package/lib/components/VideoPlayerNew/assets/pause.svg.mjs +2 -2
- package/lib/constants/icons/header/globe.svg.js +1 -1
- package/lib/constants/icons/header/globe.svg.mjs +2 -2
- package/lib/constants/icons/header/index.js +1 -1
- package/lib/constants/icons/header/index.mjs +1 -1
- package/lib/constants/icons/menu/floodlight.svg.js +5 -5
- package/lib/constants/icons/menu/floodlight.svg.mjs +2 -2
- package/lib/constants/icons/menu/index.js +9 -9
- package/lib/constants/icons/menu/index.mjs +3 -3
- package/lib/constants/icons/menu/power.svg.js +5 -5
- package/lib/constants/icons/menu/power.svg.mjs +2 -2
- package/lib/constants/icons/menu/rack.svg.js +5 -5
- package/lib/constants/icons/menu/rack.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Bullet/ai-lpr.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Bullet/ai-lpr.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Bullet/g5-bullet.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Bullet/g5-bullet.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/CameraSecurity/ai-theta-pro.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/CameraSecurity/ai-theta-pro.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/CameraSecurity/ai-theta.jpg.js +5 -5
- package/lib/constants/modelCompareData/assets/CameraSecurity/ai-theta.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DomeTurret/ai-360.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DomeTurret/ai-360.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/door-hub-mini.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/door-hub-mini.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/door-hub.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/door-hub.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/g2-reader-pro.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g2-reader-pro.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-reader-flex.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-reader-flex.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-reader-pro.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-reader-pro.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-reader.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-reader.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-starter-kit-pro.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/DoorAccess/g3-starter-kit-pro.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/Interior/ai-theta-pro.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/Interior/ai-theta-pro.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/compact.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/compact.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/floodlight.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/floodlight.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/globe.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/globe.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/power.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/power.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/bullet/ai-lpr.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/bullet/ai-lpr.jpg.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/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/door-access/door-hub-mini.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/door-hub-mini.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/door-hub.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/door-hub.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g2-reader-pro.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g2-reader-pro.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-reader-flex.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-reader-flex.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-reader-pro.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-reader-pro.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-reader.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-reader.jpg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-starter-kit-pro.jpg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/cameras/door-access/g3-starter-kit-pro.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/compact.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/compact.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/product-list-assets/ptz.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/product-list-assets/ptz.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/ptz.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/ptz.svg.mjs +2 -2
- package/lib/constants/modelCompareData/assets/rack.svg.js +1 -1
- package/lib/constants/modelCompareData/assets/rack.svg.mjs +2 -2
- package/lib/constants/modelCompareData/data/CameraSecurity.js +5 -5
- package/lib/constants/modelCompareData/data/CameraSecurity.mjs +3 -3
- package/lib/constants/modelCompareData/data/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-groups/cameraSecurity/Ptz.js +1 -1
- package/lib/constants/modelCompareData/data/product-groups/cameraSecurity/Ptz.mjs +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/compact.js +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/compact.mjs +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/ptz.js +1 -1
- package/lib/constants/modelCompareData/data/product-list-groups/ptz.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/ai360.js +2 -2
- package/lib/constants/modelCompareData/data/products/ai360.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/aiLpr.js +2 -2
- package/lib/constants/modelCompareData/data/products/aiLpr.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/doorHub.js +2 -2
- package/lib/constants/modelCompareData/data/products/doorHub.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/doorHubMini.js +2 -2
- package/lib/constants/modelCompareData/data/products/doorHubMini.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g2ReaderPro.js +2 -2
- package/lib/constants/modelCompareData/data/products/g2ReaderPro.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g3Reader.js +2 -2
- package/lib/constants/modelCompareData/data/products/g3Reader.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g3ReaderFlex.js +2 -2
- package/lib/constants/modelCompareData/data/products/g3ReaderFlex.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g3ReaderPro.js +2 -2
- package/lib/constants/modelCompareData/data/products/g3ReaderPro.mjs +2 -2
- package/lib/constants/modelCompareData/data/products/g3StarterKitPro.js +2 -2
- package/lib/constants/modelCompareData/data/products/g3StarterKitPro.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/theta.js +1 -1
- package/lib/constants/modelCompareData/data/products/theta.mjs +1 -1
- package/lib/constants/modelCompareData/data/products/thetaPro.js +1 -1
- package/lib/constants/modelCompareData/data/products/thetaPro.mjs +1 -1
- package/lib/constants/modelCompareData/data/properties/accessPowerMethod.js +1 -1
- package/lib/constants/modelCompareData/data/properties/accessPowerMethod.mjs +1 -1
- package/lib/constants/modelCompareData/data/properties/availability.js +1 -1
- package/lib/constants/modelCompareData/data/properties/availability.mjs +1 -1
- package/lib/constants/modelCompareData/data/properties/builtInFloodlight.js +1 -1
- package/lib/constants/modelCompareData/data/properties/builtInFloodlight.mjs +1 -1
- package/lib/constants/modelCompareData/data/properties/dcPowerOutput.js +1 -1
- package/lib/constants/modelCompareData/data/properties/dcPowerOutput.mjs +1 -1
- package/lib/constants/modelCompareData/data/properties/mounting.js +1 -1
- package/lib/constants/modelCompareData/data/properties/mounting.mjs +1 -1
- package/lib/constants/modelCompareData/data/properties/webMode.js +1 -1
- package/lib/constants/modelCompareData/data/properties/webMode.mjs +1 -1
- package/lib/contexts/MenuContext/mapping.js +3 -3
- package/lib/contexts/MenuContext/mapping.mjs +2 -2
- package/lib/contexts/MicrositeMenuContext/mapping.js +3 -3
- package/lib/contexts/MicrositeMenuContext/mapping.mjs +2 -2
- package/package.json +1 -1
|
@@ -46,7 +46,7 @@ var ScrollWrapper = require('../../ScrollWrapper/ScrollWrapper.js');
|
|
|
46
46
|
var MenuItem = require('../MenuItem/MenuItem.js');
|
|
47
47
|
var _externalAssets_g50k1DIN = require("../../../assets/search.svg");
|
|
48
48
|
var Tooltip = require('../../Tooltip/Tooltip.js');
|
|
49
|
-
var globe = require("../../../assets/
|
|
49
|
+
var globe = require("../../../assets/globe.svg");
|
|
50
50
|
var HistoryIcon = require("../../../assets/icon-history.svg");
|
|
51
51
|
var EAIcon = require("../../../assets/icon-ea.svg");
|
|
52
52
|
var _externalAssets_DtGmfNK5 = require("../../../assets/closeLarge.svg");
|
|
@@ -44,7 +44,7 @@ import { ScrollWrapper } from '../../ScrollWrapper/ScrollWrapper.mjs';
|
|
|
44
44
|
import { MenuItem } from '../MenuItem/MenuItem.mjs';
|
|
45
45
|
import _externalAssets_g50k1DIN__default from "../../../assets/search.svg";
|
|
46
46
|
import { Tooltip } from '../../Tooltip/Tooltip.mjs';
|
|
47
|
-
import globe__default from "../../../assets/
|
|
47
|
+
import globe__default from "../../../assets/globe.svg";
|
|
48
48
|
import HistoryIcon__default from "../../../assets/icon-history.svg";
|
|
49
49
|
import EAIcon__default from "../../../assets/icon-ea.svg";
|
|
50
50
|
import _externalAssets_DtGmfNK5__default from "../../../assets/closeLarge.svg";
|
|
@@ -39,7 +39,7 @@ var logoUnifi = require("../../../../assets/logoUnifi.svg");
|
|
|
39
39
|
var NavigationItem = require('./_components/NavigationItem/NavigationItem.js');
|
|
40
40
|
var DropdownMenu = require('../DropdownMenu/DropdownMenu.js');
|
|
41
41
|
var SubNavigation = require('./_components/SubNavigation/SubNavigation.js');
|
|
42
|
-
var globe = require("../../../../assets/
|
|
42
|
+
var globe = require("../../../../assets/globe.svg");
|
|
43
43
|
var accountLogo = require("../../../../assets/account.svg");
|
|
44
44
|
var MobileMenu = require('../../../Header/MobileLinksModal/MobileMenu.js');
|
|
45
45
|
var MobileModal = require('../../../MobileModal/MobileModal.js');
|
|
@@ -37,7 +37,7 @@ import logoUnifi__default from "../../../../assets/logoUnifi.svg";
|
|
|
37
37
|
import { NavigationItem } from './_components/NavigationItem/NavigationItem.mjs';
|
|
38
38
|
import { DropdownMenu } from '../DropdownMenu/DropdownMenu.mjs';
|
|
39
39
|
import { SubNavigation } from './_components/SubNavigation/SubNavigation.mjs';
|
|
40
|
-
import globe__default from "../../../../assets/
|
|
40
|
+
import globe__default from "../../../../assets/globe.svg";
|
|
41
41
|
import accountLogo__default from "../../../../assets/account.svg";
|
|
42
42
|
import { MobileLinksModal } from '../../../Header/MobileLinksModal/MobileMenu.mjs';
|
|
43
43
|
import { MobileModal } from '../../../MobileModal/MobileModal.mjs';
|
|
@@ -11,7 +11,7 @@ require('./assets/play.svg.js');
|
|
|
11
11
|
var MicrositeVideoSlideshow_styles = require('./MicrositeVideoSlideshow.styles.js');
|
|
12
12
|
var MicrositeSectionWrap = require('../MicrositeSectionWrap/MicrositeSectionWrap.js');
|
|
13
13
|
var PlayIcon = require("../../assets/play.svg");
|
|
14
|
-
var PauseIcon = require("../../assets/
|
|
14
|
+
var PauseIcon = require("../../assets/pause2.svg");
|
|
15
15
|
var ActiveIconBox = require("../../assets/active-icon-box.svg");
|
|
16
16
|
function _interopDefault(e) {
|
|
17
17
|
return e && e.__esModule ? e : {
|
|
@@ -9,7 +9,7 @@ import './assets/play.svg.mjs';
|
|
|
9
9
|
import { VideoBlock, Video, VideoControls, VideoInnerWrap, ProgressCircle, PlayIcon, PauseIcon, SlideRow, Slide, FeatureIconWrap, FeatureIconActiveBackground, FeatureIcon, FeatureTitle, MicrositeBuyButton } from './MicrositeVideoSlideshow.styles.mjs';
|
|
10
10
|
import { MicrositeSectionWrap } from '../MicrositeSectionWrap/MicrositeSectionWrap.mjs';
|
|
11
11
|
import PlayIcon__default from "../../assets/play.svg";
|
|
12
|
-
import PauseIcon__default from "../../assets/
|
|
12
|
+
import PauseIcon__default from "../../assets/pause2.svg";
|
|
13
13
|
import ActiveIconBox__default from "../../assets/active-icon-box.svg";
|
|
14
14
|
"use strict";
|
|
15
15
|
const MicrositeVideoSlideshow = ({
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "../../../assets/
|
|
2
|
-
export { default } from "../../../assets/
|
|
1
|
+
export * from "../../../assets/pause2.svg";
|
|
2
|
+
export { default } from "../../../assets/pause2.svg";
|
|
3
3
|
//# sourceMappingURL=pause.svg.mjs.map
|
|
@@ -7,7 +7,9 @@ require('./components/ButtonGroup/index.js');
|
|
|
7
7
|
var Product = require('./components/Product/Product.js');
|
|
8
8
|
var groupProducts = require('./components/ProductGroups/groupProducts.js');
|
|
9
9
|
var ProductGroups = require('./components/ProductGroups/ProductGroups.js');
|
|
10
|
+
var ScrollButton = require('./components/ScrollButton/ScrollButton.js');
|
|
10
11
|
var ProductList_styles = require('./ProductList.styles.js');
|
|
12
|
+
var useIsAtMaxScroll = require('./useIsAtMaxScroll.js');
|
|
11
13
|
var ButtonGroup = require('./components/ButtonGroup/ButtonGroup.js');
|
|
12
14
|
"use strict";
|
|
13
15
|
const ProductList = ({
|
|
@@ -112,6 +114,19 @@ const ProductList = ({
|
|
|
112
114
|
}
|
|
113
115
|
}, checkForScrollTimeout);
|
|
114
116
|
}, [containerRef, setPlayAnimation, setActiveGroup, checkForScrollTimeout]);
|
|
117
|
+
const scrollButtonHandler = ({
|
|
118
|
+
isLeftArrow
|
|
119
|
+
}) => {
|
|
120
|
+
if (containerRef.current) {
|
|
121
|
+
const currentScrollPosition = containerRef.current?.scrollLeft;
|
|
122
|
+
const scrollLength = isLeftArrow ? currentScrollPosition - ProductList_styles.PRODUCT_CARD_WIDTH - ProductList_styles.PRODUCT_LIST_GRID_GAP : currentScrollPosition + ProductList_styles.PRODUCT_CARD_WIDTH + ProductList_styles.PRODUCT_LIST_GRID_GAP;
|
|
123
|
+
containerRef.current?.scrollTo(scrollLength, 0);
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
const {
|
|
127
|
+
isMaxLeft,
|
|
128
|
+
isMaxRight
|
|
129
|
+
} = useIsAtMaxScroll.useIsAtMaxScroll(containerRef);
|
|
115
130
|
return /* @__PURE__ */jsxRuntime.jsxs(ProductList_styles.Wrapper, {
|
|
116
131
|
children: [showProductGroups && moreThanOneGroupExists && /* @__PURE__ */jsxRuntime.jsx(ButtonGroup.ButtonGroup, {
|
|
117
132
|
items: groupedGroups.map(group => group.productListGroup),
|
|
@@ -125,6 +140,7 @@ const ProductList = ({
|
|
|
125
140
|
ref: containerRef,
|
|
126
141
|
$isHovering: isHovering,
|
|
127
142
|
$moreThanOneGroupExists: moreThanOneGroupExists,
|
|
143
|
+
$isDragging: isDragging,
|
|
128
144
|
children: /* @__PURE__ */jsxRuntime.jsxs(ProductList_styles.ProductGroupProductListContainer, {
|
|
129
145
|
children: [moreThanOneGroupExists && /* @__PURE__ */jsxRuntime.jsx(ProductGroups.ProductGroups, {
|
|
130
146
|
products,
|
|
@@ -132,7 +148,7 @@ const ProductList = ({
|
|
|
132
148
|
playAnimation,
|
|
133
149
|
canPlayAniimation: hasBeenObserved || buttonHasBeenClick,
|
|
134
150
|
showProductGroups
|
|
135
|
-
}), /* @__PURE__ */jsxRuntime.
|
|
151
|
+
}), /* @__PURE__ */jsxRuntime.jsxs(ProductList_styles.ProductList, {
|
|
136
152
|
$columns: products.length,
|
|
137
153
|
$isDragging: isDragging,
|
|
138
154
|
$overflowExists: overflowExists,
|
|
@@ -140,7 +156,22 @@ const ProductList = ({
|
|
|
140
156
|
onMouseDown: event => mouseDownHandler(event),
|
|
141
157
|
onMouseUp: mouseUpHandler,
|
|
142
158
|
ref: productListRef,
|
|
143
|
-
children:
|
|
159
|
+
children: [/* @__PURE__ */jsxRuntime.jsx(ScrollButton.ScrollButton, {
|
|
160
|
+
color: "white",
|
|
161
|
+
rotationDegrees: 180,
|
|
162
|
+
isVisible: !isMaxLeft,
|
|
163
|
+
onClick: () => scrollButtonHandler({
|
|
164
|
+
isLeftArrow: true
|
|
165
|
+
})
|
|
166
|
+
}), /* @__PURE__ */jsxRuntime.jsx(ScrollButton.ScrollButton, {
|
|
167
|
+
color: "white",
|
|
168
|
+
rotationDegrees: 0,
|
|
169
|
+
isVisible: isMaxRight,
|
|
170
|
+
isRightButton: true,
|
|
171
|
+
onClick: () => scrollButtonHandler({
|
|
172
|
+
isLeftArrow: false
|
|
173
|
+
})
|
|
174
|
+
}), products.map((product, productsArrayIndex) => {
|
|
144
175
|
const groupIsActive = product.productListGroup?.id === activeGroup;
|
|
145
176
|
const productListGroup = products.filter(product2 => activeGroup === product2.productListGroup?.id);
|
|
146
177
|
const groupIndex = productListGroup.findIndex(item => item.id === product.id);
|
|
@@ -168,7 +199,7 @@ const ProductList = ({
|
|
|
168
199
|
isStaticProduct: productsArrayIndex === 0,
|
|
169
200
|
isOverviewPage
|
|
170
201
|
}, product.id);
|
|
171
|
-
})
|
|
202
|
+
})]
|
|
172
203
|
})]
|
|
173
204
|
})
|
|
174
205
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductList.js","sources":["../../../../src/components/ModelCompareV4/ProductList/ProductList.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useEffectOnce, useHoverDirty } from \"react-use\";\n\nimport type {\n ProductId,\n ProductListGroupId,\n} from \"../../../constants/modelCompareData/types\";\nimport { ButtonGroup } from \"./components/ButtonGroup\";\nimport { Product } from \"./components/Product/Product\";\nimport { groupProducts } from \"./components/ProductGroups/groupProducts\";\nimport { ProductGroups } from \"./components/ProductGroups/ProductGroups\";\nimport * as S from \"./ProductList.styles\";\nimport type { ProductListProps } from \"./ProductList.types\";\n\nexport const ProductList = ({\n products,\n selectedProducts,\n setSelectedProducts,\n hasBeenObserved,\n selectedProductsLimit,\n initialActiveGroup,\n setExternalState,\n showProductGroups,\n isOverviewPage,\n}: ProductListProps) => {\n const groupedGroups = groupProducts(products);\n const moreThanOneGroupExists = groupedGroups.length > 1;\n\n const containerRef = useRef<HTMLDivElement>(null);\n const productListRef = useRef<HTMLDivElement>(null);\n\n const [buttonHasBeenClick, setButtonHasBeenClicked] = useState(false);\n const [activeGroup, setActiveGroup] = useState(initialActiveGroup);\n const [playAnimation, setPlayAnimation] = useState(false);\n const isHovering = useHoverDirty(containerRef);\n const [isDragging, setIsDragging] = useState(false);\n const [overflowExists, setOverflowExists] = useState(true);\n const [endPosition, setEndPosition] = useState<number>(0);\n const checkForScrollTimeout = 150;\n\n useEffectOnce(() => {\n const refsExist = containerRef.current && productListRef.current;\n if (\n refsExist &&\n containerRef.current?.getBoundingClientRect().width <\n productListRef.current?.getBoundingClientRect().width\n ) {\n setOverflowExists(true);\n } else {\n setOverflowExists(false);\n }\n });\n\n // TODO: figure out how to remove this TODO. Currently, without this `useEffect` `activeGroup` isn't updating when toggling between different tables (`Section`s).\n // ModelCompareV4 is sometimes used to toggle between sets of data of type Section. In this situation, we need the initial active group to be updated when the new data is passed to ModelCompareV4\n useEffect(() => {\n setActiveGroup(products[0]?.productListGroup?.id as ProductListGroupId);\n }, [products]);\n\n // #############################################################################\n // Scroll-Specific useEffects\n // #############################################################################\n\n // if there aren't any product list group buttons then the ending state of the animations need to exist on the initial render\n useEffect(() => {\n if (!showProductGroups && hasBeenObserved) {\n setPlayAnimation(true);\n }\n }, [hasBeenObserved, setPlayAnimation, showProductGroups]);\n\n // plays animation when no scroll has occurred on the initial observe\n useEffect(() => {\n const productListInitialPosition =\n productListRef.current?.getBoundingClientRect().left;\n\n if (hasBeenObserved || buttonHasBeenClick) {\n setTimeout(() => {\n const currentPosition =\n productListRef.current?.getBoundingClientRect().left;\n if (productListInitialPosition === currentPosition) {\n return setPlayAnimation(true);\n }\n }, checkForScrollTimeout);\n }\n }, [hasBeenObserved, setPlayAnimation, buttonHasBeenClick]);\n\n // #############################################################################\n // Drag Logic\n // #############################################################################\n const dragStartingPosition = useRef(0);\n const scrollAmount = useRef(0);\n\n const dragHandler = useCallback(\n (event: MouseEvent) => {\n scrollAmount.current = dragStartingPosition.current - event.clientX;\n containerRef.current?.scrollTo(endPosition + scrollAmount.current, 0);\n },\n [endPosition],\n );\n\n const mouseUpHandler = useCallback(() => {\n setIsDragging(false);\n setEndPosition(containerRef.current?.scrollLeft as number);\n document.removeEventListener(\"mousemove\", dragHandler);\n }, [dragHandler]);\n\n const mouseDownHandler = useCallback(\n (event: React.MouseEvent<Element, MouseEvent>) => {\n if (event.buttons === 1) {\n dragStartingPosition.current = event.clientX;\n setIsDragging(true);\n document.addEventListener(\"mousemove\", dragHandler);\n document.addEventListener(\"mouseup\", mouseUpHandler);\n }\n },\n [dragHandler, mouseUpHandler],\n );\n\n useEffectOnce(() => {\n let isScrolling: NodeJS.Timeout;\n (containerRef.current as HTMLDivElement).addEventListener(\n \"scroll\",\n function () {\n window.clearTimeout(isScrolling);\n\n // if scrolling occurs, animations are played after scrolling has completed\n // if scrolling occurs, the container's end position is track in state after scrolling has completed\n isScrolling = setTimeout(function () {\n setPlayAnimation(true);\n setEndPosition(containerRef.current?.scrollLeft as number);\n }, checkForScrollTimeout);\n },\n );\n });\n\n // #############################################################################\n // Click to Scroll Logic\n // #############################################################################\n\n const tabClickHandler = useCallback(\n ({ groupId }: { groupId: ProductListGroupId }) => {\n const initialScrollPosition = (containerRef.current as HTMLDivElement)\n .scrollLeft;\n\n const checkForScroll = () => {\n const currentScrollPosition = (containerRef.current as HTMLDivElement)\n .scrollLeft;\n\n return currentScrollPosition === initialScrollPosition;\n };\n\n const element = document.getElementById(groupId) as HTMLDivElement;\n\n setPlayAnimation(false);\n setActiveGroup(groupId);\n setButtonHasBeenClicked(true);\n element?.scrollIntoView({\n behavior: \"smooth\",\n inline: \"start\",\n block: \"nearest\",\n });\n\n // if no scroll occurs animations are played\n setTimeout(() => {\n if (checkForScroll()) {\n setPlayAnimation(true);\n }\n }, checkForScrollTimeout);\n },\n [containerRef, setPlayAnimation, setActiveGroup, checkForScrollTimeout],\n );\n\n return (\n <S.Wrapper>\n {showProductGroups && moreThanOneGroupExists && (\n <ButtonGroup\n items={groupedGroups.map((group) => group.productListGroup)}\n activeButton={activeGroup as string}\n onClick={(id) => {\n tabClickHandler({ groupId: id as ProductListGroupId });\n }}\n />\n )}\n <S.Container\n ref={containerRef}\n $isHovering={isHovering}\n $moreThanOneGroupExists={moreThanOneGroupExists}\n >\n <S.ProductGroupProductListContainer>\n {moreThanOneGroupExists && (\n <ProductGroups\n products={products}\n activeGroup={activeGroup as ProductListGroupId}\n playAnimation={playAnimation}\n canPlayAniimation={hasBeenObserved || buttonHasBeenClick}\n showProductGroups={showProductGroups}\n />\n )}\n <S.ProductList\n $columns={products.length}\n $isDragging={isDragging}\n $overflowExists={overflowExists}\n $moreThanOneGroupExists={moreThanOneGroupExists}\n onMouseDown={(event) => mouseDownHandler(event)}\n onMouseUp={mouseUpHandler}\n ref={productListRef}\n >\n {products.map((product, productsArrayIndex) => {\n const groupIsActive =\n product.productListGroup?.id === activeGroup;\n\n const productListGroup = products.filter(\n (product) => activeGroup === product.productListGroup?.id,\n );\n\n const groupIndex = productListGroup.findIndex(\n (item) => item.id === product.id,\n );\n\n return (\n <Product\n onClick={() =>\n setActiveGroup(\n product.productListGroup?.id as ProductListGroupId,\n )\n }\n key={product.id}\n groupIndex={groupIndex}\n groupLength={productListGroup.length}\n id={product?.id as ProductId}\n groupId={product.productListGroup?.id as ProductListGroupId}\n image={product.image ?? { src: \"\", width: 0, height: 0 }}\n name={product.title}\n description={product.description}\n selectedProducts={selectedProducts}\n setSelectedProducts={setSelectedProducts}\n setExternalState={setExternalState}\n groupIsActive={groupIsActive}\n playAnimation={playAnimation}\n canPlayAniimation={hasBeenObserved || buttonHasBeenClick}\n selectedProductsLimit={selectedProductsLimit}\n showProductGroups={showProductGroups}\n isStaticProduct={productsArrayIndex === 0}\n isOverviewPage={isOverviewPage}\n />\n );\n })}\n </S.ProductList>\n </S.ProductGroupProductListContainer>\n </S.Container>\n </S.Wrapper>\n );\n};\n"],"names":["ProductList","products","selectedProducts","setSelectedProducts","hasBeenObserved","selectedProductsLimit","initialActiveGroup","setExternalState","showProductGroups","isOverviewPage","groupedGroups","groupProducts","moreThanOneGroupExists","length","containerRef","useRef","productListRef","buttonHasBeenClick","setButtonHasBeenClicked","useState","activeGroup","setActiveGroup","playAnimation","setPlayAnimation","isHovering","useHoverDirty","isDragging","setIsDragging","overflowExists","setOverflowExists","endPosition","setEndPosition","checkForScrollTimeout","useEffectOnce","refsExist","current","getBoundingClientRect","width","useEffect","productListGroup","id","productListInitialPosition","left","setTimeout","currentPosition","dragStartingPosition","scrollAmount","dragHandler","useCallback","event","clientX","scrollTo","mouseUpHandler","scrollLeft","document","removeEventListener","mouseDownHandler","buttons","addEventListener","isScrolling","window","clearTimeout","tabClickHandler","groupId","initialScrollPosition","checkForScroll","currentScrollPosition","element","getElementById","scrollIntoView","behavior","inline","block","jsxs","S.Wrapper","children","jsx","ButtonGroup","items","map","group","activeButton","onClick","S.Container","Container","ref","$isHovering","$moreThanOneGroupExists","S.ProductGroupProductListContainer","ProductGroups","canPlayAniimation","S.ProductList","$columns","$isDragging","$overflowExists","onMouseDown","onMouseUp","product","productsArrayIndex","groupIsActive","filter","groupIndex","findIndex","item","Product","groupLength","image","src","height","name","title","description","isStaticProduct"],"mappings":";;;;;;;;;;;;AAcO,MAAMA,cAAcA,CAAC;EAC1BC,QAAA;EACAC,gBAAA;EACAC,mBAAA;EACAC,eAAA;EACAC,qBAAA;EACAC,kBAAA;EACAC,gBAAA;EACAC,iBAAA;EACAC;AACF,CAAwB,KAAA;EAChB,MAAAC,aAAA,GAAgBC,4BAAcV,QAAQ,CAAA;EACtC,MAAAW,sBAAA,GAAyBF,cAAcG,MAAS,GAAA,CAAA;EAEhD,MAAAC,YAAA,GAAeC,aAAuB,IAAI,CAAA;EAC1C,MAAAC,cAAA,GAAiBD,aAAuB,IAAI,CAAA;EAElD,MAAM,CAACE,kBAAA,EAAoBC,uBAAuB,CAAA,GAAIC,KAAAA,CAAAA,SAAS,KAAK,CAAA;EACpE,MAAM,CAACC,WAAA,EAAaC,cAAc,CAAA,GAAIF,KAAAA,CAAAA,SAASb,kBAAkB,CAAA;EACjE,MAAM,CAACgB,aAAA,EAAeC,gBAAgB,CAAA,GAAIJ,KAAAA,CAAAA,SAAS,KAAK,CAAA;EAClD,MAAAK,UAAA,GAAaC,uBAAcX,YAAY,CAAA;EAC7C,MAAM,CAACY,UAAA,EAAYC,aAAa,CAAA,GAAIR,KAAAA,CAAAA,SAAS,KAAK,CAAA;EAClD,MAAM,CAACS,cAAA,EAAgBC,iBAAiB,CAAA,GAAIV,KAAAA,CAAAA,SAAS,IAAI,CAAA;EACzD,MAAM,CAACW,WAAA,EAAaC,cAAc,CAAA,GAAIZ,KAAAA,CAAAA,SAAiB,CAAC,CAAA;EACxD,MAAMa,qBAAwB,GAAA,GAAA;EAE9BC,QAAAA,CAAAA,aAAA,CAAc,MAAM;IACZ,MAAAC,SAAA,GAAYpB,YAAa,CAAAqB,OAAA,IAAWnB,cAAe,CAAAmB,OAAA;IAEvD,IAAAD,SAAA,IACApB,YAAa,CAAAqB,OAAA,EAASC,qBAAsB,C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,QAAQ1D,gBAAkB,EAAAC,EAAA;cACnCkE,KAAA,EAAOT,QAAQS,KAAS,IAAA;gBAAEC,KAAK,EAAI;gBAAAtE,KAAA,EAAO,CAAG;gBAAAuE,MAAA,EAAQ;cAAE,CAAA;cACvDC,MAAMZ,OAAQ,CAAAa,KAAA;cACdC,aAAad,OAAQ,CAAAc,WAAA;cACrB7G,gBAAA;cACAC,mBAAA;cACAI,gBAAA;cACA4F,aAAA;cACA7E,aAAA;cACAoE,mBAAmBtF,eAAmB,IAAAa,kBAAA;cACtCZ,qBAAA;cACAG,iBAAA;cACAwG,iBAAiBd,kBAAuB,KAAA,CAAA;cACxCzF;YAAA,CAAA,EAjBKwF,OAAQ,CAAAzD,EAkBf,CAAA;UAEH,CAAA;QAAA,CAAA,CAAA;MAEL,CAAA;IAAA,CAAA,CAAA;GAEJ,CAAA;AAEJ,CAAA;"}
|
|
1
|
+
{"version":3,"file":"ProductList.js","sources":["../../../../src/components/ModelCompareV4/ProductList/ProductList.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useEffectOnce, useHoverDirty } from \"react-use\";\n\nimport type {\n ProductId,\n ProductListGroupId,\n} from \"../../../constants/modelCompareData/types\";\nimport { ButtonGroup } from \"./components/ButtonGroup\";\nimport { Product } from \"./components/Product/Product\";\nimport { groupProducts } from \"./components/ProductGroups/groupProducts\";\nimport { ProductGroups } from \"./components/ProductGroups/ProductGroups\";\nimport { ScrollButton } from \"./components/ScrollButton/ScrollButton\";\nimport * as S from \"./ProductList.styles\";\nimport type { ProductListProps } from \"./ProductList.types\";\nimport { useIsAtMaxScroll } from \"./useIsAtMaxScroll\";\n\nexport const ProductList = ({\n products,\n selectedProducts,\n setSelectedProducts,\n hasBeenObserved,\n selectedProductsLimit,\n initialActiveGroup,\n setExternalState,\n showProductGroups,\n isOverviewPage,\n}: ProductListProps) => {\n const groupedGroups = groupProducts(products);\n const moreThanOneGroupExists = groupedGroups.length > 1;\n\n const containerRef = useRef<HTMLDivElement>(null);\n const productListRef = useRef<HTMLDivElement>(null);\n\n const [buttonHasBeenClick, setButtonHasBeenClicked] = useState(false);\n const [activeGroup, setActiveGroup] = useState(initialActiveGroup);\n const [playAnimation, setPlayAnimation] = useState(false);\n const isHovering = useHoverDirty(containerRef);\n const [isDragging, setIsDragging] = useState(false);\n const [overflowExists, setOverflowExists] = useState(true);\n const [endPosition, setEndPosition] = useState<number>(0);\n const checkForScrollTimeout = 150;\n\n useEffectOnce(() => {\n const refsExist = containerRef.current && productListRef.current;\n if (\n refsExist &&\n containerRef.current?.getBoundingClientRect().width <\n productListRef.current?.getBoundingClientRect().width\n ) {\n setOverflowExists(true);\n } else {\n setOverflowExists(false);\n }\n });\n\n // TODO: figure out how to remove this TODO. Currently, without this `useEffect` `activeGroup` isn't updating when toggling between different tables (`Section`s).\n // ModelCompareV4 is sometimes used to toggle between sets of data of type Section. In this situation, we need the initial active group to be updated when the new data is passed to ModelCompareV4\n useEffect(() => {\n setActiveGroup(products[0]?.productListGroup?.id as ProductListGroupId);\n }, [products]);\n\n // #############################################################################\n // Scroll-Specific useEffects\n // #############################################################################\n\n // if there aren't any product list group buttons then the ending state of the animations need to exist on the initial render\n useEffect(() => {\n if (!showProductGroups && hasBeenObserved) {\n setPlayAnimation(true);\n }\n }, [hasBeenObserved, setPlayAnimation, showProductGroups]);\n\n // plays animation when no scroll has occurred on the initial observe\n useEffect(() => {\n const productListInitialPosition =\n productListRef.current?.getBoundingClientRect().left;\n\n if (hasBeenObserved || buttonHasBeenClick) {\n setTimeout(() => {\n const currentPosition =\n productListRef.current?.getBoundingClientRect().left;\n if (productListInitialPosition === currentPosition) {\n return setPlayAnimation(true);\n }\n }, checkForScrollTimeout);\n }\n }, [hasBeenObserved, setPlayAnimation, buttonHasBeenClick]);\n\n // #############################################################################\n // Drag Logic\n // #############################################################################\n const dragStartingPosition = useRef(0);\n const scrollAmount = useRef(0);\n\n const dragHandler = useCallback(\n (event: MouseEvent) => {\n scrollAmount.current = dragStartingPosition.current - event.clientX;\n containerRef.current?.scrollTo(endPosition + scrollAmount.current, 0);\n },\n [endPosition],\n );\n\n const mouseUpHandler = useCallback(() => {\n setIsDragging(false);\n setEndPosition(containerRef.current?.scrollLeft as number);\n document.removeEventListener(\"mousemove\", dragHandler);\n }, [dragHandler]);\n\n const mouseDownHandler = useCallback(\n (event: React.MouseEvent<Element, MouseEvent>) => {\n if (event.buttons === 1) {\n dragStartingPosition.current = event.clientX;\n setIsDragging(true);\n document.addEventListener(\"mousemove\", dragHandler);\n document.addEventListener(\"mouseup\", mouseUpHandler);\n }\n },\n [dragHandler, mouseUpHandler],\n );\n\n useEffectOnce(() => {\n let isScrolling: NodeJS.Timeout;\n (containerRef.current as HTMLDivElement).addEventListener(\n \"scroll\",\n function () {\n window.clearTimeout(isScrolling);\n\n // if scrolling occurs, animations are played after scrolling has completed\n // if scrolling occurs, the container's end position is track in state after scrolling has completed\n isScrolling = setTimeout(function () {\n setPlayAnimation(true);\n setEndPosition(containerRef.current?.scrollLeft as number);\n }, checkForScrollTimeout);\n },\n );\n });\n\n // #############################################################################\n // Click to Scroll Logic\n // #############################################################################\n\n const tabClickHandler = useCallback(\n ({ groupId }: { groupId: ProductListGroupId }) => {\n const initialScrollPosition = (containerRef.current as HTMLDivElement)\n .scrollLeft;\n\n const checkForScroll = () => {\n const currentScrollPosition = (containerRef.current as HTMLDivElement)\n .scrollLeft;\n\n return currentScrollPosition === initialScrollPosition;\n };\n\n const element = document.getElementById(groupId) as HTMLDivElement;\n\n setPlayAnimation(false);\n setActiveGroup(groupId);\n setButtonHasBeenClicked(true);\n element?.scrollIntoView({\n behavior: \"smooth\",\n inline: \"start\",\n block: \"nearest\",\n });\n\n // if no scroll occurs animations are played\n setTimeout(() => {\n if (checkForScroll()) {\n setPlayAnimation(true);\n }\n }, checkForScrollTimeout);\n },\n [containerRef, setPlayAnimation, setActiveGroup, checkForScrollTimeout],\n );\n\n const scrollButtonHandler = ({ isLeftArrow }: { isLeftArrow?: boolean }) => {\n if (containerRef.current) {\n const currentScrollPosition = containerRef.current?.scrollLeft;\n\n const scrollLength = isLeftArrow\n ? currentScrollPosition - S.PRODUCT_CARD_WIDTH - S.PRODUCT_LIST_GRID_GAP\n : currentScrollPosition +\n S.PRODUCT_CARD_WIDTH +\n S.PRODUCT_LIST_GRID_GAP;\n\n containerRef.current?.scrollTo(scrollLength, 0);\n }\n };\n\n const { isMaxLeft, isMaxRight } = useIsAtMaxScroll(containerRef);\n\n return (\n <S.Wrapper>\n {showProductGroups && moreThanOneGroupExists && (\n <ButtonGroup\n items={groupedGroups.map((group) => group.productListGroup)}\n activeButton={activeGroup as string}\n onClick={(id) => {\n tabClickHandler({ groupId: id as ProductListGroupId });\n }}\n />\n )}\n <S.Container\n ref={containerRef}\n $isHovering={isHovering}\n $moreThanOneGroupExists={moreThanOneGroupExists}\n $isDragging={isDragging}\n >\n <S.ProductGroupProductListContainer>\n {moreThanOneGroupExists && (\n <ProductGroups\n products={products}\n activeGroup={activeGroup as ProductListGroupId}\n playAnimation={playAnimation}\n canPlayAniimation={hasBeenObserved || buttonHasBeenClick}\n showProductGroups={showProductGroups}\n />\n )}\n <S.ProductList\n $columns={products.length}\n $isDragging={isDragging}\n $overflowExists={overflowExists}\n $moreThanOneGroupExists={moreThanOneGroupExists}\n onMouseDown={(event) => mouseDownHandler(event)}\n onMouseUp={mouseUpHandler}\n ref={productListRef}\n >\n <ScrollButton\n color=\"white\"\n rotationDegrees={180}\n isVisible={!isMaxLeft}\n onClick={() => scrollButtonHandler({ isLeftArrow: true })}\n />\n <ScrollButton\n color=\"white\"\n rotationDegrees={0}\n isVisible={isMaxRight}\n isRightButton\n onClick={() => scrollButtonHandler({ isLeftArrow: false })}\n />\n {products.map((product, productsArrayIndex) => {\n const groupIsActive =\n product.productListGroup?.id === activeGroup;\n\n const productListGroup = products.filter(\n (product) => activeGroup === product.productListGroup?.id,\n );\n\n const groupIndex = productListGroup.findIndex(\n (item) => item.id === product.id,\n );\n\n return (\n <Product\n onClick={() =>\n setActiveGroup(\n product.productListGroup?.id as ProductListGroupId,\n )\n }\n key={product.id}\n groupIndex={groupIndex}\n groupLength={productListGroup.length}\n id={product?.id as ProductId}\n groupId={product.productListGroup?.id as ProductListGroupId}\n image={product.image ?? { src: \"\", width: 0, height: 0 }}\n name={product.title}\n description={product.description}\n selectedProducts={selectedProducts}\n setSelectedProducts={setSelectedProducts}\n setExternalState={setExternalState}\n groupIsActive={groupIsActive}\n playAnimation={playAnimation}\n canPlayAniimation={hasBeenObserved || buttonHasBeenClick}\n selectedProductsLimit={selectedProductsLimit}\n showProductGroups={showProductGroups}\n isStaticProduct={productsArrayIndex === 0}\n isOverviewPage={isOverviewPage}\n />\n );\n })}\n </S.ProductList>\n </S.ProductGroupProductListContainer>\n </S.Container>\n </S.Wrapper>\n );\n};\n"],"names":["ProductList","products","selectedProducts","setSelectedProducts","hasBeenObserved","selectedProductsLimit","initialActiveGroup","setExternalState","showProductGroups","isOverviewPage","groupedGroups","groupProducts","moreThanOneGroupExists","length","containerRef","useRef","productListRef","buttonHasBeenClick","setButtonHasBeenClicked","useState","activeGroup","setActiveGroup","playAnimation","setPlayAnimation","isHovering","useHoverDirty","isDragging","setIsDragging","overflowExists","setOverflowExists","endPosition","setEndPosition","checkForScrollTimeout","useEffectOnce","refsExist","current","getBoundingClientRect","width","useEffect","productListGroup","id","productListInitialPosition","left","setTimeout","currentPosition","dragStartingPosition","scrollAmount","dragHandler","useCallback","event","clientX","scrollTo","mouseUpHandler","scrollLeft","document","removeEventListener","mouseDownHandler","buttons","addEventListener","isScrolling","window","clearTimeout","tabClickHandler","groupId","initialScrollPosition","checkForScroll","currentScrollPosition","element","getElementById","scrollIntoView","behavior","inline","block","scrollButtonHandler","isLeftArrow","scrollLength","S.PRODUCT_CARD_WIDTH","PRODUCT_CARD_WIDTH","S.PRODUCT_LIST_GRID_GAP","PRODUCT_LIST_GRID_GAP","isMaxLeft","isMaxRight","useIsAtMaxScroll","jsxs","S.Wrapper","children","jsx","ButtonGroup","items","map","group","activeButton","onClick","S.Container","Container","ref","$isHovering","$moreThanOneGroupExists","$isDragging","S.ProductGroupProductListContainer","ProductGroups","canPlayAniimation","S.ProductList","$columns","$overflowExists","onMouseDown","onMouseUp","ScrollButton","color","rotationDegrees","isVisible","isRightButton","product","productsArrayIndex","groupIsActive","filter","groupIndex","findIndex","item","Product","groupLength","image","src","height","name","title","description","isStaticProduct"],"mappings":";;;;;;;;;;;;;;AAgBO,MAAMA,cAAcA,CAAC;EAC1BC,QAAA;EACAC,gBAAA;EACAC,mBAAA;EACAC,eAAA;EACAC,qBAAA;EACAC,kBAAA;EACAC,gBAAA;EACAC,iBAAA;EACAC;AACF,CAAwB,KAAA;EAChB,MAAAC,aAAA,GAAgBC,4BAAcV,QAAQ,CAAA;EACtC,MAAAW,sBAAA,GAAyBF,cAAcG,MAAS,GAAA,CAAA;EAEhD,MAAAC,YAAA,GAAeC,aAAuB,IAAI,CAAA;EAC1C,MAAAC,cAAA,GAAiBD,aAAuB,IAAI,CAAA;EAElD,MAAM,CAACE,kBAAA,EAAoBC,uBAAuB,CAAA,GAAIC,KAAAA,CAAAA,SAAS,KAAK,CAAA;EACpE,MAAM,CAACC,WAAA,EAAaC,cAAc,CAAA,GAAIF,KAAAA,CAAAA,SAASb,kBAAkB,CAAA;EACjE,MAAM,CAACgB,aAAA,EAAeC,gBAAgB,CAAA,GAAIJ,KAAAA,CAAAA,SAAS,KAAK,CAAA;EAClD,MAAAK,UAAA,GAAaC,uBAAcX,YAAY,CAAA;EAC7C,MAAM,CAACY,UAAA,EAAYC,aAAa,CAAA,GAAIR,KAAAA,CAAAA,SAAS,KAAK,CAAA;EAClD,MAAM,CAACS,cAAA,EAAgBC,iBAAiB,CAAA,GAAIV,KAAAA,CAAAA,SAAS,IAAI,CAAA;EACzD,MAAM,CAACW,WAAA,EAAaC,cAAc,CAAA,GAAIZ,KAAAA,CAAAA,SAAiB,CAAC,CAAA;EACxD,MAAMa,qB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kB,EAAAC,EAAA;cACnCiF,KAAA,EAAOT,QAAQS,KAAS,IAAA;gBAAEC,KAAK,EAAI;gBAAArF,KAAA,EAAO,CAAG;gBAAAsF,MAAA,EAAQ;cAAE,CAAA;cACvDC,MAAMZ,OAAQ,CAAAa,KAAA;cACdC,aAAad,OAAQ,CAAAc,WAAA;cACrB5H,gBAAA;cACAC,mBAAA;cACAI,gBAAA;cACA2G,aAAA;cACA5F,aAAA;cACA+E,mBAAmBjG,eAAmB,IAAAa,kBAAA;cACtCZ,qBAAA;cACAG,iBAAA;cACAuH,iBAAiBd,kBAAuB,KAAA,CAAA;cACxCxG;YAAA,CAAA,EAjBKuG,OAAQ,CAAAxE,EAkBf,CAAA;UAEH,CAAA,CAAA;QAAA,CAAA,CAAA;MAEL,CAAA;IAAA,CAAA,CAAA;GAEJ,CAAA;AAEJ,CAAA;"}
|
|
@@ -5,7 +5,9 @@ import './components/ButtonGroup/index.mjs';
|
|
|
5
5
|
import { Product } from './components/Product/Product.mjs';
|
|
6
6
|
import { groupProducts } from './components/ProductGroups/groupProducts.mjs';
|
|
7
7
|
import { ProductGroups } from './components/ProductGroups/ProductGroups.mjs';
|
|
8
|
-
import {
|
|
8
|
+
import { ScrollButton } from './components/ScrollButton/ScrollButton.mjs';
|
|
9
|
+
import { PRODUCT_CARD_WIDTH, PRODUCT_LIST_GRID_GAP, Wrapper, Container, ProductGroupProductListContainer, ProductList as ProductList$1 } from './ProductList.styles.mjs';
|
|
10
|
+
import { useIsAtMaxScroll } from './useIsAtMaxScroll.mjs';
|
|
9
11
|
import { ButtonGroup } from './components/ButtonGroup/ButtonGroup.mjs';
|
|
10
12
|
"use strict";
|
|
11
13
|
const ProductList = ({
|
|
@@ -110,6 +112,19 @@ const ProductList = ({
|
|
|
110
112
|
}
|
|
111
113
|
}, checkForScrollTimeout);
|
|
112
114
|
}, [containerRef, setPlayAnimation, setActiveGroup, checkForScrollTimeout]);
|
|
115
|
+
const scrollButtonHandler = ({
|
|
116
|
+
isLeftArrow
|
|
117
|
+
}) => {
|
|
118
|
+
if (containerRef.current) {
|
|
119
|
+
const currentScrollPosition = containerRef.current?.scrollLeft;
|
|
120
|
+
const scrollLength = isLeftArrow ? currentScrollPosition - PRODUCT_CARD_WIDTH - PRODUCT_LIST_GRID_GAP : currentScrollPosition + PRODUCT_CARD_WIDTH + PRODUCT_LIST_GRID_GAP;
|
|
121
|
+
containerRef.current?.scrollTo(scrollLength, 0);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
const {
|
|
125
|
+
isMaxLeft,
|
|
126
|
+
isMaxRight
|
|
127
|
+
} = useIsAtMaxScroll(containerRef);
|
|
113
128
|
return /* @__PURE__ */jsxs(Wrapper, {
|
|
114
129
|
children: [showProductGroups && moreThanOneGroupExists && /* @__PURE__ */jsx(ButtonGroup, {
|
|
115
130
|
items: groupedGroups.map(group => group.productListGroup),
|
|
@@ -123,6 +138,7 @@ const ProductList = ({
|
|
|
123
138
|
ref: containerRef,
|
|
124
139
|
$isHovering: isHovering,
|
|
125
140
|
$moreThanOneGroupExists: moreThanOneGroupExists,
|
|
141
|
+
$isDragging: isDragging,
|
|
126
142
|
children: /* @__PURE__ */jsxs(ProductGroupProductListContainer, {
|
|
127
143
|
children: [moreThanOneGroupExists && /* @__PURE__ */jsx(ProductGroups, {
|
|
128
144
|
products,
|
|
@@ -130,7 +146,7 @@ const ProductList = ({
|
|
|
130
146
|
playAnimation,
|
|
131
147
|
canPlayAniimation: hasBeenObserved || buttonHasBeenClick,
|
|
132
148
|
showProductGroups
|
|
133
|
-
}), /* @__PURE__ */
|
|
149
|
+
}), /* @__PURE__ */jsxs(ProductList$1, {
|
|
134
150
|
$columns: products.length,
|
|
135
151
|
$isDragging: isDragging,
|
|
136
152
|
$overflowExists: overflowExists,
|
|
@@ -138,7 +154,22 @@ const ProductList = ({
|
|
|
138
154
|
onMouseDown: event => mouseDownHandler(event),
|
|
139
155
|
onMouseUp: mouseUpHandler,
|
|
140
156
|
ref: productListRef,
|
|
141
|
-
children:
|
|
157
|
+
children: [/* @__PURE__ */jsx(ScrollButton, {
|
|
158
|
+
color: "white",
|
|
159
|
+
rotationDegrees: 180,
|
|
160
|
+
isVisible: !isMaxLeft,
|
|
161
|
+
onClick: () => scrollButtonHandler({
|
|
162
|
+
isLeftArrow: true
|
|
163
|
+
})
|
|
164
|
+
}), /* @__PURE__ */jsx(ScrollButton, {
|
|
165
|
+
color: "white",
|
|
166
|
+
rotationDegrees: 0,
|
|
167
|
+
isVisible: isMaxRight,
|
|
168
|
+
isRightButton: true,
|
|
169
|
+
onClick: () => scrollButtonHandler({
|
|
170
|
+
isLeftArrow: false
|
|
171
|
+
})
|
|
172
|
+
}), products.map((product, productsArrayIndex) => {
|
|
142
173
|
const groupIsActive = product.productListGroup?.id === activeGroup;
|
|
143
174
|
const productListGroup = products.filter(product2 => activeGroup === product2.productListGroup?.id);
|
|
144
175
|
const groupIndex = productListGroup.findIndex(item => item.id === product.id);
|
|
@@ -166,7 +197,7 @@ const ProductList = ({
|
|
|
166
197
|
isStaticProduct: productsArrayIndex === 0,
|
|
167
198
|
isOverviewPage
|
|
168
199
|
}, product.id);
|
|
169
|
-
})
|
|
200
|
+
})]
|
|
170
201
|
})]
|
|
171
202
|
})
|
|
172
203
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductList.mjs","sources":["../../../../src/components/ModelCompareV4/ProductList/ProductList.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useEffectOnce, useHoverDirty } from \"react-use\";\n\nimport type {\n ProductId,\n ProductListGroupId,\n} from \"../../../constants/modelCompareData/types\";\nimport { ButtonGroup } from \"./components/ButtonGroup\";\nimport { Product } from \"./components/Product/Product\";\nimport { groupProducts } from \"./components/ProductGroups/groupProducts\";\nimport { ProductGroups } from \"./components/ProductGroups/ProductGroups\";\nimport * as S from \"./ProductList.styles\";\nimport type { ProductListProps } from \"./ProductList.types\";\n\nexport const ProductList = ({\n products,\n selectedProducts,\n setSelectedProducts,\n hasBeenObserved,\n selectedProductsLimit,\n initialActiveGroup,\n setExternalState,\n showProductGroups,\n isOverviewPage,\n}: ProductListProps) => {\n const groupedGroups = groupProducts(products);\n const moreThanOneGroupExists = groupedGroups.length > 1;\n\n const containerRef = useRef<HTMLDivElement>(null);\n const productListRef = useRef<HTMLDivElement>(null);\n\n const [buttonHasBeenClick, setButtonHasBeenClicked] = useState(false);\n const [activeGroup, setActiveGroup] = useState(initialActiveGroup);\n const [playAnimation, setPlayAnimation] = useState(false);\n const isHovering = useHoverDirty(containerRef);\n const [isDragging, setIsDragging] = useState(false);\n const [overflowExists, setOverflowExists] = useState(true);\n const [endPosition, setEndPosition] = useState<number>(0);\n const checkForScrollTimeout = 150;\n\n useEffectOnce(() => {\n const refsExist = containerRef.current && productListRef.current;\n if (\n refsExist &&\n containerRef.current?.getBoundingClientRect().width <\n productListRef.current?.getBoundingClientRect().width\n ) {\n setOverflowExists(true);\n } else {\n setOverflowExists(false);\n }\n });\n\n // TODO: figure out how to remove this TODO. Currently, without this `useEffect` `activeGroup` isn't updating when toggling between different tables (`Section`s).\n // ModelCompareV4 is sometimes used to toggle between sets of data of type Section. In this situation, we need the initial active group to be updated when the new data is passed to ModelCompareV4\n useEffect(() => {\n setActiveGroup(products[0]?.productListGroup?.id as ProductListGroupId);\n }, [products]);\n\n // #############################################################################\n // Scroll-Specific useEffects\n // #############################################################################\n\n // if there aren't any product list group buttons then the ending state of the animations need to exist on the initial render\n useEffect(() => {\n if (!showProductGroups && hasBeenObserved) {\n setPlayAnimation(true);\n }\n }, [hasBeenObserved, setPlayAnimation, showProductGroups]);\n\n // plays animation when no scroll has occurred on the initial observe\n useEffect(() => {\n const productListInitialPosition =\n productListRef.current?.getBoundingClientRect().left;\n\n if (hasBeenObserved || buttonHasBeenClick) {\n setTimeout(() => {\n const currentPosition =\n productListRef.current?.getBoundingClientRect().left;\n if (productListInitialPosition === currentPosition) {\n return setPlayAnimation(true);\n }\n }, checkForScrollTimeout);\n }\n }, [hasBeenObserved, setPlayAnimation, buttonHasBeenClick]);\n\n // #############################################################################\n // Drag Logic\n // #############################################################################\n const dragStartingPosition = useRef(0);\n const scrollAmount = useRef(0);\n\n const dragHandler = useCallback(\n (event: MouseEvent) => {\n scrollAmount.current = dragStartingPosition.current - event.clientX;\n containerRef.current?.scrollTo(endPosition + scrollAmount.current, 0);\n },\n [endPosition],\n );\n\n const mouseUpHandler = useCallback(() => {\n setIsDragging(false);\n setEndPosition(containerRef.current?.scrollLeft as number);\n document.removeEventListener(\"mousemove\", dragHandler);\n }, [dragHandler]);\n\n const mouseDownHandler = useCallback(\n (event: React.MouseEvent<Element, MouseEvent>) => {\n if (event.buttons === 1) {\n dragStartingPosition.current = event.clientX;\n setIsDragging(true);\n document.addEventListener(\"mousemove\", dragHandler);\n document.addEventListener(\"mouseup\", mouseUpHandler);\n }\n },\n [dragHandler, mouseUpHandler],\n );\n\n useEffectOnce(() => {\n let isScrolling: NodeJS.Timeout;\n (containerRef.current as HTMLDivElement).addEventListener(\n \"scroll\",\n function () {\n window.clearTimeout(isScrolling);\n\n // if scrolling occurs, animations are played after scrolling has completed\n // if scrolling occurs, the container's end position is track in state after scrolling has completed\n isScrolling = setTimeout(function () {\n setPlayAnimation(true);\n setEndPosition(containerRef.current?.scrollLeft as number);\n }, checkForScrollTimeout);\n },\n );\n });\n\n // #############################################################################\n // Click to Scroll Logic\n // #############################################################################\n\n const tabClickHandler = useCallback(\n ({ groupId }: { groupId: ProductListGroupId }) => {\n const initialScrollPosition = (containerRef.current as HTMLDivElement)\n .scrollLeft;\n\n const checkForScroll = () => {\n const currentScrollPosition = (containerRef.current as HTMLDivElement)\n .scrollLeft;\n\n return currentScrollPosition === initialScrollPosition;\n };\n\n const element = document.getElementById(groupId) as HTMLDivElement;\n\n setPlayAnimation(false);\n setActiveGroup(groupId);\n setButtonHasBeenClicked(true);\n element?.scrollIntoView({\n behavior: \"smooth\",\n inline: \"start\",\n block: \"nearest\",\n });\n\n // if no scroll occurs animations are played\n setTimeout(() => {\n if (checkForScroll()) {\n setPlayAnimation(true);\n }\n }, checkForScrollTimeout);\n },\n [containerRef, setPlayAnimation, setActiveGroup, checkForScrollTimeout],\n );\n\n return (\n <S.Wrapper>\n {showProductGroups && moreThanOneGroupExists && (\n <ButtonGroup\n items={groupedGroups.map((group) => group.productListGroup)}\n activeButton={activeGroup as string}\n onClick={(id) => {\n tabClickHandler({ groupId: id as ProductListGroupId });\n }}\n />\n )}\n <S.Container\n ref={containerRef}\n $isHovering={isHovering}\n $moreThanOneGroupExists={moreThanOneGroupExists}\n >\n <S.ProductGroupProductListContainer>\n {moreThanOneGroupExists && (\n <ProductGroups\n products={products}\n activeGroup={activeGroup as ProductListGroupId}\n playAnimation={playAnimation}\n canPlayAniimation={hasBeenObserved || buttonHasBeenClick}\n showProductGroups={showProductGroups}\n />\n )}\n <S.ProductList\n $columns={products.length}\n $isDragging={isDragging}\n $overflowExists={overflowExists}\n $moreThanOneGroupExists={moreThanOneGroupExists}\n onMouseDown={(event) => mouseDownHandler(event)}\n onMouseUp={mouseUpHandler}\n ref={productListRef}\n >\n {products.map((product, productsArrayIndex) => {\n const groupIsActive =\n product.productListGroup?.id === activeGroup;\n\n const productListGroup = products.filter(\n (product) => activeGroup === product.productListGroup?.id,\n );\n\n const groupIndex = productListGroup.findIndex(\n (item) => item.id === product.id,\n );\n\n return (\n <Product\n onClick={() =>\n setActiveGroup(\n product.productListGroup?.id as ProductListGroupId,\n )\n }\n key={product.id}\n groupIndex={groupIndex}\n groupLength={productListGroup.length}\n id={product?.id as ProductId}\n groupId={product.productListGroup?.id as ProductListGroupId}\n image={product.image ?? { src: \"\", width: 0, height: 0 }}\n name={product.title}\n description={product.description}\n selectedProducts={selectedProducts}\n setSelectedProducts={setSelectedProducts}\n setExternalState={setExternalState}\n groupIsActive={groupIsActive}\n playAnimation={playAnimation}\n canPlayAniimation={hasBeenObserved || buttonHasBeenClick}\n selectedProductsLimit={selectedProductsLimit}\n showProductGroups={showProductGroups}\n isStaticProduct={productsArrayIndex === 0}\n isOverviewPage={isOverviewPage}\n />\n );\n })}\n </S.ProductList>\n </S.ProductGroupProductListContainer>\n </S.Container>\n </S.Wrapper>\n );\n};\n"],"names":["ProductList","products","selectedProducts","setSelectedProducts","hasBeenObserved","selectedProductsLimit","initialActiveGroup","setExternalState","showProductGroups","isOverviewPage","groupedGroups","groupProducts","moreThanOneGroupExists","length","containerRef","useRef","productListRef","buttonHasBeenClick","setButtonHasBeenClicked","useState","activeGroup","setActiveGroup","playAnimation","setPlayAnimation","isHovering","useHoverDirty","isDragging","setIsDragging","overflowExists","setOverflowExists","endPosition","setEndPosition","checkForScrollTimeout","useEffectOnce","refsExist","current","getBoundingClientRect","width","useEffect","productListGroup","id","productListInitialPosition","left","setTimeout","currentPosition","dragStartingPosition","scrollAmount","dragHandler","useCallback","event","clientX","scrollTo","mouseUpHandler","scrollLeft","document","removeEventListener","mouseDownHandler","buttons","addEventListener","isScrolling","window","clearTimeout","tabClickHandler","groupId","initialScrollPosition","checkForScroll","currentScrollPosition","element","getElementById","scrollIntoView","behavior","inline","block","jsxs","S.Wrapper","children","jsx","ButtonGroup","items","map","group","activeButton","onClick","S.Container","ref","$isHovering","$moreThanOneGroupExists","S.ProductGroupProductListContainer","ProductGroups","canPlayAniimation","S.ProductList","$columns","$isDragging","$overflowExists","onMouseDown","onMouseUp","product","productsArrayIndex","groupIsActive","filter","groupIndex","findIndex","item","Product","groupLength","image","src","height","name","title","description","isStaticProduct"],"mappings":";;;;;;;;;;AAcO,MAAMA,cAAcA,CAAC;EAC1BC,QAAA;EACAC,gBAAA;EACAC,mBAAA;EACAC,eAAA;EACAC,qBAAA;EACAC,kBAAA;EACAC,gBAAA;EACAC,iBAAA;EACAC;AACF,CAAwB,KAAA;EAChB,MAAAC,aAAA,GAAgBC,cAAcV,QAAQ,CAAA;EACtC,MAAAW,sBAAA,GAAyBF,cAAcG,MAAS,GAAA,CAAA;EAE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AApB,WAAA;YAEnC,MAAMmB,mBAAmBtC,QAAS,CAAAkG,MAAA,CAC/BH,QAAAA,IAAY5E,WAAgB4E,KAAAA,QAAAA,CAAQzD,gBAAkB,EAAAC,EACzD,CAAA;YAEA,MAAM4D,aAAa7D,gBAAiB,CAAA8D,SAAA,CACjCC,IAAA,IAASA,IAAK,CAAA9D,EAAA,KAAOwD,OAAQ,CAAAxD,EAChC,CAAA;YAGE,sBAAAoC,GAAA,CAAC2B,OAAA,EAAA;cACCrB,SAASA,CAAA,KACP7D,cAAA,CACE2E,QAAQzD,gBAAkB,EAAAC,EAC5B,CAAA;cAGF4D,UAAA;cACAI,aAAajE,gBAAiB,CAAA1B,MAAA;cAC9B2B,IAAIwD,OAAS,EAAAxD,EAAA;cACbuB,OAAA,EAASiC,QAAQzD,gBAAkB,EAAAC,EAAA;cACnCiE,KAAA,EAAOT,QAAQS,KAAS,IAAA;gBAAEC,KAAK,EAAI;gBAAArE,KAAA,EAAO,CAAG;gBAAAsE,MAAA,EAAQ;cAAE,CAAA;cACvDC,MAAMZ,OAAQ,CAAAa,KAAA;cACdC,aAAad,OAAQ,CAAAc,WAAA;cACrB5G,gBAAA;cACAC,mBAAA;cACAI,gBAAA;cACA2F,aAAA;cACA5E,aAAA;cACAmE,mBAAmBrF,eAAmB,IAAAa,kBAAA;cACtCZ,qBAAA;cACAG,iBAAA;cACAuG,iBAAiBd,kBAAuB,KAAA,CAAA;cACxCxF;YAAA,CAAA,EAjBKuF,OAAQ,CAAAxD,EAkBf,CAAA;UAEH,CAAA;QAAA,CAAA,CAAA;MAEL,CAAA;IAAA,CAAA,CAAA;GAEJ,CAAA;AAEJ,CAAA;"}
|
|
1
|
+
{"version":3,"file":"ProductList.mjs","sources":["../../../../src/components/ModelCompareV4/ProductList/ProductList.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useEffectOnce, useHoverDirty } from \"react-use\";\n\nimport type {\n ProductId,\n ProductListGroupId,\n} from \"../../../constants/modelCompareData/types\";\nimport { ButtonGroup } from \"./components/ButtonGroup\";\nimport { Product } from \"./components/Product/Product\";\nimport { groupProducts } from \"./components/ProductGroups/groupProducts\";\nimport { ProductGroups } from \"./components/ProductGroups/ProductGroups\";\nimport { ScrollButton } from \"./components/ScrollButton/ScrollButton\";\nimport * as S from \"./ProductList.styles\";\nimport type { ProductListProps } from \"./ProductList.types\";\nimport { useIsAtMaxScroll } from \"./useIsAtMaxScroll\";\n\nexport const ProductList = ({\n products,\n selectedProducts,\n setSelectedProducts,\n hasBeenObserved,\n selectedProductsLimit,\n initialActiveGroup,\n setExternalState,\n showProductGroups,\n isOverviewPage,\n}: ProductListProps) => {\n const groupedGroups = groupProducts(products);\n const moreThanOneGroupExists = groupedGroups.length > 1;\n\n const containerRef = useRef<HTMLDivElement>(null);\n const productListRef = useRef<HTMLDivElement>(null);\n\n const [buttonHasBeenClick, setButtonHasBeenClicked] = useState(false);\n const [activeGroup, setActiveGroup] = useState(initialActiveGroup);\n const [playAnimation, setPlayAnimation] = useState(false);\n const isHovering = useHoverDirty(containerRef);\n const [isDragging, setIsDragging] = useState(false);\n const [overflowExists, setOverflowExists] = useState(true);\n const [endPosition, setEndPosition] = useState<number>(0);\n const checkForScrollTimeout = 150;\n\n useEffectOnce(() => {\n const refsExist = containerRef.current && productListRef.current;\n if (\n refsExist &&\n containerRef.current?.getBoundingClientRect().width <\n productListRef.current?.getBoundingClientRect().width\n ) {\n setOverflowExists(true);\n } else {\n setOverflowExists(false);\n }\n });\n\n // TODO: figure out how to remove this TODO. Currently, without this `useEffect` `activeGroup` isn't updating when toggling between different tables (`Section`s).\n // ModelCompareV4 is sometimes used to toggle between sets of data of type Section. In this situation, we need the initial active group to be updated when the new data is passed to ModelCompareV4\n useEffect(() => {\n setActiveGroup(products[0]?.productListGroup?.id as ProductListGroupId);\n }, [products]);\n\n // #############################################################################\n // Scroll-Specific useEffects\n // #############################################################################\n\n // if there aren't any product list group buttons then the ending state of the animations need to exist on the initial render\n useEffect(() => {\n if (!showProductGroups && hasBeenObserved) {\n setPlayAnimation(true);\n }\n }, [hasBeenObserved, setPlayAnimation, showProductGroups]);\n\n // plays animation when no scroll has occurred on the initial observe\n useEffect(() => {\n const productListInitialPosition =\n productListRef.current?.getBoundingClientRect().left;\n\n if (hasBeenObserved || buttonHasBeenClick) {\n setTimeout(() => {\n const currentPosition =\n productListRef.current?.getBoundingClientRect().left;\n if (productListInitialPosition === currentPosition) {\n return setPlayAnimation(true);\n }\n }, checkForScrollTimeout);\n }\n }, [hasBeenObserved, setPlayAnimation, buttonHasBeenClick]);\n\n // #############################################################################\n // Drag Logic\n // #############################################################################\n const dragStartingPosition = useRef(0);\n const scrollAmount = useRef(0);\n\n const dragHandler = useCallback(\n (event: MouseEvent) => {\n scrollAmount.current = dragStartingPosition.current - event.clientX;\n containerRef.current?.scrollTo(endPosition + scrollAmount.current, 0);\n },\n [endPosition],\n );\n\n const mouseUpHandler = useCallback(() => {\n setIsDragging(false);\n setEndPosition(containerRef.current?.scrollLeft as number);\n document.removeEventListener(\"mousemove\", dragHandler);\n }, [dragHandler]);\n\n const mouseDownHandler = useCallback(\n (event: React.MouseEvent<Element, MouseEvent>) => {\n if (event.buttons === 1) {\n dragStartingPosition.current = event.clientX;\n setIsDragging(true);\n document.addEventListener(\"mousemove\", dragHandler);\n document.addEventListener(\"mouseup\", mouseUpHandler);\n }\n },\n [dragHandler, mouseUpHandler],\n );\n\n useEffectOnce(() => {\n let isScrolling: NodeJS.Timeout;\n (containerRef.current as HTMLDivElement).addEventListener(\n \"scroll\",\n function () {\n window.clearTimeout(isScrolling);\n\n // if scrolling occurs, animations are played after scrolling has completed\n // if scrolling occurs, the container's end position is track in state after scrolling has completed\n isScrolling = setTimeout(function () {\n setPlayAnimation(true);\n setEndPosition(containerRef.current?.scrollLeft as number);\n }, checkForScrollTimeout);\n },\n );\n });\n\n // #############################################################################\n // Click to Scroll Logic\n // #############################################################################\n\n const tabClickHandler = useCallback(\n ({ groupId }: { groupId: ProductListGroupId }) => {\n const initialScrollPosition = (containerRef.current as HTMLDivElement)\n .scrollLeft;\n\n const checkForScroll = () => {\n const currentScrollPosition = (containerRef.current as HTMLDivElement)\n .scrollLeft;\n\n return currentScrollPosition === initialScrollPosition;\n };\n\n const element = document.getElementById(groupId) as HTMLDivElement;\n\n setPlayAnimation(false);\n setActiveGroup(groupId);\n setButtonHasBeenClicked(true);\n element?.scrollIntoView({\n behavior: \"smooth\",\n inline: \"start\",\n block: \"nearest\",\n });\n\n // if no scroll occurs animations are played\n setTimeout(() => {\n if (checkForScroll()) {\n setPlayAnimation(true);\n }\n }, checkForScrollTimeout);\n },\n [containerRef, setPlayAnimation, setActiveGroup, checkForScrollTimeout],\n );\n\n const scrollButtonHandler = ({ isLeftArrow }: { isLeftArrow?: boolean }) => {\n if (containerRef.current) {\n const currentScrollPosition = containerRef.current?.scrollLeft;\n\n const scrollLength = isLeftArrow\n ? currentScrollPosition - S.PRODUCT_CARD_WIDTH - S.PRODUCT_LIST_GRID_GAP\n : currentScrollPosition +\n S.PRODUCT_CARD_WIDTH +\n S.PRODUCT_LIST_GRID_GAP;\n\n containerRef.current?.scrollTo(scrollLength, 0);\n }\n };\n\n const { isMaxLeft, isMaxRight } = useIsAtMaxScroll(containerRef);\n\n return (\n <S.Wrapper>\n {showProductGroups && moreThanOneGroupExists && (\n <ButtonGroup\n items={groupedGroups.map((group) => group.productListGroup)}\n activeButton={activeGroup as string}\n onClick={(id) => {\n tabClickHandler({ groupId: id as ProductListGroupId });\n }}\n />\n )}\n <S.Container\n ref={containerRef}\n $isHovering={isHovering}\n $moreThanOneGroupExists={moreThanOneGroupExists}\n $isDragging={isDragging}\n >\n <S.ProductGroupProductListContainer>\n {moreThanOneGroupExists && (\n <ProductGroups\n products={products}\n activeGroup={activeGroup as ProductListGroupId}\n playAnimation={playAnimation}\n canPlayAniimation={hasBeenObserved || buttonHasBeenClick}\n showProductGroups={showProductGroups}\n />\n )}\n <S.ProductList\n $columns={products.length}\n $isDragging={isDragging}\n $overflowExists={overflowExists}\n $moreThanOneGroupExists={moreThanOneGroupExists}\n onMouseDown={(event) => mouseDownHandler(event)}\n onMouseUp={mouseUpHandler}\n ref={productListRef}\n >\n <ScrollButton\n color=\"white\"\n rotationDegrees={180}\n isVisible={!isMaxLeft}\n onClick={() => scrollButtonHandler({ isLeftArrow: true })}\n />\n <ScrollButton\n color=\"white\"\n rotationDegrees={0}\n isVisible={isMaxRight}\n isRightButton\n onClick={() => scrollButtonHandler({ isLeftArrow: false })}\n />\n {products.map((product, productsArrayIndex) => {\n const groupIsActive =\n product.productListGroup?.id === activeGroup;\n\n const productListGroup = products.filter(\n (product) => activeGroup === product.productListGroup?.id,\n );\n\n const groupIndex = productListGroup.findIndex(\n (item) => item.id === product.id,\n );\n\n return (\n <Product\n onClick={() =>\n setActiveGroup(\n product.productListGroup?.id as ProductListGroupId,\n )\n }\n key={product.id}\n groupIndex={groupIndex}\n groupLength={productListGroup.length}\n id={product?.id as ProductId}\n groupId={product.productListGroup?.id as ProductListGroupId}\n image={product.image ?? { src: \"\", width: 0, height: 0 }}\n name={product.title}\n description={product.description}\n selectedProducts={selectedProducts}\n setSelectedProducts={setSelectedProducts}\n setExternalState={setExternalState}\n groupIsActive={groupIsActive}\n playAnimation={playAnimation}\n canPlayAniimation={hasBeenObserved || buttonHasBeenClick}\n selectedProductsLimit={selectedProductsLimit}\n showProductGroups={showProductGroups}\n isStaticProduct={productsArrayIndex === 0}\n isOverviewPage={isOverviewPage}\n />\n );\n })}\n </S.ProductList>\n </S.ProductGroupProductListContainer>\n </S.Container>\n </S.Wrapper>\n );\n};\n"],"names":["ProductList","products","selectedProducts","setSelectedProducts","hasBeenObserved","selectedProductsLimit","initialActiveGroup","setExternalState","showProductGroups","isOverviewPage","groupedGroups","groupProducts","moreThanOneGroupExists","length","containerRef","useRef","productListRef","buttonHasBeenClick","setButtonHasBeenClicked","useState","activeGroup","setActiveGroup","playAnimation","setPlayAnimation","isHovering","useHoverDirty","isDragging","setIsDragging","overflowExists","setOverflowExists","endPosition","setEndPosition","checkForScrollTimeout","useEffectOnce","refsExist","current","getBoundingClientRect","width","useEffect","productListGroup","id","productListInitialPosition","left","setTimeout","currentPosition","dragStartingPosition","scrollAmount","dragHandler","useCallback","event","clientX","scrollTo","mouseUpHandler","scrollLeft","document","removeEventListener","mouseDownHandler","buttons","addEventListener","isScrolling","window","clearTimeout","tabClickHandler","groupId","initialScrollPosition","checkForScroll","currentScrollPosition","element","getElementById","scrollIntoView","behavior","inline","block","scrollButtonHandler","isLeftArrow","scrollLength","S.PRODUCT_CARD_WIDTH","S.PRODUCT_LIST_GRID_GAP","isMaxLeft","isMaxRight","useIsAtMaxScroll","jsxs","S.Wrapper","children","jsx","ButtonGroup","items","map","group","activeButton","onClick","S.Container","ref","$isHovering","$moreThanOneGroupExists","$isDragging","S.ProductGroupProductListContainer","ProductGroups","canPlayAniimation","S.ProductList","$columns","$overflowExists","onMouseDown","onMouseUp","ScrollButton","color","rotationDegrees","isVisible","isRightButton","product","productsArrayIndex","groupIsActive","filter","groupIndex","findIndex","item","Product","groupLength","image","src","height","name","title","description","isStaticProduct"],"mappings":";;;;;;;;;;;;AAgBO,MAAMA,cAAcA,CAAC;EAC1BC,QAAA;EACAC,gBAAA;EACAC,mBAAA;EACAC,eAAA;EACAC,qBAAA;EACAC,kBAAA;EACAC,gBAAA;EACAC,iBAAA;EACAC;AACF,CAAwB,KAAA;EAChB,MAAAC,aAAA,GAAgBC,cAAcV,QAAQ,CAAA;EACtC,MAAAW,sBAAA,GAAyBF,cAAcG,MAAS,GAAA,CAAA;EAEhD,MAAAC,YAAA,GAAeC,OAAuB,IAAI,CAAA;EAC1C,MAAAC,cAAA,GAAiBD,OAAuB,IAAI,CAAA;EAElD,MAAM,CAACE,kBAAA,EAAoBC,uBAAuB,CAAA,GAAIC,SAAS,KAAK,CAAA;EACpE,MAAM,CAACC,WAAA,EAAaC,cAAc,CAAA,GAAIF,SAASb,kBAAkB,C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AAEC,KAAK,EAAI;gBAAAlF,KAAA,EAAO,CAAG;gBAAAmF,MAAA,EAAQ;cAAE,CAAA;cACvDC,MAAMZ,OAAQ,CAAAa,KAAA;cACdC,aAAad,OAAQ,CAAAc,WAAA;cACrBzH,gBAAA;cACAC,mBAAA;cACAI,gBAAA;cACAwG,aAAA;cACAzF,aAAA;cACA4E,mBAAmB9F,eAAmB,IAAAa,kBAAA;cACtCZ,qBAAA;cACAG,iBAAA;cACAoH,iBAAiBd,kBAAuB,KAAA,CAAA;cACxCrG;YAAA,CAAA,EAjBKoG,OAAQ,CAAArE,EAkBf,CAAA;UAEH,CAAA,CAAA;QAAA,CAAA,CAAA;MAEL,CAAA;IAAA,CAAA,CAAA;GAEJ,CAAA;AAEJ,CAAA;"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
export declare const PRODUCT_CARD_WIDTH = 205;
|
|
2
|
+
export declare const PRODUCT_LIST_GRID_GAP = 10;
|
|
1
3
|
export declare const Wrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
2
4
|
export declare const Container: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
3
5
|
$isHovering: boolean;
|
|
4
6
|
$moreThanOneGroupExists: boolean;
|
|
7
|
+
$isDragging: boolean;
|
|
5
8
|
}>> & string;
|
|
6
9
|
export declare const ProductGroupProductListContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
7
10
|
export declare const ProductGroups: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
@@ -14,6 +14,8 @@ var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
|
14
14
|
"use strict";
|
|
15
15
|
const scrollBarHeight = 16;
|
|
16
16
|
const PRODUCT_CLICKABLE_AREA_Z_INDEX = 1;
|
|
17
|
+
const PRODUCT_CARD_WIDTH = 205;
|
|
18
|
+
const PRODUCT_LIST_GRID_GAP = 10;
|
|
17
19
|
const productCardAnimation = styled.keyframes`
|
|
18
20
|
50% {
|
|
19
21
|
transform: scale(1.025);
|
|
@@ -56,6 +58,10 @@ const Wrapper = styled__default["default"].div`
|
|
|
56
58
|
const Container = styled__default["default"].div`
|
|
57
59
|
overflow-x: auto;
|
|
58
60
|
padding-bottom: 30px;
|
|
61
|
+
scroll-behavior: smooth;
|
|
62
|
+
scroll-behavior: ${({
|
|
63
|
+
$isDragging
|
|
64
|
+
}) => $isDragging ? "unset" : "smooth"};
|
|
59
65
|
|
|
60
66
|
${({
|
|
61
67
|
$moreThanOneGroupExists
|
|
@@ -120,9 +126,12 @@ const ProductGroups = styled__default["default"].div`
|
|
|
120
126
|
min-width: 100%;
|
|
121
127
|
display: grid;
|
|
122
128
|
gap: 0 10px;
|
|
123
|
-
grid-template-columns: repeat(
|
|
129
|
+
grid-template-columns: repeat(
|
|
130
|
+
${({
|
|
124
131
|
$columns
|
|
125
|
-
}) => $columns},
|
|
132
|
+
}) => $columns},
|
|
133
|
+
${PRODUCT_CARD_WIDTH}px
|
|
134
|
+
);
|
|
126
135
|
padding: 0 0 10px 10px;
|
|
127
136
|
|
|
128
137
|
@media ${layout.BREAKPOINTS.MOBILE_AND_DOWN} {
|
|
@@ -180,11 +189,14 @@ const ProductGroupLabelLine = styled__default["default"].div`
|
|
|
180
189
|
`;
|
|
181
190
|
const ProductList = styled__default["default"].div`
|
|
182
191
|
display: grid;
|
|
183
|
-
grid-template-columns: repeat(
|
|
192
|
+
grid-template-columns: repeat(
|
|
193
|
+
${({
|
|
184
194
|
$columns
|
|
185
|
-
}) => $columns},
|
|
195
|
+
}) => $columns},
|
|
196
|
+
${PRODUCT_CARD_WIDTH}px
|
|
197
|
+
);
|
|
186
198
|
align-items: flex-end;
|
|
187
|
-
gap: 0
|
|
199
|
+
gap: 0 ${PRODUCT_LIST_GRID_GAP}px;
|
|
188
200
|
padding: 0 10px;
|
|
189
201
|
|
|
190
202
|
@media ${layout.BREAKPOINTS.MOBILE_AND_DOWN} {
|
|
@@ -351,6 +363,8 @@ exports.Description = Description;
|
|
|
351
363
|
exports.DescriptionButtonContainer = DescriptionButtonContainer;
|
|
352
364
|
exports.Image = Image;
|
|
353
365
|
exports.Name = Name;
|
|
366
|
+
exports.PRODUCT_CARD_WIDTH = PRODUCT_CARD_WIDTH;
|
|
367
|
+
exports.PRODUCT_LIST_GRID_GAP = PRODUCT_LIST_GRID_GAP;
|
|
354
368
|
exports.Product = Product;
|
|
355
369
|
exports.ProductCardOnClickArea = ProductCardOnClickArea;
|
|
356
370
|
exports.ProductGroupLabel = ProductGroupLabel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductList.styles.js","sources":["../../../../src/components/ModelCompareV4/ProductList/ProductList.styles.tsx"],"sourcesContent":["import styled, { css, keyframes } from \"styled-components\";\n\nimport { BREAKPOINTS } from \"../../../constants/layout\";\nimport { theme } from \"../../../constants/theme\";\nimport { StyleableSvgImage } from \"../../StyleableSvgImage\";\n\nconst scrollBarHeight = 16;\nconst PRODUCT_CLICKABLE_AREA_Z_INDEX = 1;\n\nconst productCardAnimation = keyframes`\n50% {\n transform: scale(1.025);\n}\n 100% {\n box-shadow: 0 0 13px -1px rgb(33 35 39 / 0.174);\n /* we can't return to scale(1) because this creates a bug where the contents of the product card slightly shift on hover */\n transform: scale(0.999);\n }\n`;\n\nconst productGroupLineAnimation = keyframes`\n 25% {\n background: ${theme.colors.primaryBlue};\n transform: scaleY(1);\n }\n\n 50% {\n background: ${theme.colors.primaryBlue};\n transform: scaleY(1.5);\n }\n\n 70% {\n background: ${theme.colors.primaryBlue};\n transform: scaleY(1.5);\n width: 100%;\n }\n\n 100% {\n background: rgba(0, 111, 255, 0.00);\n transform: scaleY(1);\n width: 100%;\n }\n`;\n\n// seconds\nconst productGroupAnimationDuration = 0.125;\n\n// seconds\nconst productCardAnimationDuration = 0.25;\n\nexport const Wrapper = styled.div`\n position: relative;\n margin-bottom: 20px;\n`;\n\nexport const Container = styled.div<{\n $isHovering: boolean;\n $moreThanOneGroupExists: boolean;\n}>`\n overflow-x: auto;\n padding-bottom: 30px;\n\n ${({ $moreThanOneGroupExists }) =>\n !$moreThanOneGroupExists &&\n css`\n padding-top: 7px;\n `}\n\n @media ${BREAKPOINTS.MOBILE_AND_DOWN} {\n /* We need the x-padding so the shadows of the cards aren't clipped */\n padding: 0 5px 24px;\n }\n\n /**\n * We cannot define padding on some of these scroll bar\n * elements. Because of this, we're defining scroll bar colors\n * with linear-gradient so users don't have to be very\n * accurate when clicking the scroll bar while keeping the\n * styles of the scroll bar slim.\n */\n\n &::-webkit-scrollbar {\n height: ${scrollBarHeight}px;\n /* at the top of this componnent's definition is a note on why we're defining colors this way */\n background-image: linear-gradient(\n to bottom,\n transparent 6px,\n #eeeff1 6px,\n #eeeff1 8px,\n transparent 8px\n );\n }\n\n &::-webkit-scrollbar-thumb {\n /* at the top of this componnent's definition is a note on why we're defining colors this way */\n background-image: linear-gradient(\n to bottom,\n transparent 6px,\n ${theme.colors.primaryBlue} 6px,\n ${theme.colors.primaryBlue} 8px,\n transparent 8px\n );\n\n ${({ $isHovering }) =>\n $isHovering &&\n css`\n /* at the top of this componnent's definition is a note on why we're defining colors this way */\n background-image: linear-gradient(\n to bottom,\n transparent 5px,\n ${theme.colors.primaryBlue} 5px,\n ${theme.colors.primaryBlue} 9px,\n transparent 9px\n );\n `}\n }\n`;\n\nexport const ProductGroupProductListContainer = styled.div`\n display: grid;\n grid-template-columns: 1fr;\n`;\n\nexport const ProductGroups = styled.div<{ $columns: number }>`\n min-width: 100%;\n display: grid;\n gap: 0 10px;\n grid-template-columns: repeat(${({ $columns }) => $columns}, 205px);\n padding: 0 0 10px 10px;\n\n @media ${BREAKPOINTS.MOBILE_AND_DOWN} {\n padding-left: 0;\n }\n`;\n\nexport const ProductGroupLabelContainer = styled.div<{ $span: number }>`\n display: flex;\n grid-column: span ${({ $span }) => $span ?? 1};\n gap: 0 20px;\n`;\n\nexport const ProductGroupLabel = styled.span<{\n $isActive: boolean;\n $productGroupsSelectorExists: boolean;\n}>`\n color: #808893;\n font-size: 18px;\n font-weight: 700;\n scroll-margin-left: 10px;\n white-space: nowrap;\n\n ${({ $isActive, $productGroupsSelectorExists }) =>\n ($isActive || !$productGroupsSelectorExists) &&\n css`\n color: ${theme.colors.primaryBlue};\n `}\n`;\n\nexport const ProductGroupLabelLineContainer = styled.div`\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n`;\n\nexport const ProductGroupLabelGrayLine = styled.div`\n width: 100%;\n height: 1px;\n background: #eeeff1;\n`;\n\nexport const ProductGroupLabelLine = styled.div<{\n $isActive: boolean;\n $playAnimation: boolean;\n $productGroupsSelectorExists: boolean;\n}>`\n width: 0;\n height: 1px;\n background: #eeeff1;\n\n ${({ $isActive, $playAnimation, $productGroupsSelectorExists }) =>\n !$productGroupsSelectorExists\n ? css`\n animation: ${productGroupLineAnimation} ease-in-out 1 forwards;\n `\n : $isActive &&\n $playAnimation &&\n css`\n animation: ${productGroupLineAnimation}\n ${productGroupAnimationDuration + productCardAnimationDuration}s\n ease-in-out 1 forwards;\n `}\n`;\n\nexport const ProductList = styled.div<{\n $columns: number;\n $isDragging: boolean;\n $overflowExists: boolean;\n $moreThanOneGroupExists: boolean;\n}>`\n display: grid;\n grid-template-columns: repeat(${({ $columns }) => $columns}, 205px);\n align-items: flex-end;\n gap: 0 10px;\n padding: 0 10px;\n\n @media ${BREAKPOINTS.MOBILE_AND_DOWN} {\n padding-left: 6px;\n }\n\n ${({ $overflowExists }) =>\n $overflowExists &&\n css`\n cursor: grab;\n `}\n\n ${({ $isDragging, $overflowExists }) =>\n $overflowExists &&\n $isDragging &&\n css`\n cursor: grabbing;\n `}\n\n ${({ $moreThanOneGroupExists }) =>\n !$moreThanOneGroupExists &&\n css`\n margin-top: 5px;\n `}\n`;\n\nexport const ProductCardOnClickArea = styled.div`\n position: absolute;\n z-index: ${PRODUCT_CLICKABLE_AREA_Z_INDEX};\n width: 100%;\n height: 100%;\n`;\n\nexport const Product = styled.div<{\n $isActive: boolean;\n $groupIndex: number;\n $playAnimation: boolean;\n $groupLength: number;\n $canPlayAniimation: boolean;\n $productGroupsSelectorExists: boolean;\n}>`\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-end;\n background: ${theme.colors.white};\n padding: 20px 10px;\n border-radius: 6px;\n height: 100%;\n min-height: 100%;\n -webkit-user-drag: none;\n user-select: none;\n /* can't use scale(1) because the content slightly shifts on hover */\n transform: scale(0.999);\n\n ${({\n $isActive,\n $groupIndex,\n $playAnimation,\n $groupLength,\n $canPlayAniimation,\n $productGroupsSelectorExists,\n }) =>\n !$productGroupsSelectorExists\n ? css`\n animation: ${productCardAnimation} ease-in-out 1 forwards;\n `\n : $canPlayAniimation &&\n $isActive &&\n $playAnimation &&\n css`\n animation: ${productCardAnimation} ${productCardAnimationDuration}s\n ease-in-out\n ${(productGroupAnimationDuration / $groupLength) * $groupIndex}s 1\n forwards;\n `}\n`;\n\nexport const Image = styled.img`\n -webkit-user-drag: none;\n user-select: none;\n`;\n\nexport const DescriptionButtonContainer = styled.div`\n display: flex;\n flex-direction: column;\n user-select: none;\n\n justify-content: space-between;\n flex-grow: 1;\n`;\n\nexport const Name = styled.div`\n color: #212427;\n text-align: center;\n font-size: 16px;\n font-weight: 700;\n letter-spacing: -0.32px;\n line-height: normal;\n\n display: flex;\n justify-content: center;\n`;\n\nexport const Description = styled.div`\n text-align: center;\n font-size: 14px;\n font-weight: 400;\n line-height: normal;\n letter-spacing: -0.28px;\n color: rgb(0 0 0 / 0.65);\n display: flex;\n justify-content: center;\n margin-top: 6px;\n`;\n\nexport const ButtonIcon = styled(StyleableSvgImage)<{ $isSelected: boolean }>`\n transition: transform 0.125s ease-in-out;\n ${({ $isSelected }) =>\n $isSelected &&\n css`\n transform: rotate(45deg);\n `}\n`;\n\nexport const Button = styled.button<{\n $isStaticProduct: boolean;\n $isSelected: boolean;\n $disabled: boolean;\n}>`\n align-items: center;\n background: transparent;\n border-radius: 4px;\n border: 1px solid #808893;\n color: #808893;\n cursor: pointer;\n display: flex;\n gap: 4px;\n margin: 12px auto 0;\n min-width: 110px;\n padding: 10px 15px;\n transition: 0.3s;\n z-index: ${PRODUCT_CLICKABLE_AREA_Z_INDEX};\n\n &:hover {\n background: #80889310;\n }\n\n ${({ $isSelected }) =>\n $isSelected &&\n css`\n background: ${theme.colors.primaryBlue};\n border: 1px solid ${theme.colors.primaryBlue};\n color: ${theme.colors.white};\n\n &:hover {\n background: ${theme.colors.dodgerblue};\n }\n `}\n\n ${({ $disabled }) =>\n $disabled &&\n css`\n cursor: not-allowed !important;\n `}\n\n ${({ $isStaticProduct }) =>\n $isStaticProduct &&\n css`\n visibility: hidden;\n pointer-events: none;\n `}\n`;\n\nexport const CopyWhiteSpace = styled.span`\n display: inline-block;\n width: 5px;\n`;\n\nexport const ButtonCopy = styled.span`\n font-size: 14px;\n font-weight: 700;\n`;\n"],"names":["scrollBarHeight","PRODUCT_CLICKABLE_AREA_Z_INDEX","productCardAnimation","keyframes","productGroupLineAnimation","theme","colors","primaryBlue","productGroupAnimationDuration","productCardAnimationDuration","Wrapper","styled","div","Container","$moreThanOneGroupExists","css","BREAKPOINTS","MOBILE_AND_DOWN","$isHovering","ProductGroupProductListContainer","ProductGroups","$columns","ProductGroupLabelContainer","$span","ProductGroupLabel","span","$isActive","$productGroupsSelectorExists","ProductGroupLabelLineContainer","ProductGroupLabelGrayLine","ProductGroupLabelLine","$playAnimation","ProductList","$overflowExists","$isDragging","ProductCardOnClickArea","Product","white","$groupIndex","$groupLength","$canPlayAniimation","Image","img","DescriptionButtonContainer","Name","Description","ButtonIcon","StyleableSvgImage","$isSelected","Button","button","dodgerblue","$disabled","$isStaticProduct","CopyWhiteSpace","ButtonCopy"],"mappings":";;;;;;;;;;;;;;AAMA,MAAMA,eAAkB,GAAA,EAAA;AACxB,MAAMC,8BAAiC,GAAA,CAAA;AAEvC,MAAMC,oBAAuB,GAAAC,MAAA,CAAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAW7B,MAAMC,yBAA4B,GAAAD,MAAA,CAAAA,SAAA;AAAA;AAAA,sBAEZE,KAAA,CAAAA,KAAA,CAAMC,OAAOC,WAAW;AAAA;AAAA;;AAAA;AAAA,oBAK1BF,KAAA,CAAAA,KAAA,CAAMC,OAAOC,WAAW;AAAA;AAAA;;AAAA;AAAA,oBAKxBF,KAAA,CAAAA,KAAA,CAAMC,OAAOC,WAAW;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAa5C,MAAMC,6BAAgC,GAAA,KAAA;AAGtC,MAAMC,4BAA+B,GAAA,IAAA;AAE9B,MAAMC,UAAUC,eAAO,CAAA,SAAA,CAAA,CAAAC,GAAA;AAAA;AAAA;AAAA,CAAA;AAKvB,MAAMC,YAAYF,eAAO,CAAA,SAAA,CAAA,CAAAC,GAAA;AAAA;AAAA;;AAAA,IAO5B,CAAC;EAAEE;CAAwB,KAC3B,CAACA,uBACD,IAAAC,MAAA,CAAAA,GAAA;AAAA;AAAA,KAEC;;AAAA,WAEMC,MAAAA,CAAAA,YAAYC,eAAe;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA,cAcxBjB,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAgBrBK,KAAA,CAAAA,KAAA,CAAMC,OAAO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C,OAAOC,WAAW;AAAA,eACnCF,KAAA,CAAAA,KAAA,CAAMC,OAAO+B,KAAK;;AAAA;AAAA,sBAGXhC,KAAA,CAAAA,KAAA,CAAMC,OAAO6C,UAAU;AAAA;AAAA,KAExC;;AAAA,IAED,CAAC;EAAEC;CAAU,KACbA,SACA,IAAArC,MAAA,CAAAA,GAAA;AAAA;AAAA,KAEC;;AAAA,MAEC,CAAC;EAAEsC;CAAiB,KACtBA,gBACA,IAAAtC,MAAA,CAAAA,GAAA;AAAA;AAAA;AAAA,KAGC;AAAA,CAAA;AAGE,MAAMuC,iBAAiB3C,eAAO,CAAA,SAAA,CAAA,CAAAc,IAAA;AAAA;AAAA;AAAA,CAAA;AAK9B,MAAM8B,aAAa5C,eAAO,CAAA,SAAA,CAAA,CAAAc,IAAA;AAAA;AAAA;AAAA,CAAA;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"ProductList.styles.js","sources":["../../../../src/components/ModelCompareV4/ProductList/ProductList.styles.tsx"],"sourcesContent":["import styled, { css, keyframes } from \"styled-components\";\n\nimport { BREAKPOINTS } from \"../../../constants/layout\";\nimport { theme } from \"../../../constants/theme\";\nimport { StyleableSvgImage } from \"../../StyleableSvgImage\";\n\nconst scrollBarHeight = 16;\nconst PRODUCT_CLICKABLE_AREA_Z_INDEX = 1;\nexport const PRODUCT_CARD_WIDTH = 205;\nexport const PRODUCT_LIST_GRID_GAP = 10;\n\nconst productCardAnimation = keyframes`\n50% {\n transform: scale(1.025);\n}\n 100% {\n box-shadow: 0 0 13px -1px rgb(33 35 39 / 0.174);\n /* we can't return to scale(1) because this creates a bug where the contents of the product card slightly shift on hover */\n transform: scale(0.999);\n }\n`;\n\nconst productGroupLineAnimation = keyframes`\n 25% {\n background: ${theme.colors.primaryBlue};\n transform: scaleY(1);\n }\n\n 50% {\n background: ${theme.colors.primaryBlue};\n transform: scaleY(1.5);\n }\n\n 70% {\n background: ${theme.colors.primaryBlue};\n transform: scaleY(1.5);\n width: 100%;\n }\n\n 100% {\n background: rgba(0, 111, 255, 0.00);\n transform: scaleY(1);\n width: 100%;\n }\n`;\n\n// seconds\nconst productGroupAnimationDuration = 0.125;\n\n// seconds\nconst productCardAnimationDuration = 0.25;\n\nexport const Wrapper = styled.div`\n position: relative;\n margin-bottom: 20px;\n`;\n\nexport const Container = styled.div<{\n $isHovering: boolean;\n $moreThanOneGroupExists: boolean;\n $isDragging: boolean;\n}>`\n overflow-x: auto;\n padding-bottom: 30px;\n scroll-behavior: smooth;\n scroll-behavior: ${({ $isDragging }) => ($isDragging ? \"unset\" : \"smooth\")};\n\n ${({ $moreThanOneGroupExists }) =>\n !$moreThanOneGroupExists &&\n css`\n padding-top: 7px;\n `}\n\n @media ${BREAKPOINTS.MOBILE_AND_DOWN} {\n /* We need the x-padding so the shadows of the cards aren't clipped */\n padding: 0 5px 24px;\n }\n\n /**\n * We cannot define padding on some of these scroll bar\n * elements. Because of this, we're defining scroll bar colors\n * with linear-gradient so users don't have to be very\n * accurate when clicking the scroll bar while keeping the\n * styles of the scroll bar slim.\n */\n\n &::-webkit-scrollbar {\n height: ${scrollBarHeight}px;\n /* at the top of this componnent's definition is a note on why we're defining colors this way */\n background-image: linear-gradient(\n to bottom,\n transparent 6px,\n #eeeff1 6px,\n #eeeff1 8px,\n transparent 8px\n );\n }\n\n &::-webkit-scrollbar-thumb {\n /* at the top of this componnent's definition is a note on why we're defining colors this way */\n background-image: linear-gradient(\n to bottom,\n transparent 6px,\n ${theme.colors.primaryBlue} 6px,\n ${theme.colors.primaryBlue} 8px,\n transparent 8px\n );\n\n ${({ $isHovering }) =>\n $isHovering &&\n css`\n /* at the top of this componnent's definition is a note on why we're defining colors this way */\n background-image: linear-gradient(\n to bottom,\n transparent 5px,\n ${theme.colors.primaryBlue} 5px,\n ${theme.colors.primaryBlue} 9px,\n transparent 9px\n );\n `}\n }\n`;\n\nexport const ProductGroupProductListContainer = styled.div`\n display: grid;\n grid-template-columns: 1fr;\n`;\n\nexport const ProductGroups = styled.div<{ $columns: number }>`\n min-width: 100%;\n display: grid;\n gap: 0 10px;\n grid-template-columns: repeat(\n ${({ $columns }) => $columns},\n ${PRODUCT_CARD_WIDTH}px\n );\n padding: 0 0 10px 10px;\n\n @media ${BREAKPOINTS.MOBILE_AND_DOWN} {\n padding-left: 0;\n }\n`;\n\nexport const ProductGroupLabelContainer = styled.div<{ $span: number }>`\n display: flex;\n grid-column: span ${({ $span }) => $span ?? 1};\n gap: 0 20px;\n`;\n\nexport const ProductGroupLabel = styled.span<{\n $isActive: boolean;\n $productGroupsSelectorExists: boolean;\n}>`\n color: #808893;\n font-size: 18px;\n font-weight: 700;\n scroll-margin-left: 10px;\n white-space: nowrap;\n\n ${({ $isActive, $productGroupsSelectorExists }) =>\n ($isActive || !$productGroupsSelectorExists) &&\n css`\n color: ${theme.colors.primaryBlue};\n `}\n`;\n\nexport const ProductGroupLabelLineContainer = styled.div`\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n`;\n\nexport const ProductGroupLabelGrayLine = styled.div`\n width: 100%;\n height: 1px;\n background: #eeeff1;\n`;\n\nexport const ProductGroupLabelLine = styled.div<{\n $isActive: boolean;\n $playAnimation: boolean;\n $productGroupsSelectorExists: boolean;\n}>`\n width: 0;\n height: 1px;\n background: #eeeff1;\n\n ${({ $isActive, $playAnimation, $productGroupsSelectorExists }) =>\n !$productGroupsSelectorExists\n ? css`\n animation: ${productGroupLineAnimation} ease-in-out 1 forwards;\n `\n : $isActive &&\n $playAnimation &&\n css`\n animation: ${productGroupLineAnimation}\n ${productGroupAnimationDuration + productCardAnimationDuration}s\n ease-in-out 1 forwards;\n `}\n`;\n\nexport const ProductList = styled.div<{\n $columns: number;\n $isDragging: boolean;\n $overflowExists: boolean;\n $moreThanOneGroupExists: boolean;\n}>`\n display: grid;\n grid-template-columns: repeat(\n ${({ $columns }) => $columns},\n ${PRODUCT_CARD_WIDTH}px\n );\n align-items: flex-end;\n gap: 0 ${PRODUCT_LIST_GRID_GAP}px;\n padding: 0 10px;\n\n @media ${BREAKPOINTS.MOBILE_AND_DOWN} {\n padding-left: 6px;\n }\n\n ${({ $overflowExists }) =>\n $overflowExists &&\n css`\n cursor: grab;\n `}\n\n ${({ $isDragging, $overflowExists }) =>\n $overflowExists &&\n $isDragging &&\n css`\n cursor: grabbing;\n `}\n\n ${({ $moreThanOneGroupExists }) =>\n !$moreThanOneGroupExists &&\n css`\n margin-top: 5px;\n `}\n`;\n\nexport const ProductCardOnClickArea = styled.div`\n position: absolute;\n z-index: ${PRODUCT_CLICKABLE_AREA_Z_INDEX};\n width: 100%;\n height: 100%;\n`;\n\nexport const Product = styled.div<{\n $isActive: boolean;\n $groupIndex: number;\n $playAnimation: boolean;\n $groupLength: number;\n $canPlayAniimation: boolean;\n $productGroupsSelectorExists: boolean;\n}>`\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-end;\n background: ${theme.colors.white};\n padding: 20px 10px;\n border-radius: 6px;\n height: 100%;\n min-height: 100%;\n -webkit-user-drag: none;\n user-select: none;\n /* can't use scale(1) because the content slightly shifts on hover */\n transform: scale(0.999);\n\n ${({\n $isActive,\n $groupIndex,\n $playAnimation,\n $groupLength,\n $canPlayAniimation,\n $productGroupsSelectorExists,\n }) =>\n !$productGroupsSelectorExists\n ? css`\n animation: ${productCardAnimation} ease-in-out 1 forwards;\n `\n : $canPlayAniimation &&\n $isActive &&\n $playAnimation &&\n css`\n animation: ${productCardAnimation} ${productCardAnimationDuration}s\n ease-in-out\n ${(productGroupAnimationDuration / $groupLength) * $groupIndex}s 1\n forwards;\n `}\n`;\n\nexport const Image = styled.img`\n -webkit-user-drag: none;\n user-select: none;\n`;\n\nexport const DescriptionButtonContainer = styled.div`\n display: flex;\n flex-direction: column;\n user-select: none;\n\n justify-content: space-between;\n flex-grow: 1;\n`;\n\nexport const Name = styled.div`\n color: #212427;\n text-align: center;\n font-size: 16px;\n font-weight: 700;\n letter-spacing: -0.32px;\n line-height: normal;\n\n display: flex;\n justify-content: center;\n`;\n\nexport const Description = styled.div`\n text-align: center;\n font-size: 14px;\n font-weight: 400;\n line-height: normal;\n letter-spacing: -0.28px;\n color: rgb(0 0 0 / 0.65);\n display: flex;\n justify-content: center;\n margin-top: 6px;\n`;\n\nexport const ButtonIcon = styled(StyleableSvgImage)<{ $isSelected: boolean }>`\n transition: transform 0.125s ease-in-out;\n ${({ $isSelected }) =>\n $isSelected &&\n css`\n transform: rotate(45deg);\n `}\n`;\n\nexport const Button = styled.button<{\n $isStaticProduct: boolean;\n $isSelected: boolean;\n $disabled: boolean;\n}>`\n align-items: center;\n background: transparent;\n border-radius: 4px;\n border: 1px solid #808893;\n color: #808893;\n cursor: pointer;\n display: flex;\n gap: 4px;\n margin: 12px auto 0;\n min-width: 110px;\n padding: 10px 15px;\n transition: 0.3s;\n z-index: ${PRODUCT_CLICKABLE_AREA_Z_INDEX};\n\n &:hover {\n background: #80889310;\n }\n\n ${({ $isSelected }) =>\n $isSelected &&\n css`\n background: ${theme.colors.primaryBlue};\n border: 1px solid ${theme.colors.primaryBlue};\n color: ${theme.colors.white};\n\n &:hover {\n background: ${theme.colors.dodgerblue};\n }\n `}\n\n ${({ $disabled }) =>\n $disabled &&\n css`\n cursor: not-allowed !important;\n `}\n\n ${({ $isStaticProduct }) =>\n $isStaticProduct &&\n css`\n visibility: hidden;\n pointer-events: none;\n `}\n`;\n\nexport const CopyWhiteSpace = styled.span`\n display: inline-block;\n width: 5px;\n`;\n\nexport const ButtonCopy = styled.span`\n font-size: 14px;\n font-weight: 700;\n`;\n"],"names":["scrollBarHeight","PRODUCT_CLICKABLE_AREA_Z_INDEX","PRODUCT_CARD_WIDTH","PRODUCT_LIST_GRID_GAP","productCardAnimation","keyframes","productGroupLineAnimation","theme","colors","primaryBlue","productGroupAnimationDuration","productCardAnimationDuration","Wrapper","styled","div","Container","$isDragging","$moreThanOneGroupExists","css","BREAKPOINTS","MOBILE_AND_DOWN","$isHovering","ProductGroupProductListContainer","ProductGroups","$columns","ProductGroupLabelContainer","$span","ProductGroupLabel","span","$isActive","$productGroupsSelectorExists","ProductGroupLabelLineContainer","ProductGroupLabelGrayLine","ProductGroupLabelLine","$playAnimation","ProductList","$overflowExists","ProductCardOnClickArea","Product","white","$groupIndex","$groupLength","$canPlayAniimation","Image","img","DescriptionButtonContainer","Name","Description","ButtonIcon","StyleableSvgImage","$isSelected","Button","button","dodgerblue","$disabled","$isStaticProduct","CopyWhiteSpace","ButtonCopy"],"mappings":";;;;;;;;;;;;;;AAMA,MAAMA,eAAkB,GAAA,EAAA;AACxB,MAAMC,8BAAiC,GAAA,CAAA;AAChC,MAAMC,kBAAqB,GAAA,GAAA;AAC3B,MAAMC,qBAAwB,GAAA,EAAA;AAErC,MAAMC,oBAAuB,GAAAC,MAAA,CAAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAW7B,MAAMC,yBAA4B,GAAAD,MAAA,CAAAA,SAAA;AAAA;AAAA,sBAEZE,KAAA,CAAAA,KAAA,CAAMC,OAAOC,WAAW;AAAA;AAAA;;AAAA;AAAA,oBAK1BF,KAAA,CAAAA,KAAA,CAAMC,OAAOC,WAAW;AAAA;AAAA;;AAAA;AAAA,oBAKxBF,KAAA,CAAAA,KAAA,CAAMC,OAAOC,WAAW;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAa5C,MAAMC,6BAAgC,GAAA,KAAA;AAGtC,MAAMC,4BAA+B,GAAA,IAAA;AAE9B,MAAMC,UAAUC,eAAO,CAAA,SAAA,CAAA,CAAAC,GAAA;AAAA;AAAA;AAAA,CAAA;AAKvB,MAAMC,YAAYF,eAAO,CAAA,SAAA,CAAA,CAAAC,GAAA;AAAA;AAAA;AAAA;AAAA,qBAQX,CAAC;EAAEE;AAAA,CAAmB,KAAAA,WAAA,GAAc,UAAU,QAAS;;AAAA,IAExE,CAAC;EAAEC;CAAwB,KAC3B,CAACA,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