@apptegy/nuxt-navigation 0.1.43 → 0.1.45
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/module.json +1 -1
- package/dist/runtime/components/Nav/ImpersonateInfoPanel.vue +5 -2
- package/dist/runtime/components/Nav/Sidebar.vue +5 -0
- package/dist/runtime/components/Nav/SidebarItem.vue +4 -0
- package/dist/runtime/components/Nav/SidebarSection.vue +13 -4
- package/dist/runtime/composables/useDropdown.d.ts +4 -2
- package/dist/runtime/composables/useDropdown.js +11 -5
- package/package.json +14 -14
package/dist/module.json
CHANGED
|
@@ -121,7 +121,7 @@ onMounted(() => {
|
|
|
121
121
|
grid-column: 2;
|
|
122
122
|
font-size: 12px;
|
|
123
123
|
font-style: normal;
|
|
124
|
-
font-weight:
|
|
124
|
+
font-weight: 400;
|
|
125
125
|
line-height: 16px;
|
|
126
126
|
letter-spacing: 0.4px;
|
|
127
127
|
max-width: 165px;
|
|
@@ -135,9 +135,12 @@ onMounted(() => {
|
|
|
135
135
|
color: var(--nav-text-color, var(--primary-white));
|
|
136
136
|
font-size: 11px;
|
|
137
137
|
font-style: normal;
|
|
138
|
-
font-weight:
|
|
138
|
+
font-weight: 400;
|
|
139
139
|
line-height: 12px;
|
|
140
140
|
letter-spacing: 0.4px;
|
|
141
|
+
max-width: 165px;
|
|
142
|
+
overflow: hidden;
|
|
143
|
+
text-overflow: ellipsis;
|
|
141
144
|
}
|
|
142
145
|
.a-nav-section--title .a-nav-section-title-wrapper .user-grid .panel-icon {
|
|
143
146
|
transition: transform 0.2s ease-in-out;
|
|
@@ -169,9 +169,14 @@ function onHoverLeave() {
|
|
|
169
169
|
transition: width 0.3s ease;
|
|
170
170
|
height: 100%;
|
|
171
171
|
overflow-y: auto;
|
|
172
|
+
overflow-x: hidden;
|
|
173
|
+
scrollbar-width: none;
|
|
172
174
|
width: 64px;
|
|
173
175
|
position: relative;
|
|
174
176
|
}
|
|
177
|
+
.navbar::-webkit-scrollbar {
|
|
178
|
+
display: none;
|
|
179
|
+
}
|
|
175
180
|
.navbar a:focus-visible {
|
|
176
181
|
outline: var(--orange) auto 2px;
|
|
177
182
|
outline-offset: 0px;
|
|
@@ -32,6 +32,7 @@ const component = computed(()=> props.as || resolveComponent("NuxtLink"));
|
|
|
32
32
|
padding: 4px;
|
|
33
33
|
border: none;
|
|
34
34
|
border-radius: 8px;
|
|
35
|
+
user-select: none;
|
|
35
36
|
}
|
|
36
37
|
.a-navbar-item:focus-visible {
|
|
37
38
|
outline: var(--orange) auto 2px;
|
|
@@ -53,4 +54,7 @@ const component = computed(()=> props.as || resolveComponent("NuxtLink"));
|
|
|
53
54
|
outline-offset: 0px;
|
|
54
55
|
box-shadow: inset 0 0 0px 4px var(--primary-white);
|
|
55
56
|
}
|
|
57
|
+
.a-navbar-item:last-child {
|
|
58
|
+
margin-bottom: 8px;
|
|
59
|
+
}
|
|
56
60
|
</style>
|
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
<NuxtLink class="a-nav-section--link" :to="active ? '' : application.url" :aria-label="appText">
|
|
5
5
|
<svg :class="{ active }" width="32" height="32" viewBox="0 0 32 32" aria-hidden="true" v-html="icons[application.text as keyof typeof icons]"/>
|
|
6
6
|
<span v-if="expanded">{{ appText }}</span>
|
|
7
|
-
<a-icon v-if="expanded && active" class="caret-icon" icon="16:carret-up" />
|
|
7
|
+
<a-icon v-if="expanded && active" :class="['caret-icon', { 'collapse': !isOpen }]" icon="16:carret-up" @click="isOpen = !isOpen" />
|
|
8
8
|
</NuxtLink>
|
|
9
|
-
<div class="a-nav-section--content">
|
|
9
|
+
<div :class="['a-nav-section--content', { 'collapse': !isOpen }]">
|
|
10
10
|
<slot />
|
|
11
11
|
</div>
|
|
12
12
|
</div>
|
|
13
13
|
</template>
|
|
14
14
|
|
|
15
15
|
<script setup lang="ts">
|
|
16
|
-
import { useSidebar, computed } from "#imports";
|
|
16
|
+
import { useSidebar, computed, ref } from "#imports";
|
|
17
17
|
import type { IApplication } from "../../types";
|
|
18
18
|
import icons from "../../assets/iconPaths.json";
|
|
19
19
|
|
|
@@ -26,6 +26,9 @@ const appText = computed(() => props.application.text.replace("_", " "))
|
|
|
26
26
|
|
|
27
27
|
const { state: expanded } = useSidebar();
|
|
28
28
|
|
|
29
|
+
const isOpen = ref(true);
|
|
30
|
+
|
|
31
|
+
|
|
29
32
|
</script>
|
|
30
33
|
|
|
31
34
|
<style scoped>
|
|
@@ -35,11 +38,16 @@ const { state: expanded } = useSidebar();
|
|
|
35
38
|
}
|
|
36
39
|
.a-nav-section.active {
|
|
37
40
|
box-shadow: inset 0px -1px 0px 0px var(--nav-icon-background, rgb(80, 71, 100));
|
|
38
|
-
padding-bottom: 4px;
|
|
39
41
|
}
|
|
40
42
|
.a-nav-section--content {
|
|
41
43
|
display: flex;
|
|
42
44
|
flex-direction: column;
|
|
45
|
+
max-height: 100vh;
|
|
46
|
+
overflow: hidden;
|
|
47
|
+
transition: max-height 0.3s ease;
|
|
48
|
+
}
|
|
49
|
+
.a-nav-section--content.collapse {
|
|
50
|
+
max-height: 0;
|
|
43
51
|
}
|
|
44
52
|
.a-nav-section--link {
|
|
45
53
|
display: flex;
|
|
@@ -52,6 +60,7 @@ const { state: expanded } = useSidebar();
|
|
|
52
60
|
overflow: hidden;
|
|
53
61
|
padding: 0px 16px;
|
|
54
62
|
width: 100%;
|
|
63
|
+
user-select: none;
|
|
55
64
|
}
|
|
56
65
|
.a-nav-section--link svg:first-child {
|
|
57
66
|
background: var(--nav-icon-background, rgb(80, 71, 100));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Ref } from "#imports";
|
|
2
|
-
|
|
2
|
+
type OptionItem = string | Record<string, string | number | boolean>;
|
|
3
|
+
export declare function useDropdown(options: Array<OptionItem>, dropdownOptionsRef: Ref<Array<HTMLElement>>, dropdownTriggerRef: Ref<HTMLElement>, config?: {
|
|
3
4
|
searchable: boolean;
|
|
4
5
|
trackBy?: string;
|
|
5
6
|
}): {
|
|
@@ -12,5 +13,6 @@ export declare function useDropdown(options: Array<unknown>, dropdownOptionsRef:
|
|
|
12
13
|
keydownActionsOnTrigger: (event: KeyboardEvent) => void;
|
|
13
14
|
handleKeydown: (event: KeyboardEvent, index: number) => number | undefined;
|
|
14
15
|
handleDropdownSearch: (inputValue: KeyboardEvent & InputEvent) => void;
|
|
15
|
-
debouncedFocus:
|
|
16
|
+
debouncedFocus: import("@vueuse/core").PromisifyFn<(idx: number) => void>;
|
|
16
17
|
};
|
|
18
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useDebounceFn } from "@vueuse/core";
|
|
2
2
|
import { ref, nextTick } from "#imports";
|
|
3
3
|
export function useDropdown(options, dropdownOptionsRef, dropdownTriggerRef, config = { searchable: false, trackBy: "name" }) {
|
|
4
4
|
const active = ref(false);
|
|
@@ -172,7 +172,7 @@ export function useDropdown(options, dropdownOptionsRef, dropdownTriggerRef, con
|
|
|
172
172
|
break;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
const debouncedFocus =
|
|
175
|
+
const debouncedFocus = useDebounceFn((idx) => {
|
|
176
176
|
dropdownOptionsRef.value[idx].focus();
|
|
177
177
|
}, 500);
|
|
178
178
|
function handleDropdownSearch(inputValue) {
|
|
@@ -186,10 +186,16 @@ export function useDropdown(options, dropdownOptionsRef, dropdownTriggerRef, con
|
|
|
186
186
|
searchQuery.value = `${searchQuery.value}${pressedKey}`;
|
|
187
187
|
const searchIndex = options.findIndex((option) => {
|
|
188
188
|
if (!config.trackBy) {
|
|
189
|
-
return option.includes(searchQuery.value);
|
|
190
|
-
} else {
|
|
191
|
-
|
|
189
|
+
return typeof option === "string" && option.includes(searchQuery.value);
|
|
190
|
+
} else if (typeof option === "object" && option !== null && config.trackBy in option) {
|
|
191
|
+
const value = option[config.trackBy];
|
|
192
|
+
if (typeof value === "string") {
|
|
193
|
+
return value.toLowerCase().includes(searchQuery.value.toLowerCase());
|
|
194
|
+
} else if (value !== null && value !== void 0) {
|
|
195
|
+
return String(value).includes(searchQuery.value);
|
|
196
|
+
}
|
|
192
197
|
}
|
|
198
|
+
return false;
|
|
193
199
|
});
|
|
194
200
|
if (searchIndex !== -1) {
|
|
195
201
|
debouncedFocus(searchIndex);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apptegy/nuxt-navigation",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.45",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -27,25 +27,25 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@apptegy/nuxt-intl": "2.1.2",
|
|
30
|
-
"@nuxt/kit": "^3.
|
|
30
|
+
"@nuxt/kit": "^3.17.0",
|
|
31
31
|
"@vueuse/components": "12.8.2",
|
|
32
|
-
"
|
|
32
|
+
"@vueuse/core": "^12.8.2"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@nuxt/devtools": "^2.
|
|
36
|
-
"@nuxt/eslint-config": "^1.
|
|
35
|
+
"@nuxt/devtools": "^2.4.0",
|
|
36
|
+
"@nuxt/eslint-config": "^1.3.0",
|
|
37
37
|
"@nuxt/module-builder": "^0.8.4",
|
|
38
|
-
"@nuxt/schema": "^3.
|
|
38
|
+
"@nuxt/schema": "^3.17.0",
|
|
39
39
|
"@nuxt/test-utils": "^3.17.2",
|
|
40
|
-
"@types/node": "^20.17.
|
|
40
|
+
"@types/node": "^20.17.32",
|
|
41
41
|
"changelogen": "^0.5.7",
|
|
42
|
-
"eslint": "^9.
|
|
43
|
-
"nuxt": "^3.
|
|
44
|
-
"sass": "^1.
|
|
45
|
-
"typescript": "^5.8.
|
|
46
|
-
"vitest": "^3.
|
|
42
|
+
"eslint": "^9.25.1",
|
|
43
|
+
"nuxt": "^3.17.0",
|
|
44
|
+
"sass": "^1.87.0",
|
|
45
|
+
"typescript": "^5.8.3",
|
|
46
|
+
"vitest": "^3.1.2",
|
|
47
47
|
"vue": "^3.5.13",
|
|
48
|
-
"vue-tsc": "^2.2.
|
|
48
|
+
"vue-tsc": "^2.2.10"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "98fbfe464f87cbffa62256a493274fbdb7237ef2"
|
|
51
51
|
}
|