@harbor-design/proform 1.1.32 → 1.1.34
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 +63 -54
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var a = (r, e, t) => (
|
|
4
|
-
import { isRef as
|
|
1
|
+
var ie = Object.defineProperty;
|
|
2
|
+
var oe = (r, e, t) => e in r ? ie(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
+
var a = (r, e, t) => (oe(r, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
import { isRef as q, watch as P, isReactive as N, nextTick as F, toRaw as S, ref as M, reactive as Z, 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
|
-
|
|
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
|
-
) :
|
|
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
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
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(),
|
|
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(),
|
|
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
|
-
|
|
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
|
-
) :
|
|
411
|
+
) : N(e) ? P(
|
|
403
412
|
() => e,
|
|
404
413
|
() => {
|
|
405
414
|
l.isUndefined(e) || (s && l.isObject(e) && !l.isNativeObject(e) ? this.objectParser({
|
|
@@ -493,27 +502,27 @@ class me {
|
|
|
493
502
|
});
|
|
494
503
|
a(this, "formRef", M(null));
|
|
495
504
|
a(this, "hydrateEffect", new _());
|
|
496
|
-
a(this, "native",
|
|
505
|
+
a(this, "native", Z({}));
|
|
497
506
|
a(this, "grid", {});
|
|
498
507
|
a(this, "runtime", {});
|
|
499
508
|
a(this, "globalNativeFormOverride", {
|
|
500
509
|
props: {},
|
|
501
510
|
slots: {}
|
|
502
511
|
});
|
|
503
|
-
a(this, "shared", {});
|
|
512
|
+
a(this, "shared", Z({}));
|
|
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),
|
|
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),
|
|
517
|
+
this.processor.parseSchemas(t.schemas.value), F(() => {
|
|
509
518
|
s();
|
|
510
519
|
});
|
|
511
520
|
}, {
|
|
512
521
|
deep: !0
|
|
513
522
|
});
|
|
514
|
-
} else if (
|
|
523
|
+
} else if (N(t.schemas)) {
|
|
515
524
|
const s = P(() => t.schemas, () => {
|
|
516
|
-
this.processor.parseSchemas(t.schemas),
|
|
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,
|
|
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) ?? {}, (
|
|
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 = (
|
|
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,32 +558,32 @@ 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
|
|
553
|
-
l.isUndefined(b) ? g = `${
|
|
554
|
-
I[b.toLowerCase()], g = `${
|
|
555
|
-
b.toLowerCase().includes(Y.toLowerCase()) && (
|
|
556
|
-
}), g = `${
|
|
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
|
-
const
|
|
567
|
+
const A = this.runtimeAdapter.getRuntimeRequired({
|
|
559
568
|
...e,
|
|
560
569
|
label: m
|
|
561
|
-
}),
|
|
570
|
+
}), ee = E.getItemContainer(this), te = E.getFormItemContainer(this), se = this, re = e.componentSlots;
|
|
562
571
|
return p("div", {
|
|
563
572
|
style: c
|
|
564
|
-
}, [p(
|
|
573
|
+
}, [p(ee, {
|
|
565
574
|
show: y
|
|
566
575
|
}, {
|
|
567
576
|
default() {
|
|
568
|
-
return y && p(
|
|
577
|
+
return y && p(te, O(u, {
|
|
569
578
|
label: `${m ? `${m}:` : ""}`
|
|
570
|
-
}, d,
|
|
579
|
+
}, d, A), {
|
|
571
580
|
default() {
|
|
572
|
-
return
|
|
581
|
+
return se.runtimeAdapter.formComponentRenderer({
|
|
573
582
|
Component: o,
|
|
574
583
|
schema: e,
|
|
575
584
|
baseModel: s,
|
|
576
585
|
placeholder: g,
|
|
577
|
-
componentSlots:
|
|
586
|
+
componentSlots: re,
|
|
578
587
|
props: V
|
|
579
588
|
});
|
|
580
589
|
},
|
|
@@ -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,
|
|
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,
|
|
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,
|
|
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,
|
|
852
|
+
return p(r, O({
|
|
844
853
|
value: e[t.field],
|
|
845
854
|
"onUpdate:value": (n) => e[t.field] = n,
|
|
846
855
|
placeholder: s
|