@blueking/bkui-form 0.0.41 → 0.0.42-beta.10

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.
Files changed (33) hide show
  1. package/dist/adapter/vue2/common/FieldGroupWrap.d.ts +3 -3
  2. package/dist/adapter/vue2/field/ArrayField.d.ts +3 -3
  3. package/dist/adapter/vue2/field/BooleanField.d.ts +3 -3
  4. package/dist/adapter/vue2/field/CompositionField.d.ts +3 -3
  5. package/dist/adapter/vue2/field/NumberField.d.ts +3 -3
  6. package/dist/adapter/vue2/field/ObjectField.d.ts +1 -1
  7. package/dist/adapter/vue2/field/SchemaField.d.ts +1 -1
  8. package/dist/adapter/vue2/field/StringField.d.ts +3 -3
  9. package/dist/adapter/vue2/widget/ArrayWidget.d.ts +1 -1
  10. package/dist/adapter/vue2/widget/ButtonWidget.d.ts +1 -1
  11. package/dist/adapter/vue2/widget/CheckboxWidget.d.ts +1 -1
  12. package/dist/adapter/vue2/widget/CollapseGroupWidget.d.ts +2 -1
  13. package/dist/adapter/vue2/widget/ColorPickerWidget.d.ts +1 -1
  14. package/dist/adapter/vue2/widget/InputWidget.d.ts +1 -1
  15. package/dist/adapter/vue2/widget/KeyValueArrayWidget.d.ts +3 -3
  16. package/dist/adapter/vue2/widget/RadioWidget.d.ts +1 -1
  17. package/dist/adapter/vue2/widget/SelectWidget.d.ts +1 -1
  18. package/dist/adapter/vue2/widget/SwitchWidget.d.ts +1 -1
  19. package/dist/adapter/vue2/widget/TabGroupWidget.d.ts +1 -1
  20. package/dist/adapter/vue2/widget/TableWidget.d.ts +5 -4
  21. package/dist/adapter/vue2/widget/Widget.d.ts +9 -1
  22. package/dist/bkui-form-es-min.js +6 -6
  23. package/dist/bkui-form-es.js +731 -715
  24. package/dist/bkui-form-es.js.map +1 -1
  25. package/dist/bkui-form-umd-min.js +6 -6
  26. package/dist/bkui-form-umd.js +731 -715
  27. package/dist/bkui-form-umd.js.map +1 -1
  28. package/dist/bkui-form.css +20 -2
  29. package/dist/controller/form-vue2.d.ts +4 -3
  30. package/dist/controller/props.d.ts +4 -0
  31. package/dist/types/bkui-form.d.ts +7 -5
  32. package/dist/util/index.d.ts +5 -1
  33. package/package.json +6 -6
@@ -8,572 +8,537 @@
8
8
 
9
9
  var Vue__default = /*#__PURE__*/_interopDefaultLegacy(Vue);
10
10
 
11
- function _iterableToArrayLimit(arr, i) {
12
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
13
- if (null != _i) {
14
- var _s,
15
- _e,
16
- _x,
17
- _r,
18
- _arr = [],
19
- _n = !0,
20
- _d = !1;
11
+ function _arrayLikeToArray(r, a) {
12
+ (null == a || a > r.length) && (a = r.length);
13
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
14
+ return n;
15
+ }
16
+ function _arrayWithHoles(r) {
17
+ if (Array.isArray(r)) return r;
18
+ }
19
+ function _arrayWithoutHoles(r) {
20
+ if (Array.isArray(r)) return _arrayLikeToArray(r);
21
+ }
22
+ function asyncGeneratorStep(n, t, e, r, o, a, c) {
23
+ try {
24
+ var i = n[a](c),
25
+ u = i.value;
26
+ } catch (n) {
27
+ return void e(n);
28
+ }
29
+ i.done ? t(u) : Promise.resolve(u).then(r, o);
30
+ }
31
+ function _asyncToGenerator(n) {
32
+ return function () {
33
+ var t = this,
34
+ e = arguments;
35
+ return new Promise(function (r, o) {
36
+ var a = n.apply(t, e);
37
+ function _next(n) {
38
+ asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
39
+ }
40
+ function _throw(n) {
41
+ asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
42
+ }
43
+ _next(void 0);
44
+ });
45
+ };
46
+ }
47
+ function _classCallCheck(a, n) {
48
+ if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
49
+ }
50
+ function _defineProperties(e, r) {
51
+ for (var t = 0; t < r.length; t++) {
52
+ var o = r[t];
53
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
54
+ }
55
+ }
56
+ function _createClass(e, r, t) {
57
+ return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
58
+ writable: !1
59
+ }), e;
60
+ }
61
+ function _createForOfIteratorHelper(r, e) {
62
+ var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
63
+ if (!t) {
64
+ if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
65
+ t && (r = t);
66
+ var n = 0,
67
+ F = function () {};
68
+ return {
69
+ s: F,
70
+ n: function () {
71
+ return n >= r.length ? {
72
+ done: !0
73
+ } : {
74
+ done: !1,
75
+ value: r[n++]
76
+ };
77
+ },
78
+ e: function (r) {
79
+ throw r;
80
+ },
81
+ f: F
82
+ };
83
+ }
84
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
85
+ }
86
+ var o,
87
+ a = !0,
88
+ u = !1;
89
+ return {
90
+ s: function () {
91
+ t = t.call(r);
92
+ },
93
+ n: function () {
94
+ var r = t.next();
95
+ return a = r.done, r;
96
+ },
97
+ e: function (r) {
98
+ u = !0, o = r;
99
+ },
100
+ f: function () {
101
+ try {
102
+ a || null == t.return || t.return();
103
+ } finally {
104
+ if (u) throw o;
105
+ }
106
+ }
107
+ };
108
+ }
109
+ function _defineProperty(e, r, t) {
110
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
111
+ value: t,
112
+ enumerable: !0,
113
+ configurable: !0,
114
+ writable: !0
115
+ }) : e[r] = t, e;
116
+ }
117
+ function _extends$1() {
118
+ return _extends$1 = Object.assign ? Object.assign.bind() : function (n) {
119
+ for (var e = 1; e < arguments.length; e++) {
120
+ var t = arguments[e];
121
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
122
+ }
123
+ return n;
124
+ }, _extends$1.apply(null, arguments);
125
+ }
126
+ function _iterableToArray(r) {
127
+ if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
128
+ }
129
+ function _iterableToArrayLimit(r, l) {
130
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
131
+ if (null != t) {
132
+ var e,
133
+ n,
134
+ i,
135
+ u,
136
+ a = [],
137
+ f = !0,
138
+ o = !1;
21
139
  try {
22
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
23
- if (Object(_i) !== _i) return;
24
- _n = !1;
25
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
26
- } catch (err) {
27
- _d = !0, _e = err;
140
+ if (i = (t = t.call(r)).next, 0 === l) {
141
+ if (Object(t) !== t) return;
142
+ f = !1;
143
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
144
+ } catch (r) {
145
+ o = !0, n = r;
28
146
  } finally {
29
147
  try {
30
- if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
148
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
31
149
  } finally {
32
- if (_d) throw _e;
150
+ if (o) throw n;
33
151
  }
34
152
  }
35
- return _arr;
153
+ return a;
36
154
  }
37
155
  }
38
- function ownKeys(object, enumerableOnly) {
39
- var keys = Object.keys(object);
156
+ function _nonIterableRest() {
157
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
158
+ }
159
+ function _nonIterableSpread() {
160
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
161
+ }
162
+ function _objectDestructuringEmpty(t) {
163
+ if (null == t) throw new TypeError("Cannot destructure " + t);
164
+ }
165
+ function ownKeys(e, r) {
166
+ var t = Object.keys(e);
40
167
  if (Object.getOwnPropertySymbols) {
41
- var symbols = Object.getOwnPropertySymbols(object);
42
- enumerableOnly && (symbols = symbols.filter(function (sym) {
43
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
44
- })), keys.push.apply(keys, symbols);
168
+ var o = Object.getOwnPropertySymbols(e);
169
+ r && (o = o.filter(function (r) {
170
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
171
+ })), t.push.apply(t, o);
45
172
  }
46
- return keys;
47
- }
48
- function _objectSpread2(target) {
49
- for (var i = 1; i < arguments.length; i++) {
50
- var source = null != arguments[i] ? arguments[i] : {};
51
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
52
- _defineProperty(target, key, source[key]);
53
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
54
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
173
+ return t;
174
+ }
175
+ function _objectSpread2(e) {
176
+ for (var r = 1; r < arguments.length; r++) {
177
+ var t = null != arguments[r] ? arguments[r] : {};
178
+ r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
179
+ _defineProperty(e, r, t[r]);
180
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
181
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
55
182
  });
56
183
  }
57
- return target;
184
+ return e;
185
+ }
186
+ function _objectWithoutProperties(e, t) {
187
+ if (null == e) return {};
188
+ var o,
189
+ r,
190
+ i = _objectWithoutPropertiesLoose(e, t);
191
+ if (Object.getOwnPropertySymbols) {
192
+ var n = Object.getOwnPropertySymbols(e);
193
+ for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
194
+ }
195
+ return i;
196
+ }
197
+ function _objectWithoutPropertiesLoose(r, e) {
198
+ if (null == r) return {};
199
+ var t = {};
200
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
201
+ if (e.indexOf(n) >= 0) continue;
202
+ t[n] = r[n];
203
+ }
204
+ return t;
58
205
  }
59
206
  function _regeneratorRuntime() {
60
207
  _regeneratorRuntime = function () {
61
- return exports;
208
+ return e;
62
209
  };
63
- var exports = {},
64
- Op = Object.prototype,
65
- hasOwn = Op.hasOwnProperty,
66
- defineProperty = Object.defineProperty || function (obj, key, desc) {
67
- obj[key] = desc.value;
210
+ var t,
211
+ e = {},
212
+ r = Object.prototype,
213
+ n = r.hasOwnProperty,
214
+ o = Object.defineProperty || function (t, e, r) {
215
+ t[e] = r.value;
68
216
  },
69
- $Symbol = "function" == typeof Symbol ? Symbol : {},
70
- iteratorSymbol = $Symbol.iterator || "@@iterator",
71
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
72
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
73
- function define(obj, key, value) {
74
- return Object.defineProperty(obj, key, {
75
- value: value,
217
+ i = "function" == typeof Symbol ? Symbol : {},
218
+ a = i.iterator || "@@iterator",
219
+ c = i.asyncIterator || "@@asyncIterator",
220
+ u = i.toStringTag || "@@toStringTag";
221
+ function define(t, e, r) {
222
+ return Object.defineProperty(t, e, {
223
+ value: r,
76
224
  enumerable: !0,
77
225
  configurable: !0,
78
226
  writable: !0
79
- }), obj[key];
227
+ }), t[e];
80
228
  }
81
229
  try {
82
230
  define({}, "");
83
- } catch (err) {
84
- define = function (obj, key, value) {
85
- return obj[key] = value;
231
+ } catch (t) {
232
+ define = function (t, e, r) {
233
+ return t[e] = r;
86
234
  };
87
235
  }
88
- function wrap(innerFn, outerFn, self, tryLocsList) {
89
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
90
- generator = Object.create(protoGenerator.prototype),
91
- context = new Context(tryLocsList || []);
92
- return defineProperty(generator, "_invoke", {
93
- value: makeInvokeMethod(innerFn, self, context)
94
- }), generator;
236
+ function wrap(t, e, r, n) {
237
+ var i = e && e.prototype instanceof Generator ? e : Generator,
238
+ a = Object.create(i.prototype),
239
+ c = new Context(n || []);
240
+ return o(a, "_invoke", {
241
+ value: makeInvokeMethod(t, r, c)
242
+ }), a;
95
243
  }
96
- function tryCatch(fn, obj, arg) {
244
+ function tryCatch(t, e, r) {
97
245
  try {
98
246
  return {
99
247
  type: "normal",
100
- arg: fn.call(obj, arg)
248
+ arg: t.call(e, r)
101
249
  };
102
- } catch (err) {
250
+ } catch (t) {
103
251
  return {
104
252
  type: "throw",
105
- arg: err
253
+ arg: t
106
254
  };
107
255
  }
108
256
  }
109
- exports.wrap = wrap;
110
- var ContinueSentinel = {};
257
+ e.wrap = wrap;
258
+ var h = "suspendedStart",
259
+ l = "suspendedYield",
260
+ f = "executing",
261
+ s = "completed",
262
+ y = {};
111
263
  function Generator() {}
112
264
  function GeneratorFunction() {}
113
265
  function GeneratorFunctionPrototype() {}
114
- var IteratorPrototype = {};
115
- define(IteratorPrototype, iteratorSymbol, function () {
266
+ var p = {};
267
+ define(p, a, function () {
116
268
  return this;
117
269
  });
118
- var getProto = Object.getPrototypeOf,
119
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
120
- NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
121
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
122
- function defineIteratorMethods(prototype) {
123
- ["next", "throw", "return"].forEach(function (method) {
124
- define(prototype, method, function (arg) {
125
- return this._invoke(method, arg);
270
+ var d = Object.getPrototypeOf,
271
+ v = d && d(d(values([])));
272
+ v && v !== r && n.call(v, a) && (p = v);
273
+ var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
274
+ function defineIteratorMethods(t) {
275
+ ["next", "throw", "return"].forEach(function (e) {
276
+ define(t, e, function (t) {
277
+ return this._invoke(e, t);
126
278
  });
127
279
  });
128
280
  }
129
- function AsyncIterator(generator, PromiseImpl) {
130
- function invoke(method, arg, resolve, reject) {
131
- var record = tryCatch(generator[method], generator, arg);
132
- if ("throw" !== record.type) {
133
- var result = record.arg,
134
- value = result.value;
135
- return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
136
- invoke("next", value, resolve, reject);
137
- }, function (err) {
138
- invoke("throw", err, resolve, reject);
139
- }) : PromiseImpl.resolve(value).then(function (unwrapped) {
140
- result.value = unwrapped, resolve(result);
141
- }, function (error) {
142
- return invoke("throw", error, resolve, reject);
281
+ function AsyncIterator(t, e) {
282
+ function invoke(r, o, i, a) {
283
+ var c = tryCatch(t[r], t, o);
284
+ if ("throw" !== c.type) {
285
+ var u = c.arg,
286
+ h = u.value;
287
+ return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
288
+ invoke("next", t, i, a);
289
+ }, function (t) {
290
+ invoke("throw", t, i, a);
291
+ }) : e.resolve(h).then(function (t) {
292
+ u.value = t, i(u);
293
+ }, function (t) {
294
+ return invoke("throw", t, i, a);
143
295
  });
144
296
  }
145
- reject(record.arg);
297
+ a(c.arg);
146
298
  }
147
- var previousPromise;
148
- defineProperty(this, "_invoke", {
149
- value: function (method, arg) {
299
+ var r;
300
+ o(this, "_invoke", {
301
+ value: function (t, n) {
150
302
  function callInvokeWithMethodAndArg() {
151
- return new PromiseImpl(function (resolve, reject) {
152
- invoke(method, arg, resolve, reject);
303
+ return new e(function (e, r) {
304
+ invoke(t, n, e, r);
153
305
  });
154
306
  }
155
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
307
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
156
308
  }
157
309
  });
158
310
  }
159
- function makeInvokeMethod(innerFn, self, context) {
160
- var state = "suspendedStart";
161
- return function (method, arg) {
162
- if ("executing" === state) throw new Error("Generator is already running");
163
- if ("completed" === state) {
164
- if ("throw" === method) throw arg;
165
- return doneResult();
311
+ function makeInvokeMethod(e, r, n) {
312
+ var o = h;
313
+ return function (i, a) {
314
+ if (o === f) throw Error("Generator is already running");
315
+ if (o === s) {
316
+ if ("throw" === i) throw a;
317
+ return {
318
+ value: t,
319
+ done: !0
320
+ };
166
321
  }
167
- for (context.method = method, context.arg = arg;;) {
168
- var delegate = context.delegate;
169
- if (delegate) {
170
- var delegateResult = maybeInvokeDelegate(delegate, context);
171
- if (delegateResult) {
172
- if (delegateResult === ContinueSentinel) continue;
173
- return delegateResult;
322
+ for (n.method = i, n.arg = a;;) {
323
+ var c = n.delegate;
324
+ if (c) {
325
+ var u = maybeInvokeDelegate(c, n);
326
+ if (u) {
327
+ if (u === y) continue;
328
+ return u;
174
329
  }
175
330
  }
176
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
177
- if ("suspendedStart" === state) throw state = "completed", context.arg;
178
- context.dispatchException(context.arg);
179
- } else "return" === context.method && context.abrupt("return", context.arg);
180
- state = "executing";
181
- var record = tryCatch(innerFn, self, context);
182
- if ("normal" === record.type) {
183
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
331
+ if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
332
+ if (o === h) throw o = s, n.arg;
333
+ n.dispatchException(n.arg);
334
+ } else "return" === n.method && n.abrupt("return", n.arg);
335
+ o = f;
336
+ var p = tryCatch(e, r, n);
337
+ if ("normal" === p.type) {
338
+ if (o = n.done ? s : l, p.arg === y) continue;
184
339
  return {
185
- value: record.arg,
186
- done: context.done
340
+ value: p.arg,
341
+ done: n.done
187
342
  };
188
343
  }
189
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
344
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
190
345
  }
191
346
  };
192
347
  }
193
- function maybeInvokeDelegate(delegate, context) {
194
- var methodName = context.method,
195
- method = delegate.iterator[methodName];
196
- if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
197
- var record = tryCatch(method, delegate.iterator, context.arg);
198
- if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
199
- var info = record.arg;
200
- return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
348
+ function maybeInvokeDelegate(e, r) {
349
+ var n = r.method,
350
+ o = e.iterator[n];
351
+ if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
352
+ var i = tryCatch(o, e.iterator, r.arg);
353
+ if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
354
+ var a = i.arg;
355
+ return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
201
356
  }
202
- function pushTryEntry(locs) {
203
- var entry = {
204
- tryLoc: locs[0]
357
+ function pushTryEntry(t) {
358
+ var e = {
359
+ tryLoc: t[0]
205
360
  };
206
- 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
361
+ 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
207
362
  }
208
- function resetTryEntry(entry) {
209
- var record = entry.completion || {};
210
- record.type = "normal", delete record.arg, entry.completion = record;
363
+ function resetTryEntry(t) {
364
+ var e = t.completion || {};
365
+ e.type = "normal", delete e.arg, t.completion = e;
211
366
  }
212
- function Context(tryLocsList) {
367
+ function Context(t) {
213
368
  this.tryEntries = [{
214
369
  tryLoc: "root"
215
- }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
370
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
216
371
  }
217
- function values(iterable) {
218
- if (iterable) {
219
- var iteratorMethod = iterable[iteratorSymbol];
220
- if (iteratorMethod) return iteratorMethod.call(iterable);
221
- if ("function" == typeof iterable.next) return iterable;
222
- if (!isNaN(iterable.length)) {
223
- var i = -1,
224
- next = function next() {
225
- for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
226
- return next.value = undefined, next.done = !0, next;
372
+ function values(e) {
373
+ if (e || "" === e) {
374
+ var r = e[a];
375
+ if (r) return r.call(e);
376
+ if ("function" == typeof e.next) return e;
377
+ if (!isNaN(e.length)) {
378
+ var o = -1,
379
+ i = function next() {
380
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
381
+ return next.value = t, next.done = !0, next;
227
382
  };
228
- return next.next = next;
383
+ return i.next = i;
229
384
  }
230
385
  }
231
- return {
232
- next: doneResult
233
- };
234
- }
235
- function doneResult() {
236
- return {
237
- value: undefined,
238
- done: !0
239
- };
386
+ throw new TypeError(typeof e + " is not iterable");
240
387
  }
241
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
388
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
242
389
  value: GeneratorFunctionPrototype,
243
390
  configurable: !0
244
- }), defineProperty(GeneratorFunctionPrototype, "constructor", {
391
+ }), o(GeneratorFunctionPrototype, "constructor", {
245
392
  value: GeneratorFunction,
246
393
  configurable: !0
247
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
248
- var ctor = "function" == typeof genFun && genFun.constructor;
249
- return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
250
- }, exports.mark = function (genFun) {
251
- return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
252
- }, exports.awrap = function (arg) {
394
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
395
+ var e = "function" == typeof t && t.constructor;
396
+ return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
397
+ }, e.mark = function (t) {
398
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
399
+ }, e.awrap = function (t) {
253
400
  return {
254
- __await: arg
401
+ __await: t
255
402
  };
256
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
403
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
257
404
  return this;
258
- }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
259
- void 0 === PromiseImpl && (PromiseImpl = Promise);
260
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
261
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
262
- return result.done ? result.value : iter.next();
405
+ }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
406
+ void 0 === i && (i = Promise);
407
+ var a = new AsyncIterator(wrap(t, r, n, o), i);
408
+ return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
409
+ return t.done ? t.value : a.next();
263
410
  });
264
- }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
411
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
265
412
  return this;
266
- }), define(Gp, "toString", function () {
413
+ }), define(g, "toString", function () {
267
414
  return "[object Generator]";
268
- }), exports.keys = function (val) {
269
- var object = Object(val),
270
- keys = [];
271
- for (var key in object) keys.push(key);
272
- return keys.reverse(), function next() {
273
- for (; keys.length;) {
274
- var key = keys.pop();
275
- if (key in object) return next.value = key, next.done = !1, next;
415
+ }), e.keys = function (t) {
416
+ var e = Object(t),
417
+ r = [];
418
+ for (var n in e) r.push(n);
419
+ return r.reverse(), function next() {
420
+ for (; r.length;) {
421
+ var t = r.pop();
422
+ if (t in e) return next.value = t, next.done = !1, next;
276
423
  }
277
424
  return next.done = !0, next;
278
425
  };
279
- }, exports.values = values, Context.prototype = {
426
+ }, e.values = values, Context.prototype = {
280
427
  constructor: Context,
281
- reset: function (skipTempReset) {
282
- if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
428
+ reset: function (e) {
429
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
283
430
  },
284
431
  stop: function () {
285
432
  this.done = !0;
286
- var rootRecord = this.tryEntries[0].completion;
287
- if ("throw" === rootRecord.type) throw rootRecord.arg;
433
+ var t = this.tryEntries[0].completion;
434
+ if ("throw" === t.type) throw t.arg;
288
435
  return this.rval;
289
436
  },
290
- dispatchException: function (exception) {
291
- if (this.done) throw exception;
292
- var context = this;
293
- function handle(loc, caught) {
294
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
437
+ dispatchException: function (e) {
438
+ if (this.done) throw e;
439
+ var r = this;
440
+ function handle(n, o) {
441
+ return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
295
442
  }
296
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
297
- var entry = this.tryEntries[i],
298
- record = entry.completion;
299
- if ("root" === entry.tryLoc) return handle("end");
300
- if (entry.tryLoc <= this.prev) {
301
- var hasCatch = hasOwn.call(entry, "catchLoc"),
302
- hasFinally = hasOwn.call(entry, "finallyLoc");
303
- if (hasCatch && hasFinally) {
304
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
305
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
306
- } else if (hasCatch) {
307
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
443
+ for (var o = this.tryEntries.length - 1; o >= 0; --o) {
444
+ var i = this.tryEntries[o],
445
+ a = i.completion;
446
+ if ("root" === i.tryLoc) return handle("end");
447
+ if (i.tryLoc <= this.prev) {
448
+ var c = n.call(i, "catchLoc"),
449
+ u = n.call(i, "finallyLoc");
450
+ if (c && u) {
451
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
452
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
453
+ } else if (c) {
454
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
308
455
  } else {
309
- if (!hasFinally) throw new Error("try statement without catch or finally");
310
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
456
+ if (!u) throw Error("try statement without catch or finally");
457
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
311
458
  }
312
459
  }
313
460
  }
314
461
  },
315
- abrupt: function (type, arg) {
316
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
317
- var entry = this.tryEntries[i];
318
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
319
- var finallyEntry = entry;
462
+ abrupt: function (t, e) {
463
+ for (var r = this.tryEntries.length - 1; r >= 0; --r) {
464
+ var o = this.tryEntries[r];
465
+ if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
466
+ var i = o;
320
467
  break;
321
468
  }
322
469
  }
323
- finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
324
- var record = finallyEntry ? finallyEntry.completion : {};
325
- return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
470
+ i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
471
+ var a = i ? i.completion : {};
472
+ return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
326
473
  },
327
- complete: function (record, afterLoc) {
328
- if ("throw" === record.type) throw record.arg;
329
- return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
474
+ complete: function (t, e) {
475
+ if ("throw" === t.type) throw t.arg;
476
+ return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
330
477
  },
331
- finish: function (finallyLoc) {
332
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
333
- var entry = this.tryEntries[i];
334
- if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
478
+ finish: function (t) {
479
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
480
+ var r = this.tryEntries[e];
481
+ if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
335
482
  }
336
483
  },
337
- catch: function (tryLoc) {
338
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
339
- var entry = this.tryEntries[i];
340
- if (entry.tryLoc === tryLoc) {
341
- var record = entry.completion;
342
- if ("throw" === record.type) {
343
- var thrown = record.arg;
344
- resetTryEntry(entry);
484
+ catch: function (t) {
485
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
486
+ var r = this.tryEntries[e];
487
+ if (r.tryLoc === t) {
488
+ var n = r.completion;
489
+ if ("throw" === n.type) {
490
+ var o = n.arg;
491
+ resetTryEntry(r);
345
492
  }
346
- return thrown;
493
+ return o;
347
494
  }
348
495
  }
349
- throw new Error("illegal catch attempt");
496
+ throw Error("illegal catch attempt");
350
497
  },
351
- delegateYield: function (iterable, resultName, nextLoc) {
498
+ delegateYield: function (e, r, n) {
352
499
  return this.delegate = {
353
- iterator: values(iterable),
354
- resultName: resultName,
355
- nextLoc: nextLoc
356
- }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
500
+ iterator: values(e),
501
+ resultName: r,
502
+ nextLoc: n
503
+ }, "next" === this.method && (this.arg = t), y;
357
504
  }
358
- }, exports;
505
+ }, e;
359
506
  }
360
- function _typeof(obj) {
361
- "@babel/helpers - typeof";
362
-
363
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
364
- return typeof obj;
365
- } : function (obj) {
366
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
367
- }, _typeof(obj);
368
- }
369
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
370
- try {
371
- var info = gen[key](arg);
372
- var value = info.value;
373
- } catch (error) {
374
- reject(error);
375
- return;
376
- }
377
- if (info.done) {
378
- resolve(value);
379
- } else {
380
- Promise.resolve(value).then(_next, _throw);
381
- }
382
- }
383
- function _asyncToGenerator(fn) {
384
- return function () {
385
- var self = this,
386
- args = arguments;
387
- return new Promise(function (resolve, reject) {
388
- var gen = fn.apply(self, args);
389
- function _next(value) {
390
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
391
- }
392
- function _throw(err) {
393
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
394
- }
395
- _next(undefined);
396
- });
397
- };
398
- }
399
- function _classCallCheck(instance, Constructor) {
400
- if (!(instance instanceof Constructor)) {
401
- throw new TypeError("Cannot call a class as a function");
402
- }
403
- }
404
- function _defineProperties(target, props) {
405
- for (var i = 0; i < props.length; i++) {
406
- var descriptor = props[i];
407
- descriptor.enumerable = descriptor.enumerable || false;
408
- descriptor.configurable = true;
409
- if ("value" in descriptor) descriptor.writable = true;
410
- Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
411
- }
412
- }
413
- function _createClass(Constructor, protoProps, staticProps) {
414
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
415
- if (staticProps) _defineProperties(Constructor, staticProps);
416
- Object.defineProperty(Constructor, "prototype", {
417
- writable: false
418
- });
419
- return Constructor;
420
- }
421
- function _defineProperty(obj, key, value) {
422
- key = _toPropertyKey(key);
423
- if (key in obj) {
424
- Object.defineProperty(obj, key, {
425
- value: value,
426
- enumerable: true,
427
- configurable: true,
428
- writable: true
429
- });
430
- } else {
431
- obj[key] = value;
432
- }
433
- return obj;
507
+ function _slicedToArray(r, e) {
508
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
434
509
  }
435
- function _extends$1() {
436
- _extends$1 = Object.assign ? Object.assign.bind() : function (target) {
437
- for (var i = 1; i < arguments.length; i++) {
438
- var source = arguments[i];
439
- for (var key in source) {
440
- if (Object.prototype.hasOwnProperty.call(source, key)) {
441
- target[key] = source[key];
442
- }
443
- }
444
- }
445
- return target;
446
- };
447
- return _extends$1.apply(this, arguments);
448
- }
449
- function _objectDestructuringEmpty(obj) {
450
- if (obj == null) throw new TypeError("Cannot destructure " + obj);
451
- }
452
- function _objectWithoutPropertiesLoose(source, excluded) {
453
- if (source == null) return {};
454
- var target = {};
455
- var sourceKeys = Object.keys(source);
456
- var key, i;
457
- for (i = 0; i < sourceKeys.length; i++) {
458
- key = sourceKeys[i];
459
- if (excluded.indexOf(key) >= 0) continue;
460
- target[key] = source[key];
461
- }
462
- return target;
510
+ function _toConsumableArray(r) {
511
+ return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
463
512
  }
464
- function _objectWithoutProperties(source, excluded) {
465
- if (source == null) return {};
466
- var target = _objectWithoutPropertiesLoose(source, excluded);
467
- var key, i;
468
- if (Object.getOwnPropertySymbols) {
469
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
470
- for (i = 0; i < sourceSymbolKeys.length; i++) {
471
- key = sourceSymbolKeys[i];
472
- if (excluded.indexOf(key) >= 0) continue;
473
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
474
- target[key] = source[key];
475
- }
513
+ function _toPrimitive(t, r) {
514
+ if ("object" != typeof t || !t) return t;
515
+ var e = t[Symbol.toPrimitive];
516
+ if (void 0 !== e) {
517
+ var i = e.call(t, r || "default");
518
+ if ("object" != typeof i) return i;
519
+ throw new TypeError("@@toPrimitive must return a primitive value.");
476
520
  }
477
- return target;
478
- }
479
- function _slicedToArray(arr, i) {
480
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
481
- }
482
- function _toConsumableArray(arr) {
483
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
484
- }
485
- function _arrayWithoutHoles(arr) {
486
- if (Array.isArray(arr)) return _arrayLikeToArray(arr);
487
- }
488
- function _arrayWithHoles(arr) {
489
- if (Array.isArray(arr)) return arr;
521
+ return ("string" === r ? String : Number)(t);
490
522
  }
491
- function _iterableToArray(iter) {
492
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
523
+ function _toPropertyKey(t) {
524
+ var i = _toPrimitive(t, "string");
525
+ return "symbol" == typeof i ? i : i + "";
493
526
  }
494
- function _unsupportedIterableToArray(o, minLen) {
495
- if (!o) return;
496
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
497
- var n = Object.prototype.toString.call(o).slice(8, -1);
498
- if (n === "Object" && o.constructor) n = o.constructor.name;
499
- if (n === "Map" || n === "Set") return Array.from(o);
500
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
501
- }
502
- function _arrayLikeToArray(arr, len) {
503
- if (len == null || len > arr.length) len = arr.length;
504
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
505
- return arr2;
506
- }
507
- function _nonIterableSpread() {
508
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
509
- }
510
- function _nonIterableRest() {
511
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
512
- }
513
- function _createForOfIteratorHelper(o, allowArrayLike) {
514
- var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
515
- if (!it) {
516
- if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
517
- if (it) o = it;
518
- var i = 0;
519
- var F = function () {};
520
- return {
521
- s: F,
522
- n: function () {
523
- if (i >= o.length) return {
524
- done: true
525
- };
526
- return {
527
- done: false,
528
- value: o[i++]
529
- };
530
- },
531
- e: function (e) {
532
- throw e;
533
- },
534
- f: F
535
- };
536
- }
537
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
538
- }
539
- var normalCompletion = true,
540
- didErr = false,
541
- err;
542
- return {
543
- s: function () {
544
- it = it.call(o);
545
- },
546
- n: function () {
547
- var step = it.next();
548
- normalCompletion = step.done;
549
- return step;
550
- },
551
- e: function (e) {
552
- didErr = true;
553
- err = e;
554
- },
555
- f: function () {
556
- try {
557
- if (!normalCompletion && it.return != null) it.return();
558
- } finally {
559
- if (didErr) throw err;
560
- }
561
- }
562
- };
563
- }
564
- function _toPrimitive(input, hint) {
565
- if (typeof input !== "object" || input === null) return input;
566
- var prim = input[Symbol.toPrimitive];
567
- if (prim !== undefined) {
568
- var res = prim.call(input, hint || "default");
569
- if (typeof res !== "object") return res;
570
- throw new TypeError("@@toPrimitive must return a primitive value.");
527
+ function _typeof(o) {
528
+ "@babel/helpers - typeof";
529
+
530
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
531
+ return typeof o;
532
+ } : function (o) {
533
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
534
+ }, _typeof(o);
535
+ }
536
+ function _unsupportedIterableToArray(r, a) {
537
+ if (r) {
538
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
539
+ var t = {}.toString.call(r).slice(8, -1);
540
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
571
541
  }
572
- return (hint === "string" ? String : Number)(input);
573
- }
574
- function _toPropertyKey(arg) {
575
- var key = _toPrimitive(arg, "string");
576
- return typeof key === "symbol" ? key : String(key);
577
542
  }
578
543
 
579
544
  // eslint-disable-next-line no-new-func
@@ -652,7 +617,6 @@
652
617
  integer: undefined,
653
618
  number: undefined // 默认初始化值(number类型0值会有特殊含义)
654
619
  };
655
-
656
620
  switch (type) {
657
621
  case 'any':
658
622
  return undefined;
@@ -678,16 +642,25 @@
678
642
  }
679
643
  if (!sources.length) return target;
680
644
  var source = sources.shift();
681
- if (isObj(target) && isObj(source)) {
682
- for (var key in source) {
683
- if (isObj(source[key])) {
684
- if (!target[key]) Object.assign(target, _defineProperty({}, key, {}));
685
- mergeDeep(target[key], source[key]);
686
- } else {
687
- Object.assign(target, _defineProperty({}, key, source[key]));
645
+ if (source === undefined) {
646
+ return target;
647
+ }
648
+ Object.entries(source).forEach(function (_ref) {
649
+ var _ref2 = _slicedToArray(_ref, 2),
650
+ key = _ref2[0],
651
+ value = _ref2[1];
652
+ var targetValue = target[key];
653
+ if (isObj(value)) {
654
+ if (!(key in target)) {
655
+ target[key] = {};
656
+ } else if (!isObj(targetValue)) {
657
+ target[key] = {};
688
658
  }
659
+ mergeDeep(target[key], value);
660
+ } else {
661
+ target[key] = value;
689
662
  }
690
- }
663
+ });
691
664
  return mergeDeep.apply(void 0, [target].concat(sources));
692
665
  }
693
666
  function isArguments(object) {
@@ -830,7 +803,7 @@
830
803
  // 每种Schema type对于的处理器
831
804
  this.fields = new Map();
832
805
  }
833
- _createClass(Registry, [{
806
+ return _createClass(Registry, [{
834
807
  key: "addComponentsMap",
835
808
  value: function addComponentsMap() {
836
809
  var coms = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -880,14 +853,12 @@
880
853
  key = _ref2[0],
881
854
  value = _ref2[1];
882
855
  if (_this[props].has(key)) {
883
- console.warn('repeat key', key);
884
856
  return;
885
857
  }
886
858
  _this[props].set(key, value);
887
859
  });
888
860
  }
889
861
  }]);
890
- return Registry;
891
862
  }();
892
863
  // 全局命名空间
893
864
  Registry.namespace = 'bk';
@@ -902,7 +873,7 @@
902
873
  _classCallCheck(this, Schema);
903
874
  Schema.rootSchema = rootSchema;
904
875
  }
905
- _createClass(Schema, null, [{
876
+ return _createClass(Schema, null, [{
906
877
  key: "resolveRef",
907
878
  value: function resolveRef() {}
908
879
  }, {
@@ -1169,7 +1140,6 @@
1169
1140
  }
1170
1141
  }
1171
1142
  }]);
1172
- return Schema;
1173
1143
  }();
1174
1144
  Schema.rootSchema = void 0;
1175
1145
 
@@ -1188,7 +1158,7 @@
1188
1158
  this.layout = this.parseLayout(layout);
1189
1159
  }
1190
1160
  }
1191
- _createClass(Layout, [{
1161
+ return _createClass(Layout, [{
1192
1162
  key: "transformValueToPixel",
1193
1163
  value: function transformValueToPixel(value) {
1194
1164
  if (typeof value === 'number') {
@@ -1319,7 +1289,6 @@
1319
1289
  return layoutConfig;
1320
1290
  }
1321
1291
  }]);
1322
- return Layout;
1323
1292
  }();
1324
1293
 
1325
1294
  function createProxy(schema, context) {
@@ -1337,7 +1306,7 @@
1337
1306
  function Path() {
1338
1307
  _classCallCheck(this, Path);
1339
1308
  }
1340
- _createClass(Path, null, [{
1309
+ return _createClass(Path, null, [{
1341
1310
  key: "getCurPath",
1342
1311
  value: function getCurPath(parent, current) {
1343
1312
  return parent === '' ? current : [parent, current].join(this.separator);
@@ -1391,11 +1360,9 @@
1391
1360
  if (arrPath.length <= 1) {
1392
1361
  return ''; // root path
1393
1362
  }
1394
-
1395
1363
  return arrPath.slice(0, arrPath.length - 1).join(this.separator);
1396
1364
  }
1397
1365
  }]);
1398
- return Path;
1399
1366
  }();
1400
1367
  Path.separator = '.';
1401
1368
 
@@ -1408,7 +1375,7 @@
1408
1375
  headers: {},
1409
1376
  cache: 'no-cache'
1410
1377
  };
1411
- var request = /*#__PURE__*/(function () {
1378
+ var request = ( /*#__PURE__*/(function () {
1412
1379
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(url) {
1413
1380
  var config,
1414
1381
  _mergeDeep,
@@ -1518,7 +1485,7 @@
1518
1485
  return function (_x) {
1519
1486
  return _ref.apply(this, arguments);
1520
1487
  };
1521
- })();
1488
+ })());
1522
1489
 
1523
1490
  var props$1 = {
1524
1491
  // 表单值
@@ -1580,11 +1547,14 @@
1580
1547
  };
1581
1548
  }
1582
1549
  },
1583
-
1584
1550
  readonly: {
1585
1551
  type: Boolean,
1586
1552
  default: false
1587
1553
  },
1554
+ disabled: {
1555
+ type: Boolean,
1556
+ default: false
1557
+ },
1588
1558
  readonlyMode: {
1589
1559
  type: String,
1590
1560
  default: 'value',
@@ -1663,7 +1633,6 @@
1663
1633
  };
1664
1634
  }
1665
1635
  },
1666
-
1667
1636
  visible: {
1668
1637
  type: Boolean,
1669
1638
  default: true
@@ -1814,7 +1783,7 @@
1814
1783
  this.children = children;
1815
1784
  }
1816
1785
  // 当前node的值
1817
- _createClass(WidgetNode, [{
1786
+ return _createClass(WidgetNode, [{
1818
1787
  key: "value",
1819
1788
  get: function get() {
1820
1789
  var _this$instance;
@@ -1914,14 +1883,13 @@
1914
1883
  return nodes;
1915
1884
  }
1916
1885
  }]);
1917
- return WidgetNode;
1918
1886
  }();
1919
1887
  var WidgetTree = /*#__PURE__*/function () {
1920
1888
  function WidgetTree() {
1921
1889
  _classCallCheck(this, WidgetTree);
1922
1890
  this.widgetMap = {};
1923
1891
  }
1924
- _createClass(WidgetTree, [{
1892
+ return _createClass(WidgetTree, [{
1925
1893
  key: "addWidgetNode",
1926
1894
  value: function addWidgetNode(path, instance, type, index) {
1927
1895
  if (path === '') {
@@ -1939,19 +1907,19 @@
1939
1907
  // 普通节点
1940
1908
  var parentId = Path.getParentPath(path);
1941
1909
  var parentNode = this.widgetMap[parentId];
1942
- if (!parentNode) {
1943
- console.warn('Unexpected parent id, add widget failed');
1944
- return;
1945
- }
1946
1910
  var _node = new WidgetNode({
1947
- id: instance.path,
1911
+ id: (instance === null || instance === void 0 ? void 0 : instance.path) || path,
1948
1912
  type: type,
1949
1913
  index: index,
1950
1914
  parent: parentNode,
1951
1915
  instance: instance,
1952
1916
  children: []
1953
1917
  });
1954
- parentNode.appendChild(_node);
1918
+ if (!parentNode) {
1919
+ console.warn('Unexpected parent id, please check widget node', _node);
1920
+ } else {
1921
+ parentNode.appendChild(_node);
1922
+ }
1955
1923
  this.widgetMap[path] = _node;
1956
1924
  }
1957
1925
  }
@@ -1978,7 +1946,6 @@
1978
1946
  }
1979
1947
  }
1980
1948
  }]);
1981
- return WidgetTree;
1982
1949
  }();
1983
1950
  var widgetTree = new WidgetTree();
1984
1951
 
@@ -2299,7 +2266,7 @@
2299
2266
  (function (UsedValueState) {
2300
2267
  UsedValueState[UsedValueState["Started"] = 0] = "Started";
2301
2268
  UsedValueState[UsedValueState["Completed"] = 1] = "Completed";
2302
- })(UsedValueState = exports.UsedValueState || (exports.UsedValueState = {}));
2269
+ })(UsedValueState || (exports.UsedValueState = UsedValueState = {}));
2303
2270
  exports.varKinds = {
2304
2271
  const: new code_1.Name("const"),
2305
2272
  let: new code_1.Name("let"),
@@ -3131,11 +3098,10 @@
3131
3098
 
3132
3099
  var util = {};
3133
3100
 
3134
- (function (exports) {
3135
- Object.defineProperty(exports, "__esModule", { value: true });
3136
- exports.checkStrictMode = exports.getErrorPath = exports.Type = exports.useFunc = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = void 0;
3137
- const codegen_1 = codegen;
3138
- const code_1 = code$1;
3101
+ Object.defineProperty(util, "__esModule", { value: true });
3102
+ util.checkStrictMode = util.getErrorPath = util.Type = util.useFunc = util.setEvaluated = util.evaluatedPropsToName = util.mergeEvaluated = util.eachItem = util.unescapeJsonPointer = util.escapeJsonPointer = util.escapeFragment = util.unescapeFragment = util.schemaRefOrVal = util.schemaHasRulesButRef = util.schemaHasRules = util.checkUnknownRules = util.alwaysValidSchema = util.toHash = void 0;
3103
+ const codegen_1$v = codegen;
3104
+ const code_1$a = code$1;
3139
3105
  // TODO refactor to use Set
3140
3106
  function toHash(arr) {
3141
3107
  const hash = {};
@@ -3143,7 +3109,7 @@
3143
3109
  hash[item] = true;
3144
3110
  return hash;
3145
3111
  }
3146
- exports.toHash = toHash;
3112
+ util.toHash = toHash;
3147
3113
  function alwaysValidSchema(it, schema) {
3148
3114
  if (typeof schema == "boolean")
3149
3115
  return schema;
@@ -3152,7 +3118,7 @@
3152
3118
  checkUnknownRules(it, schema);
3153
3119
  return !schemaHasRules(schema, it.self.RULES.all);
3154
3120
  }
3155
- exports.alwaysValidSchema = alwaysValidSchema;
3121
+ util.alwaysValidSchema = alwaysValidSchema;
3156
3122
  function checkUnknownRules(it, schema = it.schema) {
3157
3123
  const { opts, self } = it;
3158
3124
  if (!opts.strictSchema)
@@ -3165,7 +3131,7 @@
3165
3131
  checkStrictMode(it, `unknown keyword: "${key}"`);
3166
3132
  }
3167
3133
  }
3168
- exports.checkUnknownRules = checkUnknownRules;
3134
+ util.checkUnknownRules = checkUnknownRules;
3169
3135
  function schemaHasRules(schema, rules) {
3170
3136
  if (typeof schema == "boolean")
3171
3137
  return !schema;
@@ -3174,7 +3140,7 @@
3174
3140
  return true;
3175
3141
  return false;
3176
3142
  }
3177
- exports.schemaHasRules = schemaHasRules;
3143
+ util.schemaHasRules = schemaHasRules;
3178
3144
  function schemaHasRulesButRef(schema, RULES) {
3179
3145
  if (typeof schema == "boolean")
3180
3146
  return !schema;
@@ -3183,35 +3149,35 @@
3183
3149
  return true;
3184
3150
  return false;
3185
3151
  }
3186
- exports.schemaHasRulesButRef = schemaHasRulesButRef;
3152
+ util.schemaHasRulesButRef = schemaHasRulesButRef;
3187
3153
  function schemaRefOrVal({ topSchemaRef, schemaPath }, schema, keyword, $data) {
3188
3154
  if (!$data) {
3189
3155
  if (typeof schema == "number" || typeof schema == "boolean")
3190
3156
  return schema;
3191
3157
  if (typeof schema == "string")
3192
- return (0, codegen_1._) `${schema}`;
3158
+ return (0, codegen_1$v._) `${schema}`;
3193
3159
  }
3194
- return (0, codegen_1._) `${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`;
3160
+ return (0, codegen_1$v._) `${topSchemaRef}${schemaPath}${(0, codegen_1$v.getProperty)(keyword)}`;
3195
3161
  }
3196
- exports.schemaRefOrVal = schemaRefOrVal;
3162
+ util.schemaRefOrVal = schemaRefOrVal;
3197
3163
  function unescapeFragment(str) {
3198
3164
  return unescapeJsonPointer(decodeURIComponent(str));
3199
3165
  }
3200
- exports.unescapeFragment = unescapeFragment;
3166
+ util.unescapeFragment = unescapeFragment;
3201
3167
  function escapeFragment(str) {
3202
3168
  return encodeURIComponent(escapeJsonPointer(str));
3203
3169
  }
3204
- exports.escapeFragment = escapeFragment;
3170
+ util.escapeFragment = escapeFragment;
3205
3171
  function escapeJsonPointer(str) {
3206
3172
  if (typeof str == "number")
3207
3173
  return `${str}`;
3208
3174
  return str.replace(/~/g, "~0").replace(/\//g, "~1");
3209
3175
  }
3210
- exports.escapeJsonPointer = escapeJsonPointer;
3176
+ util.escapeJsonPointer = escapeJsonPointer;
3211
3177
  function unescapeJsonPointer(str) {
3212
3178
  return str.replace(/~1/g, "/").replace(/~0/g, "~");
3213
3179
  }
3214
- exports.unescapeJsonPointer = unescapeJsonPointer;
3180
+ util.unescapeJsonPointer = unescapeJsonPointer;
3215
3181
  function eachItem(xs, f) {
3216
3182
  if (Array.isArray(xs)) {
3217
3183
  for (const x of xs)
@@ -3221,30 +3187,30 @@
3221
3187
  f(xs);
3222
3188
  }
3223
3189
  }
3224
- exports.eachItem = eachItem;
3190
+ util.eachItem = eachItem;
3225
3191
  function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues, resultToName, }) {
3226
3192
  return (gen, from, to, toName) => {
3227
3193
  const res = to === undefined
3228
3194
  ? from
3229
- : to instanceof codegen_1.Name
3230
- ? (from instanceof codegen_1.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to)
3231
- : from instanceof codegen_1.Name
3195
+ : to instanceof codegen_1$v.Name
3196
+ ? (from instanceof codegen_1$v.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to)
3197
+ : from instanceof codegen_1$v.Name
3232
3198
  ? (mergeToName(gen, to, from), from)
3233
3199
  : mergeValues(from, to);
3234
- return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res;
3200
+ return toName === codegen_1$v.Name && !(res instanceof codegen_1$v.Name) ? resultToName(gen, res) : res;
3235
3201
  };
3236
3202
  }
3237
- exports.mergeEvaluated = {
3203
+ util.mergeEvaluated = {
3238
3204
  props: makeMergeEvaluated({
3239
- mergeNames: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true && ${from} !== undefined`, () => {
3240
- gen.if((0, codegen_1._) `${from} === true`, () => gen.assign(to, true), () => gen.assign(to, (0, codegen_1._) `${to} || {}`).code((0, codegen_1._) `Object.assign(${to}, ${from})`));
3205
+ mergeNames: (gen, from, to) => gen.if((0, codegen_1$v._) `${to} !== true && ${from} !== undefined`, () => {
3206
+ gen.if((0, codegen_1$v._) `${from} === true`, () => gen.assign(to, true), () => gen.assign(to, (0, codegen_1$v._) `${to} || {}`).code((0, codegen_1$v._) `Object.assign(${to}, ${from})`));
3241
3207
  }),
3242
- mergeToName: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true`, () => {
3208
+ mergeToName: (gen, from, to) => gen.if((0, codegen_1$v._) `${to} !== true`, () => {
3243
3209
  if (from === true) {
3244
3210
  gen.assign(to, true);
3245
3211
  }
3246
3212
  else {
3247
- gen.assign(to, (0, codegen_1._) `${to} || {}`);
3213
+ gen.assign(to, (0, codegen_1$v._) `${to} || {}`);
3248
3214
  setEvaluated(gen, to, from);
3249
3215
  }
3250
3216
  }),
@@ -3252,8 +3218,8 @@
3252
3218
  resultToName: evaluatedPropsToName,
3253
3219
  }),
3254
3220
  items: makeMergeEvaluated({
3255
- mergeNames: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true && ${from} !== undefined`, () => gen.assign(to, (0, codegen_1._) `${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)),
3256
- mergeToName: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true`, () => gen.assign(to, from === true ? true : (0, codegen_1._) `${to} > ${from} ? ${to} : ${from}`)),
3221
+ mergeNames: (gen, from, to) => gen.if((0, codegen_1$v._) `${to} !== true && ${from} !== undefined`, () => gen.assign(to, (0, codegen_1$v._) `${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)),
3222
+ mergeToName: (gen, from, to) => gen.if((0, codegen_1$v._) `${to} !== true`, () => gen.assign(to, from === true ? true : (0, codegen_1$v._) `${to} > ${from} ? ${to} : ${from}`)),
3257
3223
  mergeValues: (from, to) => (from === true ? true : Math.max(from, to)),
3258
3224
  resultToName: (gen, items) => gen.var("items", items),
3259
3225
  }),
@@ -3261,44 +3227,44 @@
3261
3227
  function evaluatedPropsToName(gen, ps) {
3262
3228
  if (ps === true)
3263
3229
  return gen.var("props", true);
3264
- const props = gen.var("props", (0, codegen_1._) `{}`);
3230
+ const props = gen.var("props", (0, codegen_1$v._) `{}`);
3265
3231
  if (ps !== undefined)
3266
3232
  setEvaluated(gen, props, ps);
3267
3233
  return props;
3268
3234
  }
3269
- exports.evaluatedPropsToName = evaluatedPropsToName;
3235
+ util.evaluatedPropsToName = evaluatedPropsToName;
3270
3236
  function setEvaluated(gen, props, ps) {
3271
- Object.keys(ps).forEach((p) => gen.assign((0, codegen_1._) `${props}${(0, codegen_1.getProperty)(p)}`, true));
3237
+ Object.keys(ps).forEach((p) => gen.assign((0, codegen_1$v._) `${props}${(0, codegen_1$v.getProperty)(p)}`, true));
3272
3238
  }
3273
- exports.setEvaluated = setEvaluated;
3239
+ util.setEvaluated = setEvaluated;
3274
3240
  const snippets = {};
3275
3241
  function useFunc(gen, f) {
3276
3242
  return gen.scopeValue("func", {
3277
3243
  ref: f,
3278
- code: snippets[f.code] || (snippets[f.code] = new code_1._Code(f.code)),
3244
+ code: snippets[f.code] || (snippets[f.code] = new code_1$a._Code(f.code)),
3279
3245
  });
3280
3246
  }
3281
- exports.useFunc = useFunc;
3247
+ util.useFunc = useFunc;
3282
3248
  var Type;
3283
3249
  (function (Type) {
3284
3250
  Type[Type["Num"] = 0] = "Num";
3285
3251
  Type[Type["Str"] = 1] = "Str";
3286
- })(Type = exports.Type || (exports.Type = {}));
3252
+ })(Type || (util.Type = Type = {}));
3287
3253
  function getErrorPath(dataProp, dataPropType, jsPropertySyntax) {
3288
3254
  // let path
3289
- if (dataProp instanceof codegen_1.Name) {
3255
+ if (dataProp instanceof codegen_1$v.Name) {
3290
3256
  const isNumber = dataPropType === Type.Num;
3291
3257
  return jsPropertySyntax
3292
3258
  ? isNumber
3293
- ? (0, codegen_1._) `"[" + ${dataProp} + "]"`
3294
- : (0, codegen_1._) `"['" + ${dataProp} + "']"`
3259
+ ? (0, codegen_1$v._) `"[" + ${dataProp} + "]"`
3260
+ : (0, codegen_1$v._) `"['" + ${dataProp} + "']"`
3295
3261
  : isNumber
3296
- ? (0, codegen_1._) `"/" + ${dataProp}`
3297
- : (0, codegen_1._) `"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")`; // TODO maybe use global escapePointer
3262
+ ? (0, codegen_1$v._) `"/" + ${dataProp}`
3263
+ : (0, codegen_1$v._) `"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")`; // TODO maybe use global escapePointer
3298
3264
  }
3299
- return jsPropertySyntax ? (0, codegen_1.getProperty)(dataProp).toString() : "/" + escapeJsonPointer(dataProp);
3265
+ return jsPropertySyntax ? (0, codegen_1$v.getProperty)(dataProp).toString() : "/" + escapeJsonPointer(dataProp);
3300
3266
  }
3301
- exports.getErrorPath = getErrorPath;
3267
+ util.getErrorPath = getErrorPath;
3302
3268
  function checkStrictMode(it, msg, mode = it.opts.strictSchema) {
3303
3269
  if (!mode)
3304
3270
  return;
@@ -3307,36 +3273,34 @@
3307
3273
  throw new Error(msg);
3308
3274
  it.self.logger.warn(msg);
3309
3275
  }
3310
- exports.checkStrictMode = checkStrictMode;
3311
-
3312
- }(util));
3276
+ util.checkStrictMode = checkStrictMode;
3313
3277
 
3314
3278
  var names$1 = {};
3315
3279
 
3316
3280
  Object.defineProperty(names$1, "__esModule", { value: true });
3317
- const codegen_1$t = codegen;
3281
+ const codegen_1$u = codegen;
3318
3282
  const names = {
3319
3283
  // validation function arguments
3320
- data: new codegen_1$t.Name("data"),
3284
+ data: new codegen_1$u.Name("data"), // data passed to validation function
3321
3285
  // args passed from referencing schema
3322
- valCxt: new codegen_1$t.Name("valCxt"),
3323
- instancePath: new codegen_1$t.Name("instancePath"),
3324
- parentData: new codegen_1$t.Name("parentData"),
3325
- parentDataProperty: new codegen_1$t.Name("parentDataProperty"),
3326
- rootData: new codegen_1$t.Name("rootData"),
3327
- dynamicAnchors: new codegen_1$t.Name("dynamicAnchors"),
3286
+ valCxt: new codegen_1$u.Name("valCxt"), // validation/data context - should not be used directly, it is destructured to the names below
3287
+ instancePath: new codegen_1$u.Name("instancePath"),
3288
+ parentData: new codegen_1$u.Name("parentData"),
3289
+ parentDataProperty: new codegen_1$u.Name("parentDataProperty"),
3290
+ rootData: new codegen_1$u.Name("rootData"), // root data - same as the data passed to the first/top validation function
3291
+ dynamicAnchors: new codegen_1$u.Name("dynamicAnchors"), // used to support recursiveRef and dynamicRef
3328
3292
  // function scoped variables
3329
- vErrors: new codegen_1$t.Name("vErrors"),
3330
- errors: new codegen_1$t.Name("errors"),
3331
- this: new codegen_1$t.Name("this"),
3293
+ vErrors: new codegen_1$u.Name("vErrors"), // null or array of validation errors
3294
+ errors: new codegen_1$u.Name("errors"), // counter of validation errors
3295
+ this: new codegen_1$u.Name("this"),
3332
3296
  // "globals"
3333
- self: new codegen_1$t.Name("self"),
3334
- scope: new codegen_1$t.Name("scope"),
3297
+ self: new codegen_1$u.Name("self"),
3298
+ scope: new codegen_1$u.Name("scope"),
3335
3299
  // JTD serialize/parse name for JSON string and position
3336
- json: new codegen_1$t.Name("json"),
3337
- jsonPos: new codegen_1$t.Name("jsonPos"),
3338
- jsonLen: new codegen_1$t.Name("jsonLen"),
3339
- jsonPart: new codegen_1$t.Name("jsonPart"),
3300
+ json: new codegen_1$u.Name("json"),
3301
+ jsonPos: new codegen_1$u.Name("jsonPos"),
3302
+ jsonLen: new codegen_1$u.Name("jsonLen"),
3303
+ jsonPart: new codegen_1$u.Name("jsonPart"),
3340
3304
  };
3341
3305
  names$1.default = names;
3342
3306
 
@@ -3414,7 +3378,7 @@
3414
3378
  }
3415
3379
  const E = {
3416
3380
  keyword: new codegen_1.Name("keyword"),
3417
- schemaPath: new codegen_1.Name("schemaPath"),
3381
+ schemaPath: new codegen_1.Name("schemaPath"), // also used in JTD errors
3418
3382
  params: new codegen_1.Name("params"),
3419
3383
  propertyName: new codegen_1.Name("propertyName"),
3420
3384
  message: new codegen_1.Name("message"),
@@ -3467,8 +3431,8 @@
3467
3431
 
3468
3432
  Object.defineProperty(boolSchema, "__esModule", { value: true });
3469
3433
  boolSchema.boolOrEmptySchema = boolSchema.topBoolOrEmptySchema = void 0;
3470
- const errors_1$2 = errors;
3471
- const codegen_1$s = codegen;
3434
+ const errors_1$3 = errors;
3435
+ const codegen_1$t = codegen;
3472
3436
  const names_1$6 = names$1;
3473
3437
  const boolError = {
3474
3438
  message: "boolean schema is false",
@@ -3482,7 +3446,7 @@
3482
3446
  gen.return(names_1$6.default.data);
3483
3447
  }
3484
3448
  else {
3485
- gen.assign((0, codegen_1$s._) `${validateName}.errors`, null);
3449
+ gen.assign((0, codegen_1$t._) `${validateName}.errors`, null);
3486
3450
  gen.return(true);
3487
3451
  }
3488
3452
  }
@@ -3511,7 +3475,7 @@
3511
3475
  params: {},
3512
3476
  it,
3513
3477
  };
3514
- (0, errors_1$2.reportError)(cxt, boolError, undefined, overrideAllErrors);
3478
+ (0, errors_1$3.reportError)(cxt, boolError, undefined, overrideAllErrors);
3515
3479
  }
3516
3480
 
3517
3481
  var dataType = {};
@@ -3563,19 +3527,18 @@
3563
3527
  }
3564
3528
  applicability.shouldUseRule = shouldUseRule;
3565
3529
 
3566
- (function (exports) {
3567
- Object.defineProperty(exports, "__esModule", { value: true });
3568
- exports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = void 0;
3530
+ Object.defineProperty(dataType, "__esModule", { value: true });
3531
+ dataType.reportTypeError = dataType.checkDataTypes = dataType.checkDataType = dataType.coerceAndCheckDataType = dataType.getJSONTypes = dataType.getSchemaTypes = dataType.DataType = void 0;
3569
3532
  const rules_1 = rules;
3570
- const applicability_1 = applicability;
3571
- const errors_1 = errors;
3572
- const codegen_1 = codegen;
3573
- const util_1 = util;
3533
+ const applicability_1$1 = applicability;
3534
+ const errors_1$2 = errors;
3535
+ const codegen_1$s = codegen;
3536
+ const util_1$q = util;
3574
3537
  var DataType;
3575
3538
  (function (DataType) {
3576
3539
  DataType[DataType["Correct"] = 0] = "Correct";
3577
3540
  DataType[DataType["Wrong"] = 1] = "Wrong";
3578
- })(DataType = exports.DataType || (exports.DataType = {}));
3541
+ })(DataType || (dataType.DataType = DataType = {}));
3579
3542
  function getSchemaTypes(schema) {
3580
3543
  const types = getJSONTypes(schema.type);
3581
3544
  const hasNull = types.includes("null");
@@ -3592,19 +3555,20 @@
3592
3555
  }
3593
3556
  return types;
3594
3557
  }
3595
- exports.getSchemaTypes = getSchemaTypes;
3558
+ dataType.getSchemaTypes = getSchemaTypes;
3559
+ // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
3596
3560
  function getJSONTypes(ts) {
3597
3561
  const types = Array.isArray(ts) ? ts : ts ? [ts] : [];
3598
3562
  if (types.every(rules_1.isJSONType))
3599
3563
  return types;
3600
3564
  throw new Error("type must be JSONType or JSONType[]: " + types.join(","));
3601
3565
  }
3602
- exports.getJSONTypes = getJSONTypes;
3566
+ dataType.getJSONTypes = getJSONTypes;
3603
3567
  function coerceAndCheckDataType(it, types) {
3604
3568
  const { gen, data, opts } = it;
3605
3569
  const coerceTo = coerceToTypes(types, opts.coerceTypes);
3606
3570
  const checkTypes = types.length > 0 &&
3607
- !(coerceTo.length === 0 && types.length === 1 && (0, applicability_1.schemaHasRulesForType)(it, types[0]));
3571
+ !(coerceTo.length === 0 && types.length === 1 && (0, applicability_1$1.schemaHasRulesForType)(it, types[0]));
3608
3572
  if (checkTypes) {
3609
3573
  const wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong);
3610
3574
  gen.if(wrongType, () => {
@@ -3616,7 +3580,7 @@
3616
3580
  }
3617
3581
  return checkTypes;
3618
3582
  }
3619
- exports.coerceAndCheckDataType = coerceAndCheckDataType;
3583
+ dataType.coerceAndCheckDataType = coerceAndCheckDataType;
3620
3584
  const COERCIBLE = new Set(["string", "number", "integer", "boolean", "null"]);
3621
3585
  function coerceToTypes(types, coerceTypes) {
3622
3586
  return coerceTypes
@@ -3625,15 +3589,15 @@
3625
3589
  }
3626
3590
  function coerceData(it, types, coerceTo) {
3627
3591
  const { gen, data, opts } = it;
3628
- const dataType = gen.let("dataType", (0, codegen_1._) `typeof ${data}`);
3629
- const coerced = gen.let("coerced", (0, codegen_1._) `undefined`);
3592
+ const dataType = gen.let("dataType", (0, codegen_1$s._) `typeof ${data}`);
3593
+ const coerced = gen.let("coerced", (0, codegen_1$s._) `undefined`);
3630
3594
  if (opts.coerceTypes === "array") {
3631
- gen.if((0, codegen_1._) `${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen
3632
- .assign(data, (0, codegen_1._) `${data}[0]`)
3633
- .assign(dataType, (0, codegen_1._) `typeof ${data}`)
3595
+ gen.if((0, codegen_1$s._) `${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen
3596
+ .assign(data, (0, codegen_1$s._) `${data}[0]`)
3597
+ .assign(dataType, (0, codegen_1$s._) `typeof ${data}`)
3634
3598
  .if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data)));
3635
3599
  }
3636
- gen.if((0, codegen_1._) `${coerced} !== undefined`);
3600
+ gen.if((0, codegen_1$s._) `${coerced} !== undefined`);
3637
3601
  for (const t of coerceTo) {
3638
3602
  if (COERCIBLE.has(t) || (t === "array" && opts.coerceTypes === "array")) {
3639
3603
  coerceSpecificType(t);
@@ -3642,7 +3606,7 @@
3642
3606
  gen.else();
3643
3607
  reportTypeError(it);
3644
3608
  gen.endIf();
3645
- gen.if((0, codegen_1._) `${coerced} !== undefined`, () => {
3609
+ gen.if((0, codegen_1$s._) `${coerced} !== undefined`, () => {
3646
3610
  gen.assign(data, coerced);
3647
3611
  assignParentData(it, coerced);
3648
3612
  });
@@ -3650,108 +3614,108 @@
3650
3614
  switch (t) {
3651
3615
  case "string":
3652
3616
  gen
3653
- .elseIf((0, codegen_1._) `${dataType} == "number" || ${dataType} == "boolean"`)
3654
- .assign(coerced, (0, codegen_1._) `"" + ${data}`)
3655
- .elseIf((0, codegen_1._) `${data} === null`)
3656
- .assign(coerced, (0, codegen_1._) `""`);
3617
+ .elseIf((0, codegen_1$s._) `${dataType} == "number" || ${dataType} == "boolean"`)
3618
+ .assign(coerced, (0, codegen_1$s._) `"" + ${data}`)
3619
+ .elseIf((0, codegen_1$s._) `${data} === null`)
3620
+ .assign(coerced, (0, codegen_1$s._) `""`);
3657
3621
  return;
3658
3622
  case "number":
3659
3623
  gen
3660
- .elseIf((0, codegen_1._) `${dataType} == "boolean" || ${data} === null
3624
+ .elseIf((0, codegen_1$s._) `${dataType} == "boolean" || ${data} === null
3661
3625
  || (${dataType} == "string" && ${data} && ${data} == +${data})`)
3662
- .assign(coerced, (0, codegen_1._) `+${data}`);
3626
+ .assign(coerced, (0, codegen_1$s._) `+${data}`);
3663
3627
  return;
3664
3628
  case "integer":
3665
3629
  gen
3666
- .elseIf((0, codegen_1._) `${dataType} === "boolean" || ${data} === null
3630
+ .elseIf((0, codegen_1$s._) `${dataType} === "boolean" || ${data} === null
3667
3631
  || (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))`)
3668
- .assign(coerced, (0, codegen_1._) `+${data}`);
3632
+ .assign(coerced, (0, codegen_1$s._) `+${data}`);
3669
3633
  return;
3670
3634
  case "boolean":
3671
3635
  gen
3672
- .elseIf((0, codegen_1._) `${data} === "false" || ${data} === 0 || ${data} === null`)
3636
+ .elseIf((0, codegen_1$s._) `${data} === "false" || ${data} === 0 || ${data} === null`)
3673
3637
  .assign(coerced, false)
3674
- .elseIf((0, codegen_1._) `${data} === "true" || ${data} === 1`)
3638
+ .elseIf((0, codegen_1$s._) `${data} === "true" || ${data} === 1`)
3675
3639
  .assign(coerced, true);
3676
3640
  return;
3677
3641
  case "null":
3678
- gen.elseIf((0, codegen_1._) `${data} === "" || ${data} === 0 || ${data} === false`);
3642
+ gen.elseIf((0, codegen_1$s._) `${data} === "" || ${data} === 0 || ${data} === false`);
3679
3643
  gen.assign(coerced, null);
3680
3644
  return;
3681
3645
  case "array":
3682
3646
  gen
3683
- .elseIf((0, codegen_1._) `${dataType} === "string" || ${dataType} === "number"
3647
+ .elseIf((0, codegen_1$s._) `${dataType} === "string" || ${dataType} === "number"
3684
3648
  || ${dataType} === "boolean" || ${data} === null`)
3685
- .assign(coerced, (0, codegen_1._) `[${data}]`);
3649
+ .assign(coerced, (0, codegen_1$s._) `[${data}]`);
3686
3650
  }
3687
3651
  }
3688
3652
  }
3689
3653
  function assignParentData({ gen, parentData, parentDataProperty }, expr) {
3690
3654
  // TODO use gen.property
3691
- gen.if((0, codegen_1._) `${parentData} !== undefined`, () => gen.assign((0, codegen_1._) `${parentData}[${parentDataProperty}]`, expr));
3655
+ gen.if((0, codegen_1$s._) `${parentData} !== undefined`, () => gen.assign((0, codegen_1$s._) `${parentData}[${parentDataProperty}]`, expr));
3692
3656
  }
3693
3657
  function checkDataType(dataType, data, strictNums, correct = DataType.Correct) {
3694
- const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ;
3658
+ const EQ = correct === DataType.Correct ? codegen_1$s.operators.EQ : codegen_1$s.operators.NEQ;
3695
3659
  let cond;
3696
3660
  switch (dataType) {
3697
3661
  case "null":
3698
- return (0, codegen_1._) `${data} ${EQ} null`;
3662
+ return (0, codegen_1$s._) `${data} ${EQ} null`;
3699
3663
  case "array":
3700
- cond = (0, codegen_1._) `Array.isArray(${data})`;
3664
+ cond = (0, codegen_1$s._) `Array.isArray(${data})`;
3701
3665
  break;
3702
3666
  case "object":
3703
- cond = (0, codegen_1._) `${data} && typeof ${data} == "object" && !Array.isArray(${data})`;
3667
+ cond = (0, codegen_1$s._) `${data} && typeof ${data} == "object" && !Array.isArray(${data})`;
3704
3668
  break;
3705
3669
  case "integer":
3706
- cond = numCond((0, codegen_1._) `!(${data} % 1) && !isNaN(${data})`);
3670
+ cond = numCond((0, codegen_1$s._) `!(${data} % 1) && !isNaN(${data})`);
3707
3671
  break;
3708
3672
  case "number":
3709
3673
  cond = numCond();
3710
3674
  break;
3711
3675
  default:
3712
- return (0, codegen_1._) `typeof ${data} ${EQ} ${dataType}`;
3676
+ return (0, codegen_1$s._) `typeof ${data} ${EQ} ${dataType}`;
3713
3677
  }
3714
- return correct === DataType.Correct ? cond : (0, codegen_1.not)(cond);
3715
- function numCond(_cond = codegen_1.nil) {
3716
- return (0, codegen_1.and)((0, codegen_1._) `typeof ${data} == "number"`, _cond, strictNums ? (0, codegen_1._) `isFinite(${data})` : codegen_1.nil);
3678
+ return correct === DataType.Correct ? cond : (0, codegen_1$s.not)(cond);
3679
+ function numCond(_cond = codegen_1$s.nil) {
3680
+ return (0, codegen_1$s.and)((0, codegen_1$s._) `typeof ${data} == "number"`, _cond, strictNums ? (0, codegen_1$s._) `isFinite(${data})` : codegen_1$s.nil);
3717
3681
  }
3718
3682
  }
3719
- exports.checkDataType = checkDataType;
3683
+ dataType.checkDataType = checkDataType;
3720
3684
  function checkDataTypes(dataTypes, data, strictNums, correct) {
3721
3685
  if (dataTypes.length === 1) {
3722
3686
  return checkDataType(dataTypes[0], data, strictNums, correct);
3723
3687
  }
3724
3688
  let cond;
3725
- const types = (0, util_1.toHash)(dataTypes);
3689
+ const types = (0, util_1$q.toHash)(dataTypes);
3726
3690
  if (types.array && types.object) {
3727
- const notObj = (0, codegen_1._) `typeof ${data} != "object"`;
3728
- cond = types.null ? notObj : (0, codegen_1._) `!${data} || ${notObj}`;
3691
+ const notObj = (0, codegen_1$s._) `typeof ${data} != "object"`;
3692
+ cond = types.null ? notObj : (0, codegen_1$s._) `!${data} || ${notObj}`;
3729
3693
  delete types.null;
3730
3694
  delete types.array;
3731
3695
  delete types.object;
3732
3696
  }
3733
3697
  else {
3734
- cond = codegen_1.nil;
3698
+ cond = codegen_1$s.nil;
3735
3699
  }
3736
3700
  if (types.number)
3737
3701
  delete types.integer;
3738
3702
  for (const t in types)
3739
- cond = (0, codegen_1.and)(cond, checkDataType(t, data, strictNums, correct));
3703
+ cond = (0, codegen_1$s.and)(cond, checkDataType(t, data, strictNums, correct));
3740
3704
  return cond;
3741
3705
  }
3742
- exports.checkDataTypes = checkDataTypes;
3706
+ dataType.checkDataTypes = checkDataTypes;
3743
3707
  const typeError = {
3744
3708
  message: ({ schema }) => `must be ${schema}`,
3745
- params: ({ schema, schemaValue }) => typeof schema == "string" ? (0, codegen_1._) `{type: ${schema}}` : (0, codegen_1._) `{type: ${schemaValue}}`,
3709
+ params: ({ schema, schemaValue }) => typeof schema == "string" ? (0, codegen_1$s._) `{type: ${schema}}` : (0, codegen_1$s._) `{type: ${schemaValue}}`,
3746
3710
  };
3747
3711
  function reportTypeError(it) {
3748
3712
  const cxt = getTypeErrorContext(it);
3749
- (0, errors_1.reportError)(cxt, typeError);
3713
+ (0, errors_1$2.reportError)(cxt, typeError);
3750
3714
  }
3751
- exports.reportTypeError = reportTypeError;
3715
+ dataType.reportTypeError = reportTypeError;
3752
3716
  function getTypeErrorContext(it) {
3753
3717
  const { gen, data, schema } = it;
3754
- const schemaCode = (0, util_1.schemaRefOrVal)(it, schema, "type");
3718
+ const schemaCode = (0, util_1$q.schemaRefOrVal)(it, schema, "type");
3755
3719
  return {
3756
3720
  gen,
3757
3721
  keyword: "type",
@@ -3765,8 +3729,6 @@
3765
3729
  };
3766
3730
  }
3767
3731
 
3768
- }(dataType));
3769
-
3770
3732
  var defaults = {};
3771
3733
 
3772
3734
  Object.defineProperty(defaults, "__esModule", { value: true });
@@ -4388,16 +4350,16 @@
4388
4350
  if (parentJsonPtr === undefined)
4389
4351
  return;
4390
4352
  const fullPath = pathPrefix + jsonPtr;
4391
- let baseId = baseIds[parentJsonPtr];
4353
+ let innerBaseId = baseIds[parentJsonPtr];
4392
4354
  if (typeof sch[schemaId] == "string")
4393
- baseId = addRef.call(this, sch[schemaId]);
4355
+ innerBaseId = addRef.call(this, sch[schemaId]);
4394
4356
  addAnchor.call(this, sch.$anchor);
4395
4357
  addAnchor.call(this, sch.$dynamicAnchor);
4396
- baseIds[jsonPtr] = baseId;
4358
+ baseIds[jsonPtr] = innerBaseId;
4397
4359
  function addRef(ref) {
4398
4360
  // eslint-disable-next-line @typescript-eslint/unbound-method
4399
4361
  const _resolve = this.opts.uriResolver.resolve;
4400
- ref = normalizeId(baseId ? _resolve(baseId, ref) : ref);
4362
+ ref = normalizeId(innerBaseId ? _resolve(innerBaseId, ref) : ref);
4401
4363
  if (schemaRefs.has(ref))
4402
4364
  throw ambiguos(ref);
4403
4365
  schemaRefs.add(ref);
@@ -5038,7 +5000,7 @@
5038
5000
  parentData: names_1$2.default.parentData,
5039
5001
  parentDataProperty: names_1$2.default.parentDataProperty,
5040
5002
  dataNames: [names_1$2.default.data],
5041
- dataPathArr: [codegen_1$m.nil],
5003
+ dataPathArr: [codegen_1$m.nil], // TODO can its length be used as dataLevel if nil is removed?
5042
5004
  dataLevel: 0,
5043
5005
  dataTypes: [],
5044
5006
  definedProperties: new Set(),
@@ -6807,6 +6769,7 @@
6807
6769
  return (this.opts.defaultMeta = typeof meta == "object" ? meta[schemaId] || meta : undefined);
6808
6770
  }
6809
6771
  validate(schemaKeyRef, // key, ref or schema object
6772
+ // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
6810
6773
  data // to be validated
6811
6774
  ) {
6812
6775
  let v;
@@ -7155,9 +7118,9 @@
7155
7118
  }
7156
7119
  }
7157
7120
  }
7158
- exports.default = Ajv;
7159
7121
  Ajv.ValidationError = validation_error_1.default;
7160
7122
  Ajv.MissingRefError = ref_error_1.default;
7123
+ exports.default = Ajv;
7161
7124
  function checkOptions(checkOpts, options, msg, log = "error") {
7162
7125
  for (const key in checkOpts) {
7163
7126
  const opt = key;
@@ -7305,7 +7268,7 @@
7305
7268
 
7306
7269
  Object.defineProperty(ref, "__esModule", { value: true });
7307
7270
  ref.callRef = ref.getValidate = void 0;
7308
- const ref_error_1 = ref_error;
7271
+ const ref_error_1$1 = ref_error;
7309
7272
  const code_1$8 = code;
7310
7273
  const codegen_1$l = codegen;
7311
7274
  const names_1$1 = names$1;
@@ -7322,7 +7285,7 @@
7322
7285
  return callRootRef();
7323
7286
  const schOrEnv = compile_1$1.resolveRef.call(self, root, baseId, $ref);
7324
7287
  if (schOrEnv === undefined)
7325
- throw new ref_error_1.default(it.opts.uriResolver, baseId, $ref);
7288
+ throw new ref_error_1$1.default(it.opts.uriResolver, baseId, $ref);
7326
7289
  if (schOrEnv instanceof compile_1$1.SchemaEnv)
7327
7290
  return callValidate(schOrEnv);
7328
7291
  return inlineRefSchema(schOrEnv);
@@ -8883,20 +8846,19 @@
8883
8846
 
8884
8847
  var types = {};
8885
8848
 
8886
- (function (exports) {
8887
- Object.defineProperty(exports, "__esModule", { value: true });
8888
- exports.DiscrError = void 0;
8849
+ Object.defineProperty(types, "__esModule", { value: true });
8850
+ types.DiscrError = void 0;
8851
+ var DiscrError;
8889
8852
  (function (DiscrError) {
8890
8853
  DiscrError["Tag"] = "tag";
8891
8854
  DiscrError["Mapping"] = "mapping";
8892
- })(exports.DiscrError || (exports.DiscrError = {}));
8893
-
8894
- }(types));
8855
+ })(DiscrError || (types.DiscrError = DiscrError = {}));
8895
8856
 
8896
8857
  Object.defineProperty(discriminator, "__esModule", { value: true });
8897
8858
  const codegen_1 = codegen;
8898
8859
  const types_1 = types;
8899
8860
  const compile_1 = compile;
8861
+ const ref_error_1 = ref_error;
8900
8862
  const util_1 = util;
8901
8863
  const error = {
8902
8864
  message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag
@@ -8951,9 +8913,12 @@
8951
8913
  for (let i = 0; i < oneOf.length; i++) {
8952
8914
  let sch = oneOf[i];
8953
8915
  if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) {
8954
- sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, sch === null || sch === void 0 ? void 0 : sch.$ref);
8916
+ const ref = sch.$ref;
8917
+ sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref);
8955
8918
  if (sch instanceof compile_1.SchemaEnv)
8956
8919
  sch = sch.schema;
8920
+ if (sch === undefined)
8921
+ throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref);
8957
8922
  }
8958
8923
  const propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName];
8959
8924
  if (typeof propSch != "object") {
@@ -9246,7 +9211,7 @@
9246
9211
 
9247
9212
  (function (module, exports) {
9248
9213
  Object.defineProperty(exports, "__esModule", { value: true });
9249
- exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0;
9214
+ exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv = void 0;
9250
9215
  const core_1 = core$2;
9251
9216
  const draft7_1 = draft7;
9252
9217
  const discriminator_1 = discriminator;
@@ -9275,7 +9240,9 @@
9275
9240
  super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined));
9276
9241
  }
9277
9242
  }
9243
+ exports.Ajv = Ajv;
9278
9244
  module.exports = exports = Ajv;
9245
+ module.exports.Ajv = Ajv;
9279
9246
  Object.defineProperty(exports, "__esModule", { value: true });
9280
9247
  exports.default = Ajv;
9281
9248
  var validate_1 = validate$1;
@@ -9821,13 +9788,14 @@
9821
9788
  var widgetPaths = path.split('.');
9822
9789
  var fieldTitleBreadcrumb = [];
9823
9790
  widgetPaths.forEach(function (thePath, thePathIndex) {
9791
+ var _theWidget$instance;
9824
9792
  var currentPaths = widgetPaths.slice(0, widgetPaths.length - thePathIndex);
9825
9793
  var widgetPath = currentPaths.join('.');
9826
9794
  var theWidget = widgetTree.widgetMap[widgetPath];
9827
9795
  // todo(判断path是否是数组索引)
9828
9796
  var isIndex = theWidget.instance.schema.type === 'array' || !theWidget.instance.schema.title;
9829
9797
  fieldTitleBreadcrumb.push(isIndex ? currentPaths.pop() : theWidget.instance.schema.title);
9830
- if (theWidget.instance.verifiable && theWidget.type === 'group') {
9798
+ if ((_theWidget$instance = theWidget.instance) !== null && _theWidget$instance !== void 0 && _theWidget$instance.verifiable && theWidget.type === 'group') {
9831
9799
  if (isError) {
9832
9800
  var groupErrors = "".concat(fieldTitleBreadcrumb.reverse().join('-'), ": ").concat(errorMsg);
9833
9801
  theWidget.instance.setGroupErrorTips(path, groupErrors);
@@ -9845,7 +9813,7 @@
9845
9813
  var _instance$schema;
9846
9814
  // TODO 校验逻辑梳理
9847
9815
  var formItem = widgetTree.widgetMap[path];
9848
- if (!formItem) return {
9816
+ if (!formItem || !formItem.instance) return {
9849
9817
  result: true,
9850
9818
  message: '',
9851
9819
  path: ''
@@ -9860,9 +9828,10 @@
9860
9828
  // 清空所在组错误信息
9861
9829
  var widgetPaths = path.split('.');
9862
9830
  widgetPaths.forEach(function (thePath, thePathIndex) {
9831
+ var _theWidget$instance2;
9863
9832
  var currentPaths = widgetPaths.slice(0, widgetPaths.length - thePathIndex).join('.');
9864
9833
  var theWidget = widgetTree.widgetMap[currentPaths];
9865
- if (theWidget.instance.verifiable && theWidget.type === 'group') {
9834
+ if ((_theWidget$instance2 = theWidget.instance) !== null && _theWidget$instance2 !== void 0 && _theWidget$instance2.verifiable && theWidget.type === 'group') {
9866
9835
  theWidget.instance.removeGroupErrorTips(path);
9867
9836
  }
9868
9837
  });
@@ -9996,7 +9965,7 @@
9996
9965
  this.callbacks = void 0;
9997
9966
  this.callbacks = Object.create(null);
9998
9967
  }
9999
- _createClass(FormEvent, [{
9968
+ return _createClass(FormEvent, [{
10000
9969
  key: "on",
10001
9970
  value: function on(path, type, cb) {
10002
9971
  if (!(path in this.callbacks)) {
@@ -10068,7 +10037,6 @@
10068
10037
  }
10069
10038
  }
10070
10039
  }]);
10071
- return FormEvent;
10072
10040
  }();
10073
10041
  var events = new FormEvent();
10074
10042
 
@@ -10088,16 +10056,25 @@
10088
10056
  readonly: this.readonly,
10089
10057
  error: this.error
10090
10058
  },
10091
- errorTips: ''
10059
+ errorTips: '',
10060
+ privateSchema: {},
10061
+ key: ''
10092
10062
  };
10093
10063
  },
10094
10064
  computed: {
10065
+ widgetMap: function widgetMap() {
10066
+ return widgetTree.widgetMap;
10067
+ },
10095
10068
  widgetNode: function widgetNode() {
10096
10069
  return widgetTree.widgetMap[this.path];
10097
10070
  },
10098
10071
  parent: function parent() {
10099
10072
  var _this$widgetNode;
10100
10073
  return (_this$widgetNode = this.widgetNode) === null || _this$widgetNode === void 0 ? void 0 : _this$widgetNode.parent;
10074
+ },
10075
+ // 当前widget schema数据
10076
+ widgetSchema: function widgetSchema() {
10077
+ return mergeDeep({}, this.schema, this.privateSchema);
10101
10078
  }
10102
10079
  },
10103
10080
  watch: {
@@ -10111,19 +10088,27 @@
10111
10088
  }, 0);
10112
10089
  }
10113
10090
  }
10091
+ },
10092
+ widgetSchema: {
10093
+ deep: true,
10094
+ handler: function handler(newValue, oldValue) {
10095
+ if (deepEquals(newValue, oldValue)) return;
10096
+ this.resetDatasource();
10097
+ this.key = new Date().getTime();
10098
+ }
10114
10099
  }
10115
10100
  },
10116
10101
  created: function created() {
10117
10102
  var _this2 = this;
10118
10103
  // 表单项配置
10119
- var uiOptions = Schema.getUiOptions(this.schema);
10104
+ var uiOptions = Schema.getUiOptions(this.widgetSchema);
10120
10105
  this.formItemProps = _objectSpread2(_objectSpread2({}, uiOptions), {}, {
10121
10106
  // schema配置不存在title时默认用属性名作为title
10122
10107
  label: uiOptions.showTitle ? uiOptions.label || Path.getPathLastProp(this.path) : '',
10123
10108
  required: this.required
10124
10109
  });
10125
10110
  // 设置widget初始化状态 ui:component优先级 > ui:props优先级
10126
- var vNodeData = Schema.getUiComponent(this.schema);
10111
+ var vNodeData = Schema.getUiComponent(this.widgetSchema);
10127
10112
  var defaultProps = Object.assign({}, this.formItemProps, vNodeData.props || {});
10128
10113
  Object.keys(defaultProps).forEach(function (key) {
10129
10114
  if (Reflect.has(_this2.state, key)) {
@@ -10135,7 +10120,7 @@
10135
10120
  },
10136
10121
  mounted: function mounted() {
10137
10122
  // 注册联动
10138
- reactionRegister(this.path, this.schema['ui:reactions']);
10123
+ reactionRegister(this.path, this.widgetSchema['ui:reactions']);
10139
10124
  // 首次联动
10140
10125
  reactionDispatch(this.path, 'valChange');
10141
10126
  reactionDispatch(this.path, 'lifetime/init');
@@ -10161,12 +10146,12 @@
10161
10146
  loadDataSource: function loadDataSource() {
10162
10147
  var _this3 = this;
10163
10148
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
10164
- var _this3$schema, _this3$schema$uiComp, _this3$schema$uiComp$;
10149
+ var _this3$widgetSchema, _this3$widgetSchema$u, _this3$widgetSchema$u2;
10165
10150
  var xhrConfig, url, params, reset, _this3$httpAdapter, _this3$httpAdapter$re, http, responseParse, remoteURL, requestParams;
10166
10151
  return _regeneratorRuntime().wrap(function _callee$(_context) {
10167
10152
  while (1) switch (_context.prev = _context.next) {
10168
10153
  case 0:
10169
- xhrConfig = (_this3$schema = _this3.schema) === null || _this3$schema === void 0 ? void 0 : (_this3$schema$uiComp = _this3$schema['ui:component']) === null || _this3$schema$uiComp === void 0 ? void 0 : (_this3$schema$uiComp$ = _this3$schema$uiComp.props) === null || _this3$schema$uiComp$ === void 0 ? void 0 : _this3$schema$uiComp$.remoteConfig;
10154
+ xhrConfig = (_this3$widgetSchema = _this3.widgetSchema) === null || _this3$widgetSchema === void 0 ? void 0 : (_this3$widgetSchema$u = _this3$widgetSchema['ui:component']) === null || _this3$widgetSchema$u === void 0 ? void 0 : (_this3$widgetSchema$u2 = _this3$widgetSchema$u.props) === null || _this3$widgetSchema$u2 === void 0 ? void 0 : _this3$widgetSchema$u2.remoteConfig;
10170
10155
  if (!xhrConfig) {
10171
10156
  _context.next = 18;
10172
10157
  break;
@@ -10206,11 +10191,11 @@
10206
10191
  return Path.getPathVal(this.rootData, path);
10207
10192
  },
10208
10193
  getReadonlyValue: function getReadonlyValue() {
10209
- var _this$schema$uiCompo,
10210
- _this$schema$uiCompo$,
10194
+ var _this$widgetSchema$ui,
10195
+ _this$widgetSchema$ui2,
10211
10196
  _this4 = this;
10212
10197
  var val = this.value;
10213
- if (((_this$schema$uiCompo = this.schema['ui:component']) === null || _this$schema$uiCompo === void 0 ? void 0 : (_this$schema$uiCompo$ = _this$schema$uiCompo.props) === null || _this$schema$uiCompo$ === void 0 ? void 0 : _this$schema$uiCompo$.type) === 'password') {
10198
+ if (((_this$widgetSchema$ui = this.widgetSchema['ui:component']) === null || _this$widgetSchema$ui === void 0 ? void 0 : (_this$widgetSchema$ui2 = _this$widgetSchema$ui.props) === null || _this$widgetSchema$ui2 === void 0 ? void 0 : _this$widgetSchema$ui2.type) === 'password') {
10214
10199
  val = '******';
10215
10200
  } else if (this.datasource) {
10216
10201
  var _this$datasource;
@@ -10237,11 +10222,38 @@
10237
10222
  value = String(value);
10238
10223
  }
10239
10224
  return value;
10225
+ },
10226
+ getSchema: function getSchema() {
10227
+ return this.widgetSchema;
10228
+ },
10229
+ setSchema: function setSchema(data) {
10230
+ try {
10231
+ this.privateSchema = JSON.parse(JSON.stringify(data));
10232
+ } catch (err) {
10233
+ console.warn(err);
10234
+ }
10235
+ return this.widgetSchema;
10236
+ },
10237
+ resetDatasource: function resetDatasource() {
10238
+ var _this$widgetSchema, _this$widgetSchema$ui3, _this$widgetSchema$ui4;
10239
+ var xhrConfig = (_this$widgetSchema = this.widgetSchema) === null || _this$widgetSchema === void 0 ? void 0 : (_this$widgetSchema$ui3 = _this$widgetSchema['ui:component']) === null || _this$widgetSchema$ui3 === void 0 ? void 0 : (_this$widgetSchema$ui4 = _this$widgetSchema$ui3.props) === null || _this$widgetSchema$ui4 === void 0 ? void 0 : _this$widgetSchema$ui4.remoteConfig;
10240
+ if (xhrConfig) {
10241
+ this.loadDataSource();
10242
+ } else {
10243
+ this.datasource = Schema.resolveDefaultDatasource(this.widgetSchema);
10244
+ }
10240
10245
  }
10241
10246
  },
10242
10247
  render: function render(h) {
10243
- var _events$callbacks, _this$$scopedSlots$de, _this$$scopedSlots$de2, _this$$scopedSlots, _this$schema$uiCompo2, _this$$scopedSlots$su, _this$$scopedSlots2;
10244
- var _Schema$getUiComponen = Schema.getUiComponent(this.schema),
10248
+ var _events$callbacks,
10249
+ _this$$scopedSlots$de,
10250
+ _this$$scopedSlots$de2,
10251
+ _this$$scopedSlots,
10252
+ _this5 = this,
10253
+ _this$widgetSchema$ui5,
10254
+ _this$$scopedSlots$su,
10255
+ _this$$scopedSlots2;
10256
+ var _Schema$getUiComponen = Schema.getUiComponent(this.widgetSchema),
10245
10257
  name = _Schema$getUiComponen.name,
10246
10258
  uiVnodeData = _objectWithoutProperties(_Schema$getUiComponen, _excluded2);
10247
10259
  // 注意顺序!!!
@@ -10250,13 +10262,15 @@
10250
10262
  value: this.value
10251
10263
  });
10252
10264
  var self = this;
10253
- var widgetName = registry.getComponent(name) || name || Schema.getDefaultWidget(this.schema);
10265
+ var widgetName = registry.getComponent(name) || name || Schema.getDefaultWidget(this.widgetSchema);
10254
10266
  var widgetEvents = ((_events$callbacks = events.callbacks) === null || _events$callbacks === void 0 ? void 0 : _events$callbacks[this.path]) || {};
10255
10267
  // 当前state属性优先级最高
10256
10268
  var renderWidget = (_this$$scopedSlots$de = (_this$$scopedSlots$de2 = (_this$$scopedSlots = this.$scopedSlots).default) === null || _this$$scopedSlots$de2 === void 0 ? void 0 : _this$$scopedSlots$de2.call(_this$$scopedSlots, {
10257
10269
  path: this.path
10258
10270
  })) !== null && _this$$scopedSlots$de !== void 0 ? _this$$scopedSlots$de : h(widgetName, mergeDeep({
10259
- props: _objectSpread2({}, widgetProps),
10271
+ props: _objectSpread2(_objectSpread2({}, widgetProps), {}, {
10272
+ schema: this.widgetSchema
10273
+ }),
10260
10274
  attrs: _objectSpread2({}, uiVnodeData.props || {}),
10261
10275
  class: {
10262
10276
  pr20: this.removeable
@@ -10268,6 +10282,7 @@
10268
10282
  path: self.path,
10269
10283
  value: value
10270
10284
  });
10285
+ reactionDispatch(self.path, 'effect/update');
10271
10286
  }]),
10272
10287
  click: function click() {
10273
10288
  reactionDispatch(self.path, 'effect/click');
@@ -10287,7 +10302,10 @@
10287
10302
  // 渲染删除按钮(用于数组类型widget删除)
10288
10303
  var renderDelete = function renderDelete() {
10289
10304
  return h('span', {
10290
- class: ['bk-schema-form-group-delete'],
10305
+ class: ['bk-schema-form-group-delete', {
10306
+ disabled: _this5.disabled,
10307
+ readonly: _this5.readonly
10308
+ }],
10291
10309
  style: {
10292
10310
  right: '0px',
10293
10311
  top: '0px'
@@ -10302,6 +10320,7 @@
10302
10320
  })]);
10303
10321
  };
10304
10322
  return h(registry.getBaseWidget('form-item'), {
10323
+ key: this.key,
10305
10324
  props: this.formItemProps,
10306
10325
  style: _objectSpread2(_objectSpread2(_objectSpread2({}, this.layout.item || {}), this.layout.container || {}), {}, {
10307
10326
  // 表单项显示和隐藏状态
@@ -10310,9 +10329,9 @@
10310
10329
  class: {
10311
10330
  'bk-schema-form-item--error': this.state.error
10312
10331
  }
10313
- }, [this.state.readonly && this.readonlyMode === 'value' && ((_this$schema$uiCompo2 = this.schema['ui:component']) === null || _this$schema$uiCompo2 === void 0 ? void 0 : _this$schema$uiCompo2.name) !== 'table' ? renderReadonlyWidget : renderWidget, (_this$$scopedSlots$su = (_this$$scopedSlots2 = this.$scopedSlots).suffix) === null || _this$$scopedSlots$su === void 0 ? void 0 : _this$$scopedSlots$su.call(_this$$scopedSlots2, {
10332
+ }, [this.state.readonly && this.readonlyMode === 'value' && ((_this$widgetSchema$ui5 = this.widgetSchema['ui:component']) === null || _this$widgetSchema$ui5 === void 0 ? void 0 : _this$widgetSchema$ui5.name) !== 'table' ? renderReadonlyWidget : renderWidget, (_this$$scopedSlots$su = (_this$$scopedSlots2 = this.$scopedSlots).suffix) === null || _this$$scopedSlots$su === void 0 ? void 0 : _this$$scopedSlots$su.call(_this$$scopedSlots2, {
10314
10333
  path: this.path,
10315
- schema: this.schema
10334
+ schema: this.widgetSchema
10316
10335
  }), this.removeable && renderDelete(), this.state.error ? h('p', {
10317
10336
  class: 'bk-schema-form-item__error-tips'
10318
10337
  }, this.errorTips) : null, this.formItemProps.tips ? h('p', {
@@ -10449,6 +10468,7 @@
10449
10468
  },
10450
10469
  // 添加item
10451
10470
  handleAddItem: function handleAddItem() {
10471
+ if (this.disabled || this.readonly) return;
10452
10472
  var data = Schema.getSchemaDefaultValue(this.schema.items);
10453
10473
  var value = JSON.parse(JSON.stringify(this.value || []));
10454
10474
  value.push(data);
@@ -10459,6 +10479,7 @@
10459
10479
  },
10460
10480
  // 删除item
10461
10481
  handleDeleteItem: function handleDeleteItem(path) {
10482
+ if (this.disabled || this.readonly) return;
10462
10483
  var index = Number(Path.getPathLastProp(path));
10463
10484
  var value = JSON.parse(JSON.stringify(this.value || []));
10464
10485
  value.splice(index, 1);
@@ -10481,7 +10502,6 @@
10481
10502
  layout: _objectSpread2(_objectSpread2({}, _this.layout), {}, {
10482
10503
  item: {} // todo: 暂时不支持数组项之间的布局
10483
10504
  }),
10484
-
10485
10505
  removeable: true
10486
10506
  }),
10487
10507
  on: _objectSpread2(_objectSpread2({}, _this.$listeners), {}, {
@@ -10499,14 +10519,16 @@
10499
10519
  layout: {},
10500
10520
  showTitle: true // 数组类型默认展示分组title
10501
10521
  }),
10502
-
10503
10522
  style: _objectSpread2({}, this.layout.item || {})
10504
- }, vnode), [].concat(_toConsumableArray(arrVnodeList), [h(registry.getBaseWidget('form-item'), {
10523
+ }, vnode), [].concat(_toConsumableArray(arrVnodeList), [!this.readonly ? h(registry.getBaseWidget('form-item'), {
10505
10524
  class: {
10506
10525
  'bk-schema-form-item-auto-height': true
10507
10526
  }
10508
10527
  }, [h('span', {
10509
- class: ['bk-schema-form-group-add'],
10528
+ class: ['bk-schema-form-group-add', {
10529
+ disabled: this.disabled,
10530
+ readonly: this.readonly
10531
+ }],
10510
10532
  on: {
10511
10533
  click: function click() {
10512
10534
  self.handleAddItem();
@@ -10514,7 +10536,7 @@
10514
10536
  }
10515
10537
  }, [h('i', {
10516
10538
  class: ['bk-icon icon-plus-circle-shape mr5']
10517
- }), locale('add')])])]));
10539
+ }), locale('add')])]) : null]));
10518
10540
  }
10519
10541
  });
10520
10542
 
@@ -10925,21 +10947,21 @@
10925
10947
  var TableWidget = Vue__default["default"].extend({
10926
10948
  name: 'TableWidget',
10927
10949
  props: props,
10928
- mounted: function mounted() {
10929
- var _this = this;
10930
- this.$nextTick(function () {
10931
- var fieldMap = _this.schema.items.properties;
10932
- _this.value.forEach(function (item, index) {
10933
- Object.keys(fieldMap).forEach(function (key) {
10934
- var config = fieldMap[key];
10935
- if (config['ui:rules']) {
10936
- var instance = _this.$refs[key + index];
10937
- // 注册widget TreeNode
10938
- widgetTree.addWidgetNode("".concat(_this.path, ".").concat(key), instance, 'node');
10939
- }
10950
+ watch: {
10951
+ value: {
10952
+ immediate: true,
10953
+ handler: function handler() {
10954
+ var _this$value,
10955
+ _this = this;
10956
+ (_this$value = this.value) === null || _this$value === void 0 ? void 0 : _this$value.forEach(function (_, index) {
10957
+ var path = "".concat(_this.path, ".").concat(index);
10958
+ // 销毁上一次的缓存
10959
+ widgetTree.removeWidgetNode(path, null);
10960
+ // 重新当前行的父节点
10961
+ widgetTree.addWidgetNode(path, null, 'group');
10940
10962
  });
10941
- });
10942
- });
10963
+ }
10964
+ }
10943
10965
  },
10944
10966
  methods: {
10945
10967
  // 单元格表单编辑
@@ -10952,39 +10974,40 @@
10952
10974
  },
10953
10975
  // 新增
10954
10976
  handleAddRow: function handleAddRow(index) {
10955
- var _this$$props$schema$i;
10956
- if (this.schema['ui:props'].disabled) return;
10977
+ var _this$schema$uiProps, _this$$props$schema$i;
10978
+ if ((_this$schema$uiProps = this.schema['ui:props']) !== null && _this$schema$uiProps !== void 0 && _this$schema$uiProps.disabled) return;
10957
10979
  var newValue = this.value.slice(0);
10958
10980
  newValue.splice.apply(newValue, [index + 1, 0].concat(_toConsumableArray(getRowDefaultData((_this$$props$schema$i = this.$props.schema.items) === null || _this$$props$schema$i === void 0 ? void 0 : _this$$props$schema$i.properties))));
10959
10981
  this.$emit('input', newValue);
10960
10982
  },
10961
10983
  // 删除
10962
10984
  handleDelRow: function handleDelRow(index) {
10963
- if (this.schema['ui:props'].disabled) return;
10985
+ var _this$schema$uiProps2;
10986
+ if ((_this$schema$uiProps2 = this.schema['ui:props']) !== null && _this$schema$uiProps2 !== void 0 && _this$schema$uiProps2.disabled) return;
10964
10987
  var newValue = this.value.slice(0);
10965
10988
  newValue.splice(index, 1);
10966
10989
  this.$emit('input', newValue);
10967
10990
  }
10968
10991
  },
10969
10992
  render: function render(h) {
10970
- var _schema$items,
10971
- _this2 = this;
10993
+ var _this2 = this;
10972
10994
  var self = this;
10973
- var _this$$props = this.$props,
10974
- schema = _this$$props.schema,
10975
- readonly = _this$$props.readonly,
10976
- readonlyMode = _this$$props.readonlyMode,
10977
- path = _this$$props.path,
10978
- context = _this$$props.context,
10979
- rootData = _this$$props.rootData,
10980
- value = _this$$props.value,
10981
- disabled = _this$$props.disabled;
10982
- var columnsKey = Object.keys(((_schema$items = schema.items) === null || _schema$items === void 0 ? void 0 : _schema$items.properties) || []);
10995
+ var schema = this.schema,
10996
+ path = this.path,
10997
+ value = this.value;
10998
+ var schemaItems = schema.items;
10999
+ var properties = {};
11000
+ if (schemaItems !== null && schemaItems !== void 0 && schemaItems.properties) {
11001
+ properties = schemaItems === null || schemaItems === void 0 ? void 0 : schemaItems.properties;
11002
+ } else {
11003
+ // table类型目前只支持items的类型为对象的schema
11004
+ console.warn('The current schema type is not supported table component', schemaItems);
11005
+ }
10983
11006
  var uiOptions = Schema.getUiOptions(schema);
10984
11007
  var getTableColumn = function getTableColumn() {
10985
- var VNodeList = columnsKey.map(function (key) {
11008
+ var VNodeList = Object.keys(properties).map(function (key) {
10986
11009
  var _colField$uiProps, _colField$uiProps2;
10987
- var colField = schema.items.properties[key];
11010
+ var colField = properties[key];
10988
11011
  // 仅支持基础数据类型的属性配置,render-header、sort-method、formatter等Function类型的属性不属于json支持的数据类型,配置将不会生效
10989
11012
  var colProps = ((_colField$uiProps = colField['ui:props']) === null || _colField$uiProps === void 0 ? void 0 : _colField$uiProps.tableColumnProps) || {};
10990
11013
  // 内置表头部分需要显示tooltips的场景, tableHeaderTips的属性将会透传给v-bk-tooltips指令
@@ -11006,21 +11029,13 @@
11006
11029
  }
11007
11030
  return h(registry.getBaseWidget('table-column'), {
11008
11031
  props: _objectSpread2({
11009
- label: colField.title,
11010
- minWidth: colField.minWidth,
11011
- width: colField.width
11032
+ label: colField.title
11012
11033
  }, colProps),
11013
11034
  scopedSlots: {
11014
11035
  default: function _default(props) {
11015
11036
  return h(SchemaField, {
11016
- ref: key + props.$index,
11017
- props: {
11018
- context: context,
11019
- rootData: rootData,
11020
- readonly: readonly,
11021
- readonlyMode: readonlyMode,
11022
- disabled: disabled,
11023
- schema: mergeDeep(colField, {
11037
+ props: _objectSpread2(_objectSpread2({}, _this2.$props), {}, {
11038
+ schema: mergeDeep({}, colField, {
11024
11039
  'ui:props': {
11025
11040
  // 默认不展示标题
11026
11041
  showTitle: false,
@@ -11030,7 +11045,7 @@
11030
11045
  }),
11031
11046
  path: Path.getCurPath(path, "".concat(props.$index, ".").concat(key)),
11032
11047
  value: props.row[key]
11033
- },
11048
+ }),
11034
11049
  on: {
11035
11050
  input: function input(data) {
11036
11051
  self.handleCellValChange(data);
@@ -11050,10 +11065,11 @@
11050
11065
  },
11051
11066
  scopedSlots: {
11052
11067
  default: function _default(props) {
11068
+ var _schema$uiProps;
11053
11069
  return h('div', {
11054
11070
  class: {
11055
11071
  'table-widget-actions': true,
11056
- 'is-disabled': schema['ui:props'].disabled
11072
+ 'is-disabled': (_schema$uiProps = schema['ui:props']) === null || _schema$uiProps === void 0 ? void 0 : _schema$uiProps.disabled
11057
11073
  }
11058
11074
  }, [h('i', {
11059
11075
  class: 'bk-icon icon-plus-circle action-btn',
@@ -11180,9 +11196,9 @@
11180
11196
  render: function render(h) {
11181
11197
  var _this$layout,
11182
11198
  _this$layout2,
11199
+ _this = this,
11183
11200
  _this$schema,
11184
- _this$layout3,
11185
- _this = this;
11201
+ _this$layout3;
11186
11202
  var schemaFormStyle = _objectSpread2({
11187
11203
  position: 'relative',
11188
11204
  border: this.border ? '1px solid #dcdee5' : 'none',
@@ -11192,11 +11208,13 @@
11192
11208
  display: 'grid',
11193
11209
  gridGap: '20px' // 未设置layout的布局组的默认样式
11194
11210
  });
11195
-
11196
11211
  var self = this;
11197
11212
  var renderDelete = function renderDelete() {
11198
11213
  return h('span', {
11199
- class: ['bk-schema-form-group-delete'],
11214
+ class: ['bk-schema-form-group-delete', {
11215
+ disabled: _this.disabled,
11216
+ readonly: _this.readonly
11217
+ }],
11200
11218
  style: {
11201
11219
  right: '10px',
11202
11220
  top: '10px'
@@ -11231,7 +11249,7 @@
11231
11249
  }, [groupErrorTipsContent])]) : null]) : null, h("div", {
11232
11250
  "style": groupContentStyle,
11233
11251
  "class": "bk-schema-form-group-content"
11234
- }, [this.$slots.default]), this.removeable && renderDelete()]);
11252
+ }, [this.$slots.default]), this.removeable && !this.readonly && renderDelete()]);
11235
11253
  }
11236
11254
  });
11237
11255
 
@@ -11254,12 +11272,12 @@
11254
11272
  },
11255
11273
  methods: {
11256
11274
  handleAddItem: function handleAddItem() {
11257
- if (this.disabled) return;
11275
+ if (this.disabled || this.readonly) return;
11258
11276
  var data = Schema.getSchemaDefaultValue(this.schema.items);
11259
11277
  this.$emit('input', [].concat(_toConsumableArray(this.value), [data]));
11260
11278
  },
11261
11279
  handleRemoveItem: function handleRemoveItem(index) {
11262
- if (this.disabled) return;
11280
+ if (this.disabled || this.readonly) return;
11263
11281
  var value = JSON.parse(JSON.stringify(this.value));
11264
11282
  value.splice(index, 1);
11265
11283
  this.$emit('input', value);
@@ -11282,7 +11300,7 @@
11282
11300
  _this$value2;
11283
11301
  var labelBtnStyle = {
11284
11302
  'font-size': '16px',
11285
- color: '#979ba5',
11303
+ color: this.disabled ? '#c4c6cc' : '#979ba5',
11286
11304
  cursor: this.disabled ? 'not-allowed' : 'pointer',
11287
11305
  display: 'inline-block'
11288
11306
  };
@@ -11296,7 +11314,6 @@
11296
11314
  gridGap: '20px',
11297
11315
  'grid-template-columns': defaultCols // 默认配置
11298
11316
  });
11299
-
11300
11317
  var self = this;
11301
11318
  var dealSchema = function dealSchema(schema) {
11302
11319
  return (
@@ -11419,7 +11436,6 @@
11419
11436
  layout: _objectSpread2(_objectSpread2({}, this.layout), {}, {
11420
11437
  container: {} // Tab组的容器layout由panel内容控制
11421
11438
  }),
11422
-
11423
11439
  title: this.schema.title
11424
11440
  });
11425
11441
  var self = this;
@@ -11452,7 +11468,6 @@
11452
11468
  layout: layoutConfig,
11453
11469
  removeable: false // todo: 不往下传递可删除属性
11454
11470
  }),
11455
-
11456
11471
  on: _objectSpread2({}, _this.$listeners)
11457
11472
  })]);
11458
11473
  }))]);
@@ -11464,10 +11479,7 @@
11464
11479
  props: _objectSpread2(_objectSpread2({}, props), {}, {
11465
11480
  type: {
11466
11481
  type: String,
11467
- default: 'default',
11468
- validator: function validator(value) {
11469
- return ['default', 'normal', 'card'].includes(value);
11470
- }
11482
+ default: 'default' // 'default', 'normal', 'card'
11471
11483
  },
11472
11484
  showTitle: {
11473
11485
  type: Boolean,
@@ -11486,6 +11498,10 @@
11486
11498
  verifiable: {
11487
11499
  type: Boolean,
11488
11500
  default: false
11501
+ },
11502
+ collapseStyle: {
11503
+ type: String,
11504
+ default: 'normal' // normal: 修改后的样式参看BCS,default: 组件样式
11489
11505
  }
11490
11506
  }),
11491
11507
  data: function data() {
@@ -11496,7 +11512,6 @@
11496
11512
  render: function render(h) {
11497
11513
  var _this$schema,
11498
11514
  _this = this;
11499
- var collapseStyle = {};
11500
11515
  var collapseTitleStyle = {
11501
11516
  background: '#f5f7fa',
11502
11517
  'border-radius': '2px',
@@ -11514,7 +11529,6 @@
11514
11529
  layout: _objectSpread2(_objectSpread2({}, this.layout), {}, {
11515
11530
  container: {} // Tab组的容器layout由panel内容控制
11516
11531
  }),
11517
-
11518
11532
  title: this.schema.title
11519
11533
  });
11520
11534
  var properties = orderProperties(Object.keys(((_this$schema = this.schema) === null || _this$schema === void 0 ? void 0 : _this$schema.properties) || {}), this.schema['ui:order']);
@@ -11530,9 +11544,9 @@
11530
11544
  hideArrow: true,
11531
11545
  name: key
11532
11546
  },
11533
- class: ['mb15']
11547
+ class: _this.collapseStyle === 'normal' ? ['mb15'] : []
11534
11548
  }, [h('div', {
11535
- style: collapseTitleStyle
11549
+ style: _this.collapseStyle === 'normal' ? collapseTitleStyle : {}
11536
11550
  }, [h('i', {
11537
11551
  class: ['bk-icon icon-down-shape mr5'],
11538
11552
  style: _objectSpread2(_objectSpread2({}, collapseIconStyle), {}, {
@@ -11549,7 +11563,6 @@
11549
11563
  layout: layoutConfig,
11550
11564
  removeable: false // todo: 不往下传递可删除属性
11551
11565
  }),
11552
-
11553
11566
  on: _objectSpread2({}, _this.$listeners)
11554
11567
  })])]);
11555
11568
  });
@@ -11557,7 +11570,7 @@
11557
11570
  return h(FieldGroupWrap, {
11558
11571
  props: _objectSpread2({}, groupWrapProps)
11559
11572
  }, [h(registry.getBaseWidget('collapse'), {
11560
- style: collapseStyle,
11573
+ class: this.collapseStyle,
11561
11574
  props: {
11562
11575
  value: this.activeName
11563
11576
  },
@@ -11768,8 +11781,11 @@
11768
11781
  registryGlobalRules(value);
11769
11782
  }
11770
11783
  },
11771
- value: function value() {
11772
- this.initFormData();
11784
+ value: {
11785
+ handler: function handler() {
11786
+ this.initFormData();
11787
+ },
11788
+ deep: true
11773
11789
  }
11774
11790
  },
11775
11791
  beforeCreate: function beforeCreate() {