@cloudbase/weda-ui 3.9.8 → 3.10.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/dataView.d.ts +31 -0
- package/dist/configs/components/dataView.js +53 -16
- package/dist/configs/components/grid/col.d.ts +1 -1
- package/dist/configs/components/grid/col.js +1 -1
- package/dist/configs/components/grid/grid.d.ts +1 -1
- package/dist/configs/components/grid/grid.js +1 -1
- package/dist/configs/components/grid/row.d.ts +1 -1
- package/dist/configs/components/grid/row.js +1 -1
- package/dist/configs/components/listView.d.ts +148 -444
- package/dist/configs/components/listView.js +991 -703
- package/dist/configs/components/wd-bubble.d.ts +6 -6
- package/dist/configs/components/wd-cascader.d.ts +1 -1
- package/dist/configs/components/wd-checkbox.d.ts +1 -1
- package/dist/configs/components/wd-code-editor.d.ts +1 -1
- package/dist/configs/components/wd-date-range.d.ts +1 -1
- package/dist/configs/components/wd-date.d.ts +1 -1
- package/dist/configs/components/wd-department.d.ts +1 -1
- package/dist/configs/components/wd-form-arr.d.ts +1 -1
- package/dist/configs/components/wd-form-detail.d.ts +1 -1
- package/dist/configs/components/wd-form-obj.d.ts +1 -1
- package/dist/configs/components/wd-form.js +2 -1
- package/dist/configs/components/wd-input-email.d.ts +4 -3
- package/dist/configs/components/wd-input-number.d.ts +2 -2
- package/dist/configs/components/wd-input-phone.d.ts +4 -3
- package/dist/configs/components/wd-input-url.d.ts +4 -3
- package/dist/configs/components/wd-input.d.ts +3 -1
- package/dist/configs/components/wd-location.d.ts +1 -1
- package/dist/configs/components/wd-member.d.ts +1 -1
- package/dist/configs/components/wd-modal.js +2 -0
- package/dist/configs/components/wd-progress.d.ts +2 -2
- package/dist/configs/components/wd-radio.d.ts +1 -1
- package/dist/configs/components/wd-rating.d.ts +2 -2
- package/dist/configs/components/wd-region.d.ts +1 -1
- package/dist/configs/components/wd-rich-text.d.ts +1 -1
- package/dist/configs/components/wd-select-multiple.d.ts +18 -1
- package/dist/configs/components/wd-select-multiple.js +17 -1
- package/dist/configs/components/wd-select.d.ts +18 -1
- package/dist/configs/components/wd-select.js +16 -0
- package/dist/configs/components/wd-side-tab.d.ts +12 -0
- package/dist/configs/components/wd-side-tab.js +47 -3
- package/dist/configs/components/wd-switch.d.ts +2 -2
- package/dist/configs/components/wd-table.d.ts +4 -4
- package/dist/configs/components/wd-table.js +2 -1
- package/dist/configs/components/wd-tag-select.d.ts +3 -3
- package/dist/configs/components/wd-tag.d.ts +21 -21
- package/dist/configs/components/wd-textarea.d.ts +8 -1
- package/dist/configs/components/wd-textarea.js +1 -0
- package/dist/configs/components/wd-time.d.ts +1 -1
- package/dist/configs/components/wd-top-tab.d.ts +12 -0
- package/dist/configs/components/wd-top-tab.js +47 -3
- package/dist/configs/components/wd-upload-file.d.ts +5 -1
- package/dist/configs/components/wd-upload-file.js +15 -0
- package/dist/configs/components/wd-upload-image.d.ts +1 -1
- package/dist/configs/index.d.ts +883 -1407
- package/dist/configs/type-utils/index.d.ts +1 -1
- package/dist/configs/type-utils/type-form.d.ts +29 -14
- package/dist/configs/type-utils/type-form.js +43 -10
- package/dist/configs/type-utils/x-runtime-default.d.ts +6 -0
- package/dist/configs/type-utils/x-runtime-default.js +6 -0
- package/dist/configs/utils/constants.d.ts +2 -0
- package/dist/configs/utils/constants.js +3 -0
- package/dist/configs/utils/get-combinations.d.ts +1 -0
- package/dist/configs/utils/get-combinations.js +13 -0
- package/dist/style/components/grid/grid.css +1288 -0
- package/dist/style/index.css +10478 -0
- package/dist/style/index.scss +1 -1
- package/dist/style/weda-ui.min.css +4 -0
- package/dist/web/actions/showMessage/index.js +5 -0
- package/dist/web/components/carousel/index.js +5 -0
- package/dist/web/components/chart/common/core/eChartBase.js +5 -0
- package/dist/web/components/chart/statisticsCard/index.js +6 -1
- package/dist/web/components/form/form/index.js +9 -1
- package/dist/web/components/form/location/common/mapChoose.js +17 -3
- package/dist/web/components/form/location/common/mapView.js +18 -5
- package/dist/web/components/form/select/dropdown-select/h5.d.ts +3 -1
- package/dist/web/components/form/select/dropdown-select/h5.js +20 -20
- package/dist/web/components/form/select/dropdown-select/index.css +8 -0
- package/dist/web/components/form/select/dropdown-select/index.d.ts +6 -1
- package/dist/web/components/form/select/dropdown-select/index.js +64 -30
- package/dist/web/components/form/select/dropdown-select/pc.d.ts +2 -1
- package/dist/web/components/form/select/dropdown-select/pc.js +3 -3
- package/dist/web/components/form/select/dropdown-select/ui.d.ts +5 -0
- package/dist/web/components/form/select/dropdown-select/ui.js +8 -4
- package/dist/web/components/form/select/formats-util.d.ts +1 -0
- package/dist/web/components/form/select/formats-util.js +8 -0
- package/dist/web/components/form/select/h5.d.ts +1 -1
- package/dist/web/components/form/select/h5.js +6 -3
- package/dist/web/components/form/select/index.css +34 -3
- package/dist/web/components/form/select/index.d.ts +3 -0
- package/dist/web/components/form/select/index.js +6 -3
- package/dist/web/components/form/select/region/index.js +5 -1
- package/dist/web/components/form/select/request.js +2 -1
- package/dist/web/components/form/select/status/index.d.ts +2 -0
- package/dist/web/components/form/select/status/index.js +2 -0
- package/dist/web/components/form/selectMultiple/dropdown-select/h5.d.ts +3 -1
- package/dist/web/components/form/selectMultiple/dropdown-select/h5.js +31 -31
- package/dist/web/components/form/selectMultiple/dropdown-select/index.css +23 -0
- package/dist/web/components/form/selectMultiple/dropdown-select/index.d.ts +6 -1
- package/dist/web/components/form/selectMultiple/dropdown-select/index.js +58 -24
- package/dist/web/components/form/selectMultiple/dropdown-select/pc.d.ts +2 -1
- package/dist/web/components/form/selectMultiple/dropdown-select/pc.js +2 -2
- package/dist/web/components/form/selectMultiple/dropdown-select/ui.d.ts +5 -0
- package/dist/web/components/form/selectMultiple/dropdown-select/ui.js +7 -5
- package/dist/web/components/form/selectMultiple/h5.d.ts +1 -1
- package/dist/web/components/form/selectMultiple/h5.js +6 -3
- package/dist/web/components/form/selectMultiple/index.d.ts +5 -0
- package/dist/web/components/form/selectMultiple/index.js +7 -4
- package/dist/web/components/form/selectMultiple/request.js +2 -1
- package/dist/web/components/form/selectMultiple/status/index.d.ts +2 -0
- package/dist/web/components/form/selectMultiple/status/index.js +2 -0
- package/dist/web/components/form/uploader/index.css +26 -0
- package/dist/web/components/form/uploader/uploader.h5.d.ts +11 -3
- package/dist/web/components/form/uploader/uploader.h5.js +32 -96
- package/dist/web/components/form/uploader/uploader.pc.d.ts +9 -1
- package/dist/web/components/form/uploader/uploader.pc.js +36 -100
- package/dist/web/components/form/uploader/useUploadFile.d.ts +16 -0
- package/dist/web/components/form/uploader/useUploadFile.js +99 -0
- package/dist/web/components/form/uploader/util.d.ts +2 -0
- package/dist/web/components/form/uploader/util.js +87 -0
- package/dist/web/components/form/uploaderFile/uploadFile.h5.d.ts +2 -1
- package/dist/web/components/form/uploaderFile/uploadFile.h5.js +14 -4
- package/dist/web/components/form/uploaderFile/uploadFile.pc.d.ts +2 -1
- package/dist/web/components/form/uploaderFile/uploadFile.pc.js +21 -5
- package/dist/web/components/form/userOrgSelect/component/user-select-pc/user-model.js +5 -0
- package/dist/web/components/form/userOrgSelect/component/userOrgSelect.css +8 -0
- package/dist/web/components/form/userOrgSelect/departTreeSelect/departTreeSelect.h5.js +6 -0
- package/dist/web/components/form-date/index.d.ts +9 -10
- package/dist/web/components/form-depart-tree-select/index.d.ts +8 -8
- package/dist/web/components/form-email/index.d.ts +12 -19
- package/dist/web/components/form-image-uploader/index.d.ts +10 -13
- package/dist/web/components/form-input/index.d.ts +4 -4
- package/dist/web/components/form-input-hooks/index.js +7 -1
- package/dist/web/components/form-location/index.d.ts +8 -7
- package/dist/web/components/form-multi-region/index.d.ts +9 -10
- package/dist/web/components/form-phone/index.d.ts +12 -19
- package/dist/web/components/form-radio/index.d.ts +7 -6
- package/dist/web/components/form-region/index.d.ts +9 -10
- package/dist/web/components/form-rich-text/index.d.ts +8 -9
- package/dist/web/components/form-select/index.d.ts +12 -16
- package/dist/web/components/form-select-multiple/index.d.ts +9 -10
- package/dist/web/components/form-switch/index.d.ts +8 -7
- package/dist/web/components/form-text-area/index.d.ts +12 -19
- package/dist/web/components/form-time/index.d.ts +9 -10
- package/dist/web/components/form-upload-file/index.d.ts +10 -13
- package/dist/web/components/form-url/index.d.ts +12 -19
- package/dist/web/components/form-user-tree-select/index.d.ts +8 -8
- package/dist/web/components/grid/col.d.ts +6 -9
- package/dist/web/components/grid/grid.d.ts +6 -14
- package/dist/web/components/grid/row.d.ts +6 -12
- package/dist/web/components/listView/index.d.ts +21 -2
- package/dist/web/components/listView/index.js +0 -3
- package/dist/web/components/listView/interface.d.ts +4 -4
- package/dist/web/components/lottery/index.d.ts +13 -15
- package/dist/web/components/navigationBar/index.css +2 -1
- package/dist/web/components/richText/index.js +6 -0
- package/dist/web/components/richTextView/useImgTransform.js +6 -1
- package/dist/web/components/table/ImportFileModalByApi/index.js +6 -1
- package/dist/web/components/table/ImportFileModalByApi/uploadCSVFile.js +6 -1
- package/dist/web/components/wd-audio/wd-audio.js +5 -0
- package/dist/web/components/wd-canvas/wd-canvas.js +6 -1
- package/dist/web/components/wd-code-editor/wd-code-editor.js +7 -2
- package/dist/web/components/wd-date/elements/WheelPicker.js +7 -1
- package/dist/web/components/wd-form/index.d.ts +26 -40
- package/dist/web/components/wd-form/index.js +9 -2
- package/dist/web/components/wd-form-item/wd-form-item-read-only.d.ts +2 -0
- package/dist/web/components/wd-form-item/wd-form-item-read-only.js +15 -2
- package/dist/web/components/wd-form-item/wd-form-item.js +4 -3
- package/dist/web/components/wd-input/wd-input.d.ts +20 -42
- package/dist/web/components/wd-input-email/wd-input-email.d.ts +19 -41
- package/dist/web/components/wd-input-phone/wd-input-phone.d.ts +20 -42
- package/dist/web/components/wd-input-url/wd-input-url.d.ts +19 -41
- package/dist/web/components/wd-select/relationalSetting.d.ts +7 -0
- package/dist/web/components/wd-select/relationalSetting.js +15 -0
- package/dist/web/components/wd-select/wd-select.css +43 -0
- package/dist/web/components/wd-select/wd-select.d.ts +2 -0
- package/dist/web/components/wd-select/wd-select.js +25 -6
- package/dist/web/components/wd-select-multiple/wd-select-multiple.css +4 -0
- package/dist/web/components/wd-select-multiple/wd-select-multiple.d.ts +6 -0
- package/dist/web/components/wd-select-multiple/wd-select-multiple.js +25 -6
- package/dist/web/components/wd-table/components/FieldRender/Form/Enum.js +18 -4
- package/dist/web/components/wd-table/components/FieldRender/index.js +34 -5
- package/dist/web/components/wd-table/utils/index.js +18 -4
- package/dist/web/components/wd-tabs/tabs-h5.js +2 -3
- package/dist/web/components/wd-tabs/tabs-pc.js +2 -3
- package/dist/web/components/wd-tabs/util.d.ts +1 -0
- package/dist/web/components/wd-tabs/util.js +21 -0
- package/dist/web/components/wd-textarea/wd-textarea.js +11 -1
- package/dist/web/components/wd-unified-link/utils.js +1 -1
- package/dist/web/components/wd-upload-file/wd-upload-file.js +2 -2
- package/dist/web/components/web-view/web-view.d.ts +14 -20
- package/dist/web/utils/color.js +5 -0
- package/dist/web/utils/datasource.js +30 -20
- package/dist/web/utils/error.d.ts +3 -1
- package/dist/web/utils/error.js +9 -4
- package/dist/web/utils/file.js +4 -1
- package/dist/web/utils/getModelParams.js +27 -2
- package/dist/web/utils/hooks/EnumHoc.js +3 -1
- package/dist/web/utils/hooks/useRecycle.d.ts +4 -0
- package/dist/web/utils/loadIconCss.js +2 -1
- package/dist/web/utils/moment.js +2 -1
- package/dist/web/utils/platform.js +5 -2
- package/dist/web/utils/tcb.js +5 -3
- package/dist/web/weda-ui.css +8 -4
- package/package.json +8 -3
|
@@ -5,26 +5,24 @@ import './style';
|
|
|
5
5
|
type TCompRef = ICompRef<{
|
|
6
6
|
start: () => void;
|
|
7
7
|
}>;
|
|
8
|
-
declare const _default: React.ForwardRefExoticComponent<CommonPropsType &
|
|
8
|
+
declare const _default: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
9
9
|
prizeList: {
|
|
10
10
|
title: string;
|
|
11
11
|
image: string;
|
|
12
12
|
}[];
|
|
13
13
|
enablePrize: boolean;
|
|
14
14
|
prizeResult: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}>;
|
|
28
|
-
}]>> & React.RefAttributes<TCompRef>>;
|
|
15
|
+
} & {
|
|
16
|
+
events: {
|
|
17
|
+
clickLotteryButton: (eventDetail: unknown, ...args: unknown[]) => unknown;
|
|
18
|
+
finishLottery: (eventDetail: {
|
|
19
|
+
result: {
|
|
20
|
+
desc: string;
|
|
21
|
+
idx: number;
|
|
22
|
+
};
|
|
23
|
+
prize: string;
|
|
24
|
+
}, ...args: unknown[]) => unknown;
|
|
25
|
+
};
|
|
26
|
+
} & React.RefAttributes<TCompRef>>;
|
|
29
27
|
export default _default;
|
|
30
28
|
export type PropsType = CommonPropsType & DataType & EventsType & {};
|
|
@@ -6,6 +6,7 @@ import { v4 as uuidv4 } from 'uuid';
|
|
|
6
6
|
import { LOAD_ERR_IMG_BASE64, RICH_TEXT_ICON_PACK, getWhitelist, } from '../../utils/constant';
|
|
7
7
|
import { renderDecorator } from '../form/renderDecorator';
|
|
8
8
|
import { usePlatform } from '../../utils/platform';
|
|
9
|
+
import { errorHandler } from '../../utils/error';
|
|
9
10
|
import './style';
|
|
10
11
|
import { useSyncValue } from '../../utils/hooks/useSyncValue';
|
|
11
12
|
import xss from 'xss';
|
|
@@ -141,6 +142,11 @@ initialContent, placeholder, iconPack, maxSize, cloudPath, visible, }) {
|
|
|
141
142
|
return src;
|
|
142
143
|
}
|
|
143
144
|
catch (e) {
|
|
145
|
+
errorHandler({
|
|
146
|
+
code: 'UploadImageError',
|
|
147
|
+
error: e,
|
|
148
|
+
id,
|
|
149
|
+
});
|
|
144
150
|
(_g = (_f = window === null || window === void 0 ? void 0 : window.$w) === null || _f === void 0 ? void 0 : _f.utils) === null || _g === void 0 ? void 0 : _g.showToast({
|
|
145
151
|
title: '上传图片失败',
|
|
146
152
|
icon: 'error',
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
2
|
import { getTempFileURL } from '../../utils/tcb';
|
|
3
3
|
import { LOAD_ERR_IMG_BASE64 } from '../../utils/constant';
|
|
4
|
+
import { errorHandler } from '../../utils/error';
|
|
4
5
|
const regex = new RegExp(/<img [^>]*src=\\*"([^"]*?)\\*"/g);
|
|
5
6
|
const iferror = `javascript:this.width='80';this.src='${LOAD_ERR_IMG_BASE64}';this.onerror=null`;
|
|
6
7
|
const transformImag = (value) => {
|
|
@@ -39,8 +40,12 @@ export const useImgTransform = (value) => {
|
|
|
39
40
|
setDisplayValue(tempValue);
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
|
-
catch (
|
|
43
|
+
catch (error) {
|
|
43
44
|
setDisplayValue(tempValue);
|
|
45
|
+
errorHandler({
|
|
46
|
+
code: 'ImgTransformError',
|
|
47
|
+
error,
|
|
48
|
+
});
|
|
44
49
|
}
|
|
45
50
|
}, [value]);
|
|
46
51
|
return displayValue;
|
|
@@ -3,6 +3,7 @@ import { useEffect, useState } from 'react';
|
|
|
3
3
|
import { Modal, Stepper, Dropdown, List, Status, Icon } from 'tea-component';
|
|
4
4
|
import { UploadCSVFile } from './uploadCSVFile';
|
|
5
5
|
import { alertErrorMessage } from '../../../utils/platform';
|
|
6
|
+
import { errorHandler } from '../../../utils/error';
|
|
6
7
|
import { deepClone } from '../../../utils/tool';
|
|
7
8
|
import { useImportingStatus } from '../hooks/useImportingStatus';
|
|
8
9
|
import { callWedaApi } from '../../../utils/tcb';
|
|
@@ -113,7 +114,11 @@ export function ImportFileModalByApi({ onCancel, handleInOrOutRecordModealVisibl
|
|
|
113
114
|
catch (error) {
|
|
114
115
|
setStatus('error');
|
|
115
116
|
setErrorMessage(['导入文件请求失败', [(error === null || error === void 0 ? void 0 : error.message) || '']]);
|
|
116
|
-
|
|
117
|
+
errorHandler({
|
|
118
|
+
code: 'ImportFileHandleError',
|
|
119
|
+
error,
|
|
120
|
+
message: `导入文件请求失败,${(error === null || error === void 0 ? void 0 : error.message) || ''}`,
|
|
121
|
+
});
|
|
117
122
|
}
|
|
118
123
|
};
|
|
119
124
|
// 枚举 关联关系 主子明细根据可选「选项标识」「选项值」「主列字段」或「数据标识」作为导入匹配标识
|
|
@@ -3,6 +3,7 @@ import { useState } from 'react';
|
|
|
3
3
|
import { Upload, Form, Text, Status, Select, Bubble, Icon, } from 'tea-component';
|
|
4
4
|
import { exportData, getXlsxFileHeader } from '../../../utils/file';
|
|
5
5
|
import { callWedaApi } from '../../../utils/tcb';
|
|
6
|
+
import { errorHandler } from '../../../utils/error';
|
|
6
7
|
import csvTemplate from '../ImportFileModal/csvTemplate.json';
|
|
7
8
|
/**
|
|
8
9
|
* 序列化错误信息
|
|
@@ -93,7 +94,11 @@ export function UploadCSVFile({ parseFile, fields, datasourceTitle, dbName, setD
|
|
|
93
94
|
}
|
|
94
95
|
catch (error) {
|
|
95
96
|
setErrorMsg(`上传文件 CreateDataPreImport 接口调用失败,${(error === null || error === void 0 ? void 0 : error.message) || ''}`);
|
|
96
|
-
|
|
97
|
+
errorHandler({
|
|
98
|
+
code: 'GetUploadUrlError',
|
|
99
|
+
error,
|
|
100
|
+
message: `上传文件 CreateDataPreImport 接口调用失败,${(error === null || error === void 0 ? void 0 : error.message) || ''}`,
|
|
101
|
+
});
|
|
97
102
|
}
|
|
98
103
|
}
|
|
99
104
|
const tipsTemplate = `2、支持xlsx类型文件,要求文件大小10M以内,不能超过50000行,文件名中不可包含! * ' ( ) ; : @ & = + $ , / ? # [ ] 和空格`;
|
|
@@ -7,6 +7,7 @@ import { useConfig } from '../../utils/config-context';
|
|
|
7
7
|
import { usePlatform } from '../../utils/platform';
|
|
8
8
|
import useDebouncedCallback from '../../utils/hooks/use-debounced-callback';
|
|
9
9
|
import { useTempUrl } from '../../utils/hooks/use-cloud-id-temp-url';
|
|
10
|
+
import { errorHandler } from '../../utils/error';
|
|
10
11
|
const MINUTE = 60;
|
|
11
12
|
const DEFAULT_TIME_STR = '--:--';
|
|
12
13
|
const calcTime = (num) => {
|
|
@@ -20,6 +21,10 @@ const calcTime = (num) => {
|
|
|
20
21
|
return `${m}:${s}`;
|
|
21
22
|
}
|
|
22
23
|
catch (error) {
|
|
24
|
+
errorHandler({
|
|
25
|
+
code: 'CalcTimeError',
|
|
26
|
+
error,
|
|
27
|
+
});
|
|
23
28
|
return DEFAULT_TIME_STR;
|
|
24
29
|
}
|
|
25
30
|
};
|
|
@@ -3,6 +3,7 @@ import { forwardRef, useImperativeHandle, useEffect, useState, useCallback, useR
|
|
|
3
3
|
import classNames from '../../utils/classnames';
|
|
4
4
|
import { useConfig } from '../../utils/config-context';
|
|
5
5
|
import { usePlatform } from '../../utils/platform';
|
|
6
|
+
import { errorHandler } from '../../utils/error';
|
|
6
7
|
import debounce from '../../utils/debounce';
|
|
7
8
|
import { useDeepCompareEffect } from '@react-hookz/web';
|
|
8
9
|
const LONGPRESS_TIME = 500; // 长按事件触发定时,ms
|
|
@@ -250,7 +251,11 @@ export const WdCanvas = forwardRef(function WdCanvas(props, ref) {
|
|
|
250
251
|
(_a = props.events) === null || _a === void 0 ? void 0 : _a.canvasReady({ canvasInstance, canvasCtx });
|
|
251
252
|
}
|
|
252
253
|
catch (error) {
|
|
253
|
-
|
|
254
|
+
errorHandler({
|
|
255
|
+
code: 'CanvasInitError',
|
|
256
|
+
error,
|
|
257
|
+
id: props.id,
|
|
258
|
+
});
|
|
254
259
|
}
|
|
255
260
|
}, LONGPRESS_TIME);
|
|
256
261
|
/**
|
|
@@ -6,6 +6,7 @@ import { useConfig } from '../../utils/config-context';
|
|
|
6
6
|
import { WdFormItem } from '../wd-form-item';
|
|
7
7
|
import { useFormInputTrait } from '../form-input-hooks';
|
|
8
8
|
import { filterPropsWithOn, getUuid } from '../../utils/tool';
|
|
9
|
+
import { errorHandler } from '../../utils/error';
|
|
9
10
|
import { useSize } from '../../utils/hooks/useFormLegacy';
|
|
10
11
|
import { useSetWidgetApi } from '../../utils/widget-api/use-set-widget-api';
|
|
11
12
|
import { X_RUNTIME_DEFAULT } from '../../../configs/type-utils/x-runtime-default';
|
|
@@ -61,10 +62,14 @@ export const WdCodeEditor = React.forwardRef(function WdCodeEditor(props, ref) {
|
|
|
61
62
|
return result;
|
|
62
63
|
}
|
|
63
64
|
catch (error) {
|
|
64
|
-
|
|
65
|
+
errorHandler({
|
|
66
|
+
code: 'CodeEditorFormat',
|
|
67
|
+
error,
|
|
68
|
+
id: props.id,
|
|
69
|
+
});
|
|
65
70
|
}
|
|
66
71
|
},
|
|
67
|
-
}), [innerHandle, onChangeForm, value], ref);
|
|
72
|
+
}), [innerHandle, onChangeForm, props.id, value], ref);
|
|
68
73
|
useEffect(() => {
|
|
69
74
|
if (events === null || events === void 0 ? void 0 : events.ready) {
|
|
70
75
|
// eslint-disable-next-line rulesdir/no-trigger-event-in-effect
|
|
@@ -5,6 +5,7 @@ import { useSyncValue } from '../../../utils/hooks/useSyncValue';
|
|
|
5
5
|
import classNames from '../../../utils/classnames';
|
|
6
6
|
import equal from '../../../utils/isObjectEqual';
|
|
7
7
|
import { useConfig } from '../../../utils/config-context';
|
|
8
|
+
import { errorHandler } from '../../../utils/error';
|
|
8
9
|
/**
|
|
9
10
|
* 多列选择器
|
|
10
11
|
*/
|
|
@@ -28,7 +29,12 @@ export function WheelPicker(props) {
|
|
|
28
29
|
setValue(newValue);
|
|
29
30
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
30
31
|
}
|
|
31
|
-
catch (
|
|
32
|
+
catch (error) {
|
|
33
|
+
errorHandler({
|
|
34
|
+
code: 'WheelPickerError',
|
|
35
|
+
error,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
32
38
|
};
|
|
33
39
|
return (_jsx("div", { className: `${classPrefix}-custom-picker__columns size-s`, children: items.map((item, i) => (_jsx(ItemPicker, { value: value[i], options: item, onChange: (v) => handleChange(v, i) }, i))) }));
|
|
34
40
|
}
|
|
@@ -6,7 +6,7 @@ import '../style';
|
|
|
6
6
|
export type WdFromProps = CommonPropsType & DataType & EventsType & {
|
|
7
7
|
appCloud: typeof tcbAppCloud;
|
|
8
8
|
};
|
|
9
|
-
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<CommonPropsType &
|
|
9
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<CommonPropsType & {
|
|
10
10
|
_id?: string;
|
|
11
11
|
value: Record<string, any>;
|
|
12
12
|
formType: "create" | "edit" | "read";
|
|
@@ -28,45 +28,31 @@ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponen
|
|
|
28
28
|
colNum: never;
|
|
29
29
|
lgWidth: "lg" | "sm" | "md" | "hundred";
|
|
30
30
|
initialValues: Record<string, unknown>;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
data: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TAny>;
|
|
57
|
-
}>;
|
|
58
|
-
}, {
|
|
59
|
-
readonly title: "查询失败";
|
|
60
|
-
readonly name: "queryFail";
|
|
61
|
-
readonly detail: import("@sinclair/typebox").TObject<{
|
|
62
|
-
error: import("@sinclair/typebox").TObject<{
|
|
63
|
-
requestid: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
64
|
-
message: import("@sinclair/typebox").TString;
|
|
65
|
-
code: import("@sinclair/typebox").TString;
|
|
66
|
-
original: import("@sinclair/typebox").TAny;
|
|
67
|
-
}>;
|
|
68
|
-
}>;
|
|
69
|
-
}]>> & {
|
|
31
|
+
} & {
|
|
32
|
+
events: {
|
|
33
|
+
submit: (eventDetail: unknown, ...args: unknown[]) => unknown;
|
|
34
|
+
validateSuccess: (eventDetail: {
|
|
35
|
+
errors: Record<string, string>;
|
|
36
|
+
}, ...args: unknown[]) => unknown;
|
|
37
|
+
validateFail: (eventDetail: {
|
|
38
|
+
errors: Record<string, string>;
|
|
39
|
+
}, ...args: unknown[]) => unknown;
|
|
40
|
+
queryEmpty: (eventDetail: {
|
|
41
|
+
data: Record<string, any>;
|
|
42
|
+
}, ...args: unknown[]) => unknown;
|
|
43
|
+
querySuccess: (eventDetail: {
|
|
44
|
+
data: Record<string, any>;
|
|
45
|
+
}, ...args: unknown[]) => unknown;
|
|
46
|
+
queryFail: (eventDetail: {
|
|
47
|
+
error: {
|
|
48
|
+
requestid?: string;
|
|
49
|
+
code: string;
|
|
50
|
+
message: string;
|
|
51
|
+
original: any;
|
|
52
|
+
};
|
|
53
|
+
}, ...args: unknown[]) => unknown;
|
|
54
|
+
};
|
|
55
|
+
} & {
|
|
70
56
|
appCloud: typeof tcbAppCloud;
|
|
71
57
|
} & React.RefAttributes<unknown>>>;
|
|
72
58
|
export default _default;
|
|
@@ -3,6 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, } from 'react';
|
|
4
4
|
import { useMap, useMountEffect, useSyncedRef, useUnmountEffect, } from '@react-hookz/web';
|
|
5
5
|
import { unstable_batchedUpdates } from 'react-dom';
|
|
6
|
+
import { errorHandler } from '../../utils/error';
|
|
6
7
|
import { isInIde, usePlatform } from '../../utils/platform';
|
|
7
8
|
import classNames from '../../utils/classnames';
|
|
8
9
|
import { debug } from '../../utils/console';
|
|
@@ -312,9 +313,15 @@ const WdForm = React.forwardRef(function WdForm(props, ref) {
|
|
|
312
313
|
setStateForAuth('rw');
|
|
313
314
|
});
|
|
314
315
|
});
|
|
315
|
-
|
|
316
|
+
errorHandler({
|
|
317
|
+
code: 'InitFormSetDataSourceFieldsWithAuthError',
|
|
318
|
+
error,
|
|
319
|
+
id,
|
|
320
|
+
});
|
|
316
321
|
}
|
|
317
|
-
},
|
|
322
|
+
},
|
|
323
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
324
|
+
[formsItemMap]);
|
|
318
325
|
const { data: formInitValueToSet } = useInitValueFromRemote(datasourceType, dataSourceProfile, fetchedInitialValues);
|
|
319
326
|
useEffect(() => {
|
|
320
327
|
if (initValueLoadingStatus !== 'done' || !fetchedInitialValues)
|
|
@@ -3,12 +3,14 @@ import { useMemo } from 'react';
|
|
|
3
3
|
import { useConfig } from '../../utils/config-context';
|
|
4
4
|
import { usePlatform, textToString } from '../../utils/platform';
|
|
5
5
|
import { useRecycle } from '../../utils/hooks/useRecycle';
|
|
6
|
+
import { WdTag } from '../wd-tag';
|
|
7
|
+
import { isFormatWithRelation } from '../form/select/formats-util';
|
|
6
8
|
/**
|
|
7
9
|
* 只读展示,参数 props 覆盖 Context
|
|
8
10
|
*/
|
|
9
11
|
export function WdFormItemReadOnly(props) {
|
|
10
12
|
const ctx = useRecycle();
|
|
11
|
-
const { readValue, readOnly, version, readBeforeAfter, before, after } = Object.assign({}, ctx, props);
|
|
13
|
+
const { readValue, readOnly, version, readBeforeAfter, before, after, format, onRelationTagClick = undefined, value, } = Object.assign({}, ctx, props);
|
|
12
14
|
const platform = usePlatform();
|
|
13
15
|
const { classPrefix } = useConfig();
|
|
14
16
|
const item = `${classPrefix}-form-item`;
|
|
@@ -16,5 +18,16 @@ export function WdFormItemReadOnly(props) {
|
|
|
16
18
|
const _readValue = useMemo(() => textToString(readValue), [readValue]);
|
|
17
19
|
const _before = useMemo(() => readBeforeAfter && textToString(before), [before, readBeforeAfter]);
|
|
18
20
|
const _after = useMemo(() => readBeforeAfter && textToString(after), [after, readBeforeAfter]);
|
|
19
|
-
|
|
21
|
+
const isRelation = isFormatWithRelation(format);
|
|
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) => ({
|
|
24
|
+
label: i,
|
|
25
|
+
value: Array.isArray(value) ? value[index] : value,
|
|
26
|
+
prefixType: !isXEnum && 'inner',
|
|
27
|
+
prefixIcon: isXEnum ? '' : 'td:link-1',
|
|
28
|
+
})), tagStyleType: 'light', tagStyleWidthCols: 4, events: {
|
|
29
|
+
click: (item) => {
|
|
30
|
+
onRelationTagClick === null || onRelationTagClick === void 0 ? void 0 : onRelationTagClick(item);
|
|
31
|
+
},
|
|
32
|
+
} })) : (_readValue) }), _after && _jsx("span", { className: `${item}__readonly-after`, children: _after })] })) : (props.children);
|
|
20
33
|
}
|
|
@@ -10,8 +10,9 @@ import { X_RUNTIME_DEFAULT } from '../../../configs/type-utils/x-runtime-default
|
|
|
10
10
|
/**
|
|
11
11
|
* 表单项包裹,包括标题、文本提示、校验
|
|
12
12
|
*/
|
|
13
|
+
// eslint-disable-next-line complexity
|
|
13
14
|
export function WdFormItem(props) {
|
|
14
|
-
const { id, className, style, label, labelVisible = X_RUNTIME_DEFAULT.labelVisible, labelTips = X_RUNTIME_DEFAULT.labelTips, labelWidth: _labelWidth = X_RUNTIME_DEFAULT.labelWidth, labelWrap = X_RUNTIME_DEFAULT.labelWrap, extra = X_RUNTIME_DEFAULT.extra, required = X_RUNTIME_DEFAULT.required, readOnly, children, testId, requiredFlag = X_RUNTIME_DEFAULT.requiredFlag, validateState, validateErrorMsg, readValue, borderedH5 = X_RUNTIME_DEFAULT.borderedH5, borderedPc = X_RUNTIME_DEFAULT.borderedPc, classRoot, controlAlign, inputId, isWdFormDetail, before, after, readBeforeAfter = true, visible = true, LabelContainer = null, isRoot = true, } = props;
|
|
15
|
+
const { id, className, style, label, labelVisible = X_RUNTIME_DEFAULT.labelVisible, labelTips = X_RUNTIME_DEFAULT.labelTips, labelWidth: _labelWidth = X_RUNTIME_DEFAULT.labelWidth, labelWrap = X_RUNTIME_DEFAULT.labelWrap, extra = X_RUNTIME_DEFAULT.extra, required = X_RUNTIME_DEFAULT.required, readOnly, children, testId, requiredFlag = X_RUNTIME_DEFAULT.requiredFlag, validateState, validateErrorMsg, readValue, borderedH5 = X_RUNTIME_DEFAULT.borderedH5, borderedPc = X_RUNTIME_DEFAULT.borderedPc, classRoot, controlAlign, inputId, isWdFormDetail, before, after, readBeforeAfter = true, visible = true, LabelContainer = null, isRoot = true, LabelAdornment, format, value, } = props;
|
|
15
16
|
const { classPrefix } = useConfig();
|
|
16
17
|
const platform = usePlatform();
|
|
17
18
|
const isH5 = platform === 'h5';
|
|
@@ -52,9 +53,9 @@ export function WdFormItem(props) {
|
|
|
52
53
|
[`${itemWrap}__control-wrap--right`]: controlAlign === 'right',
|
|
53
54
|
});
|
|
54
55
|
// 输入部分
|
|
55
|
-
const Item = (_jsx("div", { className: `${itemWrap}__control`, "data-testid": testId, children: _jsx("div", { className: controlWrapCls, children: _jsx(WdFormItemReadOnly, { readOnly: readOnly, readValue: readValue, version: "wd", before: before, after: after, readBeforeAfter: readBeforeAfter, children: children }) }) }));
|
|
56
|
+
const Item = (_jsx("div", { className: `${itemWrap}__control`, "data-testid": testId, children: _jsx("div", { className: controlWrapCls, children: _jsx(WdFormItemReadOnly, { readOnly: readOnly, readValue: readValue, version: "wd", before: before, after: after, readBeforeAfter: readBeforeAfter, format: format, value: value, children: children }) }) }));
|
|
56
57
|
// 标题部分,含必填、提示
|
|
57
|
-
const Label = labelVisible && (
|
|
58
|
+
const Label = labelVisible && (_jsxs("div", { className: labelCls, style: labelStyle, children: [_jsxs("label", { className: `${itemWrap}__label-content`, htmlFor: inputId, children: [_jsx("span", { className: `${itemWrap}__label-text ${labelRoot}-text`, title: label, children: textToString(label) }), labelTips && (_jsx("span", { className: `${itemWrap}__label-explain`, children: _jsx(WdBubble, { style: { display: 'inline' }, bubbleChildren: _jsx(WdIcon, { name: "td:help-circle", size: iconSize }), bubbleContent: textToString(labelTips), promptTheme: "dark" }) }))] }), LabelAdornment && (_jsx("div", { className: `${itemWrap}__label-adornment`, children: LabelAdornment }))] }));
|
|
58
59
|
// 下方空白替代(改为距左对齐)
|
|
59
60
|
// const LabelSpace = labelVisible && layout === 'horizontal' && (
|
|
60
61
|
// <div className={labelCls} style={labelStyle}></div>
|
|
@@ -4,12 +4,12 @@ import type { DataType, EventsType } from '../../../configs/components/wd-input'
|
|
|
4
4
|
/**
|
|
5
5
|
* 标准化:单行输入组件
|
|
6
6
|
*/
|
|
7
|
-
export declare const WdInput: React.ForwardRefExoticComponent<CommonPropsType &
|
|
7
|
+
export declare const WdInput: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
8
8
|
type?: string;
|
|
9
|
+
name?: string;
|
|
9
10
|
label?: string;
|
|
10
11
|
template?: string;
|
|
11
12
|
focus?: boolean;
|
|
12
|
-
name?: string;
|
|
13
13
|
required?: boolean;
|
|
14
14
|
extra?: string;
|
|
15
15
|
size?: string;
|
|
@@ -41,51 +41,29 @@ export declare const WdInput: React.ForwardRefExoticComponent<CommonPropsType &
|
|
|
41
41
|
borderedPc?: boolean;
|
|
42
42
|
rules?: {
|
|
43
43
|
format: string;
|
|
44
|
-
pattern: string;
|
|
45
44
|
message: string;
|
|
45
|
+
pattern: string;
|
|
46
46
|
}[];
|
|
47
47
|
requiredFlag?: boolean;
|
|
48
48
|
requiredMsg?: string;
|
|
49
49
|
isConvert?: boolean;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
value: import("@sinclair/typebox").TString;
|
|
68
|
-
}>;
|
|
69
|
-
}, {
|
|
70
|
-
name: string;
|
|
71
|
-
title: string;
|
|
72
|
-
detail: import("@sinclair/typebox").TObject<{
|
|
73
|
-
value: import("@sinclair/typebox").TString;
|
|
74
|
-
}>;
|
|
75
|
-
}, {
|
|
76
|
-
name: string;
|
|
77
|
-
title: string;
|
|
78
|
-
detail: import("@sinclair/typebox").TObject<{
|
|
79
|
-
originValue: import("@sinclair/typebox").TString;
|
|
80
|
-
}>;
|
|
81
|
-
}, {
|
|
82
|
-
name: string;
|
|
83
|
-
title: string;
|
|
84
|
-
description: string;
|
|
85
|
-
detail: import("@sinclair/typebox").TObject<{
|
|
86
|
-
type: import("@sinclair/typebox").TString;
|
|
87
|
-
}>;
|
|
88
|
-
}]>> & {
|
|
50
|
+
} & {
|
|
51
|
+
events: {
|
|
52
|
+
[x: string]: ((eventDetail: {
|
|
53
|
+
value: string;
|
|
54
|
+
}, ...args: unknown[]) => unknown) | ((eventDetail: {
|
|
55
|
+
value: string;
|
|
56
|
+
}, ...args: unknown[]) => unknown) | ((eventDetail: {
|
|
57
|
+
value: string;
|
|
58
|
+
}, ...args: unknown[]) => unknown) | ((eventDetail: {
|
|
59
|
+
value: string;
|
|
60
|
+
}, ...args: unknown[]) => unknown) | ((eventDetail: {
|
|
61
|
+
originValue: string;
|
|
62
|
+
}, ...args: unknown[]) => unknown) | ((eventDetail: {
|
|
63
|
+
type: string;
|
|
64
|
+
}, ...args: unknown[]) => unknown);
|
|
65
|
+
};
|
|
66
|
+
} & {
|
|
89
67
|
wrapClassName?: string;
|
|
90
68
|
classRoot?: string;
|
|
91
69
|
inputPattern?: RegExp;
|
|
@@ -4,11 +4,11 @@ import type { DataType, EventsType } from '../../../configs/components/wd-input-
|
|
|
4
4
|
/**
|
|
5
5
|
* 标准化:邮箱输入组件
|
|
6
6
|
*/
|
|
7
|
-
export declare const WdInputEmail: React.ForwardRefExoticComponent<CommonPropsType &
|
|
7
|
+
export declare const WdInputEmail: React.ForwardRefExoticComponent<CommonPropsType & {
|
|
8
|
+
name?: string;
|
|
8
9
|
label?: string;
|
|
9
10
|
template?: string;
|
|
10
11
|
focus?: boolean;
|
|
11
|
-
name?: string;
|
|
12
12
|
required?: boolean;
|
|
13
13
|
extra?: string;
|
|
14
14
|
size?: string;
|
|
@@ -39,43 +39,21 @@ export declare const WdInputEmail: React.ForwardRefExoticComponent<CommonPropsTy
|
|
|
39
39
|
requiredFlag?: boolean;
|
|
40
40
|
requiredMsg?: string;
|
|
41
41
|
isConvert?: boolean;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
value: import("@sinclair/typebox").TString;
|
|
60
|
-
}>;
|
|
61
|
-
}, {
|
|
62
|
-
name: string;
|
|
63
|
-
title: string;
|
|
64
|
-
detail: import("@sinclair/typebox").TObject<{
|
|
65
|
-
value: import("@sinclair/typebox").TString;
|
|
66
|
-
}>;
|
|
67
|
-
}, {
|
|
68
|
-
name: string;
|
|
69
|
-
title: string;
|
|
70
|
-
detail: import("@sinclair/typebox").TObject<{
|
|
71
|
-
originValue: import("@sinclair/typebox").TString;
|
|
72
|
-
}>;
|
|
73
|
-
}, {
|
|
74
|
-
name: string;
|
|
75
|
-
title: string;
|
|
76
|
-
description: string;
|
|
77
|
-
detail: import("@sinclair/typebox").TObject<{
|
|
78
|
-
type: import("@sinclair/typebox").TString;
|
|
79
|
-
}>;
|
|
80
|
-
}]>> & React.RefAttributes<unknown>>;
|
|
42
|
+
} & {
|
|
43
|
+
events: {
|
|
44
|
+
[x: string]: ((eventDetail: {
|
|
45
|
+
value: string;
|
|
46
|
+
}, ...args: unknown[]) => unknown) | ((eventDetail: {
|
|
47
|
+
value: string;
|
|
48
|
+
}, ...args: unknown[]) => unknown) | ((eventDetail: {
|
|
49
|
+
value: string;
|
|
50
|
+
}, ...args: unknown[]) => unknown) | ((eventDetail: {
|
|
51
|
+
value: string;
|
|
52
|
+
}, ...args: unknown[]) => unknown) | ((eventDetail: {
|
|
53
|
+
originValue: string;
|
|
54
|
+
}, ...args: unknown[]) => unknown) | ((eventDetail: {
|
|
55
|
+
type: string;
|
|
56
|
+
}, ...args: unknown[]) => unknown);
|
|
57
|
+
};
|
|
58
|
+
} & React.RefAttributes<unknown>>;
|
|
81
59
|
export type WdInputEmailProps = CommonPropsType & DataType & EventsType & {};
|