@done-coding/admin-core 0.12.2 → 0.12.3-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.
Files changed (31) hide show
  1. package/es/bridge/index.mjs +28 -28
  2. package/es/bridge/plugin.mjs +4 -4
  3. package/es/components/app-layout/AppBody.vue.mjs +2 -2
  4. package/es/components/app-layout/AppBody.vue2.mjs +26 -33
  5. package/es/components/app-layout/AppLayout.vue.mjs +2 -2
  6. package/es/components/app-layout/AppLayout.vue2.mjs +53 -56
  7. package/es/components/app-layout/AppSidebar.vue.mjs +3 -3
  8. package/es/components/app-layout/AppSidebar.vue2.mjs +8 -8
  9. package/es/components/display/ActionBtn.vue.mjs +37 -36
  10. package/es/components/display/ActionConfirm.vue.mjs +1 -1
  11. package/es/components/display/ActionConfirm.vue2.mjs +50 -50
  12. package/es/components/form/FormSubmitBtn.vue.mjs +18 -13
  13. package/es/components/form/use-form-submit.mjs +8 -8
  14. package/es/components/table/constants.mjs +5 -0
  15. package/es/hooks/activated.mjs +1 -1
  16. package/es/hooks/use-theme-apply.mjs +80 -79
  17. package/es/hooks/use-viewport-apply.mjs +17 -16
  18. package/es/index.mjs +131 -128
  19. package/es/inject/key.mjs +27 -24
  20. package/es/injectInfo.json.mjs +6 -0
  21. package/es/style.css +1 -1
  22. package/package.json +2 -2
  23. package/types/components/app-layout/AppLayout.vue.d.ts +1 -1
  24. package/types/components/display/ActionConfirm.vue.d.ts +2 -0
  25. package/types/components/form/types.d.ts +1 -0
  26. package/types/components/form/use-form-submit.d.ts +1 -0
  27. package/types/components/table/constants.d.ts +2 -0
  28. package/types/components/table/index.d.ts +1 -0
  29. package/types/hooks/use-theme-apply.d.ts +2 -2
  30. package/types/hooks/use-viewport-apply.d.ts +2 -2
  31. package/types/injectInfo.json.d.ts +7 -0
@@ -1,13 +1,13 @@
1
- import { defineComponent as z, toRefs as E, getCurrentInstance as M, ref as p, computed as C, watch as R, openBlock as x, createBlock as w, unref as u, withCtx as d, createVNode as V, mergeProps as A, renderSlot as I } from "vue";
1
+ import { defineComponent as O, toRefs as R, getCurrentInstance as V, ref as f, computed as b, openBlock as x, createBlock as w, unref as p, withCtx as d, createVNode as $, mergeProps as A, renderSlot as I } from "vue";
2
2
  import { ElButton as T } from "element-plus";
3
- import $ from "./ActionConfirm.vue.mjs";
4
- const q = /* @__PURE__ */ z({
3
+ import F from "./ActionConfirm.vue.mjs";
4
+ const q = /* @__PURE__ */ O({
5
5
  inheritAttrs: !1,
6
6
  __name: "ActionBtn",
7
7
  props: {
8
8
  size: {},
9
9
  disabled: { type: Boolean },
10
- type: {},
10
+ type: { default: "default" },
11
11
  icon: {},
12
12
  nativeType: {},
13
13
  loadingIcon: {},
@@ -24,17 +24,17 @@ const q = /* @__PURE__ */ z({
24
24
  autoInsertSpace: { type: Boolean },
25
25
  tag: {},
26
26
  confirmMode: {},
27
- confirmConfig: { type: [Object, Function] },
28
- beforeOpen: { type: Function }
27
+ confirmConfig: {},
28
+ beforeOpen: {}
29
29
  },
30
30
  emits: ["click"],
31
31
  setup(v) {
32
- const m = v, { confirmConfig: s, confirmMode: F, beforeOpen: f } = E(m), r = M(), o = p(!1), c = p(!1), a = p();
32
+ const m = v, { confirmConfig: s, confirmMode: _, beforeOpen: u } = R(m), r = V(), o = f(!1), c = f(!1), l = f();
33
33
  let y;
34
- const L = C(
35
- () => !!s.value || !!f.value
36
- ), g = C(() => {
37
- const e = m, t = {}, l = [
34
+ const L = b(
35
+ () => !!s.value || !!u.value
36
+ ), g = b(() => {
37
+ const e = m, t = {}, a = [
38
38
  "type",
39
39
  "size",
40
40
  "plain",
@@ -53,35 +53,35 @@ const q = /* @__PURE__ */ z({
53
53
  "icon",
54
54
  "loadingIcon"
55
55
  ];
56
- for (const n of l) e[n] !== void 0 && (t[n] = e[n]);
56
+ for (const n of a) e[n] !== void 0 && (t[n] = e[n]);
57
57
  return { ...r == null ? void 0 : r.attrs, ...t };
58
- }), O = (e) => !!e && typeof e.then == "function", P = () => {
58
+ }), P = (e) => !!e && typeof e.then == "function", S = () => {
59
59
  var t;
60
60
  const e = (t = r == null ? void 0 : r.vnode.props) == null ? void 0 : t.onClick;
61
61
  return e ? Array.isArray(e) ? e : [e] : [];
62
62
  }, k = () => {
63
- const e = P();
63
+ const e = S();
64
64
  if (!e.length) return;
65
65
  const t = y;
66
- let l;
66
+ let a;
67
67
  try {
68
- l = e.map((i) => i(t));
68
+ a = e.map((i) => i(t));
69
69
  } catch (i) {
70
70
  throw o.value = !1, i;
71
71
  }
72
- const n = l.filter(O);
72
+ const n = a.filter(P);
73
73
  if (n.length)
74
74
  return o.value = !0, Promise.all(n).finally(() => {
75
75
  o.value = !1;
76
76
  });
77
- }, S = k, B = async (e) => {
77
+ }, z = () => k(), B = async (e) => {
78
78
  if (o.value || c.value) return;
79
79
  y = e;
80
80
  let t;
81
- if (f.value) {
81
+ if (u.value) {
82
82
  o.value = !0;
83
83
  try {
84
- t = await f.value();
84
+ t = await u.value();
85
85
  } catch {
86
86
  o.value = !1;
87
87
  return;
@@ -89,26 +89,27 @@ const q = /* @__PURE__ */ z({
89
89
  o.value = !1;
90
90
  } else
91
91
  t = void 0;
92
- s.value ? (a.value = typeof s.value == "function" ? s.value(t) : s.value, c.value = !0) : k();
92
+ s.value ? (l.value = typeof s.value == "function" ? s.value(t) : s.value, c.value = !0) : k();
93
+ }, E = (e) => {
94
+ l.value = void 0;
93
95
  };
94
- return R(c, (e) => {
95
- e || (a.value = void 0);
96
- }), (e, t) => {
97
- var l, n, i, h, b;
98
- return L.value ? (x(), w($, {
96
+ return (e, t) => {
97
+ var a, n, i, C, h;
98
+ return L.value ? (x(), w(F, {
99
99
  key: 0,
100
100
  show: c.value,
101
- "onUpdate:show": t[0] || (t[0] = (_) => c.value = _),
102
- mode: u(F) || "popconfirm",
103
- title: (l = a.value) == null ? void 0 : l.title,
104
- content: (n = a.value) == null ? void 0 : n.content,
105
- "confirm-text": (i = a.value) == null ? void 0 : i.confirmText,
106
- "cancel-text": (h = a.value) == null ? void 0 : h.cancelText,
107
- type: ((b = a.value) == null ? void 0 : b.type) ?? v.type,
108
- "submit-fn": u(S)
101
+ "onUpdate:show": t[0] || (t[0] = (M) => c.value = M),
102
+ mode: p(_) || "popconfirm",
103
+ title: (a = l.value) == null ? void 0 : a.title,
104
+ content: (n = l.value) == null ? void 0 : n.content,
105
+ "confirm-text": (i = l.value) == null ? void 0 : i.confirmText,
106
+ "cancel-text": (C = l.value) == null ? void 0 : C.cancelText,
107
+ type: ((h = l.value) == null ? void 0 : h.type) ?? v.type,
108
+ "submit-fn": z,
109
+ onClose: E
109
110
  }, {
110
111
  default: d(() => [
111
- V(u(T), A({ class: "dc-action-btn" }, g.value, {
112
+ $(p(T), A({ class: "dc-action-btn" }, g.value, {
112
113
  loading: o.value,
113
114
  onClick: B
114
115
  }), {
@@ -119,7 +120,7 @@ const q = /* @__PURE__ */ z({
119
120
  }, 16, ["loading"])
120
121
  ]),
121
122
  _: 3
122
- }, 8, ["show", "mode", "title", "content", "confirm-text", "cancel-text", "type", "submit-fn"])) : (x(), w(u(T), A({
123
+ }, 8, ["show", "mode", "title", "content", "confirm-text", "cancel-text", "type"])) : (x(), w(p(T), A({
123
124
  key: 1,
124
125
  class: "dc-action-btn"
125
126
  }, g.value, {
@@ -1,7 +1,7 @@
1
1
  import o from "./ActionConfirm.vue2.mjs";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const i = /* @__PURE__ */ t(o, [["__scopeId", "data-v-88119b35"]]);
4
+ const i = /* @__PURE__ */ t(o, [["__scopeId", "data-v-67d276b0"]]);
5
5
  export {
6
6
  i as default
7
7
  };
@@ -1,15 +1,15 @@
1
- import { defineComponent as _, useModel as P, ref as $, computed as s, h as r, openBlock as o, createBlock as u, unref as d, withCtx as c, createElementVNode as C, createElementBlock as f, resolveDynamicComponent as x, createCommentVNode as k, createVNode as m, createTextVNode as T, toDisplayString as b, renderSlot as v, Fragment as z, mergeModels as D } from "vue";
2
- import { ElPopover as S, ElButton as N } from "element-plus";
3
- import A from "../modal/ConfirmModal.vue.mjs";
4
- const U = { class: "action-confirm" }, j = {
1
+ import { defineComponent as z, useModel as D, ref as S, computed as s, h as u, openBlock as n, createBlock as f, unref as d, withCtx as c, createElementVNode as x, createElementBlock as m, resolveDynamicComponent as k, createCommentVNode as T, createVNode as v, createTextVNode as b, toDisplayString as N, renderSlot as y, Fragment as A, mergeModels as B } from "vue";
2
+ import { ElPopover as U, ElButton as M } from "element-plus";
3
+ import j from "../modal/ConfirmModal.vue.mjs";
4
+ const q = { class: "action-confirm" }, G = {
5
5
  key: 0,
6
6
  class: "action-confirm__title"
7
- }, q = {
7
+ }, H = {
8
8
  key: 1,
9
9
  class: "action-confirm__content"
10
- }, G = { class: "action-confirm__actions" }, K = /* @__PURE__ */ _({
10
+ }, I = { class: "action-confirm__actions" }, O = /* @__PURE__ */ z({
11
11
  __name: "ActionConfirm",
12
- props: /* @__PURE__ */ D({
12
+ props: /* @__PURE__ */ B({
13
13
  mode: {},
14
14
  title: {},
15
15
  content: {},
@@ -21,75 +21,75 @@ const U = { class: "action-confirm" }, j = {
21
21
  show: { type: Boolean, default: !1 },
22
22
  showModifiers: {}
23
23
  }),
24
- emits: ["update:show"],
25
- setup(t) {
26
- const n = t, i = P(t, "show"), a = $(!1), l = (e) => {
24
+ emits: /* @__PURE__ */ B(["close"], ["update:show"]),
25
+ setup(t, { emit: E }) {
26
+ const o = t, r = E, i = D(t, "show"), a = S(!1), l = (e) => {
27
27
  if (e != null)
28
28
  return typeof e == "function" ? e() : e;
29
- }, y = (e) => {
29
+ }, p = (e) => {
30
30
  if (!(e == null || e === ""))
31
- return typeof e == "string" ? () => r("span", e) : () => e;
32
- }, p = s(() => y(l(n.title))), h = s(() => y(l(n.content))), B = async () => {
31
+ return typeof e == "string" ? () => u("span", e) : () => e;
32
+ }, h = s(() => p(l(o.title))), g = s(() => p(l(o.content))), F = async () => {
33
33
  a.value = !0;
34
34
  try {
35
- await Promise.resolve(n.submitFn()), i.value = !1;
35
+ await Promise.resolve(o.submitFn()), r("close", !0), i.value = !1;
36
36
  } catch {
37
37
  } finally {
38
38
  a.value = !1;
39
39
  }
40
- }, g = () => {
41
- i.value = !1;
42
- }, M = s(() => {
43
- const e = l(n.title);
40
+ }, w = () => {
41
+ r("close", !1), i.value = !1;
42
+ }, V = s(() => {
43
+ const e = l(o.title);
44
44
  if (!(e === void 0 || e === ""))
45
- return typeof e == "string" ? e : () => r("span", e);
46
- }), E = s(() => {
47
- const e = l(n.content);
45
+ return typeof e == "string" ? e : () => u("span", e);
46
+ }), _ = s(() => {
47
+ const e = l(o.content);
48
48
  if (!(e === void 0 || e === ""))
49
- return typeof e == "string" ? e : () => r("div", e);
50
- }), F = async () => {
49
+ return typeof e == "string" ? e : () => u("div", e);
50
+ }), P = async () => {
51
51
  try {
52
- await Promise.resolve(n.submitFn());
52
+ await Promise.resolve(o.submitFn()), r("close", !0);
53
53
  } catch {
54
54
  return !1;
55
55
  }
56
56
  };
57
- return (e, w) => n.mode === "popconfirm" ? (o(), u(d(S), {
57
+ return (e, C) => o.mode === "popconfirm" ? (n(), f(d(U), {
58
58
  key: 0,
59
59
  visible: i.value,
60
60
  width: 240,
61
61
  persistent: !1
62
62
  }, {
63
63
  reference: c(() => [
64
- v(e.$slots, "default", {}, void 0, !0)
64
+ y(e.$slots, "default", {}, void 0, !0)
65
65
  ]),
66
66
  default: c(() => [
67
- C("div", U, [
68
- p.value ? (o(), f("div", j, [
69
- (o(), u(x(p.value)))
70
- ])) : k("", !0),
71
- h.value ? (o(), f("div", q, [
72
- (o(), u(x(h.value)))
73
- ])) : k("", !0),
74
- C("div", G, [
75
- m(d(N), {
67
+ x("div", q, [
68
+ h.value ? (n(), m("div", G, [
69
+ (n(), f(k(h.value)))
70
+ ])) : T("", !0),
71
+ g.value ? (n(), m("div", H, [
72
+ (n(), f(k(g.value)))
73
+ ])) : T("", !0),
74
+ x("div", I, [
75
+ v(d(M), {
76
76
  size: "small",
77
77
  disabled: a.value,
78
- onClick: g
78
+ onClick: w
79
79
  }, {
80
80
  default: c(() => [
81
- T(b(t.cancelText), 1)
81
+ b(N(t.cancelText), 1)
82
82
  ]),
83
83
  _: 1
84
84
  }, 8, ["disabled"]),
85
- m(d(N), {
85
+ v(d(M), {
86
86
  size: "small",
87
87
  type: t.type,
88
88
  loading: a.value,
89
- onClick: B
89
+ onClick: F
90
90
  }, {
91
91
  default: c(() => [
92
- T(b(t.confirmText), 1)
92
+ b(N(t.confirmText), 1)
93
93
  ]),
94
94
  _: 1
95
95
  }, 8, ["type", "loading"])
@@ -97,23 +97,23 @@ const U = { class: "action-confirm" }, j = {
97
97
  ])
98
98
  ]),
99
99
  _: 3
100
- }, 8, ["visible"])) : n.mode === "messageConfirm" ? (o(), f(z, { key: 1 }, [
101
- v(e.$slots, "default", {}, void 0, !0),
102
- m(A, {
100
+ }, 8, ["visible"])) : o.mode === "messageConfirm" ? (n(), m(A, { key: 1 }, [
101
+ y(e.$slots, "default", {}, void 0, !0),
102
+ v(j, {
103
103
  show: i.value,
104
- "onUpdate:show": w[0] || (w[0] = (V) => i.value = V),
105
- title: M.value,
106
- content: E.value,
104
+ "onUpdate:show": C[0] || (C[0] = ($) => i.value = $),
105
+ title: V.value,
106
+ content: _.value,
107
107
  "confirm-text": t.confirmText,
108
108
  "cancel-text": t.cancelText,
109
109
  type: t.type,
110
- "on-confirm": F,
111
- "on-cancel": g,
110
+ "on-confirm": P,
111
+ "on-cancel": w,
112
112
  "use-loading": ""
113
113
  }, null, 8, ["show", "title", "content", "confirm-text", "cancel-text", "type"])
114
- ], 64)) : v(e.$slots, "default", { key: 2 }, void 0, !0);
114
+ ], 64)) : y(e.$slots, "default", { key: 2 }, void 0, !0);
115
115
  }
116
116
  });
117
117
  export {
118
- K as default
118
+ O as default
119
119
  };
@@ -1,8 +1,8 @@
1
- import { defineComponent as c, computed as l, openBlock as p, createBlock as u, unref as o, mergeProps as f, withCtx as d, createTextVNode as y, toDisplayString as B } from "vue";
2
- import { ElButton as b } from "element-plus";
3
- import { useFormSubmit as g } from "./use-form-submit.mjs";
4
- import x from "lodash/omit";
5
- const T = /* @__PURE__ */ c({
1
+ import { defineComponent as u, computed as c, openBlock as l, createBlock as p, unref as o, mergeProps as b, withCtx as f, createTextVNode as d, toDisplayString as y } from "vue";
2
+ import { ElButton as B } from "element-plus";
3
+ import { useFormSubmit as S } from "./use-form-submit.mjs";
4
+ import g from "lodash/omit";
5
+ const T = /* @__PURE__ */ u({
6
6
  __name: "FormSubmitBtn",
7
7
  props: {
8
8
  size: {},
@@ -25,24 +25,29 @@ const T = /* @__PURE__ */ c({
25
25
  tag: {},
26
26
  formMainInstance: {},
27
27
  submitText: { default: "提交" },
28
- submitFn: {}
28
+ submitFn: {},
29
+ onSubmitStart: {}
29
30
  },
30
31
  emits: ["success", "fail"],
31
32
  setup(n, { emit: i }) {
32
- const e = n, a = i, s = l(
33
- () => x(e, ["formMainInstance", "submitText", "submitFn"])
34
- ), { submitting: m, submit: r } = g({
33
+ const e = n, a = i, m = c(
34
+ () => g(e, ["formMainInstance", "submitText", "submitFn", "onSubmitStart"])
35
+ ), { submitting: s, submit: r } = S({
35
36
  getFormMainInstance: () => e.formMainInstance,
36
37
  submitFn: (t) => e.submitFn(t),
38
+ onSubmitStart: () => {
39
+ var t;
40
+ return (t = e.onSubmitStart) == null ? void 0 : t.call(e);
41
+ },
37
42
  onSuccess: (t) => a("success", t),
38
43
  onFail: (t) => a("fail", t)
39
44
  });
40
- return (t, F) => (p(), u(o(b), f(s.value, {
41
- loading: o(m),
45
+ return (t, x) => (l(), p(o(B), b(m.value, {
46
+ loading: o(s),
42
47
  onClick: o(r)
43
48
  }), {
44
- default: d(() => [
45
- y(B(n.submitText), 1)
49
+ default: f(() => [
50
+ d(y(n.submitText), 1)
46
51
  ]),
47
52
  _: 1
48
53
  }, 16, ["loading", "onClick"]));
@@ -1,14 +1,14 @@
1
- import { ref as m } from "vue";
2
- function i(a) {
3
- const e = m(!1);
1
+ import { ref as f } from "vue";
2
+ function n(a) {
3
+ const e = f(!1);
4
4
  return { submitting: e, submit: async () => {
5
- var t, c;
6
- e.value = !0;
5
+ var t, u, c;
6
+ (t = a.onSubmitStart) == null || t.call(a), e.value = !0;
7
7
  try {
8
8
  const r = a.getFormMainInstance();
9
9
  await r.validate();
10
- const u = r.stringify();
11
- await a.submitFn(u), (t = a.onSuccess) == null || t.call(a, u);
10
+ const m = r.stringify();
11
+ await a.submitFn(m), (u = a.onSuccess) == null || u.call(a, m);
12
12
  } catch (r) {
13
13
  (c = a.onFail) == null || c.call(a, r);
14
14
  } finally {
@@ -17,5 +17,5 @@ function i(a) {
17
17
  } };
18
18
  }
19
19
  export {
20
- i as useFormSubmit
20
+ n as useFormSubmit
21
21
  };
@@ -0,0 +1,5 @@
1
+ const E = "OPERATE", L = "SELECTION";
2
+ export {
3
+ E as TABLE_COLUMN_KEY_OPERATE,
4
+ L as TABLE_COLUMN_KEY_SELECTION
5
+ };
@@ -1,4 +1,4 @@
1
- import { watch as o, ref as n, computed as v, readonly as r, onMounted as u, onActivated as A, onDeactivated as m, onBeforeUnmount as f } from "vue";
1
+ import { ref as n, computed as v, readonly as r, onMounted as u, onActivated as A, onDeactivated as m, onBeforeUnmount as f, watch as o } from "vue";
2
2
  const s = (e) => {
3
3
  const t = n({
4
4
  isActivated: !1,