@cloudbase/weda-ui 3.20.1 → 3.20.3
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/chart/bar.js +2 -2
- package/dist/configs/components/chart/line.js +2 -2
- package/dist/configs/components/chart/pie.js +2 -2
- package/dist/configs/components/chart/statisticsCard.json +5 -12
- package/dist/configs/components/form/location.json +3 -9
- package/dist/configs/components/form-location.d.ts +2 -2
- package/dist/configs/components/form-location.js +1 -1
- package/dist/configs/components/form-user-tree-select.js +1 -1
- package/dist/configs/components/scrollVeiw.json +43 -79
- package/dist/configs/components/wd-calendar.d.ts +4 -0
- package/dist/configs/components/wd-calendar.js +23 -1
- package/dist/configs/components/wd-cascader.d.ts +7 -12
- package/dist/configs/components/wd-cascader.js +12 -1
- package/dist/configs/components/wd-checkbox.d.ts +4 -1
- package/dist/configs/components/wd-checkbox.js +11 -1
- package/dist/configs/components/wd-location.d.ts +2 -2
- package/dist/configs/components/wd-location.js +1 -1
- package/dist/configs/components/wd-member.d.ts +2 -0
- package/dist/configs/components/wd-member.js +5 -1
- package/dist/configs/components/wd-radio.d.ts +4 -1
- package/dist/configs/components/wd-rich-text.d.ts +2 -0
- package/dist/configs/components/wd-rich-text.js +1 -0
- package/dist/configs/components/wd-select-multiple.d.ts +4 -1
- package/dist/configs/components/wd-select-multiple.js +11 -1
- package/dist/configs/components/wd-select.d.ts +4 -1
- package/dist/configs/components/wd-table.js +3 -2
- package/dist/configs/components/wd-tag-select.d.ts +4 -1
- package/dist/configs/components/wd-tag-select.js +11 -1
- package/dist/configs/components/wd-top-tab.d.ts +1 -1
- package/dist/configs/components/wd-top-tab.js +2 -1
- package/dist/configs/components/wd-upload-file.d.ts +2 -0
- package/dist/configs/components/wd-upload-file.js +1 -0
- package/dist/configs/components/wd-upload-image.d.ts +18 -11
- package/dist/configs/components/wd-upload-image.js +8 -6
- package/dist/configs/index.d.ts +130 -74
- package/dist/configs/type-utils/type-form.d.ts +12 -4
- package/dist/configs/type-utils/type-form.js +54 -4
- package/dist/enum/index.js +1 -0
- package/dist/style/index.css +1 -0
- 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 +3 -3
- package/dist/web/components/form/location/common/propsConfig.js +2 -2
- package/dist/web/components/form/location/components/LocationH5/location.h5.js +36 -27
- package/dist/web/components/form/location/components/LocationPC/Header.js +2 -2
- package/dist/web/components/form/location/components/LocationPC/location.PC.js +38 -41
- package/dist/web/components/form/uploader/upload/index.d.ts +1 -0
- package/dist/web/components/form/uploader/upload/index.js +7 -5
- package/dist/web/components/form/uploader/uploader.h5.d.ts +1 -0
- 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 +7 -3
- package/dist/web/components/form/uploaderFile/uploadFile.h5.d.ts +2 -1
- package/dist/web/components/form/uploaderFile/uploadFile.h5.js +11 -8
- package/dist/web/components/form/uploaderFile/uploadFile.pc.d.ts +2 -1
- package/dist/web/components/form/uploaderFile/uploadFile.pc.js +11 -8
- package/dist/web/components/form-location/index.d.ts +1 -1
- package/dist/web/components/form-location/index.js +3 -3
- package/dist/web/components/form-user-tree-select/index.js +4 -2
- package/dist/web/components/richText/index.d.ts +4 -1
- package/dist/web/components/richText/index.js +16 -14
- package/dist/web/components/uploaderFileView/index.js +3 -3
- package/dist/web/components/wd-calendar/wd-calendar.js +4 -11
- package/dist/web/components/wd-calendar/weeks.d.ts +1 -1
- package/dist/web/components/wd-calendar/weeks.js +2 -2
- package/dist/web/components/wd-form/index.js +12 -7
- package/dist/web/components/wd-location/wd-location.d.ts +1 -1
- package/dist/web/components/wd-location/wd-location.js +2 -2
- package/dist/web/components/wd-member/wd-member.js +4 -2
- package/dist/web/components/wd-rich-text/wd-rich-text.js +2 -2
- package/dist/web/components/wd-select/select/selectUI.js +4 -1
- package/dist/web/components/wd-table/components/ExportFileModalByApi/index.js +3 -2
- package/dist/web/components/wd-table/hooks/useTableData.js +8 -3
- package/dist/web/components/wd-upload-file/wd-upload-file.js +2 -2
- package/dist/web/components/wd-upload-image/wd-upload-image.js +2 -2
- package/package.json +2 -2
|
@@ -48,7 +48,7 @@ id, style, className = '', events,
|
|
|
48
48
|
label, labelVisible, value, readOnly, layout, disabled, requiredFlag, onChange, decorator = undefined, acceptTypes,
|
|
49
49
|
// acceptAudioTypes,
|
|
50
50
|
// acceptVideoTypes,
|
|
51
|
-
initialContent, placeholder, iconPack, maxSize, cloudPath, visible, }) {
|
|
51
|
+
initialContent, placeholder, iconPack, maxSize, cloudPath, visible, storageType = 'cloudID', }) {
|
|
52
52
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
53
53
|
const platform = usePlatform();
|
|
54
54
|
const isH5 = platform === 'h5';
|
|
@@ -109,24 +109,24 @@ initialContent, placeholder, iconPack, maxSize, cloudPath, visible, }) {
|
|
|
109
109
|
return true;
|
|
110
110
|
};
|
|
111
111
|
const upload = async (file) => {
|
|
112
|
-
var _a, _b, _c, _d, _e;
|
|
112
|
+
var _a, _b, _c, _d, _e, _f;
|
|
113
113
|
const tcb = await ((_b = (_a = window === null || window === void 0 ? void 0 : window.app) === null || _a === void 0 ? void 0 : _a.cloud) === null || _b === void 0 ? void 0 : _b.getCloudInstance());
|
|
114
114
|
try {
|
|
115
115
|
const fileType = (_e = (_d = (_c = file === null || file === void 0 ? void 0 : file.name) === null || _c === void 0 ? void 0 : _c.split('.')) === null || _d === void 0 ? void 0 : _d.pop()) === null || _e === void 0 ? void 0 : _e.toLowerCase();
|
|
116
116
|
const _uploadPath = getDefaultUploadPath(cloudPath);
|
|
117
117
|
const path = `${_uploadPath}/uploader-${uuidv4()}.${fileType}`;
|
|
118
|
-
const
|
|
118
|
+
const res = await tcb.uploadFile({
|
|
119
119
|
cloudPath: path,
|
|
120
120
|
filePath: file,
|
|
121
121
|
});
|
|
122
|
-
|
|
123
|
-
const
|
|
124
|
-
|
|
122
|
+
const { fileID, download_url } = res;
|
|
123
|
+
const url = (_f = download_url === null || download_url === void 0 ? void 0 : download_url.split('?')) === null || _f === void 0 ? void 0 : _f[0];
|
|
124
|
+
cloudRef.current.cloudToHttpsMap[fileID] = url;
|
|
125
125
|
setCurrentMap(cloudRef.current.cloudToHttpsMap);
|
|
126
126
|
if (!ref.current.editor.hasFocus()) {
|
|
127
127
|
ref.current.editor.focus();
|
|
128
128
|
}
|
|
129
|
-
return
|
|
129
|
+
return url;
|
|
130
130
|
}
|
|
131
131
|
catch (e) {
|
|
132
132
|
errorHandler({
|
|
@@ -251,12 +251,14 @@ initialContent, placeholder, iconPack, maxSize, cloudPath, visible, }) {
|
|
|
251
251
|
var _a;
|
|
252
252
|
setCurrentCursor(((_a = editor.selection()) === null || _a === void 0 ? void 0 : _a.from) || 0);
|
|
253
253
|
let html = editor.getHTML();
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
254
|
+
if (storageType !== 'https') {
|
|
255
|
+
const map = cloudRef.current.cloudToHttpsMap || {};
|
|
256
|
+
Object.keys(map).forEach((key) => {
|
|
257
|
+
if (map[key]) {
|
|
258
|
+
html = html.replaceAll(`${map[key]}`.replaceAll('&', '&'), `${key}`);
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
}
|
|
260
262
|
onDataChange(html);
|
|
261
263
|
if (html.length > 262144) {
|
|
262
264
|
console.warn('富文本长度过长,可能导致保存失败,当前', html.length);
|
|
@@ -273,7 +275,7 @@ initialContent, placeholder, iconPack, maxSize, cloudPath, visible, }) {
|
|
|
273
275
|
};
|
|
274
276
|
}
|
|
275
277
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
276
|
-
}, [window === null || window === void 0 ? void 0 : window.ExEditor3, toolbar]);
|
|
278
|
+
}, [window === null || window === void 0 ? void 0 : window.ExEditor3, toolbar, storageType]);
|
|
277
279
|
React.useEffect(() => {
|
|
278
280
|
if (ref.current.editor) {
|
|
279
281
|
if (readOnly || disabled) {
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { UploadFilePc } from '../form/uploaderFile/uploadFile.pc';
|
|
4
4
|
import { UploadFileH5 } from '../form/uploaderFile/uploadFile.h5';
|
|
5
|
-
import { filterStrList, isCloudFileID, downloadFile, usePlatform, transFileCloudidToName, } from '../../utils/platform';
|
|
5
|
+
import { filterStrList, isCloudFileID, isHttpFileID, downloadFile, usePlatform, transFileCloudidToName, } from '../../utils/platform';
|
|
6
6
|
import { useTempUrl } from '../../utils/hooks/use-cloud-id-temp-url';
|
|
7
7
|
import './style';
|
|
8
8
|
const CLASS_PREFIX = 'weda-uploader-file-view';
|
|
@@ -28,7 +28,7 @@ export default function UploaderFileView(props) {
|
|
|
28
28
|
value: fileIDList,
|
|
29
29
|
isEdit: false,
|
|
30
30
|
};
|
|
31
|
-
return showTypeMix === 'pc' ?
|
|
31
|
+
return showTypeMix === 'pc' ? _jsx(UploadFilePc, { ...uploadFileProps }) : _jsx(UploadFileH5, { ...uploadFileProps });
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
@@ -37,7 +37,7 @@ export default function UploaderFileView(props) {
|
|
|
37
37
|
const FileView = ({ fileID }) => {
|
|
38
38
|
const { data: src } = useTempUrl(fileID);
|
|
39
39
|
const title = React.useMemo(() => {
|
|
40
|
-
if (isCloudFileID(fileID)) {
|
|
40
|
+
if (isCloudFileID(fileID) || isHttpFileID(fileID)) {
|
|
41
41
|
return transFileCloudidToName(fileID);
|
|
42
42
|
}
|
|
43
43
|
else {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo, forwardRef, useImperativeHandle, useCallback
|
|
2
|
+
import { useMemo, forwardRef, useImperativeHandle, useCallback } from 'react';
|
|
3
3
|
import { usePlatform } from '../../utils/platform';
|
|
4
4
|
import { setRefProp } from '../../utils/tool';
|
|
5
5
|
import classNames from '../../utils/classnames';
|
|
@@ -12,7 +12,7 @@ import './style';
|
|
|
12
12
|
* 日历标准化
|
|
13
13
|
*/
|
|
14
14
|
export const WdClendar = forwardRef(function WdClendar(props, ref) {
|
|
15
|
-
const { initVisible = true, configData, events, id, className, style, } = props;
|
|
15
|
+
const { initVisible = true, configData, events, id, className, style, start = null, end = null } = props;
|
|
16
16
|
const valueStamp = useMemo(() => { var _a, _b; return (_b = (_a = getStartMoment('day', props.value)) === null || _a === void 0 ? void 0 : _a.valueOf()) !== null && _b !== void 0 ? _b : null; }, [props.value]);
|
|
17
17
|
const monthStamp = useMemo(() => { var _a, _b; return (_b = (_a = getStartMoment('month', props.initMonth)) === null || _a === void 0 ? void 0 : _a.valueOf()) !== null && _b !== void 0 ? _b : null; }, [props.initMonth]);
|
|
18
18
|
const [value, setValue] = useSyncValue(valueStamp);
|
|
@@ -23,7 +23,7 @@ export const WdClendar = forwardRef(function WdClendar(props, ref) {
|
|
|
23
23
|
const cls = classNames(blockName, 'weda-ui', `${blockName}-${platform}`, className);
|
|
24
24
|
const { year: monthYear, month: monthMonth } = yearMonthItem;
|
|
25
25
|
const configDataObj = useMemo(() => getConfigDataObj(configData), [configData]);
|
|
26
|
-
const weeks = useMemo(() => convertWeeks(monthYear, monthMonth, configDataObj), [monthYear, monthMonth, configDataObj]);
|
|
26
|
+
const weeks = useMemo(() => convertWeeks(monthYear, monthMonth, configDataObj, [start, end]), [monthYear, monthMonth, configDataObj, start, end]);
|
|
27
27
|
// 含转时间戳逻辑
|
|
28
28
|
const setValueMethod = useCallback((v) => {
|
|
29
29
|
var _a;
|
|
@@ -45,14 +45,7 @@ export const WdClendar = forwardRef(function WdClendar(props, ref) {
|
|
|
45
45
|
initMonth: monthValue,
|
|
46
46
|
initVisible,
|
|
47
47
|
value,
|
|
48
|
-
}), [
|
|
49
|
-
setValueMethod,
|
|
50
|
-
setInitMonthMethod,
|
|
51
|
-
configData,
|
|
52
|
-
monthValue,
|
|
53
|
-
initVisible,
|
|
54
|
-
value,
|
|
55
|
-
]);
|
|
48
|
+
}), [setValueMethod, setInitMonthMethod, configData, monthValue, initVisible, value]);
|
|
56
49
|
// 选中日期
|
|
57
50
|
const handleChange = (item) => {
|
|
58
51
|
var _a, _b;
|
|
@@ -9,7 +9,7 @@ interface IconfigDataObj {
|
|
|
9
9
|
}
|
|
10
10
|
export declare const blockName = "weda-calendar";
|
|
11
11
|
export declare const getConfigDataObj: (configData?: IconfigData[]) => IconfigDataObj;
|
|
12
|
-
export declare const convertWeeks: (year: any, month: any, configDataObj?: IconfigDataObj) => import("../../utils/hooks/useFormLegacy").IWeekItem[][] | {
|
|
12
|
+
export declare const convertWeeks: (year: any, month: any, configDataObj?: IconfigDataObj, range?: any[]) => import("../../utils/hooks/useFormLegacy").IWeekItem[][] | {
|
|
13
13
|
matchDate?: string;
|
|
14
14
|
disabled?: string | boolean;
|
|
15
15
|
marked?: string | boolean;
|
|
@@ -17,8 +17,8 @@ export const getConfigDataObj = (configData) => {
|
|
|
17
17
|
return obj;
|
|
18
18
|
};
|
|
19
19
|
// 年月转星期
|
|
20
|
-
export const convertWeeks = (year, month, configDataObj) => {
|
|
21
|
-
const weeks = convertYearMonthToWeeks(year, month,
|
|
20
|
+
export const convertWeeks = (year, month, configDataObj, range) => {
|
|
21
|
+
const weeks = convertYearMonthToWeeks(year, month, range, {
|
|
22
22
|
isPreNext: true,
|
|
23
23
|
isDynamic: true,
|
|
24
24
|
});
|
|
@@ -347,7 +347,7 @@ const WdForm = React.forwardRef(function WdForm(props, ref) {
|
|
|
347
347
|
useSetWidgetApi(() => {
|
|
348
348
|
const r = {
|
|
349
349
|
formType,
|
|
350
|
-
addFormItem(name, formItem, { initialValue, namePath }) {
|
|
350
|
+
addFormItem(name, formItem, { initialValue, namePath } = {}) {
|
|
351
351
|
if (isNil(name) || (typeof name === 'string' && name.length === 0)) {
|
|
352
352
|
// name 没设置或为空串的时候不受表单容器控制
|
|
353
353
|
console.warn(`组件 #${formItem === null || formItem === void 0 ? void 0 : formItem.id} 表单key(表单输入类组件 name 属性)没设置或为空串的时候不受表单容器控制`);
|
|
@@ -395,8 +395,8 @@ const WdForm = React.forwardRef(function WdForm(props, ref) {
|
|
|
395
395
|
setValueDebounce(value);
|
|
396
396
|
}
|
|
397
397
|
else {
|
|
398
|
-
const
|
|
399
|
-
setValueDebounce({ ...
|
|
398
|
+
const _formData = deepClone(formData);
|
|
399
|
+
setValueDebounce({ ..._formData, ...value });
|
|
400
400
|
}
|
|
401
401
|
},
|
|
402
402
|
reset() {
|
|
@@ -453,8 +453,6 @@ const WdForm = React.forwardRef(function WdForm(props, ref) {
|
|
|
453
453
|
}, [
|
|
454
454
|
formType,
|
|
455
455
|
submitParams,
|
|
456
|
-
setValue,
|
|
457
|
-
setValueDebounce,
|
|
458
456
|
initialValues,
|
|
459
457
|
authValue,
|
|
460
458
|
layout,
|
|
@@ -473,6 +471,9 @@ const WdForm = React.forwardRef(function WdForm(props, ref) {
|
|
|
473
471
|
enableSubmit,
|
|
474
472
|
fieldInitValueCache,
|
|
475
473
|
formsItemMap,
|
|
474
|
+
setValueDebounce,
|
|
475
|
+
formData,
|
|
476
|
+
setValue,
|
|
476
477
|
validate,
|
|
477
478
|
eventsRef,
|
|
478
479
|
submit,
|
|
@@ -522,8 +523,12 @@ const WdForm = React.forwardRef(function WdForm(props, ref) {
|
|
|
522
523
|
return;
|
|
523
524
|
}
|
|
524
525
|
lodashSet(_formData, namePath, value);
|
|
525
|
-
|
|
526
|
-
|
|
526
|
+
if (typeof _formData !== 'object' || _formData === null) {
|
|
527
|
+
console.warn('setValue data need expect a object but got null', _formData);
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
setFormData(_formData);
|
|
531
|
+
}, [formData]);
|
|
527
532
|
if (initValueLoadingStatus === 'hidden') {
|
|
528
533
|
return null;
|
|
529
534
|
}
|
|
@@ -13,7 +13,7 @@ import './style';
|
|
|
13
13
|
* 地图-标准化
|
|
14
14
|
*/
|
|
15
15
|
export const WdLocation = forwardRef(function WdLocation(props, ref) {
|
|
16
|
-
const { classRoot = 'location', clearable = X_RUNTIME_DEFAULT.clearable, placeholder = '选择地理位置', customLocation, customRange = X_RUNTIME_DEFAULT.customRange, dataSource = X_RUNTIME_DEFAULT._dataSourceInLocation,
|
|
16
|
+
const { classRoot = 'location', clearable = X_RUNTIME_DEFAULT.clearable, placeholder = '选择地理位置', customLocation, customRange = X_RUNTIME_DEFAULT.customRange, dataSource = X_RUNTIME_DEFAULT._dataSourceInLocation, defaultShowLocation, drag = X_RUNTIME_DEFAULT.drag, locationType = X_RUNTIME_DEFAULT.locationType, locationRange = X_RUNTIME_DEFAULT.locationRange, showLngLat = X_RUNTIME_DEFAULT.showLngLat, showMap = X_RUNTIME_DEFAULT.showMap, zoom = X_RUNTIME_DEFAULT.zoom, events = emptyObject, id, } = props;
|
|
17
17
|
const traitProps = { ...props, inputRef: ref };
|
|
18
18
|
const trait = useFormInputTrait(traitProps);
|
|
19
19
|
const { value, onChange, disabled, readOnly, visible } = trait;
|
|
@@ -48,5 +48,5 @@ export const WdLocation = forwardRef(function WdLocation(props, ref) {
|
|
|
48
48
|
const inputWrapProps = { ...props, classRoot, disabled, ...clearProps };
|
|
49
49
|
if (!visible)
|
|
50
50
|
return null;
|
|
51
|
-
return (_jsx(WdFormItem, { ...formItemProps, children: _jsx(WdInputGroup, { ...inputGroupProps, children: _jsx(WdInputWrap, { ...inputWrapProps, children: _jsx(RecycleProvider, { recycleBack: setIsInit, children: _jsx(Location, { events: events, labelVisible: false, placeholder: placeholder, value: value, customLocation: customLocation, customRange: customRange, dataSource: dataSource,
|
|
51
|
+
return (_jsx(WdFormItem, { ...formItemProps, children: _jsx(WdInputGroup, { ...inputGroupProps, children: _jsx(WdInputWrap, { ...inputWrapProps, children: _jsx(RecycleProvider, { recycleBack: setIsInit, children: _jsx(Location, { events: events, labelVisible: false, placeholder: placeholder, value: value, customLocation: customLocation, customRange: customRange, dataSource: dataSource, defaultShowLocation: defaultShowLocation, drag: drag, locationType: locationType, locationRange: locationRange, showLngLat: showLngLat, showMap: showMap, zoom: zoom, readOnly: readOnly, disabled: disabled, decorator: null, onChange: onChange, id: id }) }) }) }) }));
|
|
52
52
|
});
|
|
@@ -4,6 +4,7 @@ import { useHandleClear } from '../../utils/hooks/useFormLegacy';
|
|
|
4
4
|
import { useFormInputTrait } from '../../components/form-input-hooks';
|
|
5
5
|
import { WdFormItem, WdInputGroup, WdInputWrap } from '../wd-form-item';
|
|
6
6
|
import UserTreeSelect from '../form/userOrgSelect/component/user-select-h5';
|
|
7
|
+
import { parseStrToArr } from '../form/userOrgSelect/common/utils';
|
|
7
8
|
import { emptyObject } from '../../utils/constant';
|
|
8
9
|
import { RecycleProvider } from '../../utils/hooks/useRecycle';
|
|
9
10
|
import { convertSingleValue } from '../../utils/tool';
|
|
@@ -14,10 +15,11 @@ export const WdMember = forwardRef(function WdMember(props, ref) {
|
|
|
14
15
|
// 强制转换初始值
|
|
15
16
|
const initRef = useRef(false);
|
|
16
17
|
const formValue = useMemo(() => {
|
|
18
|
+
const _value = parseStrToArr(props.value);
|
|
17
19
|
if (initRef.current)
|
|
18
|
-
return
|
|
20
|
+
return _value;
|
|
19
21
|
initRef.current = true;
|
|
20
|
-
return convertSingleValue(
|
|
22
|
+
return convertSingleValue(_value, !multiple);
|
|
21
23
|
}, [props.value, multiple]);
|
|
22
24
|
const traitProps = { ...props, value: formValue, inputRef: ref };
|
|
23
25
|
const trait = useFormInputTrait(traitProps);
|
|
@@ -10,7 +10,7 @@ import './style';
|
|
|
10
10
|
* 富文本-标准化
|
|
11
11
|
*/
|
|
12
12
|
export const WdRichText = forwardRef(function WdRichText(props, ref) {
|
|
13
|
-
const { classRoot = 'rich-text', events = emptyObject, acceptTypes = ['image/*'], maxSize = 20 } = props;
|
|
13
|
+
const { classRoot = 'rich-text', events = emptyObject, acceptTypes = ['image/*'], maxSize = 20, storageType = 'cloudID', } = props;
|
|
14
14
|
const trait = useFormInputTrait({ ...props, inputRef: ref });
|
|
15
15
|
const { value, disabled, readOnly, visible } = trait;
|
|
16
16
|
const formItemProps = {
|
|
@@ -26,5 +26,5 @@ export const WdRichText = forwardRef(function WdRichText(props, ref) {
|
|
|
26
26
|
};
|
|
27
27
|
if (!visible)
|
|
28
28
|
return null;
|
|
29
|
-
return (_jsx(WdFormItem, { ...formItemProps, children: _jsx(RichText, { placeholder: true, events: events, acceptTypes: acceptTypes, maxSize: maxSize, readOnly: readOnly, disabled: disabled, value: value, decorator: null, onChange: onChange, id: props.id }) }));
|
|
29
|
+
return (_jsx(WdFormItem, { ...formItemProps, children: _jsx(RichText, { placeholder: true, events: events, acceptTypes: acceptTypes, maxSize: maxSize, readOnly: readOnly, disabled: disabled, value: value, decorator: null, onChange: onChange, id: props.id, storageType: storageType }) }));
|
|
30
30
|
});
|
|
@@ -153,7 +153,10 @@ export function SelectUI(props) {
|
|
|
153
153
|
// 缓存展示的选中项
|
|
154
154
|
setSelectedItem((selectItem) => {
|
|
155
155
|
const newSelectItem = getSelectedItem(options, value);
|
|
156
|
-
|
|
156
|
+
if (value !== null && value !== undefined) {
|
|
157
|
+
return (newSelectItem === null || newSelectItem === void 0 ? void 0 : newSelectItem.length) ? newSelectItem : selectItem;
|
|
158
|
+
}
|
|
159
|
+
return newSelectItem;
|
|
157
160
|
});
|
|
158
161
|
}, [options, value]);
|
|
159
162
|
const readValue = useMemo(() => {
|
|
@@ -18,7 +18,8 @@ export const ExportFileModal = ({ fields, columns, isExportFileModalByApiVisible
|
|
|
18
18
|
(field === null || field === void 0 ? void 0 : field.format) !== 'many-many' &&
|
|
19
19
|
(field === null || field === void 0 ? void 0 : field.format) !== 'many-one' &&
|
|
20
20
|
(field === null || field === void 0 ? void 0 : field.format) !== 'one-many' &&
|
|
21
|
-
(field === null || field === void 0 ? void 0 : field.format) !== 'one-one'
|
|
21
|
+
(field === null || field === void 0 ? void 0 : field.format) !== 'one-one' &&
|
|
22
|
+
(field === null || field === void 0 ? void 0 : field.format) !== 'one-one-r') {
|
|
22
23
|
supportFields.push(field);
|
|
23
24
|
}
|
|
24
25
|
});
|
|
@@ -36,7 +37,7 @@ export const ExportFileModal = ({ fields, columns, isExportFileModalByApiVisible
|
|
|
36
37
|
.filter((el) => {
|
|
37
38
|
const field = fields.find((i) => (i === null || i === void 0 ? void 0 : i.name) === (el === null || el === void 0 ? void 0 : el.key) && el.isRelated);
|
|
38
39
|
const format = field === null || field === void 0 ? void 0 : field.format;
|
|
39
|
-
return el.isRelated && el.isExport && format !== 'many-many' && format !== 'one-many';
|
|
40
|
+
return el.isRelated && el.isExport && format !== 'many-many' && format !== 'one-many' && format !== 'one-one-r';
|
|
40
41
|
})
|
|
41
42
|
.map((item) => {
|
|
42
43
|
return {
|
|
@@ -19,12 +19,15 @@ export const useTableData = ({ dataSourceAPI, connectorMethod, query, events, is
|
|
|
19
19
|
const fetchVersion = (fetchRef.current.version = getUuid());
|
|
20
20
|
let data = { records: [], total: 0 };
|
|
21
21
|
setTableLoading(true);
|
|
22
|
+
let canCallQuerySuccess = true;
|
|
22
23
|
try {
|
|
23
24
|
if (isModel) {
|
|
24
25
|
if (supportManyRelated) {
|
|
25
26
|
// select为空对象时报错,避免传空对象给数组
|
|
26
27
|
const select = (query === null || query === void 0 ? void 0 : query.select) || {};
|
|
28
|
+
canCallQuerySuccess = false;
|
|
27
29
|
if (Object.keys(select).length !== 0) {
|
|
30
|
+
canCallQuerySuccess = true;
|
|
28
31
|
data = await dataSourceAPI.getRecordListV2(query, { swr });
|
|
29
32
|
data.records = data.records || [];
|
|
30
33
|
}
|
|
@@ -50,9 +53,11 @@ export const useTableData = ({ dataSourceAPI, connectorMethod, query, events, is
|
|
|
50
53
|
else {
|
|
51
54
|
setTableData(records);
|
|
52
55
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
if (canCallQuerySuccess) {
|
|
57
|
+
events === null || events === void 0 ? void 0 : events.querySuccess({
|
|
58
|
+
data: Object.assign({}, data, query),
|
|
59
|
+
});
|
|
60
|
+
}
|
|
56
61
|
(records === null || records === void 0 ? void 0 : records.length) === 0 &&
|
|
57
62
|
(events === null || events === void 0 ? void 0 : events.queryEmpty({
|
|
58
63
|
data: Object.assign({}, data, query),
|
|
@@ -12,7 +12,7 @@ import './style';
|
|
|
12
12
|
* 文件上传-标准化
|
|
13
13
|
*/
|
|
14
14
|
export const WdUploadFile = forwardRef(function WdUploadFile(props, ref) {
|
|
15
|
-
const { classRoot = 'upload-file', acceptTypes: _acceptTypes = X_RUNTIME_DEFAULT._acceptTypesInFile, maxSize = X_RUNTIME_DEFAULT.maxSize, single = X_RUNTIME_DEFAULT.single, maxUploadCount = X_RUNTIME_DEFAULT.maxUploadCount, events = emptyObject, deleteVisible = X_RUNTIME_DEFAULT.deleteVisible, downloadVisible = X_RUNTIME_DEFAULT.downloadVisible, callbacks, uploadButtonText = X_RUNTIME_DEFAULT._uploadButtonText, uploadTipText = X_RUNTIME_DEFAULT._uploadTipText, } = props;
|
|
15
|
+
const { classRoot = 'upload-file', acceptTypes: _acceptTypes = X_RUNTIME_DEFAULT._acceptTypesInFile, maxSize = X_RUNTIME_DEFAULT.maxSize, single = X_RUNTIME_DEFAULT.single, maxUploadCount = X_RUNTIME_DEFAULT.maxUploadCount, events = emptyObject, deleteVisible = X_RUNTIME_DEFAULT.deleteVisible, downloadVisible = X_RUNTIME_DEFAULT.downloadVisible, callbacks, uploadButtonText = X_RUNTIME_DEFAULT._uploadButtonText, uploadTipText = X_RUNTIME_DEFAULT._uploadTipText, storageType = 'cloudID', } = props;
|
|
16
16
|
const acceptTypes = useMemo(() => convertAcceptTypes(_acceptTypes), [_acceptTypes]);
|
|
17
17
|
// 强制转换初始值
|
|
18
18
|
const initRef = useRef(false);
|
|
@@ -34,5 +34,5 @@ export const WdUploadFile = forwardRef(function WdUploadFile(props, ref) {
|
|
|
34
34
|
};
|
|
35
35
|
if (!visible)
|
|
36
36
|
return null;
|
|
37
|
-
return (_jsx(WdFormItem, { ...formItemProps, children: _jsx(UploaderFile, { btnTitle: uploadButtonText, uploadTipText: uploadTipText, events: events, labelVisible: false, acceptTypes: acceptTypes, defaultValue: value, deleteVisible: deleteVisible, downloadVisible: downloadVisible, maxSize: maxSize, maxUploadCount: maxUploadCount, single: single, readOnly: readOnly, disabled: disabled, decorator: null, onChange: onChange, callbacks: callbacks }) }));
|
|
37
|
+
return (_jsx(WdFormItem, { ...formItemProps, children: _jsx(UploaderFile, { btnTitle: uploadButtonText, uploadTipText: uploadTipText, events: events, labelVisible: false, acceptTypes: acceptTypes, defaultValue: value, deleteVisible: deleteVisible, downloadVisible: downloadVisible, maxSize: maxSize, maxUploadCount: maxUploadCount, single: single, readOnly: readOnly, disabled: disabled, decorator: null, onChange: onChange, callbacks: callbacks, storageType: storageType }) }));
|
|
38
38
|
});
|
|
@@ -15,7 +15,7 @@ import { Upload } from '../form/uploader/upload/index';
|
|
|
15
15
|
export const WdUploadImage = forwardRef(function WdUploadImage(props, ref) {
|
|
16
16
|
const { classRoot = 'upload-image', showShape = X_RUNTIME_DEFAULT.showShape, acceptTypes = X_RUNTIME_DEFAULT.acceptTypes, maxSize = X_RUNTIME_DEFAULT.maxSize, single = X_RUNTIME_DEFAULT.single, maxUploadCount = X_RUNTIME_DEFAULT.maxUploadCount, events = emptyObject, isCompressBeforeUpload = false,
|
|
17
17
|
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
18
|
-
compressQuality = 70, compressedHeight = 0, compressedWidth = 0, sourceType = 'both', tips, callbacks, template = 'normal', children, } = props;
|
|
18
|
+
compressQuality = 70, compressedHeight = 0, compressedWidth = 0, sourceType = 'both', tips, callbacks, template = 'normal', children, storageType = 'cloudID', } = props;
|
|
19
19
|
// 强制转换初始值
|
|
20
20
|
const initRef = useRef(false);
|
|
21
21
|
const uploadRef = useRef(null);
|
|
@@ -44,5 +44,5 @@ export const WdUploadImage = forwardRef(function WdUploadImage(props, ref) {
|
|
|
44
44
|
const multiple = !single;
|
|
45
45
|
if (!visible)
|
|
46
46
|
return null;
|
|
47
|
-
return (_jsx(WdFormItem, { ...formItemProps, children: template === 'custom' ? (_jsx(Upload, { events: events, acceptTypes: acceptTypes, maxSize: maxSize, maxUploadCount: maxUploadCount, readOnly: readOnly, disabled: disabled, isCompressBeforeUpload: isCompressBeforeUpload, compressQuality: compressQuality, compressedHeight: compressedHeight, compressedWidth: compressedWidth, callbacks: callbacks, value: value, multiple: multiple, sourceType: sourceType, onChange: onChange, ref: uploadRef, setUploadHandle: setUploadHandle, children: children })) : (_jsx(Uploader, { events: events, labelVisible: false, acceptTypes: acceptTypes, defaultValue: value, maxSize: maxSize, maxUploadCount: maxUploadCount, single: single, tips: tips, showShape: showShape, readOnly: readOnly, disabled: disabled, decorator: null, onChange: onChange, isCompressBeforeUpload: isCompressBeforeUpload, compressQuality: compressQuality, compressedHeight: compressedHeight, compressedWidth: compressedWidth, sourceType: sourceType, callbacks: callbacks, setUploadHandle: setUploadHandle })) }));
|
|
47
|
+
return (_jsx(WdFormItem, { ...formItemProps, children: template === 'custom' ? (_jsx(Upload, { events: events, acceptTypes: acceptTypes, maxSize: maxSize, maxUploadCount: maxUploadCount, readOnly: readOnly, disabled: disabled, isCompressBeforeUpload: isCompressBeforeUpload, compressQuality: compressQuality, compressedHeight: compressedHeight, compressedWidth: compressedWidth, callbacks: callbacks, value: value, multiple: multiple, sourceType: sourceType, onChange: onChange, ref: uploadRef, setUploadHandle: setUploadHandle, storageType: storageType, children: children })) : (_jsx(Uploader, { events: events, labelVisible: false, acceptTypes: acceptTypes, defaultValue: value, maxSize: maxSize, maxUploadCount: maxUploadCount, single: single, tips: tips, showShape: showShape, readOnly: readOnly, disabled: disabled, decorator: null, onChange: onChange, isCompressBeforeUpload: isCompressBeforeUpload, compressQuality: compressQuality, compressedHeight: compressedHeight, compressedWidth: compressedWidth, sourceType: sourceType, callbacks: callbacks, setUploadHandle: setUploadHandle, storageType: storageType })) }));
|
|
48
48
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/weda-ui",
|
|
3
|
-
"version": "3.20.
|
|
3
|
+
"version": "3.20.3",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index",
|
|
6
6
|
"miniprogram": "mpdist",
|
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
"@babel/preset-typescript": "^7.22.15",
|
|
150
150
|
"@cloudbase/cals": "^1.2.15",
|
|
151
151
|
"@cloudbase/lowcode-cli": "^0.22.3",
|
|
152
|
-
"@cloudbase/weda-cloud-sdk": "^1.0.
|
|
152
|
+
"@cloudbase/weda-cloud-sdk": "^1.0.106",
|
|
153
153
|
"@commitlint/cli": "^16.0.2",
|
|
154
154
|
"@commitlint/config-conventional": "^17.7.0",
|
|
155
155
|
"@craco/craco": "^7.1.0",
|