@harbor-design/proform 1.4.9 → 1.4.11
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 +108 -132
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
var De = Object.defineProperty;
|
|
2
2
|
var Ge = (r, e, t) => e in r ? De(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var l = (r, e, t) => (Ge(r, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
-
import { ref as H, readonly as Ee, nextTick as S, isRef as T, watch as w, isReactive as z, watchEffect as G, toRaw as $, reactive as Y, createVNode as m, mergeProps as
|
|
5
|
-
var Ze = typeof global == "object" && global && global.Object === Object && global, Je = typeof self == "object" && self && self.Object === Object && self, ee = Ze || Je || Function("return this")(), M = ee.Symbol, Re = Object.prototype, Qe = Re.hasOwnProperty, Ae = Re.toString,
|
|
4
|
+
import { ref as H, readonly as Ee, nextTick as S, isRef as T, watch as w, isReactive as z, watchEffect as G, toRaw as $, reactive as Y, createVNode as m, mergeProps as q, withDirectives as Be, vShow as Ke, createTextVNode as We, isVNode as Xe, defineComponent as Ye } from "vue";
|
|
5
|
+
var Ze = typeof global == "object" && global && global.Object === Object && global, Je = typeof self == "object" && self && self.Object === Object && self, ee = Ze || Je || Function("return this")(), M = ee.Symbol, Re = Object.prototype, Qe = Re.hasOwnProperty, Ae = Re.toString, U = M ? M.toStringTag : void 0;
|
|
6
6
|
function ke(r) {
|
|
7
|
-
var e = Qe.call(r,
|
|
7
|
+
var e = Qe.call(r, U), t = r[U];
|
|
8
8
|
try {
|
|
9
|
-
r[
|
|
9
|
+
r[U] = void 0;
|
|
10
10
|
var i = !0;
|
|
11
11
|
} catch {
|
|
12
12
|
}
|
|
13
13
|
var s = Ae.call(r);
|
|
14
|
-
return i && (e ? r[
|
|
14
|
+
return i && (e ? r[U] = t : delete r[U]), s;
|
|
15
15
|
}
|
|
16
16
|
var et = Object.prototype, tt = et.toString;
|
|
17
17
|
function rt(r) {
|
|
@@ -33,14 +33,14 @@ function at(r, e) {
|
|
|
33
33
|
s[t] = e(r[t], t, r);
|
|
34
34
|
return s;
|
|
35
35
|
}
|
|
36
|
-
var re = Array.isArray, lt = 1 / 0, we = M ? M.prototype : void 0,
|
|
36
|
+
var re = Array.isArray, lt = 1 / 0, we = M ? M.prototype : void 0, Fe = we ? we.toString : void 0;
|
|
37
37
|
function Me(r) {
|
|
38
38
|
if (typeof r == "string")
|
|
39
39
|
return r;
|
|
40
40
|
if (re(r))
|
|
41
41
|
return at(r, Me) + "";
|
|
42
42
|
if (te(r))
|
|
43
|
-
return
|
|
43
|
+
return Fe ? Fe.call(r) : "";
|
|
44
44
|
var e = r + "";
|
|
45
45
|
return e == "0" && 1 / r == -lt ? "-0" : e;
|
|
46
46
|
}
|
|
@@ -55,12 +55,12 @@ function ht(r) {
|
|
|
55
55
|
var e = $e(r);
|
|
56
56
|
return e == ft || e == ct || e == ut || e == dt;
|
|
57
57
|
}
|
|
58
|
-
var Z = ee["__core-js_shared__"],
|
|
58
|
+
var Z = ee["__core-js_shared__"], je = function() {
|
|
59
59
|
var r = /[^.]+$/.exec(Z && Z.keys && Z.keys.IE_PROTO || "");
|
|
60
60
|
return r ? "Symbol(src)_1." + r : "";
|
|
61
61
|
}();
|
|
62
62
|
function pt(r) {
|
|
63
|
-
return !!
|
|
63
|
+
return !!je && je in r;
|
|
64
64
|
}
|
|
65
65
|
var mt = Function.prototype, gt = mt.toString;
|
|
66
66
|
function bt(r) {
|
|
@@ -76,8 +76,8 @@ function bt(r) {
|
|
|
76
76
|
}
|
|
77
77
|
return "";
|
|
78
78
|
}
|
|
79
|
-
var vt = /[\\^$.*+?()[\]{}|]/g, yt = /^\[object .+?Constructor\]$/, _t = Function.prototype, Pt = Object.prototype,
|
|
80
|
-
"^" +
|
|
79
|
+
var vt = /[\\^$.*+?()[\]{}|]/g, yt = /^\[object .+?Constructor\]$/, _t = Function.prototype, Pt = Object.prototype, Ct = _t.toString, It = Pt.hasOwnProperty, St = RegExp(
|
|
80
|
+
"^" + Ct.call(It).replace(vt, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
81
81
|
);
|
|
82
82
|
function Et(r) {
|
|
83
83
|
if (!B(r) || pt(r))
|
|
@@ -92,19 +92,19 @@ function ie(r, e) {
|
|
|
92
92
|
var t = Ot(r, e);
|
|
93
93
|
return Et(t) ? t : void 0;
|
|
94
94
|
}
|
|
95
|
-
var
|
|
95
|
+
var xe = function() {
|
|
96
96
|
try {
|
|
97
97
|
var r = ie(Object, "defineProperty");
|
|
98
98
|
return r({}, "", {}), r;
|
|
99
99
|
} catch {
|
|
100
100
|
}
|
|
101
|
-
}(), wt = 9007199254740991,
|
|
102
|
-
function
|
|
101
|
+
}(), wt = 9007199254740991, Ft = /^(?:0|[1-9]\d*)$/;
|
|
102
|
+
function jt(r, e) {
|
|
103
103
|
var t = typeof r;
|
|
104
|
-
return e = e ?? wt, !!e && (t == "number" || t != "symbol" &&
|
|
104
|
+
return e = e ?? wt, !!e && (t == "number" || t != "symbol" && Ft.test(r)) && r > -1 && r % 1 == 0 && r < e;
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
e == "__proto__" &&
|
|
106
|
+
function xt(r, e, t) {
|
|
107
|
+
e == "__proto__" && xe ? xe(r, e, {
|
|
108
108
|
configurable: !0,
|
|
109
109
|
enumerable: !0,
|
|
110
110
|
value: t,
|
|
@@ -117,17 +117,17 @@ function Ve(r, e) {
|
|
|
117
117
|
var Rt = Object.prototype, $t = Rt.hasOwnProperty;
|
|
118
118
|
function Mt(r, e, t) {
|
|
119
119
|
var i = r[e];
|
|
120
|
-
(!($t.call(r, e) && Ve(i, t)) || t === void 0 && !(e in r)) &&
|
|
120
|
+
(!($t.call(r, e) && Ve(i, t)) || t === void 0 && !(e in r)) && xt(r, e, t);
|
|
121
121
|
}
|
|
122
122
|
var Vt = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Nt = /^\w*$/;
|
|
123
|
-
function
|
|
123
|
+
function Ut(r, e) {
|
|
124
124
|
if (re(r))
|
|
125
125
|
return !1;
|
|
126
126
|
var t = typeof r;
|
|
127
127
|
return t == "number" || t == "symbol" || t == "boolean" || r == null || te(r) ? !0 : Nt.test(r) || !Vt.test(r) || e != null && r in Object(e);
|
|
128
128
|
}
|
|
129
129
|
var L = ie(Object, "create");
|
|
130
|
-
function
|
|
130
|
+
function qt() {
|
|
131
131
|
this.__data__ = L ? L(null) : {}, this.size = 0;
|
|
132
132
|
}
|
|
133
133
|
function Tt(r) {
|
|
@@ -153,18 +153,18 @@ function Xt(r, e) {
|
|
|
153
153
|
var t = this.__data__;
|
|
154
154
|
return this.size += this.has(r) ? 0 : 1, t[r] = L && e === void 0 ? Wt : e, this;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function F(r) {
|
|
157
157
|
var e = -1, t = r == null ? 0 : r.length;
|
|
158
158
|
for (this.clear(); ++e < t; ) {
|
|
159
159
|
var i = r[e];
|
|
160
160
|
this.set(i[0], i[1]);
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
163
|
+
F.prototype.clear = qt;
|
|
164
|
+
F.prototype.delete = Tt;
|
|
165
|
+
F.prototype.get = Dt;
|
|
166
|
+
F.prototype.has = Kt;
|
|
167
|
+
F.prototype.set = Xt;
|
|
168
168
|
function Yt() {
|
|
169
169
|
this.__data__ = [], this.size = 0;
|
|
170
170
|
}
|
|
@@ -208,9 +208,9 @@ V.prototype.set = er;
|
|
|
208
208
|
var tr = ie(ee, "Map");
|
|
209
209
|
function rr() {
|
|
210
210
|
this.size = 0, this.__data__ = {
|
|
211
|
-
hash: new
|
|
211
|
+
hash: new F(),
|
|
212
212
|
map: new (tr || V)(),
|
|
213
|
-
string: new
|
|
213
|
+
string: new F()
|
|
214
214
|
};
|
|
215
215
|
}
|
|
216
216
|
function ir(r) {
|
|
@@ -235,18 +235,18 @@ function ar(r, e) {
|
|
|
235
235
|
var t = W(this, r), i = t.size;
|
|
236
236
|
return t.set(r, e), this.size += t.size == i ? 0 : 1, this;
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function j(r) {
|
|
239
239
|
var e = -1, t = r == null ? 0 : r.length;
|
|
240
240
|
for (this.clear(); ++e < t; ) {
|
|
241
241
|
var i = r[e];
|
|
242
242
|
this.set(i[0], i[1]);
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
245
|
+
j.prototype.clear = rr;
|
|
246
|
+
j.prototype.delete = sr;
|
|
247
|
+
j.prototype.get = nr;
|
|
248
|
+
j.prototype.has = or;
|
|
249
|
+
j.prototype.set = ar;
|
|
250
250
|
var lr = "Expected a function";
|
|
251
251
|
function se(r, e) {
|
|
252
252
|
if (typeof r != "function" || e != null && typeof e != "function")
|
|
@@ -258,9 +258,9 @@ function se(r, e) {
|
|
|
258
258
|
var a = r.apply(this, i);
|
|
259
259
|
return t.cache = n.set(s, a) || n, a;
|
|
260
260
|
};
|
|
261
|
-
return t.cache = new (se.Cache ||
|
|
261
|
+
return t.cache = new (se.Cache || j)(), t;
|
|
262
262
|
}
|
|
263
|
-
se.Cache =
|
|
263
|
+
se.Cache = j;
|
|
264
264
|
var ur = 500;
|
|
265
265
|
function fr(r) {
|
|
266
266
|
var e = se(r, function(i) {
|
|
@@ -278,10 +278,10 @@ function pr(r) {
|
|
|
278
278
|
return r == null ? "" : Me(r);
|
|
279
279
|
}
|
|
280
280
|
function Ne(r, e) {
|
|
281
|
-
return re(r) ? r :
|
|
281
|
+
return re(r) ? r : Ut(r, e) ? [r] : hr(pr(r));
|
|
282
282
|
}
|
|
283
283
|
var mr = 1 / 0;
|
|
284
|
-
function
|
|
284
|
+
function Ue(r) {
|
|
285
285
|
if (typeof r == "string" || te(r))
|
|
286
286
|
return r;
|
|
287
287
|
var e = r + "";
|
|
@@ -290,7 +290,7 @@ function qe(r) {
|
|
|
290
290
|
function gr(r, e) {
|
|
291
291
|
e = Ne(e, r);
|
|
292
292
|
for (var t = 0, i = e.length; r != null && t < i; )
|
|
293
|
-
r = r[
|
|
293
|
+
r = r[Ue(e[t++])];
|
|
294
294
|
return t && t == i ? r : void 0;
|
|
295
295
|
}
|
|
296
296
|
function D(r, e, t) {
|
|
@@ -302,12 +302,12 @@ function br(r, e, t, i) {
|
|
|
302
302
|
return r;
|
|
303
303
|
e = Ne(e, r);
|
|
304
304
|
for (var s = -1, n = e.length, a = n - 1, u = r; u != null && ++s < n; ) {
|
|
305
|
-
var f =
|
|
305
|
+
var f = Ue(e[s]), c = t;
|
|
306
306
|
if (f === "__proto__" || f === "constructor" || f === "prototype")
|
|
307
307
|
return r;
|
|
308
308
|
if (s != a) {
|
|
309
309
|
var h = u[f];
|
|
310
|
-
c = i ? i(h, f, u) : void 0, c === void 0 && (c = B(h) ? h :
|
|
310
|
+
c = i ? i(h, f, u) : void 0, c === void 0 && (c = B(h) ? h : jt(e[s + 1]) ? [] : {});
|
|
311
311
|
}
|
|
312
312
|
Mt(u, f, c), u = u[f];
|
|
313
313
|
}
|
|
@@ -391,21 +391,16 @@ class o {
|
|
|
391
391
|
return !!e.__proform_raw_object;
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
|
-
function
|
|
394
|
+
function v(r, ...e) {
|
|
395
395
|
return e.forEach((t) => {
|
|
396
396
|
if (Array.isArray(t))
|
|
397
|
-
|
|
398
|
-
typeof i == "object" && i !== null && !(i instanceof Date) ? r[s] = b(Array.isArray(i) ? [] : {}, i) : r[s] = i;
|
|
399
|
-
});
|
|
397
|
+
r = [...t];
|
|
400
398
|
else
|
|
401
399
|
for (const i in t)
|
|
402
|
-
t.hasOwnProperty(i) && (typeof t[i] == "object" && t[i] !== null && !(t[i] instanceof Date) && !(t[i] instanceof RegExp) ? r[i] =
|
|
403
|
-
r[i] || (Array.isArray(t[i]) ? [] : {}),
|
|
404
|
-
t[i]
|
|
405
|
-
) : r[i] = t[i]);
|
|
400
|
+
t.hasOwnProperty(i) && (typeof t[i] == "object" && t[i] !== null && !(t[i] instanceof Date) && !(t[i] instanceof RegExp) ? Array.isArray(t[i]) ? r[i] = [...t[i]] : r[i] = v(r[i] || {}, t[i]) : r[i] = t[i]);
|
|
406
401
|
}), r;
|
|
407
402
|
}
|
|
408
|
-
function
|
|
403
|
+
function C(r) {
|
|
409
404
|
const e = /* @__PURE__ */ new WeakMap();
|
|
410
405
|
function t(i) {
|
|
411
406
|
if (i === null || typeof i != "object")
|
|
@@ -464,7 +459,7 @@ class vr {
|
|
|
464
459
|
}
|
|
465
460
|
submit() {
|
|
466
461
|
var i;
|
|
467
|
-
const e = (i = d.getPreset(this.runtimeCore.ui)) == null ? void 0 : i.adapter, t =
|
|
462
|
+
const e = (i = d.getPreset(this.runtimeCore.ui)) == null ? void 0 : i.adapter, t = I.adapters[d.getUI(this.runtimeCore.ui)];
|
|
468
463
|
return (e == null ? void 0 : e.validateForm(this)) ?? (t == null ? void 0 : t.validateForm(this));
|
|
469
464
|
}
|
|
470
465
|
hydrate(e) {
|
|
@@ -474,7 +469,7 @@ class vr {
|
|
|
474
469
|
T(e) ? w(
|
|
475
470
|
() => e.value,
|
|
476
471
|
() => {
|
|
477
|
-
|
|
472
|
+
v(this.runtimeCore.model.value, e.value);
|
|
478
473
|
},
|
|
479
474
|
{
|
|
480
475
|
deep: !0,
|
|
@@ -483,13 +478,13 @@ class vr {
|
|
|
483
478
|
) : z(e) ? w(
|
|
484
479
|
() => e,
|
|
485
480
|
() => {
|
|
486
|
-
|
|
481
|
+
v(this.runtimeCore.model.value, e);
|
|
487
482
|
},
|
|
488
483
|
{
|
|
489
484
|
deep: !0,
|
|
490
485
|
immediate: !0
|
|
491
486
|
}
|
|
492
|
-
) :
|
|
487
|
+
) : v(this.runtimeCore.model.value, e);
|
|
493
488
|
},
|
|
494
489
|
{
|
|
495
490
|
lazy: !1
|
|
@@ -530,7 +525,7 @@ class vr {
|
|
|
530
525
|
}
|
|
531
526
|
resetModel() {
|
|
532
527
|
var e;
|
|
533
|
-
(e = this.runtimeCore) != null && e.model.value && (this.runtimeCore.model.value =
|
|
528
|
+
(e = this.runtimeCore) != null && e.model.value && (this.runtimeCore.model.value = C(
|
|
534
529
|
this.runtimeCore.processor.stableModel
|
|
535
530
|
), this.readonlyReactiveModel.value = Ee(this.runtimeCore.model.value), this.runtimeCore.runtimeAdapter.clearValidate(this.runtimeCore));
|
|
536
531
|
}
|
|
@@ -562,8 +557,8 @@ class yr {
|
|
|
562
557
|
l(this, "getRuntimeMeta");
|
|
563
558
|
l(this, "stableSchemas", []);
|
|
564
559
|
l(this, "stableModel", {});
|
|
565
|
-
l(this, "schemaPreset",
|
|
566
|
-
l(this, "componentPropsPreset",
|
|
560
|
+
l(this, "schemaPreset", I.schemaPreset);
|
|
561
|
+
l(this, "componentPropsPreset", I.componentPropsPreset);
|
|
567
562
|
l(this, "stableUpdaterProcessProgress");
|
|
568
563
|
l(this, "stableUpdaterTimes", 0);
|
|
569
564
|
l(this, "schemaEffect", new A());
|
|
@@ -611,7 +606,7 @@ class yr {
|
|
|
611
606
|
// 派生过程,用于外部应用
|
|
612
607
|
parseSchemas(e, t) {
|
|
613
608
|
o.isArrayEmpty(this.processedSchemas.value) && (this.baseDefaultValueFunctionsLength = this.countFunctionDefaultValues(
|
|
614
|
-
|
|
609
|
+
C(e)
|
|
615
610
|
), this.processedSchemas.value = this.initSchemas(e)), this.parse(e, t);
|
|
616
611
|
}
|
|
617
612
|
parseStable(e) {
|
|
@@ -646,11 +641,11 @@ class yr {
|
|
|
646
641
|
const f = u.index, c = u.key, h = u.keyIndex;
|
|
647
642
|
if (o.isUndefined(u.stable) || o.isNull(u.stable))
|
|
648
643
|
return;
|
|
649
|
-
const p = s.parseStable(u.stable),
|
|
644
|
+
const p = s.parseStable(u.stable), b = i == null ? void 0 : i.index, E = i == null ? void 0 : i.key;
|
|
650
645
|
let y = p;
|
|
651
646
|
if (o.isProcessInprogress(y) || (n[h] = !0), i) {
|
|
652
|
-
const g = s.processedSchemas.value[
|
|
653
|
-
g && o.isObject(g) && c !== "component" && (y =
|
|
647
|
+
const g = s.processedSchemas.value[b][E][f][c];
|
|
648
|
+
g && o.isObject(g) && c !== "component" && (y = v(g, y)), s.processedSchemas.value[b][E][f][c] = y, s.stableUpdater(
|
|
654
649
|
n,
|
|
655
650
|
i,
|
|
656
651
|
t,
|
|
@@ -659,7 +654,7 @@ class yr {
|
|
|
659
654
|
);
|
|
660
655
|
} else {
|
|
661
656
|
const g = s.processedSchemas.value[f][c];
|
|
662
|
-
g && o.isObject(g) && c !== "component" && (y =
|
|
657
|
+
g && o.isObject(g) && c !== "component" && (y = v(g, y)), s.processedSchemas.value[f][c] = y, s.stableUpdater(
|
|
663
658
|
n,
|
|
664
659
|
i,
|
|
665
660
|
t,
|
|
@@ -719,8 +714,8 @@ class yr {
|
|
|
719
714
|
this.defaultValueInprogressMap.set(t[s], h), !o.isProcessInprogress(h) && this.defaultValueInprogressMap.size === this.baseDefaultValueFunctionsLength && Array.from(
|
|
720
715
|
this.defaultValueInprogressMap.values()
|
|
721
716
|
).every((p) => {
|
|
722
|
-
var
|
|
723
|
-
return !((
|
|
717
|
+
var b;
|
|
718
|
+
return !((b = p == null ? void 0 : p.includes) != null && b.call(p, "undefined"));
|
|
724
719
|
}) ? (f(h), this.defaultValueEffect.clearEffects(), S(() => {
|
|
725
720
|
c();
|
|
726
721
|
})) : f(h);
|
|
@@ -735,8 +730,8 @@ class yr {
|
|
|
735
730
|
this.defaultValueInprogressMap.set(t[s], h), !o.isProcessInprogress(h) && this.defaultValueInprogressMap.size === this.baseDefaultValueFunctionsLength && Array.from(
|
|
736
731
|
this.defaultValueInprogressMap.values()
|
|
737
732
|
).every((p) => {
|
|
738
|
-
var
|
|
739
|
-
return !((
|
|
733
|
+
var b;
|
|
734
|
+
return !((b = p == null ? void 0 : p.includes) != null && b.call(p, "undefined"));
|
|
740
735
|
}) ? (f(h), this.defaultValueEffect.clearEffects(), S(() => {
|
|
741
736
|
c();
|
|
742
737
|
})) : f(h);
|
|
@@ -839,11 +834,11 @@ class yr {
|
|
|
839
834
|
e.map((t) => {
|
|
840
835
|
this.createModel(t, this.processedModel.value);
|
|
841
836
|
}), o.isObjectEmpty(this.stableModel) && this.stableUpdaterProcessProgress.every(Boolean) && this.defaultValueEffect.effects.size === 0 && S(() => {
|
|
842
|
-
this.stableModel =
|
|
837
|
+
this.stableModel = C(this.processedModel.value), this.runtimeCore.hydrateEffect.triggerEffects(), this.runtimeCore.hydrateEffect.clearEffects();
|
|
843
838
|
});
|
|
844
839
|
}
|
|
845
840
|
setModel(e, t, i) {
|
|
846
|
-
o.isFunction(t) ? _(e, t(), i) :
|
|
841
|
+
o.isFunction(t) ? _(e, t(), i) : v(e, {
|
|
847
842
|
[t]: i
|
|
848
843
|
});
|
|
849
844
|
}
|
|
@@ -865,7 +860,7 @@ class yr {
|
|
|
865
860
|
});
|
|
866
861
|
}
|
|
867
862
|
}
|
|
868
|
-
class
|
|
863
|
+
class x {
|
|
869
864
|
static getFormContainer({ ui: e } = {}) {
|
|
870
865
|
return d.presets.uiPresets[e ?? d.presets.ui].container.Form;
|
|
871
866
|
}
|
|
@@ -895,34 +890,34 @@ class _r {
|
|
|
895
890
|
}
|
|
896
891
|
getRuntimeField(e) {
|
|
897
892
|
var s;
|
|
898
|
-
const t = (s = d.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i =
|
|
893
|
+
const t = (s = d.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i = I.adapters[d.getUI(this.ui)];
|
|
899
894
|
return (t == null ? void 0 : t.getRuntimeField(e)) ?? (i == null ? void 0 : i.getRuntimeField(e));
|
|
900
895
|
}
|
|
901
896
|
getRuntimeRequired(e) {
|
|
902
897
|
var s;
|
|
903
|
-
const t = (s = d.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i =
|
|
898
|
+
const t = (s = d.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i = I.adapters[d.getUI(this.ui)];
|
|
904
899
|
return (t == null ? void 0 : t.getRuntimeRequired(e)) ?? (i == null ? void 0 : i.getRuntimeRequired(e));
|
|
905
900
|
}
|
|
906
901
|
getFormModelPropName() {
|
|
907
902
|
var i;
|
|
908
|
-
const e = (i = d.presets.uiPresets[this.ui]) == null ? void 0 : i.adapter, t =
|
|
903
|
+
const e = (i = d.presets.uiPresets[this.ui]) == null ? void 0 : i.adapter, t = I.adapters[d.getUI(this.ui)];
|
|
909
904
|
return (e == null ? void 0 : e.getFormModelPropName()) ?? (t == null ? void 0 : t.getFormModelPropName());
|
|
910
905
|
}
|
|
911
906
|
formComponentRenderer(e) {
|
|
912
907
|
var s;
|
|
913
|
-
const t = (s = d.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i =
|
|
908
|
+
const t = (s = d.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i = I.adapters[d.getUI(this.ui)];
|
|
914
909
|
return (t == null ? void 0 : t.formComponentRenderer(e)) ?? (i == null ? void 0 : i.formComponentRenderer(e));
|
|
915
910
|
}
|
|
916
911
|
clearValidate(e) {
|
|
917
912
|
var s;
|
|
918
|
-
const t = (s = d.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i =
|
|
913
|
+
const t = (s = d.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i = I.adapters[d.getUI(this.ui)];
|
|
919
914
|
return (t == null ? void 0 : t.clearValidate(e)) ?? (i == null ? void 0 : i.clearValidate(e));
|
|
920
915
|
}
|
|
921
916
|
}
|
|
922
917
|
function Pr(r) {
|
|
923
918
|
return typeof r == "function" || Object.prototype.toString.call(r) === "[object Object]" && !Xe(r);
|
|
924
919
|
}
|
|
925
|
-
class
|
|
920
|
+
class Cr {
|
|
926
921
|
constructor(e) {
|
|
927
922
|
l(this, "schemas", H([]));
|
|
928
923
|
l(this, "model", H({}));
|
|
@@ -967,7 +962,7 @@ class Ir {
|
|
|
967
962
|
}
|
|
968
963
|
getRuntimeMeta() {
|
|
969
964
|
return {
|
|
970
|
-
model: $(
|
|
965
|
+
model: $(C(this.model.value)),
|
|
971
966
|
reactiveModel: this.model.value,
|
|
972
967
|
shared: this.shared,
|
|
973
968
|
// share 增加防抖,当开发者在过程中进行 share 时避免频繁触发爆栈
|
|
@@ -985,34 +980,34 @@ class Ir {
|
|
|
985
980
|
};
|
|
986
981
|
}
|
|
987
982
|
runtimeItemProcessor(e, t, i = this.model.value, s) {
|
|
988
|
-
var oe, ae, le, ue, fe, ce, de, he, pe, me, ge, be, ve, ye, _e, Pe,
|
|
983
|
+
var oe, ae, le, ue, fe, ce, de, he, pe, me, ge, be, ve, ye, _e, Pe, Ce, Ie;
|
|
989
984
|
const n = $(e.component);
|
|
990
985
|
if (!n)
|
|
991
986
|
return;
|
|
992
|
-
(ae = (oe = e.native) == null ? void 0 : oe.props) != null && ae.Form &&
|
|
993
|
-
const a =
|
|
987
|
+
(ae = (oe = e.native) == null ? void 0 : oe.props) != null && ae.Form && v(this.globalNativeFormOverride.props.Form, (ue = (le = e.native) == null ? void 0 : le.props) == null ? void 0 : ue.Form), (ce = (fe = e.native) == null ? void 0 : fe.slots) != null && ce.Form && v(this.globalNativeFormOverride.slots.Form, (he = (de = e.native) == null ? void 0 : de.slots) == null ? void 0 : he.Form);
|
|
988
|
+
const a = v(C((me = (pe = this.native) == null ? void 0 : pe.slots) == null ? void 0 : me.FormItem) ?? {}, (be = (ge = e.native) == null ? void 0 : ge.slots) == null ? void 0 : be.FormItem), u = {
|
|
994
989
|
display: "grid",
|
|
995
990
|
gridColumn: "1 / -1",
|
|
996
991
|
...e.grid
|
|
997
|
-
}, f =
|
|
992
|
+
}, f = v(C((ye = (ve = this.native) == null ? void 0 : ve.props) == null ? void 0 : ye.FormItem) ?? {}, (Pe = (_e = e.native) == null ? void 0 : _e.props) == null ? void 0 : Pe.FormItem), c = this.runtimeAdapter.getRuntimeField({
|
|
998
993
|
schema: e,
|
|
999
994
|
parentSchema: s,
|
|
1000
995
|
index: t
|
|
1001
|
-
}), h = n.name, p = e.componentProps ?? {},
|
|
996
|
+
}), h = n.name, p = e.componentProps ?? {}, b = I.placeholderPresetByComponentName;
|
|
1002
997
|
let E = e.placeholder, y = e.show;
|
|
1003
998
|
y === void 0 && (y = !0);
|
|
1004
999
|
let g = e.label ?? "", O;
|
|
1005
|
-
if (e.runtime ? O = e.runtime : O = (s == null ? void 0 : s.runtime) ?? this.runtime, !o.isUndefined(t) && !o.isObjectEmpty(O) && (g = Q((
|
|
1000
|
+
if (e.runtime ? O = e.runtime : O = (s == null ? void 0 : s.runtime) ?? this.runtime, !o.isUndefined(t) && !o.isObjectEmpty(O) && (g = Q((Ce = O == null ? void 0 : O.customizeListItemLabel) == null ? void 0 : Ce.call(O, e.label ?? "", t + 1), "")), !E) {
|
|
1006
1001
|
let N = "请输入";
|
|
1007
|
-
o.isUndefined(h) ? E = `${N}${g}` : /* @ts-expect-error */
|
|
1008
|
-
|
|
1009
|
-
h.toLowerCase().includes(Se.toLowerCase()) && (N =
|
|
1002
|
+
o.isUndefined(h) ? E = `${N}${g}` : /* @ts-expect-error */ b[h.toLowerCase()] ? (N = // @ts-expect-error
|
|
1003
|
+
b[h.toLowerCase()], E = `${N}${g}`) : (Object.keys(b).forEach((Se) => {
|
|
1004
|
+
h.toLowerCase().includes(Se.toLowerCase()) && (N = b[Se]);
|
|
1010
1005
|
}), E = `${N}${g}`);
|
|
1011
1006
|
}
|
|
1012
|
-
const
|
|
1007
|
+
const qe = this.runtimeAdapter.getRuntimeRequired({
|
|
1013
1008
|
...e,
|
|
1014
1009
|
label: g
|
|
1015
|
-
}), Te =
|
|
1010
|
+
}), Te = x.getItemContainer(this), ze = x.getFormItemContainer(this), Le = this, He = e.componentSlots, P = (Ie = d.presets.uiPresets[this.ui]) == null ? void 0 : Ie.display;
|
|
1016
1011
|
let X;
|
|
1017
1012
|
return !o.isUndefined(P == null ? void 0 : P.labelPrefix) && !o.isNull(P == null ? void 0 : P.labelPrefix) ? X = `${g}${P == null ? void 0 : P.labelPrefix}` : X = `${g}:`, m("div", {
|
|
1018
1013
|
style: u
|
|
@@ -1020,9 +1015,9 @@ class Ir {
|
|
|
1020
1015
|
show: y
|
|
1021
1016
|
}, {
|
|
1022
1017
|
default() {
|
|
1023
|
-
return y && m(ze,
|
|
1018
|
+
return y && m(ze, q(f, {
|
|
1024
1019
|
label: `${g ? X : ""}`
|
|
1025
|
-
}, c,
|
|
1020
|
+
}, c, qe), {
|
|
1026
1021
|
default() {
|
|
1027
1022
|
return Le.runtimeAdapter.formComponentRenderer({
|
|
1028
1023
|
Component: n,
|
|
@@ -1044,7 +1039,7 @@ class Ir {
|
|
|
1044
1039
|
display: "grid",
|
|
1045
1040
|
gridColumn: "1 / -1",
|
|
1046
1041
|
...e.grid
|
|
1047
|
-
}, s =
|
|
1042
|
+
}, s = x.getGroupContainer(this);
|
|
1048
1043
|
let n = e.show;
|
|
1049
1044
|
return n === void 0 && (n = !0), m("div", {
|
|
1050
1045
|
style: i
|
|
@@ -1056,7 +1051,7 @@ class Ir {
|
|
|
1056
1051
|
}
|
|
1057
1052
|
addListItem(e) {
|
|
1058
1053
|
var t;
|
|
1059
|
-
console.log("this", this.processor.stableModel, e.field), (t = this.processor.stableModel[e.field]) != null && t[0] && this.model.value[e.field].push(
|
|
1054
|
+
console.log("this", this.processor.stableModel, e.field), (t = this.processor.stableModel[e.field]) != null && t[0] && this.model.value[e.field].push(C(this.processor.stableModel[e.field][0])), this.runtimeAdapter.clearValidate(this);
|
|
1060
1055
|
}
|
|
1061
1056
|
deleteListItem(e, t) {
|
|
1062
1057
|
this.model.value[e.field].splice(t, 1), this.runtimeAdapter.clearValidate(this);
|
|
@@ -1070,7 +1065,7 @@ class Ir {
|
|
|
1070
1065
|
i.model.value[e.field] || (i.model.value[e.field] = [{}]);
|
|
1071
1066
|
let s = e.show;
|
|
1072
1067
|
s === void 0 && (s = !0);
|
|
1073
|
-
const n =
|
|
1068
|
+
const n = x.getListContainer(this), a = x.getListItemContainer(this);
|
|
1074
1069
|
return m("div", {
|
|
1075
1070
|
style: t
|
|
1076
1071
|
}, [s && m(n, {
|
|
@@ -1112,8 +1107,8 @@ class Ir {
|
|
|
1112
1107
|
gridColumn: "1 / -1",
|
|
1113
1108
|
gridAutoColumns: "1fr",
|
|
1114
1109
|
...this.grid
|
|
1115
|
-
}, t = this, i =
|
|
1116
|
-
return m(n,
|
|
1110
|
+
}, t = this, i = v(this.globalNativeFormOverride.props.Form, C((f = (u = this.native) == null ? void 0 : u.props) == null ? void 0 : f.Form) ?? {}), s = v(this.globalNativeFormOverride.slots.Form, C((h = (c = this.native) == null ? void 0 : c.slots) == null ? void 0 : h.Form) ?? {}), n = x.getFormContainer(this), a = this.runtimeAdapter.getFormModelPropName();
|
|
1111
|
+
return m(n, q(i, {
|
|
1117
1112
|
ref: this.formRef
|
|
1118
1113
|
}, {
|
|
1119
1114
|
[a]: this.model.value
|
|
@@ -1145,7 +1140,7 @@ function J({
|
|
|
1145
1140
|
}) {
|
|
1146
1141
|
return r ? `${r.field}.${t}.${e.field}` : e.field;
|
|
1147
1142
|
}
|
|
1148
|
-
const
|
|
1143
|
+
const Ir = {
|
|
1149
1144
|
ArcoVue: {
|
|
1150
1145
|
getRuntimeField(r) {
|
|
1151
1146
|
const e = J(r);
|
|
@@ -1156,7 +1151,6 @@ const Cr = {
|
|
|
1156
1151
|
};
|
|
1157
1152
|
},
|
|
1158
1153
|
getRuntimeRequired(r) {
|
|
1159
|
-
var t;
|
|
1160
1154
|
let e = `${r.label}是必填项`;
|
|
1161
1155
|
if (r.required)
|
|
1162
1156
|
if (o.isString(r.required) && (e = r.required), !r.rules)
|
|
@@ -1165,17 +1159,12 @@ const Cr = {
|
|
|
1165
1159
|
message: e
|
|
1166
1160
|
});
|
|
1167
1161
|
else {
|
|
1168
|
-
const
|
|
1169
|
-
|
|
1162
|
+
const t = r.rules.findIndex((i) => !o.isUndefined(i.required));
|
|
1163
|
+
t !== -1 ? (r.rules[t].required = !0, r.rules[t].message = e) : r.rules.unshift({
|
|
1170
1164
|
required: !0,
|
|
1171
1165
|
message: e
|
|
1172
1166
|
});
|
|
1173
1167
|
}
|
|
1174
|
-
else
|
|
1175
|
-
r.rules && ((t = r.rules) == null ? void 0 : t.findIndex((s) => !!s.required)) === -1 && r.rules.unshift({
|
|
1176
|
-
required: !0,
|
|
1177
|
-
message: e
|
|
1178
|
-
});
|
|
1179
1168
|
return {
|
|
1180
1169
|
rules: r.rules
|
|
1181
1170
|
};
|
|
@@ -1192,7 +1181,7 @@ const Cr = {
|
|
|
1192
1181
|
props: n
|
|
1193
1182
|
}) {
|
|
1194
1183
|
let a;
|
|
1195
|
-
return o.isFunction(t.field) ? a = D(e, t.field()) : a = e[t.field], m(r,
|
|
1184
|
+
return o.isFunction(t.field) ? a = D(e, t.field()) : a = e[t.field], m(r, q({
|
|
1196
1185
|
modelValue: a,
|
|
1197
1186
|
"onUpdate:modelValue": (u) => {
|
|
1198
1187
|
o.isFunction(t.field) ? _(e, t.field(), u) : e[t.field] = u;
|
|
@@ -1222,7 +1211,6 @@ const Cr = {
|
|
|
1222
1211
|
};
|
|
1223
1212
|
},
|
|
1224
1213
|
getRuntimeRequired(r) {
|
|
1225
|
-
var t;
|
|
1226
1214
|
let e = `${r.label}是必填项`;
|
|
1227
1215
|
if (r.required)
|
|
1228
1216
|
if (o.isString(r.required) && (e = r.required), !r.rules)
|
|
@@ -1231,17 +1219,12 @@ const Cr = {
|
|
|
1231
1219
|
message: e
|
|
1232
1220
|
});
|
|
1233
1221
|
else {
|
|
1234
|
-
const
|
|
1235
|
-
|
|
1222
|
+
const t = r.rules.findIndex((i) => !o.isUndefined(i.required));
|
|
1223
|
+
t !== -1 ? (r.rules[t].required = !0, r.rules[t].message = e) : r.rules.unshift({
|
|
1236
1224
|
required: !0,
|
|
1237
1225
|
message: e
|
|
1238
1226
|
});
|
|
1239
1227
|
}
|
|
1240
|
-
else
|
|
1241
|
-
r.rules && ((t = r.rules) == null ? void 0 : t.findIndex((s) => !!s.required)) === -1 && r.rules.unshift({
|
|
1242
|
-
required: !0,
|
|
1243
|
-
message: e
|
|
1244
|
-
});
|
|
1245
1228
|
return {
|
|
1246
1229
|
rules: r.rules,
|
|
1247
1230
|
required: r.required
|
|
@@ -1259,7 +1242,7 @@ const Cr = {
|
|
|
1259
1242
|
props: n
|
|
1260
1243
|
}) {
|
|
1261
1244
|
let a;
|
|
1262
|
-
return o.isFunction(t.field) ? a = D(e, t.field()) : a = e[t.field], m(r,
|
|
1245
|
+
return o.isFunction(t.field) ? a = D(e, t.field()) : a = e[t.field], m(r, q({
|
|
1263
1246
|
modelValue: a,
|
|
1264
1247
|
"onUpdate:modelValue": (u) => {
|
|
1265
1248
|
o.isFunction(t.field) ? _(e, t.field(), u) : e[t.field] = u;
|
|
@@ -1294,7 +1277,6 @@ const Cr = {
|
|
|
1294
1277
|
};
|
|
1295
1278
|
},
|
|
1296
1279
|
getRuntimeRequired(r) {
|
|
1297
|
-
var t;
|
|
1298
1280
|
let e = `${r.label}是必填项`;
|
|
1299
1281
|
if (r.required)
|
|
1300
1282
|
if (o.isString(r.required) && (e = r.required), !r.rules)
|
|
@@ -1304,19 +1286,13 @@ const Cr = {
|
|
|
1304
1286
|
trigger: ["input", "blur"]
|
|
1305
1287
|
});
|
|
1306
1288
|
else {
|
|
1307
|
-
const
|
|
1308
|
-
|
|
1289
|
+
const t = r.rules.findIndex((i) => !o.isUndefined(i.required));
|
|
1290
|
+
t !== -1 ? (r.rules[t].required = !0, r.rules[t].message = e) : r.rules.unshift({
|
|
1309
1291
|
required: !0,
|
|
1310
1292
|
message: e,
|
|
1311
1293
|
trigger: ["input", "blur"]
|
|
1312
1294
|
});
|
|
1313
1295
|
}
|
|
1314
|
-
else
|
|
1315
|
-
r.rules && ((t = r.rules) == null ? void 0 : t.findIndex((s) => !!s.required)) === -1 && r.rules.unshift({
|
|
1316
|
-
required: !0,
|
|
1317
|
-
message: e,
|
|
1318
|
-
trigger: ["input", "blur"]
|
|
1319
|
-
});
|
|
1320
1296
|
return {
|
|
1321
1297
|
rule: r.rules
|
|
1322
1298
|
};
|
|
@@ -1333,7 +1309,7 @@ const Cr = {
|
|
|
1333
1309
|
props: n
|
|
1334
1310
|
}) {
|
|
1335
1311
|
let a;
|
|
1336
|
-
return o.isFunction(t.field) ? a = D(e, t.field()) : a = e[t.field], m(r,
|
|
1312
|
+
return o.isFunction(t.field) ? a = D(e, t.field()) : a = e[t.field], m(r, q({
|
|
1337
1313
|
value: a,
|
|
1338
1314
|
"onUpdate:value": (u) => {
|
|
1339
1315
|
o.isFunction(t.field) ? _(e, t.field(), u) : e[t.field] = u;
|
|
@@ -1419,10 +1395,10 @@ l(R, "schemaPreset", {
|
|
|
1419
1395
|
}), // 基于基本功能提出基本预设
|
|
1420
1396
|
l(R, "placeholderPresetByComponentName", R.getPlaceholderPrefixPresetByComponentName());
|
|
1421
1397
|
let k = R;
|
|
1422
|
-
const
|
|
1398
|
+
const I = {
|
|
1423
1399
|
...k,
|
|
1424
1400
|
adapters: {
|
|
1425
|
-
...
|
|
1401
|
+
...Ir
|
|
1426
1402
|
}
|
|
1427
1403
|
}, Or = /* @__PURE__ */ Ye({
|
|
1428
1404
|
props: {
|
|
@@ -1432,7 +1408,7 @@ const C = {
|
|
|
1432
1408
|
}
|
|
1433
1409
|
},
|
|
1434
1410
|
setup(r) {
|
|
1435
|
-
const e = new
|
|
1411
|
+
const e = new Cr(r.setup);
|
|
1436
1412
|
return () => e.exec();
|
|
1437
1413
|
}
|
|
1438
1414
|
});
|
|
@@ -1449,7 +1425,7 @@ function wr(r) {
|
|
|
1449
1425
|
}
|
|
1450
1426
|
];
|
|
1451
1427
|
}
|
|
1452
|
-
function
|
|
1428
|
+
function Fr(r) {
|
|
1453
1429
|
d.presets = r;
|
|
1454
1430
|
}
|
|
1455
1431
|
function ne(r, e) {
|
|
@@ -1464,10 +1440,10 @@ function ne(r, e) {
|
|
|
1464
1440
|
writable: !0
|
|
1465
1441
|
}), r;
|
|
1466
1442
|
}
|
|
1467
|
-
function
|
|
1443
|
+
function jr(r) {
|
|
1468
1444
|
return ne(r, "native");
|
|
1469
1445
|
}
|
|
1470
|
-
function
|
|
1446
|
+
function xr(r) {
|
|
1471
1447
|
return r.__proform_raw_object = !0, r;
|
|
1472
1448
|
}
|
|
1473
1449
|
function Rr(r) {
|
|
@@ -1484,11 +1460,11 @@ function $r(r) {
|
|
|
1484
1460
|
}
|
|
1485
1461
|
export {
|
|
1486
1462
|
Or as ProForm,
|
|
1487
|
-
|
|
1488
|
-
|
|
1463
|
+
jr as markNativeFunction,
|
|
1464
|
+
xr as markNativeObject,
|
|
1489
1465
|
Rr as markOnetimeFunction,
|
|
1490
1466
|
$r as markStructuredPathParsing,
|
|
1491
1467
|
wr as useForm,
|
|
1492
|
-
|
|
1468
|
+
Fr as useFormPresetConfigurer,
|
|
1493
1469
|
ne as useModifiers
|
|
1494
1470
|
};
|