@harbor-design/proform 1.3.3 → 1.3.4

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
1
  var Ue = Object.defineProperty;
2
2
  var ze = (t, e, r) => e in t ? Ue(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 E, reactive as Pe, createVNode as g, 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 T, watch as _, isReactive as q, toRaw as E, 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);
@@ -121,7 +121,7 @@ function C(t) {
121
121
  function K(t, e) {
122
122
  return t.replace(/undefined/g, e);
123
123
  }
124
- class He {
124
+ class ke {
125
125
  constructor(e) {
126
126
  u(this, "runtimeCore");
127
127
  u(this, "readonlyReactiveModel", z({}));
@@ -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 We = typeof global == "object" && global && global.Object === Object && global, Ke = typeof self == "object" && self && self.Object === Object && self, Z = We || 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 {
@@ -279,11 +279,11 @@ function st(t, e) {
279
279
  return s;
280
280
  }
281
281
  var Q = Array.isArray, nt = 1 / 0, Ie = x ? x.prototype : void 0, Se = Ie ? Ie.toString : void 0;
282
- function Me(t) {
282
+ function Fe(t) {
283
283
  if (typeof t == "string")
284
284
  return t;
285
285
  if (Q(t))
286
- return st(t, Me) + "";
286
+ return st(t, Fe) + "";
287
287
  if (J(t))
288
288
  return Se ? Se.call(t) : "";
289
289
  var e = t + "";
@@ -300,8 +300,8 @@ function ct(t) {
300
300
  var e = we(t);
301
301
  return e == at || e == lt || e == ot || e == ut;
302
302
  }
303
- var H = Z["__core-js_shared__"], Oe = function() {
304
- var t = /[^.]+$/.exec(H && H.keys && H.keys.IE_PROTO || "");
303
+ var k = Z["__core-js_shared__"], Oe = function() {
304
+ var t = /[^.]+$/.exec(k && k.keys && k.keys.IE_PROTO || "");
305
305
  return t ? "Symbol(src)_1." + t : "";
306
306
  }();
307
307
  function ft(t) {
@@ -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 Fe = function() {
340
+ var je = 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 Ft(t, e) {
347
+ function jt(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__" && Fe ? Fe(t, e, {
351
+ function Mt(t, e, r) {
352
+ e == "__proto__" && je ? je(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 Ee(t, e) {
360
360
  return t === e || t !== t && e !== e;
361
361
  }
362
- var wt = Object.prototype, Mt = wt.hasOwnProperty;
362
+ var wt = Object.prototype, Ft = wt.hasOwnProperty;
363
363
  function Et(t, e, r) {
364
364
  var i = t[e];
365
- (!(Mt.call(t, e) && Ee(i, r)) || r === void 0 && !(e in t)) && jt(t, e, r);
365
+ (!(Ft.call(t, e) && Ee(i, 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) {
@@ -393,49 +393,49 @@ function Gt(t) {
393
393
  var e = this.__data__;
394
394
  return U ? e[t] !== void 0 : Dt.call(e, t);
395
395
  }
396
- var Bt = "__lodash_hash_undefined__";
397
- function kt(t, e) {
396
+ var Wt = "__lodash_hash_undefined__";
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 ? Bt : e, this;
399
+ return this.size += this.has(t) ? 0 : 1, r[t] = U && e === void 0 ? Wt : e, this;
400
400
  }
401
- function F(t) {
401
+ function j(t) {
402
402
  var e = -1, r = t == null ? 0 : t.length;
403
403
  for (this.clear(); ++e < r; ) {
404
404
  var i = t[e];
405
405
  this.set(i[0], i[1]);
406
406
  }
407
407
  }
408
- F.prototype.clear = Vt;
409
- F.prototype.delete = Nt;
410
- F.prototype.get = zt;
411
- F.prototype.has = Gt;
412
- F.prototype.set = kt;
413
- function Ht() {
408
+ j.prototype.clear = Vt;
409
+ j.prototype.delete = Nt;
410
+ j.prototype.get = zt;
411
+ j.prototype.has = Gt;
412
+ j.prototype.set = Bt;
413
+ function kt() {
414
414
  this.__data__ = [], this.size = 0;
415
415
  }
416
- function B(t, e) {
416
+ function W(t, e) {
417
417
  for (var r = t.length; r--; )
418
418
  if (Ee(t[r][0], e))
419
419
  return r;
420
420
  return -1;
421
421
  }
422
- var Wt = Array.prototype, Kt = Wt.splice;
422
+ var Ht = Array.prototype, Kt = Ht.splice;
423
423
  function Xt(t) {
424
- var e = this.__data__, r = B(e, t);
424
+ var e = this.__data__, r = W(e, t);
425
425
  if (r < 0)
426
426
  return !1;
427
427
  var i = e.length - 1;
428
428
  return r == i ? e.pop() : Kt.call(e, r, 1), --this.size, !0;
429
429
  }
430
430
  function Yt(t) {
431
- var e = this.__data__, r = B(e, t);
431
+ var e = this.__data__, r = W(e, t);
432
432
  return r < 0 ? void 0 : e[r][1];
433
433
  }
434
434
  function Zt(t) {
435
- return B(this.__data__, t) > -1;
435
+ return W(this.__data__, t) > -1;
436
436
  }
437
437
  function Jt(t, e) {
438
- var r = this.__data__, i = B(r, t);
438
+ var r = this.__data__, i = W(r, t);
439
439
  return i < 0 ? (++this.size, r.push([t, e])) : r[i][1] = e, this;
440
440
  }
441
441
  function R(t) {
@@ -445,7 +445,7 @@ function R(t) {
445
445
  this.set(i[0], i[1]);
446
446
  }
447
447
  }
448
- R.prototype.clear = Ht;
448
+ R.prototype.clear = kt;
449
449
  R.prototype.delete = Xt;
450
450
  R.prototype.get = Yt;
451
451
  R.prototype.has = Zt;
@@ -453,45 +453,45 @@ 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 F(),
456
+ hash: new j(),
457
457
  map: new (Qt || R)(),
458
- string: new F()
458
+ string: new j()
459
459
  };
460
460
  }
461
461
  function er(t) {
462
462
  var e = typeof t;
463
463
  return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
464
464
  }
465
- function k(t, e) {
465
+ function B(t, e) {
466
466
  var r = t.__data__;
467
467
  return er(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
468
468
  }
469
469
  function tr(t) {
470
- var e = k(this, t).delete(t);
470
+ var e = B(this, t).delete(t);
471
471
  return this.size -= e ? 1 : 0, e;
472
472
  }
473
473
  function rr(t) {
474
- return k(this, t).get(t);
474
+ return B(this, t).get(t);
475
475
  }
476
476
  function ir(t) {
477
- return k(this, t).has(t);
477
+ return B(this, t).has(t);
478
478
  }
479
479
  function sr(t, e) {
480
- var r = k(this, t), i = r.size;
480
+ var r = B(this, t), i = r.size;
481
481
  return r.set(t, e), this.size += r.size == i ? 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 i = t[e];
487
487
  this.set(i[0], i[1]);
488
488
  }
489
489
  }
490
- j.prototype.clear = At;
491
- j.prototype.delete = tr;
492
- j.prototype.get = rr;
493
- j.prototype.has = ir;
494
- j.prototype.set = sr;
490
+ M.prototype.clear = At;
491
+ M.prototype.delete = tr;
492
+ M.prototype.get = rr;
493
+ M.prototype.has = ir;
494
+ M.prototype.set = sr;
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, i);
504
504
  return r.cache = n.set(s, 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(i) {
@@ -520,7 +520,7 @@ var lr = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=
520
520
  }), e;
521
521
  });
522
522
  function fr(t) {
523
- return t == null ? "" : Me(t);
523
+ return t == null ? "" : Fe(t);
524
524
  }
525
525
  function xe(t, e) {
526
526
  return Q(t) ? t : $t(t, e) ? [t] : cr(fr(t));
@@ -552,7 +552,7 @@ function hr(t, e, r, i) {
552
552
  return t;
553
553
  if (s != a) {
554
554
  var p = l[c];
555
- d = i ? i(p, c, l) : void 0, d === void 0 && (d = G(p) ? p : Ft(e[s + 1]) ? [] : {});
555
+ d = i ? i(p, c, l) : void 0, d === void 0 && (d = G(p) ? p : jt(e[s + 1]) ? [] : {});
556
556
  }
557
557
  Et(l, c, d), l = l[c];
558
558
  }
@@ -579,6 +579,7 @@ class mr {
579
579
  u(this, "baseDefaultValueFunctionsLength");
580
580
  u(this, "isModelInitialized", !0);
581
581
  u(this, "modelTriggerTimer");
582
+ u(this, "reactiveWatchMap", /* @__PURE__ */ new Map());
582
583
  this.runtimeCore = e, this.processedSchemas = e.schemas, this.processedModel = e.model, this.getRuntimeMeta = e.getRuntimeMeta.bind(e), _(
583
584
  () => this.processedModel.value,
584
585
  () => {
@@ -808,12 +809,12 @@ class mr {
808
809
  ) : q(e) ? _(
809
810
  () => e,
810
811
  () => {
811
- o.isUndefined(e) || (s && o.isObject(e) && !o.isNativeObject(e) ? this.objectParser({
812
+ this.reactiveWatchMap.get(e) || (this.reactiveWatchMap.set(e, !0), !o.isArrayEmpty(e) && !o.isObjectEmpty(e) && (o.isUndefined(e) || (s && o.isObject(e) && !o.isNativeObject(e) ? this.objectParser({
812
813
  data: e,
813
814
  updater: r,
814
815
  index: i.rootIndex,
815
816
  parentMeta: i.parentMeta
816
- }) : r(e));
817
+ }) : r(e))));
817
818
  },
818
819
  {
819
820
  immediate: !0,
@@ -906,7 +907,7 @@ class gr {
906
907
  }
907
908
  }
908
909
  function yr(t) {
909
- return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !Be(t);
910
+ return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !We(t);
910
911
  }
911
912
  class br {
912
913
  constructor(e) {
@@ -1145,7 +1146,7 @@ class f {
1145
1146
  }
1146
1147
  }
1147
1148
  u(f, "presets");
1148
- function W({
1149
+ function H({
1149
1150
  parentSchema: t,
1150
1151
  schema: e,
1151
1152
  index: r
@@ -1155,7 +1156,7 @@ function W({
1155
1156
  const vr = {
1156
1157
  ArcoVue: {
1157
1158
  getRuntimeField(t) {
1158
- const e = W(t);
1159
+ const e = H(t);
1159
1160
  return o.isFunction(e) ? {
1160
1161
  field: e()
1161
1162
  } : {
@@ -1222,7 +1223,7 @@ const vr = {
1222
1223
  },
1223
1224
  NutUI: {
1224
1225
  getRuntimeField(t) {
1225
- const e = W(t);
1226
+ const e = H(t);
1226
1227
  return o.isFunction(e) ? {
1227
1228
  prop: e()
1228
1229
  } : {
@@ -1295,7 +1296,7 @@ const vr = {
1295
1296
  },
1296
1297
  NaiveUI: {
1297
1298
  getRuntimeField(t) {
1298
- const e = W(t);
1299
+ const e = H(t);
1299
1300
  return o.isFunction(e) ? {
1300
1301
  path: e()
1301
1302
  } : {
@@ -1363,7 +1364,7 @@ const vr = {
1363
1364
  (r = (e = t.formRef.value) == null ? void 0 : e.restoreValidation) == null || r.call(e);
1364
1365
  }
1365
1366
  }
1366
- }, M = class M {
1367
+ }, F = class F {
1367
1368
  static getPlaceholderPrefixPresetByComponentName() {
1368
1369
  const e = {
1369
1370
  请选择: ["select", "tree"],
@@ -1376,7 +1377,7 @@ const vr = {
1376
1377
  return r;
1377
1378
  }
1378
1379
  };
1379
- u(M, "schemaPreset", {
1380
+ u(F, "schemaPreset", {
1380
1381
  type: {
1381
1382
  defaultValue: "item"
1382
1383
  },
@@ -1422,19 +1423,19 @@ u(M, "schemaPreset", {
1422
1423
  runtime: {
1423
1424
  default: void 0
1424
1425
  }
1425
- }), u(M, "componentPropsPreset", {
1426
+ }), u(F, "componentPropsPreset", {
1426
1427
  options: {
1427
1428
  defaultValue: []
1428
1429
  }
1429
1430
  }), // 基于基本功能提出基本预设
1430
- u(M, "placeholderPresetByComponentName", M.getPlaceholderPrefixPresetByComponentName());
1431
- let Y = M;
1431
+ u(F, "placeholderPresetByComponentName", F.getPlaceholderPrefixPresetByComponentName());
1432
+ let Y = F;
1432
1433
  const I = {
1433
1434
  ...Y,
1434
1435
  adapters: {
1435
1436
  ...vr
1436
1437
  }
1437
- }, Cr = /* @__PURE__ */ ke({
1438
+ }, Cr = /* @__PURE__ */ Be({
1438
1439
  props: {
1439
1440
  setup: {
1440
1441
  type: Function,
@@ -1447,7 +1448,7 @@ const I = {
1447
1448
  }
1448
1449
  });
1449
1450
  function Ir(t) {
1450
- const e = new He(t);
1451
+ const e = new ke(t);
1451
1452
  return [
1452
1453
  e.setup.bind(e),
1453
1454
  {
@@ -1477,10 +1478,10 @@ function te(t, e) {
1477
1478
  function Or(t) {
1478
1479
  return te(t, "native");
1479
1480
  }
1480
- function Fr(t) {
1481
+ function jr(t) {
1481
1482
  return t.__proform_raw_object = !0, t;
1482
1483
  }
1483
- function jr(t) {
1484
+ function Mr(t) {
1484
1485
  return te(t, "onetime");
1485
1486
  }
1486
1487
  function wr(t) {
@@ -1495,8 +1496,8 @@ function wr(t) {
1495
1496
  export {
1496
1497
  Cr as ProForm,
1497
1498
  Or as markNativeFunction,
1498
- Fr as markNativeObject,
1499
- jr as markOnetimeFunction,
1499
+ jr as markNativeObject,
1500
+ Mr as markOnetimeFunction,
1500
1501
  wr as markStructuredPathParsing,
1501
1502
  Ir as useForm,
1502
1503
  Sr as useFormPresetConfigurer,
@@ -24,6 +24,7 @@ export default class Processor {
24
24
  baseDefaultValueFunctionsLength: number;
25
25
  isModelInitialized: boolean;
26
26
  modelTriggerTimer: NodeJS.Timeout;
27
+ reactiveWatchMap: Map<any, any>;
27
28
  constructor(runtimeCore: RuntimeCore);
28
29
  parse<T extends object = any>(data: T[], parentMeta?: AnyObject): void;
29
30
  initSchemas(schemas: AnyObject[]): AnyObject[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harbor-design/proform",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",