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