@cloudbase/cals 1.0.3-alpha.8 → 1.0.3-alpha.9
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 +379 -366
- package/lib/parser/cals/index.d.ts.map +1 -1
- package/lib/parser/cals/index.js +75 -13
- package/lib/parser/cals/utils/block/index.d.ts +14 -14
- package/lib/parser/cals/utils/block/index.d.ts.map +0 -0
- package/lib/parser/cals/utils/block/index.js +3 -3
- package/lib/parser/cals/utils/code/index.d.ts +30 -30
- package/lib/parser/cals/utils/code/index.d.ts.map +0 -0
- package/lib/parser/cals/utils/code/index.js +12 -13
- 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 -2
- 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 -3
- 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 +6 -3
- package/lib/parser/cals/utils/version/common.d.ts +4 -4
- package/lib/parser/cals/utils/version/common.d.ts.map +0 -0
- package/lib/parser/cals/utils/version/common.js +34 -11
- 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 +0 -0
- package/lib/parser/cals/utils/version/parses.js +37 -14
- 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 -2
- 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 +6 -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 -359
- 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 +3 -13
- 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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ACZ,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
|
@@ -11,8 +11,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
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
|
|
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");
|
|
16
16
|
const common_1 = require("../../types/platform/common");
|
|
17
17
|
const expression_1 = require("../expression");
|
|
18
18
|
const common_2 = require("./utils/common");
|
|
@@ -175,13 +175,13 @@ function serializeDynamicMapWithExtra({ ctx, map = {}, scope = 'page', streamlin
|
|
|
175
175
|
let originKey = processedKey;
|
|
176
176
|
if (matched) {
|
|
177
177
|
originKey = matched[1];
|
|
178
|
-
(0,
|
|
178
|
+
(0, lodash_1.unset)(data, originKey);
|
|
179
179
|
}
|
|
180
180
|
const originKeyArr = originKey.split('.');
|
|
181
|
-
if ((0,
|
|
181
|
+
if ((0, lodash_1.get)(data, processedKey) == undefined) {
|
|
182
182
|
/* 选区结构处理 [formily] to [CALS] */
|
|
183
183
|
if (Array.isArray(processedValue) && (processedValue === null || processedValue === void 0 ? void 0 : processedValue.some((item) => !!(item === null || item === void 0 ? void 0 : item.selectableBlock)))) {
|
|
184
|
-
let valueTmp = (0,
|
|
184
|
+
let valueTmp = (0, lodash_1.cloneDeep)(processedValue);
|
|
185
185
|
processedValue = valueTmp === null || valueTmp === void 0 ? void 0 : valueTmp.map((_value) => {
|
|
186
186
|
var _a, _b, _c;
|
|
187
187
|
const xProp = (_a = _value === null || _value === void 0 ? void 0 : _value.selectableBlock) === null || _a === void 0 ? void 0 : _a['x-props'];
|
|
@@ -198,10 +198,10 @@ function serializeDynamicMapWithExtra({ ctx, map = {}, scope = 'page', streamlin
|
|
|
198
198
|
}
|
|
199
199
|
// 为动态数据且有多级,将{":range.0.label": "$page.dataset.state.test1"}转为{ range: [{ label: "$page.dataset.state.test1"}] }
|
|
200
200
|
if (matched && originKeyArr.length >= 2) {
|
|
201
|
-
(0,
|
|
201
|
+
(0, lodash_1.set)(data, replaceWithColon(originKey), (0, lodash_1.cloneDeep)(processedValue));
|
|
202
202
|
}
|
|
203
203
|
else {
|
|
204
|
-
data[processedKey] = (0,
|
|
204
|
+
data[processedKey] = (0, lodash_1.cloneDeep)(processedValue);
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
extra[originKey] = processedExtra;
|
|
@@ -231,19 +231,19 @@ function replaceWithColon(key) {
|
|
|
231
231
|
function recoverSynamicMap(parent, current, path = '') {
|
|
232
232
|
Object.keys(current).forEach((key) => {
|
|
233
233
|
let value = current[key];
|
|
234
|
-
if ((0,
|
|
234
|
+
if ((0, lodash_1.isArray)(value)) {
|
|
235
235
|
// 注意如果是 selectableBlock 独立处理
|
|
236
236
|
if (value === null || value === void 0 ? void 0 : value.some((item) => !!(item === null || item === void 0 ? void 0 : item.selectableBlock))) {
|
|
237
237
|
return;
|
|
238
238
|
}
|
|
239
239
|
// 数组必须在前面
|
|
240
240
|
value.forEach((valueItem, valueIndex) => {
|
|
241
|
-
if ((0,
|
|
241
|
+
if ((0, lodash_1.isObject)(valueItem)) {
|
|
242
242
|
valueItem = recoverSynamicMap(parent, valueItem, `${path === '' ? '' : `${path}.`}${key}.${valueIndex}`);
|
|
243
243
|
}
|
|
244
244
|
});
|
|
245
245
|
}
|
|
246
|
-
else if ((0,
|
|
246
|
+
else if ((0, lodash_1.isObject)(value)) {
|
|
247
247
|
value = recoverSynamicMap(parent, value, `${path === '' ? '' : `${path}.`}${key}`);
|
|
248
248
|
}
|
|
249
249
|
else {
|
|
@@ -252,7 +252,7 @@ function recoverSynamicMap(parent, current, path = '') {
|
|
|
252
252
|
parent[`:${path === '' ? '' : `${path}.`}${matched[1]}`] = current[key];
|
|
253
253
|
if (current !== parent) {
|
|
254
254
|
// 如果是第一层级,说明current和parent相等,不unset
|
|
255
|
-
(0,
|
|
255
|
+
(0, lodash_1.unset)(current, key);
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
}
|
|
@@ -262,7 +262,7 @@ function recoverSynamicMap(parent, current, path = '') {
|
|
|
262
262
|
function deserializeDynamicMap(ctx, map, extraMap) {
|
|
263
263
|
var _a, _b;
|
|
264
264
|
let data = {};
|
|
265
|
-
const clonedMap = (0,
|
|
265
|
+
const clonedMap = (0, lodash_1.cloneDeep)(map);
|
|
266
266
|
// 还原flatten path
|
|
267
267
|
map = recoverSynamicMap(clonedMap, clonedMap, '');
|
|
268
268
|
for (let key in map || {}) {
|
|
@@ -1057,7 +1057,7 @@ function deserializeComponentLibraryMeta(meta) {
|
|
|
1057
1057
|
dependencies, components: processedComponents, actions });
|
|
1058
1058
|
}
|
|
1059
1059
|
exports.deserializeComponentLibraryMeta = deserializeComponentLibraryMeta;
|
|
1060
|
-
function processRuntimeCodeResources(ctx, resources = [], scope) {
|
|
1060
|
+
function processRuntimeCodeResources(ctx, resources /* : IWeappCode[]*/ = [], scope) {
|
|
1061
1061
|
const { id } = ctx;
|
|
1062
1062
|
const fileTypes = [common_1.ECodeType.STYLE, common_1.ECodeType.STATE, common_1.ECodeType.LIFECYCLE, common_1.ECodeType.COMPUTEDN];
|
|
1063
1063
|
const CODE_TYPE_NAME_MAP = {
|
|
@@ -1119,3 +1119,65 @@ function parseVersion(version = '', dependencies = []) {
|
|
|
1119
1119
|
return FEATURE_MAP;
|
|
1120
1120
|
}
|
|
1121
1121
|
exports.parseVersion = parseVersion;
|
|
1122
|
+
function processListeners(listeners, options) {
|
|
1123
|
+
const { strict = false } = options || {};
|
|
1124
|
+
const listenerEventNameMap = listeners.reduce((map, listener) => {
|
|
1125
|
+
const { eventName } = listener;
|
|
1126
|
+
if (!map[eventName]) {
|
|
1127
|
+
map[eventName] = [];
|
|
1128
|
+
}
|
|
1129
|
+
map[eventName].push(listener);
|
|
1130
|
+
return map;
|
|
1131
|
+
}, {});
|
|
1132
|
+
const flowListenerIdMap = {};
|
|
1133
|
+
const eventFlowMap = {};
|
|
1134
|
+
listeners.forEach((listener) => {
|
|
1135
|
+
const { id, eventName } = listener;
|
|
1136
|
+
if (flowListenerIdMap[id]) {
|
|
1137
|
+
return;
|
|
1138
|
+
}
|
|
1139
|
+
const [_, eventFlowId] = eventName.match(/(.*?)\.start/) || [];
|
|
1140
|
+
const evnetTree = [];
|
|
1141
|
+
let eventFlow = { id: '', listeners: [] };
|
|
1142
|
+
if (eventFlowId) {
|
|
1143
|
+
eventFlow.id = eventFlowId;
|
|
1144
|
+
if (listener.description) {
|
|
1145
|
+
eventFlow.description = listener.description;
|
|
1146
|
+
}
|
|
1147
|
+
if (listener.label) {
|
|
1148
|
+
eventFlow.label = listener.label;
|
|
1149
|
+
}
|
|
1150
|
+
eventFlowMap[eventFlowId] = eventFlow;
|
|
1151
|
+
evnetTree.push(eventName);
|
|
1152
|
+
}
|
|
1153
|
+
for (let eventName of evnetTree) {
|
|
1154
|
+
const list = listenerEventNameMap[eventName] || [];
|
|
1155
|
+
if (strict && list.length > 1) {
|
|
1156
|
+
throw new Error(`事件流 ${eventFlowId} 中 ${eventName} 事件存在并发调用`);
|
|
1157
|
+
}
|
|
1158
|
+
list.forEach((item) => {
|
|
1159
|
+
flowListenerIdMap[item.id] = eventFlowId;
|
|
1160
|
+
const successEventName = `${item.id}.success`;
|
|
1161
|
+
const failEventName = `${item.id}.fail`;
|
|
1162
|
+
if (listenerEventNameMap[successEventName]) {
|
|
1163
|
+
evnetTree.push(successEventName);
|
|
1164
|
+
}
|
|
1165
|
+
if (listenerEventNameMap[failEventName]) {
|
|
1166
|
+
evnetTree.push(failEventName);
|
|
1167
|
+
}
|
|
1168
|
+
});
|
|
1169
|
+
}
|
|
1170
|
+
});
|
|
1171
|
+
const rawListeners = [];
|
|
1172
|
+
listeners.forEach((listener) => {
|
|
1173
|
+
const flowId = flowListenerIdMap[listener.id];
|
|
1174
|
+
if (flowId && eventFlowMap[flowId]) {
|
|
1175
|
+
eventFlowMap[flowId].listeners.push(listener);
|
|
1176
|
+
}
|
|
1177
|
+
else {
|
|
1178
|
+
rawListeners.push(listener);
|
|
1179
|
+
}
|
|
1180
|
+
});
|
|
1181
|
+
return { listeners: rawListeners, eventFlows: Object.values(eventFlowMap) };
|
|
1182
|
+
}
|
|
1183
|
+
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
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseComponentCals = void 0;
|
|
4
|
-
const
|
|
4
|
+
const lodash_1 = require("lodash");
|
|
5
5
|
const expression_1 = require("../../../expression");
|
|
6
6
|
function parseComponentCals(ctx, cals) {
|
|
7
7
|
if (!ctx.datasetMap) {
|
|
@@ -23,8 +23,8 @@ function parseComponentCals(ctx, cals) {
|
|
|
23
23
|
id: cals.id || '',
|
|
24
24
|
};
|
|
25
25
|
const { component, module, attributes = {}, items = [], listeners = [], directives = {}, [':class']: dynamicClassList, [':style']: dynamicStyle, } = cals;
|
|
26
|
-
if (module && component && !(0,
|
|
27
|
-
(0,
|
|
26
|
+
if (module && component && !(0, lodash_1.get)(ctx.componentMap, `${module}.${component}`)) {
|
|
27
|
+
(0, lodash_1.set)(ctx.componentMap, `${module}.${component}`, true);
|
|
28
28
|
ctx.componentLibMap[module] = true;
|
|
29
29
|
}
|
|
30
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
|
|
File without changes
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.autoResolveConflicts = exports.checkForConflicts = exports.codeToCals = exports.calsToCode = void 0;
|
|
8
8
|
const types_1 = require("../../../../types");
|
|
9
|
-
const
|
|
9
|
+
const lodash_1 = require("lodash");
|
|
10
10
|
/**
|
|
11
11
|
* CALS 转成 中间状态的代码
|
|
12
12
|
*
|
|
@@ -115,10 +115,10 @@ function calsToCode(calsJSON, version = 'v1') {
|
|
|
115
115
|
}
|
|
116
116
|
function genConfig(itemJSON, configFields, configPath, otherConfigFields) {
|
|
117
117
|
var _a;
|
|
118
|
-
const config = (0,
|
|
118
|
+
const config = (0, lodash_1.pick)(itemJSON, configFields);
|
|
119
119
|
if (otherConfigFields) {
|
|
120
120
|
Object.keys(otherConfigFields).forEach((key) => {
|
|
121
|
-
config[key] = (0,
|
|
121
|
+
config[key] = (0, lodash_1.pick)(config[key], otherConfigFields[key]);
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
124
|
// state, computed 类型以及名称为 ____index____ 的都不生成代码
|
|
@@ -200,7 +200,7 @@ function codeToCals(codeList, version = 'v1') {
|
|
|
200
200
|
resources: [],
|
|
201
201
|
};
|
|
202
202
|
const appConfigCodeItem = codeList.find((item) => item.path === 'src/app-config.json');
|
|
203
|
-
const appConfig = JSON.parse(
|
|
203
|
+
const appConfig = JSON.parse(appConfigCodeItem.code);
|
|
204
204
|
let pagePaths = appConfig.extra.pages;
|
|
205
205
|
codeList.forEach((codeItem) => {
|
|
206
206
|
if (codeItem.path === 'src/app-config.json') {
|
|
@@ -208,14 +208,14 @@ function codeToCals(codeList, version = 'v1') {
|
|
|
208
208
|
* app-config.json
|
|
209
209
|
*/
|
|
210
210
|
const config = appConfig;
|
|
211
|
-
Object.assign(calsJSON, (0,
|
|
212
|
-
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);
|
|
213
213
|
}
|
|
214
214
|
else if (isPageFile(codeItem.path)) {
|
|
215
215
|
/**
|
|
216
216
|
* page
|
|
217
217
|
*/
|
|
218
|
-
const [, pageId] = codeItem.path.match(versionConfig.pageIdRegExp)
|
|
218
|
+
const [, pageId] = codeItem.path.match(versionConfig.pageIdRegExp);
|
|
219
219
|
let pageItem = calsJSON.items.find((item) => item.id === pageId);
|
|
220
220
|
if (!pageItem) {
|
|
221
221
|
pageItem = {
|
|
@@ -233,9 +233,9 @@ function codeToCals(codeList, version = 'v1') {
|
|
|
233
233
|
* page-config.json
|
|
234
234
|
*/
|
|
235
235
|
const config = JSON.parse(codeItem.code);
|
|
236
|
-
const propsConfig = (0,
|
|
236
|
+
const propsConfig = (0, lodash_1.omit)(config, ['_ignoreResources']);
|
|
237
237
|
Object.assign(pageItem, propsConfig);
|
|
238
|
-
pageItem.resources = (0,
|
|
238
|
+
pageItem.resources = (0, lodash_1.concat)(pageItem.resources, config._ignoreResources);
|
|
239
239
|
}
|
|
240
240
|
else if (versionConfig.pageJSONRegExp.test(codeItem.path)) {
|
|
241
241
|
/**
|
|
@@ -254,12 +254,11 @@ function codeToCals(codeList, version = 'v1') {
|
|
|
254
254
|
/**
|
|
255
255
|
* global normal codes
|
|
256
256
|
*/
|
|
257
|
-
handleNormalCodes(codeItem, '', calsJSON.resources
|
|
257
|
+
handleNormalCodes(codeItem, '', calsJSON.resources);
|
|
258
258
|
}
|
|
259
259
|
});
|
|
260
260
|
return calsJSON;
|
|
261
261
|
function handleNormalCodes(codeItem, pageId, resources) {
|
|
262
|
-
var _a, _b;
|
|
263
262
|
const relativePath = !pageId
|
|
264
263
|
? codeItem.path.replace('src/', '')
|
|
265
264
|
: codeItem.path.replace(`${versionConfig.pageDir}/${pageId}/`, '');
|
|
@@ -275,7 +274,7 @@ function codeToCals(codeList, version = 'v1') {
|
|
|
275
274
|
*/
|
|
276
275
|
switch (relativePath) {
|
|
277
276
|
case 'theme.less':
|
|
278
|
-
|
|
277
|
+
calsJSON.resources.push(Object.assign({ name: types_1.ECodeType.THEME, path: `${_pageId}/${types_1.ECodeType.THEME}`, codeType: types_1.ECodeType.THEME }, commonVal));
|
|
279
278
|
break;
|
|
280
279
|
case 'style.less':
|
|
281
280
|
resources.push(Object.assign({ name: types_1.ECodeType.STYLE, path: `${_pageId}/${types_1.ECodeType.STYLE}`, codeType: types_1.ECodeType.STYLE }, commonVal));
|
|
@@ -294,7 +293,7 @@ function codeToCals(codeList, version = 'v1') {
|
|
|
294
293
|
const commonMatches = relativePath.match(/^common\/([^/]*?).js$/);
|
|
295
294
|
if (commonMatches) {
|
|
296
295
|
const [, name] = commonMatches;
|
|
297
|
-
|
|
296
|
+
calsJSON.resources.push(Object.assign({ name, path: `${_pageId}/common/${name}`, codeType: types_1.ECodeType.NORMAL_MODULE }, commonVal));
|
|
298
297
|
}
|
|
299
298
|
break;
|
|
300
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"}
|
|
@@ -4,7 +4,7 @@ exports.getValidValue = exports.setValidValue = exports.writeDynamicData = expor
|
|
|
4
4
|
const expression_1 = require("../../expression");
|
|
5
5
|
const style_1 = require("./style");
|
|
6
6
|
const common_1 = require("./common");
|
|
7
|
-
const
|
|
7
|
+
const lodash_1 = require("lodash");
|
|
8
8
|
function readComponents(properties = {}, excludeKeys = []) {
|
|
9
9
|
var _a;
|
|
10
10
|
const cmps /* IWeAppPage['componentInstances'] */ = {};
|
|
@@ -173,7 +173,7 @@ function writeListeners(listeners = []) {
|
|
|
173
173
|
exports.writeListeners = writeListeners;
|
|
174
174
|
// 处理Listeners动态数据
|
|
175
175
|
function writeDynamicData(from = {}, to, properties) {
|
|
176
|
-
const act = (0,
|
|
176
|
+
const act = (0, lodash_1.cloneDeep)(to);
|
|
177
177
|
act.dataTypes = to.dataTypes || [];
|
|
178
178
|
for (const prop in from) {
|
|
179
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
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { Properties } from 'csstype';
|
|
2
|
-
export declare function removeInvalidStyleFormValue(styleForm?: any): any;
|
|
3
|
-
/**
|
|
4
|
-
* Convert WeApps common style to css styles(React.CSSProperties)
|
|
5
|
-
* toRem/toRpx/toRpx 三者互斥 @deprecated
|
|
6
|
-
* 应使用 defaultUnit 来声明
|
|
7
|
-
*/
|
|
8
|
-
export declare function processCommonStyle2CSSProperties(commonStyle?: any, options?: {
|
|
9
|
-
/**
|
|
10
|
-
* 默认 px/无单位 转 rem
|
|
11
|
-
* @deprecated
|
|
12
|
-
*/
|
|
13
|
-
toRem?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* 默认 px/无单位 转为rpx
|
|
16
|
-
* @deprecated
|
|
17
|
-
*/
|
|
18
|
-
toRpx?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* px/无单位情况下 处理为何单位
|
|
21
|
-
* rem | rpx | px
|
|
22
|
-
* 优先级高于以上
|
|
23
|
-
*/
|
|
24
|
-
defaultUnit?: 'rem' | 'px' | 'rpx';
|
|
25
|
-
/**
|
|
26
|
-
* 是否使用 calc(xx px / `${rpxCalcRoot}`) 来模拟rpx
|
|
27
|
-
* 小程序不需要转
|
|
28
|
-
*/
|
|
29
|
-
rpxCalcRoot?: string;
|
|
30
|
-
ignoreSelf?: boolean;
|
|
31
|
-
addPXUnit?: boolean;
|
|
32
|
-
}): Properties<string | number>;
|
|
33
|
-
interface ITranslateStyleOptions {
|
|
34
|
-
looseError?: boolean;
|
|
35
|
-
rpxCalcRoot?: string;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* @deprecated
|
|
39
|
-
*/
|
|
40
|
-
export declare function processCSSProperties2Rem(style?: Properties<string | number>, options?: ITranslateStyleOptions): Properties<string | number>;
|
|
41
|
-
export declare function processCSSPropertiesUnit(style: Properties<string | number
|
|
42
|
-
export {};
|
|
1
|
+
import { Properties } from 'csstype';
|
|
2
|
+
export declare function removeInvalidStyleFormValue(styleForm?: any): any;
|
|
3
|
+
/**
|
|
4
|
+
* Convert WeApps common style to css styles(React.CSSProperties)
|
|
5
|
+
* toRem/toRpx/toRpx 三者互斥 @deprecated
|
|
6
|
+
* 应使用 defaultUnit 来声明
|
|
7
|
+
*/
|
|
8
|
+
export declare function processCommonStyle2CSSProperties(commonStyle?: any, options?: {
|
|
9
|
+
/**
|
|
10
|
+
* 默认 px/无单位 转 rem
|
|
11
|
+
* @deprecated
|
|
12
|
+
*/
|
|
13
|
+
toRem?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* 默认 px/无单位 转为rpx
|
|
16
|
+
* @deprecated
|
|
17
|
+
*/
|
|
18
|
+
toRpx?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* px/无单位情况下 处理为何单位
|
|
21
|
+
* rem | rpx | px
|
|
22
|
+
* 优先级高于以上
|
|
23
|
+
*/
|
|
24
|
+
defaultUnit?: 'rem' | 'px' | 'rpx';
|
|
25
|
+
/**
|
|
26
|
+
* 是否使用 calc(xx px / `${rpxCalcRoot}`) 来模拟rpx
|
|
27
|
+
* 小程序不需要转
|
|
28
|
+
*/
|
|
29
|
+
rpxCalcRoot?: string;
|
|
30
|
+
ignoreSelf?: boolean;
|
|
31
|
+
addPXUnit?: boolean;
|
|
32
|
+
}): Properties<string | number>;
|
|
33
|
+
interface ITranslateStyleOptions {
|
|
34
|
+
looseError?: boolean;
|
|
35
|
+
rpxCalcRoot?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated
|
|
39
|
+
*/
|
|
40
|
+
export declare function processCSSProperties2Rem(style?: Properties<string | number>, options?: ITranslateStyleOptions): Properties<string | number>;
|
|
41
|
+
export declare function processCSSPropertiesUnit(style: Properties<string | number>, type: 'px' | 'rem' | 'rpx', options?: ITranslateStyleOptions): {};
|
|
42
|
+
export {};
|
|
43
43
|
//# sourceMappingURL=style.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../../src/parser/cals/utils/style.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAIrC,wBAAgB,2BAA2B,CAAC,SAAS,GAAE,GAA2B,GAAG,GAAG,CAUvF;AA4JD;;;;GAIG;AACH,wBAAgB,gCAAgC,CAC9C,WAAW,GAAE,GAAQ,EACrB,OAAO,GAAE;IACP;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,WAAW,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,KAAK,CAAC;IACnC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;CACwE,GAC7F,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,CAkS7B;AACD,UAAU,sBAAsB;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AACD;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,GAAE,UAAU,CAAC,MAAM,GAAG,MAAM,CAAM,EACvC,OAAO,CAAC,EAAE,sBAAsB,GAC/B,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,CAE7B;AACD,wBAAgB,wBAAwB,CACtC,KAAK,
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../../src/parser/cals/utils/style.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAIrC,wBAAgB,2BAA2B,CAAC,SAAS,GAAE,GAA2B,GAAG,GAAG,CAUvF;AA4JD;;;;GAIG;AACH,wBAAgB,gCAAgC,CAC9C,WAAW,GAAE,GAAQ,EACrB,OAAO,GAAE;IACP;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,WAAW,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,KAAK,CAAC;IACnC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;CACwE,GAC7F,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,CAkS7B;AACD,UAAU,sBAAsB;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AACD;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,GAAE,UAAU,CAAC,MAAM,GAAG,MAAM,CAAM,EACvC,OAAO,CAAC,EAAE,sBAAsB,GAC/B,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,CAE7B;AACD,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,UAAU,CAAC,MAAM,GAAG,MAAM,CAAM,EACvC,IAAI,EAAE,IAAI,GAAG,KAAK,GAAG,KAAK,EAC1B,OAAO,CAAC,EAAE,sBAAsB,MAajC"}
|
|
@@ -13,7 +13,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.processCSSPropertiesUnit = exports.processCSSProperties2Rem = exports.processCommonStyle2CSSProperties = exports.removeInvalidStyleFormValue = void 0;
|
|
15
15
|
const common_1 = require("./common");
|
|
16
|
-
const
|
|
16
|
+
const lodash_1 = require("lodash");
|
|
17
17
|
const utils_1 = require("../../../utils");
|
|
18
18
|
const DISTANCE_KEY_LIST = ['top', 'right', 'bottom', 'left'];
|
|
19
19
|
function removeInvalidStyleFormValue(styleForm = {}) {
|
|
@@ -64,7 +64,7 @@ function _handleStyleNumValue(styleVal, addPXUnit) {
|
|
|
64
64
|
function setDistanceStyle(style, distance, attr, addPXUnit) {
|
|
65
65
|
const attributeKey = (0, common_1.camelcase)(`${attr}`);
|
|
66
66
|
if (Object.keys(distance).length === 4) {
|
|
67
|
-
if ((0,
|
|
67
|
+
if ((0, lodash_1.uniq)((0, lodash_1.map)(distance, (val) => val)).length === 1) {
|
|
68
68
|
// 4个值全相等的情况
|
|
69
69
|
setStyleValue(style, attributeKey, _handleStyleNumValue(distance.top, addPXUnit));
|
|
70
70
|
}
|
|
@@ -280,7 +280,7 @@ function processCommonStyle2CSSProperties(commonStyle = {}, options = { toRem: t
|
|
|
280
280
|
bottomLeft = '0';
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
|
-
if ((0,
|
|
283
|
+
if ((0, lodash_1.uniq)((0, lodash_1.map)(radiusInfo, (val) => val)).length === 1) {
|
|
284
284
|
// 4个值全相等的情况
|
|
285
285
|
setStyleValue(style, 'borderRadius', _handleStyleNumValue(topLeft, !!options.addPXUnit));
|
|
286
286
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ECodeType } from '../../../types';
|
|
2
|
-
export declare function generateDefaultCode(ctx: {
|
|
3
|
-
id: string;
|
|
4
|
-
version?: string;
|
|
5
|
-
}, type: ECodeType, scope: 'component' | 'page' | 'app'): string;
|
|
1
|
+
import { ECodeType } from '../../../types';
|
|
2
|
+
export declare function generateDefaultCode(ctx: {
|
|
3
|
+
id: string;
|
|
4
|
+
version?: string;
|
|
5
|
+
}, type: ECodeType, scope: 'component' | 'page' | 'app'): string;
|
|
6
6
|
//# sourceMappingURL=template.d.ts.map
|