pb-sxp-ui 1.0.99 → 1.0.101
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 +408 -184
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +23 -20
- package/dist/index.js +409 -184
- 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 +408 -184
- 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/ExpandableText.js +6 -3
- package/es/core/components/SxpPageRender/Hashtag/index.js +3 -1
- package/es/core/components/SxpPageRender/Navbar.js +4 -1
- package/es/core/components/SxpPageRender/Tagbar.d.ts +1 -0
- package/es/core/components/SxpPageRender/Tagbar.js +2 -2
- package/es/core/components/SxpPageRender/VideoWidget/index.d.ts +1 -0
- package/es/core/components/SxpPageRender/VideoWidget/index.js +3 -3
- package/es/core/components/SxpPageRender/WaterFall/List.js +21 -10
- package/es/core/components/SxpPageRender/WaterFall/WaterfallList.js +24 -13
- package/es/core/components/SxpPageRender/index.d.ts +1 -0
- package/es/core/components/SxpPageRender/index.js +9 -3
- package/es/core/context/EditorDataProvider.d.ts +1 -0
- package/es/core/context/EditorDataProvider.js +2 -1
- package/es/core/utils/tool.d.ts +5 -0
- package/es/core/utils/tool.js +43 -0
- package/es/index.d.ts +0 -1
- package/es/index.js +0 -1
- package/es/materials/sxp/HashTag/settingRender.d.ts +19 -22
- package/es/materials/sxp/HashTag/settingRender.js +31 -13
- package/es/materials/sxp/popup/AppointForm/Form.d.ts +14 -0
- package/es/materials/sxp/popup/AppointForm/Form.js +8 -0
- package/es/materials/sxp/popup/AppointForm/index.js +25 -20
- package/es/materials/sxp/popup/AppointForm/settingRender.d.ts +9 -20
- package/es/materials/sxp/popup/AppointForm/settingRender.js +31 -13
- package/es/materials/sxp/popup/CommodityDetail/index.js +14 -4
- package/es/materials/sxp/popup/CommodityDetail/settingRender.d.ts +19 -22
- package/es/materials/sxp/popup/CommodityDetail/settingRender.js +31 -13
- package/es/materials/sxp/popup/CommodityDetailDiroNew/index.js +17 -5
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +19 -22
- package/es/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +31 -13
- package/es/materials/sxp/popup/Prompt/index.js +4 -1
- package/es/materials/sxp/popup/Prompt/settingRender.d.ts +10 -8
- package/es/materials/sxp/popup/Prompt/settingRender.js +16 -8
- package/es/materials/sxp/template/Appoint/index.js +4 -1
- package/es/materials/sxp/template/Commodity/index.js +7 -2
- package/es/materials/sxp/template/CommodityDiro/index.js +8 -3
- package/es/materials/sxp/template/CommodityDiroNew/index.js +7 -2
- package/es/materials/sxp/template/Link/index.js +4 -1
- package/es/materials/sxp/template/MultiCommodity/index.js +7 -2
- package/es/materials/sxp/template/MultiCommodityDiro/index.js +8 -3
- package/es/materials/sxp/template/MultiCommodityDiroNew/index.js +7 -2
- package/es/materials/sxp/template/components/settingRender.d.ts +16 -24
- package/es/materials/sxp/template/components/settingRender.js +30 -12
- package/lib/core/components/SxpPageRender/ExpandableText.js +6 -3
- package/lib/core/components/SxpPageRender/Hashtag/index.js +3 -1
- package/lib/core/components/SxpPageRender/Navbar.js +4 -1
- package/lib/core/components/SxpPageRender/Tagbar.d.ts +1 -0
- package/lib/core/components/SxpPageRender/Tagbar.js +2 -2
- package/lib/core/components/SxpPageRender/VideoWidget/index.d.ts +1 -0
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +3 -3
- package/lib/core/components/SxpPageRender/WaterFall/List.js +21 -10
- package/lib/core/components/SxpPageRender/WaterFall/WaterfallList.js +24 -13
- package/lib/core/components/SxpPageRender/index.d.ts +1 -0
- package/lib/core/components/SxpPageRender/index.js +9 -3
- package/lib/core/context/EditorDataProvider.d.ts +1 -0
- package/lib/core/context/EditorDataProvider.js +2 -1
- package/lib/core/utils/tool.d.ts +5 -0
- package/lib/core/utils/tool.js +45 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +1 -3
- package/lib/materials/sxp/HashTag/settingRender.d.ts +19 -22
- package/lib/materials/sxp/HashTag/settingRender.js +31 -13
- package/lib/materials/sxp/popup/AppointForm/Form.d.ts +14 -0
- package/lib/materials/sxp/popup/AppointForm/Form.js +11 -0
- package/lib/materials/sxp/popup/AppointForm/index.js +24 -19
- package/lib/materials/sxp/popup/AppointForm/settingRender.d.ts +9 -20
- package/lib/materials/sxp/popup/AppointForm/settingRender.js +31 -14
- package/lib/materials/sxp/popup/CommodityDetail/index.js +14 -4
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.d.ts +19 -22
- package/lib/materials/sxp/popup/CommodityDetail/settingRender.js +31 -13
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/index.js +17 -5
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.d.ts +19 -22
- package/lib/materials/sxp/popup/CommodityDetailDiroNew/settingRender.js +31 -13
- package/lib/materials/sxp/popup/Prompt/index.js +4 -1
- package/lib/materials/sxp/popup/Prompt/settingRender.d.ts +10 -8
- package/lib/materials/sxp/popup/Prompt/settingRender.js +16 -9
- package/lib/materials/sxp/template/Appoint/index.js +4 -1
- package/lib/materials/sxp/template/Commodity/index.js +7 -2
- package/lib/materials/sxp/template/CommodityDiro/index.js +8 -3
- package/lib/materials/sxp/template/CommodityDiroNew/index.js +7 -2
- package/lib/materials/sxp/template/Link/index.js +4 -1
- package/lib/materials/sxp/template/MultiCommodity/index.js +7 -2
- package/lib/materials/sxp/template/MultiCommodityDiro/index.js +8 -3
- package/lib/materials/sxp/template/MultiCommodityDiroNew/index.js +7 -2
- package/lib/materials/sxp/template/components/settingRender.d.ts +16 -24
- package/lib/materials/sxp/template/components/settingRender.js +30 -12
- package/package.json +1 -1
- package/es/materials/sxp/defaultSetting.d.ts +0 -8
- package/es/materials/sxp/defaultSetting.js +0 -6
- package/lib/materials/sxp/defaultSetting.d.ts +0 -8
- package/lib/materials/sxp/defaultSetting.js +0 -9
@@ -1,3 +1,4 @@
|
|
1
|
+
import { setFontForText } from '../../../core/utils/tool';
|
1
2
|
import React, { memo, useMemo, useState, useCallback, useRef, useEffect } from 'react';
|
2
3
|
const limitTextLastWholeWord = (originalText = '', limit) => {
|
3
4
|
const chineseRegex = /[\u4e00-\u9fa5]+/;
|
@@ -45,8 +46,10 @@ const ExpandableText = ({ text, maxStr = 108, style, className, onClick, foldTex
|
|
45
46
|
display: '-webkit-box',
|
46
47
|
WebkitBoxOrient: 'vertical',
|
47
48
|
wordBreak: 'break-word'
|
48
|
-
}, dangerouslySetInnerHTML: { __html: text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>') } }),
|
49
|
-
React.createElement("div", { ref: multiRowCopy, dangerouslySetInnerHTML: { __html: text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>') } }),
|
50
|
-
text && isPost && isShow && (React.createElement("span", { style: { textDecoration: 'underline', cursor: 'pointer' }, onClick: onClick !== null && onClick !== void 0 ? onClick : handleClick
|
49
|
+
}, dangerouslySetInnerHTML: { __html: setFontForText(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), style) } }),
|
50
|
+
React.createElement("div", { ref: multiRowCopy, dangerouslySetInnerHTML: { __html: setFontForText(text === null || text === void 0 ? void 0 : text.replace(/\n/g, '</br>'), style) } }),
|
51
|
+
text && isPost && isShow && (React.createElement("span", { style: { textDecoration: 'underline', cursor: 'pointer' }, onClick: onClick !== null && onClick !== void 0 ? onClick : handleClick, dangerouslySetInnerHTML: {
|
52
|
+
__html: setFontForText(isShowMore ? unfoldText || 'show less' : foldText || 'show more', style)
|
53
|
+
} }))));
|
51
54
|
};
|
52
55
|
export default memo(ExpandableText);
|
@@ -2,6 +2,7 @@ import React, { memo, useMemo, useState } from 'react';
|
|
2
2
|
import { SwiperSlide } from 'swiper/react';
|
3
3
|
import { useSxpDataSource } from '../../../../core/hooks';
|
4
4
|
import Scroll from '../../../../materials/sxp/template/components/Scroll';
|
5
|
+
import { setFontForText } from '../../../../core/utils/tool';
|
5
6
|
const Hashtag = ({ tags, itemId, itemType, index, rec, hashTagStyle }) => {
|
6
7
|
const [isShowMore, setIsShowMore] = useState(false);
|
7
8
|
const { setWaterFallData, setOpenHashtag, setCacheActiveIndex, waterFallData, setIsFromHashtag } = useSxpDataSource();
|
@@ -35,6 +36,7 @@ const Hashtag = ({ tags, itemId, itemType, index, rec, hashTagStyle }) => {
|
|
35
36
|
return (React.createElement("span", { style: { textDecoration: 'underline', cursor: 'pointer', color: '#fff' }, onClick: () => setIsShowMore(!isShowMore) }, isShowMore ? 'show less' : 'show more'));
|
36
37
|
}, [isShowMore, tags]);
|
37
38
|
return (React.createElement("div", { className: 'clc-sxp-bottom-hashtag' },
|
38
|
-
React.createElement(Scroll, null, tags === null || tags === void 0 ? void 0 : tags.map((item, index) => (React.createElement(SwiperSlide, { key: index, hidden: !isShowMore ? index >= 6 : false, className: 'clc-sxp-bottom-hashtag-item', style: hashTagStyle, onClick: () => handleClickTag(item) },
|
39
|
+
React.createElement(Scroll, null, tags === null || tags === void 0 ? void 0 : tags.map((item, index) => (React.createElement(SwiperSlide, { key: index, hidden: !isShowMore ? index >= 6 : false, className: 'clc-sxp-bottom-hashtag-item', style: hashTagStyle, onClick: () => handleClickTag(item) },
|
40
|
+
React.createElement("div", { dangerouslySetInnerHTML: { __html: setFontForText(`#${item}`, hashTagStyle) } })))))));
|
39
41
|
};
|
40
42
|
export default memo(Hashtag);
|
@@ -1,10 +1,13 @@
|
|
1
1
|
import React, { memo } from 'react';
|
2
2
|
import { useSxpDataSource } from '../../../core/hooks';
|
3
|
+
import { setFontForText } from '../../../core/utils/tool';
|
3
4
|
const Navbar = ({ icon, styles, textStyle, onClose }) => {
|
4
5
|
var _a;
|
5
6
|
const { waterFallData, setOpenHashtag } = useSxpDataSource();
|
6
7
|
return (React.createElement("div", { className: 'clc-sxp-nav', style: styles },
|
7
8
|
React.createElement("img", { className: 'clc-sxp-nav-left', src: icon, alt: 'back button', onClick: onClose }),
|
8
|
-
React.createElement("div", { className: 'clc-sxp-nav-title', style: textStyle
|
9
|
+
React.createElement("div", { className: 'clc-sxp-nav-title', style: textStyle, dangerouslySetInnerHTML: {
|
10
|
+
__html: setFontForText(`#${(_a = waterFallData === null || waterFallData === void 0 ? void 0 : waterFallData.hashTag) !== null && _a !== void 0 ? _a : '标题'}`, textStyle)
|
11
|
+
} })));
|
9
12
|
};
|
10
13
|
export default memo(Navbar);
|
@@ -3,7 +3,7 @@ import { useSxpDataSource } from '../../../core/hooks';
|
|
3
3
|
import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../../../core/utils/event';
|
4
4
|
import { useEventReport } from '../../../core/hooks/useEventReport';
|
5
5
|
import { DEFAULT_TAG } from '../../../core/context/SxpDataSourceProvider';
|
6
|
-
const Tagbar = ({ tagList = [], setActiveIndex }) => {
|
6
|
+
const Tagbar = ({ tagList = [], setActiveIndex, style }) => {
|
7
7
|
const { getRecommendVideos, setRtcList, setCacheRtcList, setCacheActiveIndex, setLoading, swiperRef, waterFallData, bffEventReport, selectTag, setSelectTag } = useSxpDataSource();
|
8
8
|
const { backMainFeed } = useEventReport();
|
9
9
|
const realTagList = useMemo(() => {
|
@@ -44,7 +44,7 @@ const Tagbar = ({ tagList = [], setActiveIndex }) => {
|
|
44
44
|
};
|
45
45
|
if (waterFallData || tagList.length <= 0)
|
46
46
|
return null;
|
47
|
-
return (React.createElement("div", { className: 'clc-sxp-tagbar' },
|
47
|
+
return (React.createElement("div", { className: 'clc-sxp-tagbar', style: style },
|
48
48
|
React.createElement("ul", { className: 'clc-sxp-tagbar-list', style: { margin: 'auto', gap: 24 } }, realTagList.map((tag) => {
|
49
49
|
return (React.createElement("li", { className: `clc-sxp-tagbar-list-item ${tag === selectTag ? 'clc-sxp-tagbar-list-item-active' : ''}`, key: tag, onClick: handleSelectTag(tag) }, tag));
|
50
50
|
}))));
|
@@ -5,7 +5,7 @@ import FormatImage from '../FormatImage';
|
|
5
5
|
import { useSxpDataSource } from '../../../../core/hooks';
|
6
6
|
import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../../../../core/utils/event';
|
7
7
|
import loading_gif from './loading.gif';
|
8
|
-
const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoRef }) => {
|
8
|
+
const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoRef, videoPlayIcon }) => {
|
9
9
|
const [isPauseVideo, setIsPauseVideo] = useState(false);
|
10
10
|
const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport } = useSxpDataSource();
|
11
11
|
const videoStartTime = useRef(0);
|
@@ -329,7 +329,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
329
329
|
} },
|
330
330
|
React.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' } },
|
331
331
|
React.createElement("div", { className: 'n-full-screen', ref: videoEleRef, id: videoId, style: { width: '100%', height: '100%' } }),
|
332
|
-
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', alt: 'pause', src: PAUSE_ICON }))),
|
332
|
+
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', alt: 'pause', src: videoPlayIcon !== null && videoPlayIcon !== void 0 ? videoPlayIcon : PAUSE_ICON }))),
|
333
333
|
renderPoster,
|
334
334
|
renderLoading)) : (React.createElement("div", { className: 'video-container', key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, style: {
|
335
335
|
position: 'relative',
|
@@ -340,6 +340,6 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
340
340
|
React.createElement("div", { className: 'n-full-screen', ref: videoEleRef, id: videoId, style: { width: '100%', height: '100%' } }),
|
341
341
|
renderPoster,
|
342
342
|
renderLoading,
|
343
|
-
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON, alt: 'pause' })))));
|
343
|
+
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: videoPlayIcon !== null && videoPlayIcon !== void 0 ? videoPlayIcon : PAUSE_ICON, alt: 'pause' })))));
|
344
344
|
};
|
345
345
|
export default memo(VideoWidget);
|
@@ -5,6 +5,7 @@ import FormatImage from '../FormatImage';
|
|
5
5
|
import previewData from './preview.json';
|
6
6
|
import { useSxpDataSource } from '../../../../core/hooks';
|
7
7
|
import { css } from '@emotion/css';
|
8
|
+
import { setFontForText } from '../../../../core/utils/tool';
|
8
9
|
const WaterfallFlowItem = (props) => {
|
9
10
|
const { rec, index, list, reportTagsView, textStyles, space } = props;
|
10
11
|
const { swiperRef, setRtcList, setOpenHashtag, bffEventReport, sxpParameter } = useSxpDataSource();
|
@@ -110,11 +111,15 @@ const WaterfallFlowItem = (props) => {
|
|
110
111
|
React.createElement("canvas", { ref: canvasRef }))),
|
111
112
|
React.createElement(FormatImage, { loading: 'lazy', className: 'list-content-listItem-picture-img', ref: imgDom })),
|
112
113
|
React.createElement("div", { className: 'list-content-listItem-info' },
|
113
|
-
React.createElement("div", { className: `${'list-content-listItem-info-title'} ${priceText ? 'list-content-listItem-info-nowrap' : ''}`, style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.title
|
114
|
-
|
114
|
+
React.createElement("div", { className: `${'list-content-listItem-info-title'} ${priceText ? 'list-content-listItem-info-nowrap' : ''}`, style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.title, dangerouslySetInnerHTML: {
|
115
|
+
__html: setFontForText(title, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title)
|
116
|
+
} }),
|
117
|
+
React.createElement("div", { className: 'list-content-listItem-info-price', style: textStyles === null || textStyles === void 0 ? void 0 : textStyles.price, hidden: !priceText, dangerouslySetInnerHTML: {
|
118
|
+
__html: setFontForText(priceText, textStyles === null || textStyles === void 0 ? void 0 : textStyles.price)
|
119
|
+
} }))));
|
115
120
|
};
|
116
121
|
export default function WaterfallList(_a) {
|
117
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
122
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
118
123
|
var { reportTagsView, showBanner } = _a, props = __rest(_a, ["reportTagsView", "showBanner"]);
|
119
124
|
const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = useSxpDataSource();
|
120
125
|
const [list, setList] = useState();
|
@@ -176,16 +181,22 @@ export default function WaterfallList(_a) {
|
|
176
181
|
objectFit: 'cover',
|
177
182
|
marginBottom: '20px'
|
178
183
|
}), src: (_c = data === null || data === void 0 ? void 0 : data.tag) === null || _c === void 0 ? void 0 : _c.picture }))),
|
179
|
-
React.createElement("div", { className: 'list-info', style: (_d = props === null || props === void 0 ? void 0 : props.textStyles) === null || _d === void 0 ? void 0 : _d.hashTagDesc
|
180
|
-
|
184
|
+
React.createElement("div", { className: 'list-info', style: (_d = props === null || props === void 0 ? void 0 : props.textStyles) === null || _d === void 0 ? void 0 : _d.hashTagDesc, dangerouslySetInnerHTML: {
|
185
|
+
__html: setFontForText((_e = data === null || data === void 0 ? void 0 : data.tag) === null || _e === void 0 ? void 0 : _e.info, (_f = props === null || props === void 0 ? void 0 : props.textStyles) === null || _f === void 0 ? void 0 : _f.hashTagDesc)
|
186
|
+
} }),
|
187
|
+
React.createElement("div", { hidden: !((_g = data === null || data === void 0 ? void 0 : data.tag) === null || _g === void 0 ? void 0 : _g.link), className: 'list-collection', onClick: handleClickLink, style: Object.assign(Object.assign({}, (_h = props === null || props === void 0 ? void 0 : props.textStyles) === null || _h === void 0 ? void 0 : _h.hashTagLink), { marginBottom: props === null || props === void 0 ? void 0 : props.space }), dangerouslySetInnerHTML: {
|
188
|
+
__html: setFontForText(((_j = data === null || data === void 0 ? void 0 : data.tag) === null || _j === void 0 ? void 0 : _j.linkTitle) || 'Shop the collection', (_k = props === null || props === void 0 ? void 0 : props.textStyles) === null || _k === void 0 ? void 0 : _k.hashTagLink)
|
189
|
+
} }),
|
181
190
|
React.createElement("div", { className: 'list-content' }, list === null || list === void 0 ? void 0 : list.map((item, ind) => {
|
182
191
|
return (React.createElement(WaterfallFlowItem, Object.assign({ key: ind, index: ind, rec: item, list: list, reportTagsView: reportTagsView }, props)));
|
183
192
|
})),
|
184
193
|
React.createElement("div", { hidden: !isLoadMore, style: { textAlign: 'center' } }, "loading..."),
|
185
|
-
React.createElement("div", { hidden: !((
|
186
|
-
height: ((
|
194
|
+
React.createElement("div", { hidden: !((_l = data === null || data === void 0 ? void 0 : data.tag) === null || _l === void 0 ? void 0 : _l.link), style: {
|
195
|
+
height: ((_m = data === null || data === void 0 ? void 0 : data.tag) === null || _m === void 0 ? void 0 : _m.link) ? ((_o = props === null || props === void 0 ? void 0 : props.buttonBgStyle) === null || _o === void 0 ? void 0 : _o.height) || ((_p = props === null || props === void 0 ? void 0 : props.buttonStyle) === null || _p === void 0 ? void 0 : _p.height) || '100px' : 0
|
187
196
|
} })),
|
188
|
-
React.createElement("div", { className: 'list-bottom', hidden: !((
|
189
|
-
React.createElement("div", { hidden: !((
|
190
|
-
React.createElement("button", { "aria-label": ((
|
197
|
+
React.createElement("div", { className: 'list-bottom', hidden: !((_q = data === null || data === void 0 ? void 0 : data.tag) === null || _q === void 0 ? void 0 : _q.link), style: props === null || props === void 0 ? void 0 : props.buttonBgStyle }),
|
198
|
+
React.createElement("div", { hidden: !((_r = data === null || data === void 0 ? void 0 : data.tag) === null || _r === void 0 ? void 0 : _r.link), className: 'list-btn-wrap', style: Object.assign(Object.assign({}, props === null || props === void 0 ? void 0 : props.buttonBgStyle), { height: 'auto', backgroundColor: 'transparent' }) },
|
199
|
+
React.createElement("button", { "aria-label": ((_s = data === null || data === void 0 ? void 0 : data.tag) === null || _s === void 0 ? void 0 : _s.linkTitle) || 'Shop the collection', className: 'list-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink, dangerouslySetInnerHTML: {
|
200
|
+
__html: setFontForText(((_t = data === null || data === void 0 ? void 0 : data.tag) === null || _t === void 0 ? void 0 : _t.linkTitle) || 'Shop the collection', props === null || props === void 0 ? void 0 : props.buttonStyle)
|
201
|
+
} }))))));
|
191
202
|
}
|
@@ -5,6 +5,7 @@ import './WaterfallList.less';
|
|
5
5
|
import previewData from './preview.json';
|
6
6
|
import FormatImage from '../FormatImage';
|
7
7
|
import { css } from '@emotion/css';
|
8
|
+
import { setFontForText } from '../../../../core/utils/tool';
|
8
9
|
const WaterfallFlowItem = (props) => {
|
9
10
|
const { rec, style = {}, sizeChange = () => { }, unitWidth, index, showBorder, list, reportTagsView, textStyles, space } = props;
|
10
11
|
const { swiperRef, setRtcList, setOpenHashtag, sxpParameter } = useSxpDataSource();
|
@@ -102,11 +103,15 @@ const WaterfallFlowItem = (props) => {
|
|
102
103
|
React.createElement("div", { className: 'waterFallList-content-listItem-picture', ref: pictRef },
|
103
104
|
React.createElement(FormatImage, { loading: 'lazy', className: 'waterFallList-content-listItem-picture-img', onLoad: imgLoad, ref: imgDom })),
|
104
105
|
React.createElement("div", { className: 'waterFallList-content-listItem-info' },
|
105
|
-
React.createElement("div", { className: `${'waterFallList-content-listItem-info-title'} ${priceText ? 'waterFallList-content-listItem-info-nowrap' : ''}`, style: Object.assign({}, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title)
|
106
|
-
|
106
|
+
React.createElement("div", { className: `${'waterFallList-content-listItem-info-title'} ${priceText ? 'waterFallList-content-listItem-info-nowrap' : ''}`, style: Object.assign({}, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title), dangerouslySetInnerHTML: {
|
107
|
+
__html: setFontForText(title, textStyles === null || textStyles === void 0 ? void 0 : textStyles.title)
|
108
|
+
} }),
|
109
|
+
React.createElement("div", { className: 'waterFallList-content-listItem-info-price', hidden: !priceText, style: textStyles.price, dangerouslySetInnerHTML: {
|
110
|
+
__html: setFontForText(priceText, textStyles === null || textStyles === void 0 ? void 0 : textStyles.price)
|
111
|
+
} }))));
|
107
112
|
};
|
108
113
|
export default function WaterfallList(_a) {
|
109
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
114
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
110
115
|
var { reportTagsView, showBanner } = _a, props = __rest(_a, ["reportTagsView", "showBanner"]);
|
111
116
|
const { waterFallData, getRecommendVideos, hashTagSize, loadingImage, isOpenHashTag } = useSxpDataSource();
|
112
117
|
const scrollParent = useRef(null);
|
@@ -284,23 +289,29 @@ export default function WaterfallList(_a) {
|
|
284
289
|
objectFit: 'cover',
|
285
290
|
marginBottom: '20px'
|
286
291
|
}), src: (_c = data === null || data === void 0 ? void 0 : data.tag) === null || _c === void 0 ? void 0 : _c.picture }))),
|
287
|
-
React.createElement("div", { className: 'waterFallList-info', style: (_d = props === null || props === void 0 ? void 0 : props.textStyles) === null || _d === void 0 ? void 0 : _d.hashTagDesc
|
288
|
-
|
292
|
+
React.createElement("div", { className: 'waterFallList-info', style: (_d = props === null || props === void 0 ? void 0 : props.textStyles) === null || _d === void 0 ? void 0 : _d.hashTagDesc, dangerouslySetInnerHTML: {
|
293
|
+
__html: setFontForText((_e = data === null || data === void 0 ? void 0 : data.tag) === null || _e === void 0 ? void 0 : _e.info, (_f = props === null || props === void 0 ? void 0 : props.textStyles) === null || _f === void 0 ? void 0 : _f.hashTagDesc)
|
294
|
+
} }),
|
295
|
+
React.createElement("div", { hidden: !((_g = data === null || data === void 0 ? void 0 : data.tag) === null || _g === void 0 ? void 0 : _g.link), className: 'waterFallList-collection', style: Object.assign({}, (_h = props === null || props === void 0 ? void 0 : props.textStyles) === null || _h === void 0 ? void 0 : _h.hashTagLink), onClick: handleClickLink, dangerouslySetInnerHTML: {
|
296
|
+
__html: setFontForText(((_j = data === null || data === void 0 ? void 0 : data.tag) === null || _j === void 0 ? void 0 : _j.linkTitle) || 'Shop the collection', (_k = props === null || props === void 0 ? void 0 : props.textStyles) === null || _k === void 0 ? void 0 : _k.hashTagLink)
|
297
|
+
} }),
|
289
298
|
React.createElement("div", { className: 'waterFallList-content' }, list === null || list === void 0 ? void 0 :
|
290
299
|
list.map((item, ind) => {
|
291
300
|
var _a;
|
292
301
|
return (React.createElement(WaterfallFlowItem, Object.assign({ key: ind, index: ind, rec: item, list: list, showBorder: scrollTop + ((_a = scrollParent === null || scrollParent === void 0 ? void 0 : scrollParent.current) === null || _a === void 0 ? void 0 : _a.clientHeight), style: styleList[ind], sizeChange: onSizeChange, unitWidth: unitWidth, reportTagsView: reportTagsView }, props)));
|
293
302
|
}),
|
294
|
-
React.createElement("div", { hidden: !((
|
303
|
+
React.createElement("div", { hidden: !((_l = data === null || data === void 0 ? void 0 : data.tag) === null || _l === void 0 ? void 0 : _l.link), style: {
|
295
304
|
position: 'absolute',
|
296
305
|
width: '100%',
|
297
|
-
transform: `translate(0px,${(
|
298
|
-
((
|
299
|
-
height: ((
|
300
|
-
? ((
|
306
|
+
transform: `translate(0px,${(_r = ((_o = waterfallFlowListInfo === null || waterfallFlowListInfo === void 0 ? void 0 : waterfallFlowListInfo.current[((_m = waterfallFlowListInfo === null || waterfallFlowListInfo === void 0 ? void 0 : waterfallFlowListInfo.current) === null || _m === void 0 ? void 0 : _m.length) - 1]) === null || _o === void 0 ? void 0 : _o.top) +
|
307
|
+
((_q = waterfallFlowListInfo === null || waterfallFlowListInfo === void 0 ? void 0 : waterfallFlowListInfo.current[((_p = waterfallFlowListInfo === null || waterfallFlowListInfo === void 0 ? void 0 : waterfallFlowListInfo.current) === null || _p === void 0 ? void 0 : _p.length) - 1]) === null || _q === void 0 ? void 0 : _q.height)) !== null && _r !== void 0 ? _r : 0}px)`,
|
308
|
+
height: ((_s = data === null || data === void 0 ? void 0 : data.tag) === null || _s === void 0 ? void 0 : _s.link)
|
309
|
+
? ((_t = buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.current) === null || _t === void 0 ? void 0 : _t.offsetHeight) || ((_u = props === null || props === void 0 ? void 0 : props.buttonBgStyle) === null || _u === void 0 ? void 0 : _u.height) || '100px'
|
301
310
|
: 0
|
302
311
|
} }))),
|
303
|
-
React.createElement("div", { className: 'waterFallList-bottom', hidden: !((
|
304
|
-
React.createElement("div", { ref: buttonRef, hidden: !((
|
305
|
-
React.createElement("button", { "aria-label": ((
|
312
|
+
React.createElement("div", { className: 'waterFallList-bottom', hidden: !((_v = data === null || data === void 0 ? void 0 : data.tag) === null || _v === void 0 ? void 0 : _v.link), style: props === null || props === void 0 ? void 0 : props.buttonBgStyle }),
|
313
|
+
React.createElement("div", { ref: buttonRef, hidden: !((_w = data === null || data === void 0 ? void 0 : data.tag) === null || _w === void 0 ? void 0 : _w.link), className: 'waterFallList-btn-wrap', style: Object.assign(Object.assign({}, props === null || props === void 0 ? void 0 : props.buttonBgStyle), { height: 'auto', backgroundColor: 'transparent' }) },
|
314
|
+
React.createElement("button", { "aria-label": ((_x = data === null || data === void 0 ? void 0 : data.tag) === null || _x === void 0 ? void 0 : _x.linkTitle) || 'Shop the collection', className: 'waterFallList-btn', style: props === null || props === void 0 ? void 0 : props.buttonStyle, onClick: handleClickLink, dangerouslySetInnerHTML: {
|
315
|
+
__html: setFontForText(((_y = data === null || data === void 0 ? void 0 : data.tag) === null || _y === void 0 ? void 0 : _y.linkTitle) || 'Shop the collection', props === null || props === void 0 ? void 0 : props.buttonStyle)
|
316
|
+
} }))))));
|
306
317
|
}
|
@@ -168,11 +168,14 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
168
168
|
}
|
169
169
|
return h;
|
170
170
|
}, [tagList, waterFallData]);
|
171
|
-
const
|
171
|
+
const minusHeight = useMemo(() => {
|
172
172
|
let minusHeight = 0;
|
173
173
|
if ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.logoUrl) && (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.isShowLogo)) {
|
174
174
|
minusHeight += 45;
|
175
175
|
}
|
176
|
+
return minusHeight;
|
177
|
+
}, []);
|
178
|
+
const height = useMemo(() => {
|
176
179
|
return containerHeight - minusHeight - tagHeight;
|
177
180
|
}, [globalConfig, containerHeight, tagHeight]);
|
178
181
|
const renderLogo = useMemo(() => {
|
@@ -185,7 +188,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
185
188
|
const renderContent = useCallback((rec, index) => {
|
186
189
|
var _a, _b, _c, _d;
|
187
190
|
if ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.url) {
|
188
|
-
return (React.createElement(VideoWidget, { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoRef: videoRef.current }));
|
191
|
+
return (React.createElement(VideoWidget, { rec: rec, index: index, muted: isMuted, data: data, height: height, activeIndex: activeIndex, videoPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPost, videoRef: videoRef.current, videoPlayIcon: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPlayIcon }));
|
189
192
|
}
|
190
193
|
if ((_b = rec === null || rec === void 0 ? void 0 : rec.video) === null || _b === void 0 ? void 0 : _b.imgUrls) {
|
191
194
|
return (React.createElement(PictureGroup, { key: rec === null || rec === void 0 ? void 0 : rec.video.itemId, imgUrls: rec === null || rec === void 0 ? void 0 : rec.video.imgUrls, width: containerWidth, height: height, rec: rec, index: index, onReportViewImageEnd: handleReportViewImageEnd, onViewImageStartEvent: handleViewImageStartEvent, imgUrlsPostConfig: globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.imgUrlsPost }));
|
@@ -207,6 +210,7 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
207
210
|
isMuted,
|
208
211
|
activeIndex,
|
209
212
|
globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.productPost,
|
213
|
+
globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.videoPlayIcon,
|
210
214
|
viewTime,
|
211
215
|
tipText,
|
212
216
|
resolver,
|
@@ -404,7 +408,9 @@ const SxpPageRender = ({ globalConfig, descStyle, containerHeight = window.inner
|
|
404
408
|
setOpenHashtag === null || setOpenHashtag === void 0 ? void 0 : setOpenHashtag(true);
|
405
409
|
} })),
|
406
410
|
renderLogo,
|
407
|
-
React.createElement(Tagbar, { tagList: tagList, setActiveIndex: setActiveIndex
|
411
|
+
React.createElement(Tagbar, { tagList: tagList, setActiveIndex: setActiveIndex, style: {
|
412
|
+
top: minusHeight
|
413
|
+
} }),
|
408
414
|
isShowFingerTip ? (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)}%` } })) : null,
|
409
415
|
React.createElement(Swiper, { style: {
|
410
416
|
marginTop: tagHeight
|
@@ -20,6 +20,7 @@ interface IEditorDataContext {
|
|
20
20
|
setOpenHashtag?: React.Dispatch<React.SetStateAction<boolean>>;
|
21
21
|
openConsent?: boolean;
|
22
22
|
setOpenConsent?: React.Dispatch<React.SetStateAction<boolean>>;
|
23
|
+
sxpFontLinks?: any[];
|
23
24
|
}
|
24
25
|
interface IEditorProviderProps {
|
25
26
|
data?: any;
|
@@ -24,7 +24,8 @@ const EditorDataProvider = ({ children, data }) => {
|
|
24
24
|
openHashtag,
|
25
25
|
setOpenHashtag,
|
26
26
|
openConsent,
|
27
|
-
setOpenConsent
|
27
|
+
setOpenConsent,
|
28
|
+
sxpFontLinks: data === null || data === void 0 ? void 0 : data.sxpFontLinks
|
28
29
|
} }, children));
|
29
30
|
};
|
30
31
|
export function useEditorDataProvider() {
|
package/es/core/utils/tool.d.ts
CHANGED
@@ -2,4 +2,9 @@ declare function uuid(len: number, radix: number): string;
|
|
2
2
|
declare const getIndexByblockType: (type: string, index: number) => number | "initial";
|
3
3
|
export declare const generateRandomString: (length: number) => string;
|
4
4
|
export declare const getUid: () => string;
|
5
|
+
interface IfontType {
|
6
|
+
'fontFamily-cn': string;
|
7
|
+
'fontFamily-en': string;
|
8
|
+
}
|
9
|
+
export declare const setFontForText: (textContent?: string | null, style?: IfontType | any) => string;
|
5
10
|
export { uuid, getIndexByblockType };
|
package/es/core/utils/tool.js
CHANGED
@@ -45,4 +45,47 @@ export const getUid = () => {
|
|
45
45
|
const uid = (originalUid === null || originalUid === void 0 ? void 0 : originalUid.replaceAll) ? originalUid.replaceAll('-', '') : generateRandomString(32);
|
46
46
|
return uid;
|
47
47
|
};
|
48
|
+
export const setFontForText = (textContent, style) => {
|
49
|
+
if (!textContent)
|
50
|
+
return '';
|
51
|
+
let content = '';
|
52
|
+
const cn = style === null || style === void 0 ? void 0 : style['fontFamily-cn'];
|
53
|
+
const en = style === null || style === void 0 ? void 0 : style['fontFamily-en'];
|
54
|
+
if (!cn && !en) {
|
55
|
+
return textContent;
|
56
|
+
}
|
57
|
+
let text = textContent;
|
58
|
+
const chineseRegex = /[\u4e00-\u9fa5]/g;
|
59
|
+
const englishRegex = /[^\u4e00-\u9fa5]/g;
|
60
|
+
const cnStyle = `font-family:${cn !== null && cn !== void 0 ? cn : 'inherit'}`;
|
61
|
+
const enStyle = `font-family:${en !== null && en !== void 0 ? en : 'inherit'}`;
|
62
|
+
const fn = (str) => {
|
63
|
+
let chineseStartIndex = str.search(chineseRegex);
|
64
|
+
let englishStartIndex = str.search(englishRegex);
|
65
|
+
if (chineseStartIndex !== -1 && englishStartIndex !== -1 && chineseStartIndex < englishStartIndex) {
|
66
|
+
content += `<span style="${cnStyle}">${str.substring(chineseStartIndex, englishStartIndex)}</span>`;
|
67
|
+
text = str.substring(englishStartIndex, str === null || str === void 0 ? void 0 : str.length);
|
68
|
+
}
|
69
|
+
if (chineseStartIndex !== -1 && englishStartIndex !== -1 && chineseStartIndex > englishStartIndex) {
|
70
|
+
content += `<span style="${enStyle}">${str.substring(englishStartIndex, chineseStartIndex)}</span>`;
|
71
|
+
text = str.substring(chineseStartIndex, str === null || str === void 0 ? void 0 : str.length);
|
72
|
+
}
|
73
|
+
if (chineseStartIndex === -1) {
|
74
|
+
content += `<span style="${enStyle}">${str.substring(englishStartIndex, str === null || str === void 0 ? void 0 : str.length)}</span>`;
|
75
|
+
text = '';
|
76
|
+
return false;
|
77
|
+
}
|
78
|
+
if (englishStartIndex === -1) {
|
79
|
+
content += `<span style="${cnStyle}">${str.substring(chineseStartIndex, str === null || str === void 0 ? void 0 : str.length)}</span>`;
|
80
|
+
text = '';
|
81
|
+
return false;
|
82
|
+
}
|
83
|
+
return true;
|
84
|
+
};
|
85
|
+
let w = true;
|
86
|
+
while (w) {
|
87
|
+
w = fn(text);
|
88
|
+
}
|
89
|
+
return content;
|
90
|
+
};
|
48
91
|
export { uuid, getIndexByblockType };
|
package/es/index.d.ts
CHANGED
@@ -8,5 +8,4 @@ export { default as SxpDataSourceProvider } from './core/context/SxpDataSourcePr
|
|
8
8
|
export { default as SxpPageCore } from './core/components/SxpPageCore';
|
9
9
|
export { default as EditorDataProvider } from './core/context/EditorDataProvider';
|
10
10
|
export { useEditorDataProvider } from './core/context/EditorDataProvider';
|
11
|
-
export { default as defaultSetting } from './materials/sxp/defaultSetting';
|
12
11
|
export default Pagebuilder;
|
package/es/index.js
CHANGED
@@ -10,5 +10,4 @@ export { default as SxpDataSourceProvider } from './core/context/SxpDataSourcePr
|
|
10
10
|
export { default as SxpPageCore } from './core/components/SxpPageCore';
|
11
11
|
export { default as EditorDataProvider } from './core/context/EditorDataProvider';
|
12
12
|
export { useEditorDataProvider } from './core/context/EditorDataProvider';
|
13
|
-
export { default as defaultSetting } from './materials/sxp/defaultSetting';
|
14
13
|
export default Pagebuilder;
|
@@ -38,27 +38,25 @@ declare const _default: ({
|
|
38
38
|
} | {
|
39
39
|
type: string;
|
40
40
|
label: string;
|
41
|
-
child:
|
41
|
+
child: {
|
42
42
|
type: string;
|
43
43
|
name: string[];
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
44
|
+
bottomText: string;
|
45
|
+
}[];
|
46
|
+
options?: undefined;
|
47
|
+
name?: undefined;
|
48
|
+
initialValue?: undefined;
|
49
|
+
} | {
|
50
|
+
type: string;
|
51
|
+
label: string;
|
52
|
+
child: ({
|
48
53
|
type: string;
|
49
|
-
options: {
|
50
|
-
label: string;
|
51
|
-
value: string;
|
52
|
-
}[];
|
53
54
|
name: string[];
|
54
|
-
initialValue: string;
|
55
55
|
addonAfter?: undefined;
|
56
56
|
} | {
|
57
57
|
type: string;
|
58
58
|
addonAfter: string;
|
59
59
|
name: string[];
|
60
|
-
options?: undefined;
|
61
|
-
initialValue?: undefined;
|
62
60
|
})[];
|
63
61
|
options?: undefined;
|
64
62
|
name?: undefined;
|
@@ -105,19 +103,19 @@ declare const _default: ({
|
|
105
103
|
} | {
|
106
104
|
type: string;
|
107
105
|
label: string;
|
108
|
-
child:
|
106
|
+
child: {
|
109
107
|
type: string;
|
110
108
|
name: string[];
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
109
|
+
bottomText: string;
|
110
|
+
}[];
|
111
|
+
name?: undefined;
|
112
|
+
initialValue?: undefined;
|
113
|
+
} | {
|
114
|
+
type: string;
|
115
|
+
label: string;
|
116
|
+
child: ({
|
115
117
|
type: string;
|
116
118
|
name: string[];
|
117
|
-
options: {
|
118
|
-
label: string;
|
119
|
-
value: string;
|
120
|
-
}[];
|
121
119
|
initialValue: string;
|
122
120
|
addonAfter?: undefined;
|
123
121
|
} | {
|
@@ -125,7 +123,6 @@ declare const _default: ({
|
|
125
123
|
name: string[];
|
126
124
|
addonAfter: string;
|
127
125
|
initialValue?: undefined;
|
128
|
-
options?: undefined;
|
129
126
|
})[];
|
130
127
|
name?: undefined;
|
131
128
|
initialValue?: undefined;
|
@@ -1,5 +1,3 @@
|
|
1
|
-
var _a, _b;
|
2
|
-
import { fontOptions } from '../defaultSetting';
|
3
1
|
export default [
|
4
2
|
{
|
5
3
|
title: 'Banner',
|
@@ -68,14 +66,24 @@ export default [
|
|
68
66
|
label: '标题字体',
|
69
67
|
child: [
|
70
68
|
{
|
71
|
-
type: '
|
72
|
-
name: ['
|
69
|
+
type: 'Select',
|
70
|
+
name: ['fontFamily-cn'],
|
71
|
+
bottomText: '中文字体'
|
73
72
|
},
|
74
73
|
{
|
75
74
|
type: 'Select',
|
76
|
-
|
77
|
-
|
78
|
-
|
75
|
+
name: ['fontFamily-en'],
|
76
|
+
bottomText: '英文/其他字体'
|
77
|
+
}
|
78
|
+
]
|
79
|
+
},
|
80
|
+
{
|
81
|
+
type: 'Group',
|
82
|
+
label: '',
|
83
|
+
child: [
|
84
|
+
{
|
85
|
+
type: 'Color',
|
86
|
+
name: ['color']
|
79
87
|
},
|
80
88
|
{
|
81
89
|
type: 'Number',
|
@@ -142,15 +150,25 @@ export default [
|
|
142
150
|
label: '字体',
|
143
151
|
child: [
|
144
152
|
{
|
145
|
-
type: '
|
146
|
-
name: ['props', 'buttonStyle', '
|
147
|
-
|
153
|
+
type: 'Select',
|
154
|
+
name: ['props', 'buttonStyle', 'fontFamily-cn'],
|
155
|
+
bottomText: '中文字体'
|
148
156
|
},
|
149
157
|
{
|
150
158
|
type: 'Select',
|
151
|
-
name: ['props', 'buttonStyle', 'fontFamily'],
|
152
|
-
|
153
|
-
|
159
|
+
name: ['props', 'buttonStyle', 'fontFamily-en'],
|
160
|
+
bottomText: '英文/其他字体'
|
161
|
+
}
|
162
|
+
]
|
163
|
+
},
|
164
|
+
{
|
165
|
+
type: 'Group',
|
166
|
+
label: '',
|
167
|
+
child: [
|
168
|
+
{
|
169
|
+
type: 'Color',
|
170
|
+
name: ['props', 'buttonStyle', 'color'],
|
171
|
+
initialValue: '#fff'
|
154
172
|
},
|
155
173
|
{
|
156
174
|
type: 'Number',
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { IAppointFormProps } from '.';
|
2
|
+
import React from 'react';
|
3
|
+
interface IFormProps {
|
4
|
+
columns?: {
|
5
|
+
title?: string;
|
6
|
+
dataIndex?: string;
|
7
|
+
valueType?: string;
|
8
|
+
key?: string;
|
9
|
+
}[];
|
10
|
+
layout?: IAppointFormProps['layoutType'];
|
11
|
+
onChange?: (data: Record<string, any>) => void;
|
12
|
+
}
|
13
|
+
declare const _default: React.NamedExoticComponent<IFormProps>;
|
14
|
+
export default _default;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { memo } from 'react';
|
2
|
+
import React from 'react';
|
3
|
+
const Form = ({ layout, columns, onChange }) => {
|
4
|
+
return (React.createElement(React.Fragment, null, columns === null || columns === void 0 ? void 0 : columns.map((item, index) => (React.createElement("div", { key: index, className: 'pb-appoint-form-container-item', style: { flexDirection: layout === 'horizontal' ? 'row' : 'column' } },
|
5
|
+
layout !== 'inline' && React.createElement("label", { className: 'pb-appoint-form-container-label' }, item === null || item === void 0 ? void 0 : item.title),
|
6
|
+
(item === null || item === void 0 ? void 0 : item.valueType) === 'text' && (React.createElement("input", { className: 'pb-appoint-form-container-input', type: 'text', placeholder: layout === 'inline' ? item === null || item === void 0 ? void 0 : item.title : '请输入', name: item === null || item === void 0 ? void 0 : item.dataIndex, onChange: onChange })))))));
|
7
|
+
};
|
8
|
+
export default memo(Form);
|