@gem-sdk/components 2.0.0-dev.541 → 2.0.0-dev.543
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/collection/components/collection-description/common/classes.js +12 -0
- package/dist/cjs/collection/components/collection-description/common/styles.js +9 -2
- package/dist/cjs/collection/components/collection-description/components/CollectionDescription.js +11 -13
- package/dist/cjs/collection/components/collection-description/components/CollectionDescription.liquid.js +10 -10
- package/dist/cjs/collection/components/collection-description/hook/useDescription.js +8 -43
- package/dist/cjs/product/components/ProductBundle/setting/uiV2.js +25 -328
- package/dist/esm/collection/components/collection-description/common/classes.js +10 -1
- package/dist/esm/collection/components/collection-description/common/styles.js +9 -2
- package/dist/esm/collection/components/collection-description/components/CollectionDescription.js +12 -14
- package/dist/esm/collection/components/collection-description/components/CollectionDescription.liquid.js +11 -11
- package/dist/esm/collection/components/collection-description/hook/useDescription.js +10 -45
- package/dist/esm/product/components/ProductBundle/setting/uiV2.js +25 -328
- package/package.json +1 -1
|
@@ -10,6 +10,15 @@ const getClassButtonViewMore = ({ setting })=>{
|
|
|
10
10
|
const appendTypoClass = core.composeTypographyClassName(setting?.typo, setting?.typography);
|
|
11
11
|
return composeClasses(core.cls('p-description-show-more', 'gp-mt-4 hover:gp-opacity-80 gp-transition-all gp-w-full', appendTypoClass, core.getGlobalColorClass('text', setting?.showMoreColor)));
|
|
12
12
|
};
|
|
13
|
+
const getDescriptionClasses = ({ advanced })=>{
|
|
14
|
+
return composeClasses(core.cls('gp-collection-description', advanced?.cssClass));
|
|
15
|
+
};
|
|
16
|
+
const getShowMoreIconClasses = ()=>{
|
|
17
|
+
return composeClasses(core.cls('gp-show-more-icon gp-ml-1'));
|
|
18
|
+
};
|
|
19
|
+
const getShowMoreTextClasses = ()=>{
|
|
20
|
+
return composeClasses(core.cls('gp-show-more-text'));
|
|
21
|
+
};
|
|
13
22
|
const composeClasses = (classes)=>{
|
|
14
23
|
return classes.trim().split(/\s+/).reduce((acc, className)=>{
|
|
15
24
|
acc[className] = true;
|
|
@@ -19,3 +28,6 @@ const composeClasses = (classes)=>{
|
|
|
19
28
|
|
|
20
29
|
exports.getClassButtonViewMore = getClassButtonViewMore;
|
|
21
30
|
exports.getClassContainerCollectionDes = getClassContainerCollectionDes;
|
|
31
|
+
exports.getDescriptionClasses = getDescriptionClasses;
|
|
32
|
+
exports.getShowMoreIconClasses = getShowMoreIconClasses;
|
|
33
|
+
exports.getShowMoreTextClasses = getShowMoreTextClasses;
|
|
@@ -43,13 +43,20 @@ const getDefaultStyleCollectionDes = ({ setting, renderMaxHeight })=>{
|
|
|
43
43
|
};
|
|
44
44
|
const getStyleDefaultViewMore = (setting)=>{
|
|
45
45
|
const appendTypoStyle = core.composeTypographyStyle(setting?.typo, setting?.typography);
|
|
46
|
+
const getDisplayCollapse = ()=>{
|
|
47
|
+
return helpers.getDisplayStyle((device)=>{
|
|
48
|
+
const hasClamp = setting?.hasLineClamp?.[device];
|
|
49
|
+
return !!setting?.hasLineClamp && hasClamp !== undefined && !hasClamp;
|
|
50
|
+
}, 'inline-flex');
|
|
51
|
+
};
|
|
46
52
|
return {
|
|
47
53
|
...core.makeStyle({
|
|
48
54
|
tt: setting?.transform
|
|
49
55
|
}),
|
|
50
|
-
...core.makeStyleResponsive('
|
|
56
|
+
...core.makeStyleResponsive('jc', setting?.textAlign),
|
|
51
57
|
...appendTypoStyle,
|
|
52
|
-
...core.getGlobalColorStyle(setting?.showMoreColor)
|
|
58
|
+
...core.getGlobalColorStyle(setting?.showMoreColor),
|
|
59
|
+
...getDisplayCollapse()
|
|
53
60
|
};
|
|
54
61
|
};
|
|
55
62
|
const getDisplayCollapse = (setting)=>{
|
package/dist/cjs/collection/components/collection-description/components/CollectionDescription.js
CHANGED
|
@@ -22,17 +22,12 @@ const CollectionDescription = ({ setting, builderProps, pageContext, advanced })
|
|
|
22
22
|
const classButtonViewMore = system.createClass(classes.getClassButtonViewMore({
|
|
23
23
|
setting
|
|
24
24
|
}));
|
|
25
|
-
const gpDescriptionClasses = system.createClass({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
...open ? {
|
|
32
|
-
'gp-rotate-180': true
|
|
33
|
-
} : {}
|
|
34
|
-
});
|
|
35
|
-
const collapseStyle = system.createStyle({
|
|
25
|
+
const gpDescriptionClasses = system.createClass(classes.getDescriptionClasses({
|
|
26
|
+
advanced
|
|
27
|
+
}));
|
|
28
|
+
const showMoreIconClasses = system.createClass(classes.getShowMoreIconClasses());
|
|
29
|
+
const showMoreTextClasses = system.createClass(classes.getShowMoreTextClasses());
|
|
30
|
+
const textStyle = system.createStyle({
|
|
36
31
|
...styles.getDefaultStyleCollectionDes({
|
|
37
32
|
setting
|
|
38
33
|
}),
|
|
@@ -74,7 +69,7 @@ const CollectionDescription = ({ setting, builderProps, pageContext, advanced })
|
|
|
74
69
|
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
75
70
|
ref: ref,
|
|
76
71
|
className: classContainerCollectionDes,
|
|
77
|
-
style:
|
|
72
|
+
style: textStyle,
|
|
78
73
|
dangerouslySetInnerHTML: {
|
|
79
74
|
__html: collection?.descriptionHtml ?? ''
|
|
80
75
|
},
|
|
@@ -86,7 +81,10 @@ const CollectionDescription = ({ setting, builderProps, pageContext, advanced })
|
|
|
86
81
|
style: styleViewMore,
|
|
87
82
|
onClick: handleToggleShowMore,
|
|
88
83
|
children: [
|
|
89
|
-
|
|
84
|
+
/*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
85
|
+
className: showMoreTextClasses,
|
|
86
|
+
children: system.If(open, viewLessText?.toString() ?? '', viewMoreText?.toString() ?? '')
|
|
87
|
+
}),
|
|
90
88
|
system.If(setting?.enableViewMoreIcon, /*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
91
89
|
className: showMoreIconClasses,
|
|
92
90
|
dangerouslySetInnerHTML: {
|
|
@@ -18,14 +18,12 @@ const CollectionDescription = ({ setting, advanced, builderProps, pageContext })
|
|
|
18
18
|
const classButtonViewMore = system.createClass(classes.getClassButtonViewMore({
|
|
19
19
|
setting
|
|
20
20
|
}));
|
|
21
|
-
const gpDescriptionClasses = system.createClass({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
});
|
|
28
|
-
const collapseStyle = system.createStyle({
|
|
21
|
+
const gpDescriptionClasses = system.createClass(classes.getDescriptionClasses({
|
|
22
|
+
advanced
|
|
23
|
+
}));
|
|
24
|
+
const showMoreIconClasses = system.createClass(classes.getShowMoreIconClasses());
|
|
25
|
+
const showMoreTextClasses = system.createClass(classes.getShowMoreTextClasses());
|
|
26
|
+
const textStyle = system.createStyle({
|
|
29
27
|
...styles.getDefaultStyleCollectionDes({
|
|
30
28
|
setting,
|
|
31
29
|
renderMaxHeight: true
|
|
@@ -67,7 +65,7 @@ const CollectionDescription = ({ setting, advanced, builderProps, pageContext })
|
|
|
67
65
|
viewLessText: viewLessText,
|
|
68
66
|
enableViewMoreIcon: setting?.enableViewMoreIcon
|
|
69
67
|
},
|
|
70
|
-
|
|
68
|
+
textStyle
|
|
71
69
|
});
|
|
72
70
|
const renderScript = ()=>{
|
|
73
71
|
const jsURL = core.isLocalEnv ? `{{ 'gp-collection-description.js' | asset_url }}` : `${core.baseAssetURL}/assets-v2/gp-collection-description.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}`;
|
|
@@ -81,11 +79,13 @@ const CollectionDescription = ({ setting, advanced, builderProps, pageContext })
|
|
|
81
79
|
>
|
|
82
80
|
<style>${textDescriptionCss}</style>
|
|
83
81
|
${system.If(!core.isSafari(), `<style>${gpDescriptionCss}</style>`, ' ')}
|
|
84
|
-
${system.LiquidUnless('collection', `<p>Collection not found</p>`, core.template`<div ${textAttr} class="${classContainerCollectionDes}" style="${
|
|
82
|
+
${system.LiquidUnless('collection', `<p>Collection not found</p>`, core.template`<div ${textAttr} class="${classContainerCollectionDes}" style="${textStyle}">
|
|
85
83
|
{{collection.description}}
|
|
86
84
|
</div>
|
|
87
85
|
${system.LiquidIf(hasDescriptionHtml, core.template`<button type="button" class="${classButtonViewMore}" style="${styleViewMore}">
|
|
86
|
+
<span class="${showMoreTextClasses}">
|
|
88
87
|
${system.If(pageContext?.isPreviewing, viewMoreText?.toString() || '', `{{${viewMoreText}}}`)}
|
|
88
|
+
</span>
|
|
89
89
|
${system.If(setting?.enableViewMoreIcon, core.template`<span class="${showMoreIconClasses}">${constant.ICON_SVG}</span>`, ' ')}
|
|
90
90
|
</button>`)}`)}
|
|
91
91
|
</gp-collection-description>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
|
-
var constant = require('../common/constant.js');
|
|
5
4
|
var core = require('@gem-sdk/core');
|
|
6
5
|
|
|
7
6
|
const useGpDescription = (setting)=>{
|
|
@@ -13,52 +12,23 @@ const useGpDescription = (setting)=>{
|
|
|
13
12
|
const hasLineClamp = core.getResponsiveValueByScreen(setting?.hasLineClamp, currentDevice);
|
|
14
13
|
const lineClamp = core.getResponsiveValueByScreen(setting?.lineClamp, currentDevice);
|
|
15
14
|
const mode = core.useEditorMode();
|
|
16
|
-
const getLineHeightFromDom = React.useCallback(()=>{
|
|
17
|
-
if (!ref.current) return constant.DESCRIPTION_LINE_HEIGHT_DEFAULT;
|
|
18
|
-
const lineHeight = window.getComputedStyle(ref.current).getPropertyValue('line-height');
|
|
19
|
-
return Math.ceil(parseFloat(lineHeight));
|
|
20
|
-
}, []);
|
|
21
|
-
const getMaxHeight = React.useCallback((lineHeight)=>{
|
|
22
|
-
if (!hasLineClamp || !lineClamp) return 'auto';
|
|
23
|
-
if (lineHeight) return `${lineClamp * lineHeight}px`;
|
|
24
|
-
return 'auto';
|
|
25
|
-
}, [
|
|
26
|
-
hasLineClamp,
|
|
27
|
-
lineClamp
|
|
28
|
-
]);
|
|
29
15
|
const handleToggleShowMore = ()=>{
|
|
30
|
-
if (!ref.current) return;
|
|
31
|
-
const lineHeight = getLineHeightFromDom();
|
|
32
|
-
if (open) {
|
|
33
|
-
ref.current.style.maxHeight = getMaxHeight(lineHeight);
|
|
34
|
-
} else {
|
|
35
|
-
ref.current.style.maxHeight = 'none';
|
|
36
|
-
}
|
|
37
16
|
setOpen((prev)=>!prev);
|
|
38
17
|
};
|
|
39
|
-
React.useEffect(()=>{
|
|
40
|
-
const lineHeight = getLineHeightFromDom();
|
|
41
|
-
getMaxHeight(lineHeight);
|
|
42
|
-
}, [
|
|
43
|
-
setting?.typo?.custom,
|
|
44
|
-
getMaxHeight,
|
|
45
|
-
getLineHeightFromDom
|
|
46
|
-
]);
|
|
47
18
|
React.useEffect(()=>{
|
|
48
19
|
const dom = ref.current;
|
|
49
20
|
setOpen(false);
|
|
50
|
-
if (
|
|
51
|
-
const enableShowMore = hasLineClamp && collection?.descriptionHtml;
|
|
52
|
-
if (!enableShowMore) dom.style.maxHeight = 'none';
|
|
53
|
-
else {
|
|
21
|
+
if (dom && hasLineClamp && collection?.description) {
|
|
54
22
|
const value = lineClamp;
|
|
55
23
|
setTimeout(()=>{
|
|
56
24
|
const scrollHeight = dom?.scrollHeight ?? 0;
|
|
57
25
|
const clientHeight = dom?.clientHeight ?? 0;
|
|
58
|
-
const lineHeight =
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
const
|
|
26
|
+
const lineHeight = window.getComputedStyle(dom).getPropertyValue('line-height');
|
|
27
|
+
const parsedLineHeight = parseInt(lineHeight, 10) || 1;
|
|
28
|
+
const lineText = Math.round((scrollHeight ?? 0) / parsedLineHeight);
|
|
29
|
+
const isValueExceeded = value !== undefined && value < lineText;
|
|
30
|
+
const isOverflow = clientHeight < scrollHeight;
|
|
31
|
+
const conditionCheckLine = core.isSafari() ? isValueExceeded : isOverflow;
|
|
62
32
|
if (value && conditionCheckLine) {
|
|
63
33
|
setIsShowViewMore(()=>true);
|
|
64
34
|
} else {
|
|
@@ -69,12 +39,7 @@ const useGpDescription = (setting)=>{
|
|
|
69
39
|
}, [
|
|
70
40
|
hasLineClamp,
|
|
71
41
|
lineClamp,
|
|
72
|
-
collection?.description
|
|
73
|
-
collection?.descriptionHtml,
|
|
74
|
-
getLineHeightFromDom,
|
|
75
|
-
getMaxHeight,
|
|
76
|
-
setOpen,
|
|
77
|
-
setIsShowViewMore
|
|
42
|
+
collection?.description
|
|
78
43
|
]);
|
|
79
44
|
return {
|
|
80
45
|
ref,
|
|
@@ -74,6 +74,31 @@ const ControlUIV2 = [
|
|
|
74
74
|
},
|
|
75
75
|
setting: {
|
|
76
76
|
id: 'iconItemColor'
|
|
77
|
+
},
|
|
78
|
+
controlChangeTrigger: {
|
|
79
|
+
settings: [
|
|
80
|
+
{
|
|
81
|
+
action: {
|
|
82
|
+
controlId: 'iconColor',
|
|
83
|
+
valueFromField: 'iconItemColor',
|
|
84
|
+
groupType: 'setting',
|
|
85
|
+
controlType: 'setting',
|
|
86
|
+
state: 'normal'
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
options: {
|
|
91
|
+
noRecordHistory: true
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
options: {
|
|
95
|
+
updateFields: [
|
|
96
|
+
{
|
|
97
|
+
field: 'iconItemColor',
|
|
98
|
+
settingId: 'iconColor',
|
|
99
|
+
state: 'normal'
|
|
100
|
+
}
|
|
101
|
+
]
|
|
77
102
|
}
|
|
78
103
|
},
|
|
79
104
|
{
|
|
@@ -98,334 +123,6 @@ const ControlUIV2 = [
|
|
|
98
123
|
}
|
|
99
124
|
]
|
|
100
125
|
},
|
|
101
|
-
// {
|
|
102
|
-
// label: {
|
|
103
|
-
// en: 'Size',
|
|
104
|
-
// },
|
|
105
|
-
// controls: [
|
|
106
|
-
// {
|
|
107
|
-
// type: 'control',
|
|
108
|
-
// setting: {
|
|
109
|
-
// id: 'size',
|
|
110
|
-
// },
|
|
111
|
-
// },
|
|
112
|
-
// ],
|
|
113
|
-
// },
|
|
114
|
-
{
|
|
115
|
-
label: {
|
|
116
|
-
en: 'Item states'
|
|
117
|
-
},
|
|
118
|
-
controls: [
|
|
119
|
-
{
|
|
120
|
-
type: 'tab',
|
|
121
|
-
controls: [
|
|
122
|
-
{
|
|
123
|
-
type: 'group',
|
|
124
|
-
label: {
|
|
125
|
-
en: 'Default'
|
|
126
|
-
},
|
|
127
|
-
controls: [
|
|
128
|
-
{
|
|
129
|
-
type: 'control',
|
|
130
|
-
label: {
|
|
131
|
-
en: 'Icon'
|
|
132
|
-
},
|
|
133
|
-
setting: {
|
|
134
|
-
id: 'iconColor',
|
|
135
|
-
state: 'normal'
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
type: 'control',
|
|
140
|
-
label: {
|
|
141
|
-
en: 'Background'
|
|
142
|
-
},
|
|
143
|
-
setting: {
|
|
144
|
-
id: 'backgroundColor',
|
|
145
|
-
state: 'normal'
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
type: 'control',
|
|
150
|
-
label: {
|
|
151
|
-
en: 'Border'
|
|
152
|
-
},
|
|
153
|
-
setting: {
|
|
154
|
-
id: 'borderBundle',
|
|
155
|
-
state: 'normal'
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
type: 'control',
|
|
160
|
-
label: {
|
|
161
|
-
en: 'Corner'
|
|
162
|
-
},
|
|
163
|
-
setting: {
|
|
164
|
-
id: 'roundedBundle',
|
|
165
|
-
state: 'normal'
|
|
166
|
-
}
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
label: {
|
|
170
|
-
en: 'Shadow'
|
|
171
|
-
},
|
|
172
|
-
setting: {
|
|
173
|
-
id: 'boxShadowBundle',
|
|
174
|
-
state: 'normal'
|
|
175
|
-
},
|
|
176
|
-
options: {
|
|
177
|
-
updateFields: [
|
|
178
|
-
{
|
|
179
|
-
field: 'normal.enable',
|
|
180
|
-
settingId: 'hasBoxShadowBundle',
|
|
181
|
-
state: 'normal'
|
|
182
|
-
}
|
|
183
|
-
]
|
|
184
|
-
},
|
|
185
|
-
controlChangeTrigger: {
|
|
186
|
-
settings: [
|
|
187
|
-
{
|
|
188
|
-
condition: `boxShadowBundle.normal.enable === true`,
|
|
189
|
-
source: [
|
|
190
|
-
'boxShadowBundle',
|
|
191
|
-
'hasBoxShadowBundle'
|
|
192
|
-
],
|
|
193
|
-
action: {
|
|
194
|
-
controlId: 'hasBoxShadowBundle',
|
|
195
|
-
groupType: 'style',
|
|
196
|
-
controlType: 'style',
|
|
197
|
-
state: 'normal',
|
|
198
|
-
newValue: true
|
|
199
|
-
}
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
condition: `boxShadowBundle.normal.enable === false`,
|
|
203
|
-
source: [
|
|
204
|
-
'boxShadowBundle',
|
|
205
|
-
'hasBoxShadowBundle'
|
|
206
|
-
],
|
|
207
|
-
action: {
|
|
208
|
-
controlId: 'hasBoxShadowBundle',
|
|
209
|
-
groupType: 'style',
|
|
210
|
-
controlType: 'style',
|
|
211
|
-
state: 'normal',
|
|
212
|
-
newValue: false
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
],
|
|
216
|
-
options: {
|
|
217
|
-
noRecordHistory: true
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
]
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
type: 'group',
|
|
225
|
-
label: {
|
|
226
|
-
en: 'Hover'
|
|
227
|
-
},
|
|
228
|
-
controls: [
|
|
229
|
-
{
|
|
230
|
-
type: 'control',
|
|
231
|
-
label: {
|
|
232
|
-
en: 'Icon'
|
|
233
|
-
},
|
|
234
|
-
setting: {
|
|
235
|
-
id: 'iconColor',
|
|
236
|
-
state: 'hover'
|
|
237
|
-
}
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
type: 'control',
|
|
241
|
-
label: {
|
|
242
|
-
en: 'Background'
|
|
243
|
-
},
|
|
244
|
-
setting: {
|
|
245
|
-
id: 'backgroundColor',
|
|
246
|
-
state: 'hover'
|
|
247
|
-
}
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
type: 'control',
|
|
251
|
-
label: {
|
|
252
|
-
en: 'Border'
|
|
253
|
-
},
|
|
254
|
-
setting: {
|
|
255
|
-
id: 'borderBundle',
|
|
256
|
-
state: 'hover'
|
|
257
|
-
}
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
type: 'control',
|
|
261
|
-
label: {
|
|
262
|
-
en: 'Corner'
|
|
263
|
-
},
|
|
264
|
-
setting: {
|
|
265
|
-
id: 'roundedBundle',
|
|
266
|
-
state: 'hover'
|
|
267
|
-
}
|
|
268
|
-
},
|
|
269
|
-
{
|
|
270
|
-
label: {
|
|
271
|
-
en: 'Shadow'
|
|
272
|
-
},
|
|
273
|
-
setting: {
|
|
274
|
-
id: 'boxShadowBundle',
|
|
275
|
-
state: 'hover'
|
|
276
|
-
},
|
|
277
|
-
options: {
|
|
278
|
-
updateFields: [
|
|
279
|
-
{
|
|
280
|
-
field: 'hover.enable',
|
|
281
|
-
settingId: 'hasBoxShadowBundle',
|
|
282
|
-
state: 'hover'
|
|
283
|
-
}
|
|
284
|
-
]
|
|
285
|
-
},
|
|
286
|
-
controlChangeTrigger: {
|
|
287
|
-
settings: [
|
|
288
|
-
{
|
|
289
|
-
condition: `boxShadowBundle.hover.enable === true`,
|
|
290
|
-
source: [
|
|
291
|
-
'boxShadowBundle',
|
|
292
|
-
'hasBoxShadowBundle'
|
|
293
|
-
],
|
|
294
|
-
action: {
|
|
295
|
-
controlId: 'hasBoxShadowBundle',
|
|
296
|
-
groupType: 'style',
|
|
297
|
-
controlType: 'style',
|
|
298
|
-
state: 'hover',
|
|
299
|
-
newValue: true
|
|
300
|
-
}
|
|
301
|
-
},
|
|
302
|
-
{
|
|
303
|
-
condition: `boxShadowBundle.hover.enable === false`,
|
|
304
|
-
source: [
|
|
305
|
-
'boxShadowBundle',
|
|
306
|
-
'hasBoxShadowBundle'
|
|
307
|
-
],
|
|
308
|
-
action: {
|
|
309
|
-
controlId: 'hasBoxShadowBundle',
|
|
310
|
-
groupType: 'style',
|
|
311
|
-
controlType: 'style',
|
|
312
|
-
state: 'hover',
|
|
313
|
-
newValue: false
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
],
|
|
317
|
-
options: {
|
|
318
|
-
noRecordHistory: true
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
]
|
|
323
|
-
},
|
|
324
|
-
{
|
|
325
|
-
type: 'group',
|
|
326
|
-
label: {
|
|
327
|
-
en: 'Active'
|
|
328
|
-
},
|
|
329
|
-
controls: [
|
|
330
|
-
{
|
|
331
|
-
type: 'control',
|
|
332
|
-
label: {
|
|
333
|
-
en: 'Icon'
|
|
334
|
-
},
|
|
335
|
-
setting: {
|
|
336
|
-
id: 'iconColor',
|
|
337
|
-
state: 'active'
|
|
338
|
-
}
|
|
339
|
-
},
|
|
340
|
-
{
|
|
341
|
-
type: 'control',
|
|
342
|
-
label: {
|
|
343
|
-
en: 'Background'
|
|
344
|
-
},
|
|
345
|
-
setting: {
|
|
346
|
-
id: 'backgroundColor',
|
|
347
|
-
state: 'active'
|
|
348
|
-
}
|
|
349
|
-
},
|
|
350
|
-
{
|
|
351
|
-
type: 'control',
|
|
352
|
-
label: {
|
|
353
|
-
en: 'Border'
|
|
354
|
-
},
|
|
355
|
-
setting: {
|
|
356
|
-
id: 'borderBundle',
|
|
357
|
-
state: 'active'
|
|
358
|
-
}
|
|
359
|
-
},
|
|
360
|
-
{
|
|
361
|
-
type: 'control',
|
|
362
|
-
label: {
|
|
363
|
-
en: 'Corner'
|
|
364
|
-
},
|
|
365
|
-
setting: {
|
|
366
|
-
id: 'roundedBundle',
|
|
367
|
-
state: 'active'
|
|
368
|
-
}
|
|
369
|
-
},
|
|
370
|
-
{
|
|
371
|
-
label: {
|
|
372
|
-
en: 'Shadow'
|
|
373
|
-
},
|
|
374
|
-
setting: {
|
|
375
|
-
id: 'boxShadowBundle',
|
|
376
|
-
state: 'active'
|
|
377
|
-
},
|
|
378
|
-
options: {
|
|
379
|
-
updateFields: [
|
|
380
|
-
{
|
|
381
|
-
field: 'active.enable',
|
|
382
|
-
settingId: 'hasBoxShadowBundle',
|
|
383
|
-
state: 'active'
|
|
384
|
-
}
|
|
385
|
-
]
|
|
386
|
-
},
|
|
387
|
-
controlChangeTrigger: {
|
|
388
|
-
settings: [
|
|
389
|
-
{
|
|
390
|
-
condition: `boxShadowBundle.active.enable === true`,
|
|
391
|
-
source: [
|
|
392
|
-
'boxShadowBundle',
|
|
393
|
-
'hasBoxShadowBundle'
|
|
394
|
-
],
|
|
395
|
-
action: {
|
|
396
|
-
controlId: 'hasBoxShadowBundle',
|
|
397
|
-
groupType: 'style',
|
|
398
|
-
controlType: 'style',
|
|
399
|
-
state: 'active',
|
|
400
|
-
newValue: true
|
|
401
|
-
}
|
|
402
|
-
},
|
|
403
|
-
{
|
|
404
|
-
condition: `boxShadowBundle.active.enable === false`,
|
|
405
|
-
source: [
|
|
406
|
-
'boxShadowBundle',
|
|
407
|
-
'hasBoxShadowBundle'
|
|
408
|
-
],
|
|
409
|
-
action: {
|
|
410
|
-
controlId: 'hasBoxShadowBundle',
|
|
411
|
-
groupType: 'style',
|
|
412
|
-
controlType: 'style',
|
|
413
|
-
state: 'active',
|
|
414
|
-
newValue: false
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
],
|
|
418
|
-
options: {
|
|
419
|
-
noRecordHistory: true
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
]
|
|
424
|
-
}
|
|
425
|
-
]
|
|
426
|
-
}
|
|
427
|
-
]
|
|
428
|
-
},
|
|
429
126
|
{
|
|
430
127
|
label: {
|
|
431
128
|
en: 'Item style'
|
|
@@ -8,6 +8,15 @@ const getClassButtonViewMore = ({ setting })=>{
|
|
|
8
8
|
const appendTypoClass = composeTypographyClassName(setting?.typo, setting?.typography);
|
|
9
9
|
return composeClasses(cls('p-description-show-more', 'gp-mt-4 hover:gp-opacity-80 gp-transition-all gp-w-full', appendTypoClass, getGlobalColorClass('text', setting?.showMoreColor)));
|
|
10
10
|
};
|
|
11
|
+
const getDescriptionClasses = ({ advanced })=>{
|
|
12
|
+
return composeClasses(cls('gp-collection-description', advanced?.cssClass));
|
|
13
|
+
};
|
|
14
|
+
const getShowMoreIconClasses = ()=>{
|
|
15
|
+
return composeClasses(cls('gp-show-more-icon gp-ml-1'));
|
|
16
|
+
};
|
|
17
|
+
const getShowMoreTextClasses = ()=>{
|
|
18
|
+
return composeClasses(cls('gp-show-more-text'));
|
|
19
|
+
};
|
|
11
20
|
const composeClasses = (classes)=>{
|
|
12
21
|
return classes.trim().split(/\s+/).reduce((acc, className)=>{
|
|
13
22
|
acc[className] = true;
|
|
@@ -15,4 +24,4 @@ const composeClasses = (classes)=>{
|
|
|
15
24
|
}, {});
|
|
16
25
|
};
|
|
17
26
|
|
|
18
|
-
export { getClassButtonViewMore, getClassContainerCollectionDes };
|
|
27
|
+
export { getClassButtonViewMore, getClassContainerCollectionDes, getDescriptionClasses, getShowMoreIconClasses, getShowMoreTextClasses };
|
|
@@ -41,13 +41,20 @@ const getDefaultStyleCollectionDes = ({ setting, renderMaxHeight })=>{
|
|
|
41
41
|
};
|
|
42
42
|
const getStyleDefaultViewMore = (setting)=>{
|
|
43
43
|
const appendTypoStyle = composeTypographyStyle(setting?.typo, setting?.typography);
|
|
44
|
+
const getDisplayCollapse = ()=>{
|
|
45
|
+
return getDisplayStyle((device)=>{
|
|
46
|
+
const hasClamp = setting?.hasLineClamp?.[device];
|
|
47
|
+
return !!setting?.hasLineClamp && hasClamp !== undefined && !hasClamp;
|
|
48
|
+
}, 'inline-flex');
|
|
49
|
+
};
|
|
44
50
|
return {
|
|
45
51
|
...makeStyle({
|
|
46
52
|
tt: setting?.transform
|
|
47
53
|
}),
|
|
48
|
-
...makeStyleResponsive('
|
|
54
|
+
...makeStyleResponsive('jc', setting?.textAlign),
|
|
49
55
|
...appendTypoStyle,
|
|
50
|
-
...getGlobalColorStyle(setting?.showMoreColor)
|
|
56
|
+
...getGlobalColorStyle(setting?.showMoreColor),
|
|
57
|
+
...getDisplayCollapse()
|
|
51
58
|
};
|
|
52
59
|
};
|
|
53
60
|
const getDisplayCollapse = (setting)=>{
|
package/dist/esm/collection/components/collection-description/components/CollectionDescription.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { useCollection, makeStyleResponsive, makeLineClamp, isSafari } from '@gem-sdk/core';
|
|
4
4
|
import { getDefaultStyleCollectionDes, getStyleDefaultViewMore, getStaticCss } from '../common/styles.js';
|
|
5
|
-
import { getClassContainerCollectionDes, getClassButtonViewMore } from '../common/classes.js';
|
|
5
|
+
import { getClassContainerCollectionDes, getClassButtonViewMore, getDescriptionClasses, getShowMoreIconClasses, getShowMoreTextClasses } from '../common/classes.js';
|
|
6
6
|
import { createClass, createStyle, createAttr, If } from '@gem-sdk/system';
|
|
7
7
|
import { getViewLessText, getViewMoreText } from '../common/index.js';
|
|
8
8
|
import { useGpDescription } from '../hook/useDescription.js';
|
|
@@ -18,17 +18,12 @@ const CollectionDescription = ({ setting, builderProps, pageContext, advanced })
|
|
|
18
18
|
const classButtonViewMore = createClass(getClassButtonViewMore({
|
|
19
19
|
setting
|
|
20
20
|
}));
|
|
21
|
-
const gpDescriptionClasses = createClass({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
...open ? {
|
|
28
|
-
'gp-rotate-180': true
|
|
29
|
-
} : {}
|
|
30
|
-
});
|
|
31
|
-
const collapseStyle = createStyle({
|
|
21
|
+
const gpDescriptionClasses = createClass(getDescriptionClasses({
|
|
22
|
+
advanced
|
|
23
|
+
}));
|
|
24
|
+
const showMoreIconClasses = createClass(getShowMoreIconClasses());
|
|
25
|
+
const showMoreTextClasses = createClass(getShowMoreTextClasses());
|
|
26
|
+
const textStyle = createStyle({
|
|
32
27
|
...getDefaultStyleCollectionDes({
|
|
33
28
|
setting
|
|
34
29
|
}),
|
|
@@ -70,7 +65,7 @@ const CollectionDescription = ({ setting, builderProps, pageContext, advanced })
|
|
|
70
65
|
/*#__PURE__*/ jsx("div", {
|
|
71
66
|
ref: ref,
|
|
72
67
|
className: classContainerCollectionDes,
|
|
73
|
-
style:
|
|
68
|
+
style: textStyle,
|
|
74
69
|
dangerouslySetInnerHTML: {
|
|
75
70
|
__html: collection?.descriptionHtml ?? ''
|
|
76
71
|
},
|
|
@@ -82,7 +77,10 @@ const CollectionDescription = ({ setting, builderProps, pageContext, advanced })
|
|
|
82
77
|
style: styleViewMore,
|
|
83
78
|
onClick: handleToggleShowMore,
|
|
84
79
|
children: [
|
|
85
|
-
|
|
80
|
+
/*#__PURE__*/ jsx("span", {
|
|
81
|
+
className: showMoreTextClasses,
|
|
82
|
+
children: If(open, viewLessText?.toString() ?? '', viewMoreText?.toString() ?? '')
|
|
83
|
+
}),
|
|
86
84
|
If(setting?.enableViewMoreIcon, /*#__PURE__*/ jsx("span", {
|
|
87
85
|
className: showMoreIconClasses,
|
|
88
86
|
dangerouslySetInnerHTML: {
|
|
@@ -2,7 +2,7 @@ import { makeStyleResponsive, makeLineClamp, template, isSafari, isLocalEnv, bas
|
|
|
2
2
|
import { getSettingPreloadData } from '../../../../helpers.js';
|
|
3
3
|
import { getDefaultStyleCollectionDes, getStyleDefaultViewMore, getDisplayCollapse, getStaticCss } from '../common/styles.js';
|
|
4
4
|
import { createClass, createStyle, createAttr, createStateOrContext, If, Liquid, LiquidUnless, LiquidIf } from '@gem-sdk/system';
|
|
5
|
-
import { getClassContainerCollectionDes, getClassButtonViewMore } from '../common/classes.js';
|
|
5
|
+
import { getClassContainerCollectionDes, getClassButtonViewMore, getDescriptionClasses, getShowMoreIconClasses, getShowMoreTextClasses } from '../common/classes.js';
|
|
6
6
|
import { getViewLessText, getViewMoreText } from '../common/index.js';
|
|
7
7
|
import { ICON_SVG } from '../common/constant.js';
|
|
8
8
|
|
|
@@ -14,14 +14,12 @@ const CollectionDescription = ({ setting, advanced, builderProps, pageContext })
|
|
|
14
14
|
const classButtonViewMore = createClass(getClassButtonViewMore({
|
|
15
15
|
setting
|
|
16
16
|
}));
|
|
17
|
-
const gpDescriptionClasses = createClass({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
});
|
|
24
|
-
const collapseStyle = createStyle({
|
|
17
|
+
const gpDescriptionClasses = createClass(getDescriptionClasses({
|
|
18
|
+
advanced
|
|
19
|
+
}));
|
|
20
|
+
const showMoreIconClasses = createClass(getShowMoreIconClasses());
|
|
21
|
+
const showMoreTextClasses = createClass(getShowMoreTextClasses());
|
|
22
|
+
const textStyle = createStyle({
|
|
25
23
|
...getDefaultStyleCollectionDes({
|
|
26
24
|
setting,
|
|
27
25
|
renderMaxHeight: true
|
|
@@ -63,7 +61,7 @@ const CollectionDescription = ({ setting, advanced, builderProps, pageContext })
|
|
|
63
61
|
viewLessText: viewLessText,
|
|
64
62
|
enableViewMoreIcon: setting?.enableViewMoreIcon
|
|
65
63
|
},
|
|
66
|
-
|
|
64
|
+
textStyle
|
|
67
65
|
});
|
|
68
66
|
const renderScript = ()=>{
|
|
69
67
|
const jsURL = isLocalEnv ? `{{ 'gp-collection-description.js' | asset_url }}` : `${baseAssetURL}/assets-v2/gp-collection-description.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}`;
|
|
@@ -77,11 +75,13 @@ const CollectionDescription = ({ setting, advanced, builderProps, pageContext })
|
|
|
77
75
|
>
|
|
78
76
|
<style>${textDescriptionCss}</style>
|
|
79
77
|
${If(!isSafari(), `<style>${gpDescriptionCss}</style>`, ' ')}
|
|
80
|
-
${LiquidUnless('collection', `<p>Collection not found</p>`, template`<div ${textAttr} class="${classContainerCollectionDes}" style="${
|
|
78
|
+
${LiquidUnless('collection', `<p>Collection not found</p>`, template`<div ${textAttr} class="${classContainerCollectionDes}" style="${textStyle}">
|
|
81
79
|
{{collection.description}}
|
|
82
80
|
</div>
|
|
83
81
|
${LiquidIf(hasDescriptionHtml, template`<button type="button" class="${classButtonViewMore}" style="${styleViewMore}">
|
|
82
|
+
<span class="${showMoreTextClasses}">
|
|
84
83
|
${If(pageContext?.isPreviewing, viewMoreText?.toString() || '', `{{${viewMoreText}}}`)}
|
|
84
|
+
</span>
|
|
85
85
|
${If(setting?.enableViewMoreIcon, template`<span class="${showMoreIconClasses}">${ICON_SVG}</span>`, ' ')}
|
|
86
86
|
</button>`)}`)}
|
|
87
87
|
</gp-collection-description>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { useRef, useState,
|
|
2
|
-
import {
|
|
3
|
-
import { useCollection, useCurrentDevice, getResponsiveValueByScreen, useEditorMode } from '@gem-sdk/core';
|
|
1
|
+
import { useRef, useState, useEffect } from 'react';
|
|
2
|
+
import { useCollection, useCurrentDevice, getResponsiveValueByScreen, useEditorMode, isSafari } from '@gem-sdk/core';
|
|
4
3
|
|
|
5
4
|
const useGpDescription = (setting)=>{
|
|
6
5
|
const ref = useRef(null);
|
|
@@ -11,52 +10,23 @@ const useGpDescription = (setting)=>{
|
|
|
11
10
|
const hasLineClamp = getResponsiveValueByScreen(setting?.hasLineClamp, currentDevice);
|
|
12
11
|
const lineClamp = getResponsiveValueByScreen(setting?.lineClamp, currentDevice);
|
|
13
12
|
const mode = useEditorMode();
|
|
14
|
-
const getLineHeightFromDom = useCallback(()=>{
|
|
15
|
-
if (!ref.current) return DESCRIPTION_LINE_HEIGHT_DEFAULT;
|
|
16
|
-
const lineHeight = window.getComputedStyle(ref.current).getPropertyValue('line-height');
|
|
17
|
-
return Math.ceil(parseFloat(lineHeight));
|
|
18
|
-
}, []);
|
|
19
|
-
const getMaxHeight = useCallback((lineHeight)=>{
|
|
20
|
-
if (!hasLineClamp || !lineClamp) return 'auto';
|
|
21
|
-
if (lineHeight) return `${lineClamp * lineHeight}px`;
|
|
22
|
-
return 'auto';
|
|
23
|
-
}, [
|
|
24
|
-
hasLineClamp,
|
|
25
|
-
lineClamp
|
|
26
|
-
]);
|
|
27
13
|
const handleToggleShowMore = ()=>{
|
|
28
|
-
if (!ref.current) return;
|
|
29
|
-
const lineHeight = getLineHeightFromDom();
|
|
30
|
-
if (open) {
|
|
31
|
-
ref.current.style.maxHeight = getMaxHeight(lineHeight);
|
|
32
|
-
} else {
|
|
33
|
-
ref.current.style.maxHeight = 'none';
|
|
34
|
-
}
|
|
35
14
|
setOpen((prev)=>!prev);
|
|
36
15
|
};
|
|
37
|
-
useEffect(()=>{
|
|
38
|
-
const lineHeight = getLineHeightFromDom();
|
|
39
|
-
getMaxHeight(lineHeight);
|
|
40
|
-
}, [
|
|
41
|
-
setting?.typo?.custom,
|
|
42
|
-
getMaxHeight,
|
|
43
|
-
getLineHeightFromDom
|
|
44
|
-
]);
|
|
45
16
|
useEffect(()=>{
|
|
46
17
|
const dom = ref.current;
|
|
47
18
|
setOpen(false);
|
|
48
|
-
if (
|
|
49
|
-
const enableShowMore = hasLineClamp && collection?.descriptionHtml;
|
|
50
|
-
if (!enableShowMore) dom.style.maxHeight = 'none';
|
|
51
|
-
else {
|
|
19
|
+
if (dom && hasLineClamp && collection?.description) {
|
|
52
20
|
const value = lineClamp;
|
|
53
21
|
setTimeout(()=>{
|
|
54
22
|
const scrollHeight = dom?.scrollHeight ?? 0;
|
|
55
23
|
const clientHeight = dom?.clientHeight ?? 0;
|
|
56
|
-
const lineHeight =
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
const
|
|
24
|
+
const lineHeight = window.getComputedStyle(dom).getPropertyValue('line-height');
|
|
25
|
+
const parsedLineHeight = parseInt(lineHeight, 10) || 1;
|
|
26
|
+
const lineText = Math.round((scrollHeight ?? 0) / parsedLineHeight);
|
|
27
|
+
const isValueExceeded = value !== undefined && value < lineText;
|
|
28
|
+
const isOverflow = clientHeight < scrollHeight;
|
|
29
|
+
const conditionCheckLine = isSafari() ? isValueExceeded : isOverflow;
|
|
60
30
|
if (value && conditionCheckLine) {
|
|
61
31
|
setIsShowViewMore(()=>true);
|
|
62
32
|
} else {
|
|
@@ -67,12 +37,7 @@ const useGpDescription = (setting)=>{
|
|
|
67
37
|
}, [
|
|
68
38
|
hasLineClamp,
|
|
69
39
|
lineClamp,
|
|
70
|
-
collection?.description
|
|
71
|
-
collection?.descriptionHtml,
|
|
72
|
-
getLineHeightFromDom,
|
|
73
|
-
getMaxHeight,
|
|
74
|
-
setOpen,
|
|
75
|
-
setIsShowViewMore
|
|
40
|
+
collection?.description
|
|
76
41
|
]);
|
|
77
42
|
return {
|
|
78
43
|
ref,
|
|
@@ -70,6 +70,31 @@ const ControlUIV2 = [
|
|
|
70
70
|
},
|
|
71
71
|
setting: {
|
|
72
72
|
id: 'iconItemColor'
|
|
73
|
+
},
|
|
74
|
+
controlChangeTrigger: {
|
|
75
|
+
settings: [
|
|
76
|
+
{
|
|
77
|
+
action: {
|
|
78
|
+
controlId: 'iconColor',
|
|
79
|
+
valueFromField: 'iconItemColor',
|
|
80
|
+
groupType: 'setting',
|
|
81
|
+
controlType: 'setting',
|
|
82
|
+
state: 'normal'
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
options: {
|
|
87
|
+
noRecordHistory: true
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
options: {
|
|
91
|
+
updateFields: [
|
|
92
|
+
{
|
|
93
|
+
field: 'iconItemColor',
|
|
94
|
+
settingId: 'iconColor',
|
|
95
|
+
state: 'normal'
|
|
96
|
+
}
|
|
97
|
+
]
|
|
73
98
|
}
|
|
74
99
|
},
|
|
75
100
|
{
|
|
@@ -94,334 +119,6 @@ const ControlUIV2 = [
|
|
|
94
119
|
}
|
|
95
120
|
]
|
|
96
121
|
},
|
|
97
|
-
// {
|
|
98
|
-
// label: {
|
|
99
|
-
// en: 'Size',
|
|
100
|
-
// },
|
|
101
|
-
// controls: [
|
|
102
|
-
// {
|
|
103
|
-
// type: 'control',
|
|
104
|
-
// setting: {
|
|
105
|
-
// id: 'size',
|
|
106
|
-
// },
|
|
107
|
-
// },
|
|
108
|
-
// ],
|
|
109
|
-
// },
|
|
110
|
-
{
|
|
111
|
-
label: {
|
|
112
|
-
en: 'Item states'
|
|
113
|
-
},
|
|
114
|
-
controls: [
|
|
115
|
-
{
|
|
116
|
-
type: 'tab',
|
|
117
|
-
controls: [
|
|
118
|
-
{
|
|
119
|
-
type: 'group',
|
|
120
|
-
label: {
|
|
121
|
-
en: 'Default'
|
|
122
|
-
},
|
|
123
|
-
controls: [
|
|
124
|
-
{
|
|
125
|
-
type: 'control',
|
|
126
|
-
label: {
|
|
127
|
-
en: 'Icon'
|
|
128
|
-
},
|
|
129
|
-
setting: {
|
|
130
|
-
id: 'iconColor',
|
|
131
|
-
state: 'normal'
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
type: 'control',
|
|
136
|
-
label: {
|
|
137
|
-
en: 'Background'
|
|
138
|
-
},
|
|
139
|
-
setting: {
|
|
140
|
-
id: 'backgroundColor',
|
|
141
|
-
state: 'normal'
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
type: 'control',
|
|
146
|
-
label: {
|
|
147
|
-
en: 'Border'
|
|
148
|
-
},
|
|
149
|
-
setting: {
|
|
150
|
-
id: 'borderBundle',
|
|
151
|
-
state: 'normal'
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
type: 'control',
|
|
156
|
-
label: {
|
|
157
|
-
en: 'Corner'
|
|
158
|
-
},
|
|
159
|
-
setting: {
|
|
160
|
-
id: 'roundedBundle',
|
|
161
|
-
state: 'normal'
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
label: {
|
|
166
|
-
en: 'Shadow'
|
|
167
|
-
},
|
|
168
|
-
setting: {
|
|
169
|
-
id: 'boxShadowBundle',
|
|
170
|
-
state: 'normal'
|
|
171
|
-
},
|
|
172
|
-
options: {
|
|
173
|
-
updateFields: [
|
|
174
|
-
{
|
|
175
|
-
field: 'normal.enable',
|
|
176
|
-
settingId: 'hasBoxShadowBundle',
|
|
177
|
-
state: 'normal'
|
|
178
|
-
}
|
|
179
|
-
]
|
|
180
|
-
},
|
|
181
|
-
controlChangeTrigger: {
|
|
182
|
-
settings: [
|
|
183
|
-
{
|
|
184
|
-
condition: `boxShadowBundle.normal.enable === true`,
|
|
185
|
-
source: [
|
|
186
|
-
'boxShadowBundle',
|
|
187
|
-
'hasBoxShadowBundle'
|
|
188
|
-
],
|
|
189
|
-
action: {
|
|
190
|
-
controlId: 'hasBoxShadowBundle',
|
|
191
|
-
groupType: 'style',
|
|
192
|
-
controlType: 'style',
|
|
193
|
-
state: 'normal',
|
|
194
|
-
newValue: true
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
condition: `boxShadowBundle.normal.enable === false`,
|
|
199
|
-
source: [
|
|
200
|
-
'boxShadowBundle',
|
|
201
|
-
'hasBoxShadowBundle'
|
|
202
|
-
],
|
|
203
|
-
action: {
|
|
204
|
-
controlId: 'hasBoxShadowBundle',
|
|
205
|
-
groupType: 'style',
|
|
206
|
-
controlType: 'style',
|
|
207
|
-
state: 'normal',
|
|
208
|
-
newValue: false
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
],
|
|
212
|
-
options: {
|
|
213
|
-
noRecordHistory: true
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
]
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
type: 'group',
|
|
221
|
-
label: {
|
|
222
|
-
en: 'Hover'
|
|
223
|
-
},
|
|
224
|
-
controls: [
|
|
225
|
-
{
|
|
226
|
-
type: 'control',
|
|
227
|
-
label: {
|
|
228
|
-
en: 'Icon'
|
|
229
|
-
},
|
|
230
|
-
setting: {
|
|
231
|
-
id: 'iconColor',
|
|
232
|
-
state: 'hover'
|
|
233
|
-
}
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
type: 'control',
|
|
237
|
-
label: {
|
|
238
|
-
en: 'Background'
|
|
239
|
-
},
|
|
240
|
-
setting: {
|
|
241
|
-
id: 'backgroundColor',
|
|
242
|
-
state: 'hover'
|
|
243
|
-
}
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
type: 'control',
|
|
247
|
-
label: {
|
|
248
|
-
en: 'Border'
|
|
249
|
-
},
|
|
250
|
-
setting: {
|
|
251
|
-
id: 'borderBundle',
|
|
252
|
-
state: 'hover'
|
|
253
|
-
}
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
type: 'control',
|
|
257
|
-
label: {
|
|
258
|
-
en: 'Corner'
|
|
259
|
-
},
|
|
260
|
-
setting: {
|
|
261
|
-
id: 'roundedBundle',
|
|
262
|
-
state: 'hover'
|
|
263
|
-
}
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
label: {
|
|
267
|
-
en: 'Shadow'
|
|
268
|
-
},
|
|
269
|
-
setting: {
|
|
270
|
-
id: 'boxShadowBundle',
|
|
271
|
-
state: 'hover'
|
|
272
|
-
},
|
|
273
|
-
options: {
|
|
274
|
-
updateFields: [
|
|
275
|
-
{
|
|
276
|
-
field: 'hover.enable',
|
|
277
|
-
settingId: 'hasBoxShadowBundle',
|
|
278
|
-
state: 'hover'
|
|
279
|
-
}
|
|
280
|
-
]
|
|
281
|
-
},
|
|
282
|
-
controlChangeTrigger: {
|
|
283
|
-
settings: [
|
|
284
|
-
{
|
|
285
|
-
condition: `boxShadowBundle.hover.enable === true`,
|
|
286
|
-
source: [
|
|
287
|
-
'boxShadowBundle',
|
|
288
|
-
'hasBoxShadowBundle'
|
|
289
|
-
],
|
|
290
|
-
action: {
|
|
291
|
-
controlId: 'hasBoxShadowBundle',
|
|
292
|
-
groupType: 'style',
|
|
293
|
-
controlType: 'style',
|
|
294
|
-
state: 'hover',
|
|
295
|
-
newValue: true
|
|
296
|
-
}
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
condition: `boxShadowBundle.hover.enable === false`,
|
|
300
|
-
source: [
|
|
301
|
-
'boxShadowBundle',
|
|
302
|
-
'hasBoxShadowBundle'
|
|
303
|
-
],
|
|
304
|
-
action: {
|
|
305
|
-
controlId: 'hasBoxShadowBundle',
|
|
306
|
-
groupType: 'style',
|
|
307
|
-
controlType: 'style',
|
|
308
|
-
state: 'hover',
|
|
309
|
-
newValue: false
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
],
|
|
313
|
-
options: {
|
|
314
|
-
noRecordHistory: true
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
]
|
|
319
|
-
},
|
|
320
|
-
{
|
|
321
|
-
type: 'group',
|
|
322
|
-
label: {
|
|
323
|
-
en: 'Active'
|
|
324
|
-
},
|
|
325
|
-
controls: [
|
|
326
|
-
{
|
|
327
|
-
type: 'control',
|
|
328
|
-
label: {
|
|
329
|
-
en: 'Icon'
|
|
330
|
-
},
|
|
331
|
-
setting: {
|
|
332
|
-
id: 'iconColor',
|
|
333
|
-
state: 'active'
|
|
334
|
-
}
|
|
335
|
-
},
|
|
336
|
-
{
|
|
337
|
-
type: 'control',
|
|
338
|
-
label: {
|
|
339
|
-
en: 'Background'
|
|
340
|
-
},
|
|
341
|
-
setting: {
|
|
342
|
-
id: 'backgroundColor',
|
|
343
|
-
state: 'active'
|
|
344
|
-
}
|
|
345
|
-
},
|
|
346
|
-
{
|
|
347
|
-
type: 'control',
|
|
348
|
-
label: {
|
|
349
|
-
en: 'Border'
|
|
350
|
-
},
|
|
351
|
-
setting: {
|
|
352
|
-
id: 'borderBundle',
|
|
353
|
-
state: 'active'
|
|
354
|
-
}
|
|
355
|
-
},
|
|
356
|
-
{
|
|
357
|
-
type: 'control',
|
|
358
|
-
label: {
|
|
359
|
-
en: 'Corner'
|
|
360
|
-
},
|
|
361
|
-
setting: {
|
|
362
|
-
id: 'roundedBundle',
|
|
363
|
-
state: 'active'
|
|
364
|
-
}
|
|
365
|
-
},
|
|
366
|
-
{
|
|
367
|
-
label: {
|
|
368
|
-
en: 'Shadow'
|
|
369
|
-
},
|
|
370
|
-
setting: {
|
|
371
|
-
id: 'boxShadowBundle',
|
|
372
|
-
state: 'active'
|
|
373
|
-
},
|
|
374
|
-
options: {
|
|
375
|
-
updateFields: [
|
|
376
|
-
{
|
|
377
|
-
field: 'active.enable',
|
|
378
|
-
settingId: 'hasBoxShadowBundle',
|
|
379
|
-
state: 'active'
|
|
380
|
-
}
|
|
381
|
-
]
|
|
382
|
-
},
|
|
383
|
-
controlChangeTrigger: {
|
|
384
|
-
settings: [
|
|
385
|
-
{
|
|
386
|
-
condition: `boxShadowBundle.active.enable === true`,
|
|
387
|
-
source: [
|
|
388
|
-
'boxShadowBundle',
|
|
389
|
-
'hasBoxShadowBundle'
|
|
390
|
-
],
|
|
391
|
-
action: {
|
|
392
|
-
controlId: 'hasBoxShadowBundle',
|
|
393
|
-
groupType: 'style',
|
|
394
|
-
controlType: 'style',
|
|
395
|
-
state: 'active',
|
|
396
|
-
newValue: true
|
|
397
|
-
}
|
|
398
|
-
},
|
|
399
|
-
{
|
|
400
|
-
condition: `boxShadowBundle.active.enable === false`,
|
|
401
|
-
source: [
|
|
402
|
-
'boxShadowBundle',
|
|
403
|
-
'hasBoxShadowBundle'
|
|
404
|
-
],
|
|
405
|
-
action: {
|
|
406
|
-
controlId: 'hasBoxShadowBundle',
|
|
407
|
-
groupType: 'style',
|
|
408
|
-
controlType: 'style',
|
|
409
|
-
state: 'active',
|
|
410
|
-
newValue: false
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
],
|
|
414
|
-
options: {
|
|
415
|
-
noRecordHistory: true
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
]
|
|
420
|
-
}
|
|
421
|
-
]
|
|
422
|
-
}
|
|
423
|
-
]
|
|
424
|
-
},
|
|
425
122
|
{
|
|
426
123
|
label: {
|
|
427
124
|
en: 'Item style'
|