@harbor-design/proform 1.3.33 → 1.4.0
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/index.js
CHANGED
|
@@ -1,7 +1,321 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { ref as
|
|
1
|
+
var ze = Object.defineProperty;
|
|
2
|
+
var Le = (r, e, t) => e in r ? ze(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
+
var l = (r, e, t) => (Le(r, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import { ref as L, readonly as Ce, nextTick as _, isRef as U, watch as E, isReactive as T, watchEffect as D, toRaw as x, reactive as W, createVNode as m, mergeProps as q, withDirectives as He, vShow as De, createTextVNode as Ge, isVNode as Be, defineComponent as Ke } from "vue";
|
|
5
|
+
var We = typeof global == "object" && global && global.Object === Object && global, Xe = typeof self == "object" && self && self.Object === Object && self, A = We || Xe || Function("return this")(), R = A.Symbol, we = Object.prototype, Ye = we.hasOwnProperty, Ze = we.toString, N = R ? R.toStringTag : void 0;
|
|
6
|
+
function Je(r) {
|
|
7
|
+
var e = Ye.call(r, N), t = r[N];
|
|
8
|
+
try {
|
|
9
|
+
r[N] = void 0;
|
|
10
|
+
var s = !0;
|
|
11
|
+
} catch {
|
|
12
|
+
}
|
|
13
|
+
var i = Ze.call(r);
|
|
14
|
+
return s && (e ? r[N] = t : delete r[N]), i;
|
|
15
|
+
}
|
|
16
|
+
var Qe = Object.prototype, Ae = Qe.toString;
|
|
17
|
+
function ke(r) {
|
|
18
|
+
return Ae.call(r);
|
|
19
|
+
}
|
|
20
|
+
var et = "[object Null]", tt = "[object Undefined]", Ie = R ? R.toStringTag : void 0;
|
|
21
|
+
function je(r) {
|
|
22
|
+
return r == null ? r === void 0 ? tt : et : Ie && Ie in Object(r) ? Je(r) : ke(r);
|
|
23
|
+
}
|
|
24
|
+
function rt(r) {
|
|
25
|
+
return r != null && typeof r == "object";
|
|
26
|
+
}
|
|
27
|
+
var st = "[object Symbol]";
|
|
28
|
+
function k(r) {
|
|
29
|
+
return typeof r == "symbol" || rt(r) && je(r) == st;
|
|
30
|
+
}
|
|
31
|
+
function it(r, e) {
|
|
32
|
+
for (var t = -1, s = r == null ? 0 : r.length, i = Array(s); ++t < s; )
|
|
33
|
+
i[t] = e(r[t], t, r);
|
|
34
|
+
return i;
|
|
35
|
+
}
|
|
36
|
+
var ee = Array.isArray, nt = 1 / 0, Se = R ? R.prototype : void 0, Oe = Se ? Se.toString : void 0;
|
|
37
|
+
function Me(r) {
|
|
38
|
+
if (typeof r == "string")
|
|
39
|
+
return r;
|
|
40
|
+
if (ee(r))
|
|
41
|
+
return it(r, Me) + "";
|
|
42
|
+
if (k(r))
|
|
43
|
+
return Oe ? Oe.call(r) : "";
|
|
44
|
+
var e = r + "";
|
|
45
|
+
return e == "0" && 1 / r == -nt ? "-0" : e;
|
|
46
|
+
}
|
|
47
|
+
function G(r) {
|
|
48
|
+
var e = typeof r;
|
|
49
|
+
return r != null && (e == "object" || e == "function");
|
|
50
|
+
}
|
|
51
|
+
var ot = "[object AsyncFunction]", at = "[object Function]", lt = "[object GeneratorFunction]", ut = "[object Proxy]";
|
|
52
|
+
function ft(r) {
|
|
53
|
+
if (!G(r))
|
|
54
|
+
return !1;
|
|
55
|
+
var e = je(r);
|
|
56
|
+
return e == at || e == lt || e == ot || e == ut;
|
|
57
|
+
}
|
|
58
|
+
var X = A["__core-js_shared__"], Ee = function() {
|
|
59
|
+
var r = /[^.]+$/.exec(X && X.keys && X.keys.IE_PROTO || "");
|
|
60
|
+
return r ? "Symbol(src)_1." + r : "";
|
|
61
|
+
}();
|
|
62
|
+
function ct(r) {
|
|
63
|
+
return !!Ee && Ee in r;
|
|
64
|
+
}
|
|
65
|
+
var dt = Function.prototype, pt = dt.toString;
|
|
66
|
+
function ht(r) {
|
|
67
|
+
if (r != null) {
|
|
68
|
+
try {
|
|
69
|
+
return pt.call(r);
|
|
70
|
+
} catch {
|
|
71
|
+
}
|
|
72
|
+
try {
|
|
73
|
+
return r + "";
|
|
74
|
+
} catch {
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return "";
|
|
78
|
+
}
|
|
79
|
+
var mt = /[\\^$.*+?()[\]{}|]/g, gt = /^\[object .+?Constructor\]$/, bt = Function.prototype, vt = Object.prototype, yt = bt.toString, _t = vt.hasOwnProperty, Pt = RegExp(
|
|
80
|
+
"^" + yt.call(_t).replace(mt, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
81
|
+
);
|
|
82
|
+
function Ct(r) {
|
|
83
|
+
if (!G(r) || ct(r))
|
|
84
|
+
return !1;
|
|
85
|
+
var e = ft(r) ? Pt : gt;
|
|
86
|
+
return e.test(ht(r));
|
|
87
|
+
}
|
|
88
|
+
function It(r, e) {
|
|
89
|
+
return r == null ? void 0 : r[e];
|
|
90
|
+
}
|
|
91
|
+
function te(r, e) {
|
|
92
|
+
var t = It(r, e);
|
|
93
|
+
return Ct(t) ? t : void 0;
|
|
94
|
+
}
|
|
95
|
+
var Fe = function() {
|
|
96
|
+
try {
|
|
97
|
+
var r = te(Object, "defineProperty");
|
|
98
|
+
return r({}, "", {}), r;
|
|
99
|
+
} catch {
|
|
100
|
+
}
|
|
101
|
+
}(), St = 9007199254740991, Ot = /^(?:0|[1-9]\d*)$/;
|
|
102
|
+
function Et(r, e) {
|
|
103
|
+
var t = typeof r;
|
|
104
|
+
return e = e ?? St, !!e && (t == "number" || t != "symbol" && Ot.test(r)) && r > -1 && r % 1 == 0 && r < e;
|
|
105
|
+
}
|
|
106
|
+
function Ft(r, e, t) {
|
|
107
|
+
e == "__proto__" && Fe ? Fe(r, e, {
|
|
108
|
+
configurable: !0,
|
|
109
|
+
enumerable: !0,
|
|
110
|
+
value: t,
|
|
111
|
+
writable: !0
|
|
112
|
+
}) : r[e] = t;
|
|
113
|
+
}
|
|
114
|
+
function xe(r, e) {
|
|
115
|
+
return r === e || r !== r && e !== e;
|
|
116
|
+
}
|
|
117
|
+
var wt = Object.prototype, jt = wt.hasOwnProperty;
|
|
118
|
+
function Mt(r, e, t) {
|
|
119
|
+
var s = r[e];
|
|
120
|
+
(!(jt.call(r, e) && xe(s, t)) || t === void 0 && !(e in r)) && Ft(r, e, t);
|
|
121
|
+
}
|
|
122
|
+
var xt = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Rt = /^\w*$/;
|
|
123
|
+
function $t(r, e) {
|
|
124
|
+
if (ee(r))
|
|
125
|
+
return !1;
|
|
126
|
+
var t = typeof r;
|
|
127
|
+
return t == "number" || t == "symbol" || t == "boolean" || r == null || k(r) ? !0 : Rt.test(r) || !xt.test(r) || e != null && r in Object(e);
|
|
128
|
+
}
|
|
129
|
+
var z = te(Object, "create");
|
|
130
|
+
function Vt() {
|
|
131
|
+
this.__data__ = z ? z(null) : {}, this.size = 0;
|
|
132
|
+
}
|
|
133
|
+
function Nt(r) {
|
|
134
|
+
var e = this.has(r) && delete this.__data__[r];
|
|
135
|
+
return this.size -= e ? 1 : 0, e;
|
|
136
|
+
}
|
|
137
|
+
var qt = "__lodash_hash_undefined__", Ut = Object.prototype, Tt = Ut.hasOwnProperty;
|
|
138
|
+
function zt(r) {
|
|
139
|
+
var e = this.__data__;
|
|
140
|
+
if (z) {
|
|
141
|
+
var t = e[r];
|
|
142
|
+
return t === qt ? void 0 : t;
|
|
143
|
+
}
|
|
144
|
+
return Tt.call(e, r) ? e[r] : void 0;
|
|
145
|
+
}
|
|
146
|
+
var Lt = Object.prototype, Ht = Lt.hasOwnProperty;
|
|
147
|
+
function Dt(r) {
|
|
148
|
+
var e = this.__data__;
|
|
149
|
+
return z ? e[r] !== void 0 : Ht.call(e, r);
|
|
150
|
+
}
|
|
151
|
+
var Gt = "__lodash_hash_undefined__";
|
|
152
|
+
function Bt(r, e) {
|
|
153
|
+
var t = this.__data__;
|
|
154
|
+
return this.size += this.has(r) ? 0 : 1, t[r] = z && e === void 0 ? Gt : e, this;
|
|
155
|
+
}
|
|
156
|
+
function F(r) {
|
|
157
|
+
var e = -1, t = r == null ? 0 : r.length;
|
|
158
|
+
for (this.clear(); ++e < t; ) {
|
|
159
|
+
var s = r[e];
|
|
160
|
+
this.set(s[0], s[1]);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
F.prototype.clear = Vt;
|
|
164
|
+
F.prototype.delete = Nt;
|
|
165
|
+
F.prototype.get = zt;
|
|
166
|
+
F.prototype.has = Dt;
|
|
167
|
+
F.prototype.set = Bt;
|
|
168
|
+
function Kt() {
|
|
169
|
+
this.__data__ = [], this.size = 0;
|
|
170
|
+
}
|
|
171
|
+
function B(r, e) {
|
|
172
|
+
for (var t = r.length; t--; )
|
|
173
|
+
if (xe(r[t][0], e))
|
|
174
|
+
return t;
|
|
175
|
+
return -1;
|
|
176
|
+
}
|
|
177
|
+
var Wt = Array.prototype, Xt = Wt.splice;
|
|
178
|
+
function Yt(r) {
|
|
179
|
+
var e = this.__data__, t = B(e, r);
|
|
180
|
+
if (t < 0)
|
|
181
|
+
return !1;
|
|
182
|
+
var s = e.length - 1;
|
|
183
|
+
return t == s ? e.pop() : Xt.call(e, t, 1), --this.size, !0;
|
|
184
|
+
}
|
|
185
|
+
function Zt(r) {
|
|
186
|
+
var e = this.__data__, t = B(e, r);
|
|
187
|
+
return t < 0 ? void 0 : e[t][1];
|
|
188
|
+
}
|
|
189
|
+
function Jt(r) {
|
|
190
|
+
return B(this.__data__, r) > -1;
|
|
191
|
+
}
|
|
192
|
+
function Qt(r, e) {
|
|
193
|
+
var t = this.__data__, s = B(t, r);
|
|
194
|
+
return s < 0 ? (++this.size, t.push([r, e])) : t[s][1] = e, this;
|
|
195
|
+
}
|
|
196
|
+
function $(r) {
|
|
197
|
+
var e = -1, t = r == null ? 0 : r.length;
|
|
198
|
+
for (this.clear(); ++e < t; ) {
|
|
199
|
+
var s = r[e];
|
|
200
|
+
this.set(s[0], s[1]);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
$.prototype.clear = Kt;
|
|
204
|
+
$.prototype.delete = Yt;
|
|
205
|
+
$.prototype.get = Zt;
|
|
206
|
+
$.prototype.has = Jt;
|
|
207
|
+
$.prototype.set = Qt;
|
|
208
|
+
var At = te(A, "Map");
|
|
209
|
+
function kt() {
|
|
210
|
+
this.size = 0, this.__data__ = {
|
|
211
|
+
hash: new F(),
|
|
212
|
+
map: new (At || $)(),
|
|
213
|
+
string: new F()
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
function er(r) {
|
|
217
|
+
var e = typeof r;
|
|
218
|
+
return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? r !== "__proto__" : r === null;
|
|
219
|
+
}
|
|
220
|
+
function K(r, e) {
|
|
221
|
+
var t = r.__data__;
|
|
222
|
+
return er(e) ? t[typeof e == "string" ? "string" : "hash"] : t.map;
|
|
223
|
+
}
|
|
224
|
+
function tr(r) {
|
|
225
|
+
var e = K(this, r).delete(r);
|
|
226
|
+
return this.size -= e ? 1 : 0, e;
|
|
227
|
+
}
|
|
228
|
+
function rr(r) {
|
|
229
|
+
return K(this, r).get(r);
|
|
230
|
+
}
|
|
231
|
+
function sr(r) {
|
|
232
|
+
return K(this, r).has(r);
|
|
233
|
+
}
|
|
234
|
+
function ir(r, e) {
|
|
235
|
+
var t = K(this, r), s = t.size;
|
|
236
|
+
return t.set(r, e), this.size += t.size == s ? 0 : 1, this;
|
|
237
|
+
}
|
|
238
|
+
function w(r) {
|
|
239
|
+
var e = -1, t = r == null ? 0 : r.length;
|
|
240
|
+
for (this.clear(); ++e < t; ) {
|
|
241
|
+
var s = r[e];
|
|
242
|
+
this.set(s[0], s[1]);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
w.prototype.clear = kt;
|
|
246
|
+
w.prototype.delete = tr;
|
|
247
|
+
w.prototype.get = rr;
|
|
248
|
+
w.prototype.has = sr;
|
|
249
|
+
w.prototype.set = ir;
|
|
250
|
+
var nr = "Expected a function";
|
|
251
|
+
function re(r, e) {
|
|
252
|
+
if (typeof r != "function" || e != null && typeof e != "function")
|
|
253
|
+
throw new TypeError(nr);
|
|
254
|
+
var t = function() {
|
|
255
|
+
var s = arguments, i = e ? e.apply(this, s) : s[0], n = t.cache;
|
|
256
|
+
if (n.has(i))
|
|
257
|
+
return n.get(i);
|
|
258
|
+
var a = r.apply(this, s);
|
|
259
|
+
return t.cache = n.set(i, a) || n, a;
|
|
260
|
+
};
|
|
261
|
+
return t.cache = new (re.Cache || w)(), t;
|
|
262
|
+
}
|
|
263
|
+
re.Cache = w;
|
|
264
|
+
var or = 500;
|
|
265
|
+
function ar(r) {
|
|
266
|
+
var e = re(r, function(s) {
|
|
267
|
+
return t.size === or && t.clear(), s;
|
|
268
|
+
}), t = e.cache;
|
|
269
|
+
return e;
|
|
270
|
+
}
|
|
271
|
+
var lr = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, ur = /\\(\\)?/g, fr = ar(function(r) {
|
|
272
|
+
var e = [];
|
|
273
|
+
return r.charCodeAt(0) === 46 && e.push(""), r.replace(lr, function(t, s, i, n) {
|
|
274
|
+
e.push(i ? n.replace(ur, "$1") : s || t);
|
|
275
|
+
}), e;
|
|
276
|
+
});
|
|
277
|
+
function cr(r) {
|
|
278
|
+
return r == null ? "" : Me(r);
|
|
279
|
+
}
|
|
280
|
+
function Re(r, e) {
|
|
281
|
+
return ee(r) ? r : $t(r, e) ? [r] : fr(cr(r));
|
|
282
|
+
}
|
|
283
|
+
var dr = 1 / 0;
|
|
284
|
+
function $e(r) {
|
|
285
|
+
if (typeof r == "string" || k(r))
|
|
286
|
+
return r;
|
|
287
|
+
var e = r + "";
|
|
288
|
+
return e == "0" && 1 / r == -dr ? "-0" : e;
|
|
289
|
+
}
|
|
290
|
+
function pr(r, e) {
|
|
291
|
+
e = Re(e, r);
|
|
292
|
+
for (var t = 0, s = e.length; r != null && t < s; )
|
|
293
|
+
r = r[$e(e[t++])];
|
|
294
|
+
return t && t == s ? r : void 0;
|
|
295
|
+
}
|
|
296
|
+
function H(r, e, t) {
|
|
297
|
+
var s = r == null ? void 0 : pr(r, e);
|
|
298
|
+
return s === void 0 ? t : s;
|
|
299
|
+
}
|
|
300
|
+
function hr(r, e, t, s) {
|
|
301
|
+
if (!G(r))
|
|
302
|
+
return r;
|
|
303
|
+
e = Re(e, r);
|
|
304
|
+
for (var i = -1, n = e.length, a = n - 1, u = r; u != null && ++i < n; ) {
|
|
305
|
+
var f = $e(e[i]), d = t;
|
|
306
|
+
if (f === "__proto__" || f === "constructor" || f === "prototype")
|
|
307
|
+
return r;
|
|
308
|
+
if (i != a) {
|
|
309
|
+
var p = u[f];
|
|
310
|
+
d = s ? s(p, f, u) : void 0, d === void 0 && (d = G(p) ? p : Et(e[i + 1]) ? [] : {});
|
|
311
|
+
}
|
|
312
|
+
Mt(u, f, d), u = u[f];
|
|
313
|
+
}
|
|
314
|
+
return r;
|
|
315
|
+
}
|
|
316
|
+
function P(r, e, t) {
|
|
317
|
+
return r == null ? r : hr(r, e, t);
|
|
318
|
+
}
|
|
5
319
|
class o {
|
|
6
320
|
static typeChecker(e) {
|
|
7
321
|
return {}.toString.call(e);
|
|
@@ -50,18 +364,17 @@ class o {
|
|
|
50
364
|
return !1;
|
|
51
365
|
if (this.isObjectEmpty(e))
|
|
52
366
|
return !0;
|
|
53
|
-
for (const
|
|
54
|
-
if (
|
|
367
|
+
for (const t in e) {
|
|
368
|
+
if (t === "componentProps")
|
|
55
369
|
return !1;
|
|
56
|
-
if (e.hasOwnProperty(
|
|
370
|
+
if (e.hasOwnProperty(t) && this.isProcessInprogress(e[t]))
|
|
57
371
|
return !0;
|
|
58
372
|
}
|
|
59
373
|
} else if (this.isArray(e)) {
|
|
60
374
|
if (this.isArrayEmpty(e))
|
|
61
375
|
return !0;
|
|
62
|
-
for (const
|
|
63
|
-
|
|
64
|
-
return !0;
|
|
376
|
+
for (const t of e)
|
|
377
|
+
return this.isProcessInprogress(t);
|
|
65
378
|
}
|
|
66
379
|
return !1;
|
|
67
380
|
}
|
|
@@ -69,101 +382,102 @@ class o {
|
|
|
69
382
|
return !!e.__proform_raw_object;
|
|
70
383
|
}
|
|
71
384
|
}
|
|
72
|
-
function
|
|
73
|
-
return e.forEach((
|
|
74
|
-
if (Array.isArray(
|
|
75
|
-
Array.isArray(
|
|
76
|
-
typeof
|
|
385
|
+
function b(r, ...e) {
|
|
386
|
+
return e.forEach((t) => {
|
|
387
|
+
if (Array.isArray(t))
|
|
388
|
+
Array.isArray(r) || (r = []), t.forEach((s, i) => {
|
|
389
|
+
typeof s == "object" && s !== null ? r[i] = b(Array.isArray(s) ? [] : {}, s) : r[i] = s;
|
|
77
390
|
});
|
|
78
391
|
else
|
|
79
|
-
for (const
|
|
80
|
-
|
|
81
|
-
}),
|
|
392
|
+
for (const s in t)
|
|
393
|
+
t.hasOwnProperty(s) && (typeof t[s] == "object" && t[s] !== null ? r[s] = b(r[s] || {}, t[s]) : r[s] = t[s]);
|
|
394
|
+
}), r;
|
|
82
395
|
}
|
|
83
|
-
function C(
|
|
396
|
+
function C(r) {
|
|
84
397
|
const e = /* @__PURE__ */ new WeakMap();
|
|
85
|
-
function
|
|
86
|
-
if (
|
|
87
|
-
return
|
|
88
|
-
if (
|
|
89
|
-
return new Date(
|
|
90
|
-
if (
|
|
91
|
-
return new RegExp(
|
|
92
|
-
if (
|
|
398
|
+
function t(s) {
|
|
399
|
+
if (s === null || typeof s != "object")
|
|
400
|
+
return s;
|
|
401
|
+
if (s instanceof Date)
|
|
402
|
+
return new Date(s);
|
|
403
|
+
if (s instanceof RegExp)
|
|
404
|
+
return new RegExp(s);
|
|
405
|
+
if (s instanceof Map) {
|
|
93
406
|
const n = /* @__PURE__ */ new Map();
|
|
94
|
-
for (const [a,
|
|
95
|
-
n.set(
|
|
407
|
+
for (const [a, u] of s)
|
|
408
|
+
n.set(t(a), t(u));
|
|
96
409
|
return n;
|
|
97
410
|
}
|
|
98
|
-
if (
|
|
411
|
+
if (s instanceof Set) {
|
|
99
412
|
const n = /* @__PURE__ */ new Set();
|
|
100
|
-
for (const a of
|
|
101
|
-
n.add(
|
|
413
|
+
for (const a of s)
|
|
414
|
+
n.add(t(a));
|
|
102
415
|
return n;
|
|
103
416
|
}
|
|
104
|
-
if (e.has(
|
|
105
|
-
return e.get(
|
|
106
|
-
if (Array.isArray(
|
|
417
|
+
if (e.has(s))
|
|
418
|
+
return e.get(s);
|
|
419
|
+
if (Array.isArray(s)) {
|
|
107
420
|
const n = [];
|
|
108
|
-
e.set(
|
|
109
|
-
for (let a = 0; a <
|
|
110
|
-
n[a] =
|
|
421
|
+
e.set(s, n);
|
|
422
|
+
for (let a = 0; a < s.length; a++)
|
|
423
|
+
n[a] = t(s[a]);
|
|
111
424
|
return n;
|
|
112
425
|
}
|
|
113
|
-
const
|
|
114
|
-
e.set(
|
|
115
|
-
for (const n in
|
|
116
|
-
|
|
117
|
-
return
|
|
426
|
+
const i = Object.create(Object.getPrototypeOf(s));
|
|
427
|
+
e.set(s, i);
|
|
428
|
+
for (const n in s)
|
|
429
|
+
s.hasOwnProperty(n) && (i[n] = t(s[n]));
|
|
430
|
+
return i;
|
|
118
431
|
}
|
|
119
|
-
return r
|
|
432
|
+
return t(r);
|
|
120
433
|
}
|
|
121
|
-
function
|
|
122
|
-
return
|
|
434
|
+
function Z(r, e) {
|
|
435
|
+
return r.replace(/undefined/g, e);
|
|
123
436
|
}
|
|
124
|
-
class
|
|
437
|
+
class mr {
|
|
125
438
|
constructor(e) {
|
|
126
|
-
|
|
127
|
-
|
|
439
|
+
l(this, "runtimeCore");
|
|
440
|
+
l(this, "readonlyReactiveModel", L({}));
|
|
441
|
+
l(this, "shareHistory", /* @__PURE__ */ new Map());
|
|
128
442
|
this.formCustomization = e;
|
|
129
443
|
}
|
|
130
444
|
// happy path, 后续可以完善更多的 fallback 处理,fallback 处理是为了不卡住异步时的首次渲染做的优化
|
|
131
445
|
cleanFallbackFields(e) {
|
|
132
|
-
return e !== null && typeof e == "object" && (delete e.__yiwwhl_async_field_fallback, Object.values(e).forEach((
|
|
133
|
-
this.cleanFallbackFields(
|
|
446
|
+
return e !== null && typeof e == "object" && (delete e.__yiwwhl_async_field_fallback, Object.values(e).forEach((t) => {
|
|
447
|
+
this.cleanFallbackFields(t);
|
|
134
448
|
})), e;
|
|
135
449
|
}
|
|
136
450
|
setup(e) {
|
|
137
|
-
return this.runtimeCore = e, this.readonlyReactiveModel.value =
|
|
451
|
+
return this.runtimeCore = e, this.readonlyReactiveModel.value = Ce(e.model.value), Object.assign(this.runtimeCore.native, this.formCustomization.native), Object.assign(this.runtimeCore.grid, this.formCustomization.grid), Object.assign(this.runtimeCore.runtime, this.formCustomization.runtime), this.formCustomization.ui && (this.runtimeCore.ui = this.formCustomization.ui), this.formCustomization;
|
|
138
452
|
}
|
|
139
453
|
submit() {
|
|
140
|
-
var
|
|
141
|
-
const e = (
|
|
142
|
-
return (e == null ? void 0 : e.validateForm(this)) ?? (
|
|
454
|
+
var s;
|
|
455
|
+
const e = (s = c.getPreset(this.runtimeCore.ui)) == null ? void 0 : s.adapter, t = I.adapters[c.getUI(this.runtimeCore.ui)];
|
|
456
|
+
return (e == null ? void 0 : e.validateForm(this)) ?? (t == null ? void 0 : t.validateForm(this));
|
|
143
457
|
}
|
|
144
458
|
hydrate(e) {
|
|
145
|
-
|
|
459
|
+
_(() => {
|
|
146
460
|
this.runtimeCore.hydrateEffect.trackEffect(
|
|
147
461
|
() => {
|
|
148
|
-
|
|
462
|
+
U(e) ? E(
|
|
149
463
|
() => e.value,
|
|
150
464
|
() => {
|
|
151
|
-
|
|
465
|
+
b(this.runtimeCore.model.value, e.value);
|
|
152
466
|
},
|
|
153
467
|
{
|
|
154
468
|
deep: !0,
|
|
155
469
|
immediate: !0
|
|
156
470
|
}
|
|
157
|
-
) :
|
|
471
|
+
) : T(e) ? E(
|
|
158
472
|
() => e,
|
|
159
473
|
() => {
|
|
160
|
-
|
|
474
|
+
b(this.runtimeCore.model.value, e);
|
|
161
475
|
},
|
|
162
476
|
{
|
|
163
477
|
deep: !0,
|
|
164
478
|
immediate: !0
|
|
165
479
|
}
|
|
166
|
-
) :
|
|
480
|
+
) : b(this.runtimeCore.model.value, e);
|
|
167
481
|
},
|
|
168
482
|
{
|
|
169
483
|
lazy: !1
|
|
@@ -172,46 +486,25 @@ class He {
|
|
|
172
486
|
});
|
|
173
487
|
}
|
|
174
488
|
share(e) {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
()
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
deep: !0,
|
|
186
|
-
immediate: !0
|
|
187
|
-
}
|
|
188
|
-
);
|
|
189
|
-
} else if (U(e)) {
|
|
190
|
-
const r = _(
|
|
191
|
-
() => e,
|
|
192
|
-
() => {
|
|
193
|
-
h(this.runtimeCore.shared, e), this.runtimeCore.processor.schemaEffect.triggerEffects(), P(() => {
|
|
194
|
-
r();
|
|
195
|
-
});
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
deep: !0,
|
|
199
|
-
immediate: !0
|
|
200
|
-
}
|
|
201
|
-
);
|
|
202
|
-
} else
|
|
203
|
-
h(this.runtimeCore.shared, e), this.runtimeCore.processor.schemaEffect.triggerEffects();
|
|
489
|
+
_(() => {
|
|
490
|
+
Object.keys(e).forEach((t) => {
|
|
491
|
+
U(e[t]) ? D(() => {
|
|
492
|
+
P(this.runtimeCore.shared, t, e[t].value), this.shareHistory.get(t) !== e[t].value && (this.shareHistory.set(t, e[t].value), this.runtimeCore.processor.schemaEffect.triggerEffects());
|
|
493
|
+
}) : T(e[t]) ? D(() => {
|
|
494
|
+
P(this.runtimeCore.shared, t, e[t]), this.shareHistory.get(t) !== e[t] && (this.shareHistory.set(t, e[t]), this.runtimeCore.processor.schemaEffect.triggerEffects());
|
|
495
|
+
}) : (P(this.runtimeCore.shared, t, e[t]), this.shareHistory.get(t) !== e[t] && (this.shareHistory.set(t, e[t]), this.runtimeCore.processor.schemaEffect.triggerEffects()));
|
|
496
|
+
});
|
|
204
497
|
});
|
|
205
498
|
}
|
|
206
499
|
subscribeModel(e) {
|
|
207
|
-
|
|
208
|
-
const
|
|
500
|
+
_(() => {
|
|
501
|
+
const t = E(
|
|
209
502
|
() => this.readonlyReactiveModel.value,
|
|
210
|
-
(
|
|
211
|
-
e(
|
|
503
|
+
(s) => {
|
|
504
|
+
e(s, {
|
|
212
505
|
stopSubscribe() {
|
|
213
|
-
|
|
214
|
-
|
|
506
|
+
_(() => {
|
|
507
|
+
t();
|
|
215
508
|
});
|
|
216
509
|
}
|
|
217
510
|
});
|
|
@@ -227,15 +520,15 @@ class He {
|
|
|
227
520
|
var e;
|
|
228
521
|
(e = this.runtimeCore) != null && e.model.value && (this.runtimeCore.model.value = C(
|
|
229
522
|
this.runtimeCore.processor.stableModel
|
|
230
|
-
), this.readonlyReactiveModel.value =
|
|
523
|
+
), this.readonlyReactiveModel.value = Ce(this.runtimeCore.model.value), this.runtimeCore.runtimeAdapter.clearValidate(this.runtimeCore));
|
|
231
524
|
}
|
|
232
525
|
}
|
|
233
|
-
class
|
|
526
|
+
class J {
|
|
234
527
|
constructor() {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
528
|
+
l(this, "effects", /* @__PURE__ */ new Set());
|
|
529
|
+
l(this, "tempClonedEffects", /* @__PURE__ */ new Set());
|
|
530
|
+
l(this, "identifierMap", /* @__PURE__ */ new Map());
|
|
531
|
+
l(this, "timer");
|
|
239
532
|
}
|
|
240
533
|
clearEffects() {
|
|
241
534
|
this.effects.clear();
|
|
@@ -243,344 +536,30 @@ class Y {
|
|
|
243
536
|
triggerEffects() {
|
|
244
537
|
Array.from(this.effects).forEach((e) => e());
|
|
245
538
|
}
|
|
246
|
-
trackEffect(e,
|
|
539
|
+
trackEffect(e, t = {
|
|
247
540
|
lazy: !0
|
|
248
541
|
}) {
|
|
249
|
-
return !
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
var We = typeof global == "object" && global && global.Object === Object && global, Ke = typeof self == "object" && self && self.Object === Object && self, J = We || Ke || Function("return this")(), x = J.Symbol, je = Object.prototype, Xe = je.hasOwnProperty, Ye = je.toString, V = x ? x.toStringTag : void 0;
|
|
253
|
-
function Ze(t) {
|
|
254
|
-
var e = Xe.call(t, V), r = t[V];
|
|
255
|
-
try {
|
|
256
|
-
t[V] = void 0;
|
|
257
|
-
var i = !0;
|
|
258
|
-
} catch {
|
|
259
|
-
}
|
|
260
|
-
var s = Ye.call(t);
|
|
261
|
-
return i && (e ? t[V] = r : delete t[V]), s;
|
|
262
|
-
}
|
|
263
|
-
var Je = Object.prototype, Qe = Je.toString;
|
|
264
|
-
function Ae(t) {
|
|
265
|
-
return Qe.call(t);
|
|
266
|
-
}
|
|
267
|
-
var et = "[object Null]", tt = "[object Undefined]", Ce = x ? x.toStringTag : void 0;
|
|
268
|
-
function we(t) {
|
|
269
|
-
return t == null ? t === void 0 ? tt : et : Ce && Ce in Object(t) ? Ze(t) : Ae(t);
|
|
270
|
-
}
|
|
271
|
-
function rt(t) {
|
|
272
|
-
return t != null && typeof t == "object";
|
|
273
|
-
}
|
|
274
|
-
var it = "[object Symbol]";
|
|
275
|
-
function Q(t) {
|
|
276
|
-
return typeof t == "symbol" || rt(t) && we(t) == it;
|
|
277
|
-
}
|
|
278
|
-
function st(t, e) {
|
|
279
|
-
for (var r = -1, i = t == null ? 0 : t.length, s = Array(i); ++r < i; )
|
|
280
|
-
s[r] = e(t[r], r, t);
|
|
281
|
-
return s;
|
|
282
|
-
}
|
|
283
|
-
var A = Array.isArray, nt = 1 / 0, Ie = x ? x.prototype : void 0, Se = Ie ? Ie.toString : void 0;
|
|
284
|
-
function Me(t) {
|
|
285
|
-
if (typeof t == "string")
|
|
286
|
-
return t;
|
|
287
|
-
if (A(t))
|
|
288
|
-
return st(t, Me) + "";
|
|
289
|
-
if (Q(t))
|
|
290
|
-
return Se ? Se.call(t) : "";
|
|
291
|
-
var e = t + "";
|
|
292
|
-
return e == "0" && 1 / t == -nt ? "-0" : e;
|
|
293
|
-
}
|
|
294
|
-
function G(t) {
|
|
295
|
-
var e = typeof t;
|
|
296
|
-
return t != null && (e == "object" || e == "function");
|
|
297
|
-
}
|
|
298
|
-
var ot = "[object AsyncFunction]", at = "[object Function]", lt = "[object GeneratorFunction]", ut = "[object Proxy]";
|
|
299
|
-
function ct(t) {
|
|
300
|
-
if (!G(t))
|
|
301
|
-
return !1;
|
|
302
|
-
var e = we(t);
|
|
303
|
-
return e == at || e == lt || e == ot || e == ut;
|
|
304
|
-
}
|
|
305
|
-
var W = J["__core-js_shared__"], Oe = function() {
|
|
306
|
-
var t = /[^.]+$/.exec(W && W.keys && W.keys.IE_PROTO || "");
|
|
307
|
-
return t ? "Symbol(src)_1." + t : "";
|
|
308
|
-
}();
|
|
309
|
-
function ft(t) {
|
|
310
|
-
return !!Oe && Oe in t;
|
|
311
|
-
}
|
|
312
|
-
var dt = Function.prototype, pt = dt.toString;
|
|
313
|
-
function ht(t) {
|
|
314
|
-
if (t != null) {
|
|
315
|
-
try {
|
|
316
|
-
return pt.call(t);
|
|
317
|
-
} catch {
|
|
318
|
-
}
|
|
319
|
-
try {
|
|
320
|
-
return t + "";
|
|
321
|
-
} catch {
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
return "";
|
|
325
|
-
}
|
|
326
|
-
var mt = /[\\^$.*+?()[\]{}|]/g, yt = /^\[object .+?Constructor\]$/, gt = Function.prototype, bt = Object.prototype, vt = gt.toString, _t = bt.hasOwnProperty, Pt = RegExp(
|
|
327
|
-
"^" + vt.call(_t).replace(mt, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
328
|
-
);
|
|
329
|
-
function Ct(t) {
|
|
330
|
-
if (!G(t) || ft(t))
|
|
331
|
-
return !1;
|
|
332
|
-
var e = ct(t) ? Pt : yt;
|
|
333
|
-
return e.test(ht(t));
|
|
334
|
-
}
|
|
335
|
-
function It(t, e) {
|
|
336
|
-
return t == null ? void 0 : t[e];
|
|
337
|
-
}
|
|
338
|
-
function ee(t, e) {
|
|
339
|
-
var r = It(t, e);
|
|
340
|
-
return Ct(r) ? r : void 0;
|
|
341
|
-
}
|
|
342
|
-
var Fe = function() {
|
|
343
|
-
try {
|
|
344
|
-
var t = ee(Object, "defineProperty");
|
|
345
|
-
return t({}, "", {}), t;
|
|
346
|
-
} catch {
|
|
347
|
-
}
|
|
348
|
-
}(), St = 9007199254740991, Ot = /^(?:0|[1-9]\d*)$/;
|
|
349
|
-
function Ft(t, e) {
|
|
350
|
-
var r = typeof t;
|
|
351
|
-
return e = e ?? St, !!e && (r == "number" || r != "symbol" && Ot.test(t)) && t > -1 && t % 1 == 0 && t < e;
|
|
352
|
-
}
|
|
353
|
-
function jt(t, e, r) {
|
|
354
|
-
e == "__proto__" && Fe ? Fe(t, e, {
|
|
355
|
-
configurable: !0,
|
|
356
|
-
enumerable: !0,
|
|
357
|
-
value: r,
|
|
358
|
-
writable: !0
|
|
359
|
-
}) : t[e] = r;
|
|
360
|
-
}
|
|
361
|
-
function Ee(t, e) {
|
|
362
|
-
return t === e || t !== t && e !== e;
|
|
363
|
-
}
|
|
364
|
-
var wt = Object.prototype, Mt = wt.hasOwnProperty;
|
|
365
|
-
function Et(t, e, r) {
|
|
366
|
-
var i = t[e];
|
|
367
|
-
(!(Mt.call(t, e) && Ee(i, r)) || r === void 0 && !(e in t)) && jt(t, e, r);
|
|
368
|
-
}
|
|
369
|
-
var xt = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Rt = /^\w*$/;
|
|
370
|
-
function $t(t, e) {
|
|
371
|
-
if (A(t))
|
|
372
|
-
return !1;
|
|
373
|
-
var r = typeof t;
|
|
374
|
-
return r == "number" || r == "symbol" || r == "boolean" || t == null || Q(t) ? !0 : Rt.test(t) || !xt.test(t) || e != null && t in Object(e);
|
|
375
|
-
}
|
|
376
|
-
var T = ee(Object, "create");
|
|
377
|
-
function Vt() {
|
|
378
|
-
this.__data__ = T ? T(null) : {}, this.size = 0;
|
|
379
|
-
}
|
|
380
|
-
function Nt(t) {
|
|
381
|
-
var e = this.has(t) && delete this.__data__[t];
|
|
382
|
-
return this.size -= e ? 1 : 0, e;
|
|
383
|
-
}
|
|
384
|
-
var qt = "__lodash_hash_undefined__", Ut = Object.prototype, Tt = Ut.hasOwnProperty;
|
|
385
|
-
function zt(t) {
|
|
386
|
-
var e = this.__data__;
|
|
387
|
-
if (T) {
|
|
388
|
-
var r = e[t];
|
|
389
|
-
return r === qt ? void 0 : r;
|
|
390
|
-
}
|
|
391
|
-
return Tt.call(e, t) ? e[t] : void 0;
|
|
392
|
-
}
|
|
393
|
-
var Lt = Object.prototype, Dt = Lt.hasOwnProperty;
|
|
394
|
-
function Gt(t) {
|
|
395
|
-
var e = this.__data__;
|
|
396
|
-
return T ? e[t] !== void 0 : Dt.call(e, t);
|
|
397
|
-
}
|
|
398
|
-
var Bt = "__lodash_hash_undefined__";
|
|
399
|
-
function kt(t, e) {
|
|
400
|
-
var r = this.__data__;
|
|
401
|
-
return this.size += this.has(t) ? 0 : 1, r[t] = T && e === void 0 ? Bt : e, this;
|
|
402
|
-
}
|
|
403
|
-
function F(t) {
|
|
404
|
-
var e = -1, r = t == null ? 0 : t.length;
|
|
405
|
-
for (this.clear(); ++e < r; ) {
|
|
406
|
-
var i = t[e];
|
|
407
|
-
this.set(i[0], i[1]);
|
|
542
|
+
return !t.lazy && e(), t.identifier ? this.identifierMap.get(t.identifier) || (this.effects.add(e), this.identifierMap.set(t.identifier, !0)) : this.effects.add(e), () => this.effects.delete(e);
|
|
408
543
|
}
|
|
409
544
|
}
|
|
410
|
-
|
|
411
|
-
F.prototype.delete = Nt;
|
|
412
|
-
F.prototype.get = zt;
|
|
413
|
-
F.prototype.has = Gt;
|
|
414
|
-
F.prototype.set = kt;
|
|
415
|
-
function Ht() {
|
|
416
|
-
this.__data__ = [], this.size = 0;
|
|
417
|
-
}
|
|
418
|
-
function B(t, e) {
|
|
419
|
-
for (var r = t.length; r--; )
|
|
420
|
-
if (Ee(t[r][0], e))
|
|
421
|
-
return r;
|
|
422
|
-
return -1;
|
|
423
|
-
}
|
|
424
|
-
var Wt = Array.prototype, Kt = Wt.splice;
|
|
425
|
-
function Xt(t) {
|
|
426
|
-
var e = this.__data__, r = B(e, t);
|
|
427
|
-
if (r < 0)
|
|
428
|
-
return !1;
|
|
429
|
-
var i = e.length - 1;
|
|
430
|
-
return r == i ? e.pop() : Kt.call(e, r, 1), --this.size, !0;
|
|
431
|
-
}
|
|
432
|
-
function Yt(t) {
|
|
433
|
-
var e = this.__data__, r = B(e, t);
|
|
434
|
-
return r < 0 ? void 0 : e[r][1];
|
|
435
|
-
}
|
|
436
|
-
function Zt(t) {
|
|
437
|
-
return B(this.__data__, t) > -1;
|
|
438
|
-
}
|
|
439
|
-
function Jt(t, e) {
|
|
440
|
-
var r = this.__data__, i = B(r, t);
|
|
441
|
-
return i < 0 ? (++this.size, r.push([t, e])) : r[i][1] = e, this;
|
|
442
|
-
}
|
|
443
|
-
function R(t) {
|
|
444
|
-
var e = -1, r = t == null ? 0 : t.length;
|
|
445
|
-
for (this.clear(); ++e < r; ) {
|
|
446
|
-
var i = t[e];
|
|
447
|
-
this.set(i[0], i[1]);
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
R.prototype.clear = Ht;
|
|
451
|
-
R.prototype.delete = Xt;
|
|
452
|
-
R.prototype.get = Yt;
|
|
453
|
-
R.prototype.has = Zt;
|
|
454
|
-
R.prototype.set = Jt;
|
|
455
|
-
var Qt = ee(J, "Map");
|
|
456
|
-
function At() {
|
|
457
|
-
this.size = 0, this.__data__ = {
|
|
458
|
-
hash: new F(),
|
|
459
|
-
map: new (Qt || R)(),
|
|
460
|
-
string: new F()
|
|
461
|
-
};
|
|
462
|
-
}
|
|
463
|
-
function er(t) {
|
|
464
|
-
var e = typeof t;
|
|
465
|
-
return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
|
|
466
|
-
}
|
|
467
|
-
function k(t, e) {
|
|
468
|
-
var r = t.__data__;
|
|
469
|
-
return er(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
|
|
470
|
-
}
|
|
471
|
-
function tr(t) {
|
|
472
|
-
var e = k(this, t).delete(t);
|
|
473
|
-
return this.size -= e ? 1 : 0, e;
|
|
474
|
-
}
|
|
475
|
-
function rr(t) {
|
|
476
|
-
return k(this, t).get(t);
|
|
477
|
-
}
|
|
478
|
-
function ir(t) {
|
|
479
|
-
return k(this, t).has(t);
|
|
480
|
-
}
|
|
481
|
-
function sr(t, e) {
|
|
482
|
-
var r = k(this, t), i = r.size;
|
|
483
|
-
return r.set(t, e), this.size += r.size == i ? 0 : 1, this;
|
|
484
|
-
}
|
|
485
|
-
function j(t) {
|
|
486
|
-
var e = -1, r = t == null ? 0 : t.length;
|
|
487
|
-
for (this.clear(); ++e < r; ) {
|
|
488
|
-
var i = t[e];
|
|
489
|
-
this.set(i[0], i[1]);
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
j.prototype.clear = At;
|
|
493
|
-
j.prototype.delete = tr;
|
|
494
|
-
j.prototype.get = rr;
|
|
495
|
-
j.prototype.has = ir;
|
|
496
|
-
j.prototype.set = sr;
|
|
497
|
-
var nr = "Expected a function";
|
|
498
|
-
function te(t, e) {
|
|
499
|
-
if (typeof t != "function" || e != null && typeof e != "function")
|
|
500
|
-
throw new TypeError(nr);
|
|
501
|
-
var r = function() {
|
|
502
|
-
var i = arguments, s = e ? e.apply(this, i) : i[0], n = r.cache;
|
|
503
|
-
if (n.has(s))
|
|
504
|
-
return n.get(s);
|
|
505
|
-
var a = t.apply(this, i);
|
|
506
|
-
return r.cache = n.set(s, a) || n, a;
|
|
507
|
-
};
|
|
508
|
-
return r.cache = new (te.Cache || j)(), r;
|
|
509
|
-
}
|
|
510
|
-
te.Cache = j;
|
|
511
|
-
var or = 500;
|
|
512
|
-
function ar(t) {
|
|
513
|
-
var e = te(t, function(i) {
|
|
514
|
-
return r.size === or && r.clear(), i;
|
|
515
|
-
}), r = e.cache;
|
|
516
|
-
return e;
|
|
517
|
-
}
|
|
518
|
-
var lr = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, ur = /\\(\\)?/g, cr = ar(function(t) {
|
|
519
|
-
var e = [];
|
|
520
|
-
return t.charCodeAt(0) === 46 && e.push(""), t.replace(lr, function(r, i, s, n) {
|
|
521
|
-
e.push(s ? n.replace(ur, "$1") : i || r);
|
|
522
|
-
}), e;
|
|
523
|
-
});
|
|
524
|
-
function fr(t) {
|
|
525
|
-
return t == null ? "" : Me(t);
|
|
526
|
-
}
|
|
527
|
-
function xe(t, e) {
|
|
528
|
-
return A(t) ? t : $t(t, e) ? [t] : cr(fr(t));
|
|
529
|
-
}
|
|
530
|
-
var dr = 1 / 0;
|
|
531
|
-
function Re(t) {
|
|
532
|
-
if (typeof t == "string" || Q(t))
|
|
533
|
-
return t;
|
|
534
|
-
var e = t + "";
|
|
535
|
-
return e == "0" && 1 / t == -dr ? "-0" : e;
|
|
536
|
-
}
|
|
537
|
-
function pr(t, e) {
|
|
538
|
-
e = xe(e, t);
|
|
539
|
-
for (var r = 0, i = e.length; t != null && r < i; )
|
|
540
|
-
t = t[Re(e[r++])];
|
|
541
|
-
return r && r == i ? t : void 0;
|
|
542
|
-
}
|
|
543
|
-
function L(t, e, r) {
|
|
544
|
-
var i = t == null ? void 0 : pr(t, e);
|
|
545
|
-
return i === void 0 ? r : i;
|
|
546
|
-
}
|
|
547
|
-
function hr(t, e, r, i) {
|
|
548
|
-
if (!G(t))
|
|
549
|
-
return t;
|
|
550
|
-
e = xe(e, t);
|
|
551
|
-
for (var s = -1, n = e.length, a = n - 1, l = t; l != null && ++s < n; ) {
|
|
552
|
-
var c = Re(e[s]), d = r;
|
|
553
|
-
if (c === "__proto__" || c === "constructor" || c === "prototype")
|
|
554
|
-
return t;
|
|
555
|
-
if (s != a) {
|
|
556
|
-
var p = l[c];
|
|
557
|
-
d = i ? i(p, c, l) : void 0, d === void 0 && (d = G(p) ? p : Ft(e[s + 1]) ? [] : {});
|
|
558
|
-
}
|
|
559
|
-
Et(l, c, d), l = l[c];
|
|
560
|
-
}
|
|
561
|
-
return t;
|
|
562
|
-
}
|
|
563
|
-
function D(t, e, r) {
|
|
564
|
-
return t == null ? t : hr(t, e, r);
|
|
565
|
-
}
|
|
566
|
-
class mr {
|
|
545
|
+
class gr {
|
|
567
546
|
constructor(e) {
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
this.runtimeCore = e, this.processedSchemas = e.schemas, this.processedModel = e.model, this.getRuntimeMeta = e.getRuntimeMeta.bind(e),
|
|
547
|
+
l(this, "runtimeCore");
|
|
548
|
+
l(this, "processedSchemas");
|
|
549
|
+
l(this, "processedModel");
|
|
550
|
+
l(this, "getRuntimeMeta");
|
|
551
|
+
l(this, "stableSchemas", []);
|
|
552
|
+
l(this, "stableModel", {});
|
|
553
|
+
l(this, "schemaPreset", I.schemaPreset);
|
|
554
|
+
l(this, "componentPropsPreset", I.componentPropsPreset);
|
|
555
|
+
l(this, "stableUpdaterProcessProgress");
|
|
556
|
+
l(this, "stableUpdaterTimes", 0);
|
|
557
|
+
l(this, "schemaEffect", new J());
|
|
558
|
+
l(this, "defaultValueEffect", new J());
|
|
559
|
+
l(this, "defaultValueInprogressMap", /* @__PURE__ */ new Map());
|
|
560
|
+
l(this, "baseDefaultValueFunctionsLength");
|
|
561
|
+
l(this, "isModelInitialized", !0);
|
|
562
|
+
this.runtimeCore = e, this.processedSchemas = e.schemas, this.processedModel = e.model, this.getRuntimeMeta = e.getRuntimeMeta.bind(e), E(
|
|
584
563
|
() => this.processedModel.value,
|
|
585
564
|
() => {
|
|
586
565
|
this.schemaEffect.triggerEffects();
|
|
@@ -591,145 +570,145 @@ class mr {
|
|
|
591
570
|
);
|
|
592
571
|
}
|
|
593
572
|
// 核心处理过程,接收一个初始的代理数据结构,由其衍生的有 parseSchema
|
|
594
|
-
parse(e,
|
|
595
|
-
e.forEach((
|
|
596
|
-
this.parseItem(
|
|
573
|
+
parse(e, t) {
|
|
574
|
+
e.forEach((s, i) => {
|
|
575
|
+
this.parseItem(s, i, t);
|
|
597
576
|
});
|
|
598
577
|
}
|
|
599
578
|
// 初始化空数据结构,避免后续复杂的 if else
|
|
600
579
|
initSchemas(e) {
|
|
601
|
-
return e.map((
|
|
602
|
-
const
|
|
603
|
-
return
|
|
580
|
+
return e.map((t) => {
|
|
581
|
+
const s = {};
|
|
582
|
+
return t.children && (s.children = this.initSchemas(t.children)), s;
|
|
604
583
|
});
|
|
605
584
|
}
|
|
606
585
|
countFunctionDefaultValues(e) {
|
|
607
|
-
let
|
|
608
|
-
const
|
|
609
|
-
function
|
|
610
|
-
if (!
|
|
611
|
-
|
|
586
|
+
let t = 0;
|
|
587
|
+
const s = /* @__PURE__ */ new Set();
|
|
588
|
+
function i(n) {
|
|
589
|
+
if (!s.has(n) && (Array.isArray(n) || n !== null && typeof n == "object")) {
|
|
590
|
+
s.add(n);
|
|
612
591
|
for (const a in n)
|
|
613
|
-
n.hasOwnProperty(a) && (a === "defaultValue" && typeof n[a] == "function" && !n[a].toString().includes("[native code]") &&
|
|
592
|
+
n.hasOwnProperty(a) && (a === "defaultValue" && typeof n[a] == "function" && !n[a].toString().includes("[native code]") && t++, i(n[a]));
|
|
614
593
|
}
|
|
615
594
|
}
|
|
616
|
-
return
|
|
595
|
+
return i(e), t;
|
|
617
596
|
}
|
|
618
597
|
// 派生过程,用于外部应用
|
|
619
|
-
parseSchemas(e,
|
|
598
|
+
parseSchemas(e, t) {
|
|
620
599
|
o.isArrayEmpty(this.processedSchemas.value) && (this.baseDefaultValueFunctionsLength = this.countFunctionDefaultValues(
|
|
621
600
|
C(e)
|
|
622
|
-
), this.processedSchemas.value = this.initSchemas(e)), this.parse(e,
|
|
601
|
+
), this.processedSchemas.value = this.initSchemas(e)), this.parse(e, t);
|
|
623
602
|
}
|
|
624
603
|
parseStable(e) {
|
|
625
|
-
const
|
|
604
|
+
const t = {};
|
|
626
605
|
if (!o.isUndefined(e.stable))
|
|
627
|
-
|
|
606
|
+
t[e.key] = this.parseStable(e.stable);
|
|
628
607
|
else
|
|
629
608
|
return e;
|
|
630
|
-
return
|
|
609
|
+
return t;
|
|
631
610
|
}
|
|
632
611
|
// 对于稳定初始化更新的抽象
|
|
633
612
|
stableUpdater(e = []) {
|
|
634
613
|
if (e.every(Boolean)) {
|
|
635
|
-
const
|
|
636
|
-
!o.isProcessInprogress(
|
|
637
|
-
length:
|
|
638
|
-
}).fill(!1)), this.stableUpdaterProcessProgress[this.stableUpdaterTimes] = !0, this.stableUpdaterTimes++, this.modelProcessor(
|
|
614
|
+
const t = x(this.processedSchemas.value);
|
|
615
|
+
!o.isProcessInprogress(t) && o.isObjectEmpty(this.stableModel) && (this.stableUpdaterProcessProgress || (this.stableUpdaterProcessProgress = Array.from({
|
|
616
|
+
length: t.length
|
|
617
|
+
}).fill(!1)), this.stableUpdaterProcessProgress[this.stableUpdaterTimes] = !0, this.stableUpdaterTimes++, this.modelProcessor(t));
|
|
639
618
|
}
|
|
640
619
|
}
|
|
641
620
|
// 核心单 schema 处理过程,接收一个对象键值对的数据结构
|
|
642
|
-
parseItem(e,
|
|
643
|
-
const
|
|
644
|
-
length: Object.keys(e).filter((
|
|
621
|
+
parseItem(e, t, s) {
|
|
622
|
+
const i = this, n = Array.from({
|
|
623
|
+
length: Object.keys(e).filter((u) => u !== "children").length
|
|
645
624
|
}).fill(!1);
|
|
646
|
-
this.objectParser({ data: e, index:
|
|
647
|
-
function a(
|
|
648
|
-
const
|
|
649
|
-
if (o.isUndefined(
|
|
625
|
+
this.objectParser({ data: e, index: t, updater: a, parentMeta: s });
|
|
626
|
+
function a(u) {
|
|
627
|
+
const f = u.index, d = u.key, p = u.keyIndex;
|
|
628
|
+
if (o.isUndefined(u.stable))
|
|
650
629
|
return;
|
|
651
|
-
const
|
|
652
|
-
let
|
|
653
|
-
if (o.isProcessInprogress(
|
|
654
|
-
const g =
|
|
655
|
-
g && o.isObject(g) && d !== "component" && (
|
|
630
|
+
const h = i.parseStable(u.stable), v = s == null ? void 0 : s.index, S = s == null ? void 0 : s.key;
|
|
631
|
+
let y = h;
|
|
632
|
+
if (o.isProcessInprogress(y) || (n[p] = !0), s) {
|
|
633
|
+
const g = i.processedSchemas.value[v][S][f][d];
|
|
634
|
+
g && o.isObject(g) && d !== "component" && (y = b(g, y)), i.processedSchemas.value[v][S][f][d] = y, i.stableUpdater(n);
|
|
656
635
|
} else {
|
|
657
|
-
const g =
|
|
658
|
-
g && o.isObject(g) && d !== "component" && (
|
|
636
|
+
const g = i.processedSchemas.value[f][d];
|
|
637
|
+
g && o.isObject(g) && d !== "component" && (y = b(g, y)), i.processedSchemas.value[f][d] = y, i.stableUpdater(n);
|
|
659
638
|
}
|
|
660
639
|
}
|
|
661
640
|
}
|
|
662
641
|
// 只做基本的对象 parser
|
|
663
642
|
objectParser(e) {
|
|
664
|
-
const
|
|
665
|
-
Object.keys(
|
|
666
|
-
var a,
|
|
667
|
-
if (
|
|
668
|
-
this.parseSchemas(
|
|
643
|
+
const t = e.data;
|
|
644
|
+
Object.keys(t).forEach((i, n) => {
|
|
645
|
+
var a, u;
|
|
646
|
+
if (i === "children")
|
|
647
|
+
this.parseSchemas(t[i], {
|
|
669
648
|
...e,
|
|
670
|
-
key:
|
|
649
|
+
key: i,
|
|
671
650
|
keyIndex: n
|
|
672
651
|
});
|
|
673
652
|
else {
|
|
674
|
-
const
|
|
653
|
+
const f = (d) => {
|
|
675
654
|
e.updater({
|
|
676
655
|
...e,
|
|
677
|
-
key:
|
|
656
|
+
key: i,
|
|
678
657
|
keyIndex: n,
|
|
679
658
|
stable: d
|
|
680
659
|
});
|
|
681
660
|
};
|
|
682
|
-
o.isFunction(
|
|
661
|
+
o.isFunction(t[i]) ? i !== "defaultValue" ? this.schemaEffect.trackEffect(
|
|
683
662
|
() => {
|
|
684
|
-
if (
|
|
685
|
-
const d =
|
|
686
|
-
this.promiseFieldParser(d,
|
|
663
|
+
if (i === "component") {
|
|
664
|
+
const d = t[i](this.getRuntimeMeta());
|
|
665
|
+
this.promiseFieldParser(d, f, !1, {
|
|
687
666
|
rootIndex: e.index,
|
|
688
667
|
parentMeta: e.parentMeta
|
|
689
668
|
});
|
|
690
669
|
} else
|
|
691
|
-
this.fieldParser(
|
|
670
|
+
this.fieldParser(t[i], f, {
|
|
692
671
|
rootIndex: e.index,
|
|
693
672
|
parentMeta: e.parentMeta
|
|
694
673
|
});
|
|
695
674
|
},
|
|
696
675
|
{
|
|
697
676
|
lazy: !1,
|
|
698
|
-
identifier: `${(a = e.parentMeta) == null ? void 0 : a.key}${(
|
|
677
|
+
identifier: `${(a = e.parentMeta) == null ? void 0 : a.key}${(u = e.parentMeta) == null ? void 0 : u.index}${e.index}${i}${n}`
|
|
699
678
|
}
|
|
700
679
|
) : this.defaultValueEffect.trackEffect(
|
|
701
680
|
() => {
|
|
702
681
|
const d = this.schemaEffect.trackEffect(
|
|
703
682
|
() => {
|
|
704
|
-
/\{\s*model\s*\}/.test(
|
|
705
|
-
|
|
683
|
+
/\{\s*model\s*\}/.test(t[i].toString()) ? this.fieldParser(
|
|
684
|
+
t[i],
|
|
706
685
|
(p) => {
|
|
707
686
|
if (!p)
|
|
708
|
-
return
|
|
709
|
-
this.defaultValueInprogressMap.set(
|
|
687
|
+
return f(p);
|
|
688
|
+
this.defaultValueInprogressMap.set(t[i], p), !o.isProcessInprogress(p) && this.defaultValueInprogressMap.size === this.baseDefaultValueFunctionsLength && Array.from(
|
|
710
689
|
this.defaultValueInprogressMap.values()
|
|
711
|
-
).every((
|
|
712
|
-
var
|
|
713
|
-
return !((
|
|
714
|
-
}) ? (
|
|
690
|
+
).every((h) => {
|
|
691
|
+
var v;
|
|
692
|
+
return !((v = h == null ? void 0 : h.includes) != null && v.call(h, "undefined"));
|
|
693
|
+
}) ? (f(p), this.defaultValueEffect.clearEffects(), _(() => {
|
|
715
694
|
d();
|
|
716
|
-
})) :
|
|
695
|
+
})) : f(p);
|
|
717
696
|
},
|
|
718
697
|
{
|
|
719
698
|
rootIndex: e.index,
|
|
720
699
|
parentMeta: e.parentMeta
|
|
721
700
|
}
|
|
722
701
|
) : this.fieldParser(
|
|
723
|
-
|
|
702
|
+
t[i],
|
|
724
703
|
(p) => {
|
|
725
|
-
this.defaultValueInprogressMap.set(
|
|
704
|
+
this.defaultValueInprogressMap.set(t[i], p), !o.isProcessInprogress(p) && this.defaultValueInprogressMap.size === this.baseDefaultValueFunctionsLength && Array.from(
|
|
726
705
|
this.defaultValueInprogressMap.values()
|
|
727
|
-
).every((
|
|
728
|
-
var
|
|
729
|
-
return !((
|
|
730
|
-
}) ? (
|
|
706
|
+
).every((h) => {
|
|
707
|
+
var v;
|
|
708
|
+
return !((v = h == null ? void 0 : h.includes) != null && v.call(h, "undefined"));
|
|
709
|
+
}) ? (f(p), this.defaultValueEffect.clearEffects(), _(() => {
|
|
731
710
|
d();
|
|
732
|
-
})) :
|
|
711
|
+
})) : f(p);
|
|
733
712
|
},
|
|
734
713
|
{
|
|
735
714
|
rootIndex: e.index,
|
|
@@ -745,183 +724,188 @@ class mr {
|
|
|
745
724
|
{
|
|
746
725
|
lazy: !1
|
|
747
726
|
}
|
|
748
|
-
) :
|
|
727
|
+
) : i === "component" || i === "slots" || i === "runtime" ? this.promiseFieldParser(t[i], f, !1, {
|
|
749
728
|
rootIndex: e.index,
|
|
750
729
|
parentMeta: e.parentMeta
|
|
751
|
-
}) : this.fieldParser(
|
|
730
|
+
}) : this.fieldParser(t[i], f, {
|
|
752
731
|
rootIndex: e.index,
|
|
753
732
|
parentMeta: e.parentMeta
|
|
754
733
|
});
|
|
755
734
|
}
|
|
756
735
|
});
|
|
757
736
|
}
|
|
758
|
-
promiseFieldParser(e,
|
|
737
|
+
promiseFieldParser(e, t, s, i) {
|
|
759
738
|
o.isPromise(e) ? e.then((n) => {
|
|
760
|
-
o.isString(n) && (n =
|
|
739
|
+
o.isString(n) && (n = Z(n, "")), s && o.isObject(n) && !o.isNativeObject(n) ? this.objectParser({
|
|
761
740
|
data: n,
|
|
762
|
-
updater:
|
|
763
|
-
index:
|
|
764
|
-
parentMeta:
|
|
765
|
-
}) :
|
|
766
|
-
}) : (o.isString(e) && (e =
|
|
741
|
+
updater: t,
|
|
742
|
+
index: i.rootIndex,
|
|
743
|
+
parentMeta: i.parentMeta
|
|
744
|
+
}) : t(n);
|
|
745
|
+
}) : (o.isString(e) && (e = Z(e, "")), s && o.isObject(e) && !o.isNativeObject(e) ? this.objectParser({
|
|
767
746
|
data: e,
|
|
768
|
-
updater:
|
|
769
|
-
index:
|
|
770
|
-
parentMeta:
|
|
771
|
-
}) :
|
|
747
|
+
updater: t,
|
|
748
|
+
index: i.rootIndex,
|
|
749
|
+
parentMeta: i.parentMeta
|
|
750
|
+
}) : t(e));
|
|
772
751
|
}
|
|
773
752
|
// 对任意对象中单个字段的 parse: 做基本处理
|
|
774
|
-
fieldParser(e,
|
|
753
|
+
fieldParser(e, t, s, i = !0) {
|
|
775
754
|
if (o.isFunction(e))
|
|
776
755
|
if (e.name.startsWith("__proform_raw_"))
|
|
777
|
-
|
|
756
|
+
t(
|
|
778
757
|
(...n) => e({
|
|
779
758
|
rawArgs: n,
|
|
780
759
|
...this.getRuntimeMeta()
|
|
781
760
|
})
|
|
782
761
|
);
|
|
783
762
|
else if (e.name.startsWith("__proform_structured_path_parsing_mark_"))
|
|
784
|
-
|
|
763
|
+
t(e);
|
|
785
764
|
else if (e.__proform_cached_result) {
|
|
786
765
|
const n = e.__proform_cached_result;
|
|
787
|
-
this.promiseFieldParser(n,
|
|
766
|
+
this.promiseFieldParser(n, t, i, s);
|
|
788
767
|
} else {
|
|
789
768
|
const n = e(this.getRuntimeMeta());
|
|
790
|
-
e.name.startsWith("__proform_onetime_") && (e.__proform_cached_result = n), this.promiseFieldParser(n,
|
|
769
|
+
e.name.startsWith("__proform_onetime_") && (e.__proform_cached_result = n), this.promiseFieldParser(n, t, i, s);
|
|
791
770
|
}
|
|
792
771
|
else
|
|
793
|
-
|
|
772
|
+
U(e) ? E(
|
|
794
773
|
() => e.value,
|
|
795
774
|
() => {
|
|
796
|
-
o.isUndefined(e.value) || (
|
|
775
|
+
o.isUndefined(e.value) || (i && o.isObject(e.value) && !o.isNativeObject(e.value) ? this.objectParser({
|
|
797
776
|
data: e.value,
|
|
798
|
-
updater:
|
|
799
|
-
index:
|
|
800
|
-
parentMeta:
|
|
801
|
-
}) :
|
|
777
|
+
updater: t,
|
|
778
|
+
index: s.rootIndex,
|
|
779
|
+
parentMeta: s.parentMeta
|
|
780
|
+
}) : t(e.value));
|
|
802
781
|
},
|
|
803
782
|
{
|
|
804
783
|
immediate: !0,
|
|
805
784
|
deep: !0
|
|
806
785
|
}
|
|
807
|
-
) :
|
|
786
|
+
) : T(e) ? E(
|
|
808
787
|
() => e,
|
|
809
788
|
() => {
|
|
810
|
-
o.isUndefined(e) || (
|
|
789
|
+
o.isUndefined(e) || (i && o.isObject(e) && !o.isNativeObject(e) ? this.objectParser({
|
|
811
790
|
data: e,
|
|
812
|
-
updater:
|
|
813
|
-
index:
|
|
814
|
-
parentMeta:
|
|
815
|
-
}) :
|
|
791
|
+
updater: t,
|
|
792
|
+
index: s.rootIndex,
|
|
793
|
+
parentMeta: s.parentMeta
|
|
794
|
+
}) : t(e));
|
|
816
795
|
},
|
|
817
796
|
{
|
|
818
797
|
immediate: !0,
|
|
819
798
|
deep: !0
|
|
820
799
|
}
|
|
821
|
-
) :
|
|
800
|
+
) : i && o.isObject(e) && !o.isNativeObject(e) ? this.objectParser({
|
|
822
801
|
data: e,
|
|
823
|
-
updater:
|
|
824
|
-
index:
|
|
825
|
-
parentMeta:
|
|
826
|
-
}) :
|
|
802
|
+
updater: t,
|
|
803
|
+
index: s.rootIndex,
|
|
804
|
+
parentMeta: s.parentMeta
|
|
805
|
+
}) : t(e);
|
|
827
806
|
}
|
|
828
807
|
modelProcessor(e) {
|
|
829
808
|
e.map(
|
|
830
|
-
(
|
|
831
|
-
), o.isObjectEmpty(this.stableModel) && this.stableUpdaterProcessProgress.every(Boolean) && this.defaultValueEffect.effects.size === 0 && (
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
}),
|
|
809
|
+
(t) => this.createModel(t, this.processedModel.value)
|
|
810
|
+
), o.isObjectEmpty(this.stableModel) && this.stableUpdaterProcessProgress.every(Boolean) && this.defaultValueEffect.effects.size === 0 && _(() => {
|
|
811
|
+
this.stableModel = C(this.processedModel.value), this.runtimeCore.hydrateEffect.triggerEffects(), this.runtimeCore.hydrateEffect.clearEffects();
|
|
812
|
+
});
|
|
813
|
+
}
|
|
814
|
+
setModel(e, t, s) {
|
|
815
|
+
o.isFunction(t) ? P(e, t(), s) : b(e, {
|
|
816
|
+
[t]: s
|
|
817
|
+
});
|
|
818
|
+
}
|
|
819
|
+
createModel(e, t) {
|
|
820
|
+
o.isListSchema(e) && (t[e.field] || this.setModel(t, e.field, [{}]), e.children.forEach((s) => {
|
|
821
|
+
this.createModel(s, t[e.field][0]);
|
|
822
|
+
})), o.isGroupSchema(e) && e.children.forEach((s) => {
|
|
823
|
+
this.createModel(s, t);
|
|
824
|
+
}), o.isItemSchema(e) && _(() => {
|
|
842
825
|
if ("defaultValue" in e)
|
|
843
|
-
this.setModel(
|
|
826
|
+
this.setModel(t, e.field, e.defaultValue);
|
|
844
827
|
else {
|
|
845
|
-
if (o.isFunction(e.field) &&
|
|
828
|
+
if (o.isFunction(e.field) && H(t, e.field()))
|
|
846
829
|
return;
|
|
847
|
-
if (o.isString(e.field) &&
|
|
830
|
+
if (o.isString(e.field) && t[e.field])
|
|
848
831
|
return;
|
|
849
|
-
this.setModel(
|
|
832
|
+
this.setModel(t, e.field, void 0);
|
|
850
833
|
}
|
|
834
|
+
});
|
|
851
835
|
}
|
|
852
836
|
}
|
|
853
|
-
class
|
|
837
|
+
class j {
|
|
854
838
|
static getFormContainer({ ui: e } = {}) {
|
|
855
|
-
return
|
|
839
|
+
return c.presets.uiPresets[e ?? c.presets.ui].container.Form;
|
|
856
840
|
}
|
|
857
841
|
static getFormItemContainer({ ui: e } = {}) {
|
|
858
|
-
return
|
|
842
|
+
return c.presets.uiPresets[e ?? c.presets.ui].container.FormItem;
|
|
859
843
|
}
|
|
860
844
|
static getItemContainer({ ui: e } = {}) {
|
|
861
|
-
return
|
|
845
|
+
return c.presets.uiPresets[e ?? c.presets.ui].container.Item;
|
|
862
846
|
}
|
|
863
847
|
static getGroupContainer({ ui: e } = {}) {
|
|
864
|
-
return
|
|
848
|
+
return c.presets.uiPresets[e ?? c.presets.ui].container.Group;
|
|
865
849
|
}
|
|
866
850
|
static getListContainer({ ui: e } = {}) {
|
|
867
|
-
return
|
|
851
|
+
return c.presets.uiPresets[e ?? c.presets.ui].container.List;
|
|
868
852
|
}
|
|
869
853
|
static getListItemContainer({ ui: e } = {}) {
|
|
870
|
-
return
|
|
854
|
+
return c.presets.uiPresets[e ?? c.presets.ui].container.ListItem;
|
|
871
855
|
}
|
|
872
856
|
}
|
|
873
|
-
class
|
|
857
|
+
class br {
|
|
874
858
|
constructor(e) {
|
|
875
859
|
this.ui = e;
|
|
876
860
|
}
|
|
877
861
|
getRuntimeNative() {
|
|
878
|
-
var
|
|
879
|
-
return (
|
|
862
|
+
var t;
|
|
863
|
+
return (t = c.presets.uiPresets[this.ui]) == null ? void 0 : t.native;
|
|
880
864
|
}
|
|
881
865
|
getRuntimeField(e) {
|
|
882
|
-
var
|
|
883
|
-
const
|
|
884
|
-
return (
|
|
866
|
+
var i;
|
|
867
|
+
const t = (i = c.presets.uiPresets[this.ui]) == null ? void 0 : i.adapter, s = I.adapters[c.getUI(this.ui)];
|
|
868
|
+
return (t == null ? void 0 : t.getRuntimeField(e)) ?? (s == null ? void 0 : s.getRuntimeField(e));
|
|
885
869
|
}
|
|
886
870
|
getRuntimeRequired(e) {
|
|
887
|
-
var
|
|
888
|
-
const
|
|
889
|
-
return (
|
|
871
|
+
var i;
|
|
872
|
+
const t = (i = c.presets.uiPresets[this.ui]) == null ? void 0 : i.adapter, s = I.adapters[c.getUI(this.ui)];
|
|
873
|
+
return (t == null ? void 0 : t.getRuntimeRequired(e)) ?? (s == null ? void 0 : s.getRuntimeRequired(e));
|
|
890
874
|
}
|
|
891
875
|
getFormModelPropName() {
|
|
892
|
-
var
|
|
893
|
-
const e = (
|
|
894
|
-
return (e == null ? void 0 : e.getFormModelPropName()) ?? (
|
|
876
|
+
var s;
|
|
877
|
+
const e = (s = c.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, t = I.adapters[c.getUI(this.ui)];
|
|
878
|
+
return (e == null ? void 0 : e.getFormModelPropName()) ?? (t == null ? void 0 : t.getFormModelPropName());
|
|
895
879
|
}
|
|
896
880
|
formComponentRenderer(e) {
|
|
897
|
-
var
|
|
898
|
-
const
|
|
899
|
-
return (
|
|
881
|
+
var i;
|
|
882
|
+
const t = (i = c.presets.uiPresets[this.ui]) == null ? void 0 : i.adapter, s = I.adapters[c.getUI(this.ui)];
|
|
883
|
+
return (t == null ? void 0 : t.formComponentRenderer(e)) ?? (s == null ? void 0 : s.formComponentRenderer(e));
|
|
900
884
|
}
|
|
901
885
|
clearValidate(e) {
|
|
902
|
-
var
|
|
903
|
-
const
|
|
904
|
-
return (
|
|
886
|
+
var i;
|
|
887
|
+
const t = (i = c.presets.uiPresets[this.ui]) == null ? void 0 : i.adapter, s = I.adapters[c.getUI(this.ui)];
|
|
888
|
+
return (t == null ? void 0 : t.clearValidate(e)) ?? (s == null ? void 0 : s.clearValidate(e));
|
|
905
889
|
}
|
|
906
890
|
}
|
|
907
|
-
function
|
|
908
|
-
return typeof
|
|
891
|
+
function vr(r) {
|
|
892
|
+
return typeof r == "function" || Object.prototype.toString.call(r) === "[object Object]" && !Be(r);
|
|
909
893
|
}
|
|
910
|
-
class
|
|
894
|
+
class yr {
|
|
911
895
|
constructor(e) {
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
896
|
+
l(this, "schemas", L([]));
|
|
897
|
+
l(this, "model", L({}));
|
|
898
|
+
l(this, "processorBySchemaType", {
|
|
915
899
|
item: this.runtimeItemProcessor.bind(this),
|
|
916
900
|
group: this.runtimeGroupProcessor.bind(this),
|
|
917
901
|
list: this.runtimeListProcessor.bind(this)
|
|
918
902
|
});
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
903
|
+
l(this, "formRef", L(null));
|
|
904
|
+
l(this, "hydrateEffect", new J());
|
|
905
|
+
l(this, "native", W({}));
|
|
906
|
+
l(this, "grid", {});
|
|
907
|
+
l(this, "runtime", {});
|
|
908
|
+
l(this, "globalNativeFormOverride", W({
|
|
925
909
|
props: {
|
|
926
910
|
Form: {},
|
|
927
911
|
FormItem: {}
|
|
@@ -931,107 +915,97 @@ class br {
|
|
|
931
915
|
FormItem: {}
|
|
932
916
|
}
|
|
933
917
|
}));
|
|
934
|
-
|
|
935
|
-
this
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
918
|
+
l(this, "shared", W({}));
|
|
919
|
+
l(this, "shareHistory", /* @__PURE__ */ new Map());
|
|
920
|
+
this.setup = e, this.processor = new gr(this);
|
|
921
|
+
const t = this.setup(this);
|
|
922
|
+
if (this.ui = t.ui ?? c.presets.ui, this.runtimeAdapter = new br(this.ui), Object.assign(this.globalNativeFormOverride, this.runtimeAdapter.getRuntimeNative()), U(t.schemas))
|
|
923
|
+
E(
|
|
939
924
|
// @ts-expect-error
|
|
940
|
-
() =>
|
|
925
|
+
() => t.schemas.value,
|
|
941
926
|
() => {
|
|
942
|
-
this.processor.parseSchemas(
|
|
927
|
+
this.processor.parseSchemas(t.schemas.value);
|
|
943
928
|
},
|
|
944
929
|
{
|
|
945
930
|
deep: !0
|
|
946
931
|
}
|
|
947
932
|
);
|
|
948
|
-
else if (
|
|
949
|
-
const
|
|
950
|
-
this.processor.parseSchemas(
|
|
951
|
-
|
|
933
|
+
else if (T(t.schemas)) {
|
|
934
|
+
const s = E(() => t.schemas, () => {
|
|
935
|
+
this.processor.parseSchemas(t.schemas), _(() => {
|
|
936
|
+
s();
|
|
952
937
|
});
|
|
953
938
|
}, {
|
|
954
939
|
deep: !0
|
|
955
940
|
});
|
|
956
941
|
} else
|
|
957
|
-
this.processor.parseSchemas(
|
|
942
|
+
this.processor.parseSchemas(t.schemas);
|
|
958
943
|
}
|
|
959
944
|
getRuntimeMeta() {
|
|
960
945
|
return {
|
|
961
|
-
model:
|
|
946
|
+
model: x(C(this.model.value)),
|
|
962
947
|
reactiveModel: this.model.value,
|
|
963
948
|
shared: this.shared,
|
|
964
949
|
// share 增加防抖,当开发者在过程中进行 share 时避免频繁触发爆栈
|
|
965
|
-
share: (
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
})
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
immediate: !0
|
|
950
|
+
share: (t) => {
|
|
951
|
+
_(() => {
|
|
952
|
+
Object.keys(t).forEach((s) => {
|
|
953
|
+
U(t[s]) ? D(() => {
|
|
954
|
+
P(this.shared, s, t[s].value), this.shareHistory.get(s) !== t[s].value && (this.shareHistory.set(s, t[s].value), this.processor.schemaEffect.triggerEffects());
|
|
955
|
+
}) : T(t[s]) ? D(() => {
|
|
956
|
+
P(this.shared, s, t[s]), this.shareHistory.get(s) !== t[s] && (this.shareHistory.set(s, t[s]), this.processor.schemaEffect.triggerEffects());
|
|
957
|
+
}) : (P(this.shared, s, t[s]), this.shareHistory.get(s) !== t[s] && (this.shareHistory.set(s, t[s]), this.processor.schemaEffect.triggerEffects()));
|
|
974
958
|
});
|
|
975
|
-
}
|
|
976
|
-
const i = _(() => r, () => {
|
|
977
|
-
h(this.shared, r), P(() => {
|
|
978
|
-
i();
|
|
979
|
-
});
|
|
980
|
-
}, {
|
|
981
|
-
deep: !0,
|
|
982
|
-
immediate: !0
|
|
983
|
-
});
|
|
984
|
-
} else
|
|
985
|
-
h(this.shared, r);
|
|
959
|
+
});
|
|
986
960
|
}
|
|
987
961
|
};
|
|
988
962
|
}
|
|
989
|
-
runtimeItemProcessor(e,
|
|
990
|
-
var ie,
|
|
991
|
-
const n =
|
|
963
|
+
runtimeItemProcessor(e, t, s = this.model.value, i) {
|
|
964
|
+
var ie, ne, oe, ae, le, ue, fe, ce, de, pe, he, me, ge, be, ve, ye, _e;
|
|
965
|
+
const n = x(e.component);
|
|
992
966
|
if (!n)
|
|
993
967
|
return;
|
|
994
|
-
(
|
|
995
|
-
const a =
|
|
968
|
+
(ne = (ie = e.native) == null ? void 0 : ie.props) != null && ne.Form && b(this.globalNativeFormOverride.props.Form, (ae = (oe = e.native) == null ? void 0 : oe.props) == null ? void 0 : ae.Form), (ue = (le = e.native) == null ? void 0 : le.slots) != null && ue.Form && b(this.globalNativeFormOverride.slots.Form, (ce = (fe = e.native) == null ? void 0 : fe.slots) == null ? void 0 : ce.Form);
|
|
969
|
+
const a = b(C((pe = (de = this.native) == null ? void 0 : de.slots) == null ? void 0 : pe.FormItem) ?? {}, (me = (he = e.native) == null ? void 0 : he.slots) == null ? void 0 : me.FormItem), u = {
|
|
996
970
|
display: "grid",
|
|
997
971
|
gridColumn: "1 / -1",
|
|
998
972
|
...e.grid
|
|
999
|
-
},
|
|
973
|
+
}, f = b(C((be = (ge = this.native) == null ? void 0 : ge.props) == null ? void 0 : be.FormItem) ?? {}, (ye = (ve = e.native) == null ? void 0 : ve.props) == null ? void 0 : ye.FormItem), d = this.runtimeAdapter.getRuntimeField({
|
|
1000
974
|
schema: e,
|
|
1001
|
-
parentSchema:
|
|
1002
|
-
index:
|
|
1003
|
-
}), p = n.name,
|
|
1004
|
-
let S = e.placeholder,
|
|
1005
|
-
|
|
975
|
+
parentSchema: i,
|
|
976
|
+
index: t
|
|
977
|
+
}), p = n.name, h = e.componentProps ?? {}, v = I.placeholderPresetByComponentName;
|
|
978
|
+
let S = e.placeholder, y = e.show;
|
|
979
|
+
y === void 0 && (y = !0);
|
|
1006
980
|
let g = e.label ?? "", O;
|
|
1007
|
-
if (e.runtime ? O = e.runtime : O = (
|
|
1008
|
-
let
|
|
1009
|
-
o.isUndefined(p) ? S = `${
|
|
1010
|
-
|
|
1011
|
-
p.toLowerCase().includes(
|
|
1012
|
-
}), S = `${
|
|
981
|
+
if (e.runtime ? O = e.runtime : O = (i == null ? void 0 : i.runtime) ?? this.runtime, !o.isUndefined(t) && !o.isObjectEmpty(O) && (g = Z((_e = O == null ? void 0 : O.customizeListItemLabel) == null ? void 0 : _e.call(O, e.label ?? "", t + 1), "")), !S) {
|
|
982
|
+
let V = "请输入";
|
|
983
|
+
o.isUndefined(p) ? S = `${V}${g}` : /* @ts-expect-error */ v[p.toLowerCase()] ? (V = // @ts-expect-error
|
|
984
|
+
v[p.toLowerCase()], S = `${V}${g}`) : (Object.keys(v).forEach((Pe) => {
|
|
985
|
+
p.toLowerCase().includes(Pe.toLowerCase()) && (V = v[Pe]);
|
|
986
|
+
}), S = `${V}${g}`);
|
|
1013
987
|
}
|
|
1014
|
-
const
|
|
988
|
+
const Ve = this.runtimeAdapter.getRuntimeRequired({
|
|
1015
989
|
...e,
|
|
1016
990
|
label: g
|
|
1017
|
-
}),
|
|
1018
|
-
return
|
|
1019
|
-
style:
|
|
1020
|
-
}, [
|
|
1021
|
-
show:
|
|
991
|
+
}), Ne = j.getItemContainer(this), qe = j.getFormItemContainer(this), Ue = this, Te = e.componentSlots;
|
|
992
|
+
return m("div", {
|
|
993
|
+
style: u
|
|
994
|
+
}, [m(Ne, {
|
|
995
|
+
show: y
|
|
1022
996
|
}, {
|
|
1023
997
|
default() {
|
|
1024
|
-
return
|
|
998
|
+
return y && m(qe, q(f, {
|
|
1025
999
|
label: `${g ? `${g}:` : ""}`
|
|
1026
|
-
}, d,
|
|
1000
|
+
}, d, Ve), {
|
|
1027
1001
|
default() {
|
|
1028
|
-
return
|
|
1002
|
+
return Ue.runtimeAdapter.formComponentRenderer({
|
|
1029
1003
|
Component: n,
|
|
1030
1004
|
schema: e,
|
|
1031
|
-
baseModel:
|
|
1005
|
+
baseModel: s,
|
|
1032
1006
|
placeholder: S,
|
|
1033
|
-
componentSlots:
|
|
1034
|
-
props:
|
|
1007
|
+
componentSlots: Te,
|
|
1008
|
+
props: h
|
|
1035
1009
|
});
|
|
1036
1010
|
},
|
|
1037
1011
|
...a
|
|
@@ -1040,326 +1014,321 @@ class br {
|
|
|
1040
1014
|
})]);
|
|
1041
1015
|
}
|
|
1042
1016
|
runtimeGroupProcessor(e) {
|
|
1043
|
-
let
|
|
1044
|
-
const
|
|
1017
|
+
let t;
|
|
1018
|
+
const s = {
|
|
1045
1019
|
display: "grid",
|
|
1046
1020
|
gridColumn: "1 / -1",
|
|
1047
1021
|
...e.grid
|
|
1048
|
-
},
|
|
1022
|
+
}, i = j.getGroupContainer(this);
|
|
1049
1023
|
let n = e.show;
|
|
1050
|
-
return n === void 0 && (n = !0),
|
|
1051
|
-
style:
|
|
1052
|
-
}, [n &&
|
|
1024
|
+
return n === void 0 && (n = !0), m("div", {
|
|
1025
|
+
style: s
|
|
1026
|
+
}, [n && m(i, {
|
|
1053
1027
|
schema: e
|
|
1054
|
-
},
|
|
1055
|
-
default: () => [
|
|
1028
|
+
}, vr(t = e.children.map((a) => this.runtimeItemProcessor(a))) ? t : {
|
|
1029
|
+
default: () => [t]
|
|
1056
1030
|
})]);
|
|
1057
1031
|
}
|
|
1058
1032
|
addListItem(e) {
|
|
1059
|
-
var
|
|
1060
|
-
|
|
1061
|
-
return Promise.reject({
|
|
1062
|
-
code: "0001",
|
|
1063
|
-
message: "异步默认值数据正在处理中,请您耐心等待... "
|
|
1064
|
-
});
|
|
1065
|
-
(i = this.processor.stableModel[e.field]) != null && i[0] && this.model.value[e.field].push(C(this.processor.stableModel[e.field][0])), this.runtimeAdapter.clearValidate(this);
|
|
1033
|
+
var t;
|
|
1034
|
+
console.log("this", this.processor.stableModel, e.field), (t = this.processor.stableModel[e.field]) != null && t[0] && this.model.value[e.field].push(C(this.processor.stableModel[e.field][0])), this.runtimeAdapter.clearValidate(this);
|
|
1066
1035
|
}
|
|
1067
|
-
deleteListItem(e,
|
|
1068
|
-
this.model.value[e.field].splice(
|
|
1036
|
+
deleteListItem(e, t) {
|
|
1037
|
+
this.model.value[e.field].splice(t, 1), this.runtimeAdapter.clearValidate(this);
|
|
1069
1038
|
}
|
|
1070
1039
|
runtimeListProcessor(e) {
|
|
1071
|
-
const
|
|
1040
|
+
const t = {
|
|
1072
1041
|
display: "grid",
|
|
1073
1042
|
gridColumn: "1 / -1",
|
|
1074
1043
|
...e.grid
|
|
1075
|
-
},
|
|
1076
|
-
|
|
1077
|
-
let
|
|
1078
|
-
|
|
1079
|
-
const n =
|
|
1080
|
-
return
|
|
1081
|
-
style:
|
|
1082
|
-
}, [
|
|
1044
|
+
}, s = this;
|
|
1045
|
+
s.model.value[e.field] || (s.model.value[e.field] = [{}]);
|
|
1046
|
+
let i = e.show;
|
|
1047
|
+
i === void 0 && (i = !0);
|
|
1048
|
+
const n = j.getListContainer(this), a = j.getListItemContainer(this);
|
|
1049
|
+
return m("div", {
|
|
1050
|
+
style: t
|
|
1051
|
+
}, [i && m(n, {
|
|
1083
1052
|
schema: e
|
|
1084
1053
|
}, {
|
|
1085
1054
|
default() {
|
|
1086
|
-
return
|
|
1055
|
+
return s.model.value[e.field].map((u, f) => m(a, null, {
|
|
1087
1056
|
default() {
|
|
1088
|
-
return e.children.map((d) =>
|
|
1057
|
+
return e.children.map((d) => s.runtimeItemProcessor(d, f, u, e));
|
|
1089
1058
|
},
|
|
1090
1059
|
delete({
|
|
1091
1060
|
container: d
|
|
1092
1061
|
} = {}) {
|
|
1093
|
-
var
|
|
1094
|
-
const p = d ??
|
|
1095
|
-
return
|
|
1096
|
-
onClick: () =>
|
|
1097
|
-
}, null), [[De, ((
|
|
1062
|
+
var h;
|
|
1063
|
+
const p = d ?? m("button", null, null);
|
|
1064
|
+
return He(m(p, {
|
|
1065
|
+
onClick: () => s.deleteListItem(e, f)
|
|
1066
|
+
}, null), [[De, ((h = s.model.value[e.field]) == null ? void 0 : h.length) > 1]]);
|
|
1098
1067
|
}
|
|
1099
1068
|
}));
|
|
1100
1069
|
},
|
|
1101
1070
|
add({
|
|
1102
|
-
container:
|
|
1071
|
+
container: u
|
|
1103
1072
|
} = {}) {
|
|
1104
|
-
const
|
|
1105
|
-
return
|
|
1106
|
-
onClick: () =>
|
|
1073
|
+
const f = u ?? m("button", null, [Ge("添加")]);
|
|
1074
|
+
return m(f, {
|
|
1075
|
+
onClick: () => s.addListItem(e)
|
|
1107
1076
|
}, null);
|
|
1108
1077
|
}
|
|
1109
1078
|
})]);
|
|
1110
1079
|
}
|
|
1111
1080
|
runtimeProcessor(e) {
|
|
1112
|
-
return e.map((
|
|
1081
|
+
return e.map((t) => (t.type || (t.type = "item"), this.processorBySchemaType[t.type](t)));
|
|
1113
1082
|
}
|
|
1114
1083
|
exec() {
|
|
1115
|
-
var
|
|
1084
|
+
var u, f, d, p;
|
|
1116
1085
|
const e = {
|
|
1117
1086
|
display: "grid",
|
|
1118
1087
|
gridColumn: "1 / -1",
|
|
1119
1088
|
gridAutoColumns: "1fr",
|
|
1120
1089
|
...this.grid
|
|
1121
|
-
},
|
|
1122
|
-
return
|
|
1090
|
+
}, t = this, s = b(this.globalNativeFormOverride.props.Form, C((f = (u = this.native) == null ? void 0 : u.props) == null ? void 0 : f.Form) ?? {}), i = b(this.globalNativeFormOverride.slots.Form, C((p = (d = this.native) == null ? void 0 : d.slots) == null ? void 0 : p.Form) ?? {}), n = j.getFormContainer(this), a = this.runtimeAdapter.getFormModelPropName();
|
|
1091
|
+
return m(n, q(s, {
|
|
1123
1092
|
ref: this.formRef
|
|
1124
1093
|
}, {
|
|
1125
1094
|
[a]: this.model.value
|
|
1126
1095
|
}), {
|
|
1127
1096
|
default() {
|
|
1128
|
-
return
|
|
1097
|
+
return m("div", {
|
|
1129
1098
|
style: e
|
|
1130
|
-
}, [
|
|
1099
|
+
}, [t.runtimeProcessor(t.schemas.value)]);
|
|
1131
1100
|
},
|
|
1132
|
-
...
|
|
1101
|
+
...i
|
|
1133
1102
|
});
|
|
1134
1103
|
}
|
|
1135
1104
|
}
|
|
1136
|
-
class
|
|
1105
|
+
class c {
|
|
1137
1106
|
static getPreset(e) {
|
|
1138
|
-
var
|
|
1139
|
-
return (
|
|
1107
|
+
var t, s, i;
|
|
1108
|
+
return (s = (t = this.presets.uiPresets) == null ? void 0 : t[e]) != null && s.extend ? this.presets.uiPresets[(i = this.presets.uiPresets[e]) == null ? void 0 : i.extend] : this.presets.uiPresets[e];
|
|
1140
1109
|
}
|
|
1141
1110
|
static getUI(e) {
|
|
1142
|
-
var
|
|
1143
|
-
return (
|
|
1111
|
+
var t, s, i;
|
|
1112
|
+
return (s = (t = this.presets.uiPresets) == null ? void 0 : t[e]) != null && s.extend ? (i = this.presets.uiPresets[e]) == null ? void 0 : i.extend : e;
|
|
1144
1113
|
}
|
|
1145
1114
|
}
|
|
1146
|
-
|
|
1147
|
-
function
|
|
1148
|
-
parentSchema:
|
|
1115
|
+
l(c, "presets");
|
|
1116
|
+
function Y({
|
|
1117
|
+
parentSchema: r,
|
|
1149
1118
|
schema: e,
|
|
1150
|
-
index:
|
|
1119
|
+
index: t
|
|
1151
1120
|
}) {
|
|
1152
|
-
return
|
|
1121
|
+
return r ? `${r.field}.${t}.${e.field}` : e.field;
|
|
1153
1122
|
}
|
|
1154
|
-
const
|
|
1123
|
+
const _r = {
|
|
1155
1124
|
ArcoVue: {
|
|
1156
|
-
getRuntimeField(
|
|
1157
|
-
const e =
|
|
1125
|
+
getRuntimeField(r) {
|
|
1126
|
+
const e = Y(r);
|
|
1158
1127
|
return o.isFunction(e) ? {
|
|
1159
1128
|
field: e()
|
|
1160
1129
|
} : {
|
|
1161
1130
|
field: e
|
|
1162
1131
|
};
|
|
1163
1132
|
},
|
|
1164
|
-
getRuntimeRequired(
|
|
1133
|
+
getRuntimeRequired(r) {
|
|
1165
1134
|
var e;
|
|
1166
|
-
if (
|
|
1167
|
-
if (!
|
|
1168
|
-
|
|
1135
|
+
if (r.required)
|
|
1136
|
+
if (!r.rules)
|
|
1137
|
+
r.rules = [], r.rules.push({
|
|
1169
1138
|
required: !0,
|
|
1170
|
-
message: `${
|
|
1139
|
+
message: `${r.label}是必填项`
|
|
1171
1140
|
});
|
|
1172
1141
|
else {
|
|
1173
|
-
const
|
|
1174
|
-
|
|
1142
|
+
const t = r.rules.findIndex((s) => !o.isUndefined(s.required));
|
|
1143
|
+
t !== -1 ? (r.rules[t].required = !0, r.rules[t].message = `${r.label}是必填项`) : r.rules.unshift({
|
|
1175
1144
|
required: !0,
|
|
1176
|
-
message: `${
|
|
1145
|
+
message: `${r.label}是必填项`
|
|
1177
1146
|
});
|
|
1178
1147
|
}
|
|
1179
|
-
else if (
|
|
1180
|
-
const
|
|
1181
|
-
|
|
1148
|
+
else if (r.rules) {
|
|
1149
|
+
const t = (e = r.rules) == null ? void 0 : e.findIndex((s) => !!s.required);
|
|
1150
|
+
t !== -1 ? r.rules[t].required = !1 : r.rules.unshift({
|
|
1182
1151
|
required: !0,
|
|
1183
|
-
message: `${
|
|
1152
|
+
message: `${r.label}是必填项`
|
|
1184
1153
|
});
|
|
1185
1154
|
}
|
|
1186
1155
|
return {
|
|
1187
|
-
rules:
|
|
1156
|
+
rules: r.rules
|
|
1188
1157
|
};
|
|
1189
1158
|
},
|
|
1190
1159
|
getFormModelPropName() {
|
|
1191
1160
|
return "model";
|
|
1192
1161
|
},
|
|
1193
1162
|
formComponentRenderer({
|
|
1194
|
-
Component:
|
|
1163
|
+
Component: r,
|
|
1195
1164
|
baseModel: e,
|
|
1196
|
-
schema:
|
|
1197
|
-
placeholder:
|
|
1198
|
-
componentSlots:
|
|
1165
|
+
schema: t,
|
|
1166
|
+
placeholder: s,
|
|
1167
|
+
componentSlots: i,
|
|
1199
1168
|
props: n
|
|
1200
1169
|
}) {
|
|
1201
1170
|
let a;
|
|
1202
|
-
return o.isFunction(
|
|
1171
|
+
return o.isFunction(t.field) ? a = H(e, t.field()) : a = e[t.field], m(r, q({
|
|
1203
1172
|
modelValue: a,
|
|
1204
|
-
"onUpdate:modelValue": (
|
|
1205
|
-
o.isFunction(
|
|
1173
|
+
"onUpdate:modelValue": (u) => {
|
|
1174
|
+
o.isFunction(t.field) ? P(e, t.field(), u) : e[t.field] = u;
|
|
1206
1175
|
},
|
|
1207
|
-
placeholder:
|
|
1176
|
+
placeholder: s
|
|
1208
1177
|
}, n), {
|
|
1209
|
-
...
|
|
1178
|
+
...i
|
|
1210
1179
|
});
|
|
1211
1180
|
},
|
|
1212
|
-
validateForm(
|
|
1213
|
-
return new Promise((e,
|
|
1214
|
-
|
|
1181
|
+
validateForm(r) {
|
|
1182
|
+
return new Promise((e, t) => {
|
|
1183
|
+
r.runtimeCore.formRef.value.validate((s) => s ? t(s) : e(r.cleanFallbackFields(x(r.runtimeCore.processor.processedModel.value))));
|
|
1215
1184
|
});
|
|
1216
1185
|
},
|
|
1217
|
-
clearValidate(
|
|
1218
|
-
var e,
|
|
1219
|
-
(
|
|
1186
|
+
clearValidate(r) {
|
|
1187
|
+
var e, t;
|
|
1188
|
+
(t = (e = r.formRef.value) == null ? void 0 : e.clearValidate) == null || t.call(e);
|
|
1220
1189
|
}
|
|
1221
1190
|
},
|
|
1222
1191
|
NutUI: {
|
|
1223
|
-
getRuntimeField(
|
|
1224
|
-
const e =
|
|
1192
|
+
getRuntimeField(r) {
|
|
1193
|
+
const e = Y(r);
|
|
1225
1194
|
return o.isFunction(e) ? {
|
|
1226
1195
|
prop: e()
|
|
1227
1196
|
} : {
|
|
1228
1197
|
prop: e
|
|
1229
1198
|
};
|
|
1230
1199
|
},
|
|
1231
|
-
getRuntimeRequired(
|
|
1200
|
+
getRuntimeRequired(r) {
|
|
1232
1201
|
var e;
|
|
1233
|
-
if (
|
|
1234
|
-
if (!
|
|
1235
|
-
|
|
1202
|
+
if (r.required)
|
|
1203
|
+
if (!r.rules)
|
|
1204
|
+
r.rules = [], r.rules.push({
|
|
1236
1205
|
required: !0,
|
|
1237
|
-
message: `${
|
|
1206
|
+
message: `${r.label}是必填项`
|
|
1238
1207
|
});
|
|
1239
1208
|
else {
|
|
1240
|
-
const
|
|
1241
|
-
|
|
1209
|
+
const t = r.rules.findIndex((s) => !o.isUndefined(s.required));
|
|
1210
|
+
t !== -1 ? (r.rules[t].required = !0, r.rules[t].message = `${r.label}是必填项`) : r.rules.unshift({
|
|
1242
1211
|
required: !0,
|
|
1243
|
-
message: `${
|
|
1212
|
+
message: `${r.label}是必填项`
|
|
1244
1213
|
});
|
|
1245
1214
|
}
|
|
1246
|
-
else if (
|
|
1247
|
-
const
|
|
1248
|
-
|
|
1215
|
+
else if (r.rules) {
|
|
1216
|
+
const t = (e = r.rules) == null ? void 0 : e.findIndex((s) => !!s.required);
|
|
1217
|
+
t !== -1 ? r.rules[t].required = !1 : r.rules.unshift({
|
|
1249
1218
|
required: !0,
|
|
1250
|
-
message: `${
|
|
1219
|
+
message: `${r.label}是必填项`
|
|
1251
1220
|
});
|
|
1252
1221
|
}
|
|
1253
1222
|
return {
|
|
1254
|
-
rules:
|
|
1255
|
-
required:
|
|
1223
|
+
rules: r.rules,
|
|
1224
|
+
required: r.required
|
|
1256
1225
|
};
|
|
1257
1226
|
},
|
|
1258
1227
|
getFormModelPropName() {
|
|
1259
1228
|
return "modelValue";
|
|
1260
1229
|
},
|
|
1261
1230
|
formComponentRenderer({
|
|
1262
|
-
Component:
|
|
1231
|
+
Component: r,
|
|
1263
1232
|
baseModel: e,
|
|
1264
|
-
schema:
|
|
1265
|
-
placeholder:
|
|
1266
|
-
componentSlots:
|
|
1233
|
+
schema: t,
|
|
1234
|
+
placeholder: s,
|
|
1235
|
+
componentSlots: i,
|
|
1267
1236
|
props: n
|
|
1268
1237
|
}) {
|
|
1269
1238
|
let a;
|
|
1270
|
-
return o.isFunction(
|
|
1239
|
+
return o.isFunction(t.field) ? a = H(e, t.field()) : a = e[t.field], m(r, q({
|
|
1271
1240
|
modelValue: a,
|
|
1272
|
-
"onUpdate:modelValue": (
|
|
1273
|
-
o.isFunction(
|
|
1241
|
+
"onUpdate:modelValue": (u) => {
|
|
1242
|
+
o.isFunction(t.field) ? P(e, t.field(), u) : e[t.field] = u;
|
|
1274
1243
|
},
|
|
1275
|
-
placeholder:
|
|
1244
|
+
placeholder: s
|
|
1276
1245
|
}, n), {
|
|
1277
|
-
...
|
|
1246
|
+
...i
|
|
1278
1247
|
});
|
|
1279
1248
|
},
|
|
1280
|
-
validateForm(
|
|
1281
|
-
return new Promise((e,
|
|
1282
|
-
|
|
1283
|
-
valid:
|
|
1284
|
-
errors:
|
|
1249
|
+
validateForm(r) {
|
|
1250
|
+
return new Promise((e, t) => {
|
|
1251
|
+
r.runtimeCore.formRef.value.validate().then(({
|
|
1252
|
+
valid: s,
|
|
1253
|
+
errors: i
|
|
1285
1254
|
}) => {
|
|
1286
|
-
|
|
1255
|
+
s ? e(r.cleanFallbackFields(x(r.runtimeCore.processor.processedModel.value))) : t(i);
|
|
1287
1256
|
});
|
|
1288
1257
|
});
|
|
1289
1258
|
},
|
|
1290
|
-
clearValidate(
|
|
1291
|
-
var e,
|
|
1292
|
-
(
|
|
1259
|
+
clearValidate(r) {
|
|
1260
|
+
var e, t;
|
|
1261
|
+
(t = (e = r.formRef.value) == null ? void 0 : e.reset) == null || t.call(e);
|
|
1293
1262
|
}
|
|
1294
1263
|
},
|
|
1295
1264
|
NaiveUI: {
|
|
1296
|
-
getRuntimeField(
|
|
1297
|
-
const e =
|
|
1265
|
+
getRuntimeField(r) {
|
|
1266
|
+
const e = Y(r);
|
|
1298
1267
|
return o.isFunction(e) ? {
|
|
1299
1268
|
path: e()
|
|
1300
1269
|
} : {
|
|
1301
1270
|
path: e
|
|
1302
1271
|
};
|
|
1303
1272
|
},
|
|
1304
|
-
getRuntimeRequired(
|
|
1273
|
+
getRuntimeRequired(r) {
|
|
1305
1274
|
var e;
|
|
1306
|
-
if (
|
|
1307
|
-
if (!
|
|
1308
|
-
|
|
1275
|
+
if (r.required)
|
|
1276
|
+
if (!r.rules)
|
|
1277
|
+
r.rules = [], r.rules.push({
|
|
1309
1278
|
required: !0,
|
|
1310
|
-
message: `${
|
|
1279
|
+
message: `${r.label}是必填项`,
|
|
1311
1280
|
trigger: ["input", "blur"]
|
|
1312
1281
|
});
|
|
1313
1282
|
else {
|
|
1314
|
-
const
|
|
1315
|
-
|
|
1283
|
+
const t = r.rules.findIndex((s) => !o.isUndefined(s.required));
|
|
1284
|
+
t !== -1 ? (r.rules[t].required = !0, r.rules[t].message = `${r.label}是必填项`) : r.rules.unshift({
|
|
1316
1285
|
required: !0,
|
|
1317
|
-
message: `${
|
|
1286
|
+
message: `${r.label}是必填项`,
|
|
1318
1287
|
trigger: ["input", "blur"]
|
|
1319
1288
|
});
|
|
1320
1289
|
}
|
|
1321
|
-
else if (
|
|
1322
|
-
const
|
|
1323
|
-
|
|
1290
|
+
else if (r.rules) {
|
|
1291
|
+
const t = (e = r.rules) == null ? void 0 : e.findIndex((s) => !!s.required);
|
|
1292
|
+
t !== -1 ? r.rules[t].required = !1 : r.rules.unshift({
|
|
1324
1293
|
required: !0,
|
|
1325
|
-
message: `${
|
|
1294
|
+
message: `${r.label}是必填项`,
|
|
1326
1295
|
trigger: ["input", "blur"]
|
|
1327
1296
|
});
|
|
1328
1297
|
}
|
|
1329
1298
|
return {
|
|
1330
|
-
rule:
|
|
1299
|
+
rule: r.rules
|
|
1331
1300
|
};
|
|
1332
1301
|
},
|
|
1333
1302
|
getFormModelPropName() {
|
|
1334
1303
|
return "model";
|
|
1335
1304
|
},
|
|
1336
1305
|
formComponentRenderer({
|
|
1337
|
-
Component:
|
|
1306
|
+
Component: r,
|
|
1338
1307
|
baseModel: e,
|
|
1339
|
-
schema:
|
|
1340
|
-
placeholder:
|
|
1341
|
-
componentSlots:
|
|
1308
|
+
schema: t,
|
|
1309
|
+
placeholder: s,
|
|
1310
|
+
componentSlots: i,
|
|
1342
1311
|
props: n
|
|
1343
1312
|
}) {
|
|
1344
1313
|
let a;
|
|
1345
|
-
return o.isFunction(
|
|
1314
|
+
return o.isFunction(t.field) ? a = H(e, t.field()) : a = e[t.field], m(r, q({
|
|
1346
1315
|
value: a,
|
|
1347
|
-
"onUpdate:value": (
|
|
1348
|
-
o.isFunction(
|
|
1316
|
+
"onUpdate:value": (u) => {
|
|
1317
|
+
o.isFunction(t.field) ? P(e, t.field(), u) : e[t.field] = u;
|
|
1349
1318
|
},
|
|
1350
|
-
placeholder:
|
|
1319
|
+
placeholder: s
|
|
1351
1320
|
}, n), {
|
|
1352
|
-
...
|
|
1321
|
+
...i
|
|
1353
1322
|
});
|
|
1354
1323
|
},
|
|
1355
|
-
validateForm(
|
|
1356
|
-
return new Promise((e,
|
|
1357
|
-
|
|
1324
|
+
validateForm(r) {
|
|
1325
|
+
return new Promise((e, t) => {
|
|
1326
|
+
r.runtimeCore.formRef.value.validate((s) => s ? t(s) : e(r.cleanFallbackFields(x(r.runtimeCore.processor.processedModel.value))));
|
|
1358
1327
|
});
|
|
1359
1328
|
},
|
|
1360
|
-
clearValidate(
|
|
1361
|
-
var e,
|
|
1362
|
-
(
|
|
1329
|
+
clearValidate(r) {
|
|
1330
|
+
var e, t;
|
|
1331
|
+
(t = (e = r.formRef.value) == null ? void 0 : e.restoreValidation) == null || t.call(e);
|
|
1363
1332
|
}
|
|
1364
1333
|
}
|
|
1365
1334
|
}, M = class M {
|
|
@@ -1367,15 +1336,15 @@ const vr = {
|
|
|
1367
1336
|
const e = {
|
|
1368
1337
|
请选择: ["select", "tree"],
|
|
1369
1338
|
请输入: ["input"]
|
|
1370
|
-
},
|
|
1371
|
-
for (const
|
|
1372
|
-
e[
|
|
1373
|
-
|
|
1339
|
+
}, t = {};
|
|
1340
|
+
for (const s in e)
|
|
1341
|
+
e[s].forEach((i) => {
|
|
1342
|
+
t[i] = s;
|
|
1374
1343
|
});
|
|
1375
|
-
return
|
|
1344
|
+
return t;
|
|
1376
1345
|
}
|
|
1377
1346
|
};
|
|
1378
|
-
|
|
1347
|
+
l(M, "schemaPreset", {
|
|
1379
1348
|
type: {
|
|
1380
1349
|
defaultValue: "item"
|
|
1381
1350
|
},
|
|
@@ -1421,32 +1390,32 @@ u(M, "schemaPreset", {
|
|
|
1421
1390
|
runtime: {
|
|
1422
1391
|
default: void 0
|
|
1423
1392
|
}
|
|
1424
|
-
}),
|
|
1393
|
+
}), l(M, "componentPropsPreset", {
|
|
1425
1394
|
options: {
|
|
1426
1395
|
defaultValue: []
|
|
1427
1396
|
}
|
|
1428
1397
|
}), // 基于基本功能提出基本预设
|
|
1429
|
-
|
|
1430
|
-
let
|
|
1398
|
+
l(M, "placeholderPresetByComponentName", M.getPlaceholderPrefixPresetByComponentName());
|
|
1399
|
+
let Q = M;
|
|
1431
1400
|
const I = {
|
|
1432
|
-
...
|
|
1401
|
+
...Q,
|
|
1433
1402
|
adapters: {
|
|
1434
|
-
...
|
|
1403
|
+
..._r
|
|
1435
1404
|
}
|
|
1436
|
-
},
|
|
1405
|
+
}, Ir = /* @__PURE__ */ Ke({
|
|
1437
1406
|
props: {
|
|
1438
1407
|
setup: {
|
|
1439
1408
|
type: Function,
|
|
1440
1409
|
required: !0
|
|
1441
1410
|
}
|
|
1442
1411
|
},
|
|
1443
|
-
setup(
|
|
1444
|
-
const e = new
|
|
1412
|
+
setup(r) {
|
|
1413
|
+
const e = new yr(r.setup);
|
|
1445
1414
|
return () => e.exec();
|
|
1446
1415
|
}
|
|
1447
1416
|
});
|
|
1448
|
-
function
|
|
1449
|
-
const e = new
|
|
1417
|
+
function Sr(r) {
|
|
1418
|
+
const e = new mr(r);
|
|
1450
1419
|
return [
|
|
1451
1420
|
e.setup.bind(e),
|
|
1452
1421
|
{
|
|
@@ -1458,46 +1427,46 @@ function Ir(t) {
|
|
|
1458
1427
|
}
|
|
1459
1428
|
];
|
|
1460
1429
|
}
|
|
1461
|
-
function
|
|
1462
|
-
|
|
1430
|
+
function Or(r) {
|
|
1431
|
+
c.presets = r;
|
|
1463
1432
|
}
|
|
1464
|
-
function
|
|
1465
|
-
return e === "native" && Object.defineProperty(
|
|
1466
|
-
value: `__proform_raw_${
|
|
1433
|
+
function se(r, e) {
|
|
1434
|
+
return e === "native" && Object.defineProperty(r, "name", {
|
|
1435
|
+
value: `__proform_raw_${r.name}`,
|
|
1467
1436
|
writable: !0
|
|
1468
|
-
}), e === "structured_path_parsing_mark" && Object.defineProperty(
|
|
1469
|
-
value: `__proform_structured_path_parsing_mark_${
|
|
1437
|
+
}), e === "structured_path_parsing_mark" && Object.defineProperty(r, "name", {
|
|
1438
|
+
value: `__proform_structured_path_parsing_mark_${r.name}`,
|
|
1470
1439
|
writable: !0
|
|
1471
|
-
}), e === "onetime" && Object.defineProperty(
|
|
1472
|
-
value: `__proform_onetime_${
|
|
1440
|
+
}), e === "onetime" && Object.defineProperty(r, "name", {
|
|
1441
|
+
value: `__proform_onetime_${r.name}`,
|
|
1473
1442
|
writable: !0
|
|
1474
|
-
}),
|
|
1443
|
+
}), r;
|
|
1475
1444
|
}
|
|
1476
|
-
function
|
|
1477
|
-
return
|
|
1445
|
+
function Er(r) {
|
|
1446
|
+
return se(r, "native");
|
|
1478
1447
|
}
|
|
1479
|
-
function Fr(
|
|
1480
|
-
return
|
|
1448
|
+
function Fr(r) {
|
|
1449
|
+
return r.__proform_raw_object = !0, r;
|
|
1481
1450
|
}
|
|
1482
|
-
function
|
|
1483
|
-
return
|
|
1451
|
+
function wr(r) {
|
|
1452
|
+
return se(r, "onetime");
|
|
1484
1453
|
}
|
|
1485
|
-
function
|
|
1454
|
+
function jr(r) {
|
|
1486
1455
|
function e() {
|
|
1487
|
-
return
|
|
1456
|
+
return r;
|
|
1488
1457
|
}
|
|
1489
|
-
return
|
|
1458
|
+
return se(
|
|
1490
1459
|
e,
|
|
1491
1460
|
"structured_path_parsing_mark"
|
|
1492
1461
|
);
|
|
1493
1462
|
}
|
|
1494
1463
|
export {
|
|
1495
|
-
|
|
1496
|
-
|
|
1464
|
+
Ir as ProForm,
|
|
1465
|
+
Er as markNativeFunction,
|
|
1497
1466
|
Fr as markNativeObject,
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1467
|
+
wr as markOnetimeFunction,
|
|
1468
|
+
jr as markStructuredPathParsing,
|
|
1469
|
+
Sr as useForm,
|
|
1470
|
+
Or as useFormPresetConfigurer,
|
|
1471
|
+
se as useModifiers
|
|
1503
1472
|
};
|