@lingxiteam/assets 1.0.13-alpha.3 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.d.ts +2 -2
- package/es/index.js +2 -2
- package/es/rootConfig/mobile/BusiComp.js +3 -2
- package/es/rootConfig/mobile/MobileModal.js +3 -2
- package/es/rootConfig/mobile/MobilePopover.js +3 -2
- package/es/rootConfig/mobile/page.d.ts +6 -0
- package/es/rootConfig/mobile/page.js +9 -2
- package/es/rootConfig/pc/BusiComp.js +3 -2
- package/es/rootConfig/pc/Drawer.js +3 -2
- package/es/rootConfig/pc/Modal.js +3 -2
- package/es/rootConfig/pc/Popover.js +3 -2
- package/es/rootConfig/pc/page.js +3 -2
- package/es/rootConfig/todoActionList.d.ts +15 -0
- package/es/rootConfig/todoActionList.js +22 -6
- package/es/rootConfig/todoOptionList.d.ts +1 -0
- package/es/rootConfig/todoOptionList.js +2 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +9 -13
- package/lib/rootConfig/mobile/BusiComp.js +3 -2
- package/lib/rootConfig/mobile/MobileModal.js +3 -2
- package/lib/rootConfig/mobile/MobilePopover.js +3 -2
- package/lib/rootConfig/mobile/page.d.ts +6 -0
- package/lib/rootConfig/mobile/page.js +9 -2
- package/lib/rootConfig/pc/BusiComp.js +3 -2
- package/lib/rootConfig/pc/Drawer.js +3 -2
- package/lib/rootConfig/pc/Modal.js +3 -2
- package/lib/rootConfig/pc/Popover.js +3 -2
- package/lib/rootConfig/pc/page.js +3 -2
- package/lib/rootConfig/todoActionList.d.ts +15 -0
- package/lib/rootConfig/todoActionList.js +22 -6
- package/lib/rootConfig/todoOptionList.d.ts +1 -0
- package/lib/rootConfig/todoOptionList.js +2 -1
- package/package.json +1 -1
- package/es/dealDsl/PropType.d.ts +0 -7
- package/es/dealDsl/PropType.js +0 -1
- package/es/dealDsl/index.d.ts +0 -1
- package/es/dealDsl/index.js +0 -1
- package/es/dealDsl/preprocess/common.d.ts +0 -9
- package/es/dealDsl/preprocess/common.js +0 -412
- package/es/dealDsl/preprocessDSL.d.ts +0 -9
- package/es/dealDsl/preprocessDSL.js +0 -38
- package/es/dealDsl/utils/index.d.ts +0 -13
- package/es/dealDsl/utils/index.js +0 -21
- package/lib/dealDsl/PropType.d.ts +0 -7
- package/lib/dealDsl/PropType.js +0 -5
- package/lib/dealDsl/index.d.ts +0 -1
- package/lib/dealDsl/index.js +0 -12
- package/lib/dealDsl/preprocess/common.d.ts +0 -9
- package/lib/dealDsl/preprocess/common.js +0 -419
- package/lib/dealDsl/preprocessDSL.d.ts +0 -9
- package/lib/dealDsl/preprocessDSL.js +0 -46
- package/lib/dealDsl/utils/index.d.ts +0 -13
- package/lib/dealDsl/utils/index.js +0 -29
package/es/dealDsl/PropType.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export interface ContextType {
|
|
2
|
-
platformType: 'LowCode' | 'ZeroCode' | 'Design';
|
|
3
|
-
isMobile: boolean;
|
|
4
|
-
}
|
|
5
|
-
export type JSONType = Record<string, any>;
|
|
6
|
-
export type ProcessFunctionType = (component: JSONType) => JSONType;
|
|
7
|
-
export type ProcessPlatformType = Record<string, ProcessFunctionType>;
|
package/es/dealDsl/PropType.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/es/dealDsl/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { preprocessDSL } from './preprocessDSL';
|
package/es/dealDsl/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { preprocessDSL } from './preprocessDSL';
|
|
@@ -1,412 +0,0 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
import { hasSomeOwnProperty, hasEveryOwnProperty } from '../utils';
|
|
3
|
-
var h5 = {
|
|
4
|
-
Button: function Button() {
|
|
5
|
-
var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
6
|
-
var _component$props = component.props,
|
|
7
|
-
props = _component$props === void 0 ? {} : _component$props;
|
|
8
|
-
// 兼容存量数据不存在 hasIcon(是否有图标开关标识)
|
|
9
|
-
if ((props === null || props === void 0 ? void 0 : props.icontype) && JSON.stringify(props.icontype) !== '{}') {
|
|
10
|
-
props.btnIcon = true;
|
|
11
|
-
} else {
|
|
12
|
-
props.btnIcon = false;
|
|
13
|
-
}
|
|
14
|
-
return component;
|
|
15
|
-
},
|
|
16
|
-
Icon: function Icon() {
|
|
17
|
-
var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
18
|
-
var _component$props2 = component.props,
|
|
19
|
-
props = _component$props2 === void 0 ? {} : _component$props2;
|
|
20
|
-
if (props.type && _typeof(props.type) === 'object') {
|
|
21
|
-
props.icon = props.type;
|
|
22
|
-
delete props.type;
|
|
23
|
-
}
|
|
24
|
-
return component;
|
|
25
|
-
},
|
|
26
|
-
Divider: function Divider() {
|
|
27
|
-
var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
28
|
-
var _component$props3 = component.props,
|
|
29
|
-
props = _component$props3 === void 0 ? {} : _component$props3;
|
|
30
|
-
if (props.status !== undefined) {
|
|
31
|
-
props.visible = props.status;
|
|
32
|
-
delete props.status;
|
|
33
|
-
}
|
|
34
|
-
return component;
|
|
35
|
-
},
|
|
36
|
-
'DatePicker|Calendar|Picker': function DatePickerCalendarPicker() {
|
|
37
|
-
var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
38
|
-
// TODO: 1.0.9 版本数据兼容
|
|
39
|
-
if (!component.props.hasOwnProperty('visible')) {
|
|
40
|
-
component.props.visible = false;
|
|
41
|
-
}
|
|
42
|
-
;
|
|
43
|
-
return component;
|
|
44
|
-
},
|
|
45
|
-
DformDate: function DformDate() {
|
|
46
|
-
var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
47
|
-
var _component$props4 = component.props,
|
|
48
|
-
props = _component$props4 === void 0 ? {} : _component$props4;
|
|
49
|
-
var isCurrent = props.isCurrent,
|
|
50
|
-
defaultValue = props.defaultValue,
|
|
51
|
-
customTime = props.customTime;
|
|
52
|
-
// props中存在isCurrent/customTime属性,就转化。
|
|
53
|
-
if (hasSomeOwnProperty(props, ['isCurrent', 'customTime'])) {
|
|
54
|
-
props.defaultValue = {
|
|
55
|
-
isCurrent: isCurrent,
|
|
56
|
-
defaultValue: defaultValue,
|
|
57
|
-
customTime: customTime,
|
|
58
|
-
type: function () {
|
|
59
|
-
if (isCurrent) {
|
|
60
|
-
return 'isCurrent';
|
|
61
|
-
}
|
|
62
|
-
if (customTime) {
|
|
63
|
-
return 'custom';
|
|
64
|
-
}
|
|
65
|
-
return 'now';
|
|
66
|
-
}()
|
|
67
|
-
};
|
|
68
|
-
delete props.isCurrent;
|
|
69
|
-
delete props.customTime;
|
|
70
|
-
}
|
|
71
|
-
return component;
|
|
72
|
-
},
|
|
73
|
-
'DMultiplePicker|DformDate|DformInput|DformSelect|DformPicker': function DMultiplePickerDformDateDformInputDformSelectDformPicker() {
|
|
74
|
-
var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
75
|
-
var _component$props5 = component.props,
|
|
76
|
-
props = _component$props5 === void 0 ? {} : _component$props5;
|
|
77
|
-
if (props.hasOwnProperty('type')) {
|
|
78
|
-
delete props.type;
|
|
79
|
-
delete props.theme;
|
|
80
|
-
delete props.fontAddress;
|
|
81
|
-
delete props.isIconFont;
|
|
82
|
-
delete props.iconFileInfo;
|
|
83
|
-
delete props.svgContent;
|
|
84
|
-
delete props.iconFile;
|
|
85
|
-
}
|
|
86
|
-
return component;
|
|
87
|
-
},
|
|
88
|
-
DformFile: function DformFile() {
|
|
89
|
-
var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
90
|
-
// 新数据改成 accept、acceptExtension 从uploadAccepType当中获取 eg uploadAccepType = {accept,acceptExtension}
|
|
91
|
-
var _component$props6 = component.props,
|
|
92
|
-
props = _component$props6 === void 0 ? {} : _component$props6;
|
|
93
|
-
var accept = props.accept,
|
|
94
|
-
acceptExtension = props.acceptExtension;
|
|
95
|
-
if (props.hasOwnProperty('accept')) {
|
|
96
|
-
props.uploadAccepType.accept = accept;
|
|
97
|
-
props === null || props === void 0 ? true : delete props.accept;
|
|
98
|
-
}
|
|
99
|
-
if (props.hasOwnProperty('acceptExtension')) {
|
|
100
|
-
props.uploadAccepType.acceptExtension = acceptExtension;
|
|
101
|
-
props === null || props === void 0 ? true : delete props.acceptExtension;
|
|
102
|
-
}
|
|
103
|
-
return component;
|
|
104
|
-
},
|
|
105
|
-
'Image|DformFile|DformImagePicker|Signature': function ImageDformFileDformImagePickerSignature() {
|
|
106
|
-
var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
107
|
-
var _component$props7 = component.props,
|
|
108
|
-
props = _component$props7 === void 0 ? {} : _component$props7;
|
|
109
|
-
if (props.hasOwnProperty('action')) {
|
|
110
|
-
// 旧数据含有action,实际用到的值和columns当中的api是相同
|
|
111
|
-
props.columns.api = props.action;
|
|
112
|
-
delete props.action;
|
|
113
|
-
}
|
|
114
|
-
return component;
|
|
115
|
-
},
|
|
116
|
-
// 兼容处理下存量的身份证校验规则
|
|
117
|
-
'DformInput|Input': function DformInputInput(component) {
|
|
118
|
-
var _component$props8 = component === null || component === void 0 ? void 0 : component.props,
|
|
119
|
-
regexp = _component$props8.regexp;
|
|
120
|
-
if (Array.isArray(regexp)) {
|
|
121
|
-
var oldRegStr = "/^\\d{6}(18|19|20)?\\d{2}(0[1-9]|1[12])(0[1-9]|[12]\\d|3[01])\\d{3}(\\d|X)$/";
|
|
122
|
-
var newRegStr = "/^\\d{6}(18|19|20)?\\d{2}(0[1-9]|1[012])(0[1-9]|[12]\\d|3[01])\\d{3}(\\d|X)$/";
|
|
123
|
-
// 运行态会给正则加上$$符号
|
|
124
|
-
var idCardRegexp = regexp.find(function (reg) {
|
|
125
|
-
return reg.pattern === "$".concat(oldRegStr, "$") || reg.pattern === oldRegStr;
|
|
126
|
-
});
|
|
127
|
-
if (idCardRegexp) {
|
|
128
|
-
if (/^\$.+\$$/.test(idCardRegexp.pattern)) {
|
|
129
|
-
idCardRegexp.pattern = "$".concat(newRegStr, "$");
|
|
130
|
-
} else {
|
|
131
|
-
idCardRegexp.pattern = newRegStr;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
return component;
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
var pc = {
|
|
139
|
-
'DatePicker|TimePicker': function DatePickerTimePicker() {
|
|
140
|
-
var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
141
|
-
var _component$props9 = component.props,
|
|
142
|
-
props = _component$props9 === void 0 ? {} : _component$props9;
|
|
143
|
-
var isCurrent = props.isCurrent,
|
|
144
|
-
defaultValue = props.defaultValue,
|
|
145
|
-
customTime = props.customTime;
|
|
146
|
-
// props中存在isCurrent/customTime属性,就转化。
|
|
147
|
-
if (hasSomeOwnProperty(props, ['isCurrent', 'customTime'])) {
|
|
148
|
-
props.defaultValue = {
|
|
149
|
-
isCurrent: isCurrent,
|
|
150
|
-
defaultValue: defaultValue,
|
|
151
|
-
customTime: customTime,
|
|
152
|
-
type: function () {
|
|
153
|
-
if (isCurrent) {
|
|
154
|
-
return 'isCurrent';
|
|
155
|
-
}
|
|
156
|
-
if (customTime) {
|
|
157
|
-
return 'custom';
|
|
158
|
-
}
|
|
159
|
-
return 'now';
|
|
160
|
-
}()
|
|
161
|
-
};
|
|
162
|
-
delete props.isCurrent;
|
|
163
|
-
delete props.customTime;
|
|
164
|
-
}
|
|
165
|
-
return component;
|
|
166
|
-
},
|
|
167
|
-
Button: function Button() {
|
|
168
|
-
var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
169
|
-
var _component$props10 = component.props,
|
|
170
|
-
props = _component$props10 === void 0 ? {} : _component$props10;
|
|
171
|
-
// const { popoverSetting, showPopover } = props;
|
|
172
|
-
if (props.iconType && !props.icon) {
|
|
173
|
-
var theme = props.theme,
|
|
174
|
-
fontAddress = props.fontAddress,
|
|
175
|
-
isIconFont = props.isIconFont,
|
|
176
|
-
svgContent = props.svgContent,
|
|
177
|
-
iconFile = props.iconFile;
|
|
178
|
-
props.icon = {
|
|
179
|
-
type: props.iconType,
|
|
180
|
-
theme: theme,
|
|
181
|
-
fontAddress: fontAddress,
|
|
182
|
-
isIconFont: isIconFont,
|
|
183
|
-
svgContent: svgContent,
|
|
184
|
-
iconFile: iconFile
|
|
185
|
-
};
|
|
186
|
-
props.icon.type = props.iconType;
|
|
187
|
-
delete props.iconType;
|
|
188
|
-
}
|
|
189
|
-
delete props.theme;
|
|
190
|
-
delete props.fontAddress;
|
|
191
|
-
delete props.isIconFont;
|
|
192
|
-
delete props.iconFileInfo;
|
|
193
|
-
delete props.svgContent;
|
|
194
|
-
delete props.iconFile;
|
|
195
|
-
// 兼容存量数据不存在 hasIcon(是否有图标开关标识)
|
|
196
|
-
if ((props === null || props === void 0 ? void 0 : props.icon) && JSON.stringify(props.icon) !== '{}') {
|
|
197
|
-
props.hasIcon = true;
|
|
198
|
-
} else {
|
|
199
|
-
props.hasIcon = false;
|
|
200
|
-
}
|
|
201
|
-
return component;
|
|
202
|
-
},
|
|
203
|
-
'Dropdown|Menu': function DropdownMenu() {
|
|
204
|
-
var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
205
|
-
var _component$props11 = component.props,
|
|
206
|
-
props = _component$props11 === void 0 ? {} : _component$props11;
|
|
207
|
-
delete props.iconInfo;
|
|
208
|
-
return component;
|
|
209
|
-
},
|
|
210
|
-
'Input|Card|Collapse': function InputCardCollapse() {
|
|
211
|
-
var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
212
|
-
var _component$props12 = component.props,
|
|
213
|
-
props = _component$props12 === void 0 ? {} : _component$props12;
|
|
214
|
-
if (!props.icon) {
|
|
215
|
-
props.icon = {
|
|
216
|
-
type: props.type,
|
|
217
|
-
theme: props.theme || "outlined",
|
|
218
|
-
fontAddress: "",
|
|
219
|
-
isIconFont: false,
|
|
220
|
-
iconFileInfo: {}
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
delete props.type;
|
|
224
|
-
delete props.theme;
|
|
225
|
-
delete props.fontAddress;
|
|
226
|
-
delete props.isIconFont;
|
|
227
|
-
delete props.iconFileInfo;
|
|
228
|
-
delete props.svgContent;
|
|
229
|
-
delete props.iconFile;
|
|
230
|
-
if (!props.prefixIcon) {
|
|
231
|
-
props.prefixIcon = {
|
|
232
|
-
type: props.prefixIconType,
|
|
233
|
-
theme: props.prefixIconTheme || "outlined",
|
|
234
|
-
fontAddress: "",
|
|
235
|
-
isIconFont: false,
|
|
236
|
-
iconFileInfo: {}
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
delete props.prefixIconIconFileInfo;
|
|
240
|
-
delete props.prefixIconIsIconFont;
|
|
241
|
-
delete props.prefixIconType;
|
|
242
|
-
delete props.prefixIconTheme;
|
|
243
|
-
delete props.prefixIconFontAddress;
|
|
244
|
-
delete props.prefixIconiconFile;
|
|
245
|
-
return component;
|
|
246
|
-
},
|
|
247
|
-
'StdUpload|Icon': function StdUploadIcon() {
|
|
248
|
-
var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
249
|
-
var _component$props13 = component.props,
|
|
250
|
-
props = _component$props13 === void 0 ? {} : _component$props13;
|
|
251
|
-
if (!props.icon) {
|
|
252
|
-
props.icon = {
|
|
253
|
-
type: props.type,
|
|
254
|
-
theme: props.theme || "outlined",
|
|
255
|
-
fontAddress: "",
|
|
256
|
-
isIconFont: false,
|
|
257
|
-
iconFileInfo: {}
|
|
258
|
-
};
|
|
259
|
-
}
|
|
260
|
-
delete props.type;
|
|
261
|
-
delete props.theme;
|
|
262
|
-
delete props.fontAddress;
|
|
263
|
-
delete props.isIconFont;
|
|
264
|
-
delete props.iconFileInfo;
|
|
265
|
-
delete props.svgContent;
|
|
266
|
-
delete props.iconFile;
|
|
267
|
-
return component;
|
|
268
|
-
},
|
|
269
|
-
Table: function Table() {
|
|
270
|
-
var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
271
|
-
var _component$props14 = component.props,
|
|
272
|
-
props = _component$props14 === void 0 ? {} : _component$props14;
|
|
273
|
-
if (typeof props.showCustom === 'boolean') {
|
|
274
|
-
// 旧数据
|
|
275
|
-
var iconPosition = props.iconPosition,
|
|
276
|
-
type = props.type,
|
|
277
|
-
theme = props.theme,
|
|
278
|
-
fontAddress = props.fontAddress,
|
|
279
|
-
isIconFont = props.isIconFont,
|
|
280
|
-
customTitle = props.customTitle,
|
|
281
|
-
customStyle = props.customStyle,
|
|
282
|
-
iconFile = props.iconFile,
|
|
283
|
-
showCustom = props.showCustom;
|
|
284
|
-
props.showCustom = {
|
|
285
|
-
iconPosition: iconPosition,
|
|
286
|
-
type: type,
|
|
287
|
-
theme: theme,
|
|
288
|
-
fontAddress: fontAddress,
|
|
289
|
-
isIconFont: isIconFont,
|
|
290
|
-
customTitle: customTitle,
|
|
291
|
-
customStyle: customStyle,
|
|
292
|
-
iconFile: iconFile,
|
|
293
|
-
hasCustom: showCustom
|
|
294
|
-
};
|
|
295
|
-
delete props.iconPosition;
|
|
296
|
-
delete props.type;
|
|
297
|
-
delete props.theme;
|
|
298
|
-
delete props.fontAddress;
|
|
299
|
-
delete props.isIconFont;
|
|
300
|
-
delete props.customTitle;
|
|
301
|
-
delete props.customStyle;
|
|
302
|
-
delete props.iconFile;
|
|
303
|
-
}
|
|
304
|
-
// 预处理内容列配置
|
|
305
|
-
var columns = props === null || props === void 0 ? void 0 : props.columns;
|
|
306
|
-
if (Array.isArray(columns)) {
|
|
307
|
-
props.columns = columns.map(function (colCfg) {
|
|
308
|
-
/**
|
|
309
|
-
* 1、兼容存量没有 editContent 情况:默认改为 -> 提示方式为默认提示 -> 提示内容为初始数据
|
|
310
|
-
* 2、false 假值表示:提示方式为无
|
|
311
|
-
*/
|
|
312
|
-
if (!(colCfg === null || colCfg === void 0 ? void 0 : colCfg.editContent) && typeof (colCfg === null || colCfg === void 0 ? void 0 : colCfg.editContent) !== 'boolean') {
|
|
313
|
-
colCfg.editContent = {
|
|
314
|
-
edittype: 'title',
|
|
315
|
-
title: {
|
|
316
|
-
"code": "$function main(text, row, index) { return text;}$",
|
|
317
|
-
"originCode": ["/**", " * 计算绑定的内容", " * @param {String} text 行数据中数据字段对应的原始值", " * @param {Object} row 行数据对象", " * @param {Number} index 行索引", " * @returns {Boolean} 实际值", " * 例:return row.id,表示当行主键为id时,返回内容为row.id实际的值", " */", "function main(text, row, index) {", " return text;", "}"]
|
|
318
|
-
}
|
|
319
|
-
};
|
|
320
|
-
}
|
|
321
|
-
return colCfg;
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
return component;
|
|
325
|
-
},
|
|
326
|
-
Upload: function Upload(component) {
|
|
327
|
-
var _component$props15 = component.props,
|
|
328
|
-
props = _component$props15 === void 0 ? {} : _component$props15;
|
|
329
|
-
if (props.hasOwnProperty('action')) {
|
|
330
|
-
// 旧数据含有action
|
|
331
|
-
props.columns.api = props.action;
|
|
332
|
-
delete props.action;
|
|
333
|
-
}
|
|
334
|
-
if (hasEveryOwnProperty(props, ['accept', 'acceptType'])) {
|
|
335
|
-
// 实际数据是取acceptType
|
|
336
|
-
delete props.accept;
|
|
337
|
-
}
|
|
338
|
-
return component;
|
|
339
|
-
},
|
|
340
|
-
StdUpload: function StdUpload(component) {
|
|
341
|
-
var props = component.props;
|
|
342
|
-
var accept = props.accept,
|
|
343
|
-
acceptExtension = props.acceptExtension,
|
|
344
|
-
action = props.action;
|
|
345
|
-
// 旧数据含有action
|
|
346
|
-
if (props.hasOwnProperty('action')) {
|
|
347
|
-
props.columns.api = action;
|
|
348
|
-
delete props.action;
|
|
349
|
-
}
|
|
350
|
-
// 新数据改成 accept、acceptExtension 从uploadAccepType当中获取 eg uploadAccepType = {accept,acceptExtension}
|
|
351
|
-
if (props.hasOwnProperty('accept')) {
|
|
352
|
-
props.uploadAccepType = Object.assign({}, props.uploadAccepType, {
|
|
353
|
-
accept: accept
|
|
354
|
-
});
|
|
355
|
-
delete props.accept;
|
|
356
|
-
}
|
|
357
|
-
if (props.hasOwnProperty('acceptExtension')) {
|
|
358
|
-
props.uploadAccepType = Object.assign({}, props.uploadAccepType, {
|
|
359
|
-
acceptExtension: acceptExtension
|
|
360
|
-
});
|
|
361
|
-
delete props.acceptExtension;
|
|
362
|
-
}
|
|
363
|
-
return component;
|
|
364
|
-
},
|
|
365
|
-
TreeSelect: function TreeSelect(component) {
|
|
366
|
-
var props = component.props;
|
|
367
|
-
var multiple = props.multiple,
|
|
368
|
-
treeNodeFilterProp = props.treeNodeFilterProp,
|
|
369
|
-
treeCheckable = props.treeCheckable,
|
|
370
|
-
_props$filter = props.filter,
|
|
371
|
-
filter = _props$filter === void 0 ? 'local' : _props$filter;
|
|
372
|
-
if (props.hasOwnProperty('multiple')) {
|
|
373
|
-
// 废除multiple,多选统一设置为treeCheckable
|
|
374
|
-
component.props.treeCheckable = multiple || treeCheckable;
|
|
375
|
-
delete props.multiple;
|
|
376
|
-
}
|
|
377
|
-
if (props.hasOwnProperty('treeNodeFilterProp')) {
|
|
378
|
-
// 以前设置了过滤搜索值的,统一设置为本地过滤
|
|
379
|
-
component.props.filter = treeNodeFilterProp ? 'local' : filter;
|
|
380
|
-
delete props.treeNodeFilterProp;
|
|
381
|
-
}
|
|
382
|
-
return component;
|
|
383
|
-
},
|
|
384
|
-
Input: function Input(component) {
|
|
385
|
-
// 兼容处理下存量的身份证校验规则
|
|
386
|
-
var _component$props16 = component === null || component === void 0 ? void 0 : component.props,
|
|
387
|
-
regexp = _component$props16.regexp;
|
|
388
|
-
if (Array.isArray(regexp)) {
|
|
389
|
-
var oldRegStr = "/^\\d{6}(18|19|20)?\\d{2}(0[1-9]|1[12])(0[1-9]|[12]\\d|3[01])\\d{3}(\\d|X)$/";
|
|
390
|
-
var newRegStr = "/^\\d{6}(18|19|20)?\\d{2}(0[1-9]|1[012])(0[1-9]|[12]\\d|3[01])\\d{3}(\\d|X)$/";
|
|
391
|
-
// 运行态会给正则加上$$符号
|
|
392
|
-
var idCardRegexp = regexp.find(function (reg) {
|
|
393
|
-
return reg.pattern === "$".concat(oldRegStr, "$") || reg.pattern === oldRegStr;
|
|
394
|
-
});
|
|
395
|
-
if (idCardRegexp) {
|
|
396
|
-
if (/^\$.+\$$/.test(idCardRegexp.pattern)) {
|
|
397
|
-
idCardRegexp.pattern = "$".concat(newRegStr, "$");
|
|
398
|
-
} else {
|
|
399
|
-
idCardRegexp.pattern = newRegStr;
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
return component;
|
|
404
|
-
}
|
|
405
|
-
};
|
|
406
|
-
/**
|
|
407
|
-
* 配置态和运行态共用
|
|
408
|
-
*/
|
|
409
|
-
export default {
|
|
410
|
-
h5: h5,
|
|
411
|
-
pc: pc
|
|
412
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ContextType } from "./PropType";
|
|
2
|
-
/**
|
|
3
|
-
* 本方法只处理运行态和配置态公共属性. 也就是配置态运行态都会生效
|
|
4
|
-
* 如果需要修改单独特性属性,请使用在配置态中preprocessEditorDSL 处理
|
|
5
|
-
* @param component
|
|
6
|
-
* @param context
|
|
7
|
-
* @returns
|
|
8
|
-
*/
|
|
9
|
-
export declare const preprocessDSL: (component: Record<string, any>, context: ContextType) => Record<string, any>;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import preprocessObj from "./preprocess/common";
|
|
2
|
-
/**
|
|
3
|
-
* 支持属性key通过 "compName|compName"模式
|
|
4
|
-
* @param compName
|
|
5
|
-
* @param obj
|
|
6
|
-
* @returns
|
|
7
|
-
*/
|
|
8
|
-
var collectionMethods = function collectionMethods(compName, obj) {
|
|
9
|
-
var funcs = [];
|
|
10
|
-
Object.keys(obj).forEach(function (key) {
|
|
11
|
-
var compNames = key.replace(/\s/g, '').split('|');
|
|
12
|
-
if (compNames.includes(compName)) {
|
|
13
|
-
funcs.push(obj[key]);
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
return funcs;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* 本方法只处理运行态和配置态公共属性. 也就是配置态运行态都会生效
|
|
20
|
-
* 如果需要修改单独特性属性,请使用在配置态中preprocessEditorDSL 处理
|
|
21
|
-
* @param component
|
|
22
|
-
* @param context
|
|
23
|
-
* @returns
|
|
24
|
-
*/
|
|
25
|
-
export var preprocessDSL = function preprocessDSL(component, context) {
|
|
26
|
-
var targetComponents = component;
|
|
27
|
-
var _ref = component || {},
|
|
28
|
-
compName = _ref.compName;
|
|
29
|
-
var _context$isMobile = context.isMobile,
|
|
30
|
-
isMobile = _context$isMobile === void 0 ? false : _context$isMobile;
|
|
31
|
-
var platform = isMobile ? 'h5' : 'pc';
|
|
32
|
-
var methods = collectionMethods(compName, preprocessObj === null || preprocessObj === void 0 ? void 0 : preprocessObj[platform]);
|
|
33
|
-
methods.forEach(function (fn) {
|
|
34
|
-
var _fn;
|
|
35
|
-
targetComponents = (_fn = fn(targetComponents)) !== null && _fn !== void 0 ? _fn : targetComponents;
|
|
36
|
-
});
|
|
37
|
-
return targetComponents;
|
|
38
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 是否包含某属性,或的关系。 包含`propertyNames`中的一个值即可
|
|
3
|
-
* @param target
|
|
4
|
-
* @param propertyNames
|
|
5
|
-
*/
|
|
6
|
-
export declare const hasSomeOwnProperty: (target: Object, propertyNames: string[]) => boolean;
|
|
7
|
-
/**
|
|
8
|
-
* 是否包含某属性,且的关系。 必须包含`propertyNames`中的所有属性
|
|
9
|
-
* @param target
|
|
10
|
-
* @param propertyNames
|
|
11
|
-
* @returns
|
|
12
|
-
*/
|
|
13
|
-
export declare const hasEveryOwnProperty: (target: Object, propertyNames: string[]) => boolean;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 是否包含某属性,或的关系。 包含`propertyNames`中的一个值即可
|
|
3
|
-
* @param target
|
|
4
|
-
* @param propertyNames
|
|
5
|
-
*/
|
|
6
|
-
export var hasSomeOwnProperty = function hasSomeOwnProperty(target, propertyNames) {
|
|
7
|
-
return propertyNames.some(function (property) {
|
|
8
|
-
return target.hasOwnProperty(property);
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* 是否包含某属性,且的关系。 必须包含`propertyNames`中的所有属性
|
|
13
|
-
* @param target
|
|
14
|
-
* @param propertyNames
|
|
15
|
-
* @returns
|
|
16
|
-
*/
|
|
17
|
-
export var hasEveryOwnProperty = function hasEveryOwnProperty(target, propertyNames) {
|
|
18
|
-
return propertyNames.every(function (property) {
|
|
19
|
-
return target.hasOwnProperty(property);
|
|
20
|
-
});
|
|
21
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export interface ContextType {
|
|
2
|
-
platformType: 'LowCode' | 'ZeroCode' | 'Design';
|
|
3
|
-
isMobile: boolean;
|
|
4
|
-
}
|
|
5
|
-
export type JSONType = Record<string, any>;
|
|
6
|
-
export type ProcessFunctionType = (component: JSONType) => JSONType;
|
|
7
|
-
export type ProcessPlatformType = Record<string, ProcessFunctionType>;
|
package/lib/dealDsl/PropType.js
DELETED
package/lib/dealDsl/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { preprocessDSL } from './preprocessDSL';
|
package/lib/dealDsl/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "preprocessDSL", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _preprocessDSL.preprocessDSL;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _preprocessDSL = require("./preprocessDSL");
|