@harbor-design/proform 1.1.32 → 1.1.33

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 +52 -43
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  var re = Object.defineProperty;
2
2
  var ie = (r, e, t) => e in r ? re(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
3
  var a = (r, e, t) => (ie(r, typeof e != "symbol" ? e + "" : e, t), t);
4
- import { isRef as O, watch as P, isReactive as q, toRaw as S, nextTick as N, ref as M, reactive as oe, createVNode as p, mergeProps as R, withDirectives as ne, vShow as le, createTextVNode as ae, isVNode as ue, defineComponent as ce } from "vue";
4
+ import { isRef as q, watch as P, isReactive as N, nextTick as F, toRaw as S, ref as M, 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";
5
5
  class l {
6
6
  static typeChecker(e) {
7
7
  return {}.toString.call(e);
@@ -145,7 +145,7 @@ class fe {
145
145
  });
146
146
  this.runtimeCore.hydrateEffect.trackEffect(
147
147
  () => {
148
- O(e) ? P(
148
+ q(e) ? P(
149
149
  () => e.value,
150
150
  () => {
151
151
  h(this.runtimeCore.model.value, e.value);
@@ -154,7 +154,7 @@ class fe {
154
154
  deep: !0,
155
155
  immediate: !0
156
156
  }
157
- ) : q(e) ? P(
157
+ ) : N(e) ? P(
158
158
  () => e,
159
159
  () => {
160
160
  h(this.runtimeCore.model.value, e);
@@ -171,25 +171,34 @@ class fe {
171
171
  );
172
172
  }
173
173
  share(e) {
174
- O(e) ? P(
175
- () => e.value,
176
- () => {
177
- h(this.runtimeCore.shared, e.value), this.runtimeCore.processor.schemaEffect.triggerEffects();
178
- },
179
- {
180
- deep: !0,
181
- immediate: !0
182
- }
183
- ) : q(e) ? P(
184
- () => e,
185
- () => {
186
- h(this.runtimeCore.shared, e), this.runtimeCore.processor.schemaEffect.triggerEffects();
187
- },
188
- {
189
- deep: !0,
190
- immediate: !0
191
- }
192
- ) : (h(this.runtimeCore.shared, e), this.runtimeCore.processor.schemaEffect.triggerEffects());
174
+ if (q(e)) {
175
+ const t = P(
176
+ () => e.value,
177
+ () => {
178
+ h(this.runtimeCore.shared, e.value), this.runtimeCore.processor.schemaEffect.triggerEffects(), F(() => {
179
+ t();
180
+ });
181
+ },
182
+ {
183
+ deep: !0,
184
+ immediate: !0
185
+ }
186
+ );
187
+ } else if (N(e)) {
188
+ const t = P(
189
+ () => e,
190
+ () => {
191
+ h(this.runtimeCore.shared, e), this.runtimeCore.processor.schemaEffect.triggerEffects(), F(() => {
192
+ t();
193
+ });
194
+ },
195
+ {
196
+ deep: !0,
197
+ immediate: !0
198
+ }
199
+ );
200
+ } else
201
+ h(this.runtimeCore.shared, e), this.runtimeCore.processor.schemaEffect.triggerEffects();
193
202
  }
194
203
  }
195
204
  class _ {
@@ -342,13 +351,13 @@ class de {
342
351
  return n(u);
343
352
  this.defaultValueInprogressMap.set(t[i], u), !l.isProcessInprogress(u) && this.defaultValueInprogressMap.size === this.baseDefaultValueFunctionsLength && Array.from(
344
353
  this.defaultValueInprogressMap.values()
345
- ).every((d) => !d.includes("undefined")) ? (n(u), this.defaultValueEffect.clearEffects(), N(() => {
354
+ ).every((d) => !d.includes("undefined")) ? (n(u), this.defaultValueEffect.clearEffects(), F(() => {
346
355
  c();
347
356
  })) : n(u);
348
357
  }) : this.fieldParser(t[i], (u) => {
349
358
  this.defaultValueInprogressMap.set(t[i], u), !l.isProcessInprogress(u) && this.defaultValueInprogressMap.size === this.baseDefaultValueFunctionsLength && Array.from(
350
359
  this.defaultValueInprogressMap.values()
351
- ).every((d) => !d.includes("undefined")) ? (n(u), this.defaultValueEffect.clearEffects(), N(() => {
360
+ ).every((d) => !d.includes("undefined")) ? (n(u), this.defaultValueEffect.clearEffects(), F(() => {
352
361
  c();
353
362
  })) : n(u);
354
363
  });
@@ -387,7 +396,7 @@ class de {
387
396
  this.promiseFieldParser(i, t, s);
388
397
  }
389
398
  else
390
- O(e) ? P(
399
+ q(e) ? P(
391
400
  () => e.value,
392
401
  () => {
393
402
  l.isUndefined(e.value) || (s && l.isObject(e.value) && !l.isNativeObject(e.value) ? this.objectParser({
@@ -399,7 +408,7 @@ class de {
399
408
  immediate: !0,
400
409
  deep: !0
401
410
  }
402
- ) : q(e) ? P(
411
+ ) : N(e) ? P(
403
412
  () => e,
404
413
  () => {
405
414
  l.isUndefined(e) || (s && l.isObject(e) && !l.isNativeObject(e) ? this.objectParser({
@@ -503,17 +512,17 @@ class me {
503
512
  a(this, "shared", {});
504
513
  this.setup = e, this.processor = new de(this);
505
514
  const t = this.setup(this);
506
- if (this.ui = t.ui ?? f.presets.ui, this.runtimeAdapter = new pe(this.ui), O(t.schemas)) {
515
+ if (this.ui = t.ui ?? f.presets.ui, this.runtimeAdapter = new pe(this.ui), q(t.schemas)) {
507
516
  const s = P(() => t.schemas, () => {
508
- this.processor.parseSchemas(t.schemas.value), N(() => {
517
+ this.processor.parseSchemas(t.schemas.value), F(() => {
509
518
  s();
510
519
  });
511
520
  }, {
512
521
  deep: !0
513
522
  });
514
- } else if (q(t.schemas)) {
523
+ } else if (N(t.schemas)) {
515
524
  const s = P(() => t.schemas, () => {
516
- this.processor.parseSchemas(t.schemas), N(() => {
525
+ this.processor.parseSchemas(t.schemas), F(() => {
517
526
  s();
518
527
  });
519
528
  }, {
@@ -530,16 +539,16 @@ class me {
530
539
  };
531
540
  }
532
541
  runtimeItemProcessor(e, t, s = this.model.value, i) {
533
- var x, z, $, B, D, G, T, K, W, H, J, Q, X;
542
+ var x, z, $, B, D, G, T, W, K, H, J, Q, X;
534
543
  const o = S(e.component);
535
544
  if (!o)
536
545
  return;
537
546
  h(this.globalNativeFormOverride.props, (z = (x = e.native) == null ? void 0 : x.props) == null ? void 0 : z.Form), h(this.globalNativeFormOverride.slots, (B = ($ = e.native) == null ? void 0 : $.slots) == null ? void 0 : B.Form);
538
- const n = h(C((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), c = {
547
+ const n = h(C((G = (D = this.native) == null ? void 0 : D.slots) == null ? void 0 : G.FormItem) ?? {}, (W = (T = e.native) == null ? void 0 : T.slots) == null ? void 0 : W.FormItem), c = {
539
548
  display: "grid",
540
549
  gridColumn: "1 / -1",
541
550
  ...e.grid
542
- }, u = h(C((H = (W = this.native) == null ? void 0 : W.props) == null ? void 0 : H.FormItem) ?? {}, (Q = (J = e.native) == null ? void 0 : J.props) == null ? void 0 : Q.FormItem), d = this.runtimeAdapter.getRuntimeField({
551
+ }, u = 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({
543
552
  schema: e,
544
553
  parentSchema: i,
545
554
  index: t
@@ -549,11 +558,11 @@ class me {
549
558
  let m = e.label ?? "";
550
559
  const j = (i == null ? void 0 : i.runtime) ?? this.runtime;
551
560
  if (!l.isUndefined(t) && !l.isObjectEmpty(j) && (m = L((X = j == null ? void 0 : j.customizeItemLabel) == null ? void 0 : X.call(j, e.label ?? "", t + 1), "")), !g) {
552
- let F = "请输入";
553
- l.isUndefined(b) ? g = `${F}${m}` : /* @ts-expect-error */ I[b.toLowerCase()] ? (F = // @ts-expect-error
554
- I[b.toLowerCase()], g = `${F}${m}`) : (Object.keys(I).forEach((Y) => {
555
- b.toLowerCase().includes(Y.toLowerCase()) && (F = I[Y]);
556
- }), g = `${F}${m}`);
561
+ let R = "请输入";
562
+ l.isUndefined(b) ? g = `${R}${m}` : /* @ts-expect-error */ I[b.toLowerCase()] ? (R = // @ts-expect-error
563
+ I[b.toLowerCase()], g = `${R}${m}`) : (Object.keys(I).forEach((Y) => {
564
+ b.toLowerCase().includes(Y.toLowerCase()) && (R = I[Y]);
565
+ }), g = `${R}${m}`);
557
566
  }
558
567
  const Z = this.runtimeAdapter.getRuntimeRequired({
559
568
  ...e,
@@ -565,7 +574,7 @@ class me {
565
574
  show: y
566
575
  }, {
567
576
  default() {
568
- return y && p(ee, R(u, {
577
+ return y && p(ee, O(u, {
569
578
  label: `${m ? `${m}:` : ""}`
570
579
  }, d, Z), {
571
580
  default() {
@@ -663,7 +672,7 @@ class me {
663
672
  gridAutoColumns: "1fr",
664
673
  ...this.grid
665
674
  }, t = this, s = h(C((u = (c = this.native) == null ? void 0 : c.props) == null ? void 0 : u.Form) ?? {}, this.globalNativeFormOverride.props), i = h(C((b = (d = this.native) == null ? void 0 : d.slots) == null ? void 0 : b.Form) ?? {}, this.globalNativeFormOverride.slots), o = E.getFormContainer(this), n = this.runtimeAdapter.getFormModelPropName();
666
- return p(o, R(s, {
675
+ return p(o, O(s, {
667
676
  ref: this.formRef
668
677
  }, {
669
678
  [n]: this.model.value
@@ -725,7 +734,7 @@ const ye = {
725
734
  componentSlots: i,
726
735
  props: o
727
736
  }) {
728
- return p(r, R({
737
+ return p(r, O({
729
738
  modelValue: e[t.field],
730
739
  "onUpdate:modelValue": (n) => e[t.field] = n,
731
740
  placeholder: s
@@ -780,7 +789,7 @@ const ye = {
780
789
  componentSlots: i,
781
790
  props: o
782
791
  }) {
783
- return p(r, R({
792
+ return p(r, O({
784
793
  modelValue: e[t.field],
785
794
  "onUpdate:modelValue": (n) => e[t.field] = n,
786
795
  placeholder: s
@@ -840,7 +849,7 @@ const ye = {
840
849
  componentSlots: i,
841
850
  props: o
842
851
  }) {
843
- return p(r, R({
852
+ return p(r, O({
844
853
  value: e[t.field],
845
854
  "onUpdate:value": (n) => e[t.field] = n,
846
855
  placeholder: s
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harbor-design/proform",
3
- "version": "1.1.32",
3
+ "version": "1.1.33",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",