@cloudbase/cals 1.0.50 → 1.0.52-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/parser/cals/index.d.ts.map +1 -1
- package/lib/parser/cals/index.js +8 -6
- package/lib/parser/cals/utils/block/index.js +151 -0
- package/lib/parser/cals/utils/code/index.js +393 -0
- package/lib/parser/cals/utils/common.js +268 -0
- package/lib/parser/cals/utils/getUsedResources.d.ts +10 -0
- package/lib/parser/cals/utils/getUsedResources.d.ts.map +1 -0
- package/lib/parser/cals/utils/getUsedResources.js +128 -0
- package/lib/parser/cals/utils/runtime.js +268 -0
- package/lib/parser/cals/utils/spinoff/index.d.ts.map +1 -1
- package/lib/parser/cals/utils/spinoff/index.js +5 -3
- package/lib/parser/cals/utils/style.js +472 -0
- package/lib/parser/cals/utils/version/common.js +385 -0
- package/lib/parser/cals/utils/version/config.d.ts +16 -0
- package/lib/parser/cals/utils/version/config.d.ts.map +1 -0
- package/lib/parser/cals/utils/version/config.js +244 -0
- package/lib/parser/cals/utils/version/index.js +96 -0
- package/lib/parser/cals/utils/version/parses.js +581 -0
- package/lib/parser/cals/utils/version/utils.d.ts +14 -0
- package/lib/parser/cals/utils/version/utils.d.ts.map +1 -0
- package/lib/parser/cals/utils/version/utils.js +148 -0
- package/lib/parser/dependiencies/index.d.ts +116 -0
- package/lib/parser/dependiencies/index.d.ts.map +1 -0
- package/lib/parser/dependiencies/index.js +674 -0
- package/lib/parser/expression/index.d.ts +123 -0
- package/lib/parser/expression/index.d.ts.map +1 -0
- package/lib/parser/expression/index.js +301 -0
- package/lib/parser/index.d.ts +2 -1
- package/lib/parser/index.d.ts.map +1 -1
- package/lib/parser/index.js +3 -1
- package/lib/parser/plugins/postcss-rpx2clac.d.ts +18 -0
- package/lib/parser/plugins/postcss-rpx2clac.d.ts.map +1 -0
- package/lib/parser/plugins/postcss-rpx2clac.js +68 -0
- package/lib/types/basic/app.d.ts +73 -0
- package/lib/types/basic/app.d.ts.map +1 -0
- package/lib/types/basic/app.js +2 -0
- package/lib/types/basic/common.d.ts +93 -0
- package/lib/types/basic/common.d.ts.map +1 -0
- package/lib/types/basic/common.js +2 -0
- package/lib/types/basic/component.d.ts +211 -0
- package/lib/types/basic/component.d.ts.map +1 -0
- package/lib/types/basic/component.js +2 -0
- package/lib/types/basic/datasource.d.ts +50 -0
- package/lib/types/basic/datasource.d.ts.map +1 -0
- package/lib/types/basic/datasource.js +2 -0
- package/lib/types/index.js +42 -0
- package/lib/types/lcds.js +25 -0
- package/lib/types/platform/app.js +11 -0
- package/lib/types/platform/common.d.ts +181 -0
- package/lib/types/platform/common.d.ts.map +1 -0
- package/lib/types/platform/common.js +87 -0
- package/lib/types/platform/component.d.ts +139 -0
- package/lib/types/platform/component.d.ts.map +1 -0
- package/lib/types/platform/component.js +11 -0
- package/lib/types/platform/datasource.d.ts +467 -0
- package/lib/types/platform/datasource.d.ts.map +1 -0
- package/lib/types/platform/datasource.js +2 -0
- package/lib/types/platform/eventFlow.d.ts +20 -0
- package/lib/types/platform/eventFlow.d.ts.map +1 -0
- package/lib/types/platform/eventFlow.js +2 -0
- package/lib/types/platform/query.d.ts +67 -0
- package/lib/types/platform/query.d.ts.map +1 -0
- package/lib/types/platform/query.js +2 -0
- package/lib/types/platform/theme.js +2 -0
- package/lib/types/platform/widget/form.d.ts +5 -0
- package/lib/types/platform/widget/form.d.ts.map +1 -0
- package/lib/types/platform/widget/form.js +5 -0
- package/lib/types/platform/widget/meta.d.ts +60 -0
- package/lib/types/platform/widget/meta.d.ts.map +1 -0
- package/lib/types/platform/widget/meta.js +6 -0
- package/lib/utils/CSSProperty.d.ts +64 -0
- package/lib/utils/CSSProperty.d.ts.map +1 -0
- package/lib/utils/CSSProperty.js +89 -0
- package/lib/utils/build.d.ts +2 -0
- package/lib/utils/build.d.ts.map +1 -0
- package/lib/utils/build.js +75 -0
- package/lib/utils/constant.d.ts +19 -0
- package/lib/utils/constant.d.ts.map +1 -1
- package/lib/utils/constant.js +24 -1
- package/lib/utils/dts/auto-generated.d.ts +2 -0
- package/lib/utils/dts/auto-generated.d.ts.map +1 -0
- package/lib/utils/dts/auto-generated.js +1796 -0
- package/lib/utils/dts/build.d.ts +2 -0
- package/lib/utils/dts/build.d.ts.map +1 -0
- package/lib/utils/dts/build.js +136 -0
- package/lib/utils/dts/index.js +1008 -0
- package/lib/utils/index.js +27 -0
- package/lib/utils/version/common.d.ts +3 -0
- package/lib/utils/version/common.d.ts.map +1 -0
- package/lib/utils/version/common.js +27 -0
- package/lib/utils/version/featureChecker.js +35 -0
- package/lib/utils/version/migrations/version4.js +199 -0
- package/package.json +4 -4
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.renameRepeatId = exports.addFormItem = exports.afterCommonParse = exports.beforeCommonParse = void 0;
|
|
7
|
+
const utils_1 = require("./utils");
|
|
8
|
+
const get_1 = __importDefault(require("lodash/get"));
|
|
9
|
+
const set_1 = __importDefault(require("lodash/set"));
|
|
10
|
+
const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
|
|
11
|
+
const merge_1 = __importDefault(require("lodash/merge"));
|
|
12
|
+
const index_1 = require("./index");
|
|
13
|
+
const common_1 = require("../common");
|
|
14
|
+
const utils_2 = require("../../../../utils");
|
|
15
|
+
function beforeCommonParse(comp) {
|
|
16
|
+
addDefaultXIndex(comp);
|
|
17
|
+
}
|
|
18
|
+
exports.beforeCommonParse = beforeCommonParse;
|
|
19
|
+
function afterCommonParse(comp) {
|
|
20
|
+
translateClassList(comp);
|
|
21
|
+
translateStyleBinding(comp);
|
|
22
|
+
translateComponentModuleName(comp);
|
|
23
|
+
translateListeners(comp);
|
|
24
|
+
translateStyleToCommonStyle(comp);
|
|
25
|
+
translateSlot(comp);
|
|
26
|
+
}
|
|
27
|
+
exports.afterCommonParse = afterCommonParse;
|
|
28
|
+
// 复合组件 slot 属性配置迁移,从 xProps.data.content.value 里取
|
|
29
|
+
function translateSlot(comp) {
|
|
30
|
+
if (comp['xComponent'].name === 'Slot' && comp['xProps'].data.content) {
|
|
31
|
+
comp['xProps'].data.name = {
|
|
32
|
+
value: comp['xProps'].data.content.value,
|
|
33
|
+
};
|
|
34
|
+
delete comp['xProps'].data.content;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function translateListeners(comp) {
|
|
38
|
+
const { xProps } = comp;
|
|
39
|
+
// 处理click 转 tap
|
|
40
|
+
if (xProps === null || xProps === void 0 ? void 0 : xProps.listeners) {
|
|
41
|
+
const { listeners = [] } = xProps;
|
|
42
|
+
listeners.forEach((listenerItem) => {
|
|
43
|
+
const { handler } = listenerItem;
|
|
44
|
+
if (listenerItem.trigger === 'click' || listenerItem.trigger === '__weapps_action_trigger_click') {
|
|
45
|
+
listenerItem.trigger = 'tap';
|
|
46
|
+
}
|
|
47
|
+
if (handler.moduleName === 'gsd-kbone') {
|
|
48
|
+
handler.moduleName = utils_2.OFFICIAL_LIB_KEY;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function translateComponentModuleName(comp) {
|
|
54
|
+
const { xComponent } = comp;
|
|
55
|
+
if (xComponent) {
|
|
56
|
+
const { name } = xComponent;
|
|
57
|
+
const complexName = (0, utils_1.isComplexComponent)(name);
|
|
58
|
+
const gsdH5ReactName = (0, utils_1.isGsdH5ReactComponent)(name);
|
|
59
|
+
if (complexName) {
|
|
60
|
+
xComponent.moduleName = utils_2.OFFICIAL_COMPONENT_LIB_NAME;
|
|
61
|
+
xComponent.name = complexName;
|
|
62
|
+
}
|
|
63
|
+
else if (gsdH5ReactName) {
|
|
64
|
+
xComponent.moduleName = utils_2.OFFICIAL_LIB_KEY;
|
|
65
|
+
xComponent.name = gsdH5ReactName;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
xComponent.moduleName = utils_2.OFFICIAL_COMPONENT_LIB_NAME;
|
|
69
|
+
}
|
|
70
|
+
switch (name) {
|
|
71
|
+
case 'Wx-map':
|
|
72
|
+
xComponent.name = 'Map';
|
|
73
|
+
break;
|
|
74
|
+
case 'Telephone':
|
|
75
|
+
xComponent.name = 'telephone';
|
|
76
|
+
default:
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
if (xComponent.moduleName === utils_2.OFFICIAL_COMPONENT_LIB_NAME) {
|
|
80
|
+
switch (xComponent.name) {
|
|
81
|
+
case 'Cell': {
|
|
82
|
+
xComponent.name = 'Item';
|
|
83
|
+
let xprops = comp.xProps;
|
|
84
|
+
if (xprops === null || xprops === void 0 ? void 0 : xprops.data) {
|
|
85
|
+
xprops.data.value = {
|
|
86
|
+
value: '',
|
|
87
|
+
};
|
|
88
|
+
xprops.data.detail = {
|
|
89
|
+
value: false,
|
|
90
|
+
};
|
|
91
|
+
xprops.data.description = {
|
|
92
|
+
value: '',
|
|
93
|
+
};
|
|
94
|
+
if (xprops.data.label) {
|
|
95
|
+
xprops.data.title = xprops.data.label;
|
|
96
|
+
delete xprops.data.label;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
case 'NavBar': {
|
|
102
|
+
let xprops = comp.xProps;
|
|
103
|
+
if (xprops === null || xprops === void 0 ? void 0 : xprops.data) {
|
|
104
|
+
if (xprops.data.text) {
|
|
105
|
+
xprops.data.title = xprops.data.text;
|
|
106
|
+
delete xprops.data.text;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
case 'TabBar':
|
|
112
|
+
case 'Tabbar': {
|
|
113
|
+
xComponent.name = 'TabBar';
|
|
114
|
+
let xprops = comp.xProps;
|
|
115
|
+
if (xprops === null || xprops === void 0 ? void 0 : xprops.data) {
|
|
116
|
+
if (xprops.data.itemList) {
|
|
117
|
+
let dynamicValue = xprops.data.itemList;
|
|
118
|
+
if (dynamicValue.type === 'static' || !dynamicValue.type) {
|
|
119
|
+
xprops.data.tabs = {
|
|
120
|
+
value: (dynamicValue.value || []).map((item) => {
|
|
121
|
+
return Object.assign({ name: item.value }, item);
|
|
122
|
+
}),
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
xprops.data.tabs = xprops.data.itemList;
|
|
127
|
+
}
|
|
128
|
+
delete xprops.data.itemList;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function translateClassList(comp) {
|
|
138
|
+
const { xProps } = comp;
|
|
139
|
+
if (!xProps) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (xProps['classNameList']) {
|
|
143
|
+
// @ts-ignore
|
|
144
|
+
xProps['classList'] = xProps['classList'] || xProps.classNameList;
|
|
145
|
+
// @ts-ignore
|
|
146
|
+
delete xProps.classNameList;
|
|
147
|
+
}
|
|
148
|
+
if (xProps['classNameListBind']) {
|
|
149
|
+
// @ts-ignore
|
|
150
|
+
xProps['classListBind'] = xProps['classListBind'] || xProps.classNameListBind;
|
|
151
|
+
// @ts-ignore
|
|
152
|
+
xProps.classListBind.value = xProps.classListBind.bindDataPath;
|
|
153
|
+
// @ts-ignore
|
|
154
|
+
delete xProps['classListBind'].propertyPath;
|
|
155
|
+
// @ts-ignore
|
|
156
|
+
delete xProps['classListBind'].bindDataPath;
|
|
157
|
+
// @ts-ignore
|
|
158
|
+
delete xProps.classNameListBind;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
function translateStyleBinding(comp) {
|
|
162
|
+
const { xProps } = comp;
|
|
163
|
+
if (!xProps) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
if (xProps['styleBind']) {
|
|
167
|
+
// @ts-ignore
|
|
168
|
+
if (xProps['styleBind'].bindDataPath) {
|
|
169
|
+
xProps['styleBind'] = {
|
|
170
|
+
type: xProps['styleBind'].type,
|
|
171
|
+
// @ts-ignore
|
|
172
|
+
value: xProps['styleBind'].bindDataPath,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
function translateStyleToCommonStyle(comp) {
|
|
178
|
+
const { xProps } = comp;
|
|
179
|
+
if (xProps === null || xProps === void 0 ? void 0 : xProps.style) {
|
|
180
|
+
xProps.commonStyle = xProps.commonStyle || {};
|
|
181
|
+
xProps.commonStyle.self = xProps.commonStyle.self || {};
|
|
182
|
+
xProps.commonStyle.self = (0, merge_1.default)(xProps.style, xProps.commonStyle.self);
|
|
183
|
+
delete xProps.style;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
function addDefaultXIndex(comp) {
|
|
187
|
+
const { properties } = comp;
|
|
188
|
+
if (!properties) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
let xIndex = 1;
|
|
192
|
+
Object.values(properties).map((_comp) => {
|
|
193
|
+
let comp = _comp;
|
|
194
|
+
if (comp.xIndex === undefined) {
|
|
195
|
+
comp.xIndex = xIndex;
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
xIndex = comp.xIndex + 1;
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
function addFormItem(comp, key, parent, isOnlySlot = false) {
|
|
203
|
+
const { properties, xIndex, xProps } = comp;
|
|
204
|
+
const defaultValue = (0, get_1.default)(xProps, 'data.defaultValue');
|
|
205
|
+
if (defaultValue) {
|
|
206
|
+
(0, set_1.default)(xProps, 'data.value', defaultValue);
|
|
207
|
+
delete xProps.data.defaultValue;
|
|
208
|
+
}
|
|
209
|
+
const rulesValue = (0, get_1.default)(xProps, 'data.rules') || {
|
|
210
|
+
value: [],
|
|
211
|
+
};
|
|
212
|
+
if (!rulesValue.type || rulesValue.type === 'static') {
|
|
213
|
+
rulesValue.value = (rulesValue.value || []).filter((meta) => {
|
|
214
|
+
return meta && !(0, common_1.isEmptyObj)(meta);
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
if ((0, utils_1.isPlainObject)(rulesValue.value)) {
|
|
218
|
+
if ((0, utils_1.isEmptyObject)(rulesValue.value)) {
|
|
219
|
+
rulesValue.value = [];
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
rulesValue.value = [rulesValue.value];
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
const layoutValue = (0, get_1.default)(xProps, 'data.layout') || {
|
|
226
|
+
value: 'vertical',
|
|
227
|
+
};
|
|
228
|
+
const requireValue = (0, get_1.default)(xProps, 'data.required') || {
|
|
229
|
+
value: false,
|
|
230
|
+
};
|
|
231
|
+
const requiredTextValue = {
|
|
232
|
+
value: (requireValue === null || requireValue === void 0 ? void 0 : requireValue.value) ? '该项为必填项' : false,
|
|
233
|
+
};
|
|
234
|
+
const nameValue = (0, get_1.default)(xProps, 'data.name') || {
|
|
235
|
+
value: 'uniqueFormKey',
|
|
236
|
+
};
|
|
237
|
+
let labelText = (0, get_1.default)(xProps, 'data.label.value') || '';
|
|
238
|
+
let isShowTitleSlot = false;
|
|
239
|
+
if (properties) {
|
|
240
|
+
Object.keys(properties).map((subKey) => {
|
|
241
|
+
if ((0, utils_1.isWeAppId)(subKey)) {
|
|
242
|
+
delete properties[subKey];
|
|
243
|
+
}
|
|
244
|
+
if (subKey === 'label') {
|
|
245
|
+
const targetLabelSlot = properties[subKey];
|
|
246
|
+
(0, utils_1.getComponentChildren)(targetLabelSlot).map(([key, item]) => {
|
|
247
|
+
labelText = (0, get_1.default)(item, 'xProps.data.text.value');
|
|
248
|
+
const cloneItem = (0, cloneDeep_1.default)(item);
|
|
249
|
+
(0, index_1.deepParse)(cloneItem, key, comp);
|
|
250
|
+
isShowTitleSlot = true;
|
|
251
|
+
});
|
|
252
|
+
delete comp.properties.label;
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
const titleSlot = {
|
|
257
|
+
[(0, utils_1.getId)()]: {
|
|
258
|
+
xComponent: {
|
|
259
|
+
moduleName: utils_2.OFFICIAL_LIB_KEY,
|
|
260
|
+
name: 'Text',
|
|
261
|
+
},
|
|
262
|
+
xProps: {
|
|
263
|
+
data: {
|
|
264
|
+
text: {
|
|
265
|
+
value: labelText,
|
|
266
|
+
},
|
|
267
|
+
decode: {
|
|
268
|
+
value: false,
|
|
269
|
+
},
|
|
270
|
+
selectable: {
|
|
271
|
+
value: false,
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
listeners: [],
|
|
275
|
+
},
|
|
276
|
+
xIndex: 0,
|
|
277
|
+
},
|
|
278
|
+
};
|
|
279
|
+
try {
|
|
280
|
+
delete xProps.data.layout;
|
|
281
|
+
delete xProps.data.required;
|
|
282
|
+
delete xProps.data.rules;
|
|
283
|
+
delete xProps.data.requiredText;
|
|
284
|
+
delete xProps.data.label;
|
|
285
|
+
delete xProps.data.name;
|
|
286
|
+
}
|
|
287
|
+
catch (e) { }
|
|
288
|
+
if (parent) {
|
|
289
|
+
if (!parent.xComponent || (parent.xComponent && parent.xComponent.name !== 'FormItem')) {
|
|
290
|
+
// add FormItem
|
|
291
|
+
const newFormItemId = (0, utils_1.getId)();
|
|
292
|
+
// @ts-ignore
|
|
293
|
+
parent.properties[newFormItemId] = {
|
|
294
|
+
xComponent: {
|
|
295
|
+
moduleName: utils_2.OFFICIAL_COMPONENT_LIB_NAME,
|
|
296
|
+
name: 'FormItem',
|
|
297
|
+
},
|
|
298
|
+
// @ts-ignore
|
|
299
|
+
xProps: {
|
|
300
|
+
data: {
|
|
301
|
+
name: nameValue,
|
|
302
|
+
rules: rulesValue,
|
|
303
|
+
layout: layoutValue,
|
|
304
|
+
required: requireValue,
|
|
305
|
+
requiredMsg: requiredTextValue,
|
|
306
|
+
requiredFlag: true,
|
|
307
|
+
labelVisible: { value: true },
|
|
308
|
+
validateStatus: {
|
|
309
|
+
value: 'success',
|
|
310
|
+
},
|
|
311
|
+
validateTrigger: {
|
|
312
|
+
value: 'onChange',
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
xIndex,
|
|
317
|
+
properties: {
|
|
318
|
+
labelSlot: {
|
|
319
|
+
properties: Object.assign({}, titleSlot),
|
|
320
|
+
},
|
|
321
|
+
contentSlot: {
|
|
322
|
+
properties: {
|
|
323
|
+
[key]: comp,
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
},
|
|
327
|
+
};
|
|
328
|
+
try {
|
|
329
|
+
// 删除原来组件
|
|
330
|
+
delete parent.properties[key];
|
|
331
|
+
}
|
|
332
|
+
catch (e) {
|
|
333
|
+
console.error('删除组件多余属性失败 parseGsdKboneInput', e, comp);
|
|
334
|
+
}
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
delete xProps.data.rules;
|
|
339
|
+
delete xProps.data.defaultValue;
|
|
340
|
+
delete xProps.data.layout;
|
|
341
|
+
delete xProps.data.require;
|
|
342
|
+
}
|
|
343
|
+
exports.addFormItem = addFormItem;
|
|
344
|
+
function renameRepeatId(json) {
|
|
345
|
+
const { pageInstanceList = [] } = json;
|
|
346
|
+
pageInstanceList.forEach((instance, index) => {
|
|
347
|
+
const { componentInstances } = instance;
|
|
348
|
+
const _compIds = {};
|
|
349
|
+
const comps = [];
|
|
350
|
+
for (const i in componentInstances) {
|
|
351
|
+
const comp = componentInstances[i];
|
|
352
|
+
if (_compIds[i] && i.startsWith('id')) {
|
|
353
|
+
const newId = (0, utils_1.getId)();
|
|
354
|
+
componentInstances[newId] = comp;
|
|
355
|
+
delete componentInstances[i];
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
_compIds[i] = i;
|
|
359
|
+
}
|
|
360
|
+
comps.push(comp);
|
|
361
|
+
}
|
|
362
|
+
while (true) {
|
|
363
|
+
const topComp = comps.pop();
|
|
364
|
+
if (!topComp) {
|
|
365
|
+
break;
|
|
366
|
+
}
|
|
367
|
+
const keys = Object.keys(topComp['properties'] || {});
|
|
368
|
+
if (keys.length > 0) {
|
|
369
|
+
keys.forEach((key) => {
|
|
370
|
+
const _comp = topComp['properties'][key];
|
|
371
|
+
if (_compIds[key] && key.startsWith('id')) {
|
|
372
|
+
const newId = (0, utils_1.getId)();
|
|
373
|
+
topComp['properties'][newId] = _comp;
|
|
374
|
+
delete topComp['properties'][key];
|
|
375
|
+
}
|
|
376
|
+
else {
|
|
377
|
+
_compIds[key] = key;
|
|
378
|
+
}
|
|
379
|
+
comps.push(_comp);
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
exports.renameRepeatId = renameRepeatId;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
备注:登录 WeApps v2,在任一页面控制台输入以下代码(需要修改相应的分类名称),以获取指定分类的 COMPLEX_COMPONENT_KEYS
|
|
3
|
+
|
|
4
|
+
fetch(`http://dev.weapps.woa.com/api/compositeComp/list?pageIndex=0&category=${encodeURI('审批系统')}&keyword=&pageSize=500`).then(function(response) {
|
|
5
|
+
return response.json();
|
|
6
|
+
}).then(function(json) {
|
|
7
|
+
console.log(JSON.stringify(json.data.rows.map(item => item.name), null, 2))
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
*/
|
|
11
|
+
export declare const COMPLEX_COMPONENT_KEYS: string[];
|
|
12
|
+
export declare const FORM_COMPONENT_KEYS: string[];
|
|
13
|
+
export declare const GSD_H5_REACT_COMPONENT_KEYS: string[];
|
|
14
|
+
export declare const COMPONENT_SELECTABLEBLOCK_WHITELIST: string[];
|
|
15
|
+
export declare const MODULE_SELECTABLEBLOCK_REGEX: RegExp;
|
|
16
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../src/parser/cals/utils/version/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAyKH,eAAO,MAAM,sBAAsB,UAMlC,CAAC;AAEF,eAAO,MAAM,mBAAmB,UAgB/B,CAAC;AAEF,eAAO,MAAM,2BAA2B,UAgDvC,CAAC;AAGF,eAAO,MAAM,mCAAmC,UAA8D,CAAC;AAG/G,eAAO,MAAM,4BAA4B,QAA6B,CAAC"}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
备注:登录 WeApps v2,在任一页面控制台输入以下代码(需要修改相应的分类名称),以获取指定分类的 COMPLEX_COMPONENT_KEYS
|
|
4
|
+
|
|
5
|
+
fetch(`http://dev.weapps.woa.com/api/compositeComp/list?pageIndex=0&category=${encodeURI('审批系统')}&keyword=&pageSize=500`).then(function(response) {
|
|
6
|
+
return response.json();
|
|
7
|
+
}).then(function(json) {
|
|
8
|
+
console.log(JSON.stringify(json.data.rows.map(item => item.name), null, 2))
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.MODULE_SELECTABLEBLOCK_REGEX = exports.COMPONENT_SELECTABLEBLOCK_WHITELIST = exports.GSD_H5_REACT_COMPONENT_KEYS = exports.FORM_COMPONENT_KEYS = exports.COMPLEX_COMPONENT_KEYS = void 0;
|
|
14
|
+
// 政务组件
|
|
15
|
+
const ZW_COMPLEX_COMPONENT_KEYS = [
|
|
16
|
+
'Input',
|
|
17
|
+
'FormItem',
|
|
18
|
+
'Icon',
|
|
19
|
+
'FormCell',
|
|
20
|
+
'Button',
|
|
21
|
+
'Tabs',
|
|
22
|
+
'TabPane',
|
|
23
|
+
'Selector',
|
|
24
|
+
'Divider',
|
|
25
|
+
'Textarea',
|
|
26
|
+
'Checkbox',
|
|
27
|
+
'Radio',
|
|
28
|
+
'Switch',
|
|
29
|
+
'Badge',
|
|
30
|
+
'Number',
|
|
31
|
+
'Form',
|
|
32
|
+
'Agree',
|
|
33
|
+
'ButtonGroup',
|
|
34
|
+
'CheckboxGroup',
|
|
35
|
+
'MultiSelector',
|
|
36
|
+
'Uploader',
|
|
37
|
+
'Preview',
|
|
38
|
+
'Date',
|
|
39
|
+
'Time',
|
|
40
|
+
'Region',
|
|
41
|
+
'Tips',
|
|
42
|
+
'Slider',
|
|
43
|
+
'CheckboxLabel',
|
|
44
|
+
'VerficationCode',
|
|
45
|
+
'IndexList',
|
|
46
|
+
'Poplayer',
|
|
47
|
+
'TestProps',
|
|
48
|
+
'Tabbar',
|
|
49
|
+
'Cascader',
|
|
50
|
+
'RadioGroup',
|
|
51
|
+
'RadioLabel',
|
|
52
|
+
'Footer',
|
|
53
|
+
'PhoneCode',
|
|
54
|
+
'PictureCode',
|
|
55
|
+
'Card',
|
|
56
|
+
'QRCode',
|
|
57
|
+
'Search',
|
|
58
|
+
'10086',
|
|
59
|
+
'Cell',
|
|
60
|
+
'Timeline',
|
|
61
|
+
'TimeRange',
|
|
62
|
+
'CircleContent',
|
|
63
|
+
'UploadBase',
|
|
64
|
+
];
|
|
65
|
+
// 城市助手
|
|
66
|
+
const CSZS_COMPLEX_COMPONENT_KEYS = [
|
|
67
|
+
'wf-index-navigator',
|
|
68
|
+
'wf-index-weather',
|
|
69
|
+
'wf-service-list',
|
|
70
|
+
'wy-apply-receive',
|
|
71
|
+
'wf-msg',
|
|
72
|
+
'wf-lazy-image',
|
|
73
|
+
'wf-square-bone',
|
|
74
|
+
];
|
|
75
|
+
// 指尖指挥
|
|
76
|
+
const ZJZH_COMPLEX_COMPONENT_KEYS = [
|
|
77
|
+
'eventUpload',
|
|
78
|
+
'projectCard',
|
|
79
|
+
'projectDetail',
|
|
80
|
+
'eventStep',
|
|
81
|
+
'dutyTaskCard',
|
|
82
|
+
'modalInput',
|
|
83
|
+
'DepartmentDoneStatus',
|
|
84
|
+
'projectBreadcrumb',
|
|
85
|
+
'projectEmpty',
|
|
86
|
+
'telphone',
|
|
87
|
+
'eventDetail',
|
|
88
|
+
'wideDivider',
|
|
89
|
+
'testminipro',
|
|
90
|
+
'eventUploadViewer',
|
|
91
|
+
'processLine',
|
|
92
|
+
'eventUploadVideoPlayer',
|
|
93
|
+
'error',
|
|
94
|
+
'delayTaskDoneStatus',
|
|
95
|
+
];
|
|
96
|
+
// 审批系统
|
|
97
|
+
const SPXT_COMPLEX_COMPONENT_KEYS = [
|
|
98
|
+
'apxt-popup-radio',
|
|
99
|
+
'spxt-submit-button',
|
|
100
|
+
'spxt-detail-form-info',
|
|
101
|
+
'spxt-handle-schedul',
|
|
102
|
+
'statistics-count',
|
|
103
|
+
'spxt-popup-select',
|
|
104
|
+
'spxt-submit-materials-info',
|
|
105
|
+
'spxt-detail-application-info',
|
|
106
|
+
'spxt-detail-result-receive',
|
|
107
|
+
'spxt-verification-processing',
|
|
108
|
+
'spxt-detail-material-info',
|
|
109
|
+
'spxt-ems-adrress',
|
|
110
|
+
'material-one',
|
|
111
|
+
'spxt-schedule',
|
|
112
|
+
'spxt-detail-meterial-submit',
|
|
113
|
+
'spxt-nomore-data',
|
|
114
|
+
'spxt-detail-base-info',
|
|
115
|
+
'spxt-large-title',
|
|
116
|
+
'matter-item',
|
|
117
|
+
'spxt-apply-item',
|
|
118
|
+
'material-switch-group-one',
|
|
119
|
+
'material-switch-one',
|
|
120
|
+
'material-group-one',
|
|
121
|
+
'drop-content-switch',
|
|
122
|
+
'material-drop-content',
|
|
123
|
+
'spxt-detail-material-group-info',
|
|
124
|
+
'spxt-module-title',
|
|
125
|
+
'spxt-tabs-scroll',
|
|
126
|
+
'material-upload-group',
|
|
127
|
+
'material-upload',
|
|
128
|
+
'material-upload-one',
|
|
129
|
+
'spxt-tag-status',
|
|
130
|
+
];
|
|
131
|
+
// 一网通办
|
|
132
|
+
const YWTB_COMPLEX_COMPONENT_KEYS = [
|
|
133
|
+
'ywtb-select-item',
|
|
134
|
+
'handling-situation',
|
|
135
|
+
'test-qiao',
|
|
136
|
+
'success-tag',
|
|
137
|
+
'table-list',
|
|
138
|
+
'ywtb-search-content',
|
|
139
|
+
'popup-animate',
|
|
140
|
+
'ywtb-title-cell',
|
|
141
|
+
'ywtb-tab-bar',
|
|
142
|
+
'ywtb-legal-person-info',
|
|
143
|
+
'ywtb-agree',
|
|
144
|
+
'ywtb-receive-result',
|
|
145
|
+
'ywtb-person-info',
|
|
146
|
+
'ywtb-create-address',
|
|
147
|
+
'ywtb-search-result',
|
|
148
|
+
'nav-to',
|
|
149
|
+
'ywtb-popup-select',
|
|
150
|
+
'ywtb-material-submission',
|
|
151
|
+
'ywtb-search-container',
|
|
152
|
+
'region-modal',
|
|
153
|
+
'ywtb-footer-button',
|
|
154
|
+
'home-filter',
|
|
155
|
+
'ywtb_reservation_list',
|
|
156
|
+
'ywtb-select-list',
|
|
157
|
+
'ywtb-search-history',
|
|
158
|
+
'drop-content',
|
|
159
|
+
'ywtb-step-item',
|
|
160
|
+
'ywtb-steps',
|
|
161
|
+
'ywtb-commitment',
|
|
162
|
+
'ywtb_card',
|
|
163
|
+
'ywtb-cell',
|
|
164
|
+
'ywtb-line-content',
|
|
165
|
+
'ywtb-business-item',
|
|
166
|
+
'ywtb-confirm',
|
|
167
|
+
];
|
|
168
|
+
const CSM_COMPLEX_COMPONENT_KEYS = [
|
|
169
|
+
'city-code-scan-container',
|
|
170
|
+
'citycode-add-relative',
|
|
171
|
+
'city-code-scan-callback',
|
|
172
|
+
'chongqing-code-bottom-label',
|
|
173
|
+
];
|
|
174
|
+
exports.COMPLEX_COMPONENT_KEYS = ZW_COMPLEX_COMPONENT_KEYS.concat(CSZS_COMPLEX_COMPONENT_KEYS, ZJZH_COMPLEX_COMPONENT_KEYS, SPXT_COMPLEX_COMPONENT_KEYS, YWTB_COMPLEX_COMPONENT_KEYS, CSM_COMPLEX_COMPONENT_KEYS);
|
|
175
|
+
exports.FORM_COMPONENT_KEYS = [
|
|
176
|
+
'Input',
|
|
177
|
+
'Textarea',
|
|
178
|
+
'Number',
|
|
179
|
+
'Selector',
|
|
180
|
+
'MultiSelector',
|
|
181
|
+
'Time',
|
|
182
|
+
'Date',
|
|
183
|
+
'Region',
|
|
184
|
+
'CheckboxGroup',
|
|
185
|
+
'Checkbox',
|
|
186
|
+
'RadioGroup',
|
|
187
|
+
'Radio',
|
|
188
|
+
'Switch',
|
|
189
|
+
'Slider',
|
|
190
|
+
'Uploader',
|
|
191
|
+
];
|
|
192
|
+
exports.GSD_H5_REACT_COMPONENT_KEYS = [
|
|
193
|
+
'Audio',
|
|
194
|
+
'Button',
|
|
195
|
+
'Camera',
|
|
196
|
+
'Canvas',
|
|
197
|
+
'Checkbox',
|
|
198
|
+
'CheckboxeGroup',
|
|
199
|
+
'Container',
|
|
200
|
+
'DatePicker',
|
|
201
|
+
'Form',
|
|
202
|
+
'Icon',
|
|
203
|
+
'Iframe-web-view',
|
|
204
|
+
'Image',
|
|
205
|
+
'Input',
|
|
206
|
+
'Label',
|
|
207
|
+
'LivePlayer',
|
|
208
|
+
'LivePusher',
|
|
209
|
+
'Map',
|
|
210
|
+
'MultiSelector',
|
|
211
|
+
'Navigator',
|
|
212
|
+
'PickerView',
|
|
213
|
+
'PickerViewColumn',
|
|
214
|
+
'Progress',
|
|
215
|
+
'Radio',
|
|
216
|
+
'RadioGroup',
|
|
217
|
+
'RegionPicker',
|
|
218
|
+
'RichText',
|
|
219
|
+
'ScrollView',
|
|
220
|
+
'Selector',
|
|
221
|
+
'Slider',
|
|
222
|
+
'Slot',
|
|
223
|
+
'Swiper',
|
|
224
|
+
'SwiperItem',
|
|
225
|
+
'Switch',
|
|
226
|
+
'Text',
|
|
227
|
+
'TextArea',
|
|
228
|
+
'TimePicker',
|
|
229
|
+
'Uploader',
|
|
230
|
+
'Video',
|
|
231
|
+
'Wx-ad',
|
|
232
|
+
'Wx-cover-image',
|
|
233
|
+
'Wx-cover-view',
|
|
234
|
+
'Wx-movable-area',
|
|
235
|
+
'Wx-movable-view',
|
|
236
|
+
'Wx-navigation-bar',
|
|
237
|
+
'Wx-official-accout',
|
|
238
|
+
'Wx-open-data',
|
|
239
|
+
'Wx-page-mate',
|
|
240
|
+
];
|
|
241
|
+
// 支持选区的组件白名单
|
|
242
|
+
exports.COMPONENT_SELECTABLEBLOCK_WHITELIST = ['modeltable', 'modelcreate', 'modelupdate', 'modeldetail'];
|
|
243
|
+
// 支持选区的组件库命名正则表达式
|
|
244
|
+
exports.MODULE_SELECTABLEBLOCK_REGEX = /^cloudbase_bussiness.*$/i;
|