@harbor-design/proform 1.3.21 → 1.3.23

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 +60 -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 = (r, e, t) => e in r ? Te(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
3
  var u = (r, e, t) => (ze(r, typeof e != "symbol" ? e + "" : e, t), t);
4
- import { ref as z, readonly as Pe, nextTick as j, isRef as I, watch as g, isReactive as S, toRaw as R, reactive as K, createVNode as b, mergeProps as U, withDirectives as Le, vShow as De, createTextVNode as Ge, isVNode as Be, defineComponent as He } from "vue";
4
+ import { ref as z, readonly as Pe, nextTick as F, isRef as S, watch as g, isReactive as j, toRaw as R, reactive as K, createVNode as b, mergeProps as U, withDirectives as Le, vShow as De, createTextVNode as Ge, isVNode as Be, defineComponent as He } from "vue";
5
5
  class o {
6
6
  static typeChecker(e) {
7
7
  return {}.toString.call(e);
@@ -142,10 +142,10 @@ class Ke {
142
142
  return (e == null ? void 0 : e.validateForm(this)) ?? (t == null ? void 0 : t.validateForm(this));
143
143
  }
144
144
  hydrate(e) {
145
- j(() => {
145
+ F(() => {
146
146
  this.runtimeCore.hydrateEffect.trackEffect(
147
147
  () => {
148
- I(e) ? g(
148
+ S(e) ? g(
149
149
  () => e.value,
150
150
  () => {
151
151
  h(this.runtimeCore.model.value, e.value);
@@ -154,7 +154,7 @@ class Ke {
154
154
  deep: !0,
155
155
  immediate: !0
156
156
  }
157
- ) : S(e) ? g(
157
+ ) : j(e) ? g(
158
158
  () => e,
159
159
  () => {
160
160
  h(this.runtimeCore.model.value, e);
@@ -172,8 +172,8 @@ class Ke {
172
172
  });
173
173
  }
174
174
  share(e) {
175
- j(() => {
176
- I(e) ? g(
175
+ F(() => {
176
+ S(e) ? g(
177
177
  () => e.value,
178
178
  () => {
179
179
  h(this.runtimeCore.shared, e.value);
@@ -182,7 +182,7 @@ class Ke {
182
182
  deep: !0,
183
183
  immediate: !0
184
184
  }
185
- ) : S(e) ? g(
185
+ ) : j(e) ? g(
186
186
  () => e,
187
187
  () => {
188
188
  h(this.runtimeCore.shared, e);
@@ -192,7 +192,9 @@ class Ke {
192
192
  immediate: !0
193
193
  }
194
194
  ) : Object.keys(e).forEach((t) => {
195
- console.log(t, I(t), S(t)), I(e[t]) ? g(
195
+ console.log(e[t], S(e[t]), j(e[t])), S(e[t]) ? (Object.assign(this.runtimeCore.shared, {
196
+ [t]: e[t].value
197
+ }), g(
196
198
  () => e[t].value,
197
199
  () => {
198
200
  h(this.runtimeCore.shared, {
@@ -200,10 +202,11 @@ class Ke {
200
202
  });
201
203
  },
202
204
  {
203
- deep: !0,
204
- immediate: !0
205
+ deep: !0
205
206
  }
206
- ) : S(e[t]) ? g(
207
+ )) : j(e[t]) ? (Object.assign(this.runtimeCore.shared, {
208
+ [t]: e[t]
209
+ }), g(
207
210
  () => e[t],
208
211
  () => {
209
212
  h(this.runtimeCore.shared, {
@@ -211,23 +214,22 @@ class Ke {
211
214
  });
212
215
  },
213
216
  {
214
- deep: !0,
215
- immediate: !0
217
+ deep: !0
216
218
  }
217
- ) : h(this.runtimeCore.shared, {
219
+ )) : h(this.runtimeCore.shared, {
218
220
  [t]: e[t]
219
221
  });
220
222
  });
221
223
  });
222
224
  }
223
225
  subscribeModel(e) {
224
- j(() => {
226
+ F(() => {
225
227
  const t = g(
226
228
  () => this.readonlyReactiveModel.value,
227
229
  (i) => {
228
230
  e(i, {
229
231
  stopSubscribe() {
230
- j(() => {
232
+ F(() => {
231
233
  t();
232
234
  });
233
235
  }
@@ -266,7 +268,7 @@ class Z {
266
268
  return !t.lazy && e(), t.identifier ? this.identifierMap.get(t.identifier) || (this.effects.add(e), this.identifierMap.set(t.identifier, !0)) : this.effects.add(e), () => this.effects.delete(e);
267
269
  }
268
270
  }
269
- var We = typeof global == "object" && global && global.Object === Object && global, Xe = typeof self == "object" && self && self.Object === Object && self, Q = We || Xe || Function("return this")(), $ = Q.Symbol, je = Object.prototype, Ye = je.hasOwnProperty, Ze = je.toString, q = $ ? $.toStringTag : void 0;
271
+ var We = typeof global == "object" && global && global.Object === Object && global, Xe = typeof self == "object" && self && self.Object === Object && self, Q = We || Xe || Function("return this")(), $ = Q.Symbol, Fe = Object.prototype, Ye = Fe.hasOwnProperty, Ze = Fe.toString, q = $ ? $.toStringTag : void 0;
270
272
  function Je(r) {
271
273
  var e = Ye.call(r, q), t = r[q];
272
274
  try {
@@ -297,14 +299,14 @@ function st(r, e) {
297
299
  s[t] = e(r[t], t, r);
298
300
  return s;
299
301
  }
300
- var A = Array.isArray, nt = 1 / 0, Ie = $ ? $.prototype : void 0, Se = Ie ? Ie.toString : void 0;
302
+ var A = Array.isArray, nt = 1 / 0, Ie = $ ? $.prototype : void 0, Oe = Ie ? Ie.toString : void 0;
301
303
  function Me(r) {
302
304
  if (typeof r == "string")
303
305
  return r;
304
306
  if (A(r))
305
307
  return st(r, Me) + "";
306
308
  if (k(r))
307
- return Se ? Se.call(r) : "";
309
+ return Oe ? Oe.call(r) : "";
308
310
  var e = r + "";
309
311
  return e == "0" && 1 / r == -nt ? "-0" : e;
310
312
  }
@@ -319,12 +321,12 @@ function ft(r) {
319
321
  var e = we(r);
320
322
  return e == at || e == lt || e == ot || e == ut;
321
323
  }
322
- var W = Q["__core-js_shared__"], Oe = function() {
324
+ var W = Q["__core-js_shared__"], Se = function() {
323
325
  var r = /[^.]+$/.exec(W && W.keys && W.keys.IE_PROTO || "");
324
326
  return r ? "Symbol(src)_1." + r : "";
325
327
  }();
326
328
  function ct(r) {
327
- return !!Oe && Oe in r;
329
+ return !!Se && Se in r;
328
330
  }
329
331
  var dt = Function.prototype, pt = dt.toString;
330
332
  function ht(r) {
@@ -356,19 +358,19 @@ function ee(r, e) {
356
358
  var t = It(r, e);
357
359
  return Ct(t) ? t : void 0;
358
360
  }
359
- var Fe = function() {
361
+ var je = function() {
360
362
  try {
361
363
  var r = ee(Object, "defineProperty");
362
364
  return r({}, "", {}), r;
363
365
  } catch {
364
366
  }
365
- }(), St = 9007199254740991, Ot = /^(?:0|[1-9]\d*)$/;
366
- function Ft(r, e) {
367
+ }(), Ot = 9007199254740991, St = /^(?:0|[1-9]\d*)$/;
368
+ function jt(r, e) {
367
369
  var t = typeof r;
368
- return e = e ?? St, !!e && (t == "number" || t != "symbol" && Ot.test(r)) && r > -1 && r % 1 == 0 && r < e;
370
+ return e = e ?? Ot, !!e && (t == "number" || t != "symbol" && St.test(r)) && r > -1 && r % 1 == 0 && r < e;
369
371
  }
370
- function jt(r, e, t) {
371
- e == "__proto__" && Fe ? Fe(r, e, {
372
+ function Ft(r, e, t) {
373
+ e == "__proto__" && je ? je(r, e, {
372
374
  configurable: !0,
373
375
  enumerable: !0,
374
376
  value: t,
@@ -381,7 +383,7 @@ function xe(r, e) {
381
383
  var wt = Object.prototype, Mt = wt.hasOwnProperty;
382
384
  function xt(r, e, t) {
383
385
  var i = r[e];
384
- (!(Mt.call(r, e) && xe(i, t)) || t === void 0 && !(e in r)) && jt(r, e, t);
386
+ (!(Mt.call(r, e) && xe(i, t)) || t === void 0 && !(e in r)) && Ft(r, e, t);
385
387
  }
386
388
  var Et = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Rt = /^\w*$/;
387
389
  function $t(r, e) {
@@ -571,7 +573,7 @@ function hr(r, e, t, i) {
571
573
  return r;
572
574
  if (s != a) {
573
575
  var p = l[f];
574
- d = i ? i(p, f, l) : void 0, d === void 0 && (d = G(p) ? p : Ft(e[s + 1]) ? [] : {});
576
+ d = i ? i(p, f, l) : void 0, d === void 0 && (d = G(p) ? p : jt(e[s + 1]) ? [] : {});
575
577
  }
576
578
  xt(l, f, d), l = l[f];
577
579
  }
@@ -665,11 +667,11 @@ class mr {
665
667
  const f = l.index, d = l.key, p = l.keyIndex;
666
668
  if (o.isUndefined(l.stable))
667
669
  return;
668
- const m = s.parseStable(l.stable), y = i == null ? void 0 : i.index, O = i == null ? void 0 : i.key;
670
+ const m = s.parseStable(l.stable), y = i == null ? void 0 : i.index, I = i == null ? void 0 : i.key;
669
671
  let _ = m;
670
672
  if (o.isProcessInprogress(_) || (n[p] = !0), i) {
671
- const v = s.processedSchemas.value[y][O][f][d];
672
- v && o.isObject(v) && d !== "component" && (_ = h(v, _)), s.processedSchemas.value[y][O][f][d] = _, s.stableUpdater(n);
673
+ const v = s.processedSchemas.value[y][I][f][d];
674
+ v && o.isObject(v) && d !== "component" && (_ = h(v, _)), s.processedSchemas.value[y][I][f][d] = _, s.stableUpdater(n);
673
675
  } else {
674
676
  const v = s.processedSchemas.value[f][d];
675
677
  v && o.isObject(v) && d !== "component" && (_ = h(v, _)), s.processedSchemas.value[f][d] = _, s.stableUpdater(n);
@@ -728,7 +730,7 @@ class mr {
728
730
  ).every((m) => {
729
731
  var y;
730
732
  return !((y = m == null ? void 0 : m.includes) != null && y.call(m, "undefined"));
731
- }) ? (f(p), this.defaultValueEffect.clearEffects(), j(() => {
733
+ }) ? (f(p), this.defaultValueEffect.clearEffects(), F(() => {
732
734
  d();
733
735
  })) : f(p);
734
736
  },
@@ -744,7 +746,7 @@ class mr {
744
746
  ).every((m) => {
745
747
  var y;
746
748
  return !((y = m == null ? void 0 : m.includes) != null && y.call(m, "undefined"));
747
- }) ? (f(p), this.defaultValueEffect.clearEffects(), j(() => {
749
+ }) ? (f(p), this.defaultValueEffect.clearEffects(), F(() => {
748
750
  d();
749
751
  })) : f(p);
750
752
  },
@@ -807,7 +809,7 @@ class mr {
807
809
  e.name.startsWith("__proform_onetime_") && (e.__proform_cached_result = n), this.promiseFieldParser(n, t, s, i);
808
810
  }
809
811
  else
810
- I(e) ? g(
812
+ S(e) ? g(
811
813
  () => e.value,
812
814
  () => {
813
815
  o.isUndefined(e.value) || (s && o.isObject(e.value) && !o.isNativeObject(e.value) ? this.objectParser({
@@ -821,7 +823,7 @@ class mr {
821
823
  immediate: !0,
822
824
  deep: !0
823
825
  }
824
- ) : S(e) ? g(
826
+ ) : j(e) ? g(
825
827
  () => e,
826
828
  () => {
827
829
  o.isUndefined(e) || (s && o.isObject(e) && !o.isNativeObject(e) ? this.objectParser({
@@ -951,7 +953,7 @@ class vr {
951
953
  u(this, "shared", K({}));
952
954
  this.setup = e, this.processor = new mr(this);
953
955
  const t = this.setup(this);
954
- if (this.ui = t.ui ?? c.presets.ui, this.runtimeAdapter = new br(this.ui), Object.assign(this.globalNativeFormOverride, this.runtimeAdapter.getRuntimeNative()), I(t.schemas))
956
+ if (this.ui = t.ui ?? c.presets.ui, this.runtimeAdapter = new br(this.ui), Object.assign(this.globalNativeFormOverride, this.runtimeAdapter.getRuntimeNative()), S(t.schemas))
955
957
  g(
956
958
  // @ts-expect-error
957
959
  () => t.schemas.value,
@@ -962,9 +964,9 @@ class vr {
962
964
  deep: !0
963
965
  }
964
966
  );
965
- else if (S(t.schemas)) {
967
+ else if (j(t.schemas)) {
966
968
  const i = g(() => t.schemas, () => {
967
- this.processor.parseSchemas(t.schemas), j(() => {
969
+ this.processor.parseSchemas(t.schemas), F(() => {
968
970
  i();
969
971
  });
970
972
  }, {
@@ -980,25 +982,25 @@ class vr {
980
982
  shared: this.shared,
981
983
  // share 增加防抖,当开发者在过程中进行 share 时避免频繁触发爆栈
982
984
  share: (t) => {
983
- I(t) ? g(() => t.value, () => {
985
+ S(t) ? g(() => t.value, () => {
984
986
  h(this.shared, t.value);
985
987
  }, {
986
988
  deep: !0,
987
989
  immediate: !0
988
- }) : S(t) ? g(() => t, () => {
990
+ }) : j(t) ? g(() => t, () => {
989
991
  h(this.shared, t);
990
992
  }, {
991
993
  deep: !0,
992
994
  immediate: !0
993
995
  }) : Object.keys(t).forEach((i) => {
994
- console.log(i, I(i), S(i)), I(t[i]) ? g(() => t[i].value, () => {
996
+ S(t[i]) ? g(() => t[i].value, () => {
995
997
  h(this.shared, {
996
998
  [i]: t[i].value
997
999
  });
998
1000
  }, {
999
1001
  deep: !0,
1000
1002
  immediate: !0
1001
- }) : S(t[i]) ? g(() => t[i], () => {
1003
+ }) : j(t[i]) ? g(() => t[i], () => {
1002
1004
  h(this.shared, {
1003
1005
  [i]: t[i]
1004
1006
  });
@@ -1027,15 +1029,15 @@ class vr {
1027
1029
  parentSchema: s,
1028
1030
  index: t
1029
1031
  }), p = n.name, m = e.componentProps ?? {}, y = C.placeholderPresetByComponentName;
1030
- let O = e.placeholder, _ = e.show;
1032
+ let I = e.placeholder, _ = e.show;
1031
1033
  _ === void 0 && (_ = !0);
1032
- let v = e.label ?? "", F;
1033
- if (e.runtime ? F = e.runtime : F = (s == null ? void 0 : s.runtime) ?? this.runtime, !o.isUndefined(t) && !o.isObjectEmpty(F) && (v = Y((ye = F == null ? void 0 : F.customizeListItemLabel) == null ? void 0 : ye.call(F, e.label ?? "", t + 1), "")), !O) {
1034
+ let v = e.label ?? "", O;
1035
+ if (e.runtime ? O = e.runtime : O = (s == null ? void 0 : s.runtime) ?? this.runtime, !o.isUndefined(t) && !o.isObjectEmpty(O) && (v = Y((ye = O == null ? void 0 : O.customizeListItemLabel) == null ? void 0 : ye.call(O, e.label ?? "", t + 1), "")), !I) {
1034
1036
  let N = "请输入";
1035
- o.isUndefined(p) ? O = `${N}${v}` : /* @ts-expect-error */ y[p.toLowerCase()] ? (N = // @ts-expect-error
1036
- y[p.toLowerCase()], O = `${N}${v}`) : (Object.keys(y).forEach((_e) => {
1037
+ o.isUndefined(p) ? I = `${N}${v}` : /* @ts-expect-error */ y[p.toLowerCase()] ? (N = // @ts-expect-error
1038
+ y[p.toLowerCase()], I = `${N}${v}`) : (Object.keys(y).forEach((_e) => {
1037
1039
  p.toLowerCase().includes(_e.toLowerCase()) && (N = y[_e]);
1038
- }), O = `${N}${v}`);
1040
+ }), I = `${N}${v}`);
1039
1041
  }
1040
1042
  const $e = this.runtimeAdapter.getRuntimeRequired({
1041
1043
  ...e,
@@ -1055,7 +1057,7 @@ class vr {
1055
1057
  Component: n,
1056
1058
  schema: e,
1057
1059
  baseModel: i,
1058
- placeholder: O,
1060
+ placeholder: I,
1059
1061
  componentSlots: Ue,
1060
1062
  props: m
1061
1063
  });
@@ -1484,7 +1486,7 @@ function Ir(r) {
1484
1486
  }
1485
1487
  ];
1486
1488
  }
1487
- function Sr(r) {
1489
+ function Or(r) {
1488
1490
  c.presets = r;
1489
1491
  }
1490
1492
  function re(r, e) {
@@ -1499,13 +1501,13 @@ function re(r, e) {
1499
1501
  writable: !0
1500
1502
  }), r;
1501
1503
  }
1502
- function Or(r) {
1504
+ function Sr(r) {
1503
1505
  return re(r, "native");
1504
1506
  }
1505
- function Fr(r) {
1507
+ function jr(r) {
1506
1508
  return r.__proform_raw_object = !0, r;
1507
1509
  }
1508
- function jr(r) {
1510
+ function Fr(r) {
1509
1511
  return re(r, "onetime");
1510
1512
  }
1511
1513
  function wr(r) {
@@ -1519,11 +1521,11 @@ function wr(r) {
1519
1521
  }
1520
1522
  export {
1521
1523
  Cr as ProForm,
1522
- Or as markNativeFunction,
1523
- Fr as markNativeObject,
1524
- jr as markOnetimeFunction,
1524
+ Sr as markNativeFunction,
1525
+ jr as markNativeObject,
1526
+ Fr as markOnetimeFunction,
1525
1527
  wr as markStructuredPathParsing,
1526
1528
  Ir as useForm,
1527
- Sr as useFormPresetConfigurer,
1529
+ Or as useFormPresetConfigurer,
1528
1530
  re as useModifiers
1529
1531
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harbor-design/proform",
3
- "version": "1.3.21",
3
+ "version": "1.3.23",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",