pb-sxp-ui 1.0.69 → 1.0.71
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 +301 -174
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -2
- package/dist/index.js +301 -174
- 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 +304 -177
- 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/DiyPortalPreview/VideoWidget.js +3 -2
- package/es/core/components/SxpPageCore/index.js +2 -2
- package/es/core/components/SxpPageRender/FingerSwipeTip/index.d.ts +2 -1
- package/es/core/components/SxpPageRender/FingerSwipeTip/index.js +2 -2
- package/es/core/components/SxpPageRender/FormatImage.js +1 -2
- package/es/core/components/SxpPageRender/Nudge/index.js +2 -2
- package/es/core/components/SxpPageRender/VideoWidget/index.js +1 -1
- package/es/core/components/SxpPageRender/WaterFall/List.js +5 -9
- package/es/core/components/SxpPageRender/index.d.ts +5 -0
- package/es/core/components/SxpPageRender/index.js +21 -24
- package/es/core/components/SxpPageRender/typing.d.ts +1 -0
- package/es/core/context/SxpDataSourceProvider.d.ts +0 -1
- package/es/core/context/SxpDataSourceProvider.js +12 -4
- package/es/materials/sxp/HashTag/settingRender.d.ts +2 -7
- package/es/materials/sxp/HashTag/settingRender.js +0 -5
- package/es/materials/sxp/defaultSetting.d.ts +1 -4
- package/es/materials/sxp/defaultSetting.js +4 -5
- package/es/materials/sxp/popup/AppointForm/index.d.ts +2 -1
- package/es/materials/sxp/popup/AppointForm/index.js +3 -8
- package/es/materials/sxp/popup/AppointForm/settingRender.d.ts +29 -8
- package/es/materials/sxp/popup/AppointForm/settingRender.js +33 -2
- package/es/materials/sxp/popup/CommodityDetail/index.d.ts +1 -0
- package/es/materials/sxp/popup/CommodityDetail/index.js +7 -1
- package/es/materials/sxp/popup/CommodityDetail/material.js +5 -2
- package/es/materials/sxp/popup/CommodityDetail/settingRender.d.ts +28 -0
- package/es/materials/sxp/popup/CommodityDetail/settingRender.js +30 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +1 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +7 -1
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +16 -0
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +13 -0
- package/es/materials/sxp/popup/Prompt/index.d.ts +2 -1
- package/es/materials/sxp/popup/Prompt/index.js +2 -2
- package/es/materials/sxp/popup/Prompt/settingRender.d.ts +46 -11
- package/es/materials/sxp/popup/Prompt/settingRender.js +57 -14
- package/es/materials/sxp/template/Commodity/index.d.ts +1 -0
- package/es/materials/sxp/template/Commodity/index.js +12 -6
- package/es/materials/sxp/template/CommodityDiro/index.d.ts +1 -0
- package/es/materials/sxp/template/CommodityDiro/index.js +12 -6
- package/es/materials/sxp/template/CommodityDiroNew/index.d.ts +1 -0
- package/es/materials/sxp/template/CommodityDiroNew/index.js +12 -6
- package/es/materials/sxp/template/MultiCommodity/index.d.ts +1 -0
- package/es/materials/sxp/template/MultiCommodity/index.js +7 -5
- package/es/materials/sxp/template/MultiCommodityDiro/index.d.ts +1 -0
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +7 -5
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +1 -0
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +7 -5
- package/es/materials/sxp/template/components/Img.d.ts +2 -1
- package/es/materials/sxp/template/components/Img.js +2 -2
- package/es/materials/sxp/template/components/settingRender.d.ts +50 -0
- package/es/materials/sxp/template/components/settingRender.js +8 -0
- package/lib/core/components/DiyPortalPreview/VideoWidget.js +3 -2
- package/lib/core/components/SxpPageCore/index.js +2 -2
- package/lib/core/components/SxpPageRender/FingerSwipeTip/index.d.ts +2 -1
- package/lib/core/components/SxpPageRender/FingerSwipeTip/index.js +2 -2
- package/lib/core/components/SxpPageRender/FormatImage.js +0 -1
- package/lib/core/components/SxpPageRender/Nudge/index.js +2 -2
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +1 -1
- package/lib/core/components/SxpPageRender/WaterFall/List.js +5 -9
- package/lib/core/components/SxpPageRender/index.d.ts +5 -0
- package/lib/core/components/SxpPageRender/index.js +21 -24
- package/lib/core/components/SxpPageRender/typing.d.ts +1 -0
- package/lib/core/context/SxpDataSourceProvider.d.ts +0 -1
- package/lib/core/context/SxpDataSourceProvider.js +12 -4
- package/lib/materials/sxp/HashTag/settingRender.d.ts +2 -7
- package/lib/materials/sxp/HashTag/settingRender.js +0 -5
- package/lib/materials/sxp/defaultSetting.d.ts +1 -4
- package/lib/materials/sxp/defaultSetting.js +4 -5
- package/lib/materials/sxp/popup/AppointForm/index.d.ts +2 -1
- package/lib/materials/sxp/popup/AppointForm/index.js +3 -8
- package/lib/materials/sxp/popup/AppointForm/settingRender.d.ts +29 -8
- package/lib/materials/sxp/popup/AppointForm/settingRender.js +34 -2
- package/lib/materials/sxp/popup/CommodityDetail/index.d.ts +1 -0
- package/lib/materials/sxp/popup/CommodityDetail/index.js +7 -1
- package/lib/materials/sxp/popup/CommodityDetail/material.js +5 -2
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.d.ts +28 -0
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +30 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.d.ts +1 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +7 -1
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +16 -0
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +13 -0
- package/lib/materials/sxp/popup/Prompt/index.d.ts +2 -1
- package/lib/materials/sxp/popup/Prompt/index.js +2 -2
- package/lib/materials/sxp/popup/Prompt/settingRender.d.ts +46 -11
- package/lib/materials/sxp/popup/Prompt/settingRender.js +58 -14
- package/lib/materials/sxp/template/Commodity/index.d.ts +1 -0
- package/lib/materials/sxp/template/Commodity/index.js +12 -6
- package/lib/materials/sxp/template/CommodityDiro/index.d.ts +1 -0
- package/lib/materials/sxp/template/CommodityDiro/index.js +12 -6
- package/lib/materials/sxp/template/CommodityDiroNew/index.d.ts +1 -0
- package/lib/materials/sxp/template/CommodityDiroNew/index.js +12 -6
- package/lib/materials/sxp/template/MultiCommodity/index.d.ts +1 -0
- package/lib/materials/sxp/template/MultiCommodity/index.js +7 -5
- package/lib/materials/sxp/template/MultiCommodityDiro/index.d.ts +1 -0
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +7 -5
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.d.ts +1 -0
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +7 -5
- package/lib/materials/sxp/template/components/Img.d.ts +2 -1
- package/lib/materials/sxp/template/components/Img.js +2 -2
- package/lib/materials/sxp/template/components/settingRender.d.ts +50 -0
- package/lib/materials/sxp/template/components/settingRender.js +8 -0
- package/package.json +2 -3
@@ -23,6 +23,19 @@ export default [
|
|
23
23
|
type: 'Number',
|
24
24
|
name: ['props', 'swiper', 'delay'],
|
25
25
|
addonAfter: 's'
|
26
|
+
},
|
27
|
+
{
|
28
|
+
type: 'Group',
|
29
|
+
child: [
|
30
|
+
{
|
31
|
+
label: '居中垂直偏移',
|
32
|
+
type: 'Number',
|
33
|
+
name: ['props', 'swiper', 'translateY'],
|
34
|
+
min: -100,
|
35
|
+
addonAfter: '%',
|
36
|
+
initialValue: 0
|
37
|
+
}
|
38
|
+
]
|
26
39
|
}
|
27
40
|
]
|
28
41
|
},
|
@@ -57,6 +70,23 @@ export default [
|
|
57
70
|
name: ['props', 'commodityStyles', 'field'],
|
58
71
|
initialValue: 'title'
|
59
72
|
},
|
73
|
+
{
|
74
|
+
type: 'Group',
|
75
|
+
child: [
|
76
|
+
{
|
77
|
+
label: '上边距',
|
78
|
+
type: 'Number',
|
79
|
+
addonAfter: 'px',
|
80
|
+
name: ['marginTop']
|
81
|
+
},
|
82
|
+
{
|
83
|
+
label: '下边距',
|
84
|
+
type: 'Number',
|
85
|
+
addonAfter: 'px',
|
86
|
+
name: ['marginBottom']
|
87
|
+
}
|
88
|
+
]
|
89
|
+
},
|
60
90
|
{
|
61
91
|
type: 'Group',
|
62
92
|
label: '标题字体',
|
@@ -111,7 +111,13 @@ Made in Italy` })));
|
|
111
111
|
width,
|
112
112
|
height: width
|
113
113
|
} },
|
114
|
-
React.createElement(FormatImage, { style: {
|
114
|
+
React.createElement(FormatImage, { style: {
|
115
|
+
height: '100%',
|
116
|
+
width: '100%',
|
117
|
+
objectFit: 'cover',
|
118
|
+
display: 'block',
|
119
|
+
transform: `translateY(${swiper === null || swiper === void 0 ? void 0 : swiper.translateY})%`
|
120
|
+
}, src: src }))));
|
115
121
|
}))),
|
116
122
|
!((_j = product === null || product === void 0 ? void 0 : product.homePage) === null || _j === void 0 ? void 0 : _j.length) && (React.createElement("div", { className: css({
|
117
123
|
position: 'relative',
|
@@ -9,12 +9,28 @@ declare const _default: ({
|
|
9
9
|
}[];
|
10
10
|
name: string[];
|
11
11
|
addonAfter?: undefined;
|
12
|
+
child?: undefined;
|
12
13
|
} | {
|
13
14
|
type: string;
|
14
15
|
name: string[];
|
15
16
|
addonAfter: string;
|
16
17
|
label?: undefined;
|
17
18
|
options?: undefined;
|
19
|
+
child?: undefined;
|
20
|
+
} | {
|
21
|
+
type: string;
|
22
|
+
child: {
|
23
|
+
label: string;
|
24
|
+
type: string;
|
25
|
+
name: string[];
|
26
|
+
min: number;
|
27
|
+
addonAfter: string;
|
28
|
+
initialValue: number;
|
29
|
+
}[];
|
30
|
+
label?: undefined;
|
31
|
+
options?: undefined;
|
32
|
+
name?: undefined;
|
33
|
+
addonAfter?: undefined;
|
18
34
|
})[];
|
19
35
|
} | {
|
20
36
|
title: string;
|
@@ -23,6 +23,19 @@ export default [
|
|
23
23
|
type: 'Number',
|
24
24
|
name: ['props', 'swiper', 'delay'],
|
25
25
|
addonAfter: 's'
|
26
|
+
},
|
27
|
+
{
|
28
|
+
type: 'Group',
|
29
|
+
child: [
|
30
|
+
{
|
31
|
+
label: '居中垂直偏移',
|
32
|
+
type: 'Number',
|
33
|
+
name: ['props', 'swiper', 'translateY'],
|
34
|
+
min: -100,
|
35
|
+
addonAfter: '%',
|
36
|
+
initialValue: 0
|
37
|
+
}
|
38
|
+
]
|
26
39
|
}
|
27
40
|
]
|
28
41
|
},
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React, { CSSProperties } from 'react';
|
2
2
|
import './index.less';
|
3
3
|
export interface IPromptProps {
|
4
4
|
content?: string;
|
@@ -9,6 +9,7 @@ export interface IPromptProps {
|
|
9
9
|
isPopup?: boolean;
|
10
10
|
onClose?: () => void;
|
11
11
|
onClick?: () => void;
|
12
|
+
submitButtonStyle?: CSSProperties;
|
12
13
|
}
|
13
14
|
declare const _default: React.NamedExoticComponent<IPromptProps>;
|
14
15
|
export default _default;
|
@@ -7,7 +7,7 @@ import './index.less';
|
|
7
7
|
import { useSxpDataSource } from '../../../../core/hooks';
|
8
8
|
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
9
9
|
const Prompt = (_a) => {
|
10
|
-
var { content, btnText, style, icon, isPopup, isExternalLink, onClose, onClick } = _a, props = __rest(_a, ["content", "btnText", "style", "icon", "isPopup", "isExternalLink", "onClose", "onClick"]);
|
10
|
+
var { content, btnText, style, icon, isPopup, isExternalLink, onClose, onClick, submitButtonStyle } = _a, props = __rest(_a, ["content", "btnText", "style", "icon", "isPopup", "isExternalLink", "onClose", "onClick", "submitButtonStyle"]);
|
11
11
|
const { popupDetailData } = useSxpDataSource();
|
12
12
|
const { jumpToWeb } = useEventReport();
|
13
13
|
const iconSrc = typeof icon === 'string' ? icon : getMediaValueByMode(icon);
|
@@ -29,6 +29,6 @@ const Prompt = (_a) => {
|
|
29
29
|
React.createElement("div", { className: 'pb-prompt-icon' },
|
30
30
|
React.createElement("img", { width: '100%', src: iconSrc !== null && iconSrc !== void 0 ? iconSrc : success })),
|
31
31
|
React.createElement("div", { className: 'pb-prompt-content' }, content),
|
32
|
-
React.createElement("button", { className: 'pb-prompt-btn', onClick: handleOk }, btnText)));
|
32
|
+
React.createElement("button", { className: 'pb-prompt-btn', style: submitButtonStyle, onClick: handleOk }, btnText)));
|
33
33
|
};
|
34
34
|
export default memo(Prompt);
|
@@ -1,12 +1,47 @@
|
|
1
|
-
declare const _default:
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
1
|
+
declare const _default: {
|
2
|
+
title: string;
|
3
|
+
child: ({
|
4
|
+
type: string;
|
5
|
+
label: string;
|
6
|
+
name: string[];
|
7
|
+
mediaType: string;
|
8
|
+
child?: undefined;
|
9
|
+
} | {
|
10
|
+
type: string;
|
11
|
+
label: string;
|
12
|
+
name: string[];
|
13
|
+
mediaType?: undefined;
|
14
|
+
child?: undefined;
|
15
|
+
} | {
|
16
|
+
type: string;
|
17
|
+
label: string;
|
18
|
+
child: ({
|
19
|
+
type: string;
|
20
|
+
name: string[];
|
21
|
+
initialValue: string;
|
22
|
+
options?: undefined;
|
23
|
+
addonAfter?: undefined;
|
24
|
+
} | {
|
25
|
+
type: string;
|
26
|
+
name: string[];
|
27
|
+
options: any[];
|
28
|
+
initialValue: any;
|
29
|
+
addonAfter?: undefined;
|
30
|
+
} | {
|
31
|
+
type: string;
|
32
|
+
name: string[];
|
33
|
+
addonAfter: string;
|
34
|
+
initialValue: number;
|
35
|
+
options?: undefined;
|
36
|
+
})[];
|
37
|
+
name?: undefined;
|
38
|
+
mediaType?: undefined;
|
39
|
+
} | {
|
40
|
+
type: string;
|
41
|
+
name: string[];
|
42
|
+
label?: undefined;
|
43
|
+
mediaType?: undefined;
|
44
|
+
child?: undefined;
|
45
|
+
})[];
|
46
|
+
}[];
|
12
47
|
export default _default;
|
@@ -1,18 +1,61 @@
|
|
1
|
+
var _a, _b;
|
2
|
+
import defaultSetting from '../../defaultSetting';
|
1
3
|
export default [
|
2
4
|
{
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
5
|
+
title: '',
|
6
|
+
child: [
|
7
|
+
{
|
8
|
+
type: 'Media',
|
9
|
+
label: '图标',
|
10
|
+
name: ['props', 'icon'],
|
11
|
+
mediaType: 'Image'
|
12
|
+
},
|
13
|
+
{
|
14
|
+
type: 'TextArea',
|
15
|
+
label: '内容',
|
16
|
+
name: ['props', 'content']
|
17
|
+
},
|
18
|
+
{
|
19
|
+
type: 'Text',
|
20
|
+
label: '按钮文案',
|
21
|
+
name: ['props', 'btnText']
|
22
|
+
},
|
23
|
+
{
|
24
|
+
type: 'Group',
|
25
|
+
label: '提交按钮字体',
|
26
|
+
child: [
|
27
|
+
{
|
28
|
+
type: 'Color',
|
29
|
+
name: ['props', 'submitButtonStyle', 'color'],
|
30
|
+
initialValue: '#fff'
|
31
|
+
},
|
32
|
+
{
|
33
|
+
type: 'Select',
|
34
|
+
name: ['props', 'submitButtonStyle', 'fontFamily'],
|
35
|
+
options: defaultSetting === null || defaultSetting === void 0 ? void 0 : defaultSetting.fontOptions,
|
36
|
+
initialValue: (_b = (_a = defaultSetting === null || defaultSetting === void 0 ? void 0 : defaultSetting.fontOptions) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.value
|
37
|
+
},
|
38
|
+
{
|
39
|
+
type: 'Number',
|
40
|
+
name: ['props', 'submitButtonStyle', 'fontSize'],
|
41
|
+
addonAfter: 'px',
|
42
|
+
initialValue: 12
|
43
|
+
}
|
44
|
+
]
|
45
|
+
},
|
46
|
+
{
|
47
|
+
type: 'TextStyle',
|
48
|
+
name: ['props', 'submitButtonStyle']
|
49
|
+
},
|
50
|
+
{
|
51
|
+
type: 'TextAlign',
|
52
|
+
name: ['props', 'submitButtonStyle']
|
53
|
+
},
|
54
|
+
{
|
55
|
+
label: '提交按钮颜色',
|
56
|
+
type: 'Color',
|
57
|
+
name: ['props', 'submitButtonStyle', 'backgroundColor']
|
58
|
+
}
|
59
|
+
]
|
17
60
|
}
|
18
61
|
];
|
@@ -6,14 +6,20 @@ 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;
|
10
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
9
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
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 = (_g = (_f = (_d = (_c = recData === null || recData === void 0 ? void 0 : recData.product) === null || _c === void 0 ? void 0 : _c.cover) !== null && _d !== void 0 ? _d : (_e = product === null || product === void 0 ? void 0 : product.homePage) === null || _e === void 0 ? void 0 : _e[0]) !== null && _f !== void 0 ? _f : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _g !== void 0 ? _g : 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
|
-
React.createElement(FormatImage, { className: css({
|
16
|
+
React.createElement(FormatImage, { className: css({
|
17
|
+
width: '100%',
|
18
|
+
objectFit: 'cover',
|
19
|
+
height: '100%',
|
20
|
+
display: 'block',
|
21
|
+
transform: `translateY(${translateY}%)`
|
22
|
+
}), src: src })),
|
17
23
|
React.createElement("div", { className: css({
|
18
24
|
color: '#fff',
|
19
25
|
display: 'flex',
|
@@ -22,7 +28,7 @@ const Commodity = (_a) => {
|
|
22
28
|
width: '100%',
|
23
29
|
overflow: 'hidden'
|
24
30
|
}) },
|
25
|
-
React.createElement("div", { className: styles['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
26
|
-
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 }, (_h = product === null || product === void 0 ? void 0 : product.title) !== null && _h !== void 0 ? _h : '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)) }, (_k = (_j = product === null || product === void 0 ? void 0 : product.bindCta) === null || _j === void 0 ? void 0 : _j.enTitle) !== null && _k !== void 0 ? _k : 'Shop Now'))));
|
27
33
|
};
|
28
34
|
export default memo(Commodity);
|
@@ -6,14 +6,20 @@ 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;
|
10
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
9
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
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 = (_g = (_f = (_d = (_c = recData === null || recData === void 0 ? void 0 : recData.product) === null || _c === void 0 ? void 0 : _c.cover) !== null && _d !== void 0 ? _d : (_e = product === null || product === void 0 ? void 0 : product.homePage) === null || _e === void 0 ? void 0 : _e[0]) !== null && _f !== void 0 ? _f : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _g !== void 0 ? _g : 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
|
-
React.createElement(FormatImage, { className: css({
|
16
|
+
React.createElement(FormatImage, { className: css({
|
17
|
+
width: '100%',
|
18
|
+
objectFit: 'cover',
|
19
|
+
height: '100%',
|
20
|
+
display: 'block',
|
21
|
+
transform: `translateY(${translateY}%)`
|
22
|
+
}), src: src })),
|
17
23
|
React.createElement("div", { className: css({
|
18
24
|
color: '#fff',
|
19
25
|
display: 'flex',
|
@@ -22,7 +28,7 @@ const CommodityDiro = (_a) => {
|
|
22
28
|
width: '100%',
|
23
29
|
overflow: 'hidden'
|
24
30
|
}) },
|
25
|
-
React.createElement("div", { className: styles['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
26
|
-
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 }, (_h = product === null || product === void 0 ? void 0 : product.title) !== null && _h !== void 0 ? _h : '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)) }, (_k = (_j = product === null || product === void 0 ? void 0 : product.bindCta) === null || _j === void 0 ? void 0 : _j.enTitle) !== null && _k !== void 0 ? _k : 'Shop Now'))));
|
27
33
|
};
|
28
34
|
export default memo(CommodityDiro);
|
@@ -10,6 +10,7 @@ export interface ICommodityDiroNewProps {
|
|
10
10
|
ctaTempStyles?: ICtaTempStylesType;
|
11
11
|
isExternalLink?: boolean;
|
12
12
|
index?: number;
|
13
|
+
translateY?: number;
|
13
14
|
}
|
14
15
|
declare const _default: React.NamedExoticComponent<ICommodityDiroNewProps>;
|
15
16
|
export default _default;
|
@@ -6,14 +6,20 @@ 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;
|
10
|
-
var { content, style, bgImg, recData, bottom_image, ctaTempStyles, isExternalLink } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "bottom_image", "ctaTempStyles", "isExternalLink"]);
|
9
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
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 = (_g = (_f = (_d = (_c = recData === null || recData === void 0 ? void 0 : recData.product) === null || _c === void 0 ? void 0 : _c.cover) !== null && _d !== void 0 ? _d : (_e = product === null || product === void 0 ? void 0 : product.homePage) === null || _e === void 0 ? void 0 : _e[0]) !== null && _f !== void 0 ? _f : sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.bottom_image) !== null && _g !== void 0 ? _g : 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
|
-
React.createElement(FormatImage, { className: css({
|
16
|
+
React.createElement(FormatImage, { className: css({
|
17
|
+
width: '100%',
|
18
|
+
objectFit: 'cover',
|
19
|
+
height: '100%',
|
20
|
+
display: 'block',
|
21
|
+
transform: `translateY(${translateY}%)`
|
22
|
+
}), src: src })),
|
17
23
|
React.createElement("div", { className: css({
|
18
24
|
color: '#fff',
|
19
25
|
display: 'flex',
|
@@ -22,7 +28,7 @@ const CommodityDiroNew = (_a) => {
|
|
22
28
|
width: '100%',
|
23
29
|
overflow: 'hidden'
|
24
30
|
}) },
|
25
|
-
React.createElement("div", { className: styles['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
26
|
-
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 }, (_h = product === null || product === void 0 ? void 0 : product.title) !== null && _h !== void 0 ? _h : '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)) }, (_k = (_j = product === null || product === void 0 ? void 0 : product.bindCta) === null || _j === void 0 ? void 0 : _j.enTitle) !== null && _k !== void 0 ? _k : 'Shop now'))));
|
27
33
|
};
|
28
34
|
export default memo(CommodityDiroNew);
|
@@ -10,7 +10,7 @@ import { useEditor, useSxpDataSource } from '../../../../core/hooks';
|
|
10
10
|
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
11
11
|
const MultiCommodity = (_a) => {
|
12
12
|
var _b, _c;
|
13
|
-
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index"]);
|
13
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index, translateY = 0 } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index", "translateY"]);
|
14
14
|
const { sxpParameter } = useSxpDataSource();
|
15
15
|
const { ctaEvent, setPopupDetailData } = useSxpDataSource();
|
16
16
|
const { popup } = useEditor();
|
@@ -33,10 +33,12 @@ const MultiCommodity = (_a) => {
|
|
33
33
|
}
|
34
34
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
35
35
|
return (React.createElement(Scroll, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
36
|
-
var _a, _b, _c, _d, _e, _f;
|
36
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
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
|
-
React.createElement(Img, { src: (
|
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
|
+
transform: `translateY(${translateY}%)`
|
41
|
+
} })),
|
40
42
|
React.createElement("div", { className: css({
|
41
43
|
color: '#fff',
|
42
44
|
display: 'flex',
|
@@ -45,8 +47,8 @@ const MultiCommodity = (_a) => {
|
|
45
47
|
width: '100%',
|
46
48
|
overflow: 'hidden'
|
47
49
|
}) },
|
48
|
-
React.createElement("div", { className: styles['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
49
|
-
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)) }, (
|
50
|
+
React.createElement("div", { className: styles['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name'),
|
51
|
+
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)) }, (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop Now'))));
|
50
52
|
})));
|
51
53
|
};
|
52
54
|
export default memo(MultiCommodity);
|
@@ -11,6 +11,7 @@ export interface IMultiCommodityDiroProps {
|
|
11
11
|
ctaTempStyles?: ICtaTempStylesType;
|
12
12
|
isExternalLink?: boolean;
|
13
13
|
index?: number;
|
14
|
+
translateY?: number;
|
14
15
|
}
|
15
16
|
declare const _default: React.NamedExoticComponent<IMultiCommodityDiroProps>;
|
16
17
|
export default _default;
|
@@ -10,7 +10,7 @@ import { useEditor, useSxpDataSource } from '../../../../core/hooks';
|
|
10
10
|
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
11
11
|
const MultiCommodityDiro = (_a) => {
|
12
12
|
var _b, _c;
|
13
|
-
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index"]);
|
13
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index, translateY = 0 } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index", "translateY"]);
|
14
14
|
const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
|
15
15
|
const { popup } = useEditor();
|
16
16
|
const { jumpToWeb } = useEventReport();
|
@@ -32,10 +32,12 @@ const MultiCommodityDiro = (_a) => {
|
|
32
32
|
}
|
33
33
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
34
34
|
return (React.createElement(Scroll, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
35
|
-
var _a, _b, _c, _d, _e, _f;
|
35
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
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
|
-
React.createElement(Img, { src: (
|
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
|
+
transform: `translateY(${translateY}%)`
|
40
|
+
} })),
|
39
41
|
React.createElement("div", { className: css({
|
40
42
|
color: '#000',
|
41
43
|
display: 'flex',
|
@@ -44,8 +46,8 @@ const MultiCommodityDiro = (_a) => {
|
|
44
46
|
width: '100%',
|
45
47
|
overflow: 'hidden'
|
46
48
|
}) },
|
47
|
-
React.createElement("div", { className: styles['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
48
|
-
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)) }, (
|
49
|
+
React.createElement("div", { className: styles['two-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name'),
|
50
|
+
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)) }, (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop Now'))));
|
49
51
|
})));
|
50
52
|
};
|
51
53
|
export default memo(MultiCommodityDiro);
|
@@ -11,6 +11,7 @@ export interface IMultiCommodityDiroNewProps {
|
|
11
11
|
ctaTempStyles?: ICtaTempStylesType;
|
12
12
|
isExternalLink?: boolean;
|
13
13
|
index?: number;
|
14
|
+
translateY?: number;
|
14
15
|
}
|
15
16
|
declare const _default: React.NamedExoticComponent<IMultiCommodityDiroNewProps>;
|
16
17
|
export default _default;
|
@@ -10,7 +10,7 @@ import { useEditor, useSxpDataSource } from '../../../../core/hooks';
|
|
10
10
|
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
11
11
|
const MultiCommodityDiroNew = (_a) => {
|
12
12
|
var _b, _c;
|
13
|
-
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index"]);
|
13
|
+
var { content, style, bgImg, recData, onClick, bottom_image, ctaTempStyles, isExternalLink, index, translateY = 0 } = _a, props = __rest(_a, ["content", "style", "bgImg", "recData", "onClick", "bottom_image", "ctaTempStyles", "isExternalLink", "index", "translateY"]);
|
14
14
|
const { ctaEvent, setPopupDetailData, sxpParameter } = useSxpDataSource();
|
15
15
|
const { popup } = useEditor();
|
16
16
|
const { jumpToWeb } = useEventReport();
|
@@ -32,10 +32,12 @@ const MultiCommodityDiroNew = (_a) => {
|
|
32
32
|
}
|
33
33
|
}, popup === null || popup === void 0 ? void 0 : popup.duration);
|
34
34
|
return (React.createElement(Scroll, { isPadding: !!recData }, products === null || products === void 0 ? void 0 : products.map((item) => {
|
35
|
-
var _a, _b, _c, _d, _e, _f;
|
35
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
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
|
-
React.createElement(Img, { src: (
|
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
|
+
transform: `translateY(${translateY}%)`
|
40
|
+
} })),
|
39
41
|
React.createElement("div", { className: css({
|
40
42
|
color: '#fff',
|
41
43
|
display: 'flex',
|
@@ -45,8 +47,8 @@ const MultiCommodityDiroNew = (_a) => {
|
|
45
47
|
overflow: 'hidden',
|
46
48
|
lineHeight: '20px'
|
47
49
|
}) },
|
48
|
-
React.createElement("div", { className: styles['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (
|
49
|
-
React.createElement("div", { className: css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (
|
50
|
+
React.createElement("div", { className: styles['tow-line-ellipsis'], style: ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.title }, (_e = item === null || item === void 0 ? void 0 : item.title) !== null && _e !== void 0 ? _e : 'Product Name'),
|
51
|
+
React.createElement("div", { className: css(Object.assign({ textOverflow: 'ellipsis', overflow: 'hidden', whiteSpace: 'nowrap' }, ctaTempStyles === null || ctaTempStyles === void 0 ? void 0 : ctaTempStyles.ctaTitle)) }, (_g = (_f = item === null || item === void 0 ? void 0 : item.bindCta) === null || _f === void 0 ? void 0 : _f.enTitle) !== null && _g !== void 0 ? _g : 'Shop now'))));
|
50
52
|
})));
|
51
53
|
};
|
52
54
|
export default memo(MultiCommodityDiroNew);
|
@@ -1,10 +1,11 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React, { CSSProperties } from 'react';
|
2
2
|
import { ProductInfoType, RecItemType } from '../../../../core/components/SxpPageRender/typing';
|
3
3
|
export interface IImgProps {
|
4
4
|
src: string;
|
5
5
|
rec?: RecItemType;
|
6
6
|
item?: ProductInfoType;
|
7
7
|
index?: number;
|
8
|
+
style?: CSSProperties;
|
8
9
|
}
|
9
10
|
declare const _default: React.NamedExoticComponent<IImgProps>;
|
10
11
|
export default _default;
|
@@ -3,7 +3,7 @@ import React, { memo, useEffect, useRef } from 'react';
|
|
3
3
|
import useOnScreen from '../../../../core/hooks/useOnScreen';
|
4
4
|
import { useSxpDataSource } from '../../../../core/hooks';
|
5
5
|
import FormatImage from '../../../../core/components/SxpPageRender/FormatImage';
|
6
|
-
const Img = ({ src, rec, item, index }) => {
|
6
|
+
const Img = ({ src, rec, item, index, style }) => {
|
7
7
|
const ref = useRef(null);
|
8
8
|
const isOnScreen = useOnScreen(ref);
|
9
9
|
const { ctaEvent } = useSxpDataSource();
|
@@ -16,6 +16,6 @@ const Img = ({ src, rec, item, index }) => {
|
|
16
16
|
}
|
17
17
|
}, [isOnScreen, src, ref, rec, ctaEvent, item, index]);
|
18
18
|
return (React.createElement("div", { ref: ref, hidden: !src, className: css({ width: '100%', height: '100%' }) },
|
19
|
-
React.createElement(FormatImage, { className: css({ width: '100%', objectFit: 'cover', height: '100%', display: 'block' }), src: src })));
|
19
|
+
React.createElement(FormatImage, { className: css(Object.assign({ width: '100%', objectFit: 'cover', height: '100%', display: 'block' }, style)), src: src })));
|
20
20
|
};
|
21
21
|
export default memo(Img);
|