@gem-sdk/components 2.0.0-dev.359 → 2.0.0-dev.361
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-discount-tag/settingV2.js +1 -0
- package/dist/cjs/post-purchase/product/settings/product-image/setting-v2.js +2 -2
- 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-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-discount-tag/settingV2.js +1 -0
- package/dist/esm/post-purchase/product/settings/product-image/setting-v2.js +2 -2
- 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-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
package/dist/cjs/product/components/ProductVariants/components/dropdown-swatches/Dropdown.js
CHANGED
|
@@ -14,15 +14,14 @@ var useDropdownSwatches = require('./hooks/useDropdownSwatches.js');
|
|
|
14
14
|
|
|
15
15
|
const DropdownVariant = (props)=>{
|
|
16
16
|
const { option, optionPosition, optionNumber, variantGroup, variants, price, blankText, swatchHeight, optionTypography, optionTransform, initValue, hasPreSelected, optionTypo, combineHeight, combineWidth, soldOutStyle } = props;
|
|
17
|
-
let { optionBgColor, optionTextColor, optionRounded, optionShadow,
|
|
18
|
-
optionBorder } = props;
|
|
17
|
+
let { optionBgColor, optionTextColor, optionRounded, optionShadow, optionHasShadow, optionBorder } = props;
|
|
19
18
|
const { value, preset, handleOnChangeSelect, checkVariantInStock } = useDropdownSwatches.useDropdownSwatches(props);
|
|
20
19
|
const isSoldOutMark = soldOutStyle === 'disable';
|
|
21
20
|
if (!variantGroup) {
|
|
22
21
|
optionBgColor = preset?.optionBgColor;
|
|
23
22
|
optionTextColor = preset?.optionTextColor;
|
|
24
23
|
optionBorder = preset?.optionBorder;
|
|
25
|
-
|
|
24
|
+
optionHasShadow = preset?.optionHasShadow;
|
|
26
25
|
optionShadow = preset?.optionShadow;
|
|
27
26
|
optionRounded = preset?.optionRounded;
|
|
28
27
|
}
|
|
@@ -42,6 +41,7 @@ const DropdownVariant = (props)=>{
|
|
|
42
41
|
optionTextColor,
|
|
43
42
|
optionRounded,
|
|
44
43
|
optionShadow,
|
|
44
|
+
optionHasShadow,
|
|
45
45
|
optionBorder,
|
|
46
46
|
optionTransform,
|
|
47
47
|
swatchHeight
|
package/dist/cjs/product/components/ProductVariants/components/dropdown-swatches/Dropdown.liquid.js
CHANGED
|
@@ -10,8 +10,7 @@ var attrs = require('../../common/dropdown/attrs.js');
|
|
|
10
10
|
var index = require('../dropdown-option/render-liquid/index.js');
|
|
11
11
|
|
|
12
12
|
const DropdownVariant = (props)=>{
|
|
13
|
-
const { variantGroup, blankText, swatchAutoWidth, swatchHeight, optionTypography, optionBgColor, optionTextColor, optionRounded, optionShadow,
|
|
14
|
-
optionBorder, optionTransform, hasPreSelected, optionTypo, combineHeight, combineWidth, soldOutStyle, children } = props;
|
|
13
|
+
const { variantGroup, blankText, swatchAutoWidth, swatchHeight, optionTypography, optionBgColor, optionTextColor, optionRounded, optionShadow, optionHasShadow, optionBorder, optionTransform, hasPreSelected, optionTypo, combineHeight, combineWidth, soldOutStyle, children } = props;
|
|
15
14
|
const isSoldOutMark = soldOutStyle === 'disable';
|
|
16
15
|
const selectClass = system.createClass(classes.getSelectClass({
|
|
17
16
|
optionTypo,
|
|
@@ -28,6 +27,7 @@ const DropdownVariant = (props)=>{
|
|
|
28
27
|
optionBgColor,
|
|
29
28
|
optionTextColor,
|
|
30
29
|
optionRounded,
|
|
30
|
+
optionHasShadow,
|
|
31
31
|
optionShadow,
|
|
32
32
|
optionBorder,
|
|
33
33
|
optionTransform
|
|
@@ -15,7 +15,7 @@ require('@gem-sdk/keen-slider/react');
|
|
|
15
15
|
require('react-dom');
|
|
16
16
|
require('../modal/components/confirm.js');
|
|
17
17
|
require('../video/components/Video.js');
|
|
18
|
-
var index$
|
|
18
|
+
var index$6 = require('./components/ProductQuickView/index.js');
|
|
19
19
|
require('./components/constants/product-bundle.js');
|
|
20
20
|
var ProductList = require('./components/ProductList/ProductList.js');
|
|
21
21
|
require('./components/ProductBundle/common/styles.js');
|
|
@@ -24,7 +24,7 @@ require('./components/ProductBadge/constants.js');
|
|
|
24
24
|
require('./components/ProductBadge/types.js');
|
|
25
25
|
require('./components/ProductBadge/utils/shape.js');
|
|
26
26
|
var Product$1 = require('./setting/Product.js');
|
|
27
|
-
var ProductQuantity
|
|
27
|
+
var ProductQuantity = require('./setting/ProductQuantity.js');
|
|
28
28
|
var ProductTitle = require('./setting/ProductTitle.js');
|
|
29
29
|
var ProductButton$1 = require('./setting/ProductButton.js');
|
|
30
30
|
var ProductPrice = require('./setting/ProductPrice.js');
|
|
@@ -42,11 +42,11 @@ var ProductBundleDiscount$1 = require('./components/ProductBundle/setting/Produc
|
|
|
42
42
|
var ProductBundleDiscountItem$1 = require('./components/ProductBundle/setting/ProductBundleDiscountItem.js');
|
|
43
43
|
var ProductViewMore$1 = require('./setting/ProductViewMore.js');
|
|
44
44
|
var ProductBadge = require('./setting/ProductBadge.js');
|
|
45
|
-
var index$
|
|
45
|
+
var index$8 = require('./components/FileUpload/components/setting/index.js');
|
|
46
46
|
|
|
47
47
|
const productSetting = {
|
|
48
48
|
Product: Product$1.default,
|
|
49
|
-
ProductQuantity: ProductQuantity
|
|
49
|
+
ProductQuantity: ProductQuantity.default,
|
|
50
50
|
ProductTitle: ProductTitle.default,
|
|
51
51
|
ProductButton: ProductButton$1.default,
|
|
52
52
|
ProductPrice: ProductPrice.default,
|
|
@@ -64,10 +64,10 @@ const productSetting = {
|
|
|
64
64
|
ProductBundleDiscountItem: ProductBundleDiscountItem$1.default,
|
|
65
65
|
ProductViewMore: ProductViewMore$1.default,
|
|
66
66
|
ProductBadge: ProductBadge.default,
|
|
67
|
-
FileUpload: index$
|
|
67
|
+
FileUpload: index$8.default
|
|
68
68
|
};
|
|
69
69
|
|
|
70
70
|
exports.Product = Product.default;
|
|
71
|
-
exports.ProductQuickView = index$
|
|
71
|
+
exports.ProductQuickView = index$6.default;
|
|
72
72
|
exports.ProductList = ProductList.default;
|
|
73
73
|
exports.productSetting = productSetting;
|
package/dist/cjs/product/next.js
CHANGED
|
@@ -14,7 +14,7 @@ const Product = dynamic(()=>Promise.resolve().then(function () { return require(
|
|
|
14
14
|
const ProductTitle = dynamic(()=>Promise.resolve().then(function () { return require('./components/ProductTitle/index.js'); }), {
|
|
15
15
|
loading: Loading.default
|
|
16
16
|
});
|
|
17
|
-
const ProductQuantity = dynamic(()=>Promise.resolve().then(function () { return require('./components/ProductQuantity.js'); }), {
|
|
17
|
+
const ProductQuantity = dynamic(()=>Promise.resolve().then(function () { return require('./components/ProductQuantity/index.js'); }), {
|
|
18
18
|
loading: Loading.default
|
|
19
19
|
});
|
|
20
20
|
const ProductDescription = dynamic(()=>Promise.resolve().then(function () { return require('./components/ProductDescription/index.js'); }), {
|
|
@@ -618,7 +618,8 @@ const ProductVariantSettings = [
|
|
|
618
618
|
blur: '12px',
|
|
619
619
|
spread: '0px',
|
|
620
620
|
color: 'rgba(0, 0, 0, 0.20)',
|
|
621
|
-
angle: 90
|
|
621
|
+
angle: 90,
|
|
622
|
+
enable: false
|
|
622
623
|
},
|
|
623
624
|
hover: {
|
|
624
625
|
type: 'shadow-1',
|
|
@@ -626,7 +627,8 @@ const ProductVariantSettings = [
|
|
|
626
627
|
blur: '12px',
|
|
627
628
|
spread: '0px',
|
|
628
629
|
color: 'rgba(0, 0, 0, 0.20)',
|
|
629
|
-
angle: 90
|
|
630
|
+
angle: 90,
|
|
631
|
+
enable: false
|
|
630
632
|
},
|
|
631
633
|
active: {
|
|
632
634
|
type: 'shadow-1',
|
|
@@ -634,7 +636,8 @@ const ProductVariantSettings = [
|
|
|
634
636
|
blur: '12px',
|
|
635
637
|
spread: '0px',
|
|
636
638
|
color: 'rgba(0, 0, 0, 0.20)',
|
|
637
|
-
angle: 90
|
|
639
|
+
angle: 90,
|
|
640
|
+
enable: false
|
|
638
641
|
}
|
|
639
642
|
},
|
|
640
643
|
state: {
|
|
@@ -188,13 +188,66 @@ const SettingUIV2 = [
|
|
|
188
188
|
state: 'normal'
|
|
189
189
|
}
|
|
190
190
|
},
|
|
191
|
+
{
|
|
192
|
+
label: {
|
|
193
|
+
en: 'Has Shadow'
|
|
194
|
+
},
|
|
195
|
+
setting: {
|
|
196
|
+
id: 'optionHasShadow',
|
|
197
|
+
state: 'active'
|
|
198
|
+
}
|
|
199
|
+
},
|
|
191
200
|
{
|
|
192
201
|
label: {
|
|
193
202
|
en: 'Shadow'
|
|
194
203
|
},
|
|
195
204
|
setting: {
|
|
196
205
|
id: 'optionShadow',
|
|
197
|
-
state: '
|
|
206
|
+
state: 'active'
|
|
207
|
+
},
|
|
208
|
+
options: {
|
|
209
|
+
updateFields: [
|
|
210
|
+
{
|
|
211
|
+
field: 'enable',
|
|
212
|
+
settingId: 'optionHasShadow',
|
|
213
|
+
state: 'active'
|
|
214
|
+
}
|
|
215
|
+
]
|
|
216
|
+
},
|
|
217
|
+
controlChangeTrigger: {
|
|
218
|
+
settings: [
|
|
219
|
+
{
|
|
220
|
+
condition: `optionShadow.active.enable === true`,
|
|
221
|
+
source: [
|
|
222
|
+
'optionShadow',
|
|
223
|
+
'optionHasShadow'
|
|
224
|
+
],
|
|
225
|
+
action: {
|
|
226
|
+
controlId: 'optionHasShadow',
|
|
227
|
+
groupType: 'setting',
|
|
228
|
+
controlType: 'setting',
|
|
229
|
+
state: 'active',
|
|
230
|
+
newValue: true
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
condition: `optionShadow.active.enable === false`,
|
|
235
|
+
source: [
|
|
236
|
+
'optionShadow',
|
|
237
|
+
'optionHasShadow'
|
|
238
|
+
],
|
|
239
|
+
action: {
|
|
240
|
+
controlId: 'optionHasShadow',
|
|
241
|
+
groupType: 'setting',
|
|
242
|
+
controlType: 'setting',
|
|
243
|
+
state: 'active',
|
|
244
|
+
newValue: false
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
],
|
|
248
|
+
options: {
|
|
249
|
+
noRecordHistory: true
|
|
250
|
+
}
|
|
198
251
|
}
|
|
199
252
|
}
|
|
200
253
|
]
|
|
@@ -241,6 +294,15 @@ const SettingUIV2 = [
|
|
|
241
294
|
state: 'hover'
|
|
242
295
|
}
|
|
243
296
|
},
|
|
297
|
+
{
|
|
298
|
+
label: {
|
|
299
|
+
en: 'Has Shadow'
|
|
300
|
+
},
|
|
301
|
+
setting: {
|
|
302
|
+
id: 'optionHasShadow',
|
|
303
|
+
state: 'hover'
|
|
304
|
+
}
|
|
305
|
+
},
|
|
244
306
|
{
|
|
245
307
|
label: {
|
|
246
308
|
en: 'Shadow'
|
|
@@ -248,6 +310,50 @@ const SettingUIV2 = [
|
|
|
248
310
|
setting: {
|
|
249
311
|
id: 'optionShadow',
|
|
250
312
|
state: 'hover'
|
|
313
|
+
},
|
|
314
|
+
options: {
|
|
315
|
+
updateFields: [
|
|
316
|
+
{
|
|
317
|
+
field: 'enable',
|
|
318
|
+
settingId: 'optionHasShadow',
|
|
319
|
+
state: 'hover'
|
|
320
|
+
}
|
|
321
|
+
]
|
|
322
|
+
},
|
|
323
|
+
controlChangeTrigger: {
|
|
324
|
+
settings: [
|
|
325
|
+
{
|
|
326
|
+
condition: `optionShadow.hover.enable === true`,
|
|
327
|
+
source: [
|
|
328
|
+
'optionShadow',
|
|
329
|
+
'optionHasShadow'
|
|
330
|
+
],
|
|
331
|
+
action: {
|
|
332
|
+
controlId: 'optionHasShadow',
|
|
333
|
+
groupType: 'setting',
|
|
334
|
+
controlType: 'setting',
|
|
335
|
+
state: 'hover',
|
|
336
|
+
newValue: true
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
condition: `optionShadow.hover.enable === false`,
|
|
341
|
+
source: [
|
|
342
|
+
'optionShadow',
|
|
343
|
+
'optionHasShadow'
|
|
344
|
+
],
|
|
345
|
+
action: {
|
|
346
|
+
controlId: 'optionHasShadow',
|
|
347
|
+
groupType: 'setting',
|
|
348
|
+
controlType: 'setting',
|
|
349
|
+
state: 'hover',
|
|
350
|
+
newValue: false
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
],
|
|
354
|
+
options: {
|
|
355
|
+
noRecordHistory: true
|
|
356
|
+
}
|
|
251
357
|
}
|
|
252
358
|
}
|
|
253
359
|
]
|
|
@@ -39,11 +39,10 @@ const getTextStyle = (styles, setting)=>{
|
|
|
39
39
|
...core.composeBorderResponsive(styles?.shapeBorder),
|
|
40
40
|
...core.composeRadiusResponsive(styles?.shapeRounded),
|
|
41
41
|
...core.getResponsiveStyleShadowWithoutState(styles?.shapeBoxShadow, 'box-shadow', styles?.shapeBoxShadow),
|
|
42
|
-
...core.getStyleShadowState(styles?.textShadow, 'text-shadow', styles?.hasTextShadow),
|
|
43
42
|
...core.getStyleShadow({
|
|
44
43
|
value: styles?.typo?.custom?.textShadow,
|
|
45
44
|
styleAppliedFor: 'text-shadow',
|
|
46
|
-
isEnableShadow: styles?.typo?.custom?.
|
|
45
|
+
isEnableShadow: styles?.typo?.custom?.hasShadowText
|
|
47
46
|
}),
|
|
48
47
|
...core.makeStyleResponsive('ta', styles?.textAlign),
|
|
49
48
|
...core.makeStyleResponsive('line-clamp', core.makeLineClamp(styles?.lineClamp, styles?.hasLineClamp)),
|
|
@@ -344,7 +344,9 @@ const TextSettings = [
|
|
|
344
344
|
type: 'shadow-v2',
|
|
345
345
|
devices: {
|
|
346
346
|
desktop: {
|
|
347
|
-
default: {
|
|
347
|
+
default: {
|
|
348
|
+
enable: false
|
|
349
|
+
}
|
|
348
350
|
}
|
|
349
351
|
},
|
|
350
352
|
compoDefaultValue: {
|
|
@@ -355,7 +357,8 @@ const TextSettings = [
|
|
|
355
357
|
blur: '12px',
|
|
356
358
|
spread: '0px',
|
|
357
359
|
color: 'rgba(18, 18, 18, 0.2)',
|
|
358
|
-
angle: 45
|
|
360
|
+
angle: 45,
|
|
361
|
+
enable: true
|
|
359
362
|
}
|
|
360
363
|
}
|
|
361
364
|
}
|
package/dist/esm/builder.js
CHANGED
|
@@ -219,7 +219,7 @@ import HextomFreeShippingBar from './third-party/components/HextomFreeShippingBa
|
|
|
219
219
|
import EcoboostifyShoppableReelUgc from './third-party/components/EcoboostifyShoppableReelUgc.js';
|
|
220
220
|
import Product from './product/components/ProductWrap/Product.js';
|
|
221
221
|
import ProductTitle from './product/components/ProductTitle/index.js';
|
|
222
|
-
import ProductQuantity from './product/components/ProductQuantity.js';
|
|
222
|
+
import ProductQuantity from './product/components/ProductQuantity/index.js';
|
|
223
223
|
import ProductDescription from './product/components/ProductDescription/index.js';
|
|
224
224
|
import ProductPrice from './product/components/ProductPrice/index.js';
|
|
225
225
|
import ProductButton from './product/components/ProductButton/ProductButton.js';
|
|
@@ -206,6 +206,50 @@ const SettingUIV2 = [
|
|
|
206
206
|
setting: {
|
|
207
207
|
id: 'boxShadow',
|
|
208
208
|
state: 'normal'
|
|
209
|
+
},
|
|
210
|
+
options: {
|
|
211
|
+
updateFields: [
|
|
212
|
+
{
|
|
213
|
+
field: 'enable',
|
|
214
|
+
settingId: 'advanced.hasBoxShadow',
|
|
215
|
+
state: 'normal'
|
|
216
|
+
}
|
|
217
|
+
]
|
|
218
|
+
},
|
|
219
|
+
controlChangeTrigger: {
|
|
220
|
+
settings: [
|
|
221
|
+
{
|
|
222
|
+
condition: `boxShadow.normal.enable === true`,
|
|
223
|
+
source: [
|
|
224
|
+
'boxShadow',
|
|
225
|
+
'hasBoxShadow'
|
|
226
|
+
],
|
|
227
|
+
action: {
|
|
228
|
+
controlId: 'hasBoxShadow',
|
|
229
|
+
groupType: 'advanced',
|
|
230
|
+
controlType: 'advanced',
|
|
231
|
+
state: 'normal',
|
|
232
|
+
newValue: true
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
condition: `boxShadow.normal.enable === false`,
|
|
237
|
+
source: [
|
|
238
|
+
'boxShadow',
|
|
239
|
+
'hasBoxShadow'
|
|
240
|
+
],
|
|
241
|
+
action: {
|
|
242
|
+
controlId: 'hasBoxShadow',
|
|
243
|
+
groupType: 'advanced',
|
|
244
|
+
controlType: 'advanced',
|
|
245
|
+
state: 'normal',
|
|
246
|
+
newValue: false
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
],
|
|
250
|
+
options: {
|
|
251
|
+
noRecordHistory: true
|
|
252
|
+
}
|
|
209
253
|
}
|
|
210
254
|
}
|
|
211
255
|
]
|
|
@@ -210,6 +210,50 @@ const SettingUIV2 = [
|
|
|
210
210
|
controlConfig: {
|
|
211
211
|
id: 'boxShadow',
|
|
212
212
|
type: 'shadow-v2'
|
|
213
|
+
},
|
|
214
|
+
options: {
|
|
215
|
+
updateFields: [
|
|
216
|
+
{
|
|
217
|
+
field: 'enable',
|
|
218
|
+
settingId: 'advanced.hasBoxShadow',
|
|
219
|
+
state: 'normal'
|
|
220
|
+
}
|
|
221
|
+
]
|
|
222
|
+
},
|
|
223
|
+
controlChangeTrigger: {
|
|
224
|
+
settings: [
|
|
225
|
+
{
|
|
226
|
+
condition: `boxShadow.normal.enable === true`,
|
|
227
|
+
source: [
|
|
228
|
+
'boxShadow',
|
|
229
|
+
'hasBoxShadow'
|
|
230
|
+
],
|
|
231
|
+
action: {
|
|
232
|
+
controlId: 'hasBoxShadow',
|
|
233
|
+
groupType: 'advanced',
|
|
234
|
+
controlType: 'advanced',
|
|
235
|
+
state: 'normal',
|
|
236
|
+
newValue: true
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
condition: `boxShadow.normal.enable === false`,
|
|
241
|
+
source: [
|
|
242
|
+
'boxShadow',
|
|
243
|
+
'hasBoxShadow'
|
|
244
|
+
],
|
|
245
|
+
action: {
|
|
246
|
+
controlId: 'hasBoxShadow',
|
|
247
|
+
groupType: 'advanced',
|
|
248
|
+
controlType: 'advanced',
|
|
249
|
+
state: 'normal',
|
|
250
|
+
newValue: false
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
],
|
|
254
|
+
options: {
|
|
255
|
+
noRecordHistory: true
|
|
256
|
+
}
|
|
213
257
|
}
|
|
214
258
|
}
|
|
215
259
|
]
|
|
@@ -316,7 +316,9 @@ const HeadingSettings = [
|
|
|
316
316
|
type: 'shadow-v2',
|
|
317
317
|
devices: {
|
|
318
318
|
desktop: {
|
|
319
|
-
default: {
|
|
319
|
+
default: {
|
|
320
|
+
enable: false
|
|
321
|
+
}
|
|
320
322
|
}
|
|
321
323
|
},
|
|
322
324
|
compoDefaultValue: {
|
|
@@ -327,7 +329,8 @@ const HeadingSettings = [
|
|
|
327
329
|
blur: '12px',
|
|
328
330
|
spread: '0px',
|
|
329
331
|
color: 'rgba(18, 18, 18, 0.2)',
|
|
330
|
-
angle: 45
|
|
332
|
+
angle: 45,
|
|
333
|
+
enable: true
|
|
331
334
|
}
|
|
332
335
|
}
|
|
333
336
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -169,7 +169,7 @@ export { postPurchaseProduct2Col } from './post-purchase/product/settings/preset
|
|
|
169
169
|
export { postPurchaseProductDefault } from './post-purchase/product/settings/presets-config/product-presets/product-default.js';
|
|
170
170
|
export { default as Product } from './product/components/ProductWrap/Product.js';
|
|
171
171
|
export { default as ProductTitle } from './product/components/ProductTitle/index.js';
|
|
172
|
-
export { default as ProductQuantity } from './product/components/ProductQuantity.js';
|
|
172
|
+
export { default as ProductQuantity } from './product/components/ProductQuantity/index.js';
|
|
173
173
|
export { default as ProductPrice } from './product/components/ProductPrice/index.js';
|
|
174
174
|
export { default as ProductButton } from './product/components/ProductButton/ProductButton.js';
|
|
175
175
|
export { default as ProductDescription } from './product/components/ProductDescription/index.js';
|
|
@@ -11,6 +11,22 @@ const getPlusIcon = (plusIcon)=>{
|
|
|
11
11
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M18 12H6" />
|
|
12
12
|
</svg>`;
|
|
13
13
|
};
|
|
14
|
+
const getMinusIcon = (minusIcon)=>{
|
|
15
|
+
return minusIcon ?? `<svg
|
|
16
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
17
|
+
fill="none"
|
|
18
|
+
viewBox="0 0 24 24"
|
|
19
|
+
stroke="currentColor"
|
|
20
|
+
>
|
|
21
|
+
<path
|
|
22
|
+
strokeLinecap="round"
|
|
23
|
+
strokeLinejoin="round"
|
|
24
|
+
strokeWidth={2}
|
|
25
|
+
d="M12 6v6m0 0v6m0-6h6m-6 0H6"
|
|
26
|
+
/>
|
|
27
|
+
</svg>
|
|
28
|
+
`;
|
|
29
|
+
};
|
|
14
30
|
const getIconWidth = (iconSizeCustom)=>{
|
|
15
31
|
let check = true;
|
|
16
32
|
Object.keys(iconSizeCustom ?? {}).forEach((key)=>{
|
|
@@ -25,4 +41,4 @@ const getIconWidth = (iconSizeCustom)=>{
|
|
|
25
41
|
});
|
|
26
42
|
};
|
|
27
43
|
|
|
28
|
-
export { getIconWidth, getPlusIcon };
|
|
44
|
+
export { getIconWidth, getMinusIcon, getPlusIcon };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { useQuantity, useCurrentVariantInStock, useProduct, useIsSyncProduct, useInteraction } from '@gem-sdk/core';
|
|
2
|
+
import { useRef, useEffect } from 'react';
|
|
3
|
+
import { useTransition } from '../../ProductVariants/common/common.js';
|
|
4
|
+
|
|
5
|
+
const useProductQuantity = (props)=>{
|
|
6
|
+
const { setting = {}, advanced } = props;
|
|
7
|
+
const { updatePrice } = setting;
|
|
8
|
+
const { quantity, setQuantity, setUpdatePrice } = useQuantity();
|
|
9
|
+
const isInStock = useCurrentVariantInStock();
|
|
10
|
+
const product = useProduct();
|
|
11
|
+
const isSyncProduct = useIsSyncProduct();
|
|
12
|
+
const { trigger } = useInteraction();
|
|
13
|
+
const ref = useRef(null);
|
|
14
|
+
const defaultQty = setting.defaultQtyValue || 1;
|
|
15
|
+
useEffect(()=>{
|
|
16
|
+
setQuantity(parseFloat(`${defaultQty}`));
|
|
17
|
+
}, [
|
|
18
|
+
setQuantity,
|
|
19
|
+
defaultQty
|
|
20
|
+
]);
|
|
21
|
+
useEffect(()=>{
|
|
22
|
+
setUpdatePrice(updatePrice || false);
|
|
23
|
+
}, [
|
|
24
|
+
updatePrice,
|
|
25
|
+
setUpdatePrice
|
|
26
|
+
]);
|
|
27
|
+
const onHandleQuantity = (e)=>{
|
|
28
|
+
const event = e;
|
|
29
|
+
const data = event.detail;
|
|
30
|
+
const currentProductId = product?.id;
|
|
31
|
+
if (isSyncProduct && data && currentProductId == data.productId && quantity != data.quantity) {
|
|
32
|
+
dispatchInteractionChangeQuantity(data.quantity);
|
|
33
|
+
setQuantity(data.quantity);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
useEffect(()=>{
|
|
37
|
+
window.removeEventListener('set-product-quantity', onHandleQuantity);
|
|
38
|
+
window.addEventListener('set-product-quantity', onHandleQuantity);
|
|
39
|
+
});
|
|
40
|
+
useTransition((preQuantity)=>{
|
|
41
|
+
if (preQuantity !== quantity) {
|
|
42
|
+
dispatchInteractionChangeQuantity(quantity || 0);
|
|
43
|
+
}
|
|
44
|
+
}, [
|
|
45
|
+
quantity
|
|
46
|
+
]);
|
|
47
|
+
const dispatchInteractionChangeQuantity = (quantity)=>{
|
|
48
|
+
trigger({
|
|
49
|
+
event: 'gp:rollback:quantity-change',
|
|
50
|
+
selector: `[data-id="${advanced?.uid}"]`,
|
|
51
|
+
element: ref.current
|
|
52
|
+
});
|
|
53
|
+
trigger({
|
|
54
|
+
event: 'gp:quantity-change',
|
|
55
|
+
selector: `[data-id="${advanced?.uid}"]`,
|
|
56
|
+
data: quantity,
|
|
57
|
+
element: ref.current
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
return {
|
|
61
|
+
isInStock,
|
|
62
|
+
ref
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export { useProductQuantity };
|