@harbor-design/proform 1.4.2 → 1.4.4
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 +220 -206
- package/dist/types/src/services/Processor/index.d.ts +3 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
var ze = Object.defineProperty;
|
|
2
2
|
var Le = (r, e, t) => e in r ? ze(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var l = (r, e, t) => (Le(r, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
-
import { ref as L, readonly as Ie, nextTick as
|
|
5
|
-
var We = typeof global == "object" && global && global.Object === Object && global, Xe = typeof self == "object" && self && self.Object === Object && self, A = We || Xe || Function("return this")(),
|
|
4
|
+
import { ref as L, readonly as Ie, nextTick as C, isRef as U, watch as E, isReactive as T, watchEffect as D, toRaw as R, reactive as W, createVNode as m, mergeProps as N, withDirectives as He, vShow as De, createTextVNode as Ge, isVNode as Be, defineComponent as Ke } from "vue";
|
|
5
|
+
var We = typeof global == "object" && global && global.Object === Object && global, Xe = typeof self == "object" && self && self.Object === Object && self, A = We || Xe || Function("return this")(), $ = A.Symbol, Fe = Object.prototype, Ye = Fe.hasOwnProperty, Ze = Fe.toString, q = $ ? $.toStringTag : void 0;
|
|
6
6
|
function Je(r) {
|
|
7
|
-
var e = Ye.call(r,
|
|
7
|
+
var e = Ye.call(r, q), t = r[q];
|
|
8
8
|
try {
|
|
9
|
-
r[
|
|
9
|
+
r[q] = void 0;
|
|
10
10
|
var i = !0;
|
|
11
11
|
} catch {
|
|
12
12
|
}
|
|
13
13
|
var s = Ze.call(r);
|
|
14
|
-
return i && (e ? r[
|
|
14
|
+
return i && (e ? r[q] = t : delete r[q]), s;
|
|
15
15
|
}
|
|
16
16
|
var Qe = Object.prototype, Ae = Qe.toString;
|
|
17
17
|
function ke(r) {
|
|
18
18
|
return Ae.call(r);
|
|
19
19
|
}
|
|
20
|
-
var et = "[object Null]", tt = "[object Undefined]", Ce =
|
|
20
|
+
var et = "[object Null]", tt = "[object Undefined]", Ce = $ ? $.toStringTag : void 0;
|
|
21
21
|
function je(r) {
|
|
22
22
|
return r == null ? r === void 0 ? tt : et : Ce && Ce in Object(r) ? Je(r) : ke(r);
|
|
23
23
|
}
|
|
@@ -33,12 +33,12 @@ function st(r, e) {
|
|
|
33
33
|
s[t] = e(r[t], t, r);
|
|
34
34
|
return s;
|
|
35
35
|
}
|
|
36
|
-
var ee = Array.isArray, nt = 1 / 0, Se =
|
|
37
|
-
function
|
|
36
|
+
var ee = Array.isArray, nt = 1 / 0, Se = $ ? $.prototype : void 0, Oe = Se ? Se.toString : void 0;
|
|
37
|
+
function xe(r) {
|
|
38
38
|
if (typeof r == "string")
|
|
39
39
|
return r;
|
|
40
40
|
if (ee(r))
|
|
41
|
-
return st(r,
|
|
41
|
+
return st(r, xe) + "";
|
|
42
42
|
if (k(r))
|
|
43
43
|
return Oe ? Oe.call(r) : "";
|
|
44
44
|
var e = r + "";
|
|
@@ -62,11 +62,11 @@ var X = A["__core-js_shared__"], Ee = function() {
|
|
|
62
62
|
function ct(r) {
|
|
63
63
|
return !!Ee && Ee in r;
|
|
64
64
|
}
|
|
65
|
-
var dt = Function.prototype,
|
|
66
|
-
function
|
|
65
|
+
var dt = Function.prototype, ht = dt.toString;
|
|
66
|
+
function pt(r) {
|
|
67
67
|
if (r != null) {
|
|
68
68
|
try {
|
|
69
|
-
return
|
|
69
|
+
return ht.call(r);
|
|
70
70
|
} catch {
|
|
71
71
|
}
|
|
72
72
|
try {
|
|
@@ -83,7 +83,7 @@ function It(r) {
|
|
|
83
83
|
if (!G(r) || ct(r))
|
|
84
84
|
return !1;
|
|
85
85
|
var e = ft(r) ? Pt : gt;
|
|
86
|
-
return e.test(
|
|
86
|
+
return e.test(pt(r));
|
|
87
87
|
}
|
|
88
88
|
function Ct(r, e) {
|
|
89
89
|
return r == null ? void 0 : r[e];
|
|
@@ -92,7 +92,7 @@ function te(r, e) {
|
|
|
92
92
|
var t = Ct(r, e);
|
|
93
93
|
return It(t) ? t : void 0;
|
|
94
94
|
}
|
|
95
|
-
var
|
|
95
|
+
var we = function() {
|
|
96
96
|
try {
|
|
97
97
|
var r = te(Object, "defineProperty");
|
|
98
98
|
return r({}, "", {}), r;
|
|
@@ -103,43 +103,43 @@ function Et(r, e) {
|
|
|
103
103
|
var t = typeof r;
|
|
104
104
|
return e = e ?? St, !!e && (t == "number" || t != "symbol" && Ot.test(r)) && r > -1 && r % 1 == 0 && r < e;
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
e == "__proto__" &&
|
|
106
|
+
function wt(r, e, t) {
|
|
107
|
+
e == "__proto__" && we ? we(r, e, {
|
|
108
108
|
configurable: !0,
|
|
109
109
|
enumerable: !0,
|
|
110
110
|
value: t,
|
|
111
111
|
writable: !0
|
|
112
112
|
}) : r[e] = t;
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function Re(r, e) {
|
|
115
115
|
return r === e || r !== r && e !== e;
|
|
116
116
|
}
|
|
117
|
-
var
|
|
118
|
-
function
|
|
117
|
+
var Ft = Object.prototype, jt = Ft.hasOwnProperty;
|
|
118
|
+
function xt(r, e, t) {
|
|
119
119
|
var i = r[e];
|
|
120
|
-
(!(jt.call(r, e) &&
|
|
120
|
+
(!(jt.call(r, e) && Re(i, t)) || t === void 0 && !(e in r)) && wt(r, e, t);
|
|
121
121
|
}
|
|
122
|
-
var
|
|
123
|
-
function
|
|
122
|
+
var Rt = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, $t = /^\w*$/;
|
|
123
|
+
function Mt(r, e) {
|
|
124
124
|
if (ee(r))
|
|
125
125
|
return !1;
|
|
126
126
|
var t = typeof r;
|
|
127
|
-
return t == "number" || t == "symbol" || t == "boolean" || r == null || k(r) ? !0 :
|
|
127
|
+
return t == "number" || t == "symbol" || t == "boolean" || r == null || k(r) ? !0 : $t.test(r) || !Rt.test(r) || e != null && r in Object(e);
|
|
128
128
|
}
|
|
129
129
|
var z = te(Object, "create");
|
|
130
|
-
function
|
|
130
|
+
function Vt() {
|
|
131
131
|
this.__data__ = z ? z(null) : {}, this.size = 0;
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function qt(r) {
|
|
134
134
|
var e = this.has(r) && delete this.__data__[r];
|
|
135
135
|
return this.size -= e ? 1 : 0, e;
|
|
136
136
|
}
|
|
137
|
-
var
|
|
137
|
+
var Nt = "__lodash_hash_undefined__", Ut = Object.prototype, Tt = Ut.hasOwnProperty;
|
|
138
138
|
function zt(r) {
|
|
139
139
|
var e = this.__data__;
|
|
140
140
|
if (z) {
|
|
141
141
|
var t = e[r];
|
|
142
|
-
return t ===
|
|
142
|
+
return t === Nt ? void 0 : t;
|
|
143
143
|
}
|
|
144
144
|
return Tt.call(e, r) ? e[r] : void 0;
|
|
145
145
|
}
|
|
@@ -153,24 +153,24 @@ function Bt(r, e) {
|
|
|
153
153
|
var t = this.__data__;
|
|
154
154
|
return this.size += this.has(r) ? 0 : 1, t[r] = z && e === void 0 ? Gt : e, this;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
156
|
+
function w(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
|
+
w.prototype.clear = Vt;
|
|
164
|
+
w.prototype.delete = qt;
|
|
165
|
+
w.prototype.get = zt;
|
|
166
|
+
w.prototype.has = Dt;
|
|
167
|
+
w.prototype.set = Bt;
|
|
168
168
|
function Kt() {
|
|
169
169
|
this.__data__ = [], this.size = 0;
|
|
170
170
|
}
|
|
171
171
|
function B(r, e) {
|
|
172
172
|
for (var t = r.length; t--; )
|
|
173
|
-
if (
|
|
173
|
+
if (Re(r[t][0], e))
|
|
174
174
|
return t;
|
|
175
175
|
return -1;
|
|
176
176
|
}
|
|
@@ -193,24 +193,24 @@ function Qt(r, e) {
|
|
|
193
193
|
var t = this.__data__, i = B(t, r);
|
|
194
194
|
return i < 0 ? (++this.size, t.push([r, e])) : t[i][1] = e, this;
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function M(r) {
|
|
197
197
|
var e = -1, t = r == null ? 0 : r.length;
|
|
198
198
|
for (this.clear(); ++e < t; ) {
|
|
199
199
|
var i = r[e];
|
|
200
200
|
this.set(i[0], i[1]);
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
203
|
+
M.prototype.clear = Kt;
|
|
204
|
+
M.prototype.delete = Yt;
|
|
205
|
+
M.prototype.get = Zt;
|
|
206
|
+
M.prototype.has = Jt;
|
|
207
|
+
M.prototype.set = Qt;
|
|
208
208
|
var At = te(A, "Map");
|
|
209
209
|
function kt() {
|
|
210
210
|
this.size = 0, this.__data__ = {
|
|
211
|
-
hash: new
|
|
212
|
-
map: new (At ||
|
|
213
|
-
string: new
|
|
211
|
+
hash: new w(),
|
|
212
|
+
map: new (At || M)(),
|
|
213
|
+
string: new w()
|
|
214
214
|
};
|
|
215
215
|
}
|
|
216
216
|
function er(r) {
|
|
@@ -235,18 +235,18 @@ function sr(r, e) {
|
|
|
235
235
|
var t = K(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 F(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
|
+
F.prototype.clear = kt;
|
|
246
|
+
F.prototype.delete = tr;
|
|
247
|
+
F.prototype.get = rr;
|
|
248
|
+
F.prototype.has = ir;
|
|
249
|
+
F.prototype.set = sr;
|
|
250
250
|
var nr = "Expected a function";
|
|
251
251
|
function re(r, e) {
|
|
252
252
|
if (typeof r != "function" || e != null && typeof e != "function")
|
|
@@ -258,9 +258,9 @@ function re(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 (re.Cache ||
|
|
261
|
+
return t.cache = new (re.Cache || F)(), t;
|
|
262
262
|
}
|
|
263
|
-
re.Cache =
|
|
263
|
+
re.Cache = F;
|
|
264
264
|
var or = 500;
|
|
265
265
|
function ar(r) {
|
|
266
266
|
var e = re(r, function(i) {
|
|
@@ -275,46 +275,46 @@ var lr = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=
|
|
|
275
275
|
}), e;
|
|
276
276
|
});
|
|
277
277
|
function cr(r) {
|
|
278
|
-
return r == null ? "" :
|
|
278
|
+
return r == null ? "" : xe(r);
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
return ee(r) ? r :
|
|
280
|
+
function $e(r, e) {
|
|
281
|
+
return ee(r) ? r : Mt(r, e) ? [r] : fr(cr(r));
|
|
282
282
|
}
|
|
283
283
|
var dr = 1 / 0;
|
|
284
|
-
function
|
|
284
|
+
function Me(r) {
|
|
285
285
|
if (typeof r == "string" || k(r))
|
|
286
286
|
return r;
|
|
287
287
|
var e = r + "";
|
|
288
288
|
return e == "0" && 1 / r == -dr ? "-0" : e;
|
|
289
289
|
}
|
|
290
|
-
function
|
|
291
|
-
e =
|
|
290
|
+
function hr(r, e) {
|
|
291
|
+
e = $e(e, r);
|
|
292
292
|
for (var t = 0, i = e.length; r != null && t < i; )
|
|
293
|
-
r = r[
|
|
293
|
+
r = r[Me(e[t++])];
|
|
294
294
|
return t && t == i ? r : void 0;
|
|
295
295
|
}
|
|
296
296
|
function H(r, e, t) {
|
|
297
|
-
var i = r == null ? void 0 :
|
|
297
|
+
var i = r == null ? void 0 : hr(r, e);
|
|
298
298
|
return i === void 0 ? t : i;
|
|
299
299
|
}
|
|
300
|
-
function
|
|
300
|
+
function pr(r, e, t, i) {
|
|
301
301
|
if (!G(r))
|
|
302
302
|
return r;
|
|
303
|
-
e =
|
|
303
|
+
e = $e(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 = Me(e[s]), c = t;
|
|
306
306
|
if (f === "__proto__" || f === "constructor" || f === "prototype")
|
|
307
307
|
return r;
|
|
308
308
|
if (s != a) {
|
|
309
|
-
var
|
|
310
|
-
|
|
309
|
+
var h = u[f];
|
|
310
|
+
c = i ? i(h, f, u) : void 0, c === void 0 && (c = G(h) ? h : Et(e[s + 1]) ? [] : {});
|
|
311
311
|
}
|
|
312
|
-
|
|
312
|
+
xt(u, f, c), u = u[f];
|
|
313
313
|
}
|
|
314
314
|
return r;
|
|
315
315
|
}
|
|
316
|
-
function
|
|
317
|
-
return r == null ? r :
|
|
316
|
+
function _(r, e, t) {
|
|
317
|
+
return r == null ? r : pr(r, e, t);
|
|
318
318
|
}
|
|
319
319
|
class o {
|
|
320
320
|
static typeChecker(e) {
|
|
@@ -364,6 +364,8 @@ class o {
|
|
|
364
364
|
return !1;
|
|
365
365
|
if (this.isObjectEmpty(e))
|
|
366
366
|
return !0;
|
|
367
|
+
if (e.__proform_raw_object)
|
|
368
|
+
return !1;
|
|
367
369
|
for (const t in e) {
|
|
368
370
|
if (t === "componentProps")
|
|
369
371
|
return !1;
|
|
@@ -393,7 +395,7 @@ function v(r, ...e) {
|
|
|
393
395
|
t.hasOwnProperty(i) && (typeof t[i] == "object" && t[i] !== null ? r[i] = v(r[i] || {}, t[i]) : r[i] = t[i]);
|
|
394
396
|
}), r;
|
|
395
397
|
}
|
|
396
|
-
function
|
|
398
|
+
function P(r) {
|
|
397
399
|
const e = /* @__PURE__ */ new WeakMap();
|
|
398
400
|
function t(i) {
|
|
399
401
|
if (i === null || typeof i != "object")
|
|
@@ -452,11 +454,11 @@ class mr {
|
|
|
452
454
|
}
|
|
453
455
|
submit() {
|
|
454
456
|
var i;
|
|
455
|
-
const e = (i =
|
|
457
|
+
const e = (i = d.getPreset(this.runtimeCore.ui)) == null ? void 0 : i.adapter, t = I.adapters[d.getUI(this.runtimeCore.ui)];
|
|
456
458
|
return (e == null ? void 0 : e.validateForm(this)) ?? (t == null ? void 0 : t.validateForm(this));
|
|
457
459
|
}
|
|
458
460
|
hydrate(e) {
|
|
459
|
-
|
|
461
|
+
C(() => {
|
|
460
462
|
this.runtimeCore.hydrateEffect.trackEffect(
|
|
461
463
|
() => {
|
|
462
464
|
U(e) ? E(
|
|
@@ -486,24 +488,24 @@ class mr {
|
|
|
486
488
|
});
|
|
487
489
|
}
|
|
488
490
|
share(e) {
|
|
489
|
-
|
|
491
|
+
C(() => {
|
|
490
492
|
Object.keys(e).forEach((t) => {
|
|
491
493
|
U(e[t]) ? D(() => {
|
|
492
|
-
|
|
494
|
+
_(this.runtimeCore.shared, t, e[t].value), this.shareHistory.get(t) !== e[t].value && (this.shareHistory.set(t, e[t].value), this.runtimeCore.processor.schemaEffect.triggerEffects());
|
|
493
495
|
}) : T(e[t]) ? D(() => {
|
|
494
|
-
|
|
495
|
-
}) : (
|
|
496
|
+
_(this.runtimeCore.shared, t, e[t]), this.shareHistory.get(t) !== e[t] && (this.shareHistory.set(t, e[t]), this.runtimeCore.processor.schemaEffect.triggerEffects());
|
|
497
|
+
}) : (_(this.runtimeCore.shared, t, e[t]), this.shareHistory.get(t) !== e[t] && (this.shareHistory.set(t, e[t]), this.runtimeCore.processor.schemaEffect.triggerEffects()));
|
|
496
498
|
});
|
|
497
499
|
});
|
|
498
500
|
}
|
|
499
501
|
subscribeModel(e) {
|
|
500
|
-
|
|
502
|
+
C(() => {
|
|
501
503
|
const t = E(
|
|
502
504
|
() => this.readonlyReactiveModel.value,
|
|
503
505
|
(i) => {
|
|
504
506
|
e(i, {
|
|
505
507
|
stopSubscribe() {
|
|
506
|
-
|
|
508
|
+
C(() => {
|
|
507
509
|
t();
|
|
508
510
|
});
|
|
509
511
|
}
|
|
@@ -518,7 +520,7 @@ class mr {
|
|
|
518
520
|
}
|
|
519
521
|
resetModel() {
|
|
520
522
|
var e;
|
|
521
|
-
(e = this.runtimeCore) != null && e.model.value && (this.runtimeCore.model.value =
|
|
523
|
+
(e = this.runtimeCore) != null && e.model.value && (this.runtimeCore.model.value = P(
|
|
522
524
|
this.runtimeCore.processor.stableModel
|
|
523
525
|
), this.readonlyReactiveModel.value = Ie(this.runtimeCore.model.value), this.runtimeCore.runtimeAdapter.clearValidate(this.runtimeCore));
|
|
524
526
|
}
|
|
@@ -539,7 +541,7 @@ class J {
|
|
|
539
541
|
trackEffect(e, t = {
|
|
540
542
|
lazy: !0
|
|
541
543
|
}) {
|
|
542
|
-
return
|
|
544
|
+
return t.identifier ? this.identifierMap.get(t.identifier) || (this.identifierMap.set(t.identifier, !0), !t.lazy && e(), this.effects.add(e)) : (!t.lazy && e(), this.effects.add(e)), () => this.effects.delete(e);
|
|
543
545
|
}
|
|
544
546
|
}
|
|
545
547
|
class gr {
|
|
@@ -550,8 +552,8 @@ class gr {
|
|
|
550
552
|
l(this, "getRuntimeMeta");
|
|
551
553
|
l(this, "stableSchemas", []);
|
|
552
554
|
l(this, "stableModel", {});
|
|
553
|
-
l(this, "schemaPreset",
|
|
554
|
-
l(this, "componentPropsPreset",
|
|
555
|
+
l(this, "schemaPreset", I.schemaPreset);
|
|
556
|
+
l(this, "componentPropsPreset", I.componentPropsPreset);
|
|
555
557
|
l(this, "stableUpdaterProcessProgress");
|
|
556
558
|
l(this, "stableUpdaterTimes", 0);
|
|
557
559
|
l(this, "schemaEffect", new J());
|
|
@@ -559,6 +561,8 @@ class gr {
|
|
|
559
561
|
l(this, "defaultValueInprogressMap", /* @__PURE__ */ new Map());
|
|
560
562
|
l(this, "baseDefaultValueFunctionsLength");
|
|
561
563
|
l(this, "isModelInitialized", !0);
|
|
564
|
+
l(this, "schemaEffectHistory", /* @__PURE__ */ new Map());
|
|
565
|
+
l(this, "stableUpdaterHistory", /* @__PURE__ */ new Map());
|
|
562
566
|
this.runtimeCore = e, this.processedSchemas = e.schemas, this.processedModel = e.model, this.getRuntimeMeta = e.getRuntimeMeta.bind(e), E(
|
|
563
567
|
() => this.processedModel.value,
|
|
564
568
|
() => {
|
|
@@ -597,7 +601,7 @@ class gr {
|
|
|
597
601
|
// 派生过程,用于外部应用
|
|
598
602
|
parseSchemas(e, t) {
|
|
599
603
|
o.isArrayEmpty(this.processedSchemas.value) && (this.baseDefaultValueFunctionsLength = this.countFunctionDefaultValues(
|
|
600
|
-
|
|
604
|
+
P(e)
|
|
601
605
|
), this.processedSchemas.value = this.initSchemas(e)), this.parse(e, t);
|
|
602
606
|
}
|
|
603
607
|
parseStable(e) {
|
|
@@ -609,12 +613,17 @@ class gr {
|
|
|
609
613
|
return t;
|
|
610
614
|
}
|
|
611
615
|
// 对于稳定初始化更新的抽象
|
|
612
|
-
stableUpdater(e = []) {
|
|
616
|
+
stableUpdater(e = [], t, i, s, n) {
|
|
613
617
|
if (e.every(Boolean)) {
|
|
614
|
-
const
|
|
615
|
-
!o.isProcessInprogress(
|
|
616
|
-
|
|
617
|
-
|
|
618
|
+
const a = R(this.processedSchemas.value);
|
|
619
|
+
!o.isProcessInprogress(a) && o.isObjectEmpty(this.stableModel), !this.stableUpdaterHistory.get(
|
|
620
|
+
`${t == null ? void 0 : t.key}parentIndex:${t == null ? void 0 : t.index}childIndex:${i}${s}${n}`
|
|
621
|
+
) && (this.stableUpdaterHistory.set(
|
|
622
|
+
`${t == null ? void 0 : t.key}parentIndex:${t == null ? void 0 : t.index}childIndex:${i}${s}${n}`,
|
|
623
|
+
!0
|
|
624
|
+
), this.stableUpdaterProcessProgress || (this.stableUpdaterProcessProgress = Array.from({
|
|
625
|
+
length: a.length
|
|
626
|
+
}).fill(!1)), this.stableUpdaterProcessProgress[this.stableUpdaterTimes] = !0, this.stableUpdaterTimes++, this.modelProcessor(a));
|
|
618
627
|
}
|
|
619
628
|
}
|
|
620
629
|
// 核心单 schema 处理过程,接收一个对象键值对的数据结构
|
|
@@ -624,17 +633,29 @@ class gr {
|
|
|
624
633
|
}).fill(!1);
|
|
625
634
|
this.objectParser({ data: e, index: t, updater: a, parentMeta: i });
|
|
626
635
|
function a(u) {
|
|
627
|
-
const f = u.index,
|
|
636
|
+
const f = u.index, c = u.key, h = u.keyIndex;
|
|
628
637
|
if (o.isUndefined(u.stable))
|
|
629
638
|
return;
|
|
630
|
-
const
|
|
631
|
-
let y =
|
|
632
|
-
if (o.isProcessInprogress(y) || (n[
|
|
633
|
-
const g = s.processedSchemas.value[b][S][f][
|
|
634
|
-
g && o.isObject(g) &&
|
|
639
|
+
const p = s.parseStable(u.stable), b = i == null ? void 0 : i.index, S = i == null ? void 0 : i.key;
|
|
640
|
+
let y = p;
|
|
641
|
+
if (o.isProcessInprogress(y) || (n[h] = !0), i) {
|
|
642
|
+
const g = s.processedSchemas.value[b][S][f][c];
|
|
643
|
+
g && o.isObject(g) && c !== "component" && (y = v(g, y)), s.processedSchemas.value[b][S][f][c] = y, s.stableUpdater(
|
|
644
|
+
n,
|
|
645
|
+
i,
|
|
646
|
+
t,
|
|
647
|
+
c,
|
|
648
|
+
f
|
|
649
|
+
);
|
|
635
650
|
} else {
|
|
636
|
-
const g = s.processedSchemas.value[f][
|
|
637
|
-
g && o.isObject(g) &&
|
|
651
|
+
const g = s.processedSchemas.value[f][c];
|
|
652
|
+
g && o.isObject(g) && c !== "component" && (y = v(g, y)), s.processedSchemas.value[f][c] = y, s.stableUpdater(
|
|
653
|
+
n,
|
|
654
|
+
i,
|
|
655
|
+
t,
|
|
656
|
+
c,
|
|
657
|
+
f
|
|
658
|
+
);
|
|
638
659
|
}
|
|
639
660
|
}
|
|
640
661
|
}
|
|
@@ -650,19 +671,19 @@ class gr {
|
|
|
650
671
|
keyIndex: n
|
|
651
672
|
});
|
|
652
673
|
else {
|
|
653
|
-
const f = (
|
|
674
|
+
const f = (c) => {
|
|
654
675
|
e.updater({
|
|
655
676
|
...e,
|
|
656
677
|
key: s,
|
|
657
678
|
keyIndex: n,
|
|
658
|
-
stable:
|
|
679
|
+
stable: c
|
|
659
680
|
});
|
|
660
681
|
};
|
|
661
682
|
o.isFunction(t[s]) ? s !== "defaultValue" ? this.schemaEffect.trackEffect(
|
|
662
683
|
() => {
|
|
663
684
|
if (s === "component") {
|
|
664
|
-
const
|
|
665
|
-
this.promiseFieldParser(
|
|
685
|
+
const c = t[s](this.getRuntimeMeta());
|
|
686
|
+
this.promiseFieldParser(c, f, !1, {
|
|
666
687
|
rootIndex: e.index,
|
|
667
688
|
parentMeta: e.parentMeta
|
|
668
689
|
});
|
|
@@ -674,25 +695,25 @@ class gr {
|
|
|
674
695
|
},
|
|
675
696
|
{
|
|
676
697
|
lazy: !1,
|
|
677
|
-
identifier: `${(a = e.parentMeta) == null ? void 0 : a.key}
|
|
698
|
+
identifier: `${(a = e.parentMeta) == null ? void 0 : a.key}parentIndex:${(u = e.parentMeta) == null ? void 0 : u.index}childIndex:${e.index}${s}${n}`
|
|
678
699
|
}
|
|
679
700
|
) : this.defaultValueEffect.trackEffect(
|
|
680
701
|
() => {
|
|
681
|
-
const
|
|
702
|
+
const c = this.schemaEffect.trackEffect(
|
|
682
703
|
() => {
|
|
683
704
|
/\{\s*model\s*\}/.test(t[s].toString()) ? this.fieldParser(
|
|
684
705
|
t[s],
|
|
685
|
-
(
|
|
686
|
-
if (!
|
|
687
|
-
return f(
|
|
688
|
-
this.defaultValueInprogressMap.set(t[s],
|
|
706
|
+
(h) => {
|
|
707
|
+
if (!h)
|
|
708
|
+
return f(h);
|
|
709
|
+
this.defaultValueInprogressMap.set(t[s], h), !o.isProcessInprogress(h) && this.defaultValueInprogressMap.size === this.baseDefaultValueFunctionsLength && Array.from(
|
|
689
710
|
this.defaultValueInprogressMap.values()
|
|
690
|
-
).every((
|
|
711
|
+
).every((p) => {
|
|
691
712
|
var b;
|
|
692
|
-
return !((b =
|
|
693
|
-
}) ? (f(
|
|
694
|
-
|
|
695
|
-
})) : f(
|
|
713
|
+
return !((b = p == null ? void 0 : p.includes) != null && b.call(p, "undefined"));
|
|
714
|
+
}) ? (f(h), this.defaultValueEffect.clearEffects(), C(() => {
|
|
715
|
+
c();
|
|
716
|
+
})) : f(h);
|
|
696
717
|
},
|
|
697
718
|
{
|
|
698
719
|
rootIndex: e.index,
|
|
@@ -700,15 +721,15 @@ class gr {
|
|
|
700
721
|
}
|
|
701
722
|
) : this.fieldParser(
|
|
702
723
|
t[s],
|
|
703
|
-
(
|
|
704
|
-
this.defaultValueInprogressMap.set(t[s],
|
|
724
|
+
(h) => {
|
|
725
|
+
this.defaultValueInprogressMap.set(t[s], h), !o.isProcessInprogress(h) && this.defaultValueInprogressMap.size === this.baseDefaultValueFunctionsLength && Array.from(
|
|
705
726
|
this.defaultValueInprogressMap.values()
|
|
706
|
-
).every((
|
|
727
|
+
).every((p) => {
|
|
707
728
|
var b;
|
|
708
|
-
return !((b =
|
|
709
|
-
}) ? (f(
|
|
710
|
-
|
|
711
|
-
})) : f(
|
|
729
|
+
return !((b = p == null ? void 0 : p.includes) != null && b.call(p, "undefined"));
|
|
730
|
+
}) ? (f(h), this.defaultValueEffect.clearEffects(), C(() => {
|
|
731
|
+
c();
|
|
732
|
+
})) : f(h);
|
|
712
733
|
},
|
|
713
734
|
{
|
|
714
735
|
rootIndex: e.index,
|
|
@@ -805,14 +826,14 @@ class gr {
|
|
|
805
826
|
}) : t(e);
|
|
806
827
|
}
|
|
807
828
|
modelProcessor(e) {
|
|
808
|
-
e.map(
|
|
809
|
-
|
|
810
|
-
), o.isObjectEmpty(this.stableModel) && this.stableUpdaterProcessProgress.every(Boolean) && this.defaultValueEffect.effects.size === 0 &&
|
|
811
|
-
this.stableModel =
|
|
829
|
+
e.map((t) => {
|
|
830
|
+
this.createModel(t, this.processedModel.value);
|
|
831
|
+
}), o.isObjectEmpty(this.stableModel) && this.stableUpdaterProcessProgress.every(Boolean) && this.defaultValueEffect.effects.size === 0 && C(() => {
|
|
832
|
+
this.stableModel = P(this.processedModel.value), this.runtimeCore.hydrateEffect.triggerEffects(), this.runtimeCore.hydrateEffect.clearEffects();
|
|
812
833
|
});
|
|
813
834
|
}
|
|
814
835
|
setModel(e, t, i) {
|
|
815
|
-
o.isFunction(t) ?
|
|
836
|
+
o.isFunction(t) ? _(e, t(), i) : v(e, {
|
|
816
837
|
[t]: i
|
|
817
838
|
});
|
|
818
839
|
}
|
|
@@ -821,7 +842,7 @@ class gr {
|
|
|
821
842
|
this.createModel(i, t[e.field][0]);
|
|
822
843
|
})), o.isGroupSchema(e) && e.children.forEach((i) => {
|
|
823
844
|
this.createModel(i, t);
|
|
824
|
-
}), o.isItemSchema(e) &&
|
|
845
|
+
}), o.isItemSchema(e) && C(() => {
|
|
825
846
|
if ("defaultValue" in e)
|
|
826
847
|
this.setModel(t, e.field, e.defaultValue);
|
|
827
848
|
else {
|
|
@@ -836,22 +857,22 @@ class gr {
|
|
|
836
857
|
}
|
|
837
858
|
class j {
|
|
838
859
|
static getFormContainer({ ui: e } = {}) {
|
|
839
|
-
return
|
|
860
|
+
return d.presets.uiPresets[e ?? d.presets.ui].container.Form;
|
|
840
861
|
}
|
|
841
862
|
static getFormItemContainer({ ui: e } = {}) {
|
|
842
|
-
return
|
|
863
|
+
return d.presets.uiPresets[e ?? d.presets.ui].container.FormItem;
|
|
843
864
|
}
|
|
844
865
|
static getItemContainer({ ui: e } = {}) {
|
|
845
|
-
return
|
|
866
|
+
return d.presets.uiPresets[e ?? d.presets.ui].container.Item;
|
|
846
867
|
}
|
|
847
868
|
static getGroupContainer({ ui: e } = {}) {
|
|
848
|
-
return
|
|
869
|
+
return d.presets.uiPresets[e ?? d.presets.ui].container.Group;
|
|
849
870
|
}
|
|
850
871
|
static getListContainer({ ui: e } = {}) {
|
|
851
|
-
return
|
|
872
|
+
return d.presets.uiPresets[e ?? d.presets.ui].container.List;
|
|
852
873
|
}
|
|
853
874
|
static getListItemContainer({ ui: e } = {}) {
|
|
854
|
-
return
|
|
875
|
+
return d.presets.uiPresets[e ?? d.presets.ui].container.ListItem;
|
|
855
876
|
}
|
|
856
877
|
}
|
|
857
878
|
class vr {
|
|
@@ -860,31 +881,31 @@ class vr {
|
|
|
860
881
|
}
|
|
861
882
|
getRuntimeNative() {
|
|
862
883
|
var t;
|
|
863
|
-
return (t =
|
|
884
|
+
return (t = d.presets.uiPresets[this.ui]) == null ? void 0 : t.native;
|
|
864
885
|
}
|
|
865
886
|
getRuntimeField(e) {
|
|
866
887
|
var s;
|
|
867
|
-
const t = (s =
|
|
888
|
+
const t = (s = d.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i = I.adapters[d.getUI(this.ui)];
|
|
868
889
|
return (t == null ? void 0 : t.getRuntimeField(e)) ?? (i == null ? void 0 : i.getRuntimeField(e));
|
|
869
890
|
}
|
|
870
891
|
getRuntimeRequired(e) {
|
|
871
892
|
var s;
|
|
872
|
-
const t = (s =
|
|
893
|
+
const t = (s = d.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i = I.adapters[d.getUI(this.ui)];
|
|
873
894
|
return (t == null ? void 0 : t.getRuntimeRequired(e)) ?? (i == null ? void 0 : i.getRuntimeRequired(e));
|
|
874
895
|
}
|
|
875
896
|
getFormModelPropName() {
|
|
876
897
|
var i;
|
|
877
|
-
const e = (i =
|
|
898
|
+
const e = (i = d.presets.uiPresets[this.ui]) == null ? void 0 : i.adapter, t = I.adapters[d.getUI(this.ui)];
|
|
878
899
|
return (e == null ? void 0 : e.getFormModelPropName()) ?? (t == null ? void 0 : t.getFormModelPropName());
|
|
879
900
|
}
|
|
880
901
|
formComponentRenderer(e) {
|
|
881
902
|
var s;
|
|
882
|
-
const t = (s =
|
|
903
|
+
const t = (s = d.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i = I.adapters[d.getUI(this.ui)];
|
|
883
904
|
return (t == null ? void 0 : t.formComponentRenderer(e)) ?? (i == null ? void 0 : i.formComponentRenderer(e));
|
|
884
905
|
}
|
|
885
906
|
clearValidate(e) {
|
|
886
907
|
var s;
|
|
887
|
-
const t = (s =
|
|
908
|
+
const t = (s = d.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i = I.adapters[d.getUI(this.ui)];
|
|
888
909
|
return (t == null ? void 0 : t.clearValidate(e)) ?? (i == null ? void 0 : i.clearValidate(e));
|
|
889
910
|
}
|
|
890
911
|
}
|
|
@@ -919,85 +940,78 @@ class yr {
|
|
|
919
940
|
l(this, "shareHistory", /* @__PURE__ */ new Map());
|
|
920
941
|
this.setup = e, this.processor = new gr(this);
|
|
921
942
|
const t = this.setup(this);
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
()
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
{
|
|
930
|
-
deep: !0
|
|
931
|
-
}
|
|
932
|
-
);
|
|
933
|
-
else if (T(t.schemas)) {
|
|
934
|
-
const i = E(() => t.schemas, () => {
|
|
935
|
-
this.processor.parseSchemas(t.schemas), _(() => {
|
|
936
|
-
i();
|
|
937
|
-
});
|
|
938
|
-
}, {
|
|
943
|
+
this.ui = t.ui ?? d.presets.ui, this.runtimeAdapter = new vr(this.ui), Object.assign(this.globalNativeFormOverride, this.runtimeAdapter.getRuntimeNative()), U(t.schemas) ? E(
|
|
944
|
+
// @ts-expect-error
|
|
945
|
+
() => t.schemas.value,
|
|
946
|
+
() => {
|
|
947
|
+
this.processor.parseSchemas(t.schemas.value);
|
|
948
|
+
},
|
|
949
|
+
{
|
|
939
950
|
deep: !0
|
|
940
|
-
}
|
|
941
|
-
|
|
951
|
+
}
|
|
952
|
+
) : T(t.schemas) ? E(() => t.schemas, () => {
|
|
942
953
|
this.processor.parseSchemas(t.schemas);
|
|
954
|
+
}, {
|
|
955
|
+
deep: !0
|
|
956
|
+
}) : this.processor.parseSchemas(t.schemas);
|
|
943
957
|
}
|
|
944
958
|
getRuntimeMeta() {
|
|
945
959
|
return {
|
|
946
|
-
model:
|
|
960
|
+
model: R(P(this.model.value)),
|
|
947
961
|
reactiveModel: this.model.value,
|
|
948
962
|
shared: this.shared,
|
|
949
963
|
// share 增加防抖,当开发者在过程中进行 share 时避免频繁触发爆栈
|
|
950
964
|
share: (t) => {
|
|
951
|
-
|
|
965
|
+
C(() => {
|
|
952
966
|
Object.keys(t).forEach((i) => {
|
|
953
967
|
U(t[i]) ? D(() => {
|
|
954
|
-
|
|
968
|
+
_(this.shared, i, t[i].value), this.shareHistory.get(i) !== t[i].value && (this.shareHistory.set(i, t[i].value), this.processor.schemaEffect.triggerEffects());
|
|
955
969
|
}) : T(t[i]) ? D(() => {
|
|
956
|
-
|
|
957
|
-
}) : (
|
|
970
|
+
_(this.shared, i, t[i]), this.shareHistory.get(i) !== t[i] && (this.shareHistory.set(i, t[i]), this.processor.schemaEffect.triggerEffects());
|
|
971
|
+
}) : (_(this.shared, i, t[i]), this.shareHistory.get(i) !== t[i] && (this.shareHistory.set(i, t[i]), this.processor.schemaEffect.triggerEffects()));
|
|
958
972
|
});
|
|
959
973
|
});
|
|
960
974
|
}
|
|
961
975
|
};
|
|
962
976
|
}
|
|
963
977
|
runtimeItemProcessor(e, t, i = this.model.value, s) {
|
|
964
|
-
var se, ne, oe, ae, le, ue, fe, ce, de,
|
|
965
|
-
const n =
|
|
978
|
+
var se, ne, oe, ae, le, ue, fe, ce, de, he, pe, me, ge, ve, be, ye, _e;
|
|
979
|
+
const n = R(e.component);
|
|
966
980
|
if (!n)
|
|
967
981
|
return;
|
|
968
982
|
(ne = (se = e.native) == null ? void 0 : se.props) != null && ne.Form && v(this.globalNativeFormOverride.props.Form, (ae = (oe = e.native) == null ? void 0 : oe.props) == null ? void 0 : ae.Form), (ue = (le = e.native) == null ? void 0 : le.slots) != null && ue.Form && v(this.globalNativeFormOverride.slots.Form, (ce = (fe = e.native) == null ? void 0 : fe.slots) == null ? void 0 : ce.Form);
|
|
969
|
-
const a = v(
|
|
983
|
+
const a = v(P((he = (de = this.native) == null ? void 0 : de.slots) == null ? void 0 : he.FormItem) ?? {}, (me = (pe = e.native) == null ? void 0 : pe.slots) == null ? void 0 : me.FormItem), u = {
|
|
970
984
|
display: "grid",
|
|
971
985
|
gridColumn: "1 / -1",
|
|
972
986
|
...e.grid
|
|
973
|
-
}, f = v(
|
|
987
|
+
}, f = v(P((ve = (ge = this.native) == null ? void 0 : ge.props) == null ? void 0 : ve.FormItem) ?? {}, (ye = (be = e.native) == null ? void 0 : be.props) == null ? void 0 : ye.FormItem), c = this.runtimeAdapter.getRuntimeField({
|
|
974
988
|
schema: e,
|
|
975
989
|
parentSchema: s,
|
|
976
990
|
index: t
|
|
977
|
-
}),
|
|
991
|
+
}), h = n.name, p = e.componentProps ?? {}, b = I.placeholderPresetByComponentName;
|
|
978
992
|
let S = e.placeholder, y = e.show;
|
|
979
993
|
y === void 0 && (y = !0);
|
|
980
994
|
let g = e.label ?? "", O;
|
|
981
995
|
if (e.runtime ? O = e.runtime : O = (s == null ? void 0 : s.runtime) ?? this.runtime, !o.isUndefined(t) && !o.isObjectEmpty(O) && (g = Z((_e = O == null ? void 0 : O.customizeListItemLabel) == null ? void 0 : _e.call(O, e.label ?? "", t + 1), "")), !S) {
|
|
982
|
-
let
|
|
983
|
-
o.isUndefined(
|
|
984
|
-
b[
|
|
985
|
-
|
|
986
|
-
}), S = `${
|
|
996
|
+
let V = "请输入";
|
|
997
|
+
o.isUndefined(h) ? S = `${V}${g}` : /* @ts-expect-error */ b[h.toLowerCase()] ? (V = // @ts-expect-error
|
|
998
|
+
b[h.toLowerCase()], S = `${V}${g}`) : (Object.keys(b).forEach((Pe) => {
|
|
999
|
+
h.toLowerCase().includes(Pe.toLowerCase()) && (V = b[Pe]);
|
|
1000
|
+
}), S = `${V}${g}`);
|
|
987
1001
|
}
|
|
988
|
-
const
|
|
1002
|
+
const Ve = this.runtimeAdapter.getRuntimeRequired({
|
|
989
1003
|
...e,
|
|
990
1004
|
label: g
|
|
991
|
-
}),
|
|
1005
|
+
}), qe = j.getItemContainer(this), Ne = j.getFormItemContainer(this), Ue = this, Te = e.componentSlots;
|
|
992
1006
|
return m("div", {
|
|
993
1007
|
style: u
|
|
994
|
-
}, [m(
|
|
1008
|
+
}, [m(qe, {
|
|
995
1009
|
show: y
|
|
996
1010
|
}, {
|
|
997
1011
|
default() {
|
|
998
|
-
return y && m(
|
|
1012
|
+
return y && m(Ne, N(f, {
|
|
999
1013
|
label: `${g ? `${g}:` : ""}`
|
|
1000
|
-
},
|
|
1014
|
+
}, c, Ve), {
|
|
1001
1015
|
default() {
|
|
1002
1016
|
return Ue.runtimeAdapter.formComponentRenderer({
|
|
1003
1017
|
Component: n,
|
|
@@ -1005,7 +1019,7 @@ class yr {
|
|
|
1005
1019
|
baseModel: i,
|
|
1006
1020
|
placeholder: S,
|
|
1007
1021
|
componentSlots: Te,
|
|
1008
|
-
props:
|
|
1022
|
+
props: p
|
|
1009
1023
|
});
|
|
1010
1024
|
},
|
|
1011
1025
|
...a
|
|
@@ -1031,7 +1045,7 @@ class yr {
|
|
|
1031
1045
|
}
|
|
1032
1046
|
addListItem(e) {
|
|
1033
1047
|
var t;
|
|
1034
|
-
console.log("this", this.processor.stableModel, e.field), (t = this.processor.stableModel[e.field]) != null && t[0] && this.model.value[e.field].push(
|
|
1048
|
+
console.log("this", this.processor.stableModel, e.field), (t = this.processor.stableModel[e.field]) != null && t[0] && this.model.value[e.field].push(P(this.processor.stableModel[e.field][0])), this.runtimeAdapter.clearValidate(this);
|
|
1035
1049
|
}
|
|
1036
1050
|
deleteListItem(e, t) {
|
|
1037
1051
|
this.model.value[e.field].splice(t, 1), this.runtimeAdapter.clearValidate(this);
|
|
@@ -1054,16 +1068,16 @@ class yr {
|
|
|
1054
1068
|
default() {
|
|
1055
1069
|
return i.model.value[e.field].map((u, f) => m(a, null, {
|
|
1056
1070
|
default() {
|
|
1057
|
-
return e.children.map((
|
|
1071
|
+
return e.children.map((c) => i.runtimeItemProcessor(c, f, u, e));
|
|
1058
1072
|
},
|
|
1059
1073
|
delete({
|
|
1060
|
-
container:
|
|
1074
|
+
container: c
|
|
1061
1075
|
} = {}) {
|
|
1062
|
-
var
|
|
1063
|
-
const
|
|
1064
|
-
return He(m(
|
|
1076
|
+
var p;
|
|
1077
|
+
const h = c ?? m("button", null, null);
|
|
1078
|
+
return He(m(h, {
|
|
1065
1079
|
onClick: () => i.deleteListItem(e, f)
|
|
1066
|
-
}, null), [[De, ((
|
|
1080
|
+
}, null), [[De, ((p = i.model.value[e.field]) == null ? void 0 : p.length) > 1]]);
|
|
1067
1081
|
}
|
|
1068
1082
|
}));
|
|
1069
1083
|
},
|
|
@@ -1081,14 +1095,14 @@ class yr {
|
|
|
1081
1095
|
return e.map((t) => (t.type || (t.type = "item"), this.processorBySchemaType[t.type](t)));
|
|
1082
1096
|
}
|
|
1083
1097
|
exec() {
|
|
1084
|
-
var u, f,
|
|
1098
|
+
var u, f, c, h;
|
|
1085
1099
|
const e = {
|
|
1086
1100
|
display: "grid",
|
|
1087
1101
|
gridColumn: "1 / -1",
|
|
1088
1102
|
gridAutoColumns: "1fr",
|
|
1089
1103
|
...this.grid
|
|
1090
|
-
}, t = this, i = v(this.globalNativeFormOverride.props.Form,
|
|
1091
|
-
return m(n,
|
|
1104
|
+
}, t = this, i = v(this.globalNativeFormOverride.props.Form, P((f = (u = this.native) == null ? void 0 : u.props) == null ? void 0 : f.Form) ?? {}), s = v(this.globalNativeFormOverride.slots.Form, P((h = (c = this.native) == null ? void 0 : c.slots) == null ? void 0 : h.Form) ?? {}), n = j.getFormContainer(this), a = this.runtimeAdapter.getFormModelPropName();
|
|
1105
|
+
return m(n, N(i, {
|
|
1092
1106
|
ref: this.formRef
|
|
1093
1107
|
}, {
|
|
1094
1108
|
[a]: this.model.value
|
|
@@ -1102,7 +1116,7 @@ class yr {
|
|
|
1102
1116
|
});
|
|
1103
1117
|
}
|
|
1104
1118
|
}
|
|
1105
|
-
class
|
|
1119
|
+
class d {
|
|
1106
1120
|
static getPreset(e) {
|
|
1107
1121
|
var t, i, s;
|
|
1108
1122
|
return (i = (t = this.presets.uiPresets) == null ? void 0 : t[e]) != null && i.extend ? this.presets.uiPresets[(s = this.presets.uiPresets[e]) == null ? void 0 : s.extend] : this.presets.uiPresets[e];
|
|
@@ -1112,7 +1126,7 @@ class c {
|
|
|
1112
1126
|
return (i = (t = this.presets.uiPresets) == null ? void 0 : t[e]) != null && i.extend ? (s = this.presets.uiPresets[e]) == null ? void 0 : s.extend : e;
|
|
1113
1127
|
}
|
|
1114
1128
|
}
|
|
1115
|
-
l(
|
|
1129
|
+
l(d, "presets");
|
|
1116
1130
|
function Y({
|
|
1117
1131
|
parentSchema: r,
|
|
1118
1132
|
schema: e,
|
|
@@ -1167,10 +1181,10 @@ const _r = {
|
|
|
1167
1181
|
props: n
|
|
1168
1182
|
}) {
|
|
1169
1183
|
let a;
|
|
1170
|
-
return o.isFunction(t.field) ? a = H(e, t.field()) : a = e[t.field], m(r,
|
|
1184
|
+
return o.isFunction(t.field) ? a = H(e, t.field()) : a = e[t.field], m(r, N({
|
|
1171
1185
|
modelValue: a,
|
|
1172
1186
|
"onUpdate:modelValue": (u) => {
|
|
1173
|
-
o.isFunction(t.field) ?
|
|
1187
|
+
o.isFunction(t.field) ? _(e, t.field(), u) : e[t.field] = u;
|
|
1174
1188
|
},
|
|
1175
1189
|
placeholder: i
|
|
1176
1190
|
}, n), {
|
|
@@ -1179,7 +1193,7 @@ const _r = {
|
|
|
1179
1193
|
},
|
|
1180
1194
|
validateForm(r) {
|
|
1181
1195
|
return new Promise((e, t) => {
|
|
1182
|
-
r.runtimeCore.formRef.value.validate((i) => i ? t(i) : e(r.cleanFallbackFields(
|
|
1196
|
+
r.runtimeCore.formRef.value.validate((i) => i ? t(i) : e(r.cleanFallbackFields(R(r.runtimeCore.processor.processedModel.value))));
|
|
1183
1197
|
});
|
|
1184
1198
|
},
|
|
1185
1199
|
clearValidate(r) {
|
|
@@ -1234,10 +1248,10 @@ const _r = {
|
|
|
1234
1248
|
props: n
|
|
1235
1249
|
}) {
|
|
1236
1250
|
let a;
|
|
1237
|
-
return o.isFunction(t.field) ? a = H(e, t.field()) : a = e[t.field], m(r,
|
|
1251
|
+
return o.isFunction(t.field) ? a = H(e, t.field()) : a = e[t.field], m(r, N({
|
|
1238
1252
|
modelValue: a,
|
|
1239
1253
|
"onUpdate:modelValue": (u) => {
|
|
1240
|
-
o.isFunction(t.field) ?
|
|
1254
|
+
o.isFunction(t.field) ? _(e, t.field(), u) : e[t.field] = u;
|
|
1241
1255
|
},
|
|
1242
1256
|
placeholder: i
|
|
1243
1257
|
}, n), {
|
|
@@ -1250,7 +1264,7 @@ const _r = {
|
|
|
1250
1264
|
valid: i,
|
|
1251
1265
|
errors: s
|
|
1252
1266
|
}) => {
|
|
1253
|
-
i ? e(r.cleanFallbackFields(
|
|
1267
|
+
i ? e(r.cleanFallbackFields(R(r.runtimeCore.processor.processedModel.value))) : t(s);
|
|
1254
1268
|
});
|
|
1255
1269
|
});
|
|
1256
1270
|
},
|
|
@@ -1308,10 +1322,10 @@ const _r = {
|
|
|
1308
1322
|
props: n
|
|
1309
1323
|
}) {
|
|
1310
1324
|
let a;
|
|
1311
|
-
return o.isFunction(t.field) ? a = H(e, t.field()) : a = e[t.field], m(r,
|
|
1325
|
+
return o.isFunction(t.field) ? a = H(e, t.field()) : a = e[t.field], m(r, N({
|
|
1312
1326
|
value: a,
|
|
1313
1327
|
"onUpdate:value": (u) => {
|
|
1314
|
-
o.isFunction(t.field) ?
|
|
1328
|
+
o.isFunction(t.field) ? _(e, t.field(), u) : e[t.field] = u;
|
|
1315
1329
|
},
|
|
1316
1330
|
placeholder: i
|
|
1317
1331
|
}, n), {
|
|
@@ -1320,7 +1334,7 @@ const _r = {
|
|
|
1320
1334
|
},
|
|
1321
1335
|
validateForm(r) {
|
|
1322
1336
|
return new Promise((e, t) => {
|
|
1323
|
-
r.runtimeCore.formRef.value.validate((i) => i ? t(i) : e(r.cleanFallbackFields(
|
|
1337
|
+
r.runtimeCore.formRef.value.validate((i) => i ? t(i) : e(r.cleanFallbackFields(R(r.runtimeCore.processor.processedModel.value))));
|
|
1324
1338
|
});
|
|
1325
1339
|
},
|
|
1326
1340
|
clearValidate(r) {
|
|
@@ -1328,7 +1342,7 @@ const _r = {
|
|
|
1328
1342
|
(t = (e = r.formRef.value) == null ? void 0 : e.restoreValidation) == null || t.call(e);
|
|
1329
1343
|
}
|
|
1330
1344
|
}
|
|
1331
|
-
},
|
|
1345
|
+
}, x = class x {
|
|
1332
1346
|
static getPlaceholderPrefixPresetByComponentName() {
|
|
1333
1347
|
const e = {
|
|
1334
1348
|
请选择: ["select", "tree"],
|
|
@@ -1341,7 +1355,7 @@ const _r = {
|
|
|
1341
1355
|
return t;
|
|
1342
1356
|
}
|
|
1343
1357
|
};
|
|
1344
|
-
l(
|
|
1358
|
+
l(x, "schemaPreset", {
|
|
1345
1359
|
type: {
|
|
1346
1360
|
defaultValue: "item"
|
|
1347
1361
|
},
|
|
@@ -1387,14 +1401,14 @@ l(M, "schemaPreset", {
|
|
|
1387
1401
|
runtime: {
|
|
1388
1402
|
default: void 0
|
|
1389
1403
|
}
|
|
1390
|
-
}), l(
|
|
1404
|
+
}), l(x, "componentPropsPreset", {
|
|
1391
1405
|
options: {
|
|
1392
1406
|
defaultValue: []
|
|
1393
1407
|
}
|
|
1394
1408
|
}), // 基于基本功能提出基本预设
|
|
1395
|
-
l(
|
|
1396
|
-
let Q =
|
|
1397
|
-
const
|
|
1409
|
+
l(x, "placeholderPresetByComponentName", x.getPlaceholderPrefixPresetByComponentName());
|
|
1410
|
+
let Q = x;
|
|
1411
|
+
const I = {
|
|
1398
1412
|
...Q,
|
|
1399
1413
|
adapters: {
|
|
1400
1414
|
..._r
|
|
@@ -1425,7 +1439,7 @@ function Sr(r) {
|
|
|
1425
1439
|
];
|
|
1426
1440
|
}
|
|
1427
1441
|
function Or(r) {
|
|
1428
|
-
|
|
1442
|
+
d.presets = r;
|
|
1429
1443
|
}
|
|
1430
1444
|
function ie(r, e) {
|
|
1431
1445
|
return e === "native" && Object.defineProperty(r, "name", {
|
|
@@ -1442,10 +1456,10 @@ function ie(r, e) {
|
|
|
1442
1456
|
function Er(r) {
|
|
1443
1457
|
return ie(r, "native");
|
|
1444
1458
|
}
|
|
1445
|
-
function
|
|
1459
|
+
function wr(r) {
|
|
1446
1460
|
return r.__proform_raw_object = !0, r;
|
|
1447
1461
|
}
|
|
1448
|
-
function
|
|
1462
|
+
function Fr(r) {
|
|
1449
1463
|
return ie(r, "onetime");
|
|
1450
1464
|
}
|
|
1451
1465
|
function jr(r) {
|
|
@@ -1460,8 +1474,8 @@ function jr(r) {
|
|
|
1460
1474
|
export {
|
|
1461
1475
|
Cr as ProForm,
|
|
1462
1476
|
Er as markNativeFunction,
|
|
1463
|
-
|
|
1464
|
-
|
|
1477
|
+
wr as markNativeObject,
|
|
1478
|
+
Fr as markOnetimeFunction,
|
|
1465
1479
|
jr as markStructuredPathParsing,
|
|
1466
1480
|
Sr as useForm,
|
|
1467
1481
|
Or as useFormPresetConfigurer,
|
|
@@ -22,13 +22,15 @@ export default class Processor {
|
|
|
22
22
|
defaultValueInprogressMap: Map<any, any>;
|
|
23
23
|
baseDefaultValueFunctionsLength: number;
|
|
24
24
|
isModelInitialized: boolean;
|
|
25
|
+
schemaEffectHistory: Map<any, any>;
|
|
26
|
+
stableUpdaterHistory: Map<any, any>;
|
|
25
27
|
constructor(runtimeCore: RuntimeCore);
|
|
26
28
|
parse<T extends object = any>(data: T[], parentMeta?: AnyObject): void;
|
|
27
29
|
initSchemas(schemas: AnyObject[]): AnyObject[];
|
|
28
30
|
countFunctionDefaultValues(input: AnyObject): number;
|
|
29
31
|
parseSchemas(schemas: ProxyedSchema[], parentMeta?: AnyObject): void;
|
|
30
32
|
parseStable(stable: AnyObject): AnyObject;
|
|
31
|
-
stableUpdater(parseProcess?: boolean[]): void;
|
|
33
|
+
stableUpdater(parseProcess?: boolean[], parentMeta?: AnyObject, index?: number, key?: string, keyIndex?: number): void;
|
|
32
34
|
parseItem(data: AnyObject, index: number, parentMeta?: AnyObject): void;
|
|
33
35
|
objectParser(root: ObjectParserRoot): void;
|
|
34
36
|
promiseFieldParser(rootField: any, updater: AnyFunction, deepProcess: boolean, meta: AnyObject): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@harbor-design/proform",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"@types/lodash-es": "^4.17.12"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
|
-
"build": "vue-tsc && vite build"
|
|
37
|
+
"build": "vue-tsc && vite build",
|
|
38
|
+
"dev:watch": "nodemon -e .ts,.tsx --ignore dist --exec 'vite build'"
|
|
38
39
|
}
|
|
39
40
|
}
|