@harbor-design/proform 1.3.10 → 1.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +76 -58
  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 _e, nextTick as P, isRef as q, watch as _, isReactive as U, toRaw as E, reactive as Pe, 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 _e, nextTick as P, isRef as q, watch as _, isReactive as U, toRaw as E, reactive as Pe, createVNode as m, mergeProps as N, withDirectives as Le, vShow as De, createTextVNode as Ge, isVNode as Be, defineComponent as ke } from "vue";
5
5
  class o {
6
6
  static typeChecker(e) {
7
7
  return {}.toString.call(e);
@@ -69,15 +69,15 @@ class o {
69
69
  return !!e.__proform_raw_object;
70
70
  }
71
71
  }
72
- function h(t, ...e) {
72
+ function b(t, ...e) {
73
73
  return e.forEach((r) => {
74
74
  if (Array.isArray(r))
75
75
  Array.isArray(t) || (t = []), r.forEach((i, s) => {
76
- typeof i == "object" && i !== null ? t[s] = h(Array.isArray(i) ? [] : {}, i) : t[s] = i;
76
+ typeof i == "object" && i !== null ? t[s] = b(Array.isArray(i) ? [] : {}, i) : t[s] = i;
77
77
  });
78
78
  else
79
79
  for (const i in r)
80
- r.hasOwnProperty(i) && (typeof r[i] == "object" && r[i] !== null ? t[i] = h(t[i] || {}, r[i]) : t[i] = r[i]);
80
+ r.hasOwnProperty(i) && (typeof r[i] == "object" && r[i] !== null ? t[i] = b(t[i] || {}, r[i]) : t[i] = r[i]);
81
81
  }), t;
82
82
  }
83
83
  function C(t) {
@@ -148,7 +148,7 @@ class He {
148
148
  q(e) ? _(
149
149
  () => e.value,
150
150
  () => {
151
- h(this.runtimeCore.model.value, e.value);
151
+ b(this.runtimeCore.model.value, e.value);
152
152
  },
153
153
  {
154
154
  deep: !0,
@@ -157,13 +157,13 @@ class He {
157
157
  ) : U(e) ? _(
158
158
  () => e,
159
159
  () => {
160
- h(this.runtimeCore.model.value, e);
160
+ b(this.runtimeCore.model.value, e);
161
161
  },
162
162
  {
163
163
  deep: !0,
164
164
  immediate: !0
165
165
  }
166
- ) : h(this.runtimeCore.model.value, e);
166
+ ) : b(this.runtimeCore.model.value, e);
167
167
  },
168
168
  {
169
169
  lazy: !1
@@ -177,7 +177,10 @@ class He {
177
177
  const r = _(
178
178
  () => e.value,
179
179
  () => {
180
- h(this.runtimeCore.shared, e.value), this.runtimeCore.processor.schemaEffect.triggerEffects(), P(() => {
180
+ this.runtimeCore.shared = {
181
+ ...this.runtimeCore.shared,
182
+ ...e.value
183
+ }, this.runtimeCore.processor.schemaEffect.triggerEffects(), P(() => {
181
184
  r();
182
185
  });
183
186
  },
@@ -190,7 +193,10 @@ class He {
190
193
  const r = _(
191
194
  () => e,
192
195
  () => {
193
- h(this.runtimeCore.shared, e), this.runtimeCore.processor.schemaEffect.triggerEffects(), P(() => {
196
+ this.runtimeCore.shared = {
197
+ ...this.runtimeCore.shared,
198
+ ...e
199
+ }, this.runtimeCore.processor.schemaEffect.triggerEffects(), P(() => {
194
200
  r();
195
201
  });
196
202
  },
@@ -200,7 +206,10 @@ class He {
200
206
  }
201
207
  );
202
208
  } else
203
- h(this.runtimeCore.shared, e), this.runtimeCore.processor.schemaEffect.triggerEffects();
209
+ this.runtimeCore.shared = {
210
+ ...this.runtimeCore.shared,
211
+ ...e
212
+ }, this.runtimeCore.processor.schemaEffect.triggerEffects();
204
213
  });
205
214
  }
206
215
  subscribeModel(e) {
@@ -646,14 +655,14 @@ class mr {
646
655
  const c = l.index, d = l.key, p = l.keyIndex;
647
656
  if (o.isUndefined(l.stable))
648
657
  return;
649
- const m = s.parseStable(l.stable), b = i == null ? void 0 : i.index, S = i == null ? void 0 : i.key;
650
- let v = m;
658
+ const h = s.parseStable(l.stable), g = i == null ? void 0 : i.index, S = i == null ? void 0 : i.key;
659
+ let v = h;
651
660
  if (o.isProcessInprogress(v) || (n[p] = !0), i) {
652
- const g = s.processedSchemas.value[b][S][c][d];
653
- g && o.isObject(g) && d !== "component" && (v = h(g, v)), s.processedSchemas.value[b][S][c][d] = v, s.stableUpdater(n);
661
+ const y = s.processedSchemas.value[g][S][c][d];
662
+ y && o.isObject(y) && d !== "component" && (v = b(y, v)), s.processedSchemas.value[g][S][c][d] = v, s.stableUpdater(n);
654
663
  } else {
655
- const g = s.processedSchemas.value[c][d];
656
- g && o.isObject(g) && d !== "component" && (v = h(g, v)), s.processedSchemas.value[c][d] = v, s.stableUpdater(n);
664
+ const y = s.processedSchemas.value[c][d];
665
+ y && o.isObject(y) && d !== "component" && (v = b(y, v)), s.processedSchemas.value[c][d] = v, s.stableUpdater(n);
657
666
  }
658
667
  }
659
668
  }
@@ -706,9 +715,9 @@ class mr {
706
715
  return c(p);
707
716
  this.defaultValueInprogressMap.set(r[s], p), !o.isProcessInprogress(p) && this.defaultValueInprogressMap.size === this.baseDefaultValueFunctionsLength && Array.from(
708
717
  this.defaultValueInprogressMap.values()
709
- ).every((m) => {
710
- var b;
711
- return !((b = m == null ? void 0 : m.includes) != null && b.call(m, "undefined"));
718
+ ).every((h) => {
719
+ var g;
720
+ return !((g = h == null ? void 0 : h.includes) != null && g.call(h, "undefined"));
712
721
  }) ? (c(p), this.defaultValueEffect.clearEffects(), P(() => {
713
722
  d();
714
723
  })) : c(p);
@@ -722,9 +731,9 @@ class mr {
722
731
  (p) => {
723
732
  this.defaultValueInprogressMap.set(r[s], p), !o.isProcessInprogress(p) && this.defaultValueInprogressMap.size === this.baseDefaultValueFunctionsLength && Array.from(
724
733
  this.defaultValueInprogressMap.values()
725
- ).every((m) => {
726
- var b;
727
- return !((b = m == null ? void 0 : m.includes) != null && b.call(m, "undefined"));
734
+ ).every((h) => {
735
+ var g;
736
+ return !((g = h == null ? void 0 : h.includes) != null && g.call(h, "undefined"));
728
737
  }) ? (c(p), this.defaultValueEffect.clearEffects(), P(() => {
729
738
  d();
730
739
  })) : c(p);
@@ -963,7 +972,10 @@ class br {
963
972
  share: (r) => {
964
973
  if (q(r)) {
965
974
  const i = _(() => r.value, () => {
966
- h(this.shared, r.value), P(() => {
975
+ this.shared = {
976
+ ...this.shared,
977
+ ...r.value
978
+ }, P(() => {
967
979
  i();
968
980
  });
969
981
  }, {
@@ -972,7 +984,10 @@ class br {
972
984
  });
973
985
  } else if (U(r)) {
974
986
  const i = _(() => r, () => {
975
- h(this.shared, r), P(() => {
987
+ this.shared = {
988
+ ...this.shared,
989
+ ...r
990
+ }, P(() => {
976
991
  i();
977
992
  });
978
993
  }, {
@@ -980,7 +995,10 @@ class br {
980
995
  immediate: !0
981
996
  });
982
997
  } else
983
- h(this.shared, r);
998
+ this.shared = {
999
+ ...this.shared,
1000
+ ...r
1001
+ };
984
1002
  }
985
1003
  };
986
1004
  }
@@ -989,38 +1007,38 @@ class br {
989
1007
  const n = E(e.component);
990
1008
  if (!n)
991
1009
  return;
992
- (ie = (re = e.native) == null ? void 0 : re.props) != null && ie.Form && h(this.globalNativeFormOverride.props.Form, (ne = (se = e.native) == null ? void 0 : se.props) == null ? void 0 : ne.Form), (ae = (oe = e.native) == null ? void 0 : oe.slots) != null && ae.Form && h(this.globalNativeFormOverride.slots.Form, (ue = (le = e.native) == null ? void 0 : le.slots) == null ? void 0 : ue.Form);
993
- const a = h(C((fe = (ce = this.native) == null ? void 0 : ce.slots) == null ? void 0 : fe.FormItem) ?? {}, (pe = (de = e.native) == null ? void 0 : de.slots) == null ? void 0 : pe.FormItem), l = {
1010
+ (ie = (re = e.native) == null ? void 0 : re.props) != null && ie.Form && b(this.globalNativeFormOverride.props.Form, (ne = (se = e.native) == null ? void 0 : se.props) == null ? void 0 : ne.Form), (ae = (oe = e.native) == null ? void 0 : oe.slots) != null && ae.Form && b(this.globalNativeFormOverride.slots.Form, (ue = (le = e.native) == null ? void 0 : le.slots) == null ? void 0 : ue.Form);
1011
+ const a = b(C((fe = (ce = this.native) == null ? void 0 : ce.slots) == null ? void 0 : fe.FormItem) ?? {}, (pe = (de = e.native) == null ? void 0 : de.slots) == null ? void 0 : pe.FormItem), l = {
994
1012
  display: "grid",
995
1013
  gridColumn: "1 / -1",
996
1014
  ...e.grid
997
- }, c = h(C((me = (he = this.native) == null ? void 0 : he.props) == null ? void 0 : me.FormItem) ?? {}, (ge = (ye = e.native) == null ? void 0 : ye.props) == null ? void 0 : ge.FormItem), d = this.runtimeAdapter.getRuntimeField({
1015
+ }, c = b(C((me = (he = this.native) == null ? void 0 : he.props) == null ? void 0 : me.FormItem) ?? {}, (ge = (ye = e.native) == null ? void 0 : ye.props) == null ? void 0 : ge.FormItem), d = this.runtimeAdapter.getRuntimeField({
998
1016
  schema: e,
999
1017
  parentSchema: s,
1000
1018
  index: r
1001
- }), p = n.name, m = e.componentProps ?? {}, b = I.placeholderPresetByComponentName;
1019
+ }), p = n.name, h = e.componentProps ?? {}, g = I.placeholderPresetByComponentName;
1002
1020
  let S = e.placeholder, v = e.show;
1003
1021
  v === void 0 && (v = !0);
1004
- let g = e.label ?? "", O;
1005
- if (e.runtime ? O = e.runtime : O = (s == null ? void 0 : s.runtime) ?? this.runtime, !o.isUndefined(r) && !o.isObjectEmpty(O) && (g = K((be = O == null ? void 0 : O.customizeListItemLabel) == null ? void 0 : be.call(O, e.label ?? "", r + 1), "")), !S) {
1022
+ let y = e.label ?? "", O;
1023
+ if (e.runtime ? O = e.runtime : O = (s == null ? void 0 : s.runtime) ?? this.runtime, !o.isUndefined(r) && !o.isObjectEmpty(O) && (y = K((be = O == null ? void 0 : O.customizeListItemLabel) == null ? void 0 : be.call(O, e.label ?? "", r + 1), "")), !S) {
1006
1024
  let $ = "请输入";
1007
- o.isUndefined(p) ? S = `${$}${g}` : /* @ts-expect-error */ b[p.toLowerCase()] ? ($ = // @ts-expect-error
1008
- b[p.toLowerCase()], S = `${$}${g}`) : (Object.keys(b).forEach((ve) => {
1009
- p.toLowerCase().includes(ve.toLowerCase()) && ($ = b[ve]);
1010
- }), S = `${$}${g}`);
1025
+ o.isUndefined(p) ? S = `${$}${y}` : /* @ts-expect-error */ g[p.toLowerCase()] ? ($ = // @ts-expect-error
1026
+ g[p.toLowerCase()], S = `${$}${y}`) : (Object.keys(g).forEach((ve) => {
1027
+ p.toLowerCase().includes(ve.toLowerCase()) && ($ = g[ve]);
1028
+ }), S = `${$}${y}`);
1011
1029
  }
1012
1030
  const $e = this.runtimeAdapter.getRuntimeRequired({
1013
1031
  ...e,
1014
- label: g
1032
+ label: y
1015
1033
  }), Ve = w.getItemContainer(this), Ne = w.getFormItemContainer(this), qe = this, Ue = e.componentSlots;
1016
- return y("div", {
1034
+ return m("div", {
1017
1035
  style: l
1018
- }, [y(Ve, {
1036
+ }, [m(Ve, {
1019
1037
  show: v
1020
1038
  }, {
1021
1039
  default() {
1022
- return v && y(Ne, N(c, {
1023
- label: `${g ? `${g}:` : ""}`
1040
+ return v && m(Ne, N(c, {
1041
+ label: `${y ? `${y}:` : ""}`
1024
1042
  }, d, $e), {
1025
1043
  default() {
1026
1044
  return qe.runtimeAdapter.formComponentRenderer({
@@ -1029,7 +1047,7 @@ class br {
1029
1047
  baseModel: i,
1030
1048
  placeholder: S,
1031
1049
  componentSlots: Ue,
1032
- props: m
1050
+ props: h
1033
1051
  });
1034
1052
  },
1035
1053
  ...a
@@ -1045,9 +1063,9 @@ class br {
1045
1063
  ...e.grid
1046
1064
  }, s = w.getGroupContainer(this);
1047
1065
  let n = e.show;
1048
- return n === void 0 && (n = !0), y("div", {
1066
+ return n === void 0 && (n = !0), m("div", {
1049
1067
  style: i
1050
- }, [n && y(s, {
1068
+ }, [n && m(s, {
1051
1069
  schema: e
1052
1070
  }, gr(r = e.children.map((a) => this.runtimeItemProcessor(a))) ? r : {
1053
1071
  default: () => [r]
@@ -1075,32 +1093,32 @@ class br {
1075
1093
  let s = e.show;
1076
1094
  s === void 0 && (s = !0);
1077
1095
  const n = w.getListContainer(this), a = w.getListItemContainer(this);
1078
- return y("div", {
1096
+ return m("div", {
1079
1097
  style: r
1080
- }, [s && y(n, {
1098
+ }, [s && m(n, {
1081
1099
  schema: e
1082
1100
  }, {
1083
1101
  default() {
1084
- return i.model.value[e.field].map((l, c) => y(a, null, {
1102
+ return i.model.value[e.field].map((l, c) => m(a, null, {
1085
1103
  default() {
1086
1104
  return e.children.map((d) => i.runtimeItemProcessor(d, c, l, e));
1087
1105
  },
1088
1106
  delete({
1089
1107
  container: d
1090
1108
  } = {}) {
1091
- var m;
1092
- const p = d ?? y("button", null, null);
1093
- return Le(y(p, {
1109
+ var h;
1110
+ const p = d ?? m("button", null, null);
1111
+ return Le(m(p, {
1094
1112
  onClick: () => i.deleteListItem(e, c)
1095
- }, null), [[De, ((m = i.model.value[e.field]) == null ? void 0 : m.length) > 1]]);
1113
+ }, null), [[De, ((h = i.model.value[e.field]) == null ? void 0 : h.length) > 1]]);
1096
1114
  }
1097
1115
  }));
1098
1116
  },
1099
1117
  add({
1100
1118
  container: l
1101
1119
  } = {}) {
1102
- const c = l ?? y("button", null, [Ge("添加")]);
1103
- return y(c, {
1120
+ const c = l ?? m("button", null, [Ge("添加")]);
1121
+ return m(c, {
1104
1122
  onClick: () => i.addListItem(e)
1105
1123
  }, null);
1106
1124
  }
@@ -1116,14 +1134,14 @@ class br {
1116
1134
  gridColumn: "1 / -1",
1117
1135
  gridAutoColumns: "1fr",
1118
1136
  ...this.grid
1119
- }, r = this, i = h(this.globalNativeFormOverride.props.Form, C((c = (l = this.native) == null ? void 0 : l.props) == null ? void 0 : c.Form) ?? {}), s = h(this.globalNativeFormOverride.slots.Form, C((p = (d = this.native) == null ? void 0 : d.slots) == null ? void 0 : p.Form) ?? {}), n = w.getFormContainer(this), a = this.runtimeAdapter.getFormModelPropName();
1120
- return y(n, N(i, {
1137
+ }, r = this, i = b(this.globalNativeFormOverride.props.Form, C((c = (l = this.native) == null ? void 0 : l.props) == null ? void 0 : c.Form) ?? {}), s = b(this.globalNativeFormOverride.slots.Form, C((p = (d = this.native) == null ? void 0 : d.slots) == null ? void 0 : p.Form) ?? {}), n = w.getFormContainer(this), a = this.runtimeAdapter.getFormModelPropName();
1138
+ return m(n, N(i, {
1121
1139
  ref: this.formRef
1122
1140
  }, {
1123
1141
  [a]: this.model.value
1124
1142
  }), {
1125
1143
  default() {
1126
- return y("div", {
1144
+ return m("div", {
1127
1145
  style: e
1128
1146
  }, [r.runtimeProcessor(r.schemas.value)]);
1129
1147
  },
@@ -1197,7 +1215,7 @@ const vr = {
1197
1215
  props: n
1198
1216
  }) {
1199
1217
  let a;
1200
- return o.isFunction(r.field) ? a = L(e, r.field()) : a = e[r.field], y(t, N({
1218
+ return o.isFunction(r.field) ? a = L(e, r.field()) : a = e[r.field], m(t, N({
1201
1219
  modelValue: a,
1202
1220
  "onUpdate:modelValue": (l) => {
1203
1221
  o.isFunction(r.field) ? D(e, r.field(), l) : e[r.field] = l;
@@ -1265,7 +1283,7 @@ const vr = {
1265
1283
  props: n
1266
1284
  }) {
1267
1285
  let a;
1268
- return o.isFunction(r.field) ? a = L(e, r.field()) : a = e[r.field], y(t, N({
1286
+ return o.isFunction(r.field) ? a = L(e, r.field()) : a = e[r.field], m(t, N({
1269
1287
  modelValue: a,
1270
1288
  "onUpdate:modelValue": (l) => {
1271
1289
  o.isFunction(r.field) ? D(e, r.field(), l) : e[r.field] = l;
@@ -1340,7 +1358,7 @@ const vr = {
1340
1358
  props: n
1341
1359
  }) {
1342
1360
  let a;
1343
- return o.isFunction(r.field) ? a = L(e, r.field()) : a = e[r.field], y(t, N({
1361
+ return o.isFunction(r.field) ? a = L(e, r.field()) : a = e[r.field], m(t, N({
1344
1362
  value: a,
1345
1363
  "onUpdate:value": (l) => {
1346
1364
  o.isFunction(r.field) ? D(e, r.field(), l) : e[r.field] = l;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harbor-design/proform",
3
- "version": "1.3.10",
3
+ "version": "1.3.11",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",