@zl-ui-kit/components 0.21.0 → 0.22.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/README.md +206 -90
- package/dist/components/ZlButton/index.vue.d.ts +64 -0
- package/dist/components/ZlButton/index.vue.mjs +44 -0
- package/dist/components/ZlButton/index2.vue.mjs +5 -0
- 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 +12 -12
- 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 +109 -0
- package/dist/components/ZlDevMenu/index3.vue.mjs +6 -0
- package/dist/components/ZlDevMenu/types.d.ts +8 -0
- package/dist/components/ZlDialog/index.vue.mjs +17 -17
- package/dist/components/ZlDrawer/index.vue.mjs +23 -23
- package/dist/components/ZlMenu/index.vue.d.ts +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.mjs +148 -145
- package/package.json +6 -6
- 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
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { defineComponent as f, useAttrs as c, useSlots as r, computed as p, mergeProps as t, resolveComponent as v, resolveDirective as B, withDirectives as y, openBlock as m, createBlock as _ } from "vue";
|
|
2
|
+
const h = /* @__PURE__ */ f({
|
|
3
|
+
name: "ZlButton",
|
|
4
|
+
inheritAttrs: !1,
|
|
5
|
+
__name: "index",
|
|
6
|
+
props: {
|
|
7
|
+
size: { default: void 0 },
|
|
8
|
+
disabled: { type: Boolean, default: void 0 },
|
|
9
|
+
type: { default: void 0 },
|
|
10
|
+
icon: { default: void 0 },
|
|
11
|
+
nativeType: { default: void 0 },
|
|
12
|
+
loading: { type: Boolean, default: void 0 },
|
|
13
|
+
loadingIcon: { default: void 0 },
|
|
14
|
+
plain: { type: Boolean, default: void 0 },
|
|
15
|
+
text: { type: Boolean, default: void 0 },
|
|
16
|
+
link: { type: Boolean, default: void 0 },
|
|
17
|
+
bg: { type: Boolean, default: void 0 },
|
|
18
|
+
autofocus: { type: Boolean, default: void 0 },
|
|
19
|
+
round: { type: Boolean, default: void 0 },
|
|
20
|
+
circle: { type: Boolean, default: void 0 },
|
|
21
|
+
dashed: { type: Boolean, default: void 0 },
|
|
22
|
+
color: { default: void 0 },
|
|
23
|
+
dark: { type: Boolean, default: void 0 },
|
|
24
|
+
autoInsertSpace: { type: Boolean, default: void 0 },
|
|
25
|
+
tag: { default: void 0 }
|
|
26
|
+
},
|
|
27
|
+
setup(l) {
|
|
28
|
+
const a = l, d = c(), o = r(), n = p(() => t(d, a));
|
|
29
|
+
function i() {
|
|
30
|
+
const e = {};
|
|
31
|
+
return o.default && (e.default = o.default), o.icon && (e.icon = o.icon), o.loading && (e.loading = o.loading), e;
|
|
32
|
+
}
|
|
33
|
+
return (e, g) => {
|
|
34
|
+
const u = v("el-button"), s = B("slots");
|
|
35
|
+
return y((m(), _(u, t(n.value, { class: "zl-button" }), null, 16)), [
|
|
36
|
+
[s, i()]
|
|
37
|
+
]);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
export {
|
|
42
|
+
h as default
|
|
43
|
+
};
|
|
44
|
+
//# 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-40341bd5]{max-width:100%;display:inline-flex;align-items:center;gap:12px}.zl-copy__text[data-v-40341bd5]{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-40341bd5"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
_ as default
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=index.vue.mjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as m, ref as
|
|
1
|
+
import { defineComponent as m, ref as y, resolveComponent as x, openBlock as d, createElementBlock as _, createElementVNode as s, renderSlot as l, toDisplayString as r, unref as a, createVNode as z, withCtx as C, createTextVNode as h } from "vue";
|
|
2
2
|
import { useZlT as g } from "@zl-ui-kit/composables";
|
|
3
|
-
import { ElMessage as
|
|
3
|
+
import { ElMessage as p } from "element-plus";
|
|
4
4
|
import i from "./copy.mjs";
|
|
5
|
-
const k = { class: "zl-copy" }, T = ["title"],
|
|
5
|
+
const k = { class: "zl-copy" }, T = ["title"], w = /* @__PURE__ */ m({
|
|
6
6
|
name: "ZlCopy",
|
|
7
7
|
__name: "index",
|
|
8
8
|
props: {
|
|
@@ -10,17 +10,17 @@ const k = { class: "zl-copy" }, T = ["title"], B = /* @__PURE__ */ m({
|
|
|
10
10
|
copyText: {}
|
|
11
11
|
},
|
|
12
12
|
setup(e) {
|
|
13
|
-
const c = e, { t: o } = g(), n =
|
|
14
|
-
function u() {
|
|
13
|
+
const c = e, { t: o } = g(), n = y(null);
|
|
14
|
+
async function u() {
|
|
15
|
+
const t = c.copyText ?? c.text ?? n.value?.textContent ?? "";
|
|
15
16
|
try {
|
|
16
|
-
|
|
17
|
-
i(t), a.success(o("zl.copy.success", "复制成功"));
|
|
17
|
+
await i(t), p.success(o("zl.copy.success", "复制成功"));
|
|
18
18
|
} catch {
|
|
19
|
-
|
|
19
|
+
p.error(o("zl.copy.failed", "复制失败"));
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
return (t, b) => {
|
|
23
|
-
const f =
|
|
23
|
+
const f = x("el-button");
|
|
24
24
|
return d(), _("div", k, [
|
|
25
25
|
s("span", {
|
|
26
26
|
ref_key: "textRef",
|
|
@@ -31,7 +31,7 @@ const k = { class: "zl-copy" }, T = ["title"], B = /* @__PURE__ */ m({
|
|
|
31
31
|
s("span", { title: e.text }, r(e.text), 9, T)
|
|
32
32
|
], !0)
|
|
33
33
|
], 512),
|
|
34
|
-
l(t.$slots, "trigger", { copy:
|
|
34
|
+
l(t.$slots, "trigger", { copy: a(i) }, () => [
|
|
35
35
|
z(f, {
|
|
36
36
|
size: "small",
|
|
37
37
|
text: "",
|
|
@@ -39,7 +39,7 @@ const k = { class: "zl-copy" }, T = ["title"], B = /* @__PURE__ */ m({
|
|
|
39
39
|
onClick: u
|
|
40
40
|
}, {
|
|
41
41
|
default: C(() => [
|
|
42
|
-
h(r(
|
|
42
|
+
h(r(a(o)("zl.copy.copy", "复制")), 1)
|
|
43
43
|
]),
|
|
44
44
|
_: 1
|
|
45
45
|
})
|
|
@@ -49,6 +49,6 @@ const k = { class: "zl-copy" }, T = ["title"], B = /* @__PURE__ */ m({
|
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
export {
|
|
52
|
-
|
|
52
|
+
w as default
|
|
53
53
|
};
|
|
54
54
|
//# sourceMappingURL=index2.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,109 @@
|
|
|
1
|
+
import { defineComponent as D, getCurrentInstance as N, ref as r, computed as g, onBeforeUnmount as S, resolveComponent as b, openBlock as d, createElementBlock as c, normalizeStyle as F, createVNode as v, withCtx as w, createElementVNode as u, toDisplayString as y, Fragment as I, renderList as P, normalizeClass as Z, createCommentVNode as E } from "vue";
|
|
2
|
+
import j from "../ZlIcon/index.vue.mjs";
|
|
3
|
+
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 = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "zl-dev-menu__empty"
|
|
6
|
+
}, ee = /* @__PURE__ */ D({
|
|
7
|
+
name: "ZlDevMenu",
|
|
8
|
+
__name: "index",
|
|
9
|
+
props: {
|
|
10
|
+
visible: { type: Boolean, default: !0 },
|
|
11
|
+
routes: { default: void 0 },
|
|
12
|
+
navigate: { type: Function, default: void 0 },
|
|
13
|
+
draggable: { type: Boolean, default: !0 },
|
|
14
|
+
title: { default: "开发菜单" },
|
|
15
|
+
offsetRight: { default: 20 },
|
|
16
|
+
offsetBottom: { default: 20 }
|
|
17
|
+
},
|
|
18
|
+
setup(p, { expose: V }) {
|
|
19
|
+
const n = p, m = N()?.appContext.config.globalProperties.$router, i = r(n.offsetRight), f = r(n.offsetBottom), a = r(!1), h = r(""), z = g(() => {
|
|
20
|
+
if (n.routes?.length) return n.routes;
|
|
21
|
+
const t = /* @__PURE__ */ new Set();
|
|
22
|
+
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, l) => e.path.localeCompare(l.path));
|
|
23
|
+
}), C = g(() => {
|
|
24
|
+
const t = h.value.trim().toLowerCase();
|
|
25
|
+
return t ? z.value.filter((e) => `${e.label} ${e.path}`.toLowerCase().includes(t)) : z.value;
|
|
26
|
+
}), R = g(() => m?.currentRoute?.value?.path ?? "");
|
|
27
|
+
function $(t) {
|
|
28
|
+
a.value = !1, n.navigate ? n.navigate(t.path) : m?.push?.(t.path);
|
|
29
|
+
}
|
|
30
|
+
let k = 0, x = 0, M = 0, B = 0, s = !1;
|
|
31
|
+
function _(t) {
|
|
32
|
+
const e = k - t.clientX, l = x - t.clientY;
|
|
33
|
+
!s && (Math.abs(e) > 3 || Math.abs(l) > 3) && (s = !0), s && (i.value = Math.max(8, M + e), f.value = Math.max(8, B + l));
|
|
34
|
+
}
|
|
35
|
+
function L() {
|
|
36
|
+
window.removeEventListener("mousemove", _), s && (i.value = n.offsetRight);
|
|
37
|
+
}
|
|
38
|
+
function U(t) {
|
|
39
|
+
n.draggable && (k = t.clientX, x = t.clientY, M = i.value, B = f.value, s = !1, window.addEventListener("mousemove", _), window.addEventListener("mouseup", L, { once: !0 }));
|
|
40
|
+
}
|
|
41
|
+
return S(() => {
|
|
42
|
+
window.removeEventListener("mousemove", _), window.removeEventListener("mouseup", L);
|
|
43
|
+
}), V({
|
|
44
|
+
/** 展开路由面板 */
|
|
45
|
+
open: () => {
|
|
46
|
+
a.value = !0;
|
|
47
|
+
},
|
|
48
|
+
/** 收起路由面板 */
|
|
49
|
+
close: () => {
|
|
50
|
+
a.value = !1;
|
|
51
|
+
}
|
|
52
|
+
}), (t, e) => {
|
|
53
|
+
const l = b("el-button"), X = b("el-input"), Y = b("el-popover");
|
|
54
|
+
return p.visible ? (d(), c("div", {
|
|
55
|
+
key: 0,
|
|
56
|
+
class: "zl-dev-menu",
|
|
57
|
+
style: F({ right: `${i.value}px`, bottom: `${f.value}px` }),
|
|
58
|
+
onMousedown: U
|
|
59
|
+
}, [
|
|
60
|
+
v(Y, {
|
|
61
|
+
visible: a.value,
|
|
62
|
+
"onUpdate:visible": e[1] || (e[1] = (o) => a.value = o),
|
|
63
|
+
trigger: "click",
|
|
64
|
+
placement: "left-end",
|
|
65
|
+
width: 320
|
|
66
|
+
}, {
|
|
67
|
+
reference: w(() => [
|
|
68
|
+
v(l, {
|
|
69
|
+
class: "zl-dev-menu__button",
|
|
70
|
+
circle: ""
|
|
71
|
+
}, {
|
|
72
|
+
default: w(() => [
|
|
73
|
+
v(j, { icon: "zl:setting" })
|
|
74
|
+
]),
|
|
75
|
+
_: 1
|
|
76
|
+
})
|
|
77
|
+
]),
|
|
78
|
+
default: w(() => [
|
|
79
|
+
u("div", q, [
|
|
80
|
+
u("div", A, y(p.title), 1),
|
|
81
|
+
v(X, {
|
|
82
|
+
modelValue: h.value,
|
|
83
|
+
"onUpdate:modelValue": e[0] || (e[0] = (o) => h.value = o),
|
|
84
|
+
placeholder: "搜索路由",
|
|
85
|
+
clearable: ""
|
|
86
|
+
}, null, 8, ["modelValue"]),
|
|
87
|
+
u("div", G, [
|
|
88
|
+
(d(!0), c(I, null, P(C.value, (o) => (d(), c("div", {
|
|
89
|
+
key: o.path,
|
|
90
|
+
class: Z(["zl-dev-menu__item", { "is-active": o.path === R.value }]),
|
|
91
|
+
onClick: (Q) => $(o)
|
|
92
|
+
}, [
|
|
93
|
+
u("span", J, y(o.label), 1),
|
|
94
|
+
u("span", K, y(o.path), 1)
|
|
95
|
+
], 10, H))), 128)),
|
|
96
|
+
C.value.length ? E("", !0) : (d(), c("div", O, "未匹配到路由"))
|
|
97
|
+
])
|
|
98
|
+
])
|
|
99
|
+
]),
|
|
100
|
+
_: 1
|
|
101
|
+
}, 8, ["visible"])
|
|
102
|
+
], 36)) : E("", !0);
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
export {
|
|
107
|
+
ee as default
|
|
108
|
+
};
|
|
109
|
+
//# sourceMappingURL=index.vue.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useZlT as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as z, useModel as w, ref as x, computed as f, useAttrs as A, resolveComponent as m, resolveDirective as D, openBlock as d, createBlock as g, mergeProps as _, withCtx as a, withDirectives as M, createElementBlock as N, renderSlot as v, createTextVNode as y, toDisplayString as p, unref as T, createCommentVNode as Z, createVNode as $, mergeModels as O } from "vue";
|
|
2
|
+
import { useZlT as S } from "@zl-ui-kit/composables";
|
|
3
|
+
const E = { class: "zl-dialog__body" }, U = /* @__PURE__ */ z({
|
|
4
4
|
name: "ZlDialog",
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "index",
|
|
7
|
-
props: /* @__PURE__ */
|
|
7
|
+
props: /* @__PURE__ */ O({
|
|
8
8
|
onCancel: {},
|
|
9
9
|
onOk: {},
|
|
10
10
|
autoCloseAfterConfirm: { type: Boolean, default: !0 },
|
|
@@ -17,43 +17,43 @@ const S = { class: "zl-dialog__body" }, P = /* @__PURE__ */ h({
|
|
|
17
17
|
}),
|
|
18
18
|
emits: ["update:visible"],
|
|
19
19
|
setup(e) {
|
|
20
|
-
const { t: i } =
|
|
20
|
+
const { t: i } = S(), o = e, t = w(e, "visible");
|
|
21
21
|
async function r() {
|
|
22
22
|
o.onCancel && !await o.onCancel() || (t.value = !1);
|
|
23
23
|
}
|
|
24
|
-
const s =
|
|
24
|
+
const s = x(!1);
|
|
25
25
|
async function C() {
|
|
26
26
|
s.value = !0;
|
|
27
27
|
try {
|
|
28
|
-
|
|
28
|
+
await o.onOk?.(), o.autoCloseAfterConfirm && (t.value = !1);
|
|
29
29
|
} catch (l) {
|
|
30
30
|
console.error("[ZlDialog] handleConfirm: ", l);
|
|
31
31
|
} finally {
|
|
32
32
|
s.value = !1;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
const b = f(() => o.readonly ? i("zl.dialog.close", "关闭") : i("zl.dialog.confirm", "确定")), k = f(() => ({ width: "600px", "destroy-on-close": !0, ...
|
|
35
|
+
const b = f(() => o.readonly ? i("zl.dialog.close", "关闭") : i("zl.dialog.confirm", "确定")), k = A(), B = f(() => ({ width: "600px", "destroy-on-close": !0, ...k }));
|
|
36
36
|
return (l, n) => {
|
|
37
|
-
const u = m("el-button"),
|
|
38
|
-
return d(), g(
|
|
37
|
+
const u = m("el-button"), V = m("el-dialog"), h = D("loading");
|
|
38
|
+
return d(), g(V, _({
|
|
39
39
|
class: ["zl-dialog", { "zl-dialog--no-footer": !e.footerVisible }]
|
|
40
|
-
},
|
|
40
|
+
}, B.value, {
|
|
41
41
|
modelValue: t.value,
|
|
42
42
|
"onUpdate:modelValue": n[1] || (n[1] = (c) => t.value = c),
|
|
43
43
|
"before-close": r
|
|
44
44
|
}), {
|
|
45
45
|
footer: a(() => [
|
|
46
46
|
v(l.$slots, "footer", {}, () => [
|
|
47
|
-
e.readonly ?
|
|
47
|
+
e.readonly ? Z("", !0) : (d(), g(u, {
|
|
48
48
|
key: 0,
|
|
49
49
|
onClick: r
|
|
50
50
|
}, {
|
|
51
51
|
default: a(() => [
|
|
52
|
-
y(p(
|
|
52
|
+
y(p(T(i)("zl.dialog.cancel", "取消")), 1)
|
|
53
53
|
]),
|
|
54
54
|
_: 1
|
|
55
55
|
})),
|
|
56
|
-
|
|
56
|
+
$(u, {
|
|
57
57
|
type: "primary",
|
|
58
58
|
loading: s.value,
|
|
59
59
|
onClick: n[0] || (n[0] = (c) => e.readonly ? r() : C())
|
|
@@ -66,10 +66,10 @@ const S = { class: "zl-dialog__body" }, P = /* @__PURE__ */ h({
|
|
|
66
66
|
])
|
|
67
67
|
]),
|
|
68
68
|
default: a(() => [
|
|
69
|
-
|
|
69
|
+
M((d(), N("div", E, [
|
|
70
70
|
v(l.$slots, "default")
|
|
71
71
|
])), [
|
|
72
|
-
[
|
|
72
|
+
[h, e.loading]
|
|
73
73
|
])
|
|
74
74
|
]),
|
|
75
75
|
_: 3
|
|
@@ -78,6 +78,6 @@ const S = { class: "zl-dialog__body" }, P = /* @__PURE__ */ h({
|
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
80
|
export {
|
|
81
|
-
|
|
81
|
+
U as default
|
|
82
82
|
};
|
|
83
83
|
//# sourceMappingURL=index.vue.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useZlT as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as V, useModel as h, ref as A, computed as f, useAttrs as D, resolveComponent as m, resolveDirective as _, openBlock as d, createBlock as v, mergeProps as x, withCtx as n, withDirectives as M, createElementBlock as N, renderSlot as y, createTextVNode as w, toDisplayString as C, unref as T, createCommentVNode as Z, createVNode as $, mergeModels as O } from "vue";
|
|
2
|
+
import { useZlT as S } from "@zl-ui-kit/composables";
|
|
3
|
+
const E = { class: "zl-drawer__body" }, U = /* @__PURE__ */ V({
|
|
4
4
|
name: "ZlDrawer",
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "index",
|
|
7
|
-
props: /* @__PURE__ */
|
|
7
|
+
props: /* @__PURE__ */ O({
|
|
8
8
|
onCancel: {},
|
|
9
9
|
onOk: {},
|
|
10
10
|
autoCloseAfterConfirm: { type: Boolean, default: !0 },
|
|
@@ -17,62 +17,62 @@ const S = { class: "zl-drawer__body" }, P = /* @__PURE__ */ B({
|
|
|
17
17
|
}),
|
|
18
18
|
emits: ["update:visible"],
|
|
19
19
|
setup(o) {
|
|
20
|
-
const { t: a } =
|
|
20
|
+
const { t: a } = S(), l = o, r = h(o, "visible");
|
|
21
21
|
async function s() {
|
|
22
|
-
|
|
22
|
+
l.onCancel && !await l.onCancel() || (r.value = !1);
|
|
23
23
|
}
|
|
24
|
-
const i =
|
|
24
|
+
const i = A(!1);
|
|
25
25
|
async function p() {
|
|
26
26
|
i.value = !0;
|
|
27
27
|
try {
|
|
28
|
-
|
|
28
|
+
await l.onOk?.(), l.autoCloseAfterConfirm && (r.value = !1);
|
|
29
29
|
} catch (e) {
|
|
30
30
|
console.error("[ZlDrawer] handleConfirm: ", e);
|
|
31
31
|
} finally {
|
|
32
32
|
i.value = !1;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
const b = f(() =>
|
|
36
|
-
const { width: e, ...
|
|
37
|
-
return { size: 600, ...e !== void 0 ? { size: e } : {},
|
|
35
|
+
const b = f(() => l.readonly ? a("zl.drawer.close", "关闭") : a("zl.drawer.confirm", "确定")), g = D(), k = f(() => {
|
|
36
|
+
const { width: e, ...t } = g;
|
|
37
|
+
return { size: 600, ...e !== void 0 ? { size: e } : {}, "destroy-on-close": !0, ...t };
|
|
38
38
|
});
|
|
39
|
-
return (e,
|
|
40
|
-
const u = m("el-button"),
|
|
41
|
-
return d(), v(
|
|
39
|
+
return (e, t) => {
|
|
40
|
+
const u = m("el-button"), z = m("el-drawer"), B = _("loading");
|
|
41
|
+
return d(), v(z, x({
|
|
42
42
|
class: ["zl-drawer", { "zl-drawer--no-footer": !o.footerVisible }]
|
|
43
43
|
}, k.value, {
|
|
44
44
|
modelValue: r.value,
|
|
45
|
-
"onUpdate:modelValue":
|
|
45
|
+
"onUpdate:modelValue": t[1] || (t[1] = (c) => r.value = c),
|
|
46
46
|
"before-close": s
|
|
47
47
|
}), {
|
|
48
48
|
footer: n(() => [
|
|
49
49
|
y(e.$slots, "footer", {}, () => [
|
|
50
|
-
o.readonly ?
|
|
50
|
+
o.readonly ? Z("", !0) : (d(), v(u, {
|
|
51
51
|
key: 0,
|
|
52
52
|
onClick: s
|
|
53
53
|
}, {
|
|
54
54
|
default: n(() => [
|
|
55
|
-
C(
|
|
55
|
+
w(C(T(a)("zl.drawer.cancel", "取消")), 1)
|
|
56
56
|
]),
|
|
57
57
|
_: 1
|
|
58
58
|
})),
|
|
59
|
-
|
|
59
|
+
$(u, {
|
|
60
60
|
type: "primary",
|
|
61
61
|
loading: i.value,
|
|
62
|
-
onClick:
|
|
62
|
+
onClick: t[0] || (t[0] = (c) => o.readonly ? s() : p())
|
|
63
63
|
}, {
|
|
64
64
|
default: n(() => [
|
|
65
|
-
C(
|
|
65
|
+
w(C(b.value), 1)
|
|
66
66
|
]),
|
|
67
67
|
_: 1
|
|
68
68
|
}, 8, ["loading"])
|
|
69
69
|
])
|
|
70
70
|
]),
|
|
71
71
|
default: n(() => [
|
|
72
|
-
|
|
72
|
+
M((d(), N("div", E, [
|
|
73
73
|
y(e.$slots, "default")
|
|
74
74
|
])), [
|
|
75
|
-
[
|
|
75
|
+
[B, o.loading]
|
|
76
76
|
])
|
|
77
77
|
]),
|
|
78
78
|
_: 3
|
|
@@ -81,6 +81,6 @@ const S = { class: "zl-drawer__body" }, P = /* @__PURE__ */ B({
|
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
export {
|
|
84
|
-
|
|
84
|
+
U as default
|
|
85
85
|
};
|
|
86
86
|
//# sourceMappingURL=index.vue.mjs.map
|
|
@@ -28,10 +28,10 @@ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {},
|
|
|
28
28
|
}>, {
|
|
29
29
|
mode: "vertical" | "horizontal";
|
|
30
30
|
collapsed: boolean;
|
|
31
|
-
collapseTransition: boolean;
|
|
32
31
|
items: MenuOption[];
|
|
33
32
|
uniqueOpened: boolean;
|
|
34
33
|
defaultOpeneds: string[];
|
|
34
|
+
collapseTransition: boolean;
|
|
35
35
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
36
36
|
export default _default;
|
|
37
37
|
//# sourceMappingURL=index.vue.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -3,18 +3,19 @@ export { default as ZlAction } from './components/ZlAction/index.vue';
|
|
|
3
3
|
export { default as ZlActionList } from './components/ZlAction/List.vue';
|
|
4
4
|
export { default as ZlAddSub } from './components/ZlAddSub/index.vue';
|
|
5
5
|
export { default as ZlAppLayout } from './components/ZlAppLayout/index.vue';
|
|
6
|
-
export { default as ZlAppMenu } from './components/ZlAppMenu/AppMenu.vue';
|
|
7
6
|
export { default as ZlAppSlogan } from './components/ZlAppSlogan/index.vue';
|
|
8
7
|
export { default as ZlAutoTooltip } from './components/ZlAutoTooltip/index.vue';
|
|
9
8
|
export { default as ZlAvatar } from './components/ZlAvatar/index.vue';
|
|
10
9
|
export { default as ZlAvatarGroup } from './components/ZlAvatar/Group.vue';
|
|
11
10
|
export { default as ZlBreadcrumb } from './components/ZlBreadcrumb/index.vue';
|
|
11
|
+
export { default as ZlButton } from './components/ZlButton/index.vue';
|
|
12
12
|
export { default as ZlCard } from './components/ZlCard/index.vue';
|
|
13
13
|
export { default as ZlCardPage } from './components/ZlCardPage/index.vue';
|
|
14
14
|
export { default as ZlCheckAll } from './components/ZlCheckAll/index.vue';
|
|
15
15
|
export { default as ZlCheckboxTag } from './components/ZlCheckboxTag/index.vue';
|
|
16
16
|
export { default as ZlCopy } from './components/ZlCopy/index.vue';
|
|
17
17
|
export { default as ZlDescription } from './components/ZlDescription/index.vue';
|
|
18
|
+
export { default as ZlDevMenu } from './components/ZlDevMenu/index.vue';
|
|
18
19
|
export { default as ZlDialog } from './components/ZlDialog/index.vue';
|
|
19
20
|
export { default as ZlDictTag } from './components/ZlDictTag/index.vue';
|
|
20
21
|
export { default as ZlDrawer } from './components/ZlDrawer/index.vue';
|
|
@@ -62,10 +63,10 @@ export * from './components/ZlIcon/presetIconifyIcon';
|
|
|
62
63
|
export { usePagination } from './components/ZlPagination/usePagination';
|
|
63
64
|
export { useTablePagination } from './components/ZlTable/useTablePagination';
|
|
64
65
|
export { usePermission, usePermissionProvider } from './components/ZlPermission/usePermission';
|
|
65
|
-
export type { MenuItem } from './components/ZlAppMenu/AppMenu.vue';
|
|
66
66
|
export type { MenuOption } from './components/ZlMenu/types';
|
|
67
67
|
export type { StepItem } from './components/ZlStep/index.vue';
|
|
68
68
|
export type { BreadcrumbItem } from './components/ZlBreadcrumb/types';
|
|
69
|
+
export type { DevMenuRoute } from './components/ZlDevMenu/types';
|
|
69
70
|
export type { ActionItem, FormItem, SearchItem, TableColumn } from './types';
|
|
70
71
|
export type { IGridItem } from './components/ZlGrid/types';
|
|
71
72
|
export type { IComponent, IComponentSlot, VForSlot, VModelSlot, ComponentOrSlot, } from './components/ZlDynamicComponent/types';
|