@gem-sdk/components 2.0.0-dev.277 → 2.0.0-dev.288
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/accordion/components/Accordion.js +60 -179
- package/dist/cjs/accordion/components/Accordion.liquid.js +77 -101
- package/dist/cjs/accordion/components/AccordionItem.js +126 -280
- package/dist/cjs/accordion/components/AccordionItem.liquid.js +77 -215
- package/dist/cjs/accordion/components/common/classes.js +55 -0
- package/dist/cjs/accordion/components/common/index.js +146 -0
- package/dist/cjs/accordion/components/common/styles.js +131 -0
- package/dist/cjs/accordion/hooks/useAccordion.js +145 -0
- package/dist/cjs/accordion/hooks/useAccordionItem.js +119 -0
- package/dist/cjs/article/components/ArticleImage.js +0 -1
- package/dist/cjs/article/components/ArticlePagination.js +1 -1
- package/dist/cjs/article/components/ArticlePagination.liquid.js +3 -3
- package/dist/cjs/article/setting/configs/ArticleImage/settings.js +5 -5
- package/dist/cjs/banner/components/HeroBannerItem.js +0 -6
- package/dist/cjs/banner/components/HeroBannerItem.liquid.js +3 -0
- package/dist/cjs/banner/setting/setting.js +28 -3
- package/dist/cjs/banner/setting/uiV2.js +10 -97
- package/dist/cjs/builder.js +18 -20
- package/dist/cjs/cart/components/CartLineImage.js +0 -2
- package/dist/cjs/code/common/classes.js +11 -0
- package/dist/cjs/code/common/styles.js +15 -0
- package/dist/cjs/code/components/CSSCode.js +9 -99
- package/dist/cjs/code/components/CSSCode.liquid.js +11 -11
- package/dist/cjs/code/hooks/useCSSCode.js +102 -0
- package/dist/cjs/code/setting/CSSCode.js +7 -121
- package/dist/cjs/code/setting/config/setting.js +77 -0
- package/dist/cjs/code/setting/config/uiV1.js +52 -0
- package/dist/cjs/code/setting/config/uiV2.js +58 -0
- package/dist/cjs/estimate-delivery/components/EstimateDate.liquid.js +4 -1
- package/dist/cjs/form/components/contact/Contact.js +6 -2
- package/dist/cjs/form/components/contact/common/composeStyles.js +21 -0
- package/dist/cjs/form/components/form-checkbox/FormCheckbox.js +6 -4
- package/dist/cjs/form/components/form-checkbox/FormCheckbox.liquid.js +2 -4
- package/dist/cjs/form/components/form-checkbox/common/composeClasses.js +2 -2
- package/dist/cjs/form/components/form-checkbox/common/composeStyles.js +23 -10
- package/dist/cjs/form/components/form-dropdown/common/composeClasses.js +1 -1
- package/dist/cjs/form/components/form-email/FormEmail.js +18 -10
- package/dist/cjs/form/components/form-email/common/composeClasses.js +2 -1
- package/dist/cjs/form/components/newsletter/Newsletter.js +7 -2
- package/dist/cjs/form/components/newsletter/Newsletter.liquid.js +1 -1
- package/dist/cjs/form/components/newsletter/common/composeStyles.js +4 -2
- package/dist/cjs/form/components/textarea/TextArea.js +16 -8
- package/dist/cjs/form/components/textarea/common/composeClasses.js +1 -1
- package/dist/cjs/form/components/textfield/TextField.js +17 -9
- package/dist/cjs/form/components/textfield/common/composeClasses.js +2 -2
- package/dist/cjs/form/setting/contact/Contact.js +5 -1
- package/dist/cjs/form/setting/form-checkbox/configs/settings.js +153 -6
- package/dist/cjs/form/setting/form-checkbox/configs/uiV2.js +137 -0
- package/dist/cjs/form/setting/form-dropdown/configs/settings.js +147 -0
- package/dist/cjs/form/setting/form-dropdown/configs/uiV2.js +156 -4
- package/dist/cjs/form/setting/newsletter/configs/settings.js +132 -3
- package/dist/cjs/form/setting/newsletter/configs/uiV2.js +93 -0
- package/dist/cjs/form/setting/submit-button/configs/settings.js +37 -0
- package/dist/cjs/form/setting/submit-button/configs/uiV2.js +13 -0
- package/dist/cjs/grid/row/commons/getInnerRadius.js +11 -10
- package/dist/cjs/grid/row/setting/configs/uiV2.js +1 -1
- package/dist/cjs/header/components/kind/basic/index.js +1 -0
- package/dist/cjs/header/components/kind/modern/index.js +1 -1
- package/dist/cjs/helpers.js +53 -0
- package/dist/cjs/icon-list/setting/configs/uiV2.js +1 -1
- package/dist/cjs/icon-list-v2/setting/configs/settings.js +5 -5
- package/dist/cjs/image/components/AdaptiveImage.js +63 -49
- package/dist/cjs/image/components/AdaptiveImage.liquid.js +56 -44
- package/dist/cjs/image/components/Image.js +65 -154
- package/dist/cjs/image/components/Image.liquid.js +68 -103
- package/dist/cjs/image/components/Modal3d.liquid.js +54 -21
- package/dist/cjs/image/components/NextImage.js +26 -59
- package/dist/cjs/image/components/NextImage.liquid.js +27 -115
- package/dist/cjs/image/components/Video.liquid.js +38 -13
- package/dist/cjs/image/components/common/attributes.js +115 -0
- package/dist/cjs/image/components/common/classes.js +57 -0
- package/dist/cjs/image/components/common/constants.js +15 -0
- package/dist/cjs/image/components/common/data.js +24 -0
- package/dist/cjs/image/components/common/helpers.js +75 -0
- package/dist/cjs/image/components/common/styles.js +88 -0
- package/dist/cjs/image/components/helpers/getNextImageLiquidAttrs.js +80 -0
- package/dist/cjs/image/components/helpers/getNextImageReactAttrs.js +40 -0
- package/dist/cjs/image/components/hooks/useCheckNoImage.js +25 -0
- package/dist/cjs/image/helpers/getSrcSet.js +0 -2
- package/dist/cjs/image/next.js +1 -5
- package/dist/cjs/image/setting/configs/settings.js +14 -8
- package/dist/cjs/image/setting/configs/uiV2.js +61 -15
- package/dist/cjs/image/setting/index.js +1 -3
- package/dist/cjs/image-comparison/components/CompareImage.js +1 -1
- package/dist/cjs/image-comparison/components/CompareImage.liquid.js +1 -1
- package/dist/cjs/index.js +91 -91
- package/dist/cjs/index.liquid.js +8 -8
- package/dist/cjs/post-purchase/callout-banner/setting/config/callout-box/setting.js +4 -10
- package/dist/cjs/post-purchase/countdown-timer/components/PostPurchaseCountdownTimer.js +9 -23
- package/dist/cjs/post-purchase/countdown-timer/components/TextCountdown.js +12 -26
- package/dist/cjs/post-purchase/countdown-timer/components/common/getClasses.js +24 -0
- package/dist/cjs/post-purchase/countdown-timer/components/common/getStyles.js +21 -0
- package/dist/cjs/post-purchase/countdown-timer/hooks/useCountdownTimer.js +18 -1
- package/dist/cjs/post-purchase/countdown-timer/hooks/useGetTimeExpired.js +18 -0
- package/dist/cjs/post-purchase/countdown-timer/settings/CountdownTimer.js +9 -358
- package/dist/cjs/post-purchase/countdown-timer/settings/config/preset.js +26 -0
- package/dist/cjs/post-purchase/countdown-timer/settings/config/setting.js +243 -0
- package/dist/cjs/post-purchase/countdown-timer/settings/config/uiV1.js +125 -0
- package/dist/cjs/post-purchase/countdown-timer/settings/config/uiV2.js +185 -0
- package/dist/cjs/post-purchase/image/common/getClasses.js +1 -1
- package/dist/cjs/post-purchase/image/setting/setting-v2.js +5 -5
- package/dist/cjs/post-purchase/product/components/product-image/carousel-post-purchase/CarouselWrapperPostPurchase.js +24 -26
- package/dist/cjs/post-purchase/product/hooks/product-image/useListCarousel.js +1 -1
- package/dist/cjs/post-purchase/product/hooks/product-image/useProductImagePostPurchase.js +4 -1
- package/dist/cjs/post-purchase/product/settings/product-image/setting-v2.js +20 -7
- package/dist/cjs/post-purchase/product/settings/product-image/uiV2.js +3 -1
- package/dist/cjs/post-purchase/product/settings/product-price-breakdown/configs/settings.js +2 -2
- package/dist/cjs/post-purchase/product/settings/product-quantity/configs/settings.js +1 -1
- package/dist/cjs/post-purchase/utils/constants.js +1 -1
- package/dist/cjs/product/components/FileUpload/components/common/index.js +3 -0
- package/dist/cjs/product/components/ProductBundle/common/classes.js +25 -0
- package/dist/cjs/product/components/ProductBundle/common/index.js +5 -0
- package/dist/cjs/product/components/ProductBundle/common/styles.js +89 -0
- package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscount.js +82 -0
- package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscount.liquid.js +74 -0
- package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.js +69 -0
- package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.liquid.js +46 -0
- package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountItem.js +23 -0
- package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountItem.liquid.js +14 -0
- package/dist/cjs/product/components/{ProductBundleDiscount.js → ProductBundle/hooks/useProductBundleDataState.js} +20 -215
- package/dist/cjs/product/components/ProductBundle/hooks/useProductBundleDiscountState.js +56 -0
- package/dist/cjs/product/{setting → components/ProductBundle/setting}/ProductBundleDiscount.js +7 -7
- package/dist/cjs/product/{setting → components/ProductBundle/setting}/ProductBundleDiscountItem.js +3 -0
- package/dist/cjs/product/components/ProductButton.js +2 -2
- package/dist/cjs/product/components/ProductButton.liquid.js +2 -2
- package/dist/cjs/product/components/ProductPrice/common/getAttr.js +23 -0
- package/dist/cjs/product/components/ProductPrice/common/getClasses.js +19 -0
- package/dist/cjs/product/components/ProductPrice/common/getTextData.js +40 -0
- package/dist/cjs/product/components/ProductPrice/hooks/useGpPrice.js +126 -0
- package/dist/cjs/product/components/ProductPrice/index.js +54 -0
- package/dist/cjs/product/components/ProductPrice/index.liquid.js +43 -0
- package/dist/cjs/product/components/ProductQuickView/ProductQuickView.js +5 -5
- package/dist/cjs/product/next.js +3 -3
- package/dist/cjs/product/setting/index.js +2 -2
- package/dist/cjs/product/setting/product/configs/presets.js +1 -0
- package/dist/cjs/product/setting/product-image-v2/configs/setting-v2/ProductFeatureImage.js +6 -7
- package/dist/cjs/product/setting/product-image-v2/configs/setting-v2/ProductGalleryImage.js +11 -12
- package/dist/cjs/product/setting/product-image-v2/configs/setting-v2/index.js +6 -5
- package/dist/cjs/product/setting/product-list/configs/settingsV2.js +10 -8
- package/dist/cjs/setting.js +5 -2
- package/dist/esm/accordion/components/Accordion.js +61 -180
- package/dist/esm/accordion/components/Accordion.liquid.js +78 -102
- package/dist/esm/accordion/components/AccordionItem.js +129 -281
- package/dist/esm/accordion/components/AccordionItem.liquid.js +76 -214
- package/dist/esm/accordion/components/common/classes.js +44 -0
- package/dist/esm/accordion/components/common/index.js +136 -0
- package/dist/esm/accordion/components/common/styles.js +122 -0
- package/dist/esm/accordion/hooks/useAccordion.js +141 -0
- package/dist/esm/accordion/hooks/useAccordionItem.js +115 -0
- package/dist/esm/article/components/ArticleImage.js +0 -1
- package/dist/esm/article/components/ArticlePagination.js +1 -1
- package/dist/esm/article/components/ArticlePagination.liquid.js +3 -3
- package/dist/esm/article/setting/configs/ArticleImage/settings.js +5 -5
- package/dist/esm/banner/components/HeroBannerItem.js +0 -6
- package/dist/esm/banner/components/HeroBannerItem.liquid.js +3 -0
- package/dist/esm/banner/setting/setting.js +28 -3
- package/dist/esm/banner/setting/uiV2.js +10 -97
- package/dist/esm/builder.js +3 -5
- package/dist/esm/cart/components/CartLineImage.js +0 -2
- package/dist/esm/code/common/classes.js +9 -0
- package/dist/esm/code/common/styles.js +13 -0
- package/dist/esm/code/components/CSSCode.js +9 -99
- package/dist/esm/code/components/CSSCode.liquid.js +12 -12
- package/dist/esm/code/hooks/useCSSCode.js +98 -0
- package/dist/esm/code/setting/CSSCode.js +7 -121
- package/dist/esm/code/setting/config/setting.js +75 -0
- package/dist/esm/code/setting/config/uiV1.js +50 -0
- package/dist/esm/code/setting/config/uiV2.js +56 -0
- package/dist/esm/estimate-delivery/components/EstimateDate.liquid.js +4 -1
- package/dist/esm/form/components/contact/Contact.js +7 -3
- package/dist/esm/form/components/contact/common/composeStyles.js +19 -0
- package/dist/esm/form/components/form-checkbox/FormCheckbox.js +7 -5
- package/dist/esm/form/components/form-checkbox/FormCheckbox.liquid.js +3 -5
- package/dist/esm/form/components/form-checkbox/common/composeClasses.js +2 -2
- package/dist/esm/form/components/form-checkbox/common/composeStyles.js +25 -11
- package/dist/esm/form/components/form-dropdown/common/composeClasses.js +1 -1
- package/dist/esm/form/components/form-email/FormEmail.js +18 -10
- package/dist/esm/form/components/form-email/common/composeClasses.js +2 -1
- package/dist/esm/form/components/newsletter/Newsletter.js +8 -3
- package/dist/esm/form/components/newsletter/Newsletter.liquid.js +1 -1
- package/dist/esm/form/components/newsletter/common/composeStyles.js +4 -2
- package/dist/esm/form/components/textarea/TextArea.js +16 -8
- package/dist/esm/form/components/textarea/common/composeClasses.js +1 -1
- package/dist/esm/form/components/textfield/TextField.js +17 -9
- package/dist/esm/form/components/textfield/common/composeClasses.js +2 -2
- package/dist/esm/form/setting/contact/Contact.js +5 -1
- package/dist/esm/form/setting/form-checkbox/configs/settings.js +153 -6
- package/dist/esm/form/setting/form-checkbox/configs/uiV2.js +137 -0
- package/dist/esm/form/setting/form-dropdown/configs/settings.js +147 -0
- package/dist/esm/form/setting/form-dropdown/configs/uiV2.js +156 -4
- package/dist/esm/form/setting/newsletter/configs/settings.js +132 -3
- package/dist/esm/form/setting/newsletter/configs/uiV2.js +93 -0
- package/dist/esm/form/setting/submit-button/configs/settings.js +37 -0
- package/dist/esm/form/setting/submit-button/configs/uiV2.js +13 -0
- package/dist/esm/grid/row/commons/getInnerRadius.js +11 -10
- package/dist/esm/grid/row/setting/configs/uiV2.js +1 -1
- package/dist/esm/header/components/kind/basic/index.js +1 -0
- package/dist/esm/header/components/kind/modern/index.js +1 -1
- package/dist/esm/helpers.js +52 -1
- package/dist/esm/icon-list/setting/configs/uiV2.js +1 -1
- package/dist/esm/icon-list-v2/setting/configs/settings.js +5 -5
- package/dist/esm/image/components/AdaptiveImage.js +64 -50
- package/dist/esm/image/components/AdaptiveImage.liquid.js +57 -45
- package/dist/esm/image/components/Image.js +66 -155
- package/dist/esm/image/components/Image.liquid.js +69 -104
- package/dist/esm/image/components/Modal3d.liquid.js +55 -22
- package/dist/esm/image/components/NextImage.js +26 -59
- package/dist/esm/image/components/NextImage.liquid.js +28 -116
- package/dist/esm/image/components/Video.liquid.js +38 -13
- package/dist/esm/image/components/common/attributes.js +108 -0
- package/dist/esm/image/components/common/classes.js +51 -0
- package/dist/esm/image/components/common/constants.js +11 -0
- package/dist/esm/image/components/common/data.js +22 -0
- package/dist/esm/image/components/common/helpers.js +69 -0
- package/dist/esm/image/components/common/styles.js +80 -0
- package/dist/esm/image/components/helpers/getNextImageLiquidAttrs.js +78 -0
- package/dist/esm/image/components/helpers/getNextImageReactAttrs.js +38 -0
- package/dist/esm/image/components/hooks/useCheckNoImage.js +23 -0
- package/dist/esm/image/helpers/getSrcSet.js +1 -2
- package/dist/esm/image/next.js +1 -5
- package/dist/esm/image/setting/configs/settings.js +14 -8
- package/dist/esm/image/setting/configs/uiV2.js +61 -15
- package/dist/esm/image/setting/index.js +1 -3
- package/dist/esm/image-comparison/components/CompareImage.js +1 -1
- package/dist/esm/image-comparison/components/CompareImage.liquid.js +1 -1
- package/dist/esm/index.js +4 -5
- package/dist/esm/index.liquid.js +3 -3
- package/dist/esm/post-purchase/callout-banner/setting/config/callout-box/setting.js +4 -10
- package/dist/esm/post-purchase/countdown-timer/components/PostPurchaseCountdownTimer.js +9 -23
- package/dist/esm/post-purchase/countdown-timer/components/TextCountdown.js +13 -27
- package/dist/esm/post-purchase/countdown-timer/components/common/getClasses.js +21 -0
- package/dist/esm/post-purchase/countdown-timer/components/common/getStyles.js +19 -0
- package/dist/esm/post-purchase/countdown-timer/hooks/useCountdownTimer.js +19 -3
- package/dist/esm/post-purchase/countdown-timer/hooks/useGetTimeExpired.js +16 -0
- package/dist/esm/post-purchase/countdown-timer/settings/CountdownTimer.js +9 -358
- package/dist/esm/post-purchase/countdown-timer/settings/config/preset.js +24 -0
- package/dist/esm/post-purchase/countdown-timer/settings/config/setting.js +241 -0
- package/dist/esm/post-purchase/countdown-timer/settings/config/uiV1.js +123 -0
- package/dist/esm/post-purchase/countdown-timer/settings/config/uiV2.js +183 -0
- package/dist/esm/post-purchase/image/common/getClasses.js +1 -1
- package/dist/esm/post-purchase/image/setting/setting-v2.js +5 -5
- package/dist/esm/post-purchase/product/components/product-image/carousel-post-purchase/CarouselWrapperPostPurchase.js +25 -27
- package/dist/esm/post-purchase/product/hooks/product-image/useListCarousel.js +1 -1
- package/dist/esm/post-purchase/product/hooks/product-image/useProductImagePostPurchase.js +4 -1
- package/dist/esm/post-purchase/product/settings/product-image/setting-v2.js +20 -7
- package/dist/esm/post-purchase/product/settings/product-image/uiV2.js +3 -1
- package/dist/esm/post-purchase/product/settings/product-price-breakdown/configs/settings.js +2 -2
- package/dist/esm/post-purchase/product/settings/product-quantity/configs/settings.js +1 -1
- package/dist/esm/post-purchase/utils/constants.js +1 -1
- package/dist/esm/product/components/FileUpload/components/common/index.js +3 -0
- package/dist/esm/product/components/ProductBundle/common/classes.js +19 -0
- package/dist/esm/product/components/ProductBundle/common/index.js +3 -0
- package/dist/esm/product/components/ProductBundle/common/styles.js +80 -0
- package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscount.js +78 -0
- package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscount.liquid.js +70 -0
- package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.js +65 -0
- package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.liquid.js +42 -0
- package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountItem.js +19 -0
- package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountItem.liquid.js +10 -0
- package/dist/esm/product/components/{ProductBundleDiscount.js → ProductBundle/hooks/useProductBundleDataState.js} +21 -216
- package/dist/esm/product/components/ProductBundle/hooks/useProductBundleDiscountState.js +52 -0
- package/dist/esm/product/{setting → components/ProductBundle/setting}/ProductBundleDiscount.js +7 -7
- package/dist/esm/product/{setting → components/ProductBundle/setting}/ProductBundleDiscountItem.js +3 -0
- package/dist/esm/product/components/ProductButton.js +1 -1
- package/dist/esm/product/components/ProductButton.liquid.js +1 -1
- package/dist/esm/product/components/ProductPrice/common/getAttr.js +21 -0
- package/dist/esm/product/components/ProductPrice/common/getClasses.js +17 -0
- package/dist/esm/product/components/ProductPrice/common/getTextData.js +38 -0
- package/dist/esm/product/components/ProductPrice/hooks/useGpPrice.js +124 -0
- package/dist/esm/product/components/ProductPrice/index.js +50 -0
- package/dist/esm/product/components/ProductPrice/index.liquid.js +38 -0
- package/dist/esm/product/components/ProductQuickView/ProductQuickView.js +1 -1
- package/dist/esm/product/next.js +3 -3
- package/dist/esm/product/setting/index.js +2 -2
- package/dist/esm/product/setting/product/configs/presets.js +1 -0
- package/dist/esm/product/setting/product-image-v2/configs/setting-v2/ProductFeatureImage.js +6 -7
- package/dist/esm/product/setting/product-image-v2/configs/setting-v2/ProductGalleryImage.js +11 -12
- package/dist/esm/product/setting/product-image-v2/configs/setting-v2/index.js +6 -5
- package/dist/esm/product/setting/product-list/configs/settingsV2.js +10 -8
- package/dist/esm/setting.js +5 -2
- package/dist/types/index.d.ts +173 -256
- package/package.json +2 -2
- package/dist/cjs/image/components/BackgroundImage.js +0 -102
- package/dist/cjs/image/components/Img.js +0 -28
- package/dist/cjs/image/components/helpers.js +0 -12
- package/dist/cjs/image/setting/BackgroundImage.js +0 -364
- package/dist/cjs/product/components/ProductBundleDiscount.liquid.js +0 -81
- package/dist/cjs/product/components/ProductBundleDiscountItem.js +0 -42
- package/dist/cjs/product/components/ProductBundleDiscountItem.liquid.js +0 -103
- package/dist/cjs/product/components/ProductPrice.js +0 -209
- package/dist/cjs/product/components/ProductPrice.liquid.js +0 -88
- package/dist/esm/image/components/BackgroundImage.js +0 -98
- package/dist/esm/image/components/Img.js +0 -24
- package/dist/esm/image/components/helpers.js +0 -9
- package/dist/esm/image/setting/BackgroundImage.js +0 -360
- package/dist/esm/product/components/ProductBundleDiscount.liquid.js +0 -77
- package/dist/esm/product/components/ProductBundleDiscountItem.js +0 -36
- package/dist/esm/product/components/ProductBundleDiscountItem.liquid.js +0 -99
- package/dist/esm/product/components/ProductPrice.js +0 -205
- package/dist/esm/product/components/ProductPrice.liquid.js +0 -83
|
@@ -200,13 +200,26 @@ const SettingV2 = [
|
|
|
200
200
|
},
|
|
201
201
|
{
|
|
202
202
|
id: 'ftWidth',
|
|
203
|
-
type: 'input
|
|
203
|
+
type: 'dropdown:input',
|
|
204
204
|
label: 'Width',
|
|
205
|
-
min: 0,
|
|
206
205
|
units: [
|
|
207
206
|
'px',
|
|
208
207
|
'%'
|
|
209
208
|
],
|
|
209
|
+
hideUnit: false,
|
|
210
|
+
inputType: 'number',
|
|
211
|
+
displayOptions: [
|
|
212
|
+
{
|
|
213
|
+
label: 'Full',
|
|
214
|
+
value: '100%',
|
|
215
|
+
showValue: true
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
label: 'Default',
|
|
219
|
+
value: '1200px',
|
|
220
|
+
showValue: true
|
|
221
|
+
}
|
|
222
|
+
],
|
|
210
223
|
devices: {
|
|
211
224
|
desktop: {
|
|
212
225
|
default: '100%'
|
|
@@ -268,21 +281,21 @@ const SettingV2 = [
|
|
|
268
281
|
},
|
|
269
282
|
{
|
|
270
283
|
id: 'ilObjectFit',
|
|
271
|
-
type: '
|
|
272
|
-
iconViewBox: '0 0 66 48',
|
|
273
|
-
enableItemBackground: true,
|
|
284
|
+
type: 'option:illustration',
|
|
274
285
|
enableTooltip: true,
|
|
275
286
|
label: 'Image scale',
|
|
276
287
|
options: [
|
|
277
288
|
{
|
|
278
289
|
label: 'Fill image',
|
|
279
290
|
value: 'cover',
|
|
280
|
-
type: 'image'
|
|
291
|
+
type: 'image',
|
|
292
|
+
svgName: 'gp-image-cover'
|
|
281
293
|
},
|
|
282
294
|
{
|
|
283
295
|
label: 'Fit image',
|
|
284
296
|
value: 'contain',
|
|
285
|
-
type: 'image'
|
|
297
|
+
type: 'image',
|
|
298
|
+
svgName: 'gp-image-contain'
|
|
286
299
|
}
|
|
287
300
|
],
|
|
288
301
|
default: 'cover'
|
|
@@ -222,7 +222,9 @@ const SettingUIV2 = [
|
|
|
222
222
|
id: 'align'
|
|
223
223
|
},
|
|
224
224
|
options: {
|
|
225
|
-
labelVariant: 'primary'
|
|
225
|
+
labelVariant: 'primary',
|
|
226
|
+
fullWidth: true,
|
|
227
|
+
disableMessage: `Horizontal alignment is disabled when the width is set to 100% or greater`
|
|
226
228
|
},
|
|
227
229
|
conditionEnable: '!(parseInt(ftWidth) >= 100 && ftWidth?.includes("%"))'
|
|
228
230
|
}
|
|
@@ -43,14 +43,14 @@ const ProductPriceBreakdownSettings = [
|
|
|
43
43
|
id: 'contentShow',
|
|
44
44
|
type: 'input',
|
|
45
45
|
default: 'Show price breakdown',
|
|
46
|
-
|
|
46
|
+
fallbackValue: 'Show price breakdown',
|
|
47
47
|
clearButton: false
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
id: 'contentHide',
|
|
51
51
|
type: 'input',
|
|
52
52
|
default: 'Hide price breakdown',
|
|
53
|
-
|
|
53
|
+
fallbackValue: 'Hide price breakdown',
|
|
54
54
|
clearButton: false
|
|
55
55
|
}
|
|
56
56
|
]
|
|
@@ -3,6 +3,7 @@ import 'react/jsx-runtime';
|
|
|
3
3
|
import 'react';
|
|
4
4
|
import '@gem-sdk/core';
|
|
5
5
|
import '@gem-sdk/system';
|
|
6
|
+
import '../../../../../accordion/components/common/classes.js';
|
|
6
7
|
import { getDynamicSourceLocales } from '../../../../../helpers.js';
|
|
7
8
|
import 'next/link';
|
|
8
9
|
import '@gem-sdk/keen-slider/react';
|
|
@@ -26,6 +27,8 @@ import '../../../../../notification/components/Notice.js';
|
|
|
26
27
|
import '../../../ProductQuickView/index.js';
|
|
27
28
|
import '../../../constants/product-bundle.js';
|
|
28
29
|
import '../../../ProductList.js';
|
|
30
|
+
import '../../../ProductBundle/common/styles.js';
|
|
31
|
+
import '../../../ProductBundle/common/classes.js';
|
|
29
32
|
import '../../../ProductBadge/constants.js';
|
|
30
33
|
import '../../../ProductBadge/utils/shape.js';
|
|
31
34
|
import '../../../ProductBadge/types.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { composeClasses, cls } from '@gem-sdk/core';
|
|
2
|
+
|
|
3
|
+
const getLayoutClasses = (setting)=>{
|
|
4
|
+
return composeClasses(cls({
|
|
5
|
+
'gp-items-center': setting?.layout === 'vertical-layout' ? setting?.iconPosition === 'center' : setting?.iconHorizontalPosition === 'center',
|
|
6
|
+
'gp-items-start': setting?.layout === 'vertical-layout' ? setting?.iconPosition === 'baseline' : setting?.iconHorizontalPosition === 'baseline',
|
|
7
|
+
'gp-flex-col': setting?.layout === 'horizontal-layout'
|
|
8
|
+
}, 'gp-flex gp-justify-start'));
|
|
9
|
+
};
|
|
10
|
+
const getNoDiscountClasses = composeClasses('gp-w-full gp-p-2 gp-text-center gp-border gp-border-[#3C67FF] gp-text-[#676767]');
|
|
11
|
+
const getContainerClasses = (setting, cssClass)=>{
|
|
12
|
+
return composeClasses(cls({
|
|
13
|
+
'gp-flex-col': setting?.layout === 'vertical-layout'
|
|
14
|
+
}, 'gp-flex', cssClass));
|
|
15
|
+
};
|
|
16
|
+
const getIconSectionClasses = composeClasses('gp-flex-none bundle-icon-section');
|
|
17
|
+
const getItemClasses = composeClasses('product-bundle-item cursor-pointer');
|
|
18
|
+
|
|
19
|
+
export { getContainerClasses, getIconSectionClasses, getItemClasses, getLayoutClasses, getNoDiscountClasses };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { composeClasses, makeGlobalSize, makeStyle, makeStyleState, composeRadius, getStyleShadowState, getStyleShadow, getBorderStyle, handleConvertBorderWidth, handleConvertBorderStyle, handleConvertBorderColor, getRadiusStyleActiveState, makeStyleResponsive, getGlobalColorStateStyle } from '@gem-sdk/core';
|
|
2
|
+
|
|
3
|
+
const getSizeSettings = (styles)=>makeGlobalSize(styles?.size);
|
|
4
|
+
const getItemWrapStyles = (styles, isSelected)=>{
|
|
5
|
+
return {
|
|
6
|
+
...getSizeSettings(styles).width,
|
|
7
|
+
...getSizeSettings(styles).padding,
|
|
8
|
+
...makeStyleState('bg', styles?.backgroundColor),
|
|
9
|
+
...makeStyle({
|
|
10
|
+
bg: isSelected ? styles?.backgroundColor?.active : styles?.backgroundColor?.normal
|
|
11
|
+
}),
|
|
12
|
+
...composeRadius(styles?.roundedBundle),
|
|
13
|
+
...getStyleShadowState(styles?.boxShadowBundle, 'box-shadow', styles?.hasBoxShadowBundle),
|
|
14
|
+
...isSelected ? getStyleShadow({
|
|
15
|
+
value: styles?.boxShadowBundle?.active,
|
|
16
|
+
styleAppliedFor: 'box-shadow',
|
|
17
|
+
isEnableShadow: styles?.hasBoxShadowBundle?.active
|
|
18
|
+
}) : {
|
|
19
|
+
...getStyleShadow({
|
|
20
|
+
value: styles?.boxShadowBundle?.normal,
|
|
21
|
+
styleAppliedFor: 'box-shadow',
|
|
22
|
+
isEnableShadow: styles?.hasBoxShadowBundle?.normal
|
|
23
|
+
})
|
|
24
|
+
},
|
|
25
|
+
...isSelected ? getBorderStyle(styles?.borderBundle?.active) : {
|
|
26
|
+
...handleConvertBorderWidth(styles?.borderBundle),
|
|
27
|
+
...handleConvertBorderStyle(styles?.borderBundle),
|
|
28
|
+
...handleConvertBorderColor(styles?.borderBundle)
|
|
29
|
+
},
|
|
30
|
+
...isSelected ? getRadiusStyleActiveState({
|
|
31
|
+
...styles?.roundedBundle,
|
|
32
|
+
active: {
|
|
33
|
+
...styles?.roundedBundle?.active ? styles?.roundedBundle?.active : styles?.roundedBundle?.normal,
|
|
34
|
+
radiusType: 'custom'
|
|
35
|
+
}
|
|
36
|
+
}) : {}
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
const getIconStyles = (setting)=>{
|
|
40
|
+
return {
|
|
41
|
+
...setting?.layout !== 'horizontal-layout' ? makeStyle({
|
|
42
|
+
mr: setting?.iconSpacing
|
|
43
|
+
}) : makeStyle({
|
|
44
|
+
mb: setting.iconSpacing
|
|
45
|
+
}),
|
|
46
|
+
...makeStyleResponsive('w', setting?.iconSize, 'px'),
|
|
47
|
+
...makeStyleResponsive('h', setting?.iconSize, 'px')
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
const getSvgActiveStyles = (styles)=>{
|
|
51
|
+
return {
|
|
52
|
+
...getGlobalColorStateStyle('c', styles?.iconColor),
|
|
53
|
+
...makeStyle({
|
|
54
|
+
c: styles?.iconColor?.active
|
|
55
|
+
})
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
const getSvgStyles = (styles)=>{
|
|
59
|
+
return {
|
|
60
|
+
...getGlobalColorStateStyle('c', styles?.iconColor)
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
const getAlignStyle = (styles)=>{
|
|
64
|
+
const alignment = styles?.align === 'left' ? 'start' : styles?.align === 'right' ? 'end' : 'center';
|
|
65
|
+
return {
|
|
66
|
+
...makeStyle({
|
|
67
|
+
ai: alignment
|
|
68
|
+
})
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
const getFlexChildren = composeClasses('gp-flex-1');
|
|
72
|
+
const getContainerStyles = (composeSizeStyles, styles, style)=>{
|
|
73
|
+
return {
|
|
74
|
+
...composeSizeStyles,
|
|
75
|
+
...getAlignStyle(styles),
|
|
76
|
+
...style
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export { getAlignStyle, getContainerStyles, getFlexChildren, getIconStyles, getItemWrapStyles, getSizeSettings, getSvgActiveStyles, getSvgStyles };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useEditorMode, isEmptyChildren } from '@gem-sdk/core';
|
|
4
|
+
import { isValidElement } from 'react';
|
|
5
|
+
import Loading from '../../../../common/components/Loading.js';
|
|
6
|
+
import NoDataState from '../../../../common/components/NoDataState.js';
|
|
7
|
+
import { createClass, createStyle, If } from '@gem-sdk/system';
|
|
8
|
+
import { getSizeSettings, getContainerStyles } from '../common/styles.js';
|
|
9
|
+
import { getContainerClasses, getNoDiscountClasses } from '../common/classes.js';
|
|
10
|
+
import useProductBundleDataState from '../hooks/useProductBundleDataState.js';
|
|
11
|
+
import useProductBundleDiscountState from '../hooks/useProductBundleDiscountState.js';
|
|
12
|
+
import ProductBundleDiscountChildrenItem from './ProductBundleDiscountChildrenItem.js';
|
|
13
|
+
|
|
14
|
+
const ProductBundleDiscount = ({ builderAttrs, style, children, setting, styles, advanced })=>{
|
|
15
|
+
const mode = useEditorMode();
|
|
16
|
+
const { timer, isSelected, setSelected } = useProductBundleDiscountState(setting);
|
|
17
|
+
const { emitRedirectSetupPage, redirectGuideline, svg } = useProductBundleDataState();
|
|
18
|
+
const composeContainerClasses = createClass(getContainerClasses(setting, advanced?.cssClass));
|
|
19
|
+
const composeNoDiscountClasses = createClass(getNoDiscountClasses);
|
|
20
|
+
const composeSizeStyles = createStyle(getSizeSettings(styles)?.gap);
|
|
21
|
+
const composeContainerStyles = createStyle(getContainerStyles(composeSizeStyles, styles, style));
|
|
22
|
+
if (!setting?.bundleItems) {
|
|
23
|
+
return timer >= 10 ? /*#__PURE__*/ jsx("div", {
|
|
24
|
+
className: composeNoDiscountClasses,
|
|
25
|
+
children: "This product has no bundle discount"
|
|
26
|
+
}) : /*#__PURE__*/ jsx(Loading, {});
|
|
27
|
+
}
|
|
28
|
+
if (!setting.bundleItems.length && mode === 'edit') {
|
|
29
|
+
return /*#__PURE__*/ jsx(NoDataState, {
|
|
30
|
+
elementType: "secondary",
|
|
31
|
+
description: "Increase AOV with bundle quantity.",
|
|
32
|
+
descriptionActions: [
|
|
33
|
+
{
|
|
34
|
+
text: 'Setup bundle discount',
|
|
35
|
+
callback: emitRedirectSetupPage
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
text: 'read guideline',
|
|
39
|
+
callback: redirectGuideline
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
additionalMedia: svg
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
const renderBundleItem = (item, i)=>{
|
|
46
|
+
if (setting.hideNoDiscountItem && item?.discountType === 'no_discount') {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
const childItem = children?.[i];
|
|
50
|
+
if (/*#__PURE__*/ isValidElement(childItem)) {
|
|
51
|
+
return /*#__PURE__*/ jsx(ProductBundleDiscountChildrenItem, {
|
|
52
|
+
index: i,
|
|
53
|
+
childItem: childItem,
|
|
54
|
+
setting: setting,
|
|
55
|
+
styles: styles,
|
|
56
|
+
isSelected: isSelected(i),
|
|
57
|
+
setSelected: setSelected,
|
|
58
|
+
bundleItem: item
|
|
59
|
+
}, i);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
63
|
+
...builderAttrs,
|
|
64
|
+
className: composeContainerClasses,
|
|
65
|
+
style: composeContainerStyles,
|
|
66
|
+
children: [
|
|
67
|
+
If(isEmptyChildren(children) || setting?.bundleItems?.length == 0, /*#__PURE__*/ jsx("div", {
|
|
68
|
+
className: composeNoDiscountClasses,
|
|
69
|
+
children: "This product has no bundle discount"
|
|
70
|
+
})),
|
|
71
|
+
setting?.bundleItems?.map((item, i)=>{
|
|
72
|
+
return renderBundleItem(item, i);
|
|
73
|
+
})
|
|
74
|
+
]
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export { ProductBundleDiscount as default };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { template, RenderIf, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
|
|
2
|
+
import { getSettingPreloadData } from '../../../../helpers.js';
|
|
3
|
+
import { createStyle, createClass, createStateOrContext, Liquid, LiquidIf } from '@gem-sdk/system';
|
|
4
|
+
import { getSizeSettings, getContainerStyles } from '../common/styles.js';
|
|
5
|
+
import { getContainerClasses } from '../common/classes.js';
|
|
6
|
+
import ProductBundleDiscountChildrenItemLiquid from './ProductBundleDiscountChildrenItem.liquid.js';
|
|
7
|
+
|
|
8
|
+
const ProductBundleDiscount = ({ rawChildren, setting, styles, advanced, style })=>{
|
|
9
|
+
const selected = !setting?.hasPreSelectItem ? -1 : setting?.selectItemDefault ?? 0;
|
|
10
|
+
const isSelected = (i)=>{
|
|
11
|
+
return selected === i;
|
|
12
|
+
};
|
|
13
|
+
const renderBundleItem = (bundleItem, i)=>{
|
|
14
|
+
return ProductBundleDiscountChildrenItemLiquid({
|
|
15
|
+
index: i,
|
|
16
|
+
rawChildrenItem: rawChildren?.[i],
|
|
17
|
+
setting,
|
|
18
|
+
styles,
|
|
19
|
+
isSelected: isSelected(i),
|
|
20
|
+
bundleItem
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
const composeSizeStyles = createStyle(getSizeSettings(styles)?.gap);
|
|
24
|
+
const composeContainerClasses = createClass(getContainerClasses(setting, advanced?.cssClass));
|
|
25
|
+
const composeContainerStyles = createStyle(getContainerStyles(composeSizeStyles, styles, style));
|
|
26
|
+
const composeStateOrContext = createStateOrContext({
|
|
27
|
+
styles,
|
|
28
|
+
settings: {
|
|
29
|
+
selectItemDefault: setting?.selectItemDefault,
|
|
30
|
+
hideNoDiscountItem: setting?.hideNoDiscountItem,
|
|
31
|
+
hasPreSelectItem: setting?.hasPreSelectItem
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const renderScript = ()=>{
|
|
35
|
+
return RenderIf(isLocalEnv, `<script ${getSettingPreloadData('class="gps-link" delay', 'src')}="{{ 'gp-product-bundle-discount.js' | asset_url }}" defer="defer"></script>`, `<script ${getSettingPreloadData('class="gps-link" delay', 'src')}="${baseAssetURL}/assets-v2/gp-product-bundle-discount.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`);
|
|
36
|
+
};
|
|
37
|
+
return template`
|
|
38
|
+
<gp-product-bundle-discount
|
|
39
|
+
use-product-compare-at-price="${setting?.useProductCompareAtPrice}"
|
|
40
|
+
gp-data='${JSON.stringify(composeStateOrContext)}'
|
|
41
|
+
style="${composeContainerStyles}"
|
|
42
|
+
class="${composeContainerClasses}">
|
|
43
|
+
${Liquid(`
|
|
44
|
+
{%- assign gempages_product_bundle = product.metafields.gp_discount.gp_discount_selected_products -%}
|
|
45
|
+
{% assign productBundleItem = gempages_product_bundle | split: '($1)' %}
|
|
46
|
+
`)}
|
|
47
|
+
${rawChildren?.map((_, i)=>{
|
|
48
|
+
return template`
|
|
49
|
+
{% for productBundle in productBundleItem %}
|
|
50
|
+
${Liquid(`
|
|
51
|
+
{% assign attrs = productBundle | split: '($3)' %}
|
|
52
|
+
{% assign parsedAttrs = '' %}
|
|
53
|
+
{% for attr in attrs %}
|
|
54
|
+
{% assign attrParts = attr | split: '($:)' %}
|
|
55
|
+
{% assign parsedAttrs = parsedAttrs | append: attrParts[0] | append: '=' | append: attrParts[2] | append: ' ' %}
|
|
56
|
+
{% endfor %}
|
|
57
|
+
`)}
|
|
58
|
+
${LiquidIf(`forloop.index0 == ${i}`, renderBundleItem('{{ parsedAttrs | strip }}', i))}
|
|
59
|
+
{% endfor %}
|
|
60
|
+
`;
|
|
61
|
+
}).join('')}
|
|
62
|
+
</gp-product-bundle-discount>
|
|
63
|
+
|
|
64
|
+
{% if productBundleItem %}
|
|
65
|
+
${renderScript()}
|
|
66
|
+
{% endif %}
|
|
67
|
+
`;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export { ProductBundleDiscount as default };
|
package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { getItemWrapStyles, getIconStyles, getSvgActiveStyles, getSvgStyles, getFlexChildren } from '../common/styles.js';
|
|
3
|
+
import { createStyle, createClass, If } from '@gem-sdk/system';
|
|
4
|
+
import { getLayoutClasses, getIconSectionClasses, getItemClasses } from '../common/classes.js';
|
|
5
|
+
import { isValidElement } from 'react';
|
|
6
|
+
|
|
7
|
+
const ProductBundleDiscountChildrenItem = (props)=>{
|
|
8
|
+
const { index, isSelected, setSelected, setting, styles, childItem } = props;
|
|
9
|
+
const composeItemWrapStyles = createStyle(getItemWrapStyles(styles, isSelected));
|
|
10
|
+
const composeLayoutClasses = createClass(getLayoutClasses(setting));
|
|
11
|
+
const composeIconStyles = createStyle(getIconStyles(setting));
|
|
12
|
+
const composeSvgActiveStyles = createStyle(getSvgActiveStyles(styles));
|
|
13
|
+
const composeSvgStyles = createStyle(getSvgStyles(styles));
|
|
14
|
+
const composeIconSectionClasses = createClass(getIconSectionClasses);
|
|
15
|
+
const composeItemClasses = createClass(getItemClasses);
|
|
16
|
+
const composeFlexChildren = createClass(getFlexChildren);
|
|
17
|
+
return /*#__PURE__*/ jsx("div", {
|
|
18
|
+
"aria-hidden": true,
|
|
19
|
+
onClick: ()=>setSelected?.(index),
|
|
20
|
+
className: composeItemClasses,
|
|
21
|
+
style: composeItemWrapStyles,
|
|
22
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
23
|
+
className: composeLayoutClasses,
|
|
24
|
+
children: [
|
|
25
|
+
setting?.enableIcon && /*#__PURE__*/ jsx("div", {
|
|
26
|
+
className: composeIconSectionClasses,
|
|
27
|
+
style: composeIconStyles,
|
|
28
|
+
children: If(isSelected, /*#__PURE__*/ jsx("svg", {
|
|
29
|
+
style: composeSvgActiveStyles,
|
|
30
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
31
|
+
viewBox: "0 0 256 256",
|
|
32
|
+
fill: "currentColor",
|
|
33
|
+
"data-id": "493334324348453213",
|
|
34
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
35
|
+
fill: "currentColor",
|
|
36
|
+
strokeLinecap: "round",
|
|
37
|
+
strokeLinejoin: "round",
|
|
38
|
+
d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Z"
|
|
39
|
+
})
|
|
40
|
+
}), /*#__PURE__*/ jsx("svg", {
|
|
41
|
+
style: composeSvgStyles,
|
|
42
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
43
|
+
viewBox: "0 0 256 256",
|
|
44
|
+
fill: "currentColor",
|
|
45
|
+
"data-id": "508817616304734568",
|
|
46
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
47
|
+
fill: "currentColor",
|
|
48
|
+
strokeLinecap: "round",
|
|
49
|
+
strokeLinejoin: "round",
|
|
50
|
+
d: "M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Z"
|
|
51
|
+
})
|
|
52
|
+
}))
|
|
53
|
+
}),
|
|
54
|
+
/*#__PURE__*/ jsx("div", {
|
|
55
|
+
className: composeFlexChildren,
|
|
56
|
+
children: /*#__PURE__*/ isValidElement(childItem) && /*#__PURE__*/ jsx(childItem.type, {
|
|
57
|
+
...childItem.props
|
|
58
|
+
})
|
|
59
|
+
})
|
|
60
|
+
]
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export { ProductBundleDiscountChildrenItem as default };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { template, RenderChildren } from '@gem-sdk/core';
|
|
2
|
+
import { createStyle, createClass, If } from '@gem-sdk/system';
|
|
3
|
+
import { getItemWrapStyles, getIconStyles, getSvgActiveStyles, getSvgStyles, getFlexChildren } from '../common/styles.js';
|
|
4
|
+
import { getLayoutClasses, getIconSectionClasses, getItemClasses } from '../common/classes.js';
|
|
5
|
+
|
|
6
|
+
const ProductBundleDiscountChildrenItemLiquid = (props)=>{
|
|
7
|
+
const { isSelected, setting, styles, bundleItem, rawChildrenItem } = props;
|
|
8
|
+
const composeItemWrapStyles = createStyle(getItemWrapStyles(styles, isSelected));
|
|
9
|
+
const composeLayoutClasses = createClass(getLayoutClasses(setting));
|
|
10
|
+
const composeIconStyles = createStyle(getIconStyles(setting));
|
|
11
|
+
const composeSvgActiveStyles = createStyle(getSvgActiveStyles(styles));
|
|
12
|
+
const composeSvgStyles = createStyle(getSvgStyles(styles));
|
|
13
|
+
const composeIconSectionClasses = createClass(getIconSectionClasses);
|
|
14
|
+
const composeItemClasses = createClass(getItemClasses);
|
|
15
|
+
const composeFlexChildren = createClass(getFlexChildren);
|
|
16
|
+
return template`
|
|
17
|
+
<div ${bundleItem} aria-hidden class="${composeItemClasses}" style="${composeItemWrapStyles}">
|
|
18
|
+
<div class="${composeLayoutClasses}">
|
|
19
|
+
${If(setting?.enableIcon, template`
|
|
20
|
+
<div class="${composeIconSectionClasses}" style="${composeIconStyles}">
|
|
21
|
+
${If(isSelected, `<svg style="${composeSvgActiveStyles}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor">
|
|
22
|
+
<path fill="currentColor" strokeLinecap="round" strokeLinejoin="round"
|
|
23
|
+
d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Z"></path>
|
|
24
|
+
</svg>`, `<svg style="${composeSvgStyles}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor">
|
|
25
|
+
<path fill="currentColor" strokeLinecap="round" strokeLinejoin="round"
|
|
26
|
+
d="M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Z">
|
|
27
|
+
</path>
|
|
28
|
+
</svg>`)}
|
|
29
|
+
|
|
30
|
+
</div>
|
|
31
|
+
`)}
|
|
32
|
+
<div class="${composeFlexChildren}">
|
|
33
|
+
${RenderChildren({
|
|
34
|
+
...rawChildrenItem
|
|
35
|
+
})}
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
`;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export { ProductBundleDiscountChildrenItemLiquid as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useMemo, Children } from 'react';
|
|
4
|
+
import { MINIMUM_CHILD } from '../common/index.js';
|
|
5
|
+
import ChildrenDroppable from '../../../../grid/components/ChildrenDroppable.js';
|
|
6
|
+
|
|
7
|
+
const ProductBundleDiscountItem = ({ children })=>{
|
|
8
|
+
const childForBody = useMemo(()=>{
|
|
9
|
+
if (Children.count(children) >= MINIMUM_CHILD) {
|
|
10
|
+
return children;
|
|
11
|
+
}
|
|
12
|
+
return /*#__PURE__*/ jsx(ChildrenDroppable, {});
|
|
13
|
+
}, [
|
|
14
|
+
children
|
|
15
|
+
]);
|
|
16
|
+
return childForBody;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { ProductBundleDiscountItem as default };
|