pb-sxp-ui 1.0.72 → 1.0.74
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 +87 -67
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +6 -6
- package/dist/index.js +87 -67
- 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 +90 -71
- 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/FormatImage.js +7 -2
- package/es/core/components/SxpPageRender/Popup/index.js +2 -2
- package/es/core/components/SxpPageRender/index.js +27 -21
- package/es/materials/sxp/popup/AppointForm/index.js +3 -1
- package/es/materials/sxp/popup/AppointForm/settingRender.js +0 -5
- package/es/materials/sxp/popup/CommodityDetail/index.js +11 -5
- package/es/materials/sxp/popup/CommodityDetail/settingRender.js +1 -1
- package/es/materials/sxp/popup/CommodityDetailDiro/index.js +2 -3
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +12 -6
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +1 -1
- package/es/materials/sxp/template/Commodity/index.js +5 -5
- package/es/materials/sxp/template/CommodityDiro/index.js +5 -5
- package/es/materials/sxp/template/CommodityDiroNew/index.js +5 -5
- package/es/materials/sxp/template/MultiCommodity/index.js +1 -1
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +1 -1
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +1 -1
- package/es/materials/sxp/template/components/settingRender.js +1 -1
- package/lib/core/components/SxpPageRender/FormatImage.js +7 -2
- package/lib/core/components/SxpPageRender/Popup/index.js +2 -2
- package/lib/core/components/SxpPageRender/index.js +27 -21
- package/lib/materials/sxp/popup/AppointForm/index.js +3 -1
- package/lib/materials/sxp/popup/AppointForm/settingRender.js +0 -5
- package/lib/materials/sxp/popup/CommodityDetail/index.js +10 -4
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +1 -1
- package/lib/materials/sxp/popup/CommodityDetailDiro/index.js +2 -3
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +11 -5
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +1 -1
- package/lib/materials/sxp/template/Commodity/index.js +5 -5
- package/lib/materials/sxp/template/CommodityDiro/index.js +5 -5
- package/lib/materials/sxp/template/CommodityDiroNew/index.js +5 -5
- package/lib/materials/sxp/template/MultiCommodity/index.js +1 -1
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +1 -1
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +1 -1
- package/lib/materials/sxp/template/components/settingRender.js +1 -1
- package/package.json +3 -1
@@ -1,15 +1,20 @@
|
|
1
1
|
import React, { forwardRef, memo, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
2
|
+
import { useSxpDataSource } from '../../../core/hooks';
|
2
3
|
const FormatImage = forwardRef((props, ref) => {
|
3
4
|
const { src, onLoad, style, className, loading } = props;
|
4
5
|
const [imgSrc, setImgSrc] = useState();
|
6
|
+
const { swiperRef } = useSxpDataSource();
|
5
7
|
useImperativeHandle(ref, () => ({
|
6
8
|
setSrc: (v) => {
|
7
9
|
setImgSrc(v);
|
8
10
|
}
|
9
11
|
}));
|
10
12
|
useEffect(() => {
|
11
|
-
|
12
|
-
|
13
|
+
var _a, _b;
|
14
|
+
const index = (_b = (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.activeIndex;
|
15
|
+
if (index === 0 || index > 0)
|
16
|
+
setImgSrc(src);
|
17
|
+
}, [src, swiperRef]);
|
13
18
|
const imgRef = useRef(null);
|
14
19
|
return (React.createElement(React.Fragment, null, (imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc.includes('.avif')) ? (React.createElement("picture", null,
|
15
20
|
React.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
|
@@ -45,14 +45,14 @@ const Popup = () => {
|
|
45
45
|
const renderPopupDetail = useMemo(() => {
|
46
46
|
var _a, _b, _c;
|
47
47
|
return (_c = (_b = (_a = schema === null || schema === void 0 ? void 0 : schema.sxpPageConf) === null || _a === void 0 ? void 0 : _a.globalConfig) === null || _b === void 0 ? void 0 : _b.popupList) === null || _c === void 0 ? void 0 : _c.map((value, index) => {
|
48
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
48
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
49
49
|
if ((value === null || value === void 0 ? void 0 : value.id) === (popup === null || popup === void 0 ? void 0 : popup.id)) {
|
50
50
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
51
51
|
const Component = withBindDataSource(t);
|
52
52
|
const isExternalLink = ((_d = (_c = (_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.event) === null || _c === void 0 ? void 0 : _c.onClick) === null || _d === void 0 ? void 0 : _d.linkType) === 'externalLink';
|
53
53
|
const isPopup = ((_g = (_f = (_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.event) === null || _f === void 0 ? void 0 : _f.onClick) === null || _g === void 0 ? void 0 : _g.linkType) === 'popup';
|
54
54
|
const defaulSetting = (_h = t === null || t === void 0 ? void 0 : t.extend) === null || _h === void 0 ? void 0 : _h.defaulSetting;
|
55
|
-
return (React.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_j = value === null || value === void 0 ? void 0 : value.item) === null || _j === void 0 ? void 0 : _j.style), { width: '
|
55
|
+
return (React.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_j = value === null || value === void 0 ? void 0 : value.item) === null || _j === void 0 ? void 0 : _j.style), { width: (_k = window.innerWidth) !== null && _k !== void 0 ? _k : '100vw', height: '80vh', overflow: 'auto' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_l = value === null || value === void 0 ? void 0 : value.item) === null || _l === void 0 ? void 0 : _l.textStyle), bindDatas: (_o = (_m = value === null || value === void 0 ? void 0 : value.item) === null || _m === void 0 ? void 0 : _m.bindDatas) !== null && _o !== void 0 ? _o : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_p = value === null || value === void 0 ? void 0 : value.item) === null || _p === void 0 ? void 0 : _p.props, { event: ((_q = value === null || value === void 0 ? void 0 : value.item) === null || _q === void 0 ? void 0 : _q.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, isExternalLink: isExternalLink, isPopup: isPopup, onClose: handleClose })));
|
56
56
|
}
|
57
57
|
else {
|
58
58
|
return React.createElement(React.Fragment, null);
|
@@ -122,7 +122,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
122
122
|
useEffect(() => {
|
123
123
|
const item = data === null || data === void 0 ? void 0 : data[activeIndex];
|
124
124
|
const visibleChange = () => {
|
125
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
125
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
126
126
|
if (document.visibilityState === 'hidden') {
|
127
127
|
SXP_EVENT_BUS.emit(SXP_EVENT_TYPE.PAGE_DID_HIDE, item);
|
128
128
|
handleReportViewImageEnd(item);
|
@@ -131,16 +131,16 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
131
131
|
if (popupDetailData && (((_b = (_a = item === null || item === void 0 ? void 0 : item.video) === null || _a === void 0 ? void 0 : _a.bindProducts) === null || _b === void 0 ? void 0 : _b.length) || ((_c = item === null || item === void 0 ? void 0 : item.video) === null || _c === void 0 ? void 0 : _c.bindProduct))) {
|
132
132
|
fromKName = 'pdpPage';
|
133
133
|
}
|
134
|
-
else if (popupDetailData && (tempMap === null || tempMap === void 0 ? void 0 : tempMap[(_f = (_e = (_d = item === null || item === void 0 ? void 0 : item.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : ''].item.type) === 'Appoint') {
|
134
|
+
else if (popupDetailData && ((_g = tempMap === null || tempMap === void 0 ? void 0 : tempMap[(_f = (_e = (_d = item === null || item === void 0 ? void 0 : item.video) === null || _d === void 0 ? void 0 : _d.bindCta) === null || _e === void 0 ? void 0 : _e.itemId) !== null && _f !== void 0 ? _f : ''].item) === null || _g === void 0 ? void 0 : _g.type) === 'Appoint') {
|
135
135
|
fromKName = 'formPage';
|
136
136
|
}
|
137
137
|
else if (isFromHashtag) {
|
138
138
|
fromKName = 'hashTagPage';
|
139
139
|
}
|
140
|
-
else if ((
|
140
|
+
else if ((_h = item === null || item === void 0 ? void 0 : item.video) === null || _h === void 0 ? void 0 : _h.url) {
|
141
141
|
fromKName = 'videoPage';
|
142
142
|
}
|
143
|
-
else if (((
|
143
|
+
else if (((_j = item === null || item === void 0 ? void 0 : item.video) === null || _j === void 0 ? void 0 : _j.imgUrls) && ((_l = (_k = item === null || item === void 0 ? void 0 : item.video) === null || _k === void 0 ? void 0 : _k.imgUrls) === null || _l === void 0 ? void 0 : _l.length)) {
|
144
144
|
fromKName = 'imagePage';
|
145
145
|
}
|
146
146
|
else if (item === null || item === void 0 ? void 0 : item.product) {
|
@@ -151,12 +151,12 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
151
151
|
sessionDuration: Math.floor((new Date() - curTime.current) / 1000) + '',
|
152
152
|
eventSubject: 'sessionCompleted',
|
153
153
|
eventDescription: 'Session completed',
|
154
|
-
contentId: (
|
155
|
-
productId: (
|
154
|
+
contentId: (_m = item === null || item === void 0 ? void 0 : item.video) === null || _m === void 0 ? void 0 : _m.itemId,
|
155
|
+
productId: (_o = item === null || item === void 0 ? void 0 : item.product) === null || _o === void 0 ? void 0 : _o.itemId,
|
156
156
|
position: activeIndex + '',
|
157
157
|
fromKName,
|
158
158
|
fromKPage: location === null || location === void 0 ? void 0 : location.href,
|
159
|
-
ctatId: (
|
159
|
+
ctatId: (_r = (_q = (_p = item === null || item === void 0 ? void 0 : item.video) === null || _p === void 0 ? void 0 : _p.bindCta) === null || _q === void 0 ? void 0 : _q.itemId) !== null && _r !== void 0 ? _r : ''
|
160
160
|
}
|
161
161
|
});
|
162
162
|
}
|
@@ -243,8 +243,10 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
243
243
|
((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.title) && !isShowMore && React.createElement("div", { className: 'clc-sxp-bottom-shadow' }),
|
244
244
|
React.createElement("div", { className: 'clc-sxp-bottom' },
|
245
245
|
React.createElement(Nudge, { nudge: nudge }),
|
246
|
-
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)
|
247
|
-
React.createElement(
|
246
|
+
(globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA) === undefined || (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowCTA)
|
247
|
+
? (React.createElement("div", { className: 'clc-sxp-bottom-card' },
|
248
|
+
React.createElement(RenderCard, { rec: rec, index: index, tempMap: tempMap, resolver: resolver })))
|
249
|
+
: null,
|
248
250
|
React.createElement("div", null,
|
249
251
|
React.createElement(ExpandableText, { className: 'clc-sxp-bottom-text', isPost: true, foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, text: (_c = (_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.title) !== null && _c !== void 0 ? _c : '', style: Object.assign(Object.assign({}, descStyle), { textShadow: (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isOpenTextShadow) ? '2px 2px 4px rgba(0, 0, 0, 0.5)' : 'none' }), onChange: onExpandableChange }),
|
250
252
|
React.createElement(Hashtag, { index: activeIndex, tags: (_e = (_d = rec === null || rec === void 0 ? void 0 : rec.video) === null || _d === void 0 ? void 0 : _d.hashTags) !== null && _e !== void 0 ? _e : [], itemId: (_f = rec === null || rec === void 0 ? void 0 : rec.video) === null || _f === void 0 ? void 0 : _f.itemId, itemType: ((_g = rec === null || rec === void 0 ? void 0 : rec.video) === null || _g === void 0 ? void 0 : _g.itemId) ? 'VIDEO' : null, rec: rec, hashTagStyle: hashTagStyle })))));
|
@@ -390,17 +392,19 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
390
392
|
React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } })));
|
391
393
|
}
|
392
394
|
return visList === null || visList === void 0 ? void 0 : visList.map((rec, index) => {
|
393
|
-
return (React.createElement(SwiperSlide, { key: index, virtualIndex: index }, rec && (React.createElement(React.Fragment, null, (rec === null || rec === void 0 ? void 0 : rec.loading)
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
395
|
+
return (React.createElement(SwiperSlide, { key: index, virtualIndex: index }, rec && (React.createElement(React.Fragment, null, (rec === null || rec === void 0 ? void 0 : rec.loading)
|
396
|
+
? (React.createElement("div", { style: {
|
397
|
+
height,
|
398
|
+
width: containerWidth,
|
399
|
+
display: 'flex',
|
400
|
+
justifyContent: 'center',
|
401
|
+
alignItems: 'center'
|
402
|
+
} },
|
403
|
+
React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } })))
|
404
|
+
: (React.createElement(React.Fragment, null,
|
405
|
+
renderContent(rec, index),
|
406
|
+
renderBottom(rec, index),
|
407
|
+
renderLikeButton(rec, index)))))));
|
404
408
|
});
|
405
409
|
}, [containerWidth, data, height, loading, renderBottom, renderContent, visList, loadingImage]);
|
406
410
|
const mutedIcon = useIconLink('/pb_static/5beaaa5ce7f3477b99db3838619cc471.png');
|
@@ -411,7 +415,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
411
415
|
} })),
|
412
416
|
renderLogo,
|
413
417
|
React.createElement(Tagbar, { tagList: tagList, setActiveIndex: setActiveIndex }),
|
414
|
-
isShowFingerTip
|
418
|
+
isShowFingerTip
|
419
|
+
? (React.createElement(FingerSwipeTip, { imageUrl: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipIcon, style: { top: `${50 + ((_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.swipeTipOffset) !== null && _a !== void 0 ? _a : 0)}%` } }))
|
420
|
+
: null,
|
415
421
|
React.createElement(Swiper, { ref: swiperRef, onSlideChange: () => {
|
416
422
|
swiperRef.current.swiper.allowTouchMove = false;
|
417
423
|
setTimeout(() => {
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { __awaiter, __rest } from "tslib";
|
2
2
|
import { css } from '@emotion/css';
|
3
3
|
import React, { memo, useMemo, useRef, useState } from 'react';
|
4
|
+
import { BetaSchemaForm } from '@ant-design/pro-components';
|
4
5
|
import { cloneDeep, debounce } from 'lodash';
|
5
6
|
import { useSxpDataSource } from '../../../../core/hooks';
|
6
7
|
import './index.less';
|
@@ -80,7 +81,8 @@ const AppointForm = (_a) => {
|
|
80
81
|
return (React.createElement("div", { className: 'pb-appoint-form' },
|
81
82
|
React.createElement("div", { className: `pb-appoint-form-title ${css(Object.assign({}, textStyle))}` }, title),
|
82
83
|
React.createElement("div", Object.assign({ className: css(Object.assign({}, style)) }, props),
|
83
|
-
React.createElement("div", { className: 'pb-appoint-form-container' }
|
84
|
+
React.createElement("div", { className: 'pb-appoint-form-container' },
|
85
|
+
React.createElement(BetaSchemaForm, { columns: columnsData, submitter: false, layout: layoutType, autoFocusFirstInput: false, size: 'large', formRef: formRef, className: 'panel-reset' }))),
|
84
86
|
React.createElement("div", { className: 'pb-appoint-form-btn-wrapper' },
|
85
87
|
React.createElement("button", { onClick: handleSubmit, className: 'pb-appoint-form-btn', style: Object.assign({ color: submitColor, background: submitBgColor }, submitButtonStyle) }, loading ? React.createElement(React.Fragment, null, "loading...") : submitText))));
|
86
88
|
};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { __rest } from "tslib";
|
2
2
|
import { css } from '@emotion/css';
|
3
|
-
import React, { memo, useEffect, useMemo, useRef, useState } from 'react';
|
3
|
+
import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
4
4
|
import { useSxpDataSource } from '../../../../core/hooks';
|
5
5
|
import './index.less';
|
6
6
|
import { Autoplay, Pagination } from 'swiper/modules';
|
@@ -62,9 +62,9 @@ const CommodityDetail = (_a) => {
|
|
62
62
|
const renderContent = ({ isPost }) => {
|
63
63
|
var _a, _b, _c;
|
64
64
|
return (React.createElement("div", null,
|
65
|
-
React.createElement("div", { className: 'pb-commondity-content-collection', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection, hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === '') }, (_a = product === null || product === void 0 ? void 0 : product.collection) !== null && _a !== void 0 ? _a : 'Tiffany Lock'),
|
66
|
-
React.createElement("div", { className: 'pb-commondity-content-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title, hidden: !!product && !(product === null || product === void 0 ? void 0 : product.title) }, (_b = product === null || product === void 0 ? void 0 : product.title) !== null && _b !== void 0 ? _b : 'Pendant in Yellow Gold with Diamonds, Medium'),
|
67
|
-
React.createElement("div", { className: 'pb-commondity-content-price', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price, hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price) }, priceText),
|
65
|
+
React.createElement("div", { className: 'pb-commondity-content-collection', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection), hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === '') }, (_a = product === null || product === void 0 ? void 0 : product.collection) !== null && _a !== void 0 ? _a : 'Tiffany Lock'),
|
66
|
+
React.createElement("div", { className: 'pb-commondity-content-title', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title), hidden: !!product && !(product === null || product === void 0 ? void 0 : product.title) }, (_b = product === null || product === void 0 ? void 0 : product.title) !== null && _b !== void 0 ? _b : 'Pendant in Yellow Gold with Diamonds, Medium'),
|
67
|
+
React.createElement("div", { className: 'pb-commondity-content-price', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price), hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price) }, priceText),
|
68
68
|
React.createElement("div", { hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.info) || (product === null || product === void 0 ? void 0 : product.info) === '') },
|
69
69
|
React.createElement(ExpandableText, { foldText: tipText === null || tipText === void 0 ? void 0 : tipText.foldText, unfoldText: tipText === null || tipText === void 0 ? void 0 : tipText.unfoldText, onClick: () => setShowModal(true), isPost: isPost, text: (_c = product === null || product === void 0 ? void 0 : product.info) !== null && _c !== void 0 ? _c : `The design inspiration of Tiffany Lock series comes from the power of connection and inclusiveness, and the
|
70
70
|
bold and avant-garde visual design interprets the emotional bond connecting my heart. The Tiffany Lock
|
@@ -76,6 +76,12 @@ const CommodityDetail = (_a) => {
|
|
76
76
|
var _a;
|
77
77
|
return (React.createElement(React.Fragment, null, (isDefault || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { onClick: handleLink, className: 'pb-commondity-btn', style: buttonStyle }, (_a = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _a !== void 0 ? _a : 'Purchase on Website'))));
|
78
78
|
};
|
79
|
+
const getStyle = useCallback((style) => {
|
80
|
+
if (style === null || style === void 0 ? void 0 : style.lineClamp) {
|
81
|
+
return Object.assign(Object.assign({}, style), { overflow: 'hidden', WebkitLineClamp: style === null || style === void 0 ? void 0 : style.lineClamp, textOverflow: 'ellipsis', display: '-webkit-box', webkitBoxOrient: 'vertical' });
|
82
|
+
}
|
83
|
+
return style;
|
84
|
+
}, []);
|
79
85
|
return (React.createElement("div", { className: 'pb-commondity' },
|
80
86
|
React.createElement("div", Object.assign({ className: css(Object.assign({}, style)) }, props),
|
81
87
|
product && ((_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.length) > 0 && (React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
|
@@ -98,7 +104,7 @@ const CommodityDetail = (_a) => {
|
|
98
104
|
width: '100%',
|
99
105
|
objectFit: 'cover',
|
100
106
|
display: 'block',
|
101
|
-
|
107
|
+
objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? -(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
|
102
108
|
}, src: src }))));
|
103
109
|
}))),
|
104
110
|
!((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css({
|
@@ -68,9 +68,8 @@ const CommodityDetailDiro = (_a) => {
|
|
68
68
|
setSpread(!spread);
|
69
69
|
};
|
70
70
|
useEffect(() => {
|
71
|
-
var _a
|
72
|
-
|
73
|
-
if ((scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current) && ((_b = scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current) === null || _b === void 0 ? void 0 : _b.scrollHeight) > window.innerHeight) {
|
71
|
+
var _a;
|
72
|
+
if ((scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current) && ((_a = scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current) === null || _a === void 0 ? void 0 : _a.scrollHeight) > window.innerHeight) {
|
74
73
|
setStopSlide(true);
|
75
74
|
}
|
76
75
|
}, [scrollRef]);
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { __rest } from "tslib";
|
2
2
|
import { css } from '@emotion/css';
|
3
|
-
import React, { memo, useEffect, useMemo, useRef, useState } from 'react';
|
3
|
+
import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
4
4
|
import { useSxpDataSource } from '../../../../core/hooks';
|
5
5
|
import './index.less';
|
6
6
|
import { Autoplay, Pagination } from 'swiper/modules';
|
@@ -94,6 +94,12 @@ const CommodityDetailDiroNew = (_a) => {
|
|
94
94
|
`Unveiled at the Spring-Summer 2023 fashion show, the Dior Toujours bag is distinguished by a casual and practical design. Crafted in black calfskin with Macrocannage topstitching, it showcases a spacious interior compartment with a matching pouch to organize essentials. Its leather strap closure keeps items secure while the D of the CD Lock closure twists to adjust the sides and enhance the bag's silhouette. The leather handles can be adjusted using the small notches in order to be able to carry the large bag by hand or wear it over the shoulder. CD Lock and strap closures D.I.O.R. charms Removable interior pouch Adjustable leather handles Dust bag included
|
95
95
|
Made in Italy` })));
|
96
96
|
};
|
97
|
+
const getStyle = useCallback((style) => {
|
98
|
+
if (style === null || style === void 0 ? void 0 : style.lineClamp) {
|
99
|
+
return Object.assign(Object.assign({}, style), { overflow: 'hidden', WebkitLineClamp: style === null || style === void 0 ? void 0 : style.lineClamp, textOverflow: 'ellipsis', display: '-webkit-box', webkitBoxOrient: 'vertical' });
|
100
|
+
}
|
101
|
+
return style;
|
102
|
+
}, []);
|
97
103
|
return (React.createElement("div", { className: 'pb-commondityDiroNew' },
|
98
104
|
React.createElement("div", Object.assign({ ref: scrollRef, className: css(Object.assign({}, style)) }, props),
|
99
105
|
product && ((_g = product === null || product === void 0 ? void 0 : product.homePage) === null || _g === void 0 ? void 0 : _g.length) > 0 && (React.createElement(Swiper, { height: width, modules: [Pagination, Autoplay], pagination: {
|
@@ -116,7 +122,7 @@ Made in Italy` })));
|
|
116
122
|
width: '100%',
|
117
123
|
objectFit: 'cover',
|
118
124
|
display: 'block',
|
119
|
-
|
125
|
+
objectPosition: `50% ${(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) ? -(swiper === null || swiper === void 0 ? void 0 : swiper.translateY) + 50 : 50}%`
|
120
126
|
}, src: src }))));
|
121
127
|
}))),
|
122
128
|
!((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css({
|
@@ -136,11 +142,11 @@ Made in Italy` })));
|
|
136
142
|
React.createElement("div", { className: 'pb-commondityDiroNew-content' },
|
137
143
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top' },
|
138
144
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left' },
|
139
|
-
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title }, (_l = product === null || product === void 0 ? void 0 : product.title) !== null && _l !== void 0 ? _l : 'Large Dior Toujours
|
140
|
-
React.createElement("div", { className: 'pb-commondityDiroNew-content-collection', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === ''), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection }, (product === null || product === void 0 ? void 0 : product.collection) || 'Black Macrocannage
|
145
|
+
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-left-title', style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.title) }, (_l = product === null || product === void 0 ? void 0 : product.title) !== null && _l !== void 0 ? _l : 'Large Dior Toujours BagLarge'),
|
146
|
+
React.createElement("div", { className: 'pb-commondityDiroNew-content-collection', hidden: !!product && (!(product === null || product === void 0 ? void 0 : product.collection) || (product === null || product === void 0 ? void 0 : product.collection) === ''), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.collection) }, (product === null || product === void 0 ? void 0 : product.collection) || 'Black Macrocannage CalfskinLarge')),
|
141
147
|
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right' },
|
142
|
-
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price }, priceText),
|
143
|
-
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo }, (_m = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _m !== void 0 ? _m : '税费'))),
|
148
|
+
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.price), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.price) }, priceText),
|
149
|
+
React.createElement("div", { className: 'pb-commondityDiroNew-content-top-right-price', hidden: !!product && !(product === null || product === void 0 ? void 0 : product.taxInfo), style: getStyle(commodityStyles === null || commodityStyles === void 0 ? void 0 : commodityStyles.taxInfo) }, (_m = product === null || product === void 0 ? void 0 : product.taxInfo) !== null && _m !== void 0 ? _m : '税费'))),
|
144
150
|
(!product || (product === null || product === void 0 ? void 0 : product.link)) && (React.createElement("button", { onClick: handleLink, className: 'pb-commondityDiroNew-btn', style: buttonStyle }, (_o = cta === null || cta === void 0 ? void 0 : cta.enTitle) !== null && _o !== void 0 ? _o : 'Shop now')),
|
145
151
|
productInfoText({ isPost }))),
|
146
152
|
React.createElement(Modal, { visible: showModal, onClose: () => setShowModal(false) }, productInfoText({ isPost: false }))));
|
@@ -6,11 +6,11 @@ import styles from './index.module.less';
|
|
6
6
|
import { useSxpDataSource } from '../../../../core/hooks';
|
7
7
|
import FormatImage from '../../../../core/components/SxpPageRender/FormatImage';
|
8
8
|
const Commodity = (_a) => {
|
9
|
-
var _b, _c, _d, _e, _f, _g, _h, _j
|
9
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
10
10
|
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0 } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY"]);
|
11
11
|
const { sxpParameter } = useSxpDataSource();
|
12
12
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
13
|
-
const src = (
|
13
|
+
const src = (_f = (_e = (_c = product === null || product === void 0 ? void 0 : product.cover) !== null && _c !== void 0 ? _c : (_d = product === null || product === void 0 ? void 0 : product.homePage) === null || _d === void 0 ? void 0 : _d[0]) !== null && _e !== void 0 ? _e : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _f !== void 0 ? _f : bottom_image;
|
14
14
|
return (React.createElement(EventProvider, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
15
15
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
16
16
|
React.createElement(FormatImage, { className: css({
|
@@ -18,7 +18,7 @@ const Commodity = (_a) => {
|
|
18
18
|
objectFit: 'cover',
|
19
19
|
height: '100%',
|
20
20
|
display: 'block',
|
21
|
-
|
21
|
+
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
22
22
|
}), src: src })),
|
23
23
|
React.createElement("div", { className: css({
|
24
24
|
color: '#fff',
|
@@ -28,7 +28,7 @@ const Commodity = (_a) => {
|
|
28
28
|
width: '100%',
|
29
29
|
overflow: 'hidden'
|
30
30
|
}) },
|
31
|
-
React.createElement("div", { className: styles['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
32
|
-
React.createElement("div", { className: css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
31
|
+
React.createElement("div", { className: styles['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_g = product === null || product === void 0 ? void 0 : product.title) !== null && _g !== void 0 ? _g : 'Product Name'),
|
32
|
+
React.createElement("div", { className: css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_j = (_h = product === null || product === void 0 ? void 0 : product.bindCta) === null || _h === void 0 ? void 0 : _h.enTitle) !== null && _j !== void 0 ? _j : 'Shop Now'))));
|
33
33
|
};
|
34
34
|
export default memo(Commodity);
|
@@ -6,11 +6,11 @@ import styles from './index.module.less';
|
|
6
6
|
import { useSxpDataSource } from '../../../../core/hooks';
|
7
7
|
import FormatImage from '../../../../core/components/SxpPageRender/FormatImage';
|
8
8
|
const CommodityDiro = (_a) => {
|
9
|
-
var _b, _c, _d, _e, _f, _g, _h, _j
|
9
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
10
10
|
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0 } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY"]);
|
11
11
|
const { sxpParameter } = useSxpDataSource();
|
12
12
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
13
|
-
const src = (
|
13
|
+
const src = (_f = (_e = (_c = product === null || product === void 0 ? void 0 : product.cover) !== null && _c !== void 0 ? _c : (_d = product === null || product === void 0 ? void 0 : product.homePage) === null || _d === void 0 ? void 0 : _d[0]) !== null && _e !== void 0 ? _e : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _f !== void 0 ? _f : bottom_image;
|
14
14
|
return (React.createElement(EventProvider, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
15
15
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
16
16
|
React.createElement(FormatImage, { className: css({
|
@@ -18,7 +18,7 @@ const CommodityDiro = (_a) => {
|
|
18
18
|
objectFit: 'cover',
|
19
19
|
height: '100%',
|
20
20
|
display: 'block',
|
21
|
-
|
21
|
+
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
22
22
|
}), src: src })),
|
23
23
|
React.createElement("div", { className: css({
|
24
24
|
color: '#fff',
|
@@ -28,7 +28,7 @@ const CommodityDiro = (_a) => {
|
|
28
28
|
width: '100%',
|
29
29
|
overflow: 'hidden'
|
30
30
|
}) },
|
31
|
-
React.createElement("div", { className: styles['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
32
|
-
React.createElement("div", { className: css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
31
|
+
React.createElement("div", { className: styles['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_g = product === null || product === void 0 ? void 0 : product.title) !== null && _g !== void 0 ? _g : 'Product Name'),
|
32
|
+
React.createElement("div", { className: css(Object.assign({ padding: '2px 7px', textOverflow: 'ellipsis', overflow: 'hidden', borderRadius: '25px', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_j = (_h = product === null || product === void 0 ? void 0 : product.bindCta) === null || _h === void 0 ? void 0 : _h.enTitle) !== null && _j !== void 0 ? _j : 'Shop Now'))));
|
33
33
|
};
|
34
34
|
export default memo(CommodityDiro);
|
@@ -6,11 +6,11 @@ import styles from './index.module.less';
|
|
6
6
|
import { useSxpDataSource } from '../../../../core/hooks';
|
7
7
|
import FormatImage from '../../../../core/components/SxpPageRender/FormatImage';
|
8
8
|
const CommodityDiroNew = (_a) => {
|
9
|
-
var _b, _c, _d, _e, _f, _g, _h, _j
|
9
|
+
var _b, _c, _d, _e, _f, _g, _h, _j;
|
10
10
|
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink, translateY = 0 } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink", "translateY"]);
|
11
11
|
const { sxpParameter } = useSxpDataSource();
|
12
12
|
const product = (_b = recData === null || recData === void 0 ? void 0 : recData.video) === null || _b === void 0 ? void 0 : _b.bindProduct;
|
13
|
-
const src = (
|
13
|
+
const src = (_f = (_e = (_c = product === null || product === void 0 ? void 0 : product.cover) !== null && _c !== void 0 ? _c : (_d = product === null || product === void 0 ? void 0 : product.homePage) === null || _d === void 0 ? void 0 : _d[0]) !== null && _e !== void 0 ? _e : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _f !== void 0 ? _f : bottom_image;
|
14
14
|
return (React.createElement(EventProvider, Object.assign({ isExternalLink: isExternalLink, rec: recData, className: css(Object.assign({}, style)), style: { display: 'flex' } }, props),
|
15
15
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
16
16
|
React.createElement(FormatImage, { className: css({
|
@@ -18,7 +18,7 @@ const CommodityDiroNew = (_a) => {
|
|
18
18
|
objectFit: 'cover',
|
19
19
|
height: '100%',
|
20
20
|
display: 'block',
|
21
|
-
|
21
|
+
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
22
22
|
}), src: src })),
|
23
23
|
React.createElement("div", { className: css({
|
24
24
|
color: '#fff',
|
@@ -28,7 +28,7 @@ const CommodityDiroNew = (_a) => {
|
|
28
28
|
width: '100%',
|
29
29
|
overflow: 'hidden'
|
30
30
|
}) },
|
31
|
-
React.createElement("div", { className: styles['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
32
|
-
React.createElement("div", { className: css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
31
|
+
React.createElement("div", { className: styles['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_g = product === null || product === void 0 ? void 0 : product.title) !== null && _g !== void 0 ? _g : 'Product Name'),
|
32
|
+
React.createElement("div", { className: css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_j = (_h = product === null || product === void 0 ? void 0 : product.bindCta) === null || _h === void 0 ? void 0 : _h.enTitle) !== null && _j !== void 0 ? _j : 'Shop now'))));
|
33
33
|
};
|
34
34
|
export default memo(CommodityDiroNew);
|
@@ -37,7 +37,7 @@ const MultiCommodity = (_a) => {
|
|
37
37
|
return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item.itemId, className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
38
38
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
39
39
|
React.createElement(Img, { 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, style: {
|
40
|
-
|
40
|
+
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
41
41
|
} })),
|
42
42
|
React.createElement("div", { className: css({
|
43
43
|
color: '#fff',
|
@@ -36,7 +36,7 @@ const MultiCommodityDiro = (_a) => {
|
|
36
36
|
return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item === null || item === void 0 ? void 0 : item.itemId, className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
37
37
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
38
38
|
React.createElement(Img, { 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, style: {
|
39
|
-
|
39
|
+
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
40
40
|
} })),
|
41
41
|
React.createElement("div", { className: css({
|
42
42
|
color: '#000',
|
@@ -36,7 +36,7 @@ const MultiCommodityDiroNew = (_a) => {
|
|
36
36
|
return (React.createElement(SwiperSlide, Object.assign({ hidden: recData && !(item === null || item === void 0 ? void 0 : item.bindCta), key: item === null || item === void 0 ? void 0 : item.itemId, className: css(Object.assign(Object.assign({}, style), { display: 'flex', flexShrink: 0, marginLeft: 0, marginRight: '8px' })) }, props, { onClick: () => handleClick(item) }),
|
37
37
|
React.createElement("div", { className: css(Object.assign({ overflow: 'hidden', flexShrink: 0, backgroundColor: '#f2f2f2' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.img)) },
|
38
38
|
React.createElement(Img, { 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, style: {
|
39
|
-
|
39
|
+
objectPosition: `50% ${translateY ? -translateY + 50 : 50}%`
|
40
40
|
} })),
|
41
41
|
React.createElement("div", { className: css({
|
42
42
|
color: '#fff',
|
@@ -2,17 +2,22 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const tslib_1 = require("tslib");
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
5
|
+
const hooks_1 = require("../../../core/hooks");
|
5
6
|
const FormatImage = (0, react_1.forwardRef)((props, ref) => {
|
6
7
|
const { src, onLoad, style, className, loading } = props;
|
7
8
|
const [imgSrc, setImgSrc] = (0, react_1.useState)();
|
9
|
+
const { swiperRef } = (0, hooks_1.useSxpDataSource)();
|
8
10
|
(0, react_1.useImperativeHandle)(ref, () => ({
|
9
11
|
setSrc: (v) => {
|
10
12
|
setImgSrc(v);
|
11
13
|
}
|
12
14
|
}));
|
13
15
|
(0, react_1.useEffect)(() => {
|
14
|
-
|
15
|
-
|
16
|
+
var _a, _b;
|
17
|
+
const index = (_b = (_a = swiperRef === null || swiperRef === void 0 ? void 0 : swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper) === null || _b === void 0 ? void 0 : _b.activeIndex;
|
18
|
+
if (index === 0 || index > 0)
|
19
|
+
setImgSrc(src);
|
20
|
+
}, [src, swiperRef]);
|
16
21
|
const imgRef = (0, react_1.useRef)(null);
|
17
22
|
return (react_1.default.createElement(react_1.default.Fragment, null, (imgSrc === null || imgSrc === void 0 ? void 0 : imgSrc.includes('.avif')) ? (react_1.default.createElement("picture", null,
|
18
23
|
react_1.default.createElement("source", { type: 'image/avif', srcSet: imgSrc }),
|
@@ -48,14 +48,14 @@ const Popup = () => {
|
|
48
48
|
const renderPopupDetail = (0, react_1.useMemo)(() => {
|
49
49
|
var _a, _b, _c;
|
50
50
|
return (_c = (_b = (_a = schema === null || schema === void 0 ? void 0 : schema.sxpPageConf) === null || _a === void 0 ? void 0 : _a.globalConfig) === null || _b === void 0 ? void 0 : _b.popupList) === null || _c === void 0 ? void 0 : _c.map((value, index) => {
|
51
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
51
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
52
52
|
if ((value === null || value === void 0 ? void 0 : value.id) === (popup === null || popup === void 0 ? void 0 : popup.id)) {
|
53
53
|
const t = resolver[(_a = value === null || value === void 0 ? void 0 : value.item) === null || _a === void 0 ? void 0 : _a.type];
|
54
54
|
const Component = (0, withBindDataSource_1.default)(t);
|
55
55
|
const isExternalLink = ((_d = (_c = (_b = value === null || value === void 0 ? void 0 : value.item) === null || _b === void 0 ? void 0 : _b.event) === null || _c === void 0 ? void 0 : _c.onClick) === null || _d === void 0 ? void 0 : _d.linkType) === 'externalLink';
|
56
56
|
const isPopup = ((_g = (_f = (_e = value === null || value === void 0 ? void 0 : value.item) === null || _e === void 0 ? void 0 : _e.event) === null || _f === void 0 ? void 0 : _f.onClick) === null || _g === void 0 ? void 0 : _g.linkType) === 'popup';
|
57
57
|
const defaulSetting = (_h = t === null || t === void 0 ? void 0 : t.extend) === null || _h === void 0 ? void 0 : _h.defaulSetting;
|
58
|
-
return (react_1.default.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_j = value === null || value === void 0 ? void 0 : value.item) === null || _j === void 0 ? void 0 : _j.style), { width: '
|
58
|
+
return (react_1.default.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_j = value === null || value === void 0 ? void 0 : value.item) === null || _j === void 0 ? void 0 : _j.style), { width: (_k = window.innerWidth) !== null && _k !== void 0 ? _k : '100vw', height: '80vh', overflow: 'auto' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_l = value === null || value === void 0 ? void 0 : value.item) === null || _l === void 0 ? void 0 : _l.textStyle), bindDatas: (_o = (_m = value === null || value === void 0 ? void 0 : value.item) === null || _m === void 0 ? void 0 : _m.bindDatas) !== null && _o !== void 0 ? _o : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_p = value === null || value === void 0 ? void 0 : value.item) === null || _p === void 0 ? void 0 : _p.props, { event: ((_q = value === null || value === void 0 ? void 0 : value.item) === null || _q === void 0 ? void 0 : _q.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, isExternalLink: isExternalLink, isPopup: isPopup, onClose: handleClose })));
|
59
59
|
}
|
60
60
|
else {
|
61
61
|
return react_1.default.createElement(react_1.default.Fragment, null);
|