@cloudbase/cals 1.0.3-alpha.10 → 1.0.3-alpha.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/lib/parser/cals/index.d.ts +417 -366
- package/lib/parser/cals/index.d.ts.map +1 -1
- package/lib/parser/cals/index.js +90 -25
- package/lib/parser/cals/utils/block/index.d.ts +14 -14
- package/lib/parser/cals/utils/block/index.d.ts.map +1 -1
- package/lib/parser/cals/utils/block/index.js +3 -7
- package/lib/parser/cals/utils/code/index.d.ts +30 -30
- package/lib/parser/cals/utils/code/index.d.ts.map +1 -1
- package/lib/parser/cals/utils/code/index.js +12 -18
- package/lib/parser/cals/utils/common.d.ts +11 -11
- package/lib/parser/cals/utils/common.d.ts.map +0 -0
- package/lib/parser/cals/utils/common.js +0 -0
- package/lib/parser/cals/utils/runtime.d.ts +13 -13
- package/lib/parser/cals/utils/runtime.d.ts.map +1 -1
- package/lib/parser/cals/utils/runtime.js +2 -5
- package/lib/parser/cals/utils/spinoff/index.d.ts +9 -9
- package/lib/parser/cals/utils/spinoff/index.d.ts.map +0 -0
- package/lib/parser/cals/utils/spinoff/index.js +0 -0
- package/lib/parser/cals/utils/style.d.ts +42 -42
- package/lib/parser/cals/utils/style.d.ts.map +1 -1
- package/lib/parser/cals/utils/style.js +3 -7
- package/lib/parser/cals/utils/template.d.ts +5 -5
- package/lib/parser/cals/utils/template.d.ts.map +0 -0
- package/lib/parser/cals/utils/template.js +0 -0
- package/lib/parser/cals/utils/version/common.d.ts +4 -4
- package/lib/parser/cals/utils/version/common.d.ts.map +1 -1
- package/lib/parser/cals/utils/version/common.js +33 -16
- package/lib/parser/cals/utils/version/config.d.ts +13 -13
- package/lib/parser/cals/utils/version/config.d.ts.map +0 -0
- package/lib/parser/cals/utils/version/config.js +0 -0
- package/lib/parser/cals/utils/version/index.d.ts +2 -2
- package/lib/parser/cals/utils/version/index.d.ts.map +0 -0
- package/lib/parser/cals/utils/version/index.js +0 -0
- package/lib/parser/cals/utils/version/parses.d.ts +15 -15
- package/lib/parser/cals/utils/version/parses.d.ts.map +1 -1
- package/lib/parser/cals/utils/version/parses.js +36 -18
- package/lib/parser/cals/utils/version/utils.d.ts +13 -13
- package/lib/parser/cals/utils/version/utils.d.ts.map +1 -1
- package/lib/parser/cals/utils/version/utils.js +2 -5
- package/lib/parser/constants.d.ts +2 -0
- package/lib/parser/constants.d.ts.map +1 -0
- package/lib/parser/constants.js +4 -0
- package/lib/parser/expression/index.d.ts +122 -122
- package/lib/parser/expression/index.d.ts.map +0 -0
- package/lib/parser/expression/index.js +0 -0
- package/lib/parser/index.d.ts +8 -8
- package/lib/parser/index.d.ts.map +0 -0
- package/lib/parser/index.js +0 -0
- package/lib/parser/plugins/postcss-rpx2clac.d.ts +17 -17
- package/lib/parser/plugins/postcss-rpx2clac.js +2 -2
- package/lib/types/basic/app.d.ts +72 -72
- package/lib/types/basic/app.d.ts.map +0 -0
- package/lib/types/basic/app.js +0 -0
- package/lib/types/basic/common.d.ts +88 -88
- package/lib/types/basic/common.d.ts.map +1 -1
- package/lib/types/basic/common.js +0 -0
- package/lib/types/basic/component.d.ts +213 -208
- package/lib/types/basic/component.d.ts.map +1 -1
- package/lib/types/basic/component.js +0 -0
- package/lib/types/basic/datasource.d.ts +49 -49
- package/lib/types/basic/datasource.d.ts.map +0 -0
- package/lib/types/basic/datasource.js +0 -0
- package/lib/types/index.d.ts +10 -9
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js +1 -14
- package/lib/types/lcds.d.ts +334 -447
- package/lib/types/lcds.d.ts.map +1 -1
- package/lib/types/lcds.js +0 -0
- package/lib/types/platform/app.d.ts +176 -176
- package/lib/types/platform/app.d.ts.map +0 -0
- package/lib/types/platform/app.js +0 -0
- package/lib/types/platform/common.d.ts +147 -137
- package/lib/types/platform/common.d.ts.map +1 -1
- package/lib/types/platform/common.js +0 -0
- package/lib/types/platform/component.d.ts +145 -140
- package/lib/types/platform/component.d.ts.map +1 -1
- package/lib/types/platform/component.js +0 -0
- package/lib/types/platform/datasource.d.ts +466 -466
- package/lib/types/platform/datasource.d.ts.map +0 -0
- package/lib/types/platform/datasource.js +0 -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 +58 -0
- package/lib/types/platform/query.d.ts.map +1 -0
- package/lib/types/platform/query.js +2 -0
- package/lib/types/platform/widget/form.d.ts +89 -89
- package/lib/types/platform/widget/form.d.ts.map +0 -0
- package/lib/types/platform/widget/form.js +0 -0
- package/lib/types/platform/widget/meta.d.ts +59 -59
- package/lib/types/platform/widget/meta.d.ts.map +0 -0
- package/lib/types/platform/widget/meta.js +0 -0
- package/lib/utils/CSSProperty.d.ts +63 -63
- package/lib/utils/CSSProperty.d.ts.map +0 -0
- package/lib/utils/CSSProperty.js +0 -0
- package/lib/utils/build.d.ts +1 -1
- package/lib/utils/build.d.ts.map +0 -0
- package/lib/utils/build.js +3 -3
- package/lib/utils/constant.d.ts +40 -40
- package/lib/utils/constant.d.ts.map +0 -0
- package/lib/utils/constant.js +0 -0
- package/lib/utils/dts/auto-generated.d.ts +1 -1
- package/lib/utils/dts/auto-generated.d.ts.map +1 -1
- package/lib/utils/dts/auto-generated.js +35 -1227
- package/lib/utils/dts/build.d.ts +1 -1
- package/lib/utils/dts/build.js +4 -1
- package/lib/utils/dts/index.d.ts +93 -130
- package/lib/utils/dts/index.d.ts.map +1 -1
- package/lib/utils/dts/index.js +66 -361
- package/lib/utils/index.d.ts +7 -7
- package/lib/utils/index.d.ts.map +0 -0
- package/lib/utils/index.js +0 -0
- package/lib/utils/version/common.d.ts +2 -2
- package/lib/utils/version/featureChecker.d.ts +2 -2
- package/lib/utils/version/featureChecker.d.ts.map +1 -1
- package/lib/utils/version/migrations/version4.d.ts +2 -2
- package/lib/utils/version/migrations/version4.js +2 -2
- package/lib/utils/version-migrations/common.d.ts +5 -0
- package/lib/utils/version-migrations/common.d.ts.map +1 -0
- package/lib/utils/version-migrations/common.js +29 -0
- package/lib/utils/version-migrations/version4.d.ts +3 -0
- package/lib/utils/version-migrations/version4.d.ts.map +1 -0
- package/lib/utils/version-migrations/version4.js +199 -0
- package/package.json +1 -11
- package/lib/cloudbase.cals.umd.min.js +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/parser/cals/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/parser/cals/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuC,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAErG,OAAO,EACL,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,cAAc,EAGd,mBAAmB,EACnB,cAAc,EAAE,cAAc;AAC9B,mBAAmB,EACnB,aAAa,EACb,IAAI,EACL,MAAM,aAAa,CAAC;AAErB,OAAO,EAAkC,aAAa,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAgB5F,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,UAAU,mBAAmB;IAC3B,GAAG,CAAC,EAAE,YAAY,CAAC;IACnB,YAAY,CAAC,EAAE,GAAG,EAAE,CAAC;IACrB,eAAe,CAAC,EAAE,GAAG,CAAC;IACtB,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB;AAED,UAAU,iBAAiB;IACzB,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,IAAI,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACtB,SAAS,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,C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GAEG;AACH,wBAAgB,YAAY,CAC1B,OAAO,SAAK,EACZ,YAAY,QAAK,GAChB;IACD,qBAAqB,EAAE,OAAO,CAAC;IAC/B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,cAAc,EAAE,OAAO,CAAC;CACzB,CA0BA;AAED,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,iBAAiB,EAAE,EAC9B,OAAO,CAAC,EAAE;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,GAC5B;IACD,SAAS,EAAE,iBAAiB,EAAE,CAAC;IAC/B,UAAU,EAAE,UAAU,EAAE,CAAC;CAC1B,CA+DA"}
|
package/lib/parser/cals/index.js
CHANGED
|
@@ -10,17 +10,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
}
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.parseVersion = exports.processRuntimeCodeResources = exports.deserializeComponentLibraryMeta = exports.deserializeRuntimeComponent = exports.serializeRuntimeComponent = exports.serializeRuntimePage = exports.deserializePlatformApp = exports.serializePlatformApp = exports.deserializePage = exports.serializePage = exports.deserializeComponent = exports.serializeComponent = exports.deserializeDataVariables = exports.deserializeAttributes = exports.serializeAttributes = exports.deserializeDynamicMap = exports.serializeDynamicMap = exports.deserializeValue = exports.serializeValue = exports.generateDefaultCode = exports.getUsedComps = void 0;
|
|
18
|
-
const
|
|
19
|
-
const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
|
|
20
|
-
const unset_1 = __importDefault(require("lodash/unset"));
|
|
21
|
-
const set_1 = __importDefault(require("lodash/set"));
|
|
22
|
-
const isArray_1 = __importDefault(require("lodash/isArray"));
|
|
23
|
-
const isObject_1 = __importDefault(require("lodash/isObject"));
|
|
14
|
+
exports.processListeners = exports.parseVersion = exports.processRuntimeCodeResources = exports.deserializeComponentLibraryMeta = exports.deserializeRuntimeComponent = exports.serializeRuntimeComponent = exports.serializeRuntimePage = exports.deserializePlatformApp = exports.serializePlatformApp = exports.deserializePage = exports.serializePage = exports.deserializeComponent = exports.serializeComponent = exports.deserializeDataVariables = exports.deserializeAttributes = exports.serializeAttributes = exports.deserializeDynamicMap = exports.serializeDynamicMap = exports.deserializeValue = exports.serializeValue = exports.generateDefaultCode = exports.getUsedComps = void 0;
|
|
15
|
+
const lodash_1 = require("lodash");
|
|
24
16
|
const common_1 = require("../../types/platform/common");
|
|
25
17
|
const expression_1 = require("../expression");
|
|
26
18
|
const common_2 = require("./utils/common");
|
|
@@ -183,13 +175,13 @@ function serializeDynamicMapWithExtra({ ctx, map = {}, scope = 'page', streamlin
|
|
|
183
175
|
let originKey = processedKey;
|
|
184
176
|
if (matched) {
|
|
185
177
|
originKey = matched[1];
|
|
186
|
-
(0,
|
|
178
|
+
(0, lodash_1.unset)(data, originKey);
|
|
187
179
|
}
|
|
188
180
|
const originKeyArr = originKey.split('.');
|
|
189
|
-
if ((0,
|
|
181
|
+
if ((0, lodash_1.get)(data, processedKey) == undefined) {
|
|
190
182
|
/* 选区结构处理 [formily] to [CALS] */
|
|
191
183
|
if (Array.isArray(processedValue) && (processedValue === null || processedValue === void 0 ? void 0 : processedValue.some((item) => !!(item === null || item === void 0 ? void 0 : item.selectableBlock)))) {
|
|
192
|
-
let valueTmp = (0,
|
|
184
|
+
let valueTmp = (0, lodash_1.cloneDeep)(processedValue);
|
|
193
185
|
processedValue = valueTmp === null || valueTmp === void 0 ? void 0 : valueTmp.map((_value) => {
|
|
194
186
|
var _a, _b, _c;
|
|
195
187
|
const xProp = (_a = _value === null || _value === void 0 ? void 0 : _value.selectableBlock) === null || _a === void 0 ? void 0 : _a['x-props'];
|
|
@@ -206,10 +198,10 @@ function serializeDynamicMapWithExtra({ ctx, map = {}, scope = 'page', streamlin
|
|
|
206
198
|
}
|
|
207
199
|
// 为动态数据且有多级,将{":range.0.label": "$page.dataset.state.test1"}转为{ range: [{ label: "$page.dataset.state.test1"}] }
|
|
208
200
|
if (matched && originKeyArr.length >= 2) {
|
|
209
|
-
(0,
|
|
201
|
+
(0, lodash_1.set)(data, replaceWithColon(originKey), (0, lodash_1.cloneDeep)(processedValue));
|
|
210
202
|
}
|
|
211
203
|
else {
|
|
212
|
-
data[processedKey] = (0,
|
|
204
|
+
data[processedKey] = (0, lodash_1.cloneDeep)(processedValue);
|
|
213
205
|
}
|
|
214
206
|
}
|
|
215
207
|
extra[originKey] = processedExtra;
|
|
@@ -239,19 +231,19 @@ function replaceWithColon(key) {
|
|
|
239
231
|
function recoverSynamicMap(parent, current, path = '') {
|
|
240
232
|
Object.keys(current).forEach((key) => {
|
|
241
233
|
let value = current[key];
|
|
242
|
-
if ((0,
|
|
234
|
+
if ((0, lodash_1.isArray)(value)) {
|
|
243
235
|
// 注意如果是 selectableBlock 独立处理
|
|
244
236
|
if (value === null || value === void 0 ? void 0 : value.some((item) => !!(item === null || item === void 0 ? void 0 : item.selectableBlock))) {
|
|
245
237
|
return;
|
|
246
238
|
}
|
|
247
239
|
// 数组必须在前面
|
|
248
240
|
value.forEach((valueItem, valueIndex) => {
|
|
249
|
-
if ((0,
|
|
241
|
+
if ((0, lodash_1.isObject)(valueItem)) {
|
|
250
242
|
valueItem = recoverSynamicMap(parent, valueItem, `${path === '' ? '' : `${path}.`}${key}.${valueIndex}`);
|
|
251
243
|
}
|
|
252
244
|
});
|
|
253
245
|
}
|
|
254
|
-
else if ((0,
|
|
246
|
+
else if ((0, lodash_1.isObject)(value)) {
|
|
255
247
|
value = recoverSynamicMap(parent, value, `${path === '' ? '' : `${path}.`}${key}`);
|
|
256
248
|
}
|
|
257
249
|
else {
|
|
@@ -260,7 +252,7 @@ function recoverSynamicMap(parent, current, path = '') {
|
|
|
260
252
|
parent[`:${path === '' ? '' : `${path}.`}${matched[1]}`] = current[key];
|
|
261
253
|
if (current !== parent) {
|
|
262
254
|
// 如果是第一层级,说明current和parent相等,不unset
|
|
263
|
-
(0,
|
|
255
|
+
(0, lodash_1.unset)(current, key);
|
|
264
256
|
}
|
|
265
257
|
}
|
|
266
258
|
}
|
|
@@ -270,7 +262,7 @@ function recoverSynamicMap(parent, current, path = '') {
|
|
|
270
262
|
function deserializeDynamicMap(ctx, map, extraMap) {
|
|
271
263
|
var _a, _b;
|
|
272
264
|
let data = {};
|
|
273
|
-
const clonedMap = (0,
|
|
265
|
+
const clonedMap = (0, lodash_1.cloneDeep)(map);
|
|
274
266
|
// 还原flatten path
|
|
275
267
|
map = recoverSynamicMap(clonedMap, clonedMap, '');
|
|
276
268
|
for (let key in map || {}) {
|
|
@@ -722,7 +714,7 @@ function deserializeComponent(ctx, components) {
|
|
|
722
714
|
}
|
|
723
715
|
exports.deserializeComponent = deserializeComponent;
|
|
724
716
|
function serializePage(ctx, page) {
|
|
725
|
-
var _a, _b, _c, _d, _e;
|
|
717
|
+
var _a, _b, _c, _d, _e, _f;
|
|
726
718
|
const pageCtx = Object.assign(Object.assign({}, ctx), { page });
|
|
727
719
|
if (pageCtx.dependencies && !pageCtx.dependenciesMap) {
|
|
728
720
|
pageCtx.dependenciesMap = processDependenciesMap(pageCtx.dependencies || []);
|
|
@@ -743,7 +735,11 @@ function serializePage(ctx, page) {
|
|
|
743
735
|
dataVariables: (0, runtime_1.getValidValue)((_d = (_c = page === null || page === void 0 ? void 0 : page.vars) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.map((item) => serializeDataVariables(pageCtx, item))),
|
|
744
736
|
listeners: (0, runtime_1.getValidValue)((_e = page === null || page === void 0 ? void 0 : page.listeners) === null || _e === void 0 ? void 0 : _e.map((item) => {
|
|
745
737
|
return serializeListener(pageCtx, item);
|
|
746
|
-
})),
|
|
738
|
+
}).concat((_f = page === null || page === void 0 ? void 0 : page.eventFlows) === null || _f === void 0 ? void 0 : _f.reduce((list, flow) => {
|
|
739
|
+
var _a;
|
|
740
|
+
list.push(...(((_a = flow.listeners) === null || _a === void 0 ? void 0 : _a.map((item) => serializeListener(pageCtx, item))) || []));
|
|
741
|
+
return list;
|
|
742
|
+
}, []))),
|
|
747
743
|
extra: {
|
|
748
744
|
commonStyle: page === null || page === void 0 ? void 0 : page.commonStyle,
|
|
749
745
|
xIndex: page.xIndex,
|
|
@@ -769,8 +765,9 @@ function serializePage(ctx, page) {
|
|
|
769
765
|
}
|
|
770
766
|
exports.serializePage = serializePage;
|
|
771
767
|
function deserializePage(ctx, page) {
|
|
772
|
-
var _a, _b, _c, _d, _e, _f
|
|
768
|
+
var _a, _b, _c, _d, _e, _f;
|
|
773
769
|
let pageCtx = Object.assign(Object.assign({}, ctx), { page });
|
|
770
|
+
const { listeners = [], eventFlows } = processListeners((page === null || page === void 0 ? void 0 : page.listeners) || []);
|
|
774
771
|
return {
|
|
775
772
|
id: page.id,
|
|
776
773
|
isHome: page.id === ctx.homePageId,
|
|
@@ -786,9 +783,15 @@ function deserializePage(ctx, page) {
|
|
|
786
783
|
staticResourceAttribute: (_d = page === null || page === void 0 ? void 0 : page.extra) === null || _d === void 0 ? void 0 : _d.staticResourceAttribute,
|
|
787
784
|
hideAdminPortalMenu: (_e = page === null || page === void 0 ? void 0 : page.extra) === null || _e === void 0 ? void 0 : _e.hideAdminPortalMenu,
|
|
788
785
|
lowCodes: (_f = page === null || page === void 0 ? void 0 : page.resources) === null || _f === void 0 ? void 0 : _f.filter((item) => item.type === common_1.EResourceType.CODE).map((item) => deserializeCodeResource(pageCtx, item)),
|
|
789
|
-
listeners: (
|
|
786
|
+
listeners: (listeners === null || listeners === void 0 ? void 0 : listeners.map((item) => {
|
|
790
787
|
return deserializeListener(pageCtx, item);
|
|
791
788
|
})) || [],
|
|
789
|
+
eventFlows: (eventFlows === null || eventFlows === void 0 ? void 0 : eventFlows.map((eventFlow) => {
|
|
790
|
+
var _a, _b;
|
|
791
|
+
return Object.assign(Object.assign({}, eventFlow), { listeners: ((_b = (_a = eventFlow.listeners) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, (item) => {
|
|
792
|
+
return deserializeListener(pageCtx, item);
|
|
793
|
+
})) || [] });
|
|
794
|
+
})) || [],
|
|
792
795
|
// TODO
|
|
793
796
|
// children: [],
|
|
794
797
|
// styleBindPath: item.styleBindPath,
|
|
@@ -1065,7 +1068,7 @@ function deserializeComponentLibraryMeta(meta) {
|
|
|
1065
1068
|
dependencies, components: processedComponents, actions });
|
|
1066
1069
|
}
|
|
1067
1070
|
exports.deserializeComponentLibraryMeta = deserializeComponentLibraryMeta;
|
|
1068
|
-
function processRuntimeCodeResources(ctx, resources = [], scope) {
|
|
1071
|
+
function processRuntimeCodeResources(ctx, resources /* : IWeappCode[]*/ = [], scope) {
|
|
1069
1072
|
const { id } = ctx;
|
|
1070
1073
|
const fileTypes = [common_1.ECodeType.STYLE, common_1.ECodeType.STATE, common_1.ECodeType.LIFECYCLE, common_1.ECodeType.COMPUTEDN];
|
|
1071
1074
|
const CODE_TYPE_NAME_MAP = {
|
|
@@ -1127,3 +1130,65 @@ function parseVersion(version = '', dependencies = []) {
|
|
|
1127
1130
|
return FEATURE_MAP;
|
|
1128
1131
|
}
|
|
1129
1132
|
exports.parseVersion = parseVersion;
|
|
1133
|
+
function processListeners(listeners, options) {
|
|
1134
|
+
const { strict = false } = options || {};
|
|
1135
|
+
const listenerEventNameMap = listeners.reduce((map, listener) => {
|
|
1136
|
+
const { eventName } = listener;
|
|
1137
|
+
if (!map[eventName]) {
|
|
1138
|
+
map[eventName] = [];
|
|
1139
|
+
}
|
|
1140
|
+
map[eventName].push(listener);
|
|
1141
|
+
return map;
|
|
1142
|
+
}, {});
|
|
1143
|
+
const flowListenerIdMap = {};
|
|
1144
|
+
const eventFlowMap = {};
|
|
1145
|
+
listeners.forEach((listener) => {
|
|
1146
|
+
const { id, eventName } = listener;
|
|
1147
|
+
if (flowListenerIdMap[id]) {
|
|
1148
|
+
return;
|
|
1149
|
+
}
|
|
1150
|
+
const [_, eventFlowId] = eventName.match(/(.*?)\.start/) || [];
|
|
1151
|
+
const evnetTree = [];
|
|
1152
|
+
let eventFlow = { id: '', listeners: [] };
|
|
1153
|
+
if (eventFlowId) {
|
|
1154
|
+
eventFlow.id = eventFlowId;
|
|
1155
|
+
if (listener.description) {
|
|
1156
|
+
eventFlow.description = listener.description;
|
|
1157
|
+
}
|
|
1158
|
+
if (listener.label) {
|
|
1159
|
+
eventFlow.label = listener.label;
|
|
1160
|
+
}
|
|
1161
|
+
eventFlowMap[eventFlowId] = eventFlow;
|
|
1162
|
+
evnetTree.push(eventName);
|
|
1163
|
+
}
|
|
1164
|
+
for (let eventName of evnetTree) {
|
|
1165
|
+
const list = listenerEventNameMap[eventName] || [];
|
|
1166
|
+
if (strict && list.length > 1) {
|
|
1167
|
+
throw new Error(`事件流 ${eventFlowId} 中 ${eventName} 事件存在并发调用`);
|
|
1168
|
+
}
|
|
1169
|
+
list.forEach((item) => {
|
|
1170
|
+
flowListenerIdMap[item.id] = eventFlowId;
|
|
1171
|
+
const successEventName = `${item.id}.success`;
|
|
1172
|
+
const failEventName = `${item.id}.fail`;
|
|
1173
|
+
if (listenerEventNameMap[successEventName]) {
|
|
1174
|
+
evnetTree.push(successEventName);
|
|
1175
|
+
}
|
|
1176
|
+
if (listenerEventNameMap[failEventName]) {
|
|
1177
|
+
evnetTree.push(failEventName);
|
|
1178
|
+
}
|
|
1179
|
+
});
|
|
1180
|
+
}
|
|
1181
|
+
});
|
|
1182
|
+
const rawListeners = [];
|
|
1183
|
+
listeners.forEach((listener) => {
|
|
1184
|
+
const flowId = flowListenerIdMap[listener.id];
|
|
1185
|
+
if (flowId && eventFlowMap[flowId]) {
|
|
1186
|
+
eventFlowMap[flowId].listeners.push(listener);
|
|
1187
|
+
}
|
|
1188
|
+
else {
|
|
1189
|
+
rawListeners.push(listener);
|
|
1190
|
+
}
|
|
1191
|
+
});
|
|
1192
|
+
return { listeners: rawListeners, eventFlows: Object.values(eventFlowMap) };
|
|
1193
|
+
}
|
|
1194
|
+
exports.processListeners = processListeners;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { IComplexComponent, IBasicComponent } from '../../../../types';
|
|
2
|
-
interface IParseContext {
|
|
3
|
-
component?: {
|
|
4
|
-
id: string;
|
|
5
|
-
};
|
|
6
|
-
forContext: Record<string, boolean>;
|
|
7
|
-
datasetMap: Record<string, any>;
|
|
8
|
-
dataSourceMap: Record<string, any>;
|
|
9
|
-
componentMap: Record<string, any>;
|
|
10
|
-
lowcodeMap: Record<string, any>;
|
|
11
|
-
componentLibMap: Record<string, any>;
|
|
12
|
-
}
|
|
13
|
-
export declare function parseComponentCals(ctx: IParseContext, cals: IBasicComponent | IComplexComponent): IParseContext;
|
|
14
|
-
export {};
|
|
1
|
+
import { IComplexComponent, IBasicComponent } from '../../../../types';
|
|
2
|
+
interface IParseContext {
|
|
3
|
+
component?: {
|
|
4
|
+
id: string;
|
|
5
|
+
};
|
|
6
|
+
forContext: Record<string, boolean>;
|
|
7
|
+
datasetMap: Record<string, any>;
|
|
8
|
+
dataSourceMap: Record<string, any>;
|
|
9
|
+
componentMap: Record<string, any>;
|
|
10
|
+
lowcodeMap: Record<string, any>;
|
|
11
|
+
componentLibMap: Record<string, any>;
|
|
12
|
+
}
|
|
13
|
+
export declare function parseComponentCals(ctx: IParseContext, cals: IBasicComponent | IComplexComponent): IParseContext;
|
|
14
|
+
export {};
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/parser/cals/utils/block/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAqB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/parser/cals/utils/block/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAqB,MAAM,mBAAmB,CAAC;AAI1F,UAAU,aAAa;IACrB,SAAS,CAAC,EAAE;QACV,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC;IACF,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACtC;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,eAAe,GAAG,iBAAiB,GAAG,aAAa,CAyD/G"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.parseComponentCals = void 0;
|
|
7
|
-
const
|
|
8
|
-
const set_1 = __importDefault(require("lodash/set"));
|
|
4
|
+
const lodash_1 = require("lodash");
|
|
9
5
|
const expression_1 = require("../../../expression");
|
|
10
6
|
function parseComponentCals(ctx, cals) {
|
|
11
7
|
if (!ctx.datasetMap) {
|
|
@@ -27,8 +23,8 @@ function parseComponentCals(ctx, cals) {
|
|
|
27
23
|
id: cals.id || '',
|
|
28
24
|
};
|
|
29
25
|
const { component, module, attributes = {}, items = [], listeners = [], directives = {}, [':class']: dynamicClassList, [':style']: dynamicStyle, } = cals;
|
|
30
|
-
if (module && component && !(0,
|
|
31
|
-
(0,
|
|
26
|
+
if (module && component && !(0, lodash_1.get)(ctx.componentMap, `${module}.${component}`)) {
|
|
27
|
+
(0, lodash_1.set)(ctx.componentMap, `${module}.${component}`, true);
|
|
32
28
|
ctx.componentLibMap[module] = true;
|
|
33
29
|
}
|
|
34
30
|
// 优先处理 directives 因为其他绑定会用到for
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* cals 与 code 互转
|
|
3
|
-
* 这里的 code 是中间状态的 code,即非最终生成的可运行的项目代码
|
|
4
|
-
*/
|
|
5
|
-
import { IPlatformApp } from '../../../../types';
|
|
6
|
-
export interface ICodeItem {
|
|
7
|
-
path: string;
|
|
8
|
-
code: string;
|
|
9
|
-
conflict?: boolean;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* CALS 转成 中间状态的代码
|
|
13
|
-
*
|
|
14
|
-
* @params version: v0 - 没有 pages 目录; v1 - 有 pages 目录
|
|
15
|
-
*/
|
|
16
|
-
export declare function calsToCode(calsJSON: IPlatformApp, version?: 'v0' | 'v1'): ICodeItem[];
|
|
17
|
-
/**
|
|
18
|
-
* 中间状态的代码 转成 CALS
|
|
19
|
-
*
|
|
20
|
-
* @params version: v0 - 没有 pages 目录; v1 - 有 pages 目录
|
|
21
|
-
*/
|
|
22
|
-
export declare function codeToCals(codeList: ICodeItem[], version?: 'v0' | 'v1'): IPlatformApp;
|
|
23
|
-
/**
|
|
24
|
-
* 指定代码内容是否存在冲突未解决
|
|
25
|
-
*/
|
|
26
|
-
export declare function checkForConflicts(code: string): boolean;
|
|
27
|
-
/**
|
|
28
|
-
* 以 from 为准自动解决冲突
|
|
29
|
-
*/
|
|
30
|
-
export declare function autoResolveConflicts(code: string, from: 'theirs' | 'ours'): string;
|
|
1
|
+
/**
|
|
2
|
+
* cals 与 code 互转
|
|
3
|
+
* 这里的 code 是中间状态的 code,即非最终生成的可运行的项目代码
|
|
4
|
+
*/
|
|
5
|
+
import { IPlatformApp } from '../../../../types';
|
|
6
|
+
export interface ICodeItem {
|
|
7
|
+
path: string;
|
|
8
|
+
code: string;
|
|
9
|
+
conflict?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* CALS 转成 中间状态的代码
|
|
13
|
+
*
|
|
14
|
+
* @params version: v0 - 没有 pages 目录; v1 - 有 pages 目录
|
|
15
|
+
*/
|
|
16
|
+
export declare function calsToCode(calsJSON: IPlatformApp, version?: 'v0' | 'v1'): ICodeItem[];
|
|
17
|
+
/**
|
|
18
|
+
* 中间状态的代码 转成 CALS
|
|
19
|
+
*
|
|
20
|
+
* @params version: v0 - 没有 pages 目录; v1 - 有 pages 目录
|
|
21
|
+
*/
|
|
22
|
+
export declare function codeToCals(codeList: ICodeItem[], version?: 'v0' | 'v1'): IPlatformApp;
|
|
23
|
+
/**
|
|
24
|
+
* 指定代码内容是否存在冲突未解决
|
|
25
|
+
*/
|
|
26
|
+
export declare function checkForConflicts(code: string): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* 以 from 为准自动解决冲突
|
|
29
|
+
*/
|
|
30
|
+
export declare function autoResolveConflicts(code: string, from: 'theirs' | 'ours'): string;
|
|
31
31
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/parser/cals/utils/code/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAsE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/parser/cals/utils/code/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAsE,MAAM,mBAAmB,CAAC;AAGrH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,GAAE,IAAI,GAAG,IAAW,GAAG,SAAS,EAAE,CAwL3F;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,OAAO,GAAE,IAAI,GAAG,IAAW,GAAG,YAAY,CA+J3F;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,CA6BlF"}
|
|
@@ -3,15 +3,10 @@
|
|
|
3
3
|
* cals 与 code 互转
|
|
4
4
|
* 这里的 code 是中间状态的 code,即非最终生成的可运行的项目代码
|
|
5
5
|
*/
|
|
6
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
-
};
|
|
9
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
7
|
exports.autoResolveConflicts = exports.checkForConflicts = exports.codeToCals = exports.calsToCode = void 0;
|
|
11
8
|
const types_1 = require("../../../../types");
|
|
12
|
-
const
|
|
13
|
-
const omit_1 = __importDefault(require("lodash/omit"));
|
|
14
|
-
const concat_1 = __importDefault(require("lodash/concat"));
|
|
9
|
+
const lodash_1 = require("lodash");
|
|
15
10
|
/**
|
|
16
11
|
* CALS 转成 中间状态的代码
|
|
17
12
|
*
|
|
@@ -120,10 +115,10 @@ function calsToCode(calsJSON, version = 'v1') {
|
|
|
120
115
|
}
|
|
121
116
|
function genConfig(itemJSON, configFields, configPath, otherConfigFields) {
|
|
122
117
|
var _a;
|
|
123
|
-
const config = (0,
|
|
118
|
+
const config = (0, lodash_1.pick)(itemJSON, configFields);
|
|
124
119
|
if (otherConfigFields) {
|
|
125
120
|
Object.keys(otherConfigFields).forEach((key) => {
|
|
126
|
-
config[key] = (0,
|
|
121
|
+
config[key] = (0, lodash_1.pick)(config[key], otherConfigFields[key]);
|
|
127
122
|
});
|
|
128
123
|
}
|
|
129
124
|
// state, computed 类型以及名称为 ____index____ 的都不生成代码
|
|
@@ -205,7 +200,7 @@ function codeToCals(codeList, version = 'v1') {
|
|
|
205
200
|
resources: [],
|
|
206
201
|
};
|
|
207
202
|
const appConfigCodeItem = codeList.find((item) => item.path === 'src/app-config.json');
|
|
208
|
-
const appConfig = JSON.parse(
|
|
203
|
+
const appConfig = JSON.parse(appConfigCodeItem.code);
|
|
209
204
|
let pagePaths = appConfig.extra.pages;
|
|
210
205
|
codeList.forEach((codeItem) => {
|
|
211
206
|
if (codeItem.path === 'src/app-config.json') {
|
|
@@ -213,14 +208,14 @@ function codeToCals(codeList, version = 'v1') {
|
|
|
213
208
|
* app-config.json
|
|
214
209
|
*/
|
|
215
210
|
const config = appConfig;
|
|
216
|
-
Object.assign(calsJSON, (0,
|
|
217
|
-
calsJSON.resources = (0,
|
|
211
|
+
Object.assign(calsJSON, (0, lodash_1.omit)(config, ['_ignoreResources', 'extra.pages']));
|
|
212
|
+
calsJSON.resources = (0, lodash_1.concat)(calsJSON.resources, config._ignoreResources);
|
|
218
213
|
}
|
|
219
214
|
else if (isPageFile(codeItem.path)) {
|
|
220
215
|
/**
|
|
221
216
|
* page
|
|
222
217
|
*/
|
|
223
|
-
const [, pageId] = codeItem.path.match(versionConfig.pageIdRegExp)
|
|
218
|
+
const [, pageId] = codeItem.path.match(versionConfig.pageIdRegExp);
|
|
224
219
|
let pageItem = calsJSON.items.find((item) => item.id === pageId);
|
|
225
220
|
if (!pageItem) {
|
|
226
221
|
pageItem = {
|
|
@@ -238,9 +233,9 @@ function codeToCals(codeList, version = 'v1') {
|
|
|
238
233
|
* page-config.json
|
|
239
234
|
*/
|
|
240
235
|
const config = JSON.parse(codeItem.code);
|
|
241
|
-
const propsConfig = (0,
|
|
236
|
+
const propsConfig = (0, lodash_1.omit)(config, ['_ignoreResources']);
|
|
242
237
|
Object.assign(pageItem, propsConfig);
|
|
243
|
-
pageItem.resources = (0,
|
|
238
|
+
pageItem.resources = (0, lodash_1.concat)(pageItem.resources, config._ignoreResources);
|
|
244
239
|
}
|
|
245
240
|
else if (versionConfig.pageJSONRegExp.test(codeItem.path)) {
|
|
246
241
|
/**
|
|
@@ -259,12 +254,11 @@ function codeToCals(codeList, version = 'v1') {
|
|
|
259
254
|
/**
|
|
260
255
|
* global normal codes
|
|
261
256
|
*/
|
|
262
|
-
handleNormalCodes(codeItem, '', calsJSON.resources
|
|
257
|
+
handleNormalCodes(codeItem, '', calsJSON.resources);
|
|
263
258
|
}
|
|
264
259
|
});
|
|
265
260
|
return calsJSON;
|
|
266
261
|
function handleNormalCodes(codeItem, pageId, resources) {
|
|
267
|
-
var _a, _b;
|
|
268
262
|
const relativePath = !pageId
|
|
269
263
|
? codeItem.path.replace('src/', '')
|
|
270
264
|
: codeItem.path.replace(`${versionConfig.pageDir}/${pageId}/`, '');
|
|
@@ -280,7 +274,7 @@ function codeToCals(codeList, version = 'v1') {
|
|
|
280
274
|
*/
|
|
281
275
|
switch (relativePath) {
|
|
282
276
|
case 'theme.less':
|
|
283
|
-
|
|
277
|
+
calsJSON.resources.push(Object.assign({ name: types_1.ECodeType.THEME, path: `${_pageId}/${types_1.ECodeType.THEME}`, codeType: types_1.ECodeType.THEME }, commonVal));
|
|
284
278
|
break;
|
|
285
279
|
case 'style.less':
|
|
286
280
|
resources.push(Object.assign({ name: types_1.ECodeType.STYLE, path: `${_pageId}/${types_1.ECodeType.STYLE}`, codeType: types_1.ECodeType.STYLE }, commonVal));
|
|
@@ -299,7 +293,7 @@ function codeToCals(codeList, version = 'v1') {
|
|
|
299
293
|
const commonMatches = relativePath.match(/^common\/([^/]*?).js$/);
|
|
300
294
|
if (commonMatches) {
|
|
301
295
|
const [, name] = commonMatches;
|
|
302
|
-
|
|
296
|
+
calsJSON.resources.push(Object.assign({ name, path: `${_pageId}/common/${name}`, codeType: types_1.ECodeType.NORMAL_MODULE }, commonVal));
|
|
303
297
|
}
|
|
304
298
|
break;
|
|
305
299
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { IDataBind } from '../../expression/index';
|
|
2
|
-
declare type IUsedComps = {
|
|
3
|
-
[libName: string]: Set<string>;
|
|
4
|
-
};
|
|
5
|
-
export declare function camelcase(str: string, firstUpperCase?: boolean): string;
|
|
6
|
-
export declare function isPlainObject(src: any): boolean;
|
|
7
|
-
export declare const isEmptyObj: (obj: object) => boolean;
|
|
8
|
-
export declare function isValidStyleBind(styleBind: IDataBind): boolean;
|
|
9
|
-
export declare function isValidClassNameListBind(classNameListBind: IDataBind): boolean;
|
|
10
|
-
export declare function getUsedComps(apps: any[], comps: any[]): IUsedComps;
|
|
11
|
-
export {};
|
|
1
|
+
import { IDataBind } from '../../expression/index';
|
|
2
|
+
declare type IUsedComps = {
|
|
3
|
+
[libName: string]: Set<string>;
|
|
4
|
+
};
|
|
5
|
+
export declare function camelcase(str: string, firstUpperCase?: boolean): string;
|
|
6
|
+
export declare function isPlainObject(src: any): boolean;
|
|
7
|
+
export declare const isEmptyObj: (obj: object) => boolean;
|
|
8
|
+
export declare function isValidStyleBind(styleBind: IDataBind): boolean;
|
|
9
|
+
export declare function isValidClassNameListBind(classNameListBind: IDataBind): boolean;
|
|
10
|
+
export declare function getUsedComps(apps: any[], comps: any[]): IUsedComps;
|
|
11
|
+
export {};
|
|
12
12
|
//# sourceMappingURL=common.d.ts.map
|
|
File without changes
|
|
File without changes
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { IDynamicValue } from '../../expression';
|
|
2
|
-
export declare function readComponents(properties?: {
|
|
3
|
-
[key: string]: any;
|
|
4
|
-
}, excludeKeys?: string[]): Object;
|
|
5
|
-
export declare function readDirectives(cmp: any): any;
|
|
6
|
-
export declare function readDynamicData(cmp: any): {
|
|
7
|
-
[key: string]: IDynamicValue;
|
|
8
|
-
};
|
|
9
|
-
export declare function readListeners(listenerInstances?: any[]): any;
|
|
10
|
-
export declare function writeListeners(listeners?: any[]): any[];
|
|
11
|
-
export declare function writeDynamicData(from: any, to: any, properties: any): any;
|
|
12
|
-
export declare function setValidValue(target: any, key: string, value: any): void;
|
|
13
|
-
export declare function getValidValue(value: any): any;
|
|
1
|
+
import { IDynamicValue } from '../../expression';
|
|
2
|
+
export declare function readComponents(properties?: {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}, excludeKeys?: string[]): Object;
|
|
5
|
+
export declare function readDirectives(cmp: any): any;
|
|
6
|
+
export declare function readDynamicData(cmp: any): {
|
|
7
|
+
[key: string]: IDynamicValue;
|
|
8
|
+
};
|
|
9
|
+
export declare function readListeners(listenerInstances?: any[]): any;
|
|
10
|
+
export declare function writeListeners(listeners?: any[]): any[];
|
|
11
|
+
export declare function writeDynamicData(from: any, to: any, properties: any): any;
|
|
12
|
+
export declare function setValidValue(target: any, key: string, value: any): void;
|
|
13
|
+
export declare function getValidValue(value: any): any;
|
|
14
14
|
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/parser/cals/utils/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/parser/cals/utils/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA2B,MAAM,kBAAkB,CAAC;AAK1E,wBAAgB,cAAc,CAC5B,UAAU,GAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAoB,EACpD,WAAW,GAAE,MAAM,EAAO,GACzB,MAAM,CAqDR;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,OAiDtC;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,GAAG,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAA;CAAE,CA4B1E;AAED,wBAAgB,aAAa,CAAC,iBAAiB,GAAE,GAAG,EAAO,OAiB1D;AAED,wBAAgB,cAAc,CAAC,SAAS,GAAE,GAAG,EAAO,SAenD;AAGD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,GAAQ,EAAE,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,OAgExE;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,QAKjE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,OAWvC"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.getValidValue = exports.setValidValue = exports.writeDynamicData = exports.writeListeners = exports.readListeners = exports.readDynamicData = exports.readDirectives = exports.readComponents = void 0;
|
|
7
4
|
const expression_1 = require("../../expression");
|
|
8
5
|
const style_1 = require("./style");
|
|
9
6
|
const common_1 = require("./common");
|
|
10
|
-
const
|
|
7
|
+
const lodash_1 = require("lodash");
|
|
11
8
|
function readComponents(properties = {}, excludeKeys = []) {
|
|
12
9
|
var _a;
|
|
13
10
|
const cmps /* IWeAppPage['componentInstances'] */ = {};
|
|
@@ -176,7 +173,7 @@ function writeListeners(listeners = []) {
|
|
|
176
173
|
exports.writeListeners = writeListeners;
|
|
177
174
|
// 处理Listeners动态数据
|
|
178
175
|
function writeDynamicData(from = {}, to, properties) {
|
|
179
|
-
const act = (0,
|
|
176
|
+
const act = (0, lodash_1.cloneDeep)(to);
|
|
180
177
|
act.dataTypes = to.dataTypes || [];
|
|
181
178
|
for (const prop in from) {
|
|
182
179
|
const dv = from[prop];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { IPlatformApp } from '../../../../types';
|
|
2
|
-
/**
|
|
3
|
-
* [WeApps协议] to [CALS协议]
|
|
4
|
-
*
|
|
5
|
-
* @param data
|
|
6
|
-
*/
|
|
7
|
-
export declare function processComponentModule(data: any, optsions: {
|
|
8
|
-
dependencies: object[];
|
|
9
|
-
}): IPlatformApp;
|
|
1
|
+
import { IPlatformApp } from '../../../../types';
|
|
2
|
+
/**
|
|
3
|
+
* [WeApps协议] to [CALS协议]
|
|
4
|
+
*
|
|
5
|
+
* @param data
|
|
6
|
+
*/
|
|
7
|
+
export declare function processComponentModule(data: any, optsions: {
|
|
8
|
+
dependencies: object[];
|
|
9
|
+
}): IPlatformApp;
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
|
File without changes
|
|
File without changes
|