pb-sxp-ui 1.0.56 → 1.0.58
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 +100 -91
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +100 -91
- 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 +100 -91
- 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 +2 -2
- package/es/core/components/SxpPageRender/Popup/index.js +5 -4
- package/es/materials/sxp/popup/AppointForm/index.d.ts +1 -0
- package/es/materials/sxp/popup/AppointForm/index.js +12 -3
- package/es/materials/sxp/popup/CommodityDetail/index.js +1 -1
- package/lib/core/components/DiyPortalPreview/VideoWidget.js +2 -2
- package/lib/core/components/SxpPageRender/Popup/index.js +5 -4
- package/lib/materials/sxp/popup/AppointForm/index.d.ts +1 -0
- package/lib/materials/sxp/popup/AppointForm/index.js +12 -3
- package/lib/materials/sxp/popup/CommodityDetail/index.js +1 -1
- package/package.json +1 -1
@@ -217,7 +217,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
217
217
|
right: 0
|
218
218
|
} },
|
219
219
|
React.createElement("div", { style: { position: 'relative', width, height: '100%' } },
|
220
|
-
React.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, crossOrigin: 'anonymous', muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart, style: {
|
220
|
+
React.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, autoPlay: true, crossOrigin: 'anonymous', muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart, style: {
|
221
221
|
width: '100%',
|
222
222
|
height,
|
223
223
|
objectFit: 'contain'
|
@@ -229,7 +229,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
229
229
|
height,
|
230
230
|
overflow: 'hidden'
|
231
231
|
} },
|
232
|
-
React.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, crossOrigin: 'anonymous', muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart }),
|
232
|
+
React.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', style: { width: '100%' }, ref: videoRef, crossOrigin: 'anonymous', muted: true, autoPlay: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart }),
|
233
233
|
renderPoster,
|
234
234
|
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
|
235
235
|
};
|
@@ -45,18 +45,19 @@ 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;
|
48
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
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
|
-
const
|
53
|
-
|
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
|
+
const defaulSetting = (_e = t === null || t === void 0 ? void 0 : t.extend) === null || _e === void 0 ? void 0 : _e.defaulSetting;
|
54
|
+
return (React.createElement(Component, Object.assign({ key: index, style: Object.assign(Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.style), (_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.style), { width: '100%', height: '80vh', overflow: 'auto' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.textStyle), bindDatas: (_j = (_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.bindDatas) !== null && _j !== void 0 ? _j : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_k = value === null || value === void 0 ? void 0 : value.item) === null || _k === void 0 ? void 0 : _k.props, { event: ((_l = value === null || value === void 0 ? void 0 : value.item) === null || _l === void 0 ? void 0 : _l.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, isExternalLink: isExternalLink, onClose: handleClose })));
|
54
55
|
}
|
55
56
|
else {
|
56
57
|
return React.createElement(React.Fragment, null);
|
57
58
|
}
|
58
59
|
});
|
59
|
-
}, [schema, popup, resolver]);
|
60
|
+
}, [schema, popup, resolver, handleClose]);
|
60
61
|
return (React.createElement(Modal, { popup: visible, onClose: handleClose, padding: 0, modalStyle: { position: 'fixed' } }, renderPopupDetail));
|
61
62
|
};
|
62
63
|
export default Popup;
|
@@ -5,9 +5,11 @@ import { BetaSchemaForm } from '@ant-design/pro-components';
|
|
5
5
|
import { cloneDeep, debounce } from 'lodash';
|
6
6
|
import { useSxpDataSource } from '../../../../core/hooks';
|
7
7
|
import './index.less';
|
8
|
+
import { useEventReport } from '../../../../core/hooks/useEventReport';
|
8
9
|
const AppointForm = (_a) => {
|
9
|
-
var { columns, style, title, textStyle, submitBgColor, submitColor, submitText, layoutType, onClick, onClose } = _a, props = __rest(_a, ["columns", "style", "title", "textStyle", "submitBgColor", "submitColor", "submitText", "layoutType", "onClick", "onClose"]);
|
10
|
-
const { submitForm } = useSxpDataSource();
|
10
|
+
var { columns, style, title, textStyle, submitBgColor, submitColor, submitText, layoutType, isExternalLink, onClick, onClose } = _a, props = __rest(_a, ["columns", "style", "title", "textStyle", "submitBgColor", "submitColor", "submitText", "layoutType", "isExternalLink", "onClick", "onClose"]);
|
11
|
+
const { submitForm, popupDetailData } = useSxpDataSource();
|
12
|
+
const { jumpToWeb } = useEventReport();
|
11
13
|
const formRef = useRef();
|
12
14
|
const [loading, setLoading] = useState(false);
|
13
15
|
const defaultColumns = useMemo(() => [
|
@@ -46,7 +48,7 @@ const AppointForm = (_a) => {
|
|
46
48
|
}
|
47
49
|
}, [layoutType, columns, defaultColumns]);
|
48
50
|
const handleSubmit = debounce(() => __awaiter(void 0, void 0, void 0, function* () {
|
49
|
-
var _b, _c, _d;
|
51
|
+
var _b, _c, _d, _e, _f, _g;
|
50
52
|
const vals = yield ((_b = formRef === null || formRef === void 0 ? void 0 : formRef.current) === null || _b === void 0 ? void 0 : _b.getFieldsValue());
|
51
53
|
if (!vals)
|
52
54
|
return;
|
@@ -63,6 +65,13 @@ const AppointForm = (_a) => {
|
|
63
65
|
const res = (yield (submitForm === null || submitForm === void 0 ? void 0 : submitForm({ attributes: arr })));
|
64
66
|
setLoading(false);
|
65
67
|
if (res) {
|
68
|
+
if (isExternalLink) {
|
69
|
+
const data = popupDetailData;
|
70
|
+
const product = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.bindProduct;
|
71
|
+
const cta = (_g = (_f = data === null || data === void 0 ? void 0 : data.video) === null || _f === void 0 ? void 0 : _f.bindProduct) === null || _g === void 0 ? void 0 : _g.bindCta;
|
72
|
+
const position = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
73
|
+
jumpToWeb(data, product, cta, position);
|
74
|
+
}
|
66
75
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
67
76
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
68
77
|
}
|
@@ -23,7 +23,7 @@ const CommodityDetail = (_a) => {
|
|
23
23
|
const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
24
24
|
const handleLink = () => {
|
25
25
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
26
|
-
jumpToWeb(
|
26
|
+
jumpToWeb(data, product, cta, position);
|
27
27
|
if (!isPost) {
|
28
28
|
productView(data, product, cta, viewTime || curTimeRef.current, position);
|
29
29
|
}
|
@@ -220,7 +220,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
220
220
|
right: 0
|
221
221
|
} },
|
222
222
|
react_1.default.createElement("div", { style: { position: 'relative', width, height: '100%' } },
|
223
|
-
react_1.default.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, crossOrigin: 'anonymous', muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart, style: {
|
223
|
+
react_1.default.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, autoPlay: true, crossOrigin: 'anonymous', muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart, style: {
|
224
224
|
width: '100%',
|
225
225
|
height,
|
226
226
|
objectFit: 'contain'
|
@@ -232,7 +232,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
232
232
|
height,
|
233
233
|
overflow: 'hidden'
|
234
234
|
} },
|
235
|
-
react_1.default.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, crossOrigin: 'anonymous', muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart }),
|
235
|
+
react_1.default.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', style: { width: '100%' }, ref: videoRef, crossOrigin: 'anonymous', muted: true, autoPlay: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart }),
|
236
236
|
renderPoster,
|
237
237
|
react_1.default.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
|
238
238
|
};
|
@@ -48,18 +48,19 @@ 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;
|
51
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
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
|
-
const
|
56
|
-
|
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
|
+
const defaulSetting = (_e = t === null || t === void 0 ? void 0 : t.extend) === null || _e === void 0 ? void 0 : _e.defaulSetting;
|
57
|
+
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), (_f = value === null || value === void 0 ? void 0 : value.item) === null || _f === void 0 ? void 0 : _f.style), { width: '100%', height: '80vh', overflow: 'auto' }), textStyle: Object.assign(Object.assign({}, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.textStyle), (_g = value === null || value === void 0 ? void 0 : value.item) === null || _g === void 0 ? void 0 : _g.textStyle), bindDatas: (_j = (_h = value === null || value === void 0 ? void 0 : value.item) === null || _h === void 0 ? void 0 : _h.bindDatas) !== null && _j !== void 0 ? _j : [] }, defaulSetting === null || defaulSetting === void 0 ? void 0 : defaulSetting.props, (_k = value === null || value === void 0 ? void 0 : value.item) === null || _k === void 0 ? void 0 : _k.props, { event: ((_l = value === null || value === void 0 ? void 0 : value.item) === null || _l === void 0 ? void 0 : _l.event) || {}, schema: schema, id: value === null || value === void 0 ? void 0 : value.id, isExternalLink: isExternalLink, onClose: handleClose })));
|
57
58
|
}
|
58
59
|
else {
|
59
60
|
return react_1.default.createElement(react_1.default.Fragment, null);
|
60
61
|
}
|
61
62
|
});
|
62
|
-
}, [schema, popup, resolver]);
|
63
|
+
}, [schema, popup, resolver, handleClose]);
|
63
64
|
return (react_1.default.createElement(Modal_1.default, { popup: visible, onClose: handleClose, padding: 0, modalStyle: { position: 'fixed' } }, renderPopupDetail));
|
64
65
|
};
|
65
66
|
exports.default = Popup;
|
@@ -7,9 +7,11 @@ const pro_components_1 = require("@ant-design/pro-components");
|
|
7
7
|
const lodash_1 = require("lodash");
|
8
8
|
const hooks_1 = require("../../../../core/hooks");
|
9
9
|
require("./index.less");
|
10
|
+
const useEventReport_1 = require("../../../../core/hooks/useEventReport");
|
10
11
|
const AppointForm = (_a) => {
|
11
|
-
var { columns, style, title, textStyle, submitBgColor, submitColor, submitText, layoutType, onClick, onClose } = _a, props = tslib_1.__rest(_a, ["columns", "style", "title", "textStyle", "submitBgColor", "submitColor", "submitText", "layoutType", "onClick", "onClose"]);
|
12
|
-
const { submitForm } = (0, hooks_1.useSxpDataSource)();
|
12
|
+
var { columns, style, title, textStyle, submitBgColor, submitColor, submitText, layoutType, isExternalLink, onClick, onClose } = _a, props = tslib_1.__rest(_a, ["columns", "style", "title", "textStyle", "submitBgColor", "submitColor", "submitText", "layoutType", "isExternalLink", "onClick", "onClose"]);
|
13
|
+
const { submitForm, popupDetailData } = (0, hooks_1.useSxpDataSource)();
|
14
|
+
const { jumpToWeb } = (0, useEventReport_1.useEventReport)();
|
13
15
|
const formRef = (0, react_1.useRef)();
|
14
16
|
const [loading, setLoading] = (0, react_1.useState)(false);
|
15
17
|
const defaultColumns = (0, react_1.useMemo)(() => [
|
@@ -48,7 +50,7 @@ const AppointForm = (_a) => {
|
|
48
50
|
}
|
49
51
|
}, [layoutType, columns, defaultColumns]);
|
50
52
|
const handleSubmit = (0, lodash_1.debounce)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
51
|
-
var _b, _c, _d;
|
53
|
+
var _b, _c, _d, _e, _f, _g;
|
52
54
|
const vals = yield ((_b = formRef === null || formRef === void 0 ? void 0 : formRef.current) === null || _b === void 0 ? void 0 : _b.getFieldsValue());
|
53
55
|
if (!vals)
|
54
56
|
return;
|
@@ -65,6 +67,13 @@ const AppointForm = (_a) => {
|
|
65
67
|
const res = (yield (submitForm === null || submitForm === void 0 ? void 0 : submitForm({ attributes: arr })));
|
66
68
|
setLoading(false);
|
67
69
|
if (res) {
|
70
|
+
if (isExternalLink) {
|
71
|
+
const data = popupDetailData;
|
72
|
+
const product = (_e = data === null || data === void 0 ? void 0 : data.video) === null || _e === void 0 ? void 0 : _e.bindProduct;
|
73
|
+
const cta = (_g = (_f = data === null || data === void 0 ? void 0 : data.video) === null || _f === void 0 ? void 0 : _f.bindProduct) === null || _g === void 0 ? void 0 : _g.bindCta;
|
74
|
+
const position = popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
75
|
+
jumpToWeb(data, product, cta, position);
|
76
|
+
}
|
68
77
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
69
78
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
70
79
|
}
|
@@ -25,7 +25,7 @@ const CommodityDetail = (_a) => {
|
|
25
25
|
const position = isPost ? index : popupDetailData === null || popupDetailData === void 0 ? void 0 : popupDetailData.index;
|
26
26
|
const handleLink = () => {
|
27
27
|
if (product === null || product === void 0 ? void 0 : product.link) {
|
28
|
-
jumpToWeb(
|
28
|
+
jumpToWeb(data, product, cta, position);
|
29
29
|
if (!isPost) {
|
30
30
|
productView(data, product, cta, viewTime || curTimeRef.current, position);
|
31
31
|
}
|