@cloudbase/weda-ui 3.11.0 → 3.11.1
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-progress.d.ts +10 -0
- package/dist/configs/components/wd-progress.js +39 -2
- package/dist/configs/components/wd-top-tab.d.ts +4 -0
- package/dist/configs/components/wd-top-tab.js +5 -0
- package/dist/configs/index.d.ts +22 -0
- package/dist/configs/type-utils/type-form.js +1 -0
- package/dist/style/index.css +14 -4
- package/dist/style/index.scss +1 -1
- package/dist/style/weda-ui.min.css +2 -2
- package/dist/web/components/form/location/common/propsConfig.d.ts +1 -1
- package/dist/web/components/form/uploader/uploader.h5.js +13 -4
- package/dist/web/components/form/uploader/util.d.ts +1 -0
- package/dist/web/components/form/uploader/util.js +28 -0
- package/dist/web/components/form/uploaderFile/uploadFile.h5.js +14 -6
- package/dist/web/components/grid/col.d.ts +2 -2
- package/dist/web/components/wd-progress/wd-progress.js +5 -3
- package/dist/web/components/wd-table/components/FieldRender/index.js +19 -8
- package/dist/web/components/wd-table/components/ModalTable/index.js +4 -3
- package/dist/web/components/wd-table/utils/index.js +1 -1
- package/dist/web/components/wd-table/wd-table.js +2 -2
- package/dist/web/utils/isObjectEqual.d.ts +1 -1
- package/dist/web/utils/moment.d.ts +1 -0
- package/dist/web/utils/tool.js +2 -2
- package/package.json +17 -12
|
@@ -13,7 +13,7 @@ export namespace propTypes {
|
|
|
13
13
|
const zoom: PropTypes.Requireable<boolean>;
|
|
14
14
|
const disabled: PropTypes.Requireable<boolean>;
|
|
15
15
|
const requiredFlag: PropTypes.Requireable<boolean>;
|
|
16
|
-
const decorator: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
16
|
+
const decorator: PropTypes.Requireable<NonNullable<any[] | PropTypes.ReactNodeLike>>;
|
|
17
17
|
const value: PropTypes.Requireable<object>;
|
|
18
18
|
const locationType: PropTypes.Requireable<number>;
|
|
19
19
|
const dataSource: PropTypes.Requireable<object>;
|
|
@@ -9,6 +9,7 @@ import { toBase64Uri } from '../../../utils/file2base64';
|
|
|
9
9
|
import { isNil } from '../../../utils/lodash';
|
|
10
10
|
import { useUploader } from './useUploadFile';
|
|
11
11
|
import { errorHandler } from '../../../utils/error';
|
|
12
|
+
import { checkAcceptedFiles } from './util';
|
|
12
13
|
/**
|
|
13
14
|
* H5端
|
|
14
15
|
*/
|
|
@@ -51,10 +52,18 @@ export function ImageUploaderH5(props) {
|
|
|
51
52
|
return tempFile.length < maxUploadCount;
|
|
52
53
|
}, [tempFile, single, maxUploadCount, uploading]);
|
|
53
54
|
const uploadChange = async (e) => {
|
|
54
|
-
var _a, _b, _c, _d, _e, _f;
|
|
55
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
55
56
|
let files = [...e.target.files];
|
|
56
|
-
|
|
57
|
+
const isAccepted = files.every((i) => checkAcceptedFiles(i, accepts));
|
|
58
|
+
if (!isAccepted) {
|
|
57
59
|
(_b = (_a = window === null || window === void 0 ? void 0 : window.$w) === null || _a === void 0 ? void 0 : _a.utils) === null || _b === void 0 ? void 0 : _b.showToast({
|
|
60
|
+
title: `上传图片类型错误`,
|
|
61
|
+
icon: 'none',
|
|
62
|
+
});
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
if (files.some((f) => f.size > maxSize * 1024 * 1024)) {
|
|
66
|
+
(_d = (_c = window === null || window === void 0 ? void 0 : window.$w) === null || _c === void 0 ? void 0 : _c.utils) === null || _d === void 0 ? void 0 : _d.showToast({
|
|
58
67
|
title: `请上传不超过 ${maxSize}M 的图片`,
|
|
59
68
|
icon: 'none',
|
|
60
69
|
});
|
|
@@ -62,14 +71,14 @@ export function ImageUploaderH5(props) {
|
|
|
62
71
|
}
|
|
63
72
|
if (files.length > finalMaxImgCount) {
|
|
64
73
|
// 防止一下子选择过多文件
|
|
65
|
-
(
|
|
74
|
+
(_f = (_e = window === null || window === void 0 ? void 0 : window.$w) === null || _e === void 0 ? void 0 : _e.utils) === null || _f === void 0 ? void 0 : _f.showToast({
|
|
66
75
|
title: `最多只能上传${finalMaxImgCount}张图片,请重新选择`,
|
|
67
76
|
icon: 'none',
|
|
68
77
|
});
|
|
69
78
|
return false;
|
|
70
79
|
}
|
|
71
80
|
if (tempFile.length + files.length > finalMaxImgCount) {
|
|
72
|
-
(
|
|
81
|
+
(_h = (_g = window === null || window === void 0 ? void 0 : window.$w) === null || _g === void 0 ? void 0 : _g.utils) === null || _h === void 0 ? void 0 : _h.showToast({
|
|
73
82
|
title: `最多只能上传${finalMaxImgCount}张图片`,
|
|
74
83
|
icon: 'none',
|
|
75
84
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare const getBase64: (files: any) => Promise<any[]>;
|
|
2
2
|
export declare const uploadTcbMulti: (files: any, props: any) => Promise<any[]>;
|
|
3
3
|
export declare const filenameRegex: RegExp;
|
|
4
|
+
export declare const checkAcceptedFiles: (file: any, acceptedFiles: any) => any;
|
|
@@ -86,3 +86,31 @@ const uploadToTcb = async (item, props) => {
|
|
|
86
86
|
onUploadError(err);
|
|
87
87
|
}
|
|
88
88
|
};
|
|
89
|
+
export const checkAcceptedFiles = (file, acceptedFiles) => {
|
|
90
|
+
if (file && acceptedFiles) {
|
|
91
|
+
const acceptedFilesArray = Array.isArray(acceptedFiles)
|
|
92
|
+
? acceptedFiles
|
|
93
|
+
: acceptedFiles.split(',');
|
|
94
|
+
if (acceptedFilesArray.length === 0) {
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
if (acceptedFilesArray.includes('*')) {
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
const fileName = file.name || '';
|
|
101
|
+
const mimeType = (file.type || '').toLowerCase();
|
|
102
|
+
const baseMimeType = mimeType.replace(/\/.*$/, '');
|
|
103
|
+
return acceptedFilesArray.some((type) => {
|
|
104
|
+
const validType = type.trim().toLowerCase();
|
|
105
|
+
if (validType.charAt(0) === '.') {
|
|
106
|
+
return fileName.toLowerCase().endsWith(validType);
|
|
107
|
+
}
|
|
108
|
+
else if (validType.endsWith('/*')) {
|
|
109
|
+
// This is something like a image/* mime type
|
|
110
|
+
return baseMimeType === validType.replace(/\/.*$/, '');
|
|
111
|
+
}
|
|
112
|
+
return mimeType === validType;
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
return true;
|
|
116
|
+
};
|
|
@@ -13,7 +13,7 @@ import { WdButton } from '../../wd-button/wd-button';
|
|
|
13
13
|
import { toBase64Uri } from '../../../utils/file2base64';
|
|
14
14
|
import { isNil } from '../../../utils/lodash';
|
|
15
15
|
import { errorHandler } from '../../../utils/error';
|
|
16
|
-
import { filenameRegex } from '../uploader/util';
|
|
16
|
+
import { filenameRegex, checkAcceptedFiles } from '../uploader/util';
|
|
17
17
|
// 默认组件类前缀
|
|
18
18
|
const CLASS_PREFIX = 'weda-upload-file-mobile';
|
|
19
19
|
// 默认图片类型
|
|
@@ -137,10 +137,18 @@ events = emptyObject, defaultValue, uploadPath = 'weda-uploader', single = true,
|
|
|
137
137
|
}, children: _jsx("div", { "data-testid": "uploadFileH5", className: cls, id: id, style: style, children: _jsxs("div", { className: classNames(`${CLASS_PREFIX}`), children: [isEdit && (_jsx("div", { className: classNames(`${CLASS_PREFIX}__hd`, layout), children: _jsx("div", { children: btnDisabled ? (readOnly ? null : (_jsx(WdButton, { variant: "outline", className: classNames(`${CLASS_PREFIX}__btn--weak`), disabled: btnDisabled, text: btnTitle }))) : (_jsxs("div", { children: [_jsx("input", { ref: inputRef, id: "uploaderInput", type: "file", "data-testid": "button-up", className: "weui-uploader-mobile__input", accept: accepts.join(','), multiple: !single, onClick: () => {
|
|
138
138
|
inputRef.current && (inputRef.current.value = '');
|
|
139
139
|
}, onChange: async (e) => {
|
|
140
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
140
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
141
141
|
let fileList = [...e.target.files];
|
|
142
|
-
|
|
142
|
+
const isAccepted = fileList.every((i) => checkAcceptedFiles(i, accepts));
|
|
143
|
+
if (!isAccepted) {
|
|
143
144
|
(_b = (_a = window === null || window === void 0 ? void 0 : window.$w) === null || _a === void 0 ? void 0 : _a.utils) === null || _b === void 0 ? void 0 : _b.showToast({
|
|
145
|
+
title: `上传图片类型错误`,
|
|
146
|
+
icon: 'none',
|
|
147
|
+
});
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
if (single && fileList.length > 1) {
|
|
151
|
+
(_d = (_c = window === null || window === void 0 ? void 0 : window.$w) === null || _c === void 0 ? void 0 : _c.utils) === null || _d === void 0 ? void 0 : _d.showToast({
|
|
144
152
|
title: `上传文件总数不能超过1个`,
|
|
145
153
|
icon: 'none',
|
|
146
154
|
});
|
|
@@ -148,7 +156,7 @@ events = emptyObject, defaultValue, uploadPath = 'weda-uploader', single = true,
|
|
|
148
156
|
}
|
|
149
157
|
if (fileList.length + fileIDList.length >
|
|
150
158
|
maxUploadCount) {
|
|
151
|
-
(
|
|
159
|
+
(_f = (_e = window === null || window === void 0 ? void 0 : window.$w) === null || _e === void 0 ? void 0 : _e.utils) === null || _f === void 0 ? void 0 : _f.showToast({
|
|
152
160
|
title: `上传文件总数不能超过${maxUploadCount}个`,
|
|
153
161
|
icon: 'none',
|
|
154
162
|
});
|
|
@@ -156,14 +164,14 @@ events = emptyObject, defaultValue, uploadPath = 'weda-uploader', single = true,
|
|
|
156
164
|
}
|
|
157
165
|
if (maxSizeLimit &&
|
|
158
166
|
fileList.some((f) => f.size > maxSizeLimit * 1024 * 1024)) {
|
|
159
|
-
(
|
|
167
|
+
(_h = (_g = window === null || window === void 0 ? void 0 : window.$w) === null || _g === void 0 ? void 0 : _g.utils) === null || _h === void 0 ? void 0 : _h.showToast({
|
|
160
168
|
title: `请上传不超过${maxSizeLimit}M的文件`,
|
|
161
169
|
icon: 'none',
|
|
162
170
|
});
|
|
163
171
|
return false;
|
|
164
172
|
}
|
|
165
173
|
if (fileList.some((f) => f.size > 1024 * 1024 * 1024)) {
|
|
166
|
-
(
|
|
174
|
+
(_k = (_j = window === null || window === void 0 ? void 0 : window.$w) === null || _j === void 0 ? void 0 : _j.utils) === null || _k === void 0 ? void 0 : _k.showToast({
|
|
167
175
|
title: `请上传不超过1024M的文件`,
|
|
168
176
|
icon: 'none',
|
|
169
177
|
});
|
|
@@ -3,11 +3,11 @@ import type { CommonPropsType } from '../../types';
|
|
|
3
3
|
import './style';
|
|
4
4
|
declare const _default: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
5
5
|
alignSelf?: string;
|
|
6
|
-
widthType: ("fit-content" | "auto-fill" | (1 | "1") | (2 | "2") | (3 | "3") | (4 | "4") | (5 | "5") | (6 | "6") | (7 | "7") | (8 | "8") | (9 |
|
|
6
|
+
widthType: ("fit-content" | "auto-fill" | (1 | "1") | (2 | "2") | (3 | "3") | (4 | "4") | (5 | "5") | (6 | "6") | (7 | "7") | (8 | "8") | ("9" | 9) | (10 | "10") | (11 | "11") | (12 | "12")) | {
|
|
7
7
|
type: string;
|
|
8
8
|
value: string;
|
|
9
9
|
};
|
|
10
|
-
lgWidthType: ("fit-content" | "auto-fill" | (1 | "1") | (2 | "2") | (3 | "3") | (4 | "4") | (5 | "5") | (6 | "6") | (7 | "7") | (8 | "8") | (9 |
|
|
10
|
+
lgWidthType: ("fit-content" | "auto-fill" | (1 | "1") | (2 | "2") | (3 | "3") | (4 | "4") | (5 | "5") | (6 | "6") | (7 | "7") | (8 | "8") | ("9" | 9) | (10 | "10") | (11 | "11") | (12 | "12")) | {
|
|
11
11
|
type: string;
|
|
12
12
|
value: string;
|
|
13
13
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { WdFormItem } from '../wd-form-item';
|
|
@@ -11,7 +11,7 @@ import { useSyncValue } from '../../utils/hooks/useSyncValue';
|
|
|
11
11
|
import { useSetWidgetApi } from '../../utils/widget-api/use-set-widget-api';
|
|
12
12
|
import { calculateNextValue, calculatePercentByValueAndBoundary } from './util';
|
|
13
13
|
export const WdProgress = React.forwardRef(function FormProgress(props, inputRef) {
|
|
14
|
-
const { className, id, events, style, name, label, min = 0, max = 100, step = 1, } = props;
|
|
14
|
+
const { className, id, events, style, name, label, min = 0, max = 100, step = 1, percentSlot, showPercent = false, } = props;
|
|
15
15
|
const [innerHandle, setInnerHandle] = React.useState({});
|
|
16
16
|
const traitProps = { ...props, inputRef, setInnerHandle };
|
|
17
17
|
const { onChange: outerOnChange, disabled, readOnly, validateErrorMsg, validateState, visible, value: defaultValue, } = useFormInputTrait(traitProps);
|
|
@@ -30,6 +30,7 @@ export const WdProgress = React.forwardRef(function FormProgress(props, inputRef
|
|
|
30
30
|
visible,
|
|
31
31
|
disabled,
|
|
32
32
|
readOnly,
|
|
33
|
+
showPercent,
|
|
33
34
|
}), [
|
|
34
35
|
innerHandle,
|
|
35
36
|
name,
|
|
@@ -41,6 +42,7 @@ export const WdProgress = React.forwardRef(function FormProgress(props, inputRef
|
|
|
41
42
|
min,
|
|
42
43
|
max,
|
|
43
44
|
step,
|
|
45
|
+
showPercent,
|
|
44
46
|
], inputRef);
|
|
45
47
|
const active = !(readOnly || disabled);
|
|
46
48
|
const progressRef = React.useRef(null);
|
|
@@ -123,5 +125,5 @@ export const WdProgress = React.forwardRef(function FormProgress(props, inputRef
|
|
|
123
125
|
document.removeEventListener('touchmove', onTouchMove);
|
|
124
126
|
};
|
|
125
127
|
}, [cancelDragging, onMouseMove, onTouchMove, active]);
|
|
126
|
-
return (visible && (_jsx(WdFormItem, { ...props, testId: "form-progress", validateErrorMsg: validateErrorMsg, validateState: validateState, readValue: value, classRoot: 'progress', disabled: disabled, layout: props.layout, children:
|
|
128
|
+
return (visible && (_jsx(WdFormItem, { ...props, testId: "form-progress", validateErrorMsg: validateErrorMsg, validateState: validateState, readValue: value, classRoot: 'progress', disabled: disabled, layout: props.layout, children: _jsxs("div", { id: id, className: classNames(`${classPrefix}-${platform}-progress-container`, `${classPrefix}-progress-container`, className), style: style, "data-testid": "progress-container", children: [_jsx("div", { ref: progressRef, className: `${classPrefix}-progress`, children: _jsx("div", { className: `${classPrefix}-progress__value`, style: { width: `${percent}%` } }) }), showPercent && (_jsx("div", { className: `${classPrefix}-progress__percent`, children: percentSlot }))] }) })));
|
|
127
129
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
import React, { useMemo, useRef } from 'react';
|
|
3
|
+
import React, { useMemo, useRef, useState } from 'react';
|
|
4
4
|
import fromEntries from 'object.fromentries';
|
|
5
5
|
import { Modal, Table, Form, ConfigProvider } from 'tea-component';
|
|
6
6
|
import { formatTimeByType } from '../../../../utils/date';
|
|
@@ -21,7 +21,7 @@ import { errorHandler } from '../../../../utils/error';
|
|
|
21
21
|
import { ImagePreview } from './ImagePreview';
|
|
22
22
|
import { VideoPreview } from './VideoPreview';
|
|
23
23
|
import { ModalTable } from '../ModalTable';
|
|
24
|
-
import { getWhereParam } from '../../utils';
|
|
24
|
+
import { getWhereParam, getSortColumns } from '../../utils';
|
|
25
25
|
import lodashGet from 'lodash.get';
|
|
26
26
|
const MODAL_SIZE = '80%';
|
|
27
27
|
// 文字提示框包裹组件
|
|
@@ -252,7 +252,7 @@ export function getFieldRender(field = {}, extra = {}) {
|
|
|
252
252
|
const propertyArr = Object.keys(properties);
|
|
253
253
|
const relatedKey = propertyArr.find((item) => {
|
|
254
254
|
var _a;
|
|
255
|
-
if (properties[item].format === 'one
|
|
255
|
+
if (properties[item].format === 'many-one' ||
|
|
256
256
|
properties[item].format === 'many-many') {
|
|
257
257
|
return ((_a = properties[item]['x-parent']) === null || _a === void 0 ? void 0 : _a.parentFieldKey) === field.name;
|
|
258
258
|
}
|
|
@@ -262,9 +262,7 @@ export function getFieldRender(field = {}, extra = {}) {
|
|
|
262
262
|
});
|
|
263
263
|
const param = {
|
|
264
264
|
datasource: parentDatasource,
|
|
265
|
-
|
|
266
|
-
? [relatedField]
|
|
267
|
-
: [primaryField] || [],
|
|
265
|
+
isNewData: true,
|
|
268
266
|
};
|
|
269
267
|
const whereList = getWhereParam(relatedKey, rowId);
|
|
270
268
|
const modalSize = isH5 ? 'auto' : 'l';
|
|
@@ -314,6 +312,7 @@ export const DataItemView = ({ fields, modelType, value, isH5 }) => {
|
|
|
314
312
|
*/
|
|
315
313
|
export const DataTableView = ({ fields, value }) => {
|
|
316
314
|
var _a;
|
|
315
|
+
const { sortable } = Table.addons;
|
|
317
316
|
const { classPrefix } = useConfig();
|
|
318
317
|
const rawFields = (_a = Object === null || Object === void 0 ? void 0 : Object.entries(fields.properties)) === null || _a === void 0 ? void 0 : _a.map(([name, field]) => Object.assign({}, field, { name }));
|
|
319
318
|
const columns = useMemo(() => {
|
|
@@ -325,9 +324,21 @@ export const DataTableView = ({ fields, value }) => {
|
|
|
325
324
|
supportManyRelated: false,
|
|
326
325
|
showRelationWithTag: false,
|
|
327
326
|
});
|
|
328
|
-
return baseColumns;
|
|
327
|
+
return baseColumns === null || baseColumns === void 0 ? void 0 : baseColumns.map((i) => ({ ...i, isSort: true }));
|
|
329
328
|
}, [rawFields]);
|
|
330
|
-
|
|
329
|
+
// 当前排序列
|
|
330
|
+
const [sorts, setSorts] = useState([]);
|
|
331
|
+
const sortColumns = getSortColumns({
|
|
332
|
+
fields: rawFields,
|
|
333
|
+
columnSets: columns,
|
|
334
|
+
});
|
|
335
|
+
return (_jsx(ConfigProvider, { classPrefix: classPrefix, children: _jsx(EnumHoc, { fields: rawFields, children: _jsx(Table, { className: `${classPrefix}-table-wrap`, bordered: "all", recordKey: "_id", records: [].concat(value).sort(sortable.comparer(sorts)), columns: columns, addons: [
|
|
336
|
+
sortable({
|
|
337
|
+
columns: sortColumns,
|
|
338
|
+
value: sorts,
|
|
339
|
+
onChange: (value) => setSorts(value),
|
|
340
|
+
}),
|
|
341
|
+
] }) }) }));
|
|
331
342
|
};
|
|
332
343
|
/**
|
|
333
344
|
* array类型,展示组件
|
|
@@ -80,8 +80,6 @@ enablePagination = true, columnSelectType = 'select', defaultPageIndex = _defaul
|
|
|
80
80
|
columnSetsKey,
|
|
81
81
|
});
|
|
82
82
|
const fields = authFields;
|
|
83
|
-
// 可排序字段
|
|
84
|
-
const sortColumns = getSortColumns({ fields, columnSets });
|
|
85
83
|
// 查询参数
|
|
86
84
|
const { query } = useQueryParams({
|
|
87
85
|
queryParams,
|
|
@@ -152,8 +150,9 @@ enablePagination = true, columnSelectType = 'select', defaultPageIndex = _defaul
|
|
|
152
150
|
fixedEnd,
|
|
153
151
|
isH5,
|
|
154
152
|
supportManyRelated: true,
|
|
153
|
+
showRelationWithTag: false,
|
|
155
154
|
});
|
|
156
|
-
return baseColumns;
|
|
155
|
+
return baseColumns === null || baseColumns === void 0 ? void 0 : baseColumns.map((i) => ({ ...i, isSort: true }));
|
|
157
156
|
}, [
|
|
158
157
|
isNoDataSourceBind,
|
|
159
158
|
fieldsLoading,
|
|
@@ -163,6 +162,8 @@ enablePagination = true, columnSelectType = 'select', defaultPageIndex = _defaul
|
|
|
163
162
|
fixedEnd,
|
|
164
163
|
isH5,
|
|
165
164
|
]);
|
|
165
|
+
// 可排序字段
|
|
166
|
+
const sortColumns = getSortColumns({ fields, columnSets: columns });
|
|
166
167
|
// 事件属性
|
|
167
168
|
useImperativeHandle(ref, () => ({
|
|
168
169
|
refresh: () => {
|
|
@@ -412,7 +412,7 @@ export const getFilterFields = (filterFields, authFields) => {
|
|
|
412
412
|
var _a;
|
|
413
413
|
let result = [];
|
|
414
414
|
try {
|
|
415
|
-
const filterFieldsObj = JSON.parse(JSON.stringify(filterFields));
|
|
415
|
+
const filterFieldsObj = filterFields && JSON.parse(JSON.stringify(filterFields));
|
|
416
416
|
if (filterFields === null || filterFields === void 0 ? void 0 : filterFields.filterConfig) {
|
|
417
417
|
// 变量绑定的情况
|
|
418
418
|
// 筛选有权限的字段
|
|
@@ -371,10 +371,10 @@ export const WdTable = forwardRef(function TableComp(tableProps, ref) {
|
|
|
371
371
|
if (isExpression &&
|
|
372
372
|
Array.isArray(dataSourceData) &&
|
|
373
373
|
!isObjectEqual((_a = dataRef === null || dataRef === void 0 ? void 0 : dataRef.current) === null || _a === void 0 ? void 0 : _a.dataSourceData, dataSourceData)) {
|
|
374
|
-
dataRef.current.dataSourceData = dataSourceData
|
|
374
|
+
dataRef.current.dataSourceData = [...dataSourceData];
|
|
375
375
|
}
|
|
376
376
|
if (!isObjectEqual((_b = dataRef === null || dataRef === void 0 ? void 0 : dataRef.current) === null || _b === void 0 ? void 0 : _b.tableRecords, tableRecords)) {
|
|
377
|
-
dataRef.current.tableRecords = tableRecords
|
|
377
|
+
dataRef.current.tableRecords = [...tableRecords];
|
|
378
378
|
}
|
|
379
379
|
}, [dataSourceData, tableRecords, isExpression]);
|
|
380
380
|
const beforeModalDestroy = () => {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export function serde(a: any): any;
|
|
2
|
-
export default function _default(a: any, b: any, shouldSerde?: boolean):
|
|
2
|
+
export default function _default(a: any, b: any, shouldSerde?: boolean): boolean;
|
package/dist/web/utils/tool.js
CHANGED
|
@@ -227,10 +227,10 @@ export const convertSingleValue = (value, single) => {
|
|
|
227
227
|
let v = value;
|
|
228
228
|
if (value !== null) {
|
|
229
229
|
if (single && typeof value !== 'string') {
|
|
230
|
-
v = null;
|
|
230
|
+
v = Array.isArray(value) ? value[0] : null;
|
|
231
231
|
}
|
|
232
232
|
else if (!single && !Array.isArray(value)) {
|
|
233
|
-
v = [];
|
|
233
|
+
v = value ? [].concat(value) : [];
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
return v;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/weda-ui",
|
|
3
|
-
"version": "3.11.
|
|
3
|
+
"version": "3.11.1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index",
|
|
6
6
|
"miniprogram": "mpdist",
|
|
@@ -65,13 +65,15 @@
|
|
|
65
65
|
"dev-mp": "npx gulp dev -f tools/build-mp/gulpfile.mjs",
|
|
66
66
|
"convert-rpx": "npx gulp -f tools/convert-rpx/gulpfile.mjs",
|
|
67
67
|
"clear:snap": "rimraf ./src/test/__snapshots__",
|
|
68
|
-
"size": "npm run build-mp && tcb lowcode
|
|
68
|
+
"size": "npm run build-mp && tcb lowcode build && size-limit",
|
|
69
69
|
"new": "npx hygen comp new",
|
|
70
70
|
"_postinstall": "node tools/post-install.mjs",
|
|
71
71
|
"prepack": "pinst --disable",
|
|
72
72
|
"postpack": "pinst --enable",
|
|
73
73
|
"test:icon": "node tools/publish-icon/test.mjs",
|
|
74
|
-
"sync-icon": "node tools/publish-icon/sync-icon.mjs"
|
|
74
|
+
"sync-icon": "node tools/publish-icon/sync-icon.mjs",
|
|
75
|
+
"deploy": "node scripts/deploy.mjs && npm run release",
|
|
76
|
+
"release": "node scripts/release.mjs"
|
|
75
77
|
},
|
|
76
78
|
"keywords": [
|
|
77
79
|
"weda",
|
|
@@ -83,7 +85,7 @@
|
|
|
83
85
|
"description": "腾讯云微搭低代码组件库模板",
|
|
84
86
|
"dependencies": {
|
|
85
87
|
"@antv/g6": "^4.8.5",
|
|
86
|
-
"@cloudbase/weda-client": "^1.1.
|
|
88
|
+
"@cloudbase/weda-client": "^1.1.8",
|
|
87
89
|
"@codemirror/autocomplete": "^6.16.0",
|
|
88
90
|
"@codemirror/lang-javascript": "^6.2.2",
|
|
89
91
|
"@codemirror/lang-json": "^6.0.1",
|
|
@@ -114,11 +116,14 @@
|
|
|
114
116
|
"lodash.set": "^4.3.2",
|
|
115
117
|
"markdown-it": "^14.1.0",
|
|
116
118
|
"markdown-it-code-copy": "^0.1.2",
|
|
119
|
+
"mobx": "^5.15.4",
|
|
117
120
|
"moment": "^2.29.4",
|
|
118
121
|
"object.fromentries": "^2.0.7",
|
|
119
122
|
"prop-types": "^15.7.2",
|
|
120
123
|
"qrcode.react": "^3.1.0",
|
|
124
|
+
"react": "^17.0.2",
|
|
121
125
|
"react-copy-to-clipboard": "^5.1.0",
|
|
126
|
+
"react-dom": "^17.0.2",
|
|
122
127
|
"react-easy-swipe": "0.0.22",
|
|
123
128
|
"react-error-boundary": "^3.1.4",
|
|
124
129
|
"react-highlight-within-textarea": "3.1.1",
|
|
@@ -142,9 +147,9 @@
|
|
|
142
147
|
"@babel/preset-env": "^7.22.15",
|
|
143
148
|
"@babel/preset-react": "^7.22.15",
|
|
144
149
|
"@babel/preset-typescript": "^7.22.15",
|
|
145
|
-
"@cloudbase/cals": "^1.
|
|
146
|
-
"@cloudbase/lowcode-cli": "^0.21.
|
|
147
|
-
"@cloudbase/weda-cloud-sdk": "^1.0.
|
|
150
|
+
"@cloudbase/cals": "^1.2.4",
|
|
151
|
+
"@cloudbase/lowcode-cli": "^0.21.13",
|
|
152
|
+
"@cloudbase/weda-cloud-sdk": "^1.0.87",
|
|
148
153
|
"@commitlint/cli": "^16.0.2",
|
|
149
154
|
"@commitlint/config-conventional": "^17.7.0",
|
|
150
155
|
"@craco/craco": "^7.1.0",
|
|
@@ -165,6 +170,7 @@
|
|
|
165
170
|
"@storybook/react": "^6.5.16",
|
|
166
171
|
"@swc/core": "1.3.37",
|
|
167
172
|
"@swc/jest": "^0.2.24",
|
|
173
|
+
"@tcwd/dev-tools": "^1.0.1",
|
|
168
174
|
"@testing-library/jest-dom": "^5.16.4",
|
|
169
175
|
"@testing-library/react": "^12.1.5",
|
|
170
176
|
"@testing-library/react-hooks": "^8.0.1",
|
|
@@ -181,6 +187,7 @@
|
|
|
181
187
|
"babel-loader": "^8.2.5",
|
|
182
188
|
"babel-plugin-istanbul": "^6.1.1",
|
|
183
189
|
"cross-env": "^7.0.3",
|
|
190
|
+
"css-loader": "^5",
|
|
184
191
|
"cypress": "~12.7.0",
|
|
185
192
|
"cypress-image-diff-js": "^1.23.0",
|
|
186
193
|
"cypress-wait-until": "^1.7.2",
|
|
@@ -212,24 +219,21 @@
|
|
|
212
219
|
"identity-obj-proxy": "^3.0.0",
|
|
213
220
|
"is-builtin-module": "^3.2.1",
|
|
214
221
|
"jest": "^27.5.1",
|
|
215
|
-
"jest_workaround": "0.1.14",
|
|
216
222
|
"jest-canvas-mock": "^2.4.0",
|
|
217
223
|
"jest-environment-jsdom": "^27",
|
|
218
224
|
"jest-preview": "^0.2.6",
|
|
225
|
+
"jest_workaround": "0.1.14",
|
|
219
226
|
"json-schema-to-ts": "^2.5.5",
|
|
220
227
|
"make-fetch-happen": "^11.0.1",
|
|
221
228
|
"markdown-to-jsx": "^7.2.1",
|
|
222
229
|
"miniprogram-simulate": "^1.5.9",
|
|
223
230
|
"mkdirp": "^1.0.4",
|
|
224
|
-
"mobx": "^5.15.4",
|
|
225
231
|
"mochawesome": "^7.1.3",
|
|
226
232
|
"mochawesome-merge": "^4.2.1",
|
|
227
233
|
"mochawesome-report-generator": "^6.2.0",
|
|
228
234
|
"nano-staged": "^0.8.0",
|
|
229
235
|
"pinst": "^3.0.0",
|
|
230
236
|
"prettier": "^2.7.1",
|
|
231
|
-
"react": "^17.0.2",
|
|
232
|
-
"react-dom": "^17.0.2",
|
|
233
237
|
"react-scripts": "^5.0.1",
|
|
234
238
|
"react-test-renderer": "^17",
|
|
235
239
|
"recast": "^0.23.4",
|
|
@@ -243,6 +247,7 @@
|
|
|
243
247
|
"storybook-addon-sass-postcss": "^0.1.3",
|
|
244
248
|
"storybook-addon-swc": "^1.2.0",
|
|
245
249
|
"storybook-docs-toc": "^1.7.0",
|
|
250
|
+
"style-loader": "^1.3.0",
|
|
246
251
|
"swc-loader": "0.2.3",
|
|
247
252
|
"swc-plugin-coverage-instrument": "^0.0.14",
|
|
248
253
|
"tdesign-react": "^1.1.10",
|
|
@@ -287,4 +292,4 @@
|
|
|
287
292
|
"iOS >= 12",
|
|
288
293
|
"safari >= 12"
|
|
289
294
|
]
|
|
290
|
-
}
|
|
295
|
+
}
|