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