@cloudbase/cals 0.5.17 → 0.5.18-beta.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 +0 -0
- package/lib/parser/cals/index.d.ts.map +0 -0
- package/lib/parser/cals/index.js +0 -0
- package/lib/parser/cals/utils/block/index.d.ts +0 -0
- package/lib/parser/cals/utils/block/index.d.ts.map +0 -0
- package/lib/parser/cals/utils/block/index.js +0 -0
- package/lib/parser/cals/utils/code/index.d.ts +0 -0
- package/lib/parser/cals/utils/code/index.d.ts.map +0 -0
- package/lib/parser/cals/utils/code/index.js +0 -0
- package/lib/parser/cals/utils/common.d.ts +0 -0
- 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 +0 -0
- package/lib/parser/cals/utils/runtime.d.ts.map +0 -0
- package/lib/parser/cals/utils/runtime.js +0 -0
- package/lib/parser/cals/utils/spinoff/index.d.ts +0 -0
- 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 +0 -0
- package/lib/parser/cals/utils/style.d.ts.map +0 -0
- package/lib/parser/cals/utils/style.js +0 -0
- package/lib/parser/cals/utils/template.d.ts +0 -0
- package/lib/parser/cals/utils/template.d.ts.map +1 -1
- package/lib/parser/cals/utils/template.js +1 -2
- package/lib/parser/cals/utils/version/common.d.ts +0 -8
- package/lib/parser/cals/utils/version/common.d.ts.map +1 -1
- package/lib/parser/cals/utils/version/common.js +2 -57
- package/lib/parser/cals/utils/version/config.d.ts +0 -0
- 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 +0 -0
- package/lib/parser/cals/utils/version/index.d.ts.map +0 -0
- package/lib/parser/cals/utils/version/index.js +1 -1
- package/lib/parser/cals/utils/version/parses.d.ts +0 -0
- package/lib/parser/cals/utils/version/parses.d.ts.map +0 -0
- package/lib/parser/cals/utils/version/parses.js +0 -0
- package/lib/parser/cals/utils/version/utils.d.ts +0 -0
- package/lib/parser/cals/utils/version/utils.d.ts.map +0 -0
- package/lib/parser/cals/utils/version/utils.js +0 -0
- package/lib/parser/expression/index.d.ts +0 -0
- package/lib/parser/expression/index.d.ts.map +0 -0
- package/lib/parser/expression/index.js +0 -0
- package/lib/parser/index.d.ts +0 -0
- package/lib/parser/index.d.ts.map +0 -0
- package/lib/parser/index.js +0 -0
- package/lib/types/basic/app.d.ts +0 -0
- 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 +1 -0
- 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 +0 -0
- package/lib/types/basic/component.d.ts.map +0 -0
- package/lib/types/basic/component.js +0 -0
- package/lib/types/basic/datasource.d.ts +0 -0
- package/lib/types/basic/datasource.d.ts.map +0 -0
- package/lib/types/basic/datasource.js +0 -0
- package/lib/types/index.d.ts +0 -0
- package/lib/types/index.d.ts.map +0 -0
- package/lib/types/index.js +0 -0
- package/lib/types/lcds.d.ts +0 -0
- package/lib/types/lcds.d.ts.map +0 -0
- package/lib/types/lcds.js +0 -0
- package/lib/types/platform/app.d.ts +0 -0
- 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 +0 -0
- package/lib/types/platform/common.d.ts.map +0 -0
- package/lib/types/platform/common.js +0 -0
- package/lib/types/platform/component.d.ts +0 -0
- package/lib/types/platform/component.d.ts.map +0 -0
- package/lib/types/platform/component.js +0 -0
- package/lib/types/platform/datasource.d.ts +0 -0
- package/lib/types/platform/datasource.d.ts.map +0 -0
- package/lib/types/platform/datasource.js +0 -0
- package/lib/types/platform/widget/form.d.ts +0 -0
- 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 +0 -0
- 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 +0 -0
- package/lib/utils/CSSProperty.d.ts.map +0 -0
- package/lib/utils/CSSProperty.js +0 -0
- package/lib/utils/build.d.ts +0 -0
- package/lib/utils/build.d.ts.map +0 -0
- package/lib/utils/build.js +0 -0
- package/lib/utils/constant.d.ts +0 -0
- 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 +9 -9
- package/lib/utils/dts/build.js +1 -1
- package/lib/utils/index.d.ts +0 -0
- package/lib/utils/index.d.ts.map +0 -0
- package/lib/utils/index.js +0 -0
- package/package.json +1 -1
- package/lib/parser/constants.d.ts +0 -2
- package/lib/parser/constants.d.ts.map +0 -1
- package/lib/parser/constants.js +0 -4
- package/lib/utils/version-migrations/common.d.ts +0 -5
- package/lib/utils/version-migrations/common.d.ts.map +0 -1
- package/lib/utils/version-migrations/common.js +0 -29
- package/lib/utils/version-migrations/version4.d.ts +0 -3
- package/lib/utils/version-migrations/version4.d.ts.map +0 -1
- package/lib/utils/version-migrations/version4.js +0 -199
|
File without changes
|
|
File without changes
|
package/lib/parser/cals/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../../../src/parser/cals/utils/template.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../../../src/parser/cals/utils/template.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAoM3C,wBAAgB,mBAAmB,CACjC,GAAG,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,EACrC,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,WAAW,GAAG,MAAM,GAAG,KAAK,UA6BpC"}
|
|
@@ -123,8 +123,7 @@ export default {
|
|
|
123
123
|
/**
|
|
124
124
|
* @param {Object} event - 事件对象.
|
|
125
125
|
* @param {string} event.name - 事件名.
|
|
126
|
-
* @param {
|
|
127
|
-
* @param {string} event.currentTarget - 当前处理该事件的节点。包括冒泡和捕获事件。.
|
|
126
|
+
* @param {any} event.detail - 事件携带自定义数据
|
|
128
127
|
*
|
|
129
128
|
* @param {Object} data
|
|
130
129
|
* @param {any} data.target - 获取事件传参的数据
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
export declare function beforeCommonParse(comp: any): void;
|
|
2
2
|
export declare function afterCommonParse(comp: any): void;
|
|
3
|
-
export declare function translateSlot(comp: any): void;
|
|
4
|
-
export declare function translateListeners(comp: any): void;
|
|
5
|
-
export declare function translateComponentModuleName(comp: any): void;
|
|
6
|
-
export declare function translateComponent(comp: any): void;
|
|
7
|
-
export declare function translateClassList(comp: any): void;
|
|
8
|
-
export declare function translateStyleBinding(comp: any): void;
|
|
9
|
-
export declare function translateStyleToCommonStyle(comp: any): void;
|
|
10
|
-
export declare function addDefaultXIndex(comp: any): void;
|
|
11
3
|
export declare function addFormItem(comp: any, key: any, parent: any, isOnlySlot?: boolean): void;
|
|
12
4
|
export declare function renameRepeatId(json: any): void;
|
|
13
5
|
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../src/parser/cals/utils/version/common.ts"],"names":[],"mappings":"AAcA,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,GAAG,QAE1C;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../src/parser/cals/utils/version/common.ts"],"names":[],"mappings":"AAcA,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,GAAG,QAE1C;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,GAAG,QAYzC;AA2LD,wBAAgB,WAAW,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,UAAQ,QAiJ/E;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,GAAG,QAsCvC"}
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.renameRepeatId = exports.addFormItem = exports.
|
|
26
|
+
exports.renameRepeatId = exports.addFormItem = exports.afterCommonParse = exports.beforeCommonParse = void 0;
|
|
27
27
|
const utils_1 = require("./utils");
|
|
28
28
|
const lodash_1 = __importStar(require("lodash"));
|
|
29
29
|
const index_1 = require("./index");
|
|
@@ -40,7 +40,6 @@ function afterCommonParse(comp) {
|
|
|
40
40
|
translateListeners(comp);
|
|
41
41
|
translateStyleToCommonStyle(comp);
|
|
42
42
|
translateSlot(comp);
|
|
43
|
-
// translateComponent(comp)
|
|
44
43
|
}
|
|
45
44
|
exports.afterCommonParse = afterCommonParse;
|
|
46
45
|
// 复合组件 slot 属性配置迁移,从 xProps.data.content.value 里取
|
|
@@ -52,11 +51,10 @@ function translateSlot(comp) {
|
|
|
52
51
|
delete comp['xProps'].data.content;
|
|
53
52
|
}
|
|
54
53
|
}
|
|
55
|
-
exports.translateSlot = translateSlot;
|
|
56
54
|
function translateListeners(comp) {
|
|
57
55
|
const { xProps } = comp;
|
|
58
56
|
// 处理click 转 tap
|
|
59
|
-
if (xProps
|
|
57
|
+
if (xProps === null || xProps === void 0 ? void 0 : xProps.listeners) {
|
|
60
58
|
const { listeners = [] } = xProps;
|
|
61
59
|
listeners.forEach((listenerItem) => {
|
|
62
60
|
const { handler } = listenerItem;
|
|
@@ -69,7 +67,6 @@ function translateListeners(comp) {
|
|
|
69
67
|
});
|
|
70
68
|
}
|
|
71
69
|
}
|
|
72
|
-
exports.translateListeners = translateListeners;
|
|
73
70
|
function translateComponentModuleName(comp) {
|
|
74
71
|
const { xComponent } = comp;
|
|
75
72
|
if (xComponent) {
|
|
@@ -154,54 +151,6 @@ function translateComponentModuleName(comp) {
|
|
|
154
151
|
}
|
|
155
152
|
}
|
|
156
153
|
}
|
|
157
|
-
exports.translateComponentModuleName = translateComponentModuleName;
|
|
158
|
-
function translateComponent(comp) {
|
|
159
|
-
const { xComponent } = comp;
|
|
160
|
-
if (xComponent) {
|
|
161
|
-
if (xComponent.moduleName === utils_2.OFFICIAL_COMPONENT_LIB_NAME) {
|
|
162
|
-
switch (xComponent.name) {
|
|
163
|
-
case 'Button': {
|
|
164
|
-
// xComponent.moduleName = OFFICIAL_LIB_KEY
|
|
165
|
-
let xprops = comp.xProps;
|
|
166
|
-
if (xprops === null || xprops === void 0 ? void 0 : xprops.data) {
|
|
167
|
-
xprops.data.contentSlot = {
|
|
168
|
-
type: 'slot',
|
|
169
|
-
value: '',
|
|
170
|
-
};
|
|
171
|
-
comp.properties = {
|
|
172
|
-
contentSlot: {
|
|
173
|
-
properties: {
|
|
174
|
-
[(0, utils_1.getId)()]: {
|
|
175
|
-
xComponent: {
|
|
176
|
-
moduleName: utils_2.OFFICIAL_LIB_KEY,
|
|
177
|
-
name: 'Text',
|
|
178
|
-
},
|
|
179
|
-
xProps: {
|
|
180
|
-
data: {
|
|
181
|
-
text: xprops.data.text || {
|
|
182
|
-
value: '输入文本内容...',
|
|
183
|
-
},
|
|
184
|
-
decode: {
|
|
185
|
-
value: false,
|
|
186
|
-
},
|
|
187
|
-
selectable: {
|
|
188
|
-
value: false,
|
|
189
|
-
},
|
|
190
|
-
},
|
|
191
|
-
listeners: [],
|
|
192
|
-
},
|
|
193
|
-
xIndex: 0,
|
|
194
|
-
},
|
|
195
|
-
},
|
|
196
|
-
},
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
exports.translateComponent = translateComponent;
|
|
205
154
|
function translateClassList(comp) {
|
|
206
155
|
const { xProps } = comp;
|
|
207
156
|
if (!xProps) {
|
|
@@ -226,7 +175,6 @@ function translateClassList(comp) {
|
|
|
226
175
|
delete xProps.classNameListBind;
|
|
227
176
|
}
|
|
228
177
|
}
|
|
229
|
-
exports.translateClassList = translateClassList;
|
|
230
178
|
function translateStyleBinding(comp) {
|
|
231
179
|
const { xProps } = comp;
|
|
232
180
|
if (!xProps) {
|
|
@@ -243,7 +191,6 @@ function translateStyleBinding(comp) {
|
|
|
243
191
|
}
|
|
244
192
|
}
|
|
245
193
|
}
|
|
246
|
-
exports.translateStyleBinding = translateStyleBinding;
|
|
247
194
|
function translateStyleToCommonStyle(comp) {
|
|
248
195
|
const { xProps } = comp;
|
|
249
196
|
if (xProps === null || xProps === void 0 ? void 0 : xProps.style) {
|
|
@@ -253,7 +200,6 @@ function translateStyleToCommonStyle(comp) {
|
|
|
253
200
|
delete xProps.style;
|
|
254
201
|
}
|
|
255
202
|
}
|
|
256
|
-
exports.translateStyleToCommonStyle = translateStyleToCommonStyle;
|
|
257
203
|
function addDefaultXIndex(comp) {
|
|
258
204
|
const { properties } = comp;
|
|
259
205
|
if (!properties) {
|
|
@@ -270,7 +216,6 @@ function addDefaultXIndex(comp) {
|
|
|
270
216
|
}
|
|
271
217
|
});
|
|
272
218
|
}
|
|
273
|
-
exports.addDefaultXIndex = addDefaultXIndex;
|
|
274
219
|
function addFormItem(comp, key, parent, isOnlySlot = false) {
|
|
275
220
|
const { properties, xIndex, xProps } = comp;
|
|
276
221
|
const defaultValue = lodash_1.default.get(xProps, 'data.defaultValue');
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -77,7 +77,7 @@ function deepParse(comp, key, parent) {
|
|
|
77
77
|
const { name } = xComponent;
|
|
78
78
|
(0, common_1.beforeCommonParse)(comp);
|
|
79
79
|
const parseFunction = CompParse[`parseGsdKbone${name}`];
|
|
80
|
-
parseFunction
|
|
80
|
+
parseFunction === null || parseFunction === void 0 ? void 0 : parseFunction(comp, key, parent);
|
|
81
81
|
(0, common_1.afterCommonParse)(comp);
|
|
82
82
|
}
|
|
83
83
|
else {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/parser/index.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/lib/parser/index.js
CHANGED
|
File without changes
|
package/lib/types/basic/app.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/lib/types/basic/app.js
CHANGED
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/types/basic/common.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAU,SAAQ,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IACpD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,CAAC,EAAE,QAAQ,CAAC;IAEnB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,SAAS;AACT,MAAM,WAAW,QAAQ;IACvB,SAAS;IACT,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG,GAAG,CAAC,CAAC;IAC7C,eAAe;IACf,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACzC
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/types/basic/common.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAU,SAAQ,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IACpD;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,CAAC,EAAE,QAAQ,CAAC;IAEnB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,SAAS;AACT,MAAM,WAAW,QAAQ;IACvB,SAAS;IACT,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG,GAAG,CAAC,CAAC;IAC7C,eAAe;IACf,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACzC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW;IACX,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU;IACV,YAAY,EAAE,GAAG,CAAC;CACnB;AAED,aAAa;AACb,MAAM,WAAW,eAAe;IAC9B,UAAU;IACV,KAAK,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4BAA4B;IAE5B,qBAAqB;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/types/index.d.ts
CHANGED
|
File without changes
|
package/lib/types/index.d.ts.map
CHANGED
|
File without changes
|
package/lib/types/index.js
CHANGED
|
File without changes
|
package/lib/types/lcds.d.ts
CHANGED
|
File without changes
|
package/lib/types/lcds.d.ts.map
CHANGED
|
File without changes
|
package/lib/types/lcds.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/utils/CSSProperty.js
CHANGED
|
File without changes
|
package/lib/utils/build.d.ts
CHANGED
|
File without changes
|
package/lib/utils/build.d.ts.map
CHANGED
|
File without changes
|
package/lib/utils/build.js
CHANGED
|
File without changes
|
package/lib/utils/constant.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/lib/utils/constant.js
CHANGED
|
File without changes
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const wedaDTS = "declare class UserWidget {\n // FIXME: \u6682\u65F6\u4E0D\u5BF9\u5916\u66B4\u9732\n // \u5185\u7F6E\u547D\u540D\u7A7A\u95F4\n // get sys(): {\n // readonly id: string;\n // readonly module: string;\n // readonly component: string;\n // readonly parent: UserWidget;\n // readonly children: UserWidget[];\n\n // closest(filter?: (parentWidget: UserWidget) => boolean): UserWidget | null;\n // };\n\n // FIXME: \u6682\u65F6\u4E0D\u5BF9\u5916\u66B4\u9732\n // \u81EA\u5B9A\u4E49\u547D\u540D\u7A7A\u95F4\n // get custom(): { [key: string]: any };\n\n // ========== \u5FEB\u6377\u8BBF\u95EE\u65B9\u5F0F ========== //\n\n /**\n * \u7EC4\u4EF6 id\n */\n readonly id: string;\n /**\n * \u7EC4\u4EF6\u5E93\u540D\u79F0\n */\n readonly module: string;\n /**\n * \u7EC4\u4EF6\u540D\u79F0\n */\n readonly component: string;\n // FIXME: \u6682\u65F6\u4E0D\u5BF9\u5916\u66B4\u9732\n // readonly parent: UserWidget;\n // readonly children: UserWidget[];\n\n // closest(filter?: (parentWidget: UserWidget) => boolean): UserWidget | null;\n}\n\n// Used Components Inner Begin\n// Used Components - Don't touch me\n// Used Components Inner End\n\ndeclare namespace $app {\n namespace dataset {\n const state: {\n // Global State Inner Begin\n // Global State \u5168\u5C40\u53D8\u91CF - Don't touch me\n // Global State Inner End\n };\n}\n\nnamespace common {\n // Global Common Inner Begin\n // Global Common \u5168\u5C40\u65B9\u6CD5 - Don't touch me\n // Global Common Inner End\n}\n\nfunction setState(data: Object): void;\n\n}\n\ndeclare const app = $app;\n\ndeclare namespace $w {\n const app = $app;\n\n const page = $page;\n\n namespace auth {\n interface CurrentUserInfo {\n userId?: string;\n phone?: string;\n type?: number;\n relatedRoles?: {\n id?: string;\n envId?: string;\n name?: string;\n roleIdentity?: string;\n }[];\n openId?: string;\n name?: string;\n nickName?: string;\n email?: string;\n mainOrg?: {\n id?: string;\n name?: string;\n };\n orgs?: {\n id?: string;\n name?: string;\n }[];\n}\nfunction getUserInfo(): CurrentUserInfo;\nconst currentUser: CurrentUserInfo;\n\n }\n\n namespace cloud {\n interface ICallDataSourceParams {\n dataSourceName: string;\n methodName: string;\n params: Object;\n}\ninterface ICallFunctionParams {\n name: string;\n data?: any;\n}\ninterface IParseOptions {\n unwrapResult?: boolean;\n parseBusinessInfo?: boolean;\n}\ninterface ICallWorkflowParams {\n action: string;\n data?: Record<string, any>;\n capitalizeDataKey?: boolean;\n}\n\nfunction callDataSource(params: ICallDataSourceParams): any;\nfunction getTempFileURL(params: string | string[]): Promise<string | string[]>;\nfunction callWorkflow(action: ICallWorkflowParams): Promise<any>;\nfunction callFunction(params: ICallFunctionParams, parseOptions?: IParseOptions): Promise<any>;\nfunction getCloudInstance(): Promise<CloudInstance>;\n\n }\n\n // $w.utils\n namespace utils {\n interface navigatorOptions {\n packageName: string;\n pageId: string;\n data?: Record<string, any>;\n params?: Record<string, any>;\n events?: Record<string, (data: any) => void>;\n success(res: any);\n fail(res: any);\n complete(res: any);\n}\n\ninterface navigateBackOptions {\n delta: number;\n}\n\n// \u663E\u793A\u63D0\u793A\nfunction showToast(options);\n\n// \u663E\u793A loading \u63D0\u793A\nfunction showLoading(options);\n\n// \u9690\u85CF loading \u63D0\u793A\nfunction hideLoading(options);\n\n// \u663E\u793A\u6A21\u6001\u63D0\u793A\nfunction showModal(options);\n\n// \u62E8\u6253\u7535\u8BDD\nfunction callPhone(options);\n\n// sacnCode\nfunction scanCode(options: {\n onlyFromCamera?: boolean;\n enableDefaultBehavior?: boolean;\n scanType?: ('barCode' | 'qrCode')[];\n success?: (res: { result: string; scanType: string }) => void;\n fail?: (err: Error) => void;\n complete?: () => void;\n}): Promise<ScanCodeResult> | ScanCodeResult;\n\n/** \u5FAE\u4FE1\u80FD\u529B */\n/**\n * \u6D88\u606F\u8BA2\u9605\n * @param options\n */\nfunction requestSubscribeMessage(options);\n/**\n * \u5730\u56FE\u5BFC\u822A\n * @param options\n */\nfunction openLocation(options);\n/**\n * \u9884\u7EA6\u89C6\u9891\u53F7\u76F4\u64AD\n * @param options\n */\nfunction reserveChannelsLive(options);\n/**\n * \u6253\u5F00\u89C6\u9891\u53F7\u4E3B\u9875\n * @param options\n */\nfunction openChannelsUserProfile(options);\n/**\n * \u6253\u5F00\u89C6\u9891\u53F7\u76F4\u64AD\n * @param options\n */\nfunction openChannelsLive(options);\n/**\n * \u6253\u5F00\u89C6\u9891\u53F7\u6D3B\u52A8\u9875\n * @param options\n */\nfunction openChannelsEvent(options);\n/**\n * \u6253\u5F00\u89C6\u9891\u53F7\u89C6\u9891\n * @param options\n */\nfunction openChannelsActivity(options);\n/**\n * \u83B7\u53D6\u89C6\u9891\u53F7\u76F4\u64AD\u9884\u544A\u4FE1\u606F\n * @param options\n */\nfunction getChannelsLiveNoticeInfo(options);\n/**\n * \u83B7\u53D6\u89C6\u9891\u53F7\u76F4\u64AD\u4FE1\u606F\n * @param options\n */\nfunction getChannelsLiveInfo(options);\n/**\n * \u521B\u5EFA\u6FC0\u52B1\u89C6\u9891\u5E7F\u544A\n * @param options\n */\nfunction createRewardedVideoAd(options);\n/**\n * \u521B\u5EFA\u63D2\u5C4F\u5E7F\u544A\n * @param options\n */\nfunction createInterstitialAd(options);\n\n// \u7279\u5236\u8DEF\u7531\nfunction navigateTo(options: navigatorOptions);\n\nfunction redirectTo(options: navigatorOptions);\n\nfunction reLaunch(options: navigatorOptions);\n\nfunction relaunchHome();\n\nfunction navigateBack(options: navigateBackOptions);\n\n }\n\n function ABS(num: number): number;\n function Min(...args: number[]): number;\n function Max(...args: number[]): number;\n function Average(...args: number[]): number;\n function Floor(num: number): number;\n function Ceiling(num: number): number;\n function Round(num: number): number;\n function Sum(...args: number[]): number;\n function Rand(num: number): number;\n\n interface IIfObjectParam {\ncondition: boolean;\nconsequent?: any;\nalternate?: any;\n interface IIfObjectParam {\ncondition: boolean;\nconsequent?: any;\nalternate?: any;\n}\n function If(params: IIfObjectParam): any;\n function If(condition: boolean, consequent?: any, alternate?: any): any;\n function IsEmpty(text: string | string[]): boolean;\n function NotNull(val: any): boolean;\n function And(...args: boolean[]): boolean;\n function Or(...args: boolean[]): boolean;\n}\n\n function Len(text: string): number;\n function Contains(text1: string, text2: string): boolean;\n function Split(text1: string, text2: string): string[];\n function Trim(text: string): string;\n function Upper(text: string): string;\n function Lower(text: string): string;\n function Concat(...text: string[]): string;\n\n function Now(): number;\n function Timestamp(arg: number | string | Date): number;\n function Second(arg: number | string | Date): number;\n function Minute(arg: number | string | Date): number;\n function Hour(arg: number | string | Date): number;\n function Day(arg: number | string | Date): number;\n function DayOfWeek(arg: number | string | Date): number;\n function Month(arg: number | string | Date): number;\n function Year(arg: number | string | Date): number;\n function GetDate(year: number, month: number, day: number): number;\n function DateTimeValue(arg: string, val: string): number;\n function Age(arg: number | string | Date, val: number | string | Date): number;\n function AgeOfNow(arg: number | string | Date): number;\n function DateAdd(arg: number | string | Date, day: number): number;\n function MonthAdd(arg: number | string | Date, month: number): number;\n function YearAdd(arg: number | string | Date, year: number): number;\n function DateDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function HourDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function MinuteDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function SecondDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function MonthDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function YearDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function DateText(createdTime: number | string | Date, text: string): string;\n function IsToday(date: number | string | Date): boolean;\n\n\n // used widgets Inner Begin\n // used widgets - Don't touch me\n // used widgets Inner End\n\n // repeater scope Inner Begin\n // repeater scope - Don't touch me\n // repeater scope Inner End\n}\n\n// Global For Begin\ndeclare const $for: {\n // Global For Inner Begin\n // For \u5FAA\u73AF\u53D8\u91CF - Don't touch me\n // Global For Inner End\n}\ndeclare const forItems = $for\n// Global For End\n\n// $page Begin\ndeclare namespace $page {\n const id: string;\n\nnamespace dataset {\n const state: {\n // Page State Inner Begin\n // Page State \u9875\u9762\u53D8\u91CF - Don't touch me\n // Page State Inner End\n };\n const params: {\n // Page Param Inner Begin\n // Page Param \u9875\u9762\u53C2\u6570 - Don't touch me\n // Page Param Inner End\n };\n}\nnamespace handler {\n // Page Handler Inner Begin\n // Page Handler \u9875\u9762\u65B9\u6CD5 - Don't touch me\n // Page Handler Inner End\n}\n\nfunction setState(userSetState: Record<string, any>): void;\n\n}\n// $page End\n\n// $comp Begin\ndeclare namespace $comp {\n\n namespace props {\n\n const data: {\n // Comp Prop Data Inner Begin\n // Comp Prop Data \u7EC4\u4EF6\u5C5E\u6027 - Don't touch me\n // Comp Prop Data Inner End\n }\n\n namespace events {\n // Comp Prop Events Inner Begin\n // Comp Prop Events \u7EC4\u4EF6\u4E8B\u4EF6 - Don't touch me\n // Comp Prop Events Inner End\n }\n\n }\n\n namespace dataset {\n\n const state: {\n // Comp State Inner Begin\n // Comp State \u7EC4\u4EF6\u53D8\u91CF - Don't touch me\n // Comp State Inner End\n }\n\n }\n\n namespace handler {\n // Comp Handler Inner Begin\n // Comp Handler \u7EC4\u4EF6\u65B9\u6CD5 - Don't touch me\n // Comp Handler Inner End\n }\n\n}\n// $comp End\n\n// Global Formula Begin\n\ndeclare function ABS(num: number): number;\ndeclare function Min(...args: number[]): number;\ndeclare function Max(...args: number[]): number;\ndeclare function Average(...args: number[]): number;\ndeclare function Floor(num: number): number;\ndeclare function Ceiling(num: number): number;\ndeclare function Round(num: number): number;\ndeclare function Sum(...args: number[]): number;\ndeclare function Rand(num: number): number;\n\ndeclare interface IIfObjectParam {\ncondition: boolean;\nconsequent?: any;\nalternate?: any;\ndeclare interface IIfObjectParam {\ncondition: boolean;\nconsequent?: any;\nalternate?: any;\n}\ndeclare function If(params: IIfObjectParam): any;\ndeclare function If(condition: boolean, consequent?: any, alternate?: any): any;\ndeclare function IsEmpty(text: string | string[]): boolean;\ndeclare function NotNull(val: any): boolean;\ndeclare function And(...args: boolean[]): boolean;\ndeclare function Or(...args: boolean[]): boolean;\n}\n\ndeclare function Len(text: string): number;\ndeclare function Contains(text1: string, text2: string): boolean;\ndeclare function Split(text1: string, text2: string): string[];\ndeclare function Trim(text: string): string;\ndeclare function Upper(text: string): string;\ndeclare function Lower(text: string): string;\ndeclare function Concat(...text: string[]): string;\n\ndeclare function Now(): number;\ndeclare function Timestamp(arg: number | string | Date): number;\ndeclare function Second(arg: number | string | Date): number;\ndeclare function Minute(arg: number | string | Date): number;\ndeclare function Hour(arg: number | string | Date): number;\ndeclare function Day(arg: number | string | Date): number;\ndeclare function DayOfWeek(arg: number | string | Date): number;\ndeclare function Month(arg: number | string | Date): number;\ndeclare function Year(arg: number | string | Date): number;\ndeclare function GetDate(year: number, month: number, day: number): number;\ndeclare function DateTimeValue(arg: string, val: string): number;\ndeclare function Age(arg: number | string | Date, val: number | string | Date): number;\ndeclare function AgeOfNow(arg: number | string | Date): number;\ndeclare function DateAdd(arg: number | string | Date, day: number): number;\ndeclare function MonthAdd(arg: number | string | Date, month: number): number;\ndeclare function YearAdd(arg: number | string | Date, year: number): number;\ndeclare function DateDiff(startDay: number | string | Date, endDay: number | string | Date): number;\ndeclare function HourDiff(startDay: number | string | Date, endDay: number | string | Date): number;\ndeclare function MinuteDiff(startDay: number | string | Date, endDay: number | string | Date): number;\ndeclare function SecondDiff(startDay: number | string | Date, endDay: number | string | Date): number;\ndeclare function MonthDiff(startDay: number | string | Date, endDay: number | string | Date): number;\ndeclare function YearDiff(startDay: number | string | Date, endDay: number | string | Date): number;\ndeclare function DateText(createdTime: number | string | Date, text: string): string;\ndeclare function IsToday(date: number | string | Date): boolean;\n\n\n// Global Formula End\n";
|
|
1
|
+
export declare const wedaDTS = "declare class UserWidget {\n // FIXME: \u6682\u65F6\u4E0D\u5BF9\u5916\u66B4\u9732\n // \u5185\u7F6E\u547D\u540D\u7A7A\u95F4\n // get sys(): {\n // readonly id: string;\n // readonly module: string;\n // readonly component: string;\n // readonly parent: UserWidget;\n // readonly children: UserWidget[];\n\n // closest(filter?: (parentWidget: UserWidget) => boolean): UserWidget | null;\n // };\n\n // FIXME: \u6682\u65F6\u4E0D\u5BF9\u5916\u66B4\u9732\n // \u81EA\u5B9A\u4E49\u547D\u540D\u7A7A\u95F4\n // get custom(): { [key: string]: any };\n\n // ========== \u5FEB\u6377\u8BBF\u95EE\u65B9\u5F0F ========== //\n\n /**\n * \u7EC4\u4EF6 id\n */\n readonly id: string;\n /**\n * \u7EC4\u4EF6\u5E93\u540D\u79F0\n */\n readonly module: string;\n /**\n * \u7EC4\u4EF6\u540D\u79F0\n */\n readonly component: string;\n // FIXME: \u6682\u65F6\u4E0D\u5BF9\u5916\u66B4\u9732\n // readonly parent: UserWidget;\n // readonly children: UserWidget[];\n\n // closest(filter?: (parentWidget: UserWidget) => boolean): UserWidget | null;\n}\n\n// Used Components Inner Begin\n// Used Components - Don't touch me\n// Used Components Inner End\n\ndeclare namespace $app {\n namespace dataset {\n const state: {\n // Global State Inner Begin\n // Global State \u5168\u5C40\u53D8\u91CF - Don't touch me\n // Global State Inner End\n };\n}\n\nnamespace common {\n // Global Common Inner Begin\n // Global Common \u5168\u5C40\u65B9\u6CD5 - Don't touch me\n // Global Common Inner End\n}\n\nfunction setState(data: Object): void;\n\n}\n\ndeclare const app = $app;\n\ndeclare namespace $w {\n const app = $app;\n\n const page = $page;\n\n namespace auth {\n interface CurrentUserInfo {\n userId?: string;\n phone?: string;\n type?: number;\n relatedRoles?: {\n id?: string;\n envId?: string;\n name?: string;\n roleIdentity?: string;\n }[];\n openId?: string;\n name?: string;\n nickName?: string;\n email?: string;\n mainOrg?: {\n id?: string;\n name?: string;\n };\n orgs?: {\n id?: string;\n name?: string;\n }[];\n}\nfunction getUserInfo(): CurrentUserInfo;\nconst currentUser: CurrentUserInfo;\n\n }\n\n namespace cloud {\n interface ICallDataSourceParams {\n dataSourceName: string;\n methodName: string;\n params: Object;\n}\ninterface ICallFunctionParams {\n name: string;\n data?: any;\n}\ninterface IParseOptions {\n unwrapResult?: boolean;\n parseBusinessInfo?: boolean;\n}\ninterface ICallWorkflowParams {\n action: string;\n data?: Record<string, any>;\n capitalizeDataKey?: boolean;\n}\n\nfunction callDataSource(params: ICallDataSourceParams): any;\nfunction getTempFileURL(params: string | string[]): Promise<string | string[]>;\nfunction callWorkflow(action: ICallWorkflowParams): Promise<any>;\nfunction callFunction(params: ICallFunctionParams, parseOptions?: IParseOptions): Promise<any>;\nfunction getCloudInstance(): Promise<CloudInstance>;\n\n }\n\n // $w.utils\n namespace utils {\n interface navigatorOptions {\n packageName: string;\n pageId: string;\n data?: Record<string, any>;\n params?: Record<string, any>;\n events?: Record<string, (data: any) => void>;\n success(res: any);\n fail(res: any);\n complete(res: any);\n}\n\ninterface navigateBackOptions {\n delta: number;\n}\n\n// \u663E\u793A\u63D0\u793A\nfunction showToast(options);\n\n// \u663E\u793A loading \u63D0\u793A\nfunction showLoading(options);\n\n// \u9690\u85CF loading \u63D0\u793A\nfunction hideLoading(options);\n\n// \u663E\u793A\u6A21\u6001\u63D0\u793A\nfunction showModal(options);\n\n// \u62E8\u6253\u7535\u8BDD\nfunction callPhone(options);\n\n// sacnCode\nfunction scanCode(options: {\n onlyFromCamera?: boolean;\n enableDefaultBehavior?: boolean;\n scanType?: ('barCode' | 'qrCode')[];\n success?: (res: { result: string; scanType: string }) => void;\n fail?: (err: Error) => void;\n complete?: () => void;\n}): Promise<ScanCodeResult> | ScanCodeResult;\n\n/** \u5FAE\u4FE1\u80FD\u529B */\n/**\n * \u6D88\u606F\u8BA2\u9605\n * @param options\n */\nfunction requestSubscribeMessage(options);\n/**\n * \u5730\u56FE\u5BFC\u822A\n * @param options\n */\nfunction openLocation(options);\n/**\n * \u9884\u7EA6\u89C6\u9891\u53F7\u76F4\u64AD\n * @param options\n */\nfunction reserveChannelsLive(options);\n/**\n * \u6253\u5F00\u89C6\u9891\u53F7\u4E3B\u9875\n * @param options\n */\nfunction openChannelsUserProfile(options);\n/**\n * \u6253\u5F00\u89C6\u9891\u53F7\u76F4\u64AD\n * @param options\n */\nfunction openChannelsLive(options);\n/**\n * \u6253\u5F00\u89C6\u9891\u53F7\u6D3B\u52A8\u9875\n * @param options\n */\nfunction openChannelsEvent(options);\n/**\n * \u6253\u5F00\u89C6\u9891\u53F7\u89C6\u9891\n * @param options\n */\nfunction openChannelsActivity(options);\n/**\n * \u83B7\u53D6\u89C6\u9891\u53F7\u76F4\u64AD\u9884\u544A\u4FE1\u606F\n * @param options\n */\nfunction getChannelsLiveNoticeInfo(options);\n/**\n * \u83B7\u53D6\u89C6\u9891\u53F7\u76F4\u64AD\u4FE1\u606F\n * @param options\n */\nfunction getChannelsLiveInfo(options);\n/**\n * \u521B\u5EFA\u6FC0\u52B1\u89C6\u9891\u5E7F\u544A\n * @param options\n */\nfunction createRewardedVideoAd(options);\n/**\n * \u521B\u5EFA\u63D2\u5C4F\u5E7F\u544A\n * @param options\n */\nfunction createInterstitialAd(options);\n\n// \u7279\u5236\u8DEF\u7531\nfunction navigateTo(options: navigatorOptions);\n\nfunction redirectTo(options: navigatorOptions);\n\nfunction reLaunch(options: navigatorOptions);\n\nfunction relaunchHome();\n\nfunction navigateBack(options: navigateBackOptions);\n\n }\n\n function ABS(num: number): number;\n function Min(...args: number[]): number;\n function Max(...args: number[]): number;\n function Average(...args: number[]): number;\n function Floor(num: number): number;\n function Ceiling(num: number): number;\n function Round(num: number): number;\n function Sum(...args: number[]): number;\n function Rand(num: number): number;\n\n interface IIfObjectParam {\ncondition: boolean;\nconsequent?: any;\nalternate?: any;\n}\n interface IIfObjectParam {\n condition: boolean;\n consequent?: any;\n alternate?: any;\n }\n function If(params: IIfObjectParam): any;\n function If(condition: boolean, consequent?: any, alternate?: any): any;\n function IsEmpty(text: string | string[]): boolean;\n function NotNull(val: any): boolean;\n function And(...args: boolean[]): boolean;\n function Or(...args: boolean[]): boolean;\n\n function Len(text: string): number;\n function Contains(text1: string, text2: string): boolean;\n function Split(text1: string, text2: string): string[];\n function Trim(text: string): string;\n function Upper(text: string): string;\n function Lower(text: string): string;\n function Concat(...text: string[]): string;\n\n function Now(): number;\n function Timestamp(arg: number | string | Date): number;\n function Second(arg: number | string | Date): number;\n function Minute(arg: number | string | Date): number;\n function Hour(arg: number | string | Date): number;\n function Day(arg: number | string | Date): number;\n function DayOfWeek(arg: number | string | Date): number;\n function Month(arg: number | string | Date): number;\n function Year(arg: number | string | Date): number;\n function GetDate(year: number, month: number, day: number): number;\n function DateTimeValue(arg: string, val: string): number;\n function Age(arg: number | string | Date, val: number | string | Date): number;\n function AgeOfNow(arg: number | string | Date): number;\n function DateAdd(arg: number | string | Date, day: number): number;\n function MonthAdd(arg: number | string | Date, month: number): number;\n function YearAdd(arg: number | string | Date, year: number): number;\n function DateDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function HourDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function MinuteDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function SecondDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function MonthDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function YearDiff(startDay: number | string | Date, endDay: number | string | Date): number;\n function DateText(createdTime: number | string | Date, text: string): string;\n function IsToday(date: number | string | Date): boolean;\n\n\n // used widgets Inner Begin\n // used widgets - Don't touch me\n // used widgets Inner End\n\n // repeater scope Inner Begin\n // repeater scope - Don't touch me\n // repeater scope Inner End\n}\n\n// Global For Begin\ndeclare const $for: {\n // Global For Inner Begin\n // For \u5FAA\u73AF\u53D8\u91CF - Don't touch me\n // Global For Inner End\n}\ndeclare const forItems = $for\n// Global For End\n\n// $page Begin\ndeclare namespace $page {\n const id: string;\n\nnamespace dataset {\n const state: {\n // Page State Inner Begin\n // Page State \u9875\u9762\u53D8\u91CF - Don't touch me\n // Page State Inner End\n };\n const params: {\n // Page Param Inner Begin\n // Page Param \u9875\u9762\u53C2\u6570 - Don't touch me\n // Page Param Inner End\n };\n}\nnamespace handler {\n // Page Handler Inner Begin\n // Page Handler \u9875\u9762\u65B9\u6CD5 - Don't touch me\n // Page Handler Inner End\n}\n\nfunction setState(userSetState: Record<string, any>): void;\n\n}\n// $page End\n\n// $comp Begin\ndeclare namespace $comp {\n\n namespace props {\n\n const data: {\n // Comp Prop Data Inner Begin\n // Comp Prop Data \u7EC4\u4EF6\u5C5E\u6027 - Don't touch me\n // Comp Prop Data Inner End\n }\n\n namespace events {\n // Comp Prop Events Inner Begin\n // Comp Prop Events \u7EC4\u4EF6\u4E8B\u4EF6 - Don't touch me\n // Comp Prop Events Inner End\n }\n\n }\n\n namespace dataset {\n\n const state: {\n // Comp State Inner Begin\n // Comp State \u7EC4\u4EF6\u53D8\u91CF - Don't touch me\n // Comp State Inner End\n }\n\n }\n\n namespace handler {\n // Comp Handler Inner Begin\n // Comp Handler \u7EC4\u4EF6\u65B9\u6CD5 - Don't touch me\n // Comp Handler Inner End\n }\n\n}\n// $comp End\n\n// Global Formula Begin\n\ndeclare function ABS(num: number): number;\ndeclare function Min(...args: number[]): number;\ndeclare function Max(...args: number[]): number;\ndeclare function Average(...args: number[]): number;\ndeclare function Floor(num: number): number;\ndeclare function Ceiling(num: number): number;\ndeclare function Round(num: number): number;\ndeclare function Sum(...args: number[]): number;\ndeclare function Rand(num: number): number;\n\ndeclare interface IIfObjectParam {\ncondition: boolean;\nconsequent?: any;\nalternate?: any;\n}\ndeclare interface IIfObjectParam {\n condition: boolean;\n consequent?: any;\n alternate?: any;\n}\ndeclare function If(params: IIfObjectParam): any;\ndeclare function If(condition: boolean, consequent?: any, alternate?: any): any;\ndeclare function IsEmpty(text: string | string[]): boolean;\ndeclare function NotNull(val: any): boolean;\ndeclare function And(...args: boolean[]): boolean;\ndeclare function Or(...args: boolean[]): boolean;\n\ndeclare function Len(text: string): number;\ndeclare function Contains(text1: string, text2: string): boolean;\ndeclare function Split(text1: string, text2: string): string[];\ndeclare function Trim(text: string): string;\ndeclare function Upper(text: string): string;\ndeclare function Lower(text: string): string;\ndeclare function Concat(...text: string[]): string;\n\ndeclare function Now(): number;\ndeclare function Timestamp(arg: number | string | Date): number;\ndeclare function Second(arg: number | string | Date): number;\ndeclare function Minute(arg: number | string | Date): number;\ndeclare function Hour(arg: number | string | Date): number;\ndeclare function Day(arg: number | string | Date): number;\ndeclare function DayOfWeek(arg: number | string | Date): number;\ndeclare function Month(arg: number | string | Date): number;\ndeclare function Year(arg: number | string | Date): number;\ndeclare function GetDate(year: number, month: number, day: number): number;\ndeclare function DateTimeValue(arg: string, val: string): number;\ndeclare function Age(arg: number | string | Date, val: number | string | Date): number;\ndeclare function AgeOfNow(arg: number | string | Date): number;\ndeclare function DateAdd(arg: number | string | Date, day: number): number;\ndeclare function MonthAdd(arg: number | string | Date, month: number): number;\ndeclare function YearAdd(arg: number | string | Date, year: number): number;\ndeclare function DateDiff(startDay: number | string | Date, endDay: number | string | Date): number;\ndeclare function HourDiff(startDay: number | string | Date, endDay: number | string | Date): number;\ndeclare function MinuteDiff(startDay: number | string | Date, endDay: number | string | Date): number;\ndeclare function SecondDiff(startDay: number | string | Date, endDay: number | string | Date): number;\ndeclare function MonthDiff(startDay: number | string | Date, endDay: number | string | Date): number;\ndeclare function YearDiff(startDay: number | string | Date, endDay: number | string | Date): number;\ndeclare function DateText(createdTime: number | string | Date, text: string): string;\ndeclare function IsToday(date: number | string | Date): boolean;\n\n\n// Global Formula End\n";
|
|
2
2
|
//# sourceMappingURL=auto-generated.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-generated.d.ts","sourceRoot":"","sources":["../../../src/utils/dts/auto-generated.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"auto-generated.d.ts","sourceRoot":"","sources":["../../../src/utils/dts/auto-generated.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,iraA6bnB,CAAC"}
|
|
@@ -251,19 +251,19 @@ function navigateBack(options: navigateBackOptions);
|
|
|
251
251
|
interface IIfObjectParam {
|
|
252
252
|
condition: boolean;
|
|
253
253
|
consequent?: any;
|
|
254
|
-
alternate?: any;
|
|
255
|
-
interface IIfObjectParam {
|
|
256
|
-
condition: boolean;
|
|
257
|
-
consequent?: any;
|
|
258
254
|
alternate?: any;
|
|
259
255
|
}
|
|
256
|
+
interface IIfObjectParam {
|
|
257
|
+
condition: boolean;
|
|
258
|
+
consequent?: any;
|
|
259
|
+
alternate?: any;
|
|
260
|
+
}
|
|
260
261
|
function If(params: IIfObjectParam): any;
|
|
261
262
|
function If(condition: boolean, consequent?: any, alternate?: any): any;
|
|
262
263
|
function IsEmpty(text: string | string[]): boolean;
|
|
263
264
|
function NotNull(val: any): boolean;
|
|
264
265
|
function And(...args: boolean[]): boolean;
|
|
265
266
|
function Or(...args: boolean[]): boolean;
|
|
266
|
-
}
|
|
267
267
|
|
|
268
268
|
function Len(text: string): number;
|
|
269
269
|
function Contains(text1: string, text2: string): boolean;
|
|
@@ -398,10 +398,11 @@ declare interface IIfObjectParam {
|
|
|
398
398
|
condition: boolean;
|
|
399
399
|
consequent?: any;
|
|
400
400
|
alternate?: any;
|
|
401
|
+
}
|
|
401
402
|
declare interface IIfObjectParam {
|
|
402
|
-
condition: boolean;
|
|
403
|
-
consequent?: any;
|
|
404
|
-
alternate?: any;
|
|
403
|
+
condition: boolean;
|
|
404
|
+
consequent?: any;
|
|
405
|
+
alternate?: any;
|
|
405
406
|
}
|
|
406
407
|
declare function If(params: IIfObjectParam): any;
|
|
407
408
|
declare function If(condition: boolean, consequent?: any, alternate?: any): any;
|
|
@@ -409,7 +410,6 @@ declare function IsEmpty(text: string | string[]): boolean;
|
|
|
409
410
|
declare function NotNull(val: any): boolean;
|
|
410
411
|
declare function And(...args: boolean[]): boolean;
|
|
411
412
|
declare function Or(...args: boolean[]): boolean;
|
|
412
|
-
}
|
|
413
413
|
|
|
414
414
|
declare function Len(text: string): number;
|
|
415
415
|
declare function Contains(text1: string, text2: string): boolean;
|
package/lib/utils/dts/build.js
CHANGED
|
@@ -44,7 +44,7 @@ function buildFormulaDTS() {
|
|
|
44
44
|
const dts = yield fs_extra_1.default.readFile(tempDtsPath, 'utf8');
|
|
45
45
|
yield fs_extra_1.default.remove(tempDtsPath);
|
|
46
46
|
// 去掉最外层的模块声明
|
|
47
|
-
return dts.replace(/^declare module.*$/m, '').replace(
|
|
47
|
+
return dts.replace(/^declare module.*$/m, '').replace(/^\}$/m, '').replace(/^\s+/mg, '');
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
});
|
package/lib/utils/index.d.ts
CHANGED
|
File without changes
|
package/lib/utils/index.d.ts.map
CHANGED
|
File without changes
|
package/lib/utils/index.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/parser/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,iBAAiB,CAAC"}
|
package/lib/parser/constants.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare function semverComp(a: string, b: string): number;
|
|
2
|
-
export declare function toFixed(num: number, precision: number): number;
|
|
3
|
-
export declare const OFFICIAL_COMPONENT_LIB_NAME = "CLOUDBASE_STANDARD";
|
|
4
|
-
export declare const OFFICIAL_MATERIAL_LIB_NAME = "gsd-h5-react";
|
|
5
|
-
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/utils/version-migrations/common.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAYvD;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAI9D;AAED,eAAO,MAAM,2BAA2B,uBAAuB,CAAC;AAChE,eAAO,MAAM,0BAA0B,iBAAiB,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OFFICIAL_MATERIAL_LIB_NAME = exports.OFFICIAL_COMPONENT_LIB_NAME = exports.toFixed = exports.semverComp = void 0;
|
|
4
|
-
function semverComp(a, b) {
|
|
5
|
-
const pa = a.split('.');
|
|
6
|
-
const pb = b.split('.');
|
|
7
|
-
for (let i = 0; i < 3; i++) {
|
|
8
|
-
const na = Number(pa[i]);
|
|
9
|
-
const nb = Number(pb[i]);
|
|
10
|
-
if (na > nb)
|
|
11
|
-
return 1;
|
|
12
|
-
if (nb > na)
|
|
13
|
-
return -1;
|
|
14
|
-
if (!isNaN(na) && isNaN(nb))
|
|
15
|
-
return 1;
|
|
16
|
-
if (isNaN(na) && !isNaN(nb))
|
|
17
|
-
return -1;
|
|
18
|
-
}
|
|
19
|
-
return 0;
|
|
20
|
-
}
|
|
21
|
-
exports.semverComp = semverComp;
|
|
22
|
-
function toFixed(num, precision) {
|
|
23
|
-
const multiplier = Math.pow(10, (precision + 1));
|
|
24
|
-
const wholeNumber = Math.floor(num * multiplier);
|
|
25
|
-
return (Math.round(wholeNumber / 10) * 10) / multiplier;
|
|
26
|
-
}
|
|
27
|
-
exports.toFixed = toFixed;
|
|
28
|
-
exports.OFFICIAL_COMPONENT_LIB_NAME = 'CLOUDBASE_STANDARD';
|
|
29
|
-
exports.OFFICIAL_MATERIAL_LIB_NAME = 'gsd-h5-react';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"version4.d.ts","sourceRoot":"","sources":["../../../src/utils/version-migrations/version4.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAkB,MAAM,aAAa,CAAC;AAGhE,wBAAgB,QAAQ,CACtB,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,OAAO,EAClB,wBAAwB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,GAC/D,YAAY,CAEd"}
|
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.version4 = void 0;
|
|
7
|
-
const postcss_1 = __importDefault(require("postcss"));
|
|
8
|
-
const postcss_less_1 = __importDefault(require("postcss-less"));
|
|
9
|
-
const __1 = require("..");
|
|
10
|
-
const common_1 = require("./common");
|
|
11
|
-
function version4(cals, isUpgrade, setSchemaVersionCallback) {
|
|
12
|
-
return transformPxLowcodeCompAndSourceComp(cals, isUpgrade, setSchemaVersionCallback);
|
|
13
|
-
}
|
|
14
|
-
exports.version4 = version4;
|
|
15
|
-
const transformPxLowcodeCompAndSourceComp = (cals, isUpgrade, setSchemaVersionCallback) => {
|
|
16
|
-
var _a, _b, _c, _d;
|
|
17
|
-
{
|
|
18
|
-
function transformCals(items, isUpgradeToPx) {
|
|
19
|
-
return items.map((item) => {
|
|
20
|
-
var _a;
|
|
21
|
-
// 对于表单操作区的按钮组件的父容器添加.wd-form__action, 兼容组件规范化按钮升级样式
|
|
22
|
-
if ((item === null || item === void 0 ? void 0 : item.module) === common_1.OFFICIAL_COMPONENT_LIB_NAME && (item === null || item === void 0 ? void 0 : item.component) === 'Form') {
|
|
23
|
-
item = addClassToButtonContainer(item);
|
|
24
|
-
}
|
|
25
|
-
if ((_a = item === null || item === void 0 ? void 0 : item.extra) === null || _a === void 0 ? void 0 : _a.commonStyle) {
|
|
26
|
-
item.extra.commonStyle = convertCommonStyle(item.extra.commonStyle, isUpgradeToPx);
|
|
27
|
-
if (item.extra.commonStyle.self) {
|
|
28
|
-
// 处理 margin padding shorthand 同步
|
|
29
|
-
const newSelf = (0, __1.processCommonStyle2CSSProperties)(item.extra.commonStyle, {
|
|
30
|
-
toRem: false,
|
|
31
|
-
ignoreSelf: true,
|
|
32
|
-
addPXUnit: true,
|
|
33
|
-
});
|
|
34
|
-
['margin', 'padding', 'border'].forEach((k) => {
|
|
35
|
-
if (item.extra.commonStyle.self[k]) {
|
|
36
|
-
item.extra.commonStyle.self[k] = newSelf[k];
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
if (item === null || item === void 0 ? void 0 : item.resources) {
|
|
42
|
-
item.resources = item.resources.map((n) => {
|
|
43
|
-
if (n.codeType === 'style') {
|
|
44
|
-
n = convertLowCodesStyle(n, isUpgradeToPx);
|
|
45
|
-
return n;
|
|
46
|
-
}
|
|
47
|
-
return n;
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
if (item.items) {
|
|
51
|
-
item.items = transformCals(item.items, isUpgradeToPx);
|
|
52
|
-
}
|
|
53
|
-
return item;
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
let pages = cals['items'];
|
|
57
|
-
let isDivision;
|
|
58
|
-
if (isUpgrade && (0, common_1.semverComp)((_a = cals['schemaVersion']) !== null && _a !== void 0 ? _a : '3.0.0', '4.0.0') < 0) {
|
|
59
|
-
// 组件库版本高于目标版本,且schemaVersion小于4, 将应用 CALS 数据中的 CSS 和 style 中的无单位和有单位的小写 px统一改写为 1/2 px
|
|
60
|
-
isDivision = true;
|
|
61
|
-
pages = transformCals(pages, isDivision);
|
|
62
|
-
cals.resources = (_b = cals.resources) === null || _b === void 0 ? void 0 : _b.map((n) => {
|
|
63
|
-
if (n.codeType === 'style') {
|
|
64
|
-
n = convertLowCodesStyle(n, isDivision);
|
|
65
|
-
return n;
|
|
66
|
-
}
|
|
67
|
-
return n;
|
|
68
|
-
});
|
|
69
|
-
cals['schemaVersion'] = '4.0.0';
|
|
70
|
-
setSchemaVersionCallback === null || setSchemaVersionCallback === void 0 ? void 0 : setSchemaVersionCallback('4.0.0');
|
|
71
|
-
}
|
|
72
|
-
else if (!isUpgrade && (0, common_1.semverComp)((_c = cals['schemaVersion']) !== null && _c !== void 0 ? _c : '3.0.0', '4.0.0') >= 0) {
|
|
73
|
-
// 组件库低于目标版本,并且schemaVersion大于4 将应用 CALS 数据中的 CSS 和 style 中的无单位和有单位的小写 px统一改写为 2倍 px
|
|
74
|
-
isDivision = false;
|
|
75
|
-
pages = transformCals(pages, isDivision);
|
|
76
|
-
cals.resources = (_d = cals.resources) === null || _d === void 0 ? void 0 : _d.map((n) => {
|
|
77
|
-
if (n.codeType === 'style') {
|
|
78
|
-
n = convertLowCodesStyle(n, isDivision);
|
|
79
|
-
return n;
|
|
80
|
-
}
|
|
81
|
-
return n;
|
|
82
|
-
});
|
|
83
|
-
delete cals['schemaVersion'];
|
|
84
|
-
setSchemaVersionCallback === null || setSchemaVersionCallback === void 0 ? void 0 : setSchemaVersionCallback(undefined);
|
|
85
|
-
}
|
|
86
|
-
cals['items'] = pages;
|
|
87
|
-
return cals;
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
function hasSubmitButton(item) {
|
|
91
|
-
var _a;
|
|
92
|
-
if ((_a = item === null || item === void 0 ? void 0 : item.items) === null || _a === void 0 ? void 0 : _a.length) {
|
|
93
|
-
const children = item.items;
|
|
94
|
-
return children.some((i) => { var _a; return (i === null || i === void 0 ? void 0 : i.module) === common_1.OFFICIAL_COMPONENT_LIB_NAME && i.component === 'Button' && ((_a = i === null || i === void 0 ? void 0 : i.attributes) === null || _a === void 0 ? void 0 : _a.formType) === 'submit'; });
|
|
95
|
-
}
|
|
96
|
-
return false;
|
|
97
|
-
}
|
|
98
|
-
function addClassToButtonContainer(item) {
|
|
99
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
100
|
-
if ((item === null || item === void 0 ? void 0 : item.module) === common_1.OFFICIAL_MATERIAL_LIB_NAME && item.component === 'Container') {
|
|
101
|
-
if (hasSubmitButton(item)) {
|
|
102
|
-
if (((_a = item.attributes) === null || _a === void 0 ? void 0 : _a.class) && !((_b = item.attributes) === null || _b === void 0 ? void 0 : _b.class.includes('wd-form__action'))) {
|
|
103
|
-
if (typeof ((_c = item.attributes) === null || _c === void 0 ? void 0 : _c.class) === 'string') {
|
|
104
|
-
item.attributes = Object.assign(Object.assign({}, item.attributes), { class: `${(_d = item.attributes) === null || _d === void 0 ? void 0 : _d.class} wd-form__action` });
|
|
105
|
-
}
|
|
106
|
-
else if (Array.isArray((_e = item.attributes) === null || _e === void 0 ? void 0 : _e.class)) {
|
|
107
|
-
item.attributes = Object.assign(Object.assign({}, item.attributes), { class: [...(_f = item.attributes) === null || _f === void 0 ? void 0 : _f.class, 'wd-form__action'] });
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
else if (!((_g = item.attributes) === null || _g === void 0 ? void 0 : _g.class)) {
|
|
111
|
-
item.attributes = Object.assign(Object.assign({}, item.attributes), { class: 'wd-form__action' });
|
|
112
|
-
}
|
|
113
|
-
// 移除旧的padding配置
|
|
114
|
-
if ((_j = (_h = item === null || item === void 0 ? void 0 : item.extra) === null || _h === void 0 ? void 0 : _h.commonStyle) === null || _j === void 0 ? void 0 : _j.padding) {
|
|
115
|
-
delete item.extra.commonStyle.padding;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
if ((_k = item === null || item === void 0 ? void 0 : item.items) === null || _k === void 0 ? void 0 : _k.length) {
|
|
120
|
-
item.items = item.items.map((i) => addClassToButtonContainer(i));
|
|
121
|
-
}
|
|
122
|
-
return item;
|
|
123
|
-
}
|
|
124
|
-
function jsonTranverse(json, reviver) {
|
|
125
|
-
return JSON.parse(JSON.stringify(json, reviver, 2));
|
|
126
|
-
}
|
|
127
|
-
function convertCommonStyle(value, isUpgrade) {
|
|
128
|
-
return jsonTranverse(value, (key, value) => {
|
|
129
|
-
if (__1.isUnitlessNumber[key]) {
|
|
130
|
-
return value;
|
|
131
|
-
}
|
|
132
|
-
if (typeof value === 'number') {
|
|
133
|
-
if (isUpgrade) {
|
|
134
|
-
value = value / 2;
|
|
135
|
-
}
|
|
136
|
-
else {
|
|
137
|
-
value = value * 2;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
else if (/^((\d+\.)?\d+)(px)?$/.test(value)) {
|
|
141
|
-
value = !value ? value : value === null || value === void 0 ? void 0 : value.replace('px', '');
|
|
142
|
-
if (isUpgrade) {
|
|
143
|
-
// console.log(key, value, Number(value) / 2);
|
|
144
|
-
value = !value ? value : `${(0, common_1.toFixed)(Number(value) / 2, 3)}px`;
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
value = !value ? value : `${Number(value) * 2}px`;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
return value;
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
const rem2PxPlugin = (opts) => {
|
|
154
|
-
const rem2pxSym = Symbol('rem2pxSym');
|
|
155
|
-
const { isUpgrade } = opts;
|
|
156
|
-
return {
|
|
157
|
-
postcssPlugin: 'postcss-rem2px',
|
|
158
|
-
Declaration(decl, rule) {
|
|
159
|
-
// Modified From https://github.com/cuth/postcss-pxtorem/blob/122649015322214f8e9d1ac852eb11c0791b634b/lib/pixel-unit-regex.js#L9
|
|
160
|
-
// eslint-disable-next-line no-useless-escape
|
|
161
|
-
const pxRegex = /"[^"]+"|'[^']+'|(\d*\.?\d+)px/gm;
|
|
162
|
-
if (decl.value.indexOf('px') < 0) {
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
if (decl[rem2pxSym]) {
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
if (isUpgrade) {
|
|
169
|
-
const value = decl.value.replace(pxRegex, (match, p1) => {
|
|
170
|
-
if (p1 !== null && p1 !== undefined) {
|
|
171
|
-
const r = (0, common_1.toFixed)(Number(p1) / 2, 3);
|
|
172
|
-
const rs = r.toString();
|
|
173
|
-
return `${rs}px`;
|
|
174
|
-
}
|
|
175
|
-
return match;
|
|
176
|
-
});
|
|
177
|
-
decl.value = value;
|
|
178
|
-
}
|
|
179
|
-
else {
|
|
180
|
-
const value = decl.value.replace(pxRegex, (match, p1) => {
|
|
181
|
-
if (p1 !== null && p1 !== undefined) {
|
|
182
|
-
return `${Number(p1) * 2}px`;
|
|
183
|
-
}
|
|
184
|
-
return match;
|
|
185
|
-
});
|
|
186
|
-
decl.value = value;
|
|
187
|
-
}
|
|
188
|
-
decl[rem2pxSym] = true;
|
|
189
|
-
},
|
|
190
|
-
};
|
|
191
|
-
};
|
|
192
|
-
rem2PxPlugin.postcss = true;
|
|
193
|
-
function convertLowCodesStyle(value, isUpgrade) {
|
|
194
|
-
const result = (0, postcss_1.default)([rem2PxPlugin({ isUpgrade })]).process(value.code, {
|
|
195
|
-
syntax: postcss_less_1.default,
|
|
196
|
-
});
|
|
197
|
-
value.code = result.css;
|
|
198
|
-
return value;
|
|
199
|
-
}
|