@gem-sdk/components 2.0.0-dev.275 → 2.0.0-dev.278
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/article/components/ArticleReadMore.js +2 -4
- package/dist/cjs/banner/components/HeroBannerItem.liquid.js +4 -4
- package/dist/cjs/builder.js +4 -8
- package/dist/cjs/button/components/Button.js +111 -184
- package/dist/cjs/button/components/Button.liquid.js +108 -171
- package/dist/cjs/button/components/ButtonIcon.js +17 -0
- package/dist/cjs/button/components/ButtonIcon.liquid.js +16 -0
- package/dist/cjs/button/components/ButtonLabel.js +18 -0
- package/dist/cjs/button/components/ButtonLabel.liquid.js +15 -0
- package/dist/cjs/button/components/ButtonLoadingIndicator.liquid.js +12 -0
- package/dist/cjs/button/components/common/attributes.js +15 -0
- package/dist/cjs/button/components/common/classes.js +55 -0
- package/dist/cjs/button/components/common/constants.js +26 -0
- package/dist/cjs/button/components/common/data.js +76 -0
- package/dist/cjs/button/components/common/helpers.js +131 -0
- package/dist/cjs/button/components/common/styles.js +157 -0
- package/dist/cjs/button/next.js +2 -6
- package/dist/cjs/button/setting/configs/settings.js +5 -1
- package/dist/cjs/cart/components/CheckoutNow.js +0 -2
- package/dist/cjs/coupon/components/Coupon.js +1 -3
- package/dist/cjs/dialog/setting/Dialog.js +7 -580
- package/dist/cjs/dialog/setting/configs/settings.js +325 -0
- package/dist/cjs/dialog/setting/configs/uiV1.js +288 -0
- package/dist/cjs/dialog/setting/configs/uiV2.js +258 -0
- package/dist/cjs/estimate-delivery/components/EstimateDate.liquid.js +3 -3
- package/dist/cjs/form/components/submit-button/SubmitButton.js +0 -4
- package/dist/cjs/index.js +2 -4
- package/dist/cjs/index.liquid.js +1 -3
- package/dist/cjs/post-purchase/callout-banner/components/CalloutText.js +1 -2
- package/dist/cjs/post-purchase/callout-banner/components/common/getClasses.js +2 -5
- package/dist/cjs/post-purchase/callout-banner/components/common/getStyles.js +4 -2
- package/dist/cjs/post-purchase/callout-banner/setting/config/callout-text/setting.js +11 -1
- 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 +15 -2
- package/dist/cjs/post-purchase/product/settings/product-image/uiV2.js +3 -1
- package/dist/cjs/post-purchase/utils/constants.js +1 -1
- package/dist/cjs/product/components/DynamicCheckout/DynamicCheckout.js +2 -5
- package/dist/cjs/product/components/DynamicCheckout.js +2 -5
- package/dist/cjs/product/components/FileUpload/components/common/index.js +1 -1
- package/dist/cjs/product/components/ProductButton.js +2 -3
- package/dist/cjs/product/components/ProductButton.liquid.js +3 -3
- package/dist/cjs/product/components/ProductDescription/index.liquid.js +1 -2
- package/dist/cjs/product/components/ProductViewMore.js +2 -5
- package/dist/cjs/product/components/ProductViewMore.liquid.js +2 -2
- package/dist/cjs/setting.js +2 -2
- package/dist/cjs/text/components/common/getClasses.js +1 -1
- package/dist/cjs/third-party/components/PushOwl.js +0 -5
- package/dist/esm/article/components/ArticleReadMore.js +1 -3
- package/dist/esm/banner/components/HeroBannerItem.liquid.js +4 -4
- package/dist/esm/builder.js +1 -5
- package/dist/esm/button/components/Button.js +113 -186
- package/dist/esm/button/components/Button.liquid.js +109 -172
- package/dist/esm/button/components/ButtonIcon.js +13 -0
- package/dist/esm/button/components/ButtonIcon.liquid.js +12 -0
- package/dist/esm/button/components/ButtonLabel.js +14 -0
- package/dist/esm/button/components/ButtonLabel.liquid.js +11 -0
- package/dist/esm/button/components/ButtonLoadingIndicator.liquid.js +8 -0
- package/dist/esm/button/components/common/attributes.js +13 -0
- package/dist/esm/button/components/common/classes.js +49 -0
- package/dist/esm/button/components/common/constants.js +24 -0
- package/dist/esm/button/components/common/data.js +74 -0
- package/dist/esm/button/components/common/helpers.js +118 -0
- package/dist/esm/button/components/common/styles.js +148 -0
- package/dist/esm/button/next.js +2 -6
- package/dist/esm/button/setting/configs/settings.js +5 -1
- package/dist/esm/cart/components/CheckoutNow.js +0 -2
- package/dist/esm/coupon/components/Coupon.js +1 -3
- package/dist/esm/dialog/setting/Dialog.js +7 -580
- package/dist/esm/dialog/setting/configs/settings.js +323 -0
- package/dist/esm/dialog/setting/configs/uiV1.js +286 -0
- package/dist/esm/dialog/setting/configs/uiV2.js +256 -0
- package/dist/esm/estimate-delivery/components/EstimateDate.liquid.js +3 -3
- package/dist/esm/form/components/submit-button/SubmitButton.js +0 -4
- package/dist/esm/index.js +1 -2
- package/dist/esm/index.liquid.js +1 -2
- package/dist/esm/post-purchase/callout-banner/components/CalloutText.js +1 -2
- package/dist/esm/post-purchase/callout-banner/components/common/getClasses.js +2 -5
- package/dist/esm/post-purchase/callout-banner/components/common/getStyles.js +4 -2
- package/dist/esm/post-purchase/callout-banner/setting/config/callout-text/setting.js +11 -1
- 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 +15 -2
- package/dist/esm/post-purchase/product/settings/product-image/uiV2.js +3 -1
- package/dist/esm/post-purchase/utils/constants.js +1 -1
- package/dist/esm/product/components/DynamicCheckout/DynamicCheckout.js +1 -4
- package/dist/esm/product/components/DynamicCheckout.js +1 -4
- package/dist/esm/product/components/FileUpload/components/common/index.js +1 -1
- package/dist/esm/product/components/ProductButton.js +1 -2
- package/dist/esm/product/components/ProductButton.liquid.js +1 -1
- package/dist/esm/product/components/ProductDescription/index.liquid.js +3 -4
- package/dist/esm/product/components/ProductViewMore.js +1 -4
- package/dist/esm/product/components/ProductViewMore.liquid.js +1 -1
- package/dist/esm/setting.js +2 -2
- package/dist/esm/text/components/common/getClasses.js +1 -1
- package/dist/esm/third-party/components/PushOwl.js +0 -5
- package/dist/types/index.d.ts +175 -267
- package/package.json +2 -2
- package/dist/cjs/button/components/v2/ButtonIcon.js +0 -18
- package/dist/cjs/button/components/v2/ButtonLabel.js +0 -25
- package/dist/cjs/button/components/v2/ButtonV2.js +0 -140
- package/dist/cjs/button/components/v2/ButtonV2.liquid.js +0 -181
- package/dist/cjs/button/hooks/useButtonCustomCss.js +0 -88
- package/dist/cjs/button/hooks/useButtonStyles.js +0 -93
- package/dist/esm/button/components/v2/ButtonIcon.js +0 -14
- package/dist/esm/button/components/v2/ButtonLabel.js +0 -21
- package/dist/esm/button/components/v2/ButtonV2.js +0 -136
- package/dist/esm/button/components/v2/ButtonV2.liquid.js +0 -177
- package/dist/esm/button/hooks/useButtonCustomCss.js +0 -84
- package/dist/esm/button/hooks/useButtonStyles.js +0 -91
- /package/dist/cjs/button/components/{v2/ButtonLoadingIndicator.js → ButtonLoadingIndicator.js} +0 -0
- /package/dist/esm/button/components/{v2/ButtonLoadingIndicator.js → ButtonLoadingIndicator.js} +0 -0
|
@@ -5,10 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var Text = require('../../text/components/Text.js');
|
|
8
|
-
var
|
|
8
|
+
var Button = require('../../button/components/Button.js');
|
|
9
9
|
var core = require('@gem-sdk/core');
|
|
10
|
-
require('next/link');
|
|
11
|
-
require('react');
|
|
12
10
|
|
|
13
11
|
const ArticleReadMore = ({ setting, builderAttrs, builderProps, styles, style, advanced })=>{
|
|
14
12
|
const article = core.useArticleStore((s)=>s.article);
|
|
@@ -31,7 +29,7 @@ const ArticleReadMore = ({ setting, builderAttrs, builderProps, styles, style, a
|
|
|
31
29
|
globalSize: globalSizeText,
|
|
32
30
|
excludeFlex: true
|
|
33
31
|
}
|
|
34
|
-
}) : /*#__PURE__*/ jsxRuntime.jsx(
|
|
32
|
+
}) : /*#__PURE__*/ jsxRuntime.jsx(Button.default, {
|
|
35
33
|
builderAttrs: builderAttrs,
|
|
36
34
|
builderProps: builderProps,
|
|
37
35
|
setting: {
|
|
@@ -4,20 +4,20 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var core = require('@gem-sdk/core');
|
|
6
6
|
var system = require('@gem-sdk/system');
|
|
7
|
+
require('react/jsx-runtime');
|
|
8
|
+
require('react');
|
|
9
|
+
require('next/link');
|
|
7
10
|
var Row_liquid = require('../../grid/row/Row.liquid.js');
|
|
8
11
|
var NextImage_liquid = require('../../image/components/NextImage.liquid.js');
|
|
9
12
|
var HTML5Embed_liquid = require('../../video/components/HTML5Embed.liquid.js');
|
|
10
|
-
require('react');
|
|
11
|
-
require('react/jsx-runtime');
|
|
12
13
|
require('../../product/components/ProductVariants/variants/index.js');
|
|
13
14
|
require('../../product/components/ProductBadge/constants.js');
|
|
14
15
|
require('../../product/components/constants/product-bundle.js');
|
|
15
16
|
require('../../product/components/ProductBadge/types.js');
|
|
16
17
|
require('../../product/components/ProductBadge/utils/shape.js');
|
|
17
18
|
require('../../accordion/setting/configs/settings.js');
|
|
18
|
-
require('next/head');
|
|
19
|
-
require('next/link');
|
|
20
19
|
require('@gem-sdk/keen-slider/react');
|
|
20
|
+
require('next/head');
|
|
21
21
|
require('next/image');
|
|
22
22
|
var getSrcSet = require('../../image/helpers/getSrcSet.js');
|
|
23
23
|
var common$1 = require('../../video/helpers/common.js');
|
package/dist/cjs/builder.js
CHANGED
|
@@ -7,11 +7,7 @@ require('./accordion/setting/configs/settings.js');
|
|
|
7
7
|
var Accordion = require('./accordion/components/Accordion.js');
|
|
8
8
|
var AccordionItem = require('./accordion/components/AccordionItem.js');
|
|
9
9
|
var Breadcrumb = require('./breadcrumb/components/Breadcrumb.js');
|
|
10
|
-
var
|
|
11
|
-
require('react/jsx-runtime');
|
|
12
|
-
require('@gem-sdk/core');
|
|
13
|
-
require('next/link');
|
|
14
|
-
require('react');
|
|
10
|
+
var Button = require('./button/components/Button.js');
|
|
15
11
|
var Coupon = require('./coupon/components/Coupon.js');
|
|
16
12
|
var Carousel = require('./carousel/components/Carousel.js');
|
|
17
13
|
var CarouselItem = require('./carousel/components/CarouselItem.js');
|
|
@@ -252,7 +248,7 @@ var Marquee = require('./marquee/components/Marquee.js');
|
|
|
252
248
|
var MarqueeItem = require('./marquee/components/MarqueeItem.js');
|
|
253
249
|
var index$6 = require('./post-purchase/text/index.js');
|
|
254
250
|
var Image$1 = require('./post-purchase/image/components/Image.js');
|
|
255
|
-
var Button = require('./post-purchase/button/Button.js');
|
|
251
|
+
var Button$1 = require('./post-purchase/button/Button.js');
|
|
256
252
|
var CalloutBox = require('./post-purchase/callout-banner/components/CalloutBox.js');
|
|
257
253
|
var CalloutText = require('./post-purchase/callout-banner/components/CalloutText.js');
|
|
258
254
|
var PostPurchaseLine = require('./post-purchase/line/components/PostPurchaseLine.js');
|
|
@@ -326,7 +322,7 @@ var builder = {
|
|
|
326
322
|
Accordion: Accordion.default,
|
|
327
323
|
AccordionItem: AccordionItem.default,
|
|
328
324
|
Breadcrumb: Breadcrumb.default,
|
|
329
|
-
Button:
|
|
325
|
+
Button: Button.default,
|
|
330
326
|
Coupon: Coupon.default,
|
|
331
327
|
Carousel: Carousel.default,
|
|
332
328
|
CarouselItem: CarouselItem.default,
|
|
@@ -468,7 +464,7 @@ var builder = {
|
|
|
468
464
|
ProductVendor: Vendor.default,
|
|
469
465
|
PostPurchaseText: Text$1.default,
|
|
470
466
|
PostPurchaseImage: Image$1.default,
|
|
471
|
-
PostPurchaseButton: Button.default,
|
|
467
|
+
PostPurchaseButton: Button$1.default,
|
|
472
468
|
PostPurchaseProductDescription: ProductDescription.default,
|
|
473
469
|
PostPurchaseProductPrice: ProductPrice$1.default,
|
|
474
470
|
PostPurchaseProductTitle: ProductTitle.default,
|
|
@@ -5,192 +5,119 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var core = require('@gem-sdk/core');
|
|
8
|
-
var
|
|
9
|
-
var
|
|
8
|
+
var system = require('@gem-sdk/system');
|
|
9
|
+
var attributes = require('./common/attributes.js');
|
|
10
|
+
var styles = require('./common/styles.js');
|
|
11
|
+
var classes = require('./common/classes.js');
|
|
12
|
+
var ButtonIcon = require('./ButtonIcon.js');
|
|
13
|
+
var ButtonLabel = require('./ButtonLabel.js');
|
|
14
|
+
var ButtonLoadingIndicator = require('./ButtonLoadingIndicator.js');
|
|
15
|
+
var data = require('./common/data.js');
|
|
16
|
+
var helpers = require('./common/helpers.js');
|
|
10
17
|
|
|
11
|
-
const Button = (
|
|
12
|
-
const {
|
|
13
|
-
const { iconSvg, btnLink, htmlType,
|
|
14
|
-
const label = core.convertHTML(setting?.label);
|
|
15
|
-
const Wrap = btnLink?.link !== undefined && btnLink.link !== '' ? Link : 'button';
|
|
16
|
-
const props = btnLink?.link !== undefined && btnLink.link !== '' ? {
|
|
17
|
-
href: btnLink?.link,
|
|
18
|
-
target: btnLink?.target,
|
|
19
|
-
noFollow: btnLink?.noFollow
|
|
20
|
-
} : {
|
|
21
|
-
type: htmlType
|
|
22
|
-
};
|
|
23
|
-
const iconSpacingStyle = React.useMemo(()=>{
|
|
24
|
-
const spacing = iconSpacing || {
|
|
25
|
-
desktop: '8px'
|
|
26
|
-
};
|
|
27
|
-
return iconAlign === 'left' ? core.makeStyleResponsive('mr', spacing) : core.makeStyleResponsive('ml', spacing);
|
|
28
|
-
}, [
|
|
29
|
-
iconAlign,
|
|
30
|
-
iconSpacing
|
|
31
|
-
]);
|
|
32
|
-
// fix disabled still display hover color
|
|
33
|
-
if (disabled) {
|
|
34
|
-
delete backgroundColor?.hover;
|
|
35
|
-
delete backgroundColor?.focus;
|
|
36
|
-
}
|
|
18
|
+
const Button = (props)=>{
|
|
19
|
+
const { children, advanced, className, nodePrice, customAttrs, styles: styles$1 = {}, setting = {}, builderProps, builderAttrs, wrapClassName = '', onClick } = props;
|
|
20
|
+
const { iconSvg, btnLink, htmlType, loading, disabled, shouldClearSpace } = setting;
|
|
37
21
|
const mode = core.useEditorMode();
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
children
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
138
|
-
fill: "none",
|
|
139
|
-
viewBox: "0 0 24 24",
|
|
140
|
-
children: [
|
|
141
|
-
/*#__PURE__*/ jsxRuntime.jsx("circle", {
|
|
142
|
-
className: "gp-opacity-25",
|
|
143
|
-
cx: "12",
|
|
144
|
-
cy: "12",
|
|
145
|
-
r: "10",
|
|
146
|
-
stroke: "currentColor",
|
|
147
|
-
strokeWidth: "4"
|
|
148
|
-
}),
|
|
149
|
-
/*#__PURE__*/ jsxRuntime.jsx("path", {
|
|
150
|
-
className: "gp-opacity-75",
|
|
151
|
-
fill: "currentColor",
|
|
152
|
-
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
153
|
-
})
|
|
154
|
-
]
|
|
155
|
-
}) : '',
|
|
156
|
-
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
157
|
-
className: core.cls({
|
|
158
|
-
'gp-flex-row-reverse': iconAlign === 'right'
|
|
159
|
-
}, 'gp-inline-flex'),
|
|
160
|
-
children: [
|
|
161
|
-
!!iconSvg && iconVisible && /*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
162
|
-
className: `
|
|
163
|
-
gp-button-icon gp-transition-colors gp-duration-300 gp-z-1 gp-inline-flex gp-shrink-0 gp-items-center gp-justify-center group-data-[state=loading]:gp-invisible [&>svg]:!gp-h-[var(--height-desktop)] [&>svg]:!gp-w-auto tablet:[&>svg]:!gp-h-[var(--height-tablet)] mobile:[&>svg]:!gp-h-[var(--height-mobile)] ${shouldClearSpace && !label ? '!gp-m-0' : ''}`,
|
|
164
|
-
style: {
|
|
165
|
-
...iconSpacingStyle,
|
|
166
|
-
'--height-desktop': `${size?.desktop}`,
|
|
167
|
-
'--height-tablet': `${size?.desktop || size?.tablet}`,
|
|
168
|
-
'--height-mobile': `${size?.mobile || size?.tablet || size?.desktop}`
|
|
169
|
-
},
|
|
170
|
-
dangerouslySetInnerHTML: {
|
|
171
|
-
__html: iconSvg
|
|
172
|
-
}
|
|
173
|
-
}),
|
|
174
|
-
(!!label || !shouldClearSpace) && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
175
|
-
"data-gp-text": true,
|
|
176
|
-
className: core.cls(`gp-relative gp-flex gp-h-full gp-items-center gp-overflow-hidden gp-break-words group-data-[state=loading]:gp-invisible [&_p]:gp-whitespace-pre-line`, styles?.typo?.attrs?.italic ? '[&:not(:has(p))]:gp-pr-[0.2em] [&_p]:[&:has(p)]:gp-pr-[0.2em]' : '', mode === 'edit' && !options?.isCannotEditing ? 'gp-text button-text' : '', nodePrice ? appendTypoClass : {}),
|
|
177
|
-
style: {
|
|
178
|
-
...core.makeStyle({
|
|
179
|
-
tt: styles?.transform
|
|
180
|
-
}),
|
|
181
|
-
...nodePrice && appendTypoStyle
|
|
182
|
-
},
|
|
183
|
-
dangerouslySetInnerHTML: {
|
|
184
|
-
__html: styles?.typo?.attrs?.transform === 'capitalize' ? label?.toString().toLocaleLowerCase() : label
|
|
185
|
-
}
|
|
186
|
-
})
|
|
187
|
-
]
|
|
188
|
-
}),
|
|
189
|
-
nodePrice && nodePrice
|
|
190
|
-
]
|
|
191
|
-
}),
|
|
192
|
-
children
|
|
193
|
-
]
|
|
22
|
+
const { customCss, wrapStyle, restStyle, dataState, dataIdAttr, isShowIcon, isScrollToElement, getArialLabel, getLabelToDisplay, checkIsShowLabel, checkIsEditableLabel } = data.getData(props);
|
|
23
|
+
const { HTMLTag, urlData, shouldRenderLink } = helpers.getInsertLinkData({
|
|
24
|
+
htmlType,
|
|
25
|
+
setting: btnLink,
|
|
26
|
+
defaultTag: 'button'
|
|
27
|
+
});
|
|
28
|
+
const ButtonWrapper = helpers.getButtonWrapper(HTMLTag, isScrollToElement);
|
|
29
|
+
const buttonStyles = system.createStyle({
|
|
30
|
+
...styles.getButtonStyles(styles$1, nodePrice)
|
|
31
|
+
});
|
|
32
|
+
const buttonIconStyles = system.createStyle({
|
|
33
|
+
...styles.getButtonIconStyles(styles$1, setting)
|
|
34
|
+
});
|
|
35
|
+
const buttonWrapperStyles = system.createStyle({
|
|
36
|
+
...styles.getButtonWrapperStyles(restStyle, styles$1)
|
|
37
|
+
});
|
|
38
|
+
const buttonClasses = system.createClass({
|
|
39
|
+
...classes.getButtonClasses({
|
|
40
|
+
styles: styles$1,
|
|
41
|
+
className,
|
|
42
|
+
shouldRenderLink,
|
|
43
|
+
uid: builderProps?.uid
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
const buttonIconClasses = system.createClass({
|
|
47
|
+
...classes.getButtonIconClasses(getLabelToDisplay(), shouldClearSpace)
|
|
48
|
+
});
|
|
49
|
+
const buttonLabelClasses = system.createClass({
|
|
50
|
+
...classes.getButtonLabelClasses(styles$1, checkIsEditableLabel({
|
|
51
|
+
mode
|
|
52
|
+
}))
|
|
53
|
+
});
|
|
54
|
+
const buttonWrapperClasses = system.createClass({
|
|
55
|
+
...classes.getButtonWrapperClasses(wrapClassName, className, advanced?.cssClass)
|
|
56
|
+
});
|
|
57
|
+
const buttonContentWrapperClasses = system.createClass({
|
|
58
|
+
...classes.getButtonContentWrapperClasses(setting)
|
|
59
|
+
});
|
|
60
|
+
const buttonWrapperAttrs = system.createAttr({
|
|
61
|
+
...attributes.getButtonAttributes({
|
|
62
|
+
urlData,
|
|
63
|
+
disabled,
|
|
64
|
+
dataState,
|
|
65
|
+
dataId: dataIdAttr,
|
|
66
|
+
arialLabel: getArialLabel()
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
const handleClick = (e)=>{
|
|
70
|
+
onClick?.(e);
|
|
71
|
+
if (btnLink?.link?.startsWith('#') && mode !== 'edit') {
|
|
72
|
+
core.globalEvent.dispatch('onOpenDialog', {
|
|
73
|
+
popupUId: btnLink.link
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
78
|
+
style: wrapStyle,
|
|
79
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
80
|
+
...builderAttrs,
|
|
81
|
+
style: buttonWrapperStyles,
|
|
82
|
+
className: buttonWrapperClasses,
|
|
83
|
+
children: [
|
|
84
|
+
/*#__PURE__*/ jsxRuntime.jsx("style", {
|
|
85
|
+
children: customCss
|
|
86
|
+
}),
|
|
87
|
+
system.If(isScrollToElement, // eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
88
|
+
/*#__PURE__*/ jsxRuntime.jsx("a", {
|
|
89
|
+
className: "gp-trigger-button-link gp-hidden",
|
|
90
|
+
href: urlData.href,
|
|
91
|
+
target: urlData.target
|
|
92
|
+
})),
|
|
93
|
+
/*#__PURE__*/ jsxRuntime.jsxs(ButtonWrapper, {
|
|
94
|
+
...buttonWrapperAttrs,
|
|
95
|
+
...customAttrs,
|
|
96
|
+
style: buttonStyles,
|
|
97
|
+
className: buttonClasses,
|
|
98
|
+
onClick: handleClick,
|
|
99
|
+
children: [
|
|
100
|
+
system.If(loading, /*#__PURE__*/ jsxRuntime.jsx(ButtonLoadingIndicator.default, {}), ''),
|
|
101
|
+
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
102
|
+
className: buttonContentWrapperClasses,
|
|
103
|
+
children: [
|
|
104
|
+
system.If(isShowIcon, /*#__PURE__*/ jsxRuntime.jsx(ButtonIcon.default, {
|
|
105
|
+
iconSvg: iconSvg ?? '',
|
|
106
|
+
styles: buttonIconStyles,
|
|
107
|
+
classes: buttonIconClasses
|
|
108
|
+
})),
|
|
109
|
+
system.If(checkIsShowLabel(), /*#__PURE__*/ jsxRuntime.jsx(ButtonLabel.default, {
|
|
110
|
+
label: getLabelToDisplay(),
|
|
111
|
+
classes: buttonLabelClasses
|
|
112
|
+
}))
|
|
113
|
+
]
|
|
114
|
+
}),
|
|
115
|
+
system.If(!!nodePrice, nodePrice?.toString() ?? '', '')
|
|
116
|
+
]
|
|
117
|
+
}),
|
|
118
|
+
children
|
|
119
|
+
]
|
|
120
|
+
})
|
|
194
121
|
});
|
|
195
122
|
};
|
|
196
123
|
|