@gem-sdk/components 2.0.0-dev.457 → 2.0.0-dev.460
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/breadcrumb/components/Breadcrumb.js +1 -0
- package/dist/cjs/breadcrumb/components/Breadcrumb.liquid.js +1 -0
- package/dist/cjs/breadcrumb/setting/configs/settings.js +29 -2
- package/dist/cjs/breadcrumb/setting/configs/uiV2.js +230 -114
- package/dist/cjs/button/setting/configs/settings.js +2 -1
- package/dist/cjs/coupon/common/classes.js +16 -2
- package/dist/cjs/coupon/common/index.js +2 -2
- package/dist/cjs/coupon/common/styles.js +44 -26
- package/dist/cjs/coupon/components/Coupon.js +3 -6
- package/dist/cjs/coupon/components/Coupon.liquid.js +4 -7
- package/dist/cjs/coupon/setting/config/settings.js +194 -131
- package/dist/cjs/coupon/setting/config/uiV2.js +349 -142
- package/dist/cjs/product/components/FileUpload/components/config/uiV2.js +15 -0
- package/dist/cjs/product/setting/product/configs/settings.js +1 -1
- package/dist/cjs/sticky/components/Sticky.js +0 -2
- package/dist/cjs/sticky/components/Sticky.liquid.js +1 -2
- package/dist/esm/breadcrumb/components/Breadcrumb.js +2 -1
- package/dist/esm/breadcrumb/components/Breadcrumb.liquid.js +2 -1
- package/dist/esm/breadcrumb/setting/configs/settings.js +29 -2
- package/dist/esm/breadcrumb/setting/configs/uiV2.js +230 -114
- package/dist/esm/button/setting/configs/settings.js +2 -1
- package/dist/esm/coupon/common/classes.js +16 -2
- package/dist/esm/coupon/common/index.js +2 -2
- package/dist/esm/coupon/common/styles.js +45 -26
- package/dist/esm/coupon/components/Coupon.js +5 -8
- package/dist/esm/coupon/components/Coupon.liquid.js +6 -9
- package/dist/esm/coupon/setting/config/settings.js +194 -131
- package/dist/esm/coupon/setting/config/uiV2.js +349 -142
- package/dist/esm/product/components/FileUpload/components/config/uiV2.js +15 -0
- package/dist/esm/product/setting/product/configs/settings.js +1 -1
- package/dist/esm/sticky/components/Sticky.js +2 -4
- package/dist/esm/sticky/components/Sticky.liquid.js +1 -2
- package/dist/types/index.d.ts +1 -0
- package/package.json +2 -2
|
@@ -14,7 +14,6 @@ var system = require('@gem-sdk/system');
|
|
|
14
14
|
var styles = require('./common/styles.js');
|
|
15
15
|
|
|
16
16
|
const Sticky = ({ children, builderAttrs, setting, style, builderProps })=>{
|
|
17
|
-
const mode = core.useEditorMode();
|
|
18
17
|
const { background, preloadBgImage } = setting ?? {};
|
|
19
18
|
const { w, positionStyle, displayStyle, getCSSAlign } = useSticky.default(setting);
|
|
20
19
|
const computedContainerStyles = system.createStyle({
|
|
@@ -22,7 +21,6 @@ const Sticky = ({ children, builderAttrs, setting, style, builderProps })=>{
|
|
|
22
21
|
...w,
|
|
23
22
|
...displayStyle,
|
|
24
23
|
...styles.getStylePadding(style),
|
|
25
|
-
...mode !== 'edit' && setting?.isScrollToTop ? styles.displayConditionStyle(setting?.display, setting?.position) : {},
|
|
26
24
|
...positionStyle,
|
|
27
25
|
...getCSSAlign,
|
|
28
26
|
zIndex: _const.ELEMENT_Z_INDEX.STICKY
|
|
@@ -19,8 +19,7 @@ const Sticky = ({ children, builderAttrs, setting, style, builderProps, advanced
|
|
|
19
19
|
const createDataState = system.createStateOrContext({
|
|
20
20
|
uid: builderProps?.uid,
|
|
21
21
|
setting: {
|
|
22
|
-
display
|
|
23
|
-
isScrollToTop
|
|
22
|
+
display
|
|
24
23
|
},
|
|
25
24
|
advanced: {
|
|
26
25
|
d: advancedDisplay
|
|
@@ -7,7 +7,7 @@ import { createAttr, createStyle, createClass } from '@gem-sdk/system';
|
|
|
7
7
|
import { getAttr, getNavAttr } from './common/attr.js';
|
|
8
8
|
import { getBreadcrumbStyles, getSpacingStyles } from './common/style.js';
|
|
9
9
|
import { getBreadcrumbClasses, getNavClasses } from './common/classes.js';
|
|
10
|
-
import { makeStyleResponsive } from '@gem-sdk/core';
|
|
10
|
+
import { makeGlobalSize, makeStyleResponsive } from '@gem-sdk/core';
|
|
11
11
|
|
|
12
12
|
const Breadcrumb = ({ className, setting = {}, style, styles = {}, builderAttrs, builderProps })=>{
|
|
13
13
|
const { background, align } = setting || {};
|
|
@@ -51,6 +51,7 @@ const Breadcrumb = ({ className, setting = {}, style, styles = {}, builderAttrs,
|
|
|
51
51
|
...getNavAttr()
|
|
52
52
|
});
|
|
53
53
|
const navStyles = createStyle({
|
|
54
|
+
...makeGlobalSize(setting?.globalSize).padding,
|
|
54
55
|
...getSpacingStyles(setting?.spacing),
|
|
55
56
|
...makeStyleResponsive('jc', align)
|
|
56
57
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { makeStyleResponsive, template } from '@gem-sdk/core';
|
|
1
|
+
import { makeGlobalSize, makeStyleResponsive, template } from '@gem-sdk/core';
|
|
2
2
|
import { createAttr, createClass, createStyle, Liquid, LiquidUnless } from '@gem-sdk/system';
|
|
3
3
|
import { BreadcrumbItem } from './BreadcrumbItem.liquid.js';
|
|
4
4
|
import { getAttr, getNavAttr } from './common/attr.js';
|
|
@@ -45,6 +45,7 @@ const Breadcrumb = ({ setting = {}, builderAttrs, style, styles = {}, className,
|
|
|
45
45
|
...getNavAttr()
|
|
46
46
|
});
|
|
47
47
|
const navStyles = createStyle({
|
|
48
|
+
...makeGlobalSize(setting?.globalSize).padding,
|
|
48
49
|
...getSpacingStyles(spacing),
|
|
49
50
|
...makeStyleResponsive('jc', align)
|
|
50
51
|
});
|
|
@@ -2,6 +2,31 @@ const BreadcrumbSettings = [
|
|
|
2
2
|
{
|
|
3
3
|
id: 'setting',
|
|
4
4
|
controls: [
|
|
5
|
+
{
|
|
6
|
+
id: 'globalSize',
|
|
7
|
+
type: 'size-setting',
|
|
8
|
+
devices: {
|
|
9
|
+
desktop: {
|
|
10
|
+
default: {
|
|
11
|
+
width: 'Auto',
|
|
12
|
+
height: 'Auto',
|
|
13
|
+
padding: {
|
|
14
|
+
type: 'custom',
|
|
15
|
+
top: '4px',
|
|
16
|
+
bottom: '4px',
|
|
17
|
+
left: '16px',
|
|
18
|
+
right: '16px'
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
hiddenSettings: [
|
|
24
|
+
'shape',
|
|
25
|
+
'gap',
|
|
26
|
+
'width',
|
|
27
|
+
'height'
|
|
28
|
+
]
|
|
29
|
+
},
|
|
5
30
|
{
|
|
6
31
|
id: 'hideCurrentPage',
|
|
7
32
|
type: 'toggle',
|
|
@@ -35,10 +60,12 @@ const BreadcrumbSettings = [
|
|
|
35
60
|
{
|
|
36
61
|
id: 'spacing',
|
|
37
62
|
label: 'Spacing',
|
|
38
|
-
type: 'input:
|
|
63
|
+
type: 'input:slider',
|
|
39
64
|
units: [
|
|
40
65
|
'px'
|
|
41
66
|
],
|
|
67
|
+
step: 1,
|
|
68
|
+
max: 40,
|
|
42
69
|
devices: {
|
|
43
70
|
desktop: {
|
|
44
71
|
default: '4px'
|
|
@@ -178,7 +205,7 @@ const BreadcrumbSettings = [
|
|
|
178
205
|
id: 'color',
|
|
179
206
|
type: 'color-picker-v2',
|
|
180
207
|
label: 'Color',
|
|
181
|
-
default: '
|
|
208
|
+
default: 'text-1'
|
|
182
209
|
}
|
|
183
210
|
]
|
|
184
211
|
},
|
|
@@ -1,204 +1,320 @@
|
|
|
1
1
|
const SettingUIV2 = [
|
|
2
2
|
{
|
|
3
|
+
label: {
|
|
4
|
+
en: 'Separator Icon'
|
|
5
|
+
},
|
|
3
6
|
controls: [
|
|
4
7
|
{
|
|
5
8
|
label: {
|
|
6
|
-
en: '
|
|
9
|
+
en: 'Icon'
|
|
7
10
|
},
|
|
8
11
|
setting: {
|
|
9
|
-
id: '
|
|
12
|
+
id: 'iconSvg'
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
label: {
|
|
17
|
+
en: 'Color'
|
|
10
18
|
},
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
19
|
+
setting: {
|
|
20
|
+
id: 'color'
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
label: {
|
|
25
|
+
en: 'Size'
|
|
26
|
+
},
|
|
27
|
+
setting: {
|
|
28
|
+
id: 'iconWidth'
|
|
14
29
|
}
|
|
15
30
|
}
|
|
16
31
|
]
|
|
17
32
|
},
|
|
18
33
|
{
|
|
19
34
|
label: {
|
|
20
|
-
en: '
|
|
35
|
+
en: 'Text style'
|
|
21
36
|
},
|
|
22
37
|
controls: [
|
|
23
38
|
{
|
|
24
|
-
|
|
25
|
-
|
|
39
|
+
setting: {
|
|
40
|
+
id: 'typo'
|
|
26
41
|
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
id: 'typo'
|
|
42
|
+
layout: 'vertical',
|
|
43
|
+
options: {
|
|
44
|
+
updateFields: [
|
|
45
|
+
{
|
|
46
|
+
field: 'attrs.color',
|
|
47
|
+
settingId: 'labelColor',
|
|
48
|
+
state: 'normal'
|
|
35
49
|
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
{
|
|
51
|
+
field: 'custom.fontWeight',
|
|
52
|
+
settingId: 'fontWeight',
|
|
53
|
+
state: 'normal'
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
controlChangeTrigger: {
|
|
58
|
+
settings: [
|
|
59
|
+
{
|
|
60
|
+
action: {
|
|
61
|
+
controlId: 'labelColor',
|
|
62
|
+
valueFromField: 'attrs.color',
|
|
63
|
+
groupType: 'setting',
|
|
64
|
+
controlType: 'setting',
|
|
65
|
+
removeDevice: true,
|
|
66
|
+
state: 'normal'
|
|
67
|
+
}
|
|
50
68
|
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
removeDevice: true,
|
|
60
|
-
state: 'normal'
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
action: {
|
|
65
|
-
controlId: 'fontWeight',
|
|
66
|
-
valueFromField: 'custom.fontWeight',
|
|
67
|
-
groupType: 'setting',
|
|
68
|
-
controlType: 'setting',
|
|
69
|
-
removeDevice: true,
|
|
70
|
-
state: 'normal'
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
],
|
|
74
|
-
options: {
|
|
75
|
-
noRecordHistory: true
|
|
69
|
+
{
|
|
70
|
+
action: {
|
|
71
|
+
controlId: 'fontWeight',
|
|
72
|
+
valueFromField: 'custom.fontWeight',
|
|
73
|
+
groupType: 'setting',
|
|
74
|
+
controlType: 'setting',
|
|
75
|
+
removeDevice: true,
|
|
76
|
+
state: 'normal'
|
|
76
77
|
}
|
|
77
78
|
}
|
|
79
|
+
],
|
|
80
|
+
options: {
|
|
81
|
+
noRecordHistory: true
|
|
78
82
|
}
|
|
79
|
-
|
|
80
|
-
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
label: {
|
|
89
|
+
en: 'Item spacing'
|
|
90
|
+
},
|
|
91
|
+
controls: [
|
|
81
92
|
{
|
|
82
93
|
label: {
|
|
83
|
-
en: '
|
|
94
|
+
en: 'Gap'
|
|
84
95
|
},
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
96
|
+
setting: {
|
|
97
|
+
id: 'spacing'
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
label: {
|
|
104
|
+
en: 'Size'
|
|
105
|
+
},
|
|
106
|
+
controls: [
|
|
107
|
+
{
|
|
108
|
+
label: {
|
|
109
|
+
en: 'Padding'
|
|
91
110
|
},
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
id: 'labelColor',
|
|
99
|
-
state: 'hover'
|
|
100
|
-
}
|
|
111
|
+
controlConfig: {
|
|
112
|
+
id: 'padding',
|
|
113
|
+
type: 'padding-v2',
|
|
114
|
+
linkWithSetting: {
|
|
115
|
+
name: 'globalSize',
|
|
116
|
+
field: 'padding'
|
|
101
117
|
},
|
|
102
|
-
{
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
118
|
+
compoDefaultValue: {
|
|
119
|
+
desktop: {
|
|
120
|
+
default: {
|
|
121
|
+
type: 'custom',
|
|
122
|
+
top: '4px',
|
|
123
|
+
bottom: '4px',
|
|
124
|
+
left: '16px',
|
|
125
|
+
right: '16px'
|
|
126
|
+
}
|
|
109
127
|
}
|
|
110
128
|
}
|
|
111
|
-
|
|
129
|
+
}
|
|
112
130
|
}
|
|
113
131
|
]
|
|
114
132
|
},
|
|
115
133
|
{
|
|
116
134
|
label: {
|
|
117
|
-
en: '
|
|
135
|
+
en: 'Background'
|
|
118
136
|
},
|
|
119
137
|
controls: [
|
|
120
138
|
{
|
|
121
139
|
label: {
|
|
122
|
-
en: '
|
|
140
|
+
en: 'Color'
|
|
123
141
|
},
|
|
124
|
-
|
|
125
|
-
id: '
|
|
142
|
+
controlConfig: {
|
|
143
|
+
id: 'background-color',
|
|
144
|
+
type: 'color-picker-v2',
|
|
145
|
+
linkWithSetting: {
|
|
146
|
+
name: 'background',
|
|
147
|
+
field: 'color'
|
|
148
|
+
},
|
|
149
|
+
compoDefaultValue: {
|
|
150
|
+
desktop: {
|
|
151
|
+
default: '#ffffff'
|
|
152
|
+
}
|
|
153
|
+
}
|
|
126
154
|
}
|
|
127
155
|
}
|
|
128
156
|
]
|
|
129
157
|
},
|
|
130
158
|
{
|
|
131
159
|
label: {
|
|
132
|
-
en: '
|
|
160
|
+
en: 'Shape'
|
|
133
161
|
},
|
|
134
162
|
controls: [
|
|
135
163
|
{
|
|
136
164
|
label: {
|
|
137
|
-
en: '
|
|
165
|
+
en: 'Border'
|
|
138
166
|
},
|
|
139
167
|
setting: {
|
|
140
|
-
id: '
|
|
168
|
+
id: 'border',
|
|
169
|
+
state: 'normal'
|
|
141
170
|
}
|
|
142
171
|
},
|
|
143
172
|
{
|
|
144
173
|
label: {
|
|
145
|
-
en: '
|
|
174
|
+
en: 'Corner'
|
|
146
175
|
},
|
|
147
176
|
setting: {
|
|
148
|
-
id: '
|
|
177
|
+
id: 'rounded',
|
|
178
|
+
state: 'normal'
|
|
149
179
|
}
|
|
150
180
|
},
|
|
151
181
|
{
|
|
152
182
|
label: {
|
|
153
|
-
en: '
|
|
183
|
+
en: 'Shadow'
|
|
154
184
|
},
|
|
155
185
|
setting: {
|
|
156
|
-
id: '
|
|
186
|
+
id: 'boxShadow',
|
|
187
|
+
state: 'normal'
|
|
188
|
+
},
|
|
189
|
+
options: {
|
|
190
|
+
updateFields: [
|
|
191
|
+
{
|
|
192
|
+
field: 'enable',
|
|
193
|
+
settingId: 'hasBoxShadow',
|
|
194
|
+
state: 'normal'
|
|
195
|
+
}
|
|
196
|
+
]
|
|
197
|
+
},
|
|
198
|
+
controlChangeTrigger: {
|
|
199
|
+
settings: [
|
|
200
|
+
{
|
|
201
|
+
condition: `boxShadow.normal.enable === true`,
|
|
202
|
+
source: [
|
|
203
|
+
'boxShadow',
|
|
204
|
+
'hasBoxShadow'
|
|
205
|
+
],
|
|
206
|
+
action: {
|
|
207
|
+
controlId: 'hasBoxShadow',
|
|
208
|
+
groupType: 'advanced',
|
|
209
|
+
controlType: 'advanced',
|
|
210
|
+
state: 'normal',
|
|
211
|
+
newValue: true
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
condition: `boxShadow.normal.enable === false`,
|
|
216
|
+
source: [
|
|
217
|
+
'boxShadow',
|
|
218
|
+
'hasBoxShadow'
|
|
219
|
+
],
|
|
220
|
+
action: {
|
|
221
|
+
controlId: 'hasBoxShadow',
|
|
222
|
+
groupType: 'advanced',
|
|
223
|
+
controlType: 'advanced',
|
|
224
|
+
state: 'normal',
|
|
225
|
+
newValue: false
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
],
|
|
229
|
+
options: {
|
|
230
|
+
noRecordHistory: true
|
|
231
|
+
}
|
|
157
232
|
}
|
|
158
233
|
}
|
|
159
234
|
]
|
|
160
235
|
},
|
|
161
236
|
{
|
|
162
237
|
label: {
|
|
163
|
-
en: '
|
|
238
|
+
en: 'Effect'
|
|
164
239
|
},
|
|
165
240
|
controls: [
|
|
166
241
|
{
|
|
167
242
|
label: {
|
|
168
|
-
en: '
|
|
243
|
+
en: 'Hover'
|
|
169
244
|
},
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
245
|
+
type: 'combo',
|
|
246
|
+
iconName: 'polaris-check-hover',
|
|
247
|
+
fixedValue: 'Enabled',
|
|
248
|
+
isHideClear: true,
|
|
249
|
+
popoverLabel: {
|
|
250
|
+
en: 'Hover'
|
|
251
|
+
},
|
|
252
|
+
controls: [
|
|
253
|
+
{
|
|
254
|
+
label: {
|
|
255
|
+
en: 'Text color'
|
|
256
|
+
},
|
|
257
|
+
setting: {
|
|
258
|
+
id: 'labelColor',
|
|
259
|
+
state: 'hover'
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
label: {
|
|
264
|
+
en: 'Font weight'
|
|
265
|
+
},
|
|
266
|
+
setting: {
|
|
267
|
+
id: 'fontWeight',
|
|
268
|
+
state: 'hover'
|
|
269
|
+
}
|
|
176
270
|
}
|
|
177
|
-
|
|
271
|
+
]
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
label: {
|
|
275
|
+
en: 'Active'
|
|
276
|
+
},
|
|
277
|
+
type: 'combo',
|
|
278
|
+
iconName: 'polaris-status-active',
|
|
279
|
+
fixedValue: 'Enabled',
|
|
280
|
+
isHideClear: true,
|
|
281
|
+
popoverLabel: {
|
|
282
|
+
en: 'Active'
|
|
283
|
+
},
|
|
284
|
+
controls: [
|
|
285
|
+
{
|
|
286
|
+
label: {
|
|
287
|
+
en: 'Text color'
|
|
288
|
+
},
|
|
289
|
+
setting: {
|
|
290
|
+
id: 'labelColor',
|
|
291
|
+
state: 'active'
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
label: {
|
|
296
|
+
en: 'Font weight'
|
|
297
|
+
},
|
|
298
|
+
setting: {
|
|
299
|
+
id: 'fontWeight',
|
|
300
|
+
state: 'active'
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
]
|
|
178
304
|
}
|
|
179
305
|
]
|
|
180
306
|
},
|
|
181
307
|
{
|
|
182
308
|
label: {
|
|
183
|
-
en: '
|
|
309
|
+
en: 'Display option'
|
|
184
310
|
},
|
|
185
311
|
controls: [
|
|
186
312
|
{
|
|
187
313
|
label: {
|
|
188
|
-
en: '
|
|
314
|
+
en: 'Current page'
|
|
189
315
|
},
|
|
190
316
|
setting: {
|
|
191
|
-
id: '
|
|
192
|
-
state: 'active'
|
|
193
|
-
}
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
label: {
|
|
197
|
-
en: 'Font weight'
|
|
198
|
-
},
|
|
199
|
-
setting: {
|
|
200
|
-
id: 'fontWeight',
|
|
201
|
-
state: 'active'
|
|
317
|
+
id: 'hideCurrentPage'
|
|
202
318
|
}
|
|
203
319
|
}
|
|
204
320
|
]
|
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
import { composeClasses, cls } from '@gem-sdk/core';
|
|
2
2
|
|
|
3
|
-
const getActiveClasses = (
|
|
4
|
-
|
|
3
|
+
const getActiveClasses = (backgroundColor, text)=>{
|
|
4
|
+
const breakpoints = {
|
|
5
|
+
desktop: '',
|
|
6
|
+
tablet: 'tablet:',
|
|
7
|
+
mobile: 'mobile:'
|
|
8
|
+
};
|
|
9
|
+
const generateClass = (type, device, value)=>value ? `${breakpoints[device]}[_&button]:data-[active=true]:!gp-${type}-[${value}]` : '';
|
|
10
|
+
const classes = [
|
|
11
|
+
generateClass('bg', 'desktop', backgroundColor?.desktop?.active),
|
|
12
|
+
generateClass('bg', 'tablet', backgroundColor?.tablet?.active),
|
|
13
|
+
generateClass('bg', 'mobile', backgroundColor?.mobile?.active),
|
|
14
|
+
generateClass('text', 'desktop', text?.desktop?.active),
|
|
15
|
+
generateClass('text', 'tablet', text?.tablet?.active),
|
|
16
|
+
generateClass('text', 'mobile', text?.mobile?.active)
|
|
17
|
+
].filter(Boolean).join(' ');
|
|
18
|
+
return composeClasses(cls('gp-coupon', classes));
|
|
5
19
|
};
|
|
6
20
|
|
|
7
21
|
export { getActiveClasses };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const getButtonSetting = (setting, label, htmlType)=>{
|
|
2
|
-
const { iconSvg, iconAlign, couponLayout, translate, shouldClearSpace } = setting ?? {};
|
|
2
|
+
const { iconSvg, iconAlign, couponLayout, translate, shouldClearSpace, iconVisible } = setting ?? {};
|
|
3
3
|
return {
|
|
4
4
|
label,
|
|
5
5
|
htmlType,
|
|
6
6
|
iconAlign,
|
|
7
7
|
iconSvg,
|
|
8
|
-
iconVisible: couponLayout === 'icon',
|
|
8
|
+
iconVisible: couponLayout === 'icon' && iconVisible,
|
|
9
9
|
translate,
|
|
10
10
|
shouldClearSpace
|
|
11
11
|
};
|