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