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