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