jky-component-lib 0.0.36 → 0.0.37
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/dist/es/package.json.js +1 -1
- package/dist/es/page-header/PageHeader.vue.d.ts +5 -52
- package/dist/es/page-header/PageHeader.vue.js +38 -91
- package/dist/es/page-header/PopoverMenu.vue.d.ts +11 -0
- package/dist/es/page-header/PopoverMenu.vue.js +89 -0
- package/dist/es/page-header/PopoverMenu.vue2.js +4 -0
- package/dist/es/style.css +20 -0
- package/dist/lib/package.json.js +1 -1
- package/dist/lib/page-header/PageHeader.vue.d.ts +5 -52
- package/dist/lib/page-header/PageHeader.vue.js +36 -89
- package/dist/lib/page-header/PopoverMenu.vue.d.ts +11 -0
- package/dist/lib/page-header/PopoverMenu.vue.js +89 -0
- package/dist/lib/page-header/PopoverMenu.vue2.js +4 -0
- package/dist/lib/style.css +20 -0
- package/dist/umd/index.js +154 -104
- package/package.json +1 -1
package/dist/es/package.json.js
CHANGED
|
@@ -1,51 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TooltipTriggerType } from 'element-plus/es/components/tooltip';
|
|
3
|
-
import { Arrayable } from 'element-plus/es/utils';
|
|
4
|
-
type __VLS_Props = {
|
|
5
|
-
logo?: string;
|
|
6
|
-
title?: string;
|
|
7
|
-
height?: string | number;
|
|
8
|
-
background?: string;
|
|
9
|
-
backgroundImage?: string;
|
|
10
|
-
statusIcons?: StatusIcon[];
|
|
11
|
-
userName?: string;
|
|
12
|
-
userAvatar?: string;
|
|
13
|
-
/**
|
|
14
|
-
* 最左侧菜单按钮弹出窗里的内容
|
|
15
|
-
*/
|
|
16
|
-
popover?: {
|
|
17
|
-
menus?: PopoverMenuItem[];
|
|
18
|
-
buttonClass?: string;
|
|
19
|
-
elButtonClass?: string;
|
|
20
|
-
elButtonType?: ButtonType;
|
|
21
|
-
width?: number;
|
|
22
|
-
trigger?: Arrayable<TooltipTriggerType>;
|
|
23
|
-
highlightCurrent?: boolean;
|
|
24
|
-
};
|
|
25
|
-
showLogout?: boolean;
|
|
26
|
-
userDropdownItems?: UserDropdonItem[];
|
|
27
|
-
};
|
|
28
|
-
interface PopoverMenuItem {
|
|
29
|
-
label: string;
|
|
30
|
-
value: string;
|
|
31
|
-
onClick?: () => void;
|
|
32
|
-
disabled?: boolean;
|
|
33
|
-
icon?: string;
|
|
34
|
-
elButtonClass?: string;
|
|
35
|
-
}
|
|
36
|
-
interface UserDropdonItem {
|
|
37
|
-
label: string;
|
|
38
|
-
value: string;
|
|
39
|
-
icon?: string;
|
|
40
|
-
disabled?: boolean;
|
|
41
|
-
divided?: boolean;
|
|
42
|
-
}
|
|
43
|
-
interface StatusIcon {
|
|
44
|
-
icon: string | object;
|
|
45
|
-
label: string;
|
|
46
|
-
color?: string;
|
|
47
|
-
onClick?: () => void;
|
|
48
|
-
}
|
|
1
|
+
import { PageHeaderProps } from './types';
|
|
49
2
|
declare function __VLS_template(): {
|
|
50
3
|
attrs: Partial<{}>;
|
|
51
4
|
slots: {
|
|
@@ -57,16 +10,16 @@ declare function __VLS_template(): {
|
|
|
57
10
|
rootEl: HTMLElement;
|
|
58
11
|
};
|
|
59
12
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
60
|
-
declare const __VLS_component: import('vue').DefineComponent<
|
|
13
|
+
declare const __VLS_component: import('vue').DefineComponent<PageHeaderProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
61
14
|
command: (command: string) => any;
|
|
62
15
|
logout: () => any;
|
|
63
|
-
}, string, import('vue').PublicProps, Readonly<
|
|
16
|
+
}, string, import('vue').PublicProps, Readonly<PageHeaderProps> & Readonly<{
|
|
64
17
|
onCommand?: ((command: string) => any) | undefined;
|
|
65
18
|
onLogout?: (() => any) | undefined;
|
|
66
19
|
}>, {
|
|
67
20
|
height: string | number;
|
|
68
|
-
statusIcons:
|
|
69
|
-
userDropdownItems:
|
|
21
|
+
statusIcons: import('./types').PageHeaderStatusIcon[];
|
|
22
|
+
userDropdownItems: import('./types').PageHeaderUserDropdonItem[];
|
|
70
23
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
|
|
71
24
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
72
25
|
export default _default;
|
|
@@ -17,35 +17,30 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { defineComponent, computed,
|
|
21
|
-
import {
|
|
20
|
+
import { defineComponent, computed, openBlock, createElementBlock, normalizeStyle, unref, createElementVNode, createBlock, normalizeProps, mergeProps, createCommentVNode, toDisplayString, renderSlot, Fragment, renderList, normalizeClass, withCtx, resolveDynamicComponent, createVNode, createTextVNode } from "vue";
|
|
21
|
+
import { ElIcon, ElDropdown, ElDropdownMenu, ElDropdownItem } from "element-plus";
|
|
22
|
+
import _sfc_main$1 from "./PopoverMenu.vue.js";
|
|
22
23
|
const _hoisted_1 = { class: "jky-page-header__container" };
|
|
23
|
-
const _hoisted_2 = {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
};
|
|
27
|
-
const _hoisted_3 = { class: "grid grid-cols-3 gap-2 p-2" };
|
|
28
|
-
const _hoisted_4 = { class: "text-sm text-center" };
|
|
29
|
-
const _hoisted_5 = { class: "jky-page-header__left" };
|
|
30
|
-
const _hoisted_6 = ["src", "alt"];
|
|
31
|
-
const _hoisted_7 = {
|
|
24
|
+
const _hoisted_2 = { class: "jky-page-header__left" };
|
|
25
|
+
const _hoisted_3 = ["src", "alt"];
|
|
26
|
+
const _hoisted_4 = {
|
|
32
27
|
key: 1,
|
|
33
28
|
class: "jky-page-header__title"
|
|
34
29
|
};
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
const
|
|
30
|
+
const _hoisted_5 = { class: "jky-page-header__center" };
|
|
31
|
+
const _hoisted_6 = { class: "jky-page-header__right" };
|
|
32
|
+
const _hoisted_7 = { class: "jky-page-header__status-icons hidden md:flex" };
|
|
33
|
+
const _hoisted_8 = {
|
|
39
34
|
xmlns: "http://www.w3.org/2000/svg",
|
|
40
35
|
style: { "color": "white" },
|
|
41
36
|
fill: "none",
|
|
42
37
|
viewBox: "0 0 24 24",
|
|
43
38
|
stroke: "currentColor"
|
|
44
39
|
};
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
const
|
|
40
|
+
const _hoisted_9 = { class: "jky-page-header__time hidden md:block" };
|
|
41
|
+
const _hoisted_10 = { class: "jky-page-header__user" };
|
|
42
|
+
const _hoisted_11 = ["src", "alt"];
|
|
43
|
+
const _hoisted_12 = {
|
|
49
44
|
key: 0,
|
|
50
45
|
class: "jky-page-header__username text-base hidden md:block"
|
|
51
46
|
};
|
|
@@ -63,6 +58,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
63
58
|
userName: {},
|
|
64
59
|
userAvatar: {},
|
|
65
60
|
popover: {},
|
|
61
|
+
showMore: { type: Boolean },
|
|
62
|
+
showPopover: { type: Boolean },
|
|
66
63
|
showLogout: { type: Boolean },
|
|
67
64
|
userDropdownItems: { default: () => [
|
|
68
65
|
{ label: "个人信息", value: "profile", icon: "icon-[heroicons--user]" },
|
|
@@ -74,22 +71,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
74
71
|
setup(__props, { emit: __emit }) {
|
|
75
72
|
const props = __props;
|
|
76
73
|
const emit = __emit;
|
|
77
|
-
const popover = computed(() => __spreadValues({
|
|
78
|
-
menus: [],
|
|
79
|
-
buttonClass: "w-20 h-20",
|
|
80
|
-
elButtonClass: "",
|
|
81
|
-
width: 400,
|
|
82
|
-
trigger: "click",
|
|
83
|
-
highlightCurrent: true
|
|
84
|
-
}, props.popover));
|
|
85
|
-
const popoverIndex = ref("");
|
|
86
|
-
function onPopoverButtonClick(item) {
|
|
87
|
-
var _a;
|
|
88
|
-
if (popover.value.highlightCurrent) {
|
|
89
|
-
popoverIndex.value = item.value;
|
|
90
|
-
}
|
|
91
|
-
(_a = item.onClick) == null ? void 0 : _a.call(item);
|
|
92
|
-
}
|
|
93
74
|
function handleCommand(command) {
|
|
94
75
|
emit("command", command);
|
|
95
76
|
}
|
|
@@ -112,66 +93,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
112
93
|
return style;
|
|
113
94
|
});
|
|
114
95
|
return (_ctx, _cache) => {
|
|
115
|
-
var _a;
|
|
96
|
+
var _a, _b, _c, _d;
|
|
116
97
|
return openBlock(), createElementBlock("header", {
|
|
117
98
|
class: "jky-page-header",
|
|
118
|
-
style: normalizeStyle([backgroundStyle
|
|
99
|
+
style: normalizeStyle([unref(backgroundStyle), { height: unref(heightValue) }])
|
|
119
100
|
}, [
|
|
120
101
|
createElementVNode("div", _hoisted_1, [
|
|
121
|
-
((_a = popover.
|
|
122
|
-
|
|
123
|
-
title: "菜单",
|
|
124
|
-
placement: "bottom-start",
|
|
125
|
-
class: "h-full",
|
|
126
|
-
trigger: popover.value.trigger,
|
|
127
|
-
width: popover.value.width
|
|
128
|
-
}, {
|
|
129
|
-
reference: withCtx(() => [..._cache[1] || (_cache[1] = [
|
|
130
|
-
createElementVNode("span", { class: "icon-[ant-design--menu-fold-outlined] text-[white] text-2xl cursor-pointer hover:opacity-80" }, null, -1)
|
|
131
|
-
])]),
|
|
132
|
-
default: withCtx(() => [
|
|
133
|
-
createElementVNode("div", _hoisted_3, [
|
|
134
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(popover.value.menus, (item) => {
|
|
135
|
-
return openBlock(), createBlock(unref(ElButton), {
|
|
136
|
-
key: item.value,
|
|
137
|
-
disabled: item.disabled,
|
|
138
|
-
class: normalizeClass(["w-fit! h-fit! ml-0!", [popover.value.elButtonClass, item.elButtonClass]]),
|
|
139
|
-
type: unref(popoverIndex) === item.value ? "primary" : popover.value.elButtonType || "default",
|
|
140
|
-
onClick: ($event) => onPopoverButtonClick(item)
|
|
141
|
-
}, {
|
|
142
|
-
default: withCtx(() => [
|
|
143
|
-
createElementVNode("div", {
|
|
144
|
-
class: normalizeClass(["jky-page-header__popover-inner flex flex-col justify-around items-center", popover.value.buttonClass])
|
|
145
|
-
}, [
|
|
146
|
-
item.icon ? (openBlock(), createElementBlock("span", {
|
|
147
|
-
key: 0,
|
|
148
|
-
class: normalizeClass(["text-xl mr-2", [item.icon]])
|
|
149
|
-
}, null, 2)) : createCommentVNode("", true),
|
|
150
|
-
createElementVNode("span", _hoisted_4, toDisplayString(item.label), 1)
|
|
151
|
-
], 2)
|
|
152
|
-
]),
|
|
153
|
-
_: 2
|
|
154
|
-
}, 1032, ["disabled", "class", "type", "onClick"]);
|
|
155
|
-
}), 128))
|
|
156
|
-
])
|
|
157
|
-
]),
|
|
158
|
-
_: 1
|
|
159
|
-
}, 8, ["trigger", "width"])
|
|
160
|
-
])) : createCommentVNode("", true),
|
|
161
|
-
createElementVNode("div", _hoisted_5, [
|
|
102
|
+
__props.showPopover && ((_b = (_a = __props.popover) == null ? void 0 : _a.menus) == null ? void 0 : _b.length) ? (openBlock(), createBlock(_sfc_main$1, normalizeProps(mergeProps({ key: 0 }, __props.popover)), null, 16)) : createCommentVNode("", true),
|
|
103
|
+
createElementVNode("div", _hoisted_2, [
|
|
162
104
|
__props.logo ? (openBlock(), createElementBlock("img", {
|
|
163
105
|
key: 0,
|
|
164
106
|
src: __props.logo,
|
|
165
107
|
alt: __props.title || "Logo",
|
|
166
108
|
class: "jky-page-header__logo"
|
|
167
|
-
}, null, 8,
|
|
168
|
-
__props.title ? (openBlock(), createElementBlock("span",
|
|
109
|
+
}, null, 8, _hoisted_3)) : createCommentVNode("", true),
|
|
110
|
+
__props.title ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(__props.title), 1)) : createCommentVNode("", true)
|
|
169
111
|
]),
|
|
170
|
-
createElementVNode("div",
|
|
112
|
+
createElementVNode("div", _hoisted_5, [
|
|
171
113
|
renderSlot(_ctx.$slots, "center")
|
|
172
114
|
]),
|
|
173
|
-
createElementVNode("div",
|
|
174
|
-
createElementVNode("div",
|
|
115
|
+
createElementVNode("div", _hoisted_6, [
|
|
116
|
+
createElementVNode("div", _hoisted_7, [
|
|
175
117
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.statusIcons, (icon, index) => {
|
|
176
118
|
return openBlock(), createElementBlock(Fragment, { key: index }, [
|
|
177
119
|
typeof icon.icon === "string" ? (openBlock(), createElementBlock("span", {
|
|
@@ -235,7 +177,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
235
177
|
class: "jky-page-header__status-icon text-white"
|
|
236
178
|
}, {
|
|
237
179
|
default: withCtx(() => [
|
|
238
|
-
(openBlock(), createElementBlock("svg",
|
|
180
|
+
(openBlock(), createElementBlock("svg", _hoisted_8, [..._cache[1] || (_cache[1] = [
|
|
239
181
|
createElementVNode("path", {
|
|
240
182
|
"stroke-linecap": "round",
|
|
241
183
|
"stroke-linejoin": "round",
|
|
@@ -249,11 +191,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
249
191
|
]),
|
|
250
192
|
_: 1
|
|
251
193
|
})) : createCommentVNode("", true),
|
|
252
|
-
createElementVNode("div",
|
|
194
|
+
createElementVNode("div", _hoisted_9, [
|
|
253
195
|
renderSlot(_ctx.$slots, "time", {}, () => [
|
|
254
196
|
createElementVNode("span", null, toDisplayString((/* @__PURE__ */ new Date()).toLocaleString("zh-CN")), 1)
|
|
255
197
|
])
|
|
256
198
|
]),
|
|
199
|
+
__props.showMore && ((_d = (_c = __props.popover) == null ? void 0 : _c.menus) == null ? void 0 : _d.length) ? (openBlock(), createBlock(_sfc_main$1, mergeProps({
|
|
200
|
+
key: 1,
|
|
201
|
+
"ref-name": "更多",
|
|
202
|
+
"ref-icon-class": "icon-[mdi--format-list-bulleted]"
|
|
203
|
+
}, __props.popover), null, 16)) : createCommentVNode("", true),
|
|
257
204
|
createVNode(unref(ElDropdown), {
|
|
258
205
|
trigger: "hover",
|
|
259
206
|
onCommand: handleCommand
|
|
@@ -282,7 +229,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
282
229
|
})
|
|
283
230
|
]),
|
|
284
231
|
default: withCtx(() => [
|
|
285
|
-
createElementVNode("div",
|
|
232
|
+
createElementVNode("div", _hoisted_10, [
|
|
286
233
|
renderSlot(_ctx.$slots, "userIcon", {}, () => [
|
|
287
234
|
__props.userAvatar ? (openBlock(), createBlock(unref(ElIcon), {
|
|
288
235
|
key: 0,
|
|
@@ -294,7 +241,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
294
241
|
src: __props.userAvatar,
|
|
295
242
|
alt: __props.userName,
|
|
296
243
|
class: "rounded-full"
|
|
297
|
-
}, null, 8,
|
|
244
|
+
}, null, 8, _hoisted_11)
|
|
298
245
|
]),
|
|
299
246
|
_: 1
|
|
300
247
|
})) : (openBlock(), createBlock(unref(ElIcon), {
|
|
@@ -302,22 +249,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
|
|
|
302
249
|
size: 24,
|
|
303
250
|
class: "jky-page-header__avatar"
|
|
304
251
|
}, {
|
|
305
|
-
default: withCtx(() => [..._cache[
|
|
252
|
+
default: withCtx(() => [..._cache[2] || (_cache[2] = [
|
|
306
253
|
createElementVNode("span", { class: "icon-[heroicons--user]" }, null, -1)
|
|
307
254
|
])]),
|
|
308
255
|
_: 1
|
|
309
256
|
}))
|
|
310
257
|
]),
|
|
311
|
-
__props.userName ? (openBlock(), createElementBlock("span",
|
|
258
|
+
__props.userName ? (openBlock(), createElementBlock("span", _hoisted_12, toDisplayString(__props.userName), 1)) : createCommentVNode("", true)
|
|
312
259
|
])
|
|
313
260
|
]),
|
|
314
261
|
_: 3
|
|
315
262
|
}),
|
|
316
263
|
__props.showLogout ? (openBlock(), createElementBlock("div", {
|
|
317
|
-
key:
|
|
264
|
+
key: 2,
|
|
318
265
|
class: "jky-page-header__logout h-full flex items-center text-white",
|
|
319
266
|
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("logout"))
|
|
320
|
-
}, [..._cache[
|
|
267
|
+
}, [..._cache[3] || (_cache[3] = [
|
|
321
268
|
createElementVNode("span", { class: "icon-[ri--logout-circle-line] mr-2" }, null, -1),
|
|
322
269
|
createElementVNode("span", null, "退出登录", -1)
|
|
323
270
|
])])) : createCommentVNode("", true)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TooltipTriggerType } from 'element-plus';
|
|
2
|
+
import { Arrayable } from 'element-plus/es/utils';
|
|
3
|
+
import { PageHeaderPopoverMenuProps } from './types';
|
|
4
|
+
declare const _default: import('vue').DefineComponent<PageHeaderPopoverMenuProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<PageHeaderPopoverMenuProps> & Readonly<{}>, {
|
|
5
|
+
trigger: Arrayable<TooltipTriggerType>;
|
|
6
|
+
menus: PopoverMenuItem[];
|
|
7
|
+
buttonClass: string;
|
|
8
|
+
width: number;
|
|
9
|
+
highlightCurrent: boolean;
|
|
10
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { defineComponent, ref, openBlock, createElementBlock, createVNode, unref, withCtx, createElementVNode, Fragment, renderList, createBlock, normalizeClass, createCommentVNode, toDisplayString } from "vue";
|
|
2
|
+
import { ElPopover, ElButton } from "element-plus";
|
|
3
|
+
const _hoisted_1 = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "jky-page-header__popover mr-2 h-full flex items-center text-white"
|
|
6
|
+
};
|
|
7
|
+
const _hoisted_2 = { class: "flex items-center" };
|
|
8
|
+
const _hoisted_3 = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "text-white ml-2"
|
|
11
|
+
};
|
|
12
|
+
const _hoisted_4 = { class: "grid grid-cols-3 gap-2 p-2" };
|
|
13
|
+
const _hoisted_5 = { class: "text-sm text-center" };
|
|
14
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
|
+
__name: "PopoverMenu",
|
|
16
|
+
props: {
|
|
17
|
+
refIconClass: {},
|
|
18
|
+
refName: {},
|
|
19
|
+
menus: { default: () => [] },
|
|
20
|
+
buttonClass: { default: "w-20 h-20" },
|
|
21
|
+
elButtonClass: {},
|
|
22
|
+
elButtonType: {},
|
|
23
|
+
width: { default: 400 },
|
|
24
|
+
trigger: { default: "click" },
|
|
25
|
+
highlightCurrent: { type: Boolean, default: true }
|
|
26
|
+
},
|
|
27
|
+
setup(__props) {
|
|
28
|
+
const props = __props;
|
|
29
|
+
const popoverIndex = ref("");
|
|
30
|
+
function onPopoverButtonClick(item) {
|
|
31
|
+
var _a;
|
|
32
|
+
if (props.highlightCurrent) {
|
|
33
|
+
popoverIndex.value = item.value;
|
|
34
|
+
}
|
|
35
|
+
(_a = item.onClick) == null ? void 0 : _a.call(item);
|
|
36
|
+
}
|
|
37
|
+
return (_ctx, _cache) => {
|
|
38
|
+
var _a;
|
|
39
|
+
return ((_a = __props.menus) == null ? void 0 : _a.length) ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
40
|
+
createVNode(unref(ElPopover), {
|
|
41
|
+
title: "菜单",
|
|
42
|
+
placement: "bottom-start",
|
|
43
|
+
class: "h-full",
|
|
44
|
+
trigger: __props.trigger,
|
|
45
|
+
width: __props.width
|
|
46
|
+
}, {
|
|
47
|
+
reference: withCtx(() => [
|
|
48
|
+
createElementVNode("div", _hoisted_2, [
|
|
49
|
+
createElementVNode("span", {
|
|
50
|
+
class: normalizeClass(["icon-[ant-design--menu-fold-outlined] text-[white] text-2xl cursor-pointer hover:opacity-80", __props.refIconClass])
|
|
51
|
+
}, null, 2),
|
|
52
|
+
__props.refName ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(__props.refName), 1)) : createCommentVNode("", true)
|
|
53
|
+
])
|
|
54
|
+
]),
|
|
55
|
+
default: withCtx(() => [
|
|
56
|
+
createElementVNode("div", _hoisted_4, [
|
|
57
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.menus, (item) => {
|
|
58
|
+
return openBlock(), createBlock(unref(ElButton), {
|
|
59
|
+
key: item.value,
|
|
60
|
+
disabled: item.disabled,
|
|
61
|
+
class: normalizeClass(["w-fit! h-fit! ml-0!", [__props.elButtonClass, item.elButtonClass]]),
|
|
62
|
+
type: unref(popoverIndex) === item.value ? "primary" : __props.elButtonType || "default",
|
|
63
|
+
onClick: ($event) => onPopoverButtonClick(item)
|
|
64
|
+
}, {
|
|
65
|
+
default: withCtx(() => [
|
|
66
|
+
createElementVNode("div", {
|
|
67
|
+
class: normalizeClass(["jky-page-header__popover-inner flex flex-col justify-around items-center", __props.buttonClass])
|
|
68
|
+
}, [
|
|
69
|
+
item.icon ? (openBlock(), createElementBlock("span", {
|
|
70
|
+
key: 0,
|
|
71
|
+
class: normalizeClass(["text-xl mr-2", [item.icon]])
|
|
72
|
+
}, null, 2)) : createCommentVNode("", true),
|
|
73
|
+
createElementVNode("span", _hoisted_5, toDisplayString(item.label), 1)
|
|
74
|
+
], 2)
|
|
75
|
+
]),
|
|
76
|
+
_: 2
|
|
77
|
+
}, 1032, ["disabled", "class", "type", "onClick"]);
|
|
78
|
+
}), 128))
|
|
79
|
+
])
|
|
80
|
+
]),
|
|
81
|
+
_: 1
|
|
82
|
+
}, 8, ["trigger", "width"])
|
|
83
|
+
])) : createCommentVNode("", true);
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
export {
|
|
88
|
+
_sfc_main as default
|
|
89
|
+
};
|
package/dist/es/style.css
CHANGED
|
@@ -337,6 +337,10 @@
|
|
|
337
337
|
margin-left: calc(var(--spacing) * 1);
|
|
338
338
|
}
|
|
339
339
|
|
|
340
|
+
.ml-2 {
|
|
341
|
+
margin-left: calc(var(--spacing) * 2);
|
|
342
|
+
}
|
|
343
|
+
|
|
340
344
|
.icon-\[ant-design--menu-fold-outlined\] {
|
|
341
345
|
width: 1em;
|
|
342
346
|
height: 1em;
|
|
@@ -785,6 +789,22 @@
|
|
|
785
789
|
mask-repeat: no-repeat;
|
|
786
790
|
}
|
|
787
791
|
|
|
792
|
+
.icon-\[mdi--format-list-bulleted\] {
|
|
793
|
+
width: 1em;
|
|
794
|
+
height: 1em;
|
|
795
|
+
-webkit-mask-image: var(--svg);
|
|
796
|
+
-webkit-mask-image: var(--svg);
|
|
797
|
+
-webkit-mask-image: var(--svg);
|
|
798
|
+
mask-image: var(--svg);
|
|
799
|
+
--svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='black' d='M7 5h14v2H7zm0 8v-2h14v2zM4 4.5A1.5 1.5 0 0 1 5.5 6A1.5 1.5 0 0 1 4 7.5A1.5 1.5 0 0 1 2.5 6A1.5 1.5 0 0 1 4 4.5m0 6A1.5 1.5 0 0 1 5.5 12A1.5 1.5 0 0 1 4 13.5A1.5 1.5 0 0 1 2.5 12A1.5 1.5 0 0 1 4 10.5M7 19v-2h14v2zm-3-2.5A1.5 1.5 0 0 1 5.5 18A1.5 1.5 0 0 1 4 19.5A1.5 1.5 0 0 1 2.5 18A1.5 1.5 0 0 1 4 16.5'/%3E%3C/svg%3E");
|
|
800
|
+
background-color: currentColor;
|
|
801
|
+
display: inline-block;
|
|
802
|
+
-webkit-mask-size: 100% 100%;
|
|
803
|
+
mask-size: 100% 100%;
|
|
804
|
+
-webkit-mask-repeat: no-repeat;
|
|
805
|
+
mask-repeat: no-repeat;
|
|
806
|
+
}
|
|
807
|
+
|
|
788
808
|
.icon-\[ri--logout-circle-line\] {
|
|
789
809
|
width: 1em;
|
|
790
810
|
height: 1em;
|
package/dist/lib/package.json.js
CHANGED
|
@@ -1,51 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TooltipTriggerType } from 'element-plus/es/components/tooltip';
|
|
3
|
-
import { Arrayable } from 'element-plus/es/utils';
|
|
4
|
-
type __VLS_Props = {
|
|
5
|
-
logo?: string;
|
|
6
|
-
title?: string;
|
|
7
|
-
height?: string | number;
|
|
8
|
-
background?: string;
|
|
9
|
-
backgroundImage?: string;
|
|
10
|
-
statusIcons?: StatusIcon[];
|
|
11
|
-
userName?: string;
|
|
12
|
-
userAvatar?: string;
|
|
13
|
-
/**
|
|
14
|
-
* 最左侧菜单按钮弹出窗里的内容
|
|
15
|
-
*/
|
|
16
|
-
popover?: {
|
|
17
|
-
menus?: PopoverMenuItem[];
|
|
18
|
-
buttonClass?: string;
|
|
19
|
-
elButtonClass?: string;
|
|
20
|
-
elButtonType?: ButtonType;
|
|
21
|
-
width?: number;
|
|
22
|
-
trigger?: Arrayable<TooltipTriggerType>;
|
|
23
|
-
highlightCurrent?: boolean;
|
|
24
|
-
};
|
|
25
|
-
showLogout?: boolean;
|
|
26
|
-
userDropdownItems?: UserDropdonItem[];
|
|
27
|
-
};
|
|
28
|
-
interface PopoverMenuItem {
|
|
29
|
-
label: string;
|
|
30
|
-
value: string;
|
|
31
|
-
onClick?: () => void;
|
|
32
|
-
disabled?: boolean;
|
|
33
|
-
icon?: string;
|
|
34
|
-
elButtonClass?: string;
|
|
35
|
-
}
|
|
36
|
-
interface UserDropdonItem {
|
|
37
|
-
label: string;
|
|
38
|
-
value: string;
|
|
39
|
-
icon?: string;
|
|
40
|
-
disabled?: boolean;
|
|
41
|
-
divided?: boolean;
|
|
42
|
-
}
|
|
43
|
-
interface StatusIcon {
|
|
44
|
-
icon: string | object;
|
|
45
|
-
label: string;
|
|
46
|
-
color?: string;
|
|
47
|
-
onClick?: () => void;
|
|
48
|
-
}
|
|
1
|
+
import { PageHeaderProps } from './types';
|
|
49
2
|
declare function __VLS_template(): {
|
|
50
3
|
attrs: Partial<{}>;
|
|
51
4
|
slots: {
|
|
@@ -57,16 +10,16 @@ declare function __VLS_template(): {
|
|
|
57
10
|
rootEl: HTMLElement;
|
|
58
11
|
};
|
|
59
12
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
60
|
-
declare const __VLS_component: import('vue').DefineComponent<
|
|
13
|
+
declare const __VLS_component: import('vue').DefineComponent<PageHeaderProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
61
14
|
command: (command: string) => any;
|
|
62
15
|
logout: () => any;
|
|
63
|
-
}, string, import('vue').PublicProps, Readonly<
|
|
16
|
+
}, string, import('vue').PublicProps, Readonly<PageHeaderProps> & Readonly<{
|
|
64
17
|
onCommand?: ((command: string) => any) | undefined;
|
|
65
18
|
onLogout?: (() => any) | undefined;
|
|
66
19
|
}>, {
|
|
67
20
|
height: string | number;
|
|
68
|
-
statusIcons:
|
|
69
|
-
userDropdownItems:
|
|
21
|
+
statusIcons: import('./types').PageHeaderStatusIcon[];
|
|
22
|
+
userDropdownItems: import('./types').PageHeaderUserDropdonItem[];
|
|
70
23
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
|
|
71
24
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
72
25
|
export default _default;
|