@keyblade/pro-components 1.4.6 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components.d.ts +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +19 -19
- package/es/pro-keep-alive-router-view/index.d.ts +1 -1
- package/es/pro-layout/hooks.d.ts +1 -1
- package/es/pro-layout/hooks.js +1 -1
- package/es/pro-layout/index.d.ts +31 -13
- package/es/pro-layout/pro-layout.vue.d.ts +36 -15
- package/es/pro-layout/pro-layout.vue.js +127 -115
- package/es/pro-menu/index.d.ts +24 -4
- package/es/pro-menu/index.js +7 -6
- package/es/pro-menu/pro-menu.vue.d.ts +13 -1
- package/es/pro-menu/pro-menu.vue.js +99 -34
- package/es/pro-menu/pro-menu.vue2.js +2 -2
- package/es/pro-menu/pro-menu.vue3.js +5 -0
- package/es/pro-page-container/index.d.ts +82 -109
- package/es/pro-page-container/index.js +7 -7
- package/es/pro-page-container/pro-page-container.vue.d.ts +49 -79
- package/es/pro-page-container/pro-page-container.vue.js +32 -51
- package/es/{pro-breadcrumb → pro-page-header}/index.d.ts +55 -55
- package/es/pro-page-header/index.js +13 -0
- package/es/{pro-breadcrumb/pro-breadcrumb.vue.d.ts → pro-page-header/pro-page-header.vue.d.ts} +41 -41
- package/es/pro-page-header/pro-page-header.vue.js +125 -0
- package/es/pro-page-header/pro-page-header.vue3.js +5 -0
- package/es/pro-reuse-tabs/index.d.ts +1 -1
- package/es/style.css +1 -1
- package/package.json +3 -2
- package/src/index.ts +3 -3
- package/es/pro-breadcrumb/index.js +0 -13
- package/es/pro-breadcrumb/pro-breadcrumb.vue.js +0 -102
- package/es/pro-breadcrumb/pro-breadcrumb.vue3.js +0 -5
- package/es/pro-menu/pro-menu-item.vue.d.ts +0 -14
- package/es/pro-menu/pro-menu-item.vue.js +0 -88
- package/es/pro-menu/pro-menu-item.vue2.js +0 -4
- package/es/pro-menu/pro-menu-item.vue3.js +0 -5
- /package/es/{pro-breadcrumb/pro-breadcrumb.vue2.js → pro-page-header/pro-page-header.vue2.js} +0 -0
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { defineComponent as U, useCssVars as X, toRefs as Y, useSlots as Z, provide as
|
|
1
|
+
import { defineComponent as U, useCssVars as X, toRefs as Y, useSlots as Z, provide as S, ref as ee, watch as w, resolveComponent as o, openBlock as a, createBlock as i, normalizeClass as l, withCtx as s, createVNode as c, createElementVNode as p, unref as n, renderSlot as m, createElementBlock as h, Fragment as b, createTextVNode as g, toDisplayString as v, createCommentVNode as u } from "vue";
|
|
2
2
|
import { useHooks as te } from "./hooks.js";
|
|
3
3
|
const le = ["src"], oe = ["src"], e = "keyblade-pro-layout", ae = 48, re = /* @__PURE__ */ U({
|
|
4
4
|
__name: "pro-layout",
|
|
5
5
|
props: {
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* 布局模式
|
|
8
|
+
* side:侧边菜单布局
|
|
9
|
+
* mix:混合菜单布局
|
|
10
|
+
* */
|
|
7
11
|
layout: {
|
|
8
12
|
type: String,
|
|
9
13
|
required: !1,
|
|
@@ -15,17 +19,17 @@ const le = ["src"], oe = ["src"], e = "keyblade-pro-layout", ae = 48, re = /* @_
|
|
|
15
19
|
required: !1,
|
|
16
20
|
default: 60
|
|
17
21
|
},
|
|
18
|
-
/**
|
|
19
|
-
|
|
22
|
+
/** logo */
|
|
23
|
+
logo: {
|
|
20
24
|
type: String,
|
|
21
25
|
required: !1,
|
|
22
|
-
default: "
|
|
26
|
+
default: "http://p3-armor.byteimg.com/tos-cn-i-49unhts6dw/dfdba5317c0c20ce20e64fac803d52bc.svg~tplv-49unhts6dw-image.image"
|
|
23
27
|
},
|
|
24
|
-
/**
|
|
25
|
-
|
|
28
|
+
/** 标题 */
|
|
29
|
+
title: {
|
|
26
30
|
type: String,
|
|
27
31
|
required: !1,
|
|
28
|
-
default: "
|
|
32
|
+
default: "KeyBlade Pro"
|
|
29
33
|
},
|
|
30
34
|
/** 侧边栏宽度 */
|
|
31
35
|
siderWidth: {
|
|
@@ -57,190 +61,198 @@ const le = ["src"], oe = ["src"], e = "keyblade-pro-layout", ae = 48, re = /* @_
|
|
|
57
61
|
required: !1,
|
|
58
62
|
default: "KeyBlade Pro"
|
|
59
63
|
},
|
|
60
|
-
/**
|
|
61
|
-
|
|
64
|
+
/** 是否隐藏页脚 */
|
|
65
|
+
hideFooter: {
|
|
62
66
|
type: Boolean,
|
|
63
67
|
required: !1,
|
|
64
|
-
default: !
|
|
68
|
+
default: !1
|
|
69
|
+
},
|
|
70
|
+
/** 是否隐藏多页签 */
|
|
71
|
+
hideTabs: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
required: !1,
|
|
74
|
+
default: !1
|
|
65
75
|
}
|
|
66
76
|
},
|
|
67
77
|
emits: {
|
|
68
78
|
/** 收缩事件 */
|
|
69
|
-
collapse: (
|
|
79
|
+
collapse: (t) => !0,
|
|
70
80
|
/** keepAlive改变事件 */
|
|
71
|
-
keepAliveIncludeChange: (
|
|
81
|
+
keepAliveIncludeChange: (t) => !0
|
|
72
82
|
},
|
|
73
|
-
setup(
|
|
74
|
-
const
|
|
83
|
+
setup(t, { emit: $ }) {
|
|
84
|
+
const f = t;
|
|
75
85
|
X((r) => ({
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"
|
|
86
|
+
db27ef1a: V,
|
|
87
|
+
"2f10394c": D,
|
|
88
|
+
"2c81e8ab": K
|
|
79
89
|
}));
|
|
80
|
-
const { menuItems:
|
|
90
|
+
const { menuItems: C } = Y(f), y = Z(), {
|
|
81
91
|
menuSelectedKeys: N,
|
|
82
92
|
breadcrumbItems: P,
|
|
83
|
-
tabs:
|
|
84
|
-
keepAliveInclude:
|
|
93
|
+
tabs: T,
|
|
94
|
+
keepAliveInclude: _,
|
|
85
95
|
onMenuItemClick: W,
|
|
86
96
|
onTabClick: A,
|
|
87
97
|
onTabDelete: H
|
|
88
|
-
} = te(
|
|
89
|
-
|
|
98
|
+
} = te(C, {
|
|
99
|
+
hideTabs: f.hideTabs
|
|
90
100
|
});
|
|
91
|
-
|
|
92
|
-
const V = `${
|
|
93
|
-
|
|
101
|
+
S("ProBreadcrumbItems", P), S("ProKeepAliveInclude", _);
|
|
102
|
+
const V = `${f.headerHeight}px`, D = `${f.siderWidth}px`, K = `${ae}px`, d = ee(f.siderCollapsed), x = (r) => {
|
|
103
|
+
d.value = r, $("collapse", r);
|
|
94
104
|
};
|
|
95
|
-
return
|
|
96
|
-
|
|
97
|
-
}, { immediate: !0 }),
|
|
98
|
-
|
|
99
|
-
}, { immediate: !0 }), (r,
|
|
100
|
-
const
|
|
101
|
-
return
|
|
102
|
-
class:
|
|
105
|
+
return w(() => f.siderCollapsed, () => {
|
|
106
|
+
d.value = f.siderCollapsed;
|
|
107
|
+
}, { immediate: !0 }), w(_, () => {
|
|
108
|
+
$("keepAliveIncludeChange", _.value);
|
|
109
|
+
}, { immediate: !0 }), (r, I) => {
|
|
110
|
+
const q = o("a-typography-title"), B = o("a-space"), F = o("a-layout-header"), M = o("kb-pro-menu"), z = o("icon-menu-unfold"), E = o("icon-menu-fold"), R = o("a-button"), j = o("a-layout-sider"), G = o("kb-pro-reuse-tabs"), J = o("a-affix"), L = o("kb-pro-keep-alive-router-view"), O = o("a-layout-content"), Q = o("a-layout-footer"), k = o("a-layout");
|
|
111
|
+
return a(), i(k, {
|
|
112
|
+
class: l(`${e} ${e}-${t.layout}`)
|
|
103
113
|
}, {
|
|
104
|
-
default:
|
|
105
|
-
|
|
106
|
-
class:
|
|
114
|
+
default: s(() => [
|
|
115
|
+
c(F, {
|
|
116
|
+
class: l(`${e}-header` + (d.value ? ` ${e}-header-collapsed` : ""))
|
|
107
117
|
}, {
|
|
108
|
-
default:
|
|
109
|
-
|
|
110
|
-
class:
|
|
118
|
+
default: s(() => [
|
|
119
|
+
p("div", {
|
|
120
|
+
class: l(`${e}-header-left`)
|
|
111
121
|
}, [
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
default:
|
|
115
|
-
|
|
116
|
-
class:
|
|
122
|
+
n(y)["header-left"] ? m(r.$slots, "header-left", { key: 0 }) : (a(), h(b, { key: 1 }, [
|
|
123
|
+
t.layout !== "side" ? (a(), i(B, { key: 0 }, {
|
|
124
|
+
default: s(() => [
|
|
125
|
+
p("img", {
|
|
126
|
+
class: l(`${e}-header-left-logo`),
|
|
117
127
|
alt: "logo",
|
|
118
|
-
src:
|
|
128
|
+
src: t.logo
|
|
119
129
|
}, null, 10, le),
|
|
120
|
-
|
|
130
|
+
d.value ? u("", !0) : (a(), i(q, {
|
|
121
131
|
key: 0,
|
|
122
|
-
class:
|
|
132
|
+
class: l(`${e}-header-left-title`),
|
|
123
133
|
heading: 5
|
|
124
134
|
}, {
|
|
125
|
-
default:
|
|
126
|
-
|
|
135
|
+
default: s(() => [
|
|
136
|
+
g(v(t.title), 1)
|
|
127
137
|
]),
|
|
128
138
|
_: 1
|
|
129
139
|
}, 8, ["class"]))
|
|
130
140
|
]),
|
|
131
141
|
_: 1
|
|
132
|
-
})) :
|
|
142
|
+
})) : u("", !0)
|
|
133
143
|
], 64))
|
|
134
144
|
], 2),
|
|
135
|
-
|
|
136
|
-
class:
|
|
145
|
+
p("div", {
|
|
146
|
+
class: l(`${e}-header-center`)
|
|
137
147
|
}, [
|
|
138
|
-
|
|
148
|
+
n(y)["header-center"] ? m(r.$slots, "header-center", { key: 0 }) : u("", !0)
|
|
139
149
|
], 2),
|
|
140
|
-
|
|
141
|
-
class:
|
|
150
|
+
p("div", {
|
|
151
|
+
class: l(`${e}-header-right`)
|
|
142
152
|
}, [
|
|
143
153
|
m(r.$slots, "header-right")
|
|
144
154
|
], 2)
|
|
145
155
|
]),
|
|
146
156
|
_: 3
|
|
147
157
|
}, 8, ["class"]),
|
|
148
|
-
|
|
149
|
-
default:
|
|
150
|
-
|
|
151
|
-
class:
|
|
152
|
-
width:
|
|
158
|
+
c(k, null, {
|
|
159
|
+
default: s(() => [
|
|
160
|
+
c(j, {
|
|
161
|
+
class: l(`${e}-sider` + (d.value ? ` ${e}-sider-collapsed` : "")),
|
|
162
|
+
width: t.siderWidth,
|
|
153
163
|
collapsible: !0,
|
|
154
|
-
breakpoint:
|
|
155
|
-
collapsed:
|
|
164
|
+
breakpoint: t.siderBreakpoint,
|
|
165
|
+
collapsed: d.value,
|
|
156
166
|
"hide-trigger": !0,
|
|
157
|
-
onCollapse:
|
|
167
|
+
onCollapse: x
|
|
158
168
|
}, {
|
|
159
|
-
default:
|
|
160
|
-
|
|
161
|
-
class:
|
|
169
|
+
default: s(() => [
|
|
170
|
+
p("div", {
|
|
171
|
+
class: l(`${e}-sider-content`)
|
|
162
172
|
}, [
|
|
163
|
-
|
|
164
|
-
|
|
173
|
+
n(y)["sider-top"] ? m(r.$slots, "sider-top", { key: 0 }) : (a(), h(b, { key: 1 }, [
|
|
174
|
+
t.layout === "side" ? (a(), h("div", {
|
|
165
175
|
key: 0,
|
|
166
|
-
class:
|
|
176
|
+
class: l(`${e}-sider-content-top`)
|
|
167
177
|
}, [
|
|
168
|
-
|
|
169
|
-
default:
|
|
170
|
-
|
|
171
|
-
class:
|
|
178
|
+
c(B, null, {
|
|
179
|
+
default: s(() => [
|
|
180
|
+
p("img", {
|
|
181
|
+
class: l(`${e}-sider-content-top-logo`),
|
|
172
182
|
alt: "logo",
|
|
173
|
-
src:
|
|
183
|
+
src: t.logo
|
|
174
184
|
}, null, 10, oe),
|
|
175
|
-
|
|
185
|
+
d.value ? u("", !0) : (a(), i(q, {
|
|
176
186
|
key: 0,
|
|
177
|
-
class:
|
|
187
|
+
class: l(`${e}-sider-content-top-title`),
|
|
178
188
|
heading: 5
|
|
179
189
|
}, {
|
|
180
|
-
default:
|
|
181
|
-
|
|
190
|
+
default: s(() => [
|
|
191
|
+
g(v(t.title), 1)
|
|
182
192
|
]),
|
|
183
193
|
_: 1
|
|
184
194
|
}, 8, ["class"]))
|
|
185
195
|
]),
|
|
186
196
|
_: 1
|
|
187
197
|
})
|
|
188
|
-
], 2)) :
|
|
198
|
+
], 2)) : u("", !0)
|
|
189
199
|
], 64)),
|
|
190
|
-
|
|
191
|
-
collapsed:
|
|
192
|
-
"selected-keys":
|
|
193
|
-
items:
|
|
194
|
-
onMenuItemClick:
|
|
200
|
+
c(M, {
|
|
201
|
+
collapsed: d.value,
|
|
202
|
+
"selected-keys": n(N),
|
|
203
|
+
items: n(C),
|
|
204
|
+
onMenuItemClick: n(W)
|
|
195
205
|
}, null, 8, ["collapsed", "selected-keys", "items", "onMenuItemClick"])
|
|
196
206
|
], 2),
|
|
197
|
-
|
|
207
|
+
c(R, {
|
|
198
208
|
size: "mini",
|
|
199
|
-
class:
|
|
200
|
-
onClick:
|
|
209
|
+
class: l(`${e}-sider-collapsed-icon`),
|
|
210
|
+
onClick: I[0] || (I[0] = (se) => x(!d.value))
|
|
201
211
|
}, {
|
|
202
|
-
icon:
|
|
203
|
-
|
|
212
|
+
icon: s(() => [
|
|
213
|
+
d.value ? (a(), i(z, { key: 0 })) : (a(), i(E, { key: 1 }))
|
|
204
214
|
]),
|
|
205
215
|
_: 1
|
|
206
216
|
}, 8, ["class"])
|
|
207
217
|
]),
|
|
208
218
|
_: 3
|
|
209
219
|
}, 8, ["class", "width", "breakpoint", "collapsed"]),
|
|
210
|
-
|
|
211
|
-
class:
|
|
220
|
+
c(k, {
|
|
221
|
+
class: l(`${e}-body` + (d.value ? ` ${e}-body-collapsed` : ""))
|
|
212
222
|
}, {
|
|
213
|
-
default:
|
|
214
|
-
|
|
223
|
+
default: s(() => [
|
|
224
|
+
t.hideTabs ? u("", !0) : (a(), i(J, {
|
|
215
225
|
key: 0,
|
|
216
|
-
class:
|
|
217
|
-
offsetTop:
|
|
226
|
+
class: l(`${e}-body-affix`),
|
|
227
|
+
offsetTop: t.headerHeight
|
|
218
228
|
}, {
|
|
219
|
-
default:
|
|
220
|
-
|
|
229
|
+
default: s(() => [
|
|
230
|
+
n(T).length > 0 ? (a(), i(G, {
|
|
221
231
|
key: 0,
|
|
222
|
-
tabs:
|
|
223
|
-
onTabClick:
|
|
224
|
-
onTabDelete:
|
|
225
|
-
}, null, 8, ["tabs", "onTabClick", "onTabDelete"])) :
|
|
232
|
+
tabs: n(T),
|
|
233
|
+
onTabClick: n(A),
|
|
234
|
+
onTabDelete: n(H)
|
|
235
|
+
}, null, 8, ["tabs", "onTabClick", "onTabDelete"])) : u("", !0)
|
|
226
236
|
]),
|
|
227
237
|
_: 1
|
|
228
|
-
}, 8, ["class", "offsetTop"]))
|
|
229
|
-
|
|
230
|
-
default:
|
|
231
|
-
|
|
238
|
+
}, 8, ["class", "offsetTop"])),
|
|
239
|
+
c(O, null, {
|
|
240
|
+
default: s(() => [
|
|
241
|
+
c(L)
|
|
232
242
|
]),
|
|
233
243
|
_: 1
|
|
234
244
|
}),
|
|
235
|
-
|
|
236
|
-
key:
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
245
|
+
t.hideFooter ? u("", !0) : (a(), h(b, { key: 1 }, [
|
|
246
|
+
n(y).footer !== void 0 ? m(r.$slots, "footer", { key: 0 }) : (a(), i(Q, {
|
|
247
|
+
key: 1,
|
|
248
|
+
class: l(`${e}-body-footer`)
|
|
249
|
+
}, {
|
|
250
|
+
default: s(() => [
|
|
251
|
+
g(v(t.footerTitle), 1)
|
|
252
|
+
]),
|
|
253
|
+
_: 1
|
|
254
|
+
}, 8, ["class"]))
|
|
255
|
+
], 64))
|
|
244
256
|
]),
|
|
245
257
|
_: 3
|
|
246
258
|
}, 8, ["class"])
|
package/es/pro-menu/index.d.ts
CHANGED
|
@@ -5,8 +5,7 @@ declare const ProMenu: {
|
|
|
5
5
|
$: ComponentInternalInstance;
|
|
6
6
|
$data: {};
|
|
7
7
|
$props: {
|
|
8
|
-
|
|
9
|
-
style?: unknown;
|
|
8
|
+
mode?: "horizontal" | "vertical" | undefined;
|
|
10
9
|
key?: string | number | symbol | undefined;
|
|
11
10
|
ref?: VNodeRef | undefined;
|
|
12
11
|
ref_for?: boolean | undefined;
|
|
@@ -50,8 +49,10 @@ declare const ProMenu: {
|
|
|
50
49
|
[key: string]: any;
|
|
51
50
|
}>) => void)[] | undefined;
|
|
52
51
|
class?: unknown;
|
|
52
|
+
style?: unknown;
|
|
53
53
|
readonly collapsed: boolean;
|
|
54
54
|
readonly selectedKeys: string[];
|
|
55
|
+
readonly items: IProMenuItem[];
|
|
55
56
|
"onMenu-item-click"?: ((key: string) => any) | undefined;
|
|
56
57
|
};
|
|
57
58
|
$attrs: {
|
|
@@ -68,6 +69,11 @@ declare const ProMenu: {
|
|
|
68
69
|
$emit: (event: "menu-item-click", key: string) => void;
|
|
69
70
|
$el: any;
|
|
70
71
|
$options: ComponentOptionsBase<Readonly<ExtractPropTypes<{
|
|
72
|
+
mode: {
|
|
73
|
+
type: PropType<"horizontal" | "vertical">;
|
|
74
|
+
required: false;
|
|
75
|
+
default: string;
|
|
76
|
+
};
|
|
71
77
|
collapsed: {
|
|
72
78
|
type: PropType<boolean>;
|
|
73
79
|
required: true;
|
|
@@ -84,7 +90,9 @@ declare const ProMenu: {
|
|
|
84
90
|
"onMenu-item-click"?: ((key: string) => any) | undefined;
|
|
85
91
|
}, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
86
92
|
'menu-item-click': (key: string) => true;
|
|
87
|
-
}, string, {
|
|
93
|
+
}, string, {
|
|
94
|
+
mode: "horizontal" | "vertical";
|
|
95
|
+
}, {}, string, {}> & {
|
|
88
96
|
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
89
97
|
created?: ((() => void) | (() => void)[]) | undefined;
|
|
90
98
|
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
@@ -105,6 +113,11 @@ declare const ProMenu: {
|
|
|
105
113
|
$nextTick: typeof nextTick;
|
|
106
114
|
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: WatchOptions<boolean> | undefined): WatchStopHandle;
|
|
107
115
|
} & Readonly<ExtractPropTypes<{
|
|
116
|
+
mode: {
|
|
117
|
+
type: PropType<"horizontal" | "vertical">;
|
|
118
|
+
required: false;
|
|
119
|
+
default: string;
|
|
120
|
+
};
|
|
108
121
|
collapsed: {
|
|
109
122
|
type: PropType<boolean>;
|
|
110
123
|
required: true;
|
|
@@ -124,6 +137,11 @@ declare const ProMenu: {
|
|
|
124
137
|
__isTeleport?: undefined;
|
|
125
138
|
__isSuspense?: undefined;
|
|
126
139
|
} & ComponentOptionsBase<Readonly<ExtractPropTypes<{
|
|
140
|
+
mode: {
|
|
141
|
+
type: PropType<"horizontal" | "vertical">;
|
|
142
|
+
required: false;
|
|
143
|
+
default: string;
|
|
144
|
+
};
|
|
127
145
|
collapsed: {
|
|
128
146
|
type: PropType<boolean>;
|
|
129
147
|
required: true;
|
|
@@ -140,7 +158,9 @@ declare const ProMenu: {
|
|
|
140
158
|
"onMenu-item-click"?: ((key: string) => any) | undefined;
|
|
141
159
|
}, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
142
160
|
'menu-item-click': (key: string) => true;
|
|
143
|
-
}, string, {
|
|
161
|
+
}, string, {
|
|
162
|
+
mode: "horizontal" | "vertical";
|
|
163
|
+
}, {}, string, {}> & VNodeProps & AllowedComponentProps & ComponentCustomProps & {
|
|
144
164
|
install: (app: App) => void;
|
|
145
165
|
};
|
|
146
166
|
export * from './interface';
|
package/es/pro-menu/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import n from "./pro-menu.vue.js";
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import "./pro-menu.vue2.js";
|
|
3
|
+
import { Menu as t } from "@arco-design/web-vue";
|
|
4
|
+
const e = Object.assign(n, {
|
|
4
5
|
install: (o) => {
|
|
5
|
-
o.use(
|
|
6
|
+
o.use(t), o.component("KbProMenu", n);
|
|
6
7
|
}
|
|
7
|
-
}),
|
|
8
|
+
}), i = e;
|
|
8
9
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
e as ProMenu,
|
|
11
|
+
i as default
|
|
11
12
|
};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes, type PropType } from 'vue';
|
|
2
2
|
import type { IProMenuItem } from './interface';
|
|
3
3
|
declare const _default: DefineComponent<{
|
|
4
|
+
mode: {
|
|
5
|
+
type: PropType<"horizontal" | "vertical">;
|
|
6
|
+
required: false;
|
|
7
|
+
default: string;
|
|
8
|
+
};
|
|
4
9
|
collapsed: {
|
|
5
10
|
type: PropType<boolean>;
|
|
6
11
|
required: true;
|
|
@@ -16,6 +21,11 @@ declare const _default: DefineComponent<{
|
|
|
16
21
|
}, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
17
22
|
'menu-item-click': (key: string) => true;
|
|
18
23
|
}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
24
|
+
mode: {
|
|
25
|
+
type: PropType<"horizontal" | "vertical">;
|
|
26
|
+
required: false;
|
|
27
|
+
default: string;
|
|
28
|
+
};
|
|
19
29
|
collapsed: {
|
|
20
30
|
type: PropType<boolean>;
|
|
21
31
|
required: true;
|
|
@@ -30,5 +40,7 @@ declare const _default: DefineComponent<{
|
|
|
30
40
|
};
|
|
31
41
|
}>> & {
|
|
32
42
|
"onMenu-item-click"?: ((key: string) => any) | undefined;
|
|
33
|
-
}, {
|
|
43
|
+
}, {
|
|
44
|
+
mode: "horizontal" | "vertical";
|
|
45
|
+
}, {}>;
|
|
34
46
|
export default _default;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import "
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as R, computed as S, resolveComponent as y, openBlock as r, createBlock as l, normalizeClass as h, withCtx as c, createVNode as V, unref as k, createSlots as g, createTextVNode as i, toDisplayString as x, createElementBlock as u, Fragment as f, renderList as b, createCommentVNode as o, resolveDynamicComponent as N } from "vue";
|
|
2
|
+
import { createReusableTemplate as W } from "@vueuse/core";
|
|
3
|
+
import { useRouter as $ } from "vue-router";
|
|
4
|
+
const A = ["src"], K = ["src"], z = "keyblade-pro-menu", T = "keyblade-pro-menu-item", j = /* @__PURE__ */ R({
|
|
5
5
|
__name: "pro-menu",
|
|
6
6
|
props: {
|
|
7
|
+
mode: {
|
|
8
|
+
type: String,
|
|
9
|
+
required: !1,
|
|
10
|
+
default: "vertical"
|
|
11
|
+
},
|
|
7
12
|
collapsed: {
|
|
8
13
|
type: Boolean,
|
|
9
14
|
required: !0
|
|
@@ -18,44 +23,104 @@ const B = "keyblade-pro-menu", I = /* @__PURE__ */ p({
|
|
|
18
23
|
}
|
|
19
24
|
},
|
|
20
25
|
emits: {
|
|
21
|
-
"menu-item-click": (
|
|
26
|
+
"menu-item-click": (a) => !0
|
|
22
27
|
},
|
|
23
|
-
setup(
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
e != null && e.children && ((a = e.children) == null ? void 0 : a.length) > 0 && l(e.children);
|
|
28
|
+
setup(a, { emit: q }) {
|
|
29
|
+
const d = $(), [B, _] = W(), s = S(() => (n) => {
|
|
30
|
+
const t = n == null ? void 0 : n.icon;
|
|
31
|
+
return t != null && t.startsWith("icon") ? "icon" : "url";
|
|
32
|
+
}), w = (n) => {
|
|
33
|
+
if (n != null && n.path) {
|
|
34
|
+
if (n.path.startsWith("http") || n.path.startsWith("https")) {
|
|
35
|
+
window.open(n.path);
|
|
36
|
+
return;
|
|
35
37
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
d == null || d.push({ path: n.path }), q("menu-item-click", n.name);
|
|
39
|
+
}
|
|
38
40
|
};
|
|
39
|
-
return (
|
|
40
|
-
const
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
|
|
41
|
+
return (n, t) => {
|
|
42
|
+
const D = y("a-sub-menu"), I = y("a-menu-item"), M = y("a-menu");
|
|
43
|
+
return r(), l(M, {
|
|
44
|
+
mode: a.mode,
|
|
45
|
+
class: h(z),
|
|
46
|
+
collapsed: a.collapsed,
|
|
47
|
+
"selected-keys": a.selectedKeys,
|
|
48
|
+
"auto-open-selected": ""
|
|
47
49
|
}, {
|
|
48
|
-
default:
|
|
49
|
-
(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
default: c(() => [
|
|
51
|
+
V(k(B), null, {
|
|
52
|
+
default: c(({ item: e }) => {
|
|
53
|
+
var C, v;
|
|
54
|
+
return [
|
|
55
|
+
e != null && e.children && ((C = e == null ? void 0 : e.children) == null ? void 0 : C.length) > 0 ? (r(), l(D, {
|
|
56
|
+
key: e.name
|
|
57
|
+
}, g({
|
|
58
|
+
title: c(() => [
|
|
59
|
+
i(x(e.title), 1)
|
|
60
|
+
]),
|
|
61
|
+
default: c(() => [
|
|
62
|
+
e != null && e.hideChildrenInMenu ? o("", !0) : (r(!0), u(f, { key: 0 }, b((e == null ? void 0 : e.children) || [], (p) => (r(), l(k(_), {
|
|
63
|
+
key: p.name,
|
|
64
|
+
item: p
|
|
65
|
+
}, null, 8, ["item"]))), 128))
|
|
66
|
+
]),
|
|
67
|
+
_: 2
|
|
68
|
+
}, [
|
|
69
|
+
e != null && e.icon ? {
|
|
70
|
+
name: "icon",
|
|
71
|
+
fn: c(() => [
|
|
72
|
+
s.value(e) === "icon" ? (r(), l(N(e.icon), { key: 0 })) : o("", !0),
|
|
73
|
+
s.value(e) === "url" ? (r(), u("img", {
|
|
74
|
+
key: 1,
|
|
75
|
+
class: h(`${T}-img`),
|
|
76
|
+
src: e.icon,
|
|
77
|
+
alt: ""
|
|
78
|
+
}, null, 10, A)) : o("", !0)
|
|
79
|
+
]),
|
|
80
|
+
key: "0"
|
|
81
|
+
} : void 0
|
|
82
|
+
]), 1024)) : o("", !0),
|
|
83
|
+
!(e != null && e.children) || ((v = e == null ? void 0 : e.children) == null ? void 0 : v.length) === 0 ? (r(), l(I, {
|
|
84
|
+
key: e.name,
|
|
85
|
+
onClick: (p) => w(e)
|
|
86
|
+
}, g({
|
|
87
|
+
default: c(() => [
|
|
88
|
+
i(" " + x(e.title), 1)
|
|
89
|
+
]),
|
|
90
|
+
_: 2
|
|
91
|
+
}, [
|
|
92
|
+
e != null && e.icon ? {
|
|
93
|
+
name: "icon",
|
|
94
|
+
fn: c(() => [
|
|
95
|
+
s.value(e) === "icon" ? (r(), l(N(e.icon), { key: 0 })) : o("", !0),
|
|
96
|
+
s.value(e) === "url" ? (r(), u("img", {
|
|
97
|
+
key: 1,
|
|
98
|
+
class: h(`${T}-img`),
|
|
99
|
+
src: e.icon,
|
|
100
|
+
alt: ""
|
|
101
|
+
}, null, 10, K)) : o("", !0)
|
|
102
|
+
]),
|
|
103
|
+
key: "0"
|
|
104
|
+
} : void 0
|
|
105
|
+
]), 1032, ["onClick"])) : o("", !0)
|
|
106
|
+
];
|
|
107
|
+
}),
|
|
108
|
+
_: 1
|
|
109
|
+
}),
|
|
110
|
+
(r(!0), u(f, null, b(a.items, (e) => (r(), u(f, {
|
|
111
|
+
key: e.name
|
|
112
|
+
}, [
|
|
113
|
+
e && !e.hideInMenu ? (r(), l(k(_), {
|
|
114
|
+
key: 0,
|
|
115
|
+
item: e
|
|
116
|
+
}, null, 8, ["item"])) : o("", !0)
|
|
117
|
+
], 64))), 128))
|
|
53
118
|
]),
|
|
54
119
|
_: 1
|
|
55
|
-
}, 8, ["collapsed", "selected-keys"]);
|
|
120
|
+
}, 8, ["mode", "collapsed", "selected-keys"]);
|
|
56
121
|
};
|
|
57
122
|
}
|
|
58
123
|
});
|
|
59
124
|
export {
|
|
60
|
-
|
|
125
|
+
j as default
|
|
61
126
|
};
|