@gem-sdk/components 2.0.0-dev.494 → 2.0.0-dev.495
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/ProductPrice/common/getTextData.js +5 -3
- package/dist/cjs/stock-counter/setting/configs/settingsV2.js +1 -0
- package/dist/cjs/text/components/common/getStyle.js +8 -1
- package/dist/esm/product/components/ProductPrice/common/getTextData.js +5 -3
- package/dist/esm/stock-counter/setting/configs/settingsV2.js +1 -0
- package/dist/esm/text/components/common/getStyle.js +8 -1
- package/dist/types/index.d.ts +6 -0
- package/package.json +1 -1
|
@@ -24,15 +24,17 @@ const getTextProps = (props, text)=>{
|
|
|
24
24
|
};
|
|
25
25
|
return {
|
|
26
26
|
id: `p-price-${builderProps?.uid}`,
|
|
27
|
-
styles
|
|
27
|
+
styles: {
|
|
28
|
+
...styles,
|
|
29
|
+
lineThrough: isComparePrice && styles?.lineThrough
|
|
30
|
+
},
|
|
28
31
|
setting: {
|
|
29
32
|
text: text ?? `${isComparePrice ? priceCompare() : defaultPrice()}`,
|
|
30
33
|
excludeFlex: true
|
|
31
34
|
},
|
|
32
35
|
className: core.cls('gp-price', {
|
|
33
36
|
'gp-money': !isComparePrice,
|
|
34
|
-
'gp-product-compare-price': isComparePrice
|
|
35
|
-
'gp-line-through': isComparePrice && styles?.lineThrough
|
|
37
|
+
'gp-product-compare-price': isComparePrice
|
|
36
38
|
}, colorClass, classNames)
|
|
37
39
|
};
|
|
38
40
|
};
|
|
@@ -28,6 +28,10 @@ const getContainerStyle = (styles, setting)=>{
|
|
|
28
28
|
};
|
|
29
29
|
const getTextStyle = (styles, setting)=>{
|
|
30
30
|
const composeGlobalSize = core.makeGlobalSize(setting?.globalSize);
|
|
31
|
+
const tdlStyle = [
|
|
32
|
+
styles?.lineThrough && 'line-through',
|
|
33
|
+
styles?.typo?.attrs?.underline && 'underline'
|
|
34
|
+
].filter(Boolean);
|
|
31
35
|
const composeStyles = {
|
|
32
36
|
...composeGlobalSize?.width?.['--w'] ? composeGlobalSize.width : {
|
|
33
37
|
'--w': '100%'
|
|
@@ -52,7 +56,10 @@ const getTextStyle = (styles, setting)=>{
|
|
|
52
56
|
...core.getStyleBackgroundByDevice(setting?.background),
|
|
53
57
|
...composeGlobalSize.padding,
|
|
54
58
|
...core.getGradientBgrStyleByDevice(setting?.background),
|
|
55
|
-
overflow: 'hidden'
|
|
59
|
+
overflow: 'hidden',
|
|
60
|
+
...core.makeStyle({
|
|
61
|
+
tdl: tdlStyle.join(' ')
|
|
62
|
+
})
|
|
56
63
|
};
|
|
57
64
|
return filterTruthyStyles(composeStyles);
|
|
58
65
|
};
|
|
@@ -22,15 +22,17 @@ const getTextProps = (props, text)=>{
|
|
|
22
22
|
};
|
|
23
23
|
return {
|
|
24
24
|
id: `p-price-${builderProps?.uid}`,
|
|
25
|
-
styles
|
|
25
|
+
styles: {
|
|
26
|
+
...styles,
|
|
27
|
+
lineThrough: isComparePrice && styles?.lineThrough
|
|
28
|
+
},
|
|
26
29
|
setting: {
|
|
27
30
|
text: text ?? `${isComparePrice ? priceCompare() : defaultPrice()}`,
|
|
28
31
|
excludeFlex: true
|
|
29
32
|
},
|
|
30
33
|
className: cls('gp-price', {
|
|
31
34
|
'gp-money': !isComparePrice,
|
|
32
|
-
'gp-product-compare-price': isComparePrice
|
|
33
|
-
'gp-line-through': isComparePrice && styles?.lineThrough
|
|
35
|
+
'gp-product-compare-price': isComparePrice
|
|
34
36
|
}, colorClass, classNames)
|
|
35
37
|
};
|
|
36
38
|
};
|
|
@@ -26,6 +26,10 @@ const getContainerStyle = (styles, setting)=>{
|
|
|
26
26
|
};
|
|
27
27
|
const getTextStyle = (styles, setting)=>{
|
|
28
28
|
const composeGlobalSize = makeGlobalSize(setting?.globalSize);
|
|
29
|
+
const tdlStyle = [
|
|
30
|
+
styles?.lineThrough && 'line-through',
|
|
31
|
+
styles?.typo?.attrs?.underline && 'underline'
|
|
32
|
+
].filter(Boolean);
|
|
29
33
|
const composeStyles = {
|
|
30
34
|
...composeGlobalSize?.width?.['--w'] ? composeGlobalSize.width : {
|
|
31
35
|
'--w': '100%'
|
|
@@ -50,7 +54,10 @@ const getTextStyle = (styles, setting)=>{
|
|
|
50
54
|
...getStyleBackgroundByDevice(setting?.background),
|
|
51
55
|
...composeGlobalSize.padding,
|
|
52
56
|
...getGradientBgrStyleByDevice(setting?.background),
|
|
53
|
-
overflow: 'hidden'
|
|
57
|
+
overflow: 'hidden',
|
|
58
|
+
...makeStyle({
|
|
59
|
+
tdl: tdlStyle.join(' ')
|
|
60
|
+
})
|
|
54
61
|
};
|
|
55
62
|
return filterTruthyStyles(composeStyles);
|
|
56
63
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -131,6 +131,7 @@ type TextProps = BasePropsWrap<{
|
|
|
131
131
|
shapeRounded?: ObjectDevices$1<CornerRadius>;
|
|
132
132
|
shapeBoxShadow?: ObjectDevices$1<ShadowProps$1>;
|
|
133
133
|
isForceValue?: boolean;
|
|
134
|
+
lineThrough?: boolean;
|
|
134
135
|
}> & Omit<React.ComponentPropsWithoutRef<'p'>, ''>;
|
|
135
136
|
|
|
136
137
|
declare const Text$2: React.ForwardRefExoticComponent<_gem_sdk_core.BaseProps<{
|
|
@@ -180,6 +181,7 @@ declare const Text$2: React.ForwardRefExoticComponent<_gem_sdk_core.BaseProps<{
|
|
|
180
181
|
shapeRounded?: Partial<Record<_gem_sdk_core.NameDevices, _gem_sdk_core.CornerRadius>> | undefined;
|
|
181
182
|
shapeBoxShadow?: Partial<Record<_gem_sdk_core.NameDevices, _gem_sdk_core.ShadowProps>> | undefined;
|
|
182
183
|
isForceValue?: boolean | undefined;
|
|
184
|
+
lineThrough?: boolean | undefined;
|
|
183
185
|
}, Record<string, any>> & {
|
|
184
186
|
builderAttrs?: Record<string, any> | undefined;
|
|
185
187
|
style?: React.CSSProperties | undefined;
|
|
@@ -5830,6 +5832,7 @@ declare const _default$2: {
|
|
|
5830
5832
|
shapeRounded?: Partial<Record<_gem_sdk_core.NameDevices, _gem_sdk_core.CornerRadius>> | undefined;
|
|
5831
5833
|
shapeBoxShadow?: Partial<Record<_gem_sdk_core.NameDevices, _gem_sdk_core.ShadowProps>> | undefined;
|
|
5832
5834
|
isForceValue?: boolean | undefined;
|
|
5835
|
+
lineThrough?: boolean | undefined;
|
|
5833
5836
|
}, Record<string, any>> & {
|
|
5834
5837
|
builderAttrs?: Record<string, any> | undefined;
|
|
5835
5838
|
style?: React.CSSProperties | undefined;
|
|
@@ -6343,6 +6346,7 @@ declare const Text: ({ id, styles, builderAttrs, style, setting, advanced, build
|
|
|
6343
6346
|
shapeRounded?: Partial<Record<_gem_sdk_core.NameDevices, _gem_sdk_core.CornerRadius>> | undefined;
|
|
6344
6347
|
shapeBoxShadow?: Partial<Record<_gem_sdk_core.NameDevices, _gem_sdk_core.ShadowProps>> | undefined;
|
|
6345
6348
|
isForceValue?: boolean | undefined;
|
|
6349
|
+
lineThrough?: boolean | undefined;
|
|
6346
6350
|
}, Record<string, any>> & {
|
|
6347
6351
|
builderAttrs?: Record<string, any> | undefined;
|
|
6348
6352
|
style?: React.CSSProperties | undefined;
|
|
@@ -6441,6 +6445,7 @@ declare const ProductTag: ({ setting, styles, builderProps, advanced, pageContex
|
|
|
6441
6445
|
shapeRounded?: Partial<Record<_gem_sdk_core.NameDevices, _gem_sdk_core.CornerRadius>> | undefined;
|
|
6442
6446
|
shapeBoxShadow?: Partial<Record<_gem_sdk_core.NameDevices, _gem_sdk_core.ShadowProps>> | undefined;
|
|
6443
6447
|
isForceValue?: boolean | undefined;
|
|
6448
|
+
lineThrough?: boolean | undefined;
|
|
6444
6449
|
} & {
|
|
6445
6450
|
textAlign?: Partial<Record<_gem_sdk_core.NameDevices, _gem_sdk_core.AlignProp>> | undefined;
|
|
6446
6451
|
backgroundColor?: _gem_sdk_core.ColorValueType | undefined;
|
|
@@ -7477,6 +7482,7 @@ declare const _default$1: {
|
|
|
7477
7482
|
shapeRounded?: Partial<Record<_gem_sdk_core.NameDevices, _gem_sdk_core.CornerRadius>> | undefined;
|
|
7478
7483
|
shapeBoxShadow?: Partial<Record<_gem_sdk_core.NameDevices, _gem_sdk_core.ShadowProps>> | undefined;
|
|
7479
7484
|
isForceValue?: boolean | undefined;
|
|
7485
|
+
lineThrough?: boolean | undefined;
|
|
7480
7486
|
}, Record<string, any>> & {
|
|
7481
7487
|
builderAttrs?: Record<string, any> | undefined;
|
|
7482
7488
|
style?: React.CSSProperties | undefined;
|