@byteluck-fe/model-driven-engine 1.8.0-beta.1 → 1.8.0-beta.2

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.
@@ -173,7 +173,7 @@ export var ActionManager = /*#__PURE__*/ function() {
173
173
  }
174
174
  var _this = this;
175
175
  return _asyncToGenerator(function() {
176
- var action, _func, result, e;
176
+ var action, _action_func, result, e;
177
177
  return __generator(this, function(_state) {
178
178
  switch(_state.label){
179
179
  case 0:
@@ -193,7 +193,7 @@ export var ActionManager = /*#__PURE__*/ function() {
193
193
  ]);
194
194
  return [
195
195
  4,
196
- (_func = action.func).call.apply(_func, [
196
+ (_action_func = action.func).call.apply(_action_func, [
197
197
  null,
198
198
  context
199
199
  ].concat(_toConsumableArray(args)))
@@ -367,8 +367,8 @@ var Engine = /*#__PURE__*/ function(Watcher) {
367
367
  _this._jobTasks = [];
368
368
  _this.createControlInstance = _this.createInstance;
369
369
  _this.$options = Object.freeze(props);
370
- var _$options = _this.$options, _autoMount = _$options.autoMount, autoMount = _autoMount === void 0 ? true : _autoMount, schema = _$options.schema, beforeCreateInstance = _$options.beforeCreateInstance, externalParams = _$options.externalParams, _language = _$options.// fieldModel,
371
- language, language = _language === void 0 ? DEFAULT_LOCALE : _language, _debug = _$options.debug, debug = _debug === void 0 ? false : _debug;
370
+ 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,
371
+ 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;
372
372
  RulesMessage.setLocale(language);
373
373
  _this.debug = debug;
374
374
  _this.runtime = new Runtime({
@@ -402,13 +402,13 @@ var Engine = /*#__PURE__*/ function(Watcher) {
402
402
  for(var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++){
403
403
  arg[_key] = arguments[_key];
404
404
  }
405
- var _runtime;
406
- (_runtime = this.runtime).register.apply(_runtime, _toConsumableArray(arg));
405
+ var _this_runtime;
406
+ (_this_runtime = this.runtime).register.apply(_this_runtime, _toConsumableArray(arg));
407
407
  return this;
408
408
  };
409
409
  _proto.mount = function mount() {
410
410
  this.debugLog("engine的mount方法开始调用");
411
- var _$options = this.$options, _plugins = _$options.plugins, plugins = _plugins === void 0 ? [] : _plugins;
411
+ var _this_$options = this.$options, _this_$options_plugins = _this_$options.plugins, plugins = _this_$options_plugins === void 0 ? [] : _this_$options_plugins;
412
412
  this._handlerProxyState();
413
413
  this.__plugins = plugins;
414
414
  this.applyPlugins();
@@ -496,17 +496,17 @@ var Engine = /*#__PURE__*/ function(Watcher) {
496
496
  switch(type){
497
497
  case "push":
498
498
  case "unshift":
499
- var _children;
499
+ var _subtable_children;
500
500
  var newRowLengths = args.length;
501
501
  createdNewRows = createRows(newRowLengths);
502
502
  createdNewRowsData = args;
503
- (_children = subtable.children)[type].apply(_children, _toConsumableArray(createdNewRows));
503
+ (_subtable_children = subtable.children)[type].apply(_subtable_children, _toConsumableArray(createdNewRows));
504
504
  this.runtime.getFlatInstances();
505
505
  break;
506
506
  case "splice":
507
507
  if (args.length > 2) {
508
508
  var // @ts-ignore
509
- _children1;
509
+ _subtable_children1;
510
510
  var newRowLengths1 = args.length - 2;
511
511
  var newValues = args.slice(2);
512
512
  createdNewRows = createRows(newRowLengths1);
@@ -515,7 +515,7 @@ var Engine = /*#__PURE__*/ function(Watcher) {
515
515
  var start = args[0];
516
516
  // 替换几个
517
517
  var replace = args[1];
518
- (_children1 = subtable.children)[type].apply(_children1, [
518
+ (_subtable_children1 = subtable.children)[type].apply(_subtable_children1, [
519
519
  start,
520
520
  replace
521
521
  ].concat(_toConsumableArray(createdNewRows)));
@@ -526,15 +526,15 @@ var Engine = /*#__PURE__*/ function(Watcher) {
526
526
  // })
527
527
  } else {
528
528
  var // @ts-ignore
529
- _children2;
530
- (_children2 = subtable.children)[type].apply(_children2, _toConsumableArray(args));
529
+ _subtable_children2;
530
+ (_subtable_children2 = subtable.children)[type].apply(_subtable_children2, _toConsumableArray(args));
531
531
  this.runtime.getFlatInstances();
532
532
  }
533
533
  break;
534
534
  default:
535
535
  var // @ts-ignore
536
- _children3;
537
- (_children3 = subtable.children)[type].apply(_children3, _toConsumableArray(args));
536
+ _subtable_children3;
537
+ (_subtable_children3 = subtable.children)[type].apply(_subtable_children3, _toConsumableArray(args));
538
538
  this.runtime.getFlatInstances();
539
539
  break;
540
540
  }
@@ -570,7 +570,7 @@ var Engine = /*#__PURE__*/ function(Watcher) {
570
570
  var options = eventOptionsTemp || {};
571
571
  if (_instanceof(instance, RuntimeListControl)) {
572
572
  var // @ts-ignore
573
- _children;
573
+ _instance_children;
574
574
  instance.children.length = 0;
575
575
  var newValue = value;
576
576
  // @ts-ignore
@@ -580,7 +580,7 @@ var Engine = /*#__PURE__*/ function(Watcher) {
580
580
  var row = this.listControlCreateRow(instance, "subtable-row");
581
581
  row && newRows.push(row);
582
582
  }
583
- (_children = instance.children).push.apply(_children, _toConsumableArray(newRows));
583
+ (_instance_children = instance.children).push.apply(_instance_children, _toConsumableArray(newRows));
584
584
  this.runtime.getFlatInstances();
585
585
  // 这里已经能拿到控件实例,所以在这里触发setStates,触发每一行每一个控件的change事件
586
586
  // for (let i = 0; i < newValue.length; i++) {
@@ -612,8 +612,8 @@ var Engine = /*#__PURE__*/ function(Watcher) {
612
612
  if (this.__pluginsApplied) return;
613
613
  this.__plugins.forEach(function(plugin) {
614
614
  try {
615
- var _pluginName;
616
- applyingPluginName = (_pluginName = plugin.pluginName) !== null && _pluginName !== void 0 ? _pluginName : plugin.constructor.name;
615
+ var _plugin_pluginName;
616
+ applyingPluginName = (_plugin_pluginName = plugin.pluginName) !== null && _plugin_pluginName !== void 0 ? _plugin_pluginName : plugin.constructor.name;
617
617
  plugin.apply(_this);
618
618
  } catch (e) {
619
619
  error("".concat(applyingPluginName, " Plugin apply Error \n ").concat(e));
@@ -627,11 +627,11 @@ var Engine = /*#__PURE__*/ function(Watcher) {
627
627
  var row = this.runtime.createControlInstance(rowType);
628
628
  if (!row) return;
629
629
  if (_instanceof(row, RuntimeLayoutControl)) {
630
- var _children;
630
+ var _row_children;
631
631
  var template = JSONCopy(instance.props.headers);
632
632
  // @ts-ignore
633
633
  var columns = this.createControl(template);
634
- (_children = row.children).push.apply(_children, _toConsumableArray(columns));
634
+ (_row_children = row.children).push.apply(_row_children, _toConsumableArray(columns));
635
635
  }
636
636
  return row;
637
637
  };
@@ -718,8 +718,8 @@ var Engine = /*#__PURE__*/ function(Watcher) {
718
718
  for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
719
719
  args[_key] = arguments[_key];
720
720
  }
721
- var _runtime;
722
- return (_runtime = this.runtime).createControl.apply(_runtime, _toConsumableArray(args));
721
+ var _this_runtime;
722
+ return (_this_runtime = this.runtime).createControl.apply(_this_runtime, _toConsumableArray(args));
723
723
  };
724
724
  _proto.createInstance = function createInstance(type, initSchema) {
725
725
  return this.runtime.createControlInstance(type, initSchema);
@@ -734,16 +734,16 @@ var Engine = /*#__PURE__*/ function(Watcher) {
734
734
  if (controlId === undefined) {
735
735
  return this.runtime.rules;
736
736
  } else {
737
- var ref;
738
- return (ref = this.runtime.rules[controlId]) === null || ref === void 0 ? void 0 : ref.fields;
737
+ var _this_runtime_rules_controlId;
738
+ return (_this_runtime_rules_controlId = this.runtime.rules[controlId]) === null || _this_runtime_rules_controlId === void 0 ? void 0 : _this_runtime_rules_controlId.fields;
739
739
  }
740
740
  };
741
741
  _proto.getAntdRules = function getAntdRules(controlId) {
742
742
  if (controlId === undefined) {
743
743
  return this.runtime.antdRules;
744
744
  } else {
745
- var ref;
746
- return (ref = this.runtime.antdRules[controlId]) === null || ref === void 0 ? void 0 : ref.fields;
745
+ var _this_runtime_antdRules_controlId;
746
+ return (_this_runtime_antdRules_controlId = this.runtime.antdRules[controlId]) === null || _this_runtime_antdRules_controlId === void 0 ? void 0 : _this_runtime_antdRules_controlId.fields;
747
747
  }
748
748
  };
749
749
  _proto.getState = function getState(controlId, rowIndex) {
@@ -863,8 +863,8 @@ var Engine = /*#__PURE__*/ function(Watcher) {
863
863
  }
864
864
  var dataBind = dataBindMapping.dataBind, controlId = dataBindMapping.controlId;
865
865
  if (_instanceof(dataBind, ObjectDataBind)) {
866
- var ref;
867
- var oldState = (ref = JSONCopy(this.getState(controlId, rowIndex))) !== null && ref !== void 0 ? ref : this.getEmptyState(controlId);
866
+ var _JSONCopy;
867
+ var oldState = (_JSONCopy = JSONCopy(this.getState(controlId, rowIndex))) !== null && _JSONCopy !== void 0 ? _JSONCopy : this.getEmptyState(controlId);
868
868
  // fieldCode不代表是key,所以需要找到对应的key
869
869
  var newState = Object.entries(dataBind).reduce(function(result, param) {
870
870
  var _param = _slicedToArray(param, 2), key = _param[0], dataBind = _param[1];
@@ -902,8 +902,8 @@ var Engine = /*#__PURE__*/ function(Watcher) {
902
902
  }
903
903
  // 对象类型的值
904
904
  if (_instanceof(dataBind, ObjectDataBind)) {
905
- var ref;
906
- var oldState = (ref = JSONCopy(_this.getState(controlId, rowIndex))) !== null && ref !== void 0 ? ref : _this.getEmptyState(controlId);
905
+ var _JSONCopy;
906
+ var oldState = (_JSONCopy = JSONCopy(_this.getState(controlId, rowIndex))) !== null && _JSONCopy !== void 0 ? _JSONCopy : _this.getEmptyState(controlId);
907
907
  // fieldCode不代表是key,所以需要找到对应的key
908
908
  var newState = Object.entries(dataBind).reduce(function(result, param) {
909
909
  var _param = _slicedToArray(param, 2), key = _param[0], dataBind = _param[1];
@@ -981,19 +981,19 @@ var Engine = /*#__PURE__*/ function(Watcher) {
981
981
  var skipKey = [] //qiyu ObjectDataBind中会提前将相关key拿出来赋值,为了避免重复赋值,设置了此变量
982
982
  ;
983
983
  Object.keys(row).map(function(fieldCode) {
984
- var ref, ref1;
984
+ var _this_store_dataBindMapping_dataCode, _this_store_dataBindMapping_dataCode_fields;
985
985
  if (skipKey.includes(fieldCode)) {
986
986
  return;
987
987
  }
988
- var fieldMapping = (ref = _this.store.dataBindMapping[dataCode]) === null || ref === void 0 ? void 0 : (ref1 = ref.fields) === null || ref1 === void 0 ? void 0 : ref1.find(function(i) {
988
+ var fieldMapping = (_this_store_dataBindMapping_dataCode = _this.store.dataBindMapping[dataCode]) === null || _this_store_dataBindMapping_dataCode === void 0 ? void 0 : (_this_store_dataBindMapping_dataCode_fields = _this_store_dataBindMapping_dataCode.fields) === null || _this_store_dataBindMapping_dataCode_fields === void 0 ? void 0 : _this_store_dataBindMapping_dataCode_fields.find(function(i) {
989
989
  return i.fieldCode === fieldCode;
990
990
  });
991
991
  if (fieldMapping) {
992
992
  if (_instanceof(fieldMapping.dataBind, DataBind) && row[fieldCode] !== undefined) {
993
993
  newRow[fieldMapping.controlId] = row[fieldCode];
994
994
  } else if (_instanceof(fieldMapping.dataBind, ObjectDataBind)) {
995
- var ref2;
996
- var objValue = JSONCopy((ref2 = _this.getEmptyState(fieldMapping.controlId)) !== null && ref2 !== void 0 ? ref2 : {});
995
+ var _this_getEmptyState;
996
+ var objValue = JSONCopy((_this_getEmptyState = _this.getEmptyState(fieldMapping.controlId)) !== null && _this_getEmptyState !== void 0 ? _this_getEmptyState : {});
997
997
  Object.keys(fieldMapping.dataBind).map(function(key) {
998
998
  var dataBind = fieldMapping.dataBind[key];
999
999
  if (row[dataBind.fieldCode] !== undefined) {
@@ -1028,8 +1028,8 @@ var Engine = /*#__PURE__*/ function(Watcher) {
1028
1028
  if (_instanceof(mapping.dataBind, DataBind) && entity[fieldCode] !== undefined) {
1029
1029
  newState[mapping.dataViewId[0]][mapping.controlId] = entity[fieldCode];
1030
1030
  } else if (_instanceof(mapping.dataBind, ObjectDataBind)) {
1031
- var ref;
1032
- var objValue = JSONCopy((ref = _this.getEmptyState(mapping.controlId)) !== null && ref !== void 0 ? ref : {});
1031
+ var _this_getEmptyState;
1032
+ var objValue = JSONCopy((_this_getEmptyState = _this.getEmptyState(mapping.controlId)) !== null && _this_getEmptyState !== void 0 ? _this_getEmptyState : {});
1033
1033
  Object.keys(mapping.dataBind).map(function(key) {
1034
1034
  var dataBind = mapping.dataBind[key];
1035
1035
  if (entity[dataBind.fieldCode] !== undefined) {
@@ -1097,11 +1097,11 @@ var Engine = /*#__PURE__*/ function(Watcher) {
1097
1097
  }
1098
1098
  } else {
1099
1099
  var controlIdMapping = this.getControlIdMapping();
1100
- var ref;
1101
- var ref1 = _slicedToArray((ref = Object.entries(controlIdMapping).find(function(param) {
1100
+ var _Object_entries_find;
1101
+ var _ref = _slicedToArray((_Object_entries_find = Object.entries(controlIdMapping).find(function(param) {
1102
1102
  var _param = _slicedToArray(param, 2), _ = _param[0], mapping = _param[1];
1103
1103
  return mapping.children && controlId in mapping.children;
1104
- })) !== null && ref !== void 0 ? ref : [], 1), subtableId = ref1[0];
1104
+ })) !== null && _Object_entries_find !== void 0 ? _Object_entries_find : [], 1), subtableId = _ref[0];
1105
1105
  if (subtableId) {
1106
1106
  var subtable = this.getInstance(subtableId);
1107
1107
  // @ts-ignore
@@ -1255,8 +1255,8 @@ var Engine = /*#__PURE__*/ function(Watcher) {
1255
1255
  for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
1256
1256
  args[_key] = arguments[_key];
1257
1257
  }
1258
- var _runtime;
1259
- return (_runtime = this.runtime).registerControlConfig.apply(_runtime, _toConsumableArray(args));
1258
+ var _this_runtime;
1259
+ return (_this_runtime = this.runtime).registerControlConfig.apply(_this_runtime, _toConsumableArray(args));
1260
1260
  };
1261
1261
  _proto.getControlConfig = function getControlConfig(control) {
1262
1262
  return this.runtime.getControlConfig(control);
@@ -18,12 +18,12 @@ var OkWorker = /*#__PURE__*/ function() {
18
18
  });
19
19
  };
20
20
  _proto.destroy = function destroy() {
21
- var ref;
22
- (ref = this.worker) === null || ref === void 0 ? void 0 : ref.terminate();
21
+ var _this_worker;
22
+ (_this_worker = this.worker) === null || _this_worker === void 0 ? void 0 : _this_worker.terminate();
23
23
  };
24
24
  _proto.postMessage = function postMessage(message) {
25
- var ref;
26
- (ref = this.worker) === null || ref === void 0 ? void 0 : ref.postMessage(message);
25
+ var _this_worker;
26
+ (_this_worker = this.worker) === null || _this_worker === void 0 ? void 0 : _this_worker.postMessage(message);
27
27
  };
28
28
  OkWorker.createWorker = function createWorker() {
29
29
  var blob = new Blob([
@@ -64,7 +64,7 @@ var OkWorker = /*#__PURE__*/ function() {
64
64
  // return new Proxy(obj, createHandler(parentKey))
65
65
  // }
66
66
  _self.addEventListener("message", function(event) {
67
- var _data = event.data, action = _data.action, payload = _data.payload, fn = _data.fn;
67
+ var _event_data = event.data, action = _event_data.action, payload = _event_data.payload, fn = _event_data.fn;
68
68
  log(action, payload);
69
69
  // 通过proxy进行代理,每次修改的时候,自动向外抛出postMessage
70
70
  // data.key1 = 1
@@ -30,7 +30,7 @@ var Store = /*#__PURE__*/ function() {
30
30
  "use strict";
31
31
  function Store(props) {
32
32
  _classCallCheck(this, Store);
33
- var ref = init(props.instance), state = ref.state, emptyState = ref.emptyState, databindMapping = ref.databindMapping, controlidMapping = ref.controlidMapping, fieldCodeState = ref.fieldCodeState;
33
+ var _init = init(props.instance), state = _init.state, emptyState = _init.emptyState, databindMapping = _init.databindMapping, controlidMapping = _init.controlidMapping, fieldCodeState = _init.fieldCodeState;
34
34
  this.emptyState = emptyState;
35
35
  this.state = state;
36
36
  this.fieldCodeState = fieldCodeState;
@@ -97,8 +97,8 @@ var Store = /*#__PURE__*/ function() {
97
97
  if (children !== undefined) {
98
98
  Object.keys(children).map(function(childControlId) {
99
99
  if (childControlId === controlId) {
100
- var ref;
101
- state = (ref = _this.state[dataViewId][subtableId][rowIndex]) === null || ref === void 0 ? void 0 : ref[controlId];
100
+ var _this_state_dataViewId_subtableId_rowIndex;
101
+ state = (_this_state_dataViewId_subtableId_rowIndex = _this.state[dataViewId][subtableId][rowIndex]) === null || _this_state_dataViewId_subtableId_rowIndex === void 0 ? void 0 : _this_state_dataViewId_subtableId_rowIndex[controlId];
102
102
  }
103
103
  });
104
104
  }
@@ -263,14 +263,14 @@ item) {
263
263
  emptyFieldCodeTemplate[headerItemFieldCode] = JSONCopy(headerItem.props.defaultValue);
264
264
  }
265
265
  });
266
- var _defaultRows;
267
- dataViewState[item.id] = new Array((_defaultRows = item.props.defaultRows) !== null && _defaultRows !== void 0 ? _defaultRows : 1).fill(0).map(function() {
266
+ var _item_props_defaultRows;
267
+ dataViewState[item.id] = new Array((_item_props_defaultRows = item.props.defaultRows) !== null && _item_props_defaultRows !== void 0 ? _item_props_defaultRows : 1).fill(0).map(function() {
268
268
  return JSONCopy(emptyTemplate);
269
269
  });
270
270
  emptyDataViewState[item.id] = emptyTemplate;
271
271
  var dataBindFieldCode1 = item.props.datasourceBind.dataCode;
272
- var _defaultRows1;
273
- dataViewFieldCodeState[dataBindFieldCode1] = new Array((_defaultRows1 = item.props.defaultRows) !== null && _defaultRows1 !== void 0 ? _defaultRows1 : 1).fill(0).map(function() {
272
+ var _item_props_defaultRows1;
273
+ dataViewFieldCodeState[dataBindFieldCode1] = new Array((_item_props_defaultRows1 = item.props.defaultRows) !== null && _item_props_defaultRows1 !== void 0 ? _item_props_defaultRows1 : 1).fill(0).map(function() {
274
274
  return JSONCopy(emptyFieldCodeTemplate);
275
275
  });
276
276
  emptyDataViewFieldCodeState[dataBindFieldCode1] = emptyFieldCodeTemplate;
@@ -379,9 +379,9 @@ item) {
379
379
  options: []
380
380
  };
381
381
  loopFormSchema(item.props.headers, function(formControl) {
382
- var ref;
383
- var ref1;
384
- Object.assign((ref1 = (ref = data[item.id]) === null || ref === void 0 ? void 0 : ref.children) !== null && ref1 !== void 0 ? ref1 : {}, _defineProperty({}, formControl.id, {
382
+ var _data_item_id;
383
+ var _data_item_id_children;
384
+ Object.assign((_data_item_id_children = (_data_item_id = data[item.id]) === null || _data_item_id === void 0 ? void 0 : _data_item_id.children) !== null && _data_item_id_children !== void 0 ? _data_item_id_children : {}, _defineProperty({}, formControl.id, {
385
385
  dataBind: formControl.props.dataBind
386
386
  }));
387
387
  });
@@ -520,8 +520,8 @@ function getFieldTypeFromKey(key) {
520
520
  }
521
521
  }
522
522
  export function checkerValue(fieldType, key, value, oldValue) {
523
- var ref;
524
- var getCheckerFieldType = (ref = getFieldTypeFromKey(key)) !== null && ref !== void 0 ? ref : fieldType;
523
+ var _getFieldTypeFromKey;
524
+ var getCheckerFieldType = (_getFieldTypeFromKey = getFieldTypeFromKey(key)) !== null && _getFieldTypeFromKey !== void 0 ? _getFieldTypeFromKey : fieldType;
525
525
  var checker = ValueCheckerFactory.getValueChecker(getCheckerFieldType);
526
526
  if (!checker || checker.validate(value)) {
527
527
  return value;
@@ -148,8 +148,8 @@ function ArrayHandler(target, propertyKey, value, thisKey, callback) {
148
148
  // @ts-ignore
149
149
  var oldValue = target[propertyKey];
150
150
  var concatKey = thisKey === "" ? propertyKey : thisKey + "." + propertyKey;
151
- var ref;
152
- newValue = (ref = reProxyState(value)) !== null && ref !== void 0 ? ref : newValue;
151
+ var _reProxyState;
152
+ newValue = (_reProxyState = reProxyState(value)) !== null && _reProxyState !== void 0 ? _reProxyState : newValue;
153
153
  // 先设置值,然后再进行触发回调,确保回调内拿到的是最新的值
154
154
  var setResult;
155
155
  // TODO 数组拦截操作需要重构,优化现有逻辑
@@ -243,10 +243,10 @@ function flatInstanceForChildren(controls) {
243
243
  // 最后一个key可能是值对象上边的key,比如金额的amount和currency,计算公式的result和unit,所以需要判断前一个控件是不是一个表单控件,是的话就返回最后一个表单控件
244
244
  return findEndItem ? findEndItem : _instanceof(prevItem, RuntimeFormControl) ? prevItem : undefined;
245
245
  } else {
246
- var ref;
247
- var ref1;
246
+ var _prevItem_children;
247
+ var _prevItem_children_index;
248
248
  // 如果有children,则取children中对应的下标,没有的话一直返回prevItem
249
- return (ref1 = prevItem === null || prevItem === void 0 ? void 0 : (ref = prevItem.children) === null || ref === void 0 ? void 0 : ref[index]) !== null && ref1 !== void 0 ? ref1 : prevItem;
249
+ return (_prevItem_children_index = prevItem === null || prevItem === void 0 ? void 0 : (_prevItem_children = prevItem.children) === null || _prevItem_children === void 0 ? void 0 : _prevItem_children[index]) !== null && _prevItem_children_index !== void 0 ? _prevItem_children_index : prevItem;
250
250
  }
251
251
  }, initInstance);
252
252
  }
@@ -286,9 +286,9 @@ function getArrayNewArgs(type, args, value) {
286
286
  var result;
287
287
  var addValue = getArrayNewValue(key, args);
288
288
  if (addValue.length) {
289
- var _obj, ref;
289
+ var _this, _this_engineArrayBeforeSetCallbackFlag;
290
290
  // @ts-ignore
291
- var newValue = (ref = (_obj = this)[engineArrayBeforeSetCallbackFlag]) === null || ref === void 0 ? void 0 : ref.call(_obj, // @ts-ignore
291
+ var newValue = (_this_engineArrayBeforeSetCallbackFlag = (_this = this)[engineArrayBeforeSetCallbackFlag]) === null || _this_engineArrayBeforeSetCallbackFlag === void 0 ? void 0 : _this_engineArrayBeforeSetCallbackFlag.call(_this, // @ts-ignore
292
292
  this[engineTargetKey], // @ts-ignore
293
293
  this[engineProxyThisKey], addValue);
294
294
  var newArgs = getArrayNewArgs(key, args, newValue);
@@ -64,8 +64,8 @@ export var CalcPlugin = /*#__PURE__*/ function() {
64
64
  /**
65
65
  * @description 获取显隐控制的需要被记住值的控件id
66
66
  * */ _proto.getNeedHideRememberControlIds = function getNeedHideRememberControlIds() {
67
- var ref;
68
- if (!((ref = this.options) === null || ref === void 0 ? void 0 : ref.displayBoList)) {
67
+ var _this_options;
68
+ if (!((_this_options = this.options) === null || _this_options === void 0 ? void 0 : _this_options.displayBoList)) {
69
69
  return;
70
70
  }
71
71
  this.hideNotRememberControlIds = this.options.displayBoList.reduce(function(result, current) {
@@ -79,8 +79,8 @@ export var CalcPlugin = /*#__PURE__*/ function() {
79
79
  /**
80
80
  * @description 获取权限控制的隐藏的字段,不需要参与计算
81
81
  * */ _proto.getDontHasPermissionControlIds = function getDontHasPermissionControlIds() {
82
- var ref;
83
- if (!((ref = this.options) === null || ref === void 0 ? void 0 : ref.behavior)) {
82
+ var _this_options;
83
+ if (!((_this_options = this.options) === null || _this_options === void 0 ? void 0 : _this_options.behavior)) {
84
84
  return;
85
85
  }
86
86
  this.dontHasPermissionControlIds = this.options.behavior.reduce(function(result, current) {
@@ -206,8 +206,8 @@ export var CalcPlugin = /*#__PURE__*/ function() {
206
206
  var _this = this;
207
207
  this.engine.on("schema-change", function(payload) {
208
208
  if (payload.props === "isHide") {
209
- var ref;
210
- var calcControls = (ref = _this.dependenciesTriggerMap.get(payload.instance.id)) !== null && ref !== void 0 ? ref : [];
209
+ var _this_dependenciesTriggerMap_get;
210
+ var calcControls = (_this_dependenciesTriggerMap_get = _this.dependenciesTriggerMap.get(payload.instance.id)) !== null && _this_dependenciesTriggerMap_get !== void 0 ? _this_dependenciesTriggerMap_get : [];
211
211
  calcControls.forEach(function(calc) {
212
212
  _this.computedCalcValue(calc);
213
213
  });
@@ -219,18 +219,18 @@ export var CalcPlugin = /*#__PURE__*/ function() {
219
219
  * */ _proto.watchSubtableChange = function watchSubtableChange() {
220
220
  var _this = this;
221
221
  this.engine.on("list-change", function(payload) {
222
- var ref;
222
+ var _payload_options;
223
223
  _this.resetDependencies();
224
- var ref1;
225
- var changedRows = (ref1 = (ref = payload.options) === null || ref === void 0 ? void 0 : ref.changed) !== null && ref1 !== void 0 ? ref1 : [];
224
+ var _payload_options_changed;
225
+ var changedRows = (_payload_options_changed = (_payload_options = payload.options) === null || _payload_options === void 0 ? void 0 : _payload_options.changed) !== null && _payload_options_changed !== void 0 ? _payload_options_changed : [];
226
226
  // 对发生改变的行进行重新计算
227
227
  var changedCalc = _this.getCalcControlsFromSubtableRows(changedRows);
228
228
  // @ts-ignore
229
229
  changedCalc.forEach(function(calcControl) {
230
230
  _this.computedCalcValue(calcControl);
231
231
  });
232
- var ref2;
233
- var calcControls = (ref2 = _this.dependenciesTriggerMap.get(payload.instance.id)) !== null && ref2 !== void 0 ? ref2 : [];
232
+ var _this_dependenciesTriggerMap_get;
233
+ var calcControls = (_this_dependenciesTriggerMap_get = _this.dependenciesTriggerMap.get(payload.instance.id)) !== null && _this_dependenciesTriggerMap_get !== void 0 ? _this_dependenciesTriggerMap_get : [];
234
234
  // @ts-ignore
235
235
  calcControls.forEach(function(calcControl) {
236
236
  _this.computedCalcValue(calcControl);
@@ -246,8 +246,8 @@ export var CalcPlugin = /*#__PURE__*/ function() {
246
246
  if (!_this.dependenciesTriggerMap.has(instance.id)) {
247
247
  return;
248
248
  }
249
- var ref;
250
- var calcControls = (ref = _this.dependenciesTriggerMap.get(instance.id)) !== null && ref !== void 0 ? ref : [];
249
+ var _this_dependenciesTriggerMap_get;
250
+ var calcControls = (_this_dependenciesTriggerMap_get = _this.dependenciesTriggerMap.get(instance.id)) !== null && _this_dependenciesTriggerMap_get !== void 0 ? _this_dependenciesTriggerMap_get : [];
251
251
  // 在明细子表中的控件,如果计算公式也在明细子表,那只触发同一行的计算公式的计算
252
252
  if (payload.rowIndex !== undefined && payload.rowIndex > -1) {
253
253
  // @ts-ignore
@@ -271,8 +271,8 @@ export var CalcPlugin = /*#__PURE__*/ function() {
271
271
  /**
272
272
  * @description 控件在明细子表内
273
273
  * */ _proto.controlInSubtable = function controlInSubtable(control) {
274
- var ref;
275
- return ((ref = control.parent) === null || ref === void 0 ? void 0 : ref.type) === CONTROL_TYPE.SUBTABLE_COLUMN;
274
+ var _control_parent;
275
+ return ((_control_parent = control.parent) === null || _control_parent === void 0 ? void 0 : _control_parent.type) === CONTROL_TYPE.SUBTABLE_COLUMN;
276
276
  };
277
277
  /**
278
278
  * @description 执行计算公式的计算
@@ -352,10 +352,10 @@ export var CalcPlugin = /*#__PURE__*/ function() {
352
352
  if (result === (oldValue === null || oldValue === void 0 ? void 0 : oldValue.result)) {
353
353
  return;
354
354
  }
355
- var ref;
355
+ var _oldValue_unit;
356
356
  this.engine.setState(control.id, {
357
357
  result: result,
358
- unit: (ref = oldValue === null || oldValue === void 0 ? void 0 : oldValue.unit) !== null && ref !== void 0 ? ref : ""
358
+ unit: (_oldValue_unit = oldValue === null || oldValue === void 0 ? void 0 : oldValue.unit) !== null && _oldValue_unit !== void 0 ? _oldValue_unit : ""
359
359
  }, rowIndex);
360
360
  };
361
361
  /**
@@ -71,7 +71,7 @@ export var ES6ModulePlugin = /*#__PURE__*/ function() {
71
71
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
72
72
  try {
73
73
  for(var _iterator = Object.entries(res.funcMap)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
74
- var _value = _slicedToArray(_step.value, 2), key = _value[0], value = _value[1];
74
+ var _step_value = _slicedToArray(_step.value, 2), key = _step_value[0], value = _step_value[1];
75
75
  actionManager.addAction(key, value);
76
76
  }
77
77
  } catch (err) {
@@ -117,7 +117,7 @@ export function parseModule(action, engine) {
117
117
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
118
118
  try {
119
119
  for(var _iterator = Object.entries(module.exports)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
120
- var _value = _slicedToArray(_step.value, 2), key = _value[0], value = _value[1];
120
+ var _step_value = _slicedToArray(_step.value, 2), key = _step_value[0], value = _step_value[1];
121
121
  if (typeof value === "function") {
122
122
  funcMap[key] = value;
123
123
  } else {
@@ -11,10 +11,10 @@ export var StylePlugin = /*#__PURE__*/ function() {
11
11
  }
12
12
  var _proto = StylePlugin.prototype;
13
13
  _proto.apply = function apply(engine) {
14
- var ref;
14
+ var _this_config;
15
15
  this.engine = engine;
16
- var ref1;
17
- var compiledStyle = (ref1 = (ref = this.config) === null || ref === void 0 ? void 0 : ref.source) !== null && ref1 !== void 0 ? ref1 : "";
16
+ var _this_config_source;
17
+ var compiledStyle = (_this_config_source = (_this_config = this.config) === null || _this_config === void 0 ? void 0 : _this_config.source) !== null && _this_config_source !== void 0 ? _this_config_source : "";
18
18
  var style = document.createElement("style");
19
19
  style.className = "edit-css";
20
20
  style.type = "text/css";