@harbor-design/proform 1.3.29 → 1.3.30
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 +101 -101
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Te = Object.defineProperty;
|
|
2
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
|
|
4
|
+
import { ref as z, readonly as Pe, nextTick as O, isRef as q, watch as _, isReactive as U, toRaw as x, reactive as K, createVNode as b, mergeProps as N, withDirectives as Le, vShow as De, createTextVNode as Ge, isVNode as Be, defineComponent as He } from "vue";
|
|
5
5
|
class o {
|
|
6
6
|
static typeChecker(e) {
|
|
7
7
|
return {}.toString.call(e);
|
|
@@ -118,13 +118,13 @@ function P(t) {
|
|
|
118
118
|
}
|
|
119
119
|
return r(t);
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function Y(t, e) {
|
|
122
122
|
return t.replace(/undefined/g, e);
|
|
123
123
|
}
|
|
124
124
|
class Ke {
|
|
125
125
|
constructor(e) {
|
|
126
126
|
u(this, "runtimeCore");
|
|
127
|
-
u(this, "readonlyReactiveModel",
|
|
127
|
+
u(this, "readonlyReactiveModel", z({}));
|
|
128
128
|
this.formCustomization = e;
|
|
129
129
|
}
|
|
130
130
|
// happy path, 后续可以完善更多的 fallback 处理,fallback 处理是为了不卡住异步时的首次渲染做的优化
|
|
@@ -134,7 +134,7 @@ class Ke {
|
|
|
134
134
|
})), e;
|
|
135
135
|
}
|
|
136
136
|
setup(e) {
|
|
137
|
-
return this.runtimeCore = e, this.readonlyReactiveModel.value =
|
|
137
|
+
return this.runtimeCore = e, this.readonlyReactiveModel.value = Pe(e.model.value), Object.assign(this.runtimeCore.native, this.formCustomization.native), Object.assign(this.runtimeCore.grid, this.formCustomization.grid), Object.assign(this.runtimeCore.runtime, this.formCustomization.runtime), this.formCustomization.ui && (this.runtimeCore.ui = this.formCustomization.ui), this.formCustomization;
|
|
138
138
|
}
|
|
139
139
|
submit() {
|
|
140
140
|
var i;
|
|
@@ -145,7 +145,7 @@ class Ke {
|
|
|
145
145
|
O(() => {
|
|
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);
|
|
@@ -174,22 +174,22 @@ class Ke {
|
|
|
174
174
|
share(e) {
|
|
175
175
|
O(() => {
|
|
176
176
|
Object.keys(e).forEach((r) => {
|
|
177
|
-
|
|
177
|
+
q(e[r]) ? (console.log("data[key]", e[r]), _(
|
|
178
178
|
() => e[r].value,
|
|
179
179
|
() => {
|
|
180
180
|
h(this.runtimeCore.shared, {
|
|
181
|
-
[r]:
|
|
181
|
+
[r]: e[r].value
|
|
182
182
|
});
|
|
183
183
|
},
|
|
184
184
|
{
|
|
185
185
|
deep: !0,
|
|
186
186
|
immediate: !0
|
|
187
187
|
}
|
|
188
|
-
)) :
|
|
188
|
+
)) : U(e[r]) ? _(
|
|
189
189
|
() => e[r],
|
|
190
190
|
() => {
|
|
191
191
|
h(this.runtimeCore.shared, {
|
|
192
|
-
[r]:
|
|
192
|
+
[r]: e[r]
|
|
193
193
|
});
|
|
194
194
|
},
|
|
195
195
|
{
|
|
@@ -197,7 +197,7 @@ class Ke {
|
|
|
197
197
|
immediate: !0
|
|
198
198
|
}
|
|
199
199
|
) : h(this.runtimeCore.shared, {
|
|
200
|
-
[r]:
|
|
200
|
+
[r]: e[r]
|
|
201
201
|
});
|
|
202
202
|
});
|
|
203
203
|
});
|
|
@@ -226,10 +226,10 @@ class Ke {
|
|
|
226
226
|
var e;
|
|
227
227
|
(e = this.runtimeCore) != null && e.model.value && (this.runtimeCore.model.value = P(
|
|
228
228
|
this.runtimeCore.processor.stableModel
|
|
229
|
-
), this.readonlyReactiveModel.value =
|
|
229
|
+
), this.readonlyReactiveModel.value = Pe(this.runtimeCore.model.value), this.runtimeCore.runtimeAdapter.clearValidate(this.runtimeCore));
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
|
-
class
|
|
232
|
+
class Z {
|
|
233
233
|
constructor() {
|
|
234
234
|
u(this, "effects", /* @__PURE__ */ new Set());
|
|
235
235
|
u(this, "tempClonedEffects", /* @__PURE__ */ new Set());
|
|
@@ -248,16 +248,16 @@ class J {
|
|
|
248
248
|
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);
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
|
-
var We = typeof global == "object" && global && global.Object === Object && global, Xe = typeof self == "object" && self && self.Object === Object && self,
|
|
251
|
+
var We = typeof global == "object" && global && global.Object === Object && global, Xe = typeof self == "object" && self && self.Object === Object && self, Q = We || Xe || Function("return this")(), E = Q.Symbol, je = Object.prototype, Ye = je.hasOwnProperty, Ze = je.toString, V = E ? E.toStringTag : void 0;
|
|
252
252
|
function Je(t) {
|
|
253
|
-
var e = Ye.call(t,
|
|
253
|
+
var e = Ye.call(t, V), r = t[V];
|
|
254
254
|
try {
|
|
255
|
-
t[
|
|
255
|
+
t[V] = void 0;
|
|
256
256
|
var i = !0;
|
|
257
257
|
} catch {
|
|
258
258
|
}
|
|
259
259
|
var s = Ze.call(t);
|
|
260
|
-
return i && (e ? t[
|
|
260
|
+
return i && (e ? t[V] = r : delete t[V]), s;
|
|
261
261
|
}
|
|
262
262
|
var Qe = Object.prototype, ke = Qe.toString;
|
|
263
263
|
function Ae(t) {
|
|
@@ -271,7 +271,7 @@ function rt(t) {
|
|
|
271
271
|
return t != null && typeof t == "object";
|
|
272
272
|
}
|
|
273
273
|
var it = "[object Symbol]";
|
|
274
|
-
function
|
|
274
|
+
function k(t) {
|
|
275
275
|
return typeof t == "symbol" || rt(t) && we(t) == it;
|
|
276
276
|
}
|
|
277
277
|
function st(t, e) {
|
|
@@ -279,30 +279,30 @@ function st(t, e) {
|
|
|
279
279
|
s[r] = e(t[r], r, t);
|
|
280
280
|
return s;
|
|
281
281
|
}
|
|
282
|
-
var
|
|
282
|
+
var A = Array.isArray, nt = 1 / 0, Ce = E ? E.prototype : void 0, Se = Ce ? Ce.toString : void 0;
|
|
283
283
|
function Me(t) {
|
|
284
284
|
if (typeof t == "string")
|
|
285
285
|
return t;
|
|
286
|
-
if (ee(t))
|
|
287
|
-
return st(t, Me) + "";
|
|
288
286
|
if (A(t))
|
|
287
|
+
return st(t, Me) + "";
|
|
288
|
+
if (k(t))
|
|
289
289
|
return Se ? Se.call(t) : "";
|
|
290
290
|
var e = t + "";
|
|
291
291
|
return e == "0" && 1 / t == -nt ? "-0" : e;
|
|
292
292
|
}
|
|
293
|
-
function
|
|
293
|
+
function G(t) {
|
|
294
294
|
var e = typeof t;
|
|
295
295
|
return t != null && (e == "object" || e == "function");
|
|
296
296
|
}
|
|
297
297
|
var ot = "[object AsyncFunction]", at = "[object Function]", lt = "[object GeneratorFunction]", ut = "[object Proxy]";
|
|
298
298
|
function ft(t) {
|
|
299
|
-
if (!
|
|
299
|
+
if (!G(t))
|
|
300
300
|
return !1;
|
|
301
301
|
var e = we(t);
|
|
302
302
|
return e == at || e == lt || e == ot || e == ut;
|
|
303
303
|
}
|
|
304
|
-
var
|
|
305
|
-
var t = /[^.]+$/.exec(
|
|
304
|
+
var W = Q["__core-js_shared__"], Oe = function() {
|
|
305
|
+
var t = /[^.]+$/.exec(W && W.keys && W.keys.IE_PROTO || "");
|
|
306
306
|
return t ? "Symbol(src)_1." + t : "";
|
|
307
307
|
}();
|
|
308
308
|
function ct(t) {
|
|
@@ -326,7 +326,7 @@ var mt = /[\\^$.*+?()[\]{}|]/g, bt = /^\[object .+?Constructor\]$/, gt = Functio
|
|
|
326
326
|
"^" + yt.call(_t).replace(mt, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
327
327
|
);
|
|
328
328
|
function It(t) {
|
|
329
|
-
if (!
|
|
329
|
+
if (!G(t) || ct(t))
|
|
330
330
|
return !1;
|
|
331
331
|
var e = ft(t) ? Pt : bt;
|
|
332
332
|
return e.test(ht(t));
|
|
@@ -334,13 +334,13 @@ function It(t) {
|
|
|
334
334
|
function Ct(t, e) {
|
|
335
335
|
return t == null ? void 0 : t[e];
|
|
336
336
|
}
|
|
337
|
-
function
|
|
337
|
+
function ee(t, e) {
|
|
338
338
|
var r = Ct(t, e);
|
|
339
339
|
return It(r) ? r : void 0;
|
|
340
340
|
}
|
|
341
341
|
var Fe = function() {
|
|
342
342
|
try {
|
|
343
|
-
var t =
|
|
343
|
+
var t = ee(Object, "defineProperty");
|
|
344
344
|
return t({}, "", {}), t;
|
|
345
345
|
} catch {
|
|
346
346
|
}
|
|
@@ -367,14 +367,14 @@ function xt(t, e, r) {
|
|
|
367
367
|
}
|
|
368
368
|
var Et = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Rt = /^\w*$/;
|
|
369
369
|
function $t(t, e) {
|
|
370
|
-
if (
|
|
370
|
+
if (A(t))
|
|
371
371
|
return !1;
|
|
372
372
|
var r = typeof t;
|
|
373
|
-
return r == "number" || r == "symbol" || r == "boolean" || t == null ||
|
|
373
|
+
return r == "number" || r == "symbol" || r == "boolean" || t == null || k(t) ? !0 : Rt.test(t) || !Et.test(t) || e != null && t in Object(e);
|
|
374
374
|
}
|
|
375
|
-
var
|
|
375
|
+
var T = ee(Object, "create");
|
|
376
376
|
function Vt() {
|
|
377
|
-
this.__data__ =
|
|
377
|
+
this.__data__ = T ? T(null) : {}, this.size = 0;
|
|
378
378
|
}
|
|
379
379
|
function Nt(t) {
|
|
380
380
|
var e = this.has(t) && delete this.__data__[t];
|
|
@@ -383,7 +383,7 @@ function Nt(t) {
|
|
|
383
383
|
var qt = "__lodash_hash_undefined__", Ut = Object.prototype, Tt = Ut.hasOwnProperty;
|
|
384
384
|
function zt(t) {
|
|
385
385
|
var e = this.__data__;
|
|
386
|
-
if (
|
|
386
|
+
if (T) {
|
|
387
387
|
var r = e[t];
|
|
388
388
|
return r === qt ? void 0 : r;
|
|
389
389
|
}
|
|
@@ -392,12 +392,12 @@ function zt(t) {
|
|
|
392
392
|
var Lt = Object.prototype, Dt = Lt.hasOwnProperty;
|
|
393
393
|
function Gt(t) {
|
|
394
394
|
var e = this.__data__;
|
|
395
|
-
return
|
|
395
|
+
return T ? e[t] !== void 0 : Dt.call(e, t);
|
|
396
396
|
}
|
|
397
397
|
var Bt = "__lodash_hash_undefined__";
|
|
398
398
|
function Ht(t, e) {
|
|
399
399
|
var r = this.__data__;
|
|
400
|
-
return this.size += this.has(t) ? 0 : 1, r[t] =
|
|
400
|
+
return this.size += this.has(t) ? 0 : 1, r[t] = T && e === void 0 ? Bt : e, this;
|
|
401
401
|
}
|
|
402
402
|
function F(t) {
|
|
403
403
|
var e = -1, r = t == null ? 0 : t.length;
|
|
@@ -414,7 +414,7 @@ F.prototype.set = Ht;
|
|
|
414
414
|
function Kt() {
|
|
415
415
|
this.__data__ = [], this.size = 0;
|
|
416
416
|
}
|
|
417
|
-
function
|
|
417
|
+
function B(t, e) {
|
|
418
418
|
for (var r = t.length; r--; )
|
|
419
419
|
if (xe(t[r][0], e))
|
|
420
420
|
return r;
|
|
@@ -422,21 +422,21 @@ function H(t, e) {
|
|
|
422
422
|
}
|
|
423
423
|
var Wt = Array.prototype, Xt = Wt.splice;
|
|
424
424
|
function Yt(t) {
|
|
425
|
-
var e = this.__data__, r =
|
|
425
|
+
var e = this.__data__, r = B(e, t);
|
|
426
426
|
if (r < 0)
|
|
427
427
|
return !1;
|
|
428
428
|
var i = e.length - 1;
|
|
429
429
|
return r == i ? e.pop() : Xt.call(e, r, 1), --this.size, !0;
|
|
430
430
|
}
|
|
431
431
|
function Zt(t) {
|
|
432
|
-
var e = this.__data__, r =
|
|
432
|
+
var e = this.__data__, r = B(e, t);
|
|
433
433
|
return r < 0 ? void 0 : e[r][1];
|
|
434
434
|
}
|
|
435
435
|
function Jt(t) {
|
|
436
|
-
return
|
|
436
|
+
return B(this.__data__, t) > -1;
|
|
437
437
|
}
|
|
438
438
|
function Qt(t, e) {
|
|
439
|
-
var r = this.__data__, i =
|
|
439
|
+
var r = this.__data__, i = B(r, t);
|
|
440
440
|
return i < 0 ? (++this.size, r.push([t, e])) : r[i][1] = e, this;
|
|
441
441
|
}
|
|
442
442
|
function R(t) {
|
|
@@ -451,7 +451,7 @@ R.prototype.delete = Yt;
|
|
|
451
451
|
R.prototype.get = Zt;
|
|
452
452
|
R.prototype.has = Jt;
|
|
453
453
|
R.prototype.set = Qt;
|
|
454
|
-
var kt =
|
|
454
|
+
var kt = ee(Q, "Map");
|
|
455
455
|
function At() {
|
|
456
456
|
this.size = 0, this.__data__ = {
|
|
457
457
|
hash: new F(),
|
|
@@ -463,22 +463,22 @@ function er(t) {
|
|
|
463
463
|
var e = typeof t;
|
|
464
464
|
return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
|
|
465
465
|
}
|
|
466
|
-
function
|
|
466
|
+
function H(t, e) {
|
|
467
467
|
var r = t.__data__;
|
|
468
468
|
return er(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
|
|
469
469
|
}
|
|
470
470
|
function tr(t) {
|
|
471
|
-
var e =
|
|
471
|
+
var e = H(this, t).delete(t);
|
|
472
472
|
return this.size -= e ? 1 : 0, e;
|
|
473
473
|
}
|
|
474
474
|
function rr(t) {
|
|
475
|
-
return
|
|
475
|
+
return H(this, t).get(t);
|
|
476
476
|
}
|
|
477
477
|
function ir(t) {
|
|
478
|
-
return
|
|
478
|
+
return H(this, t).has(t);
|
|
479
479
|
}
|
|
480
480
|
function sr(t, e) {
|
|
481
|
-
var r =
|
|
481
|
+
var r = H(this, t), i = r.size;
|
|
482
482
|
return r.set(t, e), this.size += r.size == i ? 0 : 1, this;
|
|
483
483
|
}
|
|
484
484
|
function j(t) {
|
|
@@ -494,7 +494,7 @@ j.prototype.get = rr;
|
|
|
494
494
|
j.prototype.has = ir;
|
|
495
495
|
j.prototype.set = sr;
|
|
496
496
|
var nr = "Expected a function";
|
|
497
|
-
function
|
|
497
|
+
function te(t, e) {
|
|
498
498
|
if (typeof t != "function" || e != null && typeof e != "function")
|
|
499
499
|
throw new TypeError(nr);
|
|
500
500
|
var r = function() {
|
|
@@ -504,12 +504,12 @@ function re(t, e) {
|
|
|
504
504
|
var a = t.apply(this, i);
|
|
505
505
|
return r.cache = n.set(s, a) || n, a;
|
|
506
506
|
};
|
|
507
|
-
return r.cache = new (
|
|
507
|
+
return r.cache = new (te.Cache || j)(), r;
|
|
508
508
|
}
|
|
509
|
-
|
|
509
|
+
te.Cache = j;
|
|
510
510
|
var or = 500;
|
|
511
511
|
function ar(t) {
|
|
512
|
-
var e =
|
|
512
|
+
var e = te(t, function(i) {
|
|
513
513
|
return r.size === or && r.clear(), i;
|
|
514
514
|
}), r = e.cache;
|
|
515
515
|
return e;
|
|
@@ -524,11 +524,11 @@ function cr(t) {
|
|
|
524
524
|
return t == null ? "" : Me(t);
|
|
525
525
|
}
|
|
526
526
|
function Ee(t, e) {
|
|
527
|
-
return
|
|
527
|
+
return A(t) ? t : $t(t, e) ? [t] : fr(cr(t));
|
|
528
528
|
}
|
|
529
529
|
var dr = 1 / 0;
|
|
530
530
|
function Re(t) {
|
|
531
|
-
if (typeof t == "string" ||
|
|
531
|
+
if (typeof t == "string" || k(t))
|
|
532
532
|
return t;
|
|
533
533
|
var e = t + "";
|
|
534
534
|
return e == "0" && 1 / t == -dr ? "-0" : e;
|
|
@@ -539,12 +539,12 @@ function pr(t, e) {
|
|
|
539
539
|
t = t[Re(e[r++])];
|
|
540
540
|
return r && r == i ? t : void 0;
|
|
541
541
|
}
|
|
542
|
-
function
|
|
542
|
+
function L(t, e, r) {
|
|
543
543
|
var i = t == null ? void 0 : pr(t, e);
|
|
544
544
|
return i === void 0 ? r : i;
|
|
545
545
|
}
|
|
546
546
|
function hr(t, e, r, i) {
|
|
547
|
-
if (!
|
|
547
|
+
if (!G(t))
|
|
548
548
|
return t;
|
|
549
549
|
e = Ee(e, t);
|
|
550
550
|
for (var s = -1, n = e.length, a = n - 1, l = t; l != null && ++s < n; ) {
|
|
@@ -553,13 +553,13 @@ function hr(t, e, r, i) {
|
|
|
553
553
|
return t;
|
|
554
554
|
if (s != a) {
|
|
555
555
|
var p = l[f];
|
|
556
|
-
d = i ? i(p, f, l) : void 0, d === void 0 && (d =
|
|
556
|
+
d = i ? i(p, f, l) : void 0, d === void 0 && (d = G(p) ? p : Ft(e[s + 1]) ? [] : {});
|
|
557
557
|
}
|
|
558
558
|
xt(l, f, d), l = l[f];
|
|
559
559
|
}
|
|
560
560
|
return t;
|
|
561
561
|
}
|
|
562
|
-
function
|
|
562
|
+
function D(t, e, r) {
|
|
563
563
|
return t == null ? t : hr(t, e, r);
|
|
564
564
|
}
|
|
565
565
|
class mr {
|
|
@@ -574,8 +574,8 @@ class mr {
|
|
|
574
574
|
u(this, "componentPropsPreset", I.componentPropsPreset);
|
|
575
575
|
u(this, "stableUpdaterProcessProgress");
|
|
576
576
|
u(this, "stableUpdaterTimes", 0);
|
|
577
|
-
u(this, "schemaEffect", new
|
|
578
|
-
u(this, "defaultValueEffect", new
|
|
577
|
+
u(this, "schemaEffect", new Z());
|
|
578
|
+
u(this, "defaultValueEffect", new Z());
|
|
579
579
|
u(this, "defaultValueInprogressMap", /* @__PURE__ */ new Map());
|
|
580
580
|
u(this, "baseDefaultValueFunctionsLength");
|
|
581
581
|
u(this, "isModelInitialized", !0);
|
|
@@ -756,13 +756,13 @@ class mr {
|
|
|
756
756
|
}
|
|
757
757
|
promiseFieldParser(e, r, i, s) {
|
|
758
758
|
o.isPromise(e) ? e.then((n) => {
|
|
759
|
-
o.isString(n) && (n =
|
|
759
|
+
o.isString(n) && (n = Y(n, "")), i && o.isObject(n) && !o.isNativeObject(n) ? this.objectParser({
|
|
760
760
|
data: n,
|
|
761
761
|
updater: r,
|
|
762
762
|
index: s.rootIndex,
|
|
763
763
|
parentMeta: s.parentMeta
|
|
764
764
|
}) : r(n);
|
|
765
|
-
}) : (o.isString(e) && (e =
|
|
765
|
+
}) : (o.isString(e) && (e = Y(e, "")), i && o.isObject(e) && !o.isNativeObject(e) ? this.objectParser({
|
|
766
766
|
data: e,
|
|
767
767
|
updater: r,
|
|
768
768
|
index: s.rootIndex,
|
|
@@ -789,7 +789,7 @@ class mr {
|
|
|
789
789
|
e.name.startsWith("__proform_onetime_") && (e.__proform_cached_result = n), this.promiseFieldParser(n, r, s, i);
|
|
790
790
|
}
|
|
791
791
|
else
|
|
792
|
-
|
|
792
|
+
q(e) ? _(
|
|
793
793
|
() => e.value,
|
|
794
794
|
() => {
|
|
795
795
|
o.isUndefined(e.value) || (s && o.isObject(e.value) && !o.isNativeObject(e.value) ? this.objectParser({
|
|
@@ -803,7 +803,7 @@ class mr {
|
|
|
803
803
|
immediate: !0,
|
|
804
804
|
deep: !0
|
|
805
805
|
}
|
|
806
|
-
) :
|
|
806
|
+
) : U(e) ? _(
|
|
807
807
|
() => e,
|
|
808
808
|
() => {
|
|
809
809
|
o.isUndefined(e) || (s && o.isObject(e) && !o.isNativeObject(e) ? this.objectParser({
|
|
@@ -830,7 +830,7 @@ class mr {
|
|
|
830
830
|
), o.isObjectEmpty(this.stableModel) && this.stableUpdaterProcessProgress.every(Boolean) && this.defaultValueEffect.effects.size === 0 && (this.stableModel = P(this.processedModel.value), this.runtimeCore.hydrateEffect.triggerEffects(), this.runtimeCore.hydrateEffect.clearEffects());
|
|
831
831
|
}
|
|
832
832
|
setModel(e, r, i) {
|
|
833
|
-
o.isFunction(r) ?
|
|
833
|
+
o.isFunction(r) ? D(e, r(), i) : e[r] = i;
|
|
834
834
|
}
|
|
835
835
|
createModel(e, r) {
|
|
836
836
|
if (o.isListSchema(e) && (r[e.field] || this.setModel(r, e.field, [{}]), e.children.forEach((i) => {
|
|
@@ -841,7 +841,7 @@ class mr {
|
|
|
841
841
|
if ("defaultValue" in e)
|
|
842
842
|
this.setModel(r, e.field, e.defaultValue);
|
|
843
843
|
else {
|
|
844
|
-
if (o.isFunction(e.field) &&
|
|
844
|
+
if (o.isFunction(e.field) && L(r, e.field()))
|
|
845
845
|
return;
|
|
846
846
|
if (o.isString(e.field) && r[e.field])
|
|
847
847
|
return;
|
|
@@ -908,19 +908,19 @@ function gr(t) {
|
|
|
908
908
|
}
|
|
909
909
|
class vr {
|
|
910
910
|
constructor(e) {
|
|
911
|
-
u(this, "schemas",
|
|
912
|
-
u(this, "model",
|
|
911
|
+
u(this, "schemas", z([]));
|
|
912
|
+
u(this, "model", z({}));
|
|
913
913
|
u(this, "processorBySchemaType", {
|
|
914
914
|
item: this.runtimeItemProcessor.bind(this),
|
|
915
915
|
group: this.runtimeGroupProcessor.bind(this),
|
|
916
916
|
list: this.runtimeListProcessor.bind(this)
|
|
917
917
|
});
|
|
918
|
-
u(this, "formRef",
|
|
919
|
-
u(this, "hydrateEffect", new
|
|
920
|
-
u(this, "native",
|
|
918
|
+
u(this, "formRef", z(null));
|
|
919
|
+
u(this, "hydrateEffect", new Z());
|
|
920
|
+
u(this, "native", K({}));
|
|
921
921
|
u(this, "grid", {});
|
|
922
922
|
u(this, "runtime", {});
|
|
923
|
-
u(this, "globalNativeFormOverride",
|
|
923
|
+
u(this, "globalNativeFormOverride", K({
|
|
924
924
|
props: {
|
|
925
925
|
Form: {},
|
|
926
926
|
FormItem: {}
|
|
@@ -930,10 +930,10 @@ class vr {
|
|
|
930
930
|
FormItem: {}
|
|
931
931
|
}
|
|
932
932
|
}));
|
|
933
|
-
u(this, "shared",
|
|
933
|
+
u(this, "shared", K({}));
|
|
934
934
|
this.setup = e, this.processor = new mr(this);
|
|
935
935
|
const r = this.setup(this);
|
|
936
|
-
if (this.ui = r.ui ?? c.presets.ui, this.runtimeAdapter = new br(this.ui), Object.assign(this.globalNativeFormOverride, this.runtimeAdapter.getRuntimeNative()),
|
|
936
|
+
if (this.ui = r.ui ?? c.presets.ui, this.runtimeAdapter = new br(this.ui), Object.assign(this.globalNativeFormOverride, this.runtimeAdapter.getRuntimeNative()), q(r.schemas))
|
|
937
937
|
_(
|
|
938
938
|
// @ts-expect-error
|
|
939
939
|
() => r.schemas.value,
|
|
@@ -944,7 +944,7 @@ class vr {
|
|
|
944
944
|
deep: !0
|
|
945
945
|
}
|
|
946
946
|
);
|
|
947
|
-
else if (
|
|
947
|
+
else if (U(r.schemas)) {
|
|
948
948
|
const i = _(() => r.schemas, () => {
|
|
949
949
|
this.processor.parseSchemas(r.schemas), O(() => {
|
|
950
950
|
i();
|
|
@@ -963,14 +963,14 @@ class vr {
|
|
|
963
963
|
// share 增加防抖,当开发者在过程中进行 share 时避免频繁触发爆栈
|
|
964
964
|
share: (r) => {
|
|
965
965
|
Object.keys(r).forEach((i) => {
|
|
966
|
-
|
|
966
|
+
q(r[i]) ? _(() => r[i].value, () => {
|
|
967
967
|
h(this.shared, {
|
|
968
968
|
[i]: r[i].value
|
|
969
969
|
});
|
|
970
970
|
}, {
|
|
971
971
|
deep: !0,
|
|
972
972
|
immediate: !0
|
|
973
|
-
}) :
|
|
973
|
+
}) : U(r[i]) ? _(() => r[i], () => {
|
|
974
974
|
h(this.shared, {
|
|
975
975
|
[i]: r[i]
|
|
976
976
|
});
|
|
@@ -985,16 +985,16 @@ class vr {
|
|
|
985
985
|
};
|
|
986
986
|
}
|
|
987
987
|
runtimeItemProcessor(e, r, i = this.model.value, s) {
|
|
988
|
-
var se, ne, oe, ae, le, ue, fe, ce, de, pe, he, me, be, ge, ve, ye
|
|
988
|
+
var ie, se, ne, oe, ae, le, ue, fe, ce, de, pe, he, me, be, ge, ve, ye;
|
|
989
989
|
const n = x(e.component);
|
|
990
990
|
if (!n)
|
|
991
991
|
return;
|
|
992
|
-
(
|
|
993
|
-
const a = h(P((
|
|
992
|
+
(se = (ie = e.native) == null ? void 0 : ie.props) != null && se.Form && h(this.globalNativeFormOverride.props.Form, (oe = (ne = e.native) == null ? void 0 : ne.props) == null ? void 0 : oe.Form), (le = (ae = e.native) == null ? void 0 : ae.slots) != null && le.Form && h(this.globalNativeFormOverride.slots.Form, (fe = (ue = e.native) == null ? void 0 : ue.slots) == null ? void 0 : fe.Form);
|
|
993
|
+
const a = h(P((de = (ce = this.native) == null ? void 0 : ce.slots) == null ? void 0 : de.FormItem) ?? {}, (he = (pe = e.native) == null ? void 0 : pe.slots) == null ? void 0 : he.FormItem), l = {
|
|
994
994
|
display: "grid",
|
|
995
995
|
gridColumn: "1 / -1",
|
|
996
996
|
...e.grid
|
|
997
|
-
}, f = h(P((
|
|
997
|
+
}, f = h(P((be = (me = this.native) == null ? void 0 : me.props) == null ? void 0 : be.FormItem) ?? {}, (ve = (ge = e.native) == null ? void 0 : ge.props) == null ? void 0 : ve.FormItem), d = this.runtimeAdapter.getRuntimeField({
|
|
998
998
|
schema: e,
|
|
999
999
|
parentSchema: s,
|
|
1000
1000
|
index: r
|
|
@@ -1002,11 +1002,11 @@ class vr {
|
|
|
1002
1002
|
let C = e.placeholder, y = e.show;
|
|
1003
1003
|
y === void 0 && (y = !0);
|
|
1004
1004
|
let g = e.label ?? "", S;
|
|
1005
|
-
if (e.runtime ? S = e.runtime : S = (s == null ? void 0 : s.runtime) ?? this.runtime, !o.isUndefined(r) && !o.isObjectEmpty(S) && (g =
|
|
1005
|
+
if (e.runtime ? S = e.runtime : S = (s == null ? void 0 : s.runtime) ?? this.runtime, !o.isUndefined(r) && !o.isObjectEmpty(S) && (g = Y((ye = S == null ? void 0 : S.customizeListItemLabel) == null ? void 0 : ye.call(S, e.label ?? "", r + 1), "")), !C) {
|
|
1006
1006
|
let $ = "请输入";
|
|
1007
1007
|
o.isUndefined(p) ? C = `${$}${g}` : /* @ts-expect-error */ v[p.toLowerCase()] ? ($ = // @ts-expect-error
|
|
1008
|
-
v[p.toLowerCase()], C = `${$}${g}`) : (Object.keys(v).forEach((
|
|
1009
|
-
p.toLowerCase().includes(
|
|
1008
|
+
v[p.toLowerCase()], C = `${$}${g}`) : (Object.keys(v).forEach((_e) => {
|
|
1009
|
+
p.toLowerCase().includes(_e.toLowerCase()) && ($ = v[_e]);
|
|
1010
1010
|
}), C = `${$}${g}`);
|
|
1011
1011
|
}
|
|
1012
1012
|
const $e = this.runtimeAdapter.getRuntimeRequired({
|
|
@@ -1019,7 +1019,7 @@ class vr {
|
|
|
1019
1019
|
show: y
|
|
1020
1020
|
}, {
|
|
1021
1021
|
default() {
|
|
1022
|
-
return y && b(Ne,
|
|
1022
|
+
return y && b(Ne, N(f, {
|
|
1023
1023
|
label: `${g ? `${g}:` : ""}`
|
|
1024
1024
|
}, d, $e), {
|
|
1025
1025
|
default() {
|
|
@@ -1117,7 +1117,7 @@ class vr {
|
|
|
1117
1117
|
gridAutoColumns: "1fr",
|
|
1118
1118
|
...this.grid
|
|
1119
1119
|
}, r = this, i = h(this.globalNativeFormOverride.props.Form, P((f = (l = this.native) == null ? void 0 : l.props) == null ? void 0 : f.Form) ?? {}), s = h(this.globalNativeFormOverride.slots.Form, P((p = (d = this.native) == null ? void 0 : d.slots) == null ? void 0 : p.Form) ?? {}), n = w.getFormContainer(this), a = this.runtimeAdapter.getFormModelPropName();
|
|
1120
|
-
return b(n,
|
|
1120
|
+
return b(n, N(i, {
|
|
1121
1121
|
ref: this.formRef
|
|
1122
1122
|
}, {
|
|
1123
1123
|
[a]: this.model.value
|
|
@@ -1142,7 +1142,7 @@ class c {
|
|
|
1142
1142
|
}
|
|
1143
1143
|
}
|
|
1144
1144
|
u(c, "presets");
|
|
1145
|
-
function
|
|
1145
|
+
function X({
|
|
1146
1146
|
parentSchema: t,
|
|
1147
1147
|
schema: e,
|
|
1148
1148
|
index: r
|
|
@@ -1152,7 +1152,7 @@ function Y({
|
|
|
1152
1152
|
const yr = {
|
|
1153
1153
|
ArcoVue: {
|
|
1154
1154
|
getRuntimeField(t) {
|
|
1155
|
-
const e =
|
|
1155
|
+
const e = X(t);
|
|
1156
1156
|
return o.isFunction(e) ? {
|
|
1157
1157
|
field: e()
|
|
1158
1158
|
} : {
|
|
@@ -1197,10 +1197,10 @@ const yr = {
|
|
|
1197
1197
|
props: n
|
|
1198
1198
|
}) {
|
|
1199
1199
|
let a;
|
|
1200
|
-
return o.isFunction(r.field) ? a =
|
|
1200
|
+
return o.isFunction(r.field) ? a = L(e, r.field()) : a = e[r.field], b(t, N({
|
|
1201
1201
|
modelValue: a,
|
|
1202
1202
|
"onUpdate:modelValue": (l) => {
|
|
1203
|
-
o.isFunction(r.field) ?
|
|
1203
|
+
o.isFunction(r.field) ? D(e, r.field(), l) : e[r.field] = l;
|
|
1204
1204
|
},
|
|
1205
1205
|
placeholder: i
|
|
1206
1206
|
}, n), {
|
|
@@ -1219,7 +1219,7 @@ const yr = {
|
|
|
1219
1219
|
},
|
|
1220
1220
|
NutUI: {
|
|
1221
1221
|
getRuntimeField(t) {
|
|
1222
|
-
const e =
|
|
1222
|
+
const e = X(t);
|
|
1223
1223
|
return o.isFunction(e) ? {
|
|
1224
1224
|
prop: e()
|
|
1225
1225
|
} : {
|
|
@@ -1265,10 +1265,10 @@ const yr = {
|
|
|
1265
1265
|
props: n
|
|
1266
1266
|
}) {
|
|
1267
1267
|
let a;
|
|
1268
|
-
return o.isFunction(r.field) ? a =
|
|
1268
|
+
return o.isFunction(r.field) ? a = L(e, r.field()) : a = e[r.field], b(t, N({
|
|
1269
1269
|
modelValue: a,
|
|
1270
1270
|
"onUpdate:modelValue": (l) => {
|
|
1271
|
-
o.isFunction(r.field) ?
|
|
1271
|
+
o.isFunction(r.field) ? D(e, r.field(), l) : e[r.field] = l;
|
|
1272
1272
|
},
|
|
1273
1273
|
placeholder: i
|
|
1274
1274
|
}, n), {
|
|
@@ -1292,7 +1292,7 @@ const yr = {
|
|
|
1292
1292
|
},
|
|
1293
1293
|
NaiveUI: {
|
|
1294
1294
|
getRuntimeField(t) {
|
|
1295
|
-
const e =
|
|
1295
|
+
const e = X(t);
|
|
1296
1296
|
return o.isFunction(e) ? {
|
|
1297
1297
|
path: e()
|
|
1298
1298
|
} : {
|
|
@@ -1340,10 +1340,10 @@ const yr = {
|
|
|
1340
1340
|
props: n
|
|
1341
1341
|
}) {
|
|
1342
1342
|
let a;
|
|
1343
|
-
return o.isFunction(r.field) ? a =
|
|
1343
|
+
return o.isFunction(r.field) ? a = L(e, r.field()) : a = e[r.field], b(t, N({
|
|
1344
1344
|
value: a,
|
|
1345
1345
|
"onUpdate:value": (l) => {
|
|
1346
|
-
o.isFunction(r.field) ?
|
|
1346
|
+
o.isFunction(r.field) ? D(e, r.field(), l) : e[r.field] = l;
|
|
1347
1347
|
},
|
|
1348
1348
|
placeholder: i
|
|
1349
1349
|
}, n), {
|
|
@@ -1425,9 +1425,9 @@ u(M, "schemaPreset", {
|
|
|
1425
1425
|
}
|
|
1426
1426
|
}), // 基于基本功能提出基本预设
|
|
1427
1427
|
u(M, "placeholderPresetByComponentName", M.getPlaceholderPrefixPresetByComponentName());
|
|
1428
|
-
let
|
|
1428
|
+
let J = M;
|
|
1429
1429
|
const I = {
|
|
1430
|
-
...
|
|
1430
|
+
...J,
|
|
1431
1431
|
adapters: {
|
|
1432
1432
|
...yr
|
|
1433
1433
|
}
|
|
@@ -1459,7 +1459,7 @@ function Cr(t) {
|
|
|
1459
1459
|
function Sr(t) {
|
|
1460
1460
|
c.presets = t;
|
|
1461
1461
|
}
|
|
1462
|
-
function
|
|
1462
|
+
function re(t, e) {
|
|
1463
1463
|
return e === "native" && Object.defineProperty(t, "name", {
|
|
1464
1464
|
value: `__proform_raw_${t.name}`,
|
|
1465
1465
|
writable: !0
|
|
@@ -1472,19 +1472,19 @@ function ie(t, e) {
|
|
|
1472
1472
|
}), t;
|
|
1473
1473
|
}
|
|
1474
1474
|
function Or(t) {
|
|
1475
|
-
return
|
|
1475
|
+
return re(t, "native");
|
|
1476
1476
|
}
|
|
1477
1477
|
function Fr(t) {
|
|
1478
1478
|
return t.__proform_raw_object = !0, t;
|
|
1479
1479
|
}
|
|
1480
1480
|
function jr(t) {
|
|
1481
|
-
return
|
|
1481
|
+
return re(t, "onetime");
|
|
1482
1482
|
}
|
|
1483
1483
|
function wr(t) {
|
|
1484
1484
|
function e() {
|
|
1485
1485
|
return t;
|
|
1486
1486
|
}
|
|
1487
|
-
return
|
|
1487
|
+
return re(
|
|
1488
1488
|
e,
|
|
1489
1489
|
"structured_path_parsing_mark"
|
|
1490
1490
|
);
|
|
@@ -1497,5 +1497,5 @@ export {
|
|
|
1497
1497
|
wr as markStructuredPathParsing,
|
|
1498
1498
|
Cr as useForm,
|
|
1499
1499
|
Sr as useFormPresetConfigurer,
|
|
1500
|
-
|
|
1500
|
+
re as useModifiers
|
|
1501
1501
|
};
|