@harbor-design/proform 1.3.13 → 1.3.14

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.
Files changed (2) hide show
  1. package/dist/index.js +118 -136
  2. 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 Pe, nextTick as P, isRef as q, watch as _, isReactive as U, toRaw as x, reactive as H, createVNode as y, mergeProps as N, withDirectives as Le, vShow as De, createTextVNode as Ge, isVNode as Be, defineComponent as ke } from "vue";
4
+ import { ref as z, readonly as Pe, nextTick as O, isRef as q, watch as _, isReactive as U, toRaw as x, reactive as H, createVNode as y, 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);
@@ -80,7 +80,7 @@ function h(t, ...e) {
80
80
  r.hasOwnProperty(i) && (typeof r[i] == "object" && r[i] !== null ? t[i] = h(t[i] || {}, r[i]) : t[i] = r[i]);
81
81
  }), t;
82
82
  }
83
- function I(t) {
83
+ function P(t) {
84
84
  const e = /* @__PURE__ */ new WeakMap();
85
85
  function r(i) {
86
86
  if (i === null || typeof i != "object")
@@ -138,11 +138,11 @@ class He {
138
138
  }
139
139
  submit() {
140
140
  var i;
141
- const e = (i = f.getPreset(this.runtimeCore.ui)) == null ? void 0 : i.adapter, r = C.adapters[f.getUI(this.runtimeCore.ui)];
141
+ const e = (i = c.getPreset(this.runtimeCore.ui)) == null ? void 0 : i.adapter, r = I.adapters[c.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) {
145
- P(() => {
145
+ O(() => {
146
146
  this.runtimeCore.hydrateEffect.trackEffect(
147
147
  () => {
148
148
  q(e) ? _(
@@ -172,45 +172,36 @@ class He {
172
172
  });
173
173
  }
174
174
  share(e) {
175
- P(() => {
176
- if (q(e)) {
177
- const r = _(
178
- () => e.value,
179
- () => {
180
- h(this.runtimeCore.shared, e.value), P(() => {
181
- r();
182
- });
183
- },
184
- {
185
- deep: !0,
186
- immediate: !0
187
- }
188
- );
189
- } else if (U(e)) {
190
- const r = _(
191
- () => e,
192
- () => {
193
- h(this.runtimeCore.shared, e), P(() => {
194
- r();
195
- });
196
- },
197
- {
198
- deep: !0,
199
- immediate: !0
200
- }
201
- );
202
- } else
203
- h(this.runtimeCore.shared, e);
175
+ O(() => {
176
+ q(e) ? _(
177
+ () => e.value,
178
+ () => {
179
+ h(this.runtimeCore.shared, e.value);
180
+ },
181
+ {
182
+ deep: !0,
183
+ immediate: !0
184
+ }
185
+ ) : U(e) ? _(
186
+ () => e,
187
+ () => {
188
+ h(this.runtimeCore.shared, e);
189
+ },
190
+ {
191
+ deep: !0,
192
+ immediate: !0
193
+ }
194
+ ) : h(this.runtimeCore.shared, e);
204
195
  });
205
196
  }
206
197
  subscribeModel(e) {
207
- P(() => {
198
+ O(() => {
208
199
  const r = _(
209
200
  () => this.readonlyReactiveModel.value,
210
201
  (i) => {
211
202
  e(i, {
212
203
  stopSubscribe() {
213
- P(() => {
204
+ O(() => {
214
205
  r();
215
206
  });
216
207
  }
@@ -225,7 +216,7 @@ class He {
225
216
  }
226
217
  resetModel() {
227
218
  var e;
228
- (e = this.runtimeCore) != null && e.model.value && (this.runtimeCore.model.value = I(
219
+ (e = this.runtimeCore) != null && e.model.value && (this.runtimeCore.model.value = P(
229
220
  this.runtimeCore.processor.stableModel
230
221
  ), this.readonlyReactiveModel.value = Pe(this.runtimeCore.model.value), this.runtimeCore.runtimeAdapter.clearValidate(this.runtimeCore));
231
222
  }
@@ -249,7 +240,7 @@ class Y {
249
240
  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);
250
241
  }
251
242
  }
252
- var We = typeof global == "object" && global && global.Object === Object && global, Ke = typeof self == "object" && self && self.Object === Object && self, J = We || Ke || Function("return this")(), E = J.Symbol, je = Object.prototype, Xe = je.hasOwnProperty, Ye = je.toString, V = E ? E.toStringTag : void 0;
243
+ var Ke = typeof global == "object" && global && global.Object === Object && global, We = typeof self == "object" && self && self.Object === Object && self, J = Ke || We || Function("return this")(), E = J.Symbol, je = Object.prototype, Xe = je.hasOwnProperty, Ye = je.toString, V = E ? E.toStringTag : void 0;
253
244
  function Ze(t) {
254
245
  var e = Xe.call(t, V), r = t[V];
255
246
  try {
@@ -296,17 +287,17 @@ function G(t) {
296
287
  return t != null && (e == "object" || e == "function");
297
288
  }
298
289
  var ot = "[object AsyncFunction]", at = "[object Function]", lt = "[object GeneratorFunction]", ut = "[object Proxy]";
299
- function ct(t) {
290
+ function ft(t) {
300
291
  if (!G(t))
301
292
  return !1;
302
293
  var e = we(t);
303
294
  return e == at || e == lt || e == ot || e == ut;
304
295
  }
305
- var W = J["__core-js_shared__"], Oe = function() {
306
- var t = /[^.]+$/.exec(W && W.keys && W.keys.IE_PROTO || "");
296
+ var K = J["__core-js_shared__"], Oe = function() {
297
+ var t = /[^.]+$/.exec(K && K.keys && K.keys.IE_PROTO || "");
307
298
  return t ? "Symbol(src)_1." + t : "";
308
299
  }();
309
- function ft(t) {
300
+ function ct(t) {
310
301
  return !!Oe && Oe in t;
311
302
  }
312
303
  var dt = Function.prototype, pt = dt.toString;
@@ -327,9 +318,9 @@ var mt = /[\\^$.*+?()[\]{}|]/g, yt = /^\[object .+?Constructor\]$/, bt = Functio
327
318
  "^" + vt.call(_t).replace(mt, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
328
319
  );
329
320
  function It(t) {
330
- if (!G(t) || ft(t))
321
+ if (!G(t) || ct(t))
331
322
  return !1;
332
- var e = ct(t) ? Pt : yt;
323
+ var e = ft(t) ? Pt : yt;
333
324
  return e.test(ht(t));
334
325
  }
335
326
  function Ct(t, e) {
@@ -421,13 +412,13 @@ function B(t, e) {
421
412
  return r;
422
413
  return -1;
423
414
  }
424
- var Wt = Array.prototype, Kt = Wt.splice;
415
+ var Kt = Array.prototype, Wt = Kt.splice;
425
416
  function Xt(t) {
426
417
  var e = this.__data__, r = B(e, t);
427
418
  if (r < 0)
428
419
  return !1;
429
420
  var i = e.length - 1;
430
- return r == i ? e.pop() : Kt.call(e, r, 1), --this.size, !0;
421
+ return r == i ? e.pop() : Wt.call(e, r, 1), --this.size, !0;
431
422
  }
432
423
  function Yt(t) {
433
424
  var e = this.__data__, r = B(e, t);
@@ -515,17 +506,17 @@ function ar(t) {
515
506
  }), r = e.cache;
516
507
  return e;
517
508
  }
518
- var lr = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, ur = /\\(\\)?/g, cr = ar(function(t) {
509
+ var lr = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, ur = /\\(\\)?/g, fr = ar(function(t) {
519
510
  var e = [];
520
511
  return t.charCodeAt(0) === 46 && e.push(""), t.replace(lr, function(r, i, s, n) {
521
512
  e.push(s ? n.replace(ur, "$1") : i || r);
522
513
  }), e;
523
514
  });
524
- function fr(t) {
515
+ function cr(t) {
525
516
  return t == null ? "" : Me(t);
526
517
  }
527
518
  function Ee(t, e) {
528
- return A(t) ? t : $t(t, e) ? [t] : cr(fr(t));
519
+ return A(t) ? t : $t(t, e) ? [t] : fr(cr(t));
529
520
  }
530
521
  var dr = 1 / 0;
531
522
  function Re(t) {
@@ -549,14 +540,14 @@ function hr(t, e, r, i) {
549
540
  return t;
550
541
  e = Ee(e, t);
551
542
  for (var s = -1, n = e.length, a = n - 1, l = t; l != null && ++s < n; ) {
552
- var c = Re(e[s]), d = r;
553
- if (c === "__proto__" || c === "constructor" || c === "prototype")
543
+ var f = Re(e[s]), d = r;
544
+ if (f === "__proto__" || f === "constructor" || f === "prototype")
554
545
  return t;
555
546
  if (s != a) {
556
- var p = l[c];
557
- d = i ? i(p, c, l) : void 0, d === void 0 && (d = G(p) ? p : Ft(e[s + 1]) ? [] : {});
547
+ var p = l[f];
548
+ d = i ? i(p, f, l) : void 0, d === void 0 && (d = G(p) ? p : Ft(e[s + 1]) ? [] : {});
558
549
  }
559
- xt(l, c, d), l = l[c];
550
+ xt(l, f, d), l = l[f];
560
551
  }
561
552
  return t;
562
553
  }
@@ -571,8 +562,8 @@ class mr {
571
562
  u(this, "getRuntimeMeta");
572
563
  u(this, "stableSchemas", []);
573
564
  u(this, "stableModel", {});
574
- u(this, "schemaPreset", C.schemaPreset);
575
- u(this, "componentPropsPreset", C.componentPropsPreset);
565
+ u(this, "schemaPreset", I.schemaPreset);
566
+ u(this, "componentPropsPreset", I.componentPropsPreset);
576
567
  u(this, "stableUpdaterProcessProgress");
577
568
  u(this, "stableUpdaterTimes", 0);
578
569
  u(this, "schemaEffect", new Y());
@@ -618,7 +609,7 @@ class mr {
618
609
  // 派生过程,用于外部应用
619
610
  parseSchemas(e, r) {
620
611
  o.isArrayEmpty(this.processedSchemas.value) && (this.baseDefaultValueFunctionsLength = this.countFunctionDefaultValues(
621
- I(e)
612
+ P(e)
622
613
  ), this.processedSchemas.value = this.initSchemas(e)), this.parse(e, r);
623
614
  }
624
615
  parseStable(e) {
@@ -645,17 +636,17 @@ class mr {
645
636
  }).fill(!1);
646
637
  this.objectParser({ data: e, index: r, updater: a, parentMeta: i });
647
638
  function a(l) {
648
- const c = l.index, d = l.key, p = l.keyIndex;
639
+ const f = l.index, d = l.key, p = l.keyIndex;
649
640
  if (o.isUndefined(l.stable))
650
641
  return;
651
- const m = s.parseStable(l.stable), g = i == null ? void 0 : i.index, S = i == null ? void 0 : i.key;
642
+ const m = s.parseStable(l.stable), g = i == null ? void 0 : i.index, C = i == null ? void 0 : i.key;
652
643
  let v = m;
653
644
  if (o.isProcessInprogress(v) || (n[p] = !0), i) {
654
- const b = s.processedSchemas.value[g][S][c][d];
655
- b && o.isObject(b) && d !== "component" && (v = h(b, v)), s.processedSchemas.value[g][S][c][d] = v, s.stableUpdater(n);
645
+ const b = s.processedSchemas.value[g][C][f][d];
646
+ b && o.isObject(b) && d !== "component" && (v = h(b, v)), s.processedSchemas.value[g][C][f][d] = v, s.stableUpdater(n);
656
647
  } else {
657
- const b = s.processedSchemas.value[c][d];
658
- b && o.isObject(b) && d !== "component" && (v = h(b, v)), s.processedSchemas.value[c][d] = v, s.stableUpdater(n);
648
+ const b = s.processedSchemas.value[f][d];
649
+ b && o.isObject(b) && d !== "component" && (v = h(b, v)), s.processedSchemas.value[f][d] = v, s.stableUpdater(n);
659
650
  }
660
651
  }
661
652
  }
@@ -671,7 +662,7 @@ class mr {
671
662
  keyIndex: n
672
663
  });
673
664
  else {
674
- const c = (d) => {
665
+ const f = (d) => {
675
666
  e.updater({
676
667
  ...e,
677
668
  key: s,
@@ -683,12 +674,12 @@ class mr {
683
674
  () => {
684
675
  if (s === "component") {
685
676
  const d = r[s](this.getRuntimeMeta());
686
- this.promiseFieldParser(d, c, !1, {
677
+ this.promiseFieldParser(d, f, !1, {
687
678
  rootIndex: e.index,
688
679
  parentMeta: e.parentMeta
689
680
  });
690
681
  } else
691
- this.fieldParser(r[s], c, {
682
+ this.fieldParser(r[s], f, {
692
683
  rootIndex: e.index,
693
684
  parentMeta: e.parentMeta
694
685
  });
@@ -705,15 +696,15 @@ class mr {
705
696
  r[s],
706
697
  (p) => {
707
698
  if (!p)
708
- return c(p);
699
+ return f(p);
709
700
  this.defaultValueInprogressMap.set(r[s], p), !o.isProcessInprogress(p) && this.defaultValueInprogressMap.size === this.baseDefaultValueFunctionsLength && Array.from(
710
701
  this.defaultValueInprogressMap.values()
711
702
  ).every((m) => {
712
703
  var g;
713
704
  return !((g = m == null ? void 0 : m.includes) != null && g.call(m, "undefined"));
714
- }) ? (c(p), this.defaultValueEffect.clearEffects(), P(() => {
705
+ }) ? (f(p), this.defaultValueEffect.clearEffects(), O(() => {
715
706
  d();
716
- })) : c(p);
707
+ })) : f(p);
717
708
  },
718
709
  {
719
710
  rootIndex: e.index,
@@ -727,9 +718,9 @@ class mr {
727
718
  ).every((m) => {
728
719
  var g;
729
720
  return !((g = m == null ? void 0 : m.includes) != null && g.call(m, "undefined"));
730
- }) ? (c(p), this.defaultValueEffect.clearEffects(), P(() => {
721
+ }) ? (f(p), this.defaultValueEffect.clearEffects(), O(() => {
731
722
  d();
732
- })) : c(p);
723
+ })) : f(p);
733
724
  },
734
725
  {
735
726
  rootIndex: e.index,
@@ -745,10 +736,10 @@ class mr {
745
736
  {
746
737
  lazy: !1
747
738
  }
748
- ) : s === "component" || s === "slots" || s === "runtime" ? this.promiseFieldParser(r[s], c, !1, {
739
+ ) : s === "component" || s === "slots" || s === "runtime" ? this.promiseFieldParser(r[s], f, !1, {
749
740
  rootIndex: e.index,
750
741
  parentMeta: e.parentMeta
751
- }) : this.fieldParser(r[s], c, {
742
+ }) : this.fieldParser(r[s], f, {
752
743
  rootIndex: e.index,
753
744
  parentMeta: e.parentMeta
754
745
  });
@@ -828,7 +819,7 @@ class mr {
828
819
  modelProcessor(e) {
829
820
  e.map(
830
821
  (r) => this.createModel(r, this.processedModel.value)
831
- ), o.isObjectEmpty(this.stableModel) && this.stableUpdaterProcessProgress.every(Boolean) && this.defaultValueEffect.effects.size === 0 && (this.stableModel = I(this.processedModel.value), this.runtimeCore.hydrateEffect.triggerEffects(), this.runtimeCore.hydrateEffect.clearEffects());
822
+ ), o.isObjectEmpty(this.stableModel) && this.stableUpdaterProcessProgress.every(Boolean) && this.defaultValueEffect.effects.size === 0 && (this.stableModel = P(this.processedModel.value), this.runtimeCore.hydrateEffect.triggerEffects(), this.runtimeCore.hydrateEffect.clearEffects());
832
823
  }
833
824
  setModel(e, r, i) {
834
825
  o.isFunction(r) ? D(e, r(), i) : e[r] = i;
@@ -852,22 +843,22 @@ class mr {
852
843
  }
853
844
  class w {
854
845
  static getFormContainer({ ui: e } = {}) {
855
- return f.presets.uiPresets[e ?? f.presets.ui].container.Form;
846
+ return c.presets.uiPresets[e ?? c.presets.ui].container.Form;
856
847
  }
857
848
  static getFormItemContainer({ ui: e } = {}) {
858
- return f.presets.uiPresets[e ?? f.presets.ui].container.FormItem;
849
+ return c.presets.uiPresets[e ?? c.presets.ui].container.FormItem;
859
850
  }
860
851
  static getItemContainer({ ui: e } = {}) {
861
- return f.presets.uiPresets[e ?? f.presets.ui].container.Item;
852
+ return c.presets.uiPresets[e ?? c.presets.ui].container.Item;
862
853
  }
863
854
  static getGroupContainer({ ui: e } = {}) {
864
- return f.presets.uiPresets[e ?? f.presets.ui].container.Group;
855
+ return c.presets.uiPresets[e ?? c.presets.ui].container.Group;
865
856
  }
866
857
  static getListContainer({ ui: e } = {}) {
867
- return f.presets.uiPresets[e ?? f.presets.ui].container.List;
858
+ return c.presets.uiPresets[e ?? c.presets.ui].container.List;
868
859
  }
869
860
  static getListItemContainer({ ui: e } = {}) {
870
- return f.presets.uiPresets[e ?? f.presets.ui].container.ListItem;
861
+ return c.presets.uiPresets[e ?? c.presets.ui].container.ListItem;
871
862
  }
872
863
  }
873
864
  class yr {
@@ -876,31 +867,31 @@ class yr {
876
867
  }
877
868
  getRuntimeNative() {
878
869
  var r;
879
- return (r = f.presets.uiPresets[this.ui]) == null ? void 0 : r.native;
870
+ return (r = c.presets.uiPresets[this.ui]) == null ? void 0 : r.native;
880
871
  }
881
872
  getRuntimeField(e) {
882
873
  var s;
883
- const r = (s = f.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i = C.adapters[f.getUI(this.ui)];
874
+ const r = (s = c.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i = I.adapters[c.getUI(this.ui)];
884
875
  return (r == null ? void 0 : r.getRuntimeField(e)) ?? (i == null ? void 0 : i.getRuntimeField(e));
885
876
  }
886
877
  getRuntimeRequired(e) {
887
878
  var s;
888
- const r = (s = f.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i = C.adapters[f.getUI(this.ui)];
879
+ const r = (s = c.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i = I.adapters[c.getUI(this.ui)];
889
880
  return (r == null ? void 0 : r.getRuntimeRequired(e)) ?? (i == null ? void 0 : i.getRuntimeRequired(e));
890
881
  }
891
882
  getFormModelPropName() {
892
883
  var i;
893
- const e = (i = f.presets.uiPresets[this.ui]) == null ? void 0 : i.adapter, r = C.adapters[f.getUI(this.ui)];
884
+ const e = (i = c.presets.uiPresets[this.ui]) == null ? void 0 : i.adapter, r = I.adapters[c.getUI(this.ui)];
894
885
  return (e == null ? void 0 : e.getFormModelPropName()) ?? (r == null ? void 0 : r.getFormModelPropName());
895
886
  }
896
887
  formComponentRenderer(e) {
897
888
  var s;
898
- const r = (s = f.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i = C.adapters[f.getUI(this.ui)];
889
+ const r = (s = c.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i = I.adapters[c.getUI(this.ui)];
899
890
  return (r == null ? void 0 : r.formComponentRenderer(e)) ?? (i == null ? void 0 : i.formComponentRenderer(e));
900
891
  }
901
892
  clearValidate(e) {
902
893
  var s;
903
- const r = (s = f.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i = C.adapters[f.getUI(this.ui)];
894
+ const r = (s = c.presets.uiPresets[this.ui]) == null ? void 0 : s.adapter, i = I.adapters[c.getUI(this.ui)];
904
895
  return (r == null ? void 0 : r.clearValidate(e)) ?? (i == null ? void 0 : i.clearValidate(e));
905
896
  }
906
897
  }
@@ -934,7 +925,7 @@ class gr {
934
925
  u(this, "shared", H({}));
935
926
  this.setup = e, this.processor = new mr(this);
936
927
  const r = this.setup(this);
937
- if (this.ui = r.ui ?? f.presets.ui, this.runtimeAdapter = new yr(this.ui), Object.assign(this.globalNativeFormOverride, this.runtimeAdapter.getRuntimeNative()), q(r.schemas))
928
+ if (this.ui = r.ui ?? c.presets.ui, this.runtimeAdapter = new yr(this.ui), Object.assign(this.globalNativeFormOverride, this.runtimeAdapter.getRuntimeNative()), q(r.schemas))
938
929
  _(
939
930
  // @ts-expect-error
940
931
  () => r.schemas.value,
@@ -947,7 +938,7 @@ class gr {
947
938
  );
948
939
  else if (U(r.schemas)) {
949
940
  const i = _(() => r.schemas, () => {
950
- this.processor.parseSchemas(r.schemas), P(() => {
941
+ this.processor.parseSchemas(r.schemas), O(() => {
951
942
  i();
952
943
  });
953
944
  }, {
@@ -958,58 +949,49 @@ class gr {
958
949
  }
959
950
  getRuntimeMeta() {
960
951
  return {
961
- model: x(I(this.model.value)),
952
+ model: x(P(this.model.value)),
962
953
  reactiveModel: this.model.value,
963
954
  shared: this.shared,
964
955
  // share 增加防抖,当开发者在过程中进行 share 时避免频繁触发爆栈
965
956
  share: (r) => {
966
- if (q(r)) {
967
- const i = _(() => r.value, () => {
968
- h(this.shared, r.value), P(() => {
969
- i();
970
- });
971
- }, {
972
- deep: !0,
973
- immediate: !0
974
- });
975
- } else if (U(r)) {
976
- const i = _(() => r, () => {
977
- h(this.shared, r), P(() => {
978
- i();
979
- });
980
- }, {
981
- deep: !0,
982
- immediate: !0
983
- });
984
- } else
957
+ q(r) ? _(() => r.value, () => {
958
+ h(this.shared, r.value);
959
+ }, {
960
+ deep: !0,
961
+ immediate: !0
962
+ }) : U(r) ? _(() => r, () => {
985
963
  h(this.shared, r);
964
+ }, {
965
+ deep: !0,
966
+ immediate: !0
967
+ }) : h(this.shared, r);
986
968
  }
987
969
  };
988
970
  }
989
971
  runtimeItemProcessor(e, r, i = this.model.value, s) {
990
- var ie, se, ne, oe, ae, le, ue, ce, fe, de, pe, he, me, ye, be, ge, ve;
972
+ var ie, se, ne, oe, ae, le, ue, fe, ce, de, pe, he, me, ye, be, ge, ve;
991
973
  const n = x(e.component);
992
974
  if (!n)
993
975
  return;
994
- (se = (ie = e.native) == null ? void 0 : ie.props) != null && se.Form && h(this.globalNativeFormOverride.props.Form, (oe = (ne = e.native) == null ? void 0 : ne.props) == null ? void 0 : oe.Form), (le = (ae = e.native) == null ? void 0 : ae.slots) != null && le.Form && h(this.globalNativeFormOverride.slots.Form, (ce = (ue = e.native) == null ? void 0 : ue.slots) == null ? void 0 : ce.Form);
995
- const a = h(I((de = (fe = this.native) == null ? void 0 : fe.slots) == null ? void 0 : de.FormItem) ?? {}, (he = (pe = e.native) == null ? void 0 : pe.slots) == null ? void 0 : he.FormItem), l = {
976
+ (se = (ie = e.native) == null ? void 0 : ie.props) != null && se.Form && h(this.globalNativeFormOverride.props.Form, (oe = (ne = e.native) == null ? void 0 : ne.props) == null ? void 0 : oe.Form), (le = (ae = e.native) == null ? void 0 : ae.slots) != null && le.Form && h(this.globalNativeFormOverride.slots.Form, (fe = (ue = e.native) == null ? void 0 : ue.slots) == null ? void 0 : fe.Form);
977
+ const a = h(P((de = (ce = this.native) == null ? void 0 : ce.slots) == null ? void 0 : de.FormItem) ?? {}, (he = (pe = e.native) == null ? void 0 : pe.slots) == null ? void 0 : he.FormItem), l = {
996
978
  display: "grid",
997
979
  gridColumn: "1 / -1",
998
980
  ...e.grid
999
- }, c = h(I((ye = (me = this.native) == null ? void 0 : me.props) == null ? void 0 : ye.FormItem) ?? {}, (ge = (be = e.native) == null ? void 0 : be.props) == null ? void 0 : ge.FormItem), d = this.runtimeAdapter.getRuntimeField({
981
+ }, f = h(P((ye = (me = this.native) == null ? void 0 : me.props) == null ? void 0 : ye.FormItem) ?? {}, (ge = (be = e.native) == null ? void 0 : be.props) == null ? void 0 : ge.FormItem), d = this.runtimeAdapter.getRuntimeField({
1000
982
  schema: e,
1001
983
  parentSchema: s,
1002
984
  index: r
1003
- }), p = n.name, m = e.componentProps ?? {}, g = C.placeholderPresetByComponentName;
1004
- let S = e.placeholder, v = e.show;
985
+ }), p = n.name, m = e.componentProps ?? {}, g = I.placeholderPresetByComponentName;
986
+ let C = e.placeholder, v = e.show;
1005
987
  v === void 0 && (v = !0);
1006
- let b = e.label ?? "", O;
1007
- if (e.runtime ? O = e.runtime : O = (s == null ? void 0 : s.runtime) ?? this.runtime, !o.isUndefined(r) && !o.isObjectEmpty(O) && (b = X((ve = O == null ? void 0 : O.customizeListItemLabel) == null ? void 0 : ve.call(O, e.label ?? "", r + 1), "")), !S) {
988
+ let b = e.label ?? "", S;
989
+ if (e.runtime ? S = e.runtime : S = (s == null ? void 0 : s.runtime) ?? this.runtime, !o.isUndefined(r) && !o.isObjectEmpty(S) && (b = X((ve = S == null ? void 0 : S.customizeListItemLabel) == null ? void 0 : ve.call(S, e.label ?? "", r + 1), "")), !C) {
1008
990
  let $ = "请输入";
1009
- o.isUndefined(p) ? S = `${$}${b}` : /* @ts-expect-error */ g[p.toLowerCase()] ? ($ = // @ts-expect-error
1010
- g[p.toLowerCase()], S = `${$}${b}`) : (Object.keys(g).forEach((_e) => {
991
+ o.isUndefined(p) ? C = `${$}${b}` : /* @ts-expect-error */ g[p.toLowerCase()] ? ($ = // @ts-expect-error
992
+ g[p.toLowerCase()], C = `${$}${b}`) : (Object.keys(g).forEach((_e) => {
1011
993
  p.toLowerCase().includes(_e.toLowerCase()) && ($ = g[_e]);
1012
- }), S = `${$}${b}`);
994
+ }), C = `${$}${b}`);
1013
995
  }
1014
996
  const $e = this.runtimeAdapter.getRuntimeRequired({
1015
997
  ...e,
@@ -1021,7 +1003,7 @@ class gr {
1021
1003
  show: v
1022
1004
  }, {
1023
1005
  default() {
1024
- return v && y(Ne, N(c, {
1006
+ return v && y(Ne, N(f, {
1025
1007
  label: `${b ? `${b}:` : ""}`
1026
1008
  }, d, $e), {
1027
1009
  default() {
@@ -1029,7 +1011,7 @@ class gr {
1029
1011
  Component: n,
1030
1012
  schema: e,
1031
1013
  baseModel: i,
1032
- placeholder: S,
1014
+ placeholder: C,
1033
1015
  componentSlots: Ue,
1034
1016
  props: m
1035
1017
  });
@@ -1062,7 +1044,7 @@ class gr {
1062
1044
  code: "0001",
1063
1045
  message: "异步默认值数据正在处理中,请您耐心等待... "
1064
1046
  });
1065
- (i = this.processor.stableModel[e.field]) != null && i[0] && this.model.value[e.field].push(I(this.processor.stableModel[e.field][0])), this.runtimeAdapter.clearValidate(this);
1047
+ (i = this.processor.stableModel[e.field]) != null && i[0] && this.model.value[e.field].push(P(this.processor.stableModel[e.field][0])), this.runtimeAdapter.clearValidate(this);
1066
1048
  }
1067
1049
  deleteListItem(e, r) {
1068
1050
  this.model.value[e.field].splice(r, 1), this.runtimeAdapter.clearValidate(this);
@@ -1083,9 +1065,9 @@ class gr {
1083
1065
  schema: e
1084
1066
  }, {
1085
1067
  default() {
1086
- return i.model.value[e.field].map((l, c) => y(a, null, {
1068
+ return i.model.value[e.field].map((l, f) => y(a, null, {
1087
1069
  default() {
1088
- return e.children.map((d) => i.runtimeItemProcessor(d, c, l, e));
1070
+ return e.children.map((d) => i.runtimeItemProcessor(d, f, l, e));
1089
1071
  },
1090
1072
  delete({
1091
1073
  container: d
@@ -1093,7 +1075,7 @@ class gr {
1093
1075
  var m;
1094
1076
  const p = d ?? y("button", null, null);
1095
1077
  return Le(y(p, {
1096
- onClick: () => i.deleteListItem(e, c)
1078
+ onClick: () => i.deleteListItem(e, f)
1097
1079
  }, null), [[De, ((m = i.model.value[e.field]) == null ? void 0 : m.length) > 1]]);
1098
1080
  }
1099
1081
  }));
@@ -1101,8 +1083,8 @@ class gr {
1101
1083
  add({
1102
1084
  container: l
1103
1085
  } = {}) {
1104
- const c = l ?? y("button", null, [Ge("添加")]);
1105
- return y(c, {
1086
+ const f = l ?? y("button", null, [Ge("添加")]);
1087
+ return y(f, {
1106
1088
  onClick: () => i.addListItem(e)
1107
1089
  }, null);
1108
1090
  }
@@ -1112,13 +1094,13 @@ class gr {
1112
1094
  return e.map((r) => (r.type || (r.type = "item"), this.processorBySchemaType[r.type](r)));
1113
1095
  }
1114
1096
  exec() {
1115
- var l, c, d, p;
1097
+ var l, f, d, p;
1116
1098
  const e = {
1117
1099
  display: "grid",
1118
1100
  gridColumn: "1 / -1",
1119
1101
  gridAutoColumns: "1fr",
1120
1102
  ...this.grid
1121
- }, r = this, i = h(this.globalNativeFormOverride.props.Form, I((c = (l = this.native) == null ? void 0 : l.props) == null ? void 0 : c.Form) ?? {}), s = h(this.globalNativeFormOverride.slots.Form, I((p = (d = this.native) == null ? void 0 : d.slots) == null ? void 0 : p.Form) ?? {}), n = w.getFormContainer(this), a = this.runtimeAdapter.getFormModelPropName();
1103
+ }, r = this, i = h(this.globalNativeFormOverride.props.Form, P((f = (l = this.native) == null ? void 0 : l.props) == null ? void 0 : f.Form) ?? {}), s = h(this.globalNativeFormOverride.slots.Form, P((p = (d = this.native) == null ? void 0 : d.slots) == null ? void 0 : p.Form) ?? {}), n = w.getFormContainer(this), a = this.runtimeAdapter.getFormModelPropName();
1122
1104
  return y(n, N(i, {
1123
1105
  ref: this.formRef
1124
1106
  }, {
@@ -1133,7 +1115,7 @@ class gr {
1133
1115
  });
1134
1116
  }
1135
1117
  }
1136
- class f {
1118
+ class c {
1137
1119
  static getPreset(e) {
1138
1120
  var r, i, s;
1139
1121
  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];
@@ -1143,8 +1125,8 @@ class f {
1143
1125
  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;
1144
1126
  }
1145
1127
  }
1146
- u(f, "presets");
1147
- function K({
1128
+ u(c, "presets");
1129
+ function W({
1148
1130
  parentSchema: t,
1149
1131
  schema: e,
1150
1132
  index: r
@@ -1154,7 +1136,7 @@ function K({
1154
1136
  const vr = {
1155
1137
  ArcoVue: {
1156
1138
  getRuntimeField(t) {
1157
- const e = K(t);
1139
+ const e = W(t);
1158
1140
  return o.isFunction(e) ? {
1159
1141
  field: e()
1160
1142
  } : {
@@ -1221,7 +1203,7 @@ const vr = {
1221
1203
  },
1222
1204
  NutUI: {
1223
1205
  getRuntimeField(t) {
1224
- const e = K(t);
1206
+ const e = W(t);
1225
1207
  return o.isFunction(e) ? {
1226
1208
  prop: e()
1227
1209
  } : {
@@ -1294,7 +1276,7 @@ const vr = {
1294
1276
  },
1295
1277
  NaiveUI: {
1296
1278
  getRuntimeField(t) {
1297
- const e = K(t);
1279
+ const e = W(t);
1298
1280
  return o.isFunction(e) ? {
1299
1281
  path: e()
1300
1282
  } : {
@@ -1428,7 +1410,7 @@ u(M, "schemaPreset", {
1428
1410
  }), // 基于基本功能提出基本预设
1429
1411
  u(M, "placeholderPresetByComponentName", M.getPlaceholderPrefixPresetByComponentName());
1430
1412
  let Z = M;
1431
- const C = {
1413
+ const I = {
1432
1414
  ...Z,
1433
1415
  adapters: {
1434
1416
  ...vr
@@ -1459,7 +1441,7 @@ function Cr(t) {
1459
1441
  ];
1460
1442
  }
1461
1443
  function Sr(t) {
1462
- f.presets = t;
1444
+ c.presets = t;
1463
1445
  }
1464
1446
  function re(t, e) {
1465
1447
  return e === "native" && Object.defineProperty(t, "name", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harbor-design/proform",
3
- "version": "1.3.13",
3
+ "version": "1.3.14",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",