@byteluck-fe/model-driven-engine 2.7.0-alpha.3 → 2.7.0-alpha.30a

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.
@@ -1,18 +1,18 @@
1
- function _arrayLikeToArray(arr, len) {
1
+ function _array_like_to_array(arr, len) {
2
2
  if (len == null || len > arr.length) len = arr.length;
3
3
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4
4
  return arr2;
5
5
  }
6
- function _arrayWithHoles(arr) {
6
+ function _array_with_holes(arr) {
7
7
  if (Array.isArray(arr)) return arr;
8
8
  }
9
- function _assertThisInitialized(self) {
9
+ function _assert_this_initialized(self) {
10
10
  if (self === void 0) {
11
11
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
12
12
  }
13
13
  return self;
14
14
  }
15
- function _classCallCheck(instance, Constructor) {
15
+ function _class_call_check(instance, Constructor) {
16
16
  if (!(instance instanceof Constructor)) {
17
17
  throw new TypeError("Cannot call a class as a function");
18
18
  }
@@ -26,12 +26,12 @@ function _defineProperties(target, props) {
26
26
  Object.defineProperty(target, descriptor.key, descriptor);
27
27
  }
28
28
  }
29
- function _createClass(Constructor, protoProps, staticProps) {
29
+ function _create_class(Constructor, protoProps, staticProps) {
30
30
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
31
31
  if (staticProps) _defineProperties(Constructor, staticProps);
32
32
  return Constructor;
33
33
  }
34
- function _defineProperty(obj, key, value) {
34
+ function _define_property(obj, key, value) {
35
35
  if (key in obj) {
36
36
  Object.defineProperty(obj, key, {
37
37
  value: value,
@@ -44,11 +44,11 @@ function _defineProperty(obj, key, value) {
44
44
  }
45
45
  return obj;
46
46
  }
47
- function _getPrototypeOf(o) {
48
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
47
+ function _get_prototype_of(o) {
48
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
49
49
  return o.__proto__ || Object.getPrototypeOf(o);
50
50
  };
51
- return _getPrototypeOf(o);
51
+ return _get_prototype_of(o);
52
52
  }
53
53
  function _inherits(subClass, superClass) {
54
54
  if (typeof superClass !== "function" && superClass !== null) {
@@ -61,16 +61,9 @@ function _inherits(subClass, superClass) {
61
61
  configurable: true
62
62
  }
63
63
  });
64
- if (superClass) _setPrototypeOf(subClass, superClass);
64
+ if (superClass) _set_prototype_of(subClass, superClass);
65
65
  }
66
- function _instanceof(left, right) {
67
- if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
68
- return !!right[Symbol.hasInstance](left);
69
- } else {
70
- return left instanceof right;
71
- }
72
- }
73
- function _iterableToArrayLimit(arr, i) {
66
+ function _iterable_to_array_limit(arr, i) {
74
67
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
75
68
  if (_i == null) return;
76
69
  var _arr = [];
@@ -94,10 +87,10 @@ function _iterableToArrayLimit(arr, i) {
94
87
  }
95
88
  return _arr;
96
89
  }
97
- function _nonIterableRest() {
90
+ function _non_iterable_rest() {
98
91
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
99
92
  }
100
- function _objectSpread(target) {
93
+ function _object_spread(target) {
101
94
  for(var i = 1; i < arguments.length; i++){
102
95
  var source = arguments[i] != null ? arguments[i] : {};
103
96
  var ownKeys = Object.keys(source);
@@ -107,40 +100,40 @@ function _objectSpread(target) {
107
100
  }));
108
101
  }
109
102
  ownKeys.forEach(function(key) {
110
- _defineProperty(target, key, source[key]);
103
+ _define_property(target, key, source[key]);
111
104
  });
112
105
  }
113
106
  return target;
114
107
  }
115
- function _possibleConstructorReturn(self, call) {
116
- if (call && (_typeof(call) === "object" || typeof call === "function")) {
108
+ function _possible_constructor_return(self, call) {
109
+ if (call && (_type_of(call) === "object" || typeof call === "function")) {
117
110
  return call;
118
111
  }
119
- return _assertThisInitialized(self);
112
+ return _assert_this_initialized(self);
120
113
  }
121
- function _setPrototypeOf(o, p) {
122
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
114
+ function _set_prototype_of(o, p) {
115
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
123
116
  o.__proto__ = p;
124
117
  return o;
125
118
  };
126
- return _setPrototypeOf(o, p);
119
+ return _set_prototype_of(o, p);
127
120
  }
128
- function _slicedToArray(arr, i) {
129
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
121
+ function _sliced_to_array(arr, i) {
122
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
130
123
  }
131
- var _typeof = function(obj) {
124
+ function _type_of(obj) {
132
125
  "@swc/helpers - typeof";
133
126
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
134
- };
135
- function _unsupportedIterableToArray(o, minLen) {
127
+ }
128
+ function _unsupported_iterable_to_array(o, minLen) {
136
129
  if (!o) return;
137
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
130
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
138
131
  var n = Object.prototype.toString.call(o).slice(8, -1);
139
132
  if (n === "Object" && o.constructor) n = o.constructor.name;
140
133
  if (n === "Map" || n === "Set") return Array.from(n);
141
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
134
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
142
135
  }
143
- function _isNativeReflectConstruct() {
136
+ function _is_native_reflect_construct() {
144
137
  if (typeof Reflect === "undefined" || !Reflect.construct) return false;
145
138
  if (Reflect.construct.sham) return false;
146
139
  if (typeof Proxy === "function") return true;
@@ -151,17 +144,17 @@ function _isNativeReflectConstruct() {
151
144
  return false;
152
145
  }
153
146
  }
154
- function _createSuper(Derived) {
155
- var hasNativeReflectConstruct = _isNativeReflectConstruct();
147
+ function _create_super(Derived) {
148
+ var hasNativeReflectConstruct = _is_native_reflect_construct();
156
149
  return function _createSuperInternal() {
157
- var Super = _getPrototypeOf(Derived), result;
150
+ var Super = _get_prototype_of(Derived), result;
158
151
  if (hasNativeReflectConstruct) {
159
- var NewTarget = _getPrototypeOf(this).constructor;
152
+ var NewTarget = _get_prototype_of(this).constructor;
160
153
  result = Reflect.construct(Super, arguments, NewTarget);
161
154
  } else {
162
155
  result = Super.apply(this, arguments);
163
156
  }
164
- return _possibleConstructorReturn(this, result);
157
+ return _possible_constructor_return(this, result);
165
158
  };
166
159
  }
167
160
  import { isArray, isFunction, isString, isJSONArray, isJSONObject, isNumber, isNumberAndEmptyStringArray, isPlainObject, isStringArray, FieldTypes, isObject } from "@byteluck-fe/model-driven-shared";
@@ -169,17 +162,17 @@ import { AddressValue, AmountValue, CalcValue, RangeDateValue } from "@byteluck-
169
162
  import { camelizeKeys } from "humps";
170
163
  var ValueChecker = function ValueChecker() {
171
164
  "use strict";
172
- _classCallCheck(this, ValueChecker);
165
+ _class_call_check(this, ValueChecker);
173
166
  };
174
167
  var StringValueChecker = /*#__PURE__*/ function(ValueChecker) {
175
168
  "use strict";
176
169
  _inherits(StringValueChecker, ValueChecker);
177
- var _super = _createSuper(StringValueChecker);
170
+ var _super = _create_super(StringValueChecker);
178
171
  function StringValueChecker() {
179
- _classCallCheck(this, StringValueChecker);
172
+ _class_call_check(this, StringValueChecker);
180
173
  return _super.apply(this, arguments);
181
174
  }
182
- _createClass(StringValueChecker, [
175
+ _create_class(StringValueChecker, [
183
176
  {
184
177
  key: "validate",
185
178
  value: function validate(value) {
@@ -207,12 +200,12 @@ var StringValueChecker = /*#__PURE__*/ function(ValueChecker) {
207
200
  var NumberValueChecker = /*#__PURE__*/ function(ValueChecker) {
208
201
  "use strict";
209
202
  _inherits(NumberValueChecker, ValueChecker);
210
- var _super = _createSuper(NumberValueChecker);
203
+ var _super = _create_super(NumberValueChecker);
211
204
  function NumberValueChecker() {
212
- _classCallCheck(this, NumberValueChecker);
205
+ _class_call_check(this, NumberValueChecker);
213
206
  return _super.apply(this, arguments);
214
207
  }
215
- _createClass(NumberValueChecker, [
208
+ _create_class(NumberValueChecker, [
216
209
  {
217
210
  // 数字类型允许是空字符串,用于置空数据
218
211
  key: "validate",
@@ -239,12 +232,12 @@ var NumberValueChecker = /*#__PURE__*/ function(ValueChecker) {
239
232
  var StringArrayValueChecker = /*#__PURE__*/ function(ValueChecker) {
240
233
  "use strict";
241
234
  _inherits(StringArrayValueChecker, ValueChecker);
242
- var _super = _createSuper(StringArrayValueChecker);
235
+ var _super = _create_super(StringArrayValueChecker);
243
236
  function StringArrayValueChecker() {
244
- _classCallCheck(this, StringArrayValueChecker);
237
+ _class_call_check(this, StringArrayValueChecker);
245
238
  return _super.apply(this, arguments);
246
239
  }
247
- _createClass(StringArrayValueChecker, [
240
+ _create_class(StringArrayValueChecker, [
248
241
  {
249
242
  key: "validate",
250
243
  value: function validate(value) {
@@ -284,12 +277,12 @@ var StringArrayValueChecker = /*#__PURE__*/ function(ValueChecker) {
284
277
  var NumberArrayValueChecker = /*#__PURE__*/ function(ValueChecker) {
285
278
  "use strict";
286
279
  _inherits(NumberArrayValueChecker, ValueChecker);
287
- var _super = _createSuper(NumberArrayValueChecker);
280
+ var _super = _create_super(NumberArrayValueChecker);
288
281
  function NumberArrayValueChecker() {
289
- _classCallCheck(this, NumberArrayValueChecker);
282
+ _class_call_check(this, NumberArrayValueChecker);
290
283
  return _super.apply(this, arguments);
291
284
  }
292
- _createClass(NumberArrayValueChecker, [
285
+ _create_class(NumberArrayValueChecker, [
293
286
  {
294
287
  key: "validate",
295
288
  value: function validate(value) {
@@ -335,16 +328,17 @@ var NumberArrayValueChecker = /*#__PURE__*/ function(ValueChecker) {
335
328
  var MoneyValueChecker = /*#__PURE__*/ function(ValueChecker) {
336
329
  "use strict";
337
330
  _inherits(MoneyValueChecker, ValueChecker);
338
- var _super = _createSuper(MoneyValueChecker);
331
+ var _super = _create_super(MoneyValueChecker);
339
332
  function MoneyValueChecker() {
340
- _classCallCheck(this, MoneyValueChecker);
333
+ _class_call_check(this, MoneyValueChecker);
341
334
  return _super.apply(this, arguments);
342
335
  }
343
- _createClass(MoneyValueChecker, [
336
+ _create_class(MoneyValueChecker, [
344
337
  {
345
338
  key: "validate",
346
339
  value: function validate(value) {
347
- return _instanceof(value, AmountValue) || isPlainObject(value) && "amount" in value && isNumber(value.amount) && "currency" in value && isString(value.currency);
340
+ return(// value instanceof AmountValue ||
341
+ isPlainObject(value) && "amount" in value && isNumber(value.amount) && "currency" in value && isString(value.currency));
348
342
  }
349
343
  },
350
344
  {
@@ -357,12 +351,12 @@ var MoneyValueChecker = /*#__PURE__*/ function(ValueChecker) {
357
351
  }
358
352
  var result;
359
353
  if (isPlainObject(value)) {
360
- result = new AmountValue(_objectSpread({}, oldValue, value));
354
+ result = new AmountValue(_object_spread({}, oldValue, value));
361
355
  }
362
356
  if (isString(value) && isJSONObject(value)) {
363
357
  try {
364
358
  var newValue = JSON.parse(value);
365
- result = new AmountValue(_objectSpread({}, oldValue, newValue));
359
+ result = new AmountValue(_object_spread({}, oldValue, newValue));
366
360
  } catch (e) {}
367
361
  }
368
362
  if (result) {
@@ -385,16 +379,17 @@ var MoneyValueChecker = /*#__PURE__*/ function(ValueChecker) {
385
379
  var TimeScopeValueChecker = /*#__PURE__*/ function(ValueChecker) {
386
380
  "use strict";
387
381
  _inherits(TimeScopeValueChecker, ValueChecker);
388
- var _super = _createSuper(TimeScopeValueChecker);
382
+ var _super = _create_super(TimeScopeValueChecker);
389
383
  function TimeScopeValueChecker() {
390
- _classCallCheck(this, TimeScopeValueChecker);
384
+ _class_call_check(this, TimeScopeValueChecker);
391
385
  return _super.apply(this, arguments);
392
386
  }
393
- _createClass(TimeScopeValueChecker, [
387
+ _create_class(TimeScopeValueChecker, [
394
388
  {
395
389
  key: "validate",
396
390
  value: function validate(value) {
397
- return _instanceof(value, RangeDateValue) || isPlainObject(value) && "min" in value && isString(value.min) && "max" in value && isString(value.max);
391
+ return(// value instanceof RangeDateValue ||
392
+ isPlainObject(value) && "min" in value && isString(value.min) && "max" in value && isString(value.max));
398
393
  }
399
394
  },
400
395
  {
@@ -405,12 +400,12 @@ var TimeScopeValueChecker = /*#__PURE__*/ function(ValueChecker) {
405
400
  }
406
401
  var result;
407
402
  if (isPlainObject(value)) {
408
- result = new RangeDateValue(_objectSpread({}, oldValue, value));
403
+ result = new RangeDateValue(_object_spread({}, oldValue, value));
409
404
  }
410
405
  if (isString(value) && isJSONObject(value)) {
411
406
  try {
412
407
  var newValue = JSON.parse(value);
413
- result = new RangeDateValue(_objectSpread({}, oldValue, newValue));
408
+ result = new RangeDateValue(_object_spread({}, oldValue, newValue));
414
409
  } catch (e) {}
415
410
  }
416
411
  if (result) {
@@ -432,16 +427,17 @@ var TimeScopeValueChecker = /*#__PURE__*/ function(ValueChecker) {
432
427
  var CalcValueChecker = /*#__PURE__*/ function(ValueChecker) {
433
428
  "use strict";
434
429
  _inherits(CalcValueChecker, ValueChecker);
435
- var _super = _createSuper(CalcValueChecker);
430
+ var _super = _create_super(CalcValueChecker);
436
431
  function CalcValueChecker() {
437
- _classCallCheck(this, CalcValueChecker);
432
+ _class_call_check(this, CalcValueChecker);
438
433
  return _super.apply(this, arguments);
439
434
  }
440
- _createClass(CalcValueChecker, [
435
+ _create_class(CalcValueChecker, [
441
436
  {
442
437
  key: "validate",
443
438
  value: function validate(value) {
444
- return _instanceof(value, CalcValue) || isPlainObject(value) && "result" in value && isNumber(value.result) && "unit" in value && isString(value.unit);
439
+ return(// value instanceof CalcValue ||
440
+ isPlainObject(value) && "result" in value && isNumber(value.result) && "unit" in value && isString(value.unit));
445
441
  }
446
442
  },
447
443
  {
@@ -454,12 +450,12 @@ var CalcValueChecker = /*#__PURE__*/ function(ValueChecker) {
454
450
  }
455
451
  var result;
456
452
  if (isPlainObject(value)) {
457
- result = new CalcValue(_objectSpread({}, oldValue, value));
453
+ result = new CalcValue(_object_spread({}, oldValue, value));
458
454
  }
459
455
  if (isString(value) && isJSONObject(value)) {
460
456
  try {
461
457
  var newValue = JSON.parse(value);
462
- result = new CalcValue(_objectSpread({}, oldValue, newValue));
458
+ result = new CalcValue(_object_spread({}, oldValue, newValue));
463
459
  } catch (e) {}
464
460
  }
465
461
  if (result) {
@@ -482,16 +478,27 @@ var CalcValueChecker = /*#__PURE__*/ function(ValueChecker) {
482
478
  var AddressValueChecker = /*#__PURE__*/ function(ValueChecker) {
483
479
  "use strict";
484
480
  _inherits(AddressValueChecker, ValueChecker);
485
- var _super = _createSuper(AddressValueChecker);
481
+ var _super = _create_super(AddressValueChecker);
486
482
  function AddressValueChecker() {
487
- _classCallCheck(this, AddressValueChecker);
483
+ _class_call_check(this, AddressValueChecker);
488
484
  return _super.apply(this, arguments);
489
485
  }
490
- _createClass(AddressValueChecker, [
486
+ _create_class(AddressValueChecker, [
491
487
  {
492
488
  key: "validate",
493
489
  value: function validate(value) {
494
- return _instanceof(value, AddressValue);
490
+ // return value instanceof AddressValue
491
+ if (isPlainObject(value)) {
492
+ // city?: string;
493
+ // cityDisplay?: string;
494
+ // district?: string;
495
+ // districtDisplay?: string;
496
+ // province?: string;
497
+ // provinceDisplay?: string
498
+ return true;
499
+ } else {
500
+ return false;
501
+ }
495
502
  }
496
503
  },
497
504
  {
@@ -502,12 +509,12 @@ var AddressValueChecker = /*#__PURE__*/ function(ValueChecker) {
502
509
  }
503
510
  var result;
504
511
  if (isPlainObject(value)) {
505
- result = new AddressValue(_objectSpread({}, oldValue, camelizeKeys(value)));
512
+ result = new AddressValue(_object_spread({}, oldValue, camelizeKeys(value)));
506
513
  }
507
514
  if (isString(value) && isJSONObject(value)) {
508
515
  try {
509
516
  var newValue = JSON.parse(value);
510
- result = new AddressValue(_objectSpread({}, oldValue, camelizeKeys(newValue)));
517
+ result = new AddressValue(_object_spread({}, oldValue, camelizeKeys(newValue)));
511
518
  } catch (e) {}
512
519
  }
513
520
  if (result) {
@@ -532,9 +539,9 @@ var AddressValueChecker = /*#__PURE__*/ function(ValueChecker) {
532
539
  var ValueCheckerFactory = /*#__PURE__*/ function() {
533
540
  "use strict";
534
541
  function ValueCheckerFactory() {
535
- _classCallCheck(this, ValueCheckerFactory);
542
+ _class_call_check(this, ValueCheckerFactory);
536
543
  }
537
- _createClass(ValueCheckerFactory, null, [
544
+ _create_class(ValueCheckerFactory, null, [
538
545
  {
539
546
  key: "getValueChecker",
540
547
  value: function getValueChecker(fieldType) {
@@ -614,7 +621,7 @@ export function checkerValue(fieldType, key, value, oldValue) {
614
621
  }
615
622
  export function checkerSubtableValue(fieldTypeMap, value, emptyValue) {
616
623
  return Object.entries(fieldTypeMap).reduce(function(result, param) {
617
- var _param = _slicedToArray(param, 2), key = _param[0], fieldType = _param[1];
624
+ var _param = _sliced_to_array(param, 2), key = _param[0], fieldType = _param[1];
618
625
  var nowValue = value[key];
619
626
  result[key] = checkerValue(fieldType, key, nowValue, emptyValue[key]);
620
627
  return result;
@@ -1,27 +1,27 @@
1
- function _arrayLikeToArray(arr, len) {
1
+ function _array_like_to_array(arr, len) {
2
2
  if (len == null || len > arr.length) len = arr.length;
3
3
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4
4
  return arr2;
5
5
  }
6
- function _arrayWithoutHoles(arr) {
7
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
6
+ function _array_without_holes(arr) {
7
+ if (Array.isArray(arr)) return _array_like_to_array(arr);
8
8
  }
9
- function _iterableToArray(iter) {
9
+ function _iterable_to_array(iter) {
10
10
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
11
11
  }
12
- function _nonIterableSpread() {
12
+ function _non_iterable_spread() {
13
13
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
14
14
  }
15
- function _toConsumableArray(arr) {
16
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
15
+ function _to_consumable_array(arr) {
16
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
17
17
  }
18
- function _unsupportedIterableToArray(o, minLen) {
18
+ function _unsupported_iterable_to_array(o, minLen) {
19
19
  if (!o) return;
20
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
20
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
21
21
  var n = Object.prototype.toString.call(o).slice(8, -1);
22
22
  if (n === "Object" && o.constructor) n = o.constructor.name;
23
23
  if (n === "Map" || n === "Set") return Array.from(n);
24
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
24
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
25
25
  }
26
26
  var cc = console;
27
27
  import { CONTROL_BASE_TYPE, error, logerror } from "@byteluck-fe/model-driven-shared";
@@ -173,7 +173,9 @@ function ArrayHandler(target, propertyKey, value, thisKey, callback) {
173
173
  setResult = Reflect.set(target, propertyKey, newValue, receiver);
174
174
  callback.call(null, target, concatKey, value, oldValue);
175
175
  }
176
- return setResult;
176
+ // 不返回falsy 值(即 false、0、null、undefined、空字符串等)
177
+ //fix: TypeError: Proxy object's 'set' trap returned falsy value for property 'length'
178
+ return setResult ? setResult : true;
177
179
  }
178
180
  };
179
181
  }
@@ -203,9 +205,9 @@ function flatInstanceForChildren(controls) {
203
205
  var result = [];
204
206
  controls.forEach(function(item) {
205
207
  result.push(item);
206
- if (item.controlType === "layout") {
208
+ if (item.controlType === "layout" || item.controlType === "wrap") {
207
209
  var _result;
208
- (_result = result).push.apply(_result, _toConsumableArray(flatInstanceForChildren(item.children)));
210
+ (_result = result).push.apply(_result, _to_consumable_array(flatInstanceForChildren(item.children)));
209
211
  }
210
212
  });
211
213
  return result;
@@ -285,7 +287,7 @@ function getArrayNewArgs(type, args, value) {
285
287
  var result;
286
288
  var addValue = getArrayNewValue(key, args);
287
289
  if (addValue.length) {
288
- var _this, _this_engineArrayBeforeSetCallbackFlag;
290
+ var _this_engineArrayBeforeSetCallbackFlag, _this;
289
291
  // @ts-ignore
290
292
  var newValue = (_this_engineArrayBeforeSetCallbackFlag = (_this = this)[engineArrayBeforeSetCallbackFlag]) === null || _this_engineArrayBeforeSetCallbackFlag === void 0 ? void 0 : _this_engineArrayBeforeSetCallbackFlag.call(_this, // @ts-ignore
291
293
  this[engineTargetKey], // @ts-ignore
@@ -1,12 +1,12 @@
1
- function _arrayLikeToArray(arr, len) {
1
+ function _array_like_to_array(arr, len) {
2
2
  if (len == null || len > arr.length) len = arr.length;
3
3
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4
4
  return arr2;
5
5
  }
6
- function _arrayWithoutHoles(arr) {
7
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
6
+ function _array_without_holes(arr) {
7
+ if (Array.isArray(arr)) return _array_like_to_array(arr);
8
8
  }
9
- function _classCallCheck(instance, Constructor) {
9
+ function _class_call_check(instance, Constructor) {
10
10
  if (!(instance instanceof Constructor)) {
11
11
  throw new TypeError("Cannot call a class as a function");
12
12
  }
@@ -20,12 +20,12 @@ function _defineProperties(target, props) {
20
20
  Object.defineProperty(target, descriptor.key, descriptor);
21
21
  }
22
22
  }
23
- function _createClass(Constructor, protoProps, staticProps) {
23
+ function _create_class(Constructor, protoProps, staticProps) {
24
24
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
25
25
  if (staticProps) _defineProperties(Constructor, staticProps);
26
26
  return Constructor;
27
27
  }
28
- function _defineProperty(obj, key, value) {
28
+ function _define_property(obj, key, value) {
29
29
  if (key in obj) {
30
30
  Object.defineProperty(obj, key, {
31
31
  value: value,
@@ -38,22 +38,22 @@ function _defineProperty(obj, key, value) {
38
38
  }
39
39
  return obj;
40
40
  }
41
- function _iterableToArray(iter) {
41
+ function _iterable_to_array(iter) {
42
42
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
43
43
  }
44
- function _nonIterableSpread() {
44
+ function _non_iterable_spread() {
45
45
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
46
46
  }
47
- function _toConsumableArray(arr) {
48
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
47
+ function _to_consumable_array(arr) {
48
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
49
49
  }
50
- function _unsupportedIterableToArray(o, minLen) {
50
+ function _unsupported_iterable_to_array(o, minLen) {
51
51
  if (!o) return;
52
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
52
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
53
53
  var n = Object.prototype.toString.call(o).slice(8, -1);
54
54
  if (n === "Object" && o.constructor) n = o.constructor.name;
55
55
  if (n === "Map" || n === "Set") return Array.from(n);
56
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
56
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
57
57
  }
58
58
  import { CONTROL_TYPE, CALC_TOKEN_TYPE, CALC_AGGREGATE_TYPE } from "@byteluck-fe/model-driven-shared";
59
59
  import { format } from "mathjs";
@@ -69,27 +69,27 @@ var DisplayType;
69
69
  export var CalcPlugin = /*#__PURE__*/ function() {
70
70
  "use strict";
71
71
  function CalcPlugin(options) {
72
- _classCallCheck(this, CalcPlugin);
73
- _defineProperty(this, "engine", void 0);
74
- _defineProperty(this, "options", void 0);
72
+ _class_call_check(this, CalcPlugin);
73
+ _define_property(this, "engine", void 0);
74
+ _define_property(this, "options", void 0);
75
75
  /**
76
76
  * 所有的计算公式控件
77
77
  * */ // @ts-ignore
78
- _defineProperty(this, "calcControls", []);
78
+ _define_property(this, "calcControls", []);
79
79
  /**
80
80
  * key=控件id value=控件修改后需要触发重新计算的计算公式控件组成的数组
81
81
  * 存储为一个Map,用于在控件change的时候,重新计算依赖的calc
82
- * */ _defineProperty(this, "dependenciesTriggerMap", new Map());
82
+ * */ _define_property(this, "dependenciesTriggerMap", new Map());
83
83
  /**
84
84
  * 隐藏以后需要被计算的控件
85
- * */ _defineProperty(this, "hideNotRememberControlIds", []);
86
- _defineProperty(this, "dontHasPermissionControlIds", []);
87
- _defineProperty(this, "cacheComputedResult", {});
85
+ * */ _define_property(this, "hideNotRememberControlIds", []);
86
+ _define_property(this, "dontHasPermissionControlIds", []);
87
+ _define_property(this, "cacheComputedResult", {});
88
88
  this.options = options;
89
89
  this.getDontHasPermissionControlIds();
90
90
  this.getNeedHideRememberControlIds();
91
91
  }
92
- _createClass(CalcPlugin, [
92
+ _create_class(CalcPlugin, [
93
93
  {
94
94
  key: "getNeedHideRememberControlIds",
95
95
  value: /**
@@ -102,7 +102,7 @@ export var CalcPlugin = /*#__PURE__*/ function() {
102
102
  this.hideNotRememberControlIds = this.options.displayBoList.reduce(function(result, current) {
103
103
  if (!current.is_remember) {
104
104
  var _result;
105
- (_result = result).push.apply(_result, _toConsumableArray(current.hide_controls));
105
+ (_result = result).push.apply(_result, _to_consumable_array(current.hide_controls));
106
106
  }
107
107
  return result;
108
108
  }, []);
@@ -156,7 +156,7 @@ export var CalcPlugin = /*#__PURE__*/ function() {
156
156
  if (control.props.isHide) {
157
157
  return true;
158
158
  }
159
- if (control.parent === null) {
159
+ if (control.parent === null || control.parent === undefined) {
160
160
  return false;
161
161
  }
162
162
  return this.getControlIsHide(control.parent);
@@ -466,10 +466,10 @@ export var CalcPlugin = /*#__PURE__*/ function() {
466
466
  switch(type){
467
467
  case CALC_AGGREGATE_TYPE.MAX:
468
468
  var _Math;
469
- return (_Math = Math).max.apply(_Math, _toConsumableArray(values));
469
+ return (_Math = Math).max.apply(_Math, _to_consumable_array(values));
470
470
  case CALC_AGGREGATE_TYPE.MIN:
471
471
  var _Math1;
472
- return (_Math1 = Math).min.apply(_Math1, _toConsumableArray(values));
472
+ return (_Math1 = Math).min.apply(_Math1, _to_consumable_array(values));
473
473
  case CALC_AGGREGATE_TYPE.SUM:
474
474
  return values.reduce(function(a, b) {
475
475
  return a + b;