@gem-sdk/components 2.0.0-dev.278 → 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/components/CalloutText.js +2 -1
- package/dist/cjs/post-purchase/callout-banner/components/common/getClasses.js +5 -2
- package/dist/cjs/post-purchase/callout-banner/components/common/getStyles.js +2 -4
- package/dist/cjs/post-purchase/callout-banner/setting/config/callout-box/setting.js +4 -10
- package/dist/cjs/post-purchase/callout-banner/setting/config/callout-text/setting.js +1 -11
- 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/settings/product-image/setting-v2.js +5 -5
- 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/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/components/CalloutText.js +2 -1
- package/dist/esm/post-purchase/callout-banner/components/common/getClasses.js +5 -2
- package/dist/esm/post-purchase/callout-banner/components/common/getStyles.js +2 -4
- package/dist/esm/post-purchase/callout-banner/setting/config/callout-box/setting.js +4 -10
- package/dist/esm/post-purchase/callout-banner/setting/config/callout-text/setting.js +1 -11
- 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/settings/product-image/setting-v2.js +5 -5
- 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/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 +174 -257
- 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
|
@@ -8,304 +8,150 @@ var React = require('react');
|
|
|
8
8
|
var core = require('@gem-sdk/core');
|
|
9
9
|
var ChildrenDroppable = require('../../grid/components/ChildrenDroppable.js');
|
|
10
10
|
var Text = require('../../text/components/Text.js');
|
|
11
|
-
var
|
|
12
|
-
var
|
|
11
|
+
var useAccordionItem = require('../hooks/useAccordionItem.js');
|
|
12
|
+
var system = require('@gem-sdk/system');
|
|
13
|
+
var styles = require('./common/styles.js');
|
|
14
|
+
var classes = require('./common/classes.js');
|
|
15
|
+
var index = require('./common/index.js');
|
|
13
16
|
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const {
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const hasTransitionedIn = useMountTransition.default(isMounted || false, 500);
|
|
30
|
-
React.useEffect(()=>{
|
|
31
|
-
setIsMounted(isShow);
|
|
32
|
-
}, [
|
|
33
|
-
isShow
|
|
34
|
-
]);
|
|
35
|
-
const widthStyle = widthHeightSizeControl.width['--w'] ? widthHeightSizeControl.width : core.makeStyleResponsive('w', core.makeWidth(width, fullWidth));
|
|
36
|
-
const makeIcon = React.useMemo(()=>{
|
|
37
|
-
if (iconExpand && isShow) {
|
|
38
|
-
return iconExpand;
|
|
39
|
-
}
|
|
40
|
-
if (iconCollapse && !isShow) {
|
|
41
|
-
return iconCollapse;
|
|
42
|
-
}
|
|
43
|
-
if (iconSvg === 'plus') {
|
|
44
|
-
if (isShow) {
|
|
45
|
-
return iconNimbus;
|
|
46
|
-
}
|
|
47
|
-
return iconPlus;
|
|
48
|
-
}
|
|
49
|
-
if (iconSvg) {
|
|
50
|
-
return iconSvg;
|
|
51
|
-
}
|
|
52
|
-
}, [
|
|
53
|
-
iconNimbus,
|
|
54
|
-
iconPlus,
|
|
17
|
+
const AccordionItem = (props)=>{
|
|
18
|
+
const { children, index: index$1, parentUid, title, childrenIcon } = props;
|
|
19
|
+
const { iconSvg, titleTypo, layoutHeader, iconGlobalSize, iconCollapseSize, iconCollapse, iconExpand, alignment, configIconSize, iconPosition } = index.getParentSettings(props.parentSetting) ?? {};
|
|
20
|
+
const { refContainer, getIdDropdownItem, makeIcon, isShow, uniqueId, composeIconColor, isRenderChildren, composeContentSizeStyle, hasTransitionedIn, isMounted, productID } = useAccordionItem.default(props);
|
|
21
|
+
const composeContainerClasses = system.createClass(classes.getItemContainerClasses);
|
|
22
|
+
const composeDropdownClasses = system.createClass(classes.getDropdownClasses(props.parentStyle, {
|
|
23
|
+
isShow,
|
|
24
|
+
uniqueId,
|
|
25
|
+
makeIcon,
|
|
26
|
+
index: index$1
|
|
27
|
+
}));
|
|
28
|
+
const composeIconClasses = system.createClass(classes.getIconClasses);
|
|
29
|
+
const composeIconRotateClasses = system.createClass(classes.getIconRotateClasses(props.parentStyle, {
|
|
30
|
+
isShow,
|
|
31
|
+
iconExpand,
|
|
55
32
|
iconSvg,
|
|
33
|
+
iconCollapse
|
|
34
|
+
}));
|
|
35
|
+
const composeContentClasses = system.createClass(classes.getContentClasses(parentUid));
|
|
36
|
+
const composeGapClasses = system.createClass(classes.getGapClasses);
|
|
37
|
+
const composeContainerStyles = system.createStyle(styles.getItemContainerStyles(props.parentStyle, isShow));
|
|
38
|
+
const composeDropdownStyles = system.createStyle(styles.getDropdownStyles(props.parentStyle, {
|
|
56
39
|
isShow,
|
|
57
|
-
iconCollapse,
|
|
58
|
-
iconExpand
|
|
59
|
-
]);
|
|
60
|
-
const composePosition = React.useMemo(()=>{
|
|
61
|
-
return core.makeStyle({
|
|
62
|
-
fd: iconPosition === 'left' ? 'row' : 'row-reverse',
|
|
63
|
-
jc: iconPosition === 'right' ? 'space-between' : ''
|
|
64
|
-
});
|
|
65
|
-
}, [
|
|
66
40
|
iconPosition
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
41
|
+
}));
|
|
42
|
+
const composeIconRotateStyles = system.createStyle(styles.getIconRotateStyles(props.parentStyle, isShow, iconCollapseSize));
|
|
43
|
+
const composeIconPaddingGlobalSize = system.createStyle(styles.getIconGlobalSize(iconGlobalSize));
|
|
44
|
+
const composeGapStyles = system.createStyle(styles.getGapStyles(iconGlobalSize, alignment));
|
|
45
|
+
const inlineFlexClass = system.createClass(core.composeClasses('gp-inline-flex'));
|
|
46
|
+
const composeLayoutTextClasses = system.createClass(classes.getLayoutTextClasses);
|
|
47
|
+
const composeLayoutTextStyles = system.createStyle(styles.getLayoutTextStyles(composeIconColor, configIconSize));
|
|
48
|
+
const composeRenderChildrenClasses = system.createClass(classes.getRenderChildrenClasses(props.parentStyle, {
|
|
49
|
+
isShow,
|
|
50
|
+
hasTransitionedIn,
|
|
51
|
+
isMounted
|
|
52
|
+
}));
|
|
53
|
+
const composeRenderChildrenStyles = system.createStyle(styles.getRenderChildrenStyles(composeContentSizeStyle));
|
|
54
|
+
const composeItemBodyClasses = system.createClass(core.composeClasses('gp-accordion-item_body-inner gp-transition-all gp-duration-500 gp-min-h-0'));
|
|
55
|
+
const composeTextClasses = system.createClass(core.composeClasses('gp-border gp-border-transparent'));
|
|
75
56
|
const childForBody = React.useMemo(()=>{
|
|
76
|
-
|
|
77
|
-
|
|
57
|
+
const childrenArray = React.Children.toArray(children);
|
|
58
|
+
if (childrenArray.length >= index.MINIMUM_CHILD) {
|
|
59
|
+
return childrenArray[index.BODY_CHILD_INDEX];
|
|
78
60
|
}
|
|
79
61
|
return /*#__PURE__*/ jsxRuntime.jsx(ChildrenDroppable.default, {});
|
|
80
62
|
}, [
|
|
81
63
|
children
|
|
82
64
|
]);
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return core.makeStyle({
|
|
86
|
-
c: iconColor?.active
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
return core.getGlobalColorStateStyle('c', iconColor);
|
|
90
|
-
}, [
|
|
91
|
-
iconColor,
|
|
92
|
-
isShow
|
|
93
|
-
]);
|
|
94
|
-
const { refContainer, productID } = useGetProductId.useGetProductId();
|
|
95
|
-
const uniqueId = React.useMemo(()=>{
|
|
96
|
-
const prefix = `gp-accordion-item-${builderProps?.uid}-${index}`;
|
|
97
|
-
return productID ? `${prefix}-${productID}` : prefix;
|
|
98
|
-
}, [
|
|
99
|
-
builderProps?.uid,
|
|
100
|
-
index,
|
|
101
|
-
productID
|
|
102
|
-
]);
|
|
103
|
-
const composeColorIconStyle = React.useMemo(()=>{
|
|
104
|
-
return `.${uniqueId}:hover {
|
|
105
|
-
.gp-collapsible-icon {
|
|
106
|
-
color: ${isShow ? color?.active : color?.hover}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.gp-icon {
|
|
110
|
-
color: ${isShow ? iconColor?.active : iconColor?.hover}
|
|
111
|
-
}
|
|
112
|
-
}`;
|
|
113
|
-
}, [
|
|
114
|
-
isShow,
|
|
115
|
-
color,
|
|
116
|
-
iconColor,
|
|
117
|
-
uniqueId
|
|
118
|
-
]);
|
|
119
|
-
const composeContentSizeStyle = React.useMemo(()=>{
|
|
120
|
-
const constentSizeStyle = {
|
|
121
|
-
...contentSizePadding && contentSizePaddingSize.padding,
|
|
122
|
-
...!itemContentSpacing?.type && !contentSizePadding ? core.composeSize(itemContentSpacing?.custom) : {}
|
|
123
|
-
};
|
|
124
|
-
if (!isShow) {
|
|
125
|
-
return core.removePaddingYInStyle(constentSizeStyle);
|
|
126
|
-
}
|
|
127
|
-
return constentSizeStyle;
|
|
128
|
-
}, [
|
|
129
|
-
contentSizePadding,
|
|
130
|
-
itemContentSpacing,
|
|
131
|
-
isShow,
|
|
132
|
-
contentSizePaddingSize
|
|
133
|
-
]);
|
|
134
|
-
const isRenderChildren = React.useMemo(()=>hasTransitionedIn || isMounted || mode !== 'edit', [
|
|
135
|
-
hasTransitionedIn,
|
|
136
|
-
isMounted,
|
|
137
|
-
mode
|
|
138
|
-
]);
|
|
139
|
-
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
140
|
-
className: "gp-overflow-clip",
|
|
65
|
+
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
66
|
+
className: composeContainerClasses,
|
|
141
67
|
ref: refContainer,
|
|
142
|
-
style:
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
172
|
-
"aria-hidden": true,
|
|
173
|
-
onClick: (event)=>{
|
|
174
|
-
getIdDropdownItem(event, index?.toString());
|
|
175
|
-
},
|
|
176
|
-
className: core.cls('gp-flex gp-cursor-pointer gp-items-center', makeIcon ? 'gp-gap-[16px]' : '', uniqueId, itemHeaderSpacing?.type && !headerContentPadding ? core.genSizeClass(itemHeaderSpacing?.type) : '', {
|
|
177
|
-
[core.getGlobalColorClass('bg', bgColor?.active)]: isShow,
|
|
178
|
-
[core.getGlobalColorClass('text', textColor?.active)]: isShow,
|
|
179
|
-
[core.getGlobalColorStateClass('bg', bgColor)]: !isShow,
|
|
180
|
-
[core.getGlobalColorStateClass('text', textColor)]: !isShow
|
|
181
|
-
}),
|
|
182
|
-
style: {
|
|
183
|
-
...headerContentPadding && headerContentPaddingSize.padding,
|
|
184
|
-
...!itemHeaderSpacing?.type && !headerContentPadding ? core.composeSize(itemHeaderSpacing?.custom) : {},
|
|
185
|
-
...widthHeightSizeControl.height,
|
|
186
|
-
...composePosition,
|
|
187
|
-
...isShow ? core.makeStyle({
|
|
188
|
-
bgc: core.getSingleColorVariable(bgColor?.active ?? bgColor?.normal),
|
|
189
|
-
bs: headerBorder?.active?.border,
|
|
190
|
-
bw: headerBorder?.active?.width,
|
|
191
|
-
bc: core.getSingleColorVariable(headerBorder?.active?.color),
|
|
192
|
-
c: core.getSingleColorVariable(textColor?.active ?? textColor?.normal)
|
|
193
|
-
}) : {
|
|
194
|
-
...core.getGlobalColorStateStyle('bgc', bgColor),
|
|
195
|
-
...core.getGlobalColorStateStyle('c', textColor),
|
|
196
|
-
...core.handleConvertBorderStyle(headerBorder),
|
|
197
|
-
...core.handleConvertBorderWidth(headerBorder),
|
|
198
|
-
...core.handleConvertBorderColor(headerBorder),
|
|
199
|
-
...core.getGlobalColorStateStyle('bgc', bgColor)
|
|
200
|
-
}
|
|
201
|
-
},
|
|
202
|
-
children: [
|
|
203
|
-
makeIcon && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
204
|
-
className: "gp-inline-flex",
|
|
205
|
-
children: /*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
68
|
+
style: composeContainerStyles,
|
|
69
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
70
|
+
"data-index": index$1?.toString(),
|
|
71
|
+
className: composeContentClasses,
|
|
72
|
+
children: [
|
|
73
|
+
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
74
|
+
"aria-hidden": true,
|
|
75
|
+
onClick: (event)=>{
|
|
76
|
+
getIdDropdownItem(event, index$1?.toString());
|
|
77
|
+
},
|
|
78
|
+
className: composeDropdownClasses,
|
|
79
|
+
style: composeDropdownStyles,
|
|
80
|
+
children: [
|
|
81
|
+
system.If(Boolean(makeIcon), /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
82
|
+
className: composeIconClasses,
|
|
83
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
84
|
+
style: composeIconRotateStyles,
|
|
85
|
+
className: composeIconRotateClasses,
|
|
86
|
+
dangerouslySetInnerHTML: {
|
|
87
|
+
__html: makeIcon ?? ''
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
})),
|
|
91
|
+
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
92
|
+
className: composeGapClasses,
|
|
93
|
+
style: composeGapStyles,
|
|
94
|
+
children: [
|
|
95
|
+
system.If(Boolean(layoutHeader === 'before-text'), /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
96
|
+
className: inlineFlexClass,
|
|
206
97
|
style: {
|
|
207
|
-
...
|
|
208
|
-
c: core.getSingleColorVariable(color?.active ?? color?.normal)
|
|
209
|
-
}) : {
|
|
210
|
-
...core.getGlobalColorStateStyle('c', color)
|
|
211
|
-
},
|
|
212
|
-
width: `${iconCollapseSize ? iconCollapseSize : 16}px`,
|
|
213
|
-
height: `${iconCollapseSize ? iconCollapseSize : 16}px`,
|
|
214
|
-
'--height': `${iconCollapseSize ? iconCollapseSize : 16}px`
|
|
98
|
+
...composeIconPaddingGlobalSize
|
|
215
99
|
},
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}
|
|
223
|
-
})
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
layoutHeader === 'before-text' && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
233
|
-
className: "gp-inline-flex",
|
|
234
|
-
style: {
|
|
235
|
-
...composeIconGlobalSize.padding
|
|
236
|
-
},
|
|
237
|
-
children: /*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
238
|
-
className: "gp-icon gp-inline-flex gp-items-center gp-justify-center gp-overflow-hidden [&>svg]:!gp-h-[var(--height)] [&>svg]:!gp-w-auto",
|
|
239
|
-
style: {
|
|
240
|
-
...composeIconColor,
|
|
241
|
-
width: configIconSize ? `${configIconSize}px` : '16px',
|
|
242
|
-
height: configIconSize ? `${configIconSize}px` : '16px',
|
|
243
|
-
'--height': `${configIconSize ? `${configIconSize}px` : '16px'}`
|
|
244
|
-
},
|
|
245
|
-
dangerouslySetInnerHTML: {
|
|
246
|
-
__html: childrenIcon ?? '<svg height="100%" width="100%" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><path fill="currentColor" strokelinecap="round" strokelinejoin="round" d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"></path></svg>'
|
|
247
|
-
}
|
|
248
|
-
})
|
|
249
|
-
}),
|
|
250
|
-
/*#__PURE__*/ jsxRuntime.jsx(Text.default, {
|
|
251
|
-
setting: {
|
|
252
|
-
text: title,
|
|
253
|
-
htmlTag: 'div',
|
|
254
|
-
options: {
|
|
255
|
-
uniqueId,
|
|
256
|
-
productID,
|
|
257
|
-
useState: true
|
|
258
|
-
},
|
|
259
|
-
excludeFlex: true
|
|
260
|
-
},
|
|
261
|
-
styles: {
|
|
262
|
-
typo: titleTypo
|
|
263
|
-
},
|
|
264
|
-
className: "gp-border gp-border-transparent"
|
|
265
|
-
}),
|
|
266
|
-
layoutHeader === 'after-text' && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
267
|
-
className: "gp-inline-flex",
|
|
268
|
-
style: {
|
|
269
|
-
...composeIconGlobalSize.padding
|
|
100
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
101
|
+
className: composeLayoutTextClasses,
|
|
102
|
+
style: composeLayoutTextStyles,
|
|
103
|
+
dangerouslySetInnerHTML: {
|
|
104
|
+
__html: childrenIcon ?? index.DEFAULT_BEFORE_ICON
|
|
105
|
+
}
|
|
106
|
+
})
|
|
107
|
+
})),
|
|
108
|
+
/*#__PURE__*/ jsxRuntime.jsx(Text.default, {
|
|
109
|
+
setting: {
|
|
110
|
+
text: title,
|
|
111
|
+
htmlTag: 'div',
|
|
112
|
+
options: {
|
|
113
|
+
uniqueId,
|
|
114
|
+
productID,
|
|
115
|
+
useState: true
|
|
270
116
|
},
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
117
|
+
excludeFlex: true
|
|
118
|
+
},
|
|
119
|
+
styles: {
|
|
120
|
+
typo: titleTypo
|
|
121
|
+
},
|
|
122
|
+
className: composeTextClasses
|
|
123
|
+
}),
|
|
124
|
+
system.If(Boolean(layoutHeader === 'after-text'), /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
125
|
+
className: inlineFlexClass,
|
|
126
|
+
style: {
|
|
127
|
+
...composeIconPaddingGlobalSize
|
|
128
|
+
},
|
|
129
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
130
|
+
style: composeLayoutTextStyles,
|
|
131
|
+
className: composeLayoutTextClasses,
|
|
132
|
+
dangerouslySetInnerHTML: {
|
|
133
|
+
__html: childrenIcon ?? index.DEFAULT_AFTER_ICON
|
|
134
|
+
}
|
|
283
135
|
})
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
]
|
|
287
|
-
}),
|
|
288
|
-
isRenderChildren && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
289
|
-
...builderAttrs,
|
|
290
|
-
className: core.cls('gp-grid gp-overflow-hidden gp-transition-all gp-duration-500', {
|
|
291
|
-
'gp-grid-rows-[1fr]': isShow ? hasTransitionedIn : isMounted,
|
|
292
|
-
'gp-grid-rows-[0fr]': !isShow ? !isMounted : !hasTransitionedIn
|
|
293
|
-
}, itemContentSpacing?.type && !contentSizePadding ? core.genSizeClass(itemContentSpacing?.type) : ''),
|
|
294
|
-
style: {
|
|
295
|
-
...composeContentSizeStyle,
|
|
296
|
-
gridTemplateColumns: 'minmax(auto, 100%)'
|
|
297
|
-
},
|
|
298
|
-
children: /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
299
|
-
className: "gp-min-h-0",
|
|
300
|
-
children: childForBody
|
|
136
|
+
}))
|
|
137
|
+
]
|
|
301
138
|
})
|
|
139
|
+
]
|
|
140
|
+
}),
|
|
141
|
+
isRenderChildren && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
142
|
+
...props?.builderAttrs,
|
|
143
|
+
className: composeRenderChildrenClasses,
|
|
144
|
+
style: composeRenderChildrenStyles,
|
|
145
|
+
"data-index": index$1,
|
|
146
|
+
"data-show": isShow,
|
|
147
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
148
|
+
className: composeItemBodyClasses,
|
|
149
|
+
children: childForBody
|
|
302
150
|
})
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
151
|
+
})
|
|
152
|
+
]
|
|
153
|
+
})
|
|
306
154
|
});
|
|
307
155
|
};
|
|
308
156
|
|
|
309
|
-
exports.BODY_CHILD_INDEX = BODY_CHILD_INDEX;
|
|
310
|
-
exports.MINIMUM_CHILD = MINIMUM_CHILD;
|
|
311
157
|
exports.default = AccordionItem;
|