@harbor-design/proform 1.3.8 → 1.3.10
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 +338 -337
- package/dist/types/src/services/Processor/index.d.ts +0 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var ze = (t, e, r) => e in t ?
|
|
1
|
+
var Te = Object.defineProperty;
|
|
2
|
+
var ze = (t, e, r) => e in t ? Te(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
3
|
var u = (t, e, r) => (ze(t, typeof e != "symbol" ? e + "" : e, r), r);
|
|
4
|
-
import { ref as z, readonly as _e, nextTick as P, isRef as
|
|
4
|
+
import { ref as z, readonly as _e, nextTick as P, isRef as q, watch as _, isReactive as U, toRaw as E, reactive as Pe, createVNode as y, mergeProps as N, withDirectives as Le, vShow as De, createTextVNode as Ge, isVNode as Be, defineComponent as ke } from "vue";
|
|
5
5
|
class o {
|
|
6
6
|
static typeChecker(e) {
|
|
7
7
|
return {}.toString.call(e);
|
|
@@ -72,56 +72,56 @@ class o {
|
|
|
72
72
|
function h(t, ...e) {
|
|
73
73
|
return e.forEach((r) => {
|
|
74
74
|
if (Array.isArray(r))
|
|
75
|
-
Array.isArray(t) || (t = []), r.forEach((
|
|
76
|
-
typeof
|
|
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
|
|
80
|
-
r.hasOwnProperty(
|
|
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
81
|
}), t;
|
|
82
82
|
}
|
|
83
83
|
function C(t) {
|
|
84
84
|
const e = /* @__PURE__ */ new WeakMap();
|
|
85
|
-
function r(
|
|
86
|
-
if (
|
|
87
|
-
return
|
|
88
|
-
if (
|
|
89
|
-
return new Date(
|
|
90
|
-
if (
|
|
91
|
-
return new RegExp(
|
|
92
|
-
if (
|
|
85
|
+
function r(i) {
|
|
86
|
+
if (i === null || typeof i != "object")
|
|
87
|
+
return i;
|
|
88
|
+
if (i instanceof Date)
|
|
89
|
+
return new Date(i);
|
|
90
|
+
if (i instanceof RegExp)
|
|
91
|
+
return new RegExp(i);
|
|
92
|
+
if (i instanceof Map) {
|
|
93
93
|
const n = /* @__PURE__ */ new Map();
|
|
94
|
-
for (const [a, l] of
|
|
94
|
+
for (const [a, l] of i)
|
|
95
95
|
n.set(r(a), r(l));
|
|
96
96
|
return n;
|
|
97
97
|
}
|
|
98
|
-
if (
|
|
98
|
+
if (i instanceof Set) {
|
|
99
99
|
const n = /* @__PURE__ */ new Set();
|
|
100
|
-
for (const a of
|
|
100
|
+
for (const a of i)
|
|
101
101
|
n.add(r(a));
|
|
102
102
|
return n;
|
|
103
103
|
}
|
|
104
|
-
if (e.has(
|
|
105
|
-
return e.get(
|
|
106
|
-
if (Array.isArray(
|
|
104
|
+
if (e.has(i))
|
|
105
|
+
return e.get(i);
|
|
106
|
+
if (Array.isArray(i)) {
|
|
107
107
|
const n = [];
|
|
108
|
-
e.set(
|
|
109
|
-
for (let a = 0; a <
|
|
110
|
-
n[a] = r(
|
|
108
|
+
e.set(i, n);
|
|
109
|
+
for (let a = 0; a < i.length; a++)
|
|
110
|
+
n[a] = r(i[a]);
|
|
111
111
|
return n;
|
|
112
112
|
}
|
|
113
|
-
const
|
|
114
|
-
e.set(
|
|
115
|
-
for (const n in
|
|
116
|
-
|
|
117
|
-
return
|
|
113
|
+
const s = Object.create(Object.getPrototypeOf(i));
|
|
114
|
+
e.set(i, s);
|
|
115
|
+
for (const n in i)
|
|
116
|
+
i.hasOwnProperty(n) && (s[n] = r(i[n]));
|
|
117
|
+
return s;
|
|
118
118
|
}
|
|
119
119
|
return r(t);
|
|
120
120
|
}
|
|
121
121
|
function K(t, e) {
|
|
122
122
|
return t.replace(/undefined/g, e);
|
|
123
123
|
}
|
|
124
|
-
class
|
|
124
|
+
class He {
|
|
125
125
|
constructor(e) {
|
|
126
126
|
u(this, "runtimeCore");
|
|
127
127
|
u(this, "readonlyReactiveModel", z({}));
|
|
@@ -137,15 +137,15 @@ class ke {
|
|
|
137
137
|
return this.runtimeCore = e, this.readonlyReactiveModel.value = _e(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
|
-
var
|
|
141
|
-
const e = (
|
|
140
|
+
var i;
|
|
141
|
+
const e = (i = f.getPreset(this.runtimeCore.ui)) == null ? void 0 : i.adapter, r = I.adapters[f.getUI(this.runtimeCore.ui)];
|
|
142
142
|
return (e == null ? void 0 : e.validateForm(this)) ?? (r == null ? void 0 : r.validateForm(this));
|
|
143
143
|
}
|
|
144
144
|
hydrate(e) {
|
|
145
145
|
P(() => {
|
|
146
146
|
this.runtimeCore.hydrateEffect.trackEffect(
|
|
147
147
|
() => {
|
|
148
|
-
|
|
148
|
+
q(e) ? _(
|
|
149
149
|
() => e.value,
|
|
150
150
|
() => {
|
|
151
151
|
h(this.runtimeCore.model.value, e.value);
|
|
@@ -154,7 +154,7 @@ class ke {
|
|
|
154
154
|
deep: !0,
|
|
155
155
|
immediate: !0
|
|
156
156
|
}
|
|
157
|
-
) :
|
|
157
|
+
) : U(e) ? _(
|
|
158
158
|
() => e,
|
|
159
159
|
() => {
|
|
160
160
|
h(this.runtimeCore.model.value, e);
|
|
@@ -173,7 +173,7 @@ class ke {
|
|
|
173
173
|
}
|
|
174
174
|
share(e) {
|
|
175
175
|
P(() => {
|
|
176
|
-
if (
|
|
176
|
+
if (q(e)) {
|
|
177
177
|
const r = _(
|
|
178
178
|
() => e.value,
|
|
179
179
|
() => {
|
|
@@ -186,7 +186,7 @@ class ke {
|
|
|
186
186
|
immediate: !0
|
|
187
187
|
}
|
|
188
188
|
);
|
|
189
|
-
} else if (
|
|
189
|
+
} else if (U(e)) {
|
|
190
190
|
const r = _(
|
|
191
191
|
() => e,
|
|
192
192
|
() => {
|
|
@@ -207,8 +207,8 @@ class ke {
|
|
|
207
207
|
P(() => {
|
|
208
208
|
const r = _(
|
|
209
209
|
() => this.readonlyReactiveModel.value,
|
|
210
|
-
(
|
|
211
|
-
e(
|
|
210
|
+
(i) => {
|
|
211
|
+
e(i, {
|
|
212
212
|
stopSubscribe() {
|
|
213
213
|
P(() => {
|
|
214
214
|
r();
|
|
@@ -247,43 +247,43 @@ class X {
|
|
|
247
247
|
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);
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
|
-
var
|
|
250
|
+
var We = typeof global == "object" && global && global.Object === Object && global, Ke = typeof self == "object" && self && self.Object === Object && self, Z = We || Ke || Function("return this")(), x = Z.Symbol, je = Object.prototype, Xe = je.hasOwnProperty, Ye = je.toString, V = x ? x.toStringTag : void 0;
|
|
251
251
|
function Ze(t) {
|
|
252
252
|
var e = Xe.call(t, V), r = t[V];
|
|
253
253
|
try {
|
|
254
254
|
t[V] = void 0;
|
|
255
|
-
var
|
|
255
|
+
var i = !0;
|
|
256
256
|
} catch {
|
|
257
257
|
}
|
|
258
|
-
var
|
|
259
|
-
return
|
|
258
|
+
var s = Ye.call(t);
|
|
259
|
+
return i && (e ? t[V] = r : delete t[V]), s;
|
|
260
260
|
}
|
|
261
261
|
var Je = Object.prototype, Qe = Je.toString;
|
|
262
262
|
function Ae(t) {
|
|
263
263
|
return Qe.call(t);
|
|
264
264
|
}
|
|
265
265
|
var et = "[object Null]", tt = "[object Undefined]", Ce = x ? x.toStringTag : void 0;
|
|
266
|
-
function
|
|
266
|
+
function we(t) {
|
|
267
267
|
return t == null ? t === void 0 ? tt : et : Ce && Ce in Object(t) ? Ze(t) : Ae(t);
|
|
268
268
|
}
|
|
269
269
|
function rt(t) {
|
|
270
270
|
return t != null && typeof t == "object";
|
|
271
271
|
}
|
|
272
|
-
var
|
|
272
|
+
var it = "[object Symbol]";
|
|
273
273
|
function J(t) {
|
|
274
|
-
return typeof t == "symbol" || rt(t) &&
|
|
274
|
+
return typeof t == "symbol" || rt(t) && we(t) == it;
|
|
275
275
|
}
|
|
276
|
-
function
|
|
277
|
-
for (var r = -1,
|
|
278
|
-
|
|
279
|
-
return
|
|
276
|
+
function st(t, e) {
|
|
277
|
+
for (var r = -1, i = t == null ? 0 : t.length, s = Array(i); ++r < i; )
|
|
278
|
+
s[r] = e(t[r], r, t);
|
|
279
|
+
return s;
|
|
280
280
|
}
|
|
281
281
|
var Q = Array.isArray, nt = 1 / 0, Ie = x ? x.prototype : void 0, Se = Ie ? Ie.toString : void 0;
|
|
282
|
-
function
|
|
282
|
+
function Me(t) {
|
|
283
283
|
if (typeof t == "string")
|
|
284
284
|
return t;
|
|
285
285
|
if (Q(t))
|
|
286
|
-
return
|
|
286
|
+
return st(t, Me) + "";
|
|
287
287
|
if (J(t))
|
|
288
288
|
return Se ? Se.call(t) : "";
|
|
289
289
|
var e = t + "";
|
|
@@ -297,11 +297,11 @@ var ot = "[object AsyncFunction]", at = "[object Function]", lt = "[object Gener
|
|
|
297
297
|
function ct(t) {
|
|
298
298
|
if (!G(t))
|
|
299
299
|
return !1;
|
|
300
|
-
var e =
|
|
300
|
+
var e = we(t);
|
|
301
301
|
return e == at || e == lt || e == ot || e == ut;
|
|
302
302
|
}
|
|
303
|
-
var
|
|
304
|
-
var t = /[^.]+$/.exec(
|
|
303
|
+
var H = Z["__core-js_shared__"], Oe = function() {
|
|
304
|
+
var t = /[^.]+$/.exec(H && H.keys && H.keys.IE_PROTO || "");
|
|
305
305
|
return t ? "Symbol(src)_1." + t : "";
|
|
306
306
|
}();
|
|
307
307
|
function ft(t) {
|
|
@@ -321,13 +321,13 @@ function ht(t) {
|
|
|
321
321
|
}
|
|
322
322
|
return "";
|
|
323
323
|
}
|
|
324
|
-
var mt = /[\\^$.*+?()[\]{}|]/g,
|
|
324
|
+
var mt = /[\\^$.*+?()[\]{}|]/g, yt = /^\[object .+?Constructor\]$/, gt = Function.prototype, bt = Object.prototype, vt = gt.toString, _t = bt.hasOwnProperty, Pt = RegExp(
|
|
325
325
|
"^" + vt.call(_t).replace(mt, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
326
326
|
);
|
|
327
327
|
function Ct(t) {
|
|
328
328
|
if (!G(t) || ft(t))
|
|
329
329
|
return !1;
|
|
330
|
-
var e = ct(t) ? Pt :
|
|
330
|
+
var e = ct(t) ? Pt : yt;
|
|
331
331
|
return e.test(ht(t));
|
|
332
332
|
}
|
|
333
333
|
function It(t, e) {
|
|
@@ -337,32 +337,32 @@ function A(t, e) {
|
|
|
337
337
|
var r = It(t, e);
|
|
338
338
|
return Ct(r) ? r : void 0;
|
|
339
339
|
}
|
|
340
|
-
var
|
|
340
|
+
var Fe = function() {
|
|
341
341
|
try {
|
|
342
342
|
var t = A(Object, "defineProperty");
|
|
343
343
|
return t({}, "", {}), t;
|
|
344
344
|
} catch {
|
|
345
345
|
}
|
|
346
346
|
}(), St = 9007199254740991, Ot = /^(?:0|[1-9]\d*)$/;
|
|
347
|
-
function
|
|
347
|
+
function Ft(t, e) {
|
|
348
348
|
var r = typeof t;
|
|
349
349
|
return e = e ?? St, !!e && (r == "number" || r != "symbol" && Ot.test(t)) && t > -1 && t % 1 == 0 && t < e;
|
|
350
350
|
}
|
|
351
351
|
function jt(t, e, r) {
|
|
352
|
-
e == "__proto__" &&
|
|
352
|
+
e == "__proto__" && Fe ? Fe(t, e, {
|
|
353
353
|
configurable: !0,
|
|
354
354
|
enumerable: !0,
|
|
355
355
|
value: r,
|
|
356
356
|
writable: !0
|
|
357
357
|
}) : t[e] = r;
|
|
358
358
|
}
|
|
359
|
-
function
|
|
359
|
+
function Ee(t, e) {
|
|
360
360
|
return t === e || t !== t && e !== e;
|
|
361
361
|
}
|
|
362
|
-
var
|
|
363
|
-
function
|
|
364
|
-
var
|
|
365
|
-
(!(
|
|
362
|
+
var wt = Object.prototype, Mt = wt.hasOwnProperty;
|
|
363
|
+
function Et(t, e, r) {
|
|
364
|
+
var i = t[e];
|
|
365
|
+
(!(Mt.call(t, e) && Ee(i, r)) || r === void 0 && !(e in t)) && jt(t, e, r);
|
|
366
366
|
}
|
|
367
367
|
var xt = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Rt = /^\w*$/;
|
|
368
368
|
function $t(t, e) {
|
|
@@ -371,81 +371,81 @@ function $t(t, e) {
|
|
|
371
371
|
var r = typeof t;
|
|
372
372
|
return r == "number" || r == "symbol" || r == "boolean" || t == null || J(t) ? !0 : Rt.test(t) || !xt.test(t) || e != null && t in Object(e);
|
|
373
373
|
}
|
|
374
|
-
var
|
|
374
|
+
var T = A(Object, "create");
|
|
375
375
|
function Vt() {
|
|
376
|
-
this.__data__ =
|
|
376
|
+
this.__data__ = T ? T(null) : {}, this.size = 0;
|
|
377
377
|
}
|
|
378
378
|
function Nt(t) {
|
|
379
379
|
var e = this.has(t) && delete this.__data__[t];
|
|
380
380
|
return this.size -= e ? 1 : 0, e;
|
|
381
381
|
}
|
|
382
|
-
var
|
|
382
|
+
var qt = "__lodash_hash_undefined__", Ut = Object.prototype, Tt = Ut.hasOwnProperty;
|
|
383
383
|
function zt(t) {
|
|
384
384
|
var e = this.__data__;
|
|
385
|
-
if (
|
|
385
|
+
if (T) {
|
|
386
386
|
var r = e[t];
|
|
387
|
-
return r ===
|
|
387
|
+
return r === qt ? void 0 : r;
|
|
388
388
|
}
|
|
389
|
-
return
|
|
389
|
+
return Tt.call(e, t) ? e[t] : void 0;
|
|
390
390
|
}
|
|
391
391
|
var Lt = Object.prototype, Dt = Lt.hasOwnProperty;
|
|
392
392
|
function Gt(t) {
|
|
393
393
|
var e = this.__data__;
|
|
394
|
-
return
|
|
394
|
+
return T ? e[t] !== void 0 : Dt.call(e, t);
|
|
395
395
|
}
|
|
396
|
-
var
|
|
397
|
-
function
|
|
396
|
+
var Bt = "__lodash_hash_undefined__";
|
|
397
|
+
function kt(t, e) {
|
|
398
398
|
var r = this.__data__;
|
|
399
|
-
return this.size += this.has(t) ? 0 : 1, r[t] =
|
|
399
|
+
return this.size += this.has(t) ? 0 : 1, r[t] = T && e === void 0 ? Bt : e, this;
|
|
400
400
|
}
|
|
401
|
-
function
|
|
401
|
+
function F(t) {
|
|
402
402
|
var e = -1, r = t == null ? 0 : t.length;
|
|
403
403
|
for (this.clear(); ++e < r; ) {
|
|
404
|
-
var
|
|
405
|
-
this.set(
|
|
404
|
+
var i = t[e];
|
|
405
|
+
this.set(i[0], i[1]);
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
function
|
|
408
|
+
F.prototype.clear = Vt;
|
|
409
|
+
F.prototype.delete = Nt;
|
|
410
|
+
F.prototype.get = zt;
|
|
411
|
+
F.prototype.has = Gt;
|
|
412
|
+
F.prototype.set = kt;
|
|
413
|
+
function Ht() {
|
|
414
414
|
this.__data__ = [], this.size = 0;
|
|
415
415
|
}
|
|
416
|
-
function
|
|
416
|
+
function B(t, e) {
|
|
417
417
|
for (var r = t.length; r--; )
|
|
418
|
-
if (
|
|
418
|
+
if (Ee(t[r][0], e))
|
|
419
419
|
return r;
|
|
420
420
|
return -1;
|
|
421
421
|
}
|
|
422
|
-
var
|
|
422
|
+
var Wt = Array.prototype, Kt = Wt.splice;
|
|
423
423
|
function Xt(t) {
|
|
424
|
-
var e = this.__data__, r =
|
|
424
|
+
var e = this.__data__, r = B(e, t);
|
|
425
425
|
if (r < 0)
|
|
426
426
|
return !1;
|
|
427
|
-
var
|
|
428
|
-
return r ==
|
|
427
|
+
var i = e.length - 1;
|
|
428
|
+
return r == i ? e.pop() : Kt.call(e, r, 1), --this.size, !0;
|
|
429
429
|
}
|
|
430
430
|
function Yt(t) {
|
|
431
|
-
var e = this.__data__, r =
|
|
431
|
+
var e = this.__data__, r = B(e, t);
|
|
432
432
|
return r < 0 ? void 0 : e[r][1];
|
|
433
433
|
}
|
|
434
434
|
function Zt(t) {
|
|
435
|
-
return
|
|
435
|
+
return B(this.__data__, t) > -1;
|
|
436
436
|
}
|
|
437
437
|
function Jt(t, e) {
|
|
438
|
-
var r = this.__data__,
|
|
439
|
-
return
|
|
438
|
+
var r = this.__data__, i = B(r, t);
|
|
439
|
+
return i < 0 ? (++this.size, r.push([t, e])) : r[i][1] = e, this;
|
|
440
440
|
}
|
|
441
441
|
function R(t) {
|
|
442
442
|
var e = -1, r = t == null ? 0 : t.length;
|
|
443
443
|
for (this.clear(); ++e < r; ) {
|
|
444
|
-
var
|
|
445
|
-
this.set(
|
|
444
|
+
var i = t[e];
|
|
445
|
+
this.set(i[0], i[1]);
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
|
-
R.prototype.clear =
|
|
448
|
+
R.prototype.clear = Ht;
|
|
449
449
|
R.prototype.delete = Xt;
|
|
450
450
|
R.prototype.get = Yt;
|
|
451
451
|
R.prototype.has = Zt;
|
|
@@ -453,74 +453,74 @@ R.prototype.set = Jt;
|
|
|
453
453
|
var Qt = A(Z, "Map");
|
|
454
454
|
function At() {
|
|
455
455
|
this.size = 0, this.__data__ = {
|
|
456
|
-
hash: new
|
|
456
|
+
hash: new F(),
|
|
457
457
|
map: new (Qt || R)(),
|
|
458
|
-
string: new
|
|
458
|
+
string: new F()
|
|
459
459
|
};
|
|
460
460
|
}
|
|
461
461
|
function er(t) {
|
|
462
462
|
var e = typeof t;
|
|
463
463
|
return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
|
|
464
464
|
}
|
|
465
|
-
function
|
|
465
|
+
function k(t, e) {
|
|
466
466
|
var r = t.__data__;
|
|
467
467
|
return er(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
|
|
468
468
|
}
|
|
469
469
|
function tr(t) {
|
|
470
|
-
var e =
|
|
470
|
+
var e = k(this, t).delete(t);
|
|
471
471
|
return this.size -= e ? 1 : 0, e;
|
|
472
472
|
}
|
|
473
473
|
function rr(t) {
|
|
474
|
-
return
|
|
474
|
+
return k(this, t).get(t);
|
|
475
475
|
}
|
|
476
|
-
function
|
|
477
|
-
return
|
|
476
|
+
function ir(t) {
|
|
477
|
+
return k(this, t).has(t);
|
|
478
478
|
}
|
|
479
|
-
function
|
|
480
|
-
var r =
|
|
481
|
-
return r.set(t, e), this.size += r.size ==
|
|
479
|
+
function sr(t, e) {
|
|
480
|
+
var r = k(this, t), i = r.size;
|
|
481
|
+
return r.set(t, e), this.size += r.size == i ? 0 : 1, this;
|
|
482
482
|
}
|
|
483
483
|
function j(t) {
|
|
484
484
|
var e = -1, r = t == null ? 0 : t.length;
|
|
485
485
|
for (this.clear(); ++e < r; ) {
|
|
486
|
-
var
|
|
487
|
-
this.set(
|
|
486
|
+
var i = t[e];
|
|
487
|
+
this.set(i[0], i[1]);
|
|
488
488
|
}
|
|
489
489
|
}
|
|
490
490
|
j.prototype.clear = At;
|
|
491
491
|
j.prototype.delete = tr;
|
|
492
492
|
j.prototype.get = rr;
|
|
493
|
-
j.prototype.has =
|
|
494
|
-
j.prototype.set =
|
|
493
|
+
j.prototype.has = ir;
|
|
494
|
+
j.prototype.set = sr;
|
|
495
495
|
var nr = "Expected a function";
|
|
496
496
|
function ee(t, e) {
|
|
497
497
|
if (typeof t != "function" || e != null && typeof e != "function")
|
|
498
498
|
throw new TypeError(nr);
|
|
499
499
|
var r = function() {
|
|
500
|
-
var
|
|
501
|
-
if (n.has(
|
|
502
|
-
return n.get(
|
|
503
|
-
var a = t.apply(this,
|
|
504
|
-
return r.cache = n.set(
|
|
500
|
+
var i = arguments, s = e ? e.apply(this, i) : i[0], n = r.cache;
|
|
501
|
+
if (n.has(s))
|
|
502
|
+
return n.get(s);
|
|
503
|
+
var a = t.apply(this, i);
|
|
504
|
+
return r.cache = n.set(s, a) || n, a;
|
|
505
505
|
};
|
|
506
506
|
return r.cache = new (ee.Cache || j)(), r;
|
|
507
507
|
}
|
|
508
508
|
ee.Cache = j;
|
|
509
509
|
var or = 500;
|
|
510
510
|
function ar(t) {
|
|
511
|
-
var e = ee(t, function(
|
|
512
|
-
return r.size === or && r.clear(),
|
|
511
|
+
var e = ee(t, function(i) {
|
|
512
|
+
return r.size === or && r.clear(), i;
|
|
513
513
|
}), r = e.cache;
|
|
514
514
|
return e;
|
|
515
515
|
}
|
|
516
516
|
var lr = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, ur = /\\(\\)?/g, cr = ar(function(t) {
|
|
517
517
|
var e = [];
|
|
518
|
-
return t.charCodeAt(0) === 46 && e.push(""), t.replace(lr, function(r,
|
|
519
|
-
e.push(
|
|
518
|
+
return t.charCodeAt(0) === 46 && e.push(""), t.replace(lr, function(r, i, s, n) {
|
|
519
|
+
e.push(s ? n.replace(ur, "$1") : i || r);
|
|
520
520
|
}), e;
|
|
521
521
|
});
|
|
522
522
|
function fr(t) {
|
|
523
|
-
return t == null ? "" :
|
|
523
|
+
return t == null ? "" : Me(t);
|
|
524
524
|
}
|
|
525
525
|
function xe(t, e) {
|
|
526
526
|
return Q(t) ? t : $t(t, e) ? [t] : cr(fr(t));
|
|
@@ -534,27 +534,27 @@ function Re(t) {
|
|
|
534
534
|
}
|
|
535
535
|
function pr(t, e) {
|
|
536
536
|
e = xe(e, t);
|
|
537
|
-
for (var r = 0,
|
|
537
|
+
for (var r = 0, i = e.length; t != null && r < i; )
|
|
538
538
|
t = t[Re(e[r++])];
|
|
539
|
-
return r && r ==
|
|
539
|
+
return r && r == i ? t : void 0;
|
|
540
540
|
}
|
|
541
541
|
function L(t, e, r) {
|
|
542
|
-
var
|
|
543
|
-
return
|
|
542
|
+
var i = t == null ? void 0 : pr(t, e);
|
|
543
|
+
return i === void 0 ? r : i;
|
|
544
544
|
}
|
|
545
|
-
function hr(t, e, r,
|
|
545
|
+
function hr(t, e, r, i) {
|
|
546
546
|
if (!G(t))
|
|
547
547
|
return t;
|
|
548
548
|
e = xe(e, t);
|
|
549
|
-
for (var
|
|
550
|
-
var c = Re(e[
|
|
549
|
+
for (var s = -1, n = e.length, a = n - 1, l = t; l != null && ++s < n; ) {
|
|
550
|
+
var c = Re(e[s]), d = r;
|
|
551
551
|
if (c === "__proto__" || c === "constructor" || c === "prototype")
|
|
552
552
|
return t;
|
|
553
|
-
if (
|
|
553
|
+
if (s != a) {
|
|
554
554
|
var p = l[c];
|
|
555
|
-
d =
|
|
555
|
+
d = i ? i(p, c, l) : void 0, d === void 0 && (d = G(p) ? p : Ft(e[s + 1]) ? [] : {});
|
|
556
556
|
}
|
|
557
|
-
|
|
557
|
+
Et(l, c, d), l = l[c];
|
|
558
558
|
}
|
|
559
559
|
return t;
|
|
560
560
|
}
|
|
@@ -578,14 +578,10 @@ class mr {
|
|
|
578
578
|
u(this, "defaultValueInprogressMap", /* @__PURE__ */ new Map());
|
|
579
579
|
u(this, "baseDefaultValueFunctionsLength");
|
|
580
580
|
u(this, "isModelInitialized", !0);
|
|
581
|
-
u(this, "modelTriggerTimer");
|
|
582
|
-
u(this, "reactiveWatchMap", /* @__PURE__ */ new Map());
|
|
583
581
|
this.runtimeCore = e, this.processedSchemas = e.schemas, this.processedModel = e.model, this.getRuntimeMeta = e.getRuntimeMeta.bind(e), _(
|
|
584
582
|
() => this.processedModel.value,
|
|
585
583
|
() => {
|
|
586
|
-
this.
|
|
587
|
-
this.schemaEffect.triggerEffects();
|
|
588
|
-
}, 0);
|
|
584
|
+
this.schemaEffect.triggerEffects();
|
|
589
585
|
},
|
|
590
586
|
{
|
|
591
587
|
deep: !0
|
|
@@ -594,28 +590,28 @@ class mr {
|
|
|
594
590
|
}
|
|
595
591
|
// 核心处理过程,接收一个初始的代理数据结构,由其衍生的有 parseSchema
|
|
596
592
|
parse(e, r) {
|
|
597
|
-
e.forEach((
|
|
598
|
-
this.parseItem(
|
|
593
|
+
e.forEach((i, s) => {
|
|
594
|
+
this.parseItem(i, s, r);
|
|
599
595
|
});
|
|
600
596
|
}
|
|
601
597
|
// 初始化空数据结构,避免后续复杂的 if else
|
|
602
598
|
initSchemas(e) {
|
|
603
599
|
return e.map((r) => {
|
|
604
|
-
const
|
|
605
|
-
return r.children && (
|
|
600
|
+
const i = {};
|
|
601
|
+
return r.children && (i.children = this.initSchemas(r.children)), i;
|
|
606
602
|
});
|
|
607
603
|
}
|
|
608
604
|
countFunctionDefaultValues(e) {
|
|
609
605
|
let r = 0;
|
|
610
|
-
const
|
|
611
|
-
function
|
|
612
|
-
if (!
|
|
613
|
-
|
|
606
|
+
const i = /* @__PURE__ */ new Set();
|
|
607
|
+
function s(n) {
|
|
608
|
+
if (!i.has(n) && (Array.isArray(n) || n !== null && typeof n == "object")) {
|
|
609
|
+
i.add(n);
|
|
614
610
|
for (const a in n)
|
|
615
|
-
n.hasOwnProperty(a) && (a === "defaultValue" && typeof n[a] == "function" && !n[a].toString().includes("[native code]") && r++,
|
|
611
|
+
n.hasOwnProperty(a) && (a === "defaultValue" && typeof n[a] == "function" && !n[a].toString().includes("[native code]") && r++, s(n[a]));
|
|
616
612
|
}
|
|
617
613
|
}
|
|
618
|
-
return
|
|
614
|
+
return s(e), r;
|
|
619
615
|
}
|
|
620
616
|
// 派生过程,用于外部应用
|
|
621
617
|
parseSchemas(e, r) {
|
|
@@ -634,81 +630,81 @@ class mr {
|
|
|
634
630
|
// 对于稳定初始化更新的抽象
|
|
635
631
|
stableUpdater(e = []) {
|
|
636
632
|
if (e.every(Boolean)) {
|
|
637
|
-
const r =
|
|
633
|
+
const r = E(this.processedSchemas.value);
|
|
638
634
|
!o.isProcessInprogress(r) && o.isObjectEmpty(this.stableModel) && (this.stableUpdaterProcessProgress || (this.stableUpdaterProcessProgress = Array.from({
|
|
639
635
|
length: r.length
|
|
640
636
|
}).fill(!1)), this.stableUpdaterProcessProgress[this.stableUpdaterTimes] = !0, this.stableUpdaterTimes++, this.modelProcessor(r));
|
|
641
637
|
}
|
|
642
638
|
}
|
|
643
639
|
// 核心单 schema 处理过程,接收一个对象键值对的数据结构
|
|
644
|
-
parseItem(e, r,
|
|
645
|
-
const
|
|
640
|
+
parseItem(e, r, i) {
|
|
641
|
+
const s = this, n = Array.from({
|
|
646
642
|
length: Object.keys(e).filter((l) => l !== "children").length
|
|
647
643
|
}).fill(!1);
|
|
648
|
-
this.objectParser({ data: e, index: r, updater: a, parentMeta:
|
|
644
|
+
this.objectParser({ data: e, index: r, updater: a, parentMeta: i });
|
|
649
645
|
function a(l) {
|
|
650
646
|
const c = l.index, d = l.key, p = l.keyIndex;
|
|
651
647
|
if (o.isUndefined(l.stable))
|
|
652
648
|
return;
|
|
653
|
-
const m =
|
|
649
|
+
const m = s.parseStable(l.stable), b = i == null ? void 0 : i.index, S = i == null ? void 0 : i.key;
|
|
654
650
|
let v = m;
|
|
655
|
-
if (o.isProcessInprogress(v) || (n[p] = !0),
|
|
656
|
-
const
|
|
657
|
-
|
|
651
|
+
if (o.isProcessInprogress(v) || (n[p] = !0), i) {
|
|
652
|
+
const g = s.processedSchemas.value[b][S][c][d];
|
|
653
|
+
g && o.isObject(g) && d !== "component" && (v = h(g, v)), s.processedSchemas.value[b][S][c][d] = v, s.stableUpdater(n);
|
|
658
654
|
} else {
|
|
659
|
-
const
|
|
660
|
-
|
|
655
|
+
const g = s.processedSchemas.value[c][d];
|
|
656
|
+
g && o.isObject(g) && d !== "component" && (v = h(g, v)), s.processedSchemas.value[c][d] = v, s.stableUpdater(n);
|
|
661
657
|
}
|
|
662
658
|
}
|
|
663
659
|
}
|
|
664
660
|
// 只做基本的对象 parser
|
|
665
661
|
objectParser(e) {
|
|
666
662
|
const r = e.data;
|
|
667
|
-
Object.keys(r).forEach((
|
|
663
|
+
Object.keys(r).forEach((s, n) => {
|
|
668
664
|
var a, l;
|
|
669
|
-
if (
|
|
670
|
-
this.parseSchemas(r[
|
|
665
|
+
if (s === "children")
|
|
666
|
+
this.parseSchemas(r[s], {
|
|
671
667
|
...e,
|
|
672
|
-
key:
|
|
668
|
+
key: s,
|
|
673
669
|
keyIndex: n
|
|
674
670
|
});
|
|
675
671
|
else {
|
|
676
672
|
const c = (d) => {
|
|
677
673
|
e.updater({
|
|
678
674
|
...e,
|
|
679
|
-
key:
|
|
675
|
+
key: s,
|
|
680
676
|
keyIndex: n,
|
|
681
677
|
stable: d
|
|
682
678
|
});
|
|
683
679
|
};
|
|
684
|
-
o.isFunction(r[
|
|
680
|
+
o.isFunction(r[s]) ? s !== "defaultValue" ? this.schemaEffect.trackEffect(
|
|
685
681
|
() => {
|
|
686
|
-
if (
|
|
687
|
-
const d = r[
|
|
682
|
+
if (s === "component") {
|
|
683
|
+
const d = r[s](this.getRuntimeMeta());
|
|
688
684
|
this.promiseFieldParser(d, c, !1, {
|
|
689
685
|
rootIndex: e.index,
|
|
690
686
|
parentMeta: e.parentMeta
|
|
691
687
|
});
|
|
692
688
|
} else
|
|
693
|
-
this.fieldParser(r[
|
|
689
|
+
this.fieldParser(r[s], c, {
|
|
694
690
|
rootIndex: e.index,
|
|
695
691
|
parentMeta: e.parentMeta
|
|
696
692
|
});
|
|
697
693
|
},
|
|
698
694
|
{
|
|
699
695
|
lazy: !1,
|
|
700
|
-
identifier: `${(a = e.parentMeta) == null ? void 0 : a.key}${(l = e.parentMeta) == null ? void 0 : l.index}${e.index}${
|
|
696
|
+
identifier: `${(a = e.parentMeta) == null ? void 0 : a.key}${(l = e.parentMeta) == null ? void 0 : l.index}${e.index}${s}${n}`
|
|
701
697
|
}
|
|
702
698
|
) : this.defaultValueEffect.trackEffect(
|
|
703
699
|
() => {
|
|
704
700
|
const d = this.schemaEffect.trackEffect(
|
|
705
701
|
() => {
|
|
706
|
-
/\{\s*model\s*\}/.test(r[
|
|
707
|
-
r[
|
|
702
|
+
/\{\s*model\s*\}/.test(r[s].toString()) ? this.fieldParser(
|
|
703
|
+
r[s],
|
|
708
704
|
(p) => {
|
|
709
705
|
if (!p)
|
|
710
706
|
return c(p);
|
|
711
|
-
this.defaultValueInprogressMap.set(r[
|
|
707
|
+
this.defaultValueInprogressMap.set(r[s], p), !o.isProcessInprogress(p) && this.defaultValueInprogressMap.size === this.baseDefaultValueFunctionsLength && Array.from(
|
|
712
708
|
this.defaultValueInprogressMap.values()
|
|
713
709
|
).every((m) => {
|
|
714
710
|
var b;
|
|
@@ -722,9 +718,9 @@ class mr {
|
|
|
722
718
|
parentMeta: e.parentMeta
|
|
723
719
|
}
|
|
724
720
|
) : this.fieldParser(
|
|
725
|
-
r[
|
|
721
|
+
r[s],
|
|
726
722
|
(p) => {
|
|
727
|
-
this.defaultValueInprogressMap.set(r[
|
|
723
|
+
this.defaultValueInprogressMap.set(r[s], p), !o.isProcessInprogress(p) && this.defaultValueInprogressMap.size === this.baseDefaultValueFunctionsLength && Array.from(
|
|
728
724
|
this.defaultValueInprogressMap.values()
|
|
729
725
|
).every((m) => {
|
|
730
726
|
var b;
|
|
@@ -747,33 +743,33 @@ class mr {
|
|
|
747
743
|
{
|
|
748
744
|
lazy: !1
|
|
749
745
|
}
|
|
750
|
-
) :
|
|
746
|
+
) : s === "component" || s === "slots" || s === "runtime" ? this.promiseFieldParser(r[s], c, !1, {
|
|
751
747
|
rootIndex: e.index,
|
|
752
748
|
parentMeta: e.parentMeta
|
|
753
|
-
}) : this.fieldParser(r[
|
|
749
|
+
}) : this.fieldParser(r[s], c, {
|
|
754
750
|
rootIndex: e.index,
|
|
755
751
|
parentMeta: e.parentMeta
|
|
756
752
|
});
|
|
757
753
|
}
|
|
758
754
|
});
|
|
759
755
|
}
|
|
760
|
-
promiseFieldParser(e, r,
|
|
756
|
+
promiseFieldParser(e, r, i, s) {
|
|
761
757
|
o.isPromise(e) ? e.then((n) => {
|
|
762
|
-
o.isString(n) && (n = K(n, "")),
|
|
758
|
+
o.isString(n) && (n = K(n, "")), i && o.isObject(n) && !o.isNativeObject(n) ? this.objectParser({
|
|
763
759
|
data: n,
|
|
764
760
|
updater: r,
|
|
765
|
-
index:
|
|
766
|
-
parentMeta:
|
|
761
|
+
index: s.rootIndex,
|
|
762
|
+
parentMeta: s.parentMeta
|
|
767
763
|
}) : r(n);
|
|
768
|
-
}) : (o.isString(e) && (e = K(e, "")),
|
|
764
|
+
}) : (o.isString(e) && (e = K(e, "")), i && o.isObject(e) && !o.isNativeObject(e) ? this.objectParser({
|
|
769
765
|
data: e,
|
|
770
766
|
updater: r,
|
|
771
|
-
index:
|
|
772
|
-
parentMeta:
|
|
767
|
+
index: s.rootIndex,
|
|
768
|
+
parentMeta: s.parentMeta
|
|
773
769
|
}) : r(e));
|
|
774
770
|
}
|
|
775
771
|
// 对任意对象中单个字段的 parse: 做基本处理
|
|
776
|
-
fieldParser(e, r,
|
|
772
|
+
fieldParser(e, r, i, s = !0) {
|
|
777
773
|
if (o.isFunction(e))
|
|
778
774
|
if (e.name.startsWith("__proform_raw_"))
|
|
779
775
|
r(
|
|
@@ -786,45 +782,45 @@ class mr {
|
|
|
786
782
|
r(e);
|
|
787
783
|
else if (e.__proform_cached_result) {
|
|
788
784
|
const n = e.__proform_cached_result;
|
|
789
|
-
this.promiseFieldParser(n, r,
|
|
785
|
+
this.promiseFieldParser(n, r, s, i);
|
|
790
786
|
} else {
|
|
791
787
|
const n = e(this.getRuntimeMeta());
|
|
792
|
-
e.name.startsWith("__proform_onetime_") && (e.__proform_cached_result = n), this.promiseFieldParser(n, r,
|
|
788
|
+
e.name.startsWith("__proform_onetime_") && (e.__proform_cached_result = n), this.promiseFieldParser(n, r, s, i);
|
|
793
789
|
}
|
|
794
790
|
else
|
|
795
|
-
|
|
791
|
+
q(e) ? _(
|
|
796
792
|
() => e.value,
|
|
797
793
|
() => {
|
|
798
|
-
o.isUndefined(e.value) || (
|
|
794
|
+
o.isUndefined(e.value) || (s && o.isObject(e.value) && !o.isNativeObject(e.value) ? this.objectParser({
|
|
799
795
|
data: e.value,
|
|
800
796
|
updater: r,
|
|
801
|
-
index:
|
|
802
|
-
parentMeta:
|
|
797
|
+
index: i.rootIndex,
|
|
798
|
+
parentMeta: i.parentMeta
|
|
803
799
|
}) : r(e.value));
|
|
804
800
|
},
|
|
805
801
|
{
|
|
806
802
|
immediate: !0,
|
|
807
803
|
deep: !0
|
|
808
804
|
}
|
|
809
|
-
) :
|
|
805
|
+
) : U(e) ? _(
|
|
810
806
|
() => e,
|
|
811
807
|
() => {
|
|
812
|
-
|
|
808
|
+
o.isUndefined(e) || (s && o.isObject(e) && !o.isNativeObject(e) ? this.objectParser({
|
|
813
809
|
data: e,
|
|
814
810
|
updater: r,
|
|
815
|
-
index:
|
|
816
|
-
parentMeta:
|
|
817
|
-
}) : r(e))
|
|
811
|
+
index: i.rootIndex,
|
|
812
|
+
parentMeta: i.parentMeta
|
|
813
|
+
}) : r(e));
|
|
818
814
|
},
|
|
819
815
|
{
|
|
820
816
|
immediate: !0,
|
|
821
817
|
deep: !0
|
|
822
818
|
}
|
|
823
|
-
) :
|
|
819
|
+
) : s && o.isObject(e) && !o.isNativeObject(e) ? this.objectParser({
|
|
824
820
|
data: e,
|
|
825
821
|
updater: r,
|
|
826
|
-
index:
|
|
827
|
-
parentMeta:
|
|
822
|
+
index: i.rootIndex,
|
|
823
|
+
parentMeta: i.parentMeta
|
|
828
824
|
}) : r(e);
|
|
829
825
|
}
|
|
830
826
|
modelProcessor(e) {
|
|
@@ -832,14 +828,14 @@ class mr {
|
|
|
832
828
|
(r) => this.createModel(r, this.processedModel.value)
|
|
833
829
|
), o.isObjectEmpty(this.stableModel) && this.stableUpdaterProcessProgress.every(Boolean) && this.defaultValueEffect.effects.size === 0 && (this.stableModel = C(this.processedModel.value), this.runtimeCore.hydrateEffect.triggerEffects(), this.runtimeCore.hydrateEffect.clearEffects());
|
|
834
830
|
}
|
|
835
|
-
setModel(e, r,
|
|
836
|
-
o.isFunction(r) ? D(e, r(),
|
|
831
|
+
setModel(e, r, i) {
|
|
832
|
+
o.isFunction(r) ? D(e, r(), i) : e[r] = i;
|
|
837
833
|
}
|
|
838
834
|
createModel(e, r) {
|
|
839
|
-
if (o.isListSchema(e) && (r[e.field] || this.setModel(r, e.field, [{}]), e.children.forEach((
|
|
840
|
-
this.createModel(
|
|
841
|
-
})), o.isGroupSchema(e) && e.children.forEach((
|
|
842
|
-
this.createModel(
|
|
835
|
+
if (o.isListSchema(e) && (r[e.field] || this.setModel(r, e.field, [{}]), e.children.forEach((i) => {
|
|
836
|
+
this.createModel(i, r[e.field][0]);
|
|
837
|
+
})), o.isGroupSchema(e) && e.children.forEach((i) => {
|
|
838
|
+
this.createModel(i, r);
|
|
843
839
|
}), o.isItemSchema(e))
|
|
844
840
|
if ("defaultValue" in e)
|
|
845
841
|
this.setModel(r, e.field, e.defaultValue);
|
|
@@ -852,7 +848,7 @@ class mr {
|
|
|
852
848
|
}
|
|
853
849
|
}
|
|
854
850
|
}
|
|
855
|
-
class
|
|
851
|
+
class w {
|
|
856
852
|
static getFormContainer({ ui: e } = {}) {
|
|
857
853
|
return f.presets.uiPresets[e ?? f.presets.ui].container.Form;
|
|
858
854
|
}
|
|
@@ -872,7 +868,7 @@ class E {
|
|
|
872
868
|
return f.presets.uiPresets[e ?? f.presets.ui].container.ListItem;
|
|
873
869
|
}
|
|
874
870
|
}
|
|
875
|
-
class
|
|
871
|
+
class yr {
|
|
876
872
|
constructor(e) {
|
|
877
873
|
this.ui = e;
|
|
878
874
|
}
|
|
@@ -881,33 +877,33 @@ class gr {
|
|
|
881
877
|
return (r = f.presets.uiPresets[this.ui]) == null ? void 0 : r.native;
|
|
882
878
|
}
|
|
883
879
|
getRuntimeField(e) {
|
|
884
|
-
var
|
|
885
|
-
const r = (
|
|
886
|
-
return (r == null ? void 0 : r.getRuntimeField(e)) ?? (
|
|
880
|
+
var s;
|
|
881
|
+
const r = (s = f.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i = I.adapters[f.getUI(this.ui)];
|
|
882
|
+
return (r == null ? void 0 : r.getRuntimeField(e)) ?? (i == null ? void 0 : i.getRuntimeField(e));
|
|
887
883
|
}
|
|
888
884
|
getRuntimeRequired(e) {
|
|
889
|
-
var
|
|
890
|
-
const r = (
|
|
891
|
-
return (r == null ? void 0 : r.getRuntimeRequired(e)) ?? (
|
|
885
|
+
var s;
|
|
886
|
+
const r = (s = f.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i = I.adapters[f.getUI(this.ui)];
|
|
887
|
+
return (r == null ? void 0 : r.getRuntimeRequired(e)) ?? (i == null ? void 0 : i.getRuntimeRequired(e));
|
|
892
888
|
}
|
|
893
889
|
getFormModelPropName() {
|
|
894
|
-
var
|
|
895
|
-
const e = (
|
|
890
|
+
var i;
|
|
891
|
+
const e = (i = f.presets.uiPresets[this.ui]) == null ? void 0 : i.adapter, r = I.adapters[f.getUI(this.ui)];
|
|
896
892
|
return (e == null ? void 0 : e.getFormModelPropName()) ?? (r == null ? void 0 : r.getFormModelPropName());
|
|
897
893
|
}
|
|
898
894
|
formComponentRenderer(e) {
|
|
899
|
-
var
|
|
900
|
-
const r = (
|
|
901
|
-
return (r == null ? void 0 : r.formComponentRenderer(e)) ?? (
|
|
895
|
+
var s;
|
|
896
|
+
const r = (s = f.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i = I.adapters[f.getUI(this.ui)];
|
|
897
|
+
return (r == null ? void 0 : r.formComponentRenderer(e)) ?? (i == null ? void 0 : i.formComponentRenderer(e));
|
|
902
898
|
}
|
|
903
899
|
clearValidate(e) {
|
|
904
|
-
var
|
|
905
|
-
const r = (
|
|
906
|
-
return (r == null ? void 0 : r.clearValidate(e)) ?? (
|
|
900
|
+
var s;
|
|
901
|
+
const r = (s = f.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i = I.adapters[f.getUI(this.ui)];
|
|
902
|
+
return (r == null ? void 0 : r.clearValidate(e)) ?? (i == null ? void 0 : i.clearValidate(e));
|
|
907
903
|
}
|
|
908
904
|
}
|
|
909
|
-
function
|
|
910
|
-
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !
|
|
905
|
+
function gr(t) {
|
|
906
|
+
return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !Be(t);
|
|
911
907
|
}
|
|
912
908
|
class br {
|
|
913
909
|
constructor(e) {
|
|
@@ -936,43 +932,48 @@ class br {
|
|
|
936
932
|
u(this, "shared", {});
|
|
937
933
|
this.setup = e, this.processor = new mr(this);
|
|
938
934
|
const r = this.setup(this);
|
|
939
|
-
this.ui = r.ui ?? f.presets.ui, this.runtimeAdapter = new
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
935
|
+
if (this.ui = r.ui ?? f.presets.ui, this.runtimeAdapter = new yr(this.ui), Object.assign(this.globalNativeFormOverride, this.runtimeAdapter.getRuntimeNative()), q(r.schemas))
|
|
936
|
+
_(
|
|
937
|
+
// @ts-expect-error
|
|
938
|
+
() => r.schemas.value,
|
|
939
|
+
() => {
|
|
940
|
+
this.processor.parseSchemas(r.schemas.value);
|
|
941
|
+
},
|
|
942
|
+
{
|
|
943
|
+
deep: !0
|
|
944
|
+
}
|
|
945
|
+
);
|
|
946
|
+
else if (U(r.schemas)) {
|
|
947
|
+
const i = _(() => r.schemas, () => {
|
|
948
|
+
this.processor.parseSchemas(r.schemas), P(() => {
|
|
949
|
+
i();
|
|
950
|
+
});
|
|
951
|
+
}, {
|
|
952
|
+
deep: !0
|
|
953
|
+
});
|
|
954
|
+
} else
|
|
955
|
+
this.processor.parseSchemas(r.schemas);
|
|
955
956
|
}
|
|
956
957
|
getRuntimeMeta() {
|
|
957
958
|
return {
|
|
958
|
-
model:
|
|
959
|
+
model: E(C(this.model.value)),
|
|
959
960
|
reactiveModel: this.model.value,
|
|
960
961
|
shared: this.shared,
|
|
961
962
|
// share 增加防抖,当开发者在过程中进行 share 时避免频繁触发爆栈
|
|
962
963
|
share: (r) => {
|
|
963
|
-
if (
|
|
964
|
-
const
|
|
964
|
+
if (q(r)) {
|
|
965
|
+
const i = _(() => r.value, () => {
|
|
965
966
|
h(this.shared, r.value), P(() => {
|
|
966
|
-
|
|
967
|
+
i();
|
|
967
968
|
});
|
|
968
969
|
}, {
|
|
969
970
|
deep: !0,
|
|
970
971
|
immediate: !0
|
|
971
972
|
});
|
|
972
|
-
} else if (
|
|
973
|
-
const
|
|
973
|
+
} else if (U(r)) {
|
|
974
|
+
const i = _(() => r, () => {
|
|
974
975
|
h(this.shared, r), P(() => {
|
|
975
|
-
|
|
976
|
+
i();
|
|
976
977
|
});
|
|
977
978
|
}, {
|
|
978
979
|
deep: !0,
|
|
@@ -983,51 +984,51 @@ class br {
|
|
|
983
984
|
}
|
|
984
985
|
};
|
|
985
986
|
}
|
|
986
|
-
runtimeItemProcessor(e, r,
|
|
987
|
-
var re,
|
|
988
|
-
const n =
|
|
987
|
+
runtimeItemProcessor(e, r, i = this.model.value, s) {
|
|
988
|
+
var re, ie, se, ne, oe, ae, le, ue, ce, fe, de, pe, he, me, ye, ge, be;
|
|
989
|
+
const n = E(e.component);
|
|
989
990
|
if (!n)
|
|
990
991
|
return;
|
|
991
|
-
(
|
|
992
|
+
(ie = (re = e.native) == null ? void 0 : re.props) != null && ie.Form && h(this.globalNativeFormOverride.props.Form, (ne = (se = e.native) == null ? void 0 : se.props) == null ? void 0 : ne.Form), (ae = (oe = e.native) == null ? void 0 : oe.slots) != null && ae.Form && h(this.globalNativeFormOverride.slots.Form, (ue = (le = e.native) == null ? void 0 : le.slots) == null ? void 0 : ue.Form);
|
|
992
993
|
const a = h(C((fe = (ce = this.native) == null ? void 0 : ce.slots) == null ? void 0 : fe.FormItem) ?? {}, (pe = (de = e.native) == null ? void 0 : de.slots) == null ? void 0 : pe.FormItem), l = {
|
|
993
994
|
display: "grid",
|
|
994
995
|
gridColumn: "1 / -1",
|
|
995
996
|
...e.grid
|
|
996
|
-
}, c = h(C((me = (he = this.native) == null ? void 0 : he.props) == null ? void 0 : me.FormItem) ?? {}, (
|
|
997
|
+
}, c = h(C((me = (he = this.native) == null ? void 0 : he.props) == null ? void 0 : me.FormItem) ?? {}, (ge = (ye = e.native) == null ? void 0 : ye.props) == null ? void 0 : ge.FormItem), d = this.runtimeAdapter.getRuntimeField({
|
|
997
998
|
schema: e,
|
|
998
|
-
parentSchema:
|
|
999
|
+
parentSchema: s,
|
|
999
1000
|
index: r
|
|
1000
1001
|
}), p = n.name, m = e.componentProps ?? {}, b = I.placeholderPresetByComponentName;
|
|
1001
1002
|
let S = e.placeholder, v = e.show;
|
|
1002
1003
|
v === void 0 && (v = !0);
|
|
1003
|
-
let
|
|
1004
|
-
if (e.runtime ? O = e.runtime : O = (
|
|
1004
|
+
let g = e.label ?? "", O;
|
|
1005
|
+
if (e.runtime ? O = e.runtime : O = (s == null ? void 0 : s.runtime) ?? this.runtime, !o.isUndefined(r) && !o.isObjectEmpty(O) && (g = K((be = O == null ? void 0 : O.customizeListItemLabel) == null ? void 0 : be.call(O, e.label ?? "", r + 1), "")), !S) {
|
|
1005
1006
|
let $ = "请输入";
|
|
1006
|
-
o.isUndefined(p) ? S = `${$}${
|
|
1007
|
-
b[p.toLowerCase()], S = `${$}${
|
|
1007
|
+
o.isUndefined(p) ? S = `${$}${g}` : /* @ts-expect-error */ b[p.toLowerCase()] ? ($ = // @ts-expect-error
|
|
1008
|
+
b[p.toLowerCase()], S = `${$}${g}`) : (Object.keys(b).forEach((ve) => {
|
|
1008
1009
|
p.toLowerCase().includes(ve.toLowerCase()) && ($ = b[ve]);
|
|
1009
|
-
}), S = `${$}${
|
|
1010
|
+
}), S = `${$}${g}`);
|
|
1010
1011
|
}
|
|
1011
1012
|
const $e = this.runtimeAdapter.getRuntimeRequired({
|
|
1012
1013
|
...e,
|
|
1013
|
-
label:
|
|
1014
|
-
}), Ve =
|
|
1015
|
-
return
|
|
1014
|
+
label: g
|
|
1015
|
+
}), Ve = w.getItemContainer(this), Ne = w.getFormItemContainer(this), qe = this, Ue = e.componentSlots;
|
|
1016
|
+
return y("div", {
|
|
1016
1017
|
style: l
|
|
1017
|
-
}, [
|
|
1018
|
+
}, [y(Ve, {
|
|
1018
1019
|
show: v
|
|
1019
1020
|
}, {
|
|
1020
1021
|
default() {
|
|
1021
|
-
return v &&
|
|
1022
|
-
label: `${
|
|
1022
|
+
return v && y(Ne, N(c, {
|
|
1023
|
+
label: `${g ? `${g}:` : ""}`
|
|
1023
1024
|
}, d, $e), {
|
|
1024
1025
|
default() {
|
|
1025
|
-
return
|
|
1026
|
+
return qe.runtimeAdapter.formComponentRenderer({
|
|
1026
1027
|
Component: n,
|
|
1027
1028
|
schema: e,
|
|
1028
|
-
baseModel:
|
|
1029
|
+
baseModel: i,
|
|
1029
1030
|
placeholder: S,
|
|
1030
|
-
componentSlots:
|
|
1031
|
+
componentSlots: Ue,
|
|
1031
1032
|
props: m
|
|
1032
1033
|
});
|
|
1033
1034
|
},
|
|
@@ -1038,28 +1039,28 @@ class br {
|
|
|
1038
1039
|
}
|
|
1039
1040
|
runtimeGroupProcessor(e) {
|
|
1040
1041
|
let r;
|
|
1041
|
-
const
|
|
1042
|
+
const i = {
|
|
1042
1043
|
display: "grid",
|
|
1043
1044
|
gridColumn: "1 / -1",
|
|
1044
1045
|
...e.grid
|
|
1045
|
-
},
|
|
1046
|
+
}, s = w.getGroupContainer(this);
|
|
1046
1047
|
let n = e.show;
|
|
1047
|
-
return n === void 0 && (n = !0),
|
|
1048
|
-
style:
|
|
1049
|
-
}, [n &&
|
|
1048
|
+
return n === void 0 && (n = !0), y("div", {
|
|
1049
|
+
style: i
|
|
1050
|
+
}, [n && y(s, {
|
|
1050
1051
|
schema: e
|
|
1051
|
-
},
|
|
1052
|
+
}, gr(r = e.children.map((a) => this.runtimeItemProcessor(a))) ? r : {
|
|
1052
1053
|
default: () => [r]
|
|
1053
1054
|
})]);
|
|
1054
1055
|
}
|
|
1055
1056
|
addListItem(e) {
|
|
1056
|
-
var r,
|
|
1057
|
+
var r, i;
|
|
1057
1058
|
if (!((r = this.processor.stableModel[e.field]) != null && r[0]))
|
|
1058
1059
|
return Promise.reject({
|
|
1059
1060
|
code: "0001",
|
|
1060
1061
|
message: "异步默认值数据正在处理中,请您耐心等待... "
|
|
1061
1062
|
});
|
|
1062
|
-
(
|
|
1063
|
+
(i = this.processor.stableModel[e.field]) != null && i[0] && this.model.value[e.field].push(C(this.processor.stableModel[e.field][0])), this.runtimeAdapter.clearValidate(this);
|
|
1063
1064
|
}
|
|
1064
1065
|
deleteListItem(e, r) {
|
|
1065
1066
|
this.model.value[e.field].splice(r, 1), this.runtimeAdapter.clearValidate(this);
|
|
@@ -1069,38 +1070,38 @@ class br {
|
|
|
1069
1070
|
display: "grid",
|
|
1070
1071
|
gridColumn: "1 / -1",
|
|
1071
1072
|
...e.grid
|
|
1072
|
-
},
|
|
1073
|
-
|
|
1074
|
-
let
|
|
1075
|
-
|
|
1076
|
-
const n =
|
|
1077
|
-
return
|
|
1073
|
+
}, i = this;
|
|
1074
|
+
i.model.value[e.field] || (i.model.value[e.field] = [{}]);
|
|
1075
|
+
let s = e.show;
|
|
1076
|
+
s === void 0 && (s = !0);
|
|
1077
|
+
const n = w.getListContainer(this), a = w.getListItemContainer(this);
|
|
1078
|
+
return y("div", {
|
|
1078
1079
|
style: r
|
|
1079
|
-
}, [
|
|
1080
|
+
}, [s && y(n, {
|
|
1080
1081
|
schema: e
|
|
1081
1082
|
}, {
|
|
1082
1083
|
default() {
|
|
1083
|
-
return
|
|
1084
|
+
return i.model.value[e.field].map((l, c) => y(a, null, {
|
|
1084
1085
|
default() {
|
|
1085
|
-
return e.children.map((d) =>
|
|
1086
|
+
return e.children.map((d) => i.runtimeItemProcessor(d, c, l, e));
|
|
1086
1087
|
},
|
|
1087
1088
|
delete({
|
|
1088
1089
|
container: d
|
|
1089
1090
|
} = {}) {
|
|
1090
1091
|
var m;
|
|
1091
|
-
const p = d ??
|
|
1092
|
-
return Le(
|
|
1093
|
-
onClick: () =>
|
|
1094
|
-
}, null), [[De, ((m =
|
|
1092
|
+
const p = d ?? y("button", null, null);
|
|
1093
|
+
return Le(y(p, {
|
|
1094
|
+
onClick: () => i.deleteListItem(e, c)
|
|
1095
|
+
}, null), [[De, ((m = i.model.value[e.field]) == null ? void 0 : m.length) > 1]]);
|
|
1095
1096
|
}
|
|
1096
1097
|
}));
|
|
1097
1098
|
},
|
|
1098
1099
|
add({
|
|
1099
1100
|
container: l
|
|
1100
1101
|
} = {}) {
|
|
1101
|
-
const c = l ??
|
|
1102
|
-
return
|
|
1103
|
-
onClick: () =>
|
|
1102
|
+
const c = l ?? y("button", null, [Ge("添加")]);
|
|
1103
|
+
return y(c, {
|
|
1104
|
+
onClick: () => i.addListItem(e)
|
|
1104
1105
|
}, null);
|
|
1105
1106
|
}
|
|
1106
1107
|
})]);
|
|
@@ -1115,33 +1116,33 @@ class br {
|
|
|
1115
1116
|
gridColumn: "1 / -1",
|
|
1116
1117
|
gridAutoColumns: "1fr",
|
|
1117
1118
|
...this.grid
|
|
1118
|
-
}, r = this,
|
|
1119
|
-
return
|
|
1119
|
+
}, r = this, i = h(this.globalNativeFormOverride.props.Form, C((c = (l = this.native) == null ? void 0 : l.props) == null ? void 0 : c.Form) ?? {}), s = h(this.globalNativeFormOverride.slots.Form, C((p = (d = this.native) == null ? void 0 : d.slots) == null ? void 0 : p.Form) ?? {}), n = w.getFormContainer(this), a = this.runtimeAdapter.getFormModelPropName();
|
|
1120
|
+
return y(n, N(i, {
|
|
1120
1121
|
ref: this.formRef
|
|
1121
1122
|
}, {
|
|
1122
1123
|
[a]: this.model.value
|
|
1123
1124
|
}), {
|
|
1124
1125
|
default() {
|
|
1125
|
-
return
|
|
1126
|
+
return y("div", {
|
|
1126
1127
|
style: e
|
|
1127
1128
|
}, [r.runtimeProcessor(r.schemas.value)]);
|
|
1128
1129
|
},
|
|
1129
|
-
...
|
|
1130
|
+
...s
|
|
1130
1131
|
});
|
|
1131
1132
|
}
|
|
1132
1133
|
}
|
|
1133
1134
|
class f {
|
|
1134
1135
|
static getPreset(e) {
|
|
1135
|
-
var r,
|
|
1136
|
-
return (
|
|
1136
|
+
var r, i, s;
|
|
1137
|
+
return (i = (r = this.presets.uiPresets) == null ? void 0 : r[e]) != null && i.extend ? this.presets.uiPresets[(s = this.presets.uiPresets[e]) == null ? void 0 : s.extend] : this.presets.uiPresets[e];
|
|
1137
1138
|
}
|
|
1138
1139
|
static getUI(e) {
|
|
1139
|
-
var r,
|
|
1140
|
-
return (
|
|
1140
|
+
var r, i, s;
|
|
1141
|
+
return (i = (r = this.presets.uiPresets) == null ? void 0 : r[e]) != null && i.extend ? (s = this.presets.uiPresets[e]) == null ? void 0 : s.extend : e;
|
|
1141
1142
|
}
|
|
1142
1143
|
}
|
|
1143
1144
|
u(f, "presets");
|
|
1144
|
-
function
|
|
1145
|
+
function W({
|
|
1145
1146
|
parentSchema: t,
|
|
1146
1147
|
schema: e,
|
|
1147
1148
|
index: r
|
|
@@ -1151,7 +1152,7 @@ function H({
|
|
|
1151
1152
|
const vr = {
|
|
1152
1153
|
ArcoVue: {
|
|
1153
1154
|
getRuntimeField(t) {
|
|
1154
|
-
const e =
|
|
1155
|
+
const e = W(t);
|
|
1155
1156
|
return o.isFunction(e) ? {
|
|
1156
1157
|
field: e()
|
|
1157
1158
|
} : {
|
|
@@ -1167,14 +1168,14 @@ const vr = {
|
|
|
1167
1168
|
message: `${t.label}是必填项`
|
|
1168
1169
|
});
|
|
1169
1170
|
else {
|
|
1170
|
-
const r = t.rules.findIndex((
|
|
1171
|
+
const r = t.rules.findIndex((i) => !o.isUndefined(i.required));
|
|
1171
1172
|
r !== -1 ? (t.rules[r].required = !0, t.rules[r].message = `${t.label}是必填项`) : t.rules.unshift({
|
|
1172
1173
|
required: !0,
|
|
1173
1174
|
message: `${t.label}是必填项`
|
|
1174
1175
|
});
|
|
1175
1176
|
}
|
|
1176
1177
|
else if (t.rules) {
|
|
1177
|
-
const r = (e = t.rules) == null ? void 0 : e.findIndex((
|
|
1178
|
+
const r = (e = t.rules) == null ? void 0 : e.findIndex((i) => !!i.required);
|
|
1178
1179
|
r !== -1 ? t.rules[r].required = !1 : t.rules.unshift({
|
|
1179
1180
|
required: !0,
|
|
1180
1181
|
message: `${t.label}是必填项`
|
|
@@ -1191,24 +1192,24 @@ const vr = {
|
|
|
1191
1192
|
Component: t,
|
|
1192
1193
|
baseModel: e,
|
|
1193
1194
|
schema: r,
|
|
1194
|
-
placeholder:
|
|
1195
|
-
componentSlots:
|
|
1195
|
+
placeholder: i,
|
|
1196
|
+
componentSlots: s,
|
|
1196
1197
|
props: n
|
|
1197
1198
|
}) {
|
|
1198
1199
|
let a;
|
|
1199
|
-
return o.isFunction(r.field) ? a = L(e, r.field()) : a = e[r.field],
|
|
1200
|
+
return o.isFunction(r.field) ? a = L(e, r.field()) : a = e[r.field], y(t, N({
|
|
1200
1201
|
modelValue: a,
|
|
1201
1202
|
"onUpdate:modelValue": (l) => {
|
|
1202
1203
|
o.isFunction(r.field) ? D(e, r.field(), l) : e[r.field] = l;
|
|
1203
1204
|
},
|
|
1204
|
-
placeholder:
|
|
1205
|
+
placeholder: i
|
|
1205
1206
|
}, n), {
|
|
1206
|
-
...
|
|
1207
|
+
...s
|
|
1207
1208
|
});
|
|
1208
1209
|
},
|
|
1209
1210
|
validateForm(t) {
|
|
1210
1211
|
return new Promise((e, r) => {
|
|
1211
|
-
t.runtimeCore.formRef.value.validate((
|
|
1212
|
+
t.runtimeCore.formRef.value.validate((i) => i ? r(i) : e(t.cleanFallbackFields(E(t.runtimeCore.processor.processedModel.value))));
|
|
1212
1213
|
});
|
|
1213
1214
|
},
|
|
1214
1215
|
clearValidate(t) {
|
|
@@ -1218,7 +1219,7 @@ const vr = {
|
|
|
1218
1219
|
},
|
|
1219
1220
|
NutUI: {
|
|
1220
1221
|
getRuntimeField(t) {
|
|
1221
|
-
const e =
|
|
1222
|
+
const e = W(t);
|
|
1222
1223
|
return o.isFunction(e) ? {
|
|
1223
1224
|
prop: e()
|
|
1224
1225
|
} : {
|
|
@@ -1234,14 +1235,14 @@ const vr = {
|
|
|
1234
1235
|
message: `${t.label}是必填项`
|
|
1235
1236
|
});
|
|
1236
1237
|
else {
|
|
1237
|
-
const r = t.rules.findIndex((
|
|
1238
|
+
const r = t.rules.findIndex((i) => !o.isUndefined(i.required));
|
|
1238
1239
|
r !== -1 ? (t.rules[r].required = !0, t.rules[r].message = `${t.label}是必填项`) : t.rules.unshift({
|
|
1239
1240
|
required: !0,
|
|
1240
1241
|
message: `${t.label}是必填项`
|
|
1241
1242
|
});
|
|
1242
1243
|
}
|
|
1243
1244
|
else if (t.rules) {
|
|
1244
|
-
const r = (e = t.rules) == null ? void 0 : e.findIndex((
|
|
1245
|
+
const r = (e = t.rules) == null ? void 0 : e.findIndex((i) => !!i.required);
|
|
1245
1246
|
r !== -1 ? t.rules[r].required = !1 : t.rules.unshift({
|
|
1246
1247
|
required: !0,
|
|
1247
1248
|
message: `${t.label}是必填项`
|
|
@@ -1259,28 +1260,28 @@ const vr = {
|
|
|
1259
1260
|
Component: t,
|
|
1260
1261
|
baseModel: e,
|
|
1261
1262
|
schema: r,
|
|
1262
|
-
placeholder:
|
|
1263
|
-
componentSlots:
|
|
1263
|
+
placeholder: i,
|
|
1264
|
+
componentSlots: s,
|
|
1264
1265
|
props: n
|
|
1265
1266
|
}) {
|
|
1266
1267
|
let a;
|
|
1267
|
-
return o.isFunction(r.field) ? a = L(e, r.field()) : a = e[r.field],
|
|
1268
|
+
return o.isFunction(r.field) ? a = L(e, r.field()) : a = e[r.field], y(t, N({
|
|
1268
1269
|
modelValue: a,
|
|
1269
1270
|
"onUpdate:modelValue": (l) => {
|
|
1270
1271
|
o.isFunction(r.field) ? D(e, r.field(), l) : e[r.field] = l;
|
|
1271
1272
|
},
|
|
1272
|
-
placeholder:
|
|
1273
|
+
placeholder: i
|
|
1273
1274
|
}, n), {
|
|
1274
|
-
...
|
|
1275
|
+
...s
|
|
1275
1276
|
});
|
|
1276
1277
|
},
|
|
1277
1278
|
validateForm(t) {
|
|
1278
1279
|
return new Promise((e, r) => {
|
|
1279
1280
|
t.runtimeCore.formRef.value.validate().then(({
|
|
1280
|
-
valid:
|
|
1281
|
-
errors:
|
|
1281
|
+
valid: i,
|
|
1282
|
+
errors: s
|
|
1282
1283
|
}) => {
|
|
1283
|
-
|
|
1284
|
+
i ? e(t.cleanFallbackFields(E(t.runtimeCore.processor.processedModel.value))) : r(s);
|
|
1284
1285
|
});
|
|
1285
1286
|
});
|
|
1286
1287
|
},
|
|
@@ -1291,7 +1292,7 @@ const vr = {
|
|
|
1291
1292
|
},
|
|
1292
1293
|
NaiveUI: {
|
|
1293
1294
|
getRuntimeField(t) {
|
|
1294
|
-
const e =
|
|
1295
|
+
const e = W(t);
|
|
1295
1296
|
return o.isFunction(e) ? {
|
|
1296
1297
|
path: e()
|
|
1297
1298
|
} : {
|
|
@@ -1308,7 +1309,7 @@ const vr = {
|
|
|
1308
1309
|
trigger: ["input", "blur"]
|
|
1309
1310
|
});
|
|
1310
1311
|
else {
|
|
1311
|
-
const r = t.rules.findIndex((
|
|
1312
|
+
const r = t.rules.findIndex((i) => !o.isUndefined(i.required));
|
|
1312
1313
|
r !== -1 ? (t.rules[r].required = !0, t.rules[r].message = `${t.label}是必填项`) : t.rules.unshift({
|
|
1313
1314
|
required: !0,
|
|
1314
1315
|
message: `${t.label}是必填项`,
|
|
@@ -1316,7 +1317,7 @@ const vr = {
|
|
|
1316
1317
|
});
|
|
1317
1318
|
}
|
|
1318
1319
|
else if (t.rules) {
|
|
1319
|
-
const r = (e = t.rules) == null ? void 0 : e.findIndex((
|
|
1320
|
+
const r = (e = t.rules) == null ? void 0 : e.findIndex((i) => !!i.required);
|
|
1320
1321
|
r !== -1 ? t.rules[r].required = !1 : t.rules.unshift({
|
|
1321
1322
|
required: !0,
|
|
1322
1323
|
message: `${t.label}是必填项`,
|
|
@@ -1334,24 +1335,24 @@ const vr = {
|
|
|
1334
1335
|
Component: t,
|
|
1335
1336
|
baseModel: e,
|
|
1336
1337
|
schema: r,
|
|
1337
|
-
placeholder:
|
|
1338
|
-
componentSlots:
|
|
1338
|
+
placeholder: i,
|
|
1339
|
+
componentSlots: s,
|
|
1339
1340
|
props: n
|
|
1340
1341
|
}) {
|
|
1341
1342
|
let a;
|
|
1342
|
-
return o.isFunction(r.field) ? a = L(e, r.field()) : a = e[r.field],
|
|
1343
|
+
return o.isFunction(r.field) ? a = L(e, r.field()) : a = e[r.field], y(t, N({
|
|
1343
1344
|
value: a,
|
|
1344
1345
|
"onUpdate:value": (l) => {
|
|
1345
1346
|
o.isFunction(r.field) ? D(e, r.field(), l) : e[r.field] = l;
|
|
1346
1347
|
},
|
|
1347
|
-
placeholder:
|
|
1348
|
+
placeholder: i
|
|
1348
1349
|
}, n), {
|
|
1349
|
-
...
|
|
1350
|
+
...s
|
|
1350
1351
|
});
|
|
1351
1352
|
},
|
|
1352
1353
|
validateForm(t) {
|
|
1353
1354
|
return new Promise((e, r) => {
|
|
1354
|
-
t.runtimeCore.formRef.value.validate((
|
|
1355
|
+
t.runtimeCore.formRef.value.validate((i) => i ? r(i) : e(t.cleanFallbackFields(E(t.runtimeCore.processor.processedModel.value))));
|
|
1355
1356
|
});
|
|
1356
1357
|
},
|
|
1357
1358
|
clearValidate(t) {
|
|
@@ -1359,20 +1360,20 @@ const vr = {
|
|
|
1359
1360
|
(r = (e = t.formRef.value) == null ? void 0 : e.restoreValidation) == null || r.call(e);
|
|
1360
1361
|
}
|
|
1361
1362
|
}
|
|
1362
|
-
},
|
|
1363
|
+
}, M = class M {
|
|
1363
1364
|
static getPlaceholderPrefixPresetByComponentName() {
|
|
1364
1365
|
const e = {
|
|
1365
1366
|
请选择: ["select", "tree"],
|
|
1366
1367
|
请输入: ["input"]
|
|
1367
1368
|
}, r = {};
|
|
1368
|
-
for (const
|
|
1369
|
-
e[
|
|
1370
|
-
r[
|
|
1369
|
+
for (const i in e)
|
|
1370
|
+
e[i].forEach((s) => {
|
|
1371
|
+
r[s] = i;
|
|
1371
1372
|
});
|
|
1372
1373
|
return r;
|
|
1373
1374
|
}
|
|
1374
1375
|
};
|
|
1375
|
-
u(
|
|
1376
|
+
u(M, "schemaPreset", {
|
|
1376
1377
|
type: {
|
|
1377
1378
|
defaultValue: "item"
|
|
1378
1379
|
},
|
|
@@ -1418,19 +1419,19 @@ u(w, "schemaPreset", {
|
|
|
1418
1419
|
runtime: {
|
|
1419
1420
|
default: void 0
|
|
1420
1421
|
}
|
|
1421
|
-
}), u(
|
|
1422
|
+
}), u(M, "componentPropsPreset", {
|
|
1422
1423
|
options: {
|
|
1423
1424
|
defaultValue: []
|
|
1424
1425
|
}
|
|
1425
1426
|
}), // 基于基本功能提出基本预设
|
|
1426
|
-
u(
|
|
1427
|
-
let Y =
|
|
1427
|
+
u(M, "placeholderPresetByComponentName", M.getPlaceholderPrefixPresetByComponentName());
|
|
1428
|
+
let Y = M;
|
|
1428
1429
|
const I = {
|
|
1429
1430
|
...Y,
|
|
1430
1431
|
adapters: {
|
|
1431
1432
|
...vr
|
|
1432
1433
|
}
|
|
1433
|
-
}, Cr = /* @__PURE__ */
|
|
1434
|
+
}, Cr = /* @__PURE__ */ ke({
|
|
1434
1435
|
props: {
|
|
1435
1436
|
setup: {
|
|
1436
1437
|
type: Function,
|
|
@@ -1443,7 +1444,7 @@ const I = {
|
|
|
1443
1444
|
}
|
|
1444
1445
|
});
|
|
1445
1446
|
function Ir(t) {
|
|
1446
|
-
const e = new
|
|
1447
|
+
const e = new He(t);
|
|
1447
1448
|
return [
|
|
1448
1449
|
e.setup.bind(e),
|
|
1449
1450
|
{
|
|
@@ -1473,13 +1474,13 @@ function te(t, e) {
|
|
|
1473
1474
|
function Or(t) {
|
|
1474
1475
|
return te(t, "native");
|
|
1475
1476
|
}
|
|
1476
|
-
function
|
|
1477
|
+
function Fr(t) {
|
|
1477
1478
|
return t.__proform_raw_object = !0, t;
|
|
1478
1479
|
}
|
|
1479
1480
|
function jr(t) {
|
|
1480
1481
|
return te(t, "onetime");
|
|
1481
1482
|
}
|
|
1482
|
-
function
|
|
1483
|
+
function wr(t) {
|
|
1483
1484
|
function e() {
|
|
1484
1485
|
return t;
|
|
1485
1486
|
}
|
|
@@ -1491,9 +1492,9 @@ function Er(t) {
|
|
|
1491
1492
|
export {
|
|
1492
1493
|
Cr as ProForm,
|
|
1493
1494
|
Or as markNativeFunction,
|
|
1494
|
-
|
|
1495
|
+
Fr as markNativeObject,
|
|
1495
1496
|
jr as markOnetimeFunction,
|
|
1496
|
-
|
|
1497
|
+
wr as markStructuredPathParsing,
|
|
1497
1498
|
Ir as useForm,
|
|
1498
1499
|
Sr as useFormPresetConfigurer,
|
|
1499
1500
|
te as useModifiers
|