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