@gem-sdk/components 2.0.0-dev.432 → 2.0.0-dev.434
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/AccordionItem.liquid.js +1 -1
- package/dist/cjs/form/components/form-checkbox/FormCheckbox.js +2 -0
- package/dist/cjs/form/components/form-checkbox/FormCheckbox.liquid.js +4 -6
- package/dist/cjs/form/components/form-checkbox/common/composeClasses.js +3 -2
- package/dist/cjs/form/components/form-checkbox/common/composeStyles.js +7 -1
- package/dist/cjs/form/setting/form-checkbox/configs/settings.js +9 -3
- package/dist/cjs/form/setting/form-checkbox/configs/uiV2.js +77 -80
- package/dist/cjs/form/setting/newsletter/NewsletterInitConfig.js +33 -3
- package/dist/cjs/form/setting/newsletter/configs/settings.js +2 -39
- package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscount.js +3 -10
- package/dist/esm/accordion/components/AccordionItem.liquid.js +1 -1
- package/dist/esm/form/components/form-checkbox/FormCheckbox.js +3 -1
- package/dist/esm/form/components/form-checkbox/FormCheckbox.liquid.js +5 -7
- package/dist/esm/form/components/form-checkbox/common/composeClasses.js +3 -2
- package/dist/esm/form/components/form-checkbox/common/composeStyles.js +7 -2
- package/dist/esm/form/setting/form-checkbox/configs/settings.js +9 -3
- package/dist/esm/form/setting/form-checkbox/configs/uiV2.js +77 -80
- package/dist/esm/form/setting/newsletter/NewsletterInitConfig.js +33 -3
- package/dist/esm/form/setting/newsletter/configs/settings.js +2 -39
- package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscount.js +3 -10
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
|
@@ -46,7 +46,7 @@ const AccordionItem = (props)=>{
|
|
|
46
46
|
isMounted: false
|
|
47
47
|
}));
|
|
48
48
|
const composeRenderChildrenStyles = system.createStyle(styles.getRenderChildrenStyles(composeContentSizeStyle));
|
|
49
|
-
const composeItemBodyClasses = system.createClass(core.composeClasses('gp-accordion-item_body-inner gp-transition-all gp-duration-500
|
|
49
|
+
const composeItemBodyClasses = system.createClass(core.composeClasses('gp-accordion-item_body-inner gp-transition-all gp-duration-500'));
|
|
50
50
|
const getChildForBody = ()=>{
|
|
51
51
|
if (rawChildren && rawChildren.length >= index.MINIMUM_CHILD) {
|
|
52
52
|
return core.RenderChildren({
|
|
@@ -13,6 +13,7 @@ const FormCheckbox = ({ builderProps, setting, advanced, styles })=>{
|
|
|
13
13
|
const composedContainerStyles = system.createStyle(composeStyles.composeContainerStyles(setting));
|
|
14
14
|
const composedFormCheckboxStyles = system.createStyle(composeStyles.composeFormCheckboxStyles(setting, styles, builderProps));
|
|
15
15
|
const composedFormCheckboxInputStyles = system.createStyle(composeStyles.composeFormCheckboxInputStyles());
|
|
16
|
+
const composedTextStyle = system.createStyle(composeStyles.getComposedTextStyle(setting));
|
|
16
17
|
const composedContainerClasses = system.createClass(composeClasses.composeContainerClasses(setting, advanced, builderProps));
|
|
17
18
|
const composedFormCheckboxInputClasses = system.createClass(composeClasses.composeFormCheckboxInputClasses());
|
|
18
19
|
const composedFormCheckboxLabelClasses = system.createClass(composeClasses.composeFormCheckboxLabelClasses());
|
|
@@ -34,6 +35,7 @@ const FormCheckbox = ({ builderProps, setting, advanced, styles })=>{
|
|
|
34
35
|
}),
|
|
35
36
|
/*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
36
37
|
className: composedFormCheckboxLabelClasses,
|
|
38
|
+
style: composedTextStyle,
|
|
37
39
|
children: description
|
|
38
40
|
})
|
|
39
41
|
]
|
|
@@ -20,6 +20,7 @@ const FromCheckbox = ({ builderProps, setting, advanced, pageContext, styles })=
|
|
|
20
20
|
const composedContainerStyles = system.createStyle(composeStyles.composeContainerStyles(setting));
|
|
21
21
|
const composedFormCheckboxStyles = system.createStyle(composeStyles.composeFormCheckboxStyles(setting, styles, builderProps));
|
|
22
22
|
const composedFormCheckboxInputStyles = system.createStyle(composeStyles.composeFormCheckboxInputStyles());
|
|
23
|
+
const composedTextStyle = system.createStyle(composeStyles.getComposedTextStyle(setting));
|
|
23
24
|
const composedContainerClasses = system.createClass(composeClasses.composeContainerClasses(setting, advanced, builderProps));
|
|
24
25
|
const composedFormCheckboxInputClasses = system.createClass(composeClasses.composeFormCheckboxInputClasses());
|
|
25
26
|
const composedFormCheckboxLabelClasses = system.createClass(composeClasses.composeFormCheckboxLabelClasses());
|
|
@@ -33,18 +34,15 @@ const FromCheckbox = ({ builderProps, setting, advanced, pageContext, styles })=
|
|
|
33
34
|
class="${composedContainerClasses}"
|
|
34
35
|
>
|
|
35
36
|
<input
|
|
36
|
-
class
|
|
37
|
+
class="${composedFormCheckboxInputClasses}"
|
|
37
38
|
name="${name}"
|
|
38
39
|
type="checkbox"
|
|
39
40
|
${system.If(selected, 'checked')}
|
|
40
41
|
${system.If(required, 'required')}
|
|
41
|
-
|
|
42
|
-
style=${composedFormCheckboxInputStyles}
|
|
42
|
+
style="${composedFormCheckboxInputStyles}"
|
|
43
43
|
>
|
|
44
44
|
</input>
|
|
45
|
-
<span
|
|
46
|
-
class=${composedFormCheckboxLabelClasses}
|
|
47
|
-
>
|
|
45
|
+
<span class="${composedFormCheckboxLabelClasses}" style="${composedTextStyle}">
|
|
48
46
|
${descriptionDisplay}
|
|
49
47
|
</span>
|
|
50
48
|
</label>
|
|
@@ -10,7 +10,7 @@ const composeContainerClasses = (setting, advanced, builderProps)=>{
|
|
|
10
10
|
return composeClasses({
|
|
11
11
|
[builderProps?.uid]: !!builderProps?.uid,
|
|
12
12
|
[advanced?.cssClass]: !!advanced?.cssClass,
|
|
13
|
-
'gp-flex gp-flex-wrap gp-items-center
|
|
13
|
+
'gp-flex gp-flex-wrap gp-items-center': true,
|
|
14
14
|
[appendTypoClass]: !!appendTypoClass
|
|
15
15
|
});
|
|
16
16
|
};
|
|
@@ -21,7 +21,8 @@ const composeFormCheckboxInputClasses = ()=>{
|
|
|
21
21
|
};
|
|
22
22
|
const composeFormCheckboxLabelClasses = ()=>{
|
|
23
23
|
return composeClasses({
|
|
24
|
-
'w-auto': true
|
|
24
|
+
'w-auto': true,
|
|
25
|
+
'gp-w-[calc(100%_-_20px)]': true
|
|
25
26
|
});
|
|
26
27
|
};
|
|
27
28
|
|
|
@@ -15,7 +15,6 @@ const composeFormCheckboxStyles = (setting, styles, builderProps)=>{
|
|
|
15
15
|
const { wrapperBorder, borderRadius, shadow, globalSize } = styles ?? {};
|
|
16
16
|
const appendTypoStyle = core.composeTypographyStyle(setting?.typo, typography);
|
|
17
17
|
const composeGlobalSize = core.makeGlobalSize(globalSize);
|
|
18
|
-
console.log(123, horizontalSpacing);
|
|
19
18
|
return composeStyles({
|
|
20
19
|
...composeGlobalSize?.width?.['--w'] ? composeGlobalSize.width : {
|
|
21
20
|
'--w': '100%'
|
|
@@ -41,7 +40,14 @@ const composeFormCheckboxInputStyles = ()=>{
|
|
|
41
40
|
appearance: 'auto'
|
|
42
41
|
});
|
|
43
42
|
};
|
|
43
|
+
const getComposedTextStyle = (setting)=>{
|
|
44
|
+
const { horizontalSpacing } = setting ?? {};
|
|
45
|
+
return composeStyles({
|
|
46
|
+
...core.makeStyleResponsive('pl', horizontalSpacing)
|
|
47
|
+
});
|
|
48
|
+
};
|
|
44
49
|
|
|
45
50
|
exports.composeContainerStyles = composeContainerStyles;
|
|
46
51
|
exports.composeFormCheckboxInputStyles = composeFormCheckboxInputStyles;
|
|
47
52
|
exports.composeFormCheckboxStyles = composeFormCheckboxStyles;
|
|
53
|
+
exports.getComposedTextStyle = getComposedTextStyle;
|
|
@@ -61,12 +61,18 @@ const FormCheckboxSettings = [
|
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
63
|
id: 'horizontalSpacing',
|
|
64
|
-
type: 'input:unit',
|
|
65
64
|
units: [
|
|
66
65
|
'px'
|
|
67
66
|
],
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
type: 'input:slider',
|
|
68
|
+
step: 1,
|
|
69
|
+
min: 0,
|
|
70
|
+
max: 40,
|
|
71
|
+
devices: {
|
|
72
|
+
desktop: {
|
|
73
|
+
default: '4px'
|
|
74
|
+
}
|
|
75
|
+
}
|
|
70
76
|
},
|
|
71
77
|
{
|
|
72
78
|
id: 'align',
|
|
@@ -47,86 +47,83 @@ const SettingUIV2 = [
|
|
|
47
47
|
}
|
|
48
48
|
]
|
|
49
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
|
-
},
|
|
50
|
+
// {
|
|
51
|
+
// label: {
|
|
52
|
+
// en: 'Size',
|
|
53
|
+
// },
|
|
54
|
+
// controls: [
|
|
55
|
+
// {
|
|
56
|
+
// id: 'Width',
|
|
57
|
+
// label: {
|
|
58
|
+
// en: 'Width',
|
|
59
|
+
// },
|
|
60
|
+
// controlConfig: {
|
|
61
|
+
// id: 'width',
|
|
62
|
+
// type: 'dropdown:input',
|
|
63
|
+
// label: 'Width',
|
|
64
|
+
// inputType: 'number',
|
|
65
|
+
// units: ['px', '%'],
|
|
66
|
+
// hideUnit: false,
|
|
67
|
+
// linkWithSetting: {
|
|
68
|
+
// name: 'globalSize',
|
|
69
|
+
// field: 'width',
|
|
70
|
+
// },
|
|
71
|
+
// displayOptions: [
|
|
72
|
+
// {
|
|
73
|
+
// label: 'Fit content',
|
|
74
|
+
// value: 'Auto',
|
|
75
|
+
// showValue: true,
|
|
76
|
+
// },
|
|
77
|
+
// {
|
|
78
|
+
// label: 'Full',
|
|
79
|
+
// value: '100%',
|
|
80
|
+
// showValue: true,
|
|
81
|
+
// },
|
|
82
|
+
// {
|
|
83
|
+
// label: 'Small',
|
|
84
|
+
// value: '100px',
|
|
85
|
+
// showValue: true,
|
|
86
|
+
// },
|
|
87
|
+
// {
|
|
88
|
+
// label: 'Medium',
|
|
89
|
+
// value: '116px',
|
|
90
|
+
// showValue: true,
|
|
91
|
+
// },
|
|
92
|
+
// {
|
|
93
|
+
// label: 'Large',
|
|
94
|
+
// value: '132px',
|
|
95
|
+
// showValue: true,
|
|
96
|
+
// },
|
|
97
|
+
// ],
|
|
98
|
+
// },
|
|
99
|
+
// layout: 'horizontal',
|
|
100
|
+
// },
|
|
101
|
+
// {
|
|
102
|
+
// label: {
|
|
103
|
+
// en: 'Padding',
|
|
104
|
+
// },
|
|
105
|
+
// controlConfig: {
|
|
106
|
+
// id: 'padding',
|
|
107
|
+
// type: 'padding-v2',
|
|
108
|
+
// linkWithSetting: {
|
|
109
|
+
// name: 'globalSize',
|
|
110
|
+
// field: 'padding',
|
|
111
|
+
// },
|
|
112
|
+
// compoDefaultValue: {
|
|
113
|
+
// desktop: {
|
|
114
|
+
// default: {
|
|
115
|
+
// type: 'medium',
|
|
116
|
+
// top: '12px',
|
|
117
|
+
// bottom: '12px',
|
|
118
|
+
// left: '24px',
|
|
119
|
+
// right: '24px',
|
|
120
|
+
// },
|
|
121
|
+
// },
|
|
122
|
+
// },
|
|
123
|
+
// },
|
|
124
|
+
// },
|
|
125
|
+
// ],
|
|
126
|
+
// },
|
|
130
127
|
// {
|
|
131
128
|
// label: {
|
|
132
129
|
// en: 'Background',
|
|
@@ -44,10 +44,10 @@ const newsletterInitConfig = [
|
|
|
44
44
|
layout: {
|
|
45
45
|
desktop: {
|
|
46
46
|
cols: [
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
9,
|
|
48
|
+
3
|
|
49
49
|
],
|
|
50
|
-
display: '
|
|
50
|
+
display: 'fill'
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
horizontalAlign: {
|
|
@@ -133,6 +133,11 @@ const newsletterInitConfig = [
|
|
|
133
133
|
label: 'Send'
|
|
134
134
|
},
|
|
135
135
|
styles: {
|
|
136
|
+
globalSize: {
|
|
137
|
+
desktop: {
|
|
138
|
+
width: '100%'
|
|
139
|
+
}
|
|
140
|
+
},
|
|
136
141
|
borderBtn: {
|
|
137
142
|
normal: {
|
|
138
143
|
borderType: 'none',
|
|
@@ -158,6 +163,31 @@ const newsletterInitConfig = [
|
|
|
158
163
|
radiusType: 'none'
|
|
159
164
|
}
|
|
160
165
|
}
|
|
166
|
+
},
|
|
167
|
+
advanced: {
|
|
168
|
+
border: {
|
|
169
|
+
desktop: {
|
|
170
|
+
normal: {
|
|
171
|
+
borderType: 'style-2',
|
|
172
|
+
borderLabel: 'Style 2',
|
|
173
|
+
border: 'solid',
|
|
174
|
+
color: 'line-2',
|
|
175
|
+
isCustom: false,
|
|
176
|
+
width: '1px 1px 1px 1px'
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
rounded: {
|
|
181
|
+
desktop: {
|
|
182
|
+
normal: {
|
|
183
|
+
btrr: '0px',
|
|
184
|
+
bblr: '0px',
|
|
185
|
+
bbrr: '0px',
|
|
186
|
+
btlr: '0px',
|
|
187
|
+
radiusType: 'none'
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
161
191
|
}
|
|
162
192
|
}
|
|
163
193
|
]
|
|
@@ -33,12 +33,6 @@ const NewsletterSettings = [
|
|
|
33
33
|
type: 'stay-on-page',
|
|
34
34
|
link: '',
|
|
35
35
|
target: '_self'
|
|
36
|
-
},
|
|
37
|
-
hiddenOptions: {
|
|
38
|
-
'scroll-to': true,
|
|
39
|
-
'open-popup': true,
|
|
40
|
-
'send-email': true,
|
|
41
|
-
'call-phone': true
|
|
42
36
|
}
|
|
43
37
|
},
|
|
44
38
|
{
|
|
@@ -159,14 +153,7 @@ const NewsletterSettings = [
|
|
|
159
153
|
desktop: {
|
|
160
154
|
default: {
|
|
161
155
|
width: '480px',
|
|
162
|
-
height: 'Auto'
|
|
163
|
-
padding: {
|
|
164
|
-
type: 'medium',
|
|
165
|
-
top: '12px',
|
|
166
|
-
bottom: '12px',
|
|
167
|
-
left: '24px',
|
|
168
|
-
right: '24px'
|
|
169
|
-
}
|
|
156
|
+
height: 'Auto'
|
|
170
157
|
}
|
|
171
158
|
}
|
|
172
159
|
},
|
|
@@ -258,31 +245,7 @@ const NewsletterSettings = [
|
|
|
258
245
|
},
|
|
259
246
|
{
|
|
260
247
|
id: 'boxShadow',
|
|
261
|
-
type: 'shadow-v2'
|
|
262
|
-
devices: {
|
|
263
|
-
desktop: {
|
|
264
|
-
default: {
|
|
265
|
-
type: 'shadow-2',
|
|
266
|
-
distance: '12px',
|
|
267
|
-
blur: '12px',
|
|
268
|
-
spread: '0px',
|
|
269
|
-
color: 'rgba(18, 18, 18, 0.2)',
|
|
270
|
-
angle: 45
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
},
|
|
274
|
-
compoDefaultValue: {
|
|
275
|
-
desktop: {
|
|
276
|
-
default: {
|
|
277
|
-
type: 'shadow-2',
|
|
278
|
-
distance: '12px',
|
|
279
|
-
blur: '12px',
|
|
280
|
-
spread: '0px',
|
|
281
|
-
color: 'rgba(18, 18, 18, 0.2)',
|
|
282
|
-
angle: 45
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
}
|
|
248
|
+
type: 'shadow-v2'
|
|
286
249
|
}
|
|
287
250
|
]
|
|
288
251
|
}
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var core = require('@gem-sdk/core');
|
|
8
8
|
var React = require('react');
|
|
9
|
-
var Loading = require('../../../../common/components/Loading.js');
|
|
10
9
|
var NoDataState = require('../../../../common/components/NoDataState.js');
|
|
11
10
|
var system = require('@gem-sdk/system');
|
|
12
11
|
var styles = require('../common/styles.js');
|
|
@@ -17,19 +16,13 @@ var ProductBundleDiscountChildrenItem = require('./ProductBundleDiscountChildren
|
|
|
17
16
|
|
|
18
17
|
const ProductBundleDiscount = ({ builderAttrs, style, children, setting, styles: styles$1, advanced })=>{
|
|
19
18
|
const mode = core.useEditorMode();
|
|
20
|
-
const {
|
|
19
|
+
const { isSelected, setSelected } = useProductBundleDiscountState.default(setting);
|
|
21
20
|
const { emitRedirectSetupPage, redirectGuideline, svg } = useProductBundleDataState.default();
|
|
22
21
|
const composeContainerClasses = system.createClass(classes.getContainerClasses(setting, advanced?.cssClass));
|
|
23
22
|
const composeNoDiscountClasses = system.createClass(classes.getNoDiscountClasses);
|
|
24
23
|
const composeSizeStyles = system.createStyle(styles.getSizeSettings(styles$1)?.gap);
|
|
25
24
|
const composeContainerStyles = system.createStyle(styles.getContainerStyles(composeSizeStyles, styles$1, style));
|
|
26
|
-
if (!setting?.bundleItems) {
|
|
27
|
-
return timer >= 10 ? /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
28
|
-
className: composeNoDiscountClasses,
|
|
29
|
-
children: "This product has no bundle discount"
|
|
30
|
-
}) : /*#__PURE__*/ jsxRuntime.jsx(Loading.default, {});
|
|
31
|
-
}
|
|
32
|
-
if (!setting.bundleItems.length && mode === 'edit') {
|
|
25
|
+
if (!setting?.bundleItems?.length && mode === 'edit') {
|
|
33
26
|
return /*#__PURE__*/ jsxRuntime.jsx(NoDataState.default, {
|
|
34
27
|
elementType: "secondary",
|
|
35
28
|
description: "Increase AOV with bundle quantity.",
|
|
@@ -47,7 +40,7 @@ const ProductBundleDiscount = ({ builderAttrs, style, children, setting, styles:
|
|
|
47
40
|
});
|
|
48
41
|
}
|
|
49
42
|
const renderBundleItem = (item, i)=>{
|
|
50
|
-
if (setting
|
|
43
|
+
if (setting?.hideNoDiscountItem && item?.discountType === 'no_discount') {
|
|
51
44
|
return null;
|
|
52
45
|
}
|
|
53
46
|
const childItem = children?.[i];
|
|
@@ -42,7 +42,7 @@ const AccordionItem = (props)=>{
|
|
|
42
42
|
isMounted: false
|
|
43
43
|
}));
|
|
44
44
|
const composeRenderChildrenStyles = createStyle(getRenderChildrenStyles(composeContentSizeStyle));
|
|
45
|
-
const composeItemBodyClasses = createClass(composeClasses('gp-accordion-item_body-inner gp-transition-all gp-duration-500
|
|
45
|
+
const composeItemBodyClasses = createClass(composeClasses('gp-accordion-item_body-inner gp-transition-all gp-duration-500'));
|
|
46
46
|
const getChildForBody = ()=>{
|
|
47
47
|
if (rawChildren && rawChildren.length >= MINIMUM_CHILD) {
|
|
48
48
|
return RenderChildren({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { createStyle, createClass } from '@gem-sdk/system';
|
|
4
|
-
import { composeContainerStyles, composeFormCheckboxStyles, composeFormCheckboxInputStyles } from './common/composeStyles.js';
|
|
4
|
+
import { composeContainerStyles, composeFormCheckboxStyles, composeFormCheckboxInputStyles, getComposedTextStyle } from './common/composeStyles.js';
|
|
5
5
|
import { composeContainerClasses, composeFormCheckboxInputClasses, composeFormCheckboxLabelClasses } from './common/composeClasses.js';
|
|
6
6
|
|
|
7
7
|
const FormCheckbox = ({ builderProps, setting, advanced, styles })=>{
|
|
@@ -9,6 +9,7 @@ const FormCheckbox = ({ builderProps, setting, advanced, styles })=>{
|
|
|
9
9
|
const composedContainerStyles = createStyle(composeContainerStyles(setting));
|
|
10
10
|
const composedFormCheckboxStyles = createStyle(composeFormCheckboxStyles(setting, styles, builderProps));
|
|
11
11
|
const composedFormCheckboxInputStyles = createStyle(composeFormCheckboxInputStyles());
|
|
12
|
+
const composedTextStyle = createStyle(getComposedTextStyle(setting));
|
|
12
13
|
const composedContainerClasses = createClass(composeContainerClasses(setting, advanced, builderProps));
|
|
13
14
|
const composedFormCheckboxInputClasses = createClass(composeFormCheckboxInputClasses());
|
|
14
15
|
const composedFormCheckboxLabelClasses = createClass(composeFormCheckboxLabelClasses());
|
|
@@ -30,6 +31,7 @@ const FormCheckbox = ({ builderProps, setting, advanced, styles })=>{
|
|
|
30
31
|
}),
|
|
31
32
|
/*#__PURE__*/ jsx("span", {
|
|
32
33
|
className: composedFormCheckboxLabelClasses,
|
|
34
|
+
style: composedTextStyle,
|
|
33
35
|
children: description
|
|
34
36
|
})
|
|
35
37
|
]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { template } from '@gem-sdk/core';
|
|
2
2
|
import { getDynamicSourceLocales } from '../../../helpers.js';
|
|
3
3
|
import { createStyle, createClass, If } from '@gem-sdk/system';
|
|
4
|
-
import { composeContainerStyles, composeFormCheckboxStyles, composeFormCheckboxInputStyles } from './common/composeStyles.js';
|
|
4
|
+
import { composeContainerStyles, composeFormCheckboxStyles, composeFormCheckboxInputStyles, getComposedTextStyle } from './common/composeStyles.js';
|
|
5
5
|
import { composeContainerClasses, composeFormCheckboxInputClasses, composeFormCheckboxLabelClasses } from './common/composeClasses.js';
|
|
6
6
|
|
|
7
7
|
const FromCheckbox = ({ builderProps, setting, advanced, pageContext, styles })=>{
|
|
@@ -16,6 +16,7 @@ const FromCheckbox = ({ builderProps, setting, advanced, pageContext, styles })=
|
|
|
16
16
|
const composedContainerStyles = createStyle(composeContainerStyles(setting));
|
|
17
17
|
const composedFormCheckboxStyles = createStyle(composeFormCheckboxStyles(setting, styles, builderProps));
|
|
18
18
|
const composedFormCheckboxInputStyles = createStyle(composeFormCheckboxInputStyles());
|
|
19
|
+
const composedTextStyle = createStyle(getComposedTextStyle(setting));
|
|
19
20
|
const composedContainerClasses = createClass(composeContainerClasses(setting, advanced, builderProps));
|
|
20
21
|
const composedFormCheckboxInputClasses = createClass(composeFormCheckboxInputClasses());
|
|
21
22
|
const composedFormCheckboxLabelClasses = createClass(composeFormCheckboxLabelClasses());
|
|
@@ -29,18 +30,15 @@ const FromCheckbox = ({ builderProps, setting, advanced, pageContext, styles })=
|
|
|
29
30
|
class="${composedContainerClasses}"
|
|
30
31
|
>
|
|
31
32
|
<input
|
|
32
|
-
class
|
|
33
|
+
class="${composedFormCheckboxInputClasses}"
|
|
33
34
|
name="${name}"
|
|
34
35
|
type="checkbox"
|
|
35
36
|
${If(selected, 'checked')}
|
|
36
37
|
${If(required, 'required')}
|
|
37
|
-
|
|
38
|
-
style=${composedFormCheckboxInputStyles}
|
|
38
|
+
style="${composedFormCheckboxInputStyles}"
|
|
39
39
|
>
|
|
40
40
|
</input>
|
|
41
|
-
<span
|
|
42
|
-
class=${composedFormCheckboxLabelClasses}
|
|
43
|
-
>
|
|
41
|
+
<span class="${composedFormCheckboxLabelClasses}" style="${composedTextStyle}">
|
|
44
42
|
${descriptionDisplay}
|
|
45
43
|
</span>
|
|
46
44
|
</label>
|
|
@@ -8,7 +8,7 @@ const composeContainerClasses = (setting, advanced, builderProps)=>{
|
|
|
8
8
|
return composeClasses({
|
|
9
9
|
[builderProps?.uid]: !!builderProps?.uid,
|
|
10
10
|
[advanced?.cssClass]: !!advanced?.cssClass,
|
|
11
|
-
'gp-flex gp-flex-wrap gp-items-center
|
|
11
|
+
'gp-flex gp-flex-wrap gp-items-center': true,
|
|
12
12
|
[appendTypoClass]: !!appendTypoClass
|
|
13
13
|
});
|
|
14
14
|
};
|
|
@@ -19,7 +19,8 @@ const composeFormCheckboxInputClasses = ()=>{
|
|
|
19
19
|
};
|
|
20
20
|
const composeFormCheckboxLabelClasses = ()=>{
|
|
21
21
|
return composeClasses({
|
|
22
|
-
'w-auto': true
|
|
22
|
+
'w-auto': true,
|
|
23
|
+
'gp-w-[calc(100%_-_20px)]': true
|
|
23
24
|
});
|
|
24
25
|
};
|
|
25
26
|
|
|
@@ -13,7 +13,6 @@ const composeFormCheckboxStyles = (setting, styles, builderProps)=>{
|
|
|
13
13
|
const { wrapperBorder, borderRadius, shadow, globalSize } = styles ?? {};
|
|
14
14
|
const appendTypoStyle = composeTypographyStyle(setting?.typo, typography);
|
|
15
15
|
const composeGlobalSize = makeGlobalSize(globalSize);
|
|
16
|
-
console.log(123, horizontalSpacing);
|
|
17
16
|
return composeStyles({
|
|
18
17
|
...composeGlobalSize?.width?.['--w'] ? composeGlobalSize.width : {
|
|
19
18
|
'--w': '100%'
|
|
@@ -39,5 +38,11 @@ const composeFormCheckboxInputStyles = ()=>{
|
|
|
39
38
|
appearance: 'auto'
|
|
40
39
|
});
|
|
41
40
|
};
|
|
41
|
+
const getComposedTextStyle = (setting)=>{
|
|
42
|
+
const { horizontalSpacing } = setting ?? {};
|
|
43
|
+
return composeStyles({
|
|
44
|
+
...makeStyleResponsive('pl', horizontalSpacing)
|
|
45
|
+
});
|
|
46
|
+
};
|
|
42
47
|
|
|
43
|
-
export { composeContainerStyles, composeFormCheckboxInputStyles, composeFormCheckboxStyles };
|
|
48
|
+
export { composeContainerStyles, composeFormCheckboxInputStyles, composeFormCheckboxStyles, getComposedTextStyle };
|
|
@@ -57,12 +57,18 @@ const FormCheckboxSettings = [
|
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
id: 'horizontalSpacing',
|
|
60
|
-
type: 'input:unit',
|
|
61
60
|
units: [
|
|
62
61
|
'px'
|
|
63
62
|
],
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
type: 'input:slider',
|
|
64
|
+
step: 1,
|
|
65
|
+
min: 0,
|
|
66
|
+
max: 40,
|
|
67
|
+
devices: {
|
|
68
|
+
desktop: {
|
|
69
|
+
default: '4px'
|
|
70
|
+
}
|
|
71
|
+
}
|
|
66
72
|
},
|
|
67
73
|
{
|
|
68
74
|
id: 'align',
|
|
@@ -45,86 +45,83 @@ const SettingUIV2 = [
|
|
|
45
45
|
}
|
|
46
46
|
]
|
|
47
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
|
-
},
|
|
48
|
+
// {
|
|
49
|
+
// label: {
|
|
50
|
+
// en: 'Size',
|
|
51
|
+
// },
|
|
52
|
+
// controls: [
|
|
53
|
+
// {
|
|
54
|
+
// id: 'Width',
|
|
55
|
+
// label: {
|
|
56
|
+
// en: 'Width',
|
|
57
|
+
// },
|
|
58
|
+
// controlConfig: {
|
|
59
|
+
// id: 'width',
|
|
60
|
+
// type: 'dropdown:input',
|
|
61
|
+
// label: 'Width',
|
|
62
|
+
// inputType: 'number',
|
|
63
|
+
// units: ['px', '%'],
|
|
64
|
+
// hideUnit: false,
|
|
65
|
+
// linkWithSetting: {
|
|
66
|
+
// name: 'globalSize',
|
|
67
|
+
// field: 'width',
|
|
68
|
+
// },
|
|
69
|
+
// displayOptions: [
|
|
70
|
+
// {
|
|
71
|
+
// label: 'Fit content',
|
|
72
|
+
// value: 'Auto',
|
|
73
|
+
// showValue: true,
|
|
74
|
+
// },
|
|
75
|
+
// {
|
|
76
|
+
// label: 'Full',
|
|
77
|
+
// value: '100%',
|
|
78
|
+
// showValue: true,
|
|
79
|
+
// },
|
|
80
|
+
// {
|
|
81
|
+
// label: 'Small',
|
|
82
|
+
// value: '100px',
|
|
83
|
+
// showValue: true,
|
|
84
|
+
// },
|
|
85
|
+
// {
|
|
86
|
+
// label: 'Medium',
|
|
87
|
+
// value: '116px',
|
|
88
|
+
// showValue: true,
|
|
89
|
+
// },
|
|
90
|
+
// {
|
|
91
|
+
// label: 'Large',
|
|
92
|
+
// value: '132px',
|
|
93
|
+
// showValue: true,
|
|
94
|
+
// },
|
|
95
|
+
// ],
|
|
96
|
+
// },
|
|
97
|
+
// layout: 'horizontal',
|
|
98
|
+
// },
|
|
99
|
+
// {
|
|
100
|
+
// label: {
|
|
101
|
+
// en: 'Padding',
|
|
102
|
+
// },
|
|
103
|
+
// controlConfig: {
|
|
104
|
+
// id: 'padding',
|
|
105
|
+
// type: 'padding-v2',
|
|
106
|
+
// linkWithSetting: {
|
|
107
|
+
// name: 'globalSize',
|
|
108
|
+
// field: 'padding',
|
|
109
|
+
// },
|
|
110
|
+
// compoDefaultValue: {
|
|
111
|
+
// desktop: {
|
|
112
|
+
// default: {
|
|
113
|
+
// type: 'medium',
|
|
114
|
+
// top: '12px',
|
|
115
|
+
// bottom: '12px',
|
|
116
|
+
// left: '24px',
|
|
117
|
+
// right: '24px',
|
|
118
|
+
// },
|
|
119
|
+
// },
|
|
120
|
+
// },
|
|
121
|
+
// },
|
|
122
|
+
// },
|
|
123
|
+
// ],
|
|
124
|
+
// },
|
|
128
125
|
// {
|
|
129
126
|
// label: {
|
|
130
127
|
// en: 'Background',
|
|
@@ -42,10 +42,10 @@ const newsletterInitConfig = [
|
|
|
42
42
|
layout: {
|
|
43
43
|
desktop: {
|
|
44
44
|
cols: [
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
9,
|
|
46
|
+
3
|
|
47
47
|
],
|
|
48
|
-
display: '
|
|
48
|
+
display: 'fill'
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
horizontalAlign: {
|
|
@@ -131,6 +131,11 @@ const newsletterInitConfig = [
|
|
|
131
131
|
label: 'Send'
|
|
132
132
|
},
|
|
133
133
|
styles: {
|
|
134
|
+
globalSize: {
|
|
135
|
+
desktop: {
|
|
136
|
+
width: '100%'
|
|
137
|
+
}
|
|
138
|
+
},
|
|
134
139
|
borderBtn: {
|
|
135
140
|
normal: {
|
|
136
141
|
borderType: 'none',
|
|
@@ -156,6 +161,31 @@ const newsletterInitConfig = [
|
|
|
156
161
|
radiusType: 'none'
|
|
157
162
|
}
|
|
158
163
|
}
|
|
164
|
+
},
|
|
165
|
+
advanced: {
|
|
166
|
+
border: {
|
|
167
|
+
desktop: {
|
|
168
|
+
normal: {
|
|
169
|
+
borderType: 'style-2',
|
|
170
|
+
borderLabel: 'Style 2',
|
|
171
|
+
border: 'solid',
|
|
172
|
+
color: 'line-2',
|
|
173
|
+
isCustom: false,
|
|
174
|
+
width: '1px 1px 1px 1px'
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
rounded: {
|
|
179
|
+
desktop: {
|
|
180
|
+
normal: {
|
|
181
|
+
btrr: '0px',
|
|
182
|
+
bblr: '0px',
|
|
183
|
+
bbrr: '0px',
|
|
184
|
+
btlr: '0px',
|
|
185
|
+
radiusType: 'none'
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
159
189
|
}
|
|
160
190
|
}
|
|
161
191
|
]
|
|
@@ -29,12 +29,6 @@ const NewsletterSettings = [
|
|
|
29
29
|
type: 'stay-on-page',
|
|
30
30
|
link: '',
|
|
31
31
|
target: '_self'
|
|
32
|
-
},
|
|
33
|
-
hiddenOptions: {
|
|
34
|
-
'scroll-to': true,
|
|
35
|
-
'open-popup': true,
|
|
36
|
-
'send-email': true,
|
|
37
|
-
'call-phone': true
|
|
38
32
|
}
|
|
39
33
|
},
|
|
40
34
|
{
|
|
@@ -155,14 +149,7 @@ const NewsletterSettings = [
|
|
|
155
149
|
desktop: {
|
|
156
150
|
default: {
|
|
157
151
|
width: '480px',
|
|
158
|
-
height: 'Auto'
|
|
159
|
-
padding: {
|
|
160
|
-
type: 'medium',
|
|
161
|
-
top: '12px',
|
|
162
|
-
bottom: '12px',
|
|
163
|
-
left: '24px',
|
|
164
|
-
right: '24px'
|
|
165
|
-
}
|
|
152
|
+
height: 'Auto'
|
|
166
153
|
}
|
|
167
154
|
}
|
|
168
155
|
},
|
|
@@ -254,31 +241,7 @@ const NewsletterSettings = [
|
|
|
254
241
|
},
|
|
255
242
|
{
|
|
256
243
|
id: 'boxShadow',
|
|
257
|
-
type: 'shadow-v2'
|
|
258
|
-
devices: {
|
|
259
|
-
desktop: {
|
|
260
|
-
default: {
|
|
261
|
-
type: 'shadow-2',
|
|
262
|
-
distance: '12px',
|
|
263
|
-
blur: '12px',
|
|
264
|
-
spread: '0px',
|
|
265
|
-
color: 'rgba(18, 18, 18, 0.2)',
|
|
266
|
-
angle: 45
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
},
|
|
270
|
-
compoDefaultValue: {
|
|
271
|
-
desktop: {
|
|
272
|
-
default: {
|
|
273
|
-
type: 'shadow-2',
|
|
274
|
-
distance: '12px',
|
|
275
|
-
blur: '12px',
|
|
276
|
-
spread: '0px',
|
|
277
|
-
color: 'rgba(18, 18, 18, 0.2)',
|
|
278
|
-
angle: 45
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
}
|
|
244
|
+
type: 'shadow-v2'
|
|
282
245
|
}
|
|
283
246
|
]
|
|
284
247
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { useEditorMode, isEmptyChildren } from '@gem-sdk/core';
|
|
4
4
|
import { isValidElement } from 'react';
|
|
5
|
-
import Loading from '../../../../common/components/Loading.js';
|
|
6
5
|
import NoDataState from '../../../../common/components/NoDataState.js';
|
|
7
6
|
import { createClass, createStyle, If } from '@gem-sdk/system';
|
|
8
7
|
import { getSizeSettings, getContainerStyles } from '../common/styles.js';
|
|
@@ -13,19 +12,13 @@ import ProductBundleDiscountChildrenItem from './ProductBundleDiscountChildrenIt
|
|
|
13
12
|
|
|
14
13
|
const ProductBundleDiscount = ({ builderAttrs, style, children, setting, styles, advanced })=>{
|
|
15
14
|
const mode = useEditorMode();
|
|
16
|
-
const {
|
|
15
|
+
const { isSelected, setSelected } = useProductBundleDiscountState(setting);
|
|
17
16
|
const { emitRedirectSetupPage, redirectGuideline, svg } = useProductBundleDataState();
|
|
18
17
|
const composeContainerClasses = createClass(getContainerClasses(setting, advanced?.cssClass));
|
|
19
18
|
const composeNoDiscountClasses = createClass(getNoDiscountClasses);
|
|
20
19
|
const composeSizeStyles = createStyle(getSizeSettings(styles)?.gap);
|
|
21
20
|
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') {
|
|
21
|
+
if (!setting?.bundleItems?.length && mode === 'edit') {
|
|
29
22
|
return /*#__PURE__*/ jsx(NoDataState, {
|
|
30
23
|
elementType: "secondary",
|
|
31
24
|
description: "Increase AOV with bundle quantity.",
|
|
@@ -43,7 +36,7 @@ const ProductBundleDiscount = ({ builderAttrs, style, children, setting, styles,
|
|
|
43
36
|
});
|
|
44
37
|
}
|
|
45
38
|
const renderBundleItem = (item, i)=>{
|
|
46
|
-
if (setting
|
|
39
|
+
if (setting?.hideNoDiscountItem && item?.discountType === 'no_discount') {
|
|
47
40
|
return null;
|
|
48
41
|
}
|
|
49
42
|
const childItem = children?.[i];
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1453,7 +1453,7 @@ type FormCheckboxSetting = {
|
|
|
1453
1453
|
translate?: string;
|
|
1454
1454
|
required?: boolean;
|
|
1455
1455
|
selected?: boolean;
|
|
1456
|
-
horizontalSpacing?: Property.Padding
|
|
1456
|
+
horizontalSpacing?: ObjectDevices$1<Property.Padding>;
|
|
1457
1457
|
/**
|
|
1458
1458
|
* @deprecated please use `typo` instead
|
|
1459
1459
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/components",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.434",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@gem-sdk/core": "2.0.0-dev.431",
|
|
27
27
|
"@gem-sdk/styles": "2.0.0-dev.381",
|
|
28
|
-
"@gem-sdk/system": "2.0.0-dev.
|
|
28
|
+
"@gem-sdk/system": "2.0.0-dev.433",
|
|
29
29
|
"@types/react-transition-group": "^4.4.5"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|