@gem-sdk/components 2.0.0-dev.441 → 2.0.0-dev.443
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/product/components/ProductBadge/common/getClasses.js +1 -1
- package/dist/cjs/product/components/ProductBadge/common/getStyles.js +2 -2
- package/dist/cjs/product/components/ProductBadge/constants.js +3 -0
- package/dist/cjs/product/components/ProductBadge/index.liquid.js +3 -4
- package/dist/cjs/product/components/ProductBadge/utils/shape.js +6 -6
- package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.js +3 -2
- package/dist/cjs/product/components/ProductQuantity/common/common.js +12 -13
- package/dist/cjs/product/components/ProductQuantity/index.js +2 -2
- package/dist/cjs/product/components/ProductQuantity/index.liquid.js +1 -1
- package/dist/cjs/product/setting/product-quantity/configs/uiV2.js +7 -6
- package/dist/esm/product/components/ProductBadge/common/getClasses.js +1 -1
- package/dist/esm/product/components/ProductBadge/common/getStyles.js +2 -2
- package/dist/esm/product/components/ProductBadge/constants.js +2 -1
- package/dist/esm/product/components/ProductBadge/index.liquid.js +3 -4
- package/dist/esm/product/components/ProductBadge/utils/shape.js +6 -6
- package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.js +3 -2
- package/dist/esm/product/components/ProductQuantity/common/common.js +12 -13
- package/dist/esm/product/components/ProductQuantity/index.js +3 -3
- package/dist/esm/product/components/ProductQuantity/index.liquid.js +2 -2
- package/dist/esm/product/setting/product-quantity/configs/uiV2.js +7 -6
- package/package.json +1 -1
|
@@ -38,7 +38,7 @@ const getTextContentClasses = (styles)=>{
|
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
40
|
const getImageContainerClasses = ()=>{
|
|
41
|
-
const classList = 'product-badge-item gp-w-full gp-h-full';
|
|
41
|
+
const classList = 'product-badge-item gp-w-full gp-h-full gp-overflow-hidden';
|
|
42
42
|
return {
|
|
43
43
|
...core.composeClasses(classList)
|
|
44
44
|
};
|
|
@@ -16,10 +16,10 @@ const getSizeStyles = (props)=>{
|
|
|
16
16
|
const badgeSize = isTextBadge ? styles?.textSizeV2 : styles?.imageSizeV2;
|
|
17
17
|
return isTextBadge ? common.getSize(shape$1, badgeSize) : common.getSize(undefined, badgeSize);
|
|
18
18
|
};
|
|
19
|
-
const getContainerStyle = (props)=>{
|
|
19
|
+
const getContainerStyle = (props, isLiquid = false)=>{
|
|
20
20
|
const { setting, styles, style, navigationPosition, imageData, dotData } = props;
|
|
21
21
|
const isDropOutsideProductImage = setting?.positionWithImage === 'outside';
|
|
22
|
-
const wrapperStyles = common.getWrapperStyle(
|
|
22
|
+
const wrapperStyles = common.getWrapperStyle(isLiquid);
|
|
23
23
|
const shapePosition = getShapePosition.getShapePosition({
|
|
24
24
|
positionType: styles?.position,
|
|
25
25
|
isLiquid: false,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const IS_LIQUID = true;
|
|
3
4
|
exports.SHAPE_ID = void 0;
|
|
4
5
|
(function(SHAPE_ID) {
|
|
5
6
|
SHAPE_ID["SQUARE"] = 'square';
|
|
@@ -12,3 +13,5 @@ exports.SHAPE_ID = void 0;
|
|
|
12
13
|
SHAPE_ID["RIBBON_3"] = 'ribbon_3';
|
|
13
14
|
SHAPE_ID["TRIANGLE"] = 'triangle';
|
|
14
15
|
})(exports.SHAPE_ID || (exports.SHAPE_ID = {}));
|
|
16
|
+
|
|
17
|
+
exports.IS_LIQUID = IS_LIQUID;
|
|
@@ -11,13 +11,14 @@ var system = require('@gem-sdk/system');
|
|
|
11
11
|
var getClasses = require('./common/getClasses.js');
|
|
12
12
|
var getStyles = require('./common/getStyles.js');
|
|
13
13
|
var getAttrs = require('./common/getAttrs.js');
|
|
14
|
+
var constants = require('./constants.js');
|
|
14
15
|
|
|
15
16
|
const ProductBadge = (props)=>{
|
|
16
17
|
const { styles, setting } = props;
|
|
17
18
|
const isTextBadge = setting?.shape !== 'image';
|
|
18
19
|
const isDiscountContent = common.checkDiscountContentProductBadge(setting?.displayContent);
|
|
19
20
|
const containerStyle = system.createStyle({
|
|
20
|
-
...getStyles.getContainerStyle(props)
|
|
21
|
+
...getStyles.getContainerStyle(props, constants.IS_LIQUID)
|
|
21
22
|
});
|
|
22
23
|
const wrapperClass = system.createClass({
|
|
23
24
|
...getClasses.getWrapperClasses(props)
|
|
@@ -113,9 +114,7 @@ const ProductBadge = (props)=>{
|
|
|
113
114
|
</div>`, core.template`<div class="${imageContainerClasses}" style="${imageContainerStyles}">
|
|
114
115
|
<img ${{
|
|
115
116
|
...imageAttr
|
|
116
|
-
}}
|
|
117
|
-
class="${imageClass}"
|
|
118
|
-
/>
|
|
117
|
+
}} class="${imageClass}" alt="" />
|
|
119
118
|
</div>`)}
|
|
120
119
|
</div>
|
|
121
120
|
</div>
|
|
@@ -43,7 +43,7 @@ const productBadgeShape = [
|
|
|
43
43
|
wrapperWidth: '132px',
|
|
44
44
|
wrapperHeight: '132px',
|
|
45
45
|
shapeStyle: {
|
|
46
|
-
|
|
46
|
+
'clip-path': 'polygon(60% 0, 100% 0%, 0 100%, 0 60%)'
|
|
47
47
|
},
|
|
48
48
|
textStyle: {
|
|
49
49
|
'--t': 'translate(-10%, -30%) rotate(-45deg)',
|
|
@@ -57,7 +57,7 @@ const productBadgeShape = [
|
|
|
57
57
|
wrapperWidth: '132px',
|
|
58
58
|
wrapperHeight: '132px',
|
|
59
59
|
shapeStyle: {
|
|
60
|
-
|
|
60
|
+
'clip-path': 'polygon(50% 0%,64.351% 15.354%,85.355% 14.645%,84.646% 35.649%,100% 50%,84.646% 64.351%,85.355% 85.355%,64.351% 84.646%,50% 100%,35.649% 84.646%,14.645% 85.355%,15.354% 64.351%,0% 50%,15.354% 35.649%,14.645% 14.645%,35.649% 15.354%,50% 0%)'
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
{
|
|
@@ -65,7 +65,7 @@ const productBadgeShape = [
|
|
|
65
65
|
wrapperWidth: '132px',
|
|
66
66
|
wrapperHeight: '132px',
|
|
67
67
|
shapeStyle: {
|
|
68
|
-
|
|
68
|
+
'clip-path': 'polygon(50% 0%,63.394% 17.664%,85.355% 14.645%,82.336% 36.606%,100% 50%,82.336% 63.394%,85.355% 85.355%,63.394% 82.336%,50% 100%,36.606% 82.336%,14.645% 85.355%,17.664% 63.394%,0% 50%,17.664% 36.606%,14.645% 14.645%,36.606% 17.664%,50% 0%)'
|
|
69
69
|
},
|
|
70
70
|
ratio: 1
|
|
71
71
|
},
|
|
@@ -74,7 +74,7 @@ const productBadgeShape = [
|
|
|
74
74
|
wrapperWidth: 'auto',
|
|
75
75
|
wrapperHeight: 'auto',
|
|
76
76
|
shapeStyle: {
|
|
77
|
-
|
|
77
|
+
'clip-path': 'polygon(0 0, 0 0, 79.5% 0, 100% 50%, 79.5% 100%, 0 100%, 0 100%)'
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
80
|
{
|
|
@@ -82,7 +82,7 @@ const productBadgeShape = [
|
|
|
82
82
|
wrapperWidth: 'auto',
|
|
83
83
|
wrapperHeight: 'auto',
|
|
84
84
|
shapeStyle: {
|
|
85
|
-
|
|
85
|
+
'clip-path': 'polygon( 0% 100%,14.744% 50%,0% 0%,82.051% 0%,100% 50%,82.051% 100%,0% 100%)'
|
|
86
86
|
}
|
|
87
87
|
},
|
|
88
88
|
{
|
|
@@ -90,7 +90,7 @@ const productBadgeShape = [
|
|
|
90
90
|
wrapperWidth: '132px',
|
|
91
91
|
wrapperHeight: '132px',
|
|
92
92
|
shapeStyle: {
|
|
93
|
-
|
|
93
|
+
'clip-path': 'polygon(0% 0%, 0% 100%, 100% 0%)'
|
|
94
94
|
},
|
|
95
95
|
textStyle: {
|
|
96
96
|
'--t': 'translate(-20%, -75%) rotate(-45deg)',
|
package/dist/cjs/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.js
CHANGED
|
@@ -9,7 +9,7 @@ var classes = require('../common/classes.js');
|
|
|
9
9
|
var React = require('react');
|
|
10
10
|
|
|
11
11
|
const ProductBundleDiscountChildrenItem = (props)=>{
|
|
12
|
-
const { index, isSelected, setSelected, setting, styles: styles$1, childItem } = props;
|
|
12
|
+
const { index, isSelected, setSelected, setting, styles: styles$1, childItem, bundleItem } = props;
|
|
13
13
|
const composeItemWrapStyles = system.createStyle(styles.getItemWrapStyles(styles$1, isSelected));
|
|
14
14
|
const composeLayoutClasses = system.createClass(classes.getLayoutClasses(setting));
|
|
15
15
|
const composeIconStyles = system.createStyle(styles.getIconStyles(setting));
|
|
@@ -58,7 +58,8 @@ const ProductBundleDiscountChildrenItem = (props)=>{
|
|
|
58
58
|
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
59
59
|
className: composeFlexChildren,
|
|
60
60
|
children: /*#__PURE__*/ React.isValidElement(childItem) && /*#__PURE__*/ jsxRuntime.jsx(childItem.type, {
|
|
61
|
-
...childItem.props
|
|
61
|
+
...childItem.props,
|
|
62
|
+
"bundle-item": bundleItem
|
|
62
63
|
})
|
|
63
64
|
})
|
|
64
65
|
]
|
|
@@ -3,31 +3,30 @@
|
|
|
3
3
|
var core = require('@gem-sdk/core');
|
|
4
4
|
|
|
5
5
|
const getPlusIcon = (plusIcon)=>{
|
|
6
|
-
return plusIcon
|
|
6
|
+
return plusIcon || `<svg
|
|
7
7
|
xmlns="http://www.w3.org/2000/svg"
|
|
8
|
-
className="gp-h-full gp-w-full"
|
|
9
8
|
fill="none"
|
|
10
9
|
viewBox="0 0 24 24"
|
|
11
10
|
stroke="currentColor"
|
|
12
11
|
>
|
|
13
|
-
<path
|
|
12
|
+
<path
|
|
13
|
+
strokeLinecap="round"
|
|
14
|
+
strokeLinejoin="round"
|
|
15
|
+
strokeWidth={2}
|
|
16
|
+
d="M12 6v6m0 0v6m0-6h6m-6 0H6"
|
|
17
|
+
/>
|
|
14
18
|
</svg>`;
|
|
15
19
|
};
|
|
16
20
|
const getMinusIcon = (minusIcon)=>{
|
|
17
|
-
return minusIcon
|
|
21
|
+
return minusIcon || `<svg
|
|
18
22
|
xmlns="http://www.w3.org/2000/svg"
|
|
23
|
+
className="gp-h-full gp-w-full"
|
|
19
24
|
fill="none"
|
|
20
25
|
viewBox="0 0 24 24"
|
|
21
26
|
stroke="currentColor"
|
|
22
|
-
|
|
23
|
-
<path
|
|
24
|
-
|
|
25
|
-
strokeLinejoin="round"
|
|
26
|
-
strokeWidth={2}
|
|
27
|
-
d="M12 6v6m0 0v6m0-6h6m-6 0H6"
|
|
28
|
-
/>
|
|
29
|
-
</svg>
|
|
30
|
-
`;
|
|
27
|
+
>
|
|
28
|
+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M18 12H6" />
|
|
29
|
+
</svg>`;
|
|
31
30
|
};
|
|
32
31
|
const getIconWidth = (iconSizeCustom)=>{
|
|
33
32
|
if (!iconSizeCustom) return {};
|
|
@@ -136,7 +136,7 @@ const ProductQuantity = (props)=>{
|
|
|
136
136
|
className: iconWrapperClass,
|
|
137
137
|
style: iconWidth,
|
|
138
138
|
dangerouslySetInnerHTML: {
|
|
139
|
-
__html: common.
|
|
139
|
+
__html: common.getMinusIcon(minusIcon)
|
|
140
140
|
}
|
|
141
141
|
})
|
|
142
142
|
})),
|
|
@@ -159,7 +159,7 @@ const ProductQuantity = (props)=>{
|
|
|
159
159
|
className: iconWrapperClass,
|
|
160
160
|
style: iconWidth,
|
|
161
161
|
dangerouslySetInnerHTML: {
|
|
162
|
-
__html: common.
|
|
162
|
+
__html: common.getPlusIcon(plusIcon)
|
|
163
163
|
}
|
|
164
164
|
})
|
|
165
165
|
}))
|
|
@@ -141,7 +141,7 @@ const ProductQuantity = ({ setting = {}, styles = {}, advanced, builderProps })=
|
|
|
141
141
|
>
|
|
142
142
|
<span class="${iconWrapperClass}" style="${iconWidth}"
|
|
143
143
|
>
|
|
144
|
-
${common.
|
|
144
|
+
${common.getMinusIcon(minusIcon)}
|
|
145
145
|
</span>
|
|
146
146
|
</button>
|
|
147
147
|
`)}
|
|
@@ -242,9 +242,10 @@ const SettingUIV2 = [
|
|
|
242
242
|
en: 'Hover'
|
|
243
243
|
},
|
|
244
244
|
type: 'combo',
|
|
245
|
-
iconName: 'polaris-
|
|
245
|
+
iconName: 'polaris-check-clicked',
|
|
246
246
|
isHideClear: true,
|
|
247
|
-
fixedValue: '
|
|
247
|
+
fixedValue: 'Enabled',
|
|
248
|
+
enableCheckSettingsValue: true,
|
|
248
249
|
popoverLabel: {
|
|
249
250
|
en: 'Hover effect'
|
|
250
251
|
},
|
|
@@ -344,10 +345,10 @@ const SettingUIV2 = [
|
|
|
344
345
|
en: 'Divider'
|
|
345
346
|
},
|
|
346
347
|
type: 'combo',
|
|
347
|
-
iconName: 'polaris-edit',
|
|
348
|
-
fixedValue: 'Edit...',
|
|
349
348
|
isHideClear: true,
|
|
350
349
|
conditionDisplay: 'hasButton',
|
|
350
|
+
comboType: 'color',
|
|
351
|
+
getValueFromSettingID: 'dividerColor.normal',
|
|
351
352
|
controls: [
|
|
352
353
|
{
|
|
353
354
|
label: {
|
|
@@ -374,9 +375,9 @@ const SettingUIV2 = [
|
|
|
374
375
|
en: 'Hover'
|
|
375
376
|
},
|
|
376
377
|
type: 'combo',
|
|
377
|
-
iconName: 'polaris-
|
|
378
|
+
iconName: 'polaris-check-clicked',
|
|
378
379
|
isHideClear: true,
|
|
379
|
-
fixedValue: '
|
|
380
|
+
fixedValue: 'Enabled',
|
|
380
381
|
enableCheckSettingsValue: true,
|
|
381
382
|
popoverLabel: {
|
|
382
383
|
en: 'Hover effect'
|
|
@@ -36,7 +36,7 @@ const getTextContentClasses = (styles)=>{
|
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
38
|
const getImageContainerClasses = ()=>{
|
|
39
|
-
const classList = 'product-badge-item gp-w-full gp-h-full';
|
|
39
|
+
const classList = 'product-badge-item gp-w-full gp-h-full gp-overflow-hidden';
|
|
40
40
|
return {
|
|
41
41
|
...composeClasses(classList)
|
|
42
42
|
};
|
|
@@ -14,10 +14,10 @@ const getSizeStyles = (props)=>{
|
|
|
14
14
|
const badgeSize = isTextBadge ? styles?.textSizeV2 : styles?.imageSizeV2;
|
|
15
15
|
return isTextBadge ? getSize(shape, badgeSize) : getSize(undefined, badgeSize);
|
|
16
16
|
};
|
|
17
|
-
const getContainerStyle = (props)=>{
|
|
17
|
+
const getContainerStyle = (props, isLiquid = false)=>{
|
|
18
18
|
const { setting, styles, style, navigationPosition, imageData, dotData } = props;
|
|
19
19
|
const isDropOutsideProductImage = setting?.positionWithImage === 'outside';
|
|
20
|
-
const wrapperStyles = getWrapperStyle(
|
|
20
|
+
const wrapperStyles = getWrapperStyle(isLiquid);
|
|
21
21
|
const shapePosition = getShapePosition({
|
|
22
22
|
positionType: styles?.position,
|
|
23
23
|
isLiquid: false,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const IS_LIQUID = true;
|
|
1
2
|
var SHAPE_ID;
|
|
2
3
|
(function(SHAPE_ID) {
|
|
3
4
|
SHAPE_ID["SQUARE"] = 'square';
|
|
@@ -11,4 +12,4 @@ var SHAPE_ID;
|
|
|
11
12
|
SHAPE_ID["TRIANGLE"] = 'triangle';
|
|
12
13
|
})(SHAPE_ID || (SHAPE_ID = {}));
|
|
13
14
|
|
|
14
|
-
export { SHAPE_ID };
|
|
15
|
+
export { IS_LIQUID, SHAPE_ID };
|
|
@@ -7,13 +7,14 @@ import { createStyle, createClass, createAttr } from '@gem-sdk/system';
|
|
|
7
7
|
import { getWrapperClasses, getSubWrapperClass, getTextContainerClasses, getTextWrapperClasses, getTextContentClasses, getImageContainerClasses, getImageClasses } from './common/getClasses.js';
|
|
8
8
|
import { getContainerStyle, getSubWrapperStyle, getContentStyleInternal, getTextBadgeWrapperStyles, getTextContentStyle, getImageContainerStyles } from './common/getStyles.js';
|
|
9
9
|
import { getSubWrapperAttrs, getContainerAttrs, getTextContentAttrs, getImageAttr } from './common/getAttrs.js';
|
|
10
|
+
import { IS_LIQUID } from './constants.js';
|
|
10
11
|
|
|
11
12
|
const ProductBadge = (props)=>{
|
|
12
13
|
const { styles, setting } = props;
|
|
13
14
|
const isTextBadge = setting?.shape !== 'image';
|
|
14
15
|
const isDiscountContent = checkDiscountContentProductBadge(setting?.displayContent);
|
|
15
16
|
const containerStyle = createStyle({
|
|
16
|
-
...getContainerStyle(props)
|
|
17
|
+
...getContainerStyle(props, IS_LIQUID)
|
|
17
18
|
});
|
|
18
19
|
const wrapperClass = createClass({
|
|
19
20
|
...getWrapperClasses(props)
|
|
@@ -109,9 +110,7 @@ const ProductBadge = (props)=>{
|
|
|
109
110
|
</div>`, template`<div class="${imageContainerClasses}" style="${imageContainerStyles}">
|
|
110
111
|
<img ${{
|
|
111
112
|
...imageAttr
|
|
112
|
-
}}
|
|
113
|
-
class="${imageClass}"
|
|
114
|
-
/>
|
|
113
|
+
}} class="${imageClass}" alt="" />
|
|
115
114
|
</div>`)}
|
|
116
115
|
</div>
|
|
117
116
|
</div>
|
|
@@ -41,7 +41,7 @@ const productBadgeShape = [
|
|
|
41
41
|
wrapperWidth: '132px',
|
|
42
42
|
wrapperHeight: '132px',
|
|
43
43
|
shapeStyle: {
|
|
44
|
-
|
|
44
|
+
'clip-path': 'polygon(60% 0, 100% 0%, 0 100%, 0 60%)'
|
|
45
45
|
},
|
|
46
46
|
textStyle: {
|
|
47
47
|
'--t': 'translate(-10%, -30%) rotate(-45deg)',
|
|
@@ -55,7 +55,7 @@ const productBadgeShape = [
|
|
|
55
55
|
wrapperWidth: '132px',
|
|
56
56
|
wrapperHeight: '132px',
|
|
57
57
|
shapeStyle: {
|
|
58
|
-
|
|
58
|
+
'clip-path': 'polygon(50% 0%,64.351% 15.354%,85.355% 14.645%,84.646% 35.649%,100% 50%,84.646% 64.351%,85.355% 85.355%,64.351% 84.646%,50% 100%,35.649% 84.646%,14.645% 85.355%,15.354% 64.351%,0% 50%,15.354% 35.649%,14.645% 14.645%,35.649% 15.354%,50% 0%)'
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
61
|
{
|
|
@@ -63,7 +63,7 @@ const productBadgeShape = [
|
|
|
63
63
|
wrapperWidth: '132px',
|
|
64
64
|
wrapperHeight: '132px',
|
|
65
65
|
shapeStyle: {
|
|
66
|
-
|
|
66
|
+
'clip-path': 'polygon(50% 0%,63.394% 17.664%,85.355% 14.645%,82.336% 36.606%,100% 50%,82.336% 63.394%,85.355% 85.355%,63.394% 82.336%,50% 100%,36.606% 82.336%,14.645% 85.355%,17.664% 63.394%,0% 50%,17.664% 36.606%,14.645% 14.645%,36.606% 17.664%,50% 0%)'
|
|
67
67
|
},
|
|
68
68
|
ratio: 1
|
|
69
69
|
},
|
|
@@ -72,7 +72,7 @@ const productBadgeShape = [
|
|
|
72
72
|
wrapperWidth: 'auto',
|
|
73
73
|
wrapperHeight: 'auto',
|
|
74
74
|
shapeStyle: {
|
|
75
|
-
|
|
75
|
+
'clip-path': 'polygon(0 0, 0 0, 79.5% 0, 100% 50%, 79.5% 100%, 0 100%, 0 100%)'
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
{
|
|
@@ -80,7 +80,7 @@ const productBadgeShape = [
|
|
|
80
80
|
wrapperWidth: 'auto',
|
|
81
81
|
wrapperHeight: 'auto',
|
|
82
82
|
shapeStyle: {
|
|
83
|
-
|
|
83
|
+
'clip-path': 'polygon( 0% 100%,14.744% 50%,0% 0%,82.051% 0%,100% 50%,82.051% 100%,0% 100%)'
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
86
|
{
|
|
@@ -88,7 +88,7 @@ const productBadgeShape = [
|
|
|
88
88
|
wrapperWidth: '132px',
|
|
89
89
|
wrapperHeight: '132px',
|
|
90
90
|
shapeStyle: {
|
|
91
|
-
|
|
91
|
+
'clip-path': 'polygon(0% 0%, 0% 100%, 100% 0%)'
|
|
92
92
|
},
|
|
93
93
|
textStyle: {
|
|
94
94
|
'--t': 'translate(-20%, -75%) rotate(-45deg)',
|
package/dist/esm/product/components/ProductBundle/components/ProductBundleDiscountChildrenItem.js
CHANGED
|
@@ -5,7 +5,7 @@ import { getLayoutClasses, getIconSectionClasses, getItemClasses } from '../comm
|
|
|
5
5
|
import { isValidElement } from 'react';
|
|
6
6
|
|
|
7
7
|
const ProductBundleDiscountChildrenItem = (props)=>{
|
|
8
|
-
const { index, isSelected, setSelected, setting, styles, childItem } = props;
|
|
8
|
+
const { index, isSelected, setSelected, setting, styles, childItem, bundleItem } = props;
|
|
9
9
|
const composeItemWrapStyles = createStyle(getItemWrapStyles(styles, isSelected));
|
|
10
10
|
const composeLayoutClasses = createClass(getLayoutClasses(setting));
|
|
11
11
|
const composeIconStyles = createStyle(getIconStyles(setting));
|
|
@@ -54,7 +54,8 @@ const ProductBundleDiscountChildrenItem = (props)=>{
|
|
|
54
54
|
/*#__PURE__*/ jsx("div", {
|
|
55
55
|
className: composeFlexChildren,
|
|
56
56
|
children: /*#__PURE__*/ isValidElement(childItem) && /*#__PURE__*/ jsx(childItem.type, {
|
|
57
|
-
...childItem.props
|
|
57
|
+
...childItem.props,
|
|
58
|
+
"bundle-item": bundleItem
|
|
58
59
|
})
|
|
59
60
|
})
|
|
60
61
|
]
|
|
@@ -1,31 +1,30 @@
|
|
|
1
1
|
import { DEVICES, makeStyleResponsive } from '@gem-sdk/core';
|
|
2
2
|
|
|
3
3
|
const getPlusIcon = (plusIcon)=>{
|
|
4
|
-
return plusIcon
|
|
4
|
+
return plusIcon || `<svg
|
|
5
5
|
xmlns="http://www.w3.org/2000/svg"
|
|
6
|
-
className="gp-h-full gp-w-full"
|
|
7
6
|
fill="none"
|
|
8
7
|
viewBox="0 0 24 24"
|
|
9
8
|
stroke="currentColor"
|
|
10
9
|
>
|
|
11
|
-
<path
|
|
10
|
+
<path
|
|
11
|
+
strokeLinecap="round"
|
|
12
|
+
strokeLinejoin="round"
|
|
13
|
+
strokeWidth={2}
|
|
14
|
+
d="M12 6v6m0 0v6m0-6h6m-6 0H6"
|
|
15
|
+
/>
|
|
12
16
|
</svg>`;
|
|
13
17
|
};
|
|
14
18
|
const getMinusIcon = (minusIcon)=>{
|
|
15
|
-
return minusIcon
|
|
19
|
+
return minusIcon || `<svg
|
|
16
20
|
xmlns="http://www.w3.org/2000/svg"
|
|
21
|
+
className="gp-h-full gp-w-full"
|
|
17
22
|
fill="none"
|
|
18
23
|
viewBox="0 0 24 24"
|
|
19
24
|
stroke="currentColor"
|
|
20
|
-
|
|
21
|
-
<path
|
|
22
|
-
|
|
23
|
-
strokeLinejoin="round"
|
|
24
|
-
strokeWidth={2}
|
|
25
|
-
d="M12 6v6m0 0v6m0-6h6m-6 0H6"
|
|
26
|
-
/>
|
|
27
|
-
</svg>
|
|
28
|
-
`;
|
|
25
|
+
>
|
|
26
|
+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M18 12H6" />
|
|
27
|
+
</svg>`;
|
|
29
28
|
};
|
|
30
29
|
const getIconWidth = (iconSizeCustom)=>{
|
|
31
30
|
if (!iconSizeCustom) return {};
|
|
@@ -3,7 +3,7 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
3
3
|
import { useCurrentVariant, useQuantity } from '@gem-sdk/core';
|
|
4
4
|
import { createAttr, createClass, createStyle, If } from '@gem-sdk/system';
|
|
5
5
|
import { useProductQuantity } from './hooks/index.js';
|
|
6
|
-
import { getIconWidth,
|
|
6
|
+
import { getIconWidth, getMinusIcon, getPlusIcon } from './common/common.js';
|
|
7
7
|
import { getContainerAttrs, getInputAttr, getButtonAttrs } from './common/getAttrs.js';
|
|
8
8
|
import { getContainerClasses, getWrapperClasses, getInputClasses, getButtonClass, getIconWrapperClasses } from './common/getClasses.js';
|
|
9
9
|
import { getContainerStyles, getWrapperStyles, getInputStyle, getButtonStyle } from './common/getStyles.js';
|
|
@@ -132,7 +132,7 @@ const ProductQuantity = (props)=>{
|
|
|
132
132
|
className: iconWrapperClass,
|
|
133
133
|
style: iconWidth,
|
|
134
134
|
dangerouslySetInnerHTML: {
|
|
135
|
-
__html:
|
|
135
|
+
__html: getMinusIcon(minusIcon)
|
|
136
136
|
}
|
|
137
137
|
})
|
|
138
138
|
})),
|
|
@@ -155,7 +155,7 @@ const ProductQuantity = (props)=>{
|
|
|
155
155
|
className: iconWrapperClass,
|
|
156
156
|
style: iconWidth,
|
|
157
157
|
dangerouslySetInnerHTML: {
|
|
158
|
-
__html:
|
|
158
|
+
__html: getPlusIcon(plusIcon)
|
|
159
159
|
}
|
|
160
160
|
})
|
|
161
161
|
}))
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { template, RenderIf, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
|
|
2
2
|
import { getSettingPreloadData } from '../../../helpers.js';
|
|
3
3
|
import { createAttr, createClass, createStyle } from '@gem-sdk/system';
|
|
4
|
-
import { getIconWidth, getPlusIcon } from './common/common.js';
|
|
4
|
+
import { getIconWidth, getMinusIcon, getPlusIcon } from './common/common.js';
|
|
5
5
|
import { getContainerAttrs, getInputAttr, getButtonAttrs } from './common/getAttrs.js';
|
|
6
6
|
import { getContainerClasses, getWrapperClasses, getInputClasses, getButtonClass, getIconWrapperClasses } from './common/getClasses.js';
|
|
7
7
|
import { getContainerStyles, getWrapperStyles, getInputStyle, getButtonStyle } from './common/getStyles.js';
|
|
@@ -137,7 +137,7 @@ const ProductQuantity = ({ setting = {}, styles = {}, advanced, builderProps })=
|
|
|
137
137
|
>
|
|
138
138
|
<span class="${iconWrapperClass}" style="${iconWidth}"
|
|
139
139
|
>
|
|
140
|
-
${
|
|
140
|
+
${getMinusIcon(minusIcon)}
|
|
141
141
|
</span>
|
|
142
142
|
</button>
|
|
143
143
|
`)}
|
|
@@ -240,9 +240,10 @@ const SettingUIV2 = [
|
|
|
240
240
|
en: 'Hover'
|
|
241
241
|
},
|
|
242
242
|
type: 'combo',
|
|
243
|
-
iconName: 'polaris-
|
|
243
|
+
iconName: 'polaris-check-clicked',
|
|
244
244
|
isHideClear: true,
|
|
245
|
-
fixedValue: '
|
|
245
|
+
fixedValue: 'Enabled',
|
|
246
|
+
enableCheckSettingsValue: true,
|
|
246
247
|
popoverLabel: {
|
|
247
248
|
en: 'Hover effect'
|
|
248
249
|
},
|
|
@@ -342,10 +343,10 @@ const SettingUIV2 = [
|
|
|
342
343
|
en: 'Divider'
|
|
343
344
|
},
|
|
344
345
|
type: 'combo',
|
|
345
|
-
iconName: 'polaris-edit',
|
|
346
|
-
fixedValue: 'Edit...',
|
|
347
346
|
isHideClear: true,
|
|
348
347
|
conditionDisplay: 'hasButton',
|
|
348
|
+
comboType: 'color',
|
|
349
|
+
getValueFromSettingID: 'dividerColor.normal',
|
|
349
350
|
controls: [
|
|
350
351
|
{
|
|
351
352
|
label: {
|
|
@@ -372,9 +373,9 @@ const SettingUIV2 = [
|
|
|
372
373
|
en: 'Hover'
|
|
373
374
|
},
|
|
374
375
|
type: 'combo',
|
|
375
|
-
iconName: 'polaris-
|
|
376
|
+
iconName: 'polaris-check-clicked',
|
|
376
377
|
isHideClear: true,
|
|
377
|
-
fixedValue: '
|
|
378
|
+
fixedValue: 'Enabled',
|
|
378
379
|
enableCheckSettingsValue: true,
|
|
379
380
|
popoverLabel: {
|
|
380
381
|
en: 'Hover effect'
|