pb-sxp-ui 1.5.1 → 1.5.3

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.
@@ -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
- }) => string;
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;
@@ -37,7 +37,6 @@ const HashTag = createMaterial(HashTagComponent, {
37
37
  },
38
38
  price: {
39
39
  fontSize: 12,
40
- fontWeight: 'bold',
41
40
  color: '#000'
42
41
  }
43
42
  },
@@ -20,7 +20,6 @@ const CommodityDetailDiroNew = createMaterial(CommodityDetailDiroNewComponent, {
20
20
  commodityStyles: {
21
21
  price: {
22
22
  color: '#000',
23
- fontWeight: 'bold',
24
23
  fontSize: 13
25
24
  },
26
25
  title: {
@@ -21,7 +21,6 @@ const CommodityList = createMaterial(CommodityListComponent, {
21
21
  commodityStyles: {
22
22
  price: {
23
23
  color: '#000',
24
- fontWeight: 'bold',
25
24
  fontSize: 14
26
25
  },
27
26
  title: {
@@ -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
- }) => string;
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;
@@ -41,7 +41,6 @@ const HashTag = (0, create_1.createMaterial)(_1.default, {
41
41
  },
42
42
  price: {
43
43
  fontSize: 12,
44
- fontWeight: 'bold',
45
44
  color: '#000'
46
45
  }
47
46
  },
@@ -24,7 +24,6 @@ const CommodityDetailDiroNew = (0, create_1.createMaterial)(_1.default, {
24
24
  commodityStyles: {
25
25
  price: {
26
26
  color: '#000',
27
- fontWeight: 'bold',
28
27
  fontSize: 13
29
28
  },
30
29
  title: {
@@ -25,7 +25,6 @@ const CommodityList = (0, create_1.createMaterial)(_1.default, {
25
25
  commodityStyles: {
26
26
  price: {
27
27
  color: '#000',
28
- fontWeight: 'bold',
29
28
  fontSize: 14
30
29
  },
31
30
  title: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.5.1",
3
+ "version": "1.5.3",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",