@cloudbase/cals 1.0.52 → 1.0.54-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 +6 -1
- package/lib/parser/cals/index.d.ts.map +1 -1
- package/lib/parser/cals/index.js +35 -4
- package/lib/parser/cals/utils/code/index.d.ts +2 -2
- package/lib/parser/cals/utils/code/index.d.ts.map +1 -1
- package/lib/parser/cals/utils/code/index.js +10 -2
- package/lib/parser/cals/utils/common.d.ts +2 -2
- package/lib/parser/cals/utils/common.d.ts.map +1 -1
- package/lib/parser/cals/utils/common.js +1 -1
- package/lib/types/platform/app.d.ts +97 -34
- package/lib/types/platform/app.d.ts.map +1 -1
- package/lib/utils/dts/index.js +3 -2
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { IAttributes, IPlatformApp, IPageComponent, IPlatformComponent, IDataSou
|
|
|
3
3
|
IPlatformDataSource, IDependencies, LCDS } from '../../types';
|
|
4
4
|
import { IDynamicValue, PropBindType } from '../expression';
|
|
5
5
|
import { IEventFlow } from '../../types/platform/eventFlow';
|
|
6
|
-
import { IHandler } from '../../utils';
|
|
6
|
+
import { IHandler, IPlatformSubApp } from '../../utils';
|
|
7
7
|
export { getUsedComps } from './utils/common';
|
|
8
8
|
export { generateDefaultCode } from './utils/template';
|
|
9
9
|
interface IDeserializeContext {
|
|
@@ -496,4 +496,9 @@ export declare function processTemplatesToDependiencies(templates?: any[]): {
|
|
|
496
496
|
schemaVersion: string;
|
|
497
497
|
};
|
|
498
498
|
export declare function generateHandlerParamsDynamicMap(handler: IHandler): any;
|
|
499
|
+
/**
|
|
500
|
+
* 精简过滤子包数据
|
|
501
|
+
* 仅保留子包自身数据
|
|
502
|
+
*/
|
|
503
|
+
export declare function streamlineSubApp(cals: any): IPlatformSubApp;
|
|
499
504
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/parser/cals/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAuC,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEvH,OAAO,EACL,WAAW,EACX,YAAY,EAGZ,cAAc,EACd,kBAAkB,EAElB,mBAAmB,EACnB,cAAc,EAAE,cAAc;AAC9B,mBAAmB,EACnB,aAAa,EACb,IAAI,EAEL,MAAM,aAAa,CAAC;AAErB,OAAO,EAAkC,aAAa,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAS5F,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAoC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/parser/cals/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAuC,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEvH,OAAO,EACL,WAAW,EACX,YAAY,EAGZ,cAAc,EACd,kBAAkB,EAElB,mBAAmB,EACnB,cAAc,EAAE,cAAc;AAC9B,mBAAmB,EACnB,aAAa,EACb,IAAI,EAEL,MAAM,aAAa,CAAC;AAErB,OAAO,EAAkC,aAAa,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAS5F,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAoC,MAAM,aAAa,CAAC;AAE1F,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,UAA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IACxB,uBAAuB,EAAE,OAAO,CAAC;IACjC,oBAAoB,EAAE,OAAO,CAAC;CAC/B,CAoCA;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,CA4DA;AAED,wBAAgB,6BAA6B,CAAC,YAAY,GAAE,aAAkB,MAQ7E;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,UAWvD;AAED,wBAAgB,+BAA+B,CAAC,SAAS,QAAK;;;;;;;;;;;;;;;;;QA4BtD;;;WAGG;;;;;;;EAcV;AAED,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,QAAQ,OAchE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,KAAA,GAAG,eAAe,CAiBtD"}
|
package/lib/parser/cals/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.generateHandlerParamsDynamicMap = exports.processTemplatesToDependiencies = exports.parseDependenciesVersion = exports.processDependenciesVersionMap = exports.processListeners = exports.parseVersion = exports.processRuntimeCodeResources = exports.deserializeComponentLibraryMeta = exports.deserializeRuntimeComponent = exports.serializeRuntimeComponent = exports.serializeRuntimeDataset = exports.serializeRuntimePage = exports.deserializeCompositeComponent = exports.deserializePlatformApp = exports.serializePlatformApp = exports.deserializePage = exports.serializeLayouts = exports.serializePage = exports.deserializeComponent = exports.serializeComponent = exports.deserializeDataVariables = exports.normalizeQuery = exports.deserializeDataset = exports.deserializeTemplates = exports.serializeDataset = exports.deserializeAttributes = exports.serializeAttributes = exports.deserializeDynamicMap = exports.serializeDynamicMap = exports.deserializeValue = exports.serializeValue = exports.generateDefaultCode = exports.getUsedComps = void 0;
|
|
17
|
+
exports.streamlineSubApp = exports.generateHandlerParamsDynamicMap = exports.processTemplatesToDependiencies = exports.parseDependenciesVersion = exports.processDependenciesVersionMap = exports.processListeners = exports.parseVersion = exports.processRuntimeCodeResources = exports.deserializeComponentLibraryMeta = exports.deserializeRuntimeComponent = exports.serializeRuntimeComponent = exports.serializeRuntimeDataset = exports.serializeRuntimePage = exports.deserializeCompositeComponent = exports.deserializePlatformApp = exports.serializePlatformApp = exports.deserializePage = exports.serializeLayouts = exports.serializePage = exports.deserializeComponent = exports.serializeComponent = exports.deserializeDataVariables = exports.normalizeQuery = exports.deserializeDataset = exports.deserializeTemplates = exports.serializeDataset = exports.deserializeAttributes = exports.serializeAttributes = exports.deserializeDynamicMap = exports.serializeDynamicMap = exports.deserializeValue = exports.serializeValue = exports.generateDefaultCode = exports.getUsedComps = void 0;
|
|
18
18
|
const get_1 = __importDefault(require("lodash/get"));
|
|
19
19
|
const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
|
|
20
20
|
const unset_1 = __importDefault(require("lodash/unset"));
|
|
@@ -366,6 +366,7 @@ function serializeDataset(ctx, dataset) {
|
|
|
366
366
|
Object.entries(result.query || {}).forEach(([key, query]) => {
|
|
367
367
|
var _a, _b, _c, _d;
|
|
368
368
|
let { dataSourceName, method, listeners, handler, data, args } = query, restQuery = __rest(query, ["dataSourceName", "method", "listeners", "handler", "data", "args"]);
|
|
369
|
+
let isDeprecatedVersion = false;
|
|
369
370
|
let mergedData = (_a = serializeDynamicMapWithExtra({
|
|
370
371
|
ctx,
|
|
371
372
|
map: data || {},
|
|
@@ -375,6 +376,7 @@ function serializeDataset(ctx, dataset) {
|
|
|
375
376
|
moduleName: 'platform',
|
|
376
377
|
name: 'cloud.callDataSource',
|
|
377
378
|
};
|
|
379
|
+
isDeprecatedVersion = true;
|
|
378
380
|
mergedData = {
|
|
379
381
|
dataSourceName,
|
|
380
382
|
methodName: method === null || method === void 0 ? void 0 : method.name,
|
|
@@ -393,7 +395,10 @@ function serializeDataset(ctx, dataset) {
|
|
|
393
395
|
name: handler === null || handler === void 0 ? void 0 : handler.name,
|
|
394
396
|
code: handler === null || handler === void 0 ? void 0 : handler.code,
|
|
395
397
|
};
|
|
396
|
-
if (
|
|
398
|
+
if (isDeprecatedVersion) {
|
|
399
|
+
processedHandler.params = mergedData;
|
|
400
|
+
}
|
|
401
|
+
else if (mergedData && data) {
|
|
397
402
|
processedHandler.params = mergedData;
|
|
398
403
|
}
|
|
399
404
|
else {
|
|
@@ -1243,10 +1248,11 @@ function processRuntimeCodeResources(ctx, resources = [], scope) {
|
|
|
1243
1248
|
[common_1.ECodeType.COMPUTEDN]: common_1.ECodeName.COMPUTEDN,
|
|
1244
1249
|
[common_1.ECodeType.STYLE]: common_1.ECodeName.STYLE,
|
|
1245
1250
|
[common_1.ECodeType.LIFECYCLE]: common_1.ECodeName.LIFECYCLE,
|
|
1251
|
+
[common_1.ECodeType.MPCONFIG]: common_1.ECodeName.MPCONFIG,
|
|
1246
1252
|
};
|
|
1247
1253
|
const isComponent = id === '$comp' || scope === 'component';
|
|
1248
1254
|
if (id === 'global' || scope === 'app') {
|
|
1249
|
-
fileTypes.push(common_1.ECodeType.THEME);
|
|
1255
|
+
fileTypes.push(common_1.ECodeType.THEME, common_1.ECodeType.MPCONFIG);
|
|
1250
1256
|
}
|
|
1251
1257
|
const EXIST_FILE_TYPE_MAP = {};
|
|
1252
1258
|
resources.forEach((mod) => {
|
|
@@ -1256,11 +1262,13 @@ function processRuntimeCodeResources(ctx, resources = [], scope) {
|
|
|
1256
1262
|
const isHasLowcodeIndex = EXIST_FILE_TYPE_MAP[type];
|
|
1257
1263
|
if (!isHasLowcodeIndex) {
|
|
1258
1264
|
const name = CODE_TYPE_NAME_MAP[type] || type;
|
|
1265
|
+
const dir = type === common_1.ECodeType.MPCONFIG ? common_1.ECodeName.NORMAL_MODULE : '';
|
|
1266
|
+
const path = [id, dir, name].filter(Boolean).join('/');
|
|
1259
1267
|
resources.unshift({
|
|
1260
1268
|
name,
|
|
1261
1269
|
type,
|
|
1262
1270
|
code: (0, template_1.generateDefaultCode)(ctx, type, isComponent ? 'component' : id === 'global' ? 'app' : 'page'),
|
|
1263
|
-
path
|
|
1271
|
+
path,
|
|
1264
1272
|
system: true,
|
|
1265
1273
|
});
|
|
1266
1274
|
}
|
|
@@ -1448,3 +1456,26 @@ function generateHandlerParamsDynamicMap(handler) {
|
|
|
1448
1456
|
return handerParam;
|
|
1449
1457
|
}
|
|
1450
1458
|
exports.generateHandlerParamsDynamicMap = generateHandlerParamsDynamicMap;
|
|
1459
|
+
/**
|
|
1460
|
+
* 精简过滤子包数据
|
|
1461
|
+
* 仅保留子包自身数据
|
|
1462
|
+
*/
|
|
1463
|
+
function streamlineSubApp(cals) {
|
|
1464
|
+
const { schemaVersion, id, name, description, label, main, items = [], extra } = cals;
|
|
1465
|
+
const { originHistoryId, pageTree, rootPath } = extra;
|
|
1466
|
+
return {
|
|
1467
|
+
schemaVersion,
|
|
1468
|
+
id,
|
|
1469
|
+
name,
|
|
1470
|
+
label,
|
|
1471
|
+
description,
|
|
1472
|
+
main,
|
|
1473
|
+
items,
|
|
1474
|
+
extra: {
|
|
1475
|
+
pageTree,
|
|
1476
|
+
originHistoryId,
|
|
1477
|
+
rootPath,
|
|
1478
|
+
},
|
|
1479
|
+
};
|
|
1480
|
+
}
|
|
1481
|
+
exports.streamlineSubApp = streamlineSubApp;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* cals 与 code 互转
|
|
3
3
|
* 这里的 code 是中间状态的 code,即非最终生成的可运行的项目代码
|
|
4
4
|
*/
|
|
5
|
-
import { IPlatformApp } from '../../../../types';
|
|
5
|
+
import { IPlatformApp, IPlatformSubApp } from '../../../../types';
|
|
6
6
|
export interface ICodeItem {
|
|
7
7
|
path: string;
|
|
8
8
|
code: string;
|
|
@@ -13,7 +13,7 @@ export interface ICodeItem {
|
|
|
13
13
|
*
|
|
14
14
|
* @params version: v0 - 没有 pages 目录; v1 - 有 pages 目录
|
|
15
15
|
*/
|
|
16
|
-
export declare function calsToCode(calsJSON: IPlatformApp, version?: 'v0' | 'v1'): ICodeItem[];
|
|
16
|
+
export declare function calsToCode(calsJSON: IPlatformApp | IPlatformSubApp, version?: 'v0' | 'v1'): ICodeItem[];
|
|
17
17
|
/**
|
|
18
18
|
* 中间状态的代码 转成 CALS
|
|
19
19
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/parser/cals/utils/code/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/parser/cals/utils/code/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,YAAY,EAMZ,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAK3B,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,GAAG,eAAe,EAAE,OAAO,GAAE,IAAI,GAAG,IAAW,GAAG,SAAS,EAAE,CAiM7G;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;AAED,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,gBAAgB,GAAE,OAAe,GAChC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,CAoClD"}
|
|
@@ -93,6 +93,13 @@ function calsToCode(calsJSON, version = 'v1') {
|
|
|
93
93
|
'rootPath',
|
|
94
94
|
'themeVars',
|
|
95
95
|
'originHistoryId',
|
|
96
|
+
'enableLoading',
|
|
97
|
+
'statusPageId',
|
|
98
|
+
'disabled',
|
|
99
|
+
'enableAsyncMaterials',
|
|
100
|
+
'clientId',
|
|
101
|
+
'loginConfigVersion',
|
|
102
|
+
'enableLoginStatusShare',
|
|
96
103
|
// 额外添加,非标准
|
|
97
104
|
'pages',
|
|
98
105
|
'processPages',
|
|
@@ -139,7 +146,7 @@ function calsToCode(calsJSON, version = 'v1') {
|
|
|
139
146
|
.forEach((key) => (newConfig[key] = config[key]));
|
|
140
147
|
addCodeItem(configPath, JSON.stringify(config, null, 2));
|
|
141
148
|
}
|
|
142
|
-
function genCode(resources, basePath = '') {
|
|
149
|
+
function genCode(resources = [], basePath = '') {
|
|
143
150
|
const codeResources = (resources || []).filter((item) => item.type === types_1.EResourceType.CODE && item.name !== types_1.ECodeName.PLACEHOLDER);
|
|
144
151
|
codeResources.forEach((codeItem) => {
|
|
145
152
|
let codePath = '';
|
|
@@ -290,7 +297,7 @@ function codeToCals(codeList, version = 'v1') {
|
|
|
290
297
|
case 'lifecycle.js':
|
|
291
298
|
resources.push(Object.assign({ name: types_1.ECodeType.LIFECYCLE, path: `${_pageId}/${types_1.ECodeType.LIFECYCLE}`, codeType: types_1.ECodeType.LIFECYCLE }, commonVal));
|
|
292
299
|
break;
|
|
293
|
-
default:
|
|
300
|
+
default: {
|
|
294
301
|
// page handler
|
|
295
302
|
const handlerMatches = relativePath.match(/^handler\/([^/]*?).js$/);
|
|
296
303
|
if (handlerMatches) {
|
|
@@ -304,6 +311,7 @@ function codeToCals(codeList, version = 'v1') {
|
|
|
304
311
|
(_b = calsJSON.resources) === null || _b === void 0 ? void 0 : _b.push(Object.assign({ name, path: `${_pageId}/common/${name}`, codeType: types_1.ECodeType.NORMAL_MODULE }, commonVal));
|
|
305
312
|
}
|
|
306
313
|
break;
|
|
314
|
+
}
|
|
307
315
|
}
|
|
308
316
|
}
|
|
309
317
|
function isPageFile(filePath) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IPlatformApp } from '../../../types';
|
|
1
|
+
import { IPlatformApp, IPlatformSubApp } from '../../../types';
|
|
2
2
|
import { IDataBind } from '../../expression/index';
|
|
3
3
|
declare type IUsedComponentResources = {
|
|
4
4
|
[libName: string]: Set<string>;
|
|
@@ -8,7 +8,7 @@ export declare function isPlainObject(src: any): boolean;
|
|
|
8
8
|
export declare const isEmptyObj: (obj: object) => boolean;
|
|
9
9
|
export declare function isValidStyleBind(styleBind: IDataBind): boolean;
|
|
10
10
|
export declare function isValidClassNameListBind(classNameListBind: IDataBind): boolean;
|
|
11
|
-
export declare function getUsedComps(apps: IPlatformApp[], dependencies: any[], options?: {
|
|
11
|
+
export declare function getUsedComps(apps: (IPlatformApp | IPlatformSubApp)[], dependencies: any[], options?: {
|
|
12
12
|
withAction?: boolean;
|
|
13
13
|
/**
|
|
14
14
|
* templates 按需引入
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/parser/cals/utils/common.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,YAAY,EAAsB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/parser/cals/utils/common.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,YAAY,EAAE,eAAe,EAAsB,MAAM,gBAAgB,CAAC;AAEnG,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAsBnD,aAAK,uBAAuB,GAAG;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAOlE,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,cAAc,UAAQ,UAQ5D;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,WAErC;AAED,eAAO,MAAM,UAAU,QAAS,MAAM,YAUrC,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,SAAS,WAQpD;AAED,wBAAgB,wBAAwB,CAAC,iBAAiB,EAAE,SAAS,WAQpE;AAyJD,wBAAgB,YAAY,CAE1B,IAAI,EAAE,CAAC,YAAY,GAAG,eAAe,CAAC,EAAE,EAExC,YAAY,EAAE,GAAG,EAAE,EACnB,OAAO,CAAC,EAAE;IACR,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;CACrB,GACA,uBAAuB,GAAG;IAAE,SAAS,EAAE,uBAAuB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;CAAE,CA+EvG"}
|
|
@@ -197,7 +197,7 @@ apps,
|
|
|
197
197
|
// 分库后的组件库 denpendienicy
|
|
198
198
|
dependencies, options) {
|
|
199
199
|
const { streamline = false, withAction = false } = options || {};
|
|
200
|
-
const { templates = [] } = (apps === null || apps === void 0 ? void 0 : apps[0]) || {};
|
|
200
|
+
const { templates = [] } = ((apps === null || apps === void 0 ? void 0 : apps[0]) || {});
|
|
201
201
|
const comps = streamline && templates.length ? [...dependencies, (0, index_1.processTemplatesToDependiencies)(templates)] : dependencies;
|
|
202
202
|
// 1. 寻找应用内容里用到的所有组件
|
|
203
203
|
// 1.1 寻找主子应用各自的内容里所用到的组件
|
|
@@ -3,7 +3,6 @@ import { ICodeResource, IPlatformDataset } from './common';
|
|
|
3
3
|
import { IComplexComponent, IPageComponent } from './component';
|
|
4
4
|
import { IDataSourceVariable, IPlatformDataSource } from './datasource';
|
|
5
5
|
import { type ITheme } from './theme';
|
|
6
|
-
import { IEvents } from '../basic/component';
|
|
7
6
|
import { LCDS } from '../index';
|
|
8
7
|
export declare enum EExternalResourceType {
|
|
9
8
|
JSUrl = "jsUrl",
|
|
@@ -61,6 +60,13 @@ export interface IPlatformApp extends Omit<Basic.IApp, 'attributes' | 'events' |
|
|
|
61
60
|
/** 应用主题 */
|
|
62
61
|
theme?: ITheme;
|
|
63
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* 类型修改同步修改 parse 方法
|
|
65
|
+
* /src/parser/cals/index.ts
|
|
66
|
+
*/
|
|
67
|
+
export interface IPlatformSubApp extends Pick<IPlatformApp, 'schemaVersion' | 'id' | 'name' | 'description' | 'label' | 'main' | 'items'> {
|
|
68
|
+
extra?: IBasePlatformAppExtra & IBaseEditorPlatformAppExtra;
|
|
69
|
+
}
|
|
64
70
|
/**
|
|
65
71
|
* 格式和npm一样
|
|
66
72
|
* 格式:{ '@命名空间/组件库名称': <protocal>:<path>?v=<版本号> } 遵循URL规范
|
|
@@ -84,7 +90,11 @@ export interface IPlatformApp extends Omit<Basic.IApp, 'attributes' | 'events' |
|
|
|
84
90
|
export declare type IDependencies = {
|
|
85
91
|
[key: string]: string;
|
|
86
92
|
};
|
|
87
|
-
|
|
93
|
+
/**
|
|
94
|
+
* 新增持久化数据必须同步修改
|
|
95
|
+
* src/parser/cals/utils/code/index.ts
|
|
96
|
+
*/
|
|
97
|
+
export interface IPlatformAppExtra extends IEditorPlatformAppExtra, IBasePlatformAppExtra {
|
|
88
98
|
/**
|
|
89
99
|
* 应用统一路由模式
|
|
90
100
|
*/
|
|
@@ -96,14 +106,12 @@ export interface IPlatformAppExtra {
|
|
|
96
106
|
[key: string]: string;
|
|
97
107
|
};
|
|
98
108
|
/**
|
|
109
|
+
* @deprecated
|
|
99
110
|
* 预设色彩值
|
|
100
111
|
*/
|
|
101
112
|
presetColors?: string[];
|
|
102
113
|
/**
|
|
103
|
-
*
|
|
104
|
-
*/
|
|
105
|
-
maxID?: number;
|
|
106
|
-
/**
|
|
114
|
+
* @deprecated
|
|
107
115
|
* 小程序插件
|
|
108
116
|
*/
|
|
109
117
|
plugins?: {
|
|
@@ -114,10 +122,7 @@ export interface IPlatformAppExtra {
|
|
|
114
122
|
version: string;
|
|
115
123
|
}[];
|
|
116
124
|
/**
|
|
117
|
-
*
|
|
118
|
-
*/
|
|
119
|
-
rootPath?: string | null;
|
|
120
|
-
/**
|
|
125
|
+
* @deprecated
|
|
121
126
|
* 主题定义
|
|
122
127
|
*/
|
|
123
128
|
themeVars?: {
|
|
@@ -142,23 +147,6 @@ export interface IPlatformAppExtra {
|
|
|
142
147
|
* 当前页面静态资源域名(html、图片等静态资源)
|
|
143
148
|
*/
|
|
144
149
|
domain?: string;
|
|
145
|
-
/**
|
|
146
|
-
* 隐藏插槽配置
|
|
147
|
-
*/
|
|
148
|
-
compHiddenConfig?: {
|
|
149
|
-
[pageId: string]: string[];
|
|
150
|
-
};
|
|
151
|
-
/**
|
|
152
|
-
* 基准历史ID
|
|
153
|
-
*/
|
|
154
|
-
originHistoryId?: string;
|
|
155
|
-
/**
|
|
156
|
-
* 组件库上个版本信息。格式为:
|
|
157
|
-
* { @tcwd/CLOUDBASE_BUSSINESS: "weda:components?v=1.22.3&updateTime=1662369434696", @tcwd/CLOUDBASE_STANDARD: "weda:components?v=1.4.2&updateTime=1662369434696"}
|
|
158
|
-
*/
|
|
159
|
-
lastDependencies?: {
|
|
160
|
-
[key: string]: string;
|
|
161
|
-
};
|
|
162
150
|
/**
|
|
163
151
|
* 是否开启默认loading
|
|
164
152
|
*/
|
|
@@ -175,24 +163,99 @@ export interface IPlatformAppExtra {
|
|
|
175
163
|
* 组件库目录独立子包
|
|
176
164
|
*/
|
|
177
165
|
enableAsyncMaterials?: boolean;
|
|
166
|
+
/**
|
|
167
|
+
* idaas 登录态区分标识
|
|
168
|
+
*/
|
|
169
|
+
clientId?: string;
|
|
170
|
+
/**
|
|
171
|
+
* 登录设置
|
|
172
|
+
*/
|
|
173
|
+
loginConfigVersion?: string;
|
|
174
|
+
/**
|
|
175
|
+
* 登录态共享
|
|
176
|
+
*/
|
|
177
|
+
enableLoginStatusShare?: boolean;
|
|
178
|
+
}
|
|
179
|
+
interface IBasePlatformAppExtra {
|
|
180
|
+
/**
|
|
181
|
+
* 小程序子包名 或 web 子页面路径
|
|
182
|
+
*/
|
|
183
|
+
rootPath?: string | null;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* 新增持久化数据必须同步修改
|
|
187
|
+
* src/parser/cals/utils/code/index.ts
|
|
188
|
+
*/
|
|
189
|
+
interface IEditorPlatformAppExtra extends IBaseEditorPlatformAppExtra {
|
|
190
|
+
/**
|
|
191
|
+
* 是否显示条件渲染
|
|
192
|
+
*/
|
|
193
|
+
conditionalRendering?: Boolean;
|
|
194
|
+
/**
|
|
195
|
+
* 组件库上个版本信息。格式为:
|
|
196
|
+
* { @tcwd/CLOUDBASE_BUSSINESS: "weda:components?v=1.22.3&updateTime=1662369434696", @tcwd/CLOUDBASE_STANDARD: "weda:components?v=1.4.2&updateTime=1662369434696"}
|
|
197
|
+
*/
|
|
198
|
+
lastDependencies?: {
|
|
199
|
+
[key: string]: string;
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* 流程页面
|
|
203
|
+
*/
|
|
204
|
+
processPages?: {
|
|
205
|
+
/**
|
|
206
|
+
* 页面id
|
|
207
|
+
*/
|
|
208
|
+
id: string;
|
|
209
|
+
label: string;
|
|
210
|
+
/**
|
|
211
|
+
* 审批结点id
|
|
212
|
+
*/
|
|
213
|
+
nodeId: string;
|
|
214
|
+
nodeName: string;
|
|
215
|
+
inputNode: string[];
|
|
216
|
+
outputNode: string[];
|
|
217
|
+
/**
|
|
218
|
+
* 流程id
|
|
219
|
+
*/
|
|
220
|
+
processKey: string;
|
|
221
|
+
processName: string;
|
|
222
|
+
}[];
|
|
178
223
|
}
|
|
179
|
-
|
|
224
|
+
/**
|
|
225
|
+
* 新增持久化数据必须同步修改
|
|
226
|
+
* src/parser/cals/utils/code/index.ts
|
|
227
|
+
*/
|
|
228
|
+
interface IBaseEditorPlatformAppExtra {
|
|
180
229
|
/**
|
|
181
|
-
*
|
|
230
|
+
* 基准历史ID
|
|
182
231
|
*/
|
|
183
|
-
|
|
232
|
+
originHistoryId?: string;
|
|
184
233
|
/**
|
|
185
|
-
*
|
|
234
|
+
* 应用页面分组
|
|
186
235
|
*/
|
|
187
|
-
|
|
236
|
+
pageTree?: {
|
|
237
|
+
id: string;
|
|
238
|
+
label: string;
|
|
239
|
+
type: 'page' | 'folder';
|
|
240
|
+
items?: any[];
|
|
241
|
+
}[];
|
|
242
|
+
/**
|
|
243
|
+
* @deprecated
|
|
244
|
+
* 大纲树alias数据补充
|
|
245
|
+
*/
|
|
246
|
+
componentPropsDatas?: any[];
|
|
188
247
|
/**
|
|
189
|
-
*
|
|
248
|
+
* 隐藏设计态显示组件
|
|
249
|
+
* @deprecated
|
|
190
250
|
*/
|
|
191
|
-
|
|
251
|
+
compHiddenConfig?: {
|
|
252
|
+
[pageId: string]: string[];
|
|
253
|
+
};
|
|
192
254
|
}
|
|
193
255
|
export interface IExternalResource {
|
|
194
256
|
type: EExternalResourceType;
|
|
195
257
|
url?: string;
|
|
196
258
|
code?: string;
|
|
197
259
|
}
|
|
260
|
+
export {};
|
|
198
261
|
//# sourceMappingURL=app.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/types/platform/app.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAuC,MAAM,UAAU,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACx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;KACrB,EAAE,CAAC;CACL;AAED;;;GAGG;AACH,UAAU,2BAA2B;IACnC;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;QAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAA;KAAE,EAAE,CAAC;IACnF;;;OAGG;IACH,mBAAmB,CAAC,EAAE,GAAG,EAAE,CAAC;IAC5B;;;OAGG;IACH,gBAAgB,CAAC,EAAE;QAAE,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;KAAE,CAAC;CACnD;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
|
package/lib/utils/dts/index.js
CHANGED
|
@@ -302,11 +302,12 @@ function _generateOneItemDTS(inputData, itemType) {
|
|
|
302
302
|
* 获取用于显示的数据类型(仅有 number, string , boolean, array, object 等内置基础类型)
|
|
303
303
|
*/
|
|
304
304
|
function getDisplayReturnType(typeStr) {
|
|
305
|
+
var _a, _b;
|
|
305
306
|
let displayType = typeStr.trim();
|
|
306
|
-
if (displayType.endsWith('[]')) {
|
|
307
|
+
if ((_a = displayType === null || displayType === void 0 ? void 0 : displayType.endsWith) === null || _a === void 0 ? void 0 : _a.call(displayType, '[]')) {
|
|
307
308
|
displayType = 'array';
|
|
308
309
|
}
|
|
309
|
-
else if (displayType.endsWith('}')) {
|
|
310
|
+
else if ((_b = displayType === null || displayType === void 0 ? void 0 : displayType.endsWith) === null || _b === void 0 ? void 0 : _b.call(displayType, '}')) {
|
|
310
311
|
displayType = 'object';
|
|
311
312
|
}
|
|
312
313
|
return displayType;
|