@harbor-design/proform 1.2.4 → 1.2.6

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 +63 -71
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- var re = Object.defineProperty;
2
- var ie = (r, e, t) => e in r ? re(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var a = (r, e, t) => (ie(r, typeof e != "symbol" ? e + "" : e, t), t);
4
- import { isRef as N, watch as P, isReactive as q, nextTick as E, toRaw as R, ref as U, reactive as oe, createVNode as p, mergeProps as O, withDirectives as ne, vShow as le, createTextVNode as ae, isVNode as ue, defineComponent as ce } from "vue";
1
+ var ae = Object.defineProperty;
2
+ var ue = (r, e, t) => e in r ? ae(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
+ var a = (r, e, t) => (ue(r, typeof e != "symbol" ? e + "" : e, t), t);
4
+ import { isRef as N, watch as P, isReactive as q, nextTick as E, toRaw as R, ref as U, reactive as se, createVNode as p, mergeProps as O, withDirectives as ce, vShow as fe, createTextVNode as de, isVNode as he, defineComponent as pe } from "vue";
5
5
  class l {
6
6
  static typeChecker(e) {
7
7
  return {}.toString.call(e);
@@ -121,7 +121,7 @@ function C(r) {
121
121
  function x(r, e) {
122
122
  return r.replace(/undefined/g, e);
123
123
  }
124
- class fe {
124
+ class me {
125
125
  constructor(e) {
126
126
  a(this, "runtimeCore");
127
127
  this.formCustomization = e;
@@ -220,7 +220,7 @@ class L {
220
220
  return !t.lazy && e(), this.effects.add(e), () => this.effects.delete(e);
221
221
  }
222
222
  }
223
- class de {
223
+ class ve {
224
224
  constructor(e) {
225
225
  a(this, "runtimeCore");
226
226
  a(this, "processedSchemas");
@@ -302,17 +302,17 @@ class de {
302
302
  }).fill(!1);
303
303
  this.objectParser({ data: e, index: t, updater: n });
304
304
  function n(f) {
305
- const c = f.index, d = f.key, v = f.keyIndex;
305
+ const c = f.index, d = f.key, y = f.keyIndex;
306
306
  if (l.isUndefined(f.stable))
307
307
  return;
308
308
  const j = i.parseStable(f.stable), I = s == null ? void 0 : s.index, g = s == null ? void 0 : s.key;
309
- let y = j;
310
- if (l.isProcessInprogress(y) || (o[v] = !0), s) {
309
+ let v = j;
310
+ if (l.isProcessInprogress(v) || (o[y] = !0), s) {
311
311
  const m = i.processedSchemas.value[I][g][c][d];
312
- m && l.isObject(m) && d !== "component" && (y = h(m, y)), i.processedSchemas.value[I][g][c][d] = y, i.stableUpdater(o);
312
+ m && l.isObject(m) && d !== "component" && (v = h(m, v)), i.processedSchemas.value[I][g][c][d] = v, i.stableUpdater(o);
313
313
  } else {
314
314
  const m = i.processedSchemas.value[c][d];
315
- m && l.isObject(m) && d !== "component" && (y = h(m, y)), i.processedSchemas.value[c][d] = y, i.stableUpdater(o);
315
+ m && l.isObject(m) && d !== "component" && (v = h(m, v)), i.processedSchemas.value[c][d] = v, i.stableUpdater(o);
316
316
  }
317
317
  }
318
318
  }
@@ -466,7 +466,7 @@ class F {
466
466
  return u.presets.uiPresets[e ?? u.presets.ui].container.ListItem;
467
467
  }
468
468
  }
469
- class he {
469
+ class ye {
470
470
  constructor(e) {
471
471
  this.ui = e;
472
472
  }
@@ -500,10 +500,10 @@ class he {
500
500
  return (t == null ? void 0 : t.clearValidate(e)) ?? (s == null ? void 0 : s.clearValidate(e));
501
501
  }
502
502
  }
503
- function pe(r) {
504
- return typeof r == "function" || Object.prototype.toString.call(r) === "[object Object]" && !ue(r);
503
+ function Pe(r) {
504
+ return typeof r == "function" || Object.prototype.toString.call(r) === "[object Object]" && !he(r);
505
505
  }
506
- class me {
506
+ class be {
507
507
  constructor(e) {
508
508
  a(this, "schemas", U([]));
509
509
  a(this, "model", U({}));
@@ -514,17 +514,17 @@ class me {
514
514
  });
515
515
  a(this, "formRef", U(null));
516
516
  a(this, "hydrateEffect", new L());
517
- a(this, "native", oe({}));
517
+ a(this, "native", se({}));
518
518
  a(this, "grid", {});
519
519
  a(this, "runtime", {});
520
- a(this, "globalNativeFormOverride", {
520
+ a(this, "globalNativeFormOverride", se({
521
521
  props: {},
522
522
  slots: {}
523
- });
523
+ }));
524
524
  a(this, "shared", {});
525
- this.setup = e, this.processor = new de(this);
525
+ this.setup = e, this.processor = new ve(this);
526
526
  const t = this.setup(this);
527
- if (this.ui = t.ui ?? u.presets.ui, this.runtimeAdapter = new he(this.ui), Object.assign(this.globalNativeFormOverride, this.runtimeAdapter.getRuntimeNative()), N(t.schemas))
527
+ if (this.ui = t.ui ?? u.presets.ui, this.runtimeAdapter = new ye(this.ui), Object.assign(this.globalNativeFormOverride, this.runtimeAdapter.getRuntimeNative()), N(t.schemas))
528
528
  P(
529
529
  // @ts-expect-error
530
530
  () => t.schemas.value,
@@ -581,51 +581,51 @@ class me {
581
581
  };
582
582
  }
583
583
  runtimeItemProcessor(e, t, s = this.model.value, i) {
584
- var z, k, $, B, D, T, G, W, K, H, J, Q, X;
584
+ var z, k, $, B, D, T, G, W, K, H, J, Q, X, Y, Z, A, ee;
585
585
  const o = R(e.component);
586
586
  if (!o)
587
587
  return;
588
- h(this.globalNativeFormOverride.props, (k = (z = e.native) == null ? void 0 : z.props) == null ? void 0 : k.Form), h(this.globalNativeFormOverride.slots, (B = ($ = e.native) == null ? void 0 : $.slots) == null ? void 0 : B.Form);
589
- const n = h(C((T = (D = this.native) == null ? void 0 : D.slots) == null ? void 0 : T.FormItem) ?? {}, (W = (G = e.native) == null ? void 0 : G.slots) == null ? void 0 : W.FormItem), f = {
588
+ (k = (z = e.native) == null ? void 0 : z.props) != null && k.Form && h(this.globalNativeFormOverride.props, (B = ($ = e.native) == null ? void 0 : $.props) == null ? void 0 : B.Form), (T = (D = e.native) == null ? void 0 : D.slots) != null && T.Form && h(this.globalNativeFormOverride.slots, (W = (G = e.native) == null ? void 0 : G.slots) == null ? void 0 : W.Form);
589
+ const n = h(C((H = (K = this.native) == null ? void 0 : K.slots) == null ? void 0 : H.FormItem) ?? {}, (Q = (J = e.native) == null ? void 0 : J.slots) == null ? void 0 : Q.FormItem), f = {
590
590
  display: "grid",
591
591
  gridColumn: "1 / -1",
592
592
  ...e.grid
593
- }, c = h(C((H = (K = this.native) == null ? void 0 : K.props) == null ? void 0 : H.FormItem) ?? {}, (Q = (J = e.native) == null ? void 0 : J.props) == null ? void 0 : Q.FormItem), d = this.runtimeAdapter.getRuntimeField({
593
+ }, c = h(C((Y = (X = this.native) == null ? void 0 : X.props) == null ? void 0 : Y.FormItem) ?? {}, (A = (Z = e.native) == null ? void 0 : Z.props) == null ? void 0 : A.FormItem), d = this.runtimeAdapter.getRuntimeField({
594
594
  schema: e,
595
595
  parentSchema: i,
596
596
  index: t
597
- }), v = o.name, j = e.componentProps ?? {}, I = b.placeholderPresetByComponentName;
598
- let g = e.placeholder, y = e.show;
599
- y === void 0 && (y = !0), y || delete s[e.field];
597
+ }), y = o.name, j = e.componentProps ?? {}, I = b.placeholderPresetByComponentName;
598
+ let g = e.placeholder, v = e.show;
599
+ v === void 0 && (v = !0);
600
600
  let m = e.label ?? "";
601
601
  const V = (i == null ? void 0 : i.runtime) ?? this.runtime;
602
- if (!l.isUndefined(t) && !l.isObjectEmpty(V) && (m = x((X = V == null ? void 0 : V.customizeListItemLabel) == null ? void 0 : X.call(V, e.label ?? "", t + 1), "")), !g) {
602
+ if (!l.isUndefined(t) && !l.isObjectEmpty(V) && (m = x((ee = V == null ? void 0 : V.customizeListItemLabel) == null ? void 0 : ee.call(V, e.label ?? "", t + 1), "")), !g) {
603
603
  let S = "请输入";
604
- l.isUndefined(v) ? g = `${S}${m}` : /* @ts-expect-error */ I[v.toLowerCase()] ? (S = // @ts-expect-error
605
- I[v.toLowerCase()], g = `${S}${m}`) : (Object.keys(I).forEach((Y) => {
606
- v.toLowerCase().includes(Y.toLowerCase()) && (S = I[Y]);
604
+ l.isUndefined(y) ? g = `${S}${m}` : /* @ts-expect-error */ I[y.toLowerCase()] ? (S = // @ts-expect-error
605
+ I[y.toLowerCase()], g = `${S}${m}`) : (Object.keys(I).forEach((te) => {
606
+ y.toLowerCase().includes(te.toLowerCase()) && (S = I[te]);
607
607
  }), g = `${S}${m}`);
608
608
  }
609
- const Z = this.runtimeAdapter.getRuntimeRequired({
609
+ const re = this.runtimeAdapter.getRuntimeRequired({
610
610
  ...e,
611
611
  label: m
612
- }), A = F.getItemContainer(this), ee = F.getFormItemContainer(this), te = this, se = e.componentSlots;
612
+ }), ie = F.getItemContainer(this), oe = F.getFormItemContainer(this), ne = this, le = e.componentSlots;
613
613
  return p("div", {
614
614
  style: f
615
- }, [p(A, {
616
- show: y
615
+ }, [p(ie, {
616
+ show: v
617
617
  }, {
618
618
  default() {
619
- return y && p(ee, O(c, {
619
+ return v && p(oe, O(c, {
620
620
  label: `${m ? `${m}:` : ""}`
621
- }, d, Z), {
621
+ }, d, re), {
622
622
  default() {
623
- return te.runtimeAdapter.formComponentRenderer({
623
+ return ne.runtimeAdapter.formComponentRenderer({
624
624
  Component: o,
625
625
  schema: e,
626
626
  baseModel: s,
627
627
  placeholder: g,
628
- componentSlots: se,
628
+ componentSlots: le,
629
629
  props: j
630
630
  });
631
631
  },
@@ -646,7 +646,7 @@ class me {
646
646
  style: s
647
647
  }, [o && p(i, {
648
648
  schema: e
649
- }, pe(t = e.children.map((n) => this.runtimeItemProcessor(n))) ? t : {
649
+ }, Pe(t = e.children.map((n) => this.runtimeItemProcessor(n))) ? t : {
650
650
  default: () => [t]
651
651
  })]);
652
652
  }
@@ -686,17 +686,17 @@ class me {
686
686
  container: d
687
687
  } = {}) {
688
688
  var j;
689
- const v = d ?? p("button", null, null);
690
- return ne(p(v, {
689
+ const y = d ?? p("button", null, null);
690
+ return ce(p(y, {
691
691
  onClick: () => s.deleteListItem(e, c)
692
- }, null), [[le, ((j = s.model.value[e.field]) == null ? void 0 : j.length) > 1]]);
692
+ }, null), [[fe, ((j = s.model.value[e.field]) == null ? void 0 : j.length) > 1]]);
693
693
  }
694
694
  }));
695
695
  },
696
696
  add({
697
697
  container: f
698
698
  } = {}) {
699
- const c = f ?? p("button", null, [ae("添加")]);
699
+ const c = f ?? p("button", null, [de("添加")]);
700
700
  return p(c, {
701
701
  onClick: () => s.addListItem(e)
702
702
  }, null);
@@ -707,21 +707,13 @@ class me {
707
707
  return e.map((t) => (t.type || (t.type = "item"), this.processorBySchemaType[t.type](t)));
708
708
  }
709
709
  exec() {
710
- var f, c, d, v;
710
+ var f, c, d, y;
711
711
  const e = {
712
712
  display: "grid",
713
713
  gridColumn: "1 / -1",
714
714
  gridAutoColumns: "1fr",
715
715
  ...this.grid
716
- }, t = this, s = h(
717
- C((c = (f = this.native) == null ? void 0 : f.props) == null ? void 0 : c.Form) ?? {},
718
- // @ts-expect-error
719
- this.globalNativeFormOverride.props.Form
720
- ), i = h(
721
- C((v = (d = this.native) == null ? void 0 : d.slots) == null ? void 0 : v.Form) ?? {},
722
- // @ts-expect-error
723
- this.globalNativeFormOverride.slots.Form
724
- ), o = F.getFormContainer(this), n = this.runtimeAdapter.getFormModelPropName();
716
+ }, t = this, s = h(C((c = (f = this.native) == null ? void 0 : f.props) == null ? void 0 : c.Form) ?? {}, this.globalNativeFormOverride.props), i = h(C((y = (d = this.native) == null ? void 0 : d.slots) == null ? void 0 : y.Form) ?? {}, this.globalNativeFormOverride.slots), o = F.getFormContainer(this), n = this.runtimeAdapter.getFormModelPropName();
725
717
  return p(o, O(s, {
726
718
  ref: this.formRef
727
719
  }, {
@@ -754,7 +746,7 @@ function M({
754
746
  }) {
755
747
  return r ? `${r.field}.${t}.${e.field}` : e.field;
756
748
  }
757
- const ye = {
749
+ const ge = {
758
750
  ArcoVue: {
759
751
  getRuntimeField(r) {
760
752
  return {
@@ -990,9 +982,9 @@ let _ = w;
990
982
  const b = {
991
983
  ..._,
992
984
  adapters: {
993
- ...ye
985
+ ...ge
994
986
  }
995
- }, ge = /* @__PURE__ */ ce({
987
+ }, je = /* @__PURE__ */ pe({
996
988
  props: {
997
989
  setup: {
998
990
  type: Function,
@@ -1000,12 +992,12 @@ const b = {
1000
992
  }
1001
993
  },
1002
994
  setup(r) {
1003
- const e = new me(r.setup);
995
+ const e = new be(r.setup);
1004
996
  return () => e.exec();
1005
997
  }
1006
998
  });
1007
- function Ce(r) {
1008
- const e = new fe(r);
999
+ function Ve(r) {
1000
+ const e = new me(r);
1009
1001
  return [
1010
1002
  e.setup.bind(e),
1011
1003
  {
@@ -1015,26 +1007,26 @@ function Ce(r) {
1015
1007
  }
1016
1008
  ];
1017
1009
  }
1018
- function Ie(r) {
1010
+ function Fe(r) {
1019
1011
  u.presets = r;
1020
1012
  }
1021
- function ve(r, e) {
1013
+ function Ce(r, e) {
1022
1014
  return e === "native" && Object.defineProperty(r, "name", {
1023
1015
  value: `__proform_raw_${r.name}`,
1024
1016
  writable: !0
1025
1017
  }), r;
1026
1018
  }
1027
- function Ee(r) {
1028
- return ve(r, "native");
1019
+ function we(r) {
1020
+ return Ce(r, "native");
1029
1021
  }
1030
- function je(r) {
1022
+ function Re(r) {
1031
1023
  return r.__proform_raw_object = !0, r;
1032
1024
  }
1033
1025
  export {
1034
- ge as ProForm,
1035
- Ee as markNativeFunction,
1036
- je as markNativeObject,
1037
- Ce as useForm,
1038
- Ie as useFormPresetConfigurer,
1039
- ve as useModifiers
1026
+ je as ProForm,
1027
+ we as markNativeFunction,
1028
+ Re as markNativeObject,
1029
+ Ve as useForm,
1030
+ Fe as useFormPresetConfigurer,
1031
+ Ce as useModifiers
1040
1032
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harbor-design/proform",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",