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