@cloudbase/weda-ui 3.13.0 → 3.13.2
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/configs/components/wd-select-multiple.d.ts +14 -0
- package/dist/configs/components/wd-select-multiple.js +18 -1
- package/dist/configs/components/wd-select.d.ts +9 -4
- package/dist/configs/components/wd-select.js +11 -2
- package/dist/configs/components/wd-store-product.d.ts +1 -1
- package/dist/configs/components/wd-store-product.js +1 -1
- package/dist/configs/components/wd-table.d.ts +2 -0
- package/dist/configs/components/wd-table.js +7 -0
- package/dist/configs/components/wd-upload-image.d.ts +7 -2
- package/dist/configs/components/wd-upload-image.js +40 -6
- package/dist/configs/index.d.ts +60 -14
- package/dist/configs/type-utils/classes.js +1 -1
- package/dist/configs/type-utils/type-form.d.ts +2 -0
- package/dist/configs/type-utils/type-form.js +25 -7
- package/dist/configs/type-utils/x-runtime-default.d.ts +1 -0
- package/dist/configs/type-utils/x-runtime-default.js +1 -0
- package/dist/style/weda-ui.min.css +2 -2
- package/dist/web/components/echart/echart.js +3 -4
- package/dist/web/components/form/uploader/uploader.h5.js +14 -17
- package/dist/web/components/form/uploader/uploader.pc.js +3 -3
- package/dist/web/components/wd-form-item/wd-form-item-read-only.d.ts +1 -0
- package/dist/web/components/wd-form-item/wd-form-item-read-only.js +2 -2
- package/dist/web/components/wd-location/wd-location.css +7 -10
- package/dist/web/components/wd-location/wd-location.js +4 -0
- package/dist/web/components/wd-select/relationSelect/relationSelect.js +12 -4
- package/dist/web/components/wd-select/select/selectUI.js +12 -8
- package/dist/web/components/wd-select/wd-select.css +12 -22
- package/dist/web/components/wd-select/wd-select.js +2 -2
- package/dist/web/components/wd-select-multiple/wd-select-multiple.js +2 -2
- package/dist/web/components/wd-store-home/index.d.ts +3 -3
- package/dist/web/components/wd-store-home/index.js +8 -2
- package/dist/web/components/wd-store-product/index.d.ts +3 -3
- package/dist/web/components/wd-store-product/index.js +8 -2
- package/dist/web/components/wd-table/components/FieldRender/index.d.ts +3 -3
- package/dist/web/components/wd-table/components/FieldRender/index.js +31 -46
- package/dist/web/components/wd-table/hooks/useChooseList.d.ts +2 -1
- package/dist/web/components/wd-table/hooks/useChooseList.js +17 -4
- package/dist/web/components/wd-table/wd-table.js +6 -3
- package/dist/web/utils/moment.js +3 -0
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useRef, forwardRef, useImperativeHandle, useState, useCallback, useEffect
|
|
2
|
+
import { useRef, forwardRef, useImperativeHandle, useState, useCallback, useEffect } from 'react';
|
|
3
3
|
import { useEventListener, useResizeObserver } from '@react-hookz/web';
|
|
4
4
|
import classNames from '../../utils/classnames';
|
|
5
5
|
import { useConfig } from '../../utils/config-context';
|
|
@@ -9,8 +9,7 @@ let Echarts = null;
|
|
|
9
9
|
const getEchartInstance = async () => {
|
|
10
10
|
if (ReactEcharts && Echarts)
|
|
11
11
|
return ReactEcharts;
|
|
12
|
-
const { default: _ } = await import(
|
|
13
|
-
/* webpackChunkName: "echarts-for-react" */ 'echarts-for-react');
|
|
12
|
+
const { default: _ } = await import(/* webpackChunkName: "echarts-for-react" */ 'echarts-for-react');
|
|
14
13
|
Echarts = await import(/* webpackChunkName: "echarts" */ 'echarts');
|
|
15
14
|
ReactEcharts = _;
|
|
16
15
|
};
|
|
@@ -102,5 +101,5 @@ export const Echart = forwardRef(function Echart(props, ref) {
|
|
|
102
101
|
click,
|
|
103
102
|
dblclick,
|
|
104
103
|
};
|
|
105
|
-
return (_jsx("div", { id: id, style: { width: '100%', ...style }, ref: domRef, "data-testid": "wd-chart-test", children: init && (_jsx(ReactEcharts, {
|
|
104
|
+
return (_jsx("div", { id: id, className: classNames(classes, className), style: { width: '100%', ...style }, ref: domRef, "data-testid": "wd-chart-test", children: init && (_jsx(ReactEcharts, { option: props.option || {}, theme: themeState || (props.dark ? 'dark' : 'auto'), opts: props.opts, onChartReady: onChartReadyCallback, onEvents: onEvents })) }));
|
|
106
105
|
});
|
|
@@ -40,9 +40,7 @@ export function ImageUploaderH5(props) {
|
|
|
40
40
|
(_a = events === null || events === void 0 ? void 0 : events.change) === null || _a === void 0 ? void 0 : _a.call(events, { value, isDelete });
|
|
41
41
|
};
|
|
42
42
|
const accepts = React.useMemo(() => {
|
|
43
|
-
return acceptTypes.length === 0
|
|
44
|
-
? IMAGE_TYPES
|
|
45
|
-
: Array.from(new Set(acceptTypes));
|
|
43
|
+
return acceptTypes.length === 0 ? IMAGE_TYPES : Array.from(new Set(acceptTypes));
|
|
46
44
|
}, [acceptTypes]);
|
|
47
45
|
const showAdd = React.useMemo(() => {
|
|
48
46
|
if (single) {
|
|
@@ -92,8 +90,7 @@ export function ImageUploaderH5(props) {
|
|
|
92
90
|
if (typeof ret === 'boolean') {
|
|
93
91
|
shouldUploadToCos = ret;
|
|
94
92
|
}
|
|
95
|
-
else if (Array.isArray(ret) &&
|
|
96
|
-
ret.every((item) => item instanceof File)) {
|
|
93
|
+
else if (Array.isArray(ret) && ret.every((item) => item instanceof File)) {
|
|
97
94
|
files = ret;
|
|
98
95
|
}
|
|
99
96
|
else if (!isNil(ret)) {
|
|
@@ -114,15 +111,15 @@ export function ImageUploaderH5(props) {
|
|
|
114
111
|
const allFile = await upload(files);
|
|
115
112
|
handleChange(allFile);
|
|
116
113
|
};
|
|
117
|
-
return (_jsx("div", { className: cls, id: id, style: style, children: _jsxs("div", { className: classNames('weui-uploader weui-cells weui-cells_form weda-formcells', layout, layoutCls), children: [_jsx("div", { className: classNames('weui-uploader__hd', layout), children: _jsx(UploaderLabel, { layout: layout, label: label, labelVisible: labelVisible, currentCount: tempFile.length, maxCount: finalMaxImgCount, requiredFlag: requiredFlag }) }),
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
114
|
+
return (_jsx("div", { className: cls, id: id, style: style, children: _jsxs("div", { className: classNames('weui-uploader weui-cells weui-cells_form weda-formcells', layout, layoutCls), children: [_jsx("div", { className: classNames('weui-uploader__hd', layout), children: _jsx(UploaderLabel, { layout: layout, label: label, labelVisible: labelVisible, currentCount: tempFile.length, maxCount: finalMaxImgCount, requiredFlag: requiredFlag }) }), _jsx("div", { className: "weui-uploader__bd", children: _jsxs("ul", { className: "weui-uploader__files", id: "uploaderFiles", children: [(_a = (tempFile !== null && tempFile !== void 0 ? tempFile : [])) === null || _a === void 0 ? void 0 : _a.map((f) => (_jsx(SingleImage, { tempFile: f, deleteBySrc: deleteFile, disabled: disabled || readOnly || sourceType === 'album', imgTypeCls: imgTypeCls }, f === null || f === void 0 ? void 0 : f.key))), tempFile.length < 1 && readOnly && _jsx(_Fragment, { children: "-" }), showAdd && !readOnly && (_jsx("li", { className: `weui-uploader__input-box ${imgTypeCls}`, children: !disabled &&
|
|
115
|
+
sourceType !== 'album' &&
|
|
116
|
+
(sourceType === 'camera' ? (_jsx("input", { ref: inputRef, onClick: () => {
|
|
117
|
+
inputRef.current && (inputRef.current.value = '');
|
|
118
|
+
}, "data-testid": "uploaderh5_input", id: "uploaderInput", className: "weui-uploader__input", type: "file", accept: accepts.join(','), multiple: !single && !(browserEnv().android && browserEnv().weixin), capture: true, onChange: uploadChange })) : (_jsx("input", { ref: inputRef, onClick: () => {
|
|
119
|
+
inputRef.current && (inputRef.current.value = '');
|
|
120
|
+
}, "data-testid": "uploaderh5_input", id: "uploaderInput", className: "weui-uploader__input", type: "file", accept: accepts.join(','), multiple: !single && !(browserEnv().android && browserEnv().weixin), onChange: uploadChange }))) }))] }) })] }) }));
|
|
124
121
|
}
|
|
125
|
-
function SingleImage({ deleteBySrc, disabled, imgTypeCls, tempFile
|
|
122
|
+
function SingleImage({ deleteBySrc, disabled, imgTypeCls, tempFile }) {
|
|
126
123
|
const { progress, loading, realUrl, tempUrl } = tempFile;
|
|
127
124
|
const cls = classNames({
|
|
128
125
|
'weui-uploader__file': true,
|
|
@@ -149,11 +146,11 @@ function SingleImage({ deleteBySrc, disabled, imgTypeCls, tempFile, }) {
|
|
|
149
146
|
},
|
|
150
147
|
});
|
|
151
148
|
};
|
|
152
|
-
return (_jsxs("li", { className: `${cls} ${imgTypeCls}`, style: imgStyle, onClick: showGallery, "data-testid": "uploaderh5_imgStyle", children: [error || status ? (_jsx("div", { className: "weui-uploader__file-content", children: error ? (_jsx("i", { role: "img", "aria-label": "\u9519\u8BEF", className: "weui-icon-warn" })) : (_jsx("i", { className: `weui-loading ${imgTypeCls}`, style: { width: 30, height: 30 } })) })) : (false), loading &&
|
|
149
|
+
return (_jsxs("li", { className: `${cls} ${imgTypeCls}`, style: imgStyle, onClick: showGallery, "data-testid": "uploaderh5_imgStyle", children: [error || status ? (_jsx("div", { className: "weui-uploader__file-content", children: error ? (_jsx("i", { role: "img", "aria-label": "\u9519\u8BEF", className: "weui-icon-warn" })) : (_jsx("i", { className: `weui-loading ${imgTypeCls}`, style: { width: 30, height: 30 } })) })) : (false), loading && _jsxs("div", { className: "weui-uploader__file-progress", children: [progress, "%"] })] }));
|
|
153
150
|
}
|
|
154
|
-
const UploaderLabel = ({ layout, label, currentCount, maxCount, requiredFlag, labelVisible
|
|
151
|
+
const UploaderLabel = ({ layout, label, currentCount, maxCount, requiredFlag, labelVisible }) => {
|
|
155
152
|
if (layout === 'horizontal') {
|
|
156
|
-
return (_jsx(React.Fragment, { children: _jsx(_Fragment, { children: labelVisible && (_jsx("div", { className: "weda-formcells__label weui-cell", children: _jsxs("div", { children: [requiredFlag &&
|
|
153
|
+
return (_jsx(React.Fragment, { children: _jsx(_Fragment, { children: labelVisible && (_jsx("div", { className: "weda-formcells__label weui-cell", children: _jsxs("div", { children: [requiredFlag && _jsx("label", { className: "weda-formcells__flag", children: "*" }), _jsx("p", { className: "weui-uploader__title", children: label }), _jsxs("div", { className: "weui-uploader__info", children: [_jsx("span", { id: "uploadCount", children: currentCount }), "/", maxCount] })] }) })) }) }));
|
|
157
154
|
}
|
|
158
|
-
return (_jsx(React.Fragment, { children: _jsx(_Fragment, { children: labelVisible && (_jsxs("div", { className: "weda-formcells__label weui-cell", children: [_jsxs("div", { className: "weui-uploader__label", children: [requiredFlag &&
|
|
155
|
+
return (_jsx(React.Fragment, { children: _jsx(_Fragment, { children: labelVisible && (_jsxs("div", { className: "weda-formcells__label weui-cell", children: [_jsxs("div", { className: "weui-uploader__label", children: [requiredFlag && _jsx("label", { className: "weda-formcells__flag", children: "*" }), _jsx("p", { className: "weui-uploader__title", children: label })] }), _jsxs("div", { className: "weui-uploader__info", children: [_jsx("span", { id: "uploadCount", children: currentCount }), "/", maxCount] })] })) }) }));
|
|
159
156
|
};
|
|
@@ -118,16 +118,16 @@ export function UploaderPCInner(props) {
|
|
|
118
118
|
tips && (extraProps['title'] = tips);
|
|
119
119
|
maxSize && (extraProps['maxSize'] = maxSize * 1024 * 1024);
|
|
120
120
|
const hasActions = !uploading && !readOnly && !(disabled || sourceType === 'camera');
|
|
121
|
-
return (_jsx(ConfigProvider, { classPrefix: "wedatea2td", children: _jsxs("div", { className: "_weda-fn-upload-result", children: [tempFile === null || tempFile === void 0 ? void 0 : tempFile.map((d, index) => (_jsx("div", { className: `_weda-fn-upload-result__item ${imgTypeCls}`, children: _jsx(TcbImage, { index: index, allFile: tempFile, tempFile: d, imgTypeCls: imgTypeCls, isZoom: true, previewIcon: "td:browse", portalContainer: portalContainer, actions: hasActions && (_jsx(WdIcon, { className: `${CLASS_PREFIX}__image-actions-delete`, name: "td:delete", onClick: () => deleteHandle(d), size: "sm" })) }) }, d.key))), _jsxs("div", { className: `${CLASS_PREFIX}__input-box`, children: [readOnly && tempFile.length < 1 && _jsx("div", { children: "-" }), sourceType === 'camera' || (disabled && !readOnly) ? (_jsx("
|
|
121
|
+
return (_jsx(ConfigProvider, { classPrefix: "wedatea2td", children: _jsxs("div", { className: "_weda-fn-upload-result", children: [tempFile === null || tempFile === void 0 ? void 0 : tempFile.map((d, index) => (_jsx("div", { className: `_weda-fn-upload-result__item ${imgTypeCls}`, children: _jsx(TcbImage, { index: index, allFile: tempFile, tempFile: d, imgTypeCls: imgTypeCls, isZoom: true, previewIcon: "td:browse", portalContainer: portalContainer, actions: hasActions && (_jsx(WdIcon, { className: `${CLASS_PREFIX}__image-actions-delete`, name: "td:delete", onClick: () => deleteHandle(d), size: "sm" })) }) }, d.key))), _jsxs("div", { className: `${CLASS_PREFIX}__input-box`, children: [readOnly && tempFile.length < 1 && _jsx("div", { children: "-" }), sourceType === 'camera' || (disabled && !readOnly) ? (_jsx("div", { className: `_weda-fn-upload-result__item wedatea2td-disabled weda-uploader-btn__box ${imgTypeCls}`, children: _jsxs("div", { className: "_weda-fn-upload-result__status", children: [_jsx("i", { className: "wedatea2td-icon wedatea2td-icon-plus", role: "img", "aria-label": "plus" }), _jsx("span", { className: "wedatea2td-mt-1n wedatea2td-text-label wedatea2td-fz-reset", children: btnTitle })] }) })) : (((!single && tempFile.length < maxUploadCount) || (single && tempFile.length < 1 && !uploading)) &&
|
|
122
122
|
!readOnly && (
|
|
123
123
|
// single 模式时,当数组为空且不在上传文件过程中时显示
|
|
124
|
-
_jsx(Upload, { ...extraProps, beforeUpload: beforeHandle, children: _jsxs("
|
|
124
|
+
_jsx(Upload, { ...extraProps, beforeUpload: beforeHandle, children: _jsxs("div", {
|
|
125
125
|
// className={"_weda-fn-upload-result__item _weda-fn-upload-result__item--upload" imgTypeCls}
|
|
126
126
|
// className={classNames(
|
|
127
127
|
// `_weda-fn-upload-result__item _weda-fn-upload-result__item--upload`,
|
|
128
128
|
// imgTypeCls
|
|
129
129
|
// )}
|
|
130
|
-
className: `_weda-fn-upload-result__item _weda-fn-upload-result__item--upload ${imgTypeCls}`, children: [imgTypeCls, _jsxs("div", { className: "_weda-fn-upload-result__status", children: [_jsx("i", { className: "wedatea2td-icon wedatea2td-icon-plus", role: "img", "aria-label": "plus" }), _jsx("span", { className: "wedatea2td-mt-1n wedatea2td-text-label wedatea2td-fz-reset", children: btnTitle })] })] }) })))] })] }) }));
|
|
130
|
+
className: `_weda-fn-upload-result__item weda-uploader-btn__box _weda-fn-upload-result__item--upload ${imgTypeCls}`, children: [imgTypeCls, _jsxs("div", { className: "_weda-fn-upload-result__status", children: [_jsx("i", { className: "wedatea2td-icon wedatea2td-icon-plus", role: "img", "aria-label": "plus" }), _jsx("span", { className: "wedatea2td-mt-1n wedatea2td-text-label wedatea2td-fz-reset", children: btnTitle })] })] }) })))] })] }) }));
|
|
131
131
|
}
|
|
132
132
|
export const TcbImage = (props) => {
|
|
133
133
|
const { fileID, tempFile = { progress: 100, loading: false, realUrl: null, tempUrl: null }, isZoom, imgTypeCls, previewIcon, actions, allFile = [], index, portalContainer, ...rest } = props;
|
|
@@ -10,7 +10,7 @@ import { isFormatWithRelation } from '../form/select/formats-util';
|
|
|
10
10
|
*/
|
|
11
11
|
export function WdFormItemReadOnly(props) {
|
|
12
12
|
const ctx = useRecycle();
|
|
13
|
-
const { readValue, readOnly, version, readBeforeAfter, before, after, format, onRelationTagClick = undefined, value, } = Object.assign({}, ctx, props);
|
|
13
|
+
const { readValue, readOnly, version, readBeforeAfter, before, after, format, enableRelationTag, onRelationTagClick = undefined, value, } = Object.assign({}, ctx, props);
|
|
14
14
|
const platform = usePlatform();
|
|
15
15
|
const { classPrefix } = useConfig();
|
|
16
16
|
const item = `${classPrefix}-form-item`;
|
|
@@ -20,7 +20,7 @@ export function WdFormItemReadOnly(props) {
|
|
|
20
20
|
const _after = useMemo(() => readBeforeAfter && textToString(after), [after, readBeforeAfter]);
|
|
21
21
|
const isRelation = isFormatWithRelation(format);
|
|
22
22
|
const isXEnum = 'x-enum' === format;
|
|
23
|
-
return readOnly && version === 'wd' ? (_jsxs("div", { className: cls, children: [_before && _jsx("span", { className: `${item}__readonly-before`, children: _before }), _jsx("span", { className: `${item}__readonly-value`, children: isRelation && _readValue ? (_jsx(WdTag, { range: _readValue === null || _readValue === void 0 ? void 0 : _readValue.split(',').map((i, index) => ({
|
|
23
|
+
return readOnly && version === 'wd' ? (_jsxs("div", { className: cls, children: [_before && _jsx("span", { className: `${item}__readonly-before`, children: _before }), _jsx("span", { className: `${item}__readonly-value`, children: enableRelationTag && isRelation && _readValue ? (_jsx(WdTag, { range: _readValue === null || _readValue === void 0 ? void 0 : _readValue.split(',').map((i, index) => ({
|
|
24
24
|
label: i,
|
|
25
25
|
value: Array.isArray(value) ? value[index] : value,
|
|
26
26
|
prefixType: !isXEnum && 'inner',
|
|
@@ -23,9 +23,7 @@
|
|
|
23
23
|
width: 100% !important;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
.wd-form-item.wd-pc-location-root
|
|
27
|
-
._weda-fn-map
|
|
28
|
-
.weda-fn-map__local_loc_btn_left {
|
|
26
|
+
.wd-form-item.wd-pc-location-root ._weda-fn-map .weda-fn-map__local_loc_btn_left {
|
|
29
27
|
margin: 0;
|
|
30
28
|
line-height: 1;
|
|
31
29
|
}
|
|
@@ -36,15 +34,10 @@
|
|
|
36
34
|
margin-top: 0;
|
|
37
35
|
}
|
|
38
36
|
|
|
39
|
-
.wd-form-item.wd-pc-location-root
|
|
40
|
-
._weda-fn-map
|
|
41
|
-
.wedatea2td-justify-grid__col--right {
|
|
37
|
+
.wd-form-item.wd-pc-location-root ._weda-fn-map .wedatea2td-justify-grid__col--right {
|
|
42
38
|
position: unset;
|
|
43
39
|
}
|
|
44
|
-
.wd-form-item.wd-pc-location-root
|
|
45
|
-
._weda-fn-map
|
|
46
|
-
.wedatea2td-justify-grid__col--right
|
|
47
|
-
input {
|
|
40
|
+
.wd-form-item.wd-pc-location-root ._weda-fn-map .wedatea2td-justify-grid__col--right input {
|
|
48
41
|
width: 75px;
|
|
49
42
|
}
|
|
50
43
|
|
|
@@ -55,3 +48,7 @@
|
|
|
55
48
|
.form-location-con__text.wd-btn--link:hover:not(.is-disabled) {
|
|
56
49
|
text-decoration: none;
|
|
57
50
|
}
|
|
51
|
+
|
|
52
|
+
.wd-form-item.showMap .wd-form-input-wrap.size-height-md {
|
|
53
|
+
height: auto;
|
|
54
|
+
}
|
|
@@ -3,6 +3,7 @@ import { forwardRef, useCallback, useMemo, useState } from 'react';
|
|
|
3
3
|
import { useHandleClear } from '../../utils/hooks/useFormLegacy';
|
|
4
4
|
import { useFormInputTrait } from '../../components/form-input-hooks';
|
|
5
5
|
import { WdFormItem, WdInputGroup, WdInputWrap } from '../wd-form-item';
|
|
6
|
+
import classNames from '../../utils/classnames';
|
|
6
7
|
import Location from '../form/location';
|
|
7
8
|
import { emptyObject } from '../../utils/constant';
|
|
8
9
|
import { X_RUNTIME_DEFAULT } from '../../../configs/type-utils/x-runtime-default';
|
|
@@ -39,6 +40,9 @@ export const WdLocation = forwardRef(function WdLocation(props, ref) {
|
|
|
39
40
|
readValue,
|
|
40
41
|
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
41
42
|
readOnly: locationType === 2 ? readOnly && isInit : readOnly,
|
|
43
|
+
className: classNames(props.className, {
|
|
44
|
+
showMap: showMap,
|
|
45
|
+
}),
|
|
42
46
|
};
|
|
43
47
|
const inputGroupProps = { ...props, classRoot };
|
|
44
48
|
const inputWrapProps = { ...props, classRoot, disabled, ...clearProps };
|
|
@@ -39,9 +39,12 @@ const OptionText = ({ mode, option, selectFields, authFields, onChange, onRelati
|
|
|
39
39
|
if (platform === 'pc' && mode !== 'multiple') {
|
|
40
40
|
e.stopPropagation();
|
|
41
41
|
e.preventDefault();
|
|
42
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(option === null || option === void 0 ? void 0 : option.value
|
|
42
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(option === null || option === void 0 ? void 0 : option.value, {
|
|
43
|
+
event: e,
|
|
44
|
+
option,
|
|
45
|
+
});
|
|
43
46
|
}
|
|
44
|
-
}, children: [_jsxs("div", { className: "wd-relation-select-header", children: [_jsx("p", { className: "wd-relation-select-header-text", children: (option === null || option === void 0 ? void 0 : option.label) || (option === null || option === void 0 ? void 0 : option.value) }), enableRelationOptionJump && (_jsx("span", { onClick: () => {
|
|
47
|
+
}, children: [_jsxs("div", { className: "wd-relation-select-header", children: [_jsx("p", { className: "wd-relation-select-header-text", title: (option === null || option === void 0 ? void 0 : option.label) || (option === null || option === void 0 ? void 0 : option.value), children: (option === null || option === void 0 ? void 0 : option.label) || (option === null || option === void 0 ? void 0 : option.value) }), enableRelationOptionJump && (_jsx("span", { onClick: () => {
|
|
45
48
|
onRelationOptionJump({ item: option });
|
|
46
49
|
}, children: _jsx(WdIcon, { name: "td:jump", size: "s", type: "inner" }) }))] }), _jsxs("div", { className: "wd-relation-select-option-group", children: [_jsx("div", { className: "wd-relation-select-option-header", children: columns.map((i) => (_jsx("div", { className: "wd-relation-select-option-text", style: { width: columns.length > 1 ? i.width : 'auto' }, children: i.header }, i.key))) }), _jsx("div", { className: "wd-relation-select-option-content", children: columns.map((i) => (_jsx("div", { className: "wd-relation-select-option-text", style: { width: columns.length > 1 ? i.width : 'auto' }, children: i.render(option === null || option === void 0 ? void 0 : option.extra) }, i.key))) })] })] }));
|
|
47
50
|
};
|
|
@@ -77,13 +80,15 @@ export function RelationSelect(props) {
|
|
|
77
80
|
pageSize: defaultSize,
|
|
78
81
|
where: whereList,
|
|
79
82
|
}, isObjectEqual);
|
|
80
|
-
const { result: options, total, isValidating
|
|
83
|
+
const { result: options, total, isValidating, empty, getRelationOptions, } = useChooseList({
|
|
81
84
|
dataSourceAPI,
|
|
82
85
|
childDbName: dataSourceName,
|
|
83
86
|
queryParams: query,
|
|
84
87
|
primaryColumn: primaryField,
|
|
85
88
|
value,
|
|
89
|
+
isInsertSelectedValue: true,
|
|
86
90
|
});
|
|
91
|
+
const [isLoading, setIsLoading] = useSyncValue(isValidating, isObjectEqual);
|
|
87
92
|
// 下拉选项数据
|
|
88
93
|
const customOptions = useMemo(() => {
|
|
89
94
|
return isRelationSelectOption
|
|
@@ -125,6 +130,8 @@ export function RelationSelect(props) {
|
|
|
125
130
|
};
|
|
126
131
|
}, [getRelationOptions, query.pageNo, searchOptionListWithWhere, setRefreshStatus]);
|
|
127
132
|
const searchHandle = (keyword) => {
|
|
133
|
+
empty();
|
|
134
|
+
setIsLoading(true);
|
|
128
135
|
let where = whereList;
|
|
129
136
|
if (keyword === null || keyword === void 0 ? void 0 : keyword.length) {
|
|
130
137
|
// 筛选面板的查询条件与数据过滤的查询条件是且的关系
|
|
@@ -135,7 +142,7 @@ export function RelationSelect(props) {
|
|
|
135
142
|
searchOptionListWithWhere(where);
|
|
136
143
|
onSearch(keyword);
|
|
137
144
|
};
|
|
138
|
-
return (_jsx(EnumHoc, { fields: authFields, children: _jsx(Select, { ...props, overlayClassName: isRelationSelectOption ? 'wd-relation-select-overlay' : '', searchable: true, listWidth: listWidth, listHeight: _listHeight, matchButtonWidth: _matchButtonWidth, placeholder: placeholder, appearance: 'button', filter: () => true, size: size, disabled: disabled, autoClearSearchValue: true, options: customOptions, value: value, onChange: onChange, onSearch: searchHandle,
|
|
145
|
+
return (_jsx(EnumHoc, { fields: authFields, children: _jsx(Select, { ...props, overlayClassName: isRelationSelectOption ? 'wd-relation-select-overlay' : '', searchable: true, listWidth: listWidth, listHeight: _listHeight, matchButtonWidth: _matchButtonWidth, placeholder: placeholder, appearance: 'button', filter: () => true, size: size, disabled: disabled, autoClearSearchValue: true, options: customOptions, value: value, onChange: onChange, onSearch: searchHandle, bottomTips: isLoading ? _jsx(LoadingTip, {}) : undefined, onScrollBottom: () => {
|
|
139
146
|
if (!isLoading && customOptions.length < total) {
|
|
140
147
|
setQuery((query) => ({
|
|
141
148
|
...query,
|
|
@@ -143,6 +150,7 @@ export function RelationSelect(props) {
|
|
|
143
150
|
}));
|
|
144
151
|
}
|
|
145
152
|
}, onOpen: () => {
|
|
153
|
+
setIsLoading(true);
|
|
146
154
|
searchOptionListWithWhere();
|
|
147
155
|
}, footer: addRelationButton, mode: mode }) }));
|
|
148
156
|
}
|
|
@@ -9,6 +9,7 @@ import { usePlatform, textToString } from '../../../utils/platform';
|
|
|
9
9
|
import { useSyncValue } from '../../../utils/hooks/useSyncValue';
|
|
10
10
|
import isObjectEqual from '../../../utils/isObjectEqual';
|
|
11
11
|
import AllEmpty from '../../form/select/status/allEmpty';
|
|
12
|
+
import { X_RUNTIME_DEFAULT } from '../../../../configs/type-utils/x-runtime-default';
|
|
12
13
|
import '../style';
|
|
13
14
|
const OptionList = ({ options, inputFocus, currentSelected, optionClick, bottomTips, onScrollBottom }) => {
|
|
14
15
|
return (_jsxs(List, { className: "weda-ui-custom-picker__cloumn", style: {
|
|
@@ -20,7 +21,7 @@ const OptionList = ({ options, inputFocus, currentSelected, optionClick, bottomT
|
|
|
20
21
|
'is-selected': currentSelected.find((i) => i.value === item.value),
|
|
21
22
|
'is-disabled': item.disabled,
|
|
22
23
|
});
|
|
23
|
-
return (_jsx(List.Item, { className: itemCls, onClick: () => optionClick(item), children: _jsx("p", { className: 'weda-ui-custom-picker__cloumn-item-text', children: item.text || item.label }) }, index));
|
|
24
|
+
return (_jsx(List.Item, { className: itemCls, onClick: (e) => optionClick(item, e), children: _jsx("p", { className: 'weda-ui-custom-picker__cloumn-item-text', children: item.text || item.label }) }, index));
|
|
24
25
|
}), bottomTips && (_jsx(List.Item, { children: _jsx("div", { className: "weda-ui-custom-picker__status weda-ui-custom-picker__status--empty", children: bottomTips }) }))] }));
|
|
25
26
|
};
|
|
26
27
|
const getSelectedItem = (options = [], value) => {
|
|
@@ -93,7 +94,7 @@ function SelectH5(props) {
|
|
|
93
94
|
};
|
|
94
95
|
const handleOk = () => {
|
|
95
96
|
const selectedVal = currentSelected === null || currentSelected === void 0 ? void 0 : currentSelected.map((i) => i.value);
|
|
96
|
-
onChange(isMultiple ? selectedVal : selectedVal[0]);
|
|
97
|
+
onChange(isMultiple ? selectedVal : selectedVal[0], { options: currentSelected });
|
|
97
98
|
setVisible(false);
|
|
98
99
|
};
|
|
99
100
|
// 处理当前选中值
|
|
@@ -109,13 +110,13 @@ function SelectH5(props) {
|
|
|
109
110
|
}
|
|
110
111
|
return [...currentSelected, item];
|
|
111
112
|
};
|
|
112
|
-
const optionClick = (item) => {
|
|
113
|
+
const optionClick = (item, e) => {
|
|
113
114
|
if (item.disabled)
|
|
114
115
|
return;
|
|
115
116
|
setInputFocus(false);
|
|
116
117
|
if (!isMultiple) {
|
|
117
118
|
// 单选直接关弹窗
|
|
118
|
-
onChange(item.value);
|
|
119
|
+
onChange(item.value, { event: e, option: item });
|
|
119
120
|
setCurrentSelected([item]);
|
|
120
121
|
setVisible(false);
|
|
121
122
|
}
|
|
@@ -137,7 +138,7 @@ function SelectH5(props) {
|
|
|
137
138
|
}, children: _jsx(OptionList, { onScrollBottom: onScrollBottom, options: customOptions, inputFocus: inputFocus, currentSelected: currentSelected, optionClick: optionClick, bottomTips: bottomTips }) }), footer] })) })] })] }));
|
|
138
139
|
}
|
|
139
140
|
export function SelectUI(props) {
|
|
140
|
-
const { placeholder, size, disabled, onChange, onSearch, searchable, options = [], value, footer, overlayClassName, onOpen, onScrollBottom, tips, bottomTips, mode, format, readOnly, setAllOption, listHeight, listWidth, popupContainer, searchPlaceholder = '搜索选项', matchButtonWidth = true, ...restProps } = props;
|
|
141
|
+
const { placeholder, size, disabled, onChange, onSearch, searchable, options = [], value, footer, overlayClassName, onOpen, onScrollBottom, tips, bottomTips, mode, format, readOnly, setAllOption, listHeight, listWidth, popupContainer, searchPlaceholder = '搜索选项', matchButtonWidth = true, enableRelationTag = X_RUNTIME_DEFAULT.enableRelationTag, ...restProps } = props;
|
|
141
142
|
const platform = usePlatform();
|
|
142
143
|
const [currentOption] = useSyncValue((options === null || options === void 0 ? void 0 : options.map(({ label, value }) => ({ label, value }))) || [], isObjectEqual);
|
|
143
144
|
// 更新option,从而更新最新的选项值
|
|
@@ -156,7 +157,7 @@ export function SelectUI(props) {
|
|
|
156
157
|
.join(',');
|
|
157
158
|
}
|
|
158
159
|
else {
|
|
159
|
-
return textToString((_a = selectedItem[0]) === null || _a === void 0 ? void 0 : _a.label) || textToString((_b = selectedItem[0]) === null || _b === void 0 ? void 0 : _b.value) ||
|
|
160
|
+
return textToString((_a = selectedItem[0]) === null || _a === void 0 ? void 0 : _a.label) || textToString((_b = selectedItem[0]) === null || _b === void 0 ? void 0 : _b.value) || value;
|
|
160
161
|
}
|
|
161
162
|
}, [isMultiple, options, value]);
|
|
162
163
|
const render = () => {
|
|
@@ -169,7 +170,10 @@ export function SelectUI(props) {
|
|
|
169
170
|
return _jsx("div", { className: "wedatea2td-text-weak", children: placeholder });
|
|
170
171
|
}
|
|
171
172
|
return selectedItem.map((i) => (i === null || i === void 0 ? void 0 : i.label) || i.value).join(',');
|
|
172
|
-
}, staging: false, overlayClassName: `${overlayClassName} multiple`, searchable: searchable, matchButtonWidth: matchButtonWidth, placeholder: placeholder, searchPlaceholder: searchPlaceholder, appearance: 'button', size: size, disabled: disabled, autoClearSearchValue: true, options: options === null || options === void 0 ? void 0 : options.map((i) => ({ ...i, text: i.text || i.label })), value: Array.isArray(value) ? value : [], onChange:
|
|
173
|
+
}, staging: false, overlayClassName: `${overlayClassName} multiple`, searchable: searchable, matchButtonWidth: matchButtonWidth, placeholder: placeholder, searchPlaceholder: searchPlaceholder, appearance: 'button', size: size, disabled: disabled, autoClearSearchValue: true, options: options === null || options === void 0 ? void 0 : options.map((i) => ({ ...i, text: i.text || i.label })), value: Array.isArray(value) ? value : [], onChange: (v, context) => {
|
|
174
|
+
const _options = v === null || v === void 0 ? void 0 : v.map((item) => options === null || options === void 0 ? void 0 : options.find((i) => i.value === item));
|
|
175
|
+
onChange(v, { ...context, options: _options });
|
|
176
|
+
}, onSearch: onSearch, footer: footer, onOpen: onOpen, onScrollBottom: onScrollBottom, bottomTips: bottomTips, tips: tips, listHeight: listHeight, listWidth: listWidth }));
|
|
173
177
|
}
|
|
174
178
|
else {
|
|
175
179
|
return (_jsx(Select, { ...restProps, popupContainer: popupContainer, button: (selectedItem) => {
|
|
@@ -180,5 +184,5 @@ export function SelectUI(props) {
|
|
|
180
184
|
}, overlayClassName: overlayClassName, searchable: searchable, matchButtonWidth: matchButtonWidth, placeholder: placeholder, searchPlaceholder: searchPlaceholder, appearance: 'button', size: size, disabled: disabled, autoClearSearchValue: true, options: options === null || options === void 0 ? void 0 : options.map((i) => ({ ...i, text: i.text || i.label })), value: value, onChange: onChange, onSearch: onSearch, footer: footer, onOpen: onOpen, onScrollBottom: onScrollBottom, bottomTips: bottomTips, tips: tips, listHeight: listHeight, listWidth: listWidth }));
|
|
181
185
|
}
|
|
182
186
|
};
|
|
183
|
-
return (_jsx(WdFormItemReadOnly, { after: props.after, before: props.before, onRelationTagClick: props.onRelationTagClick, readBeforeAfter: true, readOnly: readOnly, readValue: readValue, format: format, value: value, version: 'wd', children: _jsx("div", { "data-testid": isMultiple ? 'form-item-select-multiple-pc' : 'form-select', className: isMultiple ? 'form-select-multiple-pc' : 'form-select-pc', children: render() }) }));
|
|
187
|
+
return (_jsx(WdFormItemReadOnly, { after: props.after, before: props.before, onRelationTagClick: props.onRelationTagClick, readBeforeAfter: true, readOnly: readOnly, readValue: readValue, format: format, value: value, version: 'wd', enableRelationTag: enableRelationTag, children: _jsx("div", { "data-testid": isMultiple ? 'form-item-select-multiple-pc' : 'form-select', className: isMultiple ? 'form-select-multiple-pc' : 'form-select-pc', children: render() }) }));
|
|
184
188
|
}
|
|
@@ -41,8 +41,7 @@
|
|
|
41
41
|
padding-right: 0;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
.wd-form-item.wd-pc-select-root
|
|
45
|
-
.wedatea2td-dropdown-btn.wedatea2td-dropdown__header {
|
|
44
|
+
.wd-form-item.wd-pc-select-root .wedatea2td-dropdown-btn.wedatea2td-dropdown__header {
|
|
46
45
|
border: none;
|
|
47
46
|
padding: 0;
|
|
48
47
|
display: flex;
|
|
@@ -58,16 +57,13 @@
|
|
|
58
57
|
color: var(--wd-color-text-placeholder) !important;
|
|
59
58
|
}
|
|
60
59
|
|
|
61
|
-
.wd-form--vertical-left
|
|
62
|
-
.wd-h5-select-root
|
|
63
|
-
.wd-form-select-relational-setting--wrap {
|
|
60
|
+
.wd-form--vertical-left .wd-h5-select-root .wd-form-select-relational-setting--wrap {
|
|
64
61
|
top: 16px;
|
|
65
62
|
}
|
|
66
63
|
.wd-form-select-relational-setting--wrap {
|
|
67
64
|
display: flex;
|
|
68
65
|
}
|
|
69
|
-
.wd-form.wd-pc-form
|
|
70
|
-
.wd-form-input-group.wd-form-select-relational-setting--group,
|
|
66
|
+
.wd-form.wd-pc-form .wd-form-input-group.wd-form-select-relational-setting--group,
|
|
71
67
|
.wd-form-input-group.wd-form-select-relational-setting--group {
|
|
72
68
|
width: auto;
|
|
73
69
|
}
|
|
@@ -80,9 +76,7 @@
|
|
|
80
76
|
.wd-form-select-relational-setting--group .wd-link {
|
|
81
77
|
display: flex;
|
|
82
78
|
}
|
|
83
|
-
.wd-select-select
|
|
84
|
-
.wd-form-input-wrap__content
|
|
85
|
-
> .weda-ui-custom-picker__status {
|
|
79
|
+
.wd-select-select .wd-form-input-wrap__content > .weda-ui-custom-picker__status {
|
|
86
80
|
padding-left: 5px;
|
|
87
81
|
}
|
|
88
82
|
|
|
@@ -125,6 +119,10 @@
|
|
|
125
119
|
}
|
|
126
120
|
.wd-relation-select-header-text {
|
|
127
121
|
font-size: 16px;
|
|
122
|
+
overflow: hidden;
|
|
123
|
+
text-overflow: ellipsis;
|
|
124
|
+
white-space: nowrap;
|
|
125
|
+
max-width: 300px;
|
|
128
126
|
}
|
|
129
127
|
.wd-relation-select-header .wd-icon {
|
|
130
128
|
color: var(--wd-color-brand, #0052d9);
|
|
@@ -159,18 +157,12 @@
|
|
|
159
157
|
display: block;
|
|
160
158
|
white-space: nowrap;
|
|
161
159
|
}
|
|
162
|
-
.wd-relation-select-overlay
|
|
163
|
-
.wedatea2td-dropdown-box
|
|
164
|
-
.wedatea2td-list--option
|
|
165
|
-
> li {
|
|
160
|
+
.wd-relation-select-overlay .wedatea2td-dropdown-box .wedatea2td-list--option > li {
|
|
166
161
|
width: auto !important;
|
|
167
162
|
min-width: 100%;
|
|
168
163
|
padding: 0;
|
|
169
164
|
}
|
|
170
|
-
.wd-relation-select-overlay
|
|
171
|
-
.wedatea2td-dropdown-box
|
|
172
|
-
.wedatea2td-list--option
|
|
173
|
-
.wedatea2td-list__status {
|
|
165
|
+
.wd-relation-select-overlay .wedatea2td-dropdown-box .wedatea2td-list--option .wedatea2td-list__status {
|
|
174
166
|
padding: 6px 8px;
|
|
175
167
|
}
|
|
176
168
|
/* h5端关联下拉样式 */
|
|
@@ -184,13 +176,11 @@
|
|
|
184
176
|
.weda-ui-custom-picker__cloumns.wd-relation-select-overlay {
|
|
185
177
|
overflow: auto;
|
|
186
178
|
}
|
|
187
|
-
.weda-ui-custom-picker__cloumns.wd-relation-select-overlay
|
|
188
|
-
.weda-ui-custom-picker__cloumn {
|
|
179
|
+
.weda-ui-custom-picker__cloumns.wd-relation-select-overlay .weda-ui-custom-picker__cloumn {
|
|
189
180
|
width: auto;
|
|
190
181
|
min-width: 100%;
|
|
191
182
|
}
|
|
192
|
-
.weda-ui-custom-picker__cloumns.wd-relation-select-overlay
|
|
193
|
-
.weda-ui-custom-picker__cloumn-item.is-selected {
|
|
183
|
+
.weda-ui-custom-picker__cloumns.wd-relation-select-overlay .weda-ui-custom-picker__cloumn-item.is-selected {
|
|
194
184
|
background-color: var(--wd-color-brand-light, #ecf2fe);
|
|
195
185
|
border-radius: 3px;
|
|
196
186
|
}
|
|
@@ -40,10 +40,10 @@ export const WdSelect = forwardRef(function WsSelect(props, ref) {
|
|
|
40
40
|
onChange === null || onChange === void 0 ? void 0 : onChange(v);
|
|
41
41
|
(_a = delayEvents === null || delayEvents === void 0 ? void 0 : delayEvents.change) === null || _a === void 0 ? void 0 : _a.call(delayEvents, { value: v });
|
|
42
42
|
}, [onChange, delayEvents]);
|
|
43
|
-
const handleChange = (v) => {
|
|
43
|
+
const handleChange = (v, context) => {
|
|
44
44
|
var _a;
|
|
45
45
|
onChange === null || onChange === void 0 ? void 0 : onChange(v);
|
|
46
|
-
(_a = delayEvents === null || delayEvents === void 0 ? void 0 : delayEvents.change) === null || _a === void 0 ? void 0 : _a.call(delayEvents, { value: v });
|
|
46
|
+
(_a = delayEvents === null || delayEvents === void 0 ? void 0 : delayEvents.change) === null || _a === void 0 ? void 0 : _a.call(delayEvents, { value: v, context });
|
|
47
47
|
};
|
|
48
48
|
const clearProps = useHandleClear({
|
|
49
49
|
onChange: onClearChange,
|
|
@@ -48,10 +48,10 @@ export const WdSelectMultiple = forwardRef(function WdSelectMultiple(props, ref)
|
|
|
48
48
|
disabled,
|
|
49
49
|
value,
|
|
50
50
|
});
|
|
51
|
-
const handleChange = (v) => {
|
|
51
|
+
const handleChange = (v, context) => {
|
|
52
52
|
var _a;
|
|
53
53
|
onChange === null || onChange === void 0 ? void 0 : onChange(v);
|
|
54
|
-
(_a = delayEvents === null || delayEvents === void 0 ? void 0 : delayEvents.change) === null || _a === void 0 ? void 0 : _a.call(delayEvents, { value: v });
|
|
54
|
+
(_a = delayEvents === null || delayEvents === void 0 ? void 0 : delayEvents.change) === null || _a === void 0 ? void 0 : _a.call(delayEvents, { value: v, context });
|
|
55
55
|
};
|
|
56
56
|
const isRelation = isFormatWithRelation(format);
|
|
57
57
|
const LabelAdornment = isRelation && (_jsx(RelationalSetting, { size: props.size, refresh: () => {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { CommonPropsType } from '../../types';
|
|
3
3
|
import type { DataType } from '../../../configs/components/wd-store-home';
|
|
4
4
|
import './style';
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
export interface WdStoreHomeProps extends CommonPropsType, DataType {
|
|
5
|
+
export default function WdStoreHome({ className, id }: WdStoreHomeProps): JSX.Element;
|
|
6
|
+
interface WdStoreHomeProps extends CommonPropsType, DataType {
|
|
8
7
|
}
|
|
8
|
+
export { type WdStoreHomeProps };
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { ConfigProvider, Bubble } from 'tea-component';
|
|
3
|
+
import { useCanPreview } from '../../utils/hooks/useCanPreview';
|
|
4
|
+
import { useConfig } from '../../utils/config-context';
|
|
3
5
|
import './style';
|
|
4
|
-
export default function WdStoreHome() {
|
|
5
|
-
|
|
6
|
+
export default function WdStoreHome({ className, id }) {
|
|
7
|
+
const { classPrefix } = useConfig();
|
|
8
|
+
const canPreview = useCanPreview();
|
|
9
|
+
if (!canPreview)
|
|
10
|
+
return null;
|
|
11
|
+
return (_jsx(ConfigProvider, { classPrefix: "wedatea2td", children: _jsx(Bubble, { placement: "auto", openDelay: 300, content: _jsxs(_Fragment, { children: ["\u8BE5\u7EC4\u4EF6\u5FC5\u987B\u5728\u5C0F\u7A0B\u5E8F\u771F\u5B9E\u73AF\u5883\u4F7F\u7528\u624D\u80FD\u591F\u770B\u5230\u5B9E\u9645\u6548\u679C\u3002", _jsx("br", {}), _jsx("a", { href: "https://developers.weixin.qq.com/miniprogram/dev/component/store-home.html", target: "_blank", rel: "noreferrer", children: "\u67E5\u770B\u8BF4\u660E" })] }), children: _jsxs("div", { className: `${className} ${classPrefix}-store-home__wrap`, id: id, children: [_jsxs("div", { className: `${classPrefix}-store-home__content`, children: [_jsx("img", { className: `${classPrefix}-store-home__img`, src: "https://qcloudimg.tencent-cloud.cn/raw/4a29d51b504f12b4933ce4490110b4dc.svg", alt: "" }), _jsxs("div", { children: [_jsx("p", { className: `${classPrefix}-store-home__title`, children: "\u5C0F\u5E97\u540D\u79F0" }), _jsx("p", { className: `${classPrefix}-store-home__label`, children: "\u5C0F\u5E97\u7B80\u4ECB" })] })] }), _jsxs("div", { className: `${classPrefix}-store-home__footer`, children: [_jsx("i", { className: `${classPrefix}-store-home__icon` }), "\u5C0F\u5E97\u540D\u79F0"] })] }) }) }));
|
|
6
12
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { CommonPropsType } from '../../types';
|
|
3
3
|
import type { DataType } from '../../../configs/components/wd-store-product';
|
|
4
4
|
import './style';
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
export interface WdStoreProductProps extends CommonPropsType, DataType {
|
|
5
|
+
export default function WdStoreProduct({ className, id }: WdStoreProductProps): JSX.Element;
|
|
6
|
+
interface WdStoreProductProps extends CommonPropsType, DataType {
|
|
8
7
|
}
|
|
8
|
+
export { type WdStoreProductProps };
|
|
@@ -2,6 +2,12 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { ConfigProvider, Bubble } from 'tea-component';
|
|
3
3
|
import './style';
|
|
4
4
|
import WdButton from '../wd-button';
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { useCanPreview } from '../../utils/hooks/useCanPreview';
|
|
6
|
+
import { useConfig } from '../../utils/config-context';
|
|
7
|
+
export default function WdStoreProduct({ className, id }) {
|
|
8
|
+
const { classPrefix } = useConfig();
|
|
9
|
+
const canPreview = useCanPreview();
|
|
10
|
+
if (!canPreview)
|
|
11
|
+
return null;
|
|
12
|
+
return (_jsx(ConfigProvider, { classPrefix: "wedatea2td", children: _jsx(Bubble, { placement: "auto", openDelay: 300, content: _jsxs(_Fragment, { children: ["\u8BE5\u7EC4\u4EF6\u5FC5\u987B\u5728\u5C0F\u7A0B\u5E8F\u771F\u5B9E\u73AF\u5883\u4F7F\u7528\u624D\u80FD\u591F\u770B\u5230\u5B9E\u9645\u6548\u679C\u3002", _jsx("br", {}), _jsx("a", { href: "https://developers.weixin.qq.com/miniprogram/dev/component/store-product.html", target: "_blank", rel: "noreferrer", children: "\u67E5\u770B\u8BF4\u660E" })] }), children: _jsxs("div", { className: `${className} ${classPrefix}-store-product__wrap`, id: id, children: [_jsxs("div", { className: `${classPrefix}-store-home__content`, children: [_jsx("img", { className: `${classPrefix}-store-product__img`, src: "https://qcloudimg.tencent-cloud.cn/raw/4a29d51b504f12b4933ce4490110b4dc.svg", alt: "" }), _jsxs("div", { className: `${classPrefix}-store-product__text`, children: [_jsxs("div", { children: [_jsx("p", { className: `${classPrefix}-store-home__title`, children: "\u5546\u54C1\u540D\u79F0" }), _jsx("span", { className: `${classPrefix}-store-home__label`, children: "\u5546\u54C1\u6807\u7B7E" })] }), _jsxs("div", { className: `${classPrefix}-store-product__text__footer`, children: [_jsx("p", { className: "price", children: "\u00A5\u4EF7\u683C \u8D77" }), " ", _jsx(WdButton, { text: "\u8D2D\u4E70" })] })] })] }), _jsxs("div", { className: `${classPrefix}-store-home__footer`, children: [_jsx("i", { className: `${classPrefix}-store-home__icon` }), "\u5C0F\u5E97\u540D\u79F0"] })] }) }) }));
|
|
7
13
|
}
|
|
@@ -56,7 +56,7 @@ export declare const formatNumberFix: (val: any, field: any, setZero?: boolean)
|
|
|
56
56
|
* 根据 fields 信息生成 column
|
|
57
57
|
* h5 和 pc 部分参数不同
|
|
58
58
|
*/
|
|
59
|
-
export declare const getColumns: ({ columnSets, fields, isH5, supportManyRelated, showRelationWithTag
|
|
59
|
+
export declare const getColumns: ({ columnSets, fields, isH5, supportManyRelated, showRelationWithTag }: {
|
|
60
60
|
columnSets?: any[];
|
|
61
61
|
fields: any;
|
|
62
62
|
isH5?: boolean;
|
|
@@ -123,7 +123,7 @@ export declare const filterCustomColumns: ({ columns, columnSets, slots, fields,
|
|
|
123
123
|
* 过滤字段列表
|
|
124
124
|
* 导出/搜索框,不展示自定义列
|
|
125
125
|
*/
|
|
126
|
-
export declare const filterCustomFields: ({ fields, columnSets, isFilterGenre
|
|
126
|
+
export declare const filterCustomFields: ({ fields, columnSets, isFilterGenre }: {
|
|
127
127
|
fields: any;
|
|
128
128
|
columnSets: any;
|
|
129
129
|
isFilterGenre?: boolean;
|
|
@@ -131,7 +131,7 @@ export declare const filterCustomFields: ({ fields, columnSets, isFilterGenre, }
|
|
|
131
131
|
/**
|
|
132
132
|
* 列管理加入冻结属性
|
|
133
133
|
*/
|
|
134
|
-
export declare const getFixedColumnSets: ({ fixedFront, fixedEnd, columnSets
|
|
134
|
+
export declare const getFixedColumnSets: ({ fixedFront, fixedEnd, columnSets }: {
|
|
135
135
|
fixedFront?: string;
|
|
136
136
|
fixedEnd?: string;
|
|
137
137
|
columnSets: any;
|