@harbor-design/proform 1.2.24 → 1.2.26

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