@zl-ui-kit/components 0.27.0 → 0.27.2
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 +18 -22
- 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 +65 -0
- package/dist/components/ZlAppLayout/HeaderAside3.vue.mjs +6 -0
- package/dist/components/ZlAppLayout/Horizontal.css +1 -1
- package/dist/components/ZlAppLayout/Horizontal.vue.mjs +39 -3
- package/dist/components/ZlAppLayout/Horizontal3.vue.mjs +6 -0
- package/dist/components/ZlAppLayout/Vertical.css +1 -1
- package/dist/components/ZlAppLayout/Vertical.vue.mjs +51 -3
- package/dist/components/ZlAppLayout/Vertical3.vue.mjs +6 -0
- package/dist/components/ZlAppLayout/index.vue.d.ts +6 -6
- package/dist/components/ZlAppLayout/index.vue.mjs +14 -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 +5 -5
- package/dist/components/ZlAppLayout/Horizontal2.vue.mjs +0 -42
- package/dist/components/ZlAppLayout/Vertical2.vue.mjs +0 -56
- 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
|
@@ -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;
|
|
@@ -1,80 +1,84 @@
|
|
|
1
|
-
import { defineComponent as h, useModel as
|
|
2
|
-
import { useZlT as
|
|
3
|
-
|
|
1
|
+
import { defineComponent as h, useModel as z, ref as w, computed as c, useAttrs as x, resolveComponent as A, resolveDirective as D, openBlock as d, createBlock as f, mergeProps as _, withCtx as n, withDirectives as $, createElementBlock as M, renderSlot as m, createTextVNode as g, toDisplayString as v, unref as N, createCommentVNode as T, createVNode as Z, mergeModels as O } from "vue";
|
|
2
|
+
import { useZlT as S } from "@zl-ui-kit/composables";
|
|
3
|
+
import y from "../ZlButton/index.vue.mjs";
|
|
4
|
+
const E = { class: "zl-dialog__body" }, j = /* @__PURE__ */ h({
|
|
4
5
|
name: "ZlDialog",
|
|
5
6
|
inheritAttrs: !1,
|
|
6
7
|
__name: "index",
|
|
7
|
-
props: /* @__PURE__ */
|
|
8
|
+
props: /* @__PURE__ */ O({
|
|
8
9
|
onCancel: {},
|
|
9
10
|
onOk: {},
|
|
10
11
|
autoCloseAfterConfirm: { type: Boolean, default: !0 },
|
|
11
12
|
readonly: { type: Boolean },
|
|
12
|
-
loading: { type: Boolean }
|
|
13
|
+
loading: { type: Boolean },
|
|
14
|
+
footerVisible: { type: Boolean, default: !0 }
|
|
13
15
|
}, {
|
|
14
16
|
visible: { type: Boolean, default: !1 },
|
|
15
17
|
visibleModifiers: {}
|
|
16
18
|
}),
|
|
17
19
|
emits: ["update:visible"],
|
|
18
|
-
setup(
|
|
19
|
-
const { t:
|
|
20
|
-
async function
|
|
21
|
-
|
|
20
|
+
setup(e) {
|
|
21
|
+
const { t: i } = S(), o = e, t = z(e, "visible");
|
|
22
|
+
async function r() {
|
|
23
|
+
o.onCancel && !await o.onCancel() || (t.value = !1);
|
|
22
24
|
}
|
|
23
25
|
const s = w(!1);
|
|
24
|
-
async function
|
|
26
|
+
async function p() {
|
|
25
27
|
s.value = !0;
|
|
26
28
|
try {
|
|
27
|
-
|
|
28
|
-
} catch (
|
|
29
|
-
console.error("[ZlDialog] handleConfirm: ",
|
|
29
|
+
await o.onOk?.(), o.autoCloseAfterConfirm && (t.value = !1);
|
|
30
|
+
} catch (l) {
|
|
31
|
+
console.error("[ZlDialog] handleConfirm: ", l);
|
|
30
32
|
} finally {
|
|
31
33
|
s.value = !1;
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
|
-
const
|
|
35
|
-
return (
|
|
36
|
-
const
|
|
37
|
-
return d(),
|
|
36
|
+
const C = c(() => o.readonly ? i("zl.dialog.close", "关闭") : i("zl.dialog.confirm", "确定")), k = x(), b = c(() => ({ width: "600px", "destroy-on-close": !0, ...k }));
|
|
37
|
+
return (l, a) => {
|
|
38
|
+
const B = A("el-dialog"), V = D("loading");
|
|
39
|
+
return d(), f(B, _({
|
|
40
|
+
class: ["zl-dialog", { "zl-dialog--no-footer": !e.footerVisible }]
|
|
41
|
+
}, b.value, {
|
|
38
42
|
modelValue: t.value,
|
|
39
|
-
"onUpdate:modelValue":
|
|
40
|
-
"before-close":
|
|
43
|
+
"onUpdate:modelValue": a[1] || (a[1] = (u) => t.value = u),
|
|
44
|
+
"before-close": r
|
|
41
45
|
}), {
|
|
42
|
-
footer:
|
|
43
|
-
|
|
44
|
-
|
|
46
|
+
footer: n(() => [
|
|
47
|
+
m(l.$slots, "footer", {}, () => [
|
|
48
|
+
e.readonly ? T("", !0) : (d(), f(y, {
|
|
45
49
|
key: 0,
|
|
46
|
-
onClick:
|
|
50
|
+
onClick: r
|
|
47
51
|
}, {
|
|
48
|
-
default:
|
|
49
|
-
|
|
52
|
+
default: n(() => [
|
|
53
|
+
g(v(N(i)("zl.dialog.cancel", "取消")), 1)
|
|
50
54
|
]),
|
|
51
55
|
_: 1
|
|
52
56
|
})),
|
|
53
|
-
|
|
57
|
+
Z(y, {
|
|
54
58
|
type: "primary",
|
|
55
59
|
loading: s.value,
|
|
56
|
-
onClick:
|
|
60
|
+
onClick: a[0] || (a[0] = (u) => e.readonly ? r() : p())
|
|
57
61
|
}, {
|
|
58
|
-
default:
|
|
59
|
-
|
|
62
|
+
default: n(() => [
|
|
63
|
+
g(v(C.value), 1)
|
|
60
64
|
]),
|
|
61
65
|
_: 1
|
|
62
66
|
}, 8, ["loading"])
|
|
63
67
|
])
|
|
64
68
|
]),
|
|
65
|
-
default:
|
|
66
|
-
|
|
67
|
-
|
|
69
|
+
default: n(() => [
|
|
70
|
+
$((d(), M("div", E, [
|
|
71
|
+
m(l.$slots, "default")
|
|
68
72
|
])), [
|
|
69
|
-
[
|
|
73
|
+
[V, e.loading]
|
|
70
74
|
])
|
|
71
75
|
]),
|
|
72
76
|
_: 3
|
|
73
|
-
}, 16, ["modelValue"]);
|
|
77
|
+
}, 16, ["class", "modelValue"]);
|
|
74
78
|
};
|
|
75
79
|
}
|
|
76
80
|
});
|
|
77
81
|
export {
|
|
78
|
-
|
|
82
|
+
j as default
|
|
79
83
|
};
|
|
80
84
|
//# sourceMappingURL=index.vue.mjs.map
|
|
@@ -6,15 +6,18 @@ type __VLS_Props = {
|
|
|
6
6
|
* 行级字典请用独立 key(如 `` `resourceType.${row.id}` ``)。
|
|
7
7
|
*/
|
|
8
8
|
dictKey: string;
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* 外部直传字典数据:无需依赖全局数据源即可翻译。格式同 `DictItem[]`(`{ label, value, icon?, color?, type? }`)。
|
|
11
|
+
* `color` 可以是主题色名,也可以是 `#ff7d45` 这类原生 CSS 颜色值(角标上按纯色渲染,不自动渐变)
|
|
12
|
+
*/
|
|
10
13
|
dict?: DictItem[];
|
|
11
14
|
/** 是否渲染成角标并指定方位,true 时为右上角 */
|
|
12
15
|
corner?: boolean | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
13
16
|
/**
|
|
14
17
|
* 角标形态(`corner` 生效时才起作用):
|
|
15
18
|
* `badge` 贴边小标签(默认);`ribbon` 斜跨在角上的绶带(45° 文字,如卡片右上角的「委托任务」)。
|
|
16
|
-
* 绶带与角点留有间距、文案建议 ≤4
|
|
17
|
-
* `--zl-corner-tag-ribbon-size` / `--zl-corner-tag-ribbon-gap
|
|
19
|
+
* 绶带与角点留有间距、文案建议 ≤4 个字;梯形高度用 `ribbon-height` 透传(带内字号跟着高度等比缩放),
|
|
20
|
+
* 尺寸/留白仍走 CSS 变量 `--zl-corner-tag-ribbon-size` / `--zl-corner-tag-ribbon-gap`。
|
|
18
21
|
*/
|
|
19
22
|
variant?: 'badge' | 'ribbon';
|
|
20
23
|
/**
|
|
@@ -32,8 +35,14 @@ type __VLS_Props = {
|
|
|
32
35
|
* @deprecated 用 `iconVisible`:全库显隐统一用 visible 语义,且不要用反向命名
|
|
33
36
|
*/
|
|
34
37
|
hideIcon?: boolean;
|
|
38
|
+
/** 是否使用填充背景(配合字典项 `color`/`type` 显示浅色底色,如 `--zl-<色>-1`),透传给内部 ZlTag */
|
|
39
|
+
fill?: boolean;
|
|
40
|
+
/** 是否使用全圆角样式,透传给内部 ZlTag */
|
|
41
|
+
rounded?: boolean;
|
|
35
42
|
};
|
|
36
43
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
44
|
+
fill: boolean;
|
|
45
|
+
rounded: boolean;
|
|
37
46
|
variant: "badge" | "ribbon";
|
|
38
47
|
corner: boolean | "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
39
48
|
iconVisible: boolean;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as g, watch as
|
|
2
|
-
import { useDict as
|
|
3
|
-
import
|
|
1
|
+
import { defineComponent as g, watch as B, computed as n, openBlock as c, createBlock as d, mergeProps as u, withCtx as s, createTextVNode as f, toDisplayString as v } from "vue";
|
|
2
|
+
import { useDict as h, useDictStore as b } from "@zl-ui-kit/composables";
|
|
3
|
+
import S from "../ZlTag/ZlCornerTag.vue.mjs";
|
|
4
4
|
import '../ZlTag/index.css';import '../ZlTag/ZlCornerTag.css';/* empty css */
|
|
5
|
-
import
|
|
5
|
+
import k from "../ZlTag/index.vue.mjs";
|
|
6
6
|
/* empty css */
|
|
7
|
-
const
|
|
7
|
+
const K = /* @__PURE__ */ g({
|
|
8
8
|
name: "ZlDictTag",
|
|
9
9
|
__name: "index",
|
|
10
10
|
props: {
|
|
@@ -15,56 +15,61 @@ const I = /* @__PURE__ */ g({
|
|
|
15
15
|
value: {},
|
|
16
16
|
simple: { type: Boolean },
|
|
17
17
|
iconVisible: { type: Boolean, default: void 0 },
|
|
18
|
-
hideIcon: { type: Boolean, default: void 0 }
|
|
18
|
+
hideIcon: { type: Boolean, default: void 0 },
|
|
19
|
+
fill: { type: Boolean, default: !1 },
|
|
20
|
+
rounded: { type: Boolean, default: !1 }
|
|
19
21
|
},
|
|
20
|
-
setup(
|
|
21
|
-
const t =
|
|
22
|
-
|
|
22
|
+
setup(a) {
|
|
23
|
+
const t = a, p = h(t.dictKey, { data: t.dict });
|
|
24
|
+
B(
|
|
23
25
|
() => t.dict,
|
|
24
26
|
(e) => {
|
|
25
27
|
if (e?.length) {
|
|
26
|
-
const { dictStore: o } =
|
|
28
|
+
const { dictStore: o } = b();
|
|
27
29
|
o.value = { ...o.value, [t.dictKey]: e };
|
|
28
30
|
}
|
|
29
31
|
},
|
|
30
32
|
{ deep: !1 }
|
|
31
33
|
);
|
|
32
|
-
const
|
|
34
|
+
const i = n(() => p.value.find((e) => e.value === t.value)), m = { info: "gray" };
|
|
33
35
|
function y(e) {
|
|
34
36
|
const o = e.color ?? e.type;
|
|
35
37
|
if (o)
|
|
36
38
|
return m[o] ?? o;
|
|
37
39
|
}
|
|
38
|
-
const
|
|
39
|
-
const e =
|
|
40
|
+
const l = n(() => {
|
|
41
|
+
const e = i.value;
|
|
40
42
|
return e ? {
|
|
41
43
|
color: t.simple ? void 0 : y(e),
|
|
42
44
|
icon: t.iconVisible ?? !t.hideIcon ? e.icon : void 0
|
|
43
45
|
} : {};
|
|
44
|
-
}),
|
|
45
|
-
return (e, o) =>
|
|
46
|
+
}), r = n(() => t.corner === !0 ? "top-right" : t.corner);
|
|
47
|
+
return (e, o) => r.value ? (c(), d(S, u({
|
|
46
48
|
key: 0,
|
|
47
49
|
class: "zl-dict-corner-tag"
|
|
48
|
-
}, { ...
|
|
49
|
-
position:
|
|
50
|
-
variant:
|
|
50
|
+
}, { ...l.value, ...e.$attrs }, {
|
|
51
|
+
position: r.value,
|
|
52
|
+
variant: a.variant
|
|
51
53
|
}), {
|
|
52
|
-
default:
|
|
53
|
-
v(
|
|
54
|
+
default: s(() => [
|
|
55
|
+
f(v(i.value?.label || a.value), 1)
|
|
54
56
|
]),
|
|
55
57
|
_: 1
|
|
56
|
-
}, 16, ["position", "variant"])) : (
|
|
58
|
+
}, 16, ["position", "variant"])) : (c(), d(k, u({
|
|
57
59
|
key: 1,
|
|
58
60
|
class: "zl-dict-tag"
|
|
59
|
-
}, { ...
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
}, { ...l.value, ...e.$attrs }, {
|
|
62
|
+
fill: a.fill,
|
|
63
|
+
rounded: a.rounded
|
|
64
|
+
}), {
|
|
65
|
+
default: s(() => [
|
|
66
|
+
f(v(i.value?.label || a.value), 1)
|
|
62
67
|
]),
|
|
63
68
|
_: 1
|
|
64
|
-
}, 16));
|
|
69
|
+
}, 16, ["fill", "rounded"]));
|
|
65
70
|
}
|
|
66
71
|
});
|
|
67
72
|
export {
|
|
68
|
-
|
|
73
|
+
K as default
|
|
69
74
|
};
|
|
70
75
|
//# sourceMappingURL=index.vue.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.zl-drawer__body{width:100%;min-height:100%}
|
|
1
|
+
.zl-drawer__body{width:100%;min-height:100%}.zl-drawer--no-footer .el-drawer__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;
|
|
@@ -1,83 +1,87 @@
|
|
|
1
|
-
import { defineComponent as B, useModel as
|
|
2
|
-
import { useZlT as
|
|
3
|
-
|
|
1
|
+
import { defineComponent as B, useModel as V, ref as h, computed as u, useAttrs as A, resolveComponent as D, resolveDirective as x, openBlock as d, createBlock as f, mergeProps as _, withCtx as a, withDirectives as $, createElementBlock as M, renderSlot as m, createTextVNode as v, toDisplayString as y, unref as N, createCommentVNode as T, createVNode as Z, mergeModels as O } from "vue";
|
|
2
|
+
import { useZlT as S } from "@zl-ui-kit/composables";
|
|
3
|
+
import w from "../ZlButton/index.vue.mjs";
|
|
4
|
+
const E = { class: "zl-drawer__body" }, j = /* @__PURE__ */ B({
|
|
4
5
|
name: "ZlDrawer",
|
|
5
6
|
inheritAttrs: !1,
|
|
6
7
|
__name: "index",
|
|
7
|
-
props: /* @__PURE__ */
|
|
8
|
+
props: /* @__PURE__ */ O({
|
|
8
9
|
onCancel: {},
|
|
9
10
|
onOk: {},
|
|
10
11
|
autoCloseAfterConfirm: { type: Boolean, default: !0 },
|
|
11
12
|
readonly: { type: Boolean },
|
|
12
|
-
loading: { type: Boolean }
|
|
13
|
+
loading: { type: Boolean },
|
|
14
|
+
footerVisible: { type: Boolean, default: !0 }
|
|
13
15
|
}, {
|
|
14
16
|
visible: { type: Boolean, default: !1 },
|
|
15
17
|
visibleModifiers: {}
|
|
16
18
|
}),
|
|
17
19
|
emits: ["update:visible"],
|
|
18
|
-
setup(
|
|
19
|
-
const { t:
|
|
20
|
+
setup(o) {
|
|
21
|
+
const { t: n } = S(), l = o, r = V(o, "visible");
|
|
20
22
|
async function s() {
|
|
21
|
-
|
|
23
|
+
l.onCancel && !await l.onCancel() || (r.value = !1);
|
|
22
24
|
}
|
|
23
25
|
const i = h(!1);
|
|
24
|
-
async function
|
|
26
|
+
async function C() {
|
|
25
27
|
i.value = !0;
|
|
26
28
|
try {
|
|
27
|
-
|
|
29
|
+
await l.onOk?.(), l.autoCloseAfterConfirm && (r.value = !1);
|
|
28
30
|
} catch (e) {
|
|
29
31
|
console.error("[ZlDrawer] handleConfirm: ", e);
|
|
30
32
|
} finally {
|
|
31
33
|
i.value = !1;
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
|
-
const
|
|
35
|
-
const { width: e, ...t } =
|
|
36
|
-
return { size: 600, ...e !== void 0 ? { size: e } : {},
|
|
36
|
+
const p = u(() => l.readonly ? n("zl.drawer.close", "关闭") : n("zl.drawer.confirm", "确定")), g = A(), k = u(() => {
|
|
37
|
+
const { width: e, ...t } = g;
|
|
38
|
+
return { size: 600, ...e !== void 0 ? { size: e } : {}, "destroy-on-close": !0, ...t };
|
|
37
39
|
});
|
|
38
40
|
return (e, t) => {
|
|
39
|
-
const
|
|
40
|
-
return d(),
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
const b = D("el-drawer"), z = x("loading");
|
|
42
|
+
return d(), f(b, _({
|
|
43
|
+
class: ["zl-drawer", { "zl-drawer--no-footer": !o.footerVisible }]
|
|
44
|
+
}, k.value, {
|
|
45
|
+
modelValue: r.value,
|
|
46
|
+
"onUpdate:modelValue": t[1] || (t[1] = (c) => r.value = c),
|
|
43
47
|
"before-close": s
|
|
44
48
|
}), {
|
|
45
|
-
footer:
|
|
46
|
-
|
|
47
|
-
|
|
49
|
+
footer: a(() => [
|
|
50
|
+
m(e.$slots, "footer", {}, () => [
|
|
51
|
+
o.readonly ? T("", !0) : (d(), f(w, {
|
|
48
52
|
key: 0,
|
|
49
53
|
onClick: s
|
|
50
54
|
}, {
|
|
51
|
-
default:
|
|
52
|
-
|
|
55
|
+
default: a(() => [
|
|
56
|
+
v(y(N(n)("zl.drawer.cancel", "取消")), 1)
|
|
53
57
|
]),
|
|
54
58
|
_: 1
|
|
55
59
|
})),
|
|
56
|
-
|
|
60
|
+
Z(w, {
|
|
57
61
|
type: "primary",
|
|
58
62
|
loading: i.value,
|
|
59
|
-
onClick: t[0] || (t[0] = (c) =>
|
|
63
|
+
onClick: t[0] || (t[0] = (c) => o.readonly ? s() : C())
|
|
60
64
|
}, {
|
|
61
|
-
default:
|
|
62
|
-
|
|
65
|
+
default: a(() => [
|
|
66
|
+
v(y(p.value), 1)
|
|
63
67
|
]),
|
|
64
68
|
_: 1
|
|
65
69
|
}, 8, ["loading"])
|
|
66
70
|
])
|
|
67
71
|
]),
|
|
68
|
-
default:
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
default: a(() => [
|
|
73
|
+
$((d(), M("div", E, [
|
|
74
|
+
m(e.$slots, "default")
|
|
71
75
|
])), [
|
|
72
|
-
[z,
|
|
76
|
+
[z, o.loading]
|
|
73
77
|
])
|
|
74
78
|
]),
|
|
75
79
|
_: 3
|
|
76
|
-
}, 16, ["modelValue"]);
|
|
80
|
+
}, 16, ["class", "modelValue"]);
|
|
77
81
|
};
|
|
78
82
|
}
|
|
79
83
|
});
|
|
80
84
|
export {
|
|
81
|
-
|
|
85
|
+
j as default
|
|
82
86
|
};
|
|
83
87
|
//# sourceMappingURL=index.vue.mjs.map
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { IComponent } from './types';
|
|
1
3
|
/**
|
|
2
4
|
* 动态组件渲染引擎(schema → VNode)
|
|
3
5
|
* schema 见 types.ts;组件名支持全局注册名或组件对象;默认 el-input
|
|
@@ -15,7 +17,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
15
17
|
};
|
|
16
18
|
/** 待渲染组件的 schema 描述,缺省渲染 el-input */
|
|
17
19
|
component: {
|
|
18
|
-
type:
|
|
20
|
+
type: PropType<IComponent>;
|
|
19
21
|
default: () => {
|
|
20
22
|
component: string;
|
|
21
23
|
};
|
|
@@ -40,7 +42,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
40
42
|
};
|
|
41
43
|
/** 待渲染组件的 schema 描述,缺省渲染 el-input */
|
|
42
44
|
component: {
|
|
43
|
-
type:
|
|
45
|
+
type: PropType<IComponent>;
|
|
44
46
|
default: () => {
|
|
45
47
|
component: string;
|
|
46
48
|
};
|
|
@@ -49,7 +51,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
49
51
|
onInput?: ((_value: any, ..._values: any[]) => any) | undefined;
|
|
50
52
|
"onUpdate:modelValue"?: ((_value: any) => any) | undefined;
|
|
51
53
|
}>, {
|
|
52
|
-
component:
|
|
54
|
+
component: IComponent;
|
|
53
55
|
model: Record<string, any>;
|
|
54
56
|
value: string | number | boolean | unknown[];
|
|
55
57
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
@charset "UTF-8";.zl-form-item-label{display:inline-flex;align-items:center;gap:2px}.zl-form-item-label__tooltip{color:var(--zl-text-3, var(--el-text-color-secondary))}.zl-form-item--no-label .el-form-item__label{display:none}
|
|
@@ -4,6 +4,11 @@ type __VLS_Props = {
|
|
|
4
4
|
items: FormItem[];
|
|
5
5
|
/** 表单值对象,不传时由组件内部自建 */
|
|
6
6
|
model?: Record<string, any>;
|
|
7
|
+
/**
|
|
8
|
+
* 表单项 `label` 为空字符串/缺省时不渲染 label 占位(控件直接顶到最左)。
|
|
9
|
+
* 默认 false:即使 label 为空,EP 也会因 #label 插槽存在而保留 label 列占位
|
|
10
|
+
*/
|
|
11
|
+
hideEmptyLabel?: boolean;
|
|
7
12
|
};
|
|
8
13
|
/** el-form 的校验回调:第一个参数为是否通过,失败时第二个参数为错误字段集合 */
|
|
9
14
|
type ValidateCallback = (isValid: boolean, invalidFields?: Record<string, any>) => void;
|
|
@@ -32,6 +37,7 @@ declare function __VLS_template(): {
|
|
|
32
37
|
slot?: boolean;
|
|
33
38
|
slots?: Record<string, any>;
|
|
34
39
|
props: Record<string, any>;
|
|
40
|
+
hideLabel?: boolean;
|
|
35
41
|
};
|
|
36
42
|
}) => any>> & {
|
|
37
43
|
label?(_: {
|
|
@@ -45,6 +51,7 @@ declare function __VLS_template(): {
|
|
|
45
51
|
slot?: boolean;
|
|
46
52
|
slots?: Record<string, any>;
|
|
47
53
|
props: Record<string, any>;
|
|
54
|
+
hideLabel?: boolean;
|
|
48
55
|
};
|
|
49
56
|
}): any;
|
|
50
57
|
default?(_: {}): any;
|