@cloudbase/weda-ui 3.10.1 → 3.11.0
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/button.js +1 -1
- package/dist/configs/components/chart/bar.d.ts +146 -0
- package/dist/configs/components/chart/bar.js +1147 -0
- package/dist/configs/components/dataView.js +0 -16
- package/dist/configs/components/image.js +1 -1
- package/dist/configs/components/listView.js +0 -16
- package/dist/configs/components/lottery.js +1 -1
- package/dist/configs/components/navigationBar.json +1 -1
- package/dist/configs/components/wd-audio.js +1 -1
- package/dist/configs/components/wd-button.js +2 -2
- package/dist/configs/components/wd-icon.js +1 -1
- package/dist/configs/components/wd-image.js +1 -1
- package/dist/configs/components/wd-input-email.d.ts +2 -2
- package/dist/configs/components/wd-input-phone.d.ts +2 -2
- package/dist/configs/components/wd-input-url.d.ts +2 -2
- package/dist/configs/components/wd-layout.js +0 -1
- package/dist/configs/components/wd-link.js +1 -1
- package/dist/configs/components/wd-menu-layout.js +1 -1
- package/dist/configs/components/wd-menu-list.js +1 -1
- package/dist/configs/components/wd-rating.js +2 -2
- package/dist/configs/components/wd-select-multiple.d.ts +23 -0
- package/dist/configs/components/wd-select-multiple.js +26 -1
- package/dist/configs/components/wd-select.d.ts +23 -0
- package/dist/configs/components/wd-select.js +25 -0
- package/dist/configs/components/wd-side-tab.js +2 -2
- package/dist/configs/components/wd-tabbar.js +1 -1
- package/dist/configs/components/wd-table.d.ts +13 -1
- package/dist/configs/components/wd-table.js +34 -0
- package/dist/configs/components/wd-top-tab.js +2 -2
- package/dist/configs/components/wd-upload-image.js +1 -1
- package/dist/configs/components/wedaVideo.js +3 -3
- package/dist/configs/components/wxOpenApi/share.js +1 -1
- package/dist/configs/index.d.ts +4422 -5720
- package/dist/configs/index.js +1 -1
- package/dist/configs/type-utils/type-form.d.ts +6 -0
- package/dist/configs/type-utils/type-form.js +63 -22
- 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/enum/index.js +5 -1
- package/dist/style/index.css +15 -0
- package/dist/style/index.scss +1 -1
- package/dist/style/weda-ui.min.css +2 -2
- package/dist/web/components/form/select/index.css +2 -2
- package/dist/web/components/form/select/request.d.ts +3 -3
- package/dist/web/components/form/select/request.js +1 -0
- package/dist/web/components/form/select/status/index.d.ts +3 -1
- package/dist/web/components/form/select/status/index.js +3 -1
- package/dist/web/components/form/selectMultiple/dropdown-select/index.css +5 -5
- package/dist/web/components/form/uploader/uploader.h5.js +1 -1
- package/dist/web/components/form/uploader/uploader.pc.js +1 -1
- package/dist/web/components/form/uploader/util.d.ts +1 -0
- package/dist/web/components/form/uploader/util.js +2 -1
- package/dist/web/components/form/uploaderFile/uploadFile.h5.js +4 -3
- package/dist/web/components/form/uploaderFile/uploadFile.pc.js +3 -1
- package/dist/web/components/form-date/index.d.ts +1 -1
- package/dist/web/components/form-email/index.d.ts +1 -1
- package/dist/web/components/form-input/index.d.ts +1 -1
- package/dist/web/components/form-input-hooks/index.js +10 -1
- package/dist/web/components/form-input-hooks/validator.d.ts +1 -0
- package/dist/web/components/form-input-hooks/validator.js +6 -2
- package/dist/web/components/form-phone/index.d.ts +1 -1
- package/dist/web/components/form-time/index.d.ts +1 -1
- package/dist/web/components/form-url/index.d.ts +1 -1
- package/dist/web/components/formdetail/index.css +0 -6
- package/dist/web/components/wd-date/elements/Modal.h5.d.ts +2 -0
- package/dist/web/components/wd-date/elements/Modal.h5.js +3 -3
- package/dist/web/components/wd-form/index.js +1 -1
- package/dist/web/components/wd-form-item/wd-form-item-read-only.d.ts +1 -0
- package/dist/web/components/wd-input/wd-input.d.ts +1 -1
- package/dist/web/components/wd-input-email/wd-input-email.d.ts +1 -1
- package/dist/web/components/wd-input-phone/wd-input-phone.d.ts +1 -1
- package/dist/web/components/wd-input-url/wd-input-url.d.ts +1 -1
- package/dist/web/components/wd-menu-list/CommonMenuList.js +1 -1
- package/dist/web/components/wd-menu-list/HorizontalMenuList.js +1 -1
- package/dist/web/components/wd-select/relationSelect/relationSelect.d.ts +4 -0
- package/dist/web/components/wd-select/relationSelect/relationSelect.js +202 -0
- package/dist/web/components/wd-select/{relationalSetting.js → relationSelect/relationalSetting.js} +4 -4
- package/dist/web/components/wd-select/select/index.d.ts +2 -0
- package/dist/web/components/wd-select/select/index.js +8 -0
- package/dist/web/components/wd-select/select/selectUI.d.ts +3 -0
- package/dist/web/components/wd-select/select/selectUI.js +190 -0
- package/dist/web/components/wd-select/style.d.ts +2 -0
- package/dist/web/components/wd-select/style.js +2 -0
- package/dist/web/components/wd-select/wd-select.css +83 -0
- package/dist/web/components/wd-select/wd-select.d.ts +0 -1
- package/dist/web/components/wd-select/wd-select.js +18 -8
- package/dist/web/components/wd-select-multiple/style.d.ts +2 -0
- package/dist/web/components/wd-select-multiple/style.js +2 -0
- package/dist/web/components/wd-select-multiple/wd-select-multiple.css +30 -4
- package/dist/web/components/wd-select-multiple/wd-select-multiple.js +18 -7
- package/dist/web/components/wd-table/components/FieldRender/index.d.ts +7 -4
- package/dist/web/components/wd-table/components/FieldRender/index.js +27 -11
- package/dist/web/components/wd-table/components/ModalTable/index.js +1 -1
- package/dist/web/components/wd-table/components/Table/index.d.ts +4 -2
- package/dist/web/components/wd-table/components/Table/index.js +12 -3
- package/dist/web/components/wd-table/hooks/useChooseList.d.ts +1 -0
- package/dist/web/components/wd-table/hooks/useChooseList.js +55 -26
- package/dist/web/components/wd-table/wd-table.js +8 -3
- package/dist/web/components/wd-textarea/wd-textarea.js +5 -2
- package/dist/web/utils/platform.js +3 -3
- package/package.json +2 -2
- package/dist/configs/components/chart/bar.json +0 -1144
- /package/dist/web/components/wd-select/{relationalSetting.d.ts → relationSelect/relationalSetting.d.ts} +0 -0
|
@@ -9,16 +9,16 @@ type IRelationFetchOptions = {
|
|
|
9
9
|
where: unknown;
|
|
10
10
|
pageNo: number;
|
|
11
11
|
primaryField: string;
|
|
12
|
-
controlledValue
|
|
12
|
+
controlledValue?: OptionItem[];
|
|
13
13
|
};
|
|
14
14
|
type IEnumFetchOptions = {
|
|
15
15
|
format: 'x-enum';
|
|
16
16
|
enumName: string;
|
|
17
|
-
controlledValue
|
|
17
|
+
controlledValue?: OptionItem[];
|
|
18
18
|
};
|
|
19
19
|
export type IUseoptionsParams = (IRelationFetchOptions | IEnumFetchOptions | {
|
|
20
20
|
format?: string;
|
|
21
|
-
controlledValue
|
|
21
|
+
controlledValue?: OptionItem[];
|
|
22
22
|
}) & {
|
|
23
23
|
callWedaApi?: (params: any) => Promise<any> | any;
|
|
24
24
|
callDataSource?: (params: any) => Promise<any>;
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
border-radius: 3px;
|
|
119
119
|
display: block;
|
|
120
120
|
position: absolute;
|
|
121
|
-
left:
|
|
121
|
+
left: 5px;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
.weda-ui-custom-picker__cloumns.weda-ui-custom-picker__cloumns--select-multiple
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
border-radius: 3px;
|
|
131
131
|
display: block;
|
|
132
132
|
position: absolute;
|
|
133
|
-
left:
|
|
133
|
+
left: 5px;
|
|
134
134
|
background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTAiIHZpZXdCb3g9IjAgMCAxNCAxMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTMuNDAxNDYgNy45NDI3QzMuNDAxNCA3Ljk0MjY0IDMuNDAxNTMgNy45NDI3NiAzLjQwMTQ2IDcuOTQyN0wwLjc1IDUuMjkxMjNMMi41NDM0OSAzLjU0OTE5TDUuMTcyMSA2LjE3NzhMMTEuMzY4NyAwTDEzLjEyNDQgMS43NTU3TDYuOTI3OCA3LjkzMzVMNi45MzcxOCA3Ljk0Mjg5TDYuOTExMDkgNy45NjgyM0M2Ljg1NyA4LjAyMDc3IDYuODAxMTQgOC4wNzAzNyA2Ljc0MzcxIDguMTE3MDRMNi4wNDEyMyA4LjgxNzM4QzUuNTUyODYgOS4zMDQyNyA0Ljc2MjQ0IDkuMzAzNjcgNC4yNzQ4MSA4LjgxNjA0TDMuNDAxNDYgNy45NDI3WiIgZmlsbD0id2hpdGUiIGZpbGwtb3BhY2l0eT0iMC45Ii8+Cjwvc3ZnPg==);
|
|
135
135
|
background-repeat: no-repeat;
|
|
136
136
|
background-position: center;
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
|
|
145
145
|
/* 下拉选择类型 */
|
|
146
146
|
.weda-ui-custom-picker__cloumns.weda-ui-custom-picker__cloumns--select-multiple {
|
|
147
|
-
padding: 0
|
|
147
|
+
padding: 0 16px;
|
|
148
148
|
height: 280px;
|
|
149
149
|
}
|
|
150
150
|
|
|
@@ -219,12 +219,12 @@
|
|
|
219
219
|
justify-content: space-between;
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
-
.wedatea2td-list.wedatea2td-list--option.wedatea2td-list--checkoption
|
|
222
|
+
/* .wedatea2td-list.wedatea2td-list--option.wedatea2td-list--checkoption
|
|
223
223
|
.wedatea2td-list__status
|
|
224
224
|
.wedatea2td-action-state
|
|
225
225
|
.wedatea2td-action-state__text {
|
|
226
226
|
display: none;
|
|
227
|
-
}
|
|
227
|
+
} */
|
|
228
228
|
|
|
229
229
|
.wedatea2td-list.wedatea2td-list--option.wedatea2td-list--checkoption
|
|
230
230
|
.wedatea2td-list__status
|
|
@@ -105,7 +105,7 @@ export function ImageUploaderH5(props) {
|
|
|
105
105
|
const allFile = await upload(files);
|
|
106
106
|
handleChange(allFile);
|
|
107
107
|
};
|
|
108
|
-
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 }) }), _jsxs("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: "
|
|
108
|
+
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 }) }), _jsxs("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("div", { className: `weui-uploader__input-box ${imgTypeCls}`, children: !disabled &&
|
|
109
109
|
sourceType !== 'album' &&
|
|
110
110
|
(sourceType === 'camera' ? (_jsx("input", { ref: inputRef, onClick: () => {
|
|
111
111
|
inputRef.current && (inputRef.current.value = '');
|
|
@@ -119,7 +119,7 @@ export function UploaderPCInner(props) {
|
|
|
119
119
|
tips && (extraProps['title'] = tips);
|
|
120
120
|
maxSize && (extraProps['maxSize'] = maxSize * 1024 * 1024);
|
|
121
121
|
const hasActions = !uploading && !readOnly && !(disabled || sourceType === 'camera');
|
|
122
|
-
return (_jsx(ConfigProvider, { classPrefix: "wedatea2td", children: _jsxs("div", { className: "_weda-fn-upload-result", children: [tempFile === null || tempFile === void 0 ? void 0 : tempFile.map((d) => (_jsx("div", { className: `_weda-fn-upload-result__item ${imgTypeCls}`, children: _jsx(TcbImage, { tempFile: d, imgTypeCls: imgTypeCls, isZoom: true, preivewIcon: "td:browse", 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: "
|
|
122
|
+
return (_jsx(ConfigProvider, { classPrefix: "wedatea2td", children: _jsxs("div", { className: "_weda-fn-upload-result", children: [tempFile === null || tempFile === void 0 ? void 0 : tempFile.map((d) => (_jsx("div", { className: `_weda-fn-upload-result__item ${imgTypeCls}`, children: _jsx(TcbImage, { tempFile: d, imgTypeCls: imgTypeCls, isZoom: true, preivewIcon: "td:browse", 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("li", { className: `_weda-fn-upload-result__item wedatea2td-disabled ${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) ||
|
|
123
123
|
(single && tempFile.length < 1 && !uploading)) &&
|
|
124
124
|
!readOnly && (
|
|
125
125
|
// single 模式时,当数组为空且不在上传文件过程中时显示
|
|
@@ -34,13 +34,14 @@ export const uploadTcbMulti = async (files, props) => {
|
|
|
34
34
|
const result = await Promise.all(promiseAll);
|
|
35
35
|
return result;
|
|
36
36
|
};
|
|
37
|
+
export const filenameRegex = /[^a-zA-Z0-9\u4e00-\u9fff-*!_.]/g;
|
|
37
38
|
const uploadToTcb = async (item, props) => {
|
|
38
39
|
var _a, _b;
|
|
39
40
|
const { onUploadProgress, onUploadFinish, onUploadError } = props;
|
|
40
41
|
const { file, uploadPath } = item;
|
|
41
42
|
try {
|
|
42
43
|
const tcb = await getCloudInstance();
|
|
43
|
-
const cloudPath = `${uploadPath}/${randomStr()}-${(_a = file === null || file === void 0 ? void 0 : file.name) === null || _a === void 0 ? void 0 : _a.replace(
|
|
44
|
+
const cloudPath = `${uploadPath}/${randomStr()}-${(_a = file === null || file === void 0 ? void 0 : file.name) === null || _a === void 0 ? void 0 : _a.replace(filenameRegex, '-')}`;
|
|
44
45
|
const { fileID } = await tcb.uploadFile({
|
|
45
46
|
cloudPath,
|
|
46
47
|
filePath: file,
|
|
@@ -13,6 +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
17
|
// 默认组件类前缀
|
|
17
18
|
const CLASS_PREFIX = 'weda-upload-file-mobile';
|
|
18
19
|
// 默认图片类型
|
|
@@ -256,12 +257,12 @@ const TcbFileUpload = ({ id, file, disabled, formType }) => {
|
|
|
256
257
|
}, [file === null || file === void 0 ? void 0 : file._uuid]);
|
|
257
258
|
// 上传过程
|
|
258
259
|
const handleUpload = async (file) => {
|
|
259
|
-
var _a;
|
|
260
|
+
var _a, _b;
|
|
260
261
|
const tcb = await getCloudInstance();
|
|
261
262
|
try {
|
|
262
263
|
setStatus('UPLOAD_STATUS_PENDING');
|
|
263
264
|
const { fileID } = await tcb.uploadFile({
|
|
264
|
-
cloudPath: `${uploadPath}/${randomStr()}-${file === null || file === void 0 ? void 0 : file.name}`,
|
|
265
|
+
cloudPath: `${uploadPath}/${randomStr()}-${(_a = file === null || file === void 0 ? void 0 : file.name) === null || _a === void 0 ? void 0 : _a.replace(filenameRegex, '-')}`,
|
|
265
266
|
filePath: file,
|
|
266
267
|
onUploadProgress: (progressEvent) => {
|
|
267
268
|
let percent = 0;
|
|
@@ -281,7 +282,7 @@ const TcbFileUpload = ({ id, file, disabled, formType }) => {
|
|
|
281
282
|
id,
|
|
282
283
|
});
|
|
283
284
|
setStatus('UPLOAD_STATUS_ERROR');
|
|
284
|
-
(
|
|
285
|
+
(_b = events === null || events === void 0 ? void 0 : events.error) === null || _b === void 0 ? void 0 : _b.call(events, err);
|
|
285
286
|
}
|
|
286
287
|
};
|
|
287
288
|
return (_jsxs("div", { className: `${CLASS_PREFIX}__item`, role: "TcbFileUpload", children: [_jsx("div", { className: `${CLASS_PREFIX}__item-left`, children: _jsx(UploadFileStatus, { status: status, percent: percent, size: size, title: title, percentSize: (((file === null || file === void 0 ? void 0 : file.size) / 1024) * percent) / 100, formType: formType }) }), _jsx("div", { className: `${CLASS_PREFIX}__btn-group`, children: _jsx(UploadFileAction, { file: file, uuid: file === null || file === void 0 ? void 0 : file._uuid, status: status, onCancel: (uuid) => {
|
|
@@ -14,6 +14,7 @@ import { getParentForm } from '../../../utils/widget-api';
|
|
|
14
14
|
import { toBase64Uri } from '../../../utils/file2base64';
|
|
15
15
|
import { isNil } from '../../../utils/lodash';
|
|
16
16
|
import { errorHandler } from '../../../utils/error';
|
|
17
|
+
import { filenameRegex } from '../uploader/util';
|
|
17
18
|
// 默认组件类前缀
|
|
18
19
|
const CLASS_PREFIX = 'weda-upload-file-pc';
|
|
19
20
|
// 上传状态字典
|
|
@@ -257,11 +258,12 @@ const TcbFileUpload = ({ id, file, disabled, formType }) => {
|
|
|
257
258
|
}, [file === null || file === void 0 ? void 0 : file._uuid]);
|
|
258
259
|
// 上传过程
|
|
259
260
|
const handleUpload = async (file) => {
|
|
261
|
+
var _a;
|
|
260
262
|
const tcb = await getCloudInstance();
|
|
261
263
|
try {
|
|
262
264
|
setStatus('0');
|
|
263
265
|
const { fileID } = await tcb.uploadFile({
|
|
264
|
-
cloudPath: `${uploadPath}/${randomStr()}-${file === null || file === void 0 ? void 0 : file.name}`,
|
|
266
|
+
cloudPath: `${uploadPath}/${randomStr()}-${(_a = file === null || file === void 0 ? void 0 : file.name) === null || _a === void 0 ? void 0 : _a.replace(filenameRegex, '-')}`,
|
|
265
267
|
filePath: file,
|
|
266
268
|
onUploadProgress: (progressEvent) => {
|
|
267
269
|
let percent = 0;
|
|
@@ -18,8 +18,8 @@ declare const FormDate: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
|
18
18
|
start: string;
|
|
19
19
|
layout: "" | "vertical" | "horizontal";
|
|
20
20
|
mode: "datetime" | "year" | "month" | "day";
|
|
21
|
-
labelVisible: boolean;
|
|
22
21
|
clearable: boolean;
|
|
22
|
+
labelVisible: boolean;
|
|
23
23
|
requiredFlag: boolean;
|
|
24
24
|
requiredMsg: string;
|
|
25
25
|
} & {
|
|
@@ -17,8 +17,8 @@ declare const FormEmail: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
|
17
17
|
maxLength: number;
|
|
18
18
|
placeholder: string;
|
|
19
19
|
layout: "" | "vertical" | "horizontal";
|
|
20
|
-
labelVisible: boolean;
|
|
21
20
|
clearable: boolean;
|
|
21
|
+
labelVisible: boolean;
|
|
22
22
|
requiredFlag: boolean;
|
|
23
23
|
requiredMsg: string;
|
|
24
24
|
} & {
|
|
@@ -18,9 +18,9 @@ declare const WdInput: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
|
18
18
|
maxLength: number;
|
|
19
19
|
placeholder: string;
|
|
20
20
|
layout: "" | "vertical" | "horizontal";
|
|
21
|
+
clearable: boolean;
|
|
21
22
|
labelVisible: boolean;
|
|
22
23
|
isNickNameType: boolean;
|
|
23
|
-
clearable: boolean;
|
|
24
24
|
password: boolean;
|
|
25
25
|
rules: {
|
|
26
26
|
format: string;
|
|
@@ -143,7 +143,8 @@ export function useFormInputTrait(inputParams) {
|
|
|
143
143
|
setDisabled(originalDisabled);
|
|
144
144
|
};
|
|
145
145
|
},
|
|
146
|
-
async handleValidate() {
|
|
146
|
+
async handleValidate(throwError = true) {
|
|
147
|
+
var _a;
|
|
147
148
|
let finalValue = valueRef.current;
|
|
148
149
|
if (!required && !rules.length)
|
|
149
150
|
return;
|
|
@@ -236,6 +237,14 @@ export function useFormInputTrait(inputParams) {
|
|
|
236
237
|
if (errorArr.length > 0) {
|
|
237
238
|
setValidateState('error');
|
|
238
239
|
setValidateErrorMsg(errorArr[0].message);
|
|
240
|
+
if (throwError) {
|
|
241
|
+
const { compError } = errorHandler({
|
|
242
|
+
code: 'VALIDATE_ERROR',
|
|
243
|
+
error: errorArr,
|
|
244
|
+
message: `【${label}】${(_a = errorArr[0]) === null || _a === void 0 ? void 0 : _a.message}`,
|
|
245
|
+
});
|
|
246
|
+
throw compError;
|
|
247
|
+
}
|
|
239
248
|
}
|
|
240
249
|
else {
|
|
241
250
|
// console.log("校验成功>>>>>>>")
|
|
@@ -4,6 +4,7 @@ export declare const validType: {
|
|
|
4
4
|
readonly cn: (value: any) => boolean;
|
|
5
5
|
readonly mobile: (value: any) => boolean;
|
|
6
6
|
readonly tel: (value: any) => boolean;
|
|
7
|
+
readonly internationalTel: (value: any) => boolean;
|
|
7
8
|
readonly email: (value: any) => boolean;
|
|
8
9
|
readonly url: (value: any) => boolean;
|
|
9
10
|
readonly carId: (value: any) => boolean;
|
|
@@ -7,8 +7,9 @@ const pattern = {
|
|
|
7
7
|
cnName: /^[\u2E80-\uFE4F]{2,6}(?:·[\u2E80-\uFE4F]{2,6})*$/,
|
|
8
8
|
userName: /^[\da-zA-Z\u2E80-\uFE4F \s]{2,}$/,
|
|
9
9
|
carId: /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/,
|
|
10
|
-
mobile: /^
|
|
11
|
-
tel:
|
|
10
|
+
mobile: /^1[3-9]\d{9}$/,
|
|
11
|
+
tel: /(^(0\d{2,3}-)?|^\(\d{3}\)?|^(400|800)-?)(\d{3,8})(-\d{1,4})?$/,
|
|
12
|
+
internationalTel: /^(\+\d{1,4}[\s-]?)?(\(?\d{1,4}\)?[\s-]?)?(\d{1,4}[\s-]?)?(\d{1,4})?\d{1,9}(\s?(x|ext)\s?\d{1,6})?$/,
|
|
12
13
|
address: /^[\da-zA-Z\u2E80-\uFE4F \s-]{4,400}$/,
|
|
13
14
|
date: /((^((1[8-9]\d{2})|([2-9]\d{3}))([-\/\._])(10|12|0?[13578])([-\/\._])(3[01]|[12][0-9]|0?[1-9])$)|(^((1[8-9]\d{2})|([2-9]\d{3}))([-\/\._])(11|0?[469])([-\/\._])(30|[12][0-9]|0?[1-9])$)|(^((1[8-9]\d{2})|([2-9]\d{3}))([-\/\._])(0?2)([-\/\._])(2[0-8]|1[0-9]|0?[1-9])$)|(^([2468][048]00)([-\/\._])(0?2)([-\/\._])(29)$)|(^([3579][26]00)([-\/\._])(0?2)([-\/\._])(29)$)|(^([1][89][0][48])([-\/\._])(0?2)([-\/\._])(29)$)|(^([2-9][0-9][0][48])([-\/\._])(0?2)([-\/\._])(29)$)|(^([1][89][2468][048])([-\/\._])(0?2)([-\/\._])(29)$)|(^([2-9][0-9][2468][048])([-\/\._])(0?2)([-\/\._])(29)$)|(^([1][89][13579][26])([-\/\._])(0?2)([-\/\._])(29)$)|(^([2-9][0-9][13579][26])([-\/\._])(0?2)([-\/\._])(29)$))/,
|
|
14
15
|
numVcode: /^[0-9]{4,8}$/,
|
|
@@ -58,6 +59,9 @@ export const validType = {
|
|
|
58
59
|
tel(value) {
|
|
59
60
|
return pattern.tel.test(String(value).trim());
|
|
60
61
|
},
|
|
62
|
+
internationalTel(value) {
|
|
63
|
+
return pattern.internationalTel.test(String(value).trim());
|
|
64
|
+
},
|
|
61
65
|
// 邮箱检测
|
|
62
66
|
email(value) {
|
|
63
67
|
return typeof value === 'string' && pattern.email.test(value.trim());
|
|
@@ -16,8 +16,8 @@ declare const FormPhone: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
|
16
16
|
disabled: boolean;
|
|
17
17
|
placeholder: string;
|
|
18
18
|
layout: "" | "vertical" | "horizontal";
|
|
19
|
-
labelVisible: boolean;
|
|
20
19
|
clearable: boolean;
|
|
20
|
+
labelVisible: boolean;
|
|
21
21
|
requiredFlag: boolean;
|
|
22
22
|
requiredMsg: string;
|
|
23
23
|
} & {
|
|
@@ -17,8 +17,8 @@ declare const FormTime: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
|
17
17
|
end: string;
|
|
18
18
|
start: string;
|
|
19
19
|
layout: "" | "vertical" | "horizontal";
|
|
20
|
-
labelVisible: boolean;
|
|
21
20
|
clearable: boolean;
|
|
21
|
+
labelVisible: boolean;
|
|
22
22
|
requiredFlag: boolean;
|
|
23
23
|
requiredMsg: string;
|
|
24
24
|
} & {
|
|
@@ -17,8 +17,8 @@ declare const FormUrl: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
|
17
17
|
maxLength: number;
|
|
18
18
|
placeholder: string;
|
|
19
19
|
layout: "" | "vertical" | "horizontal";
|
|
20
|
-
labelVisible: boolean;
|
|
21
20
|
clearable: boolean;
|
|
21
|
+
labelVisible: boolean;
|
|
22
22
|
requiredFlag: boolean;
|
|
23
23
|
requiredMsg: string;
|
|
24
24
|
} & {
|
|
@@ -466,12 +466,6 @@
|
|
|
466
466
|
display: none;
|
|
467
467
|
}
|
|
468
468
|
|
|
469
|
-
.form-detail-wrap.form-detail-table
|
|
470
|
-
.form-detail-group-parent-container
|
|
471
|
-
[data-role='wd-col']-lg.formrichtext
|
|
472
|
-
.bf-content {
|
|
473
|
-
height: 161px;
|
|
474
|
-
}
|
|
475
469
|
.form-detail-wrap .wd-grid-row > div,
|
|
476
470
|
.form-detail-wrap .wd-grid .wd-grid-row > div {
|
|
477
471
|
margin: 0;
|
|
@@ -7,10 +7,10 @@ import classNames from '../../../utils/classnames';
|
|
|
7
7
|
* H5端 模态框
|
|
8
8
|
*/
|
|
9
9
|
export function Modal(props) {
|
|
10
|
-
const { onOk = noop, onClose = noop, visible, children, className, header, } = props;
|
|
10
|
+
const { onOk = noop, onClose = noop, visible, children, className, header, okButtonVisible = true, popupContainer, } = props;
|
|
11
11
|
const { classPrefix } = useConfig();
|
|
12
12
|
if (!visible)
|
|
13
13
|
return null;
|
|
14
|
-
const renderHeader = () => header ? (header) : (_jsxs("div", { className: `${classPrefix}-custom-picker__header`, children: [_jsx("div", { className: `${classPrefix}-custom-picker__header-cancle`, onClick: onClose, children: "\u53D6\u6D88" }), _jsx("div", { className: `${classPrefix}-custom-picker__header-confirm`, onClick: onOk, children: "\u786E\u5B9A" })] }));
|
|
15
|
-
return (_jsx(Portal, { type: "div", children: _jsxs("div", { className: classNames(`${classPrefix}-custom-picker`, className), children: [_jsx("div", { className: `${classPrefix}-custom-backdrop`, onClick: onClose }), _jsxs("div", { className: `${classPrefix}-custom-picker__inner`, children: [renderHeader(), _jsx("div", { className: `${classPrefix}-custom-picker__body`, children: children })] })] }) }));
|
|
14
|
+
const renderHeader = () => header ? (header) : (_jsxs("div", { className: `${classPrefix}-custom-picker__header`, children: [_jsx("div", { className: `${classPrefix}-custom-picker__header-cancle`, onClick: onClose, children: "\u53D6\u6D88" }), okButtonVisible && (_jsx("div", { className: `${classPrefix}-custom-picker__header-confirm`, onClick: onOk, children: "\u786E\u5B9A" }))] }));
|
|
15
|
+
return (_jsx(Portal, { type: "div", portalContainer: popupContainer, children: _jsxs("div", { className: classNames(`${classPrefix}-custom-picker`, className), children: [_jsx("div", { className: `${classPrefix}-custom-backdrop`, onClick: onClose }), _jsxs("div", { className: `${classPrefix}-custom-picker__inner`, children: [renderHeader(), _jsx("div", { className: `${classPrefix}-custom-picker__body`, children: children })] })] }) }));
|
|
16
16
|
}
|
|
@@ -86,7 +86,7 @@ const WdForm = React.forwardRef(function WdForm(props, ref) {
|
|
|
86
86
|
}
|
|
87
87
|
items.forEach((item) => {
|
|
88
88
|
if (item.handleValidate) {
|
|
89
|
-
const validate = item.handleValidate();
|
|
89
|
+
const validate = item.handleValidate(false);
|
|
90
90
|
const { name, label } = item;
|
|
91
91
|
if (validate) {
|
|
92
92
|
validatePromise.push(validate);
|
|
@@ -26,6 +26,7 @@ export declare const WdInput: React.ForwardRefExoticComponent<CommonPropsType &
|
|
|
26
26
|
suffixIcon?: string;
|
|
27
27
|
suffixSrc?: string;
|
|
28
28
|
labelWidth?: string;
|
|
29
|
+
clearable?: boolean;
|
|
29
30
|
inputValue?: string;
|
|
30
31
|
labelVisible?: boolean;
|
|
31
32
|
labelAlign?: string;
|
|
@@ -33,7 +34,6 @@ export declare const WdInput: React.ForwardRefExoticComponent<CommonPropsType &
|
|
|
33
34
|
labelTips?: string;
|
|
34
35
|
isNickNameType?: boolean;
|
|
35
36
|
cursorSpacing?: number;
|
|
36
|
-
clearable?: boolean;
|
|
37
37
|
isUnionValue?: boolean;
|
|
38
38
|
password?: boolean;
|
|
39
39
|
counterVisible?: boolean;
|
|
@@ -25,13 +25,13 @@ export declare const WdInputEmail: React.ForwardRefExoticComponent<CommonPropsTy
|
|
|
25
25
|
suffixIcon?: string;
|
|
26
26
|
suffixSrc?: string;
|
|
27
27
|
labelWidth?: string;
|
|
28
|
+
clearable?: boolean;
|
|
28
29
|
inputValue?: string;
|
|
29
30
|
labelVisible?: boolean;
|
|
30
31
|
labelAlign?: string;
|
|
31
32
|
labelWrap?: boolean;
|
|
32
33
|
labelTips?: string;
|
|
33
34
|
cursorSpacing?: number;
|
|
34
|
-
clearable?: boolean;
|
|
35
35
|
isUnionValue?: boolean;
|
|
36
36
|
counterVisible?: boolean;
|
|
37
37
|
borderedH5?: boolean;
|
|
@@ -42,6 +42,7 @@ export declare const WdInputPhone: React.ForwardRefExoticComponent<CommonPropsTy
|
|
|
42
42
|
suffixIcon?: string;
|
|
43
43
|
suffixSrc?: string;
|
|
44
44
|
labelWidth?: string;
|
|
45
|
+
clearable?: boolean;
|
|
45
46
|
inputValue?: string;
|
|
46
47
|
labelVisible?: boolean;
|
|
47
48
|
labelAlign?: string;
|
|
@@ -49,7 +50,6 @@ export declare const WdInputPhone: React.ForwardRefExoticComponent<CommonPropsTy
|
|
|
49
50
|
labelTips?: string;
|
|
50
51
|
isNickNameType?: boolean;
|
|
51
52
|
cursorSpacing?: number;
|
|
52
|
-
clearable?: boolean;
|
|
53
53
|
isUnionValue?: boolean;
|
|
54
54
|
password?: boolean;
|
|
55
55
|
counterVisible?: boolean;
|
|
@@ -41,13 +41,13 @@ export declare const WdInputUrl: React.ForwardRefExoticComponent<CommonPropsType
|
|
|
41
41
|
suffixIcon?: string;
|
|
42
42
|
suffixSrc?: string;
|
|
43
43
|
labelWidth?: string;
|
|
44
|
+
clearable?: boolean;
|
|
44
45
|
inputValue?: string;
|
|
45
46
|
labelVisible?: boolean;
|
|
46
47
|
labelAlign?: string;
|
|
47
48
|
labelWrap?: boolean;
|
|
48
49
|
labelTips?: string;
|
|
49
50
|
cursorSpacing?: number;
|
|
50
|
-
clearable?: boolean;
|
|
51
51
|
isUnionValue?: boolean;
|
|
52
52
|
counterVisible?: boolean;
|
|
53
53
|
borderedH5?: boolean;
|
|
@@ -24,7 +24,7 @@ export const CommonMenuList = forwardRef(function CommonMenuList(props, ref) {
|
|
|
24
24
|
const menuData = useMemo(() => {
|
|
25
25
|
return getMenuList(props.menu);
|
|
26
26
|
}, [props.menu]);
|
|
27
|
-
const setSelectedInfo = useCallback((params = {}, isNavigate = false) => {
|
|
27
|
+
const setSelectedInfo = useCallback(({ params = {}, isNavigate = false, } = {}) => {
|
|
28
28
|
const { key, item } = params || {};
|
|
29
29
|
let selectItem = item;
|
|
30
30
|
if (key || !item) {
|
|
@@ -26,7 +26,7 @@ export const HorizontalMenuList = forwardRef(function HorizontalMenuList(props,
|
|
|
26
26
|
const menuData = useMemo(() => {
|
|
27
27
|
return getMenuList(props.menu);
|
|
28
28
|
}, [props.menu]);
|
|
29
|
-
const setSelectedInfo = useCallback((params = {}, isNavigate = false) => {
|
|
29
|
+
const setSelectedInfo = useCallback(({ params = {}, isNavigate = false, } = {}) => {
|
|
30
30
|
const { key, item } = params || {};
|
|
31
31
|
let selectItem = item;
|
|
32
32
|
if (key || !item) {
|