@byteluck-fe/model-driven-shared 2.7.0-alpha.2 → 2.7.0-alpha.23

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.
package/dist/esm/log.js CHANGED
@@ -1,55 +1,44 @@
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 _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
  }
19
19
  }
20
- function isNativeReflectConstruct() {
21
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
22
- if (Reflect.construct.sham) return false;
23
- if (typeof Proxy === "function") return true;
24
- try {
25
- Date.prototype.toString.call(Reflect.construct(Date, [], function() {}));
26
- return true;
27
- } catch (e) {
28
- return false;
29
- }
30
- }
31
20
  function _construct(Parent, args, Class) {
32
- if (isNativeReflectConstruct()) {
21
+ if (_is_native_reflect_construct()) {
33
22
  _construct = Reflect.construct;
34
23
  } else {
35
- _construct = function _construct(Parent, args, Class) {
24
+ _construct = function construct(Parent, args, Class) {
36
25
  var a = [
37
26
  null
38
27
  ];
39
28
  a.push.apply(a, args);
40
29
  var Constructor = Function.bind.apply(Parent, a);
41
30
  var instance = new Constructor();
42
- if (Class) _setPrototypeOf(instance, Class.prototype);
31
+ if (Class) _set_prototype_of(instance, Class.prototype);
43
32
  return instance;
44
33
  };
45
34
  }
46
35
  return _construct.apply(null, arguments);
47
36
  }
48
- function _getPrototypeOf(o) {
49
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
37
+ function _get_prototype_of(o) {
38
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
50
39
  return o.__proto__ || Object.getPrototypeOf(o);
51
40
  };
52
- return _getPrototypeOf(o);
41
+ return _get_prototype_of(o);
53
42
  }
54
43
  function _inherits(subClass, superClass) {
55
44
  if (typeof superClass !== "function" && superClass !== null) {
@@ -62,49 +51,49 @@ function _inherits(subClass, superClass) {
62
51
  configurable: true
63
52
  }
64
53
  });
65
- if (superClass) _setPrototypeOf(subClass, superClass);
54
+ if (superClass) _set_prototype_of(subClass, superClass);
66
55
  }
67
- function _isNativeFunction(fn) {
56
+ function _is_native_function(fn) {
68
57
  return Function.toString.call(fn).indexOf("[native code]") !== -1;
69
58
  }
70
- function _iterableToArray(iter) {
59
+ function _iterable_to_array(iter) {
71
60
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
72
61
  }
73
- function _nonIterableSpread() {
62
+ function _non_iterable_spread() {
74
63
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
75
64
  }
76
- function _possibleConstructorReturn(self, call) {
77
- if (call && (_typeof(call) === "object" || typeof call === "function")) {
65
+ function _possible_constructor_return(self, call) {
66
+ if (call && (_type_of(call) === "object" || typeof call === "function")) {
78
67
  return call;
79
68
  }
80
- return _assertThisInitialized(self);
69
+ return _assert_this_initialized(self);
81
70
  }
82
- function _setPrototypeOf(o, p) {
83
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
71
+ function _set_prototype_of(o, p) {
72
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
84
73
  o.__proto__ = p;
85
74
  return o;
86
75
  };
87
- return _setPrototypeOf(o, p);
76
+ return _set_prototype_of(o, p);
88
77
  }
89
- function _toConsumableArray(arr) {
90
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
78
+ function _to_consumable_array(arr) {
79
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
91
80
  }
92
- var _typeof = function(obj) {
81
+ function _type_of(obj) {
93
82
  "@swc/helpers - typeof";
94
83
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
95
- };
96
- function _unsupportedIterableToArray(o, minLen) {
84
+ }
85
+ function _unsupported_iterable_to_array(o, minLen) {
97
86
  if (!o) return;
98
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
87
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
99
88
  var n = Object.prototype.toString.call(o).slice(8, -1);
100
89
  if (n === "Object" && o.constructor) n = o.constructor.name;
101
90
  if (n === "Map" || n === "Set") return Array.from(n);
102
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
91
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
103
92
  }
104
- function _wrapNativeSuper(Class) {
93
+ function _wrap_native_super(Class) {
105
94
  var _cache = typeof Map === "function" ? new Map() : undefined;
106
- _wrapNativeSuper = function _wrapNativeSuper(Class) {
107
- if (Class === null || !_isNativeFunction(Class)) return Class;
95
+ _wrap_native_super = function wrapNativeSuper(Class) {
96
+ if (Class === null || !_is_native_function(Class)) return Class;
108
97
  if (typeof Class !== "function") {
109
98
  throw new TypeError("Super expression must either be null or a function");
110
99
  }
@@ -113,7 +102,7 @@ function _wrapNativeSuper(Class) {
113
102
  _cache.set(Class, Wrapper);
114
103
  }
115
104
  function Wrapper() {
116
- return _construct(Class, arguments, _getPrototypeOf(this).constructor);
105
+ return _construct(Class, arguments, _get_prototype_of(this).constructor);
117
106
  }
118
107
  Wrapper.prototype = Object.create(Class.prototype, {
119
108
  constructor: {
@@ -123,11 +112,11 @@ function _wrapNativeSuper(Class) {
123
112
  configurable: true
124
113
  }
125
114
  });
126
- return _setPrototypeOf(Wrapper, Class);
115
+ return _set_prototype_of(Wrapper, Class);
127
116
  };
128
- return _wrapNativeSuper(Class);
117
+ return _wrap_native_super(Class);
129
118
  }
130
- function _isNativeReflectConstruct() {
119
+ function _is_native_reflect_construct() {
131
120
  if (typeof Reflect === "undefined" || !Reflect.construct) return false;
132
121
  if (Reflect.construct.sham) return false;
133
122
  if (typeof Proxy === "function") return true;
@@ -138,17 +127,17 @@ function _isNativeReflectConstruct() {
138
127
  return false;
139
128
  }
140
129
  }
141
- function _createSuper(Derived) {
142
- var hasNativeReflectConstruct = _isNativeReflectConstruct();
130
+ function _create_super(Derived) {
131
+ var hasNativeReflectConstruct = _is_native_reflect_construct();
143
132
  return function _createSuperInternal() {
144
- var Super = _getPrototypeOf(Derived), result;
133
+ var Super = _get_prototype_of(Derived), result;
145
134
  if (hasNativeReflectConstruct) {
146
- var NewTarget = _getPrototypeOf(this).constructor;
135
+ var NewTarget = _get_prototype_of(this).constructor;
147
136
  result = Reflect.construct(Super, arguments, NewTarget);
148
137
  } else {
149
138
  result = Super.apply(this, arguments);
150
139
  }
151
- return _possibleConstructorReturn(this, result);
140
+ return _possible_constructor_return(this, result);
152
141
  };
153
142
  }
154
143
  var logger = console;
@@ -160,7 +149,7 @@ export function warn() {
160
149
  var other = data.slice(1);
161
150
  (_logger = logger).warn.apply(_logger, [
162
151
  "\uD83E\uDDD0 Driven Warning:" + data[0]
163
- ].concat(_toConsumableArray(other)));
152
+ ].concat(_to_consumable_array(other)));
164
153
  }
165
154
  export function log() {
166
155
  for(var _len = arguments.length, data = new Array(_len), _key = 0; _key < _len; _key++){
@@ -170,7 +159,7 @@ export function log() {
170
159
  var other = data.slice(1);
171
160
  (_logger = logger).log.apply(_logger, [
172
161
  "\uD83D\uDE80 Driven Log:" + data[0]
173
- ].concat(_toConsumableArray(other)));
162
+ ].concat(_to_consumable_array(other)));
174
163
  }
175
164
  function joinMessage(message) {
176
165
  return message + " \uD83D\uDC1B\uD83D\uDC1B\uD83D\uDC1B";
@@ -179,9 +168,9 @@ function joinMessage(message) {
179
168
  var DrivenError = /*#__PURE__*/ function(Error1) {
180
169
  "use strict";
181
170
  _inherits(DrivenError, Error1);
182
- var _super = _createSuper(DrivenError);
171
+ var _super = _create_super(DrivenError);
183
172
  function DrivenError(message) {
184
- _classCallCheck(this, DrivenError);
173
+ _class_call_check(this, DrivenError);
185
174
  var _this;
186
175
  _this = _super.call(this, message);
187
176
  _this.name = "\uD83D\uDCA5 Driven Error";
@@ -189,14 +178,14 @@ var DrivenError = /*#__PURE__*/ function(Error1) {
189
178
  return _this;
190
179
  }
191
180
  return DrivenError;
192
- }(_wrapNativeSuper(Error));
181
+ }(_wrap_native_super(Error));
193
182
  // 驱动语法错误
194
183
  var DrivenReferenceError = /*#__PURE__*/ function(DrivenError) {
195
184
  "use strict";
196
185
  _inherits(DrivenReferenceError, DrivenError);
197
- var _super = _createSuper(DrivenReferenceError);
186
+ var _super = _create_super(DrivenReferenceError);
198
187
  function DrivenReferenceError(message) {
199
- _classCallCheck(this, DrivenReferenceError);
188
+ _class_call_check(this, DrivenReferenceError);
200
189
  var _this;
201
190
  _this = _super.call(this, message);
202
191
  _this.name = "\uD83D\uDEA8 Driven Reference Error";
@@ -3,10 +3,16 @@ export function loopFormSchema(schema, callback) {
3
3
  schema.map(function(item) {
4
4
  switch(item.controlType){
5
5
  case "layout":
6
- loopFormSchema(item === null || item === void 0 ? void 0 : item.children, callback);
6
+ var _item;
7
+ loopFormSchema((_item = item) === null || _item === void 0 ? void 0 : _item.children, callback);
8
+ break;
9
+ case "wrap":
10
+ var _item1;
11
+ loopFormSchema((_item1 = item) === null || _item1 === void 0 ? void 0 : _item1.children, callback);
7
12
  break;
8
13
  case "search":
9
- loopFormSchema(item === null || item === void 0 ? void 0 : item.children, callback);
14
+ var _item2;
15
+ loopFormSchema((_item2 = item) === null || _item2 === void 0 ? void 0 : _item2.children, callback);
10
16
  break;
11
17
  case "form":
12
18
  callback(item);
package/dist/esm/utils.js CHANGED
@@ -105,10 +105,14 @@ export function wait() {
105
105
  var new_items = [];
106
106
  if (Array.isArray(schemaItems)) {
107
107
  new_items = schemaItems.map(function(item) {
108
+ var _item, _item1;
108
109
  var new_item = item;
109
- if (Array.isArray(item === null || item === void 0 ? void 0 : item.children)) {
110
+ if (Array.isArray((_item = item) === null || _item === void 0 ? void 0 : _item.children)) {
110
111
  new_item.children = loop(item.children, convertion);
111
112
  }
113
+ if (Array.isArray((_item1 = item) === null || _item1 === void 0 ? void 0 : _item1.footers)) {
114
+ new_item.footers = loop(item.footers, convertion);
115
+ }
112
116
  return convertion(new_item);
113
117
  });
114
118
  }