@gem-sdk/components 2.0.0-dev.358 → 2.0.0-dev.360
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/builder.js +14 -14
- package/dist/cjs/grid/row/setting/configs/uiV2.js +44 -0
- package/dist/cjs/grid/section/setting/configs/uiV2.js +44 -0
- package/dist/cjs/heading/setting/configs/settings.js +5 -2
- package/dist/cjs/index.js +40 -40
- package/dist/cjs/post-purchase/product/settings/product-image/setting-v2.js +5 -1
- package/dist/cjs/product/components/ProductQuantity/common/common.js +17 -0
- package/dist/cjs/product/components/ProductQuantity/hooks/index.js +68 -0
- package/dist/cjs/product/components/ProductQuantity/index.js +168 -0
- package/dist/cjs/product/components/ProductQuickView/ProductQuickView.js +2 -2
- package/dist/cjs/product/components/ProductVariants/common/dropdown/styles.js +2 -6
- package/dist/cjs/product/components/ProductVariants/components/dropdown-swatches/Dropdown.js +3 -3
- package/dist/cjs/product/components/ProductVariants/components/dropdown-swatches/Dropdown.liquid.js +2 -2
- package/dist/cjs/product/index.js +6 -6
- package/dist/cjs/product/next.js +1 -1
- package/dist/cjs/product/setting/product-quantity/configs/settings.js +1 -0
- package/dist/cjs/product/setting/product-quantity/configs/uiV2.js +13 -6
- package/dist/cjs/product/setting/product-variant/configs/settings.js +6 -3
- package/dist/cjs/product/setting/product-variant/configs/uiV2.js +107 -1
- package/dist/cjs/text/components/common/getStyle.js +1 -2
- package/dist/cjs/text/setting/configs/settings.js +5 -2
- package/dist/esm/builder.js +1 -1
- package/dist/esm/grid/row/setting/configs/uiV2.js +44 -0
- package/dist/esm/grid/section/setting/configs/uiV2.js +44 -0
- package/dist/esm/heading/setting/configs/settings.js +5 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/post-purchase/product/settings/product-image/setting-v2.js +5 -1
- package/dist/esm/product/components/ProductQuantity/common/common.js +17 -1
- package/dist/esm/product/components/ProductQuantity/hooks/index.js +66 -0
- package/dist/esm/product/components/ProductQuantity/index.js +164 -0
- package/dist/esm/product/components/ProductQuickView/ProductQuickView.js +1 -1
- package/dist/esm/product/components/ProductVariants/common/dropdown/styles.js +2 -6
- package/dist/esm/product/components/ProductVariants/components/dropdown-swatches/Dropdown.js +3 -3
- package/dist/esm/product/components/ProductVariants/components/dropdown-swatches/Dropdown.liquid.js +2 -2
- package/dist/esm/product/next.js +1 -1
- package/dist/esm/product/setting/product-quantity/configs/settings.js +1 -0
- package/dist/esm/product/setting/product-quantity/configs/uiV2.js +13 -6
- package/dist/esm/product/setting/product-variant/configs/settings.js +6 -3
- package/dist/esm/product/setting/product-variant/configs/uiV2.js +107 -1
- package/dist/esm/text/components/common/getStyle.js +2 -3
- package/dist/esm/text/setting/configs/settings.js +5 -2
- package/dist/types/index.d.ts +3 -27
- package/package.json +2 -2
- package/dist/cjs/product/components/ProductQuantity.js +0 -273
- package/dist/esm/product/components/ProductQuantity.js +0 -269
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useCurrentVariant, useQuantity } from '@gem-sdk/core';
|
|
4
|
+
import { createAttr, createClass, createStyle, If } from '@gem-sdk/system';
|
|
5
|
+
import { useProductQuantity } from './hooks/index.js';
|
|
6
|
+
import { getIconWidth, getPlusIcon, getMinusIcon } from './common/common.js';
|
|
7
|
+
import { getContainerAttrs, getInputAttr, getButtonAttrs } from './common/getAttrs.js';
|
|
8
|
+
import { getContainerClasses, getWrapperClasses, getInputClasses, getButtonClass, getIconWrapperClasses } from './common/getClasses.js';
|
|
9
|
+
import { getContainerStyles, getWrapperStyles, getInputStyle, getButtonStyle } from './common/getStyles.js';
|
|
10
|
+
|
|
11
|
+
const ProductQuantity = (props)=>{
|
|
12
|
+
const { setting = {}, styles = {}, builderProps, advanced } = props;
|
|
13
|
+
const currentVariant = useCurrentVariant();
|
|
14
|
+
const { quantity, increment, decrement, setQuantity } = useQuantity();
|
|
15
|
+
const { isInStock, ref } = useProductQuantity(props);
|
|
16
|
+
const { qtyStyle, plusIcon, minusIcon } = setting;
|
|
17
|
+
const defaultQty = setting.defaultQtyValue || 1;
|
|
18
|
+
const { inputHeight, buttonBackgroundColor, backgroundColor, iconColor, inputBackgroundColor, textColor, align, borderBtn, buttonWidth, iconSizeCustom, corner } = styles;
|
|
19
|
+
const containerAttrs = createAttr({
|
|
20
|
+
...getContainerAttrs({
|
|
21
|
+
isDisabled: !isInStock,
|
|
22
|
+
uid: builderProps?.uid || ''
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
const containerClasses = createClass({
|
|
26
|
+
...getContainerClasses(advanced?.cssClass)
|
|
27
|
+
});
|
|
28
|
+
const containerStyles = createStyle({
|
|
29
|
+
...getContainerStyles({
|
|
30
|
+
align,
|
|
31
|
+
inputHeight
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
const wrapperClasses = createClass({
|
|
35
|
+
...getWrapperClasses()
|
|
36
|
+
});
|
|
37
|
+
const wrapperStyles = createStyle({
|
|
38
|
+
...getWrapperStyles({
|
|
39
|
+
backgroundColor,
|
|
40
|
+
styles
|
|
41
|
+
})
|
|
42
|
+
});
|
|
43
|
+
const inputAttrs = createAttr({
|
|
44
|
+
...getInputAttr({
|
|
45
|
+
isDisabled: !isInStock,
|
|
46
|
+
qtyStyle,
|
|
47
|
+
quantity,
|
|
48
|
+
currentVariant,
|
|
49
|
+
defaultQty
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
const inputClass = createClass({
|
|
53
|
+
...getInputClasses({
|
|
54
|
+
styles,
|
|
55
|
+
qtyStyle,
|
|
56
|
+
borderBtn,
|
|
57
|
+
inputBackgroundColor,
|
|
58
|
+
textColor
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
const inputStyle = createStyle({
|
|
62
|
+
...getInputStyle(props)
|
|
63
|
+
});
|
|
64
|
+
const buttonLeftClass = createClass({
|
|
65
|
+
...getButtonClass({
|
|
66
|
+
borderBtn,
|
|
67
|
+
buttonBackgroundColor,
|
|
68
|
+
iconColor,
|
|
69
|
+
buttonSide: 'left'
|
|
70
|
+
})
|
|
71
|
+
});
|
|
72
|
+
const buttonLeftStyle = createStyle({
|
|
73
|
+
...getButtonStyle({
|
|
74
|
+
borderBtn,
|
|
75
|
+
buttonWidth,
|
|
76
|
+
buttonBackgroundColor,
|
|
77
|
+
iconColor,
|
|
78
|
+
corner,
|
|
79
|
+
buttonSide: 'left'
|
|
80
|
+
})
|
|
81
|
+
});
|
|
82
|
+
const buttonLeftAttrs = createAttr({
|
|
83
|
+
...getButtonAttrs({
|
|
84
|
+
isDisabled: !isInStock,
|
|
85
|
+
buttonSide: 'left'
|
|
86
|
+
})
|
|
87
|
+
});
|
|
88
|
+
const buttonRightClass = createClass({
|
|
89
|
+
...getButtonClass({
|
|
90
|
+
borderBtn,
|
|
91
|
+
buttonBackgroundColor,
|
|
92
|
+
iconColor,
|
|
93
|
+
buttonSide: 'right'
|
|
94
|
+
})
|
|
95
|
+
});
|
|
96
|
+
const buttonRightStyle = createStyle({
|
|
97
|
+
...getButtonStyle({
|
|
98
|
+
borderBtn,
|
|
99
|
+
buttonWidth,
|
|
100
|
+
buttonBackgroundColor,
|
|
101
|
+
iconColor,
|
|
102
|
+
corner,
|
|
103
|
+
buttonSide: 'right'
|
|
104
|
+
})
|
|
105
|
+
});
|
|
106
|
+
const buttonRightAttrs = createAttr({
|
|
107
|
+
...getButtonAttrs({
|
|
108
|
+
isDisabled: !isInStock,
|
|
109
|
+
buttonSide: 'right'
|
|
110
|
+
})
|
|
111
|
+
});
|
|
112
|
+
const iconWrapperClass = createClass({
|
|
113
|
+
...getIconWrapperClasses()
|
|
114
|
+
});
|
|
115
|
+
const iconWidth = getIconWidth(iconSizeCustom);
|
|
116
|
+
return /*#__PURE__*/ jsx("div", {
|
|
117
|
+
ref: ref,
|
|
118
|
+
...containerAttrs,
|
|
119
|
+
className: containerClasses,
|
|
120
|
+
style: containerStyles,
|
|
121
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
122
|
+
className: wrapperClasses,
|
|
123
|
+
style: wrapperStyles,
|
|
124
|
+
children: [
|
|
125
|
+
If(qtyStyle === 'standard', /*#__PURE__*/ jsx("button", {
|
|
126
|
+
...buttonLeftAttrs,
|
|
127
|
+
onClick: decrement,
|
|
128
|
+
className: buttonLeftClass,
|
|
129
|
+
style: buttonLeftStyle,
|
|
130
|
+
children: /*#__PURE__*/ jsx("span", {
|
|
131
|
+
className: iconWrapperClass,
|
|
132
|
+
style: iconWidth,
|
|
133
|
+
dangerouslySetInnerHTML: {
|
|
134
|
+
__html: getPlusIcon(plusIcon)
|
|
135
|
+
}
|
|
136
|
+
})
|
|
137
|
+
})),
|
|
138
|
+
/*#__PURE__*/ jsx("input", {
|
|
139
|
+
...inputAttrs,
|
|
140
|
+
className: inputClass,
|
|
141
|
+
style: inputStyle,
|
|
142
|
+
onChange: (e)=>{
|
|
143
|
+
setQuantity(parseInt(e.target.value, 10));
|
|
144
|
+
}
|
|
145
|
+
}),
|
|
146
|
+
If(qtyStyle === 'standard', /*#__PURE__*/ jsx("button", {
|
|
147
|
+
...buttonRightAttrs,
|
|
148
|
+
onClick: increment,
|
|
149
|
+
className: buttonRightClass,
|
|
150
|
+
style: buttonRightStyle,
|
|
151
|
+
children: /*#__PURE__*/ jsx("span", {
|
|
152
|
+
className: iconWrapperClass,
|
|
153
|
+
style: iconWidth,
|
|
154
|
+
dangerouslySetInnerHTML: {
|
|
155
|
+
__html: getMinusIcon(minusIcon)
|
|
156
|
+
}
|
|
157
|
+
})
|
|
158
|
+
}))
|
|
159
|
+
]
|
|
160
|
+
})
|
|
161
|
+
});
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
export { ProductQuantity as default };
|
|
@@ -9,7 +9,7 @@ import '../../../modal/components/confirm.js';
|
|
|
9
9
|
import ProductButton from '../ProductButton/ProductButton.js';
|
|
10
10
|
import ProductImages from '../ProductImages.js';
|
|
11
11
|
import ProductPrice from '../ProductPrice/index.js';
|
|
12
|
-
import ProductQuantity from '../ProductQuantity.js';
|
|
12
|
+
import ProductQuantity from '../ProductQuantity/index.js';
|
|
13
13
|
import ProductTitle from '../ProductTitle/index.js';
|
|
14
14
|
import ProductVariants from '../ProductVariants/index.js';
|
|
15
15
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { composeTypographyStyle, makeStyle, getSingleColorVariable, makeStyleResponsive, makeWidth, getStyleShadowState, getGlobalColorStateStyle, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertBorderColor, composeRadius } from '@gem-sdk/core';
|
|
2
2
|
import { filterTruthyObject } from '../../../../../helpers.js';
|
|
3
3
|
|
|
4
|
-
const getSelectStyle = ({ width, height, optionTypo, optionTypography, optionBgColor, optionTextColor, optionRounded, optionShadow, optionBorder, optionTransform })=>{
|
|
4
|
+
const getSelectStyle = ({ width, height, optionTypo, optionTypography, optionBgColor, optionTextColor, optionRounded, optionHasShadow, optionShadow, optionBorder, optionTransform })=>{
|
|
5
5
|
const appendTypoStyle = composeTypographyStyle(optionTypo, optionTypography);
|
|
6
6
|
const getCustomCSSActiveState = makeStyle({
|
|
7
7
|
bg: getSingleColorVariable(optionBgColor?.active),
|
|
@@ -14,11 +14,7 @@ const getSelectStyle = ({ width, height, optionTypo, optionTypography, optionBgC
|
|
|
14
14
|
...makeStyle({
|
|
15
15
|
h: height
|
|
16
16
|
}),
|
|
17
|
-
...getStyleShadowState(optionShadow, 'box-shadow',
|
|
18
|
-
normal: optionShadow?.normal?.type !== 'none',
|
|
19
|
-
hover: optionShadow?.hover?.type !== 'none',
|
|
20
|
-
active: optionShadow?.active?.type !== 'none'
|
|
21
|
-
}),
|
|
17
|
+
...getStyleShadowState(optionShadow, 'box-shadow', optionHasShadow),
|
|
22
18
|
...getCustomCSSActiveState,
|
|
23
19
|
...makeStyle({
|
|
24
20
|
tt: optionTransform
|
package/dist/esm/product/components/ProductVariants/components/dropdown-swatches/Dropdown.js
CHANGED
|
@@ -10,15 +10,14 @@ import { useDropdownSwatches } from './hooks/useDropdownSwatches.js';
|
|
|
10
10
|
|
|
11
11
|
const DropdownVariant = (props)=>{
|
|
12
12
|
const { option, optionPosition, optionNumber, variantGroup, variants, price, blankText, swatchHeight, optionTypography, optionTransform, initValue, hasPreSelected, optionTypo, combineHeight, combineWidth, soldOutStyle } = props;
|
|
13
|
-
let { optionBgColor, optionTextColor, optionRounded, optionShadow,
|
|
14
|
-
optionBorder } = props;
|
|
13
|
+
let { optionBgColor, optionTextColor, optionRounded, optionShadow, optionHasShadow, optionBorder } = props;
|
|
15
14
|
const { value, preset, handleOnChangeSelect, checkVariantInStock } = useDropdownSwatches(props);
|
|
16
15
|
const isSoldOutMark = soldOutStyle === 'disable';
|
|
17
16
|
if (!variantGroup) {
|
|
18
17
|
optionBgColor = preset?.optionBgColor;
|
|
19
18
|
optionTextColor = preset?.optionTextColor;
|
|
20
19
|
optionBorder = preset?.optionBorder;
|
|
21
|
-
|
|
20
|
+
optionHasShadow = preset?.optionHasShadow;
|
|
22
21
|
optionShadow = preset?.optionShadow;
|
|
23
22
|
optionRounded = preset?.optionRounded;
|
|
24
23
|
}
|
|
@@ -38,6 +37,7 @@ const DropdownVariant = (props)=>{
|
|
|
38
37
|
optionTextColor,
|
|
39
38
|
optionRounded,
|
|
40
39
|
optionShadow,
|
|
40
|
+
optionHasShadow,
|
|
41
41
|
optionBorder,
|
|
42
42
|
optionTransform,
|
|
43
43
|
swatchHeight
|
package/dist/esm/product/components/ProductVariants/components/dropdown-swatches/Dropdown.liquid.js
CHANGED
|
@@ -6,8 +6,7 @@ import { getSelectAttr } from '../../common/dropdown/attrs.js';
|
|
|
6
6
|
import { renderBlankOption, renderDropdownOptions } from '../dropdown-option/render-liquid/index.js';
|
|
7
7
|
|
|
8
8
|
const DropdownVariant = (props)=>{
|
|
9
|
-
const { variantGroup, blankText, swatchAutoWidth, swatchHeight, optionTypography, optionBgColor, optionTextColor, optionRounded, optionShadow,
|
|
10
|
-
optionBorder, optionTransform, hasPreSelected, optionTypo, combineHeight, combineWidth, soldOutStyle, children } = props;
|
|
9
|
+
const { variantGroup, blankText, swatchAutoWidth, swatchHeight, optionTypography, optionBgColor, optionTextColor, optionRounded, optionShadow, optionHasShadow, optionBorder, optionTransform, hasPreSelected, optionTypo, combineHeight, combineWidth, soldOutStyle, children } = props;
|
|
11
10
|
const isSoldOutMark = soldOutStyle === 'disable';
|
|
12
11
|
const selectClass = createClass(getSelectClass({
|
|
13
12
|
optionTypo,
|
|
@@ -24,6 +23,7 @@ const DropdownVariant = (props)=>{
|
|
|
24
23
|
optionBgColor,
|
|
25
24
|
optionTextColor,
|
|
26
25
|
optionRounded,
|
|
26
|
+
optionHasShadow,
|
|
27
27
|
optionShadow,
|
|
28
28
|
optionBorder,
|
|
29
29
|
optionTransform
|
package/dist/esm/product/next.js
CHANGED
|
@@ -10,7 +10,7 @@ const Product = dynamic(()=>import('./components/ProductWrap/Product.js'), {
|
|
|
10
10
|
const ProductTitle = dynamic(()=>import('./components/ProductTitle/index.js'), {
|
|
11
11
|
loading: Loading
|
|
12
12
|
});
|
|
13
|
-
const ProductQuantity = dynamic(()=>import('./components/ProductQuantity.js'), {
|
|
13
|
+
const ProductQuantity = dynamic(()=>import('./components/ProductQuantity/index.js'), {
|
|
14
14
|
loading: Loading
|
|
15
15
|
});
|
|
16
16
|
const ProductDescription = dynamic(()=>import('./components/ProductDescription/index.js'), {
|
|
@@ -189,7 +189,8 @@ const SettingUIV2 = [
|
|
|
189
189
|
},
|
|
190
190
|
setting: {
|
|
191
191
|
id: 'buttonWidth'
|
|
192
|
-
}
|
|
192
|
+
},
|
|
193
|
+
conditionDisplay: 'hasButton === true'
|
|
193
194
|
},
|
|
194
195
|
{
|
|
195
196
|
label: {
|
|
@@ -198,7 +199,8 @@ const SettingUIV2 = [
|
|
|
198
199
|
setting: {
|
|
199
200
|
id: 'buttonBackgroundColor',
|
|
200
201
|
state: 'normal'
|
|
201
|
-
}
|
|
202
|
+
},
|
|
203
|
+
conditionDisplay: 'hasButton === true'
|
|
202
204
|
},
|
|
203
205
|
{
|
|
204
206
|
label: {
|
|
@@ -206,7 +208,8 @@ const SettingUIV2 = [
|
|
|
206
208
|
},
|
|
207
209
|
setting: {
|
|
208
210
|
id: 'plusIcon'
|
|
209
|
-
}
|
|
211
|
+
},
|
|
212
|
+
conditionDisplay: 'hasButton === true'
|
|
210
213
|
},
|
|
211
214
|
{
|
|
212
215
|
label: {
|
|
@@ -214,7 +217,8 @@ const SettingUIV2 = [
|
|
|
214
217
|
},
|
|
215
218
|
setting: {
|
|
216
219
|
id: 'minusIcon'
|
|
217
|
-
}
|
|
220
|
+
},
|
|
221
|
+
conditionDisplay: 'hasButton === true'
|
|
218
222
|
},
|
|
219
223
|
{
|
|
220
224
|
label: {
|
|
@@ -223,7 +227,8 @@ const SettingUIV2 = [
|
|
|
223
227
|
setting: {
|
|
224
228
|
id: 'iconColor',
|
|
225
229
|
state: 'normal'
|
|
226
|
-
}
|
|
230
|
+
},
|
|
231
|
+
conditionDisplay: 'hasButton === true'
|
|
227
232
|
}
|
|
228
233
|
],
|
|
229
234
|
moreSettings: {
|
|
@@ -235,7 +240,8 @@ const SettingUIV2 = [
|
|
|
235
240
|
},
|
|
236
241
|
setting: {
|
|
237
242
|
id: 'iconSizeCustom'
|
|
238
|
-
}
|
|
243
|
+
},
|
|
244
|
+
conditionDisplay: 'hasButton === true'
|
|
239
245
|
},
|
|
240
246
|
{
|
|
241
247
|
label: {
|
|
@@ -248,6 +254,7 @@ const SettingUIV2 = [
|
|
|
248
254
|
popoverLabel: {
|
|
249
255
|
en: 'Hover effect'
|
|
250
256
|
},
|
|
257
|
+
conditionDisplay: 'hasButton === true',
|
|
251
258
|
controls: [
|
|
252
259
|
{
|
|
253
260
|
label: {
|
|
@@ -616,7 +616,8 @@ const ProductVariantSettings = [
|
|
|
616
616
|
blur: '12px',
|
|
617
617
|
spread: '0px',
|
|
618
618
|
color: 'rgba(0, 0, 0, 0.20)',
|
|
619
|
-
angle: 90
|
|
619
|
+
angle: 90,
|
|
620
|
+
enable: false
|
|
620
621
|
},
|
|
621
622
|
hover: {
|
|
622
623
|
type: 'shadow-1',
|
|
@@ -624,7 +625,8 @@ const ProductVariantSettings = [
|
|
|
624
625
|
blur: '12px',
|
|
625
626
|
spread: '0px',
|
|
626
627
|
color: 'rgba(0, 0, 0, 0.20)',
|
|
627
|
-
angle: 90
|
|
628
|
+
angle: 90,
|
|
629
|
+
enable: false
|
|
628
630
|
},
|
|
629
631
|
active: {
|
|
630
632
|
type: 'shadow-1',
|
|
@@ -632,7 +634,8 @@ const ProductVariantSettings = [
|
|
|
632
634
|
blur: '12px',
|
|
633
635
|
spread: '0px',
|
|
634
636
|
color: 'rgba(0, 0, 0, 0.20)',
|
|
635
|
-
angle: 90
|
|
637
|
+
angle: 90,
|
|
638
|
+
enable: false
|
|
636
639
|
}
|
|
637
640
|
},
|
|
638
641
|
state: {
|
|
@@ -186,13 +186,66 @@ const SettingUIV2 = [
|
|
|
186
186
|
state: 'normal'
|
|
187
187
|
}
|
|
188
188
|
},
|
|
189
|
+
{
|
|
190
|
+
label: {
|
|
191
|
+
en: 'Has Shadow'
|
|
192
|
+
},
|
|
193
|
+
setting: {
|
|
194
|
+
id: 'optionHasShadow',
|
|
195
|
+
state: 'active'
|
|
196
|
+
}
|
|
197
|
+
},
|
|
189
198
|
{
|
|
190
199
|
label: {
|
|
191
200
|
en: 'Shadow'
|
|
192
201
|
},
|
|
193
202
|
setting: {
|
|
194
203
|
id: 'optionShadow',
|
|
195
|
-
state: '
|
|
204
|
+
state: 'active'
|
|
205
|
+
},
|
|
206
|
+
options: {
|
|
207
|
+
updateFields: [
|
|
208
|
+
{
|
|
209
|
+
field: 'enable',
|
|
210
|
+
settingId: 'optionHasShadow',
|
|
211
|
+
state: 'active'
|
|
212
|
+
}
|
|
213
|
+
]
|
|
214
|
+
},
|
|
215
|
+
controlChangeTrigger: {
|
|
216
|
+
settings: [
|
|
217
|
+
{
|
|
218
|
+
condition: `optionShadow.active.enable === true`,
|
|
219
|
+
source: [
|
|
220
|
+
'optionShadow',
|
|
221
|
+
'optionHasShadow'
|
|
222
|
+
],
|
|
223
|
+
action: {
|
|
224
|
+
controlId: 'optionHasShadow',
|
|
225
|
+
groupType: 'setting',
|
|
226
|
+
controlType: 'setting',
|
|
227
|
+
state: 'active',
|
|
228
|
+
newValue: true
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
condition: `optionShadow.active.enable === false`,
|
|
233
|
+
source: [
|
|
234
|
+
'optionShadow',
|
|
235
|
+
'optionHasShadow'
|
|
236
|
+
],
|
|
237
|
+
action: {
|
|
238
|
+
controlId: 'optionHasShadow',
|
|
239
|
+
groupType: 'setting',
|
|
240
|
+
controlType: 'setting',
|
|
241
|
+
state: 'active',
|
|
242
|
+
newValue: false
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
],
|
|
246
|
+
options: {
|
|
247
|
+
noRecordHistory: true
|
|
248
|
+
}
|
|
196
249
|
}
|
|
197
250
|
}
|
|
198
251
|
]
|
|
@@ -239,6 +292,15 @@ const SettingUIV2 = [
|
|
|
239
292
|
state: 'hover'
|
|
240
293
|
}
|
|
241
294
|
},
|
|
295
|
+
{
|
|
296
|
+
label: {
|
|
297
|
+
en: 'Has Shadow'
|
|
298
|
+
},
|
|
299
|
+
setting: {
|
|
300
|
+
id: 'optionHasShadow',
|
|
301
|
+
state: 'hover'
|
|
302
|
+
}
|
|
303
|
+
},
|
|
242
304
|
{
|
|
243
305
|
label: {
|
|
244
306
|
en: 'Shadow'
|
|
@@ -246,6 +308,50 @@ const SettingUIV2 = [
|
|
|
246
308
|
setting: {
|
|
247
309
|
id: 'optionShadow',
|
|
248
310
|
state: 'hover'
|
|
311
|
+
},
|
|
312
|
+
options: {
|
|
313
|
+
updateFields: [
|
|
314
|
+
{
|
|
315
|
+
field: 'enable',
|
|
316
|
+
settingId: 'optionHasShadow',
|
|
317
|
+
state: 'hover'
|
|
318
|
+
}
|
|
319
|
+
]
|
|
320
|
+
},
|
|
321
|
+
controlChangeTrigger: {
|
|
322
|
+
settings: [
|
|
323
|
+
{
|
|
324
|
+
condition: `optionShadow.hover.enable === true`,
|
|
325
|
+
source: [
|
|
326
|
+
'optionShadow',
|
|
327
|
+
'optionHasShadow'
|
|
328
|
+
],
|
|
329
|
+
action: {
|
|
330
|
+
controlId: 'optionHasShadow',
|
|
331
|
+
groupType: 'setting',
|
|
332
|
+
controlType: 'setting',
|
|
333
|
+
state: 'hover',
|
|
334
|
+
newValue: true
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
condition: `optionShadow.hover.enable === false`,
|
|
339
|
+
source: [
|
|
340
|
+
'optionShadow',
|
|
341
|
+
'optionHasShadow'
|
|
342
|
+
],
|
|
343
|
+
action: {
|
|
344
|
+
controlId: 'optionHasShadow',
|
|
345
|
+
groupType: 'setting',
|
|
346
|
+
controlType: 'setting',
|
|
347
|
+
state: 'hover',
|
|
348
|
+
newValue: false
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
],
|
|
352
|
+
options: {
|
|
353
|
+
noRecordHistory: true
|
|
354
|
+
}
|
|
249
355
|
}
|
|
250
356
|
}
|
|
251
357
|
]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { makeStyle, makeStyleResponsive, makeGlobalSize, composeBorderResponsive, composeRadiusResponsive, getResponsiveStyleShadowWithoutState,
|
|
1
|
+
import { makeStyle, makeStyleResponsive, makeGlobalSize, composeBorderResponsive, composeRadiusResponsive, getResponsiveStyleShadowWithoutState, getStyleShadow, makeLineClamp, getGlobalColorStyle, getGlobalColorStateStyle, composeTypographyStyle, getStyleBackgroundByDevice, getGradientBgrStyleByDevice } from '@gem-sdk/core';
|
|
2
2
|
import { formatThickness } from './common.js';
|
|
3
3
|
|
|
4
4
|
function filterTruthyStyles(styles) {
|
|
@@ -37,11 +37,10 @@ const getTextStyle = (styles, setting)=>{
|
|
|
37
37
|
...composeBorderResponsive(styles?.shapeBorder),
|
|
38
38
|
...composeRadiusResponsive(styles?.shapeRounded),
|
|
39
39
|
...getResponsiveStyleShadowWithoutState(styles?.shapeBoxShadow, 'box-shadow', styles?.shapeBoxShadow),
|
|
40
|
-
...getStyleShadowState(styles?.textShadow, 'text-shadow', styles?.hasTextShadow),
|
|
41
40
|
...getStyleShadow({
|
|
42
41
|
value: styles?.typo?.custom?.textShadow,
|
|
43
42
|
styleAppliedFor: 'text-shadow',
|
|
44
|
-
isEnableShadow: styles?.typo?.custom?.
|
|
43
|
+
isEnableShadow: styles?.typo?.custom?.hasShadowText
|
|
45
44
|
}),
|
|
46
45
|
...makeStyleResponsive('ta', styles?.textAlign),
|
|
47
46
|
...makeStyleResponsive('line-clamp', makeLineClamp(styles?.lineClamp, styles?.hasLineClamp)),
|
|
@@ -342,7 +342,9 @@ const TextSettings = [
|
|
|
342
342
|
type: 'shadow-v2',
|
|
343
343
|
devices: {
|
|
344
344
|
desktop: {
|
|
345
|
-
default: {
|
|
345
|
+
default: {
|
|
346
|
+
enable: false
|
|
347
|
+
}
|
|
346
348
|
}
|
|
347
349
|
},
|
|
348
350
|
compoDefaultValue: {
|
|
@@ -353,7 +355,8 @@ const TextSettings = [
|
|
|
353
355
|
blur: '12px',
|
|
354
356
|
spread: '0px',
|
|
355
357
|
color: 'rgba(18, 18, 18, 0.2)',
|
|
356
|
-
angle: 45
|
|
358
|
+
angle: 45,
|
|
359
|
+
enable: true
|
|
357
360
|
}
|
|
358
361
|
}
|
|
359
362
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3228,30 +3228,6 @@ type bundleItem = {
|
|
|
3228
3228
|
discountValue: string;
|
|
3229
3229
|
discountType: 'percentage' | 'fixed_amount' | 'no_discount';
|
|
3230
3230
|
};
|
|
3231
|
-
type ProductQuantityProps$1 = BaseProps<{
|
|
3232
|
-
qtyStyle?: string;
|
|
3233
|
-
defaultQtyValue?: number;
|
|
3234
|
-
updatePrice?: boolean;
|
|
3235
|
-
}, {
|
|
3236
|
-
fullWidth?: ObjectDevices$1<boolean>;
|
|
3237
|
-
inputWidth?: ObjectDevices$1<string | number | undefined>;
|
|
3238
|
-
inputHeight?: ObjectDevices$1<string | number | undefined>;
|
|
3239
|
-
buttonWidth?: ObjectDevices$1<string | number | undefined>;
|
|
3240
|
-
/**
|
|
3241
|
-
* @deprecated use `typo` instead
|
|
3242
|
-
*/
|
|
3243
|
-
typography?: TypographySetting$1;
|
|
3244
|
-
typo?: TypographySettingV2;
|
|
3245
|
-
align?: ObjectDevices$1<AlignProp>;
|
|
3246
|
-
inputBackgroundColor?: StateProp<ColorValueType$1>;
|
|
3247
|
-
textColor?: StateProp<ColorValueType$1>;
|
|
3248
|
-
buttonBackgroundColor?: StateProp<ColorValueType$1>;
|
|
3249
|
-
iconColor?: StateProp<ColorValueType$1>;
|
|
3250
|
-
borderBtn?: ObjectDevices$1<StateProp<Border>>;
|
|
3251
|
-
lineSeparated?: boolean;
|
|
3252
|
-
iconSizeCustom?: ObjectDevices$1<Ratio | string | number>;
|
|
3253
|
-
corner?: ObjectDevices$1<StateProp<CornerRadius>>;
|
|
3254
|
-
}>;
|
|
3255
3231
|
|
|
3256
3232
|
type ProductPriceProps = BasePropsWrap<{
|
|
3257
3233
|
moneyWithCurrentFormat?: boolean;
|
|
@@ -3891,7 +3867,7 @@ declare const Product$1: React.FC<ProductProps>;
|
|
|
3891
3867
|
|
|
3892
3868
|
declare const ProductTitle$1: React.FC<ProductTitleProps>;
|
|
3893
3869
|
|
|
3894
|
-
declare const ProductQuantity$1: React.FC<ProductQuantityProps
|
|
3870
|
+
declare const ProductQuantity$1: React.FC<ProductQuantityProps>;
|
|
3895
3871
|
|
|
3896
3872
|
declare const ProductDescription$1: React.FC<ProductDescriptionProps>;
|
|
3897
3873
|
|
|
@@ -5627,7 +5603,7 @@ declare const _default$2: {
|
|
|
5627
5603
|
Radio: React.ComponentType<RadioProps>;
|
|
5628
5604
|
Product: React.ComponentType<ProductProps>;
|
|
5629
5605
|
ProductTitle: React.ComponentType<ProductTitleProps>;
|
|
5630
|
-
ProductQuantity: React.ComponentType<ProductQuantityProps
|
|
5606
|
+
ProductQuantity: React.ComponentType<ProductQuantityProps>;
|
|
5631
5607
|
ProductPrice: React.ComponentType<ProductPriceProps>;
|
|
5632
5608
|
ProductButton: React.ComponentType<ProductButtonProps>;
|
|
5633
5609
|
ProductDescription: React.ComponentType<ProductDescriptionProps>;
|
|
@@ -7235,7 +7211,7 @@ declare const _default$1: {
|
|
|
7235
7211
|
RechargeSubscriptions: React.FC<RechargeSubscriptionsProps>;
|
|
7236
7212
|
Product: React.FC<ProductProps>;
|
|
7237
7213
|
ProductTitle: React.FC<ProductTitleProps>;
|
|
7238
|
-
ProductQuantity: React.FC<ProductQuantityProps
|
|
7214
|
+
ProductQuantity: React.FC<ProductQuantityProps>;
|
|
7239
7215
|
ProductPrice: React.FC<ProductPriceProps>;
|
|
7240
7216
|
ProductSku: React.FC<SkuProps>;
|
|
7241
7217
|
FileUpload: React.FC<FileUploadProps>;
|
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.360",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"relationship": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/get-control-relationship.js && node ./scripts/get-element-relationship.js"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@gem-sdk/core": "2.0.0-dev.
|
|
25
|
+
"@gem-sdk/core": "2.0.0-dev.360",
|
|
26
26
|
"@gem-sdk/styles": "2.0.0-dev.324",
|
|
27
27
|
"@gem-sdk/system": "2.0.0-dev.324",
|
|
28
28
|
"@types/react-transition-group": "^4.4.5"
|