@harbor-design/proform 1.2.28 → 1.2.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +66 -57
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -288,19 +288,19 @@ function we(t) {
288
288
  var e = t + "";
289
289
  return e == "0" && 1 / t == -nt ? "-0" : e;
290
290
  }
291
- function D(t) {
291
+ function G(t) {
292
292
  var e = typeof t;
293
293
  return t != null && (e == "object" || e == "function");
294
294
  }
295
295
  var ot = "[object AsyncFunction]", at = "[object Function]", lt = "[object GeneratorFunction]", ut = "[object Proxy]";
296
296
  function ct(t) {
297
- if (!D(t))
297
+ if (!G(t))
298
298
  return !1;
299
299
  var e = je(t);
300
300
  return e == at || e == lt || e == ot || e == ut;
301
301
  }
302
- var B = Z["__core-js_shared__"], Oe = function() {
303
- var t = /[^.]+$/.exec(B && B.keys && B.keys.IE_PROTO || "");
302
+ var H = Z["__core-js_shared__"], Oe = function() {
303
+ var t = /[^.]+$/.exec(H && H.keys && H.keys.IE_PROTO || "");
304
304
  return t ? "Symbol(src)_1." + t : "";
305
305
  }();
306
306
  function ft(t) {
@@ -320,13 +320,13 @@ function ht(t) {
320
320
  }
321
321
  return "";
322
322
  }
323
- var mt = /[\\^$.*+?()[\]{}|]/g, yt = /^\[object .+?Constructor\]$/, gt = Function.prototype, bt = Object.prototype, vt = gt.toString, _t = bt.hasOwnProperty, Pt = RegExp(
323
+ var mt = /[\\^$.*+?()[\]{}|]/g, gt = /^\[object .+?Constructor\]$/, yt = Function.prototype, bt = Object.prototype, vt = yt.toString, _t = bt.hasOwnProperty, Pt = RegExp(
324
324
  "^" + vt.call(_t).replace(mt, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
325
325
  );
326
326
  function Ct(t) {
327
- if (!D(t) || ft(t))
327
+ if (!G(t) || ft(t))
328
328
  return !1;
329
- var e = ct(t) ? Pt : yt;
329
+ var e = ct(t) ? Pt : gt;
330
330
  return e.test(ht(t));
331
331
  }
332
332
  function It(t, e) {
@@ -412,7 +412,7 @@ O.prototype.set = Bt;
412
412
  function Ht() {
413
413
  this.__data__ = [], this.size = 0;
414
414
  }
415
- function G(t, e) {
415
+ function k(t, e) {
416
416
  for (var r = t.length; r--; )
417
417
  if (Re(t[r][0], e))
418
418
  return r;
@@ -420,21 +420,21 @@ function G(t, e) {
420
420
  }
421
421
  var Wt = Array.prototype, Kt = Wt.splice;
422
422
  function Xt(t) {
423
- var e = this.__data__, r = G(e, t);
423
+ var e = this.__data__, r = k(e, t);
424
424
  if (r < 0)
425
425
  return !1;
426
426
  var s = e.length - 1;
427
427
  return r == s ? e.pop() : Kt.call(e, r, 1), --this.size, !0;
428
428
  }
429
429
  function Yt(t) {
430
- var e = this.__data__, r = G(e, t);
430
+ var e = this.__data__, r = k(e, t);
431
431
  return r < 0 ? void 0 : e[r][1];
432
432
  }
433
433
  function Zt(t) {
434
- return G(this.__data__, t) > -1;
434
+ return k(this.__data__, t) > -1;
435
435
  }
436
436
  function Jt(t, e) {
437
- var r = this.__data__, s = G(r, t);
437
+ var r = this.__data__, s = k(r, t);
438
438
  return s < 0 ? (++this.size, r.push([t, e])) : r[s][1] = e, this;
439
439
  }
440
440
  function $(t) {
@@ -461,22 +461,22 @@ function er(t) {
461
461
  var e = typeof t;
462
462
  return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
463
463
  }
464
- function k(t, e) {
464
+ function B(t, e) {
465
465
  var r = t.__data__;
466
466
  return er(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
467
467
  }
468
468
  function tr(t) {
469
- var e = k(this, t).delete(t);
469
+ var e = B(this, t).delete(t);
470
470
  return this.size -= e ? 1 : 0, e;
471
471
  }
472
472
  function rr(t) {
473
- return k(this, t).get(t);
473
+ return B(this, t).get(t);
474
474
  }
475
475
  function sr(t) {
476
- return k(this, t).has(t);
476
+ return B(this, t).has(t);
477
477
  }
478
478
  function ir(t, e) {
479
- var r = k(this, t), s = r.size;
479
+ var r = B(this, t), s = r.size;
480
480
  return r.set(t, e), this.size += r.size == s ? 0 : 1, this;
481
481
  }
482
482
  function F(t) {
@@ -537,12 +537,12 @@ function pr(t, e) {
537
537
  t = t[$e(e[r++])];
538
538
  return r && r == s ? t : void 0;
539
539
  }
540
- function H(t, e, r) {
540
+ function L(t, e, r) {
541
541
  var s = t == null ? void 0 : pr(t, e);
542
542
  return s === void 0 ? r : s;
543
543
  }
544
544
  function hr(t, e, r, s) {
545
- if (!D(t))
545
+ if (!G(t))
546
546
  return t;
547
547
  e = Ve(e, t);
548
548
  for (var i = -1, n = e.length, o = n - 1, l = t; l != null && ++i < n; ) {
@@ -551,13 +551,13 @@ function hr(t, e, r, s) {
551
551
  return t;
552
552
  if (i != o) {
553
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]) ? [] : {});
554
+ f = s ? s(p, u, l) : void 0, f === void 0 && (f = G(p) ? p : Ft(e[i + 1]) ? [] : {});
555
555
  }
556
556
  Rt(l, u, f), l = l[u];
557
557
  }
558
558
  return t;
559
559
  }
560
- function L(t, e, r) {
560
+ function D(t, e, r) {
561
561
  return t == null ? t : hr(t, e, r);
562
562
  }
563
563
  class mr {
@@ -646,13 +646,13 @@ class mr {
646
646
  if (a.isUndefined(l.stable))
647
647
  return;
648
648
  const E = i.parseStable(l.stable), S = s == null ? void 0 : s.index, C = s == null ? void 0 : s.key;
649
- let g = E;
650
- if (a.isProcessInprogress(g) || (n[p] = !0), s) {
651
- const y = i.processedSchemas.value[S][C][u][f];
652
- y && a.isObject(y) && f !== "component" && (g = h(y, g)), i.processedSchemas.value[S][C][u][f] = g, i.stableUpdater(n);
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);
653
653
  } else {
654
- const y = i.processedSchemas.value[u][f];
655
- y && a.isObject(y) && f !== "component" && (g = h(y, g)), i.processedSchemas.value[u][f] = g, i.stableUpdater(n);
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);
656
656
  }
657
657
  }
658
658
  }
@@ -746,13 +746,13 @@ class mr {
746
746
  })
747
747
  );
748
748
  else if (e.name.startsWith("__proform_structured_path_parsing_mark_"))
749
- r(() => e());
750
- else if (e.__proform_async_result) {
751
- const i = e.__proform_async_result;
749
+ r(e);
750
+ else if (e.__proform_cached_result) {
751
+ const i = e.__proform_cached_result;
752
752
  this.promiseFieldParser(i, r, s);
753
753
  } else {
754
754
  const i = e(this.getRuntimeMeta());
755
- e.name.startsWith("__proform_onetime_") && (e.__proform_async_result = i), this.promiseFieldParser(i, r, s);
755
+ e.name.startsWith("__proform_onetime_") && (e.__proform_cached_result = i), this.promiseFieldParser(i, r, s);
756
756
  }
757
757
  else
758
758
  q(e) ? b(
@@ -790,14 +790,23 @@ class mr {
790
790
  ), a.isObjectEmpty(this.stableModel) && this.stableUpdaterProcessProgress.every(Boolean) && this.defaultValueEffect.effects.size === 0 && (this.stableModel = _(this.processedModel.value), this.runtimeCore.hydrateEffect.triggerEffects(), this.runtimeCore.hydrateEffect.clearEffects());
791
791
  }
792
792
  setModel(e, r, s) {
793
- a.isFunction(r) ? L(e, r(), s) : e[r] = s;
793
+ a.isFunction(r) ? D(e, r(), s) : e[r] = s;
794
794
  }
795
795
  createModel(e, r) {
796
- a.isListSchema(e) && (r[e.field] || this.setModel(r, e.field, [{}]), e.children.forEach((s) => {
796
+ if (a.isListSchema(e) && (r[e.field] || this.setModel(r, e.field, [{}]), e.children.forEach((s) => {
797
797
  this.createModel(s, r[e.field][0]);
798
798
  })), a.isGroupSchema(e) && e.children.forEach((s) => {
799
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));
800
+ }), a.isItemSchema(e))
801
+ if ("defaultValue" in e)
802
+ this.setModel(r, e.field, e.defaultValue);
803
+ else {
804
+ if (a.isFunction(e.field) && L(r, e.field()))
805
+ return;
806
+ if (a.isString(e.field) && r[e.field])
807
+ return;
808
+ this.setModel(r, e.field, void 0);
809
+ }
801
810
  }
802
811
  }
803
812
  class j {
@@ -820,7 +829,7 @@ class j {
820
829
  return d.presets.uiPresets[e ?? d.presets.ui].container.ListItem;
821
830
  }
822
831
  }
823
- class yr {
832
+ class gr {
824
833
  constructor(e) {
825
834
  this.ui = e;
826
835
  }
@@ -854,7 +863,7 @@ class yr {
854
863
  return (r == null ? void 0 : r.clearValidate(e)) ?? (s == null ? void 0 : s.clearValidate(e));
855
864
  }
856
865
  }
857
- function gr(t) {
866
+ function yr(t) {
858
867
  return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !ke(t);
859
868
  }
860
869
  class br {
@@ -884,7 +893,7 @@ class br {
884
893
  c(this, "shared", {});
885
894
  this.setup = e, this.processor = new mr(this);
886
895
  const r = this.setup(this);
887
- if (this.ui = r.ui ?? d.presets.ui, this.runtimeAdapter = new yr(this.ui), Object.assign(this.globalNativeFormOverride, this.runtimeAdapter.getRuntimeNative()), q(r.schemas))
896
+ 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
897
  b(
889
898
  // @ts-expect-error
890
899
  () => r.schemas.value,
@@ -941,7 +950,7 @@ class br {
941
950
  };
942
951
  }
943
952
  runtimeItemProcessor(e, r, s = this.model.value, i) {
944
- var re, se, ie, ne, oe, ae, le, ue, ce, fe, de, pe, he, me, ye, ge, be;
953
+ var re, se, ie, ne, oe, ae, le, ue, ce, fe, de, pe, he, me, ge, ye, be;
945
954
  const n = R(e.component);
946
955
  if (!n)
947
956
  return;
@@ -950,33 +959,33 @@ class br {
950
959
  display: "grid",
951
960
  gridColumn: "1 / -1",
952
961
  ...e.grid
953
- }, u = h(_((me = (he = this.native) == null ? void 0 : he.props) == null ? void 0 : me.FormItem) ?? {}, (ge = (ye = e.native) == null ? void 0 : ye.props) == null ? void 0 : ge.FormItem), f = this.runtimeAdapter.getRuntimeField({
962
+ }, u = h(_((me = (he = this.native) == null ? void 0 : he.props) == null ? void 0 : me.FormItem) ?? {}, (ye = (ge = e.native) == null ? void 0 : ge.props) == null ? void 0 : ye.FormItem), f = this.runtimeAdapter.getRuntimeField({
954
963
  schema: e,
955
964
  parentSchema: i,
956
965
  index: r
957
966
  }), p = n.name, E = e.componentProps ?? {}, S = P.placeholderPresetByComponentName;
958
- let C = e.placeholder, g = e.show;
959
- g === void 0 && (g = !0);
960
- let y = 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) && (y = K((be = I == null ? void 0 : I.customizeListItemLabel) == null ? void 0 : be.call(I, e.label ?? "", r + 1), "")), !C) {
967
+ let C = e.placeholder, y = e.show;
968
+ y === void 0 && (y = !0);
969
+ let g = e.label ?? "", I;
970
+ if (e.runtime ? I = e.runtime : I = (i == null ? void 0 : i.runtime) ?? this.runtime, !a.isUndefined(r) && !a.isObjectEmpty(I) && (g = K((be = I == null ? void 0 : I.customizeListItemLabel) == null ? void 0 : be.call(I, e.label ?? "", r + 1), "")), !C) {
962
971
  let N = "请输入";
963
- a.isUndefined(p) ? C = `${N}${y}` : /* @ts-expect-error */ S[p.toLowerCase()] ? (N = // @ts-expect-error
964
- S[p.toLowerCase()], C = `${N}${y}`) : (Object.keys(S).forEach((ve) => {
972
+ a.isUndefined(p) ? C = `${N}${g}` : /* @ts-expect-error */ S[p.toLowerCase()] ? (N = // @ts-expect-error
973
+ S[p.toLowerCase()], C = `${N}${g}`) : (Object.keys(S).forEach((ve) => {
965
974
  p.toLowerCase().includes(ve.toLowerCase()) && (N = S[ve]);
966
- }), C = `${N}${y}`);
975
+ }), C = `${N}${g}`);
967
976
  }
968
977
  const Ne = this.runtimeAdapter.getRuntimeRequired({
969
978
  ...e,
970
- label: y
979
+ label: g
971
980
  }), Me = j.getItemContainer(this), xe = j.getFormItemContainer(this), qe = this, Te = e.componentSlots;
972
981
  return m("div", {
973
982
  style: l
974
983
  }, [m(Me, {
975
- show: g
984
+ show: y
976
985
  }, {
977
986
  default() {
978
- return g && m(xe, x(u, {
979
- label: `${y ? `${y}:` : ""}`
987
+ return y && m(xe, x(u, {
988
+ label: `${g ? `${g}:` : ""}`
980
989
  }, f, Ne), {
981
990
  default() {
982
991
  return qe.runtimeAdapter.formComponentRenderer({
@@ -1005,7 +1014,7 @@ class br {
1005
1014
  style: s
1006
1015
  }, [n && m(i, {
1007
1016
  schema: e
1008
- }, gr(r = e.children.map((o) => this.runtimeItemProcessor(o))) ? r : {
1017
+ }, yr(r = e.children.map((o) => this.runtimeItemProcessor(o))) ? r : {
1009
1018
  default: () => [r]
1010
1019
  })]);
1011
1020
  }
@@ -1153,10 +1162,10 @@ const vr = {
1153
1162
  props: n
1154
1163
  }) {
1155
1164
  let o;
1156
- return a.isFunction(r.field) ? o = H(e, r.field()) : o = e[r.field], m(t, x({
1165
+ return a.isFunction(r.field) ? o = L(e, r.field()) : o = e[r.field], m(t, x({
1157
1166
  modelValue: o,
1158
1167
  "onUpdate:modelValue": (l) => {
1159
- a.isFunction(r.field) ? L(e, r.field(), l) : e[r.field] = l;
1168
+ a.isFunction(r.field) ? D(e, r.field(), l) : e[r.field] = l;
1160
1169
  },
1161
1170
  placeholder: s
1162
1171
  }, n), {
@@ -1221,10 +1230,10 @@ const vr = {
1221
1230
  props: n
1222
1231
  }) {
1223
1232
  let o;
1224
- return a.isFunction(r.field) ? o = H(e, r.field()) : o = e[r.field], m(t, x({
1233
+ return a.isFunction(r.field) ? o = L(e, r.field()) : o = e[r.field], m(t, x({
1225
1234
  modelValue: o,
1226
1235
  "onUpdate:modelValue": (l) => {
1227
- a.isFunction(r.field) ? L(e, r.field(), l) : e[r.field] = l;
1236
+ a.isFunction(r.field) ? D(e, r.field(), l) : e[r.field] = l;
1228
1237
  },
1229
1238
  placeholder: s
1230
1239
  }, n), {
@@ -1296,10 +1305,10 @@ const vr = {
1296
1305
  props: n
1297
1306
  }) {
1298
1307
  let o;
1299
- return a.isFunction(r.field) ? o = H(e, r.field()) : o = e[r.field], m(t, x({
1308
+ return a.isFunction(r.field) ? o = L(e, r.field()) : o = e[r.field], m(t, x({
1300
1309
  value: o,
1301
1310
  "onUpdate:value": (l) => {
1302
- a.isFunction(r.field) ? L(e, r.field(), l) : e[r.field] = l;
1311
+ a.isFunction(r.field) ? D(e, r.field(), l) : e[r.field] = l;
1303
1312
  },
1304
1313
  placeholder: s
1305
1314
  }, n), {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harbor-design/proform",
3
- "version": "1.2.28",
3
+ "version": "1.2.30",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",