@zl-ui-kit/components 0.26.1 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/README.md +22 -18
  2. package/dist/components/ZlAction/List.vue.mjs +46 -49
  3. package/dist/components/ZlAction/index.vue.d.ts +1 -7
  4. package/dist/components/ZlAction/index.vue.mjs +8 -12
  5. package/dist/components/ZlAction/types.d.ts +2 -5
  6. package/dist/components/ZlAppLayout/Horizontal.css +1 -1
  7. package/dist/components/ZlAppLayout/Vertical.css +1 -1
  8. package/dist/components/ZlAppLayout/Vertical2.vue.mjs +41 -39
  9. package/dist/components/ZlAppLayout/index.vue.d.ts +6 -6
  10. package/dist/components/ZlAppLayout/index.vue.mjs +8 -8
  11. package/dist/components/ZlAppMenu/AppMenu.css +1 -0
  12. package/dist/components/ZlAppMenu/AppMenu.vue.d.ts +27 -0
  13. package/dist/components/ZlAppMenu/AppMenu.vue.mjs +37 -0
  14. package/dist/components/ZlAppMenu/AppMenu3.vue.mjs +6 -0
  15. package/dist/components/ZlAppMenu/AppMenuItem.vue.d.ts +11 -0
  16. package/dist/components/ZlAppMenu/AppMenuItem.vue.mjs +58 -0
  17. package/dist/components/ZlAppMenu/AppMenuItem2.vue.mjs +5 -0
  18. package/dist/components/ZlAppSlogan/index.css +1 -1
  19. package/dist/components/ZlAppSlogan/index.vue.d.ts +1 -1
  20. package/dist/components/ZlAppSlogan/index.vue.mjs +12 -19
  21. package/dist/components/ZlCardPage/index.vue.d.ts +3 -41
  22. package/dist/components/ZlCardPage/index.vue.mjs +68 -68
  23. package/dist/components/ZlCheckboxTag/index.css +1 -1
  24. package/dist/components/ZlCheckboxTag/index.vue.d.ts +4 -4
  25. package/dist/components/ZlCheckboxTag/index.vue.mjs +30 -34
  26. package/dist/components/ZlCopy/copy.mjs +7 -17
  27. package/dist/components/ZlCopy/index.css +1 -1
  28. package/dist/components/ZlCopy/index.vue.mjs +2 -2
  29. package/dist/components/ZlCopy/index2.vue.mjs +36 -34
  30. package/dist/components/ZlDescription/index.css +1 -1
  31. package/dist/components/ZlDescription/index.vue.mjs +24 -28
  32. package/dist/components/ZlDialog/index.css +1 -1
  33. package/dist/components/ZlDialog/index.vue.d.ts +0 -3
  34. package/dist/components/ZlDialog/index.vue.mjs +35 -39
  35. package/dist/components/ZlDictTag/index.vue.d.ts +3 -12
  36. package/dist/components/ZlDictTag/index.vue.mjs +26 -31
  37. package/dist/components/ZlDrawer/index.css +1 -1
  38. package/dist/components/ZlDrawer/index.vue.d.ts +0 -3
  39. package/dist/components/ZlDrawer/index.vue.mjs +32 -36
  40. package/dist/components/ZlDynamicComponent/index.vue.d.ts +3 -5
  41. package/dist/components/ZlForm/index.css +1 -1
  42. package/dist/components/ZlForm/index.vue.d.ts +0 -7
  43. package/dist/components/ZlForm/index.vue.mjs +47 -50
  44. package/dist/components/ZlLayoutSwitch/index.css +1 -1
  45. package/dist/components/ZlLayoutSwitch/index.vue.d.ts +0 -10
  46. package/dist/components/ZlLayoutSwitch/index.vue.mjs +1 -1
  47. package/dist/components/ZlLayoutSwitch/index2.vue.mjs +19 -27
  48. package/dist/components/ZlLogin/components/LoginForm.css +1 -1
  49. package/dist/components/ZlLogin/components/LoginForm.vue.mjs +1 -1
  50. package/dist/components/ZlLogin/components/LoginForm2.vue.mjs +25 -26
  51. package/dist/components/ZlPageContainer/index.css +1 -1
  52. package/dist/components/ZlPageContainer/index.vue.mjs +1 -1
  53. package/dist/components/ZlPagination/index.css +1 -1
  54. package/dist/components/ZlPagination/index.vue.d.ts +1 -21
  55. package/dist/components/ZlPagination/index.vue.mjs +1 -1
  56. package/dist/components/ZlPagination/index2.vue.mjs +33 -59
  57. package/dist/components/ZlPagination/usePagination.d.ts +0 -1
  58. package/dist/components/ZlPagination/usePagination.mjs +34 -51
  59. package/dist/components/ZlPopconfirm/index.vue.mjs +24 -25
  60. package/dist/components/ZlSearch/index.vue.d.ts +0 -25
  61. package/dist/components/ZlSearch/index.vue.mjs +205 -202
  62. package/dist/components/ZlSearchTable/index.vue.d.ts +2 -40
  63. package/dist/components/ZlSearchTable/index.vue.mjs +55 -59
  64. package/dist/components/ZlTable/useTablePagination.d.ts +0 -1
  65. package/dist/components/ZlTable/useTablePagination.mjs +23 -37
  66. package/dist/components/ZlTabs/index.vue.d.ts +3 -16
  67. package/dist/components/ZlTag/ZlCornerTag.css +1 -1
  68. package/dist/components/ZlTag/ZlCornerTag.vue.d.ts +1 -14
  69. package/dist/components/ZlTag/ZlCornerTag.vue.mjs +14 -25
  70. package/dist/components/ZlTag/index.vue.mjs +4 -4
  71. package/dist/components/ZlUpload/index.css +1 -1
  72. package/dist/components/ZlUpload/index.vue.d.ts +3 -44
  73. package/dist/components/ZlUpload/index.vue.mjs +3 -3
  74. package/dist/components/ZlUpload/index2.vue.mjs +79 -119
  75. package/dist/index.d.ts +2 -8
  76. package/dist/index.mjs +169 -183
  77. package/dist/locales/en.mjs +2 -2
  78. package/dist/locales/zh-cn.mjs +3 -3
  79. package/package.json +6 -6
  80. package/dist/components/ZlAppLayout/HeaderAside.css +0 -1
  81. package/dist/components/ZlAppLayout/HeaderAside.vue.d.ts +0 -25
  82. package/dist/components/ZlAppLayout/HeaderAside.vue.mjs +0 -6
  83. package/dist/components/ZlAppLayout/HeaderAside2.vue.mjs +0 -65
  84. package/dist/components/ZlBreadcrumb/index.css +0 -1
  85. package/dist/components/ZlBreadcrumb/index.vue.d.ts +0 -32
  86. package/dist/components/ZlBreadcrumb/index.vue.mjs +0 -58
  87. package/dist/components/ZlBreadcrumb/index3.vue.mjs +0 -6
  88. package/dist/components/ZlBreadcrumb/types.d.ts +0 -16
  89. package/dist/components/ZlButton/index.vue.d.ts +0 -81
  90. package/dist/components/ZlButton/index.vue.mjs +0 -60
  91. package/dist/components/ZlButton/index2.vue.mjs +0 -5
  92. package/dist/components/ZlCardPage/resolvePagination.d.ts +0 -20
  93. package/dist/components/ZlCardPage/resolvePagination.mjs +0 -24
  94. package/dist/components/ZlDevMenu/index.css +0 -1
  95. package/dist/components/ZlDevMenu/index.vue.d.ts +0 -33
  96. package/dist/components/ZlDevMenu/index.vue.mjs +0 -110
  97. package/dist/components/ZlDevMenu/index3.vue.mjs +0 -6
  98. package/dist/components/ZlDevMenu/types.d.ts +0 -8
  99. package/dist/components/ZlLoading/index.css +0 -1
  100. package/dist/components/ZlLoading/index.vue.d.ts +0 -27
  101. package/dist/components/ZlLoading/index.vue.mjs +0 -8
  102. package/dist/components/ZlLoading/index2.vue.mjs +0 -30
  103. package/dist/components/ZlMenu/MenuIcon.d.ts +0 -17
  104. package/dist/components/ZlMenu/MenuIcon.mjs +0 -21
  105. package/dist/components/ZlMenu/ZlMenuItem.vue.d.ts +0 -7
  106. package/dist/components/ZlMenu/ZlMenuItem.vue.mjs +0 -53
  107. package/dist/components/ZlMenu/ZlMenuItem2.vue.mjs +0 -5
  108. package/dist/components/ZlMenu/index.css +0 -1
  109. package/dist/components/ZlMenu/index.vue.d.ts +0 -40
  110. package/dist/components/ZlMenu/index.vue.mjs +0 -60
  111. package/dist/components/ZlMenu/index3.vue.mjs +0 -6
  112. package/dist/components/ZlMenu/types.d.ts +0 -20
@@ -1,58 +0,0 @@
1
- import { defineComponent as k, useAttrs as C, resolveComponent as o, openBlock as c, createBlock as n, mergeProps as u, unref as h, withCtx as i, createElementBlock as g, Fragment as y, renderList as B, renderSlot as v, createElementVNode as z, normalizeClass as A, toDisplayString as L } from "vue";
2
- const E = ["onClick"], w = /* @__PURE__ */ k({
3
- name: "ZlBreadcrumb",
4
- inheritAttrs: !1,
5
- __name: "index",
6
- props: {
7
- items: { default: () => [] },
8
- separator: { default: "/" }
9
- },
10
- setup(a) {
11
- const m = a, b = C();
12
- function l(e) {
13
- return e === m.items.length - 1;
14
- }
15
- function d(e) {
16
- const t = { ...e };
17
- return delete t.label, delete t.click, delete t.key, t;
18
- }
19
- function f(e, t) {
20
- l(t) || e.click?.(e, t);
21
- }
22
- return (e, t) => {
23
- const p = o("el-breadcrumb-item"), _ = o("el-breadcrumb");
24
- return c(), n(_, u(h(b), {
25
- separator: a.separator,
26
- class: "zl-breadcrumb"
27
- }), {
28
- default: i(() => [
29
- (c(!0), g(y, null, B(a.items, (r, s) => (c(), n(p, u({
30
- key: r.key ?? s
31
- }, { ref_for: !0 }, d(r), {
32
- to: l(s) ? void 0 : r.to,
33
- class: { "is-current": l(s) }
34
- }), {
35
- default: i(() => [
36
- v(e.$slots, "item", {
37
- item: r,
38
- index: s,
39
- isLast: l(s)
40
- }, () => [
41
- z("span", {
42
- class: A(["zl-breadcrumb__text", { "is-clickable": !l(s) && !!r.click }]),
43
- onClick: (S) => f(r, s)
44
- }, L(r.label), 11, E)
45
- ])
46
- ]),
47
- _: 2
48
- }, 1040, ["to", "class"]))), 128))
49
- ]),
50
- _: 3
51
- }, 16, ["separator"]);
52
- };
53
- }
54
- });
55
- export {
56
- w as default
57
- };
58
- //# sourceMappingURL=index.vue.mjs.map
@@ -1,6 +0,0 @@
1
- import o from "./index.vue.mjs";
2
- import './index.css';/* empty css */
3
- export {
4
- o as default
5
- };
6
- //# sourceMappingURL=index3.vue.mjs.map
@@ -1,16 +0,0 @@
1
- /** 面包屑条目:除 `label` / `click` / `key` 外的字段原样透传给 `el-breadcrumb-item` */
2
- export interface BreadcrumbItem {
3
- /** 显示文本 */
4
- label: string;
5
- /** 路由目标(同 `el-breadcrumb-item` 的 to);最后一项忽略 */
6
- to?: string | Record<string, any>;
7
- /** 点击后替换当前历史记录(同 `el-breadcrumb-item` 的 replace) */
8
- replace?: boolean;
9
- /** 无 `to` 时的点击回调;最后一项不触发 */
10
- click?: (item: BreadcrumbItem, index: number) => void;
11
- /** `v-for` 的 key,缺省用索引 */
12
- key?: string | number;
13
- /** 其余属性透传给 `el-breadcrumb-item`(如 `separator` / `separator-icon`) */
14
- [key: string]: any;
15
- }
16
- //# sourceMappingURL=types.d.ts.map
@@ -1,81 +0,0 @@
1
- import { Component } from 'vue';
2
- type __VLS_Props = {
3
- /** 尺寸;不传时沿用 `el-form` / 全局配置 */
4
- size?: 'large' | 'default' | 'small';
5
- /** 是否禁用;不传时沿用 `el-form` 的 disabled */
6
- disabled?: boolean;
7
- /** 按钮类型 */
8
- type?: 'default' | 'primary' | 'success' | 'warning' | 'info' | 'danger' | 'text';
9
- /** 图标(同 el-button 的 icon,支持组件或已注册的组件名) */
10
- icon?: string | Component;
11
- /** 原生 type 属性 */
12
- nativeType?: 'button' | 'submit' | 'reset';
13
- /** 是否加载中 */
14
- loading?: boolean;
15
- /** 自定义加载图标 */
16
- loadingIcon?: string | Component;
17
- /** 是否为朴素按钮 */
18
- plain?: boolean;
19
- /** 是否为文字按钮 */
20
- text?: boolean;
21
- /** 是否为链接按钮 */
22
- link?: boolean;
23
- /** 文字按钮是否始终显示背景 */
24
- bg?: boolean;
25
- /** 是否自动聚焦 */
26
- autofocus?: boolean;
27
- /** 是否为圆角按钮(胶囊形);默认开启,传 false 走 EP 默认 4px 圆角 */
28
- round?: boolean;
29
- /** 是否为圆形按钮 */
30
- circle?: boolean;
31
- /** 是否为虚线按钮 */
32
- dashed?: boolean;
33
- /** 自定义颜色(自动计算 hover / active) */
34
- color?: string;
35
- /** 自定义颜色是否走暗色模式 */
36
- dark?: boolean;
37
- /** 两个汉字之间是否自动插入空格 */
38
- autoInsertSpace?: boolean;
39
- /** 自定义渲染标签,默认 `button` */
40
- tag?: string | Record<string, any>;
41
- };
42
- declare function __VLS_template(): {
43
- attrs: Partial<{}>;
44
- slots: {
45
- icon?(_: {}): any;
46
- loading?(_: {}): any;
47
- default?(_: {}): any;
48
- };
49
- refs: {};
50
- rootEl: any;
51
- };
52
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
53
- declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
54
- icon: string | Component;
55
- size: "large" | "default" | "small";
56
- color: string;
57
- link: boolean;
58
- circle: boolean;
59
- text: boolean;
60
- round: boolean;
61
- dashed: boolean;
62
- dark: boolean;
63
- disabled: boolean;
64
- type: "default" | "primary" | "success" | "warning" | "info" | "danger" | "text";
65
- nativeType: "button" | "submit" | "reset";
66
- loading: boolean;
67
- loadingIcon: string | Component;
68
- plain: boolean;
69
- bg: boolean;
70
- autofocus: boolean;
71
- autoInsertSpace: boolean;
72
- tag: string | Record<string, any>;
73
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
74
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
75
- export default _default;
76
- type __VLS_WithTemplateSlots<T, S> = T & {
77
- new (): {
78
- $slots: S;
79
- };
80
- };
81
- //# sourceMappingURL=index.vue.d.ts.map
@@ -1,60 +0,0 @@
1
- import { defineComponent as u, useAttrs as f, computed as p, mergeProps as a, resolveComponent as r, openBlock as v, createBlock as c, createSlots as y, withCtx as o, renderSlot as t } from "vue";
2
- const g = /* @__PURE__ */ u({
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: !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 d = l, n = f(), i = p(() => a(n, d));
29
- return (e, B) => {
30
- const s = r("el-button");
31
- return v(), c(s, a(i.value, { class: "zl-button" }), y({ _: 2 }, [
32
- e.$slots.icon ? {
33
- name: "icon",
34
- fn: o(() => [
35
- t(e.$slots, "icon")
36
- ]),
37
- key: "0"
38
- } : void 0,
39
- e.$slots.loading ? {
40
- name: "loading",
41
- fn: o(() => [
42
- t(e.$slots, "loading")
43
- ]),
44
- key: "1"
45
- } : void 0,
46
- e.$slots.default ? {
47
- name: "default",
48
- fn: o(() => [
49
- t(e.$slots, "default")
50
- ]),
51
- key: "2"
52
- } : void 0
53
- ]), 1040);
54
- };
55
- }
56
- });
57
- export {
58
- g as default
59
- };
60
- //# sourceMappingURL=index.vue.mjs.map
@@ -1,5 +0,0 @@
1
- import f from "./index.vue.mjs";
2
- export {
3
- f as default
4
- };
5
- //# sourceMappingURL=index2.vue.mjs.map
@@ -1,20 +0,0 @@
1
- /**
2
- * ZlCardPage 的分页数据源解析(纯函数,便于回归测试)。
3
- *
4
- * 无论接口返回行数组还是分页对象,结果里都必须带上「本次请求的目标页码」:
5
- * 下发的 `currentPage` 只有会随查询 / 重置变化,ZlPagination 的监听才会触发。
6
- * 否则数组响应(或接口不回传 pageNum)时 currentPage 恒为 1,在第 N 页点重置
7
- * 就会出现「数据已回第 1 页、分页器仍停在第 N 页」。
8
- */
9
- export interface CardPageState {
10
- /** 本次请求的目标页码,由 `search()` 写入;`refresh()` 不改(原地重查保持页码) */
11
- pageNum: number;
12
- /** 本次请求的目标页容量 */
13
- pageSize?: number;
14
- }
15
- export declare function resolveCardPagePagination(options: {
16
- data: any;
17
- pagination: Record<string, any> | boolean | undefined;
18
- pageState: CardPageState;
19
- }): Record<string, any> | false;
20
- //# sourceMappingURL=resolvePagination.d.ts.map
@@ -1,24 +0,0 @@
1
- import { isArray as p } from "@zl-ui-kit/utils";
2
- function f(o) {
3
- const { data: a, pagination: t, pageState: g } = o;
4
- if (t === !1) return !1;
5
- const e = (t === !0 ? {} : t) ?? {}, { pageNum: i, pageSize: r } = g;
6
- if (p(a))
7
- return {
8
- ...e,
9
- pageNum: i,
10
- pageSize: r ?? e.pageSize ?? 30,
11
- total: a.length
12
- };
13
- const n = a ?? {};
14
- return {
15
- ...e,
16
- pageNum: i,
17
- pageSize: r ?? n.pageSize ?? e.pageSize ?? 30,
18
- total: n.total ?? 0
19
- };
20
- }
21
- export {
22
- f as resolveCardPagePagination
23
- };
24
- //# sourceMappingURL=resolvePagination.mjs.map
@@ -1 +0,0 @@
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}
@@ -1,33 +0,0 @@
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
@@ -1,110 +0,0 @@
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,6 +0,0 @@
1
- import o from "./index.vue.mjs";
2
- import './index.css';/* empty css */
3
- export {
4
- o as default
5
- };
6
- //# sourceMappingURL=index3.vue.mjs.map
@@ -1,8 +0,0 @@
1
- /** 开发菜单路由项 */
2
- export interface DevMenuRoute {
3
- /** 显示文本,默认取路由的 `meta.title`,无则用 `path` */
4
- label: string;
5
- /** 跳转路径 */
6
- path: string;
7
- }
8
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- .zl-loading[data-v-bd5f8439]{width:100%;height:100%;flex:1;min-width:1px;min-height:1px}
@@ -1,27 +0,0 @@
1
- type __VLS_Props = {
2
- /** 是否处于加载中 */
3
- loading?: boolean;
4
- /** 是否首屏就渲染内容(默认等首次 loading 结束后再挂载) */
5
- forceRender?: boolean;
6
- };
7
- declare function __VLS_template(): {
8
- attrs: Partial<{}>;
9
- slots: {
10
- default?(_: {}): any;
11
- };
12
- refs: {};
13
- rootEl: HTMLDivElement;
14
- };
15
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
- declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
17
- loading: boolean;
18
- forceRender: boolean;
19
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
20
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
21
- export default _default;
22
- type __VLS_WithTemplateSlots<T, S> = T & {
23
- new (): {
24
- $slots: S;
25
- };
26
- };
27
- //# sourceMappingURL=index.vue.d.ts.map
@@ -1,8 +0,0 @@
1
- import o from "./index2.vue.mjs";
2
- import './index.css';/* empty css */
3
- import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-bd5f8439"]]);
5
- export {
6
- m as default
7
- };
8
- //# sourceMappingURL=index.vue.mjs.map
@@ -1,30 +0,0 @@
1
- import { defineComponent as r, ref as l, watch as d, resolveDirective as i, withDirectives as c, openBlock as s, createElementBlock as f, renderSlot as u, createCommentVNode as m } from "vue";
2
- const p = { class: "zl-loading" }, _ = /* @__PURE__ */ r({
3
- name: "ZlLoading",
4
- __name: "index",
5
- props: {
6
- loading: { type: Boolean, default: !1 },
7
- forceRender: { type: Boolean, default: !1 }
8
- },
9
- setup(o) {
10
- const t = o, n = l(t.forceRender);
11
- return d(
12
- () => t.loading,
13
- (e) => {
14
- e || (n.value = !0);
15
- },
16
- { immediate: !0 }
17
- ), (e, v) => {
18
- const a = i("loading");
19
- return c((s(), f("div", p, [
20
- n.value ? u(e.$slots, "default", {}, void 0, !0, 0) : m("", !0)
21
- ])), [
22
- [a, o.loading]
23
- ]);
24
- };
25
- }
26
- });
27
- export {
28
- _ as default
29
- };
30
- //# sourceMappingURL=index2.vue.mjs.map
@@ -1,17 +0,0 @@
1
- import { Component, PropType, VNode } from 'vue';
2
- /** 内部渲染器:统一处理字符串图标 / 组件 / VNode 三种形态 */
3
- declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
4
- icon: {
5
- type: PropType<string | Component | VNode>;
6
- required: true;
7
- };
8
- }>, () => VNode<import('vue').RendererNode, import('vue').RendererElement, {
9
- [key: string]: any;
10
- }>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
11
- icon: {
12
- type: PropType<string | Component | VNode>;
13
- required: true;
14
- };
15
- }>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
16
- export default _default;
17
- //# sourceMappingURL=MenuIcon.d.ts.map
@@ -1,21 +0,0 @@
1
- import { defineComponent as t, h as e, isVNode as o } from "vue";
2
- import i from "../ZlIcon/index.vue.mjs";
3
- const p = t({
4
- name: "ZlMenuIcon",
5
- props: {
6
- icon: {
7
- type: [String, Object, Function],
8
- required: !0
9
- }
10
- },
11
- setup(r) {
12
- return () => {
13
- const { icon: n } = r;
14
- return typeof n == "string" ? e(i, { icon: n }) : o(n) ? n : e(n);
15
- };
16
- }
17
- });
18
- export {
19
- p as default
20
- };
21
- //# sourceMappingURL=MenuIcon.mjs.map
@@ -1,7 +0,0 @@
1
- import { MenuOption } from './types';
2
- type __VLS_Props = {
3
- item: MenuOption;
4
- };
5
- declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
6
- export default _default;
7
- //# sourceMappingURL=ZlMenuItem.vue.d.ts.map
@@ -1,53 +0,0 @@
1
- import { defineComponent as b, resolveComponent as l, openBlock as t, createBlock as n, withCtx as i, createElementBlock as s, Fragment as y, renderList as f, unref as c, createCommentVNode as o, createElementVNode as x, toDisplayString as u, createTextVNode as I } from "vue";
2
- import d from "./MenuIcon.mjs";
3
- const g = /* @__PURE__ */ b({
4
- name: "ZlMenuItem",
5
- __name: "ZlMenuItem",
6
- props: {
7
- item: {}
8
- },
9
- setup(e) {
10
- return (M, h) => {
11
- const a = l("ZlMenuItem", !0), r = l("el-sub-menu"), k = l("el-menu-item");
12
- return e.item.children?.length ? (t(), n(r, {
13
- key: 0,
14
- index: e.item.key,
15
- disabled: e.item.disabled
16
- }, {
17
- title: i(() => [
18
- e.item.icon ? (t(), n(c(d), {
19
- key: 0,
20
- icon: e.item.icon
21
- }, null, 8, ["icon"])) : o("", !0),
22
- x("span", null, u(e.item.label), 1)
23
- ]),
24
- default: i(() => [
25
- (t(!0), s(y, null, f(e.item.children, (m) => (t(), n(a, {
26
- key: m.key,
27
- item: m
28
- }, null, 8, ["item"]))), 128))
29
- ]),
30
- _: 1
31
- }, 8, ["index", "disabled"])) : (t(), n(k, {
32
- key: 1,
33
- index: e.item.key,
34
- disabled: e.item.disabled
35
- }, {
36
- title: i(() => [
37
- I(u(e.item.label), 1)
38
- ]),
39
- default: i(() => [
40
- e.item.icon ? (t(), n(c(d), {
41
- key: 0,
42
- icon: e.item.icon
43
- }, null, 8, ["icon"])) : o("", !0)
44
- ]),
45
- _: 1
46
- }, 8, ["index", "disabled"]));
47
- };
48
- }
49
- });
50
- export {
51
- g as default
52
- };
53
- //# sourceMappingURL=ZlMenuItem.vue.mjs.map
@@ -1,5 +0,0 @@
1
- import f from "./ZlMenuItem.vue.mjs";
2
- export {
3
- f as default
4
- };
5
- //# sourceMappingURL=ZlMenuItem2.vue.mjs.map
@@ -1 +0,0 @@
1
- @charset "UTF-8";.zl-menu.el-menu{--el-menu-bg-color: transparent;--el-menu-text-color: var(--zl-menu-text-color, var(--zl-text-2));--el-menu-active-color: var(--zl-menu-active-color, var(--zl-menu-text-color, var(--zl-text-2)));--el-menu-hover-bg-color: var(--zl-menu-hover-bg, var(--zl-fill-2));border-right:none;background-color:transparent}.zl-menu.el-menu .el-menu-item,.zl-menu.el-menu .el-sub-menu__title{position:relative}.zl-menu.el-menu .el-menu-item .zl-icon,.zl-menu.el-menu .el-sub-menu__title .zl-icon{color:var(--zl-menu-icon-color, currentColor)}.zl-menu.el-menu .el-menu-item.is-active{background-color:var(--zl-menu-active-bg, var(--zl-menu-hover-bg, var(--zl-fill-2)))}.zl-menu.el-menu .el-menu-item.is-active .zl-icon{color:var(--el-menu-active-color)}.zl-menu.el-menu:not(.el-menu--horizontal) .el-menu-item.is-active:after{content:"";position:absolute;top:0;right:0;bottom:0;width:3px;background-color:var(--zl-menu-active-border-color, transparent)}.zl-menu.el-menu:not(.el-menu--horizontal){font-size:var(--zl-menu-font-size, 12px)}.zl-menu.el-menu:not(.el-menu--horizontal) .el-menu-item,.zl-menu.el-menu:not(.el-menu--horizontal) .el-sub-menu__title{height:var(--zl-menu-item-height, 36px);line-height:var(--zl-menu-item-height, 36px)}.zl-menu.el-menu.el-menu--horizontal .el-menu-item,.zl-menu.el-menu.el-menu--horizontal .el-sub-menu__title{height:44px;line-height:44px}