@harbor-design/proform 1.1.22 → 1.1.24

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 +32 -26
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  var oe = Object.defineProperty;
2
2
  var ne = (r, e, t) => e in r ? oe(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
3
  var a = (r, e, t) => (ne(r, typeof e != "symbol" ? e + "" : e, t), t);
4
- import { isRef as x, watch as I, isReactive as k, toRaw as j, nextTick as w, ref as q, reactive as le, createVNode as p, withDirectives as Z, mergeProps as R, vShow as A, createTextVNode as ae, isVNode as ue, defineComponent as ce } from "vue";
4
+ import { isRef as x, watch as I, isReactive as z, toRaw as j, nextTick as w, ref as q, reactive as le, createVNode as p, withDirectives as Z, mergeProps as R, vShow as A, createTextVNode as ae, isVNode as ue, defineComponent as ce } from "vue";
5
5
  class l {
6
6
  static typeChecker(e) {
7
7
  return {}.toString.call(e);
@@ -70,7 +70,7 @@ function m(r, ...e) {
70
70
  typeof s == "object" && s !== null ? r[i] = m(Array.isArray(s) ? [] : {}, s) : r[i] = s;
71
71
  });
72
72
  else
73
- for (let s in t)
73
+ for (const s in t)
74
74
  t.hasOwnProperty(s) && (typeof t[s] == "object" && t[s] !== null ? r[s] = m(r[s] || {}, t[s]) : r[s] = t[s]);
75
75
  }), r;
76
76
  }
@@ -85,13 +85,13 @@ function g(r) {
85
85
  return new RegExp(s);
86
86
  if (s instanceof Map) {
87
87
  const o = /* @__PURE__ */ new Map();
88
- for (let [n, u] of s)
88
+ for (const [n, u] of s)
89
89
  o.set(t(n), t(u));
90
90
  return o;
91
91
  }
92
92
  if (s instanceof Set) {
93
93
  const o = /* @__PURE__ */ new Set();
94
- for (let n of s)
94
+ for (const n of s)
95
95
  o.add(t(n));
96
96
  return o;
97
97
  }
@@ -106,7 +106,7 @@ function g(r) {
106
106
  }
107
107
  const i = Object.create(Object.getPrototypeOf(s));
108
108
  e.set(s, i);
109
- for (let o in s)
109
+ for (const o in s)
110
110
  s.hasOwnProperty(o) && (i[o] = t(s[o]));
111
111
  return i;
112
112
  }
@@ -151,7 +151,7 @@ class fe {
151
151
  deep: !0,
152
152
  immediate: !0
153
153
  }
154
- ) : k(e) ? I(
154
+ ) : z(e) ? I(
155
155
  () => e,
156
156
  () => {
157
157
  m(this.runtimeCore.model.value, e);
@@ -225,11 +225,12 @@ class de {
225
225
  });
226
226
  }
227
227
  countFunctionDefaultValues(e) {
228
- let t = 0, s = /* @__PURE__ */ new Set();
228
+ let t = 0;
229
+ const s = /* @__PURE__ */ new Set();
229
230
  function i(o) {
230
231
  if (!s.has(o) && (Array.isArray(o) || o !== null && typeof o == "object")) {
231
232
  s.add(o);
232
- for (let n in o)
233
+ for (const n in o)
233
234
  o.hasOwnProperty(n) && (n === "defaultValue" && typeof o[n] == "function" && !o[n].toString().includes("[native code]") && t++, i(o[n]));
234
235
  }
235
236
  }
@@ -271,10 +272,10 @@ class de {
271
272
  const O = i.parseStable(u.stable), C = s == null ? void 0 : s.index, v = s == null ? void 0 : s.key;
272
273
  let P = O;
273
274
  if (l.isProcessInprogress(P) || (o[y] = !0), s) {
274
- let h = i.processedSchemas.value[C][v][c][d];
275
+ const h = i.processedSchemas.value[C][v][c][d];
275
276
  h && l.isObject(h) && d !== "component" && (P = m(h, P)), i.processedSchemas.value[C][v][c][d] = P, i.stableUpdater(o);
276
277
  } else {
277
- let h = i.processedSchemas.value[c][d];
278
+ const h = i.processedSchemas.value[c][d];
278
279
  h && l.isObject(h) && d !== "component" && (P = m(h, P)), i.processedSchemas.value[c][d] = P, i.stableUpdater(o);
279
280
  }
280
281
  }
@@ -298,13 +299,18 @@ class de {
298
299
  stable: u
299
300
  });
300
301
  };
301
- l.isFunction(t[i]) ? i !== "defaultValue" ? this.schemaEffect.trackEffect(() => {
302
- if (i === "component") {
303
- const u = t[i](this.getRuntimeMeta());
304
- this.promiseFieldParser(u, n, !1);
305
- } else
306
- this.fieldParser(t[i], n);
307
- }) : this.defaultValueEffect.trackEffect(
302
+ l.isFunction(t[i]) ? i !== "defaultValue" ? this.schemaEffect.trackEffect(
303
+ () => {
304
+ if (i === "component") {
305
+ const u = t[i](this.getRuntimeMeta());
306
+ this.promiseFieldParser(u, n, !1);
307
+ } else
308
+ this.fieldParser(t[i], n);
309
+ },
310
+ {
311
+ lazy: !1
312
+ }
313
+ ) : this.defaultValueEffect.trackEffect(
308
314
  () => {
309
315
  const u = this.schemaEffect.trackEffect(() => {
310
316
  /\{\s*model\s*\}/.test(t[i].toString()) ? this.fieldParser(t[i], (c) => {
@@ -369,7 +375,7 @@ class de {
369
375
  immediate: !0,
370
376
  deep: !0
371
377
  }
372
- ) : k(e) ? I(
378
+ ) : z(e) ? I(
373
379
  () => e,
374
380
  () => {
375
381
  l.isUndefined(e) || (s && l.isObject(e) ? this.objectParser({
@@ -480,7 +486,7 @@ class me {
480
486
  }, {
481
487
  deep: !0
482
488
  });
483
- } else if (k(t.schemas)) {
489
+ } else if (z(t.schemas)) {
484
490
  const s = I(() => t.schemas, () => {
485
491
  this.processor.parseSchemas(t.schemas), w(() => {
486
492
  s();
@@ -498,11 +504,11 @@ class me {
498
504
  };
499
505
  }
500
506
  runtimeItemProcessor(e, t, s = this.model.value, i) {
501
- var z, $, _, B, D, G, T, K, W, H, J, Q, X;
507
+ var k, $, _, B, D, G, T, K, W, H, J, Q, X;
502
508
  const o = j(e.component);
503
509
  if (!o)
504
510
  return;
505
- m(this.globalNativeFormOverride.props, ($ = (z = e.native) == null ? void 0 : z.props) == null ? void 0 : $.Form), m(this.globalNativeFormOverride.slots, (B = (_ = e.native) == null ? void 0 : _.slots) == null ? void 0 : B.Form);
511
+ m(this.globalNativeFormOverride.props, ($ = (k = e.native) == null ? void 0 : k.props) == null ? void 0 : $.Form), m(this.globalNativeFormOverride.slots, (B = (_ = e.native) == null ? void 0 : _.slots) == null ? void 0 : B.Form);
506
512
  const n = m(g((G = (D = this.native) == null ? void 0 : D.slots) == null ? void 0 : G.FormItem) ?? {}, (K = (T = e.native) == null ? void 0 : T.slots) == null ? void 0 : K.FormItem), u = {
507
513
  display: "grid",
508
514
  gridColumn: "1 / -1",
@@ -514,7 +520,7 @@ class me {
514
520
  }), y = o.name, O = e.componentProps ?? {}, C = b.placeholderPresetByComponentName;
515
521
  let v = e.placeholder, P = e.show;
516
522
  P === void 0 && (P = !0), P || delete s[e.field];
517
- let h = e.label;
523
+ let h = e.label ?? "";
518
524
  const V = (i == null ? void 0 : i.runtime) ?? this.runtime;
519
525
  if (!l.isUndefined(t) && !l.isObjectEmpty(V) && (h = U((X = V == null ? void 0 : V.customizeItemLabel) == null ? void 0 : X.call(V, e.label ?? "", t + 1), "")), !v) {
520
526
  let E = "请输入";
@@ -532,7 +538,7 @@ class me {
532
538
  }, [p(te, null, {
533
539
  default() {
534
540
  return Z(p(se, R(c, {
535
- label: `${h}:`
541
+ label: `${h ? `${h}:` : ""}`
536
542
  }, d, ee), {
537
543
  default() {
538
544
  return re.runtimeAdapter.formComponentRenderer({
@@ -598,7 +604,7 @@ class me {
598
604
  container: c
599
605
  } = {}) {
600
606
  var y;
601
- let d = c ?? p("button", null, null);
607
+ const d = c ?? p("button", null, null);
602
608
  return Z(p(d, {
603
609
  onClick: () => s.deleteListItem(e, u)
604
610
  }, null), [[A, ((y = s.model.value[e.field]) == null ? void 0 : y.length) > 1]]);
@@ -608,7 +614,7 @@ class me {
608
614
  add({
609
615
  container: n
610
616
  } = {}) {
611
- let u = n ?? p("button", null, [ae("添加")]);
617
+ const u = n ?? p("button", null, [ae("添加")]);
612
618
  return p(u, {
613
619
  onClick: () => s.addListItem(e)
614
620
  }, null);
@@ -826,7 +832,7 @@ const ye = {
826
832
  请选择: ["select", "tree"],
827
833
  请输入: ["input"]
828
834
  }, t = {};
829
- for (let s in e)
835
+ for (const s in e)
830
836
  e[s].forEach((i) => {
831
837
  t[i] = s;
832
838
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harbor-design/proform",
3
- "version": "1.1.22",
3
+ "version": "1.1.24",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",