ketekny-ui-kit 1.0.87 → 1.0.89
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/package.json
CHANGED
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
@signup="handleSignup"
|
|
53
53
|
@signout="handleSignout"
|
|
54
54
|
@edit-profile="handleEditProfile"
|
|
55
|
+
@item-click="handleItemClick"
|
|
55
56
|
>
|
|
56
57
|
<template #sidebar-header>
|
|
57
58
|
<slot name="sidebar-header" />
|
|
@@ -103,7 +104,7 @@
|
|
|
103
104
|
:show-menu-search="showMenuSearch"
|
|
104
105
|
:menu-search-placeholder="menuSearchPlaceholder"
|
|
105
106
|
@logo-click="handleLogoClick"
|
|
106
|
-
@item-click="
|
|
107
|
+
@item-click="handleItemClick"
|
|
107
108
|
@signin="handleSignin"
|
|
108
109
|
@signup="handleSignup"
|
|
109
110
|
@signout="handleSignout"
|
|
@@ -141,7 +142,7 @@ export default {
|
|
|
141
142
|
kIcon,
|
|
142
143
|
SidebarPanel,
|
|
143
144
|
},
|
|
144
|
-
emits: ["logo-click", "signin", "signup", "signout", "edit-profile"],
|
|
145
|
+
emits: ["logo-click", "signin", "signup", "signout", "edit-profile", "item-click"],
|
|
145
146
|
props: {
|
|
146
147
|
title: { type: String, default: "" },
|
|
147
148
|
collapsedLogoSrc: {
|
|
@@ -275,6 +276,10 @@ export default {
|
|
|
275
276
|
this.closeMobileMenu();
|
|
276
277
|
this.$emit("edit-profile");
|
|
277
278
|
},
|
|
279
|
+
handleItemClick(item) {
|
|
280
|
+
this.closeMobileMenu();
|
|
281
|
+
this.$emit("item-click", item);
|
|
282
|
+
},
|
|
278
283
|
persistSidebarState() {
|
|
279
284
|
if (typeof window === "undefined") return;
|
|
280
285
|
|
|
@@ -12,18 +12,19 @@
|
|
|
12
12
|
<component
|
|
13
13
|
:is="menuItemComponent(item)"
|
|
14
14
|
v-bind="item.bindings"
|
|
15
|
-
class="flex min-w-0 flex-1 appearance-none items-center gap-3 border-
|
|
15
|
+
class="sidebar-menu-item flex min-w-0 flex-1 appearance-none items-center gap-3 rounded-r-xl border-l-2 border-transparent bg-transparent px-3 py-2 text-left outline-none transition-all duration-150"
|
|
16
16
|
:class="itemRowClasses(item)"
|
|
17
17
|
@click="handleItemClick(item, $event)"
|
|
18
18
|
>
|
|
19
19
|
<span
|
|
20
|
-
class="flex h-5 w-5 shrink-0 items-center justify-center
|
|
20
|
+
class="flex h-5 w-5 shrink-0 items-center justify-center transition-colors duration-150"
|
|
21
|
+
:class="item.active ? 'text-[#eef2f7]' : 'text-gray-500'"
|
|
21
22
|
>
|
|
22
23
|
<kIcon
|
|
23
24
|
v-if="showFullIcon(item)"
|
|
24
25
|
:name="item.icon"
|
|
25
26
|
size="18"
|
|
26
|
-
color="#eef2f7"
|
|
27
|
+
:color="item.active ? '#eef2f7' : '#9ca3af'"
|
|
27
28
|
/>
|
|
28
29
|
<span
|
|
29
30
|
v-else
|
|
@@ -37,7 +38,7 @@
|
|
|
37
38
|
<span
|
|
38
39
|
v-if="item.description"
|
|
39
40
|
class="mt-1 block truncate"
|
|
40
|
-
:class="[itemDescriptionClasses, item.active ? 'text-[#9fa6b5]' : 'text-[#6f7786]']"
|
|
41
|
+
:class="[itemDescriptionClasses, item.active ? 'text-[#9fa6b5]' : 'sidebar-menu-item-description text-[#6f7786]']"
|
|
41
42
|
>
|
|
42
43
|
{{ item.description }}
|
|
43
44
|
</span>
|
|
@@ -105,11 +106,6 @@ export default {
|
|
|
105
106
|
? "text-[12px] leading-4"
|
|
106
107
|
: "text-[11px] leading-4";
|
|
107
108
|
},
|
|
108
|
-
activeIndicatorClasses() {
|
|
109
|
-
return this.level === 0
|
|
110
|
-
? "before:left-0"
|
|
111
|
-
: "before:-left-4";
|
|
112
|
-
},
|
|
113
109
|
},
|
|
114
110
|
methods: {
|
|
115
111
|
menuItemComponent(item) {
|
|
@@ -135,9 +131,11 @@ export default {
|
|
|
135
131
|
return this.level === 0 && Boolean(item?.icon);
|
|
136
132
|
},
|
|
137
133
|
itemRowClasses(item) {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
134
|
+
if (item.active) {
|
|
135
|
+
return "sidebar-menu-item--active text-white border-l-[#2491ff] bg-[#141922]";
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return "text-[#e5e7eb] hover:text-white";
|
|
141
139
|
},
|
|
142
140
|
toggle(key) {
|
|
143
141
|
this.$emit("toggle-branch", key);
|
|
@@ -145,3 +143,13 @@ export default {
|
|
|
145
143
|
},
|
|
146
144
|
};
|
|
147
145
|
</script>
|
|
146
|
+
|
|
147
|
+
<style scoped>
|
|
148
|
+
.sidebar-menu-item--active {
|
|
149
|
+
box-shadow: inset 0 0 0 1px rgba(36, 145, 255, 0.1);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.sidebar-menu-item:hover .sidebar-menu-item-description {
|
|
153
|
+
color: #ffffff;
|
|
154
|
+
}
|
|
155
|
+
</style>
|