pb-sxp-ui 1.5.1 → 1.5.2
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/index.cjs +8 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -4
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +8 -4
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/WaterFall/List.js +2 -1
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +2 -1
- package/es/core/utils/materials.d.ts +3 -2
- package/es/core/utils/materials.js +3 -1
- package/lib/core/components/SxpPageRender/WaterFall/List.js +2 -1
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +2 -1
- package/lib/core/utils/materials.d.ts +3 -2
- package/lib/core/utils/materials.js +3 -1
- package/package.json +1 -1
@@ -40,7 +40,8 @@ const WaterfallFlowItem = (props) => {
|
|
40
40
|
const priceText = getPriceText({
|
41
41
|
product: rec === null || rec === void 0 ? void 0 : rec.product,
|
42
42
|
enableFormattedPrice: (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
43
|
-
globalConfig
|
43
|
+
globalConfig,
|
44
|
+
isHiddenDef: true
|
44
45
|
});
|
45
46
|
useEffect(() => {
|
46
47
|
const observer = new IntersectionObserver((entries) => {
|
@@ -63,7 +63,8 @@ const WaterfallFlowItem = (props) => {
|
|
63
63
|
const priceText = getPriceText({
|
64
64
|
product: rec === null || rec === void 0 ? void 0 : rec.product,
|
65
65
|
enableFormattedPrice: (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
66
|
-
globalConfig
|
66
|
+
globalConfig,
|
67
|
+
isHiddenDef: true
|
67
68
|
});
|
68
69
|
useEffect(() => {
|
69
70
|
if (imgDom.current === null || src === '') {
|
@@ -11,8 +11,9 @@ export declare const getBgStyleByImg: (data: any) => "" | {
|
|
11
11
|
backgroundRepeat: string;
|
12
12
|
backgroundSize: string;
|
13
13
|
};
|
14
|
-
export declare const getPriceText: ({ product, enableFormattedPrice, globalConfig }: {
|
14
|
+
export declare const getPriceText: ({ product, enableFormattedPrice, globalConfig, isHiddenDef }: {
|
15
15
|
product: ProductInfoType | undefined | null;
|
16
16
|
enableFormattedPrice: boolean | undefined;
|
17
17
|
globalConfig: ISxpPageRenderProps['globalConfig'];
|
18
|
-
|
18
|
+
isHiddenDef?: boolean;
|
19
|
+
}) => string | null;
|
@@ -29,8 +29,10 @@ export const getBgStyleByImg = (data) => {
|
|
29
29
|
const imgSrc = typeof bgImg === 'string' ? bgImg : getMediaValueByMode(bgImg);
|
30
30
|
return getBgStyle(imgSrc);
|
31
31
|
};
|
32
|
-
export const getPriceText = ({ product, enableFormattedPrice, globalConfig }) => {
|
32
|
+
export const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef }) => {
|
33
33
|
var _a, _b, _c, _d, _e;
|
34
|
+
if ((!(product === null || product === void 0 ? void 0 : product.currency) || !(product === null || product === void 0 ? void 0 : product.price)) && isHiddenDef)
|
35
|
+
return null;
|
34
36
|
let price = (product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price) ? product === null || product === void 0 ? void 0 : product.price : 7000;
|
35
37
|
let text = '';
|
36
38
|
let priceSymbol = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.priceSymbol;
|
@@ -42,7 +42,8 @@ const WaterfallFlowItem = (props) => {
|
|
42
42
|
const priceText = (0, materials_1.getPriceText)({
|
43
43
|
product: rec === null || rec === void 0 ? void 0 : rec.product,
|
44
44
|
enableFormattedPrice: (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
45
|
-
globalConfig
|
45
|
+
globalConfig,
|
46
|
+
isHiddenDef: true
|
46
47
|
});
|
47
48
|
(0, react_1.useEffect)(() => {
|
48
49
|
const observer = new IntersectionObserver((entries) => {
|
@@ -65,7 +65,8 @@ const WaterfallFlowItem = (props) => {
|
|
65
65
|
const priceText = (0, materials_1.getPriceText)({
|
66
66
|
product: rec === null || rec === void 0 ? void 0 : rec.product,
|
67
67
|
enableFormattedPrice: (_a = textStyles === null || textStyles === void 0 ? void 0 : textStyles.price) === null || _a === void 0 ? void 0 : _a.enableFormattedPrice,
|
68
|
-
globalConfig
|
68
|
+
globalConfig,
|
69
|
+
isHiddenDef: true
|
69
70
|
});
|
70
71
|
(0, react_1.useEffect)(() => {
|
71
72
|
if (imgDom.current === null || src === '') {
|
@@ -11,8 +11,9 @@ export declare const getBgStyleByImg: (data: any) => "" | {
|
|
11
11
|
backgroundRepeat: string;
|
12
12
|
backgroundSize: string;
|
13
13
|
};
|
14
|
-
export declare const getPriceText: ({ product, enableFormattedPrice, globalConfig }: {
|
14
|
+
export declare const getPriceText: ({ product, enableFormattedPrice, globalConfig, isHiddenDef }: {
|
15
15
|
product: ProductInfoType | undefined | null;
|
16
16
|
enableFormattedPrice: boolean | undefined;
|
17
17
|
globalConfig: ISxpPageRenderProps['globalConfig'];
|
18
|
-
|
18
|
+
isHiddenDef?: boolean;
|
19
|
+
}) => string | null;
|
@@ -35,8 +35,10 @@ const getBgStyleByImg = (data) => {
|
|
35
35
|
return (0, exports.getBgStyle)(imgSrc);
|
36
36
|
};
|
37
37
|
exports.getBgStyleByImg = getBgStyleByImg;
|
38
|
-
const getPriceText = ({ product, enableFormattedPrice, globalConfig }) => {
|
38
|
+
const getPriceText = ({ product, enableFormattedPrice, globalConfig, isHiddenDef }) => {
|
39
39
|
var _a, _b, _c, _d, _e;
|
40
|
+
if ((!(product === null || product === void 0 ? void 0 : product.currency) || !(product === null || product === void 0 ? void 0 : product.price)) && isHiddenDef)
|
41
|
+
return null;
|
40
42
|
let price = (product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price) ? product === null || product === void 0 ? void 0 : product.price : 7000;
|
41
43
|
let text = '';
|
42
44
|
let priceSymbol = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.priceSymbol;
|