@harbor-design/proform 1.4.8 → 1.4.10

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 +24 -29
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -391,18 +391,13 @@ class o {
391
391
  return !!e.__proform_raw_object;
392
392
  }
393
393
  }
394
- function b(r, ...e) {
394
+ function v(r, ...e) {
395
395
  return e.forEach((t) => {
396
396
  if (Array.isArray(t))
397
- Array.isArray(r) || (r = []), t.forEach((i, s) => {
398
- typeof i == "object" && i !== null && !(i instanceof Date) ? r[s] = b(Array.isArray(i) ? [] : {}, i) : r[s] = i;
399
- });
397
+ r = [...t];
400
398
  else
401
399
  for (const i in t)
402
- t.hasOwnProperty(i) && (typeof t[i] == "object" && t[i] !== null && !(t[i] instanceof Date) && !(t[i] instanceof RegExp) ? r[i] = b(
403
- r[i] || (Array.isArray(t[i]) ? [] : {}),
404
- t[i]
405
- ) : r[i] = t[i]);
400
+ t.hasOwnProperty(i) && (typeof t[i] == "object" && t[i] !== null && !(t[i] instanceof Date) && !(t[i] instanceof RegExp) ? Array.isArray(t[i]) ? r[i] = [...t[i]] : r[i] = v(r[i] || {}, t[i]) : r[i] = t[i]);
406
401
  }), r;
407
402
  }
408
403
  function I(r) {
@@ -474,7 +469,7 @@ class vr {
474
469
  T(e) ? w(
475
470
  () => e.value,
476
471
  () => {
477
- b(this.runtimeCore.model.value, e.value);
472
+ v(this.runtimeCore.model.value, e.value);
478
473
  },
479
474
  {
480
475
  deep: !0,
@@ -483,13 +478,13 @@ class vr {
483
478
  ) : z(e) ? w(
484
479
  () => e,
485
480
  () => {
486
- b(this.runtimeCore.model.value, e);
481
+ v(this.runtimeCore.model.value, e);
487
482
  },
488
483
  {
489
484
  deep: !0,
490
485
  immediate: !0
491
486
  }
492
- ) : b(this.runtimeCore.model.value, e);
487
+ ) : v(this.runtimeCore.model.value, e);
493
488
  },
494
489
  {
495
490
  lazy: !1
@@ -646,11 +641,11 @@ class yr {
646
641
  const f = u.index, c = u.key, h = u.keyIndex;
647
642
  if (o.isUndefined(u.stable) || o.isNull(u.stable))
648
643
  return;
649
- const p = s.parseStable(u.stable), v = i == null ? void 0 : i.index, E = i == null ? void 0 : i.key;
644
+ const p = s.parseStable(u.stable), b = i == null ? void 0 : i.index, E = i == null ? void 0 : i.key;
650
645
  let y = p;
651
646
  if (o.isProcessInprogress(y) || (n[h] = !0), i) {
652
- const g = s.processedSchemas.value[v][E][f][c];
653
- g && o.isObject(g) && c !== "component" && (y = b(g, y)), s.processedSchemas.value[v][E][f][c] = y, s.stableUpdater(
647
+ const g = s.processedSchemas.value[b][E][f][c];
648
+ g && o.isObject(g) && c !== "component" && (y = v(g, y)), s.processedSchemas.value[b][E][f][c] = y, s.stableUpdater(
654
649
  n,
655
650
  i,
656
651
  t,
@@ -659,7 +654,7 @@ class yr {
659
654
  );
660
655
  } else {
661
656
  const g = s.processedSchemas.value[f][c];
662
- g && o.isObject(g) && c !== "component" && (y = b(g, y)), s.processedSchemas.value[f][c] = y, s.stableUpdater(
657
+ g && o.isObject(g) && c !== "component" && (y = v(g, y)), s.processedSchemas.value[f][c] = y, s.stableUpdater(
663
658
  n,
664
659
  i,
665
660
  t,
@@ -719,8 +714,8 @@ class yr {
719
714
  this.defaultValueInprogressMap.set(t[s], h), !o.isProcessInprogress(h) && this.defaultValueInprogressMap.size === this.baseDefaultValueFunctionsLength && Array.from(
720
715
  this.defaultValueInprogressMap.values()
721
716
  ).every((p) => {
722
- var v;
723
- return !((v = p == null ? void 0 : p.includes) != null && v.call(p, "undefined"));
717
+ var b;
718
+ return !((b = p == null ? void 0 : p.includes) != null && b.call(p, "undefined"));
724
719
  }) ? (f(h), this.defaultValueEffect.clearEffects(), S(() => {
725
720
  c();
726
721
  })) : f(h);
@@ -735,8 +730,8 @@ class yr {
735
730
  this.defaultValueInprogressMap.set(t[s], h), !o.isProcessInprogress(h) && this.defaultValueInprogressMap.size === this.baseDefaultValueFunctionsLength && Array.from(
736
731
  this.defaultValueInprogressMap.values()
737
732
  ).every((p) => {
738
- var v;
739
- return !((v = p == null ? void 0 : p.includes) != null && v.call(p, "undefined"));
733
+ var b;
734
+ return !((b = p == null ? void 0 : p.includes) != null && b.call(p, "undefined"));
740
735
  }) ? (f(h), this.defaultValueEffect.clearEffects(), S(() => {
741
736
  c();
742
737
  })) : f(h);
@@ -843,7 +838,7 @@ class yr {
843
838
  });
844
839
  }
845
840
  setModel(e, t, i) {
846
- o.isFunction(t) ? _(e, t(), i) : b(e, {
841
+ o.isFunction(t) ? _(e, t(), i) : v(e, {
847
842
  [t]: i
848
843
  });
849
844
  }
@@ -853,7 +848,7 @@ class yr {
853
848
  })), o.isGroupSchema(e) && e.children.forEach((i) => {
854
849
  this.createModel(i, t);
855
850
  }), o.isItemSchema(e) && S(() => {
856
- if ("defaultValue" in e)
851
+ if ("defaultValue" in e && !t[e.field])
857
852
  this.setModel(t, e.field, e.defaultValue);
858
853
  else {
859
854
  if (o.isFunction(e.field) && D(t, e.field()))
@@ -989,24 +984,24 @@ class Ir {
989
984
  const n = $(e.component);
990
985
  if (!n)
991
986
  return;
992
- (ae = (oe = e.native) == null ? void 0 : oe.props) != null && ae.Form && b(this.globalNativeFormOverride.props.Form, (ue = (le = e.native) == null ? void 0 : le.props) == null ? void 0 : ue.Form), (ce = (fe = e.native) == null ? void 0 : fe.slots) != null && ce.Form && b(this.globalNativeFormOverride.slots.Form, (he = (de = e.native) == null ? void 0 : de.slots) == null ? void 0 : he.Form);
993
- const a = b(I((me = (pe = this.native) == null ? void 0 : pe.slots) == null ? void 0 : me.FormItem) ?? {}, (be = (ge = e.native) == null ? void 0 : ge.slots) == null ? void 0 : be.FormItem), u = {
987
+ (ae = (oe = e.native) == null ? void 0 : oe.props) != null && ae.Form && v(this.globalNativeFormOverride.props.Form, (ue = (le = e.native) == null ? void 0 : le.props) == null ? void 0 : ue.Form), (ce = (fe = e.native) == null ? void 0 : fe.slots) != null && ce.Form && v(this.globalNativeFormOverride.slots.Form, (he = (de = e.native) == null ? void 0 : de.slots) == null ? void 0 : he.Form);
988
+ const a = v(I((me = (pe = this.native) == null ? void 0 : pe.slots) == null ? void 0 : me.FormItem) ?? {}, (be = (ge = e.native) == null ? void 0 : ge.slots) == null ? void 0 : be.FormItem), u = {
994
989
  display: "grid",
995
990
  gridColumn: "1 / -1",
996
991
  ...e.grid
997
- }, f = b(I((ye = (ve = this.native) == null ? void 0 : ve.props) == null ? void 0 : ye.FormItem) ?? {}, (Pe = (_e = e.native) == null ? void 0 : _e.props) == null ? void 0 : Pe.FormItem), c = this.runtimeAdapter.getRuntimeField({
992
+ }, f = v(I((ye = (ve = this.native) == null ? void 0 : ve.props) == null ? void 0 : ye.FormItem) ?? {}, (Pe = (_e = e.native) == null ? void 0 : _e.props) == null ? void 0 : Pe.FormItem), c = this.runtimeAdapter.getRuntimeField({
998
993
  schema: e,
999
994
  parentSchema: s,
1000
995
  index: t
1001
- }), h = n.name, p = e.componentProps ?? {}, v = C.placeholderPresetByComponentName;
996
+ }), h = n.name, p = e.componentProps ?? {}, b = C.placeholderPresetByComponentName;
1002
997
  let E = e.placeholder, y = e.show;
1003
998
  y === void 0 && (y = !0);
1004
999
  let g = e.label ?? "", O;
1005
1000
  if (e.runtime ? O = e.runtime : O = (s == null ? void 0 : s.runtime) ?? this.runtime, !o.isUndefined(t) && !o.isObjectEmpty(O) && (g = Q((Ie = O == null ? void 0 : O.customizeListItemLabel) == null ? void 0 : Ie.call(O, e.label ?? "", t + 1), "")), !E) {
1006
1001
  let N = "请输入";
1007
- o.isUndefined(h) ? E = `${N}${g}` : /* @ts-expect-error */ v[h.toLowerCase()] ? (N = // @ts-expect-error
1008
- v[h.toLowerCase()], E = `${N}${g}`) : (Object.keys(v).forEach((Se) => {
1009
- h.toLowerCase().includes(Se.toLowerCase()) && (N = v[Se]);
1002
+ o.isUndefined(h) ? E = `${N}${g}` : /* @ts-expect-error */ b[h.toLowerCase()] ? (N = // @ts-expect-error
1003
+ b[h.toLowerCase()], E = `${N}${g}`) : (Object.keys(b).forEach((Se) => {
1004
+ h.toLowerCase().includes(Se.toLowerCase()) && (N = b[Se]);
1010
1005
  }), E = `${N}${g}`);
1011
1006
  }
1012
1007
  const Ue = this.runtimeAdapter.getRuntimeRequired({
@@ -1112,7 +1107,7 @@ class Ir {
1112
1107
  gridColumn: "1 / -1",
1113
1108
  gridAutoColumns: "1fr",
1114
1109
  ...this.grid
1115
- }, t = this, i = b(this.globalNativeFormOverride.props.Form, I((f = (u = this.native) == null ? void 0 : u.props) == null ? void 0 : f.Form) ?? {}), s = b(this.globalNativeFormOverride.slots.Form, I((h = (c = this.native) == null ? void 0 : c.slots) == null ? void 0 : h.Form) ?? {}), n = j.getFormContainer(this), a = this.runtimeAdapter.getFormModelPropName();
1110
+ }, t = this, i = v(this.globalNativeFormOverride.props.Form, I((f = (u = this.native) == null ? void 0 : u.props) == null ? void 0 : f.Form) ?? {}), s = v(this.globalNativeFormOverride.slots.Form, I((h = (c = this.native) == null ? void 0 : c.slots) == null ? void 0 : h.Form) ?? {}), n = j.getFormContainer(this), a = this.runtimeAdapter.getFormModelPropName();
1116
1111
  return m(n, U(i, {
1117
1112
  ref: this.formRef
1118
1113
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harbor-design/proform",
3
- "version": "1.4.8",
3
+ "version": "1.4.10",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",