@byteluck-fe/model-driven-engine 7.0.0-beta.6 → 7.0.0-beta.8

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.
@@ -85,7 +85,7 @@ function _unsupported_iterable_to_array(o, minLen) {
85
85
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
86
86
  }
87
87
  function _ts_generator(thisArg, body) {
88
- var f, y, t, g, _ = {
88
+ var f, y, t, _ = {
89
89
  label: 0,
90
90
  sent: function() {
91
91
  if (t[0] & 1) throw t[1];
@@ -93,13 +93,17 @@ function _ts_generator(thisArg, body) {
93
93
  },
94
94
  trys: [],
95
95
  ops: []
96
- };
97
- return g = {
98
- next: verb(0),
99
- "throw": verb(1),
100
- "return": verb(2)
101
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
102
- return this;
96
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
97
+ return d(g, "next", {
98
+ value: verb(0)
99
+ }), d(g, "throw", {
100
+ value: verb(1)
101
+ }), d(g, "return", {
102
+ value: verb(2)
103
+ }), typeof Symbol === "function" && d(g, Symbol.iterator, {
104
+ value: function() {
105
+ return this;
106
+ }
103
107
  }), g;
104
108
  function verb(n) {
105
109
  return function(v) {
@@ -111,7 +115,7 @@ function _ts_generator(thisArg, body) {
111
115
  }
112
116
  function step(op) {
113
117
  if (f) throw new TypeError("Generator is already executing.");
114
- while(_)try {
118
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
115
119
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
116
120
  if (y = 0, t) op = [
117
121
  op[0] & 2,
@@ -200,13 +204,12 @@ export var ActionManager = /*#__PURE__*/ function() {
200
204
  for(var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
201
205
  args[_key - 2] = arguments[_key];
202
206
  }
203
- var _this = this;
204
207
  return _async_to_generator(function() {
205
208
  var action, _action_func, result, e;
206
209
  return _ts_generator(this, function(_state) {
207
210
  switch(_state.label){
208
211
  case 0:
209
- action = _this.actionMap.get(name);
212
+ action = this.actionMap.get(name);
210
213
  if (!action) {
211
214
  return [
212
215
  2
@@ -248,7 +251,7 @@ export var ActionManager = /*#__PURE__*/ function() {
248
251
  ];
249
252
  }
250
253
  });
251
- })();
254
+ }).call(this);
252
255
  }
253
256
  },
254
257
  {
@@ -60,7 +60,7 @@ function _define_property(obj, key, value) {
60
60
  return obj;
61
61
  }
62
62
  function _ts_generator(thisArg, body) {
63
- var f, y, t, g, _ = {
63
+ var f, y, t, _ = {
64
64
  label: 0,
65
65
  sent: function() {
66
66
  if (t[0] & 1) throw t[1];
@@ -68,13 +68,17 @@ function _ts_generator(thisArg, body) {
68
68
  },
69
69
  trys: [],
70
70
  ops: []
71
- };
72
- return g = {
73
- next: verb(0),
74
- "throw": verb(1),
75
- "return": verb(2)
76
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
77
- return this;
71
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
72
+ return d(g, "next", {
73
+ value: verb(0)
74
+ }), d(g, "throw", {
75
+ value: verb(1)
76
+ }), d(g, "return", {
77
+ value: verb(2)
78
+ }), typeof Symbol === "function" && d(g, Symbol.iterator, {
79
+ value: function() {
80
+ return this;
81
+ }
78
82
  }), g;
79
83
  function verb(n) {
80
84
  return function(v) {
@@ -86,7 +90,7 @@ function _ts_generator(thisArg, body) {
86
90
  }
87
91
  function step(op) {
88
92
  if (f) throw new TypeError("Generator is already executing.");
89
- while(_)try {
93
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
90
94
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
91
95
  if (y = 0, t) op = [
92
96
  op[0] & 2,
@@ -186,10 +190,9 @@ export var DataManager = /*#__PURE__*/ function() {
186
190
  {
187
191
  key: "getRemoteData",
188
192
  value: function getRemoteData(payload) {
189
- var _this = this;
190
193
  return _async_to_generator(function() {
191
194
  return _ts_generator(this, function(_state) {
192
- if (_this.executer === undefined) {
195
+ if (this.executer === undefined) {
193
196
  // @i18n-translate-ignore
194
197
  logerror('未初始化executer');
195
198
  return [
@@ -199,14 +202,14 @@ export var DataManager = /*#__PURE__*/ function() {
199
202
  } else {
200
203
  return [
201
204
  2,
202
- _this.executer(payload)
205
+ this.executer(payload)
203
206
  ];
204
207
  }
205
208
  return [
206
209
  2
207
210
  ];
208
211
  });
209
- })();
212
+ }).call(this);
210
213
  }
211
214
  }
212
215
  ]);
@@ -234,7 +234,7 @@ function _is_native_reflect_construct() {
234
234
  })();
235
235
  }
236
236
  function _ts_generator(thisArg, body) {
237
- var f, y, t, g, _ = {
237
+ var f, y, t, _ = {
238
238
  label: 0,
239
239
  sent: function() {
240
240
  if (t[0] & 1) throw t[1];
@@ -242,13 +242,17 @@ function _ts_generator(thisArg, body) {
242
242
  },
243
243
  trys: [],
244
244
  ops: []
245
- };
246
- return g = {
247
- next: verb(0),
248
- "throw": verb(1),
249
- "return": verb(2)
250
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
251
- return this;
245
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
246
+ return d(g, "next", {
247
+ value: verb(0)
248
+ }), d(g, "throw", {
249
+ value: verb(1)
250
+ }), d(g, "return", {
251
+ value: verb(2)
252
+ }), typeof Symbol === "function" && d(g, Symbol.iterator, {
253
+ value: function() {
254
+ return this;
255
+ }
252
256
  }), g;
253
257
  function verb(n) {
254
258
  return function(v) {
@@ -260,7 +264,7 @@ function _ts_generator(thisArg, body) {
260
264
  }
261
265
  function step(op) {
262
266
  if (f) throw new TypeError("Generator is already executing.");
263
- while(_)try {
267
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
264
268
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
265
269
  if (y = 0, t) op = [
266
270
  op[0] & 2,
@@ -498,7 +502,7 @@ var Engine = /*#__PURE__*/ function(Watcher) {
498
502
  // if (!(subtable instanceof RuntimeListControl)) return
499
503
  if (!((subtable === null || subtable === void 0 ? void 0 : subtable.controlType) === CONTROL_BASE_TYPE.LIST)) return;
500
504
  // 新增多行方法
501
- var createRows = function(len) {
505
+ var createRows = function createRows(len) {
502
506
  // @ts-ignore
503
507
  var newRows = [];
504
508
  for(var i = 0; i < len; i++){
@@ -781,7 +785,7 @@ var Engine = /*#__PURE__*/ function(Watcher) {
781
785
  value: // payload应该是runtimeSchema和value,然后通过runTimeSchema去找需要修改的data里边的key
782
786
  function emit(eventKey, payload) {
783
787
  var _this = this;
784
- var _this1 = this, _superprop_get_emit = function() {
788
+ var _this1 = this, _superprop_get_emit = function _superprop_get_emit() {
785
789
  return _get(_get_prototype_of(Engine.prototype), "emit", _this);
786
790
  };
787
791
  return _async_to_generator(function() {
@@ -793,19 +797,19 @@ var Engine = /*#__PURE__*/ function(Watcher) {
793
797
  3,
794
798
  3
795
799
  ];
796
- if (_this1.isMounted) {
800
+ if (this.isMounted) {
797
801
  warn('The engine-mounted life cycle can only be triggered once');
798
802
  return [
799
803
  2,
800
804
  Promise.resolve([])
801
805
  ];
802
806
  }
803
- if (!_this1._jobTasks.length) return [
807
+ if (!this._jobTasks.length) return [
804
808
  3,
805
809
  2
806
810
  ];
807
811
  console.time('engine-mounted need wait');
808
- needWait = _to_consumable_array(_this1._jobTasks);
812
+ needWait = _to_consumable_array(this._jobTasks);
809
813
  return [
810
814
  4,
811
815
  Promise.all(needWait)
@@ -815,15 +819,15 @@ var Engine = /*#__PURE__*/ function(Watcher) {
815
819
  console.timeEnd('engine-mounted need wait');
816
820
  _state.label = 2;
817
821
  case 2:
818
- _this1.isMounted = true;
822
+ this.isMounted = true;
819
823
  _state.label = 3;
820
824
  case 3:
821
825
  // 如果没有挂载的话,需要记录在挂载之前触发的所有任务
822
- if (!_this1.isMounted) {
826
+ if (!this.isMounted) {
823
827
  promise = new Promise(function(resolve) {
824
828
  promiseResolver = resolve;
825
829
  });
826
- _this1._jobTasks.push(promise);
830
+ this._jobTasks.push(promise);
827
831
  }
828
832
  return [
829
833
  4,
@@ -834,7 +838,7 @@ var Engine = /*#__PURE__*/ function(Watcher) {
834
838
  if (promiseResolver && promise) {
835
839
  // 每一个任务完成的时候,都把自己从task中去掉
836
840
  promiseResolver();
837
- _this1._jobTasks.splice(_this1._jobTasks.indexOf(promise), 1);
841
+ this._jobTasks.splice(this._jobTasks.indexOf(promise), 1);
838
842
  }
839
843
  return [
840
844
  2,
@@ -842,7 +846,7 @@ var Engine = /*#__PURE__*/ function(Watcher) {
842
846
  ];
843
847
  }
844
848
  });
845
- })();
849
+ }).call(this);
846
850
  }
847
851
  },
848
852
  {
@@ -1397,13 +1401,13 @@ var Engine = /*#__PURE__*/ function(Watcher) {
1397
1401
  }
1398
1402
  var newMapping = _this.getDataBindMapping(dataCode);
1399
1403
  if (newMapping) {
1404
+ var _ref;
1400
1405
  var _newMapping_fields;
1401
1406
  var mappingKeys = newMapping === null || newMapping === void 0 ? void 0 : (_newMapping_fields = newMapping.fields) === null || _newMapping_fields === void 0 ? void 0 : _newMapping_fields.map(function(item) {
1402
1407
  return item === null || item === void 0 ? void 0 : item.controlId;
1403
1408
  });
1404
1409
  var mappingValue = _this.getEmptyState(newMapping === null || newMapping === void 0 ? void 0 : newMapping.controlId);
1405
- var _newState_newMapping_controlId;
1406
- var mainStateKeys = Object.keys((_newState_newMapping_controlId = newState === null || newState === void 0 ? void 0 : newState[newMapping === null || newMapping === void 0 ? void 0 : newMapping.controlId]) !== null && _newState_newMapping_controlId !== void 0 ? _newState_newMapping_controlId : {});
1410
+ var mainStateKeys = Object.keys((_ref = newState === null || newState === void 0 ? void 0 : newState[newMapping === null || newMapping === void 0 ? void 0 : newMapping.controlId]) !== null && _ref !== void 0 ? _ref : {});
1407
1411
  mappingKeys === null || mappingKeys === void 0 ? void 0 : mappingKeys.forEach(function(key) {
1408
1412
  if (!mainStateKeys.includes(key) && key !== 'uid' && newState[newMapping === null || newMapping === void 0 ? void 0 : newMapping.controlId]) {
1409
1413
  if (Object.keys(newState).length) {
@@ -54,8 +54,7 @@ var Store = /*#__PURE__*/ function() {
54
54
  _class_call_check(this, Store);
55
55
  _define_property(this, "emptyState", void 0);
56
56
  _define_property(this, "state", void 0);
57
- _define_property(this, "dataBindMapping", void 0 // 主要提供给二开使用
58
- );
57
+ _define_property(this, "dataBindMapping", void 0); // 主要提供给二开使用
59
58
  _define_property(this, "controlIdMapping", void 0);
60
59
  _define_property(this, "subtableHeadersControlIdMapping", void 0);
61
60
  _define_property(this, "defaultState", void 0);
@@ -136,10 +135,10 @@ var Store = /*#__PURE__*/ function() {
136
135
  } else {
137
136
  var controlInfo = this.controlIdMapping[controlId];
138
137
  if (controlInfo !== undefined) {
138
+ var _ref;
139
139
  var data = this.state[controlInfo.dataView][controlId];
140
- var _controlInfo_children;
141
140
  // 只有明细表key,再通过rowIndex获取行数据
142
- if (rowIndex !== undefined && Object.keys((_controlInfo_children = controlInfo === null || controlInfo === void 0 ? void 0 : controlInfo.children) !== null && _controlInfo_children !== void 0 ? _controlInfo_children : {}).length > 0) {
141
+ if (rowIndex !== undefined && Object.keys((_ref = controlInfo === null || controlInfo === void 0 ? void 0 : controlInfo.children) !== null && _ref !== void 0 ? _ref : {}).length > 0) {
143
142
  return data[rowIndex];
144
143
  } else {
145
144
  return data;
@@ -288,11 +287,11 @@ item) {
288
287
  dataViewState[item.id] = JSONCopy(item.props.defaultValue);
289
288
  emptyDataViewState[item.id] = JSONCopy(item.props.defaultValue);
290
289
  } else {
290
+ var _fill_map, _item_props_defaultRows;
291
291
  var emptyTemplate = {};
292
292
  loopFormSchema(item.props.headers, function(headerItem) {
293
293
  emptyTemplate[headerItem.id] = JSONCopy(headerItem.props.defaultValue);
294
294
  });
295
- var _item_props_defaultRows, _fill_map;
296
295
  dataViewState[item.id] = (_fill_map = new Array((_item_props_defaultRows = item.props.defaultRows) !== null && _item_props_defaultRows !== void 0 ? _item_props_defaultRows : 1).fill(0).map(function() {
297
296
  return _object_spread({
298
297
  uid: 'new:' + buildUUID('uid')
@@ -420,9 +419,9 @@ item) {
420
419
  options: []
421
420
  };
422
421
  loopFormSchema(item.props.headers, function(formControl) {
422
+ var _ref;
423
423
  var _data_item_id;
424
- var _data_item_id_children;
425
- 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 : {}, _define_property({}, formControl.id, {
424
+ Object.assign((_ref = (_data_item_id = data[item.id]) === null || _data_item_id === void 0 ? void 0 : _data_item_id.children) !== null && _ref !== void 0 ? _ref : {}, _define_property({}, formControl.id, {
426
425
  dataBind: formControl.props.dataBind
427
426
  }));
428
427
  });
@@ -249,7 +249,7 @@ var StringArrayValueChecker = /*#__PURE__*/ function(ValueChecker) {
249
249
  if (Array.isArray(newValue)) {
250
250
  return getStringValueArray(newValue);
251
251
  }
252
- } catch (e) {}
252
+ } catch (unused) {}
253
253
  }
254
254
  return [
255
255
  String(value)
@@ -295,7 +295,7 @@ var NumberArrayValueChecker = /*#__PURE__*/ function(ValueChecker) {
295
295
  if (isArray(newValue)) {
296
296
  return getNumberValueArray(newValue);
297
297
  }
298
- } catch (e) {}
298
+ } catch (unused) {}
299
299
  }
300
300
  var newValue1 = Number(value);
301
301
  if (Number.isNaN(newValue1)) {
@@ -340,7 +340,7 @@ var MoneyValueChecker = /*#__PURE__*/ function(ValueChecker) {
340
340
  try {
341
341
  var newValue = JSON.parse(value);
342
342
  result = new AmountValue(_object_spread({}, oldValue, newValue));
343
- } catch (e) {}
343
+ } catch (unused) {}
344
344
  }
345
345
  if (result) {
346
346
  var numberChecker = new NumberValueChecker();
@@ -388,7 +388,7 @@ var TimeScopeValueChecker = /*#__PURE__*/ function(ValueChecker) {
388
388
  try {
389
389
  var newValue = JSON.parse(value);
390
390
  result = new RangeDateValue(_object_spread({}, oldValue, newValue));
391
- } catch (e) {}
391
+ } catch (unused) {}
392
392
  }
393
393
  if (result) {
394
394
  var stringChecker = new StringValueChecker();
@@ -437,7 +437,7 @@ var CalcValueChecker = /*#__PURE__*/ function(ValueChecker) {
437
437
  try {
438
438
  var newValue = JSON.parse(value);
439
439
  result = new CalcValue(_object_spread({}, oldValue, newValue));
440
- } catch (e) {}
440
+ } catch (unused) {}
441
441
  }
442
442
  if (result) {
443
443
  var numberChecker = new NumberValueChecker();
@@ -495,7 +495,7 @@ var AddressValueChecker = /*#__PURE__*/ function(ValueChecker) {
495
495
  try {
496
496
  var newValue = JSON.parse(value);
497
497
  result = new AddressValue(_object_spread({}, oldValue, camelizeKeys(newValue)));
498
- } catch (e) {}
498
+ } catch (unused) {}
499
499
  }
500
500
  if (result) {
501
501
  var stringChecker = new StringValueChecker();
@@ -129,6 +129,7 @@ function ArrayHandler(target, propertyKey, value, thisKey, callback) {
129
129
  return Reflect.get(target, propertyKey, receiver);
130
130
  },
131
131
  set: function set(target, propertyKey, value, receiver) {
132
+ var _reProxyState;
132
133
  var newValue = JSONCopy(value);
133
134
  // @ts-ignore
134
135
  var oldValue = target[propertyKey];
@@ -145,7 +146,6 @@ function ArrayHandler(target, propertyKey, value, thisKey, callback) {
145
146
  }
146
147
  }
147
148
  }
148
- var _reProxyState;
149
149
  newValue = (_reProxyState = reProxyState(newValue)) !== null && _reProxyState !== void 0 ? _reProxyState : newValue;
150
150
  // 先设置值,然后再进行触发回调,确保回调内拿到的是最新的值
151
151
  var setResult;
@@ -248,10 +248,10 @@ function flatInstanceForChildren(controls) {
248
248
  // 最后一个key可能是值对象上边的key,比如金额的amount和currency,计算公式的result和unit,所以需要判断前一个控件是不是一个表单控件,是的话就返回最后一个表单控件
249
249
  return findEndItem ? findEndItem : prevItem.controlType === CONTROL_BASE_TYPE.FORM ? prevItem : undefined;
250
250
  } else {
251
+ var _ref;
251
252
  var _prevItem_children;
252
- var _prevItem_children_index;
253
253
  // 如果有children,则取children中对应的下标,没有的话一直返回prevItem
254
- 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;
254
+ return (_ref = prevItem === null || prevItem === void 0 ? void 0 : (_prevItem_children = prevItem.children) === null || _prevItem_children === void 0 ? void 0 : _prevItem_children[index]) !== null && _ref !== void 0 ? _ref : prevItem;
255
255
  }
256
256
  }, initInstance);
257
257
  }
@@ -296,19 +296,18 @@ export var CalcPlugin = /*#__PURE__*/ function() {
296
296
  * */ function watchSubtableChange() {
297
297
  var _this = this;
298
298
  this.engine.on('list-change', function(payload) {
299
+ var _ref, _this_dependenciesTriggerMap_get;
299
300
  var _payload_options;
300
301
  // 初始化前是批量操作。不做处理
301
302
  if (_this.engine.isMounted === false) return;
302
303
  _this.resetDependencies();
303
- var _payload_options_changed;
304
- 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 : [];
304
+ var changedRows = (_ref = (_payload_options = payload.options) === null || _payload_options === void 0 ? void 0 : _payload_options.changed) !== null && _ref !== void 0 ? _ref : [];
305
305
  // 对发生改变的行进行重新计算
306
306
  var changedCalc = _this.getCalcControlsFromSubtableRows(changedRows);
307
307
  // @ts-ignore
308
308
  changedCalc.forEach(function(calcControl) {
309
309
  _this.computedCalcValue(calcControl);
310
310
  });
311
- var _this_dependenciesTriggerMap_get;
312
311
  var calcControls = (_this_dependenciesTriggerMap_get = _this.dependenciesTriggerMap.get(payload.instance.id)) !== null && _this_dependenciesTriggerMap_get !== void 0 ? _this_dependenciesTriggerMap_get : [];
313
312
  // @ts-ignore
314
313
  calcControls.forEach(function(calcControl) {
@@ -324,13 +323,13 @@ export var CalcPlugin = /*#__PURE__*/ function() {
324
323
  * */ function watchControlChange() {
325
324
  var _this = this;
326
325
  this.engine.on('change', function(payload) {
326
+ var _this_dependenciesTriggerMap_get;
327
327
  // 初始化前是批量操作。不做处理
328
328
  if (_this.engine.isMounted === false) return;
329
329
  var instance = payload.instance;
330
330
  if (!_this.dependenciesTriggerMap.has(instance.id)) {
331
331
  return;
332
332
  }
333
- var _this_dependenciesTriggerMap_get;
334
333
  var calcControls = (_this_dependenciesTriggerMap_get = _this.dependenciesTriggerMap.get(instance.id)) !== null && _this_dependenciesTriggerMap_get !== void 0 ? _this_dependenciesTriggerMap_get : [];
335
334
  // 在明细子表中的控件,如果计算公式也在明细子表,那只触发同一行的计算公式的计算
336
335
  if (payload.rowIndex !== undefined && payload.rowIndex > -1) {
@@ -369,6 +368,7 @@ export var CalcPlugin = /*#__PURE__*/ function() {
369
368
  * */ // @ts-ignore
370
369
  function computedCalcValue(control) {
371
370
  var _this = this;
371
+ var _ref;
372
372
  var scriptEcho = control.props.scriptEcho;
373
373
  if (!scriptEcho || scriptEcho.length === 0) {
374
374
  return;
@@ -446,10 +446,9 @@ export var CalcPlugin = /*#__PURE__*/ function() {
446
446
  if (result === (oldValue === null || oldValue === void 0 ? void 0 : oldValue.result)) {
447
447
  return;
448
448
  }
449
- var _oldValue_unit;
450
449
  this.engine.setState(control.id, {
451
450
  result: result,
452
- unit: (_oldValue_unit = oldValue === null || oldValue === void 0 ? void 0 : oldValue.unit) !== null && _oldValue_unit !== void 0 ? _oldValue_unit : ''
451
+ unit: (_ref = oldValue === null || oldValue === void 0 ? void 0 : oldValue.unit) !== null && _ref !== void 0 ? _ref : ''
453
452
  }, rowIndex);
454
453
  }
455
454
  },
@@ -60,7 +60,7 @@ function _define_property(obj, key, value) {
60
60
  return obj;
61
61
  }
62
62
  function _ts_generator(thisArg, body) {
63
- var f, y, t, g, _ = {
63
+ var f, y, t, _ = {
64
64
  label: 0,
65
65
  sent: function() {
66
66
  if (t[0] & 1) throw t[1];
@@ -68,13 +68,17 @@ function _ts_generator(thisArg, body) {
68
68
  },
69
69
  trys: [],
70
70
  ops: []
71
- };
72
- return g = {
73
- next: verb(0),
74
- "throw": verb(1),
75
- "return": verb(2)
76
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
77
- return this;
71
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
72
+ return d(g, "next", {
73
+ value: verb(0)
74
+ }), d(g, "throw", {
75
+ value: verb(1)
76
+ }), d(g, "return", {
77
+ value: verb(2)
78
+ }), typeof Symbol === "function" && d(g, Symbol.iterator, {
79
+ value: function() {
80
+ return this;
81
+ }
78
82
  }), g;
79
83
  function verb(n) {
80
84
  return function(v) {
@@ -86,7 +90,7 @@ function _ts_generator(thisArg, body) {
86
90
  }
87
91
  function step(op) {
88
92
  if (f) throw new TypeError("Generator is already executing.");
89
- while(_)try {
93
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
90
94
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
91
95
  if (y = 0, t) op = [
92
96
  op[0] & 2,
@@ -218,13 +222,13 @@ export var ControlsEventPlugin = /*#__PURE__*/ function() {
218
222
  key: "engineAddEventListener",
219
223
  value: function engineAddEventListener(eventKey, controlEventKey) {
220
224
  var _this = this;
221
- this.engine.on(eventKey, /*#__PURE__*/ function() {
222
- var _ref = _async_to_generator(function(payload) {
225
+ this.engine.on(eventKey, function(payload) {
226
+ return _async_to_generator(function() {
223
227
  return _ts_generator(this, function(_state) {
224
228
  switch(_state.label){
225
229
  case 0:
226
230
  // 初始化state的时候不触发change事件,必须在engine mounted以后才触发
227
- if ((eventKey === 'change' || eventKey === 'list-change') && !_this.engine.isMounted) {
231
+ if ((eventKey === 'change' || eventKey === 'list-change') && !this.engine.isMounted) {
228
232
  return [
229
233
  2
230
234
  ];
@@ -235,7 +239,7 @@ export var ControlsEventPlugin = /*#__PURE__*/ function() {
235
239
  ];
236
240
  return [
237
241
  4,
238
- _this.callControlEvent(controlEventKey, payload)
242
+ this.callControlEvent(controlEventKey, payload)
239
243
  ];
240
244
  case 1:
241
245
  return [
@@ -248,23 +252,20 @@ export var ControlsEventPlugin = /*#__PURE__*/ function() {
248
252
  ];
249
253
  }
250
254
  });
251
- });
252
- return function(payload) {
253
- return _ref.apply(this, arguments);
254
- };
255
- }());
255
+ }).call(_this);
256
+ });
256
257
  }
257
258
  },
258
259
  {
259
260
  key: "callControlEvent",
260
261
  value: function callControlEvent(name, payload) {
261
- var _this = this;
262
262
  return _async_to_generator(function() {
263
- var events, result;
263
+ var _this, events, result;
264
264
  return _ts_generator(this, function(_state) {
265
265
  switch(_state.label){
266
266
  case 0:
267
- events = _this.config[payload.instance.id];
267
+ _this = this;
268
+ events = this.config[payload.instance.id];
268
269
  if (!events || !Array.isArray(events[name])) {
269
270
  return [
270
271
  2,
@@ -273,15 +274,15 @@ export var ControlsEventPlugin = /*#__PURE__*/ function() {
273
274
  }
274
275
  return [
275
276
  4,
276
- Promise.all(events[name].map(/*#__PURE__*/ function() {
277
- var _ref = _async_to_generator(function(eventName) {
277
+ Promise.all(events[name].map(function(eventName) {
278
+ return _async_to_generator(function() {
278
279
  var execResult;
279
280
  return _ts_generator(this, function(_state) {
280
281
  switch(_state.label){
281
282
  case 0:
282
283
  return [
283
284
  4,
284
- _this.engine.getAction().execAction(eventName, //qiyu 注释掉的两个参数变为全局参数
285
+ this.engine.getAction().execAction(eventName, //qiyu 注释掉的两个参数变为全局参数
285
286
  // this.engine,
286
287
  // this.engine.getAction().actionUtils, //以前是params,空的
287
288
  payload)
@@ -294,11 +295,8 @@ export var ControlsEventPlugin = /*#__PURE__*/ function() {
294
295
  ];
295
296
  }
296
297
  });
297
- });
298
- return function(eventName) {
299
- return _ref.apply(this, arguments);
300
- };
301
- }()))
298
+ }).call(_this);
299
+ }))
302
300
  ];
303
301
  case 1:
304
302
  result = _state.sent();
@@ -318,7 +316,7 @@ export var ControlsEventPlugin = /*#__PURE__*/ function() {
318
316
  ];
319
317
  }
320
318
  });
321
- })();
319
+ }).call(this);
322
320
  }
323
321
  }
324
322
  ]);