@harbor-design/proform 1.2.6 → 1.2.8
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
|
@@ -305,8 +305,8 @@ class ve {
|
|
|
305
305
|
const c = f.index, d = f.key, y = f.keyIndex;
|
|
306
306
|
if (l.isUndefined(f.stable))
|
|
307
307
|
return;
|
|
308
|
-
const
|
|
309
|
-
let v =
|
|
308
|
+
const F = i.parseStable(f.stable), I = s == null ? void 0 : s.index, g = s == null ? void 0 : s.key;
|
|
309
|
+
let v = F;
|
|
310
310
|
if (l.isProcessInprogress(v) || (o[y] = !0), s) {
|
|
311
311
|
const m = i.processedSchemas.value[I][g][c][d];
|
|
312
312
|
m && l.isObject(m) && d !== "component" && (v = h(m, v)), i.processedSchemas.value[I][g][c][d] = v, i.stableUpdater(o);
|
|
@@ -446,7 +446,7 @@ class ve {
|
|
|
446
446
|
}), l.isItemSchema(e) && ("defaultValue" in e ? t[e.field] = e.defaultValue : t[e.field] || (t[e.field] = void 0));
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
|
-
class
|
|
449
|
+
class V {
|
|
450
450
|
static getFormContainer({ ui: e } = {}) {
|
|
451
451
|
return u.presets.uiPresets[e ?? u.presets.ui].container.Form;
|
|
452
452
|
}
|
|
@@ -518,8 +518,14 @@ class be {
|
|
|
518
518
|
a(this, "grid", {});
|
|
519
519
|
a(this, "runtime", {});
|
|
520
520
|
a(this, "globalNativeFormOverride", se({
|
|
521
|
-
props: {
|
|
522
|
-
|
|
521
|
+
props: {
|
|
522
|
+
Form: {},
|
|
523
|
+
FormItem: {}
|
|
524
|
+
},
|
|
525
|
+
slots: {
|
|
526
|
+
Form: {},
|
|
527
|
+
FormItem: {}
|
|
528
|
+
}
|
|
523
529
|
}));
|
|
524
530
|
a(this, "shared", {});
|
|
525
531
|
this.setup = e, this.processor = new ve(this);
|
|
@@ -585,7 +591,7 @@ class be {
|
|
|
585
591
|
const o = R(e.component);
|
|
586
592
|
if (!o)
|
|
587
593
|
return;
|
|
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);
|
|
594
|
+
(k = (z = e.native) == null ? void 0 : z.props) != null && k.Form && h(this.globalNativeFormOverride.props.Form, (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.Form, (W = (G = e.native) == null ? void 0 : G.slots) == null ? void 0 : W.Form);
|
|
589
595
|
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
596
|
display: "grid",
|
|
591
597
|
gridColumn: "1 / -1",
|
|
@@ -594,12 +600,12 @@ class be {
|
|
|
594
600
|
schema: e,
|
|
595
601
|
parentSchema: i,
|
|
596
602
|
index: t
|
|
597
|
-
}), y = o.name,
|
|
603
|
+
}), y = o.name, F = e.componentProps ?? {}, I = b.placeholderPresetByComponentName;
|
|
598
604
|
let g = e.placeholder, v = e.show;
|
|
599
605
|
v === void 0 && (v = !0);
|
|
600
606
|
let m = e.label ?? "";
|
|
601
|
-
const
|
|
602
|
-
if (!l.isUndefined(t) && !l.isObjectEmpty(
|
|
607
|
+
const j = (i == null ? void 0 : i.runtime) ?? this.runtime;
|
|
608
|
+
if (!l.isUndefined(t) && !l.isObjectEmpty(j) && (m = x((ee = j == null ? void 0 : j.customizeListItemLabel) == null ? void 0 : ee.call(j, e.label ?? "", t + 1), "")), !g) {
|
|
603
609
|
let S = "请输入";
|
|
604
610
|
l.isUndefined(y) ? g = `${S}${m}` : /* @ts-expect-error */ I[y.toLowerCase()] ? (S = // @ts-expect-error
|
|
605
611
|
I[y.toLowerCase()], g = `${S}${m}`) : (Object.keys(I).forEach((te) => {
|
|
@@ -609,7 +615,7 @@ class be {
|
|
|
609
615
|
const re = this.runtimeAdapter.getRuntimeRequired({
|
|
610
616
|
...e,
|
|
611
617
|
label: m
|
|
612
|
-
}), ie =
|
|
618
|
+
}), ie = V.getItemContainer(this), oe = V.getFormItemContainer(this), ne = this, le = e.componentSlots;
|
|
613
619
|
return p("div", {
|
|
614
620
|
style: f
|
|
615
621
|
}, [p(ie, {
|
|
@@ -626,7 +632,7 @@ class be {
|
|
|
626
632
|
baseModel: s,
|
|
627
633
|
placeholder: g,
|
|
628
634
|
componentSlots: le,
|
|
629
|
-
props:
|
|
635
|
+
props: F
|
|
630
636
|
});
|
|
631
637
|
},
|
|
632
638
|
...n
|
|
@@ -640,7 +646,7 @@ class be {
|
|
|
640
646
|
display: "grid",
|
|
641
647
|
gridColumn: "1 / -1",
|
|
642
648
|
...e.grid
|
|
643
|
-
}, i =
|
|
649
|
+
}, i = V.getGroupContainer(this);
|
|
644
650
|
let o = e.show;
|
|
645
651
|
return o === void 0 && (o = !0), p("div", {
|
|
646
652
|
style: s
|
|
@@ -671,7 +677,7 @@ class be {
|
|
|
671
677
|
s.model.value[e.field] || (s.model.value[e.field] = [{}]);
|
|
672
678
|
let i = e.show;
|
|
673
679
|
i === void 0 && (i = !0);
|
|
674
|
-
const o =
|
|
680
|
+
const o = V.getListContainer(this), n = V.getListItemContainer(this);
|
|
675
681
|
return p("div", {
|
|
676
682
|
style: t
|
|
677
683
|
}, [i && p(o, {
|
|
@@ -685,11 +691,11 @@ class be {
|
|
|
685
691
|
delete({
|
|
686
692
|
container: d
|
|
687
693
|
} = {}) {
|
|
688
|
-
var
|
|
694
|
+
var F;
|
|
689
695
|
const y = d ?? p("button", null, null);
|
|
690
696
|
return ce(p(y, {
|
|
691
697
|
onClick: () => s.deleteListItem(e, c)
|
|
692
|
-
}, null), [[fe, ((
|
|
698
|
+
}, null), [[fe, ((F = s.model.value[e.field]) == null ? void 0 : F.length) > 1]]);
|
|
693
699
|
}
|
|
694
700
|
}));
|
|
695
701
|
},
|
|
@@ -713,7 +719,7 @@ class be {
|
|
|
713
719
|
gridColumn: "1 / -1",
|
|
714
720
|
gridAutoColumns: "1fr",
|
|
715
721
|
...this.grid
|
|
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 =
|
|
722
|
+
}, t = this, s = h(C((c = (f = this.native) == null ? void 0 : f.props) == null ? void 0 : c.Form) ?? {}, this.globalNativeFormOverride.props.Form), i = h(C((y = (d = this.native) == null ? void 0 : d.slots) == null ? void 0 : y.Form) ?? {}, this.globalNativeFormOverride.slots.Form), o = V.getFormContainer(this), n = this.runtimeAdapter.getFormModelPropName();
|
|
717
723
|
return p(o, O(s, {
|
|
718
724
|
ref: this.formRef
|
|
719
725
|
}, {
|
|
@@ -984,7 +990,7 @@ const b = {
|
|
|
984
990
|
adapters: {
|
|
985
991
|
...ge
|
|
986
992
|
}
|
|
987
|
-
},
|
|
993
|
+
}, Fe = /* @__PURE__ */ pe({
|
|
988
994
|
props: {
|
|
989
995
|
setup: {
|
|
990
996
|
type: Function,
|
|
@@ -996,7 +1002,7 @@ const b = {
|
|
|
996
1002
|
return () => e.exec();
|
|
997
1003
|
}
|
|
998
1004
|
});
|
|
999
|
-
function
|
|
1005
|
+
function je(r) {
|
|
1000
1006
|
const e = new me(r);
|
|
1001
1007
|
return [
|
|
1002
1008
|
e.setup.bind(e),
|
|
@@ -1007,7 +1013,7 @@ function Ve(r) {
|
|
|
1007
1013
|
}
|
|
1008
1014
|
];
|
|
1009
1015
|
}
|
|
1010
|
-
function
|
|
1016
|
+
function Ve(r) {
|
|
1011
1017
|
u.presets = r;
|
|
1012
1018
|
}
|
|
1013
1019
|
function Ce(r, e) {
|
|
@@ -1023,10 +1029,10 @@ function Re(r) {
|
|
|
1023
1029
|
return r.__proform_raw_object = !0, r;
|
|
1024
1030
|
}
|
|
1025
1031
|
export {
|
|
1026
|
-
|
|
1032
|
+
Fe as ProForm,
|
|
1027
1033
|
we as markNativeFunction,
|
|
1028
1034
|
Re as markNativeObject,
|
|
1029
|
-
|
|
1030
|
-
|
|
1035
|
+
je as useForm,
|
|
1036
|
+
Ve as useFormPresetConfigurer,
|
|
1031
1037
|
Ce as useModifiers
|
|
1032
1038
|
};
|
|
@@ -15,8 +15,14 @@ export default class RuntimeCore {
|
|
|
15
15
|
grid: {};
|
|
16
16
|
runtime: Runtime;
|
|
17
17
|
globalNativeFormOverride: {
|
|
18
|
-
props: {
|
|
19
|
-
|
|
18
|
+
props: {
|
|
19
|
+
Form: {};
|
|
20
|
+
FormItem: {};
|
|
21
|
+
};
|
|
22
|
+
slots: {
|
|
23
|
+
Form: {};
|
|
24
|
+
FormItem: {};
|
|
25
|
+
};
|
|
20
26
|
};
|
|
21
27
|
ui: string;
|
|
22
28
|
runtimeAdapter: RuntimeAdpter;
|