@harbor-design/proform 1.3.33 → 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
|
|
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,46 +487,25 @@ class He {
|
|
|
172
487
|
});
|
|
173
488
|
}
|
|
174
489
|
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();
|
|
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()));
|
|
497
|
+
});
|
|
204
498
|
});
|
|
205
499
|
}
|
|
206
500
|
subscribeModel(e) {
|
|
207
|
-
|
|
208
|
-
const
|
|
501
|
+
O(() => {
|
|
502
|
+
const t = E(
|
|
209
503
|
() => this.readonlyReactiveModel.value,
|
|
210
|
-
(
|
|
211
|
-
e(
|
|
504
|
+
(s) => {
|
|
505
|
+
e(s, {
|
|
212
506
|
stopSubscribe() {
|
|
213
|
-
|
|
214
|
-
|
|
507
|
+
O(() => {
|
|
508
|
+
t();
|
|
215
509
|
});
|
|
216
510
|
}
|
|
217
511
|
});
|
|
@@ -225,17 +519,17 @@ class He {
|
|
|
225
519
|
}
|
|
226
520
|
resetModel() {
|
|
227
521
|
var e;
|
|
228
|
-
(e = this.runtimeCore) != null && e.model.value && (this.runtimeCore.model.value =
|
|
522
|
+
(e = this.runtimeCore) != null && e.model.value && (this.runtimeCore.model.value = P(
|
|
229
523
|
this.runtimeCore.processor.stableModel
|
|
230
|
-
), this.readonlyReactiveModel.value =
|
|
524
|
+
), this.readonlyReactiveModel.value = Ce(this.runtimeCore.model.value), this.runtimeCore.runtimeAdapter.clearValidate(this.runtimeCore));
|
|
231
525
|
}
|
|
232
526
|
}
|
|
233
|
-
class
|
|
527
|
+
class J {
|
|
234
528
|
constructor() {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
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");
|
|
239
533
|
}
|
|
240
534
|
clearEffects() {
|
|
241
535
|
this.effects.clear();
|
|
@@ -243,344 +537,30 @@ class Y {
|
|
|
243
537
|
triggerEffects() {
|
|
244
538
|
Array.from(this.effects).forEach((e) => e());
|
|
245
539
|
}
|
|
246
|
-
trackEffect(e,
|
|
540
|
+
trackEffect(e, t = {
|
|
247
541
|
lazy: !0
|
|
248
542
|
}) {
|
|
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 {
|
|
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);
|
|
259
544
|
}
|
|
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
545
|
}
|
|
283
|
-
|
|
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]);
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
F.prototype.clear = Vt;
|
|
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 {
|
|
546
|
+
class gr {
|
|
567
547
|
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),
|
|
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(
|
|
584
564
|
() => this.processedModel.value,
|
|
585
565
|
() => {
|
|
586
566
|
this.schemaEffect.triggerEffects();
|
|
@@ -591,145 +571,145 @@ class mr {
|
|
|
591
571
|
);
|
|
592
572
|
}
|
|
593
573
|
// 核心处理过程,接收一个初始的代理数据结构,由其衍生的有 parseSchema
|
|
594
|
-
parse(e,
|
|
595
|
-
e.forEach((
|
|
596
|
-
this.parseItem(
|
|
574
|
+
parse(e, t) {
|
|
575
|
+
e.forEach((s, i) => {
|
|
576
|
+
this.parseItem(s, i, t);
|
|
597
577
|
});
|
|
598
578
|
}
|
|
599
579
|
// 初始化空数据结构,避免后续复杂的 if else
|
|
600
580
|
initSchemas(e) {
|
|
601
|
-
return e.map((
|
|
602
|
-
const
|
|
603
|
-
return
|
|
581
|
+
return e.map((t) => {
|
|
582
|
+
const s = {};
|
|
583
|
+
return t.children && (s.children = this.initSchemas(t.children)), s;
|
|
604
584
|
});
|
|
605
585
|
}
|
|
606
586
|
countFunctionDefaultValues(e) {
|
|
607
|
-
let
|
|
608
|
-
const
|
|
609
|
-
function
|
|
610
|
-
if (!
|
|
611
|
-
|
|
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);
|
|
612
592
|
for (const a in n)
|
|
613
|
-
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]));
|
|
614
594
|
}
|
|
615
595
|
}
|
|
616
|
-
return
|
|
596
|
+
return i(e), t;
|
|
617
597
|
}
|
|
618
598
|
// 派生过程,用于外部应用
|
|
619
|
-
parseSchemas(e,
|
|
599
|
+
parseSchemas(e, t) {
|
|
620
600
|
o.isArrayEmpty(this.processedSchemas.value) && (this.baseDefaultValueFunctionsLength = this.countFunctionDefaultValues(
|
|
621
|
-
|
|
622
|
-
), this.processedSchemas.value = this.initSchemas(e)), this.parse(e,
|
|
601
|
+
P(e)
|
|
602
|
+
), this.processedSchemas.value = this.initSchemas(e)), this.parse(e, t);
|
|
623
603
|
}
|
|
624
604
|
parseStable(e) {
|
|
625
|
-
const
|
|
605
|
+
const t = {};
|
|
626
606
|
if (!o.isUndefined(e.stable))
|
|
627
|
-
|
|
607
|
+
t[e.key] = this.parseStable(e.stable);
|
|
628
608
|
else
|
|
629
609
|
return e;
|
|
630
|
-
return
|
|
610
|
+
return t;
|
|
631
611
|
}
|
|
632
612
|
// 对于稳定初始化更新的抽象
|
|
633
613
|
stableUpdater(e = []) {
|
|
634
614
|
if (e.every(Boolean)) {
|
|
635
|
-
const
|
|
636
|
-
!o.isProcessInprogress(
|
|
637
|
-
length:
|
|
638
|
-
}).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));
|
|
639
619
|
}
|
|
640
620
|
}
|
|
641
621
|
// 核心单 schema 处理过程,接收一个对象键值对的数据结构
|
|
642
|
-
parseItem(e,
|
|
643
|
-
const
|
|
644
|
-
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
|
|
645
625
|
}).fill(!1);
|
|
646
|
-
this.objectParser({ data: e, index:
|
|
647
|
-
function a(
|
|
648
|
-
const
|
|
649
|
-
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))
|
|
650
630
|
return;
|
|
651
|
-
const
|
|
652
|
-
let
|
|
653
|
-
if (o.isProcessInprogress(
|
|
654
|
-
const g =
|
|
655
|
-
g && o.isObject(g) && d !== "component" && (
|
|
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);
|
|
656
636
|
} else {
|
|
657
|
-
const g =
|
|
658
|
-
g && o.isObject(g) && d !== "component" && (
|
|
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);
|
|
659
639
|
}
|
|
660
640
|
}
|
|
661
641
|
}
|
|
662
642
|
// 只做基本的对象 parser
|
|
663
643
|
objectParser(e) {
|
|
664
|
-
const
|
|
665
|
-
Object.keys(
|
|
666
|
-
var a,
|
|
667
|
-
if (
|
|
668
|
-
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], {
|
|
669
649
|
...e,
|
|
670
|
-
key:
|
|
650
|
+
key: i,
|
|
671
651
|
keyIndex: n
|
|
672
652
|
});
|
|
673
653
|
else {
|
|
674
|
-
const
|
|
654
|
+
const f = (d) => {
|
|
675
655
|
e.updater({
|
|
676
656
|
...e,
|
|
677
|
-
key:
|
|
657
|
+
key: i,
|
|
678
658
|
keyIndex: n,
|
|
679
659
|
stable: d
|
|
680
660
|
});
|
|
681
661
|
};
|
|
682
|
-
o.isFunction(
|
|
662
|
+
o.isFunction(t[i]) ? i !== "defaultValue" ? this.schemaEffect.trackEffect(
|
|
683
663
|
() => {
|
|
684
|
-
if (
|
|
685
|
-
const d =
|
|
686
|
-
this.promiseFieldParser(d,
|
|
664
|
+
if (i === "component") {
|
|
665
|
+
const d = t[i](this.getRuntimeMeta());
|
|
666
|
+
this.promiseFieldParser(d, f, !1, {
|
|
687
667
|
rootIndex: e.index,
|
|
688
668
|
parentMeta: e.parentMeta
|
|
689
669
|
});
|
|
690
670
|
} else
|
|
691
|
-
this.fieldParser(
|
|
671
|
+
this.fieldParser(t[i], f, {
|
|
692
672
|
rootIndex: e.index,
|
|
693
673
|
parentMeta: e.parentMeta
|
|
694
674
|
});
|
|
695
675
|
},
|
|
696
676
|
{
|
|
697
677
|
lazy: !1,
|
|
698
|
-
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}`
|
|
699
679
|
}
|
|
700
680
|
) : this.defaultValueEffect.trackEffect(
|
|
701
681
|
() => {
|
|
702
682
|
const d = this.schemaEffect.trackEffect(
|
|
703
683
|
() => {
|
|
704
|
-
/\{\s*model\s*\}/.test(
|
|
705
|
-
|
|
706
|
-
(
|
|
707
|
-
if (!
|
|
708
|
-
return
|
|
709
|
-
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(
|
|
710
690
|
this.defaultValueInprogressMap.values()
|
|
711
|
-
).every((
|
|
691
|
+
).every((p) => {
|
|
712
692
|
var b;
|
|
713
|
-
return !((b =
|
|
714
|
-
}) ? (
|
|
693
|
+
return !((b = p == null ? void 0 : p.includes) != null && b.call(p, "undefined"));
|
|
694
|
+
}) ? (f(h), this.defaultValueEffect.clearEffects(), O(() => {
|
|
715
695
|
d();
|
|
716
|
-
})) :
|
|
696
|
+
})) : f(h);
|
|
717
697
|
},
|
|
718
698
|
{
|
|
719
699
|
rootIndex: e.index,
|
|
720
700
|
parentMeta: e.parentMeta
|
|
721
701
|
}
|
|
722
702
|
) : this.fieldParser(
|
|
723
|
-
|
|
724
|
-
(
|
|
725
|
-
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(
|
|
726
706
|
this.defaultValueInprogressMap.values()
|
|
727
|
-
).every((
|
|
707
|
+
).every((p) => {
|
|
728
708
|
var b;
|
|
729
|
-
return !((b =
|
|
730
|
-
}) ? (
|
|
709
|
+
return !((b = p == null ? void 0 : p.includes) != null && b.call(p, "undefined"));
|
|
710
|
+
}) ? (f(h), this.defaultValueEffect.clearEffects(), O(() => {
|
|
731
711
|
d();
|
|
732
|
-
})) :
|
|
712
|
+
})) : f(h);
|
|
733
713
|
},
|
|
734
714
|
{
|
|
735
715
|
rootIndex: e.index,
|
|
@@ -745,183 +725,183 @@ class mr {
|
|
|
745
725
|
{
|
|
746
726
|
lazy: !1
|
|
747
727
|
}
|
|
748
|
-
) :
|
|
728
|
+
) : i === "component" || i === "slots" || i === "runtime" ? this.promiseFieldParser(t[i], f, !1, {
|
|
749
729
|
rootIndex: e.index,
|
|
750
730
|
parentMeta: e.parentMeta
|
|
751
|
-
}) : this.fieldParser(
|
|
731
|
+
}) : this.fieldParser(t[i], f, {
|
|
752
732
|
rootIndex: e.index,
|
|
753
733
|
parentMeta: e.parentMeta
|
|
754
734
|
});
|
|
755
735
|
}
|
|
756
736
|
});
|
|
757
737
|
}
|
|
758
|
-
promiseFieldParser(e,
|
|
738
|
+
promiseFieldParser(e, t, s, i) {
|
|
759
739
|
o.isPromise(e) ? e.then((n) => {
|
|
760
|
-
o.isString(n) && (n =
|
|
740
|
+
o.isString(n) && (n = Z(n, "")), s && o.isObject(n) && !o.isNativeObject(n) ? this.objectParser({
|
|
761
741
|
data: n,
|
|
762
|
-
updater:
|
|
763
|
-
index:
|
|
764
|
-
parentMeta:
|
|
765
|
-
}) :
|
|
766
|
-
}) : (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({
|
|
767
747
|
data: e,
|
|
768
|
-
updater:
|
|
769
|
-
index:
|
|
770
|
-
parentMeta:
|
|
771
|
-
}) :
|
|
748
|
+
updater: t,
|
|
749
|
+
index: i.rootIndex,
|
|
750
|
+
parentMeta: i.parentMeta
|
|
751
|
+
}) : t(e));
|
|
772
752
|
}
|
|
773
753
|
// 对任意对象中单个字段的 parse: 做基本处理
|
|
774
|
-
fieldParser(e,
|
|
754
|
+
fieldParser(e, t, s, i = !0) {
|
|
775
755
|
if (o.isFunction(e))
|
|
776
756
|
if (e.name.startsWith("__proform_raw_"))
|
|
777
|
-
|
|
757
|
+
t(
|
|
778
758
|
(...n) => e({
|
|
779
759
|
rawArgs: n,
|
|
780
760
|
...this.getRuntimeMeta()
|
|
781
761
|
})
|
|
782
762
|
);
|
|
783
763
|
else if (e.name.startsWith("__proform_structured_path_parsing_mark_"))
|
|
784
|
-
|
|
764
|
+
t(e);
|
|
785
765
|
else if (e.__proform_cached_result) {
|
|
786
766
|
const n = e.__proform_cached_result;
|
|
787
|
-
this.promiseFieldParser(n,
|
|
767
|
+
this.promiseFieldParser(n, t, i, s);
|
|
788
768
|
} else {
|
|
789
769
|
const n = e(this.getRuntimeMeta());
|
|
790
|
-
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);
|
|
791
771
|
}
|
|
792
772
|
else
|
|
793
|
-
|
|
773
|
+
T(e) ? E(
|
|
794
774
|
() => e.value,
|
|
795
775
|
() => {
|
|
796
|
-
o.isUndefined(e.value) || (
|
|
776
|
+
o.isUndefined(e.value) || (i && o.isObject(e.value) && !o.isNativeObject(e.value) ? this.objectParser({
|
|
797
777
|
data: e.value,
|
|
798
|
-
updater:
|
|
799
|
-
index:
|
|
800
|
-
parentMeta:
|
|
801
|
-
}) :
|
|
778
|
+
updater: t,
|
|
779
|
+
index: s.rootIndex,
|
|
780
|
+
parentMeta: s.parentMeta
|
|
781
|
+
}) : t(e.value));
|
|
802
782
|
},
|
|
803
783
|
{
|
|
804
784
|
immediate: !0,
|
|
805
785
|
deep: !0
|
|
806
786
|
}
|
|
807
|
-
) : U(e) ?
|
|
787
|
+
) : U(e) ? E(
|
|
808
788
|
() => e,
|
|
809
789
|
() => {
|
|
810
|
-
o.isUndefined(e) || (
|
|
790
|
+
o.isUndefined(e) || (i && o.isObject(e) && !o.isNativeObject(e) ? this.objectParser({
|
|
811
791
|
data: e,
|
|
812
|
-
updater:
|
|
813
|
-
index:
|
|
814
|
-
parentMeta:
|
|
815
|
-
}) :
|
|
792
|
+
updater: t,
|
|
793
|
+
index: s.rootIndex,
|
|
794
|
+
parentMeta: s.parentMeta
|
|
795
|
+
}) : t(e));
|
|
816
796
|
},
|
|
817
797
|
{
|
|
818
798
|
immediate: !0,
|
|
819
799
|
deep: !0
|
|
820
800
|
}
|
|
821
|
-
) :
|
|
801
|
+
) : i && o.isObject(e) && !o.isNativeObject(e) ? this.objectParser({
|
|
822
802
|
data: e,
|
|
823
|
-
updater:
|
|
824
|
-
index:
|
|
825
|
-
parentMeta:
|
|
826
|
-
}) :
|
|
803
|
+
updater: t,
|
|
804
|
+
index: s.rootIndex,
|
|
805
|
+
parentMeta: s.parentMeta
|
|
806
|
+
}) : t(e);
|
|
827
807
|
}
|
|
828
808
|
modelProcessor(e) {
|
|
829
809
|
e.map(
|
|
830
|
-
(
|
|
831
|
-
), o.isObjectEmpty(this.stableModel) && this.stableUpdaterProcessProgress.every(Boolean) && this.defaultValueEffect.effects.size === 0 && (this.stableModel =
|
|
810
|
+
(t) => this.createModel(t, this.processedModel.value)
|
|
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());
|
|
832
812
|
}
|
|
833
|
-
setModel(e,
|
|
834
|
-
o.isFunction(
|
|
813
|
+
setModel(e, t, s) {
|
|
814
|
+
o.isFunction(t) ? _(e, t(), s) : e[t] = s;
|
|
835
815
|
}
|
|
836
|
-
createModel(e,
|
|
837
|
-
if (o.isListSchema(e) && (
|
|
838
|
-
this.createModel(
|
|
839
|
-
})), o.isGroupSchema(e) && e.children.forEach((
|
|
840
|
-
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);
|
|
841
821
|
}), o.isItemSchema(e))
|
|
842
822
|
if ("defaultValue" in e)
|
|
843
|
-
this.setModel(
|
|
823
|
+
this.setModel(t, e.field, e.defaultValue);
|
|
844
824
|
else {
|
|
845
|
-
if (o.isFunction(e.field) &&
|
|
825
|
+
if (o.isFunction(e.field) && H(t, e.field()))
|
|
846
826
|
return;
|
|
847
|
-
if (o.isString(e.field) &&
|
|
827
|
+
if (o.isString(e.field) && t[e.field])
|
|
848
828
|
return;
|
|
849
|
-
this.setModel(
|
|
829
|
+
this.setModel(t, e.field, void 0);
|
|
850
830
|
}
|
|
851
831
|
}
|
|
852
832
|
}
|
|
853
833
|
class w {
|
|
854
834
|
static getFormContainer({ ui: e } = {}) {
|
|
855
|
-
return
|
|
835
|
+
return c.presets.uiPresets[e ?? c.presets.ui].container.Form;
|
|
856
836
|
}
|
|
857
837
|
static getFormItemContainer({ ui: e } = {}) {
|
|
858
|
-
return
|
|
838
|
+
return c.presets.uiPresets[e ?? c.presets.ui].container.FormItem;
|
|
859
839
|
}
|
|
860
840
|
static getItemContainer({ ui: e } = {}) {
|
|
861
|
-
return
|
|
841
|
+
return c.presets.uiPresets[e ?? c.presets.ui].container.Item;
|
|
862
842
|
}
|
|
863
843
|
static getGroupContainer({ ui: e } = {}) {
|
|
864
|
-
return
|
|
844
|
+
return c.presets.uiPresets[e ?? c.presets.ui].container.Group;
|
|
865
845
|
}
|
|
866
846
|
static getListContainer({ ui: e } = {}) {
|
|
867
|
-
return
|
|
847
|
+
return c.presets.uiPresets[e ?? c.presets.ui].container.List;
|
|
868
848
|
}
|
|
869
849
|
static getListItemContainer({ ui: e } = {}) {
|
|
870
|
-
return
|
|
850
|
+
return c.presets.uiPresets[e ?? c.presets.ui].container.ListItem;
|
|
871
851
|
}
|
|
872
852
|
}
|
|
873
|
-
class
|
|
853
|
+
class br {
|
|
874
854
|
constructor(e) {
|
|
875
855
|
this.ui = e;
|
|
876
856
|
}
|
|
877
857
|
getRuntimeNative() {
|
|
878
|
-
var
|
|
879
|
-
return (
|
|
858
|
+
var t;
|
|
859
|
+
return (t = c.presets.uiPresets[this.ui]) == null ? void 0 : t.native;
|
|
880
860
|
}
|
|
881
861
|
getRuntimeField(e) {
|
|
882
|
-
var
|
|
883
|
-
const
|
|
884
|
-
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));
|
|
885
865
|
}
|
|
886
866
|
getRuntimeRequired(e) {
|
|
887
|
-
var
|
|
888
|
-
const
|
|
889
|
-
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));
|
|
890
870
|
}
|
|
891
871
|
getFormModelPropName() {
|
|
892
|
-
var
|
|
893
|
-
const e = (
|
|
894
|
-
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());
|
|
895
875
|
}
|
|
896
876
|
formComponentRenderer(e) {
|
|
897
|
-
var
|
|
898
|
-
const
|
|
899
|
-
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));
|
|
900
880
|
}
|
|
901
881
|
clearValidate(e) {
|
|
902
|
-
var
|
|
903
|
-
const
|
|
904
|
-
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));
|
|
905
885
|
}
|
|
906
886
|
}
|
|
907
|
-
function
|
|
908
|
-
return typeof
|
|
887
|
+
function vr(r) {
|
|
888
|
+
return typeof r == "function" || Object.prototype.toString.call(r) === "[object Object]" && !Be(r);
|
|
909
889
|
}
|
|
910
|
-
class
|
|
890
|
+
class yr {
|
|
911
891
|
constructor(e) {
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
892
|
+
l(this, "schemas", L([]));
|
|
893
|
+
l(this, "model", L({}));
|
|
894
|
+
l(this, "processorBySchemaType", {
|
|
915
895
|
item: this.runtimeItemProcessor.bind(this),
|
|
916
896
|
group: this.runtimeGroupProcessor.bind(this),
|
|
917
897
|
list: this.runtimeListProcessor.bind(this)
|
|
918
898
|
});
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
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({
|
|
925
905
|
props: {
|
|
926
906
|
Form: {},
|
|
927
907
|
FormItem: {}
|
|
@@ -931,107 +911,99 @@ class br {
|
|
|
931
911
|
FormItem: {}
|
|
932
912
|
}
|
|
933
913
|
}));
|
|
934
|
-
|
|
935
|
-
this
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
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(
|
|
939
920
|
// @ts-expect-error
|
|
940
|
-
() =>
|
|
921
|
+
() => t.schemas.value,
|
|
941
922
|
() => {
|
|
942
|
-
this.processor.parseSchemas(
|
|
923
|
+
this.processor.parseSchemas(t.schemas.value);
|
|
943
924
|
},
|
|
944
925
|
{
|
|
945
926
|
deep: !0
|
|
946
927
|
}
|
|
947
928
|
);
|
|
948
|
-
else if (U(
|
|
949
|
-
const
|
|
950
|
-
this.processor.parseSchemas(
|
|
951
|
-
|
|
929
|
+
else if (U(t.schemas)) {
|
|
930
|
+
const s = E(() => t.schemas, () => {
|
|
931
|
+
this.processor.parseSchemas(t.schemas), O(() => {
|
|
932
|
+
s();
|
|
952
933
|
});
|
|
953
934
|
}, {
|
|
954
935
|
deep: !0
|
|
955
936
|
});
|
|
956
937
|
} else
|
|
957
|
-
this.processor.parseSchemas(
|
|
938
|
+
this.processor.parseSchemas(t.schemas);
|
|
958
939
|
}
|
|
959
940
|
getRuntimeMeta() {
|
|
960
941
|
return {
|
|
961
|
-
model:
|
|
942
|
+
model: x(P(this.model.value)),
|
|
962
943
|
reactiveModel: this.model.value,
|
|
963
944
|
shared: this.shared,
|
|
964
945
|
// share 增加防抖,当开发者在过程中进行 share 时避免频繁触发爆栈
|
|
965
|
-
share: (
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
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()));
|
|
970
955
|
});
|
|
971
|
-
},
|
|
972
|
-
|
|
973
|
-
immediate: !0
|
|
974
|
-
});
|
|
975
|
-
} else if (U(r)) {
|
|
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);
|
|
956
|
+
}, 0);
|
|
957
|
+
});
|
|
986
958
|
}
|
|
987
959
|
};
|
|
988
960
|
}
|
|
989
|
-
runtimeItemProcessor(e,
|
|
990
|
-
var ie,
|
|
991
|
-
const n =
|
|
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;
|
|
963
|
+
const n = x(e.component);
|
|
992
964
|
if (!n)
|
|
993
965
|
return;
|
|
994
|
-
(
|
|
995
|
-
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 = {
|
|
996
968
|
display: "grid",
|
|
997
969
|
gridColumn: "1 / -1",
|
|
998
970
|
...e.grid
|
|
999
|
-
},
|
|
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({
|
|
1000
972
|
schema: e,
|
|
1001
|
-
parentSchema:
|
|
1002
|
-
index:
|
|
1003
|
-
}),
|
|
1004
|
-
let
|
|
1005
|
-
|
|
1006
|
-
let g = e.label ?? "",
|
|
1007
|
-
if (e.runtime ?
|
|
1008
|
-
let
|
|
1009
|
-
o.isUndefined(
|
|
1010
|
-
b[
|
|
1011
|
-
|
|
1012
|
-
}),
|
|
973
|
+
parentSchema: i,
|
|
974
|
+
index: t
|
|
975
|
+
}), h = n.name, p = e.componentProps ?? {}, b = C.placeholderPresetByComponentName;
|
|
976
|
+
let I = e.placeholder, y = e.show;
|
|
977
|
+
y === void 0 && (y = !0);
|
|
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}`);
|
|
1013
985
|
}
|
|
1014
|
-
const
|
|
986
|
+
const Ve = this.runtimeAdapter.getRuntimeRequired({
|
|
1015
987
|
...e,
|
|
1016
988
|
label: g
|
|
1017
|
-
}),
|
|
1018
|
-
return
|
|
1019
|
-
style:
|
|
1020
|
-
}, [
|
|
1021
|
-
show:
|
|
989
|
+
}), Ne = w.getItemContainer(this), qe = w.getFormItemContainer(this), Te = this, Ue = e.componentSlots;
|
|
990
|
+
return m("div", {
|
|
991
|
+
style: u
|
|
992
|
+
}, [m(Ne, {
|
|
993
|
+
show: y
|
|
1022
994
|
}, {
|
|
1023
995
|
default() {
|
|
1024
|
-
return
|
|
996
|
+
return y && m(qe, q(f, {
|
|
1025
997
|
label: `${g ? `${g}:` : ""}`
|
|
1026
|
-
}, d,
|
|
998
|
+
}, d, Ve), {
|
|
1027
999
|
default() {
|
|
1028
|
-
return
|
|
1000
|
+
return Te.runtimeAdapter.formComponentRenderer({
|
|
1029
1001
|
Component: n,
|
|
1030
1002
|
schema: e,
|
|
1031
|
-
baseModel:
|
|
1032
|
-
placeholder:
|
|
1003
|
+
baseModel: s,
|
|
1004
|
+
placeholder: I,
|
|
1033
1005
|
componentSlots: Ue,
|
|
1034
|
-
props:
|
|
1006
|
+
props: p
|
|
1035
1007
|
});
|
|
1036
1008
|
},
|
|
1037
1009
|
...a
|
|
@@ -1040,326 +1012,326 @@ class br {
|
|
|
1040
1012
|
})]);
|
|
1041
1013
|
}
|
|
1042
1014
|
runtimeGroupProcessor(e) {
|
|
1043
|
-
let
|
|
1044
|
-
const
|
|
1015
|
+
let t;
|
|
1016
|
+
const s = {
|
|
1045
1017
|
display: "grid",
|
|
1046
1018
|
gridColumn: "1 / -1",
|
|
1047
1019
|
...e.grid
|
|
1048
|
-
},
|
|
1020
|
+
}, i = w.getGroupContainer(this);
|
|
1049
1021
|
let n = e.show;
|
|
1050
|
-
return n === void 0 && (n = !0),
|
|
1051
|
-
style:
|
|
1052
|
-
}, [n &&
|
|
1022
|
+
return n === void 0 && (n = !0), m("div", {
|
|
1023
|
+
style: s
|
|
1024
|
+
}, [n && m(i, {
|
|
1053
1025
|
schema: e
|
|
1054
|
-
},
|
|
1055
|
-
default: () => [
|
|
1026
|
+
}, vr(t = e.children.map((a) => this.runtimeItemProcessor(a))) ? t : {
|
|
1027
|
+
default: () => [t]
|
|
1056
1028
|
})]);
|
|
1057
1029
|
}
|
|
1058
1030
|
addListItem(e) {
|
|
1059
|
-
var
|
|
1060
|
-
if (!((
|
|
1031
|
+
var t, s;
|
|
1032
|
+
if (!((t = this.processor.stableModel[e.field]) != null && t[0]))
|
|
1061
1033
|
return Promise.reject({
|
|
1062
1034
|
code: "0001",
|
|
1063
1035
|
message: "异步默认值数据正在处理中,请您耐心等待... "
|
|
1064
1036
|
});
|
|
1065
|
-
(
|
|
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);
|
|
1066
1038
|
}
|
|
1067
|
-
deleteListItem(e,
|
|
1068
|
-
this.model.value[e.field].splice(
|
|
1039
|
+
deleteListItem(e, t) {
|
|
1040
|
+
this.model.value[e.field].splice(t, 1), this.runtimeAdapter.clearValidate(this);
|
|
1069
1041
|
}
|
|
1070
1042
|
runtimeListProcessor(e) {
|
|
1071
|
-
const
|
|
1043
|
+
const t = {
|
|
1072
1044
|
display: "grid",
|
|
1073
1045
|
gridColumn: "1 / -1",
|
|
1074
1046
|
...e.grid
|
|
1075
|
-
},
|
|
1076
|
-
|
|
1077
|
-
let
|
|
1078
|
-
|
|
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);
|
|
1079
1051
|
const n = w.getListContainer(this), a = w.getListItemContainer(this);
|
|
1080
|
-
return
|
|
1081
|
-
style:
|
|
1082
|
-
}, [
|
|
1052
|
+
return m("div", {
|
|
1053
|
+
style: t
|
|
1054
|
+
}, [i && m(n, {
|
|
1083
1055
|
schema: e
|
|
1084
1056
|
}, {
|
|
1085
1057
|
default() {
|
|
1086
|
-
return
|
|
1058
|
+
return s.model.value[e.field].map((u, f) => m(a, null, {
|
|
1087
1059
|
default() {
|
|
1088
|
-
return e.children.map((d) =>
|
|
1060
|
+
return e.children.map((d) => s.runtimeItemProcessor(d, f, u, e));
|
|
1089
1061
|
},
|
|
1090
1062
|
delete({
|
|
1091
1063
|
container: d
|
|
1092
1064
|
} = {}) {
|
|
1093
|
-
var
|
|
1094
|
-
const
|
|
1095
|
-
return
|
|
1096
|
-
onClick: () =>
|
|
1097
|
-
}, 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]]);
|
|
1098
1070
|
}
|
|
1099
1071
|
}));
|
|
1100
1072
|
},
|
|
1101
1073
|
add({
|
|
1102
|
-
container:
|
|
1074
|
+
container: u
|
|
1103
1075
|
} = {}) {
|
|
1104
|
-
const
|
|
1105
|
-
return
|
|
1106
|
-
onClick: () =>
|
|
1076
|
+
const f = u ?? m("button", null, [Ge("添加")]);
|
|
1077
|
+
return m(f, {
|
|
1078
|
+
onClick: () => s.addListItem(e)
|
|
1107
1079
|
}, null);
|
|
1108
1080
|
}
|
|
1109
1081
|
})]);
|
|
1110
1082
|
}
|
|
1111
1083
|
runtimeProcessor(e) {
|
|
1112
|
-
return e.map((
|
|
1084
|
+
return e.map((t) => (t.type || (t.type = "item"), this.processorBySchemaType[t.type](t)));
|
|
1113
1085
|
}
|
|
1114
1086
|
exec() {
|
|
1115
|
-
var
|
|
1087
|
+
var u, f, d, h;
|
|
1116
1088
|
const e = {
|
|
1117
1089
|
display: "grid",
|
|
1118
1090
|
gridColumn: "1 / -1",
|
|
1119
1091
|
gridAutoColumns: "1fr",
|
|
1120
1092
|
...this.grid
|
|
1121
|
-
},
|
|
1122
|
-
return
|
|
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, {
|
|
1123
1095
|
ref: this.formRef
|
|
1124
1096
|
}, {
|
|
1125
1097
|
[a]: this.model.value
|
|
1126
1098
|
}), {
|
|
1127
1099
|
default() {
|
|
1128
|
-
return
|
|
1100
|
+
return m("div", {
|
|
1129
1101
|
style: e
|
|
1130
|
-
}, [
|
|
1102
|
+
}, [t.runtimeProcessor(t.schemas.value)]);
|
|
1131
1103
|
},
|
|
1132
|
-
...
|
|
1104
|
+
...i
|
|
1133
1105
|
});
|
|
1134
1106
|
}
|
|
1135
1107
|
}
|
|
1136
|
-
class
|
|
1108
|
+
class c {
|
|
1137
1109
|
static getPreset(e) {
|
|
1138
|
-
var
|
|
1139
|
-
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];
|
|
1140
1112
|
}
|
|
1141
1113
|
static getUI(e) {
|
|
1142
|
-
var
|
|
1143
|
-
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;
|
|
1144
1116
|
}
|
|
1145
1117
|
}
|
|
1146
|
-
|
|
1147
|
-
function
|
|
1148
|
-
parentSchema:
|
|
1118
|
+
l(c, "presets");
|
|
1119
|
+
function Y({
|
|
1120
|
+
parentSchema: r,
|
|
1149
1121
|
schema: e,
|
|
1150
|
-
index:
|
|
1122
|
+
index: t
|
|
1151
1123
|
}) {
|
|
1152
|
-
return
|
|
1124
|
+
return r ? `${r.field}.${t}.${e.field}` : e.field;
|
|
1153
1125
|
}
|
|
1154
|
-
const
|
|
1126
|
+
const _r = {
|
|
1155
1127
|
ArcoVue: {
|
|
1156
|
-
getRuntimeField(
|
|
1157
|
-
const e =
|
|
1128
|
+
getRuntimeField(r) {
|
|
1129
|
+
const e = Y(r);
|
|
1158
1130
|
return o.isFunction(e) ? {
|
|
1159
1131
|
field: e()
|
|
1160
1132
|
} : {
|
|
1161
1133
|
field: e
|
|
1162
1134
|
};
|
|
1163
1135
|
},
|
|
1164
|
-
getRuntimeRequired(
|
|
1136
|
+
getRuntimeRequired(r) {
|
|
1165
1137
|
var e;
|
|
1166
|
-
if (
|
|
1167
|
-
if (!
|
|
1168
|
-
|
|
1138
|
+
if (r.required)
|
|
1139
|
+
if (!r.rules)
|
|
1140
|
+
r.rules = [], r.rules.push({
|
|
1169
1141
|
required: !0,
|
|
1170
|
-
message: `${
|
|
1142
|
+
message: `${r.label}是必填项`
|
|
1171
1143
|
});
|
|
1172
1144
|
else {
|
|
1173
|
-
const
|
|
1174
|
-
|
|
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({
|
|
1175
1147
|
required: !0,
|
|
1176
|
-
message: `${
|
|
1148
|
+
message: `${r.label}是必填项`
|
|
1177
1149
|
});
|
|
1178
1150
|
}
|
|
1179
|
-
else if (
|
|
1180
|
-
const
|
|
1181
|
-
|
|
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({
|
|
1182
1154
|
required: !0,
|
|
1183
|
-
message: `${
|
|
1155
|
+
message: `${r.label}是必填项`
|
|
1184
1156
|
});
|
|
1185
1157
|
}
|
|
1186
1158
|
return {
|
|
1187
|
-
rules:
|
|
1159
|
+
rules: r.rules
|
|
1188
1160
|
};
|
|
1189
1161
|
},
|
|
1190
1162
|
getFormModelPropName() {
|
|
1191
1163
|
return "model";
|
|
1192
1164
|
},
|
|
1193
1165
|
formComponentRenderer({
|
|
1194
|
-
Component:
|
|
1166
|
+
Component: r,
|
|
1195
1167
|
baseModel: e,
|
|
1196
|
-
schema:
|
|
1197
|
-
placeholder:
|
|
1198
|
-
componentSlots:
|
|
1168
|
+
schema: t,
|
|
1169
|
+
placeholder: s,
|
|
1170
|
+
componentSlots: i,
|
|
1199
1171
|
props: n
|
|
1200
1172
|
}) {
|
|
1201
1173
|
let a;
|
|
1202
|
-
return o.isFunction(
|
|
1174
|
+
return o.isFunction(t.field) ? a = H(e, t.field()) : a = e[t.field], m(r, q({
|
|
1203
1175
|
modelValue: a,
|
|
1204
|
-
"onUpdate:modelValue": (
|
|
1205
|
-
o.isFunction(
|
|
1176
|
+
"onUpdate:modelValue": (u) => {
|
|
1177
|
+
o.isFunction(t.field) ? _(e, t.field(), u) : e[t.field] = u;
|
|
1206
1178
|
},
|
|
1207
|
-
placeholder:
|
|
1179
|
+
placeholder: s
|
|
1208
1180
|
}, n), {
|
|
1209
|
-
...
|
|
1181
|
+
...i
|
|
1210
1182
|
});
|
|
1211
1183
|
},
|
|
1212
|
-
validateForm(
|
|
1213
|
-
return new Promise((e,
|
|
1214
|
-
|
|
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))));
|
|
1215
1187
|
});
|
|
1216
1188
|
},
|
|
1217
|
-
clearValidate(
|
|
1218
|
-
var e,
|
|
1219
|
-
(
|
|
1189
|
+
clearValidate(r) {
|
|
1190
|
+
var e, t;
|
|
1191
|
+
(t = (e = r.formRef.value) == null ? void 0 : e.clearValidate) == null || t.call(e);
|
|
1220
1192
|
}
|
|
1221
1193
|
},
|
|
1222
1194
|
NutUI: {
|
|
1223
|
-
getRuntimeField(
|
|
1224
|
-
const e =
|
|
1195
|
+
getRuntimeField(r) {
|
|
1196
|
+
const e = Y(r);
|
|
1225
1197
|
return o.isFunction(e) ? {
|
|
1226
1198
|
prop: e()
|
|
1227
1199
|
} : {
|
|
1228
1200
|
prop: e
|
|
1229
1201
|
};
|
|
1230
1202
|
},
|
|
1231
|
-
getRuntimeRequired(
|
|
1203
|
+
getRuntimeRequired(r) {
|
|
1232
1204
|
var e;
|
|
1233
|
-
if (
|
|
1234
|
-
if (!
|
|
1235
|
-
|
|
1205
|
+
if (r.required)
|
|
1206
|
+
if (!r.rules)
|
|
1207
|
+
r.rules = [], r.rules.push({
|
|
1236
1208
|
required: !0,
|
|
1237
|
-
message: `${
|
|
1209
|
+
message: `${r.label}是必填项`
|
|
1238
1210
|
});
|
|
1239
1211
|
else {
|
|
1240
|
-
const
|
|
1241
|
-
|
|
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({
|
|
1242
1214
|
required: !0,
|
|
1243
|
-
message: `${
|
|
1215
|
+
message: `${r.label}是必填项`
|
|
1244
1216
|
});
|
|
1245
1217
|
}
|
|
1246
|
-
else if (
|
|
1247
|
-
const
|
|
1248
|
-
|
|
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({
|
|
1249
1221
|
required: !0,
|
|
1250
|
-
message: `${
|
|
1222
|
+
message: `${r.label}是必填项`
|
|
1251
1223
|
});
|
|
1252
1224
|
}
|
|
1253
1225
|
return {
|
|
1254
|
-
rules:
|
|
1255
|
-
required:
|
|
1226
|
+
rules: r.rules,
|
|
1227
|
+
required: r.required
|
|
1256
1228
|
};
|
|
1257
1229
|
},
|
|
1258
1230
|
getFormModelPropName() {
|
|
1259
1231
|
return "modelValue";
|
|
1260
1232
|
},
|
|
1261
1233
|
formComponentRenderer({
|
|
1262
|
-
Component:
|
|
1234
|
+
Component: r,
|
|
1263
1235
|
baseModel: e,
|
|
1264
|
-
schema:
|
|
1265
|
-
placeholder:
|
|
1266
|
-
componentSlots:
|
|
1236
|
+
schema: t,
|
|
1237
|
+
placeholder: s,
|
|
1238
|
+
componentSlots: i,
|
|
1267
1239
|
props: n
|
|
1268
1240
|
}) {
|
|
1269
1241
|
let a;
|
|
1270
|
-
return o.isFunction(
|
|
1242
|
+
return o.isFunction(t.field) ? a = H(e, t.field()) : a = e[t.field], m(r, q({
|
|
1271
1243
|
modelValue: a,
|
|
1272
|
-
"onUpdate:modelValue": (
|
|
1273
|
-
o.isFunction(
|
|
1244
|
+
"onUpdate:modelValue": (u) => {
|
|
1245
|
+
o.isFunction(t.field) ? _(e, t.field(), u) : e[t.field] = u;
|
|
1274
1246
|
},
|
|
1275
|
-
placeholder:
|
|
1247
|
+
placeholder: s
|
|
1276
1248
|
}, n), {
|
|
1277
|
-
...
|
|
1249
|
+
...i
|
|
1278
1250
|
});
|
|
1279
1251
|
},
|
|
1280
|
-
validateForm(
|
|
1281
|
-
return new Promise((e,
|
|
1282
|
-
|
|
1283
|
-
valid:
|
|
1284
|
-
errors:
|
|
1252
|
+
validateForm(r) {
|
|
1253
|
+
return new Promise((e, t) => {
|
|
1254
|
+
r.runtimeCore.formRef.value.validate().then(({
|
|
1255
|
+
valid: s,
|
|
1256
|
+
errors: i
|
|
1285
1257
|
}) => {
|
|
1286
|
-
|
|
1258
|
+
s ? e(r.cleanFallbackFields(x(r.runtimeCore.processor.processedModel.value))) : t(i);
|
|
1287
1259
|
});
|
|
1288
1260
|
});
|
|
1289
1261
|
},
|
|
1290
|
-
clearValidate(
|
|
1291
|
-
var e,
|
|
1292
|
-
(
|
|
1262
|
+
clearValidate(r) {
|
|
1263
|
+
var e, t;
|
|
1264
|
+
(t = (e = r.formRef.value) == null ? void 0 : e.reset) == null || t.call(e);
|
|
1293
1265
|
}
|
|
1294
1266
|
},
|
|
1295
1267
|
NaiveUI: {
|
|
1296
|
-
getRuntimeField(
|
|
1297
|
-
const e =
|
|
1268
|
+
getRuntimeField(r) {
|
|
1269
|
+
const e = Y(r);
|
|
1298
1270
|
return o.isFunction(e) ? {
|
|
1299
1271
|
path: e()
|
|
1300
1272
|
} : {
|
|
1301
1273
|
path: e
|
|
1302
1274
|
};
|
|
1303
1275
|
},
|
|
1304
|
-
getRuntimeRequired(
|
|
1276
|
+
getRuntimeRequired(r) {
|
|
1305
1277
|
var e;
|
|
1306
|
-
if (
|
|
1307
|
-
if (!
|
|
1308
|
-
|
|
1278
|
+
if (r.required)
|
|
1279
|
+
if (!r.rules)
|
|
1280
|
+
r.rules = [], r.rules.push({
|
|
1309
1281
|
required: !0,
|
|
1310
|
-
message: `${
|
|
1282
|
+
message: `${r.label}是必填项`,
|
|
1311
1283
|
trigger: ["input", "blur"]
|
|
1312
1284
|
});
|
|
1313
1285
|
else {
|
|
1314
|
-
const
|
|
1315
|
-
|
|
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({
|
|
1316
1288
|
required: !0,
|
|
1317
|
-
message: `${
|
|
1289
|
+
message: `${r.label}是必填项`,
|
|
1318
1290
|
trigger: ["input", "blur"]
|
|
1319
1291
|
});
|
|
1320
1292
|
}
|
|
1321
|
-
else if (
|
|
1322
|
-
const
|
|
1323
|
-
|
|
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({
|
|
1324
1296
|
required: !0,
|
|
1325
|
-
message: `${
|
|
1297
|
+
message: `${r.label}是必填项`,
|
|
1326
1298
|
trigger: ["input", "blur"]
|
|
1327
1299
|
});
|
|
1328
1300
|
}
|
|
1329
1301
|
return {
|
|
1330
|
-
rule:
|
|
1302
|
+
rule: r.rules
|
|
1331
1303
|
};
|
|
1332
1304
|
},
|
|
1333
1305
|
getFormModelPropName() {
|
|
1334
1306
|
return "model";
|
|
1335
1307
|
},
|
|
1336
1308
|
formComponentRenderer({
|
|
1337
|
-
Component:
|
|
1309
|
+
Component: r,
|
|
1338
1310
|
baseModel: e,
|
|
1339
|
-
schema:
|
|
1340
|
-
placeholder:
|
|
1341
|
-
componentSlots:
|
|
1311
|
+
schema: t,
|
|
1312
|
+
placeholder: s,
|
|
1313
|
+
componentSlots: i,
|
|
1342
1314
|
props: n
|
|
1343
1315
|
}) {
|
|
1344
1316
|
let a;
|
|
1345
|
-
return o.isFunction(
|
|
1317
|
+
return o.isFunction(t.field) ? a = H(e, t.field()) : a = e[t.field], m(r, q({
|
|
1346
1318
|
value: a,
|
|
1347
|
-
"onUpdate:value": (
|
|
1348
|
-
o.isFunction(
|
|
1319
|
+
"onUpdate:value": (u) => {
|
|
1320
|
+
o.isFunction(t.field) ? _(e, t.field(), u) : e[t.field] = u;
|
|
1349
1321
|
},
|
|
1350
|
-
placeholder:
|
|
1322
|
+
placeholder: s
|
|
1351
1323
|
}, n), {
|
|
1352
|
-
...
|
|
1324
|
+
...i
|
|
1353
1325
|
});
|
|
1354
1326
|
},
|
|
1355
|
-
validateForm(
|
|
1356
|
-
return new Promise((e,
|
|
1357
|
-
|
|
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))));
|
|
1358
1330
|
});
|
|
1359
1331
|
},
|
|
1360
|
-
clearValidate(
|
|
1361
|
-
var e,
|
|
1362
|
-
(
|
|
1332
|
+
clearValidate(r) {
|
|
1333
|
+
var e, t;
|
|
1334
|
+
(t = (e = r.formRef.value) == null ? void 0 : e.restoreValidation) == null || t.call(e);
|
|
1363
1335
|
}
|
|
1364
1336
|
}
|
|
1365
1337
|
}, M = class M {
|
|
@@ -1367,15 +1339,15 @@ const vr = {
|
|
|
1367
1339
|
const e = {
|
|
1368
1340
|
请选择: ["select", "tree"],
|
|
1369
1341
|
请输入: ["input"]
|
|
1370
|
-
},
|
|
1371
|
-
for (const
|
|
1372
|
-
e[
|
|
1373
|
-
|
|
1342
|
+
}, t = {};
|
|
1343
|
+
for (const s in e)
|
|
1344
|
+
e[s].forEach((i) => {
|
|
1345
|
+
t[i] = s;
|
|
1374
1346
|
});
|
|
1375
|
-
return
|
|
1347
|
+
return t;
|
|
1376
1348
|
}
|
|
1377
1349
|
};
|
|
1378
|
-
|
|
1350
|
+
l(M, "schemaPreset", {
|
|
1379
1351
|
type: {
|
|
1380
1352
|
defaultValue: "item"
|
|
1381
1353
|
},
|
|
@@ -1421,32 +1393,32 @@ u(M, "schemaPreset", {
|
|
|
1421
1393
|
runtime: {
|
|
1422
1394
|
default: void 0
|
|
1423
1395
|
}
|
|
1424
|
-
}),
|
|
1396
|
+
}), l(M, "componentPropsPreset", {
|
|
1425
1397
|
options: {
|
|
1426
1398
|
defaultValue: []
|
|
1427
1399
|
}
|
|
1428
1400
|
}), // 基于基本功能提出基本预设
|
|
1429
|
-
|
|
1430
|
-
let
|
|
1431
|
-
const
|
|
1432
|
-
...
|
|
1401
|
+
l(M, "placeholderPresetByComponentName", M.getPlaceholderPrefixPresetByComponentName());
|
|
1402
|
+
let Q = M;
|
|
1403
|
+
const C = {
|
|
1404
|
+
...Q,
|
|
1433
1405
|
adapters: {
|
|
1434
|
-
...
|
|
1406
|
+
..._r
|
|
1435
1407
|
}
|
|
1436
|
-
},
|
|
1408
|
+
}, Ir = /* @__PURE__ */ Ke({
|
|
1437
1409
|
props: {
|
|
1438
1410
|
setup: {
|
|
1439
1411
|
type: Function,
|
|
1440
1412
|
required: !0
|
|
1441
1413
|
}
|
|
1442
1414
|
},
|
|
1443
|
-
setup(
|
|
1444
|
-
const e = new
|
|
1415
|
+
setup(r) {
|
|
1416
|
+
const e = new yr(r.setup);
|
|
1445
1417
|
return () => e.exec();
|
|
1446
1418
|
}
|
|
1447
1419
|
});
|
|
1448
|
-
function
|
|
1449
|
-
const e = new
|
|
1420
|
+
function Sr(r) {
|
|
1421
|
+
const e = new mr(r);
|
|
1450
1422
|
return [
|
|
1451
1423
|
e.setup.bind(e),
|
|
1452
1424
|
{
|
|
@@ -1458,46 +1430,46 @@ function Ir(t) {
|
|
|
1458
1430
|
}
|
|
1459
1431
|
];
|
|
1460
1432
|
}
|
|
1461
|
-
function
|
|
1462
|
-
|
|
1433
|
+
function Or(r) {
|
|
1434
|
+
c.presets = r;
|
|
1463
1435
|
}
|
|
1464
|
-
function
|
|
1465
|
-
return e === "native" && Object.defineProperty(
|
|
1466
|
-
value: `__proform_raw_${
|
|
1436
|
+
function se(r, e) {
|
|
1437
|
+
return e === "native" && Object.defineProperty(r, "name", {
|
|
1438
|
+
value: `__proform_raw_${r.name}`,
|
|
1467
1439
|
writable: !0
|
|
1468
|
-
}), e === "structured_path_parsing_mark" && Object.defineProperty(
|
|
1469
|
-
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}`,
|
|
1470
1442
|
writable: !0
|
|
1471
|
-
}), e === "onetime" && Object.defineProperty(
|
|
1472
|
-
value: `__proform_onetime_${
|
|
1443
|
+
}), e === "onetime" && Object.defineProperty(r, "name", {
|
|
1444
|
+
value: `__proform_onetime_${r.name}`,
|
|
1473
1445
|
writable: !0
|
|
1474
|
-
}),
|
|
1446
|
+
}), r;
|
|
1475
1447
|
}
|
|
1476
|
-
function
|
|
1477
|
-
return
|
|
1448
|
+
function Er(r) {
|
|
1449
|
+
return se(r, "native");
|
|
1478
1450
|
}
|
|
1479
|
-
function Fr(
|
|
1480
|
-
return
|
|
1451
|
+
function Fr(r) {
|
|
1452
|
+
return r.__proform_raw_object = !0, r;
|
|
1481
1453
|
}
|
|
1482
|
-
function jr(
|
|
1483
|
-
return
|
|
1454
|
+
function jr(r) {
|
|
1455
|
+
return se(r, "onetime");
|
|
1484
1456
|
}
|
|
1485
|
-
function wr(
|
|
1457
|
+
function wr(r) {
|
|
1486
1458
|
function e() {
|
|
1487
|
-
return
|
|
1459
|
+
return r;
|
|
1488
1460
|
}
|
|
1489
|
-
return
|
|
1461
|
+
return se(
|
|
1490
1462
|
e,
|
|
1491
1463
|
"structured_path_parsing_mark"
|
|
1492
1464
|
);
|
|
1493
1465
|
}
|
|
1494
1466
|
export {
|
|
1495
|
-
|
|
1496
|
-
|
|
1467
|
+
Ir as ProForm,
|
|
1468
|
+
Er as markNativeFunction,
|
|
1497
1469
|
Fr as markNativeObject,
|
|
1498
1470
|
jr as markOnetimeFunction,
|
|
1499
1471
|
wr as markStructuredPathParsing,
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1472
|
+
Sr as useForm,
|
|
1473
|
+
Or as useFormPresetConfigurer,
|
|
1474
|
+
se as useModifiers
|
|
1503
1475
|
};
|