pb-sxp-ui 1.2.6 → 1.2.7

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.
Files changed (32) hide show
  1. package/dist/index.cjs +53 -37
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +1 -3
  4. package/dist/index.js +53 -37
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.cjs +3 -3
  7. package/dist/index.min.cjs.map +1 -1
  8. package/dist/index.min.js +3 -3
  9. package/dist/index.min.js.map +1 -1
  10. package/dist/pb-ui.js +53 -37
  11. package/dist/pb-ui.js.map +1 -1
  12. package/dist/pb-ui.min.js +3 -3
  13. package/dist/pb-ui.min.js.map +1 -1
  14. package/es/core/components/SxpPageRender/FormatImage.js +7 -3
  15. package/es/core/components/SxpPageRender/Popup/index.js +5 -5
  16. package/es/core/components/SxpPageRender/index.js +5 -5
  17. package/es/core/context/SxpDataSourceProvider.js +25 -15
  18. package/es/core/hooks/useEventReport.js +4 -4
  19. package/es/materials/sxp/popup/CommodityList/index.d.ts +0 -1
  20. package/es/materials/sxp/popup/CommodityList/index.js +2 -1
  21. package/es/materials/sxp/template/components/CommodityGroup.d.ts +1 -1
  22. package/es/materials/sxp/template/components/CommodityGroup.js +2 -1
  23. package/lib/core/components/SxpPageRender/FormatImage.js +7 -3
  24. package/lib/core/components/SxpPageRender/Popup/index.js +5 -5
  25. package/lib/core/components/SxpPageRender/index.js +5 -5
  26. package/lib/core/context/SxpDataSourceProvider.js +25 -15
  27. package/lib/core/hooks/useEventReport.js +4 -4
  28. package/lib/materials/sxp/popup/CommodityList/index.d.ts +0 -1
  29. package/lib/materials/sxp/popup/CommodityList/index.js +2 -1
  30. package/lib/materials/sxp/template/components/CommodityGroup.d.ts +1 -1
  31. package/lib/materials/sxp/template/components/CommodityGroup.js +2 -1
  32. package/package.json +1 -1
@@ -11,12 +11,13 @@ const Img_1 = tslib_1.__importDefault(require("../../template/components/Img"));
11
11
  const lodash_1 = require("lodash");
12
12
  const CommodityList = (_a) => {
13
13
  var _b, _c;
14
- var { style, isDefault, rec, viewTime, isPost, bottom_image, commodityStyles, buttonStyle, index, translateY = 0, commodityPicture, isExternalLink, onClick } = _a, props = tslib_1.__rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "commodityStyles", "buttonStyle", "index", "translateY", "commodityPicture", "isExternalLink", "onClick"]);
14
+ var { style, isDefault, rec, viewTime, isPost, bottom_image, commodityStyles, buttonStyle, translateY = 0, commodityPicture, isExternalLink, onClick } = _a, props = tslib_1.__rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "commodityStyles", "buttonStyle", "translateY", "commodityPicture", "isExternalLink", "onClick"]);
15
15
  const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent } = (0, hooks_1.useSxpDataSource)();
16
16
  const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
17
17
  const { popup } = (0, hooks_1.useEditor)();
18
18
  const recData = isPost ? rec : popupDetailData;
19
19
  const product = (_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [null, null, null, null];
20
+ const index = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
20
21
  const priceText = (0, react_1.useCallback)((product) => {
21
22
  var _a, _b, _c, _d, _e;
22
23
  if ((product === null || product === void 0 ? void 0 : product.currency) && (product === null || product === void 0 ? void 0 : product.price)) {
@@ -12,7 +12,7 @@ interface ICommodityGroupProps {
12
12
  style?: CSSProperties;
13
13
  onCLick?: (i: number) => void;
14
14
  popupDetailData?: ISxpDataSourceContext['popupDetailData'];
15
- check?: number;
15
+ check: number;
16
16
  }
17
17
  declare const _default: React.NamedExoticComponent<ICommodityGroupProps>;
18
18
  export default _default;
@@ -15,7 +15,8 @@ const CommodityGroup = ({ products, data, defImg, style, onCLick, popupDetailDat
15
15
  const handleClick = (item, index) => {
16
16
  if (check === index)
17
17
  return;
18
- productView(popupDetailData, item, item === null || item === void 0 ? void 0 : item.bindCta, popupCurTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);
18
+ const prevItem = products === null || products === void 0 ? void 0 : products[check];
19
+ productView(popupDetailData, prevItem, prevItem === null || prevItem === void 0 ? void 0 : prevItem.bindCta, popupCurTimeRef.current, popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index);
19
20
  onCLick === null || onCLick === void 0 ? void 0 : onCLick(index);
20
21
  };
21
22
  return (react_1.default.createElement(react_1.default.Fragment, null, (data === null || data === void 0 ? void 0 : data.open) && ((products && (products === null || products === void 0 ? void 0 : products.length) > 1) || !popupDetailData) && (react_1.default.createElement(Scroll_1.default, { enableSlideActive: true, isPadding: false, style: Object.assign(Object.assign({}, style), data === null || data === void 0 ? void 0 : data.style) }, (_a = (popupDetailData ? products : [0, 1, 2, 3])) === null || _a === void 0 ? void 0 : _a.map((item, index) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",