@done-coding/admin-core 0.8.3-alpha.0 → 0.9.1-alpha.0
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/docs/nested-config-paradigm.md +80 -0
- package/es/bridge/config-hook.mjs +37 -0
- package/es/bridge/index.mjs +157 -62
- package/es/bridge/plugin.mjs +29 -0
- package/es/bridge/theme.mjs +65 -0
- package/es/components/app-layout/AppBody.vue.mjs +1 -1
- package/es/components/app-layout/AppBody.vue2.mjs +47 -49
- package/es/components/app-layout/AppBreadcrumb.vue.mjs +1 -1
- package/es/components/app-layout/AppBreadcrumb.vue2.mjs +35 -41
- package/es/components/app-layout/AppFooter.vue.mjs +2 -2
- package/es/components/app-layout/AppFooter.vue2.mjs +8 -8
- package/es/components/app-layout/AppHeader.vue.mjs +1 -1
- package/es/components/app-layout/AppHeader.vue2.mjs +60 -69
- package/es/components/app-layout/AppLayout.vue.mjs +2 -2
- package/es/components/app-layout/AppLayout.vue2.mjs +95 -93
- package/es/components/app-layout/AppSidebar.vue.mjs +2 -2
- package/es/components/app-layout/AppSidebar.vue2.mjs +79 -82
- package/es/components/app-layout/AppTheme.vue.mjs +7 -0
- package/es/components/app-layout/AppTheme.vue2.mjs +38 -0
- package/es/components/data-view/DataListView.vue.mjs +2 -2
- package/es/components/data-view/DataListView.vue2.mjs +36 -36
- package/es/components/display/ActionConfirm.vue2.mjs +16 -16
- package/es/components/display/HeightProvider.vue.mjs +10 -10
- package/es/components/display/TabsHeader.vue.mjs +4 -4
- package/es/components/display/TabsHeader.vue2.mjs +34 -34
- package/es/components/display/TabsMain.vue.mjs +40 -39
- package/es/components/display/TabsRefineFlow.vue.mjs +30 -28
- package/es/components/form/FormItem.vue.mjs +1 -1
- package/es/components/form/FormItem.vue2.mjs +75 -81
- package/es/components/form/FormItemNestForm.vue.mjs +7 -0
- package/es/components/form/FormItemNestForm.vue2.mjs +49 -0
- package/es/components/form/FormItemNestFormList.vue.mjs +7 -0
- package/es/components/form/FormItemNestFormList.vue2.mjs +137 -0
- package/es/components/form/FormMain.vue.mjs +5 -147
- package/es/components/form/FormMain.vue2.mjs +160 -2
- package/es/components/form/FormRadioGroup.vue.mjs +42 -49
- package/es/components/form/FormSearch.vue.mjs +2 -2
- package/es/components/form/FormSearch.vue2.mjs +122 -128
- package/es/components/form/FormSelect.vue.mjs +34 -40
- package/es/components/form/FormSubmitBtn.vue.mjs +23 -28
- package/es/components/form/FormSubmitPanel.vue.mjs +2 -2
- package/es/components/form/FormSubmitPanel.vue2.mjs +29 -28
- package/es/components/form/FormTree.vue.mjs +16 -21
- package/es/components/form/FormVerifyCode.vue.mjs +37 -43
- package/es/components/form/FormVerifyImage.vue.mjs +2 -2
- package/es/components/form/FormVerifyImage.vue2.mjs +36 -41
- package/es/components/form/nest-form-item-list.mjs +71 -0
- package/es/components/form/nest-form-item.mjs +42 -0
- package/es/components/form/nest-registry.mjs +7 -0
- package/es/components/form/use-nest-form-list.mjs +22 -0
- package/es/components/form/use-nest-form.mjs +34 -0
- package/es/components/form/use-nest-layout-scale.mjs +14 -0
- package/es/components/form/utils.mjs +77 -61
- package/es/components/list-page/ListPage.vue.mjs +2 -2
- package/es/components/list-page/ListPage.vue2.mjs +134 -139
- package/es/components/menu/MenuItemSub.vue.mjs +41 -48
- package/es/components/menu/MenuTree.vue.mjs +58 -65
- package/es/components/misc/AutoRefresh.vue.mjs +2 -2
- package/es/components/misc/AutoRefresh.vue2.mjs +44 -51
- package/es/components/misc/AutoRefreshGroup.vue.mjs +2 -2
- package/es/components/misc/AutoRefreshGroup.vue2.mjs +37 -43
- package/es/components/modal/ConfirmModal.vue.mjs +3 -4
- package/es/components/modal/ConfirmModal.vue2.mjs +83 -111
- package/es/components/modal/DetailModal.vue.mjs +38 -41
- package/es/components/panel/PanelEditSwitch.vue.mjs +1 -1
- package/es/components/panel/PanelEditSwitch.vue2.mjs +50 -55
- package/es/components/panel/PanelItemNestForm.vue.mjs +7 -0
- package/es/components/panel/PanelItemNestForm.vue2.mjs +69 -0
- package/es/components/panel/PanelItemNestPanel.vue.mjs +34 -0
- package/es/components/panel/PanelItemNestPanel.vue2.mjs +4 -0
- package/es/components/panel/PanelMain.vue.mjs +1 -1
- package/es/components/panel/PanelMain.vue2.mjs +72 -72
- package/es/components/panel/nest-panel-form.mjs +53 -0
- package/es/components/panel/nest-panel-item.mjs +25 -0
- package/es/components/table/TableMain.vue.mjs +2 -2
- package/es/components/table/TableMain.vue2.mjs +221 -229
- package/es/components/table/TableToolbar.vue.mjs +2 -2
- package/es/components/table/TableToolbar.vue2.mjs +115 -126
- package/es/hooks/use-admin-theme-apply.mjs +84 -0
- package/es/hooks/use-admin-viewport-apply.mjs +27 -0
- package/es/index.mjs +190 -153
- package/es/inject/key.mjs +15 -6
- package/es/store/app.mjs +75 -84
- package/es/style.css +1 -1
- package/es/utils/theme-scale.mjs +37 -0
- package/package.json +2 -4
- package/types/bridge/config-hook.d.ts +91 -0
- package/types/bridge/index.d.ts +108 -8
- package/types/bridge/plugin.d.ts +39 -0
- package/types/bridge/theme.d.ts +85 -0
- package/types/components/app-layout/AppTheme.vue.d.ts +2 -0
- package/types/components/app-layout/types.d.ts +1 -1
- package/types/components/form/FormItem.vue.d.ts +12 -12
- package/types/components/form/FormItemNestForm.vue.d.ts +36 -0
- package/types/components/form/FormItemNestFormList.vue.d.ts +63 -0
- package/types/components/form/FormMain.vue.d.ts +2 -2
- package/types/components/form/FormSearch.vue.d.ts +2 -2
- package/types/components/form/FormTree.vue.d.ts +50 -50
- package/types/components/form/index.d.ts +9 -1
- package/types/components/form/nest-form-item-list.d.ts +63 -0
- package/types/components/form/nest-form-item.d.ts +36 -0
- package/types/components/form/nest-registry.d.ts +22 -0
- package/types/components/form/types.d.ts +2 -0
- package/types/components/form/use-nest-form-list.d.ts +20 -0
- package/types/components/form/use-nest-form.d.ts +26 -0
- package/types/components/form/use-nest-layout-scale.d.ts +17 -0
- package/types/components/form/utils.d.ts +26 -1
- package/types/components/menu/MenuTree.vue.d.ts +10 -10
- package/types/components/modal/ModalShelf.vue.d.ts +1 -1
- package/types/components/panel/PanelItemNestForm.vue.d.ts +35 -0
- package/types/components/panel/PanelItemNestPanel.vue.d.ts +22 -0
- package/types/components/panel/index.d.ts +5 -1
- package/types/components/panel/nest-panel-form.d.ts +38 -0
- package/types/components/panel/nest-panel-item.d.ts +28 -0
- package/types/components/panel/types.d.ts +2 -0
- package/types/components/table/TableMain.vue.d.ts +3 -3
- package/types/hooks/activated.d.ts +2 -2
- package/types/hooks/feel-size.d.ts +1 -1
- package/types/hooks/index.d.ts +2 -0
- package/types/hooks/menus-dispatch.d.ts +5 -5
- package/types/hooks/use-admin-theme-apply.d.ts +17 -0
- package/types/hooks/use-admin-viewport-apply.d.ts +15 -0
- package/types/hooks/use-breakpoint.d.ts +1 -1
- package/types/inject/key.d.ts +46 -1
- package/types/store/app.d.ts +138 -59
- package/types/utils/index.d.ts +1 -0
- package/types/utils/theme-scale.d.ts +35 -0
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "element-plus
|
|
3
|
-
|
|
4
|
-
import { defineComponent as m, openBlock as r, createBlock as u } from "vue";
|
|
5
|
-
const i = /* @__PURE__ */ m({
|
|
1
|
+
import { defineComponent as n, openBlock as u, createBlock as c, unref as r } from "vue";
|
|
2
|
+
import { ElTree as m } from "element-plus";
|
|
3
|
+
const s = /* @__PURE__ */ n({
|
|
6
4
|
__name: "FormTree",
|
|
7
5
|
props: {
|
|
8
6
|
modelValue: {},
|
|
@@ -11,24 +9,21 @@ const i = /* @__PURE__ */ m({
|
|
|
11
9
|
defaultExpandAll: { type: Boolean }
|
|
12
10
|
},
|
|
13
11
|
emits: ["update:modelValue"],
|
|
14
|
-
setup(e, { emit:
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
return (d, t) => {
|
|
19
|
-
const n = c;
|
|
20
|
-
return r(), u(n, {
|
|
21
|
-
ref: "elTree",
|
|
22
|
-
data: e.tree,
|
|
23
|
-
showCheckbox: e.showCheckbox,
|
|
24
|
-
nodeKey: "id",
|
|
25
|
-
defaultCheckedKeys: e.modelValue,
|
|
26
|
-
defaultExpandAll: e.defaultExpandAll,
|
|
27
|
-
onCheck: a
|
|
28
|
-
}, null, 8, ["data", "showCheckbox", "defaultCheckedKeys", "defaultExpandAll"]);
|
|
12
|
+
setup(e, { emit: a }) {
|
|
13
|
+
const t = a, o = (d, { checkedKeys: l }) => {
|
|
14
|
+
t("update:modelValue", l);
|
|
29
15
|
};
|
|
16
|
+
return (d, l) => (u(), c(r(m), {
|
|
17
|
+
ref: "elTree",
|
|
18
|
+
data: e.tree,
|
|
19
|
+
showCheckbox: e.showCheckbox,
|
|
20
|
+
nodeKey: "id",
|
|
21
|
+
defaultCheckedKeys: e.modelValue,
|
|
22
|
+
defaultExpandAll: e.defaultExpandAll,
|
|
23
|
+
onCheck: o
|
|
24
|
+
}, null, 8, ["data", "showCheckbox", "defaultCheckedKeys", "defaultExpandAll"]));
|
|
30
25
|
}
|
|
31
26
|
});
|
|
32
27
|
export {
|
|
33
|
-
|
|
28
|
+
s as default
|
|
34
29
|
};
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "element-plus
|
|
3
|
-
import "element-plus/es/components/input/style/css";
|
|
4
|
-
import "element-plus/es/components/button/style/css";
|
|
5
|
-
import { defineComponent as h, ref as u, computed as x, onBeforeUnmount as _, watch as E, openBlock as n, createBlock as I, withCtx as r, createVNode as T, unref as a, createElementBlock as p, toDisplayString as c } from "vue";
|
|
1
|
+
import { defineComponent as b, ref as u, computed as k, onBeforeUnmount as g, watch as h, openBlock as d, createBlock as x, unref as m, withCtx as r, createVNode as B, createElementBlock as f, toDisplayString as p } from "vue";
|
|
2
|
+
import { ElInput as E, ElButton as T } from "element-plus";
|
|
6
3
|
import { timeCountDown as z } from "../../utils/time.mjs";
|
|
7
|
-
const
|
|
4
|
+
const I = { key: 0 }, K = { key: 1 }, F = /* @__PURE__ */ b({
|
|
8
5
|
__name: "FormVerifyCode",
|
|
9
6
|
props: {
|
|
10
7
|
modelValue: {},
|
|
@@ -16,57 +13,54 @@ const K = { key: 0 }, U = { key: 1 }, A = /* @__PURE__ */ h({
|
|
|
16
13
|
btnText: { default: "发送验证码" }
|
|
17
14
|
},
|
|
18
15
|
emits: ["update:modelValue"],
|
|
19
|
-
setup(
|
|
20
|
-
const
|
|
16
|
+
setup(t, { emit: c }) {
|
|
17
|
+
const a = t, v = c, l = u(0), o = u(!1), i = k(() => l.value > 0);
|
|
21
18
|
let e;
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
const y = () => {
|
|
20
|
+
o.value = !0, console.log("发送验证码"), a.api(a.params).then(() => {
|
|
21
|
+
l.value = a.hz, e == null || e(), e = z(
|
|
22
|
+
l.value,
|
|
26
23
|
(s) => {
|
|
27
|
-
|
|
24
|
+
l.value = s;
|
|
28
25
|
},
|
|
29
26
|
() => {
|
|
30
27
|
console.log("倒计时结束");
|
|
31
28
|
}
|
|
32
29
|
);
|
|
33
30
|
}).finally(() => {
|
|
34
|
-
|
|
31
|
+
o.value = !1;
|
|
35
32
|
});
|
|
36
33
|
};
|
|
37
|
-
return
|
|
34
|
+
return g(() => {
|
|
38
35
|
e == null || e();
|
|
39
|
-
}),
|
|
40
|
-
() =>
|
|
36
|
+
}), h(
|
|
37
|
+
() => a.resetKey,
|
|
41
38
|
() => {
|
|
42
|
-
e == null || e(),
|
|
39
|
+
e == null || e(), l.value = 0;
|
|
43
40
|
}
|
|
44
|
-
), (s,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
_: 1
|
|
66
|
-
}, 8, ["modelValue", "disabled"]);
|
|
67
|
-
};
|
|
41
|
+
), (s, n) => (d(), x(m(E), {
|
|
42
|
+
modelValue: t.modelValue,
|
|
43
|
+
disabled: t.disabled,
|
|
44
|
+
"onUpdate:modelValue": n[0] || (n[0] = (V) => v("update:modelValue", V))
|
|
45
|
+
}, {
|
|
46
|
+
suffix: r(() => [
|
|
47
|
+
B(m(T), {
|
|
48
|
+
type: "primary",
|
|
49
|
+
link: "",
|
|
50
|
+
loading: o.value,
|
|
51
|
+
disabled: i.value || t.disabled,
|
|
52
|
+
onClick: y
|
|
53
|
+
}, {
|
|
54
|
+
default: r(() => [
|
|
55
|
+
i.value ? (d(), f("span", I, p(l.value) + "s后可重新发送", 1)) : (d(), f("span", K, p(t.btnText), 1))
|
|
56
|
+
]),
|
|
57
|
+
_: 1
|
|
58
|
+
}, 8, ["loading", "disabled"])
|
|
59
|
+
]),
|
|
60
|
+
_: 1
|
|
61
|
+
}, 8, ["modelValue", "disabled"]));
|
|
68
62
|
}
|
|
69
63
|
});
|
|
70
64
|
export {
|
|
71
|
-
|
|
65
|
+
F as default
|
|
72
66
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./FormVerifyImage.vue2.mjs";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const
|
|
4
|
+
const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-669b7ad9"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "element-plus
|
|
3
|
-
|
|
4
|
-
import { defineComponent as V, ref as r, computed as s, onMounted as _, openBlock as k, createBlock as U, normalizeStyle as u, unref as o, withCtx as I, createElementVNode as c } from "vue";
|
|
5
|
-
const R = ["disabled"], $ = ["src"], d = "9px", E = /* @__PURE__ */ V({
|
|
1
|
+
import { defineComponent as y, ref as m, computed as n, onMounted as h, openBlock as x, createBlock as V, unref as _, normalizeStyle as s, withCtx as k, createElementVNode as u } from "vue";
|
|
2
|
+
import { ElInput as U } from "element-plus";
|
|
3
|
+
const R = ["disabled"], $ = ["src"], d = "9px", B = /* @__PURE__ */ y({
|
|
6
4
|
__name: "FormVerifyImage",
|
|
7
5
|
props: {
|
|
8
6
|
modelValue: {},
|
|
@@ -12,49 +10,46 @@ const R = ["disabled"], $ = ["src"], d = "9px", E = /* @__PURE__ */ V({
|
|
|
12
10
|
autoRevokeUrl: { type: Boolean }
|
|
13
11
|
},
|
|
14
12
|
emits: ["update:modelValue"],
|
|
15
|
-
setup(a, { emit:
|
|
16
|
-
const e = a,
|
|
13
|
+
setup(a, { emit: c }) {
|
|
14
|
+
const e = a, f = c, l = m(!1), t = m(""), p = n(() => ({
|
|
17
15
|
left: `calc(100% + ${d})`,
|
|
18
16
|
width: `${e.imgWidth}px`
|
|
19
|
-
})), v =
|
|
17
|
+
})), v = n(() => ({
|
|
20
18
|
width: `calc(100% - ${d} - ${e.imgWidth}px)`
|
|
21
|
-
})),
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
})), o = () => {
|
|
20
|
+
l.value || (console.log("获取图片验证码"), l.value = !0, t.value && e.autoRevokeUrl && URL.revokeObjectURL(t.value), e.api(e.params).then((i) => {
|
|
21
|
+
t.value = i;
|
|
24
22
|
}).finally(() => {
|
|
25
|
-
|
|
23
|
+
l.value = !1;
|
|
26
24
|
}));
|
|
27
25
|
};
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
}), (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
_: 1
|
|
54
|
-
}, 8, ["modelValue", "style"]);
|
|
55
|
-
};
|
|
26
|
+
return h(() => {
|
|
27
|
+
o();
|
|
28
|
+
}), (i, r) => (x(), V(_(U), {
|
|
29
|
+
placeholder: "验证码",
|
|
30
|
+
modelValue: a.modelValue,
|
|
31
|
+
class: "form-verify-image",
|
|
32
|
+
style: s(v.value),
|
|
33
|
+
"onUpdate:modelValue": r[0] || (r[0] = (g) => f("update:modelValue", g))
|
|
34
|
+
}, {
|
|
35
|
+
suffix: k(() => [
|
|
36
|
+
u("div", {
|
|
37
|
+
class: "form-verify-image-suffix",
|
|
38
|
+
style: s(p.value),
|
|
39
|
+
disabled: l.value,
|
|
40
|
+
onClick: o
|
|
41
|
+
}, [
|
|
42
|
+
u("img", {
|
|
43
|
+
class: "form-verify-image-suffix-main",
|
|
44
|
+
src: t.value,
|
|
45
|
+
alt: ""
|
|
46
|
+
}, null, 8, $)
|
|
47
|
+
], 12, R)
|
|
48
|
+
]),
|
|
49
|
+
_: 1
|
|
50
|
+
}, 8, ["modelValue", "style"]));
|
|
56
51
|
}
|
|
57
52
|
});
|
|
58
53
|
export {
|
|
59
|
-
|
|
54
|
+
B as default
|
|
60
55
|
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { markRaw as K } from "vue";
|
|
2
|
+
import M from "./FormItemNestFormList.vue.mjs";
|
|
3
|
+
import { resolveLayoutSpan as N, parseFormData as S, stringifyFormData as T } from "./utils.mjs";
|
|
4
|
+
const v = K(M);
|
|
5
|
+
function k(l) {
|
|
6
|
+
const {
|
|
7
|
+
key: m,
|
|
8
|
+
label: n,
|
|
9
|
+
list: o,
|
|
10
|
+
rowKey: d,
|
|
11
|
+
itemFactory: h,
|
|
12
|
+
min: f,
|
|
13
|
+
max: y,
|
|
14
|
+
layout: p,
|
|
15
|
+
rowGutter: c,
|
|
16
|
+
addText: F,
|
|
17
|
+
removeText: R,
|
|
18
|
+
headerRender: w,
|
|
19
|
+
footerRender: A,
|
|
20
|
+
shadowColor: L,
|
|
21
|
+
rules: t,
|
|
22
|
+
init: x,
|
|
23
|
+
stringify: I,
|
|
24
|
+
parse: $,
|
|
25
|
+
rebase: C,
|
|
26
|
+
removeConfirm: D
|
|
27
|
+
} = l, i = f ?? 0, s = y ?? 1 / 0, u = {
|
|
28
|
+
validator: (r, e, a) => {
|
|
29
|
+
const g = Array.isArray(e) ? e.length : 0;
|
|
30
|
+
return g < i ? a(new Error(`${n}至少需要 ${i} 项`)) : g > s ? a(new Error(`${n}最多 ${s} 项`)) : a();
|
|
31
|
+
},
|
|
32
|
+
trigger: "change"
|
|
33
|
+
}, E = i > 0 || s !== 1 / 0 ? typeof t == "function" ? (r) => [u, ...t(r)] : [u, ...t ?? []] : t;
|
|
34
|
+
return {
|
|
35
|
+
key: m,
|
|
36
|
+
label: n,
|
|
37
|
+
layout: p,
|
|
38
|
+
rules: E,
|
|
39
|
+
// 自动 pack(可覆盖):父 generate/stringify/parse 对数组逐项递归。
|
|
40
|
+
// init 缺省 = 空数组 []([MUST NOT] 补 min 行改初始值;min/max 由上方 rules 校验)
|
|
41
|
+
init: x ?? (() => []),
|
|
42
|
+
stringify: I ?? ((r) => (Array.isArray(r) ? r : []).map(
|
|
43
|
+
(e) => T(e, o)
|
|
44
|
+
)),
|
|
45
|
+
parse: $ ?? ((r) => (Array.isArray(r) ? r : []).map((e) => S(e, o))),
|
|
46
|
+
// render 用【组件本体引用】(非包裹 fn):FormItem 经 vModel sugar 注入 modelValue/onUpdate,
|
|
47
|
+
// 固定配置走 props。便于消费方按 `config.render === FormItemNestFormList` 判定"是联结组件"。
|
|
48
|
+
render: v,
|
|
49
|
+
props: {
|
|
50
|
+
nestKey: m,
|
|
51
|
+
list: o,
|
|
52
|
+
rowKey: d,
|
|
53
|
+
itemFactory: h,
|
|
54
|
+
min: f,
|
|
55
|
+
max: y,
|
|
56
|
+
rowGutter: c,
|
|
57
|
+
addText: F,
|
|
58
|
+
removeText: R,
|
|
59
|
+
headerRender: w,
|
|
60
|
+
footerRender: A,
|
|
61
|
+
shadowColor: L,
|
|
62
|
+
// P3:把父 item 代表 span 传薄壳,供其叠 rebase 因子算每行子 FormMain 的 layoutScale
|
|
63
|
+
parentSpan: N(p),
|
|
64
|
+
rebase: C,
|
|
65
|
+
removeConfirm: D
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
k as nestFormItemList
|
|
71
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { markRaw as y } from "vue";
|
|
2
|
+
import l from "./FormItemNestForm.vue.mjs";
|
|
3
|
+
import { resolveLayoutSpan as u, parseFormData as g, stringifyFormData as w, generateFormData as c } from "./utils.mjs";
|
|
4
|
+
const D = y(l);
|
|
5
|
+
function k(a) {
|
|
6
|
+
const {
|
|
7
|
+
key: e,
|
|
8
|
+
label: m,
|
|
9
|
+
list: r,
|
|
10
|
+
layout: o,
|
|
11
|
+
rowGutter: n,
|
|
12
|
+
shadowColor: s,
|
|
13
|
+
init: i,
|
|
14
|
+
stringify: p,
|
|
15
|
+
parse: F,
|
|
16
|
+
rebase: f
|
|
17
|
+
} = a;
|
|
18
|
+
return {
|
|
19
|
+
key: e,
|
|
20
|
+
label: m,
|
|
21
|
+
layout: o,
|
|
22
|
+
// 自动 pack(可覆盖):父 generate/stringify/parse 递归进子 list
|
|
23
|
+
init: i ?? (() => c(r)),
|
|
24
|
+
stringify: p ?? ((t) => w(t ?? {}, r)),
|
|
25
|
+
parse: F ?? ((t) => g(t ?? {}, r)),
|
|
26
|
+
// render 用【组件本体引用】(非包裹 fn):FormItem 经 vModel sugar 注入 modelValue/onUpdate,
|
|
27
|
+
// 固定配置走 props。便于消费方按 `config.render === FormItemNestForm` 判定"是联结组件"。
|
|
28
|
+
render: D,
|
|
29
|
+
props: {
|
|
30
|
+
nestKey: e,
|
|
31
|
+
list: r,
|
|
32
|
+
rowGutter: n,
|
|
33
|
+
shadowColor: s,
|
|
34
|
+
// P3:把父 item 代表 span 传薄壳,供其叠 rebase 因子算子 FormMain 的 layoutScale
|
|
35
|
+
parentSpan: u(o),
|
|
36
|
+
rebase: f
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
k as nestFormItem
|
|
42
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { inject as s, onMounted as l, toValue as a, onBeforeUnmount as c } from "vue";
|
|
2
|
+
import { FORM_NEST_REGISTRY_KEY as d } from "../../inject/key.mjs";
|
|
3
|
+
function u(n) {
|
|
4
|
+
const { rowInstances: t, key: r } = n, o = s(d, null);
|
|
5
|
+
if (!o) return;
|
|
6
|
+
const i = {
|
|
7
|
+
validate: () => Promise.all(t().map((e) => e.validate())).then(() => {
|
|
8
|
+
}),
|
|
9
|
+
clearValidate: () => t().forEach((e) => e.clearValidate()),
|
|
10
|
+
resetFields: () => t().forEach((e) => e.resetFields())
|
|
11
|
+
};
|
|
12
|
+
l(() => {
|
|
13
|
+
const e = a(r);
|
|
14
|
+
e !== void 0 && (o[e] = i);
|
|
15
|
+
}), c(() => {
|
|
16
|
+
const e = a(r);
|
|
17
|
+
e !== void 0 && delete o[e];
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
u as useNestFormList
|
|
22
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { inject as d, onMounted as u, toValue as a, onBeforeUnmount as f } from "vue";
|
|
2
|
+
import { FORM_NEST_REGISTRY_KEY as p } from "../../inject/key.mjs";
|
|
3
|
+
function x(c) {
|
|
4
|
+
const { childRef: s, key: i } = c, l = () => {
|
|
5
|
+
var o;
|
|
6
|
+
return ((o = s.value) == null ? void 0 : o.validate()) ?? Promise.resolve();
|
|
7
|
+
}, r = (o) => {
|
|
8
|
+
var e;
|
|
9
|
+
return (e = s.value) == null ? void 0 : e.clearValidate(o);
|
|
10
|
+
}, n = () => {
|
|
11
|
+
var o;
|
|
12
|
+
return (o = s.value) == null ? void 0 : o.resetFields();
|
|
13
|
+
}, t = d(p, null);
|
|
14
|
+
if (t) {
|
|
15
|
+
const o = {
|
|
16
|
+
validate: () => l(),
|
|
17
|
+
clearValidate: (e) => r(e),
|
|
18
|
+
resetFields: () => n()
|
|
19
|
+
};
|
|
20
|
+
u(() => {
|
|
21
|
+
const e = a(i);
|
|
22
|
+
e !== void 0 && (e in t && t[e] === o && console.error(
|
|
23
|
+
`[useNestForm] 嵌套 exposeMap 重复注册同一 expose(key="${e}"),疑似生命周期重复挂载;已继续挂载。`
|
|
24
|
+
), t[e] = o);
|
|
25
|
+
}), f(() => {
|
|
26
|
+
const e = a(i);
|
|
27
|
+
e !== void 0 && delete t[e];
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return { validateChild: l, clearChild: r, resetChild: n };
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
x as useNestForm
|
|
34
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { inject as u, computed as c, toValue as o } from "vue";
|
|
2
|
+
import { NEST_LAYOUT_SCALE_KEY as f } from "../../inject/key.mjs";
|
|
3
|
+
function m(t) {
|
|
4
|
+
const r = u(f, void 0);
|
|
5
|
+
return c(() => {
|
|
6
|
+
const n = r ? r.value : 1;
|
|
7
|
+
if (o(t.rebase) === !1) return n;
|
|
8
|
+
const e = o(t.parentSpan), a = typeof e == "number" && e > 0 ? e : 24;
|
|
9
|
+
return n * (24 / a);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
m as useNestLayoutScale
|
|
14
|
+
};
|