@blueking/bkui-form 0.0.41-beta.1 → 0.0.42-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bkui-form-es-min.js +6 -6
- package/dist/bkui-form-es.js +565 -619
- package/dist/bkui-form-es.js.map +1 -1
- package/dist/bkui-form-umd-min.js +6 -6
- package/dist/bkui-form-umd.js +565 -619
- package/dist/bkui-form-umd.js.map +1 -1
- package/package.json +6 -6
package/dist/bkui-form-umd.js
CHANGED
|
@@ -8,572 +8,537 @@
|
|
|
8
8
|
|
|
9
9
|
var Vue__default = /*#__PURE__*/_interopDefaultLegacy(Vue);
|
|
10
10
|
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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 (
|
|
23
|
-
if (Object(
|
|
24
|
-
|
|
25
|
-
} else for (; !(
|
|
26
|
-
} catch (
|
|
27
|
-
|
|
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 (!
|
|
148
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
31
149
|
} finally {
|
|
32
|
-
if (
|
|
150
|
+
if (o) throw n;
|
|
33
151
|
}
|
|
34
152
|
}
|
|
35
|
-
return
|
|
153
|
+
return a;
|
|
36
154
|
}
|
|
37
155
|
}
|
|
38
|
-
function
|
|
39
|
-
|
|
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
|
|
42
|
-
|
|
43
|
-
return Object.getOwnPropertyDescriptor(
|
|
44
|
-
})),
|
|
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
|
|
47
|
-
}
|
|
48
|
-
function _objectSpread2(
|
|
49
|
-
for (var
|
|
50
|
-
var
|
|
51
|
-
|
|
52
|
-
_defineProperty(
|
|
53
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(
|
|
54
|
-
Object.defineProperty(
|
|
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
|
|
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
|
|
208
|
+
return e;
|
|
62
209
|
};
|
|
63
|
-
var
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
function define(
|
|
74
|
-
return Object.defineProperty(
|
|
75
|
-
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
|
-
}),
|
|
227
|
+
}), t[e];
|
|
80
228
|
}
|
|
81
229
|
try {
|
|
82
230
|
define({}, "");
|
|
83
|
-
} catch (
|
|
84
|
-
define = function (
|
|
85
|
-
return
|
|
231
|
+
} catch (t) {
|
|
232
|
+
define = function (t, e, r) {
|
|
233
|
+
return t[e] = r;
|
|
86
234
|
};
|
|
87
235
|
}
|
|
88
|
-
function wrap(
|
|
89
|
-
var
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return
|
|
93
|
-
value: makeInvokeMethod(
|
|
94
|
-
}),
|
|
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(
|
|
244
|
+
function tryCatch(t, e, r) {
|
|
97
245
|
try {
|
|
98
246
|
return {
|
|
99
247
|
type: "normal",
|
|
100
|
-
arg:
|
|
248
|
+
arg: t.call(e, r)
|
|
101
249
|
};
|
|
102
|
-
} catch (
|
|
250
|
+
} catch (t) {
|
|
103
251
|
return {
|
|
104
252
|
type: "throw",
|
|
105
|
-
arg:
|
|
253
|
+
arg: t
|
|
106
254
|
};
|
|
107
255
|
}
|
|
108
256
|
}
|
|
109
|
-
|
|
110
|
-
var
|
|
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
|
|
115
|
-
define(
|
|
266
|
+
var p = {};
|
|
267
|
+
define(p, a, function () {
|
|
116
268
|
return this;
|
|
117
269
|
});
|
|
118
|
-
var
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
var
|
|
122
|
-
function defineIteratorMethods(
|
|
123
|
-
["next", "throw", "return"].forEach(function (
|
|
124
|
-
define(
|
|
125
|
-
return this._invoke(
|
|
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(
|
|
130
|
-
function invoke(
|
|
131
|
-
var
|
|
132
|
-
if ("throw" !==
|
|
133
|
-
var
|
|
134
|
-
|
|
135
|
-
return
|
|
136
|
-
invoke("next",
|
|
137
|
-
}, function (
|
|
138
|
-
invoke("throw",
|
|
139
|
-
}) :
|
|
140
|
-
|
|
141
|
-
}, function (
|
|
142
|
-
return invoke("throw",
|
|
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
|
-
|
|
297
|
+
a(c.arg);
|
|
146
298
|
}
|
|
147
|
-
var
|
|
148
|
-
|
|
149
|
-
value: function (
|
|
299
|
+
var r;
|
|
300
|
+
o(this, "_invoke", {
|
|
301
|
+
value: function (t, n) {
|
|
150
302
|
function callInvokeWithMethodAndArg() {
|
|
151
|
-
return new
|
|
152
|
-
invoke(
|
|
303
|
+
return new e(function (e, r) {
|
|
304
|
+
invoke(t, n, e, r);
|
|
153
305
|
});
|
|
154
306
|
}
|
|
155
|
-
return
|
|
307
|
+
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
156
308
|
}
|
|
157
309
|
});
|
|
158
310
|
}
|
|
159
|
-
function makeInvokeMethod(
|
|
160
|
-
var
|
|
161
|
-
return function (
|
|
162
|
-
if (
|
|
163
|
-
if (
|
|
164
|
-
if ("throw" ===
|
|
165
|
-
return
|
|
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 (
|
|
168
|
-
var
|
|
169
|
-
if (
|
|
170
|
-
var
|
|
171
|
-
if (
|
|
172
|
-
if (
|
|
173
|
-
return
|
|
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" ===
|
|
177
|
-
if (
|
|
178
|
-
|
|
179
|
-
} else "return" ===
|
|
180
|
-
|
|
181
|
-
var
|
|
182
|
-
if ("normal" ===
|
|
183
|
-
if (
|
|
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:
|
|
186
|
-
done:
|
|
340
|
+
value: p.arg,
|
|
341
|
+
done: n.done
|
|
187
342
|
};
|
|
188
343
|
}
|
|
189
|
-
"throw" ===
|
|
344
|
+
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
190
345
|
}
|
|
191
346
|
};
|
|
192
347
|
}
|
|
193
|
-
function maybeInvokeDelegate(
|
|
194
|
-
var
|
|
195
|
-
|
|
196
|
-
if (
|
|
197
|
-
var
|
|
198
|
-
if ("throw" ===
|
|
199
|
-
var
|
|
200
|
-
return
|
|
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(
|
|
203
|
-
var
|
|
204
|
-
tryLoc:
|
|
357
|
+
function pushTryEntry(t) {
|
|
358
|
+
var e = {
|
|
359
|
+
tryLoc: t[0]
|
|
205
360
|
};
|
|
206
|
-
1 in
|
|
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(
|
|
209
|
-
var
|
|
210
|
-
|
|
363
|
+
function resetTryEntry(t) {
|
|
364
|
+
var e = t.completion || {};
|
|
365
|
+
e.type = "normal", delete e.arg, t.completion = e;
|
|
211
366
|
}
|
|
212
|
-
function Context(
|
|
367
|
+
function Context(t) {
|
|
213
368
|
this.tryEntries = [{
|
|
214
369
|
tryLoc: "root"
|
|
215
|
-
}],
|
|
370
|
+
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
216
371
|
}
|
|
217
|
-
function values(
|
|
218
|
-
if (
|
|
219
|
-
var
|
|
220
|
-
if (
|
|
221
|
-
if ("function" == typeof
|
|
222
|
-
if (!isNaN(
|
|
223
|
-
var
|
|
224
|
-
|
|
225
|
-
for (; ++
|
|
226
|
-
return next.value =
|
|
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
|
|
383
|
+
return i.next = i;
|
|
229
384
|
}
|
|
230
385
|
}
|
|
231
|
-
|
|
232
|
-
next: doneResult
|
|
233
|
-
};
|
|
386
|
+
throw new TypeError(typeof e + " is not iterable");
|
|
234
387
|
}
|
|
235
|
-
|
|
236
|
-
return {
|
|
237
|
-
value: undefined,
|
|
238
|
-
done: !0
|
|
239
|
-
};
|
|
240
|
-
}
|
|
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
|
-
}),
|
|
391
|
+
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
245
392
|
value: GeneratorFunction,
|
|
246
393
|
configurable: !0
|
|
247
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype,
|
|
248
|
-
var
|
|
249
|
-
return !!
|
|
250
|
-
},
|
|
251
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(
|
|
252
|
-
},
|
|
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:
|
|
401
|
+
__await: t
|
|
255
402
|
};
|
|
256
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype,
|
|
403
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
257
404
|
return this;
|
|
258
|
-
}),
|
|
259
|
-
void 0 ===
|
|
260
|
-
var
|
|
261
|
-
return
|
|
262
|
-
return
|
|
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(
|
|
411
|
+
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
265
412
|
return this;
|
|
266
|
-
}), define(
|
|
413
|
+
}), define(g, "toString", function () {
|
|
267
414
|
return "[object Generator]";
|
|
268
|
-
}),
|
|
269
|
-
var
|
|
270
|
-
|
|
271
|
-
for (var
|
|
272
|
-
return
|
|
273
|
-
for (;
|
|
274
|
-
var
|
|
275
|
-
if (
|
|
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
|
-
},
|
|
426
|
+
}, e.values = values, Context.prototype = {
|
|
280
427
|
constructor: Context,
|
|
281
|
-
reset: function (
|
|
282
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent =
|
|
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
|
|
287
|
-
if ("throw" ===
|
|
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 (
|
|
291
|
-
if (this.done) throw
|
|
292
|
-
var
|
|
293
|
-
function handle(
|
|
294
|
-
return
|
|
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
|
|
297
|
-
var
|
|
298
|
-
|
|
299
|
-
if ("root" ===
|
|
300
|
-
if (
|
|
301
|
-
var
|
|
302
|
-
|
|
303
|
-
if (
|
|
304
|
-
if (this.prev <
|
|
305
|
-
if (this.prev <
|
|
306
|
-
} else if (
|
|
307
|
-
if (this.prev <
|
|
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 (!
|
|
310
|
-
if (this.prev <
|
|
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 (
|
|
316
|
-
for (var
|
|
317
|
-
var
|
|
318
|
-
if (
|
|
319
|
-
var
|
|
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
|
-
|
|
324
|
-
var
|
|
325
|
-
return
|
|
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 (
|
|
328
|
-
if ("throw" ===
|
|
329
|
-
return "break" ===
|
|
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 (
|
|
332
|
-
for (var
|
|
333
|
-
var
|
|
334
|
-
if (
|
|
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 (
|
|
338
|
-
for (var
|
|
339
|
-
var
|
|
340
|
-
if (
|
|
341
|
-
var
|
|
342
|
-
if ("throw" ===
|
|
343
|
-
var
|
|
344
|
-
resetTryEntry(
|
|
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
|
|
493
|
+
return o;
|
|
347
494
|
}
|
|
348
495
|
}
|
|
349
|
-
throw
|
|
496
|
+
throw Error("illegal catch attempt");
|
|
350
497
|
},
|
|
351
|
-
delegateYield: function (
|
|
498
|
+
delegateYield: function (e, r, n) {
|
|
352
499
|
return this.delegate = {
|
|
353
|
-
iterator: values(
|
|
354
|
-
resultName:
|
|
355
|
-
nextLoc:
|
|
356
|
-
}, "next" === this.method && (this.arg =
|
|
500
|
+
iterator: values(e),
|
|
501
|
+
resultName: r,
|
|
502
|
+
nextLoc: n
|
|
503
|
+
}, "next" === this.method && (this.arg = t), y;
|
|
357
504
|
}
|
|
358
|
-
},
|
|
505
|
+
}, e;
|
|
359
506
|
}
|
|
360
|
-
function
|
|
361
|
-
|
|
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);
|
|
507
|
+
function _slicedToArray(r, e) {
|
|
508
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
368
509
|
}
|
|
369
|
-
function
|
|
370
|
-
|
|
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
|
-
};
|
|
510
|
+
function _toConsumableArray(r) {
|
|
511
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
398
512
|
}
|
|
399
|
-
function
|
|
400
|
-
if (
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
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;
|
|
434
|
-
}
|
|
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;
|
|
463
|
-
}
|
|
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
|
|
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);
|
|
521
|
+
return ("string" === r ? String : Number)(t);
|
|
487
522
|
}
|
|
488
|
-
function
|
|
489
|
-
|
|
523
|
+
function _toPropertyKey(t) {
|
|
524
|
+
var i = _toPrimitive(t, "string");
|
|
525
|
+
return "symbol" == typeof i ? i : i + "";
|
|
490
526
|
}
|
|
491
|
-
function
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
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;
|
|
@@ -830,7 +794,7 @@
|
|
|
830
794
|
// 每种Schema type对于的处理器
|
|
831
795
|
this.fields = new Map();
|
|
832
796
|
}
|
|
833
|
-
_createClass(Registry, [{
|
|
797
|
+
return _createClass(Registry, [{
|
|
834
798
|
key: "addComponentsMap",
|
|
835
799
|
value: function addComponentsMap() {
|
|
836
800
|
var coms = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -887,7 +851,6 @@
|
|
|
887
851
|
});
|
|
888
852
|
}
|
|
889
853
|
}]);
|
|
890
|
-
return Registry;
|
|
891
854
|
}();
|
|
892
855
|
// 全局命名空间
|
|
893
856
|
Registry.namespace = 'bk';
|
|
@@ -902,7 +865,7 @@
|
|
|
902
865
|
_classCallCheck(this, Schema);
|
|
903
866
|
Schema.rootSchema = rootSchema;
|
|
904
867
|
}
|
|
905
|
-
_createClass(Schema, null, [{
|
|
868
|
+
return _createClass(Schema, null, [{
|
|
906
869
|
key: "resolveRef",
|
|
907
870
|
value: function resolveRef() {}
|
|
908
871
|
}, {
|
|
@@ -1169,7 +1132,6 @@
|
|
|
1169
1132
|
}
|
|
1170
1133
|
}
|
|
1171
1134
|
}]);
|
|
1172
|
-
return Schema;
|
|
1173
1135
|
}();
|
|
1174
1136
|
Schema.rootSchema = void 0;
|
|
1175
1137
|
|
|
@@ -1188,7 +1150,7 @@
|
|
|
1188
1150
|
this.layout = this.parseLayout(layout);
|
|
1189
1151
|
}
|
|
1190
1152
|
}
|
|
1191
|
-
_createClass(Layout, [{
|
|
1153
|
+
return _createClass(Layout, [{
|
|
1192
1154
|
key: "transformValueToPixel",
|
|
1193
1155
|
value: function transformValueToPixel(value) {
|
|
1194
1156
|
if (typeof value === 'number') {
|
|
@@ -1319,7 +1281,6 @@
|
|
|
1319
1281
|
return layoutConfig;
|
|
1320
1282
|
}
|
|
1321
1283
|
}]);
|
|
1322
|
-
return Layout;
|
|
1323
1284
|
}();
|
|
1324
1285
|
|
|
1325
1286
|
function createProxy(schema, context) {
|
|
@@ -1337,7 +1298,7 @@
|
|
|
1337
1298
|
function Path() {
|
|
1338
1299
|
_classCallCheck(this, Path);
|
|
1339
1300
|
}
|
|
1340
|
-
_createClass(Path, null, [{
|
|
1301
|
+
return _createClass(Path, null, [{
|
|
1341
1302
|
key: "getCurPath",
|
|
1342
1303
|
value: function getCurPath(parent, current) {
|
|
1343
1304
|
return parent === '' ? current : [parent, current].join(this.separator);
|
|
@@ -1391,11 +1352,9 @@
|
|
|
1391
1352
|
if (arrPath.length <= 1) {
|
|
1392
1353
|
return ''; // root path
|
|
1393
1354
|
}
|
|
1394
|
-
|
|
1395
1355
|
return arrPath.slice(0, arrPath.length - 1).join(this.separator);
|
|
1396
1356
|
}
|
|
1397
1357
|
}]);
|
|
1398
|
-
return Path;
|
|
1399
1358
|
}();
|
|
1400
1359
|
Path.separator = '.';
|
|
1401
1360
|
|
|
@@ -1408,7 +1367,7 @@
|
|
|
1408
1367
|
headers: {},
|
|
1409
1368
|
cache: 'no-cache'
|
|
1410
1369
|
};
|
|
1411
|
-
var request = /*#__PURE__*/(function () {
|
|
1370
|
+
var request = ( /*#__PURE__*/(function () {
|
|
1412
1371
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(url) {
|
|
1413
1372
|
var config,
|
|
1414
1373
|
_mergeDeep,
|
|
@@ -1518,7 +1477,7 @@
|
|
|
1518
1477
|
return function (_x) {
|
|
1519
1478
|
return _ref.apply(this, arguments);
|
|
1520
1479
|
};
|
|
1521
|
-
})();
|
|
1480
|
+
})());
|
|
1522
1481
|
|
|
1523
1482
|
var props$1 = {
|
|
1524
1483
|
// 表单值
|
|
@@ -1580,7 +1539,6 @@
|
|
|
1580
1539
|
};
|
|
1581
1540
|
}
|
|
1582
1541
|
},
|
|
1583
|
-
|
|
1584
1542
|
readonly: {
|
|
1585
1543
|
type: Boolean,
|
|
1586
1544
|
default: false
|
|
@@ -1663,7 +1621,6 @@
|
|
|
1663
1621
|
};
|
|
1664
1622
|
}
|
|
1665
1623
|
},
|
|
1666
|
-
|
|
1667
1624
|
visible: {
|
|
1668
1625
|
type: Boolean,
|
|
1669
1626
|
default: true
|
|
@@ -1814,7 +1771,7 @@
|
|
|
1814
1771
|
this.children = children;
|
|
1815
1772
|
}
|
|
1816
1773
|
// 当前node的值
|
|
1817
|
-
_createClass(WidgetNode, [{
|
|
1774
|
+
return _createClass(WidgetNode, [{
|
|
1818
1775
|
key: "value",
|
|
1819
1776
|
get: function get() {
|
|
1820
1777
|
var _this$instance;
|
|
@@ -1914,14 +1871,13 @@
|
|
|
1914
1871
|
return nodes;
|
|
1915
1872
|
}
|
|
1916
1873
|
}]);
|
|
1917
|
-
return WidgetNode;
|
|
1918
1874
|
}();
|
|
1919
1875
|
var WidgetTree = /*#__PURE__*/function () {
|
|
1920
1876
|
function WidgetTree() {
|
|
1921
1877
|
_classCallCheck(this, WidgetTree);
|
|
1922
1878
|
this.widgetMap = {};
|
|
1923
1879
|
}
|
|
1924
|
-
_createClass(WidgetTree, [{
|
|
1880
|
+
return _createClass(WidgetTree, [{
|
|
1925
1881
|
key: "addWidgetNode",
|
|
1926
1882
|
value: function addWidgetNode(path, instance, type, index) {
|
|
1927
1883
|
if (path === '') {
|
|
@@ -1978,7 +1934,6 @@
|
|
|
1978
1934
|
}
|
|
1979
1935
|
}
|
|
1980
1936
|
}]);
|
|
1981
|
-
return WidgetTree;
|
|
1982
1937
|
}();
|
|
1983
1938
|
var widgetTree = new WidgetTree();
|
|
1984
1939
|
|
|
@@ -2299,7 +2254,7 @@
|
|
|
2299
2254
|
(function (UsedValueState) {
|
|
2300
2255
|
UsedValueState[UsedValueState["Started"] = 0] = "Started";
|
|
2301
2256
|
UsedValueState[UsedValueState["Completed"] = 1] = "Completed";
|
|
2302
|
-
})(UsedValueState
|
|
2257
|
+
})(UsedValueState || (exports.UsedValueState = UsedValueState = {}));
|
|
2303
2258
|
exports.varKinds = {
|
|
2304
2259
|
const: new code_1.Name("const"),
|
|
2305
2260
|
let: new code_1.Name("let"),
|
|
@@ -3131,11 +3086,10 @@
|
|
|
3131
3086
|
|
|
3132
3087
|
var util = {};
|
|
3133
3088
|
|
|
3134
|
-
(
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
const
|
|
3138
|
-
const code_1 = code$1;
|
|
3089
|
+
Object.defineProperty(util, "__esModule", { value: true });
|
|
3090
|
+
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;
|
|
3091
|
+
const codegen_1$v = codegen;
|
|
3092
|
+
const code_1$a = code$1;
|
|
3139
3093
|
// TODO refactor to use Set
|
|
3140
3094
|
function toHash(arr) {
|
|
3141
3095
|
const hash = {};
|
|
@@ -3143,7 +3097,7 @@
|
|
|
3143
3097
|
hash[item] = true;
|
|
3144
3098
|
return hash;
|
|
3145
3099
|
}
|
|
3146
|
-
|
|
3100
|
+
util.toHash = toHash;
|
|
3147
3101
|
function alwaysValidSchema(it, schema) {
|
|
3148
3102
|
if (typeof schema == "boolean")
|
|
3149
3103
|
return schema;
|
|
@@ -3152,7 +3106,7 @@
|
|
|
3152
3106
|
checkUnknownRules(it, schema);
|
|
3153
3107
|
return !schemaHasRules(schema, it.self.RULES.all);
|
|
3154
3108
|
}
|
|
3155
|
-
|
|
3109
|
+
util.alwaysValidSchema = alwaysValidSchema;
|
|
3156
3110
|
function checkUnknownRules(it, schema = it.schema) {
|
|
3157
3111
|
const { opts, self } = it;
|
|
3158
3112
|
if (!opts.strictSchema)
|
|
@@ -3165,7 +3119,7 @@
|
|
|
3165
3119
|
checkStrictMode(it, `unknown keyword: "${key}"`);
|
|
3166
3120
|
}
|
|
3167
3121
|
}
|
|
3168
|
-
|
|
3122
|
+
util.checkUnknownRules = checkUnknownRules;
|
|
3169
3123
|
function schemaHasRules(schema, rules) {
|
|
3170
3124
|
if (typeof schema == "boolean")
|
|
3171
3125
|
return !schema;
|
|
@@ -3174,7 +3128,7 @@
|
|
|
3174
3128
|
return true;
|
|
3175
3129
|
return false;
|
|
3176
3130
|
}
|
|
3177
|
-
|
|
3131
|
+
util.schemaHasRules = schemaHasRules;
|
|
3178
3132
|
function schemaHasRulesButRef(schema, RULES) {
|
|
3179
3133
|
if (typeof schema == "boolean")
|
|
3180
3134
|
return !schema;
|
|
@@ -3183,35 +3137,35 @@
|
|
|
3183
3137
|
return true;
|
|
3184
3138
|
return false;
|
|
3185
3139
|
}
|
|
3186
|
-
|
|
3140
|
+
util.schemaHasRulesButRef = schemaHasRulesButRef;
|
|
3187
3141
|
function schemaRefOrVal({ topSchemaRef, schemaPath }, schema, keyword, $data) {
|
|
3188
3142
|
if (!$data) {
|
|
3189
3143
|
if (typeof schema == "number" || typeof schema == "boolean")
|
|
3190
3144
|
return schema;
|
|
3191
3145
|
if (typeof schema == "string")
|
|
3192
|
-
return (0, codegen_1._) `${schema}`;
|
|
3146
|
+
return (0, codegen_1$v._) `${schema}`;
|
|
3193
3147
|
}
|
|
3194
|
-
return (0, codegen_1._) `${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`;
|
|
3148
|
+
return (0, codegen_1$v._) `${topSchemaRef}${schemaPath}${(0, codegen_1$v.getProperty)(keyword)}`;
|
|
3195
3149
|
}
|
|
3196
|
-
|
|
3150
|
+
util.schemaRefOrVal = schemaRefOrVal;
|
|
3197
3151
|
function unescapeFragment(str) {
|
|
3198
3152
|
return unescapeJsonPointer(decodeURIComponent(str));
|
|
3199
3153
|
}
|
|
3200
|
-
|
|
3154
|
+
util.unescapeFragment = unescapeFragment;
|
|
3201
3155
|
function escapeFragment(str) {
|
|
3202
3156
|
return encodeURIComponent(escapeJsonPointer(str));
|
|
3203
3157
|
}
|
|
3204
|
-
|
|
3158
|
+
util.escapeFragment = escapeFragment;
|
|
3205
3159
|
function escapeJsonPointer(str) {
|
|
3206
3160
|
if (typeof str == "number")
|
|
3207
3161
|
return `${str}`;
|
|
3208
3162
|
return str.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
3209
3163
|
}
|
|
3210
|
-
|
|
3164
|
+
util.escapeJsonPointer = escapeJsonPointer;
|
|
3211
3165
|
function unescapeJsonPointer(str) {
|
|
3212
3166
|
return str.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
3213
3167
|
}
|
|
3214
|
-
|
|
3168
|
+
util.unescapeJsonPointer = unescapeJsonPointer;
|
|
3215
3169
|
function eachItem(xs, f) {
|
|
3216
3170
|
if (Array.isArray(xs)) {
|
|
3217
3171
|
for (const x of xs)
|
|
@@ -3221,30 +3175,30 @@
|
|
|
3221
3175
|
f(xs);
|
|
3222
3176
|
}
|
|
3223
3177
|
}
|
|
3224
|
-
|
|
3178
|
+
util.eachItem = eachItem;
|
|
3225
3179
|
function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues, resultToName, }) {
|
|
3226
3180
|
return (gen, from, to, toName) => {
|
|
3227
3181
|
const res = to === undefined
|
|
3228
3182
|
? 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
|
|
3183
|
+
: to instanceof codegen_1$v.Name
|
|
3184
|
+
? (from instanceof codegen_1$v.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to)
|
|
3185
|
+
: from instanceof codegen_1$v.Name
|
|
3232
3186
|
? (mergeToName(gen, to, from), from)
|
|
3233
3187
|
: mergeValues(from, to);
|
|
3234
|
-
return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res;
|
|
3188
|
+
return toName === codegen_1$v.Name && !(res instanceof codegen_1$v.Name) ? resultToName(gen, res) : res;
|
|
3235
3189
|
};
|
|
3236
3190
|
}
|
|
3237
|
-
|
|
3191
|
+
util.mergeEvaluated = {
|
|
3238
3192
|
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})`));
|
|
3193
|
+
mergeNames: (gen, from, to) => gen.if((0, codegen_1$v._) `${to} !== true && ${from} !== undefined`, () => {
|
|
3194
|
+
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
3195
|
}),
|
|
3242
|
-
mergeToName: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true`, () => {
|
|
3196
|
+
mergeToName: (gen, from, to) => gen.if((0, codegen_1$v._) `${to} !== true`, () => {
|
|
3243
3197
|
if (from === true) {
|
|
3244
3198
|
gen.assign(to, true);
|
|
3245
3199
|
}
|
|
3246
3200
|
else {
|
|
3247
|
-
gen.assign(to, (0, codegen_1._) `${to} || {}`);
|
|
3201
|
+
gen.assign(to, (0, codegen_1$v._) `${to} || {}`);
|
|
3248
3202
|
setEvaluated(gen, to, from);
|
|
3249
3203
|
}
|
|
3250
3204
|
}),
|
|
@@ -3252,8 +3206,8 @@
|
|
|
3252
3206
|
resultToName: evaluatedPropsToName,
|
|
3253
3207
|
}),
|
|
3254
3208
|
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}`)),
|
|
3209
|
+
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}`)),
|
|
3210
|
+
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
3211
|
mergeValues: (from, to) => (from === true ? true : Math.max(from, to)),
|
|
3258
3212
|
resultToName: (gen, items) => gen.var("items", items),
|
|
3259
3213
|
}),
|
|
@@ -3261,44 +3215,44 @@
|
|
|
3261
3215
|
function evaluatedPropsToName(gen, ps) {
|
|
3262
3216
|
if (ps === true)
|
|
3263
3217
|
return gen.var("props", true);
|
|
3264
|
-
const props = gen.var("props", (0, codegen_1._) `{}`);
|
|
3218
|
+
const props = gen.var("props", (0, codegen_1$v._) `{}`);
|
|
3265
3219
|
if (ps !== undefined)
|
|
3266
3220
|
setEvaluated(gen, props, ps);
|
|
3267
3221
|
return props;
|
|
3268
3222
|
}
|
|
3269
|
-
|
|
3223
|
+
util.evaluatedPropsToName = evaluatedPropsToName;
|
|
3270
3224
|
function setEvaluated(gen, props, ps) {
|
|
3271
|
-
Object.keys(ps).forEach((p) => gen.assign((0, codegen_1._) `${props}${(0, codegen_1.getProperty)(p)}`, true));
|
|
3225
|
+
Object.keys(ps).forEach((p) => gen.assign((0, codegen_1$v._) `${props}${(0, codegen_1$v.getProperty)(p)}`, true));
|
|
3272
3226
|
}
|
|
3273
|
-
|
|
3227
|
+
util.setEvaluated = setEvaluated;
|
|
3274
3228
|
const snippets = {};
|
|
3275
3229
|
function useFunc(gen, f) {
|
|
3276
3230
|
return gen.scopeValue("func", {
|
|
3277
3231
|
ref: f,
|
|
3278
|
-
code: snippets[f.code] || (snippets[f.code] = new code_1._Code(f.code)),
|
|
3232
|
+
code: snippets[f.code] || (snippets[f.code] = new code_1$a._Code(f.code)),
|
|
3279
3233
|
});
|
|
3280
3234
|
}
|
|
3281
|
-
|
|
3235
|
+
util.useFunc = useFunc;
|
|
3282
3236
|
var Type;
|
|
3283
3237
|
(function (Type) {
|
|
3284
3238
|
Type[Type["Num"] = 0] = "Num";
|
|
3285
3239
|
Type[Type["Str"] = 1] = "Str";
|
|
3286
|
-
})(Type
|
|
3240
|
+
})(Type || (util.Type = Type = {}));
|
|
3287
3241
|
function getErrorPath(dataProp, dataPropType, jsPropertySyntax) {
|
|
3288
3242
|
// let path
|
|
3289
|
-
if (dataProp instanceof codegen_1.Name) {
|
|
3243
|
+
if (dataProp instanceof codegen_1$v.Name) {
|
|
3290
3244
|
const isNumber = dataPropType === Type.Num;
|
|
3291
3245
|
return jsPropertySyntax
|
|
3292
3246
|
? isNumber
|
|
3293
|
-
? (0, codegen_1._) `"[" + ${dataProp} + "]"`
|
|
3294
|
-
: (0, codegen_1._) `"['" + ${dataProp} + "']"`
|
|
3247
|
+
? (0, codegen_1$v._) `"[" + ${dataProp} + "]"`
|
|
3248
|
+
: (0, codegen_1$v._) `"['" + ${dataProp} + "']"`
|
|
3295
3249
|
: isNumber
|
|
3296
|
-
? (0, codegen_1._) `"/" + ${dataProp}`
|
|
3297
|
-
: (0, codegen_1._) `"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")`; // TODO maybe use global escapePointer
|
|
3250
|
+
? (0, codegen_1$v._) `"/" + ${dataProp}`
|
|
3251
|
+
: (0, codegen_1$v._) `"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")`; // TODO maybe use global escapePointer
|
|
3298
3252
|
}
|
|
3299
|
-
return jsPropertySyntax ? (0, codegen_1.getProperty)(dataProp).toString() : "/" + escapeJsonPointer(dataProp);
|
|
3253
|
+
return jsPropertySyntax ? (0, codegen_1$v.getProperty)(dataProp).toString() : "/" + escapeJsonPointer(dataProp);
|
|
3300
3254
|
}
|
|
3301
|
-
|
|
3255
|
+
util.getErrorPath = getErrorPath;
|
|
3302
3256
|
function checkStrictMode(it, msg, mode = it.opts.strictSchema) {
|
|
3303
3257
|
if (!mode)
|
|
3304
3258
|
return;
|
|
@@ -3307,36 +3261,34 @@
|
|
|
3307
3261
|
throw new Error(msg);
|
|
3308
3262
|
it.self.logger.warn(msg);
|
|
3309
3263
|
}
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
}(util));
|
|
3264
|
+
util.checkStrictMode = checkStrictMode;
|
|
3313
3265
|
|
|
3314
3266
|
var names$1 = {};
|
|
3315
3267
|
|
|
3316
3268
|
Object.defineProperty(names$1, "__esModule", { value: true });
|
|
3317
|
-
const codegen_1$
|
|
3269
|
+
const codegen_1$u = codegen;
|
|
3318
3270
|
const names = {
|
|
3319
3271
|
// validation function arguments
|
|
3320
|
-
data: new codegen_1$
|
|
3272
|
+
data: new codegen_1$u.Name("data"), // data passed to validation function
|
|
3321
3273
|
// args passed from referencing schema
|
|
3322
|
-
valCxt: new codegen_1$
|
|
3323
|
-
instancePath: new codegen_1$
|
|
3324
|
-
parentData: new codegen_1$
|
|
3325
|
-
parentDataProperty: new codegen_1$
|
|
3326
|
-
rootData: new codegen_1$
|
|
3327
|
-
dynamicAnchors: new codegen_1$
|
|
3274
|
+
valCxt: new codegen_1$u.Name("valCxt"), // validation/data context - should not be used directly, it is destructured to the names below
|
|
3275
|
+
instancePath: new codegen_1$u.Name("instancePath"),
|
|
3276
|
+
parentData: new codegen_1$u.Name("parentData"),
|
|
3277
|
+
parentDataProperty: new codegen_1$u.Name("parentDataProperty"),
|
|
3278
|
+
rootData: new codegen_1$u.Name("rootData"), // root data - same as the data passed to the first/top validation function
|
|
3279
|
+
dynamicAnchors: new codegen_1$u.Name("dynamicAnchors"), // used to support recursiveRef and dynamicRef
|
|
3328
3280
|
// function scoped variables
|
|
3329
|
-
vErrors: new codegen_1$
|
|
3330
|
-
errors: new codegen_1$
|
|
3331
|
-
this: new codegen_1$
|
|
3281
|
+
vErrors: new codegen_1$u.Name("vErrors"), // null or array of validation errors
|
|
3282
|
+
errors: new codegen_1$u.Name("errors"), // counter of validation errors
|
|
3283
|
+
this: new codegen_1$u.Name("this"),
|
|
3332
3284
|
// "globals"
|
|
3333
|
-
self: new codegen_1$
|
|
3334
|
-
scope: new codegen_1$
|
|
3285
|
+
self: new codegen_1$u.Name("self"),
|
|
3286
|
+
scope: new codegen_1$u.Name("scope"),
|
|
3335
3287
|
// JTD serialize/parse name for JSON string and position
|
|
3336
|
-
json: new codegen_1$
|
|
3337
|
-
jsonPos: new codegen_1$
|
|
3338
|
-
jsonLen: new codegen_1$
|
|
3339
|
-
jsonPart: new codegen_1$
|
|
3288
|
+
json: new codegen_1$u.Name("json"),
|
|
3289
|
+
jsonPos: new codegen_1$u.Name("jsonPos"),
|
|
3290
|
+
jsonLen: new codegen_1$u.Name("jsonLen"),
|
|
3291
|
+
jsonPart: new codegen_1$u.Name("jsonPart"),
|
|
3340
3292
|
};
|
|
3341
3293
|
names$1.default = names;
|
|
3342
3294
|
|
|
@@ -3414,7 +3366,7 @@
|
|
|
3414
3366
|
}
|
|
3415
3367
|
const E = {
|
|
3416
3368
|
keyword: new codegen_1.Name("keyword"),
|
|
3417
|
-
schemaPath: new codegen_1.Name("schemaPath"),
|
|
3369
|
+
schemaPath: new codegen_1.Name("schemaPath"), // also used in JTD errors
|
|
3418
3370
|
params: new codegen_1.Name("params"),
|
|
3419
3371
|
propertyName: new codegen_1.Name("propertyName"),
|
|
3420
3372
|
message: new codegen_1.Name("message"),
|
|
@@ -3467,8 +3419,8 @@
|
|
|
3467
3419
|
|
|
3468
3420
|
Object.defineProperty(boolSchema, "__esModule", { value: true });
|
|
3469
3421
|
boolSchema.boolOrEmptySchema = boolSchema.topBoolOrEmptySchema = void 0;
|
|
3470
|
-
const errors_1$
|
|
3471
|
-
const codegen_1$
|
|
3422
|
+
const errors_1$3 = errors;
|
|
3423
|
+
const codegen_1$t = codegen;
|
|
3472
3424
|
const names_1$6 = names$1;
|
|
3473
3425
|
const boolError = {
|
|
3474
3426
|
message: "boolean schema is false",
|
|
@@ -3482,7 +3434,7 @@
|
|
|
3482
3434
|
gen.return(names_1$6.default.data);
|
|
3483
3435
|
}
|
|
3484
3436
|
else {
|
|
3485
|
-
gen.assign((0, codegen_1$
|
|
3437
|
+
gen.assign((0, codegen_1$t._) `${validateName}.errors`, null);
|
|
3486
3438
|
gen.return(true);
|
|
3487
3439
|
}
|
|
3488
3440
|
}
|
|
@@ -3511,7 +3463,7 @@
|
|
|
3511
3463
|
params: {},
|
|
3512
3464
|
it,
|
|
3513
3465
|
};
|
|
3514
|
-
(0, errors_1$
|
|
3466
|
+
(0, errors_1$3.reportError)(cxt, boolError, undefined, overrideAllErrors);
|
|
3515
3467
|
}
|
|
3516
3468
|
|
|
3517
3469
|
var dataType = {};
|
|
@@ -3563,19 +3515,18 @@
|
|
|
3563
3515
|
}
|
|
3564
3516
|
applicability.shouldUseRule = shouldUseRule;
|
|
3565
3517
|
|
|
3566
|
-
(
|
|
3567
|
-
|
|
3568
|
-
exports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = void 0;
|
|
3518
|
+
Object.defineProperty(dataType, "__esModule", { value: true });
|
|
3519
|
+
dataType.reportTypeError = dataType.checkDataTypes = dataType.checkDataType = dataType.coerceAndCheckDataType = dataType.getJSONTypes = dataType.getSchemaTypes = dataType.DataType = void 0;
|
|
3569
3520
|
const rules_1 = rules;
|
|
3570
|
-
const applicability_1 = applicability;
|
|
3571
|
-
const errors_1 = errors;
|
|
3572
|
-
const codegen_1 = codegen;
|
|
3573
|
-
const util_1 = util;
|
|
3521
|
+
const applicability_1$1 = applicability;
|
|
3522
|
+
const errors_1$2 = errors;
|
|
3523
|
+
const codegen_1$s = codegen;
|
|
3524
|
+
const util_1$q = util;
|
|
3574
3525
|
var DataType;
|
|
3575
3526
|
(function (DataType) {
|
|
3576
3527
|
DataType[DataType["Correct"] = 0] = "Correct";
|
|
3577
3528
|
DataType[DataType["Wrong"] = 1] = "Wrong";
|
|
3578
|
-
})(DataType
|
|
3529
|
+
})(DataType || (dataType.DataType = DataType = {}));
|
|
3579
3530
|
function getSchemaTypes(schema) {
|
|
3580
3531
|
const types = getJSONTypes(schema.type);
|
|
3581
3532
|
const hasNull = types.includes("null");
|
|
@@ -3592,19 +3543,20 @@
|
|
|
3592
3543
|
}
|
|
3593
3544
|
return types;
|
|
3594
3545
|
}
|
|
3595
|
-
|
|
3546
|
+
dataType.getSchemaTypes = getSchemaTypes;
|
|
3547
|
+
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
|
|
3596
3548
|
function getJSONTypes(ts) {
|
|
3597
3549
|
const types = Array.isArray(ts) ? ts : ts ? [ts] : [];
|
|
3598
3550
|
if (types.every(rules_1.isJSONType))
|
|
3599
3551
|
return types;
|
|
3600
3552
|
throw new Error("type must be JSONType or JSONType[]: " + types.join(","));
|
|
3601
3553
|
}
|
|
3602
|
-
|
|
3554
|
+
dataType.getJSONTypes = getJSONTypes;
|
|
3603
3555
|
function coerceAndCheckDataType(it, types) {
|
|
3604
3556
|
const { gen, data, opts } = it;
|
|
3605
3557
|
const coerceTo = coerceToTypes(types, opts.coerceTypes);
|
|
3606
3558
|
const checkTypes = types.length > 0 &&
|
|
3607
|
-
!(coerceTo.length === 0 && types.length === 1 && (0, applicability_1.schemaHasRulesForType)(it, types[0]));
|
|
3559
|
+
!(coerceTo.length === 0 && types.length === 1 && (0, applicability_1$1.schemaHasRulesForType)(it, types[0]));
|
|
3608
3560
|
if (checkTypes) {
|
|
3609
3561
|
const wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong);
|
|
3610
3562
|
gen.if(wrongType, () => {
|
|
@@ -3616,7 +3568,7 @@
|
|
|
3616
3568
|
}
|
|
3617
3569
|
return checkTypes;
|
|
3618
3570
|
}
|
|
3619
|
-
|
|
3571
|
+
dataType.coerceAndCheckDataType = coerceAndCheckDataType;
|
|
3620
3572
|
const COERCIBLE = new Set(["string", "number", "integer", "boolean", "null"]);
|
|
3621
3573
|
function coerceToTypes(types, coerceTypes) {
|
|
3622
3574
|
return coerceTypes
|
|
@@ -3625,15 +3577,15 @@
|
|
|
3625
3577
|
}
|
|
3626
3578
|
function coerceData(it, types, coerceTo) {
|
|
3627
3579
|
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`);
|
|
3580
|
+
const dataType = gen.let("dataType", (0, codegen_1$s._) `typeof ${data}`);
|
|
3581
|
+
const coerced = gen.let("coerced", (0, codegen_1$s._) `undefined`);
|
|
3630
3582
|
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}`)
|
|
3583
|
+
gen.if((0, codegen_1$s._) `${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen
|
|
3584
|
+
.assign(data, (0, codegen_1$s._) `${data}[0]`)
|
|
3585
|
+
.assign(dataType, (0, codegen_1$s._) `typeof ${data}`)
|
|
3634
3586
|
.if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data)));
|
|
3635
3587
|
}
|
|
3636
|
-
gen.if((0, codegen_1._) `${coerced} !== undefined`);
|
|
3588
|
+
gen.if((0, codegen_1$s._) `${coerced} !== undefined`);
|
|
3637
3589
|
for (const t of coerceTo) {
|
|
3638
3590
|
if (COERCIBLE.has(t) || (t === "array" && opts.coerceTypes === "array")) {
|
|
3639
3591
|
coerceSpecificType(t);
|
|
@@ -3642,7 +3594,7 @@
|
|
|
3642
3594
|
gen.else();
|
|
3643
3595
|
reportTypeError(it);
|
|
3644
3596
|
gen.endIf();
|
|
3645
|
-
gen.if((0, codegen_1._) `${coerced} !== undefined`, () => {
|
|
3597
|
+
gen.if((0, codegen_1$s._) `${coerced} !== undefined`, () => {
|
|
3646
3598
|
gen.assign(data, coerced);
|
|
3647
3599
|
assignParentData(it, coerced);
|
|
3648
3600
|
});
|
|
@@ -3650,108 +3602,108 @@
|
|
|
3650
3602
|
switch (t) {
|
|
3651
3603
|
case "string":
|
|
3652
3604
|
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._) `""`);
|
|
3605
|
+
.elseIf((0, codegen_1$s._) `${dataType} == "number" || ${dataType} == "boolean"`)
|
|
3606
|
+
.assign(coerced, (0, codegen_1$s._) `"" + ${data}`)
|
|
3607
|
+
.elseIf((0, codegen_1$s._) `${data} === null`)
|
|
3608
|
+
.assign(coerced, (0, codegen_1$s._) `""`);
|
|
3657
3609
|
return;
|
|
3658
3610
|
case "number":
|
|
3659
3611
|
gen
|
|
3660
|
-
.elseIf((0, codegen_1._) `${dataType} == "boolean" || ${data} === null
|
|
3612
|
+
.elseIf((0, codegen_1$s._) `${dataType} == "boolean" || ${data} === null
|
|
3661
3613
|
|| (${dataType} == "string" && ${data} && ${data} == +${data})`)
|
|
3662
|
-
.assign(coerced, (0, codegen_1._) `+${data}`);
|
|
3614
|
+
.assign(coerced, (0, codegen_1$s._) `+${data}`);
|
|
3663
3615
|
return;
|
|
3664
3616
|
case "integer":
|
|
3665
3617
|
gen
|
|
3666
|
-
.elseIf((0, codegen_1._) `${dataType} === "boolean" || ${data} === null
|
|
3618
|
+
.elseIf((0, codegen_1$s._) `${dataType} === "boolean" || ${data} === null
|
|
3667
3619
|
|| (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))`)
|
|
3668
|
-
.assign(coerced, (0, codegen_1._) `+${data}`);
|
|
3620
|
+
.assign(coerced, (0, codegen_1$s._) `+${data}`);
|
|
3669
3621
|
return;
|
|
3670
3622
|
case "boolean":
|
|
3671
3623
|
gen
|
|
3672
|
-
.elseIf((0, codegen_1._) `${data} === "false" || ${data} === 0 || ${data} === null`)
|
|
3624
|
+
.elseIf((0, codegen_1$s._) `${data} === "false" || ${data} === 0 || ${data} === null`)
|
|
3673
3625
|
.assign(coerced, false)
|
|
3674
|
-
.elseIf((0, codegen_1._) `${data} === "true" || ${data} === 1`)
|
|
3626
|
+
.elseIf((0, codegen_1$s._) `${data} === "true" || ${data} === 1`)
|
|
3675
3627
|
.assign(coerced, true);
|
|
3676
3628
|
return;
|
|
3677
3629
|
case "null":
|
|
3678
|
-
gen.elseIf((0, codegen_1._) `${data} === "" || ${data} === 0 || ${data} === false`);
|
|
3630
|
+
gen.elseIf((0, codegen_1$s._) `${data} === "" || ${data} === 0 || ${data} === false`);
|
|
3679
3631
|
gen.assign(coerced, null);
|
|
3680
3632
|
return;
|
|
3681
3633
|
case "array":
|
|
3682
3634
|
gen
|
|
3683
|
-
.elseIf((0, codegen_1._) `${dataType} === "string" || ${dataType} === "number"
|
|
3635
|
+
.elseIf((0, codegen_1$s._) `${dataType} === "string" || ${dataType} === "number"
|
|
3684
3636
|
|| ${dataType} === "boolean" || ${data} === null`)
|
|
3685
|
-
.assign(coerced, (0, codegen_1._) `[${data}]`);
|
|
3637
|
+
.assign(coerced, (0, codegen_1$s._) `[${data}]`);
|
|
3686
3638
|
}
|
|
3687
3639
|
}
|
|
3688
3640
|
}
|
|
3689
3641
|
function assignParentData({ gen, parentData, parentDataProperty }, expr) {
|
|
3690
3642
|
// TODO use gen.property
|
|
3691
|
-
gen.if((0, codegen_1._) `${parentData} !== undefined`, () => gen.assign((0, codegen_1._) `${parentData}[${parentDataProperty}]`, expr));
|
|
3643
|
+
gen.if((0, codegen_1$s._) `${parentData} !== undefined`, () => gen.assign((0, codegen_1$s._) `${parentData}[${parentDataProperty}]`, expr));
|
|
3692
3644
|
}
|
|
3693
3645
|
function checkDataType(dataType, data, strictNums, correct = DataType.Correct) {
|
|
3694
|
-
const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ;
|
|
3646
|
+
const EQ = correct === DataType.Correct ? codegen_1$s.operators.EQ : codegen_1$s.operators.NEQ;
|
|
3695
3647
|
let cond;
|
|
3696
3648
|
switch (dataType) {
|
|
3697
3649
|
case "null":
|
|
3698
|
-
return (0, codegen_1._) `${data} ${EQ} null`;
|
|
3650
|
+
return (0, codegen_1$s._) `${data} ${EQ} null`;
|
|
3699
3651
|
case "array":
|
|
3700
|
-
cond = (0, codegen_1._) `Array.isArray(${data})`;
|
|
3652
|
+
cond = (0, codegen_1$s._) `Array.isArray(${data})`;
|
|
3701
3653
|
break;
|
|
3702
3654
|
case "object":
|
|
3703
|
-
cond = (0, codegen_1._) `${data} && typeof ${data} == "object" && !Array.isArray(${data})`;
|
|
3655
|
+
cond = (0, codegen_1$s._) `${data} && typeof ${data} == "object" && !Array.isArray(${data})`;
|
|
3704
3656
|
break;
|
|
3705
3657
|
case "integer":
|
|
3706
|
-
cond = numCond((0, codegen_1._) `!(${data} % 1) && !isNaN(${data})`);
|
|
3658
|
+
cond = numCond((0, codegen_1$s._) `!(${data} % 1) && !isNaN(${data})`);
|
|
3707
3659
|
break;
|
|
3708
3660
|
case "number":
|
|
3709
3661
|
cond = numCond();
|
|
3710
3662
|
break;
|
|
3711
3663
|
default:
|
|
3712
|
-
return (0, codegen_1._) `typeof ${data} ${EQ} ${dataType}`;
|
|
3664
|
+
return (0, codegen_1$s._) `typeof ${data} ${EQ} ${dataType}`;
|
|
3713
3665
|
}
|
|
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);
|
|
3666
|
+
return correct === DataType.Correct ? cond : (0, codegen_1$s.not)(cond);
|
|
3667
|
+
function numCond(_cond = codegen_1$s.nil) {
|
|
3668
|
+
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
3669
|
}
|
|
3718
3670
|
}
|
|
3719
|
-
|
|
3671
|
+
dataType.checkDataType = checkDataType;
|
|
3720
3672
|
function checkDataTypes(dataTypes, data, strictNums, correct) {
|
|
3721
3673
|
if (dataTypes.length === 1) {
|
|
3722
3674
|
return checkDataType(dataTypes[0], data, strictNums, correct);
|
|
3723
3675
|
}
|
|
3724
3676
|
let cond;
|
|
3725
|
-
const types = (0, util_1.toHash)(dataTypes);
|
|
3677
|
+
const types = (0, util_1$q.toHash)(dataTypes);
|
|
3726
3678
|
if (types.array && types.object) {
|
|
3727
|
-
const notObj = (0, codegen_1._) `typeof ${data} != "object"`;
|
|
3728
|
-
cond = types.null ? notObj : (0, codegen_1._) `!${data} || ${notObj}`;
|
|
3679
|
+
const notObj = (0, codegen_1$s._) `typeof ${data} != "object"`;
|
|
3680
|
+
cond = types.null ? notObj : (0, codegen_1$s._) `!${data} || ${notObj}`;
|
|
3729
3681
|
delete types.null;
|
|
3730
3682
|
delete types.array;
|
|
3731
3683
|
delete types.object;
|
|
3732
3684
|
}
|
|
3733
3685
|
else {
|
|
3734
|
-
cond = codegen_1.nil;
|
|
3686
|
+
cond = codegen_1$s.nil;
|
|
3735
3687
|
}
|
|
3736
3688
|
if (types.number)
|
|
3737
3689
|
delete types.integer;
|
|
3738
3690
|
for (const t in types)
|
|
3739
|
-
cond = (0, codegen_1.and)(cond, checkDataType(t, data, strictNums, correct));
|
|
3691
|
+
cond = (0, codegen_1$s.and)(cond, checkDataType(t, data, strictNums, correct));
|
|
3740
3692
|
return cond;
|
|
3741
3693
|
}
|
|
3742
|
-
|
|
3694
|
+
dataType.checkDataTypes = checkDataTypes;
|
|
3743
3695
|
const typeError = {
|
|
3744
3696
|
message: ({ schema }) => `must be ${schema}`,
|
|
3745
|
-
params: ({ schema, schemaValue }) => typeof schema == "string" ? (0, codegen_1._) `{type: ${schema}}` : (0, codegen_1._) `{type: ${schemaValue}}`,
|
|
3697
|
+
params: ({ schema, schemaValue }) => typeof schema == "string" ? (0, codegen_1$s._) `{type: ${schema}}` : (0, codegen_1$s._) `{type: ${schemaValue}}`,
|
|
3746
3698
|
};
|
|
3747
3699
|
function reportTypeError(it) {
|
|
3748
3700
|
const cxt = getTypeErrorContext(it);
|
|
3749
|
-
(0, errors_1.reportError)(cxt, typeError);
|
|
3701
|
+
(0, errors_1$2.reportError)(cxt, typeError);
|
|
3750
3702
|
}
|
|
3751
|
-
|
|
3703
|
+
dataType.reportTypeError = reportTypeError;
|
|
3752
3704
|
function getTypeErrorContext(it) {
|
|
3753
3705
|
const { gen, data, schema } = it;
|
|
3754
|
-
const schemaCode = (0, util_1.schemaRefOrVal)(it, schema, "type");
|
|
3706
|
+
const schemaCode = (0, util_1$q.schemaRefOrVal)(it, schema, "type");
|
|
3755
3707
|
return {
|
|
3756
3708
|
gen,
|
|
3757
3709
|
keyword: "type",
|
|
@@ -3765,8 +3717,6 @@
|
|
|
3765
3717
|
};
|
|
3766
3718
|
}
|
|
3767
3719
|
|
|
3768
|
-
}(dataType));
|
|
3769
|
-
|
|
3770
3720
|
var defaults = {};
|
|
3771
3721
|
|
|
3772
3722
|
Object.defineProperty(defaults, "__esModule", { value: true });
|
|
@@ -4388,16 +4338,16 @@
|
|
|
4388
4338
|
if (parentJsonPtr === undefined)
|
|
4389
4339
|
return;
|
|
4390
4340
|
const fullPath = pathPrefix + jsonPtr;
|
|
4391
|
-
let
|
|
4341
|
+
let innerBaseId = baseIds[parentJsonPtr];
|
|
4392
4342
|
if (typeof sch[schemaId] == "string")
|
|
4393
|
-
|
|
4343
|
+
innerBaseId = addRef.call(this, sch[schemaId]);
|
|
4394
4344
|
addAnchor.call(this, sch.$anchor);
|
|
4395
4345
|
addAnchor.call(this, sch.$dynamicAnchor);
|
|
4396
|
-
baseIds[jsonPtr] =
|
|
4346
|
+
baseIds[jsonPtr] = innerBaseId;
|
|
4397
4347
|
function addRef(ref) {
|
|
4398
4348
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
4399
4349
|
const _resolve = this.opts.uriResolver.resolve;
|
|
4400
|
-
ref = normalizeId(
|
|
4350
|
+
ref = normalizeId(innerBaseId ? _resolve(innerBaseId, ref) : ref);
|
|
4401
4351
|
if (schemaRefs.has(ref))
|
|
4402
4352
|
throw ambiguos(ref);
|
|
4403
4353
|
schemaRefs.add(ref);
|
|
@@ -5038,7 +4988,7 @@
|
|
|
5038
4988
|
parentData: names_1$2.default.parentData,
|
|
5039
4989
|
parentDataProperty: names_1$2.default.parentDataProperty,
|
|
5040
4990
|
dataNames: [names_1$2.default.data],
|
|
5041
|
-
dataPathArr: [codegen_1$m.nil],
|
|
4991
|
+
dataPathArr: [codegen_1$m.nil], // TODO can its length be used as dataLevel if nil is removed?
|
|
5042
4992
|
dataLevel: 0,
|
|
5043
4993
|
dataTypes: [],
|
|
5044
4994
|
definedProperties: new Set(),
|
|
@@ -6807,6 +6757,7 @@
|
|
|
6807
6757
|
return (this.opts.defaultMeta = typeof meta == "object" ? meta[schemaId] || meta : undefined);
|
|
6808
6758
|
}
|
|
6809
6759
|
validate(schemaKeyRef, // key, ref or schema object
|
|
6760
|
+
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
|
|
6810
6761
|
data // to be validated
|
|
6811
6762
|
) {
|
|
6812
6763
|
let v;
|
|
@@ -7155,9 +7106,9 @@
|
|
|
7155
7106
|
}
|
|
7156
7107
|
}
|
|
7157
7108
|
}
|
|
7158
|
-
exports.default = Ajv;
|
|
7159
7109
|
Ajv.ValidationError = validation_error_1.default;
|
|
7160
7110
|
Ajv.MissingRefError = ref_error_1.default;
|
|
7111
|
+
exports.default = Ajv;
|
|
7161
7112
|
function checkOptions(checkOpts, options, msg, log = "error") {
|
|
7162
7113
|
for (const key in checkOpts) {
|
|
7163
7114
|
const opt = key;
|
|
@@ -7305,7 +7256,7 @@
|
|
|
7305
7256
|
|
|
7306
7257
|
Object.defineProperty(ref, "__esModule", { value: true });
|
|
7307
7258
|
ref.callRef = ref.getValidate = void 0;
|
|
7308
|
-
const ref_error_1 = ref_error;
|
|
7259
|
+
const ref_error_1$1 = ref_error;
|
|
7309
7260
|
const code_1$8 = code;
|
|
7310
7261
|
const codegen_1$l = codegen;
|
|
7311
7262
|
const names_1$1 = names$1;
|
|
@@ -7322,7 +7273,7 @@
|
|
|
7322
7273
|
return callRootRef();
|
|
7323
7274
|
const schOrEnv = compile_1$1.resolveRef.call(self, root, baseId, $ref);
|
|
7324
7275
|
if (schOrEnv === undefined)
|
|
7325
|
-
throw new ref_error_1.default(it.opts.uriResolver, baseId, $ref);
|
|
7276
|
+
throw new ref_error_1$1.default(it.opts.uriResolver, baseId, $ref);
|
|
7326
7277
|
if (schOrEnv instanceof compile_1$1.SchemaEnv)
|
|
7327
7278
|
return callValidate(schOrEnv);
|
|
7328
7279
|
return inlineRefSchema(schOrEnv);
|
|
@@ -8883,20 +8834,19 @@
|
|
|
8883
8834
|
|
|
8884
8835
|
var types = {};
|
|
8885
8836
|
|
|
8886
|
-
(
|
|
8887
|
-
|
|
8888
|
-
|
|
8837
|
+
Object.defineProperty(types, "__esModule", { value: true });
|
|
8838
|
+
types.DiscrError = void 0;
|
|
8839
|
+
var DiscrError;
|
|
8889
8840
|
(function (DiscrError) {
|
|
8890
8841
|
DiscrError["Tag"] = "tag";
|
|
8891
8842
|
DiscrError["Mapping"] = "mapping";
|
|
8892
|
-
})(
|
|
8893
|
-
|
|
8894
|
-
}(types));
|
|
8843
|
+
})(DiscrError || (types.DiscrError = DiscrError = {}));
|
|
8895
8844
|
|
|
8896
8845
|
Object.defineProperty(discriminator, "__esModule", { value: true });
|
|
8897
8846
|
const codegen_1 = codegen;
|
|
8898
8847
|
const types_1 = types;
|
|
8899
8848
|
const compile_1 = compile;
|
|
8849
|
+
const ref_error_1 = ref_error;
|
|
8900
8850
|
const util_1 = util;
|
|
8901
8851
|
const error = {
|
|
8902
8852
|
message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag
|
|
@@ -8951,9 +8901,12 @@
|
|
|
8951
8901
|
for (let i = 0; i < oneOf.length; i++) {
|
|
8952
8902
|
let sch = oneOf[i];
|
|
8953
8903
|
if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) {
|
|
8954
|
-
|
|
8904
|
+
const ref = sch.$ref;
|
|
8905
|
+
sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref);
|
|
8955
8906
|
if (sch instanceof compile_1.SchemaEnv)
|
|
8956
8907
|
sch = sch.schema;
|
|
8908
|
+
if (sch === undefined)
|
|
8909
|
+
throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref);
|
|
8957
8910
|
}
|
|
8958
8911
|
const propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName];
|
|
8959
8912
|
if (typeof propSch != "object") {
|
|
@@ -9246,7 +9199,7 @@
|
|
|
9246
9199
|
|
|
9247
9200
|
(function (module, exports) {
|
|
9248
9201
|
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;
|
|
9202
|
+
exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv = void 0;
|
|
9250
9203
|
const core_1 = core$2;
|
|
9251
9204
|
const draft7_1 = draft7;
|
|
9252
9205
|
const discriminator_1 = discriminator;
|
|
@@ -9275,7 +9228,9 @@
|
|
|
9275
9228
|
super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined));
|
|
9276
9229
|
}
|
|
9277
9230
|
}
|
|
9231
|
+
exports.Ajv = Ajv;
|
|
9278
9232
|
module.exports = exports = Ajv;
|
|
9233
|
+
module.exports.Ajv = Ajv;
|
|
9279
9234
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9280
9235
|
exports.default = Ajv;
|
|
9281
9236
|
var validate_1 = validate$1;
|
|
@@ -9846,7 +9801,7 @@
|
|
|
9846
9801
|
var _instance$schema;
|
|
9847
9802
|
// TODO 校验逻辑梳理
|
|
9848
9803
|
var formItem = widgetTree.widgetMap[path];
|
|
9849
|
-
if (!formItem) return {
|
|
9804
|
+
if (!formItem || !formItem.instance) return {
|
|
9850
9805
|
result: true,
|
|
9851
9806
|
message: '',
|
|
9852
9807
|
path: ''
|
|
@@ -9998,7 +9953,7 @@
|
|
|
9998
9953
|
this.callbacks = void 0;
|
|
9999
9954
|
this.callbacks = Object.create(null);
|
|
10000
9955
|
}
|
|
10001
|
-
_createClass(FormEvent, [{
|
|
9956
|
+
return _createClass(FormEvent, [{
|
|
10002
9957
|
key: "on",
|
|
10003
9958
|
value: function on(path, type, cb) {
|
|
10004
9959
|
if (!(path in this.callbacks)) {
|
|
@@ -10070,7 +10025,6 @@
|
|
|
10070
10025
|
}
|
|
10071
10026
|
}
|
|
10072
10027
|
}]);
|
|
10073
|
-
return FormEvent;
|
|
10074
10028
|
}();
|
|
10075
10029
|
var events = new FormEvent();
|
|
10076
10030
|
|
|
@@ -10523,7 +10477,6 @@
|
|
|
10523
10477
|
layout: _objectSpread2(_objectSpread2({}, _this.layout), {}, {
|
|
10524
10478
|
item: {} // todo: 暂时不支持数组项之间的布局
|
|
10525
10479
|
}),
|
|
10526
|
-
|
|
10527
10480
|
removeable: true
|
|
10528
10481
|
}),
|
|
10529
10482
|
on: _objectSpread2(_objectSpread2({}, _this.$listeners), {}, {
|
|
@@ -10541,7 +10494,6 @@
|
|
|
10541
10494
|
layout: {},
|
|
10542
10495
|
showTitle: true // 数组类型默认展示分组title
|
|
10543
10496
|
}),
|
|
10544
|
-
|
|
10545
10497
|
style: _objectSpread2({}, this.layout.item || {})
|
|
10546
10498
|
}, vnode), [].concat(_toConsumableArray(arrVnodeList), [h(registry.getBaseWidget('form-item'), {
|
|
10547
10499
|
class: {
|
|
@@ -11055,7 +11007,7 @@
|
|
|
11055
11007
|
default: function _default(props) {
|
|
11056
11008
|
return h(SchemaField, {
|
|
11057
11009
|
props: _objectSpread2(_objectSpread2({}, _this2.$props), {}, {
|
|
11058
|
-
schema: mergeDeep(colField, {
|
|
11010
|
+
schema: mergeDeep({}, colField, {
|
|
11059
11011
|
'ui:props': {
|
|
11060
11012
|
// 默认不展示标题
|
|
11061
11013
|
showTitle: false,
|
|
@@ -11228,7 +11180,6 @@
|
|
|
11228
11180
|
display: 'grid',
|
|
11229
11181
|
gridGap: '20px' // 未设置layout的布局组的默认样式
|
|
11230
11182
|
});
|
|
11231
|
-
|
|
11232
11183
|
var self = this;
|
|
11233
11184
|
var renderDelete = function renderDelete() {
|
|
11234
11185
|
return h('span', {
|
|
@@ -11332,7 +11283,6 @@
|
|
|
11332
11283
|
gridGap: '20px',
|
|
11333
11284
|
'grid-template-columns': defaultCols // 默认配置
|
|
11334
11285
|
});
|
|
11335
|
-
|
|
11336
11286
|
var self = this;
|
|
11337
11287
|
var dealSchema = function dealSchema(schema) {
|
|
11338
11288
|
return (
|
|
@@ -11455,7 +11405,6 @@
|
|
|
11455
11405
|
layout: _objectSpread2(_objectSpread2({}, this.layout), {}, {
|
|
11456
11406
|
container: {} // Tab组的容器layout由panel内容控制
|
|
11457
11407
|
}),
|
|
11458
|
-
|
|
11459
11408
|
title: this.schema.title
|
|
11460
11409
|
});
|
|
11461
11410
|
var self = this;
|
|
@@ -11488,7 +11437,6 @@
|
|
|
11488
11437
|
layout: layoutConfig,
|
|
11489
11438
|
removeable: false // todo: 不往下传递可删除属性
|
|
11490
11439
|
}),
|
|
11491
|
-
|
|
11492
11440
|
on: _objectSpread2({}, _this.$listeners)
|
|
11493
11441
|
})]);
|
|
11494
11442
|
}))]);
|
|
@@ -11550,7 +11498,6 @@
|
|
|
11550
11498
|
layout: _objectSpread2(_objectSpread2({}, this.layout), {}, {
|
|
11551
11499
|
container: {} // Tab组的容器layout由panel内容控制
|
|
11552
11500
|
}),
|
|
11553
|
-
|
|
11554
11501
|
title: this.schema.title
|
|
11555
11502
|
});
|
|
11556
11503
|
var properties = orderProperties(Object.keys(((_this$schema = this.schema) === null || _this$schema === void 0 ? void 0 : _this$schema.properties) || {}), this.schema['ui:order']);
|
|
@@ -11585,7 +11532,6 @@
|
|
|
11585
11532
|
layout: layoutConfig,
|
|
11586
11533
|
removeable: false // todo: 不往下传递可删除属性
|
|
11587
11534
|
}),
|
|
11588
|
-
|
|
11589
11535
|
on: _objectSpread2({}, _this.$listeners)
|
|
11590
11536
|
})])]);
|
|
11591
11537
|
});
|