@anker-in/headless-ui 1.0.19-temp-101403 → 1.0.19-temp-101406
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/dist/cjs/biz-components/AccordionCards/index.js.map +2 -2
- package/dist/cjs/biz-components/AplusDesc/index.js +2 -0
- package/dist/cjs/biz-components/AplusDesc/index.js.map +7 -0
- package/dist/cjs/biz-components/CollectionsBanner/index.js +1 -1
- package/dist/cjs/biz-components/CollectionsBanner/index.js.map +2 -2
- package/dist/cjs/biz-components/CollectionsFilters/FilterCardWrap.js +1 -1
- package/dist/cjs/biz-components/CollectionsFilters/FilterCardWrap.js.map +2 -2
- package/dist/cjs/biz-components/CollectionsFilters/FilterCardWrapItem.js +1 -1
- package/dist/cjs/biz-components/CollectionsFilters/FilterCardWrapItem.js.map +2 -2
- package/dist/cjs/biz-components/CollectionsFilters/component/filtersFun.js.map +1 -1
- package/dist/cjs/biz-components/DownLoad/index.js +2 -0
- package/dist/cjs/biz-components/DownLoad/index.js.map +7 -0
- package/dist/cjs/biz-components/Features/index.js +2 -0
- package/dist/cjs/biz-components/Features/index.js.map +7 -0
- package/dist/cjs/biz-components/FootCharger/index.js +2 -0
- package/dist/cjs/biz-components/FootCharger/index.js.map +7 -0
- package/dist/cjs/biz-components/FooterNavigation/index.js +1 -1
- package/dist/cjs/biz-components/FooterNavigation/index.js.map +3 -3
- package/dist/cjs/biz-components/FooterNavigation/types.d.ts +2 -1
- package/dist/cjs/biz-components/FooterNavigation/types.js +1 -1
- package/dist/cjs/biz-components/FooterNavigation/types.js.map +2 -2
- package/dist/cjs/biz-components/GiftBox/index.js +2 -0
- package/dist/cjs/biz-components/GiftBox/index.js.map +7 -0
- package/dist/cjs/biz-components/GraphicMore/index.js +2 -0
- package/dist/cjs/biz-components/GraphicMore/index.js.map +7 -0
- package/dist/cjs/biz-components/HeaderNavigation/NavProvider.d.ts +6 -5
- package/dist/cjs/biz-components/HeaderNavigation/NavProvider.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/NavProvider.js.map +3 -3
- package/dist/cjs/biz-components/HeaderNavigation/icons/Polygon.js +2 -0
- package/dist/cjs/biz-components/HeaderNavigation/icons/Polygon.js.map +7 -0
- package/dist/cjs/biz-components/HeaderNavigation/icons/index.d.ts +2 -1
- package/dist/cjs/biz-components/HeaderNavigation/icons/index.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/icons/index.js.map +3 -3
- package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/index.js.map +3 -3
- package/dist/cjs/biz-components/HeaderNavigation/types.d.ts +16 -2
- package/dist/cjs/biz-components/HeaderNavigation/types.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/types.js.map +2 -2
- package/dist/cjs/biz-components/HeaderNavigation/withCategory.d.ts +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/withCategory.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/withCategory.js.map +3 -3
- package/dist/cjs/biz-components/Listing/ProductProvider.js +2 -0
- package/dist/cjs/biz-components/Listing/ProductProvider.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/const.js +2 -0
- package/dist/cjs/biz-components/Listing/const.js.map +7 -0
- package/dist/cjs/biz-components/Listing/hooks/use-options.js +2 -0
- package/dist/cjs/biz-components/Listing/hooks/use-options.js.map +7 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant-media.js +2 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant-media.js.map +7 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant.js +2 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant.js.map +7 -0
- package/dist/cjs/biz-components/Listing/hooks/useCopy.js +2 -0
- package/dist/cjs/biz-components/Listing/hooks/useCopy.js.map +7 -0
- package/dist/cjs/biz-components/Listing/index.js +2 -0
- package/dist/cjs/biz-components/Listing/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types/graphql.js +2 -0
- package/dist/cjs/biz-components/Listing/types/graphql.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types/product.js +2 -0
- package/dist/cjs/biz-components/Listing/types/product.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types/productMetafields.d.js +2 -0
- package/dist/cjs/biz-components/Listing/types/productMetafields.d.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types/type-helper.js +2 -0
- package/dist/cjs/biz-components/Listing/types/type-helper.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types.js +2 -0
- package/dist/cjs/biz-components/Listing/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/utils/helper.js +2 -0
- package/dist/cjs/biz-components/Listing/utils/helper.js.map +7 -0
- package/dist/cjs/biz-components/Listing/utils/index.js +2 -0
- package/dist/cjs/biz-components/Listing/utils/index.js.map +7 -0
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
- package/dist/cjs/biz-components/NavigationSearch/index.js +2 -0
- package/dist/cjs/biz-components/NavigationSearch/index.js.map +7 -0
- package/dist/cjs/biz-components/NavigationSearch/types.js +2 -0
- package/dist/cjs/biz-components/NavigationSearch/types.js.map +7 -0
- package/dist/cjs/biz-components/SearchPage/index.js +2 -0
- package/dist/cjs/biz-components/SearchPage/index.js.map +7 -0
- package/dist/cjs/biz-components/SearchPage/types.js +2 -0
- package/dist/cjs/biz-components/SearchPage/types.js.map +7 -0
- package/dist/cjs/biz-components/SelectStore/index.js +2 -0
- package/dist/cjs/biz-components/SelectStore/index.js.map +7 -0
- package/dist/cjs/biz-components/ShelfDisplay/index.js +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/index.js.map +3 -3
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.js +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.js.map +2 -2
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +4 -4
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
- package/dist/cjs/biz-components/Specs/dropdown.js +3 -0
- package/dist/cjs/biz-components/Specs/dropdown.js.map +7 -0
- package/dist/cjs/biz-components/Specs/index.js +2 -0
- package/dist/cjs/biz-components/Specs/index.js.map +7 -0
- package/dist/cjs/biz-components/Subscribe/index.d.ts +7 -1
- package/dist/cjs/biz-components/Subscribe/index.js +1 -1
- package/dist/cjs/biz-components/Subscribe/index.js.map +3 -3
- package/dist/cjs/biz-components/Title/index.js +1 -1
- package/dist/cjs/biz-components/Title/index.js.map +2 -2
- package/dist/cjs/biz-components/Title/types.d.ts +3 -1
- package/dist/cjs/biz-components/Title/types.js +1 -1
- package/dist/cjs/biz-components/Title/types.js.map +1 -1
- package/dist/cjs/biz-components/index.d.ts +25 -0
- package/dist/cjs/biz-components/index.js +1 -1
- package/dist/cjs/biz-components/index.js.map +3 -3
- package/dist/cjs/components/button.js +1 -1
- package/dist/cjs/components/button.js.map +2 -2
- package/dist/cjs/components/container.js +1 -1
- package/dist/cjs/components/container.js.map +2 -2
- package/dist/cjs/components/dialog.d.ts +3 -1
- package/dist/cjs/components/dialog.js +1 -1
- package/dist/cjs/components/dialog.js.map +3 -3
- package/dist/cjs/components/index.d.ts +1 -0
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/index.js.map +3 -3
- package/dist/cjs/components/loadingDots.js +42 -0
- package/dist/cjs/components/loadingDots.js.map +7 -0
- package/dist/cjs/helpers/utils.d.ts +1 -0
- package/dist/cjs/helpers/utils.js +1 -1
- package/dist/cjs/helpers/utils.js.map +3 -3
- package/dist/cjs/stories/aplusdesc.stories.js +2 -0
- package/dist/cjs/stories/aplusdesc.stories.js.map +7 -0
- package/dist/cjs/stories/download.stories.js +2 -0
- package/dist/cjs/stories/download.stories.js.map +7 -0
- package/dist/cjs/stories/features.stories.js +2 -0
- package/dist/cjs/stories/features.stories.js.map +7 -0
- package/dist/cjs/stories/footcharger.stories.js +2 -0
- package/dist/cjs/stories/footcharger.stories.js.map +7 -0
- package/dist/cjs/stories/giftbox.stories.js +2 -0
- package/dist/cjs/stories/giftbox.stories.js.map +7 -0
- package/dist/cjs/stories/graphicMore.stories.js +2 -0
- package/dist/cjs/stories/graphicMore.stories.js.map +7 -0
- package/dist/cjs/stories/selectstore.stories.js +2 -0
- package/dist/cjs/stories/selectstore.stories.js.map +7 -0
- package/dist/cjs/stories/shelfDisplay.stories.js +644 -1
- package/dist/cjs/stories/shelfDisplay.stories.js.map +2 -2
- package/dist/cjs/stories/tabs.stories.js +1 -1
- package/dist/cjs/stories/tabs.stories.js.map +3 -3
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/biz-components/AccordionCards/index.js.map +2 -2
- package/dist/esm/biz-components/AplusDesc/index.js +2 -0
- package/dist/esm/biz-components/AplusDesc/index.js.map +7 -0
- package/dist/esm/biz-components/CollectionsBanner/index.js +1 -1
- package/dist/esm/biz-components/CollectionsBanner/index.js.map +2 -2
- package/dist/esm/biz-components/CollectionsFilters/FilterCardWrap.js +1 -1
- package/dist/esm/biz-components/CollectionsFilters/FilterCardWrap.js.map +2 -2
- package/dist/esm/biz-components/CollectionsFilters/FilterCardWrapItem.js +1 -1
- package/dist/esm/biz-components/CollectionsFilters/FilterCardWrapItem.js.map +2 -2
- package/dist/esm/biz-components/CollectionsFilters/component/filtersFun.js.map +1 -1
- package/dist/esm/biz-components/DownLoad/index.js +2 -0
- package/dist/esm/biz-components/DownLoad/index.js.map +7 -0
- package/dist/esm/biz-components/Features/index.js +2 -0
- package/dist/esm/biz-components/Features/index.js.map +7 -0
- package/dist/esm/biz-components/FootCharger/index.js +2 -0
- package/dist/esm/biz-components/FootCharger/index.js.map +7 -0
- package/dist/esm/biz-components/FooterNavigation/index.js +1 -1
- package/dist/esm/biz-components/FooterNavigation/index.js.map +3 -3
- package/dist/esm/biz-components/FooterNavigation/types.d.ts +2 -1
- package/dist/esm/biz-components/FooterNavigation/types.js +1 -1
- package/dist/esm/biz-components/FooterNavigation/types.js.map +2 -2
- package/dist/esm/biz-components/GiftBox/index.js +2 -0
- package/dist/esm/biz-components/GiftBox/index.js.map +7 -0
- package/dist/esm/biz-components/GraphicMore/index.js +2 -0
- package/dist/esm/biz-components/GraphicMore/index.js.map +7 -0
- package/dist/esm/biz-components/HeaderNavigation/NavProvider.d.ts +6 -5
- package/dist/esm/biz-components/HeaderNavigation/NavProvider.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/NavProvider.js.map +3 -3
- package/dist/esm/biz-components/HeaderNavigation/icons/Polygon.js +2 -0
- package/dist/esm/biz-components/HeaderNavigation/icons/Polygon.js.map +7 -0
- package/dist/esm/biz-components/HeaderNavigation/icons/index.d.ts +2 -1
- package/dist/esm/biz-components/HeaderNavigation/icons/index.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/icons/index.js.map +3 -3
- package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/index.js.map +3 -3
- package/dist/esm/biz-components/HeaderNavigation/types.d.ts +16 -2
- package/dist/esm/biz-components/HeaderNavigation/types.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/types.js.map +2 -2
- package/dist/esm/biz-components/HeaderNavigation/withCategory.d.ts +1 -1
- package/dist/esm/biz-components/HeaderNavigation/withCategory.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/withCategory.js.map +3 -3
- package/dist/esm/biz-components/Listing/ProductProvider.js +2 -0
- package/dist/esm/biz-components/Listing/ProductProvider.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/types.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/types.js +1 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js +1 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/types.js +1 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/const.js +2 -0
- package/dist/esm/biz-components/Listing/const.js.map +7 -0
- package/dist/esm/biz-components/Listing/hooks/use-options.js +2 -0
- package/dist/esm/biz-components/Listing/hooks/use-options.js.map +7 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant-media.js +2 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant-media.js.map +7 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant.js +2 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant.js.map +7 -0
- package/dist/esm/biz-components/Listing/hooks/useCopy.js +2 -0
- package/dist/esm/biz-components/Listing/hooks/useCopy.js.map +7 -0
- package/dist/esm/biz-components/Listing/index.js +2 -0
- package/dist/esm/biz-components/Listing/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/types/graphql.js +2 -0
- package/dist/esm/biz-components/Listing/types/graphql.js.map +7 -0
- package/dist/esm/biz-components/Listing/types/product.js +2 -0
- package/dist/esm/biz-components/Listing/types/product.js.map +7 -0
- package/dist/esm/biz-components/Listing/types/productMetafields.d.js +2 -0
- package/dist/esm/biz-components/Listing/types/productMetafields.d.js.map +7 -0
- package/dist/esm/biz-components/Listing/types/type-helper.js +1 -0
- package/dist/esm/biz-components/Listing/types/type-helper.js.map +7 -0
- package/dist/esm/biz-components/Listing/types.js +1 -0
- package/dist/esm/biz-components/Listing/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/utils/helper.js +2 -0
- package/dist/esm/biz-components/Listing/utils/helper.js.map +7 -0
- package/dist/esm/biz-components/Listing/utils/index.js +2 -0
- package/dist/esm/biz-components/Listing/utils/index.js.map +7 -0
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
- package/dist/esm/biz-components/NavigationSearch/index.js +2 -0
- package/dist/esm/biz-components/NavigationSearch/index.js.map +7 -0
- package/dist/esm/biz-components/NavigationSearch/types.js +2 -0
- package/dist/esm/biz-components/NavigationSearch/types.js.map +7 -0
- package/dist/esm/biz-components/SearchPage/index.js +2 -0
- package/dist/esm/biz-components/SearchPage/index.js.map +7 -0
- package/dist/esm/biz-components/SearchPage/types.js +2 -0
- package/dist/esm/biz-components/SearchPage/types.js.map +7 -0
- package/dist/esm/biz-components/SelectStore/index.js +2 -0
- package/dist/esm/biz-components/SelectStore/index.js.map +7 -0
- package/dist/esm/biz-components/ShelfDisplay/index.js +1 -1
- package/dist/esm/biz-components/ShelfDisplay/index.js.map +3 -3
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.js +1 -1
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.js.map +2 -2
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +9 -9
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
- package/dist/esm/biz-components/Specs/dropdown.js +3 -0
- package/dist/esm/biz-components/Specs/dropdown.js.map +7 -0
- package/dist/esm/biz-components/Specs/index.js +2 -0
- package/dist/esm/biz-components/Specs/index.js.map +7 -0
- package/dist/esm/biz-components/Subscribe/index.d.ts +7 -1
- package/dist/esm/biz-components/Subscribe/index.js +1 -1
- package/dist/esm/biz-components/Subscribe/index.js.map +3 -3
- package/dist/esm/biz-components/Title/index.js +1 -1
- package/dist/esm/biz-components/Title/index.js.map +2 -2
- package/dist/esm/biz-components/Title/types.d.ts +3 -1
- package/dist/esm/biz-components/index.d.ts +25 -0
- package/dist/esm/biz-components/index.js +1 -1
- package/dist/esm/biz-components/index.js.map +3 -3
- package/dist/esm/components/button.js +1 -1
- package/dist/esm/components/button.js.map +2 -2
- package/dist/esm/components/container.js +1 -1
- package/dist/esm/components/container.js.map +2 -2
- package/dist/esm/components/dialog.d.ts +3 -1
- package/dist/esm/components/dialog.js +1 -1
- package/dist/esm/components/dialog.js.map +3 -3
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +2 -2
- package/dist/esm/components/loadingDots.js +42 -0
- package/dist/esm/components/loadingDots.js.map +7 -0
- package/dist/esm/helpers/utils.d.ts +1 -0
- package/dist/esm/helpers/utils.js +1 -1
- package/dist/esm/helpers/utils.js.map +3 -3
- package/dist/esm/stories/aplusdesc.stories.js +2 -0
- package/dist/esm/stories/aplusdesc.stories.js.map +7 -0
- package/dist/esm/stories/download.stories.js +2 -0
- package/dist/esm/stories/download.stories.js.map +7 -0
- package/dist/esm/stories/features.stories.js +2 -0
- package/dist/esm/stories/features.stories.js.map +7 -0
- package/dist/esm/stories/footcharger.stories.js +2 -0
- package/dist/esm/stories/footcharger.stories.js.map +7 -0
- package/dist/esm/stories/giftbox.stories.js +2 -0
- package/dist/esm/stories/giftbox.stories.js.map +7 -0
- package/dist/esm/stories/graphicMore.stories.js +2 -0
- package/dist/esm/stories/graphicMore.stories.js.map +7 -0
- package/dist/esm/stories/selectstore.stories.js +2 -0
- package/dist/esm/stories/selectstore.stories.js.map +7 -0
- package/dist/esm/stories/shelfDisplay.stories.js +644 -1
- package/dist/esm/stories/shelfDisplay.stories.js.map +2 -2
- package/dist/esm/stories/tabs.stories.js +1 -1
- package/dist/esm/stories/tabs.stories.js.map +3 -3
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/tokens/base.css +1 -1
- package/package.json +1 -1
- package/style.css +4 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/AccordionCards/index.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\nimport Title from '../Title/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport Button from '../../components/button.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport React, { useState, useRef, useCallback, useImperativeHandle, useEffect, type RefObject } from 'react'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport type { Img } from '../../types/props.js'\nimport throttle from '../../shared/throttle.js'\nimport { Heading } from '../../components/heading.js'\n\nconst componentType = 'image'\nconst componentName = 'scene_banner'\n\n/** Hook\uFF1A\u76D1\u542C\u7A97\u53E3\u5BBD\u5EA6 */\ntype ItemType = {\n /** \u6807\u9898\u6587\u672C */\n title: string\n /** \u56FE\u7247*/\n img: Img\n mobileImg?: Img\n /** \u5185\u5BB9\u8282\u70B9 */\n subTitle: string\n link?: string\n imgLink?: string\n}\n\nexport type AccordionCardsType = {\n className?: string\n data: {\n key?: string\n title?: string\n products: Array<ItemType>\n /** \u6309\u94AE\u5F62\u72B6 */\n shape?: 'round' | 'square'\n /** \u5361\u7247\u5F62\u72B6 */\n itemShape?: 'round' | 'square'\n /** \u4E3B\u6309\u94AE\u914D\u7F6E */\n primaryButton?: string\n theme?: 'light' | 'dark'\n }\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: {\n primaryButton?: (v: any, index: number) => void\n }\n}\n\nconst AccordionCardsPcItem = ({\n item,\n idx,\n itemShape,\n hoverIndex,\n getRef,\n handleSwiperItemClick,\n isAnimation,\n contentWidth,\n primaryButton,\n event,\n data,\n accordionRef,\n}: {\n item: ItemType\n idx: number\n itemShape: 'round' | 'square' | undefined\n hoverIndex: number | null\n getRef: (idx: number, el: HTMLDivElement) => void\n handleSwiperItemClick: (idx: number) => void\n isAnimation: any\n contentWidth: number\n primaryButton: string | undefined\n event: any\n data: AccordionCardsType['data']\n accordionRef: React.MutableRefObject<HTMLDivElement[]>\n}) => {\n const isExpanded = hoverIndex === idx\n const flexValue = isExpanded ? 8 : 1\n\n useExposure({ current: accordionRef.current[idx] } as RefObject<HTMLDivElement>, {\n componentType,\n componentName,\n componentTitle: item?.title,\n position: idx + 1,\n componentDescription: item?.subTitle,\n })\n\n return (\n <div\n key={idx}\n style={{\n flex: `${flexValue} 1 0%`,\n transition: 'all 0.6s',\n }}\n ref={(el: HTMLDivElement | null) => {\n if (el) getRef(idx, el)\n }}\n className={cn('relative cursor-pointer overflow-hidden', itemShape === 'round' ? 'rounded-2xl' : '')}\n onMouseEnter={() => handleSwiperItemClick(idx)}\n onMouseLeave={() => {\n isAnimation.current = false\n }}\n onClick={() => {\n handleSwiperItemClick(idx)\n }}\n >\n <a\n href={trackUrlRef(item?.imgLink, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${item?.title}#${item?.subTitle}`}\n >\n <Picture\n source={item?.img?.url}\n className=\"size-full object-cover [&_img]:h-full [&_img]:object-cover\"\n alt={item?.img?.alt || ''}\n />\n </a>\n <div\n style={{\n width: contentWidth,\n }}\n className={cn(\n 'absolute inset-x-0 bottom-0 flex w-full items-end justify-between overflow-hidden px-8 pb-8 opacity-0 transition-opacity duration-[600ms] ease-in',\n isExpanded && contentWidth ? 'opacity-100' : 'opacity-0'\n )}\n >\n <div className=\"mr-16 flex-1 overflow-hidden\">\n <Heading as=\"h3\" className=\"laptop:text-2xl desktop:text-[32px] text-info-primary mb-1 text-xl font-bold\">\n {item?.title}\n </Heading>\n <Heading\n as=\"h4\"\n className=\"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary line-clamp-2 text-[14px] font-[700]\"\n >\n {item?.subTitle}\n </Heading>\n </div>\n <Button\n className={cn('mb-1.5 font-bold')}\n as=\"a\"\n href={trackUrlRef(item?.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${item?.title}#${item?.subTitle}#${primaryButton}`}\n onClick={() => event?.primaryButton?.(data, idx)}\n >\n {primaryButton}\n <span className=\"sr-only\">{item?.title ?? item?.subTitle}</span>\n </Button>\n </div>\n </div>\n )\n}\n\nconst MobileItem = ({ data, configuration }: { data: ItemType; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n position: configuration?.index + 1,\n componentDescription: data?.subTitle,\n })\n \n return (\n <div\n ref={ref}\n className={cn(\n 'bg-container-secondary-1 relative w-full shrink-0 grow-0 overflow-hidden border border-solid',\n configuration?.itemShape === 'round' ? 'rounded-2xl' : ''\n )}\n >\n <a\n href={trackUrlRef(data?.imgLink, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}@${data?.subTitle}`}\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n >\n <Picture\n className=\"size-full object-cover [&_img]:h-full [&_img]:object-cover\"\n source={data?.mobileImg?.url || ''}\n alt={data?.mobileImg?.alt || ''}\n />\n </a>\n <div className={cn('absolute inset-x-0 bottom-0 overflow-hidden px-4 pb-4')}>\n <div className=\"tablet:mb-6 mb-4 flex-1 overflow-hidden\">\n <p className=\"text-info-primary text-2xl font-bold leading-[1.2]\">{data?.title}</p>\n <h3 className=\"text-info-primary line-clamp-2 text-sm font-semibold\">{data?.subTitle}</h3>\n </div>\n\n <Button\n as=\"a\"\n variant=\"secondary\"\n aria-label={data?.title ?? data?.subTitle}\n className={cn('text-info-primary text-sm font-bold')}\n href={trackUrlRef(data.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n data-headless-title-desc-button={`${data?.title}#${data?.subTitle}#${configuration?.primaryButton}`}\n >\n {configuration?.primaryButton}\n </Button>\n </div>\n </div>\n )\n}\n\nconst AccordionCards = React.forwardRef<HTMLDivElement, AccordionCardsType>(({ data, className = '', event }, ref) => {\n const [hoverIndex, setHoverIndex] = useState<number | null>(0)\n\n const hoverIndexRef = useRef<number>(0)\n const accordionRef = useRef<HTMLDivElement[]>([])\n const isAnimation = useRef<boolean>(false)\n const [contentWidth, setContentWidth] = useState<number>(0)\n\n const innerRef = useRef<HTMLDivElement>(null)\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n const getRef = (index: number, el: HTMLDivElement) => {\n if (el) {\n accordionRef.current[index] = el\n }\n }\n\n useEffect(() => {\n const handleResize = () => {\n if (accordionRef.current[hoverIndexRef.current]) {\n setContentWidth(accordionRef.current[hoverIndexRef.current].offsetWidth)\n }\n }\n handleResize()\n const throttleResize = throttle(handleResize, 300)\n window.addEventListener('resize', throttleResize)\n return () => window.removeEventListener('resize', throttleResize)\n }, [])\n\n\n\n const handleSwiperItemClick = useCallback(\n (idx: number) => {\n if (hoverIndex === idx || isAnimation.current) return\n isAnimation.current = true\n // \u66F4\u65B0\u5BBD\u5EA6\u76F8\u5173\u72B6\u6001\n setHoverIndex(idx)\n hoverIndexRef.current = idx\n },\n [data?.products, hoverIndex]\n )\n\n return (\n <>\n {data?.title && <Title data={{ title: data?.title }} />}\n <div ref={innerRef} className={cn('laptop:block hidden', { 'aiui-dark': data?.theme === 'dark' })}>\n <div\n className={cn(\n 'lg-desktop:h-[calc(560_/_1920*100vw)] desktop:h-[calc(448_/_1440*100vw)] laptop:h-[calc(336_/_1025*100vw)] flex max-h-[560px] min-h-[336px] w-full gap-4 overflow-hidden',\n className\n )}\n >\n {data?.products?.map((item, idx) => (\n <AccordionCardsPcItem\n key={idx}\n item={item}\n idx={idx}\n itemShape={data?.itemShape}\n hoverIndex={hoverIndex}\n getRef={getRef}\n handleSwiperItemClick={handleSwiperItemClick}\n isAnimation={isAnimation}\n contentWidth={contentWidth}\n primaryButton={data?.primaryButton}\n event={event}\n data={data}\n accordionRef={accordionRef}\n />\n ))}\n </div>\n </div>\n <div className={cn('laptop:hidden block', { 'aiui-dark': data?.theme === 'dark' })}>\n <SwiperBox\n className={cn('h-[400px] !overflow-visible', className)}\n id={'AccordionCards' + data?.key}\n data={{\n list: data?.products,\n configuration: {\n shape: data?.shape,\n itemShape: data?.itemShape,\n primaryButton: data?.primaryButton,\n event: event,\n title: data?.title,\n },\n }}\n Slide={MobileItem}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n }}\n />\n </div>\n </>\n )\n})\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c,OAAO,EAAE,WAAW,CAE3E,EACAI,EAAa,EACb,MAAMC,KAAiB,EAAAC,SAASF,EAAc,GAAG,EACjD,cAAO,iBAAiB,SAAUC,CAAc,EACzC,IAAM,OAAO,oBAAoB,SAAUA,CAAc,CAClE,EAAG,CAAC,CAAC,
|
|
4
|
+
"sourcesContent": ["'use client'\nimport Title from '../Title/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport Button from '../../components/button.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport React, { useState, useRef, useCallback, useImperativeHandle, useEffect, type RefObject } from 'react'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport type { Img } from '../../types/props.js'\nimport throttle from '../../shared/throttle.js'\nimport { Heading } from '../../components/heading.js'\n\nconst componentType = 'image'\nconst componentName = 'scene_banner'\n\n/** Hook\uFF1A\u76D1\u542C\u7A97\u53E3\u5BBD\u5EA6 */\ntype ItemType = {\n /** \u6807\u9898\u6587\u672C */\n title: string\n /** \u56FE\u7247*/\n img: Img\n mobileImg?: Img\n /** \u5185\u5BB9\u8282\u70B9 */\n subTitle: string\n link?: string\n imgLink?: string\n}\n\nexport type AccordionCardsType = {\n className?: string\n data: {\n key?: string\n title?: string\n products: Array<ItemType>\n /** \u6309\u94AE\u5F62\u72B6 */\n shape?: 'round' | 'square'\n /** \u5361\u7247\u5F62\u72B6 */\n itemShape?: 'round' | 'square'\n /** \u4E3B\u6309\u94AE\u914D\u7F6E */\n primaryButton?: string\n theme?: 'light' | 'dark'\n }\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: {\n primaryButton?: (v: any, index: number) => void\n }\n}\n\nconst AccordionCardsPcItem = ({\n item,\n idx,\n itemShape,\n hoverIndex,\n getRef,\n handleSwiperItemClick,\n isAnimation,\n contentWidth,\n primaryButton,\n event,\n data,\n accordionRef,\n}: {\n item: ItemType\n idx: number\n itemShape: 'round' | 'square' | undefined\n hoverIndex: number | null\n getRef: (idx: number, el: HTMLDivElement) => void\n handleSwiperItemClick: (idx: number) => void\n isAnimation: any\n contentWidth: number\n primaryButton: string | undefined\n event: any\n data: AccordionCardsType['data']\n accordionRef: React.MutableRefObject<HTMLDivElement[]>\n}) => {\n const isExpanded = hoverIndex === idx\n const flexValue = isExpanded ? 8 : 1\n\n useExposure({ current: accordionRef.current[idx] } as RefObject<HTMLDivElement>, {\n componentType,\n componentName,\n componentTitle: item?.title,\n position: idx + 1,\n componentDescription: item?.subTitle,\n })\n\n return (\n <div\n key={idx}\n style={{\n flex: `${flexValue} 1 0%`,\n transition: 'all 0.6s',\n }}\n ref={(el: HTMLDivElement | null) => {\n if (el) getRef(idx, el)\n }}\n className={cn('relative cursor-pointer overflow-hidden', itemShape === 'round' ? 'rounded-2xl' : '')}\n onMouseEnter={() => handleSwiperItemClick(idx)}\n onMouseLeave={() => {\n isAnimation.current = false\n }}\n onClick={() => {\n handleSwiperItemClick(idx)\n }}\n >\n <a\n href={trackUrlRef(item?.imgLink, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${item?.title}#${item?.subTitle}`}\n >\n <Picture\n source={item?.img?.url}\n className=\"size-full object-cover [&_img]:h-full [&_img]:object-cover\"\n alt={item?.img?.alt || ''}\n />\n </a>\n <div\n style={{\n width: contentWidth,\n }}\n className={cn(\n 'absolute inset-x-0 bottom-0 flex w-full items-end justify-between overflow-hidden px-8 pb-8 opacity-0 transition-opacity duration-[600ms] ease-in',\n isExpanded && contentWidth ? 'opacity-100' : 'opacity-0'\n )}\n >\n <div className=\"mr-16 flex-1 overflow-hidden\">\n <Heading as=\"h3\" className=\"laptop:text-2xl desktop:text-[32px] text-info-primary mb-1 text-xl font-bold\">\n {item?.title}\n </Heading>\n <Heading\n as=\"h4\"\n className=\"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary line-clamp-2 text-[14px] font-[700]\"\n >\n {item?.subTitle}\n </Heading>\n </div>\n <Button\n className={cn('mb-1.5 font-bold')}\n as=\"a\"\n href={trackUrlRef(item?.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${item?.title}#${item?.subTitle}#${primaryButton}`}\n onClick={() => event?.primaryButton?.(data, idx)}\n >\n {primaryButton}\n <span className=\"sr-only\">{item?.title ?? item?.subTitle}</span>\n </Button>\n </div>\n </div>\n )\n}\n\nconst MobileItem = ({ data, configuration }: { data: ItemType; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n position: configuration?.index + 1,\n componentDescription: data?.subTitle,\n })\n \n return (\n <div\n ref={ref}\n className={cn(\n 'bg-container-secondary-1 relative w-full shrink-0 grow-0 overflow-hidden border border-solid',\n configuration?.itemShape === 'round' ? 'rounded-2xl' : ''\n )}\n >\n <a\n href={trackUrlRef(data?.imgLink, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}@${data?.subTitle}`}\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n >\n <Picture\n className=\"size-full object-cover [&_img]:h-full [&_img]:object-cover\"\n source={data?.mobileImg?.url || ''}\n alt={data?.mobileImg?.alt || ''}\n />\n </a>\n <div className={cn('absolute inset-x-0 bottom-0 overflow-hidden px-4 pb-4')}>\n <div className=\"tablet:mb-6 mb-4 flex-1 overflow-hidden\">\n <p className=\"text-info-primary text-2xl font-bold leading-[1.2]\">{data?.title}</p>\n <h3 className=\"text-info-primary line-clamp-2 text-sm font-semibold\">{data?.subTitle}</h3>\n </div>\n\n <Button\n as=\"a\"\n variant=\"secondary\"\n aria-label={data?.title ?? data?.subTitle}\n className={cn('text-info-primary text-sm font-bold')}\n href={trackUrlRef(data.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n data-headless-title-desc-button={`${data?.title}#${data?.subTitle}#${configuration?.primaryButton}`}\n >\n {configuration?.primaryButton}\n </Button>\n </div>\n </div>\n )\n}\n\nconst AccordionCards = React.forwardRef<HTMLDivElement, AccordionCardsType>(({ data, className = '', event }, ref) => {\n const [hoverIndex, setHoverIndex] = useState<number | null>(0)\n\n const hoverIndexRef = useRef<number>(0)\n const accordionRef = useRef<HTMLDivElement[]>([])\n const isAnimation = useRef<boolean>(false)\n const [contentWidth, setContentWidth] = useState<number>(0)\n\n const innerRef = useRef<HTMLDivElement>(null)\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n const getRef = (index: number, el: HTMLDivElement) => {\n if (el) {\n accordionRef.current[index] = el\n }\n }\n\n useEffect(() => {\n const handleResize = () => {\n if (accordionRef.current[hoverIndexRef.current]) {\n setContentWidth(accordionRef.current[hoverIndexRef.current].offsetWidth)\n }\n }\n handleResize()\n const throttleResize = throttle(handleResize, 300)\n window.addEventListener('resize', throttleResize)\n return () => window.removeEventListener('resize', throttleResize)\n }, [])\n\n const handleSwiperItemClick = useCallback(\n (idx: number) => {\n if (hoverIndex === idx || isAnimation.current) return\n isAnimation.current = true\n // \u66F4\u65B0\u5BBD\u5EA6\u76F8\u5173\u72B6\u6001\n setHoverIndex(idx)\n hoverIndexRef.current = idx\n },\n [data?.products, hoverIndex]\n )\n\n return (\n <>\n {data?.title && <Title data={{ title: data?.title }} />}\n <div ref={innerRef} className={cn('laptop:block hidden', { 'aiui-dark': data?.theme === 'dark' })}>\n <div\n className={cn(\n 'lg-desktop:h-[calc(560_/_1920*100vw)] desktop:h-[calc(448_/_1440*100vw)] laptop:h-[calc(336_/_1025*100vw)] flex max-h-[560px] min-h-[336px] w-full gap-4 overflow-hidden',\n className\n )}\n >\n {data?.products?.map((item, idx) => (\n <AccordionCardsPcItem\n key={idx}\n item={item}\n idx={idx}\n itemShape={data?.itemShape}\n hoverIndex={hoverIndex}\n getRef={getRef}\n handleSwiperItemClick={handleSwiperItemClick}\n isAnimation={isAnimation}\n contentWidth={contentWidth}\n primaryButton={data?.primaryButton}\n event={event}\n data={data}\n accordionRef={accordionRef}\n />\n ))}\n </div>\n </div>\n <div className={cn('laptop:hidden block', { 'aiui-dark': data?.theme === 'dark' })}>\n <SwiperBox\n className={cn('h-[400px] !overflow-visible', className)}\n id={'AccordionCards' + data?.key}\n data={{\n list: data?.products,\n configuration: {\n shape: data?.shape,\n itemShape: data?.itemShape,\n primaryButton: data?.primaryButton,\n event: event,\n title: data?.title,\n },\n }}\n Slide={MobileItem}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n }}\n />\n </div>\n </>\n )\n})\nexport default withLayout(AccordionCards)\n"],
|
|
5
|
+
"mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAgHQ,IAAAI,EAAA,6BA/GRC,EAAkB,gCAClBC,EAAmB,kCACnBC,EAAoB,0CACpBC,EAAmB,yCACnBC,EAAsB,oCACtBC,EAA2B,kCAC3BC,EAAqG,oBACrGC,EAA4B,sCAC5BC,EAA4B,uCAE5BC,EAAqB,uCACrBC,EAAwB,uCAExB,MAAMC,EAAgB,QAChBC,EAAgB,eAmChBC,EAAuB,CAAC,CAC5B,KAAAC,EACA,IAAAC,EACA,UAAAC,EACA,WAAAC,EACA,OAAAC,EACA,sBAAAC,EACA,YAAAC,EACA,aAAAC,EACA,cAAAC,EACA,MAAAC,EACA,KAAAC,EACA,aAAAC,CACF,IAaM,CACJ,MAAMC,EAAaT,IAAeF,EAC5BY,EAAYD,EAAa,EAAI,EAEnC,wBAAY,CAAE,QAASD,EAAa,QAAQV,CAAG,CAAE,EAAgC,CAC/E,cAAAJ,EACA,cAAAC,EACA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KC,EACL,UAAWS,GAAM,UACjB,WAAYP,EACZ,OAAQC,EACR,sBAAuBC,EACvB,YAAaC,EACb,aAAcC,EACd,cAAeG,GAAM,cACrB,MAAOD,EACP,KAAMC,EACN,aAAcC,GAZTV,CAaP,CACD,EACH,EACF,KACA,OAAC,OAAI,aAAW,MAAG,sBAAuB,CAAE,YAAaS,GAAM,QAAU,MAAO,CAAC,EAC/E,mBAAC,EAAAsB,QAAA,CACC,aAAW,MAAG,8BAA+BV,CAAS,EACtD,GAAI,iBAAmBZ,GAAM,IAC7B,KAAM,CACJ,KAAMA,GAAM,SACZ,cAAe,CACb,MAAOA,GAAM,MACb,UAAWA,GAAM,UACjB,cAAeA,GAAM,cACrB,MAAOD,EACP,MAAOC,GAAM,KACf,CACF,EACA,MAAOO,EACP,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,CACF,EACF,EACF,GACF,CAEJ,CAAC,EACD,IAAOlC,KAAQ,cAAWqC,CAAc",
|
|
6
6
|
"names": ["AccordionCards_exports", "__export", "AccordionCards_default", "__toCommonJS", "import_jsx_runtime", "import_Title", "import_utils", "import_picture", "import_button", "import_SwiperBox", "import_Styles", "import_react", "import_useExposure", "import_trackUrlRef", "import_throttle", "import_heading", "componentType", "componentName", "AccordionCardsPcItem", "item", "idx", "itemShape", "hoverIndex", "getRef", "handleSwiperItemClick", "isAnimation", "contentWidth", "primaryButton", "event", "data", "accordionRef", "isExpanded", "flexValue", "el", "Picture", "Button", "MobileItem", "configuration", "ref", "AccordionCards", "React", "className", "setHoverIndex", "hoverIndexRef", "setContentWidth", "innerRef", "index", "handleResize", "throttleResize", "throttle", "Title", "SwiperBox"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";"use client";var m=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var n=Object.prototype.hasOwnProperty;var f=(l,t)=>{for(var p in t)m(l,p,{get:t[p],enumerable:!0})},N=(l,t,p,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of k(t))!n.call(l,o)&&o!==p&&m(l,o,{get:()=>t[o],enumerable:!(a=u(t,o))||a.enumerable});return l};var b=l=>N(m({},"__esModule",{value:!0}),l);var y={};f(y,{default:()=>I});module.exports=b(y);var e=require("react/jsx-runtime"),i=require("../../helpers/utils.js"),g=require("../../shared/Styles.js"),s=require("../../components/index.js");const v=l=>{const{data:t,className:p}=l,{title:a,img:o,mobileImg:r,list:x}=t;return(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)("div",{className:"w-full",children:[(0,e.jsxs)("div",{className:"flex desktop:items-center desktop:justify-between desktop:flex-row flex-col w-full",children:[(0,e.jsx)("div",{className:" desktop:w-[600px] lg-desktop:w-[800px]",children:a&&(0,e.jsx)(s.Text,{html:a,className:"desktop:text-[16px] lg-desktop:text-[18px] text-[14px] font-bold leading-[1.2]"})}),(0,e.jsxs)("div",{children:[o?.url&&(0,e.jsx)(s.Picture,{className:"w-[464px] rounded-2xl hidden desktop:block",imgClassName:"",source:t?.img?.url,alt:t?.img?.alt||""}),r?.url&&(0,e.jsx)(s.Picture,{className:"w-[224px] rounded-2xl block desktop:hidden",imgClassName:"",source:t?.mobileImg?.url,alt:t?.mobileImg?.alt||""})]})]}),(0,e.jsx)("div",{className:"mt-[24px] grid tablet:grid-cols-2 desktop:grid-cols-3 grid-cols-1 gap-[16px] desktop:gap-[24px] lg-desktop:gap-[32px]",children:x.map((d,c)=>(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)(s.Picture,{className:" rounded-2xl",imgClassName:"",source:d?.img?.url,alt:d?.img?.alt||""}),(0,e.jsxs)("div",{className:(0,i.cn)("text-info-primary absolute bottom-[16px] left-[16px] flex flex-col desktop:bottom-[24px] desktop:left-[24px] lg-desktop:bottom-[32px] lg-desktop:left-[32px]",{"aiui-dark":d.theme==="dark"}),children:[(0,e.jsx)(s.Text,{html:d?.title,className:" lg-desktop:text-[24px] text-[20px] font-bold leading-[1.2]"}),(0,e.jsx)(s.Text,{html:d?.desc,className:" lg-desktop:text-[16px] text-[14px] font-bold leading-[1.4]"})]})]},c))})]})})};var I=(0,g.withLayout)(v);
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/AplusDesc/index.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\nimport { cn } from '../../helpers/utils.js'\nimport type { Img } from '../../types/props.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Picture, Text } from '../../components/index.js'\n\n\ntype AplusItem = {\n img: Img\n mobileImg: Img\n title: string\n desc: string\n theme: 'light' | 'dark'\n}\n\ntype AplusDescType = {\n data: {\n title: string\n img: Img\n mobileImg: Img\n list: AplusItem[]\n }\n className?: string\n}\n\nconst AplusDesc = (props: AplusDescType) => {\n const { data, className } = props\n const { title, img , mobileImg,list} = data\n\n return (\n <>\n <div className='w-full'>\n <div className='flex desktop:items-center desktop:justify-between desktop:flex-row flex-col w-full'>\n <div className=' desktop:w-[600px] lg-desktop:w-[800px]'>\n {title && (\n <Text\n html={title}\n className=\"desktop:text-[16px] lg-desktop:text-[18px] text-[14px] font-bold leading-[1.2]\"\n />\n )}\n </div>\n <div>\n {img?.url && (\n <Picture\n className=\"w-[464px] rounded-2xl hidden desktop:block\"\n imgClassName=\"\"\n source={data?.img?.url}\n alt={data?.img?.alt || ''}\n />\n )}\n {mobileImg?.url && (\n <Picture\n className=\"w-[224px] rounded-2xl block desktop:hidden\"\n imgClassName=\"\"\n source={data?.mobileImg?.url}\n alt={data?.mobileImg?.alt || ''}\n />\n )}\n </div>\n </div>\n <div className='mt-[24px] grid tablet:grid-cols-2 desktop:grid-cols-3 grid-cols-1 gap-[16px] desktop:gap-[24px] lg-desktop:gap-[32px]'>\n {list.map((item,ind)=>(\n <div key={ind} className='relative'>\n <Picture\n className=\" rounded-2xl\"\n imgClassName=\"\"\n source={item?.img?.url}\n alt={item?.img?.alt || ''}\n />\n <div className={cn(\n 'text-info-primary absolute bottom-[16px] left-[16px] flex flex-col desktop:bottom-[24px] desktop:left-[24px] lg-desktop:bottom-[32px] lg-desktop:left-[32px]',\n {\n 'aiui-dark': item.theme === 'dark',\n }\n )}>\n <Text html={item?.title} className=\" lg-desktop:text-[24px] text-[20px] font-bold leading-[1.2]\" />\n <Text html={item?.desc} className=\" lg-desktop:text-[16px] text-[14px] font-bold leading-[1.4]\" />\n </div>\n </div>\n ))}\n </div>\n </div>\n </>\n )\n}\n\nexport default withLayout(AplusDesc)\n"],
|
|
5
|
+
"mappings": "sbAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA8BI,IAAAI,EAAA,6BA7BJC,EAAmB,kCAEnBC,EAA2B,kCAC3BC,EAA8B,qCAqB9B,MAAMC,EAAaC,GAAyB,CAC1C,KAAM,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAIF,EACtB,CAAE,MAAAG,EAAO,IAAAC,EAAM,UAAAC,EAAU,KAAAC,CAAI,EAAIL,EAEvC,SACE,mBACE,oBAAC,OAAI,UAAU,SACb,qBAAC,OAAI,UAAU,qFACX,oBAAC,OAAI,UAAU,0CACV,SAAAE,MACD,OAAC,QACG,KAAMA,EACN,UAAU,iFACd,EAEJ,KACA,QAAC,OACI,UAAAC,GAAK,QACN,OAAC,WACG,UAAU,6CACV,aAAa,GACb,OAAQH,GAAM,KAAK,IACnB,IAAKA,GAAM,KAAK,KAAO,GAC3B,EAEHI,GAAW,QACR,OAAC,WACG,UAAU,6CACV,aAAa,GACb,OAAQJ,GAAM,WAAW,IACzB,IAAKA,GAAM,WAAW,KAAO,GACjC,GAEJ,GACJ,KACA,OAAC,OAAI,UAAU,wHACV,SAAAK,EAAK,IAAI,CAACC,EAAKC,OACZ,QAAC,OAAc,UAAU,WACrB,oBAAC,WACG,UAAU,eACV,aAAa,GACb,OAAQD,GAAM,KAAK,IACnB,IAAKA,GAAM,KAAK,KAAO,GAC3B,KACA,QAAC,OAAI,aAAW,MACZ,+JACA,CACI,YAAaA,EAAK,QAAU,MAChC,CACJ,EACI,oBAAC,QAAK,KAAMA,GAAM,MAAO,UAAU,8DAA8D,KACjG,OAAC,QAAK,KAAMA,GAAM,KAAM,UAAU,8DAA8D,GACpG,IAfMC,CAgBV,CACH,EACL,GACF,EACF,CAEJ,EAEA,IAAOf,KAAQ,cAAWM,CAAS",
|
|
6
|
+
"names": ["AplusDesc_exports", "__export", "AplusDesc_default", "__toCommonJS", "import_jsx_runtime", "import_utils", "import_Styles", "import_components", "AplusDesc", "props", "data", "className", "title", "img", "mobileImg", "list", "item", "ind"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var G=Object.create;var b=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var O=Object.getPrototypeOf,W=Object.prototype.hasOwnProperty;var X=(e,t)=>{for(var l in t)b(e,l,{get:t[l],enumerable:!0})},L=(e,t,l,
|
|
1
|
+
"use strict";"use client";var G=Object.create;var b=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var O=Object.getPrototypeOf,W=Object.prototype.hasOwnProperty;var X=(e,t)=>{for(var l in t)b(e,l,{get:t[l],enumerable:!0})},L=(e,t,l,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of K(t))!W.call(e,a)&&a!==l&&b(e,a,{get:()=>t[a],enumerable:!(s=J(t,a))||s.enumerable});return e};var y=(e,t,l)=>(l=e!=null?G(O(e)):{},L(t||!e||!e.__esModule?b(l,"default",{value:e,enumerable:!0}):l,e)),Y=e=>L(b({},"__esModule",{value:!0}),e);var ee={};X(ee,{default:()=>Z});module.exports=Y(ee);var r=require("react/jsx-runtime"),o=y(require("react")),u=y(require("gsap")),m=require("gsap/dist/ScrollTrigger"),T=require("react-responsive"),z=require("react-intersection-observer"),B=y(require("../../helpers/ScrollLoadVideo.js")),g=require("../../components/index.js"),d=require("../../helpers/index.js"),E=require("../../shared/Styles.js"),D=require("../../hooks/useExposure.js"),U=require("../../shared/trackUrlRef.js"),se=require("../../components/button.js"),ie=require("../VideoModal/index.js");const k="image",w="collections_banner",S=o.default.forwardRef(({data:e,className:t},l)=>{const{title:s,subtitle:a,pcImage:N,padImage:j,mobileImage:H,pcVideo:R,padVideo:P,mobileVideo:f,isShowVideo:q,theme:_="light",blockLink:V}=e,$=(0,T.useMediaQuery)({query:"(max-width: 768px)"}),I=(0,T.useMediaQuery)({query:"(max-width: 1024px)"}),{ref:Q,inView:M}=(0,z.useInView)(),h=(0,o.useRef)(null),x=(0,o.useRef)(null),v=(0,o.useRef)(null),i=(0,o.useRef)(null),n=(0,o.useRef)(null);return(0,D.useExposure)(n,{componentType:k,componentName:w,componentTitle:s,componentDescription:a}),(0,o.useImperativeHandle)(l,()=>n.current),(0,o.useEffect)(()=>{u.default.registerPlugin(m.ScrollTrigger);function A(){if(!i.current)return;const F=n.current?.clientHeight||100;window.innerHeight<=F?h.current=m.ScrollTrigger.create({trigger:n.current,start:"top bottom",end:"bottom top",scrub:!0,onUpdate:c=>{const p=c.progress*40-20;u.default.set(i.current,{yPercent:p})}}):(v.current=m.ScrollTrigger.create({trigger:n.current,start:"top bottom",end:"bottom bottom",scrub:!0,onUpdate:c=>{const p=c.progress*20-20;u.default.set(i.current,{yPercent:p})}}),x.current=m.ScrollTrigger.create({trigger:n.current,start:"top top",end:"bottom top",scrub:!0,onUpdate:c=>{const p=c.progress*20;u.default.set(i.current,{yPercent:p})}}))}return M&&A(),()=>{h.current&&h.current.kill(),v.current&&v.current.kill(),x.current&&x.current.kill()}},[M]),(0,r.jsx)("div",{ref:Q,"data-ui-component-id":"CollectionsBanner",children:(0,r.jsxs)("div",{ref:n,className:(0,d.cn)(_==="dark"?"aiui-dark":"","text-info-primary relative w-full overflow-hidden","lg-desktop:aspect-[1920/480] desktop:aspect-[1440/384] laptop:aspect-[1024/400] tablet:aspect-[768/480] aspect-[390/430]",t),children:[V&&(0,r.jsx)("a",{tabIndex:-1,"aria-hidden":"true","aria-label":s,className:"absolute inset-0 z-10","data-headless-title-desc-button":`${s}#${a}`,"data-headless-type-name":`${k}#${w}`,href:(0,U.trackUrlRef)(V,`${k}_${w}`)}),(0,r.jsx)("div",{ref:i,className:(0,d.cn)("absolute left-0 top-0 size-full"),children:q?(0,r.jsx)(B.default,{poster:$?f?.url:I?P?.url||f?.url:R?.url,src:$?f?.url:I?P?.url||f?.url:R?.url,className:"laptop:w-full h-full",videoClassName:"h-full object-cover",muted:!0,loop:!0,playsInline:!0}):(0,r.jsx)(g.Picture,{loading:"eager",fetchPriority:"high",className:"laptop:w-full h-full",imgClassName:"h-full object-cover",alt:N?.alt||"",source:`${N?.url||""} , ${j?.url??(H?.url||"")} 1024, ${H?.url||""} 767`})}),(0,r.jsx)("div",{className:"laptop:top-1/2 laptop:-translate-y-1/2 tablet:px-8 laptop:px-16 lg-desktop:px-[calc(50%-832px)] lg-desktop:gap-8 absolute top-24 md-tablet:top-8 z-10 flex flex-col gap-6 px-4",children:(0,r.jsxs)("div",{className:"laptop:text-left max-w-[686px]",children:[s&&(0,r.jsx)(g.Heading,{as:"h2",size:5,className:(0,d.cn)("font-bold hero-banner-title"),html:s}),a&&(0,r.jsx)(g.Heading,{as:"h3",className:(0,d.cn)("hero-banner-subtitle font-heading lg-desktop:text-lg desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm font-bold"),html:a})]})})]})})});S.displayName="CollectionsBanner";var Z=(0,E.withLayout)(S);
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/CollectionsBanner/index.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef, useState, useEffect } from 'react'\nimport gsap from 'gsap'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport type { CollectionsBannerProps } from './types.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { useInView } from 'react-intersection-observer'\nimport ScrollLoadVideo from '../../helpers/ScrollLoadVideo.js'\nimport { Button, Heading, Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { sizeMap } from '../../components/button.js'\nimport { VideoModal } from '../VideoModal/index.js'\n\nconst componentType = 'image'\nconst componentName = 'collections_banner'\n\nconst CollectionsBanner = React.forwardRef<HTMLDivElement, CollectionsBannerProps>(({ data, className }, ref) => {\n const {\n title,\n subtitle,\n pcImage,\n padImage,\n mobileImage,\n pcVideo,\n padVideo,\n mobileVideo,\n isShowVideo,\n theme = 'light',\n blockLink,\n } = data\n\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const isPad = useMediaQuery({ query: '(max-width: 1024px)' })\n const { ref: inViewRef, inView } = useInView()\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n const bgTriggerRef = useRef<ScrollTrigger | null>(null)\n const boxTriggerRef = useRef<ScrollTrigger | null>(null)\n\n const bgRef = useRef<HTMLImageElement>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n componentDescription: subtitle,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n useEffect(() => {\n gsap.registerPlugin(ScrollTrigger)\n function gsapResize() {\n if (!bgRef.current) return\n const clientHeight = boxRef.current?.clientHeight || 100\n const screenHeight = window.innerHeight\n\n if (screenHeight <= clientHeight) {\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: boxRef.current,\n start: 'top bottom',\n end: 'bottom top',\n scrub: true,\n onUpdate: (self: any) => {\n const base = 40\n const value = self.progress * base - base / 2\n gsap.set(bgRef.current, { yPercent: value })\n },\n })\n } else {\n boxTriggerRef.current = ScrollTrigger.create({\n trigger: boxRef.current,\n start: 'top bottom',\n end: 'bottom bottom',\n scrub: true,\n onUpdate: (self: any) => {\n const base = 20\n const value = self.progress * base - base\n gsap.set(bgRef.current, { yPercent: value })\n },\n })\n bgTriggerRef.current = ScrollTrigger.create({\n trigger: boxRef.current,\n start: 'top top',\n end: 'bottom top',\n scrub: true,\n onUpdate: (self: any) => {\n const base = 20\n const value = self.progress * base\n gsap.set(bgRef.current, { yPercent: value })\n },\n })\n }\n }\n if (inView) gsapResize()\n return () => {\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n boxTriggerRef.current && boxTriggerRef.current.kill()\n bgTriggerRef.current && bgTriggerRef.current.kill()\n }\n }, [inView])\n\n return (\n <div ref={inViewRef} data-ui-component-id=\"CollectionsBanner\">\n <div\n ref={boxRef}\n className={cn(\n theme === 'dark' ? 'aiui-dark' : '',\n 'text-info-primary relative w-full overflow-hidden',\n 'lg-desktop:aspect-[1920/480] desktop:aspect-[1440/384] laptop:aspect-[1024/400] tablet:aspect-[768/480] aspect-[390/430]',\n className\n )}\n >\n {blockLink && (\n <a\n tabIndex={-1}\n aria-hidden=\"true\"\n aria-label={title}\n className=\"absolute inset-0 z-10\"\n data-headless-title-desc-button={`${title}#${subtitle}`}\n data-headless-type-name={`${componentType}#${componentName}`}\n href={trackUrlRef(blockLink, `${componentType}_${componentName}`)}\n />\n )}\n <div ref={bgRef} className={cn('absolute left-0 top-0 size-full')}>\n {isShowVideo ? (\n <ScrollLoadVideo\n poster={isMobile ? mobileVideo?.url : isPad ? padVideo?.url || mobileVideo?.url : pcVideo?.url}\n src={\n isMobile\n ? (mobileVideo?.url as string)\n : isPad\n ? (padVideo?.url as string) || (mobileVideo?.url as string)\n : (pcVideo?.url as string)\n }\n className=\"laptop:w-full h-full\"\n videoClassName=\"h-full object-cover\"\n muted\n loop\n playsInline\n />\n ) : (\n <Picture\n loading=\"eager\"\n fetchPriority=\"high\"\n className=\"laptop:w-full h-full\"\n imgClassName=\"h-full object-cover\"\n alt={pcImage?.alt || ''}\n source={`${pcImage?.url || ''} , ${padImage?.url ?? (mobileImage?.url || '')} 1024, ${mobileImage?.url || ''} 767`}\n />\n )}\n </div>\n\n {/* \u5185\u5BB9\u533A\u57DF */}\n <div className=\"laptop:top-1/2 laptop:-translate-y-1/2 tablet:px-8 laptop:px-16 lg-desktop:px-[calc(50%-832px)] lg-desktop:gap-8 absolute top-24 z-10 flex flex-col gap-6 px-4\">\n <div className=\"laptop:text-left max-w-[686px]\">\n {title && <Heading as=\"h2\" size={5} className={cn('font-bold hero-banner-title')} html={title} />}\n {subtitle && (\n <Heading\n as=\"h3\"\n className={cn(\n 'hero-banner-subtitle font-heading lg-desktop:text-lg desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm font-bold'\n )}\n html={subtitle}\n />\n )}\n </div>\n </div>\n </div>\n </div>\n )\n})\n\nCollectionsBanner.displayName = 'CollectionsBanner'\n\nexport default withLayout(CollectionsBanner)\n"],
|
|
5
|
-
"mappings": "ukBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,aAAAE,IAAA,eAAAC,EAAAH,IAqHU,IAAAI,EAAA,6BApHVC,EAAwE,oBACxEC,EAAiB,mBACjBC,EAA8B,mCAE9BC,EAA8B,4BAC9BC,EAA0B,uCAC1BC,EAA4B,+CAC5BC,EAA+C,qCAC/CC,EAAmB,kCACnBC,EAA2B,kCAC3BC,EAA4B,sCAC5BC,EAA4B,uCAC5BC,GAAwB,sCACxBC,GAA2B,kCAE3B,MAAMC,EAAgB,QAChBC,EAAgB,qBAEhBC,EAAoB,EAAAC,QAAM,WAAmD,CAAC,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAGC,IAAQ,CAC/G,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AI,UAAU,
|
|
4
|
+
"sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef, useState, useEffect } from 'react'\nimport gsap from 'gsap'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport type { CollectionsBannerProps } from './types.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { useInView } from 'react-intersection-observer'\nimport ScrollLoadVideo from '../../helpers/ScrollLoadVideo.js'\nimport { Button, Heading, Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { sizeMap } from '../../components/button.js'\nimport { VideoModal } from '../VideoModal/index.js'\n\nconst componentType = 'image'\nconst componentName = 'collections_banner'\n\nconst CollectionsBanner = React.forwardRef<HTMLDivElement, CollectionsBannerProps>(({ data, className }, ref) => {\n const {\n title,\n subtitle,\n pcImage,\n padImage,\n mobileImage,\n pcVideo,\n padVideo,\n mobileVideo,\n isShowVideo,\n theme = 'light',\n blockLink,\n } = data\n\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const isPad = useMediaQuery({ query: '(max-width: 1024px)' })\n const { ref: inViewRef, inView } = useInView()\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n const bgTriggerRef = useRef<ScrollTrigger | null>(null)\n const boxTriggerRef = useRef<ScrollTrigger | null>(null)\n\n const bgRef = useRef<HTMLImageElement>(null)\n const boxRef = useRef<HTMLDivElement>(null)\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n componentDescription: subtitle,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n useEffect(() => {\n gsap.registerPlugin(ScrollTrigger)\n function gsapResize() {\n if (!bgRef.current) return\n const clientHeight = boxRef.current?.clientHeight || 100\n const screenHeight = window.innerHeight\n\n if (screenHeight <= clientHeight) {\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: boxRef.current,\n start: 'top bottom',\n end: 'bottom top',\n scrub: true,\n onUpdate: (self: any) => {\n const base = 40\n const value = self.progress * base - base / 2\n gsap.set(bgRef.current, { yPercent: value })\n },\n })\n } else {\n boxTriggerRef.current = ScrollTrigger.create({\n trigger: boxRef.current,\n start: 'top bottom',\n end: 'bottom bottom',\n scrub: true,\n onUpdate: (self: any) => {\n const base = 20\n const value = self.progress * base - base\n gsap.set(bgRef.current, { yPercent: value })\n },\n })\n bgTriggerRef.current = ScrollTrigger.create({\n trigger: boxRef.current,\n start: 'top top',\n end: 'bottom top',\n scrub: true,\n onUpdate: (self: any) => {\n const base = 20\n const value = self.progress * base\n gsap.set(bgRef.current, { yPercent: value })\n },\n })\n }\n }\n if (inView) gsapResize()\n return () => {\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n boxTriggerRef.current && boxTriggerRef.current.kill()\n bgTriggerRef.current && bgTriggerRef.current.kill()\n }\n }, [inView])\n\n return (\n <div ref={inViewRef} data-ui-component-id=\"CollectionsBanner\">\n <div\n ref={boxRef}\n className={cn(\n theme === 'dark' ? 'aiui-dark' : '',\n 'text-info-primary relative w-full overflow-hidden',\n 'lg-desktop:aspect-[1920/480] desktop:aspect-[1440/384] laptop:aspect-[1024/400] tablet:aspect-[768/480] aspect-[390/430]',\n className\n )}\n >\n {blockLink && (\n <a\n tabIndex={-1}\n aria-hidden=\"true\"\n aria-label={title}\n className=\"absolute inset-0 z-10\"\n data-headless-title-desc-button={`${title}#${subtitle}`}\n data-headless-type-name={`${componentType}#${componentName}`}\n href={trackUrlRef(blockLink, `${componentType}_${componentName}`)}\n />\n )}\n <div ref={bgRef} className={cn('absolute left-0 top-0 size-full')}>\n {isShowVideo ? (\n <ScrollLoadVideo\n poster={isMobile ? mobileVideo?.url : isPad ? padVideo?.url || mobileVideo?.url : pcVideo?.url}\n src={\n isMobile\n ? (mobileVideo?.url as string)\n : isPad\n ? (padVideo?.url as string) || (mobileVideo?.url as string)\n : (pcVideo?.url as string)\n }\n className=\"laptop:w-full h-full\"\n videoClassName=\"h-full object-cover\"\n muted\n loop\n playsInline\n />\n ) : (\n <Picture\n loading=\"eager\"\n fetchPriority=\"high\"\n className=\"laptop:w-full h-full\"\n imgClassName=\"h-full object-cover\"\n alt={pcImage?.alt || ''}\n source={`${pcImage?.url || ''} , ${padImage?.url ?? (mobileImage?.url || '')} 1024, ${mobileImage?.url || ''} 767`}\n />\n )}\n </div>\n\n {/* \u5185\u5BB9\u533A\u57DF */}\n <div className=\"laptop:top-1/2 laptop:-translate-y-1/2 tablet:px-8 laptop:px-16 lg-desktop:px-[calc(50%-832px)] lg-desktop:gap-8 absolute top-24 md-tablet:top-8 z-10 flex flex-col gap-6 px-4\">\n <div className=\"laptop:text-left max-w-[686px]\">\n {title && <Heading as=\"h2\" size={5} className={cn('font-bold hero-banner-title')} html={title} />}\n {subtitle && (\n <Heading\n as=\"h3\"\n className={cn(\n 'hero-banner-subtitle font-heading lg-desktop:text-lg desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm font-bold'\n )}\n html={subtitle}\n />\n )}\n </div>\n </div>\n </div>\n </div>\n )\n})\n\nCollectionsBanner.displayName = 'CollectionsBanner'\n\nexport default withLayout(CollectionsBanner)\n"],
|
|
5
|
+
"mappings": "ukBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,aAAAE,IAAA,eAAAC,EAAAH,IAqHU,IAAAI,EAAA,6BApHVC,EAAwE,oBACxEC,EAAiB,mBACjBC,EAA8B,mCAE9BC,EAA8B,4BAC9BC,EAA0B,uCAC1BC,EAA4B,+CAC5BC,EAA+C,qCAC/CC,EAAmB,kCACnBC,EAA2B,kCAC3BC,EAA4B,sCAC5BC,EAA4B,uCAC5BC,GAAwB,sCACxBC,GAA2B,kCAE3B,MAAMC,EAAgB,QAChBC,EAAgB,qBAEhBC,EAAoB,EAAAC,QAAM,WAAmD,CAAC,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAGC,IAAQ,CAC/G,KA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,UAAU,iLACb,oBAAC,OAAI,UAAU,iCACZ,UAAAJ,MAAS,OAAC,WAAQ,GAAG,KAAK,KAAM,EAAG,aAAW,MAAG,6BAA6B,EAAG,KAAMA,EAAO,EAC9FC,MACC,OAAC,WACC,GAAG,KACH,aAAW,MACT,2HACF,EACA,KAAMA,EACR,GAEJ,EACF,GACF,EACF,CAEJ,CAAC,EAEDN,EAAkB,YAAc,oBAEhC,IAAOlB,KAAQ,cAAWkB,CAAiB",
|
|
6
6
|
"names": ["CollectionsBanner_exports", "__export", "CollectionsBanner_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_gsap", "import_ScrollTrigger", "import_react_responsive", "import_react_intersection_observer", "import_ScrollLoadVideo", "import_components", "import_helpers", "import_Styles", "import_useExposure", "import_trackUrlRef", "import_button", "import_VideoModal", "componentType", "componentName", "CollectionsBanner", "React", "data", "className", "ref", "title", "subtitle", "pcImage", "padImage", "mobileImage", "pcVideo", "padVideo", "mobileVideo", "isShowVideo", "theme", "blockLink", "isMobile", "isPad", "inViewRef", "inView", "scrollTriggerRef", "bgTriggerRef", "boxTriggerRef", "bgRef", "boxRef", "gsap", "gsapResize", "clientHeight", "self", "value", "ScrollLoadVideo"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var O=Object.create;var x=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var H=(o,a)=>{for(var l in a)x(o,l,{get:a[l],enumerable:!0})},L=(o,a,l,w)=>{if(a&&typeof a=="object"||typeof a=="function")for(let f of Y(a))!E.call(o,f)&&f!==l&&x(o,f,{get:()=>a[f],enumerable:!(w=V(a,f))||w.enumerable});return o};var Q=(o,a,l)=>(l=o!=null?O(q(o)):{},L(a||!o||!o.__esModule?x(l,"default",{value:o,enumerable:!0}):l,o)),Z=o=>L(x({},"__esModule",{value:!0}),o);var K={};H(K,{default:()=>J});module.exports=Z(K);var t=require("react/jsx-runtime"),C=require("../../helpers/utils.js"),N=require("react-responsive"),M=Q(require("./FilterCardWrapItem")),s=require("react"),R=require("es-toolkit");const G=(o,a)=>{const{shopifyData:l={},isSale:w=!1,total:f,result:i,closeFilter:h,page:y,metafields:S,refreshStarRating:j,onPrimaryChange:z,onSecondaryChange:T,onNextPage:P,onPrevPage:W}=o,{advertisingSpace:k}=S,{buttonText:B,loadMoreText:A}=l,u=k||l?.advertisingSpace,F=(0,s.useRef)(null),[v,b]=(0,s.useState)([]),c=(0,N.useMediaQuery)({query:"(max-width: 1024px)"}),D=d=>{const e=(0,R.cloneDeep)(d||[]);if(u){const n=e.findIndex(m=>m.mImage);if(n===-1){const m=Math.min(h?u?.maxLocation||7:u?.minLocation||5,e.length);e.splice(m,0,u)}else{e.splice(n,1);const m=Math.min(h?u?.maxLocation||7:u?.minLocation||5,e.length);e.splice(m,0,u)}}return e};(0,s.useImperativeHandle)(a,()=>({clearData(){b([])}}));const I=()=>{const d=F.current;if(!d)return;const e=d.getBoundingClientRect()?.top+window?.pageYOffset;window?.scrollTo?.({top:e,behavior:"smooth"})};return(0,s.useEffect)(()=>{(i?.slug||i?.id)&&((y===1||!c)&&b([]),i?.products&&b(d=>{const e=i.products?.filter?.(r=>!d.some(p=>p.id===r.id));let n=[...d,...e];const m=n.filter?.(r=>!(!r?.metafields?.seoSetting?.noindex&&r.availableForSale&&r?.variants?.some(p=>p.availableForSale)));return n.push(...m),n=n.filter?.(r=>!r?.metafields?.seoSetting?.noindex&&r.availableForSale&&r?.variants?.some(p=>p.availableForSale)),w&&(n=n.filter?.(r=>{let p=!1;if(r?.options?.find(g=>g?.displayName==="color"))p=r?.variants?.find(g=>g?.coupons?.length&&g?.coupons?.[0]&&typeof g?.coupons?.[0]=="object");else{const g=r?.variants?.[0]?.coupons;p=g?.length&&g?.[0]&&typeof g?.[0]=="object"}return!!p})),(y===1&&!c||c)&&(n=D(n)),n}))},[i?.products,y,c,k]),(0,s.useEffect)(()=>{v?.length&&y===1&&!c&&b(D(v))},[h]),(0,s.useEffect)(()=>{v?.length&&j?.()},[v]),(0,t.jsxs)("div",{className:"filter-card-wrap-container",ref:F,children:[(0,t.jsx)("div",{className:(0,C.cn)("min-h-[60vh] w-full grid gap-3 md-tablet:grid-cols-2 grid-cols-3",{"laptop:grid-cols-4 tablet:grid-cols-3":h&&!c,"laptop:grid-cols-3 tablet:grid-cols-2":!h&&!c},"filter-card-wrap"),children:v?.map?.(d=>(0,t.jsx)(M.default,{data:d,buttonText:B,metafields:S,onPrimaryChange:(e,n)=>z?.(e,n),onSecondaryChange:(e,n)=>T?.(e,n)},d.id))}),c?(0,t.jsxs)("div",{onClick:()=>{P?.(i?.pageInfo?.endCursor)},className:"mt-6 text-sm font-bold cursor-pointer flex items-center justify-center gap-1 filter-card-wrap-more",children:[(0,t.jsx)("span",{children:A||"View More"}),(0,t.jsx)("div",{className:"size-[18px]",children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"6",viewBox:"0 0 12 6",fill:"none",children:(0,t.jsx)("path",{d:"M9.96967 0.21967C10.2626 -0.0732232 10.7373 -0.073223 11.0302 0.21967C11.3231 0.512563 11.3231 0.987324 11.0302 1.28022L6.53022 5.78022C6.23732 6.07311 5.76256 6.07311 5.46967 5.78022L0.96967 1.28022C0.676777 0.987324 0.676777 0.512563 0.96967 0.21967C1.26256 -0.0732233 1.73732 -0.0732233 2.03022 0.21967L5.99994 4.1894L9.96967 0.21967Z",fill:"#1D1D1F"})})})]}):null,!c&&f>18?(0,t.jsxs)("div",{className:"mt-6 flex items-center justify-end gap-4 cursor-pointer",children:[(0,t.jsx)("button",{name:"perv page",disabled:!i?.pageInfo?.hasPreviousPage,className:(0,C.cn)("flex items-center justify-center lg-desktop:size-14 size-10 rounded-full leading-tight overflow-hidden bg-transparent border-[1.5px] border-[#3D3D3F]",{"opacity-50 cursor-not-allowed":!i?.pageInfo?.hasPreviousPage}),onClick:()=>{I?.(),W?.(i?.pageInfo?.startCursor)},children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:(0,t.jsx)("path",{d:"M12 5L7 10L12 15",stroke:"#3D3D3F","stroke-width":"1.66667","stroke-linecap":"round","stroke-linejoin":"round"})})}),(0,t.jsx)("button",{name:"next page",className:(0,C.cn)("flex items-center justify-center lg-desktop:size-14 size-10 rounded-full leading-tight overflow-hidden bg-transparent border-[1.5px] border-[#3D3D3F]",{"opacity-50 cursor-not-allowed":!i?.pageInfo?.hasNextPage}),disabled:!i?.pageInfo?.hasNextPage,onClick:()=>{I?.(),P?.(i?.pageInfo?.endCursor)},children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:(0,t.jsx)("path",{d:"M7.5 5L12.5 10L7.5 15",stroke:"#3D3D3F","stroke-width":"1.66667","stroke-linecap":"round","stroke-linejoin":"round"})})})]}):null]})};var J=(0,s.forwardRef)(G);
|
|
1
|
+
"use strict";var O=Object.create;var x=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var H=(o,a)=>{for(var l in a)x(o,l,{get:a[l],enumerable:!0})},L=(o,a,l,w)=>{if(a&&typeof a=="object"||typeof a=="function")for(let f of Y(a))!E.call(o,f)&&f!==l&&x(o,f,{get:()=>a[f],enumerable:!(w=V(a,f))||w.enumerable});return o};var Q=(o,a,l)=>(l=o!=null?O(q(o)):{},L(a||!o||!o.__esModule?x(l,"default",{value:o,enumerable:!0}):l,o)),Z=o=>L(x({},"__esModule",{value:!0}),o);var K={};H(K,{default:()=>J});module.exports=Z(K);var t=require("react/jsx-runtime"),C=require("../../helpers/utils.js"),N=require("react-responsive"),M=Q(require("./FilterCardWrapItem")),s=require("react"),R=require("es-toolkit");const G=(o,a)=>{const{shopifyData:l={},isSale:w=!1,total:f,result:i,closeFilter:h,page:y,metafields:S,refreshStarRating:j,onPrimaryChange:z,onSecondaryChange:T,onNextPage:P,onPrevPage:W}=o,{advertisingSpace:k}=S,{buttonText:B,loadMoreText:A}=l,u=k||l?.advertisingSpace,F=(0,s.useRef)(null),[v,b]=(0,s.useState)([]),c=(0,N.useMediaQuery)({query:"(max-width: 1024px)"}),D=d=>{const e=(0,R.cloneDeep)(d||[]);if(u){const n=e.findIndex(m=>m.mImage);if(n===-1){const m=Math.min(h?u?.maxLocation||7:u?.minLocation||5,e.length);e.splice(m,0,u)}else{e.splice(n,1);const m=Math.min(h?u?.maxLocation||7:u?.minLocation||5,e.length);e.splice(m,0,u)}}return e};(0,s.useImperativeHandle)(a,()=>({clearData(){b([])}}));const I=()=>{const d=F.current;if(!d)return;const e=d.getBoundingClientRect()?.top+window?.pageYOffset-120;window?.scrollTo?.({top:e,behavior:"smooth"})};return(0,s.useEffect)(()=>{(i?.slug||i?.id)&&((y===1||!c)&&b([]),i?.products&&b(d=>{const e=i.products?.filter?.(r=>!d.some(p=>p.id===r.id));let n=[...d,...e];const m=n.filter?.(r=>!(!r?.metafields?.seoSetting?.noindex&&r.availableForSale&&r?.variants?.some(p=>p.availableForSale)));return n.push(...m),n=n.filter?.(r=>!r?.metafields?.seoSetting?.noindex&&r.availableForSale&&r?.variants?.some(p=>p.availableForSale)),w&&(n=n.filter?.(r=>{let p=!1;if(r?.options?.find(g=>g?.displayName==="color"))p=r?.variants?.find(g=>g?.coupons?.length&&g?.coupons?.[0]&&typeof g?.coupons?.[0]=="object");else{const g=r?.variants?.[0]?.coupons;p=g?.length&&g?.[0]&&typeof g?.[0]=="object"}return!!p})),(y===1&&!c||c)&&(n=D(n)),n}))},[i?.products,y,c,k]),(0,s.useEffect)(()=>{v?.length&&y===1&&!c&&b(D(v))},[h]),(0,s.useEffect)(()=>{v?.length&&j?.()},[v]),(0,t.jsxs)("div",{className:"filter-card-wrap-container",ref:F,children:[(0,t.jsx)("div",{className:(0,C.cn)("min-h-[60vh] w-full grid gap-3 md-tablet:grid-cols-2 grid-cols-3",{"laptop:grid-cols-4 tablet:grid-cols-3":h&&!c,"laptop:grid-cols-3 tablet:grid-cols-2":!h&&!c},"filter-card-wrap"),children:v?.map?.(d=>(0,t.jsx)(M.default,{data:d,buttonText:B,metafields:S,onPrimaryChange:(e,n)=>z?.(e,n),onSecondaryChange:(e,n)=>T?.(e,n)},d.id))}),c?(0,t.jsxs)("div",{onClick:()=>{P?.(i?.pageInfo?.endCursor)},className:"mt-6 text-sm font-bold cursor-pointer flex items-center justify-center gap-1 filter-card-wrap-more",children:[(0,t.jsx)("span",{children:A||"View More"}),(0,t.jsx)("div",{className:"size-[18px]",children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"6",viewBox:"0 0 12 6",fill:"none",children:(0,t.jsx)("path",{d:"M9.96967 0.21967C10.2626 -0.0732232 10.7373 -0.073223 11.0302 0.21967C11.3231 0.512563 11.3231 0.987324 11.0302 1.28022L6.53022 5.78022C6.23732 6.07311 5.76256 6.07311 5.46967 5.78022L0.96967 1.28022C0.676777 0.987324 0.676777 0.512563 0.96967 0.21967C1.26256 -0.0732233 1.73732 -0.0732233 2.03022 0.21967L5.99994 4.1894L9.96967 0.21967Z",fill:"#1D1D1F"})})})]}):null,!c&&f>18?(0,t.jsxs)("div",{className:"mt-6 flex items-center justify-end gap-4 cursor-pointer",children:[(0,t.jsx)("button",{name:"perv page",disabled:!i?.pageInfo?.hasPreviousPage,className:(0,C.cn)("flex items-center justify-center lg-desktop:size-14 size-10 rounded-full leading-tight overflow-hidden bg-transparent border-[1.5px] border-[#3D3D3F]",{"opacity-50 cursor-not-allowed":!i?.pageInfo?.hasPreviousPage}),onClick:()=>{I?.(),W?.(i?.pageInfo?.startCursor)},children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:(0,t.jsx)("path",{d:"M12 5L7 10L12 15",stroke:"#3D3D3F","stroke-width":"1.66667","stroke-linecap":"round","stroke-linejoin":"round"})})}),(0,t.jsx)("button",{name:"next page",className:(0,C.cn)("flex items-center justify-center lg-desktop:size-14 size-10 rounded-full leading-tight overflow-hidden bg-transparent border-[1.5px] border-[#3D3D3F]",{"opacity-50 cursor-not-allowed":!i?.pageInfo?.hasNextPage}),disabled:!i?.pageInfo?.hasNextPage,onClick:()=>{I?.(),P?.(i?.pageInfo?.endCursor)},children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:(0,t.jsx)("path",{d:"M7.5 5L12.5 10L7.5 15",stroke:"#3D3D3F","stroke-width":"1.66667","stroke-linecap":"round","stroke-linejoin":"round"})})})]}):null]})};var J=(0,s.forwardRef)(G);
|
|
2
2
|
//# sourceMappingURL=FilterCardWrap.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/CollectionsFilters/FilterCardWrap.tsx"],
|
|
4
|
-
"sourcesContent": ["import { cn } from '../../helpers/utils.js'\nimport { useMediaQuery } from 'react-responsive'\nimport FilterCardWrapItem from './FilterCardWrapItem'\nimport { useRef, useState, useEffect, forwardRef, useImperativeHandle } from 'react'\nimport type { Ref } from 'react'\nimport { cloneDeep } from 'es-toolkit'\n\ntype FilterCardWrapProps = {\n isSale?: boolean\n result?: any\n total: number\n shopifyData?: any\n currentPage?: number\n closeFilter: boolean\n page: number\n metafields: any\n refreshStarRating?: () => void\n onPrimaryChange?: (item: any, sku: string) => void\n onSecondaryChange?: (item: any, sku: string) => void\n onNextPage?: (v: string) => void\n onPrevPage?: (v: string) => void\n}\n\nconst FilterCardWrap = (props: FilterCardWrapProps, ref: Ref<unknown> | undefined) => {\n const {\n shopifyData = {},\n isSale = false,\n total,\n result,\n closeFilter,\n page,\n metafields,\n refreshStarRating,\n onPrimaryChange,\n onSecondaryChange,\n onNextPage,\n onPrevPage,\n } = props\n const { advertisingSpace } = metafields\n const { buttonText, loadMoreText } = shopifyData\n\n const currentAdvertisingSpace = advertisingSpace || shopifyData?.advertisingSpace\n\n const filterCardWrapRef = useRef<any>(null)\n\n const [data, setData] = useState<any[]>([])\n\n const isMobile = useMediaQuery({ query: '(max-width: 1024px)' })\n\n const handleAdvertisingSpace = (products: any[]) => {\n const updatedProducts = cloneDeep(products || [])\n if (currentAdvertisingSpace) {\n const findIndex = updatedProducts.findIndex(item => item.mImage)\n if (findIndex === -1) {\n const insertIndex = closeFilter\n ? Math.min(currentAdvertisingSpace?.maxLocation || 7, updatedProducts.length)\n : Math.min(currentAdvertisingSpace?.minLocation || 5, updatedProducts.length)\n updatedProducts.splice(insertIndex, 0, currentAdvertisingSpace)\n } else {\n updatedProducts.splice(findIndex, 1)\n const insertIndex = closeFilter\n ? Math.min(currentAdvertisingSpace?.maxLocation || 7, updatedProducts.length)\n : Math.min(currentAdvertisingSpace?.minLocation || 5, updatedProducts.length)\n updatedProducts.splice(insertIndex, 0, currentAdvertisingSpace)\n }\n }\n return updatedProducts\n }\n\n useImperativeHandle(ref, () => ({\n clearData() {\n setData([])\n },\n }))\n\n const onScrollTop = () => {\n const target = filterCardWrapRef.current\n if (!target) return\n const targetY = target.getBoundingClientRect()?.top + window?.pageYOffset\n window?.scrollTo?.({\n top: targetY,\n behavior: 'smooth',\n })\n }\n\n // \u5904\u7406\u4EA7\u54C1\u6570\u636E\n useEffect(() => {\n if (result?.slug || result?.id) {\n (page === 1 || !isMobile) && setData([])\n if (result?.products) {\n setData(prevProducts => {\n // \u68C0\u67E5\u662F\u5426\u5DF2\u7ECF\u5B58\u5728\u4E8E prevProducts \u4E2D\uFF0C\u907F\u514D\u91CD\u590D\u6DFB\u52A0\n const newProducts = result.products?.filter?.(\n (product: { id: any }) => !prevProducts.some(prev => prev.id === product.id)\n )\n let updatedProducts = [...prevProducts, ...newProducts]\n /** \u5DF2\u552E\u5B8C\u7684\u4EA7\u54C1 */\n const soldOutProducts = updatedProducts.filter?.(\n item =>\n !(\n !item?.metafields?.seoSetting?.noindex &&\n item.availableForSale &&\n item?.variants?.some((item: { availableForSale: any }) => item.availableForSale)\n )\n )\n // \u5C06\u5DF2\u552E\u5B8C\u7684\u4EA7\u54C1\u6DFB\u52A0\u5230\u6700\u540E\n updatedProducts.push(...soldOutProducts)\n // \u8FC7\u6EE4\u6389 availableForSale \u4E3A false \u7684\u4EA7\u54C1\n updatedProducts = updatedProducts.filter?.(\n item =>\n !item?.metafields?.seoSetting?.noindex &&\n item.availableForSale &&\n item?.variants?.some((item: { availableForSale: any }) => item.availableForSale)\n )\n // \u5982\u679C\u662F\u6709\u6298\u6263\u7684\u4EA7\u54C1\uFF0C\u5219\u8FC7\u6EE4\u6389\u6CA1\u6709\u6298\u6263\u7684\u4EA7\u54C1\n if (isSale) {\n updatedProducts = updatedProducts.filter?.((item: any) => {\n let isShow = false\n const isColor = item?.options?.find((item: any) => item?.displayName === 'color')\n if (isColor) {\n isShow = item?.variants?.find(\n (params: any) =>\n params?.coupons?.length && params?.coupons?.[0] && typeof params?.coupons?.[0] === 'object'\n )\n } else {\n const isVariants = item?.variants?.[0]?.coupons\n isShow = isVariants?.length && isVariants?.[0] && typeof isVariants?.[0] === 'object'\n }\n return !!isShow\n })\n }\n // \u5982\u679C advertisingSpace \u5B58\u5728\u4E14\u5C1A\u672A\u6DFB\u52A0\u5230\u6570\u7EC4\u4E2D\n if ((page === 1 && !isMobile) || isMobile) {\n updatedProducts = handleAdvertisingSpace(updatedProducts)\n }\n return updatedProducts\n })\n }\n }\n }, [result?.products, page, isMobile, advertisingSpace])\n\n useEffect(() => {\n if (!data?.length) return\n if (page === 1 && !isMobile) {\n setData(handleAdvertisingSpace(data))\n }\n }, [closeFilter])\n\n useEffect(() => {\n if (data?.length) {\n refreshStarRating?.()\n }\n }, [data])\n\n return (\n <div className=\"filter-card-wrap-container\" ref={filterCardWrapRef}>\n <div\n className={cn(\n 'min-h-[60vh] w-full grid gap-3 md-tablet:grid-cols-2 grid-cols-3',\n {\n 'laptop:grid-cols-4 tablet:grid-cols-3': closeFilter && !isMobile,\n 'laptop:grid-cols-3 tablet:grid-cols-2': !closeFilter && !isMobile,\n },\n 'filter-card-wrap'\n )}\n >\n {data?.map?.(item => {\n return (\n <FilterCardWrapItem\n data={item}\n key={item.id}\n buttonText={buttonText}\n metafields={metafields}\n onPrimaryChange={(e, data) => onPrimaryChange?.(e, data)}\n onSecondaryChange={(e, data) => onSecondaryChange?.(e, data)}\n />\n )\n })}\n </div>\n {isMobile ? (\n <div\n onClick={() => {\n onNextPage?.(result?.pageInfo?.endCursor)\n }}\n className=\"mt-6 text-sm font-bold cursor-pointer flex items-center justify-center gap-1 filter-card-wrap-more\"\n >\n <span>{loadMoreText || 'View More'}</span>\n <div className=\"size-[18px]\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"6\" viewBox=\"0 0 12 6\" fill=\"none\">\n <path\n d=\"M9.96967 0.21967C10.2626 -0.0732232 10.7373 -0.073223 11.0302 0.21967C11.3231 0.512563 11.3231 0.987324 11.0302 1.28022L6.53022 5.78022C6.23732 6.07311 5.76256 6.07311 5.46967 5.78022L0.96967 1.28022C0.676777 0.987324 0.676777 0.512563 0.96967 0.21967C1.26256 -0.0732233 1.73732 -0.0732233 2.03022 0.21967L5.99994 4.1894L9.96967 0.21967Z\"\n fill=\"#1D1D1F\"\n />\n </svg>\n </div>\n </div>\n ) : null}\n {!isMobile && total > 18 ? (\n <div className=\"mt-6 flex items-center justify-end gap-4 cursor-pointer\">\n <button\n name=\"perv page\"\n disabled={!result?.pageInfo?.hasPreviousPage}\n className={cn(\n 'flex items-center justify-center lg-desktop:size-14 size-10 rounded-full leading-tight overflow-hidden bg-transparent border-[1.5px] border-[#3D3D3F]',\n {\n 'opacity-50 cursor-not-allowed': !result?.pageInfo?.hasPreviousPage,\n }\n )}\n onClick={() => {\n onScrollTop?.()\n onPrevPage?.(result?.pageInfo?.startCursor)\n }}\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\n <path\n d=\"M12 5L7 10L12 15\"\n stroke=\"#3D3D3F\"\n stroke-width=\"1.66667\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n <button\n name=\"next page\"\n className={cn(\n 'flex items-center justify-center lg-desktop:size-14 size-10 rounded-full leading-tight overflow-hidden bg-transparent border-[1.5px] border-[#3D3D3F]',\n {\n 'opacity-50 cursor-not-allowed': !result?.pageInfo?.hasNextPage,\n }\n )}\n disabled={!result?.pageInfo?.hasNextPage}\n onClick={() => {\n onScrollTop?.()\n onNextPage?.(result?.pageInfo?.endCursor)\n }}\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\n <path\n d=\"M7.5 5L12.5 10L7.5 15\"\n stroke=\"#3D3D3F\"\n stroke-width=\"1.66667\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n </div>\n ) : // <Paginator\n // className=\"mt-6\"\n // currentPage={currentPage}\n // onPageChange={(v: number) => {\n // setData([])\n // if(v > currentPage) {\n // onNextPage?.(result?.pageInfo?.endCursor)\n // } else {\n // onPrevPage?.(result?.pageInfo?.startCursor)\n // }\n // setCurrentPage(v)\n // }}\n // total={100}\n // />\n null}\n </div>\n )\n}\n\nexport default forwardRef(FilterCardWrap)\n"],
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAwKY,IAAAI,EAAA,6BAxKZC,EAAmB,kCACnBC,EAA8B,4BAC9BC,EAA+B,mCAC/BC,EAA6E,iBAE7EC,EAA0B,sBAkB1B,MAAMC,EAAiB,CAACC,EAA4BC,IAAkC,CACpF,KAAM,CACJ,YAAAC,EAAc,CAAC,EACf,OAAAC,EAAS,GACT,MAAAC,EACA,OAAAC,EACA,YAAAC,EACA,KAAAC,EACA,WAAAC,EACA,kBAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,WAAAC,EACA,WAAAC,CACF,EAAIb,EACE,CAAE,iBAAAc,CAAiB,EAAIN,EACvB,CAAE,WAAAO,EAAY,aAAAC,CAAa,EAAId,EAE/Be,EAA0BH,GAAoBZ,GAAa,iBAE3DgB,KAAoB,UAAY,IAAI,EAEpC,CAACC,EAAMC,CAAO,KAAI,YAAgB,CAAC,CAAC,EAEpCC,KAAW,iBAAc,CAAE,MAAO,qBAAsB,CAAC,EAEzDC,EAA0BC,GAAoB,CAClD,MAAMC,KAAkB,aAAUD,GAAY,CAAC,CAAC,EAChD,GAAIN,EAAyB,CAC3B,MAAMQ,EAAYD,EAAgB,UAAUE,GAAQA,EAAK,MAAM,EAC/D,GAAID,IAAc,GAAI,CACpB,MAAME,EACF,KAAK,IADWrB,EACPW,GAAyB,aAAe,EACxCA,GAAyB,aAAe,EADGO,EAAgB,MAAM,EAE9EA,EAAgB,OAAOG,EAAa,EAAGV,CAAuB,CAChE,KAAO,CACLO,EAAgB,OAAOC,EAAW,CAAC,EACnC,MAAME,EACF,KAAK,IADWrB,EACPW,GAAyB,aAAe,EACxCA,GAAyB,aAAe,EADGO,EAAgB,MAAM,EAE9EA,EAAgB,OAAOG,EAAa,EAAGV,CAAuB,CAChE,CACF,CACA,OAAOO,CACT,KAEA,uBAAoBvB,EAAK,KAAO,CAC9B,WAAY,CACVmB,EAAQ,CAAC,CAAC,CACZ,CACF,EAAE,EAEF,MAAMQ,EAAc,IAAM,CACxB,MAAMC,EAASX,EAAkB,QACjC,GAAI,CAACW,EAAQ,OACb,MAAMC,EAAUD,EAAO,sBAAsB,GAAG,IAAM,QAAQ,
|
|
4
|
+
"sourcesContent": ["import { cn } from '../../helpers/utils.js'\nimport { useMediaQuery } from 'react-responsive'\nimport FilterCardWrapItem from './FilterCardWrapItem'\nimport { useRef, useState, useEffect, forwardRef, useImperativeHandle } from 'react'\nimport type { Ref } from 'react'\nimport { cloneDeep } from 'es-toolkit'\n\ntype FilterCardWrapProps = {\n isSale?: boolean\n result?: any\n total: number\n shopifyData?: any\n currentPage?: number\n closeFilter: boolean\n page: number\n metafields: any\n refreshStarRating?: () => void\n onPrimaryChange?: (item: any, sku: string) => void\n onSecondaryChange?: (item: any, sku: string) => void\n onNextPage?: (v: string) => void\n onPrevPage?: (v: string) => void\n}\n\nconst FilterCardWrap = (props: FilterCardWrapProps, ref: Ref<unknown> | undefined) => {\n const {\n shopifyData = {},\n isSale = false,\n total,\n result,\n closeFilter,\n page,\n metafields,\n refreshStarRating,\n onPrimaryChange,\n onSecondaryChange,\n onNextPage,\n onPrevPage,\n } = props\n const { advertisingSpace } = metafields\n const { buttonText, loadMoreText } = shopifyData\n\n const currentAdvertisingSpace = advertisingSpace || shopifyData?.advertisingSpace\n\n const filterCardWrapRef = useRef<any>(null)\n\n const [data, setData] = useState<any[]>([])\n\n const isMobile = useMediaQuery({ query: '(max-width: 1024px)' })\n\n const handleAdvertisingSpace = (products: any[]) => {\n const updatedProducts = cloneDeep(products || [])\n if (currentAdvertisingSpace) {\n const findIndex = updatedProducts.findIndex(item => item.mImage)\n if (findIndex === -1) {\n const insertIndex = closeFilter\n ? Math.min(currentAdvertisingSpace?.maxLocation || 7, updatedProducts.length)\n : Math.min(currentAdvertisingSpace?.minLocation || 5, updatedProducts.length)\n updatedProducts.splice(insertIndex, 0, currentAdvertisingSpace)\n } else {\n updatedProducts.splice(findIndex, 1)\n const insertIndex = closeFilter\n ? Math.min(currentAdvertisingSpace?.maxLocation || 7, updatedProducts.length)\n : Math.min(currentAdvertisingSpace?.minLocation || 5, updatedProducts.length)\n updatedProducts.splice(insertIndex, 0, currentAdvertisingSpace)\n }\n }\n return updatedProducts\n }\n\n useImperativeHandle(ref, () => ({\n clearData() {\n setData([])\n },\n }))\n\n const onScrollTop = () => {\n const target = filterCardWrapRef.current\n if (!target) return\n const targetY = target.getBoundingClientRect()?.top + window?.pageYOffset - 120\n window?.scrollTo?.({\n top: targetY,\n behavior: 'smooth',\n })\n }\n\n // \u5904\u7406\u4EA7\u54C1\u6570\u636E\n useEffect(() => {\n if (result?.slug || result?.id) {\n (page === 1 || !isMobile) && setData([])\n if (result?.products) {\n setData(prevProducts => {\n // \u68C0\u67E5\u662F\u5426\u5DF2\u7ECF\u5B58\u5728\u4E8E prevProducts \u4E2D\uFF0C\u907F\u514D\u91CD\u590D\u6DFB\u52A0\n const newProducts = result.products?.filter?.(\n (product: { id: any }) => !prevProducts.some(prev => prev.id === product.id)\n )\n let updatedProducts = [...prevProducts, ...newProducts]\n /** \u5DF2\u552E\u5B8C\u7684\u4EA7\u54C1 */\n const soldOutProducts = updatedProducts.filter?.(\n item =>\n !(\n !item?.metafields?.seoSetting?.noindex &&\n item.availableForSale &&\n item?.variants?.some((item: { availableForSale: any }) => item.availableForSale)\n )\n )\n // \u5C06\u5DF2\u552E\u5B8C\u7684\u4EA7\u54C1\u6DFB\u52A0\u5230\u6700\u540E\n updatedProducts.push(...soldOutProducts)\n // \u8FC7\u6EE4\u6389 availableForSale \u4E3A false \u7684\u4EA7\u54C1\n updatedProducts = updatedProducts.filter?.(\n item =>\n !item?.metafields?.seoSetting?.noindex &&\n item.availableForSale &&\n item?.variants?.some((item: { availableForSale: any }) => item.availableForSale)\n )\n // \u5982\u679C\u662F\u6709\u6298\u6263\u7684\u4EA7\u54C1\uFF0C\u5219\u8FC7\u6EE4\u6389\u6CA1\u6709\u6298\u6263\u7684\u4EA7\u54C1\n if (isSale) {\n updatedProducts = updatedProducts.filter?.((item: any) => {\n let isShow = false\n const isColor = item?.options?.find((item: any) => item?.displayName === 'color')\n if (isColor) {\n isShow = item?.variants?.find(\n (params: any) =>\n params?.coupons?.length && params?.coupons?.[0] && typeof params?.coupons?.[0] === 'object'\n )\n } else {\n const isVariants = item?.variants?.[0]?.coupons\n isShow = isVariants?.length && isVariants?.[0] && typeof isVariants?.[0] === 'object'\n }\n return !!isShow\n })\n }\n // \u5982\u679C advertisingSpace \u5B58\u5728\u4E14\u5C1A\u672A\u6DFB\u52A0\u5230\u6570\u7EC4\u4E2D\n if ((page === 1 && !isMobile) || isMobile) {\n updatedProducts = handleAdvertisingSpace(updatedProducts)\n }\n return updatedProducts\n })\n }\n }\n }, [result?.products, page, isMobile, advertisingSpace])\n\n useEffect(() => {\n if (!data?.length) return\n if (page === 1 && !isMobile) {\n setData(handleAdvertisingSpace(data))\n }\n }, [closeFilter])\n\n useEffect(() => {\n if (data?.length) {\n refreshStarRating?.()\n }\n }, [data])\n\n return (\n <div className=\"filter-card-wrap-container\" ref={filterCardWrapRef}>\n <div\n className={cn(\n 'min-h-[60vh] w-full grid gap-3 md-tablet:grid-cols-2 grid-cols-3',\n {\n 'laptop:grid-cols-4 tablet:grid-cols-3': closeFilter && !isMobile,\n 'laptop:grid-cols-3 tablet:grid-cols-2': !closeFilter && !isMobile,\n },\n 'filter-card-wrap'\n )}\n >\n {data?.map?.(item => {\n return (\n <FilterCardWrapItem\n data={item}\n key={item.id}\n buttonText={buttonText}\n metafields={metafields}\n onPrimaryChange={(e, data) => onPrimaryChange?.(e, data)}\n onSecondaryChange={(e, data) => onSecondaryChange?.(e, data)}\n />\n )\n })}\n </div>\n {isMobile ? (\n <div\n onClick={() => {\n onNextPage?.(result?.pageInfo?.endCursor)\n }}\n className=\"mt-6 text-sm font-bold cursor-pointer flex items-center justify-center gap-1 filter-card-wrap-more\"\n >\n <span>{loadMoreText || 'View More'}</span>\n <div className=\"size-[18px]\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"6\" viewBox=\"0 0 12 6\" fill=\"none\">\n <path\n d=\"M9.96967 0.21967C10.2626 -0.0732232 10.7373 -0.073223 11.0302 0.21967C11.3231 0.512563 11.3231 0.987324 11.0302 1.28022L6.53022 5.78022C6.23732 6.07311 5.76256 6.07311 5.46967 5.78022L0.96967 1.28022C0.676777 0.987324 0.676777 0.512563 0.96967 0.21967C1.26256 -0.0732233 1.73732 -0.0732233 2.03022 0.21967L5.99994 4.1894L9.96967 0.21967Z\"\n fill=\"#1D1D1F\"\n />\n </svg>\n </div>\n </div>\n ) : null}\n {!isMobile && total > 18 ? (\n <div className=\"mt-6 flex items-center justify-end gap-4 cursor-pointer\">\n <button\n name=\"perv page\"\n disabled={!result?.pageInfo?.hasPreviousPage}\n className={cn(\n 'flex items-center justify-center lg-desktop:size-14 size-10 rounded-full leading-tight overflow-hidden bg-transparent border-[1.5px] border-[#3D3D3F]',\n {\n 'opacity-50 cursor-not-allowed': !result?.pageInfo?.hasPreviousPage,\n }\n )}\n onClick={() => {\n onScrollTop?.()\n onPrevPage?.(result?.pageInfo?.startCursor)\n }}\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\n <path\n d=\"M12 5L7 10L12 15\"\n stroke=\"#3D3D3F\"\n stroke-width=\"1.66667\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n <button\n name=\"next page\"\n className={cn(\n 'flex items-center justify-center lg-desktop:size-14 size-10 rounded-full leading-tight overflow-hidden bg-transparent border-[1.5px] border-[#3D3D3F]',\n {\n 'opacity-50 cursor-not-allowed': !result?.pageInfo?.hasNextPage,\n }\n )}\n disabled={!result?.pageInfo?.hasNextPage}\n onClick={() => {\n onScrollTop?.()\n onNextPage?.(result?.pageInfo?.endCursor)\n }}\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\n <path\n d=\"M7.5 5L12.5 10L7.5 15\"\n stroke=\"#3D3D3F\"\n stroke-width=\"1.66667\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n </div>\n ) : // <Paginator\n // className=\"mt-6\"\n // currentPage={currentPage}\n // onPageChange={(v: number) => {\n // setData([])\n // if(v > currentPage) {\n // onNextPage?.(result?.pageInfo?.endCursor)\n // } else {\n // onPrevPage?.(result?.pageInfo?.startCursor)\n // }\n // setCurrentPage(v)\n // }}\n // total={100}\n // />\n null}\n </div>\n )\n}\n\nexport default forwardRef(FilterCardWrap)\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAwKY,IAAAI,EAAA,6BAxKZC,EAAmB,kCACnBC,EAA8B,4BAC9BC,EAA+B,mCAC/BC,EAA6E,iBAE7EC,EAA0B,sBAkB1B,MAAMC,EAAiB,CAACC,EAA4BC,IAAkC,CACpF,KAAM,CACJ,YAAAC,EAAc,CAAC,EACf,OAAAC,EAAS,GACT,MAAAC,EACA,OAAAC,EACA,YAAAC,EACA,KAAAC,EACA,WAAAC,EACA,kBAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,WAAAC,EACA,WAAAC,CACF,EAAIb,EACE,CAAE,iBAAAc,CAAiB,EAAIN,EACvB,CAAE,WAAAO,EAAY,aAAAC,CAAa,EAAId,EAE/Be,EAA0BH,GAAoBZ,GAAa,iBAE3DgB,KAAoB,UAAY,IAAI,EAEpC,CAACC,EAAMC,CAAO,KAAI,YAAgB,CAAC,CAAC,EAEpCC,KAAW,iBAAc,CAAE,MAAO,qBAAsB,CAAC,EAEzDC,EAA0BC,GAAoB,CAClD,MAAMC,KAAkB,aAAUD,GAAY,CAAC,CAAC,EAChD,GAAIN,EAAyB,CAC3B,MAAMQ,EAAYD,EAAgB,UAAUE,GAAQA,EAAK,MAAM,EAC/D,GAAID,IAAc,GAAI,CACpB,MAAME,EACF,KAAK,IADWrB,EACPW,GAAyB,aAAe,EACxCA,GAAyB,aAAe,EADGO,EAAgB,MAAM,EAE9EA,EAAgB,OAAOG,EAAa,EAAGV,CAAuB,CAChE,KAAO,CACLO,EAAgB,OAAOC,EAAW,CAAC,EACnC,MAAME,EACF,KAAK,IADWrB,EACPW,GAAyB,aAAe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I,UAAU,0DACb,oBAAC,UACC,KAAK,YACL,SAAU,CAACC,GAAQ,UAAU,gBAC7B,aAAW,MACT,wJACA,CACE,gCAAiC,CAACA,GAAQ,UAAU,eACtD,CACF,EACA,QAAS,IAAM,CACbuB,IAAc,EACdf,IAAaR,GAAQ,UAAU,WAAW,CAC5C,EAEA,mBAAC,OAAI,MAAM,6BAA6B,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OACtF,mBAAC,QACC,EAAE,mBACF,OAAO,UACP,eAAa,UACb,iBAAe,QACf,kBAAgB,QAClB,EACF,EACF,KACA,OAAC,UACC,KAAK,YACL,aAAW,MACT,wJACA,CACE,gCAAiC,CAACA,GAAQ,UAAU,WACtD,CACF,EACA,SAAU,CAACA,GAAQ,UAAU,YAC7B,QAAS,IAAM,CACbuB,IAAc,EACdhB,IAAaP,GAAQ,UAAU,SAAS,CAC1C,EAEA,mBAAC,OAAI,MAAM,6BAA6B,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OACtF,mBAAC,QACC,EAAE,wBACF,OAAO,UACP,eAAa,UACb,iBAAe,QACf,kBAAgB,QAClB,EACF,EACF,GACF,EAeF,MACF,CAEJ,EAEA,IAAOd,KAAQ,cAAWQ,CAAc",
|
|
6
6
|
"names": ["FilterCardWrap_exports", "__export", "FilterCardWrap_default", "__toCommonJS", "import_jsx_runtime", "import_utils", "import_react_responsive", "import_FilterCardWrapItem", "import_react", "import_es_toolkit", "FilterCardWrap", "props", "ref", "shopifyData", "isSale", "total", "result", "closeFilter", "page", "metafields", "refreshStarRating", "onPrimaryChange", "onSecondaryChange", "onNextPage", "onPrevPage", "advertisingSpace", "buttonText", "loadMoreText", "currentAdvertisingSpace", "filterCardWrapRef", "data", "setData", "isMobile", "handleAdvertisingSpace", "products", "updatedProducts", "findIndex", "item", "insertIndex", "onScrollTop", "target", "targetY", "prevProducts", "newProducts", "product", "prev", "soldOutProducts", "isShow", "params", "isVariants", "FilterCardWrapItem"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var ye=Object.create;var k=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var ke=Object.getOwnPropertyNames;var Ce=Object.getPrototypeOf,Ne=Object.prototype.hasOwnProperty;var _e=(e,r)=>{for(var l in r)k(e,l,{get:r[l],enumerable:!0})},J=(e,r,l,g)=>{if(r&&typeof r=="object"||typeof r=="function")for(let p of ke(r))!Ne.call(e,p)&&p!==l&&k(e,p,{get:()=>r[p],enumerable:!(g=he(r,p))||g.enumerable});return e};var P=(e,r,l)=>(l=e!=null?ye(Ce(e)):{},J(r||!e||!e.__esModule?k(l,"default",{value:e,enumerable:!0}):l,e)),Se=e=>J(k({},"__esModule",{value:!0}),e);var Te={};_e(Te,{default:()=>Ie});module.exports=Se(Te);var t=require("react/jsx-runtime"),c=require("../../helpers/utils.js"),K=require("../AiuiProvider/index.js"),Q=require("../ShelfDisplay/shelfDisplay.js"),X=P(require("../../components/badge.js")),Y=require("../../components/text.js"),B=P(require("../../components/button.js")),M=P(require("../../components/picture.js")),C=require("../../shared/trackUrlRef.js"),Z=require("./component/price.js"),n=require("react");const I="image",T="product_shelf",we=999999999e-2,$e=e=>{let r;return e?.includes("products")?r=e?.split("products")[0]+"files/":r=e?.replace(e?.split("files")?.pop()||"","")+"/",r},Pe=({data:e,buttonText:r,itemShape:l,metafields:g,onPrimaryChange:p,onSecondaryChange:ee})=>{const{memberPriceDiscount:te,memberSetting:z,discounts:L,shopCommon:oe}=g,[f,F]=(0,n.useState)(""),[se,O]=(0,n.useState)(""),[x,W]=(0,n.useState)(""),[j,re]=(0,n.useState)(!1),[D,ie]=(0,n.useState)({}),[ne,le]=(0,n.useState)(!1),[H,ae]=(0,n.useState)({price:"",basePrice:""}),[A,ce]=(0,n.useState)([]),[de,me]=(0,n.useState)([]),[v,pe]=(0,n.useState)(""),[ue,fe]=(0,n.useState)(""),{locale:a="us",currencyCode:be,isLogin:U}=(0,K.useAiuiContext)(),N=e?.custom_name||e?.title||e?.name,E=e?.custom_description||e?.description||e?.descriptionHtml,d=e?.filter_variants||e?.variants||[],R=(0,c.atobID)(e?.id||""),ge=o=>W(o),_=(o,i,s,b)=>{le(b),pe(o||""),ae({basePrice:i||"",price:s||""})};return(0,n.useEffect)(()=>{if(x){const s=d?.find(b=>b?.name?.includes?.(x));F(s?.sku||d?.[0]?.sku||""),O(s?.image?.url||d?.[0]?.image?.url||"");return}const o=e?.options?.find(s=>s?.displayName==="color")?.values?.[0]?.label;o&&W(o);const i=d?.find(s=>s?.name?.includes?.(o));F(i?.sku||d?.[0]?.sku||""),O(i?.image?.url||d?.[0]?.image?.url||"")},[x]),(0,n.useEffect)(()=>{if(!f)return;ce(e?.tags||[]);const o=d?.find(m=>m?.sku===f)||d?.[0]||{};ie(o),re(!o?.availableForSale||o?.price?.amount===we);const{infos:i}=o?.metafields||{},{productInfos:s,preRender:b}=e?.metafields||{};fe(i?.comingSoon||s?.comingSoon||b?.soldOut||oe?.soldOut||"");const y=o?.coupons?.[0],{price:V,basePrice:q,discount:xe,discountAmount:ve}=(0,Q.formatVariantPrice)({locale:a,amount:y?y.variant_price4wscode:o.price,baseAmount:y?o.price:0,currencyCode:e?.price?.currencyCode||"USD"}),G=(()=>{if(y?.value_type==="fixed_amount"){const m=ve||"",h=m.match(/^(.*?)(\d[\d.,]*)(.*)$/);if(h){const[,S,u,w]=h;let $=u;return u.endsWith(".00")?$=u.replace(/\.00$/,""):u.endsWith(",00")&&($=u.replace(/,00$/,"")),`${S}${$}${w}`}return m}return xe||""})();if(U){const m=(0,Z.getFunctionMemberPrice)({locale:a,variant:o,shopMemberPriceDiscountConfig:te,currencyCode:be||e?.price?.currencyCode||"USD"});if(m){const{hasMemberPrice:h,salePriceWithCurrency:S,originalPriceWithCurrency:u,savePriceWithCurrency:w}=m;_(w||"",u||"",h?S:"",m?.hasMemberPrice)}else _(G,q||"",V||"",!1)}else _(G,q||"",V||"",!1)},[e,f]),(0,n.useEffect)(()=>{let o=[];if(v){const s=`${v}${L?.off}`;o.push(s)}const i=A?.filter?.(s=>s?.startsWith?.("CLtag"))?.map?.(s=>s?.replace?.("CLtag:",""))?.slice?.(0,v?1:2);me(o.concat(i))},[A,v]),(0,t.jsx)("div",{className:(0,c.cn)(l==="round"?"rounded-2xl":"rounded-none","tablet:hover:bg-info-white bg-container-secondary-1 box-border w-full cursor-pointer overflow-hidden duration-300",{"aiui-dark":e.theme==="dark"}),children:e?.mImage?(0,t.jsx)("div",{className:"size-full box-border overflow-hidden hover:[&_img]:scale-105",children:(0,t.jsx)("div",{className:"relative inset-0 size-full",children:(0,t.jsxs)("a",{className:"size-full",href:(0,C.trackUrlRef)(e?.link,`${I}_${T}`),children:[(0,t.jsx)(M.default,{alt:"",source:e?.mImage?.url||e?.mImage,className:"size-full [&_img]:object-cover [&_img]:size-full",imgClassName:"size-full object-cover transition-all duration-300"}),(0,t.jsxs)("div",{className:"desktop:p-6 absolute inset-x-0 top-0 box-border overflow-hidden p-4",children:[(0,t.jsx)("p",{className:"desktop:mb-2 mb-1 text-info-primary desktop:text-base text-sm font-bold",dangerouslySetInnerHTML:{__html:e?.subTitle}}),(0,t.jsx)("span",{className:"text-info-secondary desktop:text-[32px] text-[20px] font-bold desktop:leading-9 line-clamp-4 leading-6",dangerouslySetInnerHTML:{__html:e?.title}})]})]})})}):(0,t.jsxs)("div",{className:"size-full desktop:p-6 desktop:pt-4 box-border overflow-hidden flex flex-col justify-between tablet:p-4 p-2 pb-4",children:[(0,t.jsx)("div",{className:"flex flex-wrap gap-1 overflow-hidden collection-filter-tags",children:de?.map?.((o,i)=>(0,t.jsx)(X.default,{className:"whitespace-nowrap max-w-full truncate px-1 box-border font-bold item-badge",children:o},i))}),(0,t.jsx)("a",{target:"_blank","aria-label":N,className:"my-1",href:(0,C.trackUrlRef)(`${a==="us"||!a?"":`/${a}`}/products/${e?.handle}`,`${I}_${T}`),children:(0,t.jsx)("div",{className:(0,c.cn)("m-auto desktop:size-[196px] size-[120px] overflow-hidden"),children:(0,t.jsx)(M.default,{alt:"",source:se,className:"h-full [&_img]:object-cover [&_img]:h-full [&_img]:w-fit"})})}),e?.options?.map(o=>{if(o?.displayName==="color")return(0,t.jsx)("div",{className:"flex items-center gap-1",children:o?.values?.map(i=>{const s=i?.hexColors?i.hexColors?.[0]:i?.label;return(0,t.jsx)("button",{onClick:()=>ge(i?.label),className:(0,c.cn)("size-4 rounded-full cursor-pointer overflow-hidden border-2 border-transparent",`${x===i?.label?"border-[#00BEFA]":""}`),children:(0,t.jsx)("img",{alt:s,className:"h-full w-full object-cover",src:`${$e(e?.images?.[0]?.url)}${s?.toLowerCase().split(" ")?.join("-")}_50x.png`})},i?.label)})})}),(0,t.jsxs)("div",{children:[N?(0,t.jsx)("span",{dangerouslySetInnerHTML:{__html:N||""},className:"shelf-display-product-title line-clamp-2 lg-desktop:text-2xl laptop:text-xl text-base font-bold"}):null,e?.metafields?.judgemeBadge?(0,t.jsx)("a",{target:"_blank",className:"font-bold text-xs [&_.jdgm-star]:text-[#F77234]",dangerouslySetInnerHTML:{__html:e?.metafields?.judgemeBadge},href:(0,C.trackUrlRef)(`${a==="us"||!a?"":`/${a}`}/products/${e?.handle}`,`${I}_${T}`)}):(0,t.jsx)("div",{className:"font-bold text-xs yotpo-widget-instance [&_.yotpo-sr-bottom-line-new-review]:hidden","data-yotpo-instance-id":(0,c.yotpoInstanceId)(a),"data-yotpo-product-id":R,"data-yotpo-cart-product-id":R,"data-yotpo-section-id":""}),E?(0,t.jsx)(Y.Text,{size:2,html:E||"",className:"desktop:text-base laptop:text-sm shelf-display-product-description line-clamp-1 text-xs font-bold"}):null,(0,t.jsxs)("div",{className:"mt-3 mb-2",children:[(0,t.jsx)("p",{dangerouslySetInnerHTML:{__html:U&&ne&&(L?.memberPrice||z?.member_price||z?.plus_member_price)||""},className:"text-info-primary lg-desktop:text-lg desktop:text-base laptop:text-sm text-xs font-bold"}),(0,t.jsx)("div",{className:"flex items-center",children:j?(0,t.jsx)("div",{className:"desktop:text-2xl tablet:text-xl text-info-primary text-base font-bold",children:ue||""}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"final-price desktop:text-2xl tablet:text-xl text-info-primary text-base font-bold",children:D?.availableForSale&&H?.price||""}),(0,t.jsx)("div",{className:"origin-price desktop:text-xl tablet:text-lg text-info-secondary ml-1 text-sm font-bold line-through",children:D?.availableForSale&&H?.basePrice||""})]})})]}),(0,t.jsxs)("div",{className:(0,c.cn)("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2 m-tablet:flex-col"),children:[(0,t.jsx)(B.default,{variant:"secondary",className:"m-tablet:w-full font-bold",onClick:()=>ee?.(e,f),children:r?.secondaryButton||"Learn More"}),(0,t.jsx)(B.default,{variant:"primary",className:"m-tablet:w-full font-bold",disabled:j,onClick:()=>p?.(e,f),children:r?.primaryButton||"Shop Now"})]})]})]})},e?.id||e?.handle)};var Ie=Pe;
|
|
1
|
+
"use strict";var ye=Object.create;var k=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var ke=Object.getOwnPropertyNames;var Ce=Object.getPrototypeOf,Ne=Object.prototype.hasOwnProperty;var _e=(e,r)=>{for(var l in r)k(e,l,{get:r[l],enumerable:!0})},J=(e,r,l,g)=>{if(r&&typeof r=="object"||typeof r=="function")for(let p of ke(r))!Ne.call(e,p)&&p!==l&&k(e,p,{get:()=>r[p],enumerable:!(g=he(r,p))||g.enumerable});return e};var P=(e,r,l)=>(l=e!=null?ye(Ce(e)):{},J(r||!e||!e.__esModule?k(l,"default",{value:e,enumerable:!0}):l,e)),Se=e=>J(k({},"__esModule",{value:!0}),e);var Te={};_e(Te,{default:()=>Ie});module.exports=Se(Te);var t=require("react/jsx-runtime"),c=require("../../helpers/utils.js"),K=require("../AiuiProvider/index.js"),Q=require("../ShelfDisplay/shelfDisplay.js"),X=P(require("../../components/badge.js")),Y=require("../../components/text.js"),B=P(require("../../components/button.js")),M=P(require("../../components/picture.js")),C=require("../../shared/trackUrlRef.js"),Z=require("./component/price.js"),n=require("react");const I="image",T="product_shelf",we=999999999e-2,$e=e=>{let r;return e?.includes("products")?r=e?.split("products")[0]+"files/":r=e?.replace(e?.split("files")?.pop()||"","")+"/",r},Pe=({data:e,buttonText:r,itemShape:l,metafields:g,onPrimaryChange:p,onSecondaryChange:ee})=>{const{memberPriceDiscount:te,memberSetting:z,discounts:L,shopCommon:oe}=g,[f,F]=(0,n.useState)(""),[se,O]=(0,n.useState)(""),[x,W]=(0,n.useState)(""),[j,re]=(0,n.useState)(!1),[D,ie]=(0,n.useState)({}),[ne,le]=(0,n.useState)(!1),[H,ae]=(0,n.useState)({price:"",basePrice:""}),[A,ce]=(0,n.useState)([]),[de,me]=(0,n.useState)([]),[v,pe]=(0,n.useState)(""),[ue,fe]=(0,n.useState)(""),{locale:a="us",currencyCode:be,isLogin:U}=(0,K.useAiuiContext)(),N=e?.custom_name||e?.title||e?.name,E=e?.custom_description||e?.description||e?.descriptionHtml,d=e?.filter_variants||e?.variants||[],R=(0,c.atobID)(e?.id||""),ge=o=>W(o),_=(o,i,s,b)=>{le(b),pe(o||""),ae({basePrice:i||"",price:s||""})};return(0,n.useEffect)(()=>{if(x){const s=d?.find(b=>b?.name?.includes?.(x));F(s?.sku||d?.[0]?.sku||""),O(s?.image?.url||d?.[0]?.image?.url||"");return}const o=e?.options?.find(s=>s?.displayName==="color")?.values?.[0]?.label;o&&W(o);const i=d?.find(s=>s?.name?.includes?.(o));F(i?.sku||d?.[0]?.sku||""),O(i?.image?.url||d?.[0]?.image?.url||"")},[x]),(0,n.useEffect)(()=>{if(!f)return;ce(e?.tags||[]);const o=d?.find(m=>m?.sku===f)||d?.[0]||{};ie(o),re(!o?.availableForSale||o?.price?.amount===we);const{infos:i}=o?.metafields||{},{productInfos:s,preRender:b}=e?.metafields||{};fe(i?.comingSoon||s?.comingSoon||b?.soldOut||oe?.soldOut||"");const y=o?.coupons?.[0],{price:V,basePrice:q,discount:xe,discountAmount:ve}=(0,Q.formatVariantPrice)({locale:a,amount:y?y.variant_price4wscode:o.price,baseAmount:y?o.price:0,currencyCode:e?.price?.currencyCode||"USD"}),G=(()=>{if(y?.value_type==="fixed_amount"){const m=ve||"",h=m.match(/^(.*?)(\d[\d.,]*)(.*)$/);if(h){const[,S,u,w]=h;let $=u;return u.endsWith(".00")?$=u.replace(/\.00$/,""):u.endsWith(",00")&&($=u.replace(/,00$/,"")),`${S}${$}${w}`}return m}return xe||""})();if(U){const m=(0,Z.getFunctionMemberPrice)({locale:a,variant:o,shopMemberPriceDiscountConfig:te,currencyCode:be||e?.price?.currencyCode||"USD"});if(m){const{hasMemberPrice:h,salePriceWithCurrency:S,originalPriceWithCurrency:u,savePriceWithCurrency:w}=m;_(w||"",u||"",h?S:"",m?.hasMemberPrice)}else _(G,q||"",V||"",!1)}else _(G,q||"",V||"",!1)},[e,f]),(0,n.useEffect)(()=>{let o=[];if(v){const s=`${v} ${L?.off}`;o.push(s)}const i=A?.filter?.(s=>s?.startsWith?.("CLtag"))?.map?.(s=>s?.replace?.("CLtag:",""))?.slice?.(0,v?1:2);me(o.concat(i))},[A,v]),(0,t.jsx)("div",{className:(0,c.cn)(l==="round"?"rounded-2xl":"rounded-none","tablet:hover:bg-info-white bg-container-secondary-1 box-border w-full cursor-pointer overflow-hidden duration-300",{"aiui-dark":e.theme==="dark"}),children:e?.mImage?(0,t.jsx)("div",{className:"size-full box-border overflow-hidden hover:[&_img]:scale-105",children:(0,t.jsx)("div",{className:"relative inset-0 size-full",children:(0,t.jsxs)("a",{className:"size-full",href:(0,C.trackUrlRef)(e?.link,`${I}_${T}`),children:[(0,t.jsx)(M.default,{alt:"",source:e?.mImage?.url||e?.mImage,className:"size-full [&_img]:object-cover [&_img]:size-full",imgClassName:"size-full object-cover transition-all duration-300"}),(0,t.jsxs)("div",{className:"desktop:p-6 absolute inset-x-0 top-0 box-border overflow-hidden p-4",children:[(0,t.jsx)("p",{className:"desktop:mb-2 mb-1 text-info-primary desktop:text-base text-sm font-bold",dangerouslySetInnerHTML:{__html:e?.subTitle}}),(0,t.jsx)("span",{className:"text-info-secondary desktop:text-[32px] text-[20px] font-bold desktop:leading-9 line-clamp-4 leading-6",dangerouslySetInnerHTML:{__html:e?.title}})]})]})})}):(0,t.jsxs)("div",{className:"size-full desktop:p-6 desktop:pt-4 box-border overflow-hidden flex flex-col justify-between tablet:p-4 p-2 pb-4",children:[(0,t.jsx)("div",{className:"flex flex-wrap gap-1 overflow-hidden collection-filter-tags",children:de?.map?.((o,i)=>(0,t.jsx)(X.default,{className:"whitespace-nowrap max-w-full truncate px-1 box-border font-bold item-badge",children:o},i))}),(0,t.jsx)("a",{target:"_blank","aria-label":N,className:"my-1",href:(0,C.trackUrlRef)(`${a==="us"||!a?"":`/${a}`}/products/${e?.handle}`,`${I}_${T}`),children:(0,t.jsx)("div",{className:(0,c.cn)("m-auto desktop:size-[196px] size-[120px] overflow-hidden"),children:(0,t.jsx)(M.default,{alt:"",source:se,className:"h-full [&_img]:object-cover [&_img]:h-full [&_img]:w-fit"})})}),e?.options?.map(o=>{if(o?.displayName==="color")return(0,t.jsx)("div",{className:"flex items-center gap-1",children:o?.values?.map(i=>{const s=i?.hexColors?i.hexColors?.[0]:i?.label;return(0,t.jsx)("button",{onClick:()=>ge(i?.label),className:(0,c.cn)("size-4 rounded-full cursor-pointer overflow-hidden border-2 border-transparent",`${x===i?.label?"border-[#00BEFA]":""}`),children:(0,t.jsx)("img",{alt:s,className:"h-full w-full object-cover",src:`${$e(e?.images?.[0]?.url)}${s?.toLowerCase().split(" ")?.join("-")}_50x.png`})},i?.label)})})}),(0,t.jsxs)("div",{children:[N?(0,t.jsx)("span",{dangerouslySetInnerHTML:{__html:N||""},className:"shelf-display-product-title line-clamp-2 lg-desktop:text-2xl laptop:text-xl text-base font-bold"}):null,e?.metafields?.judgemeBadge?(0,t.jsx)("a",{target:"_blank",className:"font-bold text-xs [&_.jdgm-star]:text-[#F77234]",dangerouslySetInnerHTML:{__html:e?.metafields?.judgemeBadge},href:(0,C.trackUrlRef)(`${a==="us"||!a?"":`/${a}`}/products/${e?.handle}`,`${I}_${T}`)}):(0,t.jsx)("div",{className:"font-bold text-xs yotpo-widget-instance [&_.yotpo-sr-bottom-line-new-review]:hidden","data-yotpo-instance-id":(0,c.yotpoInstanceId)(a),"data-yotpo-product-id":R,"data-yotpo-cart-product-id":R,"data-yotpo-section-id":""}),E?(0,t.jsx)(Y.Text,{size:2,html:E||"",className:"desktop:text-base laptop:text-sm shelf-display-product-description line-clamp-1 text-xs font-bold"}):null,(0,t.jsxs)("div",{className:"mt-3 mb-2",children:[(0,t.jsx)("p",{dangerouslySetInnerHTML:{__html:U&&ne&&(L?.memberPrice||z?.member_price||z?.plus_member_price)||""},className:"text-info-primary lg-desktop:text-lg desktop:text-base laptop:text-sm text-xs font-bold"}),(0,t.jsx)("div",{className:"flex items-center",children:j?(0,t.jsx)("div",{className:"desktop:text-2xl tablet:text-xl text-info-primary text-base font-bold",children:ue||""}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"final-price desktop:text-2xl tablet:text-xl text-info-primary text-base font-bold",children:D?.availableForSale&&H?.price||""}),(0,t.jsx)("div",{className:"origin-price desktop:text-xl tablet:text-lg text-info-secondary ml-1 text-sm font-bold line-through",children:D?.availableForSale&&H?.basePrice||""})]})})]}),(0,t.jsxs)("div",{className:(0,c.cn)("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2 m-tablet:flex-col"),children:[(0,t.jsx)(B.default,{variant:"secondary",className:"m-tablet:w-full font-bold",onClick:()=>ee?.(e,f),children:r?.secondaryButton||"Learn More"}),(0,t.jsx)(B.default,{variant:"primary",className:"m-tablet:w-full font-bold",disabled:j,onClick:()=>p?.(e,f),children:r?.primaryButton||"Shop Now"})]})]})]})},e?.id||e?.handle)};var Ie=Pe;
|
|
2
2
|
//# sourceMappingURL=FilterCardWrapItem.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/CollectionsFilters/FilterCardWrapItem.tsx"],
|
|
4
|
-
"sourcesContent": ["import { cn, atobID, yotpoInstanceId } from '../../helpers/utils.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { formatVariantPrice } from '../ShelfDisplay/shelfDisplay.js'\nimport Badge from '../../components/badge.js'\nimport { Text } from '../../components/text.js'\nimport Button from '../../components/button.js'\nimport Picture from '../../components/picture.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { getFunctionMemberPrice } from './component/price.js'\nimport { useState, useEffect } from 'react'\n\nconst componentType = 'image'\nconst componentName = 'product_shelf'\n\nconst SOLD_OUT_PRICE = 9999999.99\n\nconst getShopifyCdnBaseUrl = (imagePath: string | null) => {\n // \u76EE\u524D\u77E5\u9053\u7684 shopify \u56FE\u7247\u8DEF\u7531\u7684\u5F62\u5F0F\n // https://cdn.shopify.com/s/files/1/0493/9834/9974/files/Group_5581_2.jpg?v=1662379184\n // https://cdn.shopify.com/s/files/1/0493/9834/9974/products/B2633123.jpg?v=1631264041_3840x\n // \u8FD4\u56DE https://cdn.shopify.com/s/files/1/0493/9834/9974/files/\n let path\n if (imagePath?.includes('products')) {\n path = imagePath?.split('products')[0] + 'files/'\n } else {\n path = imagePath?.replace(imagePath?.split('files')?.pop() || '', '') + '/'\n }\n return path\n}\n\ntype FilterCardWrapItemProps = {\n data: any\n buttonText?: any\n itemShape?: string\n metafields: any\n onPrimaryChange?: (item: any, sku: string) => void\n onSecondaryChange?: (item: any, sku: string) => void\n}\n\nconst FilterCardWrapItem = ({\n data,\n buttonText,\n itemShape,\n metafields,\n onPrimaryChange,\n onSecondaryChange,\n}: FilterCardWrapItemProps) => {\n const { memberPriceDiscount, memberSetting, discounts, shopCommon } = metafields\n const [currentSku, setCurrentSku] = useState<string>('')\n const [currentImage, setCurrentImage] = useState<string>('')\n const [selectedColor, setSelectedColor] = useState<string>('')\n const [isSoldOut, setIsSoldOut] = useState<any>(false)\n const [currentVariant, setCurrentVariant] = useState<any>({})\n const [plusMemberStatus, setPlusMemberStatus] = useState<boolean>(false)\n const [priceCollection, setPriceCollection] = useState<{ price: string; basePrice: string }>({\n price: '',\n basePrice: '',\n })\n const [tags, setTags] = useState<string[]>([])\n const [showTags, setShowTags] = useState<string[]>([])\n const [discountCollection, setDiscountCollection] = useState<string>('')\n const [soldOutText, setSoldOutText] = useState<string>('')\n\n const { locale = 'us', currencyCode, isLogin } = useAiuiContext()\n\n const displayTitle = data?.custom_name || data?.title || data?.name\n const displayDescription = data?.custom_description || data?.description || data?.descriptionHtml\n const skuArray = data?.filter_variants || data?.variants || []\n const id = atobID(data?.id || '')\n\n const onColorClick = (color: string) => setSelectedColor(color)\n\n const handleBasePrice = (discount: string, priceCurrency: string, salePrice: string, status: boolean) => {\n setPlusMemberStatus(status)\n setDiscountCollection(discount || '')\n setPriceCollection({\n basePrice: priceCurrency || '',\n price: salePrice || '',\n })\n }\n\n useEffect(() => {\n if (selectedColor) {\n const findSku = skuArray?.find((item: any) => item?.name?.includes?.(selectedColor))\n setCurrentSku(findSku?.sku || skuArray?.[0]?.sku || '')\n setCurrentImage(findSku?.image?.url || skuArray?.[0]?.image?.url || '')\n return\n }\n const firstOption = data?.options?.find((item: any) => item?.displayName === 'color')?.values?.[0]?.label\n firstOption && setSelectedColor(firstOption)\n const findSku = skuArray?.find((item: any) => item?.name?.includes?.(firstOption))\n setCurrentSku(findSku?.sku || skuArray?.[0]?.sku || '')\n setCurrentImage(findSku?.image?.url || skuArray?.[0]?.image?.url || '')\n }, [selectedColor])\n\n useEffect(() => {\n if (!currentSku) return\n setTags(data?.tags || [])\n const variant = skuArray?.find((item: any) => item?.sku === currentSku) || skuArray?.[0] || {}\n setCurrentVariant(variant)\n setIsSoldOut(!variant?.availableForSale || variant?.price?.amount === SOLD_OUT_PRICE)\n const { infos } = variant?.metafields || {}\n const { productInfos, preRender } = data?.metafields || {}\n setSoldOutText(infos?.comingSoon || productInfos?.comingSoon || preRender?.soldOut || shopCommon?.soldOut || '')\n // active \u7684 \u901A\u7528\u6298\u6263\n const coupon = variant?.coupons?.[0]\n const { price, basePrice, discount, discountAmount } = formatVariantPrice({\n locale: locale,\n amount: coupon ? coupon.variant_price4wscode : variant.price,\n baseAmount: coupon ? variant.price : 0,\n currencyCode: data?.price?.currencyCode || 'USD',\n })\n const showPrice = (() => {\n if (coupon?.value_type === 'fixed_amount') {\n const amountStr = discountAmount || ''\n const match = amountStr.match(/^(.*?)(\\d[\\d.,]*)(.*)$/)\n if (match) {\n const [, prefix, numeric, suffix] = match\n let updatedNumeric = numeric\n if (numeric.endsWith('.00')) {\n updatedNumeric = numeric.replace(/\\.00$/, '')\n } else if (numeric.endsWith(',00')) {\n updatedNumeric = numeric.replace(/,00$/, '')\n }\n return `${prefix}${updatedNumeric}${suffix}`\n }\n return amountStr\n }\n return discount || ''\n })()\n // \u4F1A\u5458\u6298\u6263\n if (isLogin) {\n const result = getFunctionMemberPrice({\n locale: locale,\n variant: variant,\n shopMemberPriceDiscountConfig: memberPriceDiscount,\n currencyCode: currencyCode || data?.price?.currencyCode || 'USD',\n })\n if (result) {\n const { hasMemberPrice, salePriceWithCurrency, originalPriceWithCurrency, savePriceWithCurrency } = result\n handleBasePrice(\n savePriceWithCurrency || '',\n originalPriceWithCurrency || '',\n hasMemberPrice ? salePriceWithCurrency : '',\n result?.hasMemberPrice\n )\n } else {\n handleBasePrice(showPrice, basePrice || '', price || '', false)\n }\n } else {\n handleBasePrice(showPrice, basePrice || '', price || '', false)\n }\n }, [data, currentSku])\n\n // \u5904\u7406\u6807\u7B7E\n useEffect(() => {\n let handleTags: string[] = []\n if (discountCollection) {\n const discountTag = `${discountCollection}${discounts?.off}`\n handleTags.push(discountTag)\n }\n const newTags = tags\n ?.filter?.((item: string) => item?.startsWith?.('CLtag'))\n ?.map?.((item: string) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, discountCollection ? 1 : 2)\n setShowTags(handleTags.concat(newTags))\n }, [tags, discountCollection])\n\n return (\n <div\n key={data?.id || data?.handle}\n className={cn(\n itemShape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'tablet:hover:bg-info-white bg-container-secondary-1 box-border w-full cursor-pointer overflow-hidden duration-300',\n {\n 'aiui-dark': data.theme === 'dark',\n }\n )}\n >\n {data?.mImage ? (\n <div className=\"size-full box-border overflow-hidden hover:[&_img]:scale-105\">\n <div className=\"relative inset-0 size-full\">\n <a className=\"size-full\" href={trackUrlRef(data?.link, `${componentType}_${componentName}`)}>\n <Picture\n alt=\"\"\n source={data?.mImage?.url || data?.mImage}\n className=\"size-full [&_img]:object-cover [&_img]:size-full\"\n imgClassName=\"size-full object-cover transition-all duration-300\"\n />\n <div className=\"desktop:p-6 absolute inset-x-0 top-0 box-border overflow-hidden p-4\">\n <p\n className=\"desktop:mb-2 mb-1 text-info-primary desktop:text-base text-sm font-bold\"\n dangerouslySetInnerHTML={{ __html: data?.subTitle }}\n />\n <span\n className=\"text-info-secondary desktop:text-[32px] text-[20px] font-bold desktop:leading-9 line-clamp-4 leading-6\"\n dangerouslySetInnerHTML={{ __html: data?.title }}\n />\n </div>\n </a>\n </div>\n </div>\n ) : (\n <div className=\"size-full desktop:p-6 desktop:pt-4 box-border overflow-hidden flex flex-col justify-between tablet:p-4 p-2 pb-4\">\n <div className=\"flex flex-wrap gap-1 overflow-hidden collection-filter-tags\">\n {showTags?.map?.((item: string, index: number) => (\n <Badge key={index} className=\"whitespace-nowrap max-w-full truncate px-1 box-border font-bold item-badge\">\n {item}\n </Badge>\n ))}\n </div>\n <a\n target=\"_blank\"\n aria-label={displayTitle}\n className=\"my-1\"\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}`,\n `${componentType}_${componentName}`\n )}\n >\n <div className={cn('m-auto desktop:size-[196px] size-[120px] overflow-hidden')}>\n <Picture\n alt=\"\"\n source={currentImage}\n className=\"h-full [&_img]:object-cover [&_img]:h-full [&_img]:w-fit\"\n />\n </div>\n </a>\n {data?.options?.map((option: any) => {\n if (option?.displayName === 'color') {\n return (\n <div className=\"flex items-center gap-1\">\n {option?.values?.map((item: any) => {\n const color = item?.hexColors ? item.hexColors?.[0] : item?.label\n return (\n <button\n key={item?.label}\n onClick={() => onColorClick(item?.label)}\n className={cn(\n 'size-4 rounded-full cursor-pointer overflow-hidden border-2 border-transparent',\n `${selectedColor === item?.label ? 'border-[#00BEFA]' : ''}`\n )}\n >\n <img\n alt={color}\n className=\"h-full w-full object-cover\"\n src={`${getShopifyCdnBaseUrl(data?.images?.[0]?.url)}${color\n ?.toLowerCase()\n .split(' ')\n ?.join('-')}_${'50x'}.png`}\n />\n </button>\n )\n })}\n </div>\n )\n }\n })}\n <div>\n {displayTitle ? (\n <span\n dangerouslySetInnerHTML={{ __html: displayTitle || '' }}\n className=\"shelf-display-product-title line-clamp-2 lg-desktop:text-2xl laptop:text-xl text-base font-bold\"\n />\n ) : null}\n {data?.metafields?.judgemeBadge ? (\n <a\n target=\"_blank\"\n className=\"font-bold text-xs [&_.jdgm-star]:text-[#F77234]\"\n dangerouslySetInnerHTML={{ __html: data?.metafields?.judgemeBadge }}\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}`,\n `${componentType}_${componentName}`\n )}\n />\n ) : (\n <div\n className=\"font-bold text-xs yotpo-widget-instance [&_.yotpo-sr-bottom-line-new-review]:hidden\"\n data-yotpo-instance-id={yotpoInstanceId(locale)}\n data-yotpo-product-id={id}\n data-yotpo-cart-product-id={id}\n data-yotpo-section-id=\"\"\n />\n )}\n {displayDescription ? (\n <Text\n size={2}\n html={displayDescription || ''}\n className=\"desktop:text-base laptop:text-sm shelf-display-product-description line-clamp-1 text-xs font-bold\"\n />\n ) : null}\n <div className=\"mt-3 mb-2\">\n <p\n dangerouslySetInnerHTML={{\n __html:\n isLogin && plusMemberStatus\n ? discounts?.memberPrice || memberSetting?.member_price || memberSetting?.plus_member_price || ''\n : '',\n }}\n className=\"text-info-primary lg-desktop:text-lg desktop:text-base laptop:text-sm text-xs font-bold\"\n />\n <div className=\"flex items-center\">\n {isSoldOut ? (\n <div className=\"desktop:text-2xl tablet:text-xl text-info-primary text-base font-bold\">\n {soldOutText || ''}\n </div>\n ) : (\n <>\n <div className=\"final-price desktop:text-2xl tablet:text-xl text-info-primary text-base font-bold\">\n {currentVariant?.availableForSale ? priceCollection?.price || '' : ''}\n </div>\n <div className=\"origin-price desktop:text-xl tablet:text-lg text-info-secondary ml-1 text-sm font-bold line-through\">\n {currentVariant?.availableForSale ? priceCollection?.basePrice || '' : ''}\n </div>\n </>\n )}\n </div>\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div\n className={cn('shelf-flex-button-group', 'lg-desktop:gap-3 flex items-center gap-2 m-tablet:flex-col')}\n >\n <Button\n variant=\"secondary\"\n className=\"m-tablet:w-full font-bold\"\n onClick={() => onSecondaryChange?.(data, currentSku)}\n >\n {buttonText?.secondaryButton || 'Learn More'}\n </Button>\n <Button\n variant=\"primary\"\n className=\"m-tablet:w-full font-bold\"\n disabled={isSoldOut}\n onClick={() => onPrimaryChange?.(data, currentSku)}\n >\n {buttonText?.primaryButton || 'Shop Now'}\n </Button>\n </div>\n </div>\n </div>\n )}\n </div>\n )\n}\nexport default FilterCardWrapItem\n"],
|
|
5
|
-
"mappings": "skBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAuLc,IAAAI,EAAA,6BAvLdC,EAA4C,kCAC5CC,EAA+B,oCAC/BC,EAAmC,2CACnCC,EAAkB,wCAClBC,EAAqB,oCACrBC,EAAmB,yCACnBC,EAAoB,0CACpBC,EAA4B,uCAC5BC,EAAuC,gCACvCC,EAAoC,iBAEpC,MAAMC,EAAgB,QAChBC,EAAgB,gBAEhBC,GAAiB,aAEjBC,GAAwBC,GAA6B,CAKzD,IAAIC,EACJ,OAAID,GAAW,SAAS,UAAU,EAChCC,EAA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C,EAC5B,GAAIzC,EAAoB,CACtB,MAAM0C,EAAc,GAAG1C,CAAkB,
|
|
4
|
+
"sourcesContent": ["import { cn, atobID, yotpoInstanceId } from '../../helpers/utils.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { formatVariantPrice } from '../ShelfDisplay/shelfDisplay.js'\nimport Badge from '../../components/badge.js'\nimport { Text } from '../../components/text.js'\nimport Button from '../../components/button.js'\nimport Picture from '../../components/picture.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { getFunctionMemberPrice } from './component/price.js'\nimport { useState, useEffect } from 'react'\n\nconst componentType = 'image'\nconst componentName = 'product_shelf'\n\nconst SOLD_OUT_PRICE = 9999999.99\n\nconst getShopifyCdnBaseUrl = (imagePath: string | null) => {\n // \u76EE\u524D\u77E5\u9053\u7684 shopify \u56FE\u7247\u8DEF\u7531\u7684\u5F62\u5F0F\n // https://cdn.shopify.com/s/files/1/0493/9834/9974/files/Group_5581_2.jpg?v=1662379184\n // https://cdn.shopify.com/s/files/1/0493/9834/9974/products/B2633123.jpg?v=1631264041_3840x\n // \u8FD4\u56DE https://cdn.shopify.com/s/files/1/0493/9834/9974/files/\n let path\n if (imagePath?.includes('products')) {\n path = imagePath?.split('products')[0] + 'files/'\n } else {\n path = imagePath?.replace(imagePath?.split('files')?.pop() || '', '') + '/'\n }\n return path\n}\n\ntype FilterCardWrapItemProps = {\n data: any\n buttonText?: any\n itemShape?: string\n metafields: any\n onPrimaryChange?: (item: any, sku: string) => void\n onSecondaryChange?: (item: any, sku: string) => void\n}\n\nconst FilterCardWrapItem = ({\n data,\n buttonText,\n itemShape,\n metafields,\n onPrimaryChange,\n onSecondaryChange,\n}: FilterCardWrapItemProps) => {\n const { memberPriceDiscount, memberSetting, discounts, shopCommon } = metafields\n const [currentSku, setCurrentSku] = useState<string>('')\n const [currentImage, setCurrentImage] = useState<string>('')\n const [selectedColor, setSelectedColor] = useState<string>('')\n const [isSoldOut, setIsSoldOut] = useState<any>(false)\n const [currentVariant, setCurrentVariant] = useState<any>({})\n const [plusMemberStatus, setPlusMemberStatus] = useState<boolean>(false)\n const [priceCollection, setPriceCollection] = useState<{ price: string; basePrice: string }>({\n price: '',\n basePrice: '',\n })\n const [tags, setTags] = useState<string[]>([])\n const [showTags, setShowTags] = useState<string[]>([])\n const [discountCollection, setDiscountCollection] = useState<string>('')\n const [soldOutText, setSoldOutText] = useState<string>('')\n\n const { locale = 'us', currencyCode, isLogin } = useAiuiContext()\n\n const displayTitle = data?.custom_name || data?.title || data?.name\n const displayDescription = data?.custom_description || data?.description || data?.descriptionHtml\n const skuArray = data?.filter_variants || data?.variants || []\n const id = atobID(data?.id || '')\n\n const onColorClick = (color: string) => setSelectedColor(color)\n\n const handleBasePrice = (discount: string, priceCurrency: string, salePrice: string, status: boolean) => {\n setPlusMemberStatus(status)\n setDiscountCollection(discount || '')\n setPriceCollection({\n basePrice: priceCurrency || '',\n price: salePrice || '',\n })\n }\n\n useEffect(() => {\n if (selectedColor) {\n const findSku = skuArray?.find((item: any) => item?.name?.includes?.(selectedColor))\n setCurrentSku(findSku?.sku || skuArray?.[0]?.sku || '')\n setCurrentImage(findSku?.image?.url || skuArray?.[0]?.image?.url || '')\n return\n }\n const firstOption = data?.options?.find((item: any) => item?.displayName === 'color')?.values?.[0]?.label\n firstOption && setSelectedColor(firstOption)\n const findSku = skuArray?.find((item: any) => item?.name?.includes?.(firstOption))\n setCurrentSku(findSku?.sku || skuArray?.[0]?.sku || '')\n setCurrentImage(findSku?.image?.url || skuArray?.[0]?.image?.url || '')\n }, [selectedColor])\n\n useEffect(() => {\n if (!currentSku) return\n setTags(data?.tags || [])\n const variant = skuArray?.find((item: any) => item?.sku === currentSku) || skuArray?.[0] || {}\n setCurrentVariant(variant)\n setIsSoldOut(!variant?.availableForSale || variant?.price?.amount === SOLD_OUT_PRICE)\n const { infos } = variant?.metafields || {}\n const { productInfos, preRender } = data?.metafields || {}\n setSoldOutText(infos?.comingSoon || productInfos?.comingSoon || preRender?.soldOut || shopCommon?.soldOut || '')\n // active \u7684 \u901A\u7528\u6298\u6263\n const coupon = variant?.coupons?.[0]\n const { price, basePrice, discount, discountAmount } = formatVariantPrice({\n locale: locale,\n amount: coupon ? coupon.variant_price4wscode : variant.price,\n baseAmount: coupon ? variant.price : 0,\n currencyCode: data?.price?.currencyCode || 'USD',\n })\n const showPrice = (() => {\n if (coupon?.value_type === 'fixed_amount') {\n const amountStr = discountAmount || ''\n const match = amountStr.match(/^(.*?)(\\d[\\d.,]*)(.*)$/)\n if (match) {\n const [, prefix, numeric, suffix] = match\n let updatedNumeric = numeric\n if (numeric.endsWith('.00')) {\n updatedNumeric = numeric.replace(/\\.00$/, '')\n } else if (numeric.endsWith(',00')) {\n updatedNumeric = numeric.replace(/,00$/, '')\n }\n return `${prefix}${updatedNumeric}${suffix}`\n }\n return amountStr\n }\n return discount || ''\n })()\n // \u4F1A\u5458\u6298\u6263\n if (isLogin) {\n const result = getFunctionMemberPrice({\n locale: locale,\n variant: variant,\n shopMemberPriceDiscountConfig: memberPriceDiscount,\n currencyCode: currencyCode || data?.price?.currencyCode || 'USD',\n })\n if (result) {\n const { hasMemberPrice, salePriceWithCurrency, originalPriceWithCurrency, savePriceWithCurrency } = result\n handleBasePrice(\n savePriceWithCurrency || '',\n originalPriceWithCurrency || '',\n hasMemberPrice ? salePriceWithCurrency : '',\n result?.hasMemberPrice\n )\n } else {\n handleBasePrice(showPrice, basePrice || '', price || '', false)\n }\n } else {\n handleBasePrice(showPrice, basePrice || '', price || '', false)\n }\n }, [data, currentSku])\n\n // \u5904\u7406\u6807\u7B7E\n useEffect(() => {\n let handleTags: string[] = []\n if (discountCollection) {\n const discountTag = `${discountCollection} ${discounts?.off}`\n handleTags.push(discountTag)\n }\n const newTags = tags\n ?.filter?.((item: string) => item?.startsWith?.('CLtag'))\n ?.map?.((item: string) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, discountCollection ? 1 : 2)\n setShowTags(handleTags.concat(newTags))\n }, [tags, discountCollection])\n\n return (\n <div\n key={data?.id || data?.handle}\n className={cn(\n itemShape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'tablet:hover:bg-info-white bg-container-secondary-1 box-border w-full cursor-pointer overflow-hidden duration-300',\n {\n 'aiui-dark': data.theme === 'dark',\n }\n )}\n >\n {data?.mImage ? (\n <div className=\"size-full box-border overflow-hidden hover:[&_img]:scale-105\">\n <div className=\"relative inset-0 size-full\">\n <a className=\"size-full\" href={trackUrlRef(data?.link, `${componentType}_${componentName}`)}>\n <Picture\n alt=\"\"\n source={data?.mImage?.url || data?.mImage}\n className=\"size-full [&_img]:object-cover [&_img]:size-full\"\n imgClassName=\"size-full object-cover transition-all duration-300\"\n />\n <div className=\"desktop:p-6 absolute inset-x-0 top-0 box-border overflow-hidden p-4\">\n <p\n className=\"desktop:mb-2 mb-1 text-info-primary desktop:text-base text-sm font-bold\"\n dangerouslySetInnerHTML={{ __html: data?.subTitle }}\n />\n <span\n className=\"text-info-secondary desktop:text-[32px] text-[20px] font-bold desktop:leading-9 line-clamp-4 leading-6\"\n dangerouslySetInnerHTML={{ __html: data?.title }}\n />\n </div>\n </a>\n </div>\n </div>\n ) : (\n <div className=\"size-full desktop:p-6 desktop:pt-4 box-border overflow-hidden flex flex-col justify-between tablet:p-4 p-2 pb-4\">\n <div className=\"flex flex-wrap gap-1 overflow-hidden collection-filter-tags\">\n {showTags?.map?.((item: string, index: number) => (\n <Badge key={index} className=\"whitespace-nowrap max-w-full truncate px-1 box-border font-bold item-badge\">\n {item}\n </Badge>\n ))}\n </div>\n <a\n target=\"_blank\"\n aria-label={displayTitle}\n className=\"my-1\"\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}`,\n `${componentType}_${componentName}`\n )}\n >\n <div className={cn('m-auto desktop:size-[196px] size-[120px] overflow-hidden')}>\n <Picture\n alt=\"\"\n source={currentImage}\n className=\"h-full [&_img]:object-cover [&_img]:h-full [&_img]:w-fit\"\n />\n </div>\n </a>\n {data?.options?.map((option: any) => {\n if (option?.displayName === 'color') {\n return (\n <div className=\"flex items-center gap-1\">\n {option?.values?.map((item: any) => {\n const color = item?.hexColors ? item.hexColors?.[0] : item?.label\n return (\n <button\n key={item?.label}\n onClick={() => onColorClick(item?.label)}\n className={cn(\n 'size-4 rounded-full cursor-pointer overflow-hidden border-2 border-transparent',\n `${selectedColor === item?.label ? 'border-[#00BEFA]' : ''}`\n )}\n >\n <img\n alt={color}\n className=\"h-full w-full object-cover\"\n src={`${getShopifyCdnBaseUrl(data?.images?.[0]?.url)}${color\n ?.toLowerCase()\n .split(' ')\n ?.join('-')}_${'50x'}.png`}\n />\n </button>\n )\n })}\n </div>\n )\n }\n })}\n <div>\n {displayTitle ? (\n <span\n dangerouslySetInnerHTML={{ __html: displayTitle || '' }}\n className=\"shelf-display-product-title line-clamp-2 lg-desktop:text-2xl laptop:text-xl text-base font-bold\"\n />\n ) : null}\n {data?.metafields?.judgemeBadge ? (\n <a\n target=\"_blank\"\n className=\"font-bold text-xs [&_.jdgm-star]:text-[#F77234]\"\n dangerouslySetInnerHTML={{ __html: data?.metafields?.judgemeBadge }}\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}`,\n `${componentType}_${componentName}`\n )}\n />\n ) : (\n <div\n className=\"font-bold text-xs yotpo-widget-instance [&_.yotpo-sr-bottom-line-new-review]:hidden\"\n data-yotpo-instance-id={yotpoInstanceId(locale)}\n data-yotpo-product-id={id}\n data-yotpo-cart-product-id={id}\n data-yotpo-section-id=\"\"\n />\n )}\n {displayDescription ? (\n <Text\n size={2}\n html={displayDescription || ''}\n className=\"desktop:text-base laptop:text-sm shelf-display-product-description line-clamp-1 text-xs font-bold\"\n />\n ) : null}\n <div className=\"mt-3 mb-2\">\n <p\n dangerouslySetInnerHTML={{\n __html:\n isLogin && plusMemberStatus\n ? discounts?.memberPrice || memberSetting?.member_price || memberSetting?.plus_member_price || ''\n : '',\n }}\n className=\"text-info-primary lg-desktop:text-lg desktop:text-base laptop:text-sm text-xs font-bold\"\n />\n <div className=\"flex items-center\">\n {isSoldOut ? (\n <div className=\"desktop:text-2xl tablet:text-xl text-info-primary text-base font-bold\">\n {soldOutText || ''}\n </div>\n ) : (\n <>\n <div className=\"final-price desktop:text-2xl tablet:text-xl text-info-primary text-base font-bold\">\n {currentVariant?.availableForSale ? priceCollection?.price || '' : ''}\n </div>\n <div className=\"origin-price desktop:text-xl tablet:text-lg text-info-secondary ml-1 text-sm font-bold line-through\">\n {currentVariant?.availableForSale ? priceCollection?.basePrice || '' : ''}\n </div>\n </>\n )}\n </div>\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div\n className={cn('shelf-flex-button-group', 'lg-desktop:gap-3 flex items-center gap-2 m-tablet:flex-col')}\n >\n <Button\n variant=\"secondary\"\n className=\"m-tablet:w-full font-bold\"\n onClick={() => onSecondaryChange?.(data, currentSku)}\n >\n {buttonText?.secondaryButton || 'Learn More'}\n </Button>\n <Button\n variant=\"primary\"\n className=\"m-tablet:w-full font-bold\"\n disabled={isSoldOut}\n onClick={() => onPrimaryChange?.(data, currentSku)}\n >\n {buttonText?.primaryButton || 'Shop Now'}\n </Button>\n </div>\n </div>\n </div>\n )}\n </div>\n )\n}\nexport default FilterCardWrapItem\n"],
|
|
5
|
+
"mappings": "skBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAuLc,IAAAI,EAAA,6BAvLdC,EAA4C,kCAC5CC,EAA+B,oCAC/BC,EAAmC,2CACnCC,EAAkB,wCAClBC,EAAqB,oCACrBC,EAAmB,yCACnBC,EAAoB,0CACpBC,EAA4B,uCAC5BC,EAAuC,gCACvCC,EAAoC,iBAEpC,MAAMC,EAAgB,QAChBC,EAAgB,gBAEhBC,GAAiB,aAEjBC,GAAwBC,GAA6B,CAKzD,IAAIC,EACJ,OAAID,GAAW,SAAS,UAAU,EAChCC,EAAOD,GAAW,MA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YACb,oBAAC,KACC,wBAAyB,CACvB,OACEF,GAAWd,KACPZ,GAAW,aAAeD,GAAe,cAAgBA,GAAe,oBAAqB,EAErG,EACA,UAAU,0FACZ,KACA,OAAC,OAAI,UAAU,oBACZ,SAAAS,KACC,OAAC,OAAI,UAAU,wEACZ,SAAAc,IAAe,GAClB,KAEA,oBACE,oBAAC,OAAI,UAAU,oFACZ,SAAAZ,GAAgB,kBAAmBI,GAAiB,OAAS,GAChE,KACA,OAAC,OAAI,UAAU,sGACZ,SAAAJ,GAAgB,kBAAmBI,GAAiB,WAAa,GACpE,GACF,EAEJ,GACF,KAEA,QAAC,OACC,aAAW,MAAG,0BAA2B,4DAA4D,EAErG,oBAAC,EAAAsD,QAAA,CACC,QAAQ,YACR,UAAU,4BACV,QAAS,IAAMvE,KAAoBL,EAAMU,CAAU,EAElD,SAAAT,GAAY,iBAAmB,aAClC,KACA,OAAC,EAAA2E,QAAA,CACC,QAAQ,UACR,UAAU,4BACV,SAAU5D,EACV,QAAS,IAAMZ,IAAkBJ,EAAMU,CAAU,EAEhD,SAAAT,GAAY,eAAiB,WAChC,GACF,GACF,GACF,GAzKGD,GAAM,IAAMA,GAAM,MA2KzB,CAEJ,EACA,IAAOpB,GAAQmB",
|
|
6
6
|
"names": ["FilterCardWrapItem_exports", "__export", "FilterCardWrapItem_default", "__toCommonJS", "import_jsx_runtime", "import_utils", "import_AiuiProvider", "import_shelfDisplay", "import_badge", "import_text", "import_button", "import_picture", "import_trackUrlRef", "import_price", "import_react", "componentType", "componentName", "SOLD_OUT_PRICE", "getShopifyCdnBaseUrl", "imagePath", "path", "FilterCardWrapItem", "data", "buttonText", "itemShape", "metafields", "onPrimaryChange", "onSecondaryChange", "memberPriceDiscount", "memberSetting", "discounts", "shopCommon", "currentSku", "setCurrentSku", "currentImage", "setCurrentImage", "selectedColor", "setSelectedColor", "isSoldOut", "setIsSoldOut", "currentVariant", "setCurrentVariant", "plusMemberStatus", "setPlusMemberStatus", "priceCollection", "setPriceCollection", "tags", "setTags", "showTags", "setShowTags", "discountCollection", "setDiscountCollection", "soldOutText", "setSoldOutText", "locale", "currencyCode", "isLogin", "displayTitle", "displayDescription", "skuArray", "id", "onColorClick", "color", "handleBasePrice", "discount", "priceCurrency", "salePrice", "status", "findSku", "item", "firstOption", "variant", "infos", "productInfos", "preRender", "coupon", "price", "basePrice", "discountAmount", "showPrice", "amountStr", "match", "prefix", "numeric", "suffix", "updatedNumeric", "result", "hasMemberPrice", "salePriceWithCurrency", "originalPriceWithCurrency", "savePriceWithCurrency", "handleTags", "discountTag", "newTags", "Picture", "index", "Badge", "option", "Button"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/biz-components/CollectionsFilters/component/filtersFun.ts"],
|
|
4
|
-
"sourcesContent": ["const handleFilters = (filtered: any) => {\n const allFilters: any[] = []\n let chunkNumber: number = 18\n Object.keys(filtered).forEach(key => {\n if (key === 'price') {\n const priceOptions =\n filtered[key]\n ?.join('|')\n ?.split('|')\n ?.map((item: any) => Number(item)) || []\n const maxValue = Math.max(...priceOptions)\n const minValue = Math.min(...priceOptions)\n maxValue &&\n minValue &&\n allFilters.push({\n price: {\n max: maxValue,\n min: minValue,\n },\n })\n }\n if (key.includes('filter.p.tag')) {\n filtered[key]?.forEach((item: any) => {\n allFilters.push({\n tag: item,\n })\n })\n }\n if (key.includes('filter.p.product_type')) {\n filtered[key]?.forEach((item: any) => {\n allFilters.push({\n productType: item,\n })\n })\n }\n if (key.includes('filter.v.availability')) {\n filtered[key]?.forEach((item: string) => {\n const val = item.split('filter.v.availability.')?.pop()\n allFilters.push({\n available: val === '1',\n })\n })\n }\n if (key.includes('filter.v.m.filter.')) {\n const metafieldsKey = key.split('filter.v.m.filter.')?.pop()\n filtered[key]?.forEach((item: any) => {\n allFilters.push({\n variantMetafield: {\n namespace: 'filter',\n key: metafieldsKey,\n value: item,\n },\n })\n })\n }\n if (key.includes('offers')) {\n chunkNumber = 150\n }\n })\n return { allFilters: allFilters, chunkNumber: chunkNumber }\n}\n\nconst handleSortKeyAndReverse = (sortList: any, sortKeyIndx: number) => {\n if (sortList && sortKeyIndx >= 0) {\n const current = sortList?.[sortKeyIndx]\n if (!current?.type?.includes('filter.')) {\n const [sortKey, reverse] = current?.type?.split('|')\n return [sortKey, !!reverse]\n }\n }\n return ['COLLECTION_DEFAULT', false]\n}\n\nconst handleChunkNumber = (filtered: any) => {\n if (Object.keys(filtered)?.some(key => key === 'offers')) return 150\n return 18\n}\n\n\nconst handleFilterOptions = (result: any, filterPrice: any, shop_filters_pair: any, filterProductData?: any) => {\n const Offers = {\n label: shop_filters_pair?.filter_txt?.offers?.name || 'Offers',\n value: 'offers',\n mainPair: false,\n options: [\n {\n label: shop_filters_pair?.filter_txt?.offers?.onsale || 'On Sale',\n value: 'onsale',\n },\n ],\n }\n filterPrice.mainPair = false\n const initOption = [filterPrice, Offers]\n return (\n result?.filters &&\n result.filters.reduce((ac: any, cu: any) => {\n const filter = {\n label: cu?.label,\n options: [],\n value: cu?.id,\n mainPair: filterProductData?.mainPair?.type === cu?.id ? true : false,\n }\n // if (cu?.id === 'filter.p.tag') return ac\n if (cu?.id === 'filter.v.price') return ac\n if (cu?.id === 'filter.p.product_type') return ac\n if (cu?.id === 'filter.v.availability') {\n filter.options = cu.values.reduce((acV: any, cuV: any) => {\n if (cuV.id === 'filter.v.availability.1') {\n acV.push({\n count: cuV.count,\n label: cuV.label,\n value: cuV.id,\n })\n }\n return [...acV]\n }, [])\n ac.push(filter)\n return [...ac]\n }\n if (cu?.id === 'filter.v.m.filter.capacity') {\n filter.options = cu.values.reduce((acV: any, cuV: any) => {\n if (cuV?.label?.includes('Over')) {\n acV.unshift({\n count: cuV.count,\n label: cuV.label,\n value: cuV.label,\n })\n } else {\n acV.push({\n count: cuV.count,\n label: cuV.label,\n value: cuV.label,\n })\n }\n return [...acV]\n }, [])\n ac.push(filter)\n return [...ac]\n }\n filter.options = cu.values.reduce((acV: any, cuV: any) => {\n acV.push({\n count: cuV.count,\n label: cuV.label,\n value: cuV.label,\n })\n return [...acV]\n }, [])\n ac.push(filter)\n return [...ac]\n }, initOption)\n )\n}\n\nfunction getComponentData(\n metafields: any,\n dataKey: string,\n variant: any = null,\n components: any = null\n) {\n // console.log(\"metafields\", metafields)\n // \u83B7\u53D6 component \u7684\u6587\u6848\n\n let data = {}\n if (components) {\n data = components[dataKey?.trim()] || {}\n } else {\n data = metafields?.components ? metafields.components[dataKey?.trim()] : {}\n }\n\n if (variant) {\n // \u5982\u679C\u6709\u4E14 variant \u6709\u5BF9\u5E94\u6587\u6848\uFF0Cvariant \u8986\u76D6 component\n const { variantsMetafields = {} } =\n components || metafields?.components || {}\n\n const variantMetafields = Array.isArray(variantsMetafields)\n ? variantsMetafields?.find((f) => f.id === variant?.id)\n : {}\n if (\n variantMetafields?.metafields &&\n variantMetafields.metafields[dataKey]\n ) {\n data = variantMetafields.metafields[dataKey]\n }\n }\n\n return {\n key: dataKey.split('_')[0],\n data,\n }\n}\n\nexport { handleFilters, handleSortKeyAndReverse, handleChunkNumber, handleFilterOptions, getComponentData }"],
|
|
4
|
+
"sourcesContent": ["const handleFilters = (filtered: any) => {\n const allFilters: any[] = []\n let chunkNumber: number = 18\n Object.keys(filtered).forEach(key => {\n if (key === 'price') {\n const priceOptions =\n filtered[key]\n ?.join('|')\n ?.split('|')\n ?.map((item: any) => Number(item)) || []\n const maxValue = Math.max(...priceOptions)\n const minValue = Math.min(...priceOptions)\n maxValue &&\n minValue &&\n allFilters.push({\n price: {\n max: maxValue,\n min: minValue,\n },\n })\n }\n if (key.includes('filter.p.tag')) {\n filtered[key]?.forEach((item: any) => {\n allFilters.push({\n tag: item,\n })\n })\n }\n if (key.includes('filter.p.product_type')) {\n filtered[key]?.forEach((item: any) => {\n allFilters.push({\n productType: item,\n })\n })\n }\n if (key.includes('filter.v.availability')) {\n filtered[key]?.forEach((item: string) => {\n const val = item.split('filter.v.availability.')?.pop()\n allFilters.push({\n available: val === '1',\n })\n })\n }\n if (key.includes('filter.v.m.filter.')) {\n const metafieldsKey = key.split('filter.v.m.filter.')?.pop()\n filtered[key]?.forEach((item: any) => {\n allFilters.push({\n variantMetafield: {\n namespace: 'filter',\n key: metafieldsKey,\n value: item,\n },\n })\n })\n }\n if (key.includes('offers')) {\n chunkNumber = 150\n }\n })\n return { allFilters: allFilters, chunkNumber: chunkNumber }\n}\n\nconst handleSortKeyAndReverse = (sortList: any, sortKeyIndx: number) => {\n if (sortList && sortKeyIndx >= 0) {\n const current = sortList?.[sortKeyIndx]\n if (!current?.type?.includes('filter.')) {\n const [sortKey, reverse] = current?.type?.split('|')\n return [sortKey, !!reverse]\n }\n }\n return ['COLLECTION_DEFAULT', false]\n}\n\nconst handleChunkNumber = (filtered: any) => {\n if (Object.keys(filtered)?.some(key => key === 'offers')) return 150\n return 18\n}\n\n\nconst handleFilterOptions = (result: any, filterPrice: any, shop_filters_pair: any, filterProductData?: any) => {\n const Offers = {\n label: shop_filters_pair?.filter_txt?.offers?.name || 'Offers',\n value: 'offers',\n mainPair: false,\n options: [\n {\n label: shop_filters_pair?.filter_txt?.offers?.onsale || 'On Sale',\n value: 'onsale',\n },\n ],\n }\n filterPrice.mainPair = false\n const initOption = [filterPrice, Offers]\n return (\n result?.filters &&\n result.filters.reduce((ac: any, cu: any) => {\n const filter = {\n label: cu?.label,\n options: [],\n value: cu?.id,\n mainPair: filterProductData?.mainPair?.type === cu?.id ? true : false,\n }\n // if (cu?.id === 'filter.p.tag') return ac\n if (cu?.id === 'filter.v.price') return ac\n if (cu?.id === 'filter.p.product_type') return ac\n if (cu?.id === 'filter.v.availability') {\n filter.options = cu.values.reduce((acV: any, cuV: any) => {\n if (cuV.id === 'filter.v.availability.1') {\n acV.push({\n count: cuV.count,\n label: cuV.label,\n value: cuV.id,\n })\n }\n return [...acV]\n }, [])\n ac.push(filter)\n return [...ac]\n }\n if (cu?.id === 'filter.v.m.filter.capacity') {\n filter.options = cu.values.reduce((acV: any, cuV: any) => {\n if (cuV?.label?.includes('Over')) {\n acV.unshift({\n count: cuV.count,\n label: cuV.label,\n value: cuV.label,\n })\n } else {\n acV.push({\n count: cuV.count,\n label: cuV.label,\n value: cuV.label,\n })\n }\n return [...acV]\n }, [])\n ac.push(filter)\n return [...ac]\n }\n filter.options = cu.values.reduce((acV: any, cuV: any) => {\n acV.push({\n count: cuV.count,\n label: cuV.label,\n value: cuV.label,\n })\n return [...acV]\n }, [])\n ac.push(filter)\n return [...ac]\n }, initOption)\n )\n}\n\nfunction getComponentData(\n metafields: any,\n dataKey: string,\n variant: any = null,\n components: any = null\n) {\n // console.log(\"metafields\", metafields)\n // \u83B7\u53D6 component \u7684\u6587\u6848\n\n let data = {}\n if (components) {\n data = components[dataKey?.trim()] || {}\n } else {\n data = metafields?.components ? metafields.components[dataKey?.trim()] : {}\n }\n\n if (variant) {\n // \u5982\u679C\u6709\u4E14 variant \u6709\u5BF9\u5E94\u6587\u6848\uFF0Cvariant \u8986\u76D6 component\n const { variantsMetafields = {} } =\n components || metafields?.components || {}\n\n const variantMetafields = Array.isArray(variantsMetafields)\n ? variantsMetafields?.find((f) => f.id === variant?.id)\n : {}\n if (\n variantMetafields?.metafields &&\n variantMetafields.metafields[dataKey]\n ) {\n data = variantMetafields.metafields[dataKey]\n }\n }\n\n return {\n key: dataKey.split('_')[0],\n data,\n }\n}\n\nexport { handleFilters, handleSortKeyAndReverse, handleChunkNumber, handleFilterOptions, getComponentData }\n"],
|
|
5
5
|
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,EAAA,sBAAAC,EAAA,wBAAAC,EAAA,kBAAAC,EAAA,4BAAAC,IAAA,eAAAC,EAAAP,GAAA,MAAMK,EAAiBG,GAAkB,CACvC,MAAMC,EAAoB,CAAC,EAC3B,IAAIC,EAAsB,GAC1B,cAAO,KAAKF,CAAQ,EAAE,QAAQG,GAAO,CACnC,GAAI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MAAOA,EAAI,KACb,CAAC,EAEI,CAAC,GAAGD,CAAG,GACb,CAAC,CAAC,EACLH,EAAG,KAAKE,CAAM,EACP,CAAC,GAAGF,CAAE,IAEfE,EAAO,QAAUD,EAAG,OAAO,OAAO,CAACE,EAAUC,KAC3CD,EAAI,KAAK,CACP,MAAOC,EAAI,MACX,MAAOA,EAAI,MACX,MAAOA,EAAI,KACb,CAAC,EACM,CAAC,GAAGD,CAAG,GACb,CAAC,CAAC,EACLH,EAAG,KAAKE,CAAM,EACP,CAAC,GAAGF,CAAE,EACf,EAAGD,CAAU,CAEnB,EAEA,SAAS1B,EACPgC,EACAC,EACAC,EAAe,KACfC,EAAkB,KAClB,CAIA,IAAIC,EAAO,CAAC,EAOZ,GANID,EACFC,EAAOD,EAAWF,GAAS,KAAK,CAAC,GAAK,CAAC,EAEvCG,EAAOJ,GAAY,WAAaA,EAAW,WAAWC,GAAS,KAAK,CAAC,EAAI,CAAC,EAGxEC,EAAS,CAEX,KAAM,CAAE,mBAAAG,EAAqB,CAAC,CAAE,EAC9BF,GAAcH,GAAY,YAAc,CAAC,EAErCM,EAAoB,MAAM,QAAQD,CAAkB,EACtDA,GAAoB,KAAME,GAAMA,EAAE,KAAOL,GAAS,EAAE,EACpD,CAAC,EAEHI,GAAmB,YACnBA,EAAkB,WAAWL,CAAO,IAEpCG,EAAOE,EAAkB,WAAWL,CAAO,EAE/C,CAEA,MAAO,CACL,IAAKA,EAAQ,MAAM,GAAG,EAAE,CAAC,EACzB,KAAAG,CACF,CACF",
|
|
6
6
|
"names": ["filtersFun_exports", "__export", "getComponentData", "handleChunkNumber", "handleFilterOptions", "handleFilters", "handleSortKeyAndReverse", "__toCommonJS", "filtered", "allFilters", "chunkNumber", "key", "priceOptions", "item", "maxValue", "minValue", "val", "metafieldsKey", "sortList", "sortKeyIndx", "current", "sortKey", "reverse", "result", "filterPrice", "shop_filters_pair", "filterProductData", "Offers", "initOption", "ac", "cu", "filter", "acV", "cuV", "metafields", "dataKey", "variant", "components", "data", "variantsMetafields", "variantMetafields", "f"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";"use client";var i=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var g=(l,e)=>{for(var s in e)i(l,s,{get:e[s],enumerable:!0})},u=(l,e,s,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of d(e))!f.call(l,p)&&p!==s&&i(l,p,{get:()=>e[p],enumerable:!(o=c(e,p))||o.enumerable});return l};var w=l=>u(i({},"__esModule",{value:!0}),l);var h={};g(h,{default:()=>y});module.exports=w(h);var t=require("react/jsx-runtime"),v=require("../../helpers/utils.js"),x=require("../../shared/Styles.js"),a=require("../../components/index.js");const N=l=>{const{data:e}=l,{title:s,text:o,time:p,line:n,icon:m,link:r}=e;return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("div",{className:"bg-[#EAEAEC] rounded-2xl w-full",children:(0,t.jsxs)("div",{className:"w-full flex items-center justify-between py-[12px] px-[24px]",children:[(0,t.jsxs)("div",{className:"flex items-center flex-row laptop:gap-[24px] gap-[12px]",children:[(0,t.jsx)(a.Text,{html:s,className:"text-[14px] font-bold leading-[1.4] laptop:text-[18px]"}),(0,t.jsx)(a.Picture,{className:" h-[16px]",source:n?.url,alt:n?.alt||""}),(0,t.jsx)(a.Text,{html:o,className:"text-[14px] font-bold leading-[1.4] laptop:text-[18px]"})]}),(0,t.jsxs)(a.Link,{href:r,target:"_blank",className:"flex items-center justify-center flex-row laptop:gap-[24px] gap-[4px] ",children:[(0,t.jsx)(a.Text,{html:p,className:"text-[14px] font-bold leading-[1.4] laptop:text-[18px]"}),(0,t.jsx)(a.Picture,{className:"w-[24px]",imgClassName:"w-full h-auto",source:m?.url,alt:m?.alt||""})]})]})})})};var y=(0,x.withLayout)(N);
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/DownLoad/index.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\nimport { cn } from '../../helpers/utils.js'\nimport type { Img } from '../../types/props.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Picture, Text ,Link} from '../../components/index.js'\n\n\ntype DownLoadType = {\n data: {\n title: string\n text: string\n time: string\n link: string\n line: Img\n icon: Img\n }\n className?: string\n}\n\nconst DownLoad = (props: DownLoadType) => {\n const { data } = props\n const { title, text, time, line, icon ,link} = data\n\n return (\n <>\n <div className='bg-[#EAEAEC] rounded-2xl w-full'>\n <div className='w-full flex items-center justify-between py-[12px] px-[24px]'>\n <div className='flex items-center flex-row laptop:gap-[24px] gap-[12px]'>\n <Text html={title} className='text-[14px] font-bold leading-[1.4] laptop:text-[18px]' />\n <Picture\n className=' h-[16px]'\n source={line?.url}\n alt={line?.alt || ''}\n />\n <Text html={text} className='text-[14px] font-bold leading-[1.4] laptop:text-[18px]'/>\n </div>\n \n <Link href={link} target='_blank' className='flex items-center justify-center flex-row laptop:gap-[24px] gap-[4px] '>\n <Text html={time} className='text-[14px] font-bold leading-[1.4] laptop:text-[18px]'/>\n <Picture\n className=\"w-[24px]\" // \u9650\u5236\u6700\u5916\u5C42\u5BBD\u5EA6\n imgClassName=\"w-full h-auto\"\n source={icon?.url}\n alt={icon?.alt || ''}\n />\n </Link>\n </div>\n </div>\n </>\n )\n}\n\nexport default withLayout(DownLoad)\n"],
|
|
5
|
+
"mappings": "sbAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAwBI,IAAAI,EAAA,6BAvBJC,EAAmB,kCAEnBC,EAA2B,kCAC3BC,EAAmC,qCAenC,MAAMC,EAAYC,GAAwB,CACxC,KAAM,CAAE,KAAAC,CAAK,EAAID,EACX,CAAE,MAAAE,EAAO,KAAAC,EAAM,KAAAC,EAAM,KAAAC,EAAM,KAAAC,EAAM,KAAAC,CAAI,EAAIN,EAE/C,SACE,mBACE,mBAAC,OAAI,UAAU,kCACb,oBAAC,OAAI,UAAU,+DACX,qBAAC,OAAI,UAAU,0DACX,oBAAC,QAAK,KAAMC,EAAO,UAAU,yDAAyD,KACtF,OAAC,WACG,UAAU,YACV,OAAQG,GAAM,IACd,IAAKA,GAAM,KAAO,GACtB,KACA,OAAC,QAAK,KAAMF,EAAM,UAAU,yDAAwD,GACxF,KAEA,QAAC,QAAK,KAAMI,EAAM,OAAO,SAAS,UAAU,yEACxC,oBAAC,QAAK,KAAMH,EAAM,UAAU,yDAAwD,KACpF,OAAC,WACG,UAAU,WACV,aAAa,gBACb,OAAQE,GAAM,IACd,IAAKA,GAAM,KAAO,GACtB,GACJ,GACJ,EACF,EACF,CAEJ,EAEA,IAAOb,KAAQ,cAAWM,CAAQ",
|
|
6
|
+
"names": ["DownLoad_exports", "__export", "DownLoad_default", "__toCommonJS", "import_jsx_runtime", "import_utils", "import_Styles", "import_components", "DownLoad", "props", "data", "title", "text", "time", "line", "icon", "link"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";"use client";var d=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var c=(p,l)=>{for(var s in l)d(p,s,{get:l[s],enumerable:!0})},m=(p,l,s,o)=>{if(l&&typeof l=="object"||typeof l=="function")for(let e of n(l))!g.call(p,e)&&e!==s&&d(p,e,{get:()=>l[e],enumerable:!(o=x(l,e))||o.enumerable});return p};var k=p=>m(d({},"__esModule",{value:!0}),p);var v={};c(v,{default:()=>u});module.exports=k(v);var t=require("react/jsx-runtime"),N=require("../../helpers/utils.js"),w=require("../SwiperBox/index.js"),r=require("../../shared/Styles.js"),a=require("../../components/index.js");const b=p=>{const{data:l,className:s}=p,{list:o}=l;return(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{className:"",children:[l?.title&&(0,t.jsx)("div",{className:"py-[24px] desktop:w-[800px]",children:(0,t.jsx)(a.Text,{html:l?.title,className:"graphic-title desktop:text-[32px] line-clamp-3 lg-desktop:text-lg desktop:text-base text-[23px] font-bold leading-[1.2]"})}),l?.img?.url&&(0,t.jsx)(a.Picture,{className:"aspect-[1664/560] rounded-2xl md-tablet:hidden",imgClassName:"",source:l?.img?.url,alt:l?.img?.alt||""}),l?.mobileImg?.url&&(0,t.jsx)(a.Picture,{className:"aspect-[358/360] rounded-2xl tablet:hidden",imgClassName:"",source:l?.mobileImg?.url,alt:l?.mobileImg?.alt||""}),(0,t.jsx)("div",{className:"laptop:pt-[64px] tablet:pt-[32px]",children:(0,t.jsx)("div",{className:"flex flex-col gap-4",children:o.map((e,i)=>(0,t.jsxs)("div",{className:`desktop:flex pt-[64px] gap-4 tablet:gap-8 laptop:gap-[64px] ${i%2===0?"laptop:flex-row-reverse":""}`,children:[(0,t.jsxs)("div",{className:"flex flex-col justify-center",children:[(0,t.jsx)(a.Text,{html:e?.title,className:"graphic-title line-clamp-3 lg-desktop:text-lg desktop:text-base desktop:text-[32px] text-[24px] font-bold leading-[1.2]"}),(0,t.jsx)(a.Text,{html:e?.description,className:"graphic-title pt-[4px] desktop:pt-[8px] line-clamp-3 lg-desktop:text-lg desktop:text-base lg-desktop:text-[18px] desktop:text-[16px] text-[14px] font-bold leading-[1.2]"}),e?.numberOne&&(0,t.jsxs)("div",{className:"desktop:pt-[48px] pt-[24px] flex desktop:flex-col flex-row desktop:gap-[48px] gap-[24px]",children:[(0,t.jsxs)("div",{className:"",children:[(0,t.jsx)(a.Text,{style:{background:"var(--1, linear-gradient(90deg, #3AD1FF 0%, #008CD6 100%))",backgroundClip:"text",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",color:"transparent"},html:e?.numberOne,className:"graphic-title line-clamp-3 lg-desktop:text-lg desktop:text-base desktop:text-[64px] text-[40px] font-bold leading-[1]"}),(0,t.jsx)(a.Text,{html:e?.textOne,className:"graphic-title line-clamp-3 lg-desktop:text-lg desktop:text-base desktop:text-[18px] text-[14px] font-bold leading-[1.4]"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(a.Text,{style:{background:"var(--1, linear-gradient(90deg, #3AD1FF 0%, #008CD6 100%))",backgroundClip:"text",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",color:"transparent"},html:e?.numberTwo,className:"graphic-title line-clamp-3 lg-desktop:text-lg desktop:text-base desktop:text-[64px] text-[40px] font-bold leading-[1]"}),(0,t.jsx)(a.Text,{html:e?.textTwo,className:"graphic-title line-clamp-3 lg-desktop:text-lg desktop:text-base desktop:text-[18px] text-[14px] font-bold leading-[1.4]"})]})]}),e?.icon?.url&&(0,t.jsx)("div",{className:"pt-[24px] desktop:pt-[24px] lg-desktop:pt-[48px]",children:(0,t.jsx)(a.Picture,{className:"w-[358px] desktop:w-[368px] lg-desktop:w-[488px]",source:e?.icon?.url,alt:e?.icon?.alt||""})})]}),(0,t.jsx)("div",{className:"aspect-[964/560] md-tablet:hidden rounded-2xl overflow-hidden pt-[24px] laptop:pt-[32px] desktop:pt-[0px]",children:(0,t.jsx)(a.Picture,{className:"w-full h-full object-cover ",source:e?.img?.url,alt:e?.img?.alt||""})}),(0,t.jsx)("div",{className:"aspect-[358/360] tablet:hidden rounded-2xl overflow-hidden mt-[24px]",children:(0,t.jsx)(a.Picture,{className:"w-full h-full object-cover",source:e?.mobileImg?.url,alt:e?.mobileImg?.alt||""})})]},i))})})]})})};var u=(0,r.withLayout)(b);
|
|
2
|
+
//# sourceMappingURL=index.js.map
|