@harbor-design/proform 1.3.8 → 1.3.9

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.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- var Ue = Object.defineProperty;
2
- var ze = (t, e, r) => e in t ? Ue(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
1
+ var Te = Object.defineProperty;
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 T, watch as _, isReactive as q, toRaw as F, reactive as Pe, createVNode as g, mergeProps as N, withDirectives as Le, vShow as De, createTextVNode as Ge, isVNode as We, defineComponent as Be } from "vue";
4
+ import { ref as z, readonly as _e, nextTick as P, isRef as q, watch as _, isReactive as U, toRaw as F, reactive as Pe, createVNode as g, mergeProps as N, withDirectives as Le, vShow as De, createTextVNode as Ge, isVNode as We, defineComponent as Be } from "vue";
5
5
  class o {
6
6
  static typeChecker(e) {
7
7
  return {}.toString.call(e);
@@ -145,7 +145,7 @@ class ke {
145
145
  P(() => {
146
146
  this.runtimeCore.hydrateEffect.trackEffect(
147
147
  () => {
148
- T(e) ? _(
148
+ q(e) ? _(
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
- ) : q(e) ? _(
157
+ ) : U(e) ? _(
158
158
  () => e,
159
159
  () => {
160
160
  h(this.runtimeCore.model.value, e);
@@ -173,7 +173,7 @@ class ke {
173
173
  }
174
174
  share(e) {
175
175
  P(() => {
176
- if (T(e)) {
176
+ if (q(e)) {
177
177
  const r = _(
178
178
  () => e.value,
179
179
  () => {
@@ -186,7 +186,7 @@ class ke {
186
186
  immediate: !0
187
187
  }
188
188
  );
189
- } else if (q(e)) {
189
+ } else if (U(e)) {
190
190
  const r = _(
191
191
  () => e,
192
192
  () => {
@@ -247,7 +247,7 @@ class X {
247
247
  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);
248
248
  }
249
249
  }
250
- var He = typeof global == "object" && global && global.Object === Object && global, Ke = typeof self == "object" && self && self.Object === Object && self, Z = He || Ke || Function("return this")(), x = Z.Symbol, je = Object.prototype, Xe = je.hasOwnProperty, Ye = je.toString, V = x ? x.toStringTag : void 0;
250
+ var He = typeof global == "object" && global && global.Object === Object && global, Ke = typeof self == "object" && self && self.Object === Object && self, Z = He || Ke || Function("return this")(), x = Z.Symbol, Me = Object.prototype, Xe = Me.hasOwnProperty, Ye = Me.toString, V = x ? x.toStringTag : void 0;
251
251
  function Ze(t) {
252
252
  var e = Xe.call(t, V), r = t[V];
253
253
  try {
@@ -263,7 +263,7 @@ function Ae(t) {
263
263
  return Qe.call(t);
264
264
  }
265
265
  var et = "[object Null]", tt = "[object Undefined]", Ce = x ? x.toStringTag : void 0;
266
- function Ee(t) {
266
+ function je(t) {
267
267
  return t == null ? t === void 0 ? tt : et : Ce && Ce in Object(t) ? Ze(t) : Ae(t);
268
268
  }
269
269
  function rt(t) {
@@ -271,7 +271,7 @@ function rt(t) {
271
271
  }
272
272
  var st = "[object Symbol]";
273
273
  function J(t) {
274
- return typeof t == "symbol" || rt(t) && Ee(t) == st;
274
+ return typeof t == "symbol" || rt(t) && je(t) == st;
275
275
  }
276
276
  function it(t, e) {
277
277
  for (var r = -1, s = t == null ? 0 : t.length, i = Array(s); ++r < s; )
@@ -297,7 +297,7 @@ var ot = "[object AsyncFunction]", at = "[object Function]", lt = "[object Gener
297
297
  function ct(t) {
298
298
  if (!G(t))
299
299
  return !1;
300
- var e = Ee(t);
300
+ var e = je(t);
301
301
  return e == at || e == lt || e == ot || e == ut;
302
302
  }
303
303
  var k = Z["__core-js_shared__"], Oe = function() {
@@ -337,19 +337,19 @@ function A(t, e) {
337
337
  var r = It(t, e);
338
338
  return Ct(r) ? r : void 0;
339
339
  }
340
- var Me = function() {
340
+ var Ee = function() {
341
341
  try {
342
342
  var t = A(Object, "defineProperty");
343
343
  return t({}, "", {}), t;
344
344
  } catch {
345
345
  }
346
346
  }(), St = 9007199254740991, Ot = /^(?:0|[1-9]\d*)$/;
347
- function Mt(t, e) {
347
+ function Et(t, e) {
348
348
  var r = typeof t;
349
349
  return e = e ?? St, !!e && (r == "number" || r != "symbol" && Ot.test(t)) && t > -1 && t % 1 == 0 && t < e;
350
350
  }
351
- function jt(t, e, r) {
352
- e == "__proto__" && Me ? Me(t, e, {
351
+ function Mt(t, e, r) {
352
+ e == "__proto__" && Ee ? Ee(t, e, {
353
353
  configurable: !0,
354
354
  enumerable: !0,
355
355
  value: r,
@@ -359,10 +359,10 @@ function jt(t, e, r) {
359
359
  function Fe(t, e) {
360
360
  return t === e || t !== t && e !== e;
361
361
  }
362
- var Et = Object.prototype, wt = Et.hasOwnProperty;
362
+ var jt = Object.prototype, wt = jt.hasOwnProperty;
363
363
  function Ft(t, e, r) {
364
364
  var s = t[e];
365
- (!(wt.call(t, e) && Fe(s, r)) || r === void 0 && !(e in t)) && jt(t, e, r);
365
+ (!(wt.call(t, e) && Fe(s, r)) || r === void 0 && !(e in t)) && Mt(t, e, r);
366
366
  }
367
367
  var xt = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Rt = /^\w*$/;
368
368
  function $t(t, e) {
@@ -371,45 +371,45 @@ function $t(t, e) {
371
371
  var r = typeof t;
372
372
  return r == "number" || r == "symbol" || r == "boolean" || t == null || J(t) ? !0 : Rt.test(t) || !xt.test(t) || e != null && t in Object(e);
373
373
  }
374
- var U = A(Object, "create");
374
+ var T = A(Object, "create");
375
375
  function Vt() {
376
- this.__data__ = U ? U(null) : {}, this.size = 0;
376
+ this.__data__ = T ? T(null) : {}, this.size = 0;
377
377
  }
378
378
  function Nt(t) {
379
379
  var e = this.has(t) && delete this.__data__[t];
380
380
  return this.size -= e ? 1 : 0, e;
381
381
  }
382
- var Tt = "__lodash_hash_undefined__", qt = Object.prototype, Ut = qt.hasOwnProperty;
382
+ var qt = "__lodash_hash_undefined__", Ut = Object.prototype, Tt = Ut.hasOwnProperty;
383
383
  function zt(t) {
384
384
  var e = this.__data__;
385
- if (U) {
385
+ if (T) {
386
386
  var r = e[t];
387
- return r === Tt ? void 0 : r;
387
+ return r === qt ? void 0 : r;
388
388
  }
389
- return Ut.call(e, t) ? e[t] : void 0;
389
+ return Tt.call(e, t) ? e[t] : void 0;
390
390
  }
391
391
  var Lt = Object.prototype, Dt = Lt.hasOwnProperty;
392
392
  function Gt(t) {
393
393
  var e = this.__data__;
394
- return U ? e[t] !== void 0 : Dt.call(e, t);
394
+ return T ? e[t] !== void 0 : Dt.call(e, t);
395
395
  }
396
396
  var Wt = "__lodash_hash_undefined__";
397
397
  function Bt(t, e) {
398
398
  var r = this.__data__;
399
- return this.size += this.has(t) ? 0 : 1, r[t] = U && e === void 0 ? Wt : e, this;
399
+ return this.size += this.has(t) ? 0 : 1, r[t] = T && e === void 0 ? Wt : e, this;
400
400
  }
401
- function M(t) {
401
+ function E(t) {
402
402
  var e = -1, r = t == null ? 0 : t.length;
403
403
  for (this.clear(); ++e < r; ) {
404
404
  var s = t[e];
405
405
  this.set(s[0], s[1]);
406
406
  }
407
407
  }
408
- M.prototype.clear = Vt;
409
- M.prototype.delete = Nt;
410
- M.prototype.get = zt;
411
- M.prototype.has = Gt;
412
- M.prototype.set = Bt;
408
+ E.prototype.clear = Vt;
409
+ E.prototype.delete = Nt;
410
+ E.prototype.get = zt;
411
+ E.prototype.has = Gt;
412
+ E.prototype.set = Bt;
413
413
  function kt() {
414
414
  this.__data__ = [], this.size = 0;
415
415
  }
@@ -453,9 +453,9 @@ R.prototype.set = Jt;
453
453
  var Qt = A(Z, "Map");
454
454
  function At() {
455
455
  this.size = 0, this.__data__ = {
456
- hash: new M(),
456
+ hash: new E(),
457
457
  map: new (Qt || R)(),
458
- string: new M()
458
+ string: new E()
459
459
  };
460
460
  }
461
461
  function er(t) {
@@ -480,18 +480,18 @@ function ir(t, e) {
480
480
  var r = B(this, t), s = r.size;
481
481
  return r.set(t, e), this.size += r.size == s ? 0 : 1, this;
482
482
  }
483
- function j(t) {
483
+ function M(t) {
484
484
  var e = -1, r = t == null ? 0 : t.length;
485
485
  for (this.clear(); ++e < r; ) {
486
486
  var s = t[e];
487
487
  this.set(s[0], s[1]);
488
488
  }
489
489
  }
490
- j.prototype.clear = At;
491
- j.prototype.delete = tr;
492
- j.prototype.get = rr;
493
- j.prototype.has = sr;
494
- j.prototype.set = ir;
490
+ M.prototype.clear = At;
491
+ M.prototype.delete = tr;
492
+ M.prototype.get = rr;
493
+ M.prototype.has = sr;
494
+ M.prototype.set = ir;
495
495
  var nr = "Expected a function";
496
496
  function ee(t, e) {
497
497
  if (typeof t != "function" || e != null && typeof e != "function")
@@ -503,9 +503,9 @@ function ee(t, e) {
503
503
  var a = t.apply(this, s);
504
504
  return r.cache = n.set(i, a) || n, a;
505
505
  };
506
- return r.cache = new (ee.Cache || j)(), r;
506
+ return r.cache = new (ee.Cache || M)(), r;
507
507
  }
508
- ee.Cache = j;
508
+ ee.Cache = M;
509
509
  var or = 500;
510
510
  function ar(t) {
511
511
  var e = ee(t, function(s) {
@@ -552,7 +552,7 @@ function hr(t, e, r, s) {
552
552
  return t;
553
553
  if (i != a) {
554
554
  var p = l[c];
555
- d = s ? s(p, c, l) : void 0, d === void 0 && (d = G(p) ? p : Mt(e[i + 1]) ? [] : {});
555
+ d = s ? s(p, c, l) : void 0, d === void 0 && (d = G(p) ? p : Et(e[i + 1]) ? [] : {});
556
556
  }
557
557
  Ft(l, c, d), l = l[c];
558
558
  }
@@ -578,14 +578,11 @@ class mr {
578
578
  u(this, "defaultValueInprogressMap", /* @__PURE__ */ new Map());
579
579
  u(this, "baseDefaultValueFunctionsLength");
580
580
  u(this, "isModelInitialized", !0);
581
- u(this, "modelTriggerTimer");
582
581
  u(this, "reactiveWatchMap", /* @__PURE__ */ new Map());
583
582
  this.runtimeCore = e, this.processedSchemas = e.schemas, this.processedModel = e.model, this.getRuntimeMeta = e.getRuntimeMeta.bind(e), _(
584
583
  () => this.processedModel.value,
585
584
  () => {
586
- this.modelTriggerTimer && clearTimeout(this.modelTriggerTimer), this.modelTriggerTimer = setTimeout(() => {
587
- this.schemaEffect.triggerEffects();
588
- }, 0);
585
+ this.schemaEffect.triggerEffects();
589
586
  },
590
587
  {
591
588
  deep: !0
@@ -792,7 +789,7 @@ class mr {
792
789
  e.name.startsWith("__proform_onetime_") && (e.__proform_cached_result = n), this.promiseFieldParser(n, r, i, s);
793
790
  }
794
791
  else
795
- T(e) ? _(
792
+ q(e) ? _(
796
793
  () => e.value,
797
794
  () => {
798
795
  o.isUndefined(e.value) || (i && o.isObject(e.value) && !o.isNativeObject(e.value) ? this.objectParser({
@@ -806,7 +803,7 @@ class mr {
806
803
  immediate: !0,
807
804
  deep: !0
808
805
  }
809
- ) : q(e) ? _(
806
+ ) : U(e) ? _(
810
807
  () => e,
811
808
  () => {
812
809
  this.reactiveWatchMap.get(e) || (this.reactiveWatchMap.set(e, !0), !o.isArrayEmpty(e) && !o.isObjectEmpty(e) && (o.isUndefined(e) || (i && o.isObject(e) && !o.isNativeObject(e) ? this.objectParser({
@@ -852,7 +849,7 @@ class mr {
852
849
  }
853
850
  }
854
851
  }
855
- class E {
852
+ class j {
856
853
  static getFormContainer({ ui: e } = {}) {
857
854
  return f.presets.uiPresets[e ?? f.presets.ui].container.Form;
858
855
  }
@@ -936,7 +933,7 @@ class br {
936
933
  u(this, "shared", {});
937
934
  this.setup = e, this.processor = new mr(this);
938
935
  const r = this.setup(this);
939
- this.ui = r.ui ?? f.presets.ui, this.runtimeAdapter = new gr(this.ui), Object.assign(this.globalNativeFormOverride, this.runtimeAdapter.getRuntimeNative()), T(r.schemas) ? _(
936
+ this.ui = r.ui ?? f.presets.ui, this.runtimeAdapter = new gr(this.ui), Object.assign(this.globalNativeFormOverride, this.runtimeAdapter.getRuntimeNative()), q(r.schemas) ? _(
940
937
  // @ts-expect-error
941
938
  () => r.schemas.value,
942
939
  () => {
@@ -946,7 +943,7 @@ class br {
946
943
  deep: !0,
947
944
  immediate: !0
948
945
  }
949
- ) : q(r.schemas) ? _(() => r.schemas, () => {
946
+ ) : U(r.schemas) ? _(() => r.schemas, () => {
950
947
  this.processor.schemaEffect.clearEffects(), this.processor.processedSchemas.value = [], this.processor.processedModel.value = {}, this.processor.stableModel = {}, this.processor.parseSchemas(r.schemas);
951
948
  }, {
952
949
  deep: !0,
@@ -960,18 +957,18 @@ class br {
960
957
  shared: this.shared,
961
958
  // share 增加防抖,当开发者在过程中进行 share 时避免频繁触发爆栈
962
959
  share: (r) => {
963
- if (T(r)) {
960
+ if (q(r)) {
964
961
  const s = _(() => r.value, () => {
965
- h(this.shared, r.value), P(() => {
962
+ h(this.shared, r.value), this.processor.schemaEffect.triggerEffects(), P(() => {
966
963
  s();
967
964
  });
968
965
  }, {
969
966
  deep: !0,
970
967
  immediate: !0
971
968
  });
972
- } else if (q(r)) {
969
+ } else if (U(r)) {
973
970
  const s = _(() => r, () => {
974
- h(this.shared, r), P(() => {
971
+ h(this.shared, r), this.processor.schemaEffect.triggerEffects(), P(() => {
975
972
  s();
976
973
  });
977
974
  }, {
@@ -979,7 +976,7 @@ class br {
979
976
  immediate: !0
980
977
  });
981
978
  } else
982
- h(this.shared, r);
979
+ h(this.shared, r), this.processor.schemaEffect.triggerEffects();
983
980
  }
984
981
  };
985
982
  }
@@ -1011,7 +1008,7 @@ class br {
1011
1008
  const $e = this.runtimeAdapter.getRuntimeRequired({
1012
1009
  ...e,
1013
1010
  label: y
1014
- }), Ve = E.getItemContainer(this), Ne = E.getFormItemContainer(this), Te = this, qe = e.componentSlots;
1011
+ }), Ve = j.getItemContainer(this), Ne = j.getFormItemContainer(this), qe = this, Ue = e.componentSlots;
1015
1012
  return g("div", {
1016
1013
  style: l
1017
1014
  }, [g(Ve, {
@@ -1022,12 +1019,12 @@ class br {
1022
1019
  label: `${y ? `${y}:` : ""}`
1023
1020
  }, d, $e), {
1024
1021
  default() {
1025
- return Te.runtimeAdapter.formComponentRenderer({
1022
+ return qe.runtimeAdapter.formComponentRenderer({
1026
1023
  Component: n,
1027
1024
  schema: e,
1028
1025
  baseModel: s,
1029
1026
  placeholder: S,
1030
- componentSlots: qe,
1027
+ componentSlots: Ue,
1031
1028
  props: m
1032
1029
  });
1033
1030
  },
@@ -1042,7 +1039,7 @@ class br {
1042
1039
  display: "grid",
1043
1040
  gridColumn: "1 / -1",
1044
1041
  ...e.grid
1045
- }, i = E.getGroupContainer(this);
1042
+ }, i = j.getGroupContainer(this);
1046
1043
  let n = e.show;
1047
1044
  return n === void 0 && (n = !0), g("div", {
1048
1045
  style: s
@@ -1054,7 +1051,7 @@ class br {
1054
1051
  }
1055
1052
  addListItem(e) {
1056
1053
  var r, s;
1057
- if (!((r = this.processor.stableModel[e.field]) != null && r[0]))
1054
+ if (console.log("this", this.processor.stableModel), !((r = this.processor.stableModel[e.field]) != null && r[0]))
1058
1055
  return Promise.reject({
1059
1056
  code: "0001",
1060
1057
  message: "异步默认值数据正在处理中,请您耐心等待... "
@@ -1073,7 +1070,7 @@ class br {
1073
1070
  s.model.value[e.field] || (s.model.value[e.field] = [{}]);
1074
1071
  let i = e.show;
1075
1072
  i === void 0 && (i = !0);
1076
- const n = E.getListContainer(this), a = E.getListItemContainer(this);
1073
+ const n = j.getListContainer(this), a = j.getListItemContainer(this);
1077
1074
  return g("div", {
1078
1075
  style: r
1079
1076
  }, [i && g(n, {
@@ -1115,7 +1112,7 @@ class br {
1115
1112
  gridColumn: "1 / -1",
1116
1113
  gridAutoColumns: "1fr",
1117
1114
  ...this.grid
1118
- }, r = this, s = h(this.globalNativeFormOverride.props.Form, C((c = (l = this.native) == null ? void 0 : l.props) == null ? void 0 : c.Form) ?? {}), i = h(this.globalNativeFormOverride.slots.Form, C((p = (d = this.native) == null ? void 0 : d.slots) == null ? void 0 : p.Form) ?? {}), n = E.getFormContainer(this), a = this.runtimeAdapter.getFormModelPropName();
1115
+ }, r = this, s = h(this.globalNativeFormOverride.props.Form, C((c = (l = this.native) == null ? void 0 : l.props) == null ? void 0 : c.Form) ?? {}), i = h(this.globalNativeFormOverride.slots.Form, C((p = (d = this.native) == null ? void 0 : d.slots) == null ? void 0 : p.Form) ?? {}), n = j.getFormContainer(this), a = this.runtimeAdapter.getFormModelPropName();
1119
1116
  return g(n, N(s, {
1120
1117
  ref: this.formRef
1121
1118
  }, {
@@ -1473,13 +1470,13 @@ function te(t, e) {
1473
1470
  function Or(t) {
1474
1471
  return te(t, "native");
1475
1472
  }
1476
- function Mr(t) {
1473
+ function Er(t) {
1477
1474
  return t.__proform_raw_object = !0, t;
1478
1475
  }
1479
- function jr(t) {
1476
+ function Mr(t) {
1480
1477
  return te(t, "onetime");
1481
1478
  }
1482
- function Er(t) {
1479
+ function jr(t) {
1483
1480
  function e() {
1484
1481
  return t;
1485
1482
  }
@@ -1491,9 +1488,9 @@ function Er(t) {
1491
1488
  export {
1492
1489
  Cr as ProForm,
1493
1490
  Or as markNativeFunction,
1494
- Mr as markNativeObject,
1495
- jr as markOnetimeFunction,
1496
- Er as markStructuredPathParsing,
1491
+ Er as markNativeObject,
1492
+ Mr as markOnetimeFunction,
1493
+ jr as markStructuredPathParsing,
1497
1494
  Ir as useForm,
1498
1495
  Sr as useFormPresetConfigurer,
1499
1496
  te as useModifiers
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { Ref } from "vue";
3
2
  import { AnyObject, Schema, ProxyedSchema, AnyFunction, ObjectParserRoot } from "../../types";
4
3
  import { RuntimeCore } from "..";
@@ -23,7 +22,6 @@ export default class Processor {
23
22
  defaultValueInprogressMap: Map<any, any>;
24
23
  baseDefaultValueFunctionsLength: number;
25
24
  isModelInitialized: boolean;
26
- modelTriggerTimer: NodeJS.Timeout;
27
25
  reactiveWatchMap: Map<any, any>;
28
26
  constructor(runtimeCore: RuntimeCore);
29
27
  parse<T extends object = any>(data: T[], parentMeta?: AnyObject): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harbor-design/proform",
3
- "version": "1.3.8",
3
+ "version": "1.3.9",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",