@done-coding/admin-core 0.12.2 → 0.13.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/es/bridge/index.mjs +28 -28
- package/es/bridge/plugin.mjs +4 -4
- package/es/components/app-layout/AppBody.vue.mjs +2 -2
- package/es/components/app-layout/AppBody.vue2.mjs +26 -33
- package/es/components/app-layout/AppLayout.vue.mjs +2 -2
- package/es/components/app-layout/AppLayout.vue2.mjs +53 -56
- package/es/components/app-layout/AppSidebar.vue.mjs +3 -3
- package/es/components/app-layout/AppSidebar.vue2.mjs +8 -8
- package/es/components/display/ActionBtn.vue.mjs +37 -36
- package/es/components/display/ActionConfirm.vue.mjs +1 -1
- package/es/components/display/ActionConfirm.vue2.mjs +50 -50
- package/es/components/form/FormSubmitBtn.vue.mjs +18 -13
- package/es/components/form/use-form-submit.mjs +8 -8
- package/es/components/table/constants.mjs +5 -0
- package/es/hooks/activated.mjs +1 -1
- package/es/hooks/use-theme-apply.mjs +80 -79
- package/es/hooks/use-viewport-apply.mjs +17 -16
- package/es/index.mjs +131 -128
- package/es/inject/key.mjs +27 -24
- package/es/injectInfo.json.mjs +6 -0
- package/es/style.css +1 -1
- package/package.json +2 -2
- package/types/components/app-layout/AppLayout.vue.d.ts +1 -1
- package/types/components/display/ActionConfirm.vue.d.ts +2 -0
- package/types/components/form/types.d.ts +1 -0
- package/types/components/form/use-form-submit.d.ts +1 -0
- package/types/components/table/constants.d.ts +2 -0
- package/types/components/table/index.d.ts +1 -0
- package/types/hooks/use-theme-apply.d.ts +2 -2
- package/types/hooks/use-viewport-apply.d.ts +2 -2
- package/types/injectInfo.json.d.ts +7 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
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
|
|
4
|
-
const q = /* @__PURE__ */
|
|
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: {
|
|
28
|
-
beforeOpen: {
|
|
27
|
+
confirmConfig: {},
|
|
28
|
+
beforeOpen: {}
|
|
29
29
|
},
|
|
30
30
|
emits: ["click"],
|
|
31
31
|
setup(v) {
|
|
32
|
-
const m = v, { confirmConfig: s, confirmMode:
|
|
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 =
|
|
35
|
-
() => !!s.value || !!
|
|
36
|
-
), g =
|
|
37
|
-
const e = m, t = {},
|
|
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
|
|
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
|
-
}),
|
|
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 =
|
|
63
|
+
const e = S();
|
|
64
64
|
if (!e.length) return;
|
|
65
65
|
const t = y;
|
|
66
|
-
let
|
|
66
|
+
let a;
|
|
67
67
|
try {
|
|
68
|
-
|
|
68
|
+
a = e.map((i) => i(t));
|
|
69
69
|
} catch (i) {
|
|
70
70
|
throw o.value = !1, i;
|
|
71
71
|
}
|
|
72
|
-
const n =
|
|
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
|
-
},
|
|
77
|
+
}, z = () => k(), B = async (e) => {
|
|
78
78
|
if (o.value || c.value) return;
|
|
79
79
|
y = e;
|
|
80
80
|
let t;
|
|
81
|
-
if (
|
|
81
|
+
if (u.value) {
|
|
82
82
|
o.value = !0;
|
|
83
83
|
try {
|
|
84
|
-
t = await
|
|
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 ? (
|
|
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
|
|
95
|
-
|
|
96
|
-
|
|
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] = (
|
|
102
|
-
mode:
|
|
103
|
-
title: (
|
|
104
|
-
content: (n =
|
|
105
|
-
"confirm-text": (i =
|
|
106
|
-
"cancel-text": (
|
|
107
|
-
type: ((
|
|
108
|
-
"submit-fn":
|
|
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
|
-
|
|
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"
|
|
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-
|
|
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
|
|
2
|
-
import { ElPopover as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
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
|
-
},
|
|
7
|
+
}, H = {
|
|
8
8
|
key: 1,
|
|
9
9
|
class: "action-confirm__content"
|
|
10
|
-
},
|
|
10
|
+
}, I = { class: "action-confirm__actions" }, O = /* @__PURE__ */ z({
|
|
11
11
|
__name: "ActionConfirm",
|
|
12
|
-
props: /* @__PURE__ */
|
|
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
|
|
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
|
-
},
|
|
29
|
+
}, p = (e) => {
|
|
30
30
|
if (!(e == null || e === ""))
|
|
31
|
-
return typeof e == "string" ? () =>
|
|
32
|
-
},
|
|
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(
|
|
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
|
-
},
|
|
41
|
-
i.value = !1;
|
|
42
|
-
},
|
|
43
|
-
const e = l(
|
|
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 : () =>
|
|
46
|
-
}),
|
|
47
|
-
const e = l(
|
|
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 : () =>
|
|
50
|
-
}),
|
|
49
|
+
return typeof e == "string" ? e : () => u("div", e);
|
|
50
|
+
}), P = async () => {
|
|
51
51
|
try {
|
|
52
|
-
await Promise.resolve(
|
|
52
|
+
await Promise.resolve(o.submitFn()), r("close", !0);
|
|
53
53
|
} catch {
|
|
54
54
|
return !1;
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
|
-
return (e,
|
|
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
|
-
|
|
64
|
+
y(e.$slots, "default", {}, void 0, !0)
|
|
65
65
|
]),
|
|
66
66
|
default: c(() => [
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
(
|
|
70
|
-
])) :
|
|
71
|
-
|
|
72
|
-
(
|
|
73
|
-
])) :
|
|
74
|
-
|
|
75
|
-
|
|
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:
|
|
78
|
+
onClick: w
|
|
79
79
|
}, {
|
|
80
80
|
default: c(() => [
|
|
81
|
-
|
|
81
|
+
b(N(t.cancelText), 1)
|
|
82
82
|
]),
|
|
83
83
|
_: 1
|
|
84
84
|
}, 8, ["disabled"]),
|
|
85
|
-
|
|
85
|
+
v(d(M), {
|
|
86
86
|
size: "small",
|
|
87
87
|
type: t.type,
|
|
88
88
|
loading: a.value,
|
|
89
|
-
onClick:
|
|
89
|
+
onClick: F
|
|
90
90
|
}, {
|
|
91
91
|
default: c(() => [
|
|
92
|
-
|
|
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"])) :
|
|
101
|
-
|
|
102
|
-
|
|
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":
|
|
105
|
-
title:
|
|
106
|
-
content:
|
|
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":
|
|
111
|
-
"on-cancel":
|
|
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)) :
|
|
114
|
+
], 64)) : y(e.$slots, "default", { key: 2 }, void 0, !0);
|
|
115
115
|
}
|
|
116
116
|
});
|
|
117
117
|
export {
|
|
118
|
-
|
|
118
|
+
O as default
|
|
119
119
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ElButton as
|
|
3
|
-
import { useFormSubmit as
|
|
4
|
-
import
|
|
5
|
-
const T = /* @__PURE__ */
|
|
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,
|
|
33
|
-
() =>
|
|
34
|
-
), { submitting:
|
|
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,
|
|
41
|
-
loading: o(
|
|
45
|
+
return (t, x) => (l(), p(o(B), b(m.value, {
|
|
46
|
+
loading: o(s),
|
|
42
47
|
onClick: o(r)
|
|
43
48
|
}), {
|
|
44
|
-
default:
|
|
45
|
-
y(
|
|
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
|
|
2
|
-
function
|
|
3
|
-
const e =
|
|
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
|
|
11
|
-
await a.submitFn(
|
|
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
|
-
|
|
20
|
+
n as useFormSubmit
|
|
21
21
|
};
|
package/es/hooks/activated.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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,
|