@byteluck-fe/model-driven-engine 2.22.2-beta.8 → 2.22.3-beta.10

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 (32) hide show
  1. package/README.md +30 -30
  2. package/dist/esm/common/ActionManager.js +4 -4
  3. package/dist/esm/common/Engine.js +67 -95
  4. package/dist/esm/common/Runtime.js +14 -30
  5. package/dist/esm/common/Store.js +18 -13
  6. package/dist/esm/common/checkerValue.js +17 -37
  7. package/dist/esm/common/proxyState.js +18 -18
  8. package/dist/esm/plugins/CalcPlugin.js +43 -43
  9. package/dist/esm/plugins/ControlsEventPlugin.js +2 -2
  10. package/dist/esm/plugins/LifecycleEventPlugin.js +2 -2
  11. package/dist/esm/plugins/StylePlugin.js +7 -7
  12. package/dist/index.umd.js +7 -56
  13. package/dist/types/common/ActionManager.d.ts +14 -14
  14. package/dist/types/common/DataManager.d.ts +10 -10
  15. package/dist/types/common/Engine.d.ts +201 -201
  16. package/dist/types/common/OkWorker.d.ts +13 -13
  17. package/dist/types/common/Plugin.d.ts +6 -6
  18. package/dist/types/common/Runtime.d.ts +31 -31
  19. package/dist/types/common/Store.d.ts +54 -54
  20. package/dist/types/common/checkerValue.d.ts +3 -3
  21. package/dist/types/common/index.d.ts +2 -2
  22. package/dist/types/common/proxyState.d.ts +30 -30
  23. package/dist/types/index.d.ts +3 -3
  24. package/dist/types/plugins/CalcPlugin.d.ts +121 -121
  25. package/dist/types/plugins/ControlsEventPlugin.d.ts +17 -17
  26. package/dist/types/plugins/ES6ModulePlugin.d.ts +27 -27
  27. package/dist/types/plugins/LifecycleEventPlugin.d.ts +15 -15
  28. package/dist/types/plugins/StylePlugin.d.ts +13 -13
  29. package/dist/types/plugins/index.d.ts +5 -5
  30. package/dist/types/utils/index.d.ts +1 -1
  31. package/dist/types/utils/runtimeUtils.d.ts +5 -5
  32. package/package.json +4 -4
package/README.md CHANGED
@@ -1,30 +1,30 @@
1
- # Engine
2
- 运行态引擎
3
-
4
- ```
5
- │ index.ts // 入口文件
6
-
7
- ├─common // 引擎相关
8
- │ ActionManager.ts // utils操作管理
9
- │ checkerValue.ts // 表单值校验器
10
- │ DataManager.ts // 数据源容器
11
- │ Engine.ts // 引擎
12
- │ index.ts // 入口
13
- │ OkWorker.ts // 无用
14
- │ Plugin.ts // 插件
15
- │ proxyState.ts // 劫持引擎表单数据
16
- │ Runtime.ts // 控件注册和创建
17
- │ Store.ts // 数据管理
18
-
19
- ├─plugins
20
- │ CalcPlugin.ts // 计算公式插件
21
- │ ControlsEventPlugin.ts // 控件二开事件插件
22
- │ ES6ModulePlugin.ts //
23
- │ index.ts
24
- │ LifecycleEventPlugin.ts // 页面生命周期事件
25
- │ StylePlugin.ts // css二开
26
-
27
- └─utils
28
- index.ts
29
- runtimeUtils.ts // 工具函数
30
- ```
1
+ # Engine
2
+ 运行态引擎
3
+
4
+ ```
5
+ │ index.ts // 入口文件
6
+
7
+ ├─common // 引擎相关
8
+ │ ActionManager.ts // utils操作管理
9
+ │ checkerValue.ts // 表单值校验器
10
+ │ DataManager.ts // 数据源容器
11
+ │ Engine.ts // 引擎
12
+ │ index.ts // 入口
13
+ │ OkWorker.ts // 无用
14
+ │ Plugin.ts // 插件
15
+ │ proxyState.ts // 劫持引擎表单数据
16
+ │ Runtime.ts // 控件注册和创建
17
+ │ Store.ts // 数据管理
18
+
19
+ ├─plugins
20
+ │ CalcPlugin.ts // 计算公式插件
21
+ │ ControlsEventPlugin.ts // 控件二开事件插件
22
+ │ ES6ModulePlugin.ts //
23
+ │ index.ts
24
+ │ LifecycleEventPlugin.ts // 页面生命周期事件
25
+ │ StylePlugin.ts // css二开
26
+
27
+ └─utils
28
+ index.ts
29
+ runtimeUtils.ts // 工具函数
30
+ ```
@@ -186,11 +186,11 @@ export var ActionManager = /*#__PURE__*/ function() {
186
186
  _class_call_check(this, ActionManager);
187
187
  _define_property(this, "actionMap", new Map());
188
188
  _define_property(this, "buildinActions", {});
189
- /**
190
- * 执行action的时候,作为第二个参数传递给方法,可以通过外部挂载
189
+ /**
190
+ * 执行action的时候,作为第二个参数传递给方法,可以通过外部挂载
191
191
  */ _define_property(this, "actionUtils", {});
192
- /**
193
- * 用于存储es module解析出来的源码,CustomVueControlPlugin
192
+ /**
193
+ * 用于存储es module解析出来的源码,CustomVueControlPlugin
194
194
  */ _define_property(this, "sources", {});
195
195
  }
196
196
  _create_class(ActionManager, [
@@ -44,6 +44,10 @@ function _async_to_generator(fn) {
44
44
  });
45
45
  };
46
46
  }
47
+ function _call_super(_this, derived, args) {
48
+ derived = _get_prototype_of(derived);
49
+ return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
50
+ }
47
51
  function _class_call_check(instance, Constructor) {
48
52
  if (!(instance instanceof Constructor)) {
49
53
  throw new TypeError("Cannot call a class as a function");
@@ -222,28 +226,12 @@ function _unsupported_iterable_to_array(o, minLen) {
222
226
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
223
227
  }
224
228
  function _is_native_reflect_construct() {
225
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
226
- if (Reflect.construct.sham) return false;
227
- if (typeof Proxy === "function") return true;
228
229
  try {
229
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
230
- return true;
231
- } catch (e) {
232
- return false;
233
- }
234
- }
235
- function _create_super(Derived) {
236
- var hasNativeReflectConstruct = _is_native_reflect_construct();
237
- return function _createSuperInternal() {
238
- var Super = _get_prototype_of(Derived), result;
239
- if (hasNativeReflectConstruct) {
240
- var NewTarget = _get_prototype_of(this).constructor;
241
- result = Reflect.construct(Super, arguments, NewTarget);
242
- } else {
243
- result = Super.apply(this, arguments);
244
- }
245
- return _possible_constructor_return(this, result);
246
- };
230
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
231
+ } catch (_) {}
232
+ return (_is_native_reflect_construct = function() {
233
+ return !!result;
234
+ })();
247
235
  }
248
236
  function _ts_generator(thisArg, body) {
249
237
  var f, y, t, g, _ = {
@@ -341,7 +329,7 @@ function _ts_generator(thisArg, body) {
341
329
  }
342
330
  }
343
331
  import { isDataBind } from '@byteluck-fe/model-driven-core';
344
- import { CONTROL_BASE_TYPE, CONTROL_TYPE, DEFAULT_LOCALE, error, genNonDuplicateId, isString, JSONCopy, log, RulesMessage, updateValueFromKeys, warn, Watcher, isBuiltInControls } from '@byteluck-fe/model-driven-shared';
332
+ import { CONTROL_BASE_TYPE, CONTROL_TYPE, DEFAULT_LOCALE, error, genNonDuplicateId, isString, JSONCopy, log, updateValueFromKeys, warn, Watcher, isBuiltInControls } from '@byteluck-fe/model-driven-shared';
345
333
  import { Runtime } from './Runtime';
346
334
  import { Store } from './Store';
347
335
  import { findItem, proxyState } from './proxyState';
@@ -361,34 +349,17 @@ var applyingPluginName = '';
361
349
  var Engine = /*#__PURE__*/ function(Watcher) {
362
350
  "use strict";
363
351
  _inherits(Engine, Watcher);
364
- var _super = _create_super(Engine);
365
352
  function Engine(props) {
366
353
  _class_call_check(this, Engine);
367
354
  var _this;
368
- _this = _super.call(this);
369
- _define_property(_assert_this_initialized(_this), "store", void 0);
370
- _define_property(_assert_this_initialized(_this), "rawStore", {});
371
- _define_property(_assert_this_initialized(_this), "parent", void 0);
372
- // 提供注册运行态控件以及实例化控件的能力
373
- _define_property(_assert_this_initialized(_this), "runtime", void 0);
374
- // 提供子线程处理脚本以及修改数据的能力
355
+ _this = _call_super(this, Engine), _define_property(_this, "store", void 0), _define_property(_this, "rawStore", {}), _define_property(_this, "parent", void 0), // 提供注册运行态控件以及实例化控件的能力
356
+ _define_property(_this, "runtime", void 0), // 提供子线程处理脚本以及修改数据的能力
375
357
  // public worker: OkWorker
376
- _define_property(_assert_this_initialized(_this), "isMounted", false);
377
- _define_property(_assert_this_initialized(_this), "id", genNonDuplicateId(8));
378
- _define_property(_assert_this_initialized(_this), "externalParams", void 0);
379
- _define_property(_assert_this_initialized(_this), "children", void 0);
380
- // 提供外部注册插件,在不同的hooks触发时执行固定函数的能力
381
- _define_property(_assert_this_initialized(_this), "__plugins", void 0);
382
- _define_property(_assert_this_initialized(_this), "__pluginsApplied", false);
383
- _define_property(_assert_this_initialized(_this), "$options", void 0);
384
- _define_property(_assert_this_initialized(_this), "actionManager", new ActionManager());
385
- _define_property(_assert_this_initialized(_this), "dataManager", void 0);
386
- _define_property(_assert_this_initialized(_this), "_jobTasks", []);
387
- _define_property(_assert_this_initialized(_this), "createControlInstance", _this.createInstance);
358
+ _define_property(_this, "isMounted", false), _define_property(_this, "id", genNonDuplicateId(8)), _define_property(_this, "externalParams", void 0), _define_property(_this, "children", void 0), // 提供外部注册插件,在不同的hooks触发时执行固定函数的能力
359
+ _define_property(_this, "__plugins", void 0), _define_property(_this, "__pluginsApplied", false), _define_property(_this, "$options", void 0), _define_property(_this, "actionManager", new ActionManager()), _define_property(_this, "dataManager", void 0), _define_property(_this, "_jobTasks", []), _define_property(_this, "createControlInstance", _this.createInstance);
388
360
  _this.$options = Object.freeze(props);
389
361
  var _this_$options = _this.$options, _this_$options_autoMount = _this_$options.autoMount, autoMount = _this_$options_autoMount === void 0 ? true : _this_$options_autoMount, schema = _this_$options.schema, beforeCreateInstance = _this_$options.beforeCreateInstance, externalParams = _this_$options.externalParams, _this_$options_language = _this_$options.// fieldModel,
390
362
  language, language = _this_$options_language === void 0 ? DEFAULT_LOCALE : _this_$options_language, _this_$options_debug = _this_$options.debug, debug = _this_$options_debug === void 0 ? false : _this_$options_debug, messagesI18n = _this_$options.messagesI18n, children = _this_$options.children;
391
- RulesMessage.setLocale(language, messagesI18n);
392
363
  _this.debug = debug;
393
364
  _this.runtime = new Runtime({
394
365
  schema: schema,
@@ -625,6 +596,7 @@ var Engine = /*#__PURE__*/ function(Watcher) {
625
596
  {
626
597
  key: "_handlerSubtableUpdateUid",
627
598
  value: function _handlerSubtableUpdateUid(subtableData) {
599
+ ;
628
600
  subtableData.forEach(function(item) {
629
601
  if (!item.uid) {
630
602
  Object.assign(item, {
@@ -978,9 +950,9 @@ var Engine = /*#__PURE__*/ function(Watcher) {
978
950
  }
979
951
  },
980
952
  {
981
- /**
982
- * 设置payload的options,提供在不是使用标准api修改state的时候可以传递options,会在本次任务执行完成之后清空
983
- * @param options 需要携带的options
953
+ /**
954
+ * 设置payload的options,提供在不是使用标准api修改state的时候可以传递options,会在本次任务执行完成之后清空
955
+ * @param options 需要携带的options
984
956
  * */ key: "setPayloadOptions",
985
957
  value: function setPayloadOptions(options) {
986
958
  eventOptionsTemp = options;
@@ -997,9 +969,9 @@ var Engine = /*#__PURE__*/ function(Watcher) {
997
969
  }
998
970
  },
999
971
  {
1000
- /**
1001
- * 向Store设置一组值,明细表必须全量赋值,并触发事件(触发事件是根据组件在页面中的顺序逐个触发)
1002
- * @param states
972
+ /**
973
+ * 向Store设置一组值,明细表必须全量赋值,并触发事件(触发事件是根据组件在页面中的顺序逐个触发)
974
+ * @param states
1003
975
  */ key: "setStates",
1004
976
  value: function setStates(states, rowIndex, options) {
1005
977
  var _this = this;
@@ -1026,11 +998,11 @@ var Engine = /*#__PURE__*/ function(Watcher) {
1026
998
  }
1027
999
  },
1028
1000
  {
1029
- /**
1030
- * 通过dataCode和fieldCode来获取控件的值
1031
- * @param dataCode 模型编码 - 如果是主表的话就是主表的模型编码,明细子表的话就是子表的模型编码
1032
- * @param fieldCode 字段编码 - 控件绑定的数据项的编码
1033
- * @param rowIndex 行下标 - 如果是明细子表中的控件需要提供
1001
+ /**
1002
+ * 通过dataCode和fieldCode来获取控件的值
1003
+ * @param dataCode 模型编码 - 如果是主表的话就是主表的模型编码,明细子表的话就是子表的模型编码
1004
+ * @param fieldCode 字段编码 - 控件绑定的数据项的编码
1005
+ * @param rowIndex 行下标 - 如果是明细子表中的控件需要提供
1034
1006
  * */ key: "getField",
1035
1007
  value: function getField(dataCode, fieldCode, rowIndex) {
1036
1008
  if (!fieldCode) {
@@ -1145,13 +1117,13 @@ var Engine = /*#__PURE__*/ function(Watcher) {
1145
1117
  }
1146
1118
  },
1147
1119
  {
1148
- /**
1149
- * 通过dataCode和fieldCode来设置控件的值
1150
- * @param dataCode 模型编码 - 如果是主表的话就是主表的模型编码,明细子表的话就是子表的模型编码
1151
- * @param fieldCode 字段编码 - 控件绑定的数据项的编码
1152
- * @param value 修改的值
1153
- * @param rowIndex 行下标 - 如果是明细子表中的控件需要提供
1154
- * @param options 触发事件携带的参数
1120
+ /**
1121
+ * 通过dataCode和fieldCode来设置控件的值
1122
+ * @param dataCode 模型编码 - 如果是主表的话就是主表的模型编码,明细子表的话就是子表的模型编码
1123
+ * @param fieldCode 字段编码 - 控件绑定的数据项的编码
1124
+ * @param value 修改的值
1125
+ * @param rowIndex 行下标 - 如果是明细子表中的控件需要提供
1126
+ * @param options 触发事件携带的参数
1155
1127
  * */ key: "setField",
1156
1128
  value: function setField(dataCode, fieldCode, value, rowIndex, options) {
1157
1129
  var dataBindMapping = this.getDataBindMapping(dataCode, fieldCode);
@@ -1179,12 +1151,12 @@ var Engine = /*#__PURE__*/ function(Watcher) {
1179
1151
  }
1180
1152
  },
1181
1153
  {
1182
- /**
1183
- * 通过dataCode和 state来给一组控件赋值,并触发事件携带options
1184
- * @param dataCode 需要赋值的目标模型
1185
- * @param state 赋值对象,以fieldCode为key组成的对象
1186
- * @param rowIndex 行下标,给明细子表赋值时指定赋值某行
1187
- * @param options 触发事件携带的参数
1154
+ /**
1155
+ * 通过dataCode和 state来给一组控件赋值,并触发事件携带options
1156
+ * @param dataCode 需要赋值的目标模型
1157
+ * @param state 赋值对象,以fieldCode为key组成的对象
1158
+ * @param rowIndex 行下标,给明细子表赋值时指定赋值某行
1159
+ * @param options 触发事件携带的参数
1188
1160
  * */ key: "setFields",
1189
1161
  value: function setFields(dataCode, state, rowIndex, options) {
1190
1162
  var _this = this;
@@ -1225,10 +1197,10 @@ var Engine = /*#__PURE__*/ function(Watcher) {
1225
1197
  }
1226
1198
  },
1227
1199
  {
1228
- /**
1229
- * 通过dataCode来将state转化为标准的state结构
1230
- * @param dataCode 需要转换的目标模型code
1231
- * @param state 值对象,以fieldCode为key组成的对象
1200
+ /**
1201
+ * 通过dataCode来将state转化为标准的state结构
1202
+ * @param dataCode 需要转换的目标模型code
1203
+ * @param state 值对象,以fieldCode为key组成的对象
1232
1204
  * */ key: "buildFields",
1233
1205
  value: function buildFields(dataCode, state) {
1234
1206
  var _this = this;
@@ -1269,10 +1241,10 @@ var Engine = /*#__PURE__*/ function(Watcher) {
1269
1241
  }
1270
1242
  },
1271
1243
  {
1272
- /**
1273
- * 向Store设置一组值,并触发事件携带options
1274
- * @param dataSet
1275
- * @options 传递给关联事件中 EventPayload中的options,一般在plugin中监听使用
1244
+ /**
1245
+ * 向Store设置一组值,并触发事件携带options
1246
+ * @param dataSet
1247
+ * @options 传递给关联事件中 EventPayload中的options,一般在plugin中监听使用
1276
1248
  */ key: "setData",
1277
1249
  value: function setData(dataSet, options) {
1278
1250
  var _this = this;
@@ -1410,19 +1382,19 @@ var Engine = /*#__PURE__*/ function(Watcher) {
1410
1382
  }
1411
1383
  },
1412
1384
  {
1413
- /**
1414
- * 获取控件的dataBind
1415
- * @param controlId
1385
+ /**
1386
+ * 获取控件的dataBind
1387
+ * @param controlId
1416
1388
  * */ key: "getDataBind",
1417
1389
  value: function getDataBind(controlId) {
1418
1390
  return this.store.getDataBind(controlId);
1419
1391
  }
1420
1392
  },
1421
1393
  {
1422
- /**
1423
- * 获取组件实例,传入rowIndex代表获取明细表内的控件实例,rowIndex传入-1代表获取表头内的实例
1424
- * @param controlId
1425
- * @param rowIndex
1394
+ /**
1395
+ * 获取组件实例,传入rowIndex代表获取明细表内的控件实例,rowIndex传入-1代表获取表头内的实例
1396
+ * @param controlId
1397
+ * @param rowIndex
1426
1398
  */ key: "getInstance",
1427
1399
  value: function getInstance(controlId, rowIndex) {
1428
1400
  var instances = this.getInstances(controlId, rowIndex === -1);
@@ -1441,10 +1413,10 @@ var Engine = /*#__PURE__*/ function(Watcher) {
1441
1413
  }
1442
1414
  },
1443
1415
  {
1444
- /**
1445
- * 获取组件实例,明细表中的组件将会得到数组, 第二个参数为(false/不传入)则获取到的是明细表内不包含表头内实例的所有控件实例,传入true则获取到包含表头内实例的所有控件实例,表头内实例永远在下标0的位置
1446
- * @param controlId
1447
- * @param header 明细表内是否获取表头的控件
1416
+ /**
1417
+ * 获取组件实例,明细表中的组件将会得到数组, 第二个参数为(false/不传入)则获取到的是明细表内不包含表头内实例的所有控件实例,传入true则获取到包含表头内实例的所有控件实例,表头内实例永远在下标0的位置
1418
+ * @param controlId
1419
+ * @param header 明细表内是否获取表头的控件
1448
1420
  */ // getInstances(
1449
1421
  // controlId?: string,
1450
1422
  // header: boolean = false
@@ -1620,27 +1592,27 @@ var Engine = /*#__PURE__*/ function(Watcher) {
1620
1592
  },
1621
1593
  {
1622
1594
  key: "assertInstance",
1623
- value: /**
1624
- * 判断控件的类型,返回当前控件的正确类型
1595
+ value: /**
1596
+ * 判断控件的类型,返回当前控件的正确类型
1625
1597
  * */ function assertInstance(instance, types) {
1626
1598
  return isString(types) ? instance.type === types : types.includes(instance.type);
1627
1599
  }
1628
1600
  },
1629
1601
  {
1630
1602
  key: "assertInstanceIsCustomControl",
1631
- value: /**
1632
- * 判断控件或控件类型是一个自定义控件
1603
+ value: /**
1604
+ * 判断控件或控件类型是一个自定义控件
1633
1605
  * */ function assertInstanceIsCustomControl(instance) {
1634
1606
  return !isBuiltInControls(isString(instance) ? instance : instance.type);
1635
1607
  }
1636
1608
  },
1637
1609
  {
1638
1610
  key: "getInstanceRowIndex",
1639
- value: /**
1640
- * 获取控件在明细子表中的行下标,
1641
- * 如果控件在表头内,则返回-1
1642
- * 如果控件在表内,则返回行下标
1643
- * 如果控件不在明细表内,则返回undefined
1611
+ value: /**
1612
+ * 获取控件在明细子表中的行下标,
1613
+ * 如果控件在表头内,则返回-1
1614
+ * 如果控件在表内,则返回行下标
1615
+ * 如果控件不在明细表内,则返回undefined
1644
1616
  * */ // public getInstanceRowIndex(
1645
1617
  // instance: ControlRuntimeInstance<ControlsKeys> | RuntimeControl
1646
1618
  // ) {
@@ -4,6 +4,10 @@ function _assert_this_initialized(self) {
4
4
  }
5
5
  return self;
6
6
  }
7
+ function _call_super(_this, derived, args) {
8
+ derived = _get_prototype_of(derived);
9
+ return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
10
+ }
7
11
  function _class_call_check(instance, Constructor) {
8
12
  if (!(instance instanceof Constructor)) {
9
13
  throw new TypeError("Cannot call a class as a function");
@@ -73,28 +77,12 @@ function _type_of(obj) {
73
77
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
74
78
  }
75
79
  function _is_native_reflect_construct() {
76
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
77
- if (Reflect.construct.sham) return false;
78
- if (typeof Proxy === "function") return true;
79
80
  try {
80
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
81
- return true;
82
- } catch (e) {
83
- return false;
84
- }
85
- }
86
- function _create_super(Derived) {
87
- var hasNativeReflectConstruct = _is_native_reflect_construct();
88
- return function _createSuperInternal() {
89
- var Super = _get_prototype_of(Derived), result;
90
- if (hasNativeReflectConstruct) {
91
- var NewTarget = _get_prototype_of(this).constructor;
92
- result = Reflect.construct(Super, arguments, NewTarget);
93
- } else {
94
- result = Super.apply(this, arguments);
95
- }
96
- return _possible_constructor_return(this, result);
97
- };
81
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
82
+ } catch (_) {}
83
+ return (_is_native_reflect_construct = function() {
84
+ return !!result;
85
+ })();
98
86
  }
99
87
  import { RegisterControls, isDataBind } from '@byteluck-fe/model-driven-core';
100
88
  import { CONTROL_BASE_TYPE, CONTROL_TYPE, JSONCopy, loopFormSchema, isArray } from '@byteluck-fe/model-driven-shared';
@@ -102,16 +90,12 @@ import { hasChildrenControl, loopDataViewControl, loopFormControl } from '../uti
102
90
  export var Runtime = /*#__PURE__*/ function(RegisterControls) {
103
91
  "use strict";
104
92
  _inherits(Runtime, RegisterControls);
105
- var _super = _create_super(Runtime);
106
93
  function Runtime(props) {
107
94
  _class_call_check(this, Runtime);
108
95
  var _this;
109
- _this = _super.call(this, 'Runtime');
110
- _define_property(_assert_this_initialized(_this), "_schema", void 0);
111
- _define_property(_assert_this_initialized(_this), "_instance", void 0);
112
- _define_property(_assert_this_initialized(_this), "_flatInstances", []);
113
- _define_property(_assert_this_initialized(_this), "_instanceMap", {});
114
- _define_property(_assert_this_initialized(_this), "_controlParentIdMap", {});
96
+ _this = _call_super(this, Runtime, [
97
+ 'Runtime'
98
+ ]), _define_property(_this, "_schema", void 0), _define_property(_this, "_instance", void 0), _define_property(_this, "_flatInstances", []), _define_property(_this, "_instanceMap", {}), _define_property(_this, "_controlParentIdMap", {});
115
99
  var schema = props.schema;
116
100
  _this._schema = schema;
117
101
  _this._instance = _this.createControl(schema, props.beforeCreateInstance);
@@ -305,8 +289,8 @@ function loop(control, parentId, callback) {
305
289
  function hasHeaderOrFooterControl(control, checkType) {
306
290
  return checkType in control.props && isArray(control.props[checkType]);
307
291
  }
308
- /**
309
- * 控件是否在视图中隐藏,遍历查找所有parent
292
+ /**
293
+ * 控件是否在视图中隐藏,遍历查找所有parent
310
294
  * */ function getControlIsHide(control) {
311
295
  if (control.props.isHide) {
312
296
  return true;
@@ -69,10 +69,10 @@ var Store = /*#__PURE__*/ function() {
69
69
  }
70
70
  _create_class(Store, [
71
71
  {
72
- /**
73
- * 使用该方法仅改变数据,不会表单触发事件。明细表可全量赋值也可根据rowIndex进行单独设置
74
- * @param controlId 组件ID
75
- * @param value
72
+ /**
73
+ * 使用该方法仅改变数据,不会表单触发事件。明细表可全量赋值也可根据rowIndex进行单独设置
74
+ * @param controlId 组件ID
75
+ * @param value
76
76
  */ key: "setState",
77
77
  value: function setState(controlId, value, rowIndex) {
78
78
  var _this = this;
@@ -81,6 +81,7 @@ var Store = /*#__PURE__*/ function() {
81
81
  if (controlInfo !== undefined) {
82
82
  //明细表
83
83
  if (controlInfo.children) {
84
+ ;
84
85
  value.forEach(function(item) {
85
86
  if (!item.uid) {
86
87
  Object.assign(item, {
@@ -109,6 +110,7 @@ var Store = /*#__PURE__*/ function() {
109
110
  Object.keys(children).map(function(childControlId) {
110
111
  if (childControlId === controlId) {
111
112
  if (_this.state[dataView][subtableId][rowIndex]) {
113
+ ;
112
114
  _this.state[dataView][subtableId][rowIndex][controlId] = noProxyValue;
113
115
  }
114
116
  }
@@ -167,6 +169,7 @@ var Store = /*#__PURE__*/ function() {
167
169
  if (children !== undefined) {
168
170
  Object.keys(children).map(function(childControlId) {
169
171
  if (childControlId === controlId) {
172
+ ;
170
173
  _this.state[dataViewId][subtableId].map(function(item) {
171
174
  states.push(item[controlId]);
172
175
  });
@@ -364,15 +367,17 @@ item) {
364
367
  Object.keys(item.props.dataBind).map(function(key) {
365
368
  var dataBind = item.props.dataBind;
366
369
  var dataCode = dataBind[key].dataCode;
367
- data[dataCode].fields.push({
368
- fieldCode: dataBind[key].fieldCode,
369
- controlId: item.id,
370
- dataBind: dataBind,
371
- dataViewId: [
372
- dataViewId,
373
- subtableId
374
- ]
375
- });
370
+ if (dataBind[key].fieldCode !== '') {
371
+ data[dataCode].fields.push({
372
+ fieldCode: dataBind[key].fieldCode,
373
+ controlId: item.id,
374
+ dataBind: dataBind,
375
+ dataViewId: [
376
+ dataViewId,
377
+ subtableId
378
+ ]
379
+ });
380
+ }
376
381
  });
377
382
  } else {
378
383
  if (data[item.props.dataBind.dataCode] === undefined) {
@@ -12,6 +12,10 @@ function _assert_this_initialized(self) {
12
12
  }
13
13
  return self;
14
14
  }
15
+ function _call_super(_this, derived, args) {
16
+ derived = _get_prototype_of(derived);
17
+ return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
18
+ }
15
19
  function _class_call_check(instance, Constructor) {
16
20
  if (!(instance instanceof Constructor)) {
17
21
  throw new TypeError("Cannot call a class as a function");
@@ -134,28 +138,12 @@ function _unsupported_iterable_to_array(o, minLen) {
134
138
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
135
139
  }
136
140
  function _is_native_reflect_construct() {
137
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
138
- if (Reflect.construct.sham) return false;
139
- if (typeof Proxy === "function") return true;
140
141
  try {
141
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
142
- return true;
143
- } catch (e) {
144
- return false;
145
- }
146
- }
147
- function _create_super(Derived) {
148
- var hasNativeReflectConstruct = _is_native_reflect_construct();
149
- return function _createSuperInternal() {
150
- var Super = _get_prototype_of(Derived), result;
151
- if (hasNativeReflectConstruct) {
152
- var NewTarget = _get_prototype_of(this).constructor;
153
- result = Reflect.construct(Super, arguments, NewTarget);
154
- } else {
155
- result = Super.apply(this, arguments);
156
- }
157
- return _possible_constructor_return(this, result);
158
- };
142
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
143
+ } catch (_) {}
144
+ return (_is_native_reflect_construct = function() {
145
+ return !!result;
146
+ })();
159
147
  }
160
148
  import { isArray, isFunction, isString, isJSONArray, isJSONObject, isNumber, isNumberAndEmptyStringArray, isPlainObject, isStringArray, FieldTypes, isObject } from '@byteluck-fe/model-driven-shared';
161
149
  import { AddressValue, AmountValue, CalcValue, RangeDateValue } from '@byteluck-fe/model-driven-core';
@@ -167,10 +155,9 @@ var ValueChecker = function ValueChecker() {
167
155
  var StringValueChecker = /*#__PURE__*/ function(ValueChecker) {
168
156
  "use strict";
169
157
  _inherits(StringValueChecker, ValueChecker);
170
- var _super = _create_super(StringValueChecker);
171
158
  function StringValueChecker() {
172
159
  _class_call_check(this, StringValueChecker);
173
- return _super.apply(this, arguments);
160
+ return _call_super(this, StringValueChecker, arguments);
174
161
  }
175
162
  _create_class(StringValueChecker, [
176
163
  {
@@ -200,10 +187,9 @@ var StringValueChecker = /*#__PURE__*/ function(ValueChecker) {
200
187
  var NumberValueChecker = /*#__PURE__*/ function(ValueChecker) {
201
188
  "use strict";
202
189
  _inherits(NumberValueChecker, ValueChecker);
203
- var _super = _create_super(NumberValueChecker);
204
190
  function NumberValueChecker() {
205
191
  _class_call_check(this, NumberValueChecker);
206
- return _super.apply(this, arguments);
192
+ return _call_super(this, NumberValueChecker, arguments);
207
193
  }
208
194
  _create_class(NumberValueChecker, [
209
195
  {
@@ -232,10 +218,9 @@ var NumberValueChecker = /*#__PURE__*/ function(ValueChecker) {
232
218
  var StringArrayValueChecker = /*#__PURE__*/ function(ValueChecker) {
233
219
  "use strict";
234
220
  _inherits(StringArrayValueChecker, ValueChecker);
235
- var _super = _create_super(StringArrayValueChecker);
236
221
  function StringArrayValueChecker() {
237
222
  _class_call_check(this, StringArrayValueChecker);
238
- return _super.apply(this, arguments);
223
+ return _call_super(this, StringArrayValueChecker, arguments);
239
224
  }
240
225
  _create_class(StringArrayValueChecker, [
241
226
  {
@@ -277,10 +262,9 @@ var StringArrayValueChecker = /*#__PURE__*/ function(ValueChecker) {
277
262
  var NumberArrayValueChecker = /*#__PURE__*/ function(ValueChecker) {
278
263
  "use strict";
279
264
  _inherits(NumberArrayValueChecker, ValueChecker);
280
- var _super = _create_super(NumberArrayValueChecker);
281
265
  function NumberArrayValueChecker() {
282
266
  _class_call_check(this, NumberArrayValueChecker);
283
- return _super.apply(this, arguments);
267
+ return _call_super(this, NumberArrayValueChecker, arguments);
284
268
  }
285
269
  _create_class(NumberArrayValueChecker, [
286
270
  {
@@ -328,10 +312,9 @@ var NumberArrayValueChecker = /*#__PURE__*/ function(ValueChecker) {
328
312
  var MoneyValueChecker = /*#__PURE__*/ function(ValueChecker) {
329
313
  "use strict";
330
314
  _inherits(MoneyValueChecker, ValueChecker);
331
- var _super = _create_super(MoneyValueChecker);
332
315
  function MoneyValueChecker() {
333
316
  _class_call_check(this, MoneyValueChecker);
334
- return _super.apply(this, arguments);
317
+ return _call_super(this, MoneyValueChecker, arguments);
335
318
  }
336
319
  _create_class(MoneyValueChecker, [
337
320
  {
@@ -379,10 +362,9 @@ var MoneyValueChecker = /*#__PURE__*/ function(ValueChecker) {
379
362
  var TimeScopeValueChecker = /*#__PURE__*/ function(ValueChecker) {
380
363
  "use strict";
381
364
  _inherits(TimeScopeValueChecker, ValueChecker);
382
- var _super = _create_super(TimeScopeValueChecker);
383
365
  function TimeScopeValueChecker() {
384
366
  _class_call_check(this, TimeScopeValueChecker);
385
- return _super.apply(this, arguments);
367
+ return _call_super(this, TimeScopeValueChecker, arguments);
386
368
  }
387
369
  _create_class(TimeScopeValueChecker, [
388
370
  {
@@ -427,10 +409,9 @@ var TimeScopeValueChecker = /*#__PURE__*/ function(ValueChecker) {
427
409
  var CalcValueChecker = /*#__PURE__*/ function(ValueChecker) {
428
410
  "use strict";
429
411
  _inherits(CalcValueChecker, ValueChecker);
430
- var _super = _create_super(CalcValueChecker);
431
412
  function CalcValueChecker() {
432
413
  _class_call_check(this, CalcValueChecker);
433
- return _super.apply(this, arguments);
414
+ return _call_super(this, CalcValueChecker, arguments);
434
415
  }
435
416
  _create_class(CalcValueChecker, [
436
417
  {
@@ -478,10 +459,9 @@ var CalcValueChecker = /*#__PURE__*/ function(ValueChecker) {
478
459
  var AddressValueChecker = /*#__PURE__*/ function(ValueChecker) {
479
460
  "use strict";
480
461
  _inherits(AddressValueChecker, ValueChecker);
481
- var _super = _create_super(AddressValueChecker);
482
462
  function AddressValueChecker() {
483
463
  _class_call_check(this, AddressValueChecker);
484
- return _super.apply(this, arguments);
464
+ return _call_super(this, AddressValueChecker, arguments);
485
465
  }
486
466
  _create_class(AddressValueChecker, [
487
467
  {