@done-coding/admin-core 0.8.2 → 0.9.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 (94) hide show
  1. package/es/bridge/config-hook.mjs +37 -0
  2. package/es/bridge/index.mjs +157 -62
  3. package/es/bridge/plugin.mjs +29 -0
  4. package/es/bridge/theme.mjs +62 -0
  5. package/es/components/app-layout/AppBody.vue.mjs +1 -1
  6. package/es/components/app-layout/AppBody.vue2.mjs +47 -49
  7. package/es/components/app-layout/AppBreadcrumb.vue.mjs +1 -1
  8. package/es/components/app-layout/AppBreadcrumb.vue2.mjs +35 -41
  9. package/es/components/app-layout/AppFooter.vue.mjs +2 -2
  10. package/es/components/app-layout/AppFooter.vue2.mjs +8 -8
  11. package/es/components/app-layout/AppHeader.vue.mjs +1 -1
  12. package/es/components/app-layout/AppHeader.vue2.mjs +60 -69
  13. package/es/components/app-layout/AppLayout.vue.mjs +2 -2
  14. package/es/components/app-layout/AppLayout.vue2.mjs +95 -93
  15. package/es/components/app-layout/AppSidebar.vue.mjs +2 -2
  16. package/es/components/app-layout/AppSidebar.vue2.mjs +79 -82
  17. package/es/components/app-layout/AppTheme.vue.mjs +7 -0
  18. package/es/components/app-layout/AppTheme.vue2.mjs +38 -0
  19. package/es/components/data-view/DataListView.vue.mjs +2 -2
  20. package/es/components/data-view/DataListView.vue2.mjs +36 -36
  21. package/es/components/display/ActionConfirm.vue2.mjs +16 -16
  22. package/es/components/display/HeightProvider.vue.mjs +10 -10
  23. package/es/components/display/TabsHeader.vue.mjs +4 -4
  24. package/es/components/display/TabsHeader.vue2.mjs +34 -34
  25. package/es/components/display/TabsMain.vue.mjs +40 -39
  26. package/es/components/display/TabsRefineFlow.vue.mjs +30 -28
  27. package/es/components/form/FormItem.vue.mjs +1 -1
  28. package/es/components/form/FormItem.vue2.mjs +75 -81
  29. package/es/components/form/FormMain.vue.mjs +81 -88
  30. package/es/components/form/FormRadioGroup.vue.mjs +42 -49
  31. package/es/components/form/FormSearch.vue.mjs +1 -1
  32. package/es/components/form/FormSearch.vue2.mjs +116 -123
  33. package/es/components/form/FormSelect.vue.mjs +34 -40
  34. package/es/components/form/FormSubmitBtn.vue.mjs +24 -35
  35. package/es/components/form/FormSubmitPanel.vue.mjs +2 -2
  36. package/es/components/form/FormSubmitPanel.vue2.mjs +75 -55
  37. package/es/components/form/FormTree.vue.mjs +16 -21
  38. package/es/components/form/FormVerifyCode.vue.mjs +37 -43
  39. package/es/components/form/FormVerifyImage.vue.mjs +2 -2
  40. package/es/components/form/FormVerifyImage.vue2.mjs +36 -41
  41. package/es/components/form/use-form-submit.mjs +21 -0
  42. package/es/components/list-page/ListPage.vue.mjs +2 -2
  43. package/es/components/list-page/ListPage.vue2.mjs +134 -139
  44. package/es/components/menu/MenuItemSub.vue.mjs +41 -48
  45. package/es/components/menu/MenuTree.vue.mjs +58 -65
  46. package/es/components/misc/AutoRefresh.vue.mjs +2 -2
  47. package/es/components/misc/AutoRefresh.vue2.mjs +44 -51
  48. package/es/components/misc/AutoRefreshGroup.vue.mjs +2 -2
  49. package/es/components/misc/AutoRefreshGroup.vue2.mjs +37 -43
  50. package/es/components/modal/ConfirmModal.vue.mjs +3 -3
  51. package/es/components/modal/ConfirmModal.vue2.mjs +93 -100
  52. package/es/components/modal/DetailModal.vue.mjs +38 -41
  53. package/es/components/panel/PanelEditSwitch.vue.mjs +1 -1
  54. package/es/components/panel/PanelEditSwitch.vue2.mjs +50 -55
  55. package/es/components/panel/PanelMain.vue.mjs +2 -2
  56. package/es/components/panel/PanelMain.vue2.mjs +67 -74
  57. package/es/components/table/TableMain.vue.mjs +2 -2
  58. package/es/components/table/TableMain.vue2.mjs +221 -229
  59. package/es/components/table/TableToolbar.vue.mjs +2 -2
  60. package/es/components/table/TableToolbar.vue2.mjs +115 -126
  61. package/es/hooks/use-admin-theme-apply.mjs +84 -0
  62. package/es/hooks/use-admin-viewport-apply.mjs +27 -0
  63. package/es/index.mjs +125 -117
  64. package/es/inject/key.mjs +7 -4
  65. package/es/store/app.mjs +75 -84
  66. package/es/style.css +1 -1
  67. package/es/utils/theme-scale.mjs +37 -0
  68. package/package.json +2 -4
  69. package/types/bridge/config-hook.d.ts +91 -0
  70. package/types/bridge/index.d.ts +110 -10
  71. package/types/bridge/plugin.d.ts +39 -0
  72. package/types/bridge/theme.d.ts +66 -0
  73. package/types/components/app-layout/AppTheme.vue.d.ts +2 -0
  74. package/types/components/app-layout/types.d.ts +1 -1
  75. package/types/components/form/FormItem.vue.d.ts +12 -12
  76. package/types/components/form/FormSubmitPanel.vue.d.ts +4 -0
  77. package/types/components/form/FormTree.vue.d.ts +50 -50
  78. package/types/components/form/types.d.ts +17 -0
  79. package/types/components/form/use-form-submit.d.ts +25 -0
  80. package/types/components/menu/MenuTree.vue.d.ts +10 -10
  81. package/types/components/modal/ModalShelf.vue.d.ts +1 -1
  82. package/types/components/table/TableMain.vue.d.ts +1 -1
  83. package/types/hooks/activated.d.ts +2 -2
  84. package/types/hooks/feel-size.d.ts +1 -1
  85. package/types/hooks/index.d.ts +2 -0
  86. package/types/hooks/menus-dispatch.d.ts +5 -5
  87. package/types/hooks/use-admin-theme-apply.d.ts +17 -0
  88. package/types/hooks/use-admin-viewport-apply.d.ts +15 -0
  89. package/types/hooks/use-breakpoint.d.ts +1 -1
  90. package/types/inject/key.d.ts +18 -0
  91. package/types/store/app.d.ts +138 -59
  92. package/types/store/user.d.ts +3 -3
  93. package/types/utils/index.d.ts +1 -0
  94. package/types/utils/theme-scale.d.ts +35 -0
@@ -1,13 +1,11 @@
1
- import { ElButton as C } 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, useModel as w, ref as F, computed as B, watch as c, openBlock as r, createElementBlock as u, createBlock as d, withCtx as E, createTextVNode as P, createCommentVNode as M, renderSlot as l, Fragment as $, unref as o, mergeModels as m } from "vue";
5
- import N from "lodash/cloneDeep";
6
- import T from "../form/FormSubmitPanel.vue.mjs";
7
- const V = { class: "panel-edit-switch" }, A = /* @__PURE__ */ h({
1
+ import { defineComponent as S, useModel as C, ref as h, computed as w, watch as l, openBlock as s, createElementBlock as u, createBlock as d, unref as c, withCtx as F, createTextVNode as B, createCommentVNode as E, renderSlot as r, Fragment as P, mergeModels as f } from "vue";
2
+ import { ElButton as M } from "element-plus";
3
+ import $ from "lodash/cloneDeep";
4
+ import N from "../form/FormSubmitPanel.vue.mjs";
5
+ const T = { class: "panel-edit-switch" }, R = /* @__PURE__ */ S({
8
6
  name: "PanelEditSwitch",
9
7
  __name: "PanelEditSwitch",
10
- props: /* @__PURE__ */ m({
8
+ props: /* @__PURE__ */ f({
11
9
  data: {},
12
10
  config: {},
13
11
  editable: { type: Boolean },
@@ -16,28 +14,28 @@ const V = { class: "panel-edit-switch" }, A = /* @__PURE__ */ h({
16
14
  editing: { type: Boolean, default: !1 },
17
15
  editingModifiers: {}
18
16
  }),
19
- emits: /* @__PURE__ */ m(["submitSuccess"], ["update:editing"]),
20
- setup(i, { emit: f }) {
21
- const n = i, g = f, e = w(i, "editing"), a = F(
17
+ emits: /* @__PURE__ */ f(["submitSuccess"], ["update:editing"]),
18
+ setup(i, { emit: m }) {
19
+ const n = i, g = m, e = C(i, "editing"), a = h(
22
20
  {}
23
- ), p = B(() => [n.config.editorConfig]), y = (t) => t, b = () => {
21
+ ), y = w(() => [n.config.editorConfig]), b = (t) => t, p = () => {
24
22
  e.value = !0;
25
- }, k = () => {
23
+ }, v = () => {
26
24
  e.value = !1;
27
- }, v = (t) => {
25
+ }, k = (t) => {
28
26
  if (!n.submitFn)
29
27
  throw new Error("可编辑 那么必须提供 submitFn");
30
28
  return n.submitFn(t);
31
29
  }, D = (t) => {
32
30
  e.value = !1, g("submitSuccess", t);
33
31
  };
34
- return c(
32
+ return l(
35
33
  e,
36
- (t, s) => {
37
- t && !s && (a.value = N(n.data));
34
+ (t, o) => {
35
+ t && !o && (a.value = $(n.data));
38
36
  },
39
37
  { immediate: !0 }
40
- ), c(
38
+ ), l(
41
39
  () => n.editable,
42
40
  (t) => {
43
41
  t || (e.value = !1);
@@ -45,47 +43,44 @@ const V = { class: "panel-edit-switch" }, A = /* @__PURE__ */ h({
45
43
  {
46
44
  immediate: !0
47
45
  }
48
- ), (t, s) => {
49
- const S = C;
50
- return r(), u("div", V, [
51
- i.editable && !e.value ? (r(), d(S, {
46
+ ), (t, o) => (s(), u("div", T, [
47
+ i.editable && !e.value ? (s(), d(c(M), {
48
+ key: 0,
49
+ class: "panel-edit-switch-edit-btn",
50
+ type: "primary",
51
+ link: "",
52
+ size: "small",
53
+ onClick: p
54
+ }, {
55
+ default: F(() => [...o[0] || (o[0] = [
56
+ B(" 编辑", -1)
57
+ ])]),
58
+ _: 1
59
+ })) : E("", !0),
60
+ e.value ? (s(), u(P, { key: 2 }, [
61
+ i.config.editorRender ? r(t.$slots, "editor", {
52
62
  key: 0,
53
- class: "panel-edit-switch-edit-btn",
54
- type: "primary",
55
- link: "",
56
- size: "small",
57
- onClick: b
58
- }, {
59
- default: E(() => [...s[0] || (s[0] = [
60
- P(" 编辑", -1)
61
- ])]),
62
- _: 1
63
- })) : M("", !0),
64
- e.value ? (r(), u($, { key: 2 }, [
65
- i.config.editorRender ? l(t.$slots, "editor", {
66
- key: 0,
67
- stringifyDraftData: o(a)
68
- }, void 0, !0) : i.config.editorConfig ? (r(), d(o(T), {
69
- key: 1,
70
- list: o(p),
71
- "stringify-data": y(o(a)),
72
- "cancel-btn": "取消",
73
- "operation-position": "bottom-right",
74
- "submit-fn": v,
75
- onCancel: k,
76
- onSuccess: D
77
- }, null, 8, ["list", "stringify-data"])) : l(t.$slots, "default", {
78
- key: 2,
79
- stringifyDraftData: o(a)
80
- }, void 0, !0)
81
- ], 64)) : l(t.$slots, "default", {
63
+ stringifyDraftData: a.value
64
+ }, void 0, !0) : i.config.editorConfig ? (s(), d(c(N), {
82
65
  key: 1,
83
- stringifyDraftData: i.data
66
+ list: y.value,
67
+ "stringify-data": b(a.value),
68
+ "cancel-btn": "取消",
69
+ "operation-position": "bottom-right",
70
+ "submit-fn": k,
71
+ onCancel: v,
72
+ onSuccess: D
73
+ }, null, 8, ["list", "stringify-data"])) : r(t.$slots, "default", {
74
+ key: 2,
75
+ stringifyDraftData: a.value
84
76
  }, void 0, !0)
85
- ]);
86
- };
77
+ ], 64)) : r(t.$slots, "default", {
78
+ key: 1,
79
+ stringifyDraftData: i.data
80
+ }, void 0, !0)
81
+ ]));
87
82
  }
88
83
  });
89
84
  export {
90
- A as default
85
+ R as default
91
86
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./PanelMain.vue2.mjs";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-25951dc8"]]);
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5cf5e2e7"]]);
5
5
  export {
6
- p as default
6
+ f as default
7
7
  };
@@ -1,12 +1,8 @@
1
- import { ElRow as E, ElCol as M } 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 x, useCssVars as F, unref as i, ref as L, computed as c, watch as j, openBlock as l, createBlock as u, withCtx as d, createElementBlock as P, Fragment as D, renderList as G, withDirectives as H, mergeProps as O, resolveDynamicComponent as R, normalizeClass as U, createVNode as V, vShow as W } from "vue";
6
- import $ from "./PanelItem.vue.mjs";
7
- import { ElCard as f } from "element-plus";
8
- import { resolveFormLayout as y } from "../form/utils.mjs";
9
- const Q = /* @__PURE__ */ x({
1
+ import { defineComponent as B, useCssVars as _, ref as M, computed as l, watch as E, openBlock as o, createBlock as u, unref as d, withCtx as m, createElementBlock as x, Fragment as F, renderList as L, withDirectives as j, mergeProps as P, resolveDynamicComponent as D, normalizeClass as G, createVNode as H, vShow as O } from "vue";
2
+ import U from "./PanelItem.vue.mjs";
3
+ import { ElCard as f, ElRow as V, ElCol as W } from "element-plus";
4
+ import { resolveFormLayout as p } from "../form/utils.mjs";
5
+ const T = /* @__PURE__ */ B({
10
6
  name: "PanelMain",
11
7
  __name: "PanelMain",
12
8
  props: {
@@ -18,79 +14,76 @@ const Q = /* @__PURE__ */ x({
18
14
  refreshFn: {}
19
15
  },
20
16
  emits: ["submitSuccess"],
21
- setup(s, { emit: C }) {
22
- F((e) => ({
23
- v39ccf6bc: i(_)
17
+ setup(s, { emit: y }) {
18
+ _((t) => ({
19
+ v5f184251: h.value
24
20
  }));
25
- const a = s, h = C, n = L({}), p = c(() => a.itemCard ? f : "span"), k = c(
26
- () => `panel-main-item-col-wrap_${p.value === f ? "card" : "span"}`
27
- ), _ = c(
28
- () => typeof a.itemCard == "object" && a.itemCard.lastMarginBottom ? a.itemCard.lastMarginBottom : 0
29
- ), v = (e) => {
30
- const { hide: t } = e;
31
- if (typeof t == "function") {
32
- const r = {
33
- data: a.data,
34
- value: a.data[e.key],
35
- config: e
21
+ const r = s, v = y, n = M({}), c = l(() => r.itemCard ? f : "span"), C = l(
22
+ () => `panel-main-item-col-wrap_${c.value === f ? "card" : "span"}`
23
+ ), h = l(
24
+ () => typeof r.itemCard == "object" && r.itemCard.lastMarginBottom ? r.itemCard.lastMarginBottom : 0
25
+ ), k = (t) => {
26
+ const { hide: a } = t;
27
+ if (typeof a == "function") {
28
+ const e = {
29
+ data: r.data,
30
+ value: r.data[t.key],
31
+ config: t
36
32
  };
37
- return !!t(r);
33
+ return !!a(e);
38
34
  }
39
- return !!t;
40
- }, b = (e) => ({
41
- ...y(a.layout),
42
- ...y(e)
43
- }), g = (e, t) => {
44
- n.value = {}, t && (n.value[e] = t);
45
- }, w = (e) => (t) => {
46
- var r;
47
- return (r = a.refreshFn) == null ? void 0 : r.call(a, t, e);
48
- }, S = (e, t) => {
49
- h("submitSuccess", t, e);
35
+ return !!a;
36
+ }, g = (t) => ({
37
+ ...p(r.layout),
38
+ ...p(t)
39
+ }), S = (t, a) => {
40
+ n.value = {}, a && (n.value[t] = a);
41
+ }, b = (t) => (a) => {
42
+ var e;
43
+ return (e = r.refreshFn) == null ? void 0 : e.call(r, a, t);
44
+ }, w = (t, a) => {
45
+ v("submitSuccess", a, t);
50
46
  };
51
- return j(
52
- () => a.list,
53
- (e) => {
54
- const t = e.map((r) => r.key);
55
- Object.keys(n.value).forEach((r) => {
56
- t.includes(r) || delete n.value[r];
47
+ return E(
48
+ () => r.list,
49
+ (t) => {
50
+ const a = t.map((e) => e.key);
51
+ Object.keys(n.value).forEach((e) => {
52
+ a.includes(e) || delete n.value[e];
57
53
  });
58
54
  },
59
55
  { immediate: !0 }
60
- ), (e, t) => {
61
- const r = M, B = E;
62
- return l(), u(B, { gutter: s.rowGutter }, {
63
- default: d(() => [
64
- (l(!0), P(D, null, G(s.list, (o) => H((l(), u(r, O({
65
- key: o.key
66
- }, { ref_for: !0 }, b(o.layout), { class: "panel-main-item-col" }), {
67
- default: d(() => [
68
- (l(), u(R(i(p)), {
69
- class: U(i(k))
70
- }, {
71
- default: d(() => [
72
- V($, {
73
- data: s.data,
74
- config: o,
75
- editing: i(n)[o.key] ?? !1,
76
- "refresh-fn": w(o.key),
77
- "onUpdate:editing": (m) => g(o.key, m),
78
- onSubmitSuccess: (m) => S(o.key, m)
79
- }, null, 8, ["data", "config", "editing", "refresh-fn", "onUpdate:editing", "onSubmitSuccess"])
80
- ]),
81
- _: 2
82
- }, 1032, ["class"]))
83
- ]),
84
- _: 2
85
- }, 1040)), [
86
- [W, !v(o)]
87
- ])), 128))
88
- ]),
89
- _: 1
90
- }, 8, ["gutter"]);
91
- };
56
+ ), (t, a) => (o(), u(d(V), { gutter: s.rowGutter }, {
57
+ default: m(() => [
58
+ (o(!0), x(F, null, L(s.list, (e) => j((o(), u(d(W), P({
59
+ key: e.key
60
+ }, { ref_for: !0 }, g(e.layout), { class: "panel-main-item-col" }), {
61
+ default: m(() => [
62
+ (o(), u(D(c.value), {
63
+ class: G(C.value)
64
+ }, {
65
+ default: m(() => [
66
+ H(U, {
67
+ data: s.data,
68
+ config: e,
69
+ editing: n.value[e.key] ?? !1,
70
+ "refresh-fn": b(e.key),
71
+ "onUpdate:editing": (i) => S(e.key, i),
72
+ onSubmitSuccess: (i) => w(e.key, i)
73
+ }, null, 8, ["data", "config", "editing", "refresh-fn", "onUpdate:editing", "onSubmitSuccess"])
74
+ ]),
75
+ _: 2
76
+ }, 1032, ["class"]))
77
+ ]),
78
+ _: 2
79
+ }, 1040)), [
80
+ [O, !k(e)]
81
+ ])), 128))
82
+ ]),
83
+ _: 1
84
+ }, 8, ["gutter"]));
92
85
  }
93
86
  });
94
87
  export {
95
- Q as default
88
+ T as default
96
89
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./TableMain.vue2.mjs";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-05684b89"]]);
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-132febbc"]]);
5
5
  export {
6
- p as default
6
+ f as default
7
7
  };