@done-coding/admin-core 0.2.0 → 0.3.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.
Files changed (34) hide show
  1. package/es/components/modal/ModalPorter.vue.mjs +52 -0
  2. package/es/components/modal/ModalPorter.vue2.mjs +4 -0
  3. package/es/components/modal/ModalShelf.vue.mjs +38 -0
  4. package/es/components/modal/ModalShelf.vue2.mjs +4 -0
  5. package/es/components/modal/index.mjs +17 -11
  6. package/es/components/modal/modal-shelf-core.mjs +52 -0
  7. package/es/components/modal/modal-shelf-hierarchy.mjs +21 -0
  8. package/es/components/panel/PanelEditSwitch.vue.mjs +7 -0
  9. package/es/components/panel/PanelEditSwitch.vue2.mjs +93 -0
  10. package/es/components/panel/PanelItem.vue.mjs +54 -0
  11. package/es/components/panel/PanelItem.vue2.mjs +4 -0
  12. package/es/components/panel/PanelMain.vue.mjs +80 -0
  13. package/es/components/panel/PanelMain.vue2.mjs +4 -0
  14. package/es/components/panel/index.mjs +20 -0
  15. package/es/index.mjs +122 -109
  16. package/es/inject/key.mjs +8 -4
  17. package/es/style.css +1 -1
  18. package/package.json +2 -2
  19. package/types/components/misc/ActionConfirm.vue.d.ts +1 -1
  20. package/types/components/modal/ConfirmModal.vue.d.ts +3 -3
  21. package/types/components/modal/ModalPorter.vue.d.ts +29 -0
  22. package/types/components/modal/ModalShelf.vue.d.ts +36 -0
  23. package/types/components/modal/index.d.ts +5 -1
  24. package/types/components/modal/modal-shelf-core.d.ts +10 -0
  25. package/types/components/modal/modal-shelf-hierarchy.d.ts +7 -0
  26. package/types/components/modal/modal-shelf-types.d.ts +74 -0
  27. package/types/components/panel/PanelEditSwitch.vue.d.ts +31 -0
  28. package/types/components/panel/PanelItem.vue.d.ts +21 -0
  29. package/types/components/panel/PanelMain.vue.d.ts +17 -0
  30. package/types/components/panel/index.d.ts +9 -0
  31. package/types/components/panel/types.d.ts +62 -0
  32. package/types/components/table/TableToolbar.vue.d.ts +8 -8
  33. package/types/index.d.ts +3 -1
  34. package/types/inject/key.d.ts +8 -0
@@ -0,0 +1,52 @@
1
+ import { defineComponent as S, getCurrentInstance as h, inject as c, renderSlot as v } from "vue";
2
+ import { getModalShelfInjectionKey as u } from "../../inject/key.mjs";
3
+ import { useActivatedEvent as y } from "../../hooks/activated.mjs";
4
+ const k = /* @__PURE__ */ S({
5
+ __name: "ModalPorter",
6
+ props: {
7
+ modalList: {}
8
+ },
9
+ setup(i, { expose: p }) {
10
+ var s;
11
+ const o = i, f = ((s = h()) == null ? void 0 : s.uid) ?? Math.floor(Math.random() * 1e9), d = {
12
+ app: c(u("app"), null),
13
+ page: c(u("page"), null)
14
+ };
15
+ function a(e) {
16
+ return `p${f}:${e}`;
17
+ }
18
+ function l(e) {
19
+ if (e === "app" || e === "page") {
20
+ const t = d[e];
21
+ return t || (console.error(`[ModalPorter] 未找到 level="${e}" 的 ModalShelf`), null);
22
+ }
23
+ return e;
24
+ }
25
+ function m(e, t) {
26
+ const r = o.modalList.find((g) => g.key === e);
27
+ if (!r)
28
+ return console.error(`[ModalPorter] 未配置的弹窗 key: ${String(e)}`), null;
29
+ const n = l(r.shelf);
30
+ return n ? n.evoke(a(String(e)), r.component, {
31
+ payload: t,
32
+ sameKeyStrategy: r.sameKeyStrategy
33
+ }) : null;
34
+ }
35
+ return y(
36
+ () => {
37
+ },
38
+ () => {
39
+ const e = /* @__PURE__ */ new Map();
40
+ o.modalList.forEach((t) => {
41
+ const r = l(t.shelf);
42
+ if (!r) return;
43
+ const n = e.get(r) ?? [];
44
+ n.push(a(String(t.key))), e.set(r, n);
45
+ }), e.forEach((t, r) => r.remove(t));
46
+ }
47
+ ), p({ evoke: m }), (e, t) => v(e.$slots, "default");
48
+ }
49
+ });
50
+ export {
51
+ k as default
52
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ModalPorter.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,38 @@
1
+ import { defineComponent as h, provide as v, onMounted as y, inject as a, openBlock as s, createElementBlock as c, Fragment as u, renderSlot as w, renderList as C, unref as l, createBlock as F, resolveDynamicComponent as _, defineAsyncComponent as k } from "vue";
2
+ import { createShelfController as S } from "./modal-shelf-core.mjs";
3
+ import { assertLevelHierarchy as g } from "./modal-shelf-hierarchy.mjs";
4
+ import { getModalShelfInjectionKey as p } from "../../inject/key.mjs";
5
+ const E = /* @__PURE__ */ h({
6
+ __name: "ModalShelf",
7
+ props: {
8
+ level: {}
9
+ },
10
+ setup(f, { expose: m }) {
11
+ const r = f.level, n = S(r);
12
+ m(n), v(p(r), n);
13
+ function d(o) {
14
+ return typeof o == "function" ? k(o) : o;
15
+ }
16
+ return y(() => {
17
+ const o = [];
18
+ ["app", "page", "custom"].forEach((e) => {
19
+ e !== r && a(p(e), null) && o.push(e);
20
+ });
21
+ const t = a(p(r), null);
22
+ t && t !== n && o.push(r), g(r, o);
23
+ }), (o, t) => (s(), c(u, null, [
24
+ w(o.$slots, "default"),
25
+ (s(!0), c(u, null, C(l(n).items.value, (e) => (s(), F(_(d(e.component)), {
26
+ key: e.id,
27
+ show: e.show,
28
+ payload: e.payload,
29
+ closeFn: () => l(n).close(e),
30
+ removeFn: () => l(n).remove(e.nsKey),
31
+ "onUpdate:show": (i) => !i && l(n).close(e)
32
+ }, null, 40, ["show", "payload", "closeFn", "removeFn", "onUpdate:show"]))), 128))
33
+ ], 64));
34
+ }
35
+ });
36
+ export {
37
+ E as default
38
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./ModalShelf.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -1,17 +1,23 @@
1
- import n from "./ConfirmModal.vue.mjs";
2
- import l from "./DetailModal.vue.mjs";
3
- const m = {
4
- ConfirmModal: n,
5
- DetailModal: l
6
- }, r = {
1
+ import l from "./ConfirmModal.vue.mjs";
2
+ import r from "./DetailModal.vue.mjs";
3
+ import m from "./ModalShelf.vue.mjs";
4
+ import n from "./ModalPorter.vue.mjs";
5
+ const e = {
6
+ ConfirmModal: l,
7
+ DetailModal: r,
8
+ ModalShelf: m,
9
+ ModalPorter: n
10
+ }, d = {
7
11
  install(o) {
8
- Object.entries(m).forEach(([t, a]) => {
9
- o.component(t, a);
12
+ Object.entries(e).forEach(([a, t]) => {
13
+ o.component(a, t);
10
14
  });
11
15
  }
12
16
  };
13
17
  export {
14
- n as ConfirmModal,
15
- l as DetailModal,
16
- r as modalInstall
18
+ l as ConfirmModal,
19
+ r as DetailModal,
20
+ n as ModalPorter,
21
+ m as ModalShelf,
22
+ d as modalInstall
17
23
  };
@@ -0,0 +1,52 @@
1
+ import { ref as h } from "vue";
2
+ const x = 300;
3
+ function g(s) {
4
+ let l = 0;
5
+ const r = h([]);
6
+ function d(e) {
7
+ return r.value.findIndex((t) => t.nsKey === e);
8
+ }
9
+ function u(e) {
10
+ e.timer !== void 0 && (clearTimeout(e.timer), e.timer = void 0);
11
+ }
12
+ function a(e) {
13
+ (Array.isArray(e) ? e : [e]).forEach((i) => {
14
+ const n = d(i);
15
+ n > -1 && (u(r.value[n]), r.value.splice(n, 1));
16
+ });
17
+ }
18
+ function c(e) {
19
+ const t = r.value.find((i) => i.id === e.id);
20
+ t && t.timer === void 0 && (t.show = !1, t.timer = setTimeout(() => {
21
+ const i = r.value.findIndex((n) => n.id === e.id);
22
+ i > -1 && r.value.splice(i, 1);
23
+ }, x));
24
+ }
25
+ function f(e) {
26
+ return {
27
+ close: () => {
28
+ const t = r.value.find((i) => i.nsKey === e);
29
+ t && c(t);
30
+ },
31
+ update: (t) => {
32
+ const i = r.value.find((n) => n.nsKey === e);
33
+ i && (i.payload = { ...i.payload, ...t });
34
+ }
35
+ };
36
+ }
37
+ function v(e, t, i) {
38
+ const { payload: n, sameKeyStrategy: m = "recreate" } = i;
39
+ if (m === "update") {
40
+ const o = r.value.find((y) => y.nsKey === e);
41
+ if (o)
42
+ return u(o), o.show = !0, o.payload = n, f(e);
43
+ }
44
+ a(e);
45
+ const p = { id: ++l, nsKey: e, component: t, payload: n, show: !0 };
46
+ return r.value.push(p), f(e);
47
+ }
48
+ return { level: s, items: r, evoke: v, remove: a, close: c };
49
+ }
50
+ export {
51
+ g as createShelfController
52
+ };
@@ -0,0 +1,21 @@
1
+ function l(o, e) {
2
+ if (o === "app" && e.length > 0) {
3
+ console.error(
4
+ `[ModalShelf] level="app" 必须最顶层,但其上存在: ${e.join(
5
+ ", "
6
+ )}`
7
+ );
8
+ return;
9
+ }
10
+ if (o === "page") {
11
+ const r = e.filter((a) => a === "page" || a === "custom");
12
+ r.length > 0 && console.error(
13
+ `[ModalShelf] level="page" 之上不得套 page/custom,发现: ${r.join(
14
+ ", "
15
+ )}`
16
+ );
17
+ }
18
+ }
19
+ export {
20
+ l as assertLevelHierarchy
21
+ };
@@ -0,0 +1,7 @@
1
+ import t from "./PanelEditSwitch.vue2.mjs";
2
+ /* empty css */
3
+ import o from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const i = /* @__PURE__ */ o(t, [["__scopeId", "data-v-ea2a07d5"]]);
5
+ export {
6
+ i as default
7
+ };
@@ -0,0 +1,93 @@
1
+ import { ElButton as E } from "element-plus/es";
2
+ import "element-plus/es/components/base/style/css";
3
+ import "element-plus/es/components/button/style/css";
4
+ import { defineComponent as h, ref as d, watch as B, openBlock as u, createElementBlock as f, unref as m, createBlock as C, withCtx as c, createTextVNode as p, createCommentVNode as S, renderSlot as v, Fragment as N, createElementVNode as P, createVNode as g } from "vue";
5
+ import V from "lodash/cloneDeep";
6
+ const $ = { class: "panel-edit-switch-actions" }, j = /* @__PURE__ */ h({
7
+ name: "PanelEditSwitch",
8
+ __name: "PanelEditSwitch",
9
+ props: {
10
+ data: {},
11
+ editing: { type: Boolean },
12
+ submitFn: { type: Function }
13
+ },
14
+ emits: ["update:editing", "submitFinish"],
15
+ setup(a, { emit: b }) {
16
+ const o = a, i = b, s = d(!1), l = d(!1), n = d({});
17
+ B(
18
+ () => o.editing,
19
+ (t, e) => {
20
+ t && !e && (n.value = V(o.data));
21
+ },
22
+ { immediate: !0 }
23
+ );
24
+ const y = () => {
25
+ i("update:editing", !0);
26
+ }, k = () => {
27
+ i("update:editing", !1);
28
+ }, w = async () => {
29
+ if (!o.submitFn) {
30
+ console.error("[PanelEditSwitch] editable 项缺少 submitFn,无法提交");
31
+ return;
32
+ }
33
+ l.value = !0;
34
+ try {
35
+ await o.submitFn(n.value), i("submitFinish", !0, n.value), i("update:editing", !1);
36
+ } catch (t) {
37
+ console.error("[PanelEditSwitch] submitFn 失败", t), i("submitFinish", !1, n.value);
38
+ } finally {
39
+ l.value = !1;
40
+ }
41
+ };
42
+ return (t, e) => {
43
+ const r = E;
44
+ return u(), f("div", {
45
+ class: "panel-edit-switch",
46
+ onMouseenter: e[0] || (e[0] = (F) => s.value = !0),
47
+ onMouseleave: e[1] || (e[1] = (F) => s.value = !1)
48
+ }, [
49
+ !a.editing && m(s) ? (u(), C(r, {
50
+ key: 0,
51
+ class: "panel-edit-switch-edit-btn",
52
+ type: "primary",
53
+ link: "",
54
+ size: "small",
55
+ onClick: y
56
+ }, {
57
+ default: c(() => [...e[2] || (e[2] = [
58
+ p("编辑", -1)
59
+ ])]),
60
+ _: 1
61
+ })) : S("", !0),
62
+ a.editing ? (u(), f(N, { key: 2 }, [
63
+ v(t.$slots, "editor", { data: m(n) }, void 0, !0),
64
+ P("div", $, [
65
+ g(r, {
66
+ size: "small",
67
+ onClick: k
68
+ }, {
69
+ default: c(() => [...e[3] || (e[3] = [
70
+ p("取消", -1)
71
+ ])]),
72
+ _: 1
73
+ }),
74
+ g(r, {
75
+ type: "primary",
76
+ size: "small",
77
+ loading: m(l),
78
+ onClick: w
79
+ }, {
80
+ default: c(() => [...e[4] || (e[4] = [
81
+ p("提交", -1)
82
+ ])]),
83
+ _: 1
84
+ }, 8, ["loading"])
85
+ ])
86
+ ], 64)) : v(t.$slots, "default", { key: 1 }, void 0, !0)
87
+ ], 32);
88
+ };
89
+ }
90
+ });
91
+ export {
92
+ j as default
93
+ };
@@ -0,0 +1,54 @@
1
+ import { defineComponent as P, computed as c, unref as r, openBlock as n, createElementBlock as f, Fragment as w, toDisplayString as k, createBlock as l, resolveDynamicComponent as u, normalizeProps as g, mergeProps as m, withCtx as h } from "vue";
2
+ import S from "./PanelEditSwitch.vue.mjs";
3
+ const x = { key: 0 }, C = { key: 0 }, E = { key: 0 }, I = /* @__PURE__ */ P({
4
+ name: "PanelItem",
5
+ __name: "PanelItem",
6
+ props: {
7
+ data: {},
8
+ config: {},
9
+ editing: { type: Boolean }
10
+ },
11
+ emits: ["update:editing", "submitFinish", "refresh"],
12
+ setup(e, { emit: b }) {
13
+ const t = e, o = b, a = c(() => ({
14
+ data: t.data,
15
+ value: t.data[t.config.key],
16
+ config: t.config,
17
+ refresh: () => o("refresh")
18
+ })), p = c(() => {
19
+ const { editable: i } = t.config;
20
+ return typeof i == "function" ? !!i(a.value) : !!i;
21
+ }), v = c(() => String(a.value.value ?? "")), y = c(() => ({
22
+ data: a.value.data,
23
+ value: a.value.value,
24
+ config: a.value.config,
25
+ refresh: () => o("refresh"),
26
+ onRefresh: () => o("refresh")
27
+ })), B = (i) => ({
28
+ data: i,
29
+ value: i[t.config.key],
30
+ config: t.config
31
+ });
32
+ return (i, s) => r(p) ? (n(), l(S, {
33
+ key: 1,
34
+ data: e.data,
35
+ editing: e.editing,
36
+ "submit-fn": e.config.submitFn,
37
+ "onUpdate:editing": s[0] || (s[0] = (d) => o("update:editing", d)),
38
+ onSubmitFinish: s[1] || (s[1] = (d, F) => o("submitFinish", d, F))
39
+ }, {
40
+ editor: h(({ data: d }) => [
41
+ e.config.editorRender === void 0 ? (n(), f("span", E)) : (n(), l(u(e.config.editorRender), g(m({ key: 1 }, B(d))), null, 16))
42
+ ]),
43
+ default: h(() => [
44
+ e.config.render === void 0 ? (n(), f("span", C, k(r(v)), 1)) : (n(), l(u(e.config.render), g(m({ key: 1 }, r(y))), null, 16))
45
+ ]),
46
+ _: 1
47
+ }, 8, ["data", "editing", "submit-fn"])) : (n(), f(w, { key: 0 }, [
48
+ e.config.render === void 0 ? (n(), f("span", x, k(r(v)), 1)) : (n(), l(u(e.config.render), g(m({ key: 1 }, r(y))), null, 16))
49
+ ], 64));
50
+ }
51
+ });
52
+ export {
53
+ I as default
54
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./PanelItem.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,80 @@
1
+ import { ElRow as x, ElCol as R } from "element-plus/es";
2
+ import "element-plus/es/components/base/style/css";
3
+ import "element-plus/es/components/row/style/css";
4
+ import "element-plus/es/components/col/style/css";
5
+ import { defineComponent as L, ref as B, computed as F, watch as M, openBlock as s, createBlock as f, withCtx as l, createElementBlock as P, Fragment as b, renderList as D, unref as u, withDirectives as S, mergeProps as U, createVNode as j, vShow as H } from "vue";
6
+ import N from "./PanelItem.vue.mjs";
7
+ import { resolveFormLayout as m } from "../form/utils.mjs";
8
+ const I = /* @__PURE__ */ L({
9
+ name: "PanelMain",
10
+ __name: "PanelMain",
11
+ props: {
12
+ data: {},
13
+ layout: { default: () => ({ span: 24 }) },
14
+ list: {}
15
+ },
16
+ emits: ["refresh"],
17
+ setup(c, { emit: p }) {
18
+ const n = c, d = p, g = (e) => e, h = (e) => e, a = B({}), y = F(
19
+ () => n.list.map((e, t) => ({ config: e, index: t })).sort((e, t) => {
20
+ const o = e.config.order ?? e.index, i = t.config.order ?? t.index;
21
+ return o - i;
22
+ })
23
+ ), _ = (e) => {
24
+ const { hide: t } = e;
25
+ if (typeof t == "function") {
26
+ const o = {
27
+ data: n.data,
28
+ value: n.data[e.key],
29
+ config: e
30
+ };
31
+ return !!t(o);
32
+ }
33
+ return !!t;
34
+ }, k = (e) => ({
35
+ ...m(n.layout),
36
+ ...m(e)
37
+ }), v = (e, t) => {
38
+ a.value = {}, t && (a.value[e] = t);
39
+ }, E = (e, t) => {
40
+ e && d("refresh", t);
41
+ }, w = () => d("refresh", n.data);
42
+ return M(
43
+ () => n.list,
44
+ (e) => {
45
+ const t = e.map((o) => o.key);
46
+ Object.keys(a.value).forEach((o) => {
47
+ t.includes(o) || delete a.value[o];
48
+ });
49
+ },
50
+ { immediate: !0 }
51
+ ), (e, t) => {
52
+ const o = R, i = x;
53
+ return s(), f(i, null, {
54
+ default: l(() => [
55
+ (s(!0), P(b, null, D(u(y), (r) => S((s(), f(o, U({
56
+ key: r.config.key
57
+ }, { ref_for: !0 }, k(r.config.layout)), {
58
+ default: l(() => [
59
+ j(N, {
60
+ data: g(c.data),
61
+ config: h(r.config),
62
+ editing: u(a)[r.config.key] ?? !1,
63
+ "onUpdate:editing": (C) => v(r.config.key, C),
64
+ onSubmitFinish: E,
65
+ onRefresh: w
66
+ }, null, 8, ["data", "config", "editing", "onUpdate:editing"])
67
+ ]),
68
+ _: 2
69
+ }, 1040)), [
70
+ [H, !_(r.config)]
71
+ ])), 128))
72
+ ]),
73
+ _: 1
74
+ });
75
+ };
76
+ }
77
+ });
78
+ export {
79
+ I as default
80
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./PanelMain.vue.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,20 @@
1
+ import e from "./PanelMain.vue.mjs";
2
+ import o from "./PanelItem.vue.mjs";
3
+ import m from "./PanelEditSwitch.vue.mjs";
4
+ const i = {
5
+ PanelMain: e,
6
+ PanelItem: o,
7
+ PanelEditSwitch: m
8
+ }, r = {
9
+ install(n) {
10
+ Object.entries(i).forEach(([t, a]) => {
11
+ n.component(t, a);
12
+ });
13
+ }
14
+ };
15
+ export {
16
+ m as PanelEditSwitch,
17
+ o as PanelItem,
18
+ e as PanelMain,
19
+ r as panelInstall
20
+ };
package/es/index.mjs CHANGED
@@ -5,128 +5,141 @@ import { miscInstall as a } from "./components/misc/index.mjs";
5
5
  import { modalInstall as m } from "./components/modal/index.mjs";
6
6
  import { tableInstall as f } from "./components/table/index.mjs";
7
7
  import { listPageInstall as s } from "./components/list-page/index.mjs";
8
- import { createAdminBridge as g } from "./bridge/index.mjs";
9
- import { default as _ } from "./components/misc/ActionBtn.vue.mjs";
8
+ import { panelInstall as l } from "./components/panel/index.mjs";
9
+ import { createAdminBridge as A } from "./bridge/index.mjs";
10
+ import { default as C } from "./components/misc/ActionBtn.vue.mjs";
10
11
  import { default as T } from "./components/misc/ActionButton.vue.mjs";
11
- import { default as F } from "./components/misc/ActionButtonDanger.vue.mjs";
12
+ import { default as L } from "./components/misc/ActionButtonDanger.vue.mjs";
12
13
  import { default as R } from "./components/misc/ActionButtonWarn.vue.mjs";
13
- import { default as O } from "./components/modal/DetailModal.vue.mjs";
14
- import { default as D } from "./components/form/FormMain.vue.mjs";
15
- import { default as h } from "./components/form/FormRadioGroup.vue.mjs";
16
- import { default as b } from "./components/form/FormSelect.vue.mjs";
17
- import { default as v } from "./components/form/FormTree.vue.mjs";
18
- import { default as H } from "./components/form/FormVerifyCode.vue.mjs";
19
- import { default as V } from "./components/display/HeightProvider.vue.mjs";
20
- import { default as W } from "./components/menu/MenuItemSub.vue.mjs";
21
- import { default as k } from "./components/menu/MenuTree.vue.mjs";
22
- import { default as X } from "./components/misc/TriggerAutoImport.vue.mjs";
23
- import { default as Q } from "./components/display/WatchSize.vue.mjs";
24
- import { APP_API_LIST_MODEL_KEY_CONFIG as q } from "./config/list-model.mjs";
25
- import { default as Z } from "./components/misc/ActionConfirm.vue.mjs";
26
- import { default as ee } from "./components/misc/AutoRefresh.vue.mjs";
27
- import { BODY_CONTENT_VIEWPORT_HEIGHT as oe, FULLSCREEN_HEIGHT_CHANNEL as re } from "./inject/key.mjs";
28
- import { default as me } from "./components/modal/ConfirmModal.vue.mjs";
29
- import { EXPORT_MAX_LIMIT as se, OPERATE_COLUMN_PROP as le, exportCSV as ue, pickExportColumns as ie } from "./utils/export.mjs";
30
- import { FORM_CONFIG_SELECT_ALL_VALUE as ne, getConfirmPasswordRule as xe, passwordRule as de, setFormComponentType as ce } from "./helpers/form.mjs";
31
- import { FORM_ITEM_CHANGE_LOADING as Ie, generateFormData as ge, getBlurSubmit as Ae, getChangeSubmit as _e, getDatePickerShortcuts as Ce, getEnterSubmit as Te, getPlaceholder as Me, getVModelSugar as Fe, parseFormData as Le, resolveFormLayout as Re, setInputComponent as Se, setSelectComponent as Oe, stringifyFormData as Pe, swiftFormItemConfig as De } from "./components/form/utils.mjs";
32
- import { default as he } from "./components/form/FormSearch.vue.mjs";
33
- import { default as be } from "./components/form/FormVerifyImage.vue.mjs";
34
- import { default as ve } from "./components/list-page/ListPage.vue.mjs";
35
- import { ROUTE_MODULE_LEVEL as He, TabsMainReplaceQueryKey as Ue } from "./config/route.mjs";
36
- import { default as we } from "./components/table/TableMain.vue.mjs";
37
- import { default as Ke } from "./components/display/TabsMain.vue.mjs";
38
- import { countAll as ze, createListApi as Xe, fetchListAll as Ye } from "./helpers/list-helper.mjs";
39
- import { createGenerateRouteMetaRawTree as je } from "./helpers/route.mjs";
40
- import { createStorageWithNamespace as Je } from "./helpers/storage.mjs";
41
- import { createUseState as $e } from "./helpers/state.mjs";
42
- import { createUserStore as tt } from "./store/user.mjs";
43
- import { flatRouteMetaResolveRaw as rt, getRoutePermissionKey as at } from "./utils/router.mjs";
44
- import { getId as ft } from "./utils/id.mjs";
45
- import { timeCountDown as lt } from "./utils/time.mjs";
46
- import { useActivated as it, useActivatedEvent as pt, useActivatedExec as nt } from "./hooks/activated.mjs";
47
- import { useFeelSize as dt } from "./hooks/feel-size.mjs";
48
- import { useMenusDataDispatch as Et } from "./hooks/menus-dispatch.mjs";
49
- import { useTimeout as gt } from "./hooks/timeout.mjs";
50
- const c = {
14
+ import { default as h } from "./components/modal/DetailModal.vue.mjs";
15
+ import { default as N } from "./components/form/FormMain.vue.mjs";
16
+ import { default as b } from "./components/form/FormRadioGroup.vue.mjs";
17
+ import { default as v } from "./components/form/FormSelect.vue.mjs";
18
+ import { default as B } from "./components/form/FormTree.vue.mjs";
19
+ import { default as U } from "./components/form/FormVerifyCode.vue.mjs";
20
+ import { default as K } from "./components/display/HeightProvider.vue.mjs";
21
+ import { default as k } from "./components/menu/MenuItemSub.vue.mjs";
22
+ import { default as X } from "./components/menu/MenuTree.vue.mjs";
23
+ import { default as j } from "./components/modal/ModalPorter.vue.mjs";
24
+ import { default as q } from "./components/modal/ModalShelf.vue.mjs";
25
+ import { default as Z } from "./components/panel/PanelItem.vue.mjs";
26
+ import { default as ee } from "./components/panel/PanelMain.vue.mjs";
27
+ import { default as oe } from "./components/misc/TriggerAutoImport.vue.mjs";
28
+ import { default as ae } from "./components/display/WatchSize.vue.mjs";
29
+ import { APP_API_LIST_MODEL_KEY_CONFIG as fe } from "./config/list-model.mjs";
30
+ import { default as le } from "./components/misc/ActionConfirm.vue.mjs";
31
+ import { default as ie } from "./components/misc/AutoRefresh.vue.mjs";
32
+ import { BODY_CONTENT_VIEWPORT_HEIGHT as pe, FULLSCREEN_HEIGHT_CHANNEL as xe, getModalShelfInjectionKey as de } from "./inject/key.mjs";
33
+ import { default as Ie } from "./components/modal/ConfirmModal.vue.mjs";
34
+ import { EXPORT_MAX_LIMIT as ge, OPERATE_COLUMN_PROP as Me, exportCSV as Ae, pickExportColumns as _e } from "./utils/export.mjs";
35
+ import { FORM_CONFIG_SELECT_ALL_VALUE as Se, getConfirmPasswordRule as Te, passwordRule as Fe, setFormComponentType as Le } from "./helpers/form.mjs";
36
+ import { FORM_ITEM_CHANGE_LOADING as Re, generateFormData as Oe, getBlurSubmit as he, getChangeSubmit as De, getDatePickerShortcuts as Ne, getEnterSubmit as ye, getPlaceholder as be, getVModelSugar as Ge, parseFormData as ve, resolveFormLayout as we, setInputComponent as Be, setSelectComponent as He, stringifyFormData as Ue, swiftFormItemConfig as Ve } from "./components/form/utils.mjs";
37
+ import { default as We } from "./components/form/FormSearch.vue.mjs";
38
+ import { default as ze } from "./components/form/FormVerifyImage.vue.mjs";
39
+ import { default as Ye } from "./components/list-page/ListPage.vue.mjs";
40
+ import { default as Qe } from "./components/panel/PanelEditSwitch.vue.mjs";
41
+ import { ROUTE_MODULE_LEVEL as Je, TabsMainReplaceQueryKey as Ze } from "./config/route.mjs";
42
+ import { default as et } from "./components/table/TableMain.vue.mjs";
43
+ import { default as ot } from "./components/display/TabsMain.vue.mjs";
44
+ import { countAll as at, createListApi as mt, fetchListAll as ft } from "./helpers/list-helper.mjs";
45
+ import { createGenerateRouteMetaRawTree as lt } from "./helpers/route.mjs";
46
+ import { createStorageWithNamespace as it } from "./helpers/storage.mjs";
47
+ import { createUseState as pt } from "./helpers/state.mjs";
48
+ import { createUserStore as dt } from "./store/user.mjs";
49
+ import { flatRouteMetaResolveRaw as It, getRoutePermissionKey as Et } from "./utils/router.mjs";
50
+ import { getId as Mt } from "./utils/id.mjs";
51
+ import { timeCountDown as _t } from "./utils/time.mjs";
52
+ import { useActivated as St, useActivatedEvent as Tt, useActivatedExec as Ft } from "./hooks/activated.mjs";
53
+ import { useFeelSize as Pt } from "./hooks/feel-size.mjs";
54
+ import { useMenusDataDispatch as Ot } from "./hooks/menus-dispatch.mjs";
55
+ import { useTimeout as Dt } from "./hooks/timeout.mjs";
56
+ const E = {
51
57
  install(e) {
52
- e.use(t), e.use(o), e.use(r), e.use(a), e.use(m), e.use(f), e.use(s);
58
+ e.use(t), e.use(o), e.use(r), e.use(a), e.use(m), e.use(f), e.use(s), e.use(l);
53
59
  }
54
60
  };
55
61
  export {
56
- q as APP_API_LIST_MODEL_KEY_CONFIG,
57
- _ as ActionBtn,
62
+ fe as APP_API_LIST_MODEL_KEY_CONFIG,
63
+ C as ActionBtn,
58
64
  T as ActionButton,
59
- F as ActionButtonDanger,
65
+ L as ActionButtonDanger,
60
66
  R as ActionButtonWarn,
61
- Z as ActionConfirm,
62
- ee as AutoRefresh,
63
- oe as BODY_CONTENT_VIEWPORT_HEIGHT,
64
- me as ConfirmModal,
65
- O as DetailModal,
66
- se as EXPORT_MAX_LIMIT,
67
- ne as FORM_CONFIG_SELECT_ALL_VALUE,
68
- Ie as FORM_ITEM_CHANGE_LOADING,
69
- re as FULLSCREEN_HEIGHT_CHANNEL,
70
- D as FormMain,
71
- h as FormRadioGroup,
72
- he as FormSearch,
73
- b as FormSelect,
74
- v as FormTree,
75
- H as FormVerifyCode,
76
- be as FormVerifyImage,
77
- V as HeightProvider,
78
- ve as ListPage,
79
- W as MenuItemSub,
80
- k as MenuTree,
81
- le as OPERATE_COLUMN_PROP,
82
- He as ROUTE_MODULE_LEVEL,
83
- we as TableMain,
84
- Ke as TabsMain,
85
- Ue as TabsMainReplaceQueryKey,
86
- X as TriggerAutoImport,
87
- Q as WatchSize,
88
- ze as countAll,
89
- g as createAdminBridge,
90
- je as createGenerateRouteMetaRawTree,
91
- Xe as createListApi,
92
- Je as createStorageWithNamespace,
93
- $e as createUseState,
94
- tt as createUserStore,
67
+ le as ActionConfirm,
68
+ ie as AutoRefresh,
69
+ pe as BODY_CONTENT_VIEWPORT_HEIGHT,
70
+ Ie as ConfirmModal,
71
+ h as DetailModal,
72
+ ge as EXPORT_MAX_LIMIT,
73
+ Se as FORM_CONFIG_SELECT_ALL_VALUE,
74
+ Re as FORM_ITEM_CHANGE_LOADING,
75
+ xe as FULLSCREEN_HEIGHT_CHANNEL,
76
+ N as FormMain,
77
+ b as FormRadioGroup,
78
+ We as FormSearch,
79
+ v as FormSelect,
80
+ B as FormTree,
81
+ U as FormVerifyCode,
82
+ ze as FormVerifyImage,
83
+ K as HeightProvider,
84
+ Ye as ListPage,
85
+ k as MenuItemSub,
86
+ X as MenuTree,
87
+ j as ModalPorter,
88
+ q as ModalShelf,
89
+ Me as OPERATE_COLUMN_PROP,
90
+ Qe as PanelEditSwitch,
91
+ Z as PanelItem,
92
+ ee as PanelMain,
93
+ Je as ROUTE_MODULE_LEVEL,
94
+ et as TableMain,
95
+ ot as TabsMain,
96
+ Ze as TabsMainReplaceQueryKey,
97
+ oe as TriggerAutoImport,
98
+ ae as WatchSize,
99
+ at as countAll,
100
+ A as createAdminBridge,
101
+ lt as createGenerateRouteMetaRawTree,
102
+ mt as createListApi,
103
+ it as createStorageWithNamespace,
104
+ pt as createUseState,
105
+ dt as createUserStore,
95
106
  r as displayInstall,
96
- ue as exportCSV,
97
- Ye as fetchListAll,
98
- rt as flatRouteMetaResolveRaw,
107
+ Ae as exportCSV,
108
+ ft as fetchListAll,
109
+ It as flatRouteMetaResolveRaw,
99
110
  t as formInstall,
100
- ge as generateFormData,
101
- Ae as getBlurSubmit,
102
- _e as getChangeSubmit,
103
- xe as getConfirmPasswordRule,
104
- Ce as getDatePickerShortcuts,
105
- Te as getEnterSubmit,
106
- ft as getId,
107
- Me as getPlaceholder,
108
- at as getRoutePermissionKey,
109
- Fe as getVModelSugar,
110
- c as installComponents,
111
+ Oe as generateFormData,
112
+ he as getBlurSubmit,
113
+ De as getChangeSubmit,
114
+ Te as getConfirmPasswordRule,
115
+ Ne as getDatePickerShortcuts,
116
+ ye as getEnterSubmit,
117
+ Mt as getId,
118
+ de as getModalShelfInjectionKey,
119
+ be as getPlaceholder,
120
+ Et as getRoutePermissionKey,
121
+ Ge as getVModelSugar,
122
+ E as installComponents,
111
123
  s as listPageInstall,
112
124
  o as menuInstall,
113
125
  a as miscInstall,
114
126
  m as modalInstall,
115
- Le as parseFormData,
116
- de as passwordRule,
117
- ie as pickExportColumns,
118
- Re as resolveFormLayout,
119
- ce as setFormComponentType,
120
- Se as setInputComponent,
121
- Oe as setSelectComponent,
122
- Pe as stringifyFormData,
123
- De as swiftFormItemConfig,
127
+ l as panelInstall,
128
+ ve as parseFormData,
129
+ Fe as passwordRule,
130
+ _e as pickExportColumns,
131
+ we as resolveFormLayout,
132
+ Le as setFormComponentType,
133
+ Be as setInputComponent,
134
+ He as setSelectComponent,
135
+ Ue as stringifyFormData,
136
+ Ve as swiftFormItemConfig,
124
137
  f as tableInstall,
125
- lt as timeCountDown,
126
- it as useActivated,
127
- pt as useActivatedEvent,
128
- nt as useActivatedExec,
129
- dt as useFeelSize,
130
- Et as useMenusDataDispatch,
131
- gt as useTimeout
138
+ _t as timeCountDown,
139
+ St as useActivated,
140
+ Tt as useActivatedEvent,
141
+ Ft as useActivatedExec,
142
+ Pt as useFeelSize,
143
+ Ot as useMenusDataDispatch,
144
+ Dt as useTimeout
132
145
  };
package/es/inject/key.mjs CHANGED
@@ -1,9 +1,13 @@
1
- const E = Symbol.for(
1
+ const o = Symbol.for(
2
2
  "BODY_CONTENT_VIEWPORT_HEIGHT"
3
- ), H = Symbol.for(
3
+ ), _ = Symbol.for(
4
4
  "FULLSCREEN_HEIGHT_CHANNEL"
5
5
  );
6
+ function H(E) {
7
+ return Symbol.for(`MODAL_SHELF_${E}`);
8
+ }
6
9
  export {
7
- E as BODY_CONTENT_VIEWPORT_HEIGHT,
8
- H as FULLSCREEN_HEIGHT_CHANNEL
10
+ o as BODY_CONTENT_VIEWPORT_HEIGHT,
11
+ _ as FULLSCREEN_HEIGHT_CHANNEL,
12
+ H as getModalShelfInjectionKey
9
13
  };
package/es/style.css CHANGED
@@ -1 +1 @@
1
- .form-item-tip[data-v-0dd66b41]{text-align:left;line-height:1.5;font-size:12px}.form-item-label-hide[data-v-0dd66b41] .el-form-item__label-wrap{display:none}.form-search_show[data-v-8896356d]{margin-bottom:10px}.form-search .btn-box[data-v-8896356d]{padding-left:20px}.form-search[data-v-8896356d] .el-col{padding-left:14px}.form-verify-image[data-v-a4baf877] .el-input__suffix-inner *{margin:0}.form-verify-image-suffix[data-v-a4baf877]{position:absolute;height:100%;border-radius:var(--el-input-border-radius, var(--el-border-radius-base));top:50%;transform:translateY(-50%);overflow:hidden;cursor:pointer}.form-verify-image-suffix-main[data-v-a4baf877]{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#f4f4f4}.tabs-main-bar[data-v-c9b7515f]{position:relative;display:flex;align-items:center}.tabs-main-bar-item[data-v-c9b7515f]{padding:8px 16px;border:none;background:transparent;font-size:14px;color:var(--el-text-color-regular);cursor:pointer}.tabs-main-bar-item_active[data-v-c9b7515f]{color:var(--el-color-primary)}.tabs-main-bar-indicator[data-v-c9b7515f]{position:absolute;bottom:0;left:0;height:2px;background:var(--el-color-primary);transition:transform .2s,width .2s}.auto-refresh[data-v-9d78ca06]{display:flex;align-items:center;gap:8px}.auto-refresh-label[data-v-9d78ca06]{font-size:13px;color:var(--el-text-color-regular)}.auto-refresh-interval[data-v-9d78ca06]{width:80px}.action-confirm__title[data-v-1003e4cb]{font-weight:600;margin-bottom:6px}.action-confirm__content[data-v-1003e4cb]{margin-bottom:12px;color:var(--el-text-color-regular)}.action-confirm__actions[data-v-1003e4cb]{display:flex;justify-content:flex-end;gap:8px}.confirm-dialog .content[data-v-2f0c870e]{overflow-x:hidden;overflow-y:auto;max-height:calc(100vh - 200px)}.confirm-dialog .btn[data-v-2f0c870e]{width:150px;height:40px;border-radius:4px}.confirm-dialog .main[data-v-2f0c870e]{position:relative;text-align:center}.confirm-dialog .main .close-box[data-v-2f0c870e]{position:absolute;top:0;right:0;cursor:pointer;z-index:2}.confirm-dialog .main .shim[data-v-2f0c870e]{position:relative;z-index:1}.confirm-dialog .main .shim .title[data-v-2f0c870e]{font-size:18px;font-weight:500}.confirm-dialog .main .shim .content[data-v-2f0c870e]{font-size:16px;margin-top:15px}.confirm-dialog .main .shim .footer[data-v-2f0c870e]{display:flex;justify-content:center;align-items:center;padding-top:5px}.confirm-dialog .main .shim .footer>.btn[data-v-2f0c870e]:not(:last-child){margin-right:30px}.confirm-dialog .main .shim .footer[reverse=true][data-v-2f0c870e]{flex-direction:row-reverse}.confirm-dialog .main .shim .footer[reverse=true]>.btn[data-v-2f0c870e]:not(:last-child){margin-right:0;margin-left:30px}.confirm-dialog .el-dialog__header,.confirm-dialog .el-dialog__body{padding:0;background-color:transparent}.table-toolbar[data-v-90cd7b54]{display:flex;justify-content:space-between;align-items:center;padding-bottom:8px;gap:20px}.table-toolbar-left[data-v-90cd7b54],.table-toolbar-right[data-v-90cd7b54]{display:flex;align-items:center;gap:10px}.table-toolbar-icon--rotating[data-v-90cd7b54]{animation:table-toolbar-rotating-90cd7b54 1s linear infinite}@keyframes table-toolbar-rotating-90cd7b54{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.data-list-view[data-v-4c7d7547]{width:100%}.table-main-table[data-v-d70ba841]{--el-table-header-bg-color: var(--e731a8f2)}.table-main-pagination[data-v-d70ba841]{margin-top:10px;display:flex;justify-content:flex-end}.list-page[data-v-e22c3b7c]{min-height:var(--v09e0228a)}.list-page-header[data-v-e22c3b7c],.list-page-operation[data-v-e22c3b7c]{margin-bottom:10px}.list-page[data-v-e22c3b7c] .el-loading-mask{left:-10px;top:-10px;right:-10px;bottom:-10px}
1
+ .form-item-tip[data-v-0dd66b41]{text-align:left;line-height:1.5;font-size:12px}.form-item-label-hide[data-v-0dd66b41] .el-form-item__label-wrap{display:none}.form-search_show[data-v-8896356d]{margin-bottom:10px}.form-search .btn-box[data-v-8896356d]{padding-left:20px}.form-search[data-v-8896356d] .el-col{padding-left:14px}.form-verify-image[data-v-a4baf877] .el-input__suffix-inner *{margin:0}.form-verify-image-suffix[data-v-a4baf877]{position:absolute;height:100%;border-radius:var(--el-input-border-radius, var(--el-border-radius-base));top:50%;transform:translateY(-50%);overflow:hidden;cursor:pointer}.form-verify-image-suffix-main[data-v-a4baf877]{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#f4f4f4}.tabs-main-bar[data-v-c9b7515f]{position:relative;display:flex;align-items:center}.tabs-main-bar-item[data-v-c9b7515f]{padding:8px 16px;border:none;background:transparent;font-size:14px;color:var(--el-text-color-regular);cursor:pointer}.tabs-main-bar-item_active[data-v-c9b7515f]{color:var(--el-color-primary)}.tabs-main-bar-indicator[data-v-c9b7515f]{position:absolute;bottom:0;left:0;height:2px;background:var(--el-color-primary);transition:transform .2s,width .2s}.auto-refresh[data-v-9d78ca06]{display:flex;align-items:center;gap:8px}.auto-refresh-label[data-v-9d78ca06]{font-size:13px;color:var(--el-text-color-regular)}.auto-refresh-interval[data-v-9d78ca06]{width:80px}.action-confirm__title[data-v-1003e4cb]{font-weight:600;margin-bottom:6px}.action-confirm__content[data-v-1003e4cb]{margin-bottom:12px;color:var(--el-text-color-regular)}.action-confirm__actions[data-v-1003e4cb]{display:flex;justify-content:flex-end;gap:8px}.confirm-dialog .content[data-v-2f0c870e]{overflow-x:hidden;overflow-y:auto;max-height:calc(100vh - 200px)}.confirm-dialog .btn[data-v-2f0c870e]{width:150px;height:40px;border-radius:4px}.confirm-dialog .main[data-v-2f0c870e]{position:relative;text-align:center}.confirm-dialog .main .close-box[data-v-2f0c870e]{position:absolute;top:0;right:0;cursor:pointer;z-index:2}.confirm-dialog .main .shim[data-v-2f0c870e]{position:relative;z-index:1}.confirm-dialog .main .shim .title[data-v-2f0c870e]{font-size:18px;font-weight:500}.confirm-dialog .main .shim .content[data-v-2f0c870e]{font-size:16px;margin-top:15px}.confirm-dialog .main .shim .footer[data-v-2f0c870e]{display:flex;justify-content:center;align-items:center;padding-top:5px}.confirm-dialog .main .shim .footer>.btn[data-v-2f0c870e]:not(:last-child){margin-right:30px}.confirm-dialog .main .shim .footer[reverse=true][data-v-2f0c870e]{flex-direction:row-reverse}.confirm-dialog .main .shim .footer[reverse=true]>.btn[data-v-2f0c870e]:not(:last-child){margin-right:0;margin-left:30px}.confirm-dialog .el-dialog__header,.confirm-dialog .el-dialog__body{padding:0;background-color:transparent}.table-toolbar[data-v-90cd7b54]{display:flex;justify-content:space-between;align-items:center;padding-bottom:8px;gap:20px}.table-toolbar-left[data-v-90cd7b54],.table-toolbar-right[data-v-90cd7b54]{display:flex;align-items:center;gap:10px}.table-toolbar-icon--rotating[data-v-90cd7b54]{animation:table-toolbar-rotating-90cd7b54 1s linear infinite}@keyframes table-toolbar-rotating-90cd7b54{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.data-list-view[data-v-4c7d7547]{width:100%}.table-main-table[data-v-d70ba841]{--el-table-header-bg-color: var(--e731a8f2)}.table-main-pagination[data-v-d70ba841]{margin-top:10px;display:flex;justify-content:flex-end}.list-page[data-v-e22c3b7c]{min-height:var(--v09e0228a)}.list-page-header[data-v-e22c3b7c],.list-page-operation[data-v-e22c3b7c]{margin-bottom:10px}.list-page[data-v-e22c3b7c] .el-loading-mask{left:-10px;top:-10px;right:-10px;bottom:-10px}.panel-edit-switch[data-v-ea2a07d5]{position:relative}.panel-edit-switch-edit-btn[data-v-ea2a07d5]{position:absolute;top:0;right:0;z-index:1}.panel-edit-switch-actions[data-v-ea2a07d5]{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@done-coding/admin-core",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "后台管理核心",
5
5
  "private": false,
6
6
  "main": "lib/index.cjs",
@@ -77,5 +77,5 @@
77
77
  "node": ">=18.0.0",
78
78
  "pnpm": ">=9.0.0"
79
79
  },
80
- "gitHead": "f4a73c50566857dfab79b6dc2ab3c8421d5ea100"
80
+ "gitHead": "57917c0c51b696e75b0ebe1f701be13ca512364a"
81
81
  }
@@ -12,8 +12,8 @@ declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractP
12
12
  confirmText: string;
13
13
  cancelText: string;
14
14
  }>>> & Readonly<{}>, {
15
- confirmText: string;
16
15
  cancelText: string;
16
+ confirmText: string;
17
17
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
18
18
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
19
19
  export default _default;
@@ -72,12 +72,12 @@ declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractP
72
72
  }>>> & Readonly<{
73
73
  "onUpdate:show"?: ((value: boolean) => any) | undefined;
74
74
  }>, {
75
- width: number | string;
76
- reverse: boolean;
77
75
  showClose: boolean;
78
- confirmText: string | (() => VNode);
79
76
  cancelText: string | (() => VNode);
77
+ confirmText: string | (() => VNode);
80
78
  hiddenCancel: boolean;
79
+ width: number | string;
80
+ reverse: boolean;
81
81
  closeOnPressEscape: boolean;
82
82
  closeOnClickModal: boolean;
83
83
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,29 @@
1
+ import { EvokeHandle, ModalShelfMap, RegisterEntry } from './modal-shelf-types';
2
+
3
+ declare function evoke<K extends keyof ModalShelfMap>(key: K, payload: ModalShelfMap[K]): EvokeHandle | null;
4
+ declare function __VLS_template(): {
5
+ default?(_: {}): any;
6
+ };
7
+ declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
8
+ modalList: RegisterEntry[];
9
+ }>>, {
10
+ evoke: typeof evoke;
11
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
12
+ modalList: RegisterEntry[];
13
+ }>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
14
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
15
+ export default _default;
16
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
17
+ type __VLS_TypePropsToRuntimeProps<T> = {
18
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
19
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
20
+ } : {
21
+ type: import('vue').PropType<T[K]>;
22
+ required: true;
23
+ };
24
+ };
25
+ type __VLS_WithTemplateSlots<T, S> = T & {
26
+ new (): {
27
+ $slots: S;
28
+ };
29
+ };
@@ -0,0 +1,36 @@
1
+ import { Component } from 'vue';
2
+ import { ModalLevel } from './modal-shelf-types';
3
+
4
+ declare function __VLS_template(): {
5
+ default?(_: {}): any;
6
+ };
7
+ declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
8
+ level: ModalLevel;
9
+ }>>, {
10
+ items: Ref<import('./modal-shelf-types').ShelfItem[]>;
11
+ level: ModalLevel;
12
+ evoke: (nsKey: string, component: Component | (() => Promise<Component>), options: {
13
+ payload: Record<string, unknown>;
14
+ sameKeyStrategy?: import('./modal-shelf-types').ModalSameKeyStrategy;
15
+ }) => import('./modal-shelf-types').EvokeHandle;
16
+ remove: (nsKey: string | string[]) => void;
17
+ close: (item: import('./modal-shelf-types').ShelfItem) => void;
18
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
19
+ level: ModalLevel;
20
+ }>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
21
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
22
+ export default _default;
23
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
24
+ type __VLS_TypePropsToRuntimeProps<T> = {
25
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
26
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
27
+ } : {
28
+ type: import('vue').PropType<T[K]>;
29
+ required: true;
30
+ };
31
+ };
32
+ type __VLS_WithTemplateSlots<T, S> = T & {
33
+ new (): {
34
+ $slots: S;
35
+ };
36
+ };
@@ -1,7 +1,11 @@
1
1
  import { Plugin } from 'vue';
2
2
  import { default as ConfirmModal } from './ConfirmModal.vue';
3
3
  import { default as DetailModal } from './DetailModal.vue';
4
+ import { default as ModalShelf } from './ModalShelf.vue';
5
+ import { default as ModalPorter } from './ModalPorter.vue';
4
6
 
5
7
  export * from './types';
6
- export { ConfirmModal, DetailModal };
8
+ export * from './modal-shelf-types';
9
+ export { ConfirmModal, DetailModal, ModalShelf, ModalPorter };
10
+ /** 弹窗子模块批量注册插件 */
7
11
  export declare const modalInstall: Plugin;
@@ -0,0 +1,10 @@
1
+ import { Ref } from 'vue';
2
+ import { ModalLevel, ShelfController, ShelfItem } from './modal-shelf-types';
3
+
4
+ /** ShelfController 内部扩展:额外暴露渲染用活跃实例列表 */
5
+ export interface ShelfControllerInternal extends ShelfController {
6
+ /** 渲染用:当前活跃实例列表(多例数组) */
7
+ items: Ref<ShelfItem[]>;
8
+ }
9
+ /** 创建一个架子逻辑控制器(纯逻辑,无 DOM 依赖,可单测) */
10
+ export declare function createShelfController(level: ModalLevel): ShelfControllerInternal;
@@ -0,0 +1,7 @@
1
+ import { ModalLevel } from './modal-shelf-types';
2
+
3
+ /**
4
+ * 层级合法性:app 必最顶层;page 祖先仅允许 app;custom 可嵌套任何(含 custom 套 custom)。
5
+ * 非法仅开发期 console.error,不抛、不静默。
6
+ */
7
+ export declare function assertLevelHierarchy(level: ModalLevel, ancestorLevels: ModalLevel[]): void;
@@ -0,0 +1,74 @@
1
+ import { Component } from 'vue';
2
+
3
+ /** 架子层级 */
4
+ export type ModalLevel = "app" | "page" | "custom";
5
+ /** 同 key 再 evoke 策略:recreate=关旧重建(默认);update=已开则整体替换 props 不 remount */
6
+ export type ModalSameKeyStrategy = "recreate" | "update";
7
+ /**
8
+ * 业务侧 declare merge 扩展此接口声明每个弹窗的业务 props 契约。
9
+ * 例:declare module "@done-coding/admin-core" {
10
+ * interface ModalShelfMap { detail: { id: string; onConfirm?: (r: unknown) => void } }
11
+ * }
12
+ */
13
+ export interface ModalShelfMap {
14
+ }
15
+ /** 架子注入给弹窗组件的契约(业务 payload 经单 payload 对象传入) */
16
+ export interface ModalInjectedProps<P = Record<string, unknown>> {
17
+ /** v-model:show 受控可见性 */
18
+ show: boolean;
19
+ /** 优雅关闭(隐藏→等动画→移除),=== EvokeHandle.close */
20
+ closeFn: () => void;
21
+ /** 立即移除(无动画) */
22
+ removeFn: () => void;
23
+ /** 业务 payload(ModalShelfMap[key]) */
24
+ payload: P;
25
+ }
26
+ /** evoke 返回的命令式句柄;只绑稳定 nsKey,调用时现查当前实例(不闭包 id) */
27
+ export interface EvokeHandle {
28
+ /** 优雅关闭该 nsKey 当前实例;无则 no-op */
29
+ close: () => void;
30
+ /** 对该 nsKey 当前实例受控增量合并 payload(不 remount);无则 no-op */
31
+ update: (partialPayload: Record<string, unknown>) => void;
32
+ }
33
+ /** 注册项(扁平,无 options 包裹,无 isSingle——v1 仅多例) */
34
+ export interface RegisterEntry<K extends keyof ModalShelfMap = keyof ModalShelfMap> {
35
+ /** 弹窗逻辑 key */
36
+ key: K;
37
+ /** 组件或懒工厂(() => import()) */
38
+ component: Component | (() => Promise<Component>);
39
+ /** 目标架子:app/page 名称代指,或直接持 ShelfInstance */
40
+ shelf: "app" | "page" | ShelfInstance;
41
+ /** 同 key 再 evoke 策略,缺省 "recreate" */
42
+ sameKeyStrategy?: ModalSameKeyStrategy;
43
+ }
44
+ /** 架子内部一条活跃实例 */
45
+ export interface ShelfItem {
46
+ /** 架子内部自增唯一 id,用作渲染 :key */
47
+ id: number;
48
+ /** porter 命名空间后的注册键 p{porterUid}:{key} */
49
+ nsKey: string;
50
+ /** 组件或懒工厂 */
51
+ component: Component | (() => Promise<Component>);
52
+ /** 业务 payload */
53
+ payload: Record<string, unknown>;
54
+ /** v-model:show */
55
+ show: boolean;
56
+ /** close 排定的关闭动画定时器句柄;remove 立即移除前 [MUST] clearTimeout 它 */
57
+ timer?: ReturnType<typeof setTimeout>;
58
+ }
59
+ /** ModalShelf 实例 expose === 它 provide 的 controller */
60
+ export interface ShelfController {
61
+ /** 本架子层级 */
62
+ level: ModalLevel;
63
+ /** 唤起一条;同 nsKey 先 remove(立即) 旧再新建 */
64
+ evoke: (nsKey: string, component: Component | (() => Promise<Component>), options: {
65
+ payload: Record<string, unknown>;
66
+ sameKeyStrategy?: ModalSameKeyStrategy;
67
+ }) => EvokeHandle;
68
+ /** 立即移除(不等动画),支持单个或批量 */
69
+ remove: (nsKey: string | string[]) => void;
70
+ /** 优雅关闭某条(触发隐藏 → 动画结束 → 移除) */
71
+ close: (item: ShelfItem) => void;
72
+ }
73
+ /** ModalShelf 实例引用类型别名(用于 RegisterEntry.shelf 直接持实例定位 custom 架子) */
74
+ export type ShelfInstance = ShelfController;
@@ -0,0 +1,31 @@
1
+ import { PanelEditSwitchProps } from './types';
2
+
3
+ declare function __VLS_template(): {
4
+ default?(_: {}): any;
5
+ editor?(_: {
6
+ data: Record<string, any>;
7
+ }): any;
8
+ };
9
+ declare const __VLS_component: import('vue').DefineComponent<globalThis.ExtractPropTypes<__VLS_TypePropsToRuntimeProps<PanelEditSwitchProps<Record<string, any>>>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
10
+ "update:editing": (value: boolean) => void;
11
+ submitFinish: (success: boolean, data: Record<string, any>) => void;
12
+ }, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_TypePropsToRuntimeProps<PanelEditSwitchProps<Record<string, any>>>>> & Readonly<{
13
+ "onUpdate:editing"?: ((value: boolean) => any) | undefined;
14
+ onSubmitFinish?: ((success: boolean, data: Record<string, any>) => any) | undefined;
15
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
16
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
17
+ export default _default;
18
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
19
+ type __VLS_TypePropsToRuntimeProps<T> = {
20
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
21
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
22
+ } : {
23
+ type: import('vue').PropType<T[K]>;
24
+ required: true;
25
+ };
26
+ };
27
+ type __VLS_WithTemplateSlots<T, S> = T & {
28
+ new (): {
29
+ $slots: S;
30
+ };
31
+ };
@@ -0,0 +1,21 @@
1
+ import { PanelItemProps } from './types';
2
+
3
+ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<__VLS_TypePropsToRuntimeProps<PanelItemProps<Record<string, any>>>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
4
+ "update:editing": (value: boolean) => void;
5
+ submitFinish: (success: boolean, data: Record<string, any>) => void;
6
+ refresh: () => void;
7
+ }, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<__VLS_TypePropsToRuntimeProps<PanelItemProps<Record<string, any>>>>> & Readonly<{
8
+ onRefresh?: (() => any) | undefined;
9
+ "onUpdate:editing"?: ((value: boolean) => any) | undefined;
10
+ onSubmitFinish?: ((success: boolean, data: Record<string, any>) => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
12
+ export default _default;
13
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
14
+ type __VLS_TypePropsToRuntimeProps<T> = {
15
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
16
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
17
+ } : {
18
+ type: import('vue').PropType<T[K]>;
19
+ required: true;
20
+ };
21
+ };
@@ -0,0 +1,17 @@
1
+ import { PanelMainProps } from './types';
2
+
3
+ declare const _default: <T extends Record<string, any>>(__VLS_props: Awaited<typeof __VLS_setup>["props"], __VLS_ctx?: __VLS_Prettify<Pick<Awaited<typeof __VLS_setup>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
4
+ props: __VLS_Prettify<__VLS_OmitKeepDiscriminatedUnion<(Partial<{}> & Omit<{
5
+ readonly onRefresh?: ((data: T) => any) | undefined;
6
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>) & PanelMainProps<T>, keyof import('vue').VNodeProps | keyof import('vue').AllowedComponentProps>> & {} & (import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps);
7
+ expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
8
+ attrs: any;
9
+ slots: ReturnType<() => {}>;
10
+ emit: (e: "refresh", data: T) => void;
11
+ }>) => import('vue').VNode & {
12
+ __ctx?: Awaited<typeof __VLS_setup>;
13
+ };
14
+ export default _default;
15
+ type __VLS_Prettify<T> = {
16
+ [K in keyof T]: T[K];
17
+ } & {};
@@ -0,0 +1,9 @@
1
+ import { Plugin } from 'vue';
2
+ import { default as PanelMain } from './PanelMain.vue';
3
+ import { default as PanelItem } from './PanelItem.vue';
4
+ import { default as PanelEditSwitch } from './PanelEditSwitch.vue';
5
+
6
+ export * from './types';
7
+ export { PanelMain, PanelItem, PanelEditSwitch };
8
+ /** Panel 组件族一键注册插件(app.use(panelInstall)) */
9
+ export declare const panelInstall: Plugin;
@@ -0,0 +1,62 @@
1
+ import { VNode } from 'vue';
2
+ import { ColProps } from 'element-plus';
3
+
4
+ /** Panel 只读渲染作用域(render 用) */
5
+ export interface PanelScope<T extends Record<string, any> = Record<string, any>> {
6
+ /** 原始数据(只读消费,[MUST NOT] 在 render 内修改) */
7
+ data: T;
8
+ /** data[config.key] */
9
+ value: any;
10
+ config: PanelItemConfig<T>;
11
+ /** 请求 PanelMain 向父层触发 refresh(preview 组件绕开 PanelEditSwitch 刷新用) */
12
+ refresh?: () => void;
13
+ }
14
+ /** Panel 编辑器作用域(editorRender 用,data = 深克隆副本) */
15
+ export interface PanelEditorScope<T extends Record<string, any> = Record<string, any>> {
16
+ /** PanelEditSwitch 内部深克隆副本(编辑器直接改它) */
17
+ data: T;
18
+ /** data[config.key](克隆体上的值) */
19
+ value: any;
20
+ config: PanelItemConfig<T>;
21
+ }
22
+ /** Panel 配置项 */
23
+ export interface PanelItemConfig<T extends Record<string, any> = Record<string, any>> {
24
+ /** 数据键 */
25
+ key: string;
26
+ /** 标签,非必填 */
27
+ label?: string;
28
+ /** 栅格布局,复用 resolveFormLayout 语义;缺省继承 PanelMain.layout */
29
+ layout?: Partial<ColProps>;
30
+ /** 顺序,缺省按数组序 */
31
+ order?: number;
32
+ /** 隐藏 */
33
+ hide?: boolean | ((scope: PanelScope<T>) => boolean);
34
+ /** 只读渲染;缺省=纯文本 data[key] */
35
+ render?: string | Record<string, any> | ((scope: PanelScope<T>) => VNode);
36
+ /** 是否可就地编辑 */
37
+ editable?: boolean | ((scope: PanelScope<T>) => boolean);
38
+ /** 编辑器渲染;仅 editable 时需要 */
39
+ editorRender?: string | Record<string, any> | ((scope: PanelEditorScope<T>) => VNode);
40
+ /** 单字段提交;仅 editable 时需要。draft = 深克隆副本 */
41
+ submitFn?: (draft: T) => Promise<unknown>;
42
+ }
43
+ /** Panel 配置项列表 */
44
+ export type PanelItemConfigList<T extends Record<string, any> = Record<string, any>> = PanelItemConfig<T>[];
45
+ /** PanelMain props */
46
+ export interface PanelMainProps<T extends Record<string, any> = Record<string, any>> {
47
+ data: T;
48
+ layout?: Partial<ColProps>;
49
+ list: PanelItemConfigList<T>;
50
+ }
51
+ /** PanelItem props */
52
+ export interface PanelItemProps<T extends Record<string, any> = Record<string, any>> {
53
+ data: T;
54
+ config: PanelItemConfig<T>;
55
+ editing: boolean;
56
+ }
57
+ /** PanelEditSwitch props */
58
+ export interface PanelEditSwitchProps<T extends Record<string, any> = Record<string, any>> {
59
+ data: T;
60
+ editing: boolean;
61
+ submitFn?: (draft: T) => Promise<unknown>;
62
+ }
@@ -2,14 +2,14 @@ import { ExportType, TableExportContext, TableMainInstance } from './types';
2
2
 
3
3
  declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<{
4
4
  isAutoRefresh: import('vue').PropType<boolean>;
5
- pageSize: {
6
- type: globalThis.PropType<number>;
7
- required: true;
8
- };
9
5
  loading: {
10
6
  type: globalThis.PropType<boolean>;
11
7
  required: true;
12
8
  };
9
+ pageSize: {
10
+ type: globalThis.PropType<number>;
11
+ required: true;
12
+ };
13
13
  showRefresh: {
14
14
  type: globalThis.PropType<boolean>;
15
15
  default: boolean;
@@ -52,14 +52,14 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
52
52
  };
53
53
  }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
54
54
  isAutoRefresh: import('vue').PropType<boolean>;
55
- pageSize: {
56
- type: globalThis.PropType<number>;
57
- required: true;
58
- };
59
55
  loading: {
60
56
  type: globalThis.PropType<boolean>;
61
57
  required: true;
62
58
  };
59
+ pageSize: {
60
+ type: globalThis.PropType<number>;
61
+ required: true;
62
+ };
63
63
  showRefresh: {
64
64
  type: globalThis.PropType<boolean>;
65
65
  default: boolean;
package/types/index.d.ts CHANGED
@@ -6,6 +6,7 @@ import { miscInstall } from './components/misc';
6
6
  import { modalInstall } from './components/modal';
7
7
  import { tableInstall } from './components/table';
8
8
  import { listPageInstall } from './components/list-page';
9
+ import { panelInstall } from './components/panel';
9
10
 
10
11
  export * from './components/form';
11
12
  export * from './components/menu';
@@ -14,6 +15,7 @@ export * from './components/misc';
14
15
  export * from './components/modal';
15
16
  export * from './components/table';
16
17
  export * from './components/list-page';
18
+ export * from './components/panel';
17
19
  export * from './utils';
18
20
  export * from './hooks';
19
21
  export * from './types';
@@ -22,5 +24,5 @@ export * from './inject';
22
24
  export * from './helpers';
23
25
  export * from './bridge';
24
26
  export * from './store';
25
- export { formInstall, menuInstall, displayInstall, miscInstall, modalInstall, tableInstall, listPageInstall, };
27
+ export { formInstall, menuInstall, displayInstall, miscInstall, modalInstall, tableInstall, listPageInstall, panelInstall, };
26
28
  export declare const installComponents: Plugin;
@@ -1,3 +1,6 @@
1
+ import { InjectionKey } from 'vue';
2
+ import { ModalLevel, ShelfController } from '../components/modal';
3
+
1
4
  /**
2
5
  * body 视口高度
3
6
  * ---
@@ -20,3 +23,8 @@ export declare const BODY_CONTENT_VIEWPORT_HEIGHT: unique symbol;
20
23
  * 导致 provide/inject 失配 → 预算链断裂)。
21
24
  */
22
25
  export declare const FULLSCREEN_HEIGHT_CHANNEL: unique symbol;
26
+ /**
27
+ * 弹窗架子 inject key 工厂——按 level 参数化。
28
+ * Symbol.for 全局注册表保证跨包/跨 chunk/跨 ESM 实例唯一(同 BODY_CONTENT_VIEWPORT_HEIGHT)。
29
+ */
30
+ export declare function getModalShelfInjectionKey(level: ModalLevel): InjectionKey<ShelfController>;