pb-sxp-ui 1.2.3 → 1.2.5

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 (68) hide show
  1. package/dist/index.cjs +276 -172
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +2 -2
  4. package/dist/index.js +276 -172
  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 +276 -172
  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/Hashtag/index.js +0 -1
  15. package/es/core/components/SxpPageRender/LikeButton/index.js +34 -15
  16. package/es/core/components/SxpPageRender/Modal/index.js +16 -8
  17. package/es/core/components/SxpPageRender/Popup/index.js +24 -13
  18. package/es/core/components/SxpPageRender/RenderCard.d.ts +1 -0
  19. package/es/core/components/SxpPageRender/RenderCard.js +17 -4
  20. package/es/core/components/SxpPageRender/index.js +3 -3
  21. package/es/core/components/SxpPageRender/typing.d.ts +1 -0
  22. package/es/core/context/SxpDataSourceProvider.d.ts +3 -3
  23. package/es/core/context/SxpDataSourceProvider.js +7 -3
  24. package/es/materials/sxp/cta/AniLink/index.js +5 -1
  25. package/es/materials/sxp/cta/AniLinkPopup/index.d.ts +1 -0
  26. package/es/materials/sxp/cta/AniLinkPopup/index.js +12 -18
  27. package/es/materials/sxp/cta/AniLinkPopup/settingRender.js +1 -1
  28. package/es/materials/sxp/popup/CommodityDetail/index.js +25 -13
  29. package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +28 -17
  30. package/es/materials/sxp/popup/CommodityList/index.js +28 -10
  31. package/es/materials/sxp/popup/CommodityList/material.js +1 -0
  32. package/es/materials/sxp/popup/CommodityList/settingRender.js +5 -0
  33. package/es/materials/sxp/template/MultiCommodity/index.js +3 -3
  34. package/es/materials/sxp/template/MultiCommodityDiro/index.js +3 -3
  35. package/es/materials/sxp/template/components/CommodityGroup.d.ts +4 -0
  36. package/es/materials/sxp/template/components/CommodityGroup.js +12 -15
  37. package/es/materials/sxp/template/components/Img.d.ts +1 -0
  38. package/es/materials/sxp/template/components/Img.js +3 -3
  39. package/es/materials/sxp/template/components/Scroll.d.ts +1 -0
  40. package/es/materials/sxp/template/components/Scroll.js +5 -4
  41. package/lib/core/components/SxpPageRender/Hashtag/index.js +0 -1
  42. package/lib/core/components/SxpPageRender/LikeButton/index.js +34 -15
  43. package/lib/core/components/SxpPageRender/Modal/index.js +16 -8
  44. package/lib/core/components/SxpPageRender/Popup/index.js +23 -12
  45. package/lib/core/components/SxpPageRender/RenderCard.d.ts +1 -0
  46. package/lib/core/components/SxpPageRender/RenderCard.js +17 -4
  47. package/lib/core/components/SxpPageRender/index.js +3 -3
  48. package/lib/core/components/SxpPageRender/typing.d.ts +1 -0
  49. package/lib/core/context/SxpDataSourceProvider.d.ts +3 -3
  50. package/lib/core/context/SxpDataSourceProvider.js +7 -3
  51. package/lib/materials/sxp/cta/AniLink/index.js +5 -1
  52. package/lib/materials/sxp/cta/AniLinkPopup/index.d.ts +1 -0
  53. package/lib/materials/sxp/cta/AniLinkPopup/index.js +11 -17
  54. package/lib/materials/sxp/cta/AniLinkPopup/settingRender.js +1 -1
  55. package/lib/materials/sxp/popup/CommodityDetail/index.js +24 -12
  56. package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +28 -17
  57. package/lib/materials/sxp/popup/CommodityList/index.js +27 -9
  58. package/lib/materials/sxp/popup/CommodityList/material.js +1 -0
  59. package/lib/materials/sxp/popup/CommodityList/settingRender.js +5 -0
  60. package/lib/materials/sxp/template/MultiCommodity/index.js +3 -3
  61. package/lib/materials/sxp/template/MultiCommodityDiro/index.js +3 -3
  62. package/lib/materials/sxp/template/components/CommodityGroup.d.ts +4 -0
  63. package/lib/materials/sxp/template/components/CommodityGroup.js +11 -14
  64. package/lib/materials/sxp/template/components/Img.d.ts +1 -0
  65. package/lib/materials/sxp/template/components/Img.js +3 -3
  66. package/lib/materials/sxp/template/components/Scroll.d.ts +1 -0
  67. package/lib/materials/sxp/template/components/Scroll.js +5 -4
  68. package/package.json +1 -1
@@ -5,14 +5,16 @@ const css_1 = require("@emotion/css");
5
5
  const react_1 = tslib_1.__importStar(require("react"));
6
6
  const hooks_1 = require("../../../../core/hooks");
7
7
  require("./index.less");
8
+ const useEventReport_1 = require("../../../../core/hooks/useEventReport");
8
9
  const tool_1 = require("../../../../core/utils/tool");
9
10
  const Img_1 = tslib_1.__importDefault(require("../../template/components/Img"));
10
- const EventProvider_1 = tslib_1.__importDefault(require("../../template/components/EventProvider"));
11
+ const lodash_1 = require("lodash");
11
12
  const CommodityList = (_a) => {
12
13
  var _b, _c;
13
- var { style, isDefault, rec, viewTime, isPost, bottom_image, commodityStyles, buttonStyle, index, translateY = 0, commodityPicture, isExternalLink } = _a, props = tslib_1.__rest(_a, ["style", "isDefault", "rec", "viewTime", "isPost", "bottom_image", "commodityStyles", "buttonStyle", "index", "translateY", "commodityPicture", "isExternalLink"]);
14
- const { sxpParameter } = (0, hooks_1.useSxpDataSource)();
15
- const { popupDetailData, bffEventReport, isPreview, swiperRef, bffFbReport } = (0, hooks_1.useSxpDataSource)();
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"]);
15
+ const { sxpParameter, popupDetailData, setPopupDetailData, ctaEvent } = (0, hooks_1.useSxpDataSource)();
16
+ const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
17
+ const { popup } = (0, hooks_1.useEditor)();
16
18
  const recData = isPost ? rec : popupDetailData;
17
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];
18
20
  const priceText = (0, react_1.useCallback)((product) => {
@@ -26,12 +28,28 @@ const CommodityList = (_a) => {
26
28
  return '$7,000';
27
29
  }
28
30
  }, []);
31
+ const handleClick = (0, lodash_1.throttle)((item, multiCheckIndex) => {
32
+ ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
33
+ eventSubject: 'clickCta',
34
+ eventDescription: 'User clicked the CTA'
35
+ }, recData, item, index);
36
+ setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }), index, multiCheckIndex }));
37
+ if (isExternalLink) {
38
+ if (item === null || item === void 0 ? void 0 : item.link) {
39
+ jumpToWeb(recData, item, item.bindCta, index);
40
+ window.location.href = window.getJointUtmLink(item.link);
41
+ }
42
+ }
43
+ else {
44
+ onClick === null || onClick === void 0 ? void 0 : onClick();
45
+ }
46
+ }, popup === null || popup === void 0 ? void 0 : popup.duration);
29
47
  return (react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign(Object.assign({}, style), { display: 'flex', flexDirection: 'column', gap: '10px', padding: '0 20px', marginTop: '50px' })) }, product === null || product === void 0 ? void 0 : product.map((item, index) => {
30
48
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
31
- return (react_1.default.createElement(EventProvider_1.default, Object.assign({ key: index, isExternalLink: isExternalLink, rec: recData, index: index }, props, { className: (0, css_1.css)({
49
+ return (react_1.default.createElement(react_1.default.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (react_1.default.createElement("div", Object.assign({ key: index }, props, { className: (0, css_1.css)({
32
50
  display: 'flex'
33
- }) }),
34
- react_1.default.createElement(Img_1.default, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: commodityPicture }),
51
+ }), onClick: () => handleClick(item, index) }),
52
+ react_1.default.createElement(Img_1.default, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: commodityPicture, enableEventReport: false }),
35
53
  react_1.default.createElement("div", { style: {
36
54
  flex: 1,
37
55
  width: `calc(100% - ${(_e = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.width) !== null && _e !== void 0 ? _e : 0}px - ${(_f = commodityPicture === null || commodityPicture === void 0 ? void 0 : commodityPicture.marginRight) !== null && _f !== void 0 ? _f : 0}px - ${(_g = style === null || style === void 0 ? void 0 : style.padding) !== null && _g !== void 0 ? _g : 0}px)`,
@@ -56,9 +74,9 @@ const CommodityList = (_a) => {
56
74
  react_1.default.createElement("div", { style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price, hidden: !!item && !(item === null || item === void 0 ? void 0 : item.price), dangerouslySetInnerHTML: {
57
75
  __html: (0, tool_1.setFontForText)(priceText(item), commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price)
58
76
  } }),
59
- react_1.default.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px', maxWidth: '100px' }), dangerouslySetInnerHTML: {
77
+ react_1.default.createElement("div", { className: 'one-line-ellipsis', style: Object.assign(Object.assign({}, buttonStyle), { padding: '0 15px' }), dangerouslySetInnerHTML: {
60
78
  __html: (0, tool_1.setFontForText)((_l = (_k = item === null || item === void 0 ? void 0 : item.bindCta) === null || _k === void 0 ? void 0 : _k.enTitle) !== null && _l !== void 0 ? _l : 'Shop Now', buttonStyle)
61
- } })))));
79
+ } })))))));
62
80
  })));
63
81
  };
64
82
  exports.default = (0, react_1.memo)(CommodityList);
@@ -41,6 +41,7 @@ const CommodityList = (0, create_1.createMaterial)(_1.default, {
41
41
  backgroundColor: '#000',
42
42
  fontSize: 12,
43
43
  height: 30,
44
+ width: 100,
44
45
  textAlign: 'center',
45
46
  color: '#fff',
46
47
  lineHeight: 2.5
@@ -135,6 +135,11 @@ exports.default = [
135
135
  type: 'Group',
136
136
  label: '尺寸',
137
137
  child: [
138
+ {
139
+ type: 'Number',
140
+ name: ['props', 'buttonStyle', 'width'],
141
+ addonAfter: 'W'
142
+ },
138
143
  {
139
144
  type: 'Number',
140
145
  name: ['props', 'buttonStyle', 'height'],
@@ -19,12 +19,12 @@ const MultiCommodity = (_a) => {
19
19
  const { popup } = (0, hooks_1.useEditor)();
20
20
  const [products, setProducts] = (0, react_1.useState)((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
21
21
  const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
22
- const handleClick = (0, lodash_1.throttle)((item) => {
22
+ const handleClick = (0, lodash_1.throttle)((item, multiCheckIndex) => {
23
23
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
24
24
  eventSubject: 'clickCta',
25
25
  eventDescription: 'User clicked the CTA'
26
26
  }, recData, item, index);
27
- setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }), index }));
27
+ setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }), index, multiCheckIndex }));
28
28
  if (isExternalLink) {
29
29
  if (item === null || item === void 0 ? void 0 : item.link) {
30
30
  jumpToWeb(recData, item, item.bindCta, index);
@@ -37,7 +37,7 @@ const MultiCommodity = (_a) => {
37
37
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
38
38
  return (react_1.default.createElement(Scroll_1.default, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
39
39
  var _a, _b, _c, _d, _e, _f, _g, _h;
40
- return (react_1.default.createElement(react_1.default.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (react_1.default.createElement(react_2.SwiperSlide, Object.assign({ key: index, className: (0, css_1.css)(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
40
+ return (react_1.default.createElement(react_1.default.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (react_1.default.createElement(react_2.SwiperSlide, Object.assign({ key: index, className: (0, css_1.css)(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
41
41
  react_1.default.createElement(Img_1.default, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
42
42
  react_1.default.createElement("div", { className: (0, css_1.css)({
43
43
  color: '#fff',
@@ -18,12 +18,12 @@ const MultiCommodityDiro = (_a) => {
18
18
  const { popup } = (0, hooks_1.useEditor)();
19
19
  const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
20
20
  const [products, setProducts] = (0, react_1.useState)((_c = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProducts) !== null && _c !== void 0 ? _c : [1, 2]);
21
- const handleClick = (0, lodash_1.throttle)((item) => {
21
+ const handleClick = (0, lodash_1.throttle)((item, multiCheckIndex) => {
22
22
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
23
23
  eventSubject: 'clickCta',
24
24
  eventDescription: 'User clicked the CTA'
25
25
  }, recData, item, index);
26
- setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }), index }));
26
+ setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData(Object.assign(Object.assign({}, recData), { video: Object.assign(Object.assign({}, recData === null || recData === void 0 ? void 0 : recData.video), { bindProduct: item }), index, multiCheckIndex }));
27
27
  if (isExternalLink) {
28
28
  if (item === null || item === void 0 ? void 0 : item.link) {
29
29
  jumpToWeb(recData, item, item.bindCta, index);
@@ -36,7 +36,7 @@ const MultiCommodityDiro = (_a) => {
36
36
  }, popup === null || popup === void 0 ? void 0 : popup.duration);
37
37
  return (react_1.default.createElement(Scroll_1.default, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
38
38
  var _a, _b, _c, _d, _e, _f, _g, _h;
39
- return (react_1.default.createElement(react_1.default.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (react_1.default.createElement(react_2.SwiperSlide, Object.assign({ key: index, className: (0, css_1.css)(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
39
+ return (react_1.default.createElement(react_1.default.Fragment, null, recData && !(item === null || item === void 0 ? void 0 : item.bindCta) ? null : (react_1.default.createElement(react_2.SwiperSlide, Object.assign({ key: index, className: (0, css_1.css)(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item, index) }),
40
40
  react_1.default.createElement(Img_1.default, { src: (_d = (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _d !== void 0 ? _d : bottom_image, rec: recData, item: item, index: index, translateY: translateY, imgStyle: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img }),
41
41
  react_1.default.createElement("div", { className: (0, css_1.css)({
42
42
  color: '#000',
@@ -1,5 +1,6 @@
1
1
  import { VideoInfoType } from '../../../../core/components/SxpPageRender/typing';
2
2
  import React, { CSSProperties } from 'react';
3
+ import { ISxpDataSourceContext } from '../../../../core/context/SxpDataSourceProvider';
3
4
  interface ICommodityGroupProps {
4
5
  products?: VideoInfoType['bindProducts'];
5
6
  data?: {
@@ -9,6 +10,9 @@ interface ICommodityGroupProps {
9
10
  };
10
11
  defImg: string;
11
12
  style?: CSSProperties;
13
+ onCLick?: (i: number) => void;
14
+ popupDetailData?: ISxpDataSourceContext['popupDetailData'];
15
+ check?: number;
12
16
  }
13
17
  declare const _default: React.NamedExoticComponent<ICommodityGroupProps>;
14
18
  export default _default;
@@ -4,31 +4,28 @@ const tslib_1 = require("tslib");
4
4
  const react_1 = tslib_1.__importStar(require("react"));
5
5
  const Scroll_1 = tslib_1.__importDefault(require("./Scroll"));
6
6
  const FormatImage_1 = tslib_1.__importDefault(require("../../../../core/components/SxpPageRender/FormatImage"));
7
- const hooks_1 = require("../../../../core/hooks");
8
7
  const react_2 = require("swiper/react");
9
8
  const css_1 = require("@emotion/css");
10
- const CommodityGroup = ({ products, data, defImg, style }) => {
11
- var _a, _b;
12
- const { setPopupDetailData, popupDetailData } = (0, hooks_1.useSxpDataSource)();
13
- const [check, setCheck] = (0, react_1.useState)((_a = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _a !== void 0 ? _a : 0);
14
- const handleClick = (0, react_1.useCallback)((index) => {
15
- setPopupDetailData === null || setPopupDetailData === void 0 ? void 0 : setPopupDetailData((val) => (Object.assign(Object.assign({}, val), { video: Object.assign(Object.assign({}, val === null || val === void 0 ? void 0 : val.video), { bindProduct: products === null || products === void 0 ? void 0 : products[index] }), multiCheckIndex: index })));
16
- }, []);
17
- 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) > 0) || !popupDetailData) && (react_1.default.createElement(Scroll_1.default, { isPadding: false, style: Object.assign(Object.assign({}, style), data === null || data === void 0 ? void 0 : data.style) }, (_b = (popupDetailData ? products : [0, 1, 2, 3])) === null || _b === void 0 ? void 0 : _b.map((item, index) => {
9
+ const CommodityGroup = ({ products, data, defImg, style, onCLick, popupDetailData, check }) => {
10
+ var _a;
11
+ 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) => {
18
12
  var _a, _b, _c;
19
- return (react_1.default.createElement(react_2.SwiperSlide, { className: (0, css_1.css)({
13
+ return (react_1.default.createElement(react_1.default.Fragment, null, (item === null || item === void 0 ? void 0 : item.bindCta) ? (react_1.default.createElement(react_2.SwiperSlide, { className: (0, css_1.css)({
20
14
  width: '50px',
21
15
  height: '50px',
22
16
  marginRight: '10px'
23
- }), onClick: () => handleClick(index), key: index },
17
+ }), onClick: () => {
18
+ onCLick === null || onCLick === void 0 ? void 0 : onCLick(index);
19
+ }, key: index },
24
20
  react_1.default.createElement(FormatImage_1.default, { style: {
25
21
  height: '100%',
26
22
  width: '100%',
27
23
  objectFit: 'cover',
28
24
  display: 'block',
29
- objectPosition: `50% ${(data === null || data === void 0 ? void 0 : data.translateY) ? -(data === null || data === void 0 ? void 0 : data.translateY) + 50 : 50}%`,
30
- border: check === index ? '1px solid #000' : '1px solid #f2f2f2'
31
- }, src: (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : defImg })));
25
+ objectPosition: `50% ${(data === null || data === void 0 ? void 0 : data.translateY) ? (data === null || data === void 0 ? void 0 : data.translateY) + 50 : 50}%`,
26
+ border: check === index ? '1px solid #000' : '1px solid #f2f2f2',
27
+ boxSizing: 'border-box'
28
+ }, src: (_c = (_a = item === null || item === void 0 ? void 0 : item.cover) !== null && _a !== void 0 ? _a : (_b = item === null || item === void 0 ? void 0 : item.homePage) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : defImg }))) : null));
32
29
  })))));
33
30
  };
34
31
  exports.default = (0, react_1.memo)(CommodityGroup);
@@ -8,6 +8,7 @@ export interface IImgProps {
8
8
  style?: CSSProperties;
9
9
  translateY?: number;
10
10
  imgStyle?: CSSProperties;
11
+ enableEventReport?: boolean;
11
12
  }
12
13
  declare const _default: React.NamedExoticComponent<IImgProps>;
13
14
  export default _default;
@@ -6,18 +6,18 @@ const react_1 = tslib_1.__importStar(require("react"));
6
6
  const useOnScreen_1 = tslib_1.__importDefault(require("../../../../core/hooks/useOnScreen"));
7
7
  const hooks_1 = require("../../../../core/hooks");
8
8
  const FormatImage_1 = tslib_1.__importDefault(require("../../../../core/components/SxpPageRender/FormatImage"));
9
- const Img = ({ src, rec, item, index, style, translateY, imgStyle }) => {
9
+ const Img = ({ src, rec, item, index, style, translateY, imgStyle, enableEventReport = true }) => {
10
10
  const ref = (0, react_1.useRef)(null);
11
11
  const isOnScreen = (0, useOnScreen_1.default)(ref);
12
12
  const { ctaEvent } = (0, hooks_1.useSxpDataSource)();
13
13
  (0, react_1.useEffect)(() => {
14
- if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current)) {
14
+ if (isOnScreen && src && (ref === null || ref === void 0 ? void 0 : ref.current) && enableEventReport) {
15
15
  ctaEvent === null || ctaEvent === void 0 ? void 0 : ctaEvent({
16
16
  eventSubject: 'ctaExposure',
17
17
  eventDescription: 'The cta was shown to the user'
18
18
  }, rec, item, index);
19
19
  }
20
- }, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
20
+ }, [isOnScreen, src, ref, rec, ctaEvent, item, index, enableEventReport]);
21
21
  const imgSrc = (0, react_1.useMemo)(() => {
22
22
  return (src === null || src === void 0 ? void 0 : src.includes('.avif')) ? src : `${src}?imrquality/rquality/20`;
23
23
  }, [src]);
@@ -6,6 +6,7 @@ interface IScrollProps {
6
6
  children: any;
7
7
  isPadding?: boolean;
8
8
  style?: CSSProperties;
9
+ enableSlideActive?: boolean;
9
10
  }
10
11
  declare const _default: React.NamedExoticComponent<IScrollProps>;
11
12
  export default _default;
@@ -8,13 +8,14 @@ require("swiper/css/free-mode");
8
8
  require("swiper/css/scrollbar");
9
9
  const modules_1 = require("swiper/modules");
10
10
  const hooks_1 = require("../../../../core/hooks");
11
- const Scroll = ({ children, isPadding = true, style }) => {
11
+ const Scroll = ({ children, isPadding = true, style, enableSlideActive = false }) => {
12
12
  const ref = (0, react_1.useRef)();
13
13
  const { popupDetailData } = (0, hooks_1.useSxpDataSource)();
14
14
  (0, react_1.useEffect)(() => {
15
- var _a;
16
- (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo(popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex);
17
- }, [popupDetailData]);
15
+ var _a, _b;
16
+ if (enableSlideActive)
17
+ (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.swiper.slideTo((_b = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.multiCheckIndex) !== null && _b !== void 0 ? _b : 0);
18
+ }, [popupDetailData, enableSlideActive]);
18
19
  return (react_1.default.createElement(react_2.Swiper, { ref: ref, direction: 'horizontal', slidesPerView: 'auto', freeMode: true, mousewheel: true, modules: [modules_1.FreeMode, modules_1.Scrollbar, modules_1.Mousewheel], style: Object.assign({ padding: isPadding ? '0 12px 0 20px' : 0 }, style) }, children));
19
20
  };
20
21
  exports.default = (0, react_1.memo)(Scroll);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",