@byteluck-fe/model-driven-engine 2.23.0-beta.3 → 2.23.0-beta.6

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.
@@ -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, updateValueFromKeys, warn, Watcher, isBuiltInControls } from '@byteluck-fe/model-driven-shared';
332
+ import { CONTROL_BASE_TYPE, CONTROL_TYPE, DEFAULT_LOCALE, error, genNonDuplicateId, isString, JSONCopy, log, RulesMessage, 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,18 @@ 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)
363
+ RulesMessage.setLocale(language, messagesI18n);
392
364
  _this.debug = debug;
393
365
  _this.runtime = new Runtime({
394
366
  schema: schema,
@@ -625,6 +597,7 @@ var Engine = /*#__PURE__*/ function(Watcher) {
625
597
  {
626
598
  key: "_handlerSubtableUpdateUid",
627
599
  value: function _handlerSubtableUpdateUid(subtableData) {
600
+ ;
628
601
  subtableData.forEach(function(item) {
629
602
  if (!item.uid) {
630
603
  Object.assign(item, {
@@ -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);
@@ -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
  });
@@ -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
  {
@@ -217,7 +217,7 @@ export var ControlsEventPlugin = /*#__PURE__*/ function() {
217
217
  key: "engineAddEventListener",
218
218
  value: function engineAddEventListener(eventKey, controlEventKey) {
219
219
  var _this = this;
220
- this.engine.on(eventKey, function() {
220
+ this.engine.on(eventKey, /*#__PURE__*/ function() {
221
221
  var _ref = _async_to_generator(function(payload) {
222
222
  return _ts_generator(this, function(_state) {
223
223
  switch(_state.label){
@@ -272,7 +272,7 @@ export var ControlsEventPlugin = /*#__PURE__*/ function() {
272
272
  }
273
273
  return [
274
274
  4,
275
- Promise.all(events[name].map(function() {
275
+ Promise.all(events[name].map(/*#__PURE__*/ function() {
276
276
  var _ref = _async_to_generator(function(eventName) {
277
277
  var execResult;
278
278
  return _ts_generator(this, function(_state) {
@@ -224,7 +224,7 @@ export var LifecycleEventPlugin = /*#__PURE__*/ function() {
224
224
  Object.entries(LifecycleEventKeyMap).forEach(function(param) {
225
225
  var _param = _sliced_to_array(param, 2), engineKey = _param[0], lifecycleKey = _param[1];
226
226
  var _this1 = _this;
227
- engine.on(engineKey, function() {
227
+ engine.on(engineKey, /*#__PURE__*/ function() {
228
228
  var _ref = _async_to_generator(function(payload) {
229
229
  var result;
230
230
  return _ts_generator(this, function(_state) {
@@ -278,7 +278,7 @@ export var LifecycleEventPlugin = /*#__PURE__*/ function() {
278
278
  }
279
279
  return [
280
280
  4,
281
- Promise.all(events[name].map(function() {
281
+ Promise.all(events[name].map(/*#__PURE__*/ function() {
282
282
  var _ref = _async_to_generator(function(eventName) {
283
283
  var execResult;
284
284
  return _ts_generator(this, function(_state) {