pb-sxp-ui 1.1.1 → 1.2.0
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 +2257 -857
- package/dist/index.cjs.map +1 -0
- package/dist/index.css +356 -175
- package/dist/index.js +2257 -857
- package/dist/index.js.map +1 -0
- package/dist/index.min.cjs +4 -3
- package/dist/index.min.cjs.map +1 -0
- package/dist/index.min.js +4 -3
- package/dist/index.min.js.map +1 -0
- package/dist/pb-ui.js +2257 -857
- package/dist/pb-ui.js.map +1 -0
- package/dist/pb-ui.min.js +4 -3
- package/dist/pb-ui.min.js.map +1 -0
- package/es/core/Pagebuilder/type.d.ts +1 -0
- package/es/core/components/SxpPageRender/Hashtag/index.js +1 -3
- package/es/core/components/SxpPageRender/Modal/index.d.ts +3 -0
- package/es/core/components/SxpPageRender/Modal/index.js +70 -6
- package/es/core/components/SxpPageRender/Navbar.js +1 -1
- package/es/core/components/SxpPageRender/Popup/index.js +1 -1
- package/es/core/components/SxpPageRender/RenderCard.d.ts +1 -0
- package/es/core/components/SxpPageRender/RenderCard.js +16 -12
- package/es/core/components/SxpPageRender/VideoWidget/index.js +11 -10
- package/es/core/components/SxpPageRender/WaterFall/List.js +1 -1
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +1 -1
- package/es/core/components/SxpPageRender/index.d.ts +3 -2
- package/es/core/components/SxpPageRender/index.js +51 -17
- package/es/core/components/SxpPageRender/typing.d.ts +1 -0
- package/es/core/context/SxpDataSourceProvider.d.ts +1 -0
- package/es/core/context/SxpDataSourceProvider.js +6 -3
- package/es/core/utils/localStore.d.ts +3 -0
- package/es/core/utils/localStore.js +8 -0
- package/es/materials/sxp/HashTag/material.js +1 -2
- package/es/materials/sxp/cta/AniLink/index.d.ts +14 -0
- package/es/materials/sxp/cta/AniLink/index.js +58 -0
- package/es/materials/sxp/cta/AniLink/interactionRender.d.ts +42 -0
- package/es/materials/sxp/cta/AniLink/interactionRender.js +50 -0
- package/es/materials/sxp/cta/AniLink/material.d.ts +2 -0
- package/es/materials/sxp/cta/AniLink/material.js +38 -0
- package/es/materials/sxp/cta/AniLink/settingRender.d.ts +73 -0
- package/es/materials/sxp/cta/AniLink/settingRender.js +103 -0
- package/es/materials/sxp/cta/AniLinkPopup/index.d.ts +17 -0
- package/es/materials/sxp/cta/AniLinkPopup/index.js +65 -0
- package/es/materials/sxp/cta/AniLinkPopup/interactionRender.d.ts +42 -0
- package/es/materials/sxp/cta/AniLinkPopup/interactionRender.js +50 -0
- package/es/materials/sxp/cta/AniLinkPopup/material.d.ts +2 -0
- package/es/materials/sxp/cta/AniLinkPopup/material.js +52 -0
- package/es/materials/sxp/cta/AniLinkPopup/settingRender.d.ts +176 -0
- package/es/materials/sxp/cta/AniLinkPopup/settingRender.js +249 -0
- package/es/materials/sxp/cta/index.d.ts +2 -0
- package/es/materials/sxp/cta/index.js +2 -0
- package/es/materials/sxp/index.d.ts +1 -0
- package/es/materials/sxp/index.js +1 -0
- package/es/materials/sxp/popup/AppointForm/Form.js +1 -1
- package/es/materials/sxp/popup/CommodityDetail/index.d.ts +5 -0
- package/es/materials/sxp/popup/CommodityDetail/index.js +43 -26
- package/es/materials/sxp/popup/CommodityDetail/interactionRender.d.ts +9 -0
- package/es/materials/sxp/popup/CommodityDetail/interactionRender.js +12 -0
- package/es/materials/sxp/popup/CommodityDetail/material.js +3 -1
- package/es/materials/sxp/popup/CommodityDetail/settingRender.d.ts +37 -0
- package/es/materials/sxp/popup/CommodityDetail/settingRender.js +41 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +5 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +11 -25
- package/es/materials/sxp/popup/CommodityDetailDiroNew/interactionRender.d.ts +9 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/interactionRender.js +12 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/material.js +3 -1
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +37 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +41 -0
- package/es/materials/sxp/popup/CommodityList/index.d.ts +28 -0
- package/es/materials/sxp/popup/CommodityList/index.js +56 -0
- package/es/materials/sxp/popup/CommodityList/interactionRender.d.ts +8 -0
- package/es/materials/sxp/popup/CommodityList/interactionRender.js +11 -0
- package/es/materials/sxp/popup/CommodityList/material.d.ts +2 -0
- package/es/materials/sxp/popup/CommodityList/material.js +51 -0
- package/es/materials/sxp/popup/CommodityList/settingRender.d.ts +151 -0
- package/es/materials/sxp/popup/CommodityList/settingRender.js +207 -0
- package/es/materials/sxp/popup/index.d.ts +1 -0
- package/es/materials/sxp/popup/index.js +1 -0
- package/es/materials/sxp/template/Link/index.js +2 -2
- package/es/materials/sxp/template/MultiCommodity/index.js +2 -2
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +2 -2
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +5 -4
- package/es/materials/sxp/template/components/CommodityGroup.d.ts +14 -0
- package/es/materials/sxp/template/components/CommodityGroup.js +31 -0
- package/es/materials/sxp/template/components/Img.js +1 -1
- package/es/materials/sxp/template/components/Scroll.d.ts +2 -1
- package/es/materials/sxp/template/components/Scroll.js +10 -3
- package/es/materials/sxp/template/components/settingRender.js +0 -5
- package/lib/core/Pagebuilder/type.d.ts +1 -0
- package/lib/core/components/SxpPageRender/Hashtag/index.js +1 -3
- package/lib/core/components/SxpPageRender/Modal/index.d.ts +3 -0
- package/lib/core/components/SxpPageRender/Modal/index.js +70 -6
- package/lib/core/components/SxpPageRender/Navbar.js +1 -1
- package/lib/core/components/SxpPageRender/Popup/index.js +1 -1
- package/lib/core/components/SxpPageRender/RenderCard.d.ts +1 -0
- package/lib/core/components/SxpPageRender/RenderCard.js +16 -12
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +11 -10
- package/lib/core/components/SxpPageRender/WaterFall/List.js +1 -1
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +1 -1
- package/lib/core/components/SxpPageRender/index.d.ts +3 -2
- package/lib/core/components/SxpPageRender/index.js +50 -16
- package/lib/core/components/SxpPageRender/typing.d.ts +1 -0
- package/lib/core/context/SxpDataSourceProvider.d.ts +1 -0
- package/lib/core/context/SxpDataSourceProvider.js +6 -3
- package/lib/core/utils/localStore.d.ts +3 -0
- package/lib/core/utils/localStore.js +11 -1
- package/lib/materials/sxp/HashTag/material.js +1 -2
- package/lib/materials/sxp/cta/AniLink/index.d.ts +14 -0
- package/lib/materials/sxp/cta/AniLink/index.js +60 -0
- package/lib/materials/sxp/cta/AniLink/interactionRender.d.ts +42 -0
- package/lib/materials/sxp/cta/AniLink/interactionRender.js +52 -0
- package/lib/materials/sxp/cta/AniLink/material.d.ts +2 -0
- package/lib/materials/sxp/cta/AniLink/material.js +42 -0
- package/lib/materials/sxp/cta/AniLink/settingRender.d.ts +73 -0
- package/lib/materials/sxp/cta/AniLink/settingRender.js +105 -0
- package/lib/materials/sxp/cta/AniLinkPopup/index.d.ts +17 -0
- package/lib/materials/sxp/cta/AniLinkPopup/index.js +67 -0
- package/lib/materials/sxp/cta/AniLinkPopup/interactionRender.d.ts +42 -0
- package/lib/materials/sxp/cta/AniLinkPopup/interactionRender.js +52 -0
- package/lib/materials/sxp/cta/AniLinkPopup/material.d.ts +2 -0
- package/lib/materials/sxp/cta/AniLinkPopup/material.js +56 -0
- package/lib/materials/sxp/cta/AniLinkPopup/settingRender.d.ts +176 -0
- package/lib/materials/sxp/cta/AniLinkPopup/settingRender.js +251 -0
- package/lib/materials/sxp/cta/index.d.ts +2 -0
- package/lib/materials/sxp/cta/index.js +5 -0
- package/lib/materials/sxp/index.d.ts +1 -0
- package/lib/materials/sxp/index.js +1 -0
- package/lib/materials/sxp/popup/AppointForm/Form.js +1 -1
- package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +5 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.js +43 -26
- package/lib/materials/sxp/popup/CommodityDetail/interactionRender.d.ts +9 -0
- package/lib/materials/sxp/popup/CommodityDetail/interactionRender.js +14 -0
- package/lib/materials/sxp/popup/CommodityDetail/material.js +3 -1
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.d.ts +37 -0
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +41 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +5 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +11 -25
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/interactionRender.d.ts +9 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/interactionRender.js +14 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/material.js +3 -1
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +37 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +41 -0
- package/lib/materials/sxp/popup/CommodityList/index.d.ts +28 -0
- package/lib/materials/sxp/popup/CommodityList/index.js +58 -0
- package/lib/materials/sxp/popup/CommodityList/interactionRender.d.ts +8 -0
- package/lib/materials/sxp/popup/CommodityList/interactionRender.js +13 -0
- package/lib/materials/sxp/popup/CommodityList/material.d.ts +2 -0
- package/lib/materials/sxp/popup/CommodityList/material.js +55 -0
- package/lib/materials/sxp/popup/CommodityList/settingRender.d.ts +151 -0
- package/lib/materials/sxp/popup/CommodityList/settingRender.js +209 -0
- package/lib/materials/sxp/popup/index.d.ts +1 -0
- package/lib/materials/sxp/popup/index.js +1 -0
- package/lib/materials/sxp/template/Link/index.js +2 -2
- package/lib/materials/sxp/template/MultiCommodity/index.js +2 -2
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +2 -2
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +5 -4
- package/lib/materials/sxp/template/components/CommodityGroup.d.ts +14 -0
- package/lib/materials/sxp/template/components/CommodityGroup.js +34 -0
- package/lib/materials/sxp/template/components/Img.js +1 -1
- package/lib/materials/sxp/template/components/Scroll.d.ts +2 -1
- package/lib/materials/sxp/template/components/Scroll.js +9 -2
- package/lib/materials/sxp/template/components/settingRender.js +0 -5
- package/package.json +1 -1
@@ -35,9 +35,9 @@ const MultiCommodity = (_a) => {
|
|
35
35
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
36
36
|
}
|
37
37
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
38
|
-
return (react_1.default.createElement(Scroll_1.default, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
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:
|
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) }),
|
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',
|
@@ -34,9 +34,9 @@ const MultiCommodityDiro = (_a) => {
|
|
34
34
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
35
35
|
}
|
36
36
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
37
|
-
return (react_1.default.createElement(Scroll_1.default, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
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:
|
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) }),
|
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',
|
@@ -18,12 +18,13 @@ const MultiCommodityDiroNew = (_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,
|
27
|
+
multiCheckIndex }));
|
27
28
|
if (isExternalLink) {
|
28
29
|
if (item === null || item === void 0 ? void 0 : item.link) {
|
29
30
|
jumpToWeb(recData, item, item.bindCta, index);
|
@@ -34,9 +35,9 @@ const MultiCommodityDiroNew = (_a) => {
|
|
34
35
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
35
36
|
}
|
36
37
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
37
|
-
return (react_1.default.createElement(Scroll_1.default, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
38
|
+
return (react_1.default.createElement(Scroll_1.default, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item, index) => {
|
38
39
|
var _a, _b, _c, _d, _e, _f, _g;
|
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:
|
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) }),
|
40
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 }),
|
41
42
|
react_1.default.createElement("div", { className: (0, css_1.css)({
|
42
43
|
color: '#fff',
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { VideoInfoType } from '../../../../core/components/SxpPageRender/typing';
|
2
|
+
import React, { CSSProperties } from 'react';
|
3
|
+
interface ICommodityGroupProps {
|
4
|
+
products?: VideoInfoType['bindProducts'];
|
5
|
+
data?: {
|
6
|
+
open?: boolean;
|
7
|
+
translateY?: number;
|
8
|
+
style?: CSSProperties;
|
9
|
+
};
|
10
|
+
defImg: string;
|
11
|
+
style?: CSSProperties;
|
12
|
+
}
|
13
|
+
declare const _default: React.NamedExoticComponent<ICommodityGroupProps>;
|
14
|
+
export default _default;
|
@@ -0,0 +1,34 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const tslib_1 = require("tslib");
|
4
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
5
|
+
const Scroll_1 = tslib_1.__importDefault(require("./Scroll"));
|
6
|
+
const FormatImage_1 = tslib_1.__importDefault(require("../../../../core/components/SxpPageRender/FormatImage"));
|
7
|
+
const hooks_1 = require("../../../../core/hooks");
|
8
|
+
const react_2 = require("swiper/react");
|
9
|
+
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) => {
|
18
|
+
var _a, _b, _c;
|
19
|
+
return (react_1.default.createElement(react_2.SwiperSlide, { className: (0, css_1.css)({
|
20
|
+
width: '50px',
|
21
|
+
height: '50px',
|
22
|
+
marginRight: '10px'
|
23
|
+
}), onClick: () => handleClick(index), key: index },
|
24
|
+
react_1.default.createElement(FormatImage_1.default, { style: {
|
25
|
+
height: '100%',
|
26
|
+
width: '100%',
|
27
|
+
objectFit: 'cover',
|
28
|
+
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 })));
|
32
|
+
})))));
|
33
|
+
};
|
34
|
+
exports.default = (0, react_1.memo)(CommodityGroup);
|
@@ -23,6 +23,6 @@ const Img = ({ src, rec, item, index, style, translateY, imgStyle }) => {
|
|
23
23
|
}, [src]);
|
24
24
|
return (react_1.default.createElement("div", { className: (0, css_1.css)(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, imgStyle)) },
|
25
25
|
react_1.default.createElement("div", { ref: ref, hidden: !src, className: (0, css_1.css)({ width: '100%', height: '100%' }) },
|
26
|
-
react_1.default.createElement(FormatImage_1.default, { className: (0, css_1.css)(Object.assign({ width: '100%', objectFit: 'cover', height: '100%', display: 'block', objectPosition: `50% ${translateY ? translateY + 50 : 50}%` }, style)), src: src }))));
|
26
|
+
react_1.default.createElement(FormatImage_1.default, { className: (0, css_1.css)(Object.assign({ width: '100%', objectFit: 'cover', height: '100%', display: 'block', objectPosition: `50% ${translateY ? -translateY + 50 : 50}%` }, style)), src: src }))));
|
27
27
|
};
|
28
28
|
exports.default = (0, react_1.memo)(Img);
|
@@ -1,10 +1,11 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React, { CSSProperties } from 'react';
|
2
2
|
import 'swiper/css';
|
3
3
|
import 'swiper/css/free-mode';
|
4
4
|
import 'swiper/css/scrollbar';
|
5
5
|
interface IScrollProps {
|
6
6
|
children: any;
|
7
7
|
isPadding?: boolean;
|
8
|
+
style?: CSSProperties;
|
8
9
|
}
|
9
10
|
declare const _default: React.NamedExoticComponent<IScrollProps>;
|
10
11
|
export default _default;
|
@@ -7,7 +7,14 @@ require("swiper/css");
|
|
7
7
|
require("swiper/css/free-mode");
|
8
8
|
require("swiper/css/scrollbar");
|
9
9
|
const modules_1 = require("swiper/modules");
|
10
|
-
const
|
11
|
-
|
10
|
+
const hooks_1 = require("../../../../core/hooks");
|
11
|
+
const Scroll = ({ children, isPadding = true, style }) => {
|
12
|
+
const ref = (0, react_1.useRef)();
|
13
|
+
const { popupDetailData } = (0, hooks_1.useSxpDataSource)();
|
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]);
|
18
|
+
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));
|
12
19
|
};
|
13
20
|
exports.default = (0, react_1.memo)(Scroll);
|