@zl-ui-kit/components 0.27.0 → 0.27.1
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/README.md +11 -32
- package/dist/components/ZlAction/List.vue.mjs +49 -46
- package/dist/components/ZlAction/index.vue.d.ts +7 -1
- package/dist/components/ZlAction/index.vue.mjs +12 -8
- package/dist/components/ZlAction/types.d.ts +5 -2
- package/dist/components/ZlAppLayout/HeaderAside.css +1 -0
- package/dist/components/ZlAppLayout/HeaderAside.vue.d.ts +25 -0
- package/dist/components/ZlAppLayout/HeaderAside.vue.mjs +6 -0
- package/dist/components/ZlAppLayout/HeaderAside2.vue.mjs +65 -0
- package/dist/components/ZlAppLayout/Horizontal.css +1 -1
- package/dist/components/ZlAppLayout/Vertical.css +1 -1
- package/dist/components/ZlAppLayout/Vertical2.vue.mjs +39 -41
- package/dist/components/ZlAppLayout/index.vue.d.ts +50 -6
- package/dist/components/ZlAppLayout/index.vue.mjs +26 -8
- package/dist/components/ZlAppSlogan/index.css +1 -1
- package/dist/components/ZlAppSlogan/index.vue.d.ts +1 -1
- package/dist/components/ZlAppSlogan/index.vue.mjs +19 -12
- package/dist/components/ZlBreadcrumb/index.css +1 -0
- package/dist/components/ZlBreadcrumb/index.vue.d.ts +32 -0
- package/dist/components/ZlBreadcrumb/index.vue.mjs +58 -0
- package/dist/components/ZlBreadcrumb/index3.vue.mjs +6 -0
- package/dist/components/ZlBreadcrumb/types.d.ts +16 -0
- package/dist/components/ZlButton/index.vue.d.ts +81 -0
- package/dist/components/ZlButton/index.vue.mjs +60 -0
- package/dist/components/ZlButton/index2.vue.mjs +5 -0
- package/dist/components/ZlCardPage/index.vue.d.ts +41 -3
- package/dist/components/ZlCardPage/index.vue.mjs +68 -68
- package/dist/components/ZlCardPage/resolvePagination.d.ts +20 -0
- package/dist/components/ZlCardPage/resolvePagination.mjs +24 -0
- package/dist/components/ZlCheckboxTag/index.css +1 -1
- package/dist/components/ZlCheckboxTag/index.vue.d.ts +4 -4
- package/dist/components/ZlCheckboxTag/index.vue.mjs +34 -30
- package/dist/components/ZlCopy/copy.mjs +17 -7
- package/dist/components/ZlCopy/index.css +1 -1
- package/dist/components/ZlCopy/index.vue.mjs +2 -2
- package/dist/components/ZlCopy/index2.vue.mjs +34 -36
- package/dist/components/ZlDescription/index.css +1 -1
- package/dist/components/ZlDescription/index.vue.mjs +28 -24
- package/dist/components/ZlDevMenu/index.css +1 -0
- package/dist/components/ZlDevMenu/index.vue.d.ts +33 -0
- package/dist/components/ZlDevMenu/index.vue.mjs +110 -0
- package/dist/components/ZlDevMenu/index3.vue.mjs +6 -0
- package/dist/components/ZlDevMenu/types.d.ts +8 -0
- package/dist/components/ZlDialog/index.css +1 -1
- package/dist/components/ZlDialog/index.vue.d.ts +3 -0
- package/dist/components/ZlDialog/index.vue.mjs +39 -35
- package/dist/components/ZlDictTag/index.vue.d.ts +12 -3
- package/dist/components/ZlDictTag/index.vue.mjs +31 -26
- package/dist/components/ZlDrawer/index.css +1 -1
- package/dist/components/ZlDrawer/index.vue.d.ts +3 -0
- package/dist/components/ZlDrawer/index.vue.mjs +36 -32
- package/dist/components/ZlDynamicComponent/index.vue.d.ts +5 -3
- package/dist/components/ZlForm/index.css +1 -1
- package/dist/components/ZlForm/index.vue.d.ts +7 -0
- package/dist/components/ZlForm/index.vue.mjs +50 -47
- package/dist/components/ZlLayoutSwitch/index.css +1 -1
- package/dist/components/ZlLayoutSwitch/index.vue.d.ts +10 -0
- package/dist/components/ZlLayoutSwitch/index.vue.mjs +1 -1
- package/dist/components/ZlLayoutSwitch/index2.vue.mjs +27 -19
- package/dist/components/ZlLoading/index.css +1 -0
- package/dist/components/ZlLoading/index.vue.d.ts +27 -0
- package/dist/components/ZlLoading/index.vue.mjs +8 -0
- package/dist/components/ZlLoading/index2.vue.mjs +30 -0
- package/dist/components/ZlLogin/components/LoginForm.css +1 -1
- package/dist/components/ZlLogin/components/LoginForm.vue.mjs +1 -1
- package/dist/components/ZlLogin/components/LoginForm2.vue.mjs +26 -25
- package/dist/components/ZlMenu/MenuIcon.d.ts +17 -0
- package/dist/components/ZlMenu/MenuIcon.mjs +21 -0
- package/dist/components/ZlMenu/ZlMenuItem.vue.d.ts +7 -0
- package/dist/components/ZlMenu/ZlMenuItem.vue.mjs +53 -0
- package/dist/components/ZlMenu/ZlMenuItem2.vue.mjs +5 -0
- package/dist/components/ZlMenu/index.css +1 -0
- package/dist/components/ZlMenu/index.vue.d.ts +40 -0
- package/dist/components/ZlMenu/index.vue.mjs +60 -0
- package/dist/components/ZlMenu/index3.vue.mjs +6 -0
- package/dist/components/ZlMenu/types.d.ts +20 -0
- package/dist/components/ZlPageContainer/index.css +1 -1
- package/dist/components/ZlPageContainer/index.vue.mjs +1 -1
- package/dist/components/ZlPagination/index.css +1 -1
- package/dist/components/ZlPagination/index.vue.d.ts +21 -1
- package/dist/components/ZlPagination/index.vue.mjs +1 -1
- package/dist/components/ZlPagination/index2.vue.mjs +59 -33
- package/dist/components/ZlPagination/usePagination.d.ts +1 -0
- package/dist/components/ZlPagination/usePagination.mjs +51 -34
- package/dist/components/ZlPopconfirm/index.vue.mjs +25 -24
- package/dist/components/ZlSearch/index.vue.d.ts +25 -0
- package/dist/components/ZlSearch/index.vue.mjs +202 -205
- package/dist/components/ZlSearchTable/index.vue.d.ts +40 -2
- package/dist/components/ZlSearchTable/index.vue.mjs +59 -55
- package/dist/components/ZlTable/useTablePagination.d.ts +1 -0
- package/dist/components/ZlTable/useTablePagination.mjs +37 -23
- package/dist/components/ZlTabs/index.vue.d.ts +16 -3
- package/dist/components/ZlTag/ZlCornerTag.css +1 -1
- package/dist/components/ZlTag/ZlCornerTag.vue.d.ts +14 -1
- package/dist/components/ZlTag/ZlCornerTag.vue.mjs +25 -14
- package/dist/components/ZlTag/index.vue.mjs +4 -4
- package/dist/components/ZlUpload/index.css +1 -1
- package/dist/components/ZlUpload/index.vue.d.ts +44 -3
- package/dist/components/ZlUpload/index.vue.mjs +3 -3
- package/dist/components/ZlUpload/index2.vue.mjs +119 -79
- package/dist/index.d.ts +8 -2
- package/dist/index.mjs +183 -169
- package/dist/locales/en.mjs +2 -2
- package/dist/locales/zh-cn.mjs +3 -3
- package/package.json +6 -6
- package/dist/components/ZlAppMenu/AppMenu.css +0 -1
- package/dist/components/ZlAppMenu/AppMenu.vue.d.ts +0 -27
- package/dist/components/ZlAppMenu/AppMenu.vue.mjs +0 -37
- package/dist/components/ZlAppMenu/AppMenu3.vue.mjs +0 -6
- package/dist/components/ZlAppMenu/AppMenuItem.vue.d.ts +0 -11
- package/dist/components/ZlAppMenu/AppMenuItem.vue.mjs +0 -58
- package/dist/components/ZlAppMenu/AppMenuItem2.vue.mjs +0 -5
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as x, useModel as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as x, useModel as b, computed as t, ref as h, openBlock as c, createElementBlock as v, Fragment as k, renderList as m, createBlock as y, normalizeStyle as z, normalizeClass as B, withCtx as C, renderSlot as S, mergeProps as V, createTextVNode as $, toDisplayString as E, mergeModels as M } from "vue";
|
|
2
|
+
import w from "../ZlTag/index.vue.mjs";
|
|
3
3
|
import '../ZlTag/index.css';/* empty css */
|
|
4
|
-
const
|
|
4
|
+
const N = { class: "zl-checkbox-tag" }, F = /* @__PURE__ */ x({
|
|
5
5
|
name: "ZlCheckboxTag",
|
|
6
6
|
__name: "index",
|
|
7
|
-
props: /* @__PURE__ */
|
|
7
|
+
props: /* @__PURE__ */ M({
|
|
8
8
|
options: { default: () => [] },
|
|
9
9
|
single: { type: Boolean },
|
|
10
|
-
rounded: { type: Boolean, default: !0 },
|
|
10
|
+
rounded: { type: [Boolean, Number, String], default: !0 },
|
|
11
11
|
bordered: { type: Boolean, default: !0 },
|
|
12
12
|
fill: { type: Boolean, default: !0 },
|
|
13
13
|
size: { default: "small" }
|
|
@@ -17,51 +17,55 @@ const M = { class: "zl-checkbox-tag" }, T = /* @__PURE__ */ x({
|
|
|
17
17
|
}),
|
|
18
18
|
emits: ["update:modelValue"],
|
|
19
19
|
setup(o) {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
const a = o, u = b(o, "modelValue"), f = t(() => {
|
|
21
|
+
if (typeof a.rounded == "number") return { "--zl-radius-round": `${a.rounded}px` };
|
|
22
|
+
if (typeof a.rounded == "string") return { "--zl-radius-round": a.rounded };
|
|
23
|
+
}), i = t(() => a.options.some((e) => e.exclusive)), d = h();
|
|
24
|
+
if (i.value && u.value) {
|
|
25
|
+
const e = a.options.find((n) => n.value === u.value[0]);
|
|
23
26
|
d.value = e?.exclusive;
|
|
24
27
|
}
|
|
25
|
-
const
|
|
26
|
-
function
|
|
28
|
+
const r = t(() => new Set(a.single ? [u.value] : u.value ?? []));
|
|
29
|
+
function p(e) {
|
|
27
30
|
if (e.disabled) return;
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
const
|
|
31
|
-
|
|
31
|
+
const n = a.single ? [u.value] : [...u.value ?? []], l = n.includes(e.value);
|
|
32
|
+
if (i.value && !l) {
|
|
33
|
+
const s = e;
|
|
34
|
+
s.exclusive === !0 || s.exclusive !== d.value ? (u.value = [e.value], d.value = s.exclusive) : u.value = [...n, e.value];
|
|
32
35
|
return;
|
|
33
36
|
}
|
|
34
37
|
if (l) {
|
|
35
|
-
const
|
|
36
|
-
|
|
38
|
+
const s = n.filter((g) => g !== e.value);
|
|
39
|
+
u.value = a.single ? s[0] : s;
|
|
37
40
|
} else
|
|
38
|
-
|
|
41
|
+
a.single ? u.value = e.value : u.value = [...n, e.value];
|
|
39
42
|
}
|
|
40
|
-
return (e,
|
|
41
|
-
(
|
|
43
|
+
return (e, n) => (c(), v("div", N, [
|
|
44
|
+
(c(!0), v(k, null, m(o.options, (l) => (c(), y(w, {
|
|
42
45
|
key: l.value,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
class: B({ "zl-checkbox-tag__plain": !r.value.has(l.value) && o.fill }),
|
|
47
|
+
style: z(f.value),
|
|
48
|
+
rounded: o.rounded !== !1,
|
|
49
|
+
color: r.value.has(l.value) ? "primary" : void 0,
|
|
50
|
+
bordered: o.bordered,
|
|
47
51
|
selectable: "",
|
|
48
|
-
selected:
|
|
52
|
+
selected: r.value.has(l.value),
|
|
49
53
|
disabled: l.disabled,
|
|
50
54
|
icon: l.icon,
|
|
51
55
|
size: o.size,
|
|
52
|
-
onClick: (
|
|
56
|
+
onClick: (s) => p(l)
|
|
53
57
|
}, {
|
|
54
|
-
default:
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
default: C(() => [
|
|
59
|
+
S(e.$slots, "default", V({ ref_for: !0 }, { item: l, checked: r.value.has(l.value) }), () => [
|
|
60
|
+
$(E(l.label), 1)
|
|
57
61
|
])
|
|
58
62
|
]),
|
|
59
63
|
_: 2
|
|
60
|
-
}, 1032, ["
|
|
64
|
+
}, 1032, ["class", "style", "rounded", "color", "bordered", "selected", "disabled", "icon", "size", "onClick"]))), 128))
|
|
61
65
|
]));
|
|
62
66
|
}
|
|
63
67
|
});
|
|
64
68
|
export {
|
|
65
|
-
|
|
69
|
+
F as default
|
|
66
70
|
};
|
|
67
71
|
//# sourceMappingURL=index.vue.mjs.map
|
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const t = document.createElement("textarea");
|
|
4
|
-
t.value = e ?? "", t.style.position = "absolute", t.style.opacity = "0", document.body.appendChild(t), t.select(), document.execCommand("copy"), t.remove();
|
|
1
|
+
function t() {
|
|
2
|
+
return typeof navigator < "u" && !!navigator.clipboard;
|
|
5
3
|
}
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
function n(o) {
|
|
5
|
+
if (typeof document > "u")
|
|
6
|
+
throw new Error("[ZlCopy] document is not available");
|
|
7
|
+
const e = document.createElement("textarea");
|
|
8
|
+
e.value = o ?? "", e.style.position = "fixed", e.style.top = "-9999px", e.style.opacity = "0", document.body.appendChild(e), e.select();
|
|
9
|
+
try {
|
|
10
|
+
if (!document.execCommand("copy"))
|
|
11
|
+
throw new Error('[ZlCopy] execCommand("copy") failed');
|
|
12
|
+
} finally {
|
|
13
|
+
e.remove();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
async function a(o) {
|
|
17
|
+
o != null && (t() ? await navigator.clipboard.writeText(o) : n(o));
|
|
8
18
|
}
|
|
9
19
|
export {
|
|
10
|
-
|
|
20
|
+
a as default
|
|
11
21
|
};
|
|
12
22
|
//# sourceMappingURL=copy.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.zl-copy[data-v-
|
|
1
|
+
.zl-copy[data-v-1c32b385]{max-width:100%;display:inline-flex;align-items:center;gap:12px}.zl-copy__text[data-v-1c32b385]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import o from "./index2.vue.mjs";
|
|
2
2
|
import './index.css';/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const
|
|
4
|
+
const _ = /* @__PURE__ */ t(o, [["__scopeId", "data-v-1c32b385"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
_ as default
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=index.vue.mjs.map
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent as m, ref as
|
|
2
|
-
import { useZlT as
|
|
3
|
-
import { ElMessage as
|
|
1
|
+
import { defineComponent as m, ref as u, openBlock as y, createElementBlock as x, createElementVNode as r, renderSlot as n, toDisplayString as l, unref as a, createVNode as d, withCtx as _, createTextVNode as z } from "vue";
|
|
2
|
+
import { useZlT as h } from "@zl-ui-kit/composables";
|
|
3
|
+
import { ElMessage as p } from "element-plus";
|
|
4
|
+
import C from "../ZlButton/index.vue.mjs";
|
|
4
5
|
import i from "./copy.mjs";
|
|
5
|
-
const
|
|
6
|
+
const g = { class: "zl-copy" }, k = ["title"], w = /* @__PURE__ */ m({
|
|
6
7
|
name: "ZlCopy",
|
|
7
8
|
__name: "index",
|
|
8
9
|
props: {
|
|
@@ -10,45 +11,42 @@ const k = { class: "zl-copy" }, T = ["title"], B = /* @__PURE__ */ m({
|
|
|
10
11
|
copyText: {}
|
|
11
12
|
},
|
|
12
13
|
setup(e) {
|
|
13
|
-
const c = e, { t: o } =
|
|
14
|
-
function
|
|
14
|
+
const c = e, { t: o } = h(), s = u(null);
|
|
15
|
+
async function f() {
|
|
16
|
+
const t = c.copyText ?? c.text ?? s.value?.textContent ?? "";
|
|
15
17
|
try {
|
|
16
|
-
|
|
17
|
-
i(t), a.success(o("zl.copy.success", "复制成功"));
|
|
18
|
+
await i(t), p.success(o("zl.copy.success", "复制成功"));
|
|
18
19
|
} catch {
|
|
19
|
-
|
|
20
|
+
p.error(o("zl.copy.failed", "复制失败"));
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
|
-
return (t,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
s
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
l(t.$slots, "default", {}, () => [
|
|
31
|
-
s("span", { title: e.text }, r(e.text), 9, T)
|
|
32
|
-
], !0)
|
|
33
|
-
], 512),
|
|
34
|
-
l(t.$slots, "trigger", { copy: p(i) }, () => [
|
|
35
|
-
z(f, {
|
|
36
|
-
size: "small",
|
|
37
|
-
text: "",
|
|
38
|
-
class: "zl-copy__button",
|
|
39
|
-
onClick: u
|
|
40
|
-
}, {
|
|
41
|
-
default: C(() => [
|
|
42
|
-
h(r(p(o)("zl.copy.copy", "复制")), 1)
|
|
43
|
-
]),
|
|
44
|
-
_: 1
|
|
45
|
-
})
|
|
23
|
+
return (t, T) => (y(), x("div", g, [
|
|
24
|
+
r("span", {
|
|
25
|
+
ref_key: "textRef",
|
|
26
|
+
ref: s,
|
|
27
|
+
class: "zl-copy__text"
|
|
28
|
+
}, [
|
|
29
|
+
n(t.$slots, "default", {}, () => [
|
|
30
|
+
r("span", { title: e.text }, l(e.text), 9, k)
|
|
46
31
|
], !0)
|
|
47
|
-
])
|
|
48
|
-
|
|
32
|
+
], 512),
|
|
33
|
+
n(t.$slots, "trigger", { copy: a(i) }, () => [
|
|
34
|
+
d(C, {
|
|
35
|
+
size: "small",
|
|
36
|
+
text: "",
|
|
37
|
+
class: "zl-copy__button",
|
|
38
|
+
onClick: f
|
|
39
|
+
}, {
|
|
40
|
+
default: _(() => [
|
|
41
|
+
z(l(a(o)("zl.copy.copy", "复制")), 1)
|
|
42
|
+
]),
|
|
43
|
+
_: 1
|
|
44
|
+
})
|
|
45
|
+
], !0)
|
|
46
|
+
]));
|
|
49
47
|
}
|
|
50
48
|
});
|
|
51
49
|
export {
|
|
52
|
-
|
|
50
|
+
w as default
|
|
53
51
|
};
|
|
54
52
|
//# sourceMappingURL=index2.vue.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
@charset "UTF-8";.zl-description{display:inline-flex;gap:0 16px;font-size:12px;line-height:20px;white-space:nowrap;flex-wrap:wrap;max-width:100%}.zl-description-type-secondary{padding:0 8px;background-color:var(--zl-fill-2, #eff4f9);border-radius:var(--zl-radius-small, 2px)}.zl-description-type-secondary .zl-description-item:not(:last-child):after{content:"";display:inline-block;height:12px;width:1px;background-color:var(--zl-border-2, #e3e9ef);position:absolute;top:4px;right:-8px}.zl-description-item{position:relative;display:inline-flex;align-items:center;gap:2px;min-width:0;max-width:100%}.zl-description-item-icon{color:var(--zl-text-2, #4d5e7d)}.zl-description-item-label{color:var(--zl-text-3, #79879c);margin-right:10px;flex-shrink:0}.zl-description-item-value{color:var(--zl-text-1, #242e43);flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.zl-description .zl-tag:not(.zl-tag-fill){padding:0}
|
|
@@ -1,52 +1,56 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as C, computed as h, defineAsyncComponent as T, resolveComponent as g, openBlock as n, createElementBlock as a, normalizeClass as b, Fragment as B, renderList as D, createBlock as d, createCommentVNode as E, createElementVNode as u, toDisplayString as y, unref as N, mergeProps as V, renderSlot as Z, withCtx as A, createTextVNode as F } from "vue";
|
|
2
2
|
import { useZlT as S } from "@zl-ui-kit/composables";
|
|
3
|
-
import { isNumber as
|
|
4
|
-
|
|
3
|
+
import { isNumber as w } from "@zl-ui-kit/utils";
|
|
4
|
+
import I from "../ZlAutoTooltip/index.vue.mjs";
|
|
5
|
+
const K = { class: "zl-description-item-label" }, L = { class: "zl-description-item-value" }, H = /* @__PURE__ */ C({
|
|
5
6
|
name: "ZlDescription",
|
|
6
7
|
__name: "index",
|
|
7
8
|
props: {
|
|
8
9
|
items: {},
|
|
9
10
|
data: { default: () => ({}) },
|
|
10
|
-
emptyChecker: { type: Function, default: (s) => !s && !
|
|
11
|
+
emptyChecker: { type: Function, default: (s) => !s && !w(s) },
|
|
11
12
|
emptyText: {},
|
|
12
13
|
secondary: { type: Boolean }
|
|
13
14
|
},
|
|
14
15
|
setup(s) {
|
|
15
|
-
const { t:
|
|
16
|
-
const c = [],
|
|
16
|
+
const { t: f } = S(), t = s, k = h(() => {
|
|
17
|
+
const c = [], p = t.emptyText ?? f("zl.description.empty", "暂无");
|
|
17
18
|
for (const o of t.items) {
|
|
18
|
-
const { visible: e, key:
|
|
19
|
-
if (e === !1 || typeof e == "function" && !e(i,
|
|
19
|
+
const { visible: e, key: r, getValue: m, dict: l, ..._ } = o, i = typeof m == "function" ? m(t.data, o.key, o) : t.data[o.key], x = t.emptyChecker(i, r, t.data) ? p : i;
|
|
20
|
+
if (e === !1 || typeof e == "function" && !e(i, r, t.data))
|
|
20
21
|
continue;
|
|
21
|
-
const
|
|
22
|
-
c.push({ ...
|
|
22
|
+
const z = typeof l == "string" ? { dictKey: l } : l;
|
|
23
|
+
c.push({ ..._, key: r, value: i, text: x, dict: z });
|
|
23
24
|
}
|
|
24
25
|
return c;
|
|
25
|
-
}),
|
|
26
|
-
return (c,
|
|
27
|
-
const o =
|
|
28
|
-
return n(),
|
|
29
|
-
class:
|
|
26
|
+
}), v = T(() => import("../ZlDictTag/index2.vue.mjs"));
|
|
27
|
+
return (c, p) => {
|
|
28
|
+
const o = g("zl-icon");
|
|
29
|
+
return n(), a("div", {
|
|
30
|
+
class: b(["zl-description", { "zl-description-type-secondary": s.secondary }])
|
|
30
31
|
}, [
|
|
31
|
-
(n(!0),
|
|
32
|
+
(n(!0), a(B, null, D(k.value, (e) => (n(), a("div", {
|
|
32
33
|
key: e.key,
|
|
33
34
|
class: "zl-description-item"
|
|
34
35
|
}, [
|
|
35
|
-
e.icon ? (n(),
|
|
36
|
+
e.icon ? (n(), d(o, {
|
|
36
37
|
key: 0,
|
|
37
38
|
class: "zl-description-item-icon",
|
|
38
39
|
icon: e.icon
|
|
39
40
|
}, null, 8, ["icon"])) : E("", !0),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
e.dict ? (n(),
|
|
41
|
+
u("div", K, y(e.label), 1),
|
|
42
|
+
u("div", L, [
|
|
43
|
+
e.dict ? (n(), d(N(v), V({
|
|
43
44
|
key: 0,
|
|
44
45
|
ref_for: !0
|
|
45
46
|
}, e.dict, {
|
|
46
47
|
value: e.text
|
|
47
|
-
}), null, 16, ["value"])) : e.slot ? Z(c.$slots, e.key, {}, void 0, void 0, 1) : (n(),
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
}), null, 16, ["value"])) : e.slot ? Z(c.$slots, e.key, {}, void 0, void 0, 1) : (n(), d(I, { key: 2 }, {
|
|
49
|
+
default: A(() => [
|
|
50
|
+
F(y(e.text), 1)
|
|
51
|
+
]),
|
|
52
|
+
_: 2
|
|
53
|
+
}, 1024))
|
|
50
54
|
])
|
|
51
55
|
]))), 128))
|
|
52
56
|
], 2);
|
|
@@ -54,6 +58,6 @@ const I = { class: "zl-description-item-label" }, K = { class: "zl-description-i
|
|
|
54
58
|
}
|
|
55
59
|
});
|
|
56
60
|
export {
|
|
57
|
-
|
|
61
|
+
H as default
|
|
58
62
|
};
|
|
59
63
|
//# sourceMappingURL=index.vue.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.zl-dev-menu{position:fixed;z-index:3000;user-select:none}.zl-dev-menu__button{width:48px;height:48px;font-size:20px;box-shadow:0 4px 10px var(--zl-shadow-1, rgba(36, 46, 67, .1))}.zl-dev-menu__panel{display:flex;flex-direction:column;gap:10px}.zl-dev-menu__title{font-size:12px;font-weight:600;color:var(--zl-text-1, #242e43)}.zl-dev-menu__list{display:flex;flex-direction:column;gap:2px;max-height:320px;overflow:auto}.zl-dev-menu__item{display:flex;gap:8px;align-items:center;justify-content:space-between;padding:6px 8px;font-size:12px;color:var(--zl-text-2, #4d5e7d);cursor:pointer;border-radius:4px}.zl-dev-menu__item:hover{background:var(--zl-fill-2, #f5f7fa)}.zl-dev-menu__item.is-active{font-weight:600;color:var(--zl-primary-6, var(--el-color-primary))}.zl-dev-menu__label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.zl-dev-menu__path{flex:none;max-width:50%;overflow:hidden;font-size:11px;color:var(--zl-text-3, #8a9bb5);text-overflow:ellipsis;white-space:nowrap}.zl-dev-menu__empty{padding:12px 8px;font-size:12px;color:var(--zl-text-3, #8a9bb5);text-align:center}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DevMenuRoute } from './types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** 是否显示浮球(默认 true,通常由宿主结合开发模式控制) */
|
|
4
|
+
visible?: boolean;
|
|
5
|
+
/** 路由列表;不传时从宿主 vue-router 自动读取 */
|
|
6
|
+
routes?: DevMenuRoute[];
|
|
7
|
+
/** 选中后的跳转方式;不传时调用宿主 `router.push` */
|
|
8
|
+
navigate?: (path: string) => void;
|
|
9
|
+
/** 是否可拖拽;松手后会吸附回右侧,保留垂直位置 */
|
|
10
|
+
draggable?: boolean;
|
|
11
|
+
/** 面板标题 */
|
|
12
|
+
title?: string;
|
|
13
|
+
/** 距右侧距离(px) */
|
|
14
|
+
offsetRight?: number;
|
|
15
|
+
/** 距底部距离(px) */
|
|
16
|
+
offsetBottom?: number;
|
|
17
|
+
};
|
|
18
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
19
|
+
/** 展开路由面板 */
|
|
20
|
+
open: () => void;
|
|
21
|
+
/** 收起路由面板 */
|
|
22
|
+
close: () => void;
|
|
23
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
24
|
+
title: string;
|
|
25
|
+
visible: boolean;
|
|
26
|
+
routes: DevMenuRoute[];
|
|
27
|
+
navigate: (path: string) => void;
|
|
28
|
+
draggable: boolean;
|
|
29
|
+
offsetRight: number;
|
|
30
|
+
offsetBottom: number;
|
|
31
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
32
|
+
export default _default;
|
|
33
|
+
//# sourceMappingURL=index.vue.d.ts.map
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { defineComponent as Y, getCurrentInstance as D, ref as u, computed as g, onBeforeUnmount as N, resolveComponent as L, openBlock as d, createElementBlock as c, normalizeStyle as S, createVNode as v, withCtx as w, createElementVNode as i, toDisplayString as b, Fragment as F, renderList as I, normalizeClass as P, createCommentVNode as E } from "vue";
|
|
2
|
+
import Z from "../ZlButton/index.vue.mjs";
|
|
3
|
+
import j from "../ZlIcon/index.vue.mjs";
|
|
4
|
+
const q = { class: "zl-dev-menu__panel" }, A = { class: "zl-dev-menu__title" }, G = { class: "zl-dev-menu__list" }, H = ["onClick"], J = { class: "zl-dev-menu__label" }, K = { class: "zl-dev-menu__path" }, O = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "zl-dev-menu__empty"
|
|
7
|
+
}, te = /* @__PURE__ */ Y({
|
|
8
|
+
name: "ZlDevMenu",
|
|
9
|
+
__name: "index",
|
|
10
|
+
props: {
|
|
11
|
+
visible: { type: Boolean, default: !0 },
|
|
12
|
+
routes: { default: void 0 },
|
|
13
|
+
navigate: { type: Function, default: void 0 },
|
|
14
|
+
draggable: { type: Boolean, default: !0 },
|
|
15
|
+
title: { default: "开发菜单" },
|
|
16
|
+
offsetRight: { default: 20 },
|
|
17
|
+
offsetBottom: { default: 20 }
|
|
18
|
+
},
|
|
19
|
+
setup(p, { expose: V }) {
|
|
20
|
+
const l = p, m = D()?.appContext.config.globalProperties.$router, r = u(l.offsetRight), f = u(l.offsetBottom), a = u(!1), h = u(""), y = g(() => {
|
|
21
|
+
if (l.routes?.length) return l.routes;
|
|
22
|
+
const t = /* @__PURE__ */ new Set();
|
|
23
|
+
return (m?.getRoutes?.() ?? []).filter((e) => e.path && !e.redirect && !e.path.includes(":")).filter((e) => t.has(e.path) ? !1 : (t.add(e.path), !0)).map((e) => ({ label: e.meta?.title || e.path, path: e.path })).sort((e, n) => e.path.localeCompare(n.path));
|
|
24
|
+
}), z = g(() => {
|
|
25
|
+
const t = h.value.trim().toLowerCase();
|
|
26
|
+
return t ? y.value.filter((e) => `${e.label} ${e.path}`.toLowerCase().includes(t)) : y.value;
|
|
27
|
+
}), $ = g(() => m?.currentRoute?.value?.path ?? "");
|
|
28
|
+
function R(t) {
|
|
29
|
+
a.value = !1, l.navigate ? l.navigate(t.path) : m?.push?.(t.path);
|
|
30
|
+
}
|
|
31
|
+
let C = 0, k = 0, x = 0, M = 0, s = !1;
|
|
32
|
+
function _(t) {
|
|
33
|
+
const e = C - t.clientX, n = k - t.clientY;
|
|
34
|
+
!s && (Math.abs(e) > 3 || Math.abs(n) > 3) && (s = !0), s && (r.value = Math.max(8, x + e), f.value = Math.max(8, M + n));
|
|
35
|
+
}
|
|
36
|
+
function B() {
|
|
37
|
+
window.removeEventListener("mousemove", _), s && (r.value = l.offsetRight);
|
|
38
|
+
}
|
|
39
|
+
function U(t) {
|
|
40
|
+
l.draggable && (C = t.clientX, k = t.clientY, x = r.value, M = f.value, s = !1, window.addEventListener("mousemove", _), window.addEventListener("mouseup", B, { once: !0 }));
|
|
41
|
+
}
|
|
42
|
+
return N(() => {
|
|
43
|
+
window.removeEventListener("mousemove", _), window.removeEventListener("mouseup", B);
|
|
44
|
+
}), V({
|
|
45
|
+
/** 展开路由面板 */
|
|
46
|
+
open: () => {
|
|
47
|
+
a.value = !0;
|
|
48
|
+
},
|
|
49
|
+
/** 收起路由面板 */
|
|
50
|
+
close: () => {
|
|
51
|
+
a.value = !1;
|
|
52
|
+
}
|
|
53
|
+
}), (t, e) => {
|
|
54
|
+
const n = L("el-input"), X = L("el-popover");
|
|
55
|
+
return p.visible ? (d(), c("div", {
|
|
56
|
+
key: 0,
|
|
57
|
+
class: "zl-dev-menu",
|
|
58
|
+
style: S({ right: `${r.value}px`, bottom: `${f.value}px` }),
|
|
59
|
+
onMousedown: U
|
|
60
|
+
}, [
|
|
61
|
+
v(X, {
|
|
62
|
+
visible: a.value,
|
|
63
|
+
"onUpdate:visible": e[1] || (e[1] = (o) => a.value = o),
|
|
64
|
+
trigger: "click",
|
|
65
|
+
placement: "left-end",
|
|
66
|
+
width: 320
|
|
67
|
+
}, {
|
|
68
|
+
reference: w(() => [
|
|
69
|
+
v(Z, {
|
|
70
|
+
class: "zl-dev-menu__button",
|
|
71
|
+
circle: ""
|
|
72
|
+
}, {
|
|
73
|
+
default: w(() => [
|
|
74
|
+
v(j, { icon: "zl:setting" })
|
|
75
|
+
]),
|
|
76
|
+
_: 1
|
|
77
|
+
})
|
|
78
|
+
]),
|
|
79
|
+
default: w(() => [
|
|
80
|
+
i("div", q, [
|
|
81
|
+
i("div", A, b(p.title), 1),
|
|
82
|
+
v(n, {
|
|
83
|
+
modelValue: h.value,
|
|
84
|
+
"onUpdate:modelValue": e[0] || (e[0] = (o) => h.value = o),
|
|
85
|
+
placeholder: "搜索路由",
|
|
86
|
+
clearable: ""
|
|
87
|
+
}, null, 8, ["modelValue"]),
|
|
88
|
+
i("div", G, [
|
|
89
|
+
(d(!0), c(F, null, I(z.value, (o) => (d(), c("div", {
|
|
90
|
+
key: o.path,
|
|
91
|
+
class: P(["zl-dev-menu__item", { "is-active": o.path === $.value }]),
|
|
92
|
+
onClick: (Q) => R(o)
|
|
93
|
+
}, [
|
|
94
|
+
i("span", J, b(o.label), 1),
|
|
95
|
+
i("span", K, b(o.path), 1)
|
|
96
|
+
], 10, H))), 128)),
|
|
97
|
+
z.value.length ? E("", !0) : (d(), c("div", O, "未匹配到路由"))
|
|
98
|
+
])
|
|
99
|
+
])
|
|
100
|
+
]),
|
|
101
|
+
_: 1
|
|
102
|
+
}, 8, ["visible"])
|
|
103
|
+
], 36)) : E("", !0);
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
export {
|
|
108
|
+
te as default
|
|
109
|
+
};
|
|
110
|
+
//# sourceMappingURL=index.vue.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.zl-dialog__body{width:100%}
|
|
1
|
+
.zl-dialog__body{width:100%}.zl-dialog--no-footer .el-dialog__footer{display:none}
|
|
@@ -9,6 +9,8 @@ type __VLS_Props = {
|
|
|
9
9
|
readonly?: boolean;
|
|
10
10
|
/** 内容区加载态,为 true 时显示遮罩 loading */
|
|
11
11
|
loading?: boolean;
|
|
12
|
+
/** 底部按钮区是否可见;为 false 时隐藏整个页脚(默认取消/确定按钮与 footer 插槽一并隐藏),默认 true */
|
|
13
|
+
footerVisible?: boolean;
|
|
12
14
|
};
|
|
13
15
|
type __VLS_PublicProps = {
|
|
14
16
|
'visible'?: boolean;
|
|
@@ -29,6 +31,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
|
|
|
29
31
|
"onUpdate:visible"?: ((value: boolean) => any) | undefined;
|
|
30
32
|
}>, {
|
|
31
33
|
autoCloseAfterConfirm: boolean;
|
|
34
|
+
footerVisible: boolean;
|
|
32
35
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
33
36
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
34
37
|
export default _default;
|