@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.
Files changed (125) hide show
  1. package/lib/parser/cals/index.d.ts +379 -366
  2. package/lib/parser/cals/index.d.ts.map +1 -1
  3. package/lib/parser/cals/index.js +75 -13
  4. package/lib/parser/cals/utils/block/index.d.ts +14 -14
  5. package/lib/parser/cals/utils/block/index.d.ts.map +0 -0
  6. package/lib/parser/cals/utils/block/index.js +3 -3
  7. package/lib/parser/cals/utils/code/index.d.ts +30 -30
  8. package/lib/parser/cals/utils/code/index.d.ts.map +0 -0
  9. package/lib/parser/cals/utils/code/index.js +12 -13
  10. package/lib/parser/cals/utils/common.d.ts +11 -11
  11. package/lib/parser/cals/utils/common.d.ts.map +0 -0
  12. package/lib/parser/cals/utils/common.js +0 -0
  13. package/lib/parser/cals/utils/runtime.d.ts +13 -13
  14. package/lib/parser/cals/utils/runtime.d.ts.map +1 -1
  15. package/lib/parser/cals/utils/runtime.js +2 -2
  16. package/lib/parser/cals/utils/spinoff/index.d.ts +9 -9
  17. package/lib/parser/cals/utils/spinoff/index.d.ts.map +0 -0
  18. package/lib/parser/cals/utils/spinoff/index.js +0 -0
  19. package/lib/parser/cals/utils/style.d.ts +42 -42
  20. package/lib/parser/cals/utils/style.d.ts.map +1 -1
  21. package/lib/parser/cals/utils/style.js +3 -3
  22. package/lib/parser/cals/utils/template.d.ts +5 -5
  23. package/lib/parser/cals/utils/template.d.ts.map +0 -0
  24. package/lib/parser/cals/utils/template.js +6 -3
  25. package/lib/parser/cals/utils/version/common.d.ts +4 -4
  26. package/lib/parser/cals/utils/version/common.d.ts.map +0 -0
  27. package/lib/parser/cals/utils/version/common.js +34 -11
  28. package/lib/parser/cals/utils/version/config.d.ts +13 -13
  29. package/lib/parser/cals/utils/version/config.d.ts.map +0 -0
  30. package/lib/parser/cals/utils/version/config.js +0 -0
  31. package/lib/parser/cals/utils/version/index.d.ts +2 -2
  32. package/lib/parser/cals/utils/version/index.d.ts.map +0 -0
  33. package/lib/parser/cals/utils/version/index.js +0 -0
  34. package/lib/parser/cals/utils/version/parses.d.ts +15 -15
  35. package/lib/parser/cals/utils/version/parses.d.ts.map +0 -0
  36. package/lib/parser/cals/utils/version/parses.js +37 -14
  37. package/lib/parser/cals/utils/version/utils.d.ts +13 -13
  38. package/lib/parser/cals/utils/version/utils.d.ts.map +1 -1
  39. package/lib/parser/cals/utils/version/utils.js +2 -2
  40. package/lib/parser/constants.d.ts +2 -0
  41. package/lib/parser/constants.d.ts.map +1 -0
  42. package/lib/parser/constants.js +4 -0
  43. package/lib/parser/expression/index.d.ts +122 -122
  44. package/lib/parser/expression/index.d.ts.map +0 -0
  45. package/lib/parser/expression/index.js +0 -0
  46. package/lib/parser/index.d.ts +8 -8
  47. package/lib/parser/index.d.ts.map +0 -0
  48. package/lib/parser/index.js +0 -0
  49. package/lib/parser/plugins/postcss-rpx2clac.d.ts +17 -17
  50. package/lib/parser/plugins/postcss-rpx2clac.js +2 -2
  51. package/lib/types/basic/app.d.ts +72 -72
  52. package/lib/types/basic/app.d.ts.map +0 -0
  53. package/lib/types/basic/app.js +0 -0
  54. package/lib/types/basic/common.d.ts +88 -88
  55. package/lib/types/basic/common.d.ts.map +1 -1
  56. package/lib/types/basic/common.js +0 -0
  57. package/lib/types/basic/component.d.ts +213 -208
  58. package/lib/types/basic/component.d.ts.map +1 -1
  59. package/lib/types/basic/component.js +0 -0
  60. package/lib/types/basic/datasource.d.ts +49 -49
  61. package/lib/types/basic/datasource.d.ts.map +0 -0
  62. package/lib/types/basic/datasource.js +0 -0
  63. package/lib/types/index.d.ts +10 -9
  64. package/lib/types/index.d.ts.map +1 -1
  65. package/lib/types/index.js +1 -14
  66. package/lib/types/lcds.d.ts +334 -447
  67. package/lib/types/lcds.d.ts.map +1 -1
  68. package/lib/types/lcds.js +0 -0
  69. package/lib/types/platform/app.d.ts +176 -176
  70. package/lib/types/platform/app.d.ts.map +0 -0
  71. package/lib/types/platform/app.js +0 -0
  72. package/lib/types/platform/common.d.ts +147 -137
  73. package/lib/types/platform/common.d.ts.map +1 -1
  74. package/lib/types/platform/common.js +0 -0
  75. package/lib/types/platform/component.d.ts +145 -140
  76. package/lib/types/platform/component.d.ts.map +1 -1
  77. package/lib/types/platform/component.js +0 -0
  78. package/lib/types/platform/datasource.d.ts +466 -466
  79. package/lib/types/platform/datasource.d.ts.map +0 -0
  80. package/lib/types/platform/datasource.js +0 -0
  81. package/lib/types/platform/eventFlow.d.ts +20 -0
  82. package/lib/types/platform/eventFlow.d.ts.map +1 -0
  83. package/lib/types/platform/eventFlow.js +2 -0
  84. package/lib/types/platform/query.d.ts +58 -0
  85. package/lib/types/platform/query.d.ts.map +1 -0
  86. package/lib/types/platform/query.js +2 -0
  87. package/lib/types/platform/widget/form.d.ts +89 -89
  88. package/lib/types/platform/widget/form.d.ts.map +0 -0
  89. package/lib/types/platform/widget/form.js +0 -0
  90. package/lib/types/platform/widget/meta.d.ts +59 -59
  91. package/lib/types/platform/widget/meta.d.ts.map +0 -0
  92. package/lib/types/platform/widget/meta.js +0 -0
  93. package/lib/utils/CSSProperty.d.ts +63 -63
  94. package/lib/utils/CSSProperty.d.ts.map +0 -0
  95. package/lib/utils/CSSProperty.js +0 -0
  96. package/lib/utils/build.d.ts +1 -1
  97. package/lib/utils/build.d.ts.map +0 -0
  98. package/lib/utils/build.js +6 -3
  99. package/lib/utils/constant.d.ts +40 -40
  100. package/lib/utils/constant.d.ts.map +0 -0
  101. package/lib/utils/constant.js +0 -0
  102. package/lib/utils/dts/auto-generated.d.ts +1 -1
  103. package/lib/utils/dts/auto-generated.d.ts.map +1 -1
  104. package/lib/utils/dts/auto-generated.js +35 -1227
  105. package/lib/utils/dts/build.d.ts +1 -1
  106. package/lib/utils/dts/build.js +4 -1
  107. package/lib/utils/dts/index.d.ts +93 -130
  108. package/lib/utils/dts/index.d.ts.map +1 -1
  109. package/lib/utils/dts/index.js +66 -359
  110. package/lib/utils/index.d.ts +7 -7
  111. package/lib/utils/index.d.ts.map +0 -0
  112. package/lib/utils/index.js +0 -0
  113. package/lib/utils/version/common.d.ts +2 -2
  114. package/lib/utils/version/featureChecker.d.ts +2 -2
  115. package/lib/utils/version/featureChecker.d.ts.map +1 -1
  116. package/lib/utils/version/migrations/version4.d.ts +2 -2
  117. package/lib/utils/version/migrations/version4.js +2 -2
  118. package/lib/utils/version-migrations/common.d.ts +5 -0
  119. package/lib/utils/version-migrations/common.d.ts.map +1 -0
  120. package/lib/utils/version-migrations/common.js +29 -0
  121. package/lib/utils/version-migrations/version4.d.ts +3 -0
  122. package/lib/utils/version-migrations/version4.d.ts.map +1 -0
  123. package/lib/utils/version-migrations/version4.js +199 -0
  124. package/package.json +3 -13
  125. package/lib/cloudbase.cals.umd.min.js +0 -5
File without changes
@@ -1,7 +1,10 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.generateDefaultCode = void 0;
4
- const lodash_es_1 = require("lodash-es");
7
+ const template_1 = __importDefault(require("lodash/template"));
5
8
  const types_1 = require("../../../types");
6
9
  const TEMPLATES = {
7
10
  /* ========== 低代码简化类型代码 ========== */
@@ -214,11 +217,11 @@ function generateDefaultCode(ctx, type, scope) {
214
217
  tpl = TEMPLATES.appLifeCycle;
215
218
  break;
216
219
  }
217
- return (0, lodash_es_1.template)(tpl)(data);
220
+ return (0, template_1.default)(tpl)(data);
218
221
  }
219
222
  default: {
220
223
  const tpl = TEMPLATES[type] || 'epxort default {}';
221
- return (0, lodash_es_1.template)(tpl)(data);
224
+ return (0, template_1.default)(tpl)(data);
222
225
  }
223
226
  }
224
227
  }
@@ -1,5 +1,5 @@
1
- export declare function beforeCommonParse(comp: any): void;
2
- export declare function afterCommonParse(comp: any): void;
3
- export declare function addFormItem(comp: any, key: any, parent: any, isOnlySlot?: boolean): void;
4
- export declare function renameRepeatId(json: any): void;
1
+ export declare function beforeCommonParse(comp: any): void;
2
+ export declare function afterCommonParse(comp: any): void;
3
+ export declare function addFormItem(comp: any, key: any, parent: any, isOnlySlot?: boolean): void;
4
+ export declare function renameRepeatId(json: any): void;
5
5
  //# sourceMappingURL=common.d.ts.map
File without changes
@@ -1,8 +1,31 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.renameRepeatId = exports.addFormItem = exports.afterCommonParse = exports.beforeCommonParse = void 0;
4
27
  const utils_1 = require("./utils");
5
- const lodash_es_1 = require("lodash-es");
28
+ const lodash_1 = __importStar(require("lodash"));
6
29
  const index_1 = require("./index");
7
30
  const common_1 = require("../common");
8
31
  const utils_2 = require("../../../../utils");
@@ -173,7 +196,7 @@ function translateStyleToCommonStyle(comp) {
173
196
  if (xProps === null || xProps === void 0 ? void 0 : xProps.style) {
174
197
  xProps.commonStyle = xProps.commonStyle || {};
175
198
  xProps.commonStyle.self = xProps.commonStyle.self || {};
176
- xProps.commonStyle.self = (0, lodash_es_1.merge)(xProps.style, xProps.commonStyle.self);
199
+ xProps.commonStyle.self = (0, lodash_1.merge)(xProps.style, xProps.commonStyle.self);
177
200
  delete xProps.style;
178
201
  }
179
202
  }
@@ -195,12 +218,12 @@ function addDefaultXIndex(comp) {
195
218
  }
196
219
  function addFormItem(comp, key, parent, isOnlySlot = false) {
197
220
  const { properties, xIndex, xProps } = comp;
198
- const defaultValue = (0, lodash_es_1.get)(xProps, 'data.defaultValue');
221
+ const defaultValue = lodash_1.default.get(xProps, 'data.defaultValue');
199
222
  if (defaultValue) {
200
- (0, lodash_es_1.set)(xProps, 'data.value', defaultValue);
223
+ lodash_1.default.set(xProps, 'data.value', defaultValue);
201
224
  delete xProps.data.defaultValue;
202
225
  }
203
- const rulesValue = (0, lodash_es_1.get)(xProps, 'data.rules') || {
226
+ const rulesValue = lodash_1.default.get(xProps, 'data.rules') || {
204
227
  value: [],
205
228
  };
206
229
  if (!rulesValue.type || rulesValue.type === 'static') {
@@ -216,19 +239,19 @@ function addFormItem(comp, key, parent, isOnlySlot = false) {
216
239
  rulesValue.value = [rulesValue.value];
217
240
  }
218
241
  }
219
- const layoutValue = (0, lodash_es_1.get)(xProps, 'data.layout') || {
242
+ const layoutValue = lodash_1.default.get(xProps, 'data.layout') || {
220
243
  value: 'vertical',
221
244
  };
222
- const requireValue = (0, lodash_es_1.get)(xProps, 'data.required') || {
245
+ const requireValue = lodash_1.default.get(xProps, 'data.required') || {
223
246
  value: false,
224
247
  };
225
248
  const requiredTextValue = {
226
249
  value: (requireValue === null || requireValue === void 0 ? void 0 : requireValue.value) ? '该项为必填项' : false,
227
250
  };
228
- const nameValue = (0, lodash_es_1.get)(xProps, 'data.name') || {
251
+ const nameValue = lodash_1.default.get(xProps, 'data.name') || {
229
252
  value: 'uniqueFormKey',
230
253
  };
231
- let labelText = (0, lodash_es_1.get)(xProps, 'data.label.value') || '';
254
+ let labelText = lodash_1.default.get(xProps, 'data.label.value') || '';
232
255
  let isShowTitleSlot = false;
233
256
  if (properties) {
234
257
  Object.keys(properties).map((subKey) => {
@@ -238,8 +261,8 @@ function addFormItem(comp, key, parent, isOnlySlot = false) {
238
261
  if (subKey === 'label') {
239
262
  const targetLabelSlot = properties[subKey];
240
263
  (0, utils_1.getComponentChildren)(targetLabelSlot).map(([key, item]) => {
241
- labelText = (0, lodash_es_1.get)(item, 'xProps.data.text.value');
242
- const cloneItem = (0, lodash_es_1.cloneDeep)(item);
264
+ labelText = lodash_1.default.get(item, 'xProps.data.text.value');
265
+ const cloneItem = lodash_1.default.cloneDeep(item);
243
266
  (0, index_1.deepParse)(cloneItem, key, comp);
244
267
  isShowTitleSlot = true;
245
268
  });
@@ -1,16 +1,16 @@
1
- /**
2
- 备注:登录 WeApps v2,在任一页面控制台输入以下代码(需要修改相应的分类名称),以获取指定分类的 COMPLEX_COMPONENT_KEYS
1
+ /**
2
+ 备注:登录 WeApps v2,在任一页面控制台输入以下代码(需要修改相应的分类名称),以获取指定分类的 COMPLEX_COMPONENT_KEYS
3
3
 
4
- fetch(`http://dev.weapps.woa.com/api/compositeComp/list?pageIndex=0&category=${encodeURI('审批系统')}&keyword=&pageSize=500`).then(function(response) {
5
- return response.json();
6
- }).then(function(json) {
7
- console.log(JSON.stringify(json.data.rows.map(item => item.name), null, 2))
8
- });
4
+ fetch(`http://dev.weapps.woa.com/api/compositeComp/list?pageIndex=0&category=${encodeURI('审批系统')}&keyword=&pageSize=500`).then(function(response) {
5
+ return response.json();
6
+ }).then(function(json) {
7
+ console.log(JSON.stringify(json.data.rows.map(item => item.name), null, 2))
8
+ });
9
9
 
10
- */
11
- export declare const COMPLEX_COMPONENT_KEYS: string[];
12
- export declare const FORM_COMPONENT_KEYS: string[];
13
- export declare const GSD_H5_REACT_COMPONENT_KEYS: string[];
14
- export declare const COMPONENT_SELECTABLEBLOCK_WHITELIST: string[];
15
- export declare const MODULE_SELECTABLEBLOCK_REGEX: RegExp;
10
+ */
11
+ export declare const COMPLEX_COMPONENT_KEYS: string[];
12
+ export declare const FORM_COMPONENT_KEYS: string[];
13
+ export declare const GSD_H5_REACT_COMPONENT_KEYS: string[];
14
+ export declare const COMPONENT_SELECTABLEBLOCK_WHITELIST: string[];
15
+ export declare const MODULE_SELECTABLEBLOCK_REGEX: RegExp;
16
16
  //# sourceMappingURL=config.d.ts.map
File without changes
File without changes
@@ -1,3 +1,3 @@
1
- export declare function upgrageToVersion2(app: any): any;
2
- export declare function deepParse(comp: any, key: any, parent: any): void;
1
+ export declare function upgrageToVersion2(app: any): any;
2
+ export declare function deepParse(comp: any, key: any, parent: any): void;
3
3
  //# sourceMappingURL=index.d.ts.map
File without changes
File without changes
@@ -1,16 +1,16 @@
1
- export declare function parseGsdKboneFooter(comp: any): void;
2
- export declare function parseGsdKboneButton(comp: any): void;
3
- export declare function parseGsdKbonePopLayer(comp: any): void;
4
- export declare function parseGsdKboneAgree(comp: any, key: any, parent: any): void;
5
- export declare function parseGsdKboneSwiper(comp: any): void;
6
- export declare function parseGsdKboneRichText(comp: any): void;
7
- export declare function parseGsdKboneText(comp: any): void;
8
- export declare function parseGsdKboneInput(comp: any, key: any, parent: any): void;
9
- export declare function parseGsdKboneSwitch(comp: any, key: any, parent: any): void;
10
- export declare function parseGsdKbonePicker(comp: any, key: any, parent: any): void;
11
- export declare function parseGsdKboneDateTimePicker(comp: any, key: any, parent: any): void;
12
- export declare function parseGsdKboneUpload(comp: any, key: any, parent: any): void;
13
- export declare function addFormWrapperComp(pageInstance: any): void;
14
- export declare function parseGsdKboneTabs(comp: any): void;
15
- export declare function parseComplexComponentInstance(instance: any): void;
1
+ export declare function parseGsdKboneFooter(comp: any): void;
2
+ export declare function parseGsdKboneButton(comp: any): void;
3
+ export declare function parseGsdKbonePopLayer(comp: any): void;
4
+ export declare function parseGsdKboneAgree(comp: any, key: any, parent: any): void;
5
+ export declare function parseGsdKboneSwiper(comp: any): void;
6
+ export declare function parseGsdKboneRichText(comp: any): void;
7
+ export declare function parseGsdKboneText(comp: any): void;
8
+ export declare function parseGsdKboneInput(comp: any, key: any, parent: any): void;
9
+ export declare function parseGsdKboneSwitch(comp: any, key: any, parent: any): void;
10
+ export declare function parseGsdKbonePicker(comp: any, key: any, parent: any): void;
11
+ export declare function parseGsdKboneDateTimePicker(comp: any, key: any, parent: any): void;
12
+ export declare function parseGsdKboneUpload(comp: any, key: any, parent: any): void;
13
+ export declare function addFormWrapperComp(pageInstance: any): void;
14
+ export declare function parseGsdKboneTabs(comp: any): void;
15
+ export declare function parseComplexComponentInstance(instance: any): void;
16
16
  //# sourceMappingURL=parses.d.ts.map
File without changes
@@ -1,8 +1,31 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.parseComplexComponentInstance = exports.parseGsdKboneTabs = exports.addFormWrapperComp = exports.parseGsdKboneUpload = exports.parseGsdKboneDateTimePicker = exports.parseGsdKbonePicker = exports.parseGsdKboneSwitch = exports.parseGsdKboneInput = exports.parseGsdKboneText = exports.parseGsdKboneRichText = exports.parseGsdKboneSwiper = exports.parseGsdKboneAgree = exports.parseGsdKbonePopLayer = exports.parseGsdKboneButton = exports.parseGsdKboneFooter = void 0;
4
27
  const utils_1 = require("./utils");
5
- const lodash_es_1 = require("lodash-es");
28
+ const lodash_1 = __importStar(require("lodash"));
6
29
  const common_1 = require("./common");
7
30
  const utils_2 = require("../../../../utils");
8
31
  function parseGsdKboneFooter(comp) {
@@ -260,7 +283,7 @@ function parseGsdKboneSwiper(comp) {
260
283
  else {
261
284
  const newSwiperItemId = (0, utils_1.getId)();
262
285
  const newSubComp = JSON.parse(JSON.stringify(subComp).replace(new RegExp(`forItems\\.${subKey}`, 'g'), `forItems.${newSwiperItemId}`));
263
- const waFor = (0, lodash_es_1.get)(newSubComp, 'xProps.directives.waFor');
286
+ const waFor = lodash_1.default.get(newSubComp, 'xProps.directives.waFor');
264
287
  try {
265
288
  delete newSubComp.xProps.directives.waFor;
266
289
  delete comp.properties[subKey];
@@ -307,7 +330,7 @@ function parseGsdKboneText(comp) {
307
330
  comp.xProps = comp.xProps || {};
308
331
  comp.xProps.commonStyle = comp.xProps.commonStyle || {};
309
332
  // v1 版本 text 为 block
310
- comp.xProps.commonStyle = (0, lodash_es_1.merge)({
333
+ comp.xProps.commonStyle = (0, lodash_1.merge)({
311
334
  display: 'block',
312
335
  self: {
313
336
  display: 'block',
@@ -360,20 +383,20 @@ function parseGsdKboneInput(comp, key, parent) {
360
383
  },
361
384
  };
362
385
  (0, utils_1.addDefaultData)(defaultData, comp);
363
- const append = (0, lodash_es_1.get)(comp, 'properties.append');
386
+ const append = lodash_1.default.get(comp, 'properties.append');
364
387
  if (append) {
365
- (0, lodash_es_1.set)(comp, 'properties.suffix', append);
366
- (0, lodash_es_1.set)(comp, 'xProps.data.isSuffix.value', true);
388
+ lodash_1.default.set(comp, 'properties.suffix', append);
389
+ lodash_1.default.set(comp, 'xProps.data.isSuffix.value', true);
367
390
  delete comp.properties.append;
368
391
  }
369
392
  }
370
393
  exports.parseGsdKboneInput = parseGsdKboneInput;
371
394
  function parseGsdKboneSwitch(comp, key, parent) {
372
395
  (0, common_1.addFormItem)(comp, key, parent, true);
373
- const defaultValue = (0, lodash_es_1.get)(comp, 'xProps.data.defaultValue');
374
- defaultValue && (0, lodash_es_1.set)(comp, 'xProps.data.value', defaultValue);
375
- const originStyle = (0, lodash_es_1.get)(comp, 'xProps.commonStyle.margin');
376
- (0, lodash_es_1.set)(comp, 'xProps.commonStyle.margin', Object.assign(Object.assign({}, originStyle), { top: '30', right: '40', bottom: '30', left: '40' }));
396
+ const defaultValue = lodash_1.default.get(comp, 'xProps.data.defaultValue');
397
+ defaultValue && lodash_1.default.set(comp, 'xProps.data.value', defaultValue);
398
+ const originStyle = lodash_1.default.get(comp, 'xProps.commonStyle.margin');
399
+ lodash_1.default.set(comp, 'xProps.commonStyle.margin', Object.assign(Object.assign({}, originStyle), { top: '30', right: '40', bottom: '30', left: '40' }));
377
400
  }
378
401
  exports.parseGsdKboneSwitch = parseGsdKboneSwitch;
379
402
  function parseGsdKbonePicker(comp, key, parent) {
@@ -383,7 +406,7 @@ function parseGsdKbonePicker(comp, key, parent) {
383
406
  exports.parseGsdKbonePicker = parseGsdKbonePicker;
384
407
  function parseGsdKboneDateTimePicker(comp, key, parent) {
385
408
  (0, common_1.addFormItem)(comp, key, parent);
386
- const modeValue = (0, lodash_es_1.get)(comp, 'xProps.data.mode.value');
409
+ const modeValue = lodash_1.default.get(comp, 'xProps.data.mode.value');
387
410
  if (modeValue === 'date') {
388
411
  comp.xComponent.name = 'Date';
389
412
  }
@@ -451,10 +474,10 @@ function addFormWrapperComp(pageInstance) {
451
474
  let comp = _comp;
452
475
  const { xComponent, xProps } = comp;
453
476
  if (xComponent && xComponent.name === 'Button') {
454
- const target = (0, lodash_es_1.get)(xProps, 'listeners[0]');
477
+ const target = lodash_1.default.get(xProps, 'listeners[0]');
455
478
  if (target && target.trigger && target.trigger === 'click') {
456
479
  listeners = xProps.listeners;
457
- (0, lodash_es_1.set)(xProps, 'data.formType', {
480
+ lodash_1.default.set(xProps, 'data.formType', {
458
481
  value: 'submit',
459
482
  });
460
483
  target.trigger = 'submit';
@@ -506,7 +529,7 @@ function parseGsdKboneTabs(comp) {
506
529
  }
507
530
  let tabItems; // [{key, title, content}]
508
531
  if (xProps.data) {
509
- tabItems = (0, lodash_es_1.get)(xProps.data, 'TabItems.value', []);
532
+ tabItems = lodash_1.default.get(xProps.data, 'TabItems.value', []);
510
533
  // 只保留 activeKey
511
534
  Object.keys(xProps.data).forEach((key) => {
512
535
  if (key !== 'activeKey')
@@ -1,14 +1,14 @@
1
- export declare function init(json: any): void;
2
- export declare function getId(): string;
3
- export declare function isComplexComponent(name?: string): string | undefined;
4
- export declare function isGsdH5ReactComponent(name?: string): string | undefined;
5
- export declare function addDefaultSlot(slotKey: string[] | undefined, comp: any): void;
6
- export declare function addDefaultData(defaultData: any, comp: any): void;
7
- export declare function isComplexJSON(json: any): any;
8
- export declare function getComponentChildren(component: any): [string, unknown][];
9
- export declare function isWeAppId(key?: string): RegExpMatchArray | null;
10
- export declare function isEmptyObject(obj?: {}): boolean;
11
- export declare function isPlainObject(src: any): boolean;
12
- export declare function checkIsNeedAddFormWrapper(tree: any): boolean;
13
- export declare function findComponentInTree(tree: any, cb: (cmp: any, path: string) => any, path?: string): any;
1
+ export declare function init(json: any): void;
2
+ export declare function getId(): string;
3
+ export declare function isComplexComponent(name?: string): string;
4
+ export declare function isGsdH5ReactComponent(name?: string): string;
5
+ export declare function addDefaultSlot(slotKey: string[], comp: any): void;
6
+ export declare function addDefaultData(defaultData: any, comp: any): void;
7
+ export declare function isComplexJSON(json: any): any;
8
+ export declare function getComponentChildren(component: any): [string, unknown][];
9
+ export declare function isWeAppId(key?: string): RegExpMatchArray;
10
+ export declare function isEmptyObject(obj?: {}): boolean;
11
+ export declare function isPlainObject(src: any): boolean;
12
+ export declare function checkIsNeedAddFormWrapper(tree: any): boolean;
13
+ export declare function findComponentInTree(tree: any, cb: (cmp: any, path: string) => any, path?: string): any;
14
14
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/parser/cals/utils/version/utils.ts"],"names":[],"mappings":"AAKA,wBAAgB,IAAI,CAAC,IAAI,EAAE,GAAG,QA2B7B;AAED,wBAAgB,KAAK,WAEpB;AAED,wBAAgB,kBAAkB,CAAC,IAAI,SAAK,sBAQ3C;AAED,wBAAgB,qBAAqB,CAAC,IAAI,SAAK,sBAQ9C;AAED,wBAAgB,cAAc,CAAC,OAAO,sBAAe,EAAE,IAAI,EAAE,GAAG,QAO/D;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,QAKzD;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,GAAG,OAItC;AAED,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,GAAG,uBASlD;AAED,wBAAgB,SAAS,CAAC,GAAG,SAAK,2BAEjC;AAED,wBAAgB,aAAa,CAAC,GAAG,KAAK,WAErC;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,WAErC;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,GAAG,WAkBlD;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,GAAG,EAAE,IAAI,SAAK,GAAG,GAAG,CAmBlG"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/parser/cals/utils/version/utils.ts"],"names":[],"mappings":"AAKA,wBAAgB,IAAI,CAAC,IAAI,EAAE,GAAG,QA2B7B;AAED,wBAAgB,KAAK,WAEpB;AAED,wBAAgB,kBAAkB,CAAC,IAAI,SAAK,UAQ3C;AAED,wBAAgB,qBAAqB,CAAC,IAAI,SAAK,UAQ9C;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAO,EAAE,IAAI,EAAE,GAAG,QAO/D;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,QAKzD;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,GAAG,OAItC;AAED,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,GAAG,uBASlD;AAED,wBAAgB,SAAS,CAAC,GAAG,SAAK,oBAEjC;AAED,wBAAgB,aAAa,CAAC,GAAG,KAAK,WAErC;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,WAErC;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,GAAG,WAkBlD;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,GAAG,EAAE,IAAI,SAAK,GAAG,GAAG,CAmBlG"}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.findComponentInTree = exports.checkIsNeedAddFormWrapper = exports.isPlainObject = exports.isEmptyObject = exports.isWeAppId = exports.getComponentChildren = exports.isComplexJSON = exports.addDefaultData = exports.addDefaultSlot = exports.isGsdH5ReactComponent = exports.isComplexComponent = exports.getId = exports.init = void 0;
4
4
  const config_1 = require("./config");
5
- const lodash_es_1 = require("lodash-es");
5
+ const lodash_1 = require("lodash");
6
6
  const ids = [];
7
7
  let maxId = 10000;
8
8
  function init(json) {
@@ -71,7 +71,7 @@ function addDefaultData(defaultData, comp) {
71
71
  // @ts-ignore
72
72
  comp.xProps = comp.xProps || {};
73
73
  comp.xProps.data = comp.xProps.data || {};
74
- comp.xProps.data = (0, lodash_es_1.merge)(defaultData, comp.xProps.data);
74
+ comp.xProps.data = (0, lodash_1.merge)(defaultData, comp.xProps.data);
75
75
  }
76
76
  exports.addDefaultData = addDefaultData;
77
77
  function isComplexJSON(json) {
@@ -0,0 +1,2 @@
1
+ export declare const OFFICIAL_LIB_KEY = "gsd-h5-react";
2
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/parser/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,iBAAiB,CAAC"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OFFICIAL_LIB_KEY = void 0;
4
+ exports.OFFICIAL_LIB_KEY = 'gsd-h5-react';
@@ -1,123 +1,123 @@
1
- import { Node, Options } from 'acorn';
2
- export declare const PARSE_CONFIG: Options;
3
- export declare const AST_TYPE: {
4
- Literal: string;
5
- ExpressionStatement: string;
6
- LogicalExpression: string;
7
- BinaryExpression: string;
8
- UnaryExpression: string;
9
- MemberExpression: string;
10
- Identifier: string;
11
- ArrayExpression: string;
12
- CallExpression: string;
13
- TemplateLiteral: string;
14
- TemplateElement: string;
15
- ConditionalExpression: string;
16
- SequenceExpression: string;
17
- };
18
- export declare enum PropBindType {
19
- static = "static",
20
- state = "rematch",
21
- computed = "computed",
22
- forItem = "for-item",
23
- expression = "expression",
24
- prop = "prop",
25
- slot = "slot",
26
- dataVar = "dataVar",
27
- stateData = "state",
28
- /**
29
- * @deprecated
30
- */
31
- paramData = "params",
32
- params = "params",
33
- scope = "scope"
34
- }
35
- export declare enum ActionType {
36
- Rematch = "rematch",
37
- Material = "material",
38
- GeneralFunc = "general-func",
39
- LifeCycle = "lifecycle",
40
- PropEvent = "prop-event",
41
- HandlerFn = "handler-fn",
42
- Inline = "inline",
43
- Platform = "platform",
44
- DataSource = "dataSource"
45
- }
46
- export interface IDynamicValue {
47
- type: PropBindType;
48
- value: any;
49
- extra?: any;
50
- }
51
- export interface IDataBind {
52
- propertyPath: string;
53
- bindDataPath: string;
54
- type?: PropBindType;
55
- extra?: any;
56
- }
57
- interface NodeEx extends Node {
58
- $parent: NodeEx;
59
- $path: any[];
60
- expressions: NodeEx[];
61
- /**
62
- * LogicalExpression
63
- */
64
- left: NodeEx;
65
- right: NodeEx;
66
- /**
67
- * UnaryExpression
68
- */
69
- operator: string;
70
- prefix: boolean;
71
- /**
72
- * MemberExpression
73
- */
74
- property: NodeEx;
75
- object: NodeEx;
76
- computed: boolean;
77
- /**
78
- * Literal
79
- */
80
- name: string;
81
- value: any;
82
- regex: any;
83
- }
84
- /**
85
- * 检查全局变量静态访问是否符合要求
86
- * @export
87
- * @param {*} expression
88
- */
89
- export declare function parseMemberProperty(expression: NodeEx, checkMemberProperty?: (path: any[]) => void): (string | number)[];
90
- interface IDynamicValueParserOptions {
91
- type: PropBindType;
92
- value?: string;
93
- expression?: any;
94
- pageId?: string;
95
- }
96
- export declare class DynamicValueParser {
97
- expression: NodeEx;
98
- expressionString: string;
99
- options: IDynamicValueParserOptions;
100
- constructor(expressionString: string, options?: Partial<IDynamicValueParserOptions>);
101
- /**
102
- * parser
103
- */
104
- parse(): IDynamicValueParserOptions;
105
- linkBinaryExpression(expression: NodeEx): void;
106
- parseBinaryExpression(expression: NodeEx, options: this['options']): IDynamicValueParserOptions;
107
- parseSimpleExpression(expression: NodeEx, options: this['options']): IDynamicValueParserOptions;
108
- parseItemAliseExpression(expression: NodeEx, options: this['options']): this["options"];
109
- _generatePrefix(memberProperty: (number | string)[], index: number): string;
110
- _replaceExpression(meta: {
111
- memberProperty: (number | string)[];
112
- index: number;
113
- replacer: string;
114
- expressionString?: string;
115
- }): string;
116
- parseDataset(expression: NodeEx, meta: {
117
- memberProperty: (number | string)[];
118
- index: number;
119
- replacer: string;
120
- }, options: this['options']): IDynamicValueParserOptions;
121
- }
122
- export {};
1
+ import { Node, Options } from 'acorn';
2
+ export declare const PARSE_CONFIG: Options;
3
+ export declare const AST_TYPE: {
4
+ Literal: string;
5
+ ExpressionStatement: string;
6
+ LogicalExpression: string;
7
+ BinaryExpression: string;
8
+ UnaryExpression: string;
9
+ MemberExpression: string;
10
+ Identifier: string;
11
+ ArrayExpression: string;
12
+ CallExpression: string;
13
+ TemplateLiteral: string;
14
+ TemplateElement: string;
15
+ ConditionalExpression: string;
16
+ SequenceExpression: string;
17
+ };
18
+ export declare enum PropBindType {
19
+ static = "static",
20
+ state = "rematch",
21
+ computed = "computed",
22
+ forItem = "for-item",
23
+ expression = "expression",
24
+ prop = "prop",
25
+ slot = "slot",
26
+ dataVar = "dataVar",
27
+ stateData = "state",
28
+ /**
29
+ * @deprecated
30
+ */
31
+ paramData = "params",
32
+ params = "params",
33
+ scope = "scope"
34
+ }
35
+ export declare enum ActionType {
36
+ Rematch = "rematch",
37
+ Material = "material",
38
+ GeneralFunc = "general-func",
39
+ LifeCycle = "lifecycle",
40
+ PropEvent = "prop-event",
41
+ HandlerFn = "handler-fn",
42
+ Inline = "inline",
43
+ Platform = "platform",
44
+ DataSource = "dataSource"
45
+ }
46
+ export interface IDynamicValue {
47
+ type: PropBindType;
48
+ value: any;
49
+ extra?: any;
50
+ }
51
+ export interface IDataBind {
52
+ propertyPath: string;
53
+ bindDataPath: string;
54
+ type?: PropBindType;
55
+ extra?: any;
56
+ }
57
+ interface NodeEx extends Node {
58
+ $parent: NodeEx;
59
+ $path: any[];
60
+ expressions: NodeEx[];
61
+ /**
62
+ * LogicalExpression
63
+ */
64
+ left: NodeEx;
65
+ right: NodeEx;
66
+ /**
67
+ * UnaryExpression
68
+ */
69
+ operator: string;
70
+ prefix: boolean;
71
+ /**
72
+ * MemberExpression
73
+ */
74
+ property: NodeEx;
75
+ object: NodeEx;
76
+ computed: boolean;
77
+ /**
78
+ * Literal
79
+ */
80
+ name: string;
81
+ value: any;
82
+ regex: any;
83
+ }
84
+ /**
85
+ * 检查全局变量静态访问是否符合要求
86
+ * @export
87
+ * @param {*} expression
88
+ */
89
+ export declare function parseMemberProperty(expression: NodeEx, checkMemberProperty?: (path: any[]) => void): (string | number)[];
90
+ interface IDynamicValueParserOptions {
91
+ type: PropBindType;
92
+ value?: string;
93
+ expression?: any;
94
+ pageId?: string;
95
+ }
96
+ export declare class DynamicValueParser {
97
+ expression: NodeEx;
98
+ expressionString: string;
99
+ options: IDynamicValueParserOptions;
100
+ constructor(expressionString: string, options?: Partial<IDynamicValueParserOptions>);
101
+ /**
102
+ * parser
103
+ */
104
+ parse(): IDynamicValueParserOptions;
105
+ linkBinaryExpression(expression: NodeEx): void;
106
+ parseBinaryExpression(expression: NodeEx, options: this['options']): IDynamicValueParserOptions;
107
+ parseSimpleExpression(expression: NodeEx, options: this['options']): IDynamicValueParserOptions;
108
+ parseItemAliseExpression(expression: NodeEx, options: this['options']): this["options"];
109
+ _generatePrefix(memberProperty: (number | string)[], index: number): string;
110
+ _replaceExpression(meta: {
111
+ memberProperty: (number | string)[];
112
+ index: number;
113
+ replacer: string;
114
+ expressionString?: string;
115
+ }): string;
116
+ parseDataset(expression: NodeEx, meta: {
117
+ memberProperty: (number | string)[];
118
+ index: number;
119
+ replacer: string;
120
+ }, options: this['options']): IDynamicValueParserOptions;
121
+ }
122
+ export {};
123
123
  //# sourceMappingURL=index.d.ts.map
File without changes
File without changes