@cloudbase/weda-ui 3.4.11-alpha.1 → 3.4.12
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/common/form-input-required.js +3 -3
- package/dist/configs/components/dataView.js +20 -10
- package/dist/configs/components/form-checkbox.js +15 -2
- package/dist/configs/components/form-email.js +17 -2
- package/dist/configs/components/form-input.js +17 -2
- package/dist/configs/components/form-phone.js +17 -2
- package/dist/configs/components/form-radio.js +15 -2
- package/dist/configs/components/form-select-multiple.js +362 -0
- package/dist/configs/components/form-switch.js +15 -2
- package/dist/configs/components/form-text-area.js +15 -2
- package/dist/configs/components/form-url.js +17 -2
- package/dist/configs/components/listView.js +32 -49
- package/dist/configs/components/table.json +1 -54
- package/dist/configs/components/wd-bubble.js +46 -8
- package/dist/configs/components/wd-checkbox.js +464 -0
- package/dist/configs/components/wd-form.js +66 -10
- package/dist/configs/components/wd-input-email.js +37 -0
- package/dist/configs/components/wd-input-phone.js +43 -0
- package/dist/configs/components/wd-input-url.js +37 -0
- package/dist/configs/components/wd-input.js +94 -0
- package/dist/configs/components/wd-official-account.js +87 -0
- package/dist/configs/components/wd-radio.js +443 -0
- package/dist/configs/components/wd-switch.js +315 -0
- package/dist/configs/components/wd-table.js +1 -54
- package/dist/configs/components/wd-textarea.js +82 -0
- package/dist/configs/components/wd-tree.js +443 -0
- package/dist/configs/index.js +24 -1
- package/dist/configs/type-utils/type-form.js +681 -0
- package/dist/docs/common/components/methods-view.js +1 -1
- package/dist/docs/common/components/properties-view.js +3 -1
- package/dist/docs/common/format.js +7 -7
- package/dist/docs/common/tableView.js +3 -1
- package/dist/enum/index.js +196 -0
- package/dist/style/index.scss +1 -1
- package/dist/web/components/calendar/index.js +1 -1
- package/dist/web/components/customer-service/customer-service.js +19 -2
- package/dist/web/components/dataView/index.js +16 -3
- package/dist/web/components/flow/common/hooks/useCommonFlowData/flow-get.js +5 -1
- package/dist/web/components/flow/common/request.js +5 -5
- package/dist/web/components/flow/modules/operations/controls-items/flow-task-info-modal.js +8 -16
- package/dist/web/components/form/enumSelect/MultipleSelect.js +1 -0
- package/dist/web/components/form/enumSelect/SelectContainer.js +1 -0
- package/dist/web/components/form/formcell/index.css +13 -1
- package/dist/web/components/form/formcell/index.js +1 -1
- package/dist/web/components/form/location/components/LocationH5/location.h5.js +1 -1
- package/dist/web/components/form/location/components/LocationPC/Header.js +1 -0
- package/dist/web/components/form/location/index.js +1 -0
- package/dist/web/components/form/select/h5.js +8 -7
- package/dist/web/components/form/select/index.js +9 -9
- package/dist/web/components/form/select/region/index.js +1 -1
- package/dist/web/components/form/selectMultiple/dropdown-select/h5.js +111 -0
- package/dist/web/components/form/selectMultiple/dropdown-select/index.css +270 -0
- package/dist/web/components/form/selectMultiple/dropdown-select/index.js +206 -0
- package/dist/web/components/form/selectMultiple/dropdown-select/pc.js +115 -0
- package/dist/web/components/form/selectMultiple/dropdown-select/ui.js +113 -0
- package/dist/web/components/form/selectMultiple/h5.js +40 -0
- package/dist/web/components/form/selectMultiple/index.js +94 -0
- package/dist/web/components/form/selectMultiple/request.js +76 -0
- package/dist/web/components/form/selectMultiple/status/allEmpty.js +5 -0
- package/dist/web/components/form/selectMultiple/status/empty.js +19 -0
- package/dist/web/components/form/selectMultiple/status/index.css +63 -0
- package/dist/web/components/form/selectMultiple/status/index.js +7 -0
- package/dist/web/components/form/selectMultiple/status/loading.js +19 -0
- package/dist/web/components/form/selectMultiple/status/propsType.js +1 -0
- package/dist/web/components/form/selectMultiple/status/retry.js +19 -0
- package/dist/web/components/form/tips/index.css +9 -3
- package/dist/web/components/form/uploader/index.css +10 -0
- package/dist/web/components/form/uploader/uploader.h5.js +6 -6
- package/dist/web/components/form/uploader/uploader.pc.js +1 -1
- package/dist/web/components/form/uploaderFile/index.js +2 -0
- package/dist/web/components/form/uploaderFile/uploadFile.h5.js +0 -19
- package/dist/web/components/form/uploaderFile/uploadFile.pc.js +3 -24
- package/dist/web/components/form/userOrgSelect/common/fetch-data-service.js +7 -4
- package/dist/web/components/form/userOrgSelect/common/utils.js +1 -0
- package/dist/web/components/form/userOrgSelect/component/user-select-h5/index.js +15 -5
- package/dist/web/components/form-input-hooks/index.js +39 -14
- package/dist/web/components/form-select-multiple/index.js +26 -0
- package/dist/web/components/formdetail/index.css +31 -1
- package/dist/web/components/formdetail/index.js +30 -0
- package/dist/web/components/index.js +17 -1
- package/dist/web/components/listView/index.js +20 -5
- package/dist/web/components/phone/index.js +26 -1
- package/dist/web/components/phoneCode/index.js +3 -1
- package/dist/web/components/repeater/index.js +1 -0
- package/dist/web/components/repeater-item/index.js +1 -0
- package/dist/web/components/richText/index.css +70 -67
- package/dist/web/components/richText/index.js +311 -251
- package/dist/web/components/richText/richtext.module.css +1 -0
- package/dist/web/components/richTextView/index.css +39 -0
- package/dist/web/components/richTextView/index.js +1 -1
- package/dist/web/components/share/index.js +26 -1
- package/dist/web/components/statusContent/index.js +1 -0
- package/dist/web/components/wd-checkbox/checkbox.js +34 -0
- package/dist/web/components/wd-checkbox/index.js +3 -0
- package/dist/web/components/wd-checkbox-list/checkboxList.js +140 -0
- package/dist/web/components/wd-checkbox-list/index.js +3 -0
- package/dist/web/components/wd-form/index.js +25 -12
- package/dist/web/components/wd-form/wd-form.js +42 -0
- package/dist/web/components/wd-form-cell/index.js +3 -0
- package/dist/web/components/wd-form-cell/wd-form-cell.js +42 -0
- package/dist/web/components/wd-form-item/index.js +4 -0
- package/dist/web/components/wd-form-item/wd-form-item.js +55 -0
- package/dist/web/components/wd-form-item/wd-input-group.js +24 -0
- package/dist/web/components/wd-input/index.js +3 -0
- package/dist/web/components/wd-input/wd-input.js +155 -0
- package/dist/web/components/wd-input-email/index.js +3 -0
- package/dist/web/components/wd-input-email/wd-input-email.js +13 -0
- package/dist/web/components/wd-input-group/index.js +3 -0
- package/dist/web/components/wd-input-group/wd-input-group.js +10 -0
- package/dist/web/components/wd-input-phone/index.js +3 -0
- package/dist/web/components/wd-input-phone/wd-input-phone.js +14 -0
- package/dist/web/components/wd-input-url/index.js +3 -0
- package/dist/web/components/wd-input-url/wd-input-url.js +13 -0
- package/dist/web/components/wd-input-wrap/index.js +3 -0
- package/dist/web/components/wd-input-wrap/wd-input-wrap.js +18 -0
- package/dist/web/components/wd-official-account/index.css +29 -0
- package/dist/web/components/wd-official-account/index.js +36 -0
- package/dist/web/components/wd-radio/index.js +3 -0
- package/dist/web/components/wd-radio/wd-radio.js +30 -0
- package/dist/web/components/wd-radio-list/index.js +3 -0
- package/dist/web/components/wd-radio-list/wd-radio-list.js +104 -0
- package/dist/web/components/wd-switch/index.js +3 -0
- package/dist/web/components/wd-switch/wd-switch.js +52 -0
- package/dist/web/components/wd-table/components/Table/index.js +12 -2
- package/dist/web/components/wd-table/hooks/useQueryParams.js +4 -1
- package/dist/web/components/wd-table/utils/index.js +6 -2
- package/dist/web/components/wd-table/wd-table.js +70 -57
- package/dist/web/components/wd-textarea/index.js +3 -0
- package/dist/web/components/wd-textarea/wd-textarea.js +78 -0
- package/dist/web/components/wd-tree/index.js +3 -0
- package/dist/web/components/wd-tree/utils.js +291 -0
- package/dist/web/components/wd-tree/wd-tree.js +193 -0
- package/dist/web/utils/constant.js +16 -0
- package/dist/web/utils/datasource.js +2 -2
- package/dist/web/utils/hooks/useFormLegacy.js +111 -0
- package/dist/web/utils/tool.js +12 -2
- package/dist/web/weda-ui.css +193 -3
- package/package.json +6 -5
- package/dist/web/components/emptyContent/index.js +0 -46
- package/dist/web/components/flow/components/FlowModuleText/Content.js +0 -6
- package/dist/web/components/flow/components/FlowModuleText/Title.js +0 -16
- package/dist/web/components/flow/components/FlowModuleText/index.js +0 -7
- package/dist/web/components/flow/components/FlowModuleText/utils.js +0 -34
- package/dist/web/components/flow/components/FlowStatusText/index.js +0 -37
- package/dist/web/components/flow/components/HighLightComment/index.js +0 -31
- package/dist/web/components/flow/components/index.js +0 -3
- package/dist/web/components/flow/constants/index.js +0 -65
- package/dist/web/components/flow/frame/getCommonFlowData.js +0 -80
- package/dist/web/components/flow/frame/hooks/index.js +0 -2
- package/dist/web/components/flow/frame/hooks/useCommonFlowRequest.js +0 -148
- package/dist/web/components/flow/frame/hooks/useElementMediaQuery.js +0 -15
- package/dist/web/components/flow/frame/index.js +0 -76
- package/dist/web/components/flow/frame/types.js +0 -277
- package/dist/web/components/flow/frame/utils.js +0 -149
- package/dist/web/components/flow/modules/chart/Chart.js +0 -282
- package/dist/web/components/flow/modules/chart/constants.js +0 -28
- package/dist/web/components/flow/modules/chart/index.css +0 -84
- package/dist/web/components/flow/modules/chart/isString.js +0 -5
- package/dist/web/components/flow/modules/chart/utils.js +0 -111
- package/dist/web/components/flow/modules/process/Process.js +0 -73
- package/dist/web/components/flow/modules/process/ProcessMobile.js +0 -81
- package/dist/web/components/flow/modules/process/index.js +0 -14
- package/dist/web/components/flow/modules/process/utils/index.js +0 -32
- package/dist/web/components/flow/services/flow.js +0 -111
- package/dist/web/components/flow/services/ideData/chart.js +0 -88
- package/dist/web/components/flow/services/ideData/index.js +0 -5
- package/dist/web/components/flow/services/ideData/instance.js +0 -23
- package/dist/web/components/flow/services/ideData/pageDetail.js +0 -42
- package/dist/web/components/flow/services/ideData/process.js +0 -27
- package/dist/web/components/flow/services/index.js +0 -2
- package/dist/web/components/flow/services/user.js +0 -23
- package/dist/web/components/flow/services/utils.js +0 -28
- package/dist/web/components/form/userOrgSelect/component/OrgPaths.js +0 -12
- package/dist/web/components/form/userOrgSelect/component/depart-select/departTreeSelect.h5.js +0 -156
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/* eslint-disable max-lines */
|
|
3
|
+
import { forwardRef, useImperativeHandle, useEffect, useState, useCallback, } from 'react';
|
|
4
|
+
import classNames from '../../utils/classnames';
|
|
5
|
+
import { useConfig } from '../../utils/config-context';
|
|
6
|
+
import { usePlatform } from '../../utils/platform';
|
|
7
|
+
import WdCheckbox from '../wd-checkbox';
|
|
8
|
+
import WdIcon from '../wd-icon';
|
|
9
|
+
import { TREE_INFO_GOT, initData, initTreeState, dealCheck, getTreeInfo, } from './utils';
|
|
10
|
+
import { deepClone } from '../../utils/tool';
|
|
11
|
+
export const WdTree = forwardRef(function WdTree(props, ref) {
|
|
12
|
+
var _a;
|
|
13
|
+
const { className = '', style, id, events, data, checkable, checkedCustom, expandType, expandCustom, showIcon, foldIcon, expendIcon, leafIcon, line, } = props;
|
|
14
|
+
const platform = usePlatform();
|
|
15
|
+
// 样式
|
|
16
|
+
const { classPrefix } = useConfig();
|
|
17
|
+
// 响应式css api
|
|
18
|
+
const platformCss = `${classPrefix}-${platform}-tree`;
|
|
19
|
+
const classes = {
|
|
20
|
+
[`${classPrefix}-tree`]: true,
|
|
21
|
+
[platformCss]: true,
|
|
22
|
+
[`${classPrefix}-tree--line`]: props.line,
|
|
23
|
+
};
|
|
24
|
+
const nodeClassName = `${classPrefix}-tree-node`;
|
|
25
|
+
// 组件内树节点初始化
|
|
26
|
+
const [showData, setShowData] = useState([]);
|
|
27
|
+
const [treeInfo, setTreeInfo] = useState({});
|
|
28
|
+
// 点击的节点
|
|
29
|
+
const [selected, setSelected] = useState(((_a = props.checkedCustom) === null || _a === void 0 ? void 0 : _a.length) ? props.checkedCustom[0] : '');
|
|
30
|
+
// 搜索内容
|
|
31
|
+
const [searchKey, setSearchKey] = useState('');
|
|
32
|
+
/**
|
|
33
|
+
* 组件搜索节点方法
|
|
34
|
+
*/
|
|
35
|
+
const searchNode = useCallback(({ searchKey = '' } = {}) => {
|
|
36
|
+
setSearchKey(searchKey || '');
|
|
37
|
+
setShowData(initTreeState({
|
|
38
|
+
data: showData,
|
|
39
|
+
checkedCustom: [],
|
|
40
|
+
expandType: '',
|
|
41
|
+
expandCustom: [],
|
|
42
|
+
searchKey,
|
|
43
|
+
}));
|
|
44
|
+
}, [showData]);
|
|
45
|
+
// Widget API,挂载组件只读属性和组件方法
|
|
46
|
+
useImperativeHandle(ref, () => {
|
|
47
|
+
return {
|
|
48
|
+
methods: {
|
|
49
|
+
searchNode,
|
|
50
|
+
},
|
|
51
|
+
treeInfo,
|
|
52
|
+
data,
|
|
53
|
+
checkable,
|
|
54
|
+
checkedCustom,
|
|
55
|
+
expandType,
|
|
56
|
+
expandCustom,
|
|
57
|
+
showIcon,
|
|
58
|
+
foldIcon,
|
|
59
|
+
expendIcon,
|
|
60
|
+
leafIcon,
|
|
61
|
+
line,
|
|
62
|
+
};
|
|
63
|
+
}, [
|
|
64
|
+
checkable,
|
|
65
|
+
checkedCustom,
|
|
66
|
+
data,
|
|
67
|
+
expandCustom,
|
|
68
|
+
expandType,
|
|
69
|
+
expendIcon,
|
|
70
|
+
foldIcon,
|
|
71
|
+
leafIcon,
|
|
72
|
+
line,
|
|
73
|
+
searchNode,
|
|
74
|
+
showIcon,
|
|
75
|
+
treeInfo,
|
|
76
|
+
]);
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
var _a;
|
|
79
|
+
const aimData = initTreeState({
|
|
80
|
+
data: initData({
|
|
81
|
+
data: deepClone(props.data),
|
|
82
|
+
parent: null,
|
|
83
|
+
showIcon: props.showIcon,
|
|
84
|
+
expendIcon: props.expendIcon,
|
|
85
|
+
foldIcon: props.foldIcon,
|
|
86
|
+
leafIcon: props.leafIcon,
|
|
87
|
+
}),
|
|
88
|
+
checkedCustom: props.checkedCustom,
|
|
89
|
+
expandType: props.expandType || 'all',
|
|
90
|
+
expandCustom: props.expandCustom,
|
|
91
|
+
});
|
|
92
|
+
setShowData(aimData);
|
|
93
|
+
const selected = ((_a = props.checkedCustom) === null || _a === void 0 ? void 0 : _a.length) ? props.checkedCustom[0] : '';
|
|
94
|
+
setTreeInfo({
|
|
95
|
+
event: 'init',
|
|
96
|
+
currentNode: [],
|
|
97
|
+
...getTreeInfo({ tree: aimData, info: { selected }, condition: TREE_INFO_GOT }, props.checkable),
|
|
98
|
+
});
|
|
99
|
+
setSelected(selected);
|
|
100
|
+
}, [props.data, props.checkedCustom, props.expandCustom, props.expandType, props.showIcon, props.expendIcon, props.foldIcon, props.leafIcon, props.checkable]);
|
|
101
|
+
/**
|
|
102
|
+
* 节点变化,check:选中节点改变,select:点击节点,expand:节点展开/折叠
|
|
103
|
+
* @param treeNode
|
|
104
|
+
* @param event
|
|
105
|
+
* @param state 改变的状态
|
|
106
|
+
*/
|
|
107
|
+
const change = (treeNode, event, state) => {
|
|
108
|
+
var _a;
|
|
109
|
+
if (treeNode.disabled && event !== 'expand')
|
|
110
|
+
return;
|
|
111
|
+
// 开启多选属性时, 点击节点事件去掉, 变成check事件
|
|
112
|
+
if (event === 'select' && props.checkable) {
|
|
113
|
+
event = 'check';
|
|
114
|
+
state = treeNode.checked !== 'checked';
|
|
115
|
+
}
|
|
116
|
+
const eventKey = {
|
|
117
|
+
check: 'selectNodeChange',
|
|
118
|
+
select: 'selectNodeChange',
|
|
119
|
+
expand: 'nodeExpandChange',
|
|
120
|
+
}[event];
|
|
121
|
+
let selectedKey = selected;
|
|
122
|
+
// 不同类型要执行的操作
|
|
123
|
+
const typeFunc = {
|
|
124
|
+
check: () => {
|
|
125
|
+
treeNode.checked = state ? 'checked' : '';
|
|
126
|
+
// 处理节点的父/子节点选中状态
|
|
127
|
+
dealCheck(treeNode);
|
|
128
|
+
},
|
|
129
|
+
select: () => {
|
|
130
|
+
state = selectedKey !== treeNode.value;
|
|
131
|
+
selectedKey = state ? treeNode.value : '';
|
|
132
|
+
setSelected(selectedKey);
|
|
133
|
+
},
|
|
134
|
+
expand: () => {
|
|
135
|
+
var _a;
|
|
136
|
+
treeNode.isExpand = state;
|
|
137
|
+
treeNode.expanded = state ? 'expand' : '';
|
|
138
|
+
if (treeNode.iconShow && ((_a = treeNode.children) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
139
|
+
treeNode.iconShow = state ? treeNode.expendIcon : treeNode.foldIcon;
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
}[event];
|
|
143
|
+
typeFunc === null || typeFunc === void 0 ? void 0 : typeFunc();
|
|
144
|
+
const info = {
|
|
145
|
+
event,
|
|
146
|
+
currentNode: [treeNode.root],
|
|
147
|
+
[`${event}State`]: state,
|
|
148
|
+
...getTreeInfo({
|
|
149
|
+
tree: showData,
|
|
150
|
+
info: { selected: selectedKey },
|
|
151
|
+
condition: TREE_INFO_GOT,
|
|
152
|
+
}, props.checkable),
|
|
153
|
+
};
|
|
154
|
+
(_a = events[eventKey]) === null || _a === void 0 ? void 0 : _a.call(events, info);
|
|
155
|
+
// events.change?.(info);
|
|
156
|
+
setTreeInfo(info);
|
|
157
|
+
event !== 'select' && setShowData([...showData]);
|
|
158
|
+
};
|
|
159
|
+
const list = [];
|
|
160
|
+
const renderNode = (d, count) => {
|
|
161
|
+
if (!Array.isArray(d))
|
|
162
|
+
return [];
|
|
163
|
+
// @ts-ignore const 会报错,应该是let
|
|
164
|
+
count = count || 0;
|
|
165
|
+
const STEP = 1;
|
|
166
|
+
d.filter((item) => item === null || item === void 0 ? void 0 : item.value).forEach((item, index) => {
|
|
167
|
+
var _a;
|
|
168
|
+
const subTree = ((_a = item.children) === null || _a === void 0 ? void 0 : _a.length) > 0 ? item.children : undefined;
|
|
169
|
+
const spaceDom = [];
|
|
170
|
+
const disableStyle = item.disabled
|
|
171
|
+
? { cursor: 'not-allowed', color: 'rgba(0,0,0,.26)' }
|
|
172
|
+
: {};
|
|
173
|
+
for (let i = 0; i < count; i++) {
|
|
174
|
+
spaceDom.push(_jsx("span", { className: `${classPrefix}-tree__space` }, Math.random()));
|
|
175
|
+
}
|
|
176
|
+
list.push(_jsxs("div", {
|
|
177
|
+
// 叶子节点 加 `${classPrefix}-tree-node--leaf` 为了连线的时候,对横线特殊处理
|
|
178
|
+
// 选中态,加 is-selected
|
|
179
|
+
className: `${nodeClassName} ${subTree ? '' : `${classPrefix}-tree-node--leaf`} ${selected === item.value && !props.checkable ? 'is-selected' : ''}`, "data-testid": nodeClassName, children: [spaceDom, _jsx("div", { className: `${classPrefix}-tree__switcher`, onClick: () => change(item, 'expand', !item.isExpand), children: subTree && (
|
|
180
|
+
// 展开/收起的图标
|
|
181
|
+
_jsx(WdIcon, { className: `${classPrefix}-tree__switcher-icon`, name: item.isExpand ? 'td:caret-down-small' : 'td:caret-right-small' })) }), _jsxs("div", { className: `${classPrefix}-tree__label`, onClick: () => change(item, 'select'), children: [props.checkable && (_jsx(WdCheckbox, { index: index + count, option: { value: item.value }, isAll: item.checked === 'childChecked', size: "md", disabled: item.disabled, getChangeHandler: () => {
|
|
182
|
+
if (item.disabled)
|
|
183
|
+
return;
|
|
184
|
+
change(item, 'check', item.checked !== 'checked');
|
|
185
|
+
}, checkedItemValue: { [item.value]: item.checked === 'checked' }, ...{} })), item.iconShow && (_jsx(WdIcon, { "data-testid": "wd-tree-icon-test", className: `${classPrefix}-tree__label-icon `, name: item.iconShow, src: item.iconShow, type: item.iconShow.startsWith('http') ? 'custom' : 'inner' })), _jsx("label", { className: `${classPrefix}-tree__label-text`, htmlFor: "", style: disableStyle, children: searchKey
|
|
186
|
+
? item.label.split(searchKey).map((v, i) => (_jsxs("span", { children: [i !== 0 && (_jsx("span", { className: `${classPrefix}-tree__label-text-search`, children: searchKey })), v] }, i)))
|
|
187
|
+
: item.label })] })] }, item.value));
|
|
188
|
+
subTree && item.isExpand && renderNode(subTree, count + STEP);
|
|
189
|
+
});
|
|
190
|
+
return list;
|
|
191
|
+
};
|
|
192
|
+
return (_jsx("div", { id: id, style: style, className: classNames(classes, className), "data-testid": "wd-tree-test", children: renderNode(showData, 0) }));
|
|
193
|
+
});
|
|
@@ -5,6 +5,20 @@ export const TitleType = {
|
|
|
5
5
|
NONE: 'none',
|
|
6
6
|
};
|
|
7
7
|
export const LOAD_ERR_IMG_BASE64 = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgdmlld0JveD0iMCAwIDMyIDMyIiBmaWxsPSJub25lIj4KICA8cGF0aCBkPSJNMjUuMzIgMTYuMzU5N0MyNi4wNzY0IDE2LjM1OTcgMjYuODI1NCAxNi41MDg3IDI3LjUyNDMgMTYuNzk4MUMyOC4yMjMxIDE3LjA4NzYgMjguODU4MSAxNy41MTE5IDI5LjM5MjkgMTguMDQ2OEMyOS45Mjc4IDE4LjU4MTYgMzAuMzUyMSAxOS4yMTY2IDMwLjY0MTYgMTkuOTE1NEMzMC45MzEgMjAuNjE0MyAzMS4wOCAyMS4zNjMzIDMxLjA4IDIyLjExOTdDMzEuMDggMjIuODc2MSAzMC45MzEgMjMuNjI1MSAzMC42NDE2IDI0LjMyMzlDMzAuMzUyMSAyNS4wMjI4IDI5LjkyNzggMjUuNjU3OCAyOS4zOTI5IDI2LjE5MjZDMjguODU4MSAyNi43Mjc1IDI4LjIyMzEgMjcuMTUxOCAyNy41MjQzIDI3LjQ0MTJDMjYuODI1NCAyNy43MzA3IDI2LjA3NjQgMjcuODc5NyAyNS4zMiAyNy44Nzk3QzIzLjc5MjQgMjcuODc5NyAyMi4zMjczIDI3LjI3MjggMjEuMjQ3MSAyNi4xOTI2QzIwLjE2NjkgMjUuMTEyNCAxOS41NiAyMy42NDczIDE5LjU2IDIyLjExOTdDMTkuNTYgMjAuNTkyIDIwLjE2NjkgMTkuMTI3IDIxLjI0NzEgMTguMDQ2OEMyMi4zMjczIDE2Ljk2NjUgMjMuNzkyNCAxNi4zNTk3IDI1LjMyIDE2LjM1OTdaTTI4IDMuNTU5NjlWMTQuODc2OEMyNy4xNzc3IDE0LjU4NjYgMjYuMTkyIDE0LjQzODggMjUuMzIgMTQuNDM5N0MyNC4wMzEgMTQuNDM5NyAyMi44MTU3IDE0Ljc1NzEgMjEuNzQ4OCAxNS4zMTg0TDIwLjc5NTIgMTMuMTU5N0wxNi4wMjU5IDIwLjAyNzVMOC40NDU3NiAxNi40NDFMMy41NiAyMy4zOTk3SDE3Ljc0NjJDMTcuOTg2NyAyNC44MjkgMTguNjI4MiAyNi4xNjA2IDE5LjU5NTggMjcuMjM5N0gxVjMuNTU5NjlIMjhaTTI1Ljk2IDI0LjAzOTdIMjQuNjhWMjUuMzE5N0gyNS45NlYyNC4wMzk3Wk0yNS45NiAxOC45MTk3SDI0LjY4VjIzLjM5OTdIMjUuOTZWMTguOTE5N1pNNi4xMiAxMC41OTk3QzYuMTIgMTEuOTk4MSA3LjE5OTA0IDEzLjEwODUgOC42MDc2OCAxMy4xNTg0QzEwLjAyMDggMTMuMjA3NyAxMS4yNCAxMi4wNDggMTEuMjQgMTAuNTk5N0MxMS4yNCA5LjI0NjA5IDEwLjA2NDMgOC4wODU3NyA4Ljc1MjMyIDguMDQwOTdDNy4yOTU2OCA3Ljk5MTY5IDYuMTIgOS4xNTEzNyA2LjEyIDEwLjU5OTdaIiBmaWxsPSIjQkNDNEQwIj48L3BhdGg+Cjwvc3ZnPgo=';
|
|
8
|
+
export const RICH_TEXT_ICON_PACK = {
|
|
9
|
+
mathFormula: '<svg class="icon" style="vertical-align:middle" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" fill="currentColor" overflow="hidden"><path d="M552 566l54-54-54-54-261-261h551v-77l-660 1v76l316 315-316 316v75l660 1v-77H291l261-261"></path></svg>',
|
|
10
|
+
leftTextAlign: '<svg style="width:16px;height:16px" viewBox="0 0 512 512" fill="currentColor"><path d="M384 106.666c11.782 0 21.334 9.552 21.334 21.334 0 10.94-8.236 19.958-18.846 21.19l-2.488 0.143h-277.334c-11.782 0-21.334-9.552-21.334-21.334 0-10.941 8.236-19.957 18.846-21.19l2.488-0.144h277.334z" ></path><path d="M277.334 234.667c11.782 0 21.334 9.552 21.334 21.333 0 10.94-8.236 19.957-18.846 21.19l-2.488 0.144h-170.667c-11.782 0-21.334-9.551-21.334-21.334 0-10.94 8.236-19.958 18.846-21.19l2.488-0.143h170.667z"></path><path d="M384 362.666c11.782 0 21.334 9.551 21.334 21.334 0 10.94-8.236 19.957-18.846 21.19l-2.488 0.144h-277.334c-11.782 0-21.334-9.551-21.334-21.334 0-10.94 8.236-19.957 18.846-21.19l2.488-0.144h277.334z"></path></svg>',
|
|
11
|
+
centerTextAlign: '<svg style="width:16px;height:16px" viewBox="0 0 512 512" fill="currentColor"><path d="M384 106.666c11.782 0 21.334 9.552 21.334 21.334 0 10.94-8.236 19.958-18.846 21.19l-2.488 0.143h-277.334c-11.782 0-21.334-9.552-21.334-21.334 0-10.941 8.236-19.957 18.846-21.19l2.488-0.144h277.334z"></path><path d="M330.666 234.667c11.782 0 21.334 9.552 21.334 21.333 0 10.94-8.236 19.957-18.846 21.19l-2.488 0.144h-170.667c-11.782 0-21.333-9.551-21.333-21.334 0-10.94 8.236-19.958 18.846-21.19l2.488-0.143h170.667z"></path><path d="M384 362.666c11.782 0 21.334 9.551 21.334 21.334 0 10.94-8.236 19.957-18.846 21.19l-2.488 0.144h-277.334c-11.782 0-21.334-9.551-21.334-21.334 0-10.94 8.236-19.957 18.846-21.19l2.488-0.144h277.334z"></path></svg>',
|
|
12
|
+
rightTextAlign: '<svg style="width:16px;height:16px" viewBox="0 0 512 512" fill="currentColor"><path d="M384 106.666c11.782 0 21.334 9.552 21.334 21.334 0 10.94-8.236 19.958-18.846 21.19l-2.488 0.143h-277.334c-11.782 0-21.334-9.552-21.334-21.334 0-10.941 8.236-19.957 18.846-21.19l2.488-0.144h277.334z"></path><path d="M384 234.667c11.782 0 21.334 9.552 21.334 21.333 0 10.94-8.236 19.957-18.846 21.19l-2.488 0.144h-170.667c-11.782 0-21.333-9.551-21.333-21.334 0-10.94 8.236-19.958 18.846-21.19l2.488-0.143h170.666z"></path><path d="M384 362.666c11.782 0 21.334 9.551 21.334 21.334 0 10.94-8.236 19.957-18.846 21.19l-2.488 0.144h-277.334c-11.782 0-21.334-9.551-21.334-21.334 0-10.94 8.236-19.957 18.846-21.19l2.488-0.144h277.334z"></path></svg>',
|
|
13
|
+
justifyTextAlign: '<svg style="width:16px;height:16px" viewBox="0 0 512 512" fill="currentColor"><path d="M384 106.666c11.782 0 21.334 9.552 21.334 21.334 0 10.94-8.236 19.958-18.846 21.19l-2.488 0.143h-277.334c-11.782 0-21.334-9.552-21.334-21.334 0-10.941 8.236-19.957 18.846-21.19l2.488-0.144h277.334z"></path><path d="M384 234.667c11.782 0 21.334 9.552 21.334 21.334 0 10.94-8.236 19.958-18.846 21.19l-2.488 0.143h-277.334c-11.782 0-21.334-9.552-21.334-21.334 0-10.941 8.236-19.957 18.846-21.19l2.488-0.144h277.334z"></path><path d="M384 362.666c11.782 0 21.334 9.551 21.334 21.334 0 10.94-8.236 19.957-18.846 21.19l-2.488 0.144h-277.334c-11.782 0-21.334-9.551-21.334-21.334 0-10.94 8.236-19.957 18.846-21.19l2.488-0.144h277.334z"></path></svg>',
|
|
14
|
+
textIndent: '<svg style="width:20px;height:20px" fill="currentColor" viewBox="0 0 24 24" style="transform: scale(1.25)"><path d="M5 17v1.25h14V17H5zm11-8v6l3-3-3-3zM5 13.25v1.25h9v-1.25H5zM5 9.5v1.25h9V9.5H5zm0-3.75V7h14V5.75H5z"></path></svg>',
|
|
15
|
+
heading: '<svg style="width:18px;height:18px" viewBox="0 0 512 512"><path transform="translate(80 20)" fill="currentColor" d="M286 85c11 0 20 9 21 19v280a21 21 0 0 1-42 2V267H85v117a21 21 0 0 1-42 2V107a21 21 0 0 1 42-3v120h180V107c0-12 9-22 21-22z"></path></svg>',
|
|
16
|
+
marginTop: '<svg style="width:18px;height:18px" fill="currentColor" viewBox="0 0 512 512"><path d="M106.666 292.607h280.448c11.782 0 21.334-9.551 21.334-21.334s-9.551-21.334-21.334-21.334h-280.448c-11.782 0-21.334 9.551-21.334 21.334s9.552 21.334 21.334 21.334z"></path><path d="M106.666 420.607h280.448c11.782 0 21.334-9.551 21.334-21.334s-9.551-21.334-21.334-21.334h-280.448c-11.782 0-21.334 9.551-21.334 21.334s9.552 21.334 21.334 21.334z"></path><path d="M232.697 114.138l-36.906 58.304c-6.315 9.963 1.578 22.422 14.186 22.422h73.835c12.608 0 20.502-12.458 14.208-22.422l-36.928-58.304c-6.315-9.963-22.080-9.963-28.394 0z"></path></svg>',
|
|
17
|
+
marginBottom: '<svg style="width:18px;height:18px" fill="currentColor" viewBox="0 0 512 512"><path d="M387.115 245.333h-280.448c-11.782 0-21.334 9.552-21.334 21.333s9.552 21.334 21.334 21.334h280.448c11.782 0 21.334-9.551 21.334-21.334s-9.551-21.334-21.334-21.334z"></path><path d="M387.115 117.334h-280.448c-11.782 0-21.334 9.552-21.334 21.334s9.552 21.333 21.334 21.333h280.448c11.782 0 21.334-9.552 21.334-21.334s-9.551-21.334-21.334-21.334z"></path><path d="M261.092 423.801l36.906-58.304c6.315-9.962-1.579-22.421-14.208-22.421h-73.814c-12.63 0-20.501 12.459-14.208 22.421l36.906 58.304c6.315 9.962 22.101 9.962 28.416 0z"></path></svg>',
|
|
18
|
+
marginSide: '<svg style="width:18px;height:18px" fill="currentColor" viewBox="0 0 24 24" style="transform:scale(1.125)"><path d="M5 5.8c0-.5.3-.8.7-.8h14.5a.8.8 0 0 1 0 1.5H5.7a.8.8 0 0 1-.7-.8Z"></path><path d="M9 14.8c0-.5.3-.8.7-.8h6.5a.8.8 0 0 1 0 1.5H9.7a.8.8 0 0 1-.7-.8Z"></path><path d="M9 9.8c0-.5.3-.8.7-.8h6.5a.8.8 0 0 1 0 1.5H9.7a.8.8 0 0 1-.7-.8Z"></path><path d="M5 18.8c0-.5.3-.8.7-.8h14.5a.8.8 0 0 1 0 1.5H5.7a.8.8 0 0 1-.7-.8Z"></path><path d="M5.5 14.5c-.2.2-.5 0-.5-.2V9.7c0-.2.3-.4.5-.2l2.3 2.3v.4l-2.3 2.3Z"></path><path d="M20.5 14.5c.2.2.5 0 .5-.2V9.7c0-.2-.3-.4-.5-.2l-2.3 2.3c-.1.1-.1.3 0 .4l2.3 2.3Z"></path></svg>',
|
|
19
|
+
lineSpace: '<svg style="width:18px;height:18px" viewBox="0 0 24 24" fill="currentColor" style="transform:scale(1.1)"><path fill-rule="evenodd" clip-rule="evenodd" d="M5 5.3c0-.5.3-.8.7-.8h14.5a.8.8 0 0 1 0 1.5H5.7a.8.8 0 0 1-.7-.8Zm7 9c0-.5.3-.8.7-.8h7.5a.8.8 0 0 1 0 1.5h-7.5a.8.8 0 0 1-.7-.8Zm0-4.5c0-.5.3-.8.7-.8h7.5a.8.8 0 0 1 0 1.5h-7.5a.8.8 0 0 1-.7-.8Zm-7 9c0-.5.3-.8.7-.8h14.5a.8.8 0 0 1 0 1.5H5.7a.8.8 0 0 1-.7-.8Zm5.3-8.8c.3.1.1.5-.1.5H5.8a.3.3 0 0 1-.2-.5l2.2-1.8c.1-.1.3-.1.4 0l2.1 1.8Zm0 4c.3-.1.1-.5-.1-.5H5.8c-.3 0-.4.4-.2.5l2.2 1.8c.1.1.3.1.4 0l2.1-1.8Z"></path></svg>',
|
|
20
|
+
wordSpace: '<svg style="width:18px;height:18px" viewBox="0 0 24 24" fill="none" style="transform: scale(1.1)"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.75 13.25C9.33579 13.25 9 12.9142 9 12.5C9 12.0858 9.33579 11.75 9.75 11.75H15.25C15.6642 11.75 16 12.0858 16 12.5C16 12.9142 15.6642 13.25 15.25 13.25H9.75Z" fill="currentColor"></path><path d="M7.5 17L11.8719 6.42009C11.9769 6.16584 12.2249 6 12.5 6V6C12.7751 6 13.0231 6.16584 13.1281 6.42009L17.5 17" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M4.25 4.20001C4.66421 4.20001 5 4.5358 5 4.95001L5 18.95C5 19.3642 4.66421 19.7 4.25 19.7C3.83579 19.7 3.5 19.3642 3.5 18.95L3.5 4.95001C3.5 4.5358 3.83579 4.20001 4.25 4.20001Z" fill="currentColor"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M20.75 4.20001C21.1642 4.20001 21.5 4.5358 21.5 4.95001L21.5 18.95C21.5 19.3642 21.1642 19.7 20.75 19.7C20.3358 19.7 20 19.3642 20 18.95L20 4.95001C20 4.5358 20.3358 4.20001 20.75 4.20001Z" fill="currentColor"></path></svg>',
|
|
21
|
+
};
|
|
8
22
|
export const REL_DICT = {
|
|
9
23
|
equal: 'eq',
|
|
10
24
|
unequal: 'neq',
|
|
@@ -117,3 +131,5 @@ export const TABLE_SLOT_PREFIX = 'cell_';
|
|
|
117
131
|
export const CELL_CUSTOM_OPTION = 'cell__custom__option';
|
|
118
132
|
// 表格全局按钮插槽名称
|
|
119
133
|
export const GLOBAL_BUTTON = 'globalButton';
|
|
134
|
+
export const FORM_MAX_LENGTH = 140;
|
|
135
|
+
export const KEY_DOWN_CODE = 13;
|
|
@@ -110,7 +110,7 @@ export class DataSource {
|
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
export const getDataSourceByName = async (dbName, GetColumnAuth =
|
|
113
|
+
export const getDataSourceByName = async (dbName, GetColumnAuth = true) => {
|
|
114
114
|
var _a, _b;
|
|
115
115
|
try {
|
|
116
116
|
// dbName 为空时
|
|
@@ -124,7 +124,7 @@ export const getDataSourceByName = async (dbName, GetColumnAuth = false) => {
|
|
|
124
124
|
return getDataSourceByNameCompatibleProvite(dbName);
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
|
-
const datasource = await window.app.cloud.getDataSourceProfileAsync(GetColumnAuth ? { Name: dbName, GetColumnAuth: true } : dbName);
|
|
127
|
+
const datasource = await window.app.cloud.getDataSourceProfileAsync(GetColumnAuth ? { Name: dbName, GetColumnAuth: true } : { Name: dbName });
|
|
128
128
|
return datasource;
|
|
129
129
|
}
|
|
130
130
|
catch (error) {
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { useMemo, useRef } from 'react';
|
|
2
|
+
import { convertLegacyProps, convertLegacyEnum } from '../tool';
|
|
3
|
+
import { WD_INPUT_SIZE, WD_INPUT_LAYOUT, WD_INPUT_LABEL_ALIGN, } from '../../../enum';
|
|
4
|
+
import isEqual from '../isObjectEqual';
|
|
5
|
+
import lodashGet from 'lodash.get';
|
|
6
|
+
import { usePlatform, textToString } from '../platform';
|
|
7
|
+
const PROPS_VALUE_MAP = { size: { l: 'lg', m: 'md', s: 'sm' } };
|
|
8
|
+
// h5端固定为 md
|
|
9
|
+
export const useSize = (props) => {
|
|
10
|
+
const platform = usePlatform();
|
|
11
|
+
const _size = props.size;
|
|
12
|
+
const size = useMemo(() => {
|
|
13
|
+
const temp = convertLegacyProps(PROPS_VALUE_MAP, 'size', _size);
|
|
14
|
+
if (temp === 'xs')
|
|
15
|
+
return 'xs';
|
|
16
|
+
if (platform === 'h5')
|
|
17
|
+
return 'md';
|
|
18
|
+
return convertLegacyEnum(temp, WD_INPUT_SIZE, 'md');
|
|
19
|
+
}, [_size, platform]);
|
|
20
|
+
return size;
|
|
21
|
+
};
|
|
22
|
+
// 位置,需要从 WdForm 中同步,所以默认为空
|
|
23
|
+
export const useLayout = (props) => {
|
|
24
|
+
const { layout: _layout } = props || {};
|
|
25
|
+
const layout = useMemo(() => {
|
|
26
|
+
return convertLegacyEnum(_layout, WD_INPUT_LAYOUT, 'horizontal');
|
|
27
|
+
}, [_layout]);
|
|
28
|
+
return layout;
|
|
29
|
+
};
|
|
30
|
+
// 对齐
|
|
31
|
+
export const useLabelAlign = (props) => {
|
|
32
|
+
const { labelAlign: _labelAlign } = props || {};
|
|
33
|
+
const labelAlign = useMemo(() => {
|
|
34
|
+
return convertLegacyEnum(_labelAlign, WD_INPUT_LABEL_ALIGN, 'left');
|
|
35
|
+
}, [_labelAlign]);
|
|
36
|
+
return labelAlign;
|
|
37
|
+
};
|
|
38
|
+
// 兼容有前后缀时的必填校验
|
|
39
|
+
export const useRules = (props) => {
|
|
40
|
+
const { rules: _rules, required, before, after, requiredMsg } = props || {};
|
|
41
|
+
const [_before, _after] = [textToString(before), textToString(after)];
|
|
42
|
+
const rulesRef = useRef(_rules);
|
|
43
|
+
const rules = useMemo(() => {
|
|
44
|
+
let newRules = _rules;
|
|
45
|
+
if (required && (_before || _after)) {
|
|
46
|
+
const reg = `/^(?!(^${_before}${_after}$)).*$/`;
|
|
47
|
+
const rule = { message: requiredMsg, pattern: reg };
|
|
48
|
+
newRules = [..._rules, rule];
|
|
49
|
+
}
|
|
50
|
+
if (!isEqual(rulesRef.current, newRules)) {
|
|
51
|
+
rulesRef.current = newRules;
|
|
52
|
+
}
|
|
53
|
+
return rulesRef.current;
|
|
54
|
+
}, [_rules, required, _before, _after, requiredMsg]);
|
|
55
|
+
return rules;
|
|
56
|
+
};
|
|
57
|
+
// 兼容新旧状态
|
|
58
|
+
export const useStatus = (props) => {
|
|
59
|
+
const { disabled: _disabled, readOnly: _readOnly, status } = props || {};
|
|
60
|
+
const result = useMemo(() => {
|
|
61
|
+
const disabled = status === 'disabled' || !!_disabled;
|
|
62
|
+
const readOnly = status === 'readOnly' || !!_readOnly;
|
|
63
|
+
return { disabled, readOnly };
|
|
64
|
+
}, [_disabled, _readOnly, status]);
|
|
65
|
+
return result;
|
|
66
|
+
};
|
|
67
|
+
// 输入值添加前后缀,且兼容数字
|
|
68
|
+
export const converValueFix = (_inputValue, _before, _after, type) => {
|
|
69
|
+
const [inputValue, before, after] = [_inputValue, _before, _after].map((d) => textToString(d));
|
|
70
|
+
const fixValue = `${before}${inputValue}${after}`;
|
|
71
|
+
if (type && ['number', 'digit'].includes(type) && fixValue === '') {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
return fixValue;
|
|
75
|
+
};
|
|
76
|
+
// 前后缀值转输入值
|
|
77
|
+
export const converInputValue = (_value, _before, _after) => {
|
|
78
|
+
const [value, before, after] = [_value, _before, _after].map((d) => textToString(d));
|
|
79
|
+
let inputValue = value;
|
|
80
|
+
if (before && inputValue.startsWith(before)) {
|
|
81
|
+
const beforeReg = new RegExp(`^${before}`);
|
|
82
|
+
inputValue = inputValue.replace(beforeReg, '');
|
|
83
|
+
}
|
|
84
|
+
if (after && inputValue.endsWith(after)) {
|
|
85
|
+
const afterReg = new RegExp(`${after}$`);
|
|
86
|
+
inputValue = inputValue.replace(afterReg, '');
|
|
87
|
+
}
|
|
88
|
+
return inputValue;
|
|
89
|
+
};
|
|
90
|
+
// 转换方法参数 {value} -> str
|
|
91
|
+
export const convertMethodParam = (val) => {
|
|
92
|
+
const methodValue = lodashGet(val, 'value');
|
|
93
|
+
return methodValue !== undefined ? methodValue : val;
|
|
94
|
+
};
|
|
95
|
+
// 将输入值转成字符串类型
|
|
96
|
+
export const useStringProp = (props) => {
|
|
97
|
+
const { inputValue: _inputValue, value: _value, before: _before, after: _after, } = props || {};
|
|
98
|
+
const result = useMemo(() => {
|
|
99
|
+
const inputValue = textToString(_inputValue);
|
|
100
|
+
const value = textToString(_value);
|
|
101
|
+
const before = textToString(_before);
|
|
102
|
+
const after = textToString(_after);
|
|
103
|
+
return { inputValue, value, before, after };
|
|
104
|
+
}, [_inputValue, _value, _before, _after]);
|
|
105
|
+
return result;
|
|
106
|
+
};
|
|
107
|
+
// 兼容 px 单位
|
|
108
|
+
export const convertPx = (val, unit = 'px') => {
|
|
109
|
+
const temp = /^\d+$/.test(`${val}`) ? `${val}${unit}` : val;
|
|
110
|
+
return typeof temp === 'string' ? temp : '';
|
|
111
|
+
};
|
package/dist/web/utils/tool.js
CHANGED
|
@@ -30,8 +30,13 @@ export const getUuid = () => {
|
|
|
30
30
|
/**
|
|
31
31
|
* 转换枚举值
|
|
32
32
|
*/
|
|
33
|
-
export const convertLegacyEnum = (prop, enumObj) => {
|
|
34
|
-
|
|
33
|
+
export const convertLegacyEnum = (prop, enumObj, defaultValue) => {
|
|
34
|
+
const enumValue = enumObj.map((i) => i.value).includes(prop)
|
|
35
|
+
? prop
|
|
36
|
+
: enumObj[0].value;
|
|
37
|
+
if (defaultValue !== undefined)
|
|
38
|
+
return enumValue || defaultValue;
|
|
39
|
+
return enumValue;
|
|
35
40
|
};
|
|
36
41
|
/**
|
|
37
42
|
* 判断数据源字段类型名称
|
|
@@ -132,3 +137,8 @@ export const deepClone = (obj) => {
|
|
|
132
137
|
});
|
|
133
138
|
return newObj;
|
|
134
139
|
};
|
|
140
|
+
/** 兼容旧属性 */
|
|
141
|
+
export const convertLegacyProps = (map, key, prop) => {
|
|
142
|
+
var _a;
|
|
143
|
+
return (_a = map[key][prop]) !== null && _a !== void 0 ? _a : prop;
|
|
144
|
+
};
|