@apptegy/nuxt-navigation 0.1.18 → 0.1.19
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/Header.vue +2 -1
- package/dist/runtime/components/Nav/Sidebar.vue +7 -20
- package/dist/runtime/components/Nav/SidebarSection.vue +5 -2
- package/dist/runtime/components/Nav/UserDropdown.vue +2 -2
- package/dist/runtime/types/index.d.ts +13 -0
- package/dist/runtime/types/index.js +0 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -34,6 +34,7 @@ defineEmits(['selected-option']);
|
|
|
34
34
|
|
|
35
35
|
<style scoped>
|
|
36
36
|
header.header {
|
|
37
|
+
position: relative;
|
|
37
38
|
grid-area: navheader;
|
|
38
39
|
display: grid;
|
|
39
40
|
grid-auto-flow: column;
|
|
@@ -45,7 +46,7 @@ header.header {
|
|
|
45
46
|
background-color: var(--primary-white);
|
|
46
47
|
font: var(--font-regular);
|
|
47
48
|
}
|
|
48
|
-
@media only screen and (
|
|
49
|
+
@media only screen and (width <= 960px) {
|
|
49
50
|
header.header {
|
|
50
51
|
padding-left: 32px;
|
|
51
52
|
padding-right: 32px;
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
<slot name="logo" v-bind="expanded">
|
|
45
45
|
<NuxtLink v-if="expanded ? logo.src : logo.iconSrc" :to="homepageUrl">
|
|
46
46
|
<div class="navbar--logo">
|
|
47
|
-
<img :src="expanded ? logo.src : logo.iconSrc" :alt="logo.alt">
|
|
47
|
+
<img :src="expanded ? logo.src : logo.iconSrc" :alt="logo.alt || $t('navigation.logoAlt')">
|
|
48
48
|
</div>
|
|
49
49
|
</NuxtLink>
|
|
50
50
|
</slot>
|
|
@@ -54,24 +54,11 @@
|
|
|
54
54
|
|
|
55
55
|
<script setup lang="ts">
|
|
56
56
|
import { useNuxtApp, useSidebar } from '#imports';
|
|
57
|
+
import type { IApplication, IUser } from "../../types";
|
|
58
|
+
|
|
57
59
|
const { $t } = useNuxtApp();
|
|
58
60
|
const { state: expanded } = useSidebar();
|
|
59
61
|
|
|
60
|
-
interface IApplications {
|
|
61
|
-
id: number;
|
|
62
|
-
text: string;
|
|
63
|
-
url: string;
|
|
64
|
-
img_src: string;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
interface IUser {
|
|
68
|
-
show: boolean;
|
|
69
|
-
email: string;
|
|
70
|
-
phone_number: string;
|
|
71
|
-
client: string;
|
|
72
|
-
admin_email: string;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
62
|
interface ILogo {
|
|
76
63
|
alt: string;
|
|
77
64
|
src: string;
|
|
@@ -79,8 +66,8 @@ interface ILogo {
|
|
|
79
66
|
}
|
|
80
67
|
|
|
81
68
|
interface ISidebarProps {
|
|
82
|
-
applications: Array<
|
|
83
|
-
currentApplication?:
|
|
69
|
+
applications: Array<IApplication>;
|
|
70
|
+
currentApplication?: IApplication['text'];
|
|
84
71
|
homepageUrl?: string;
|
|
85
72
|
showHelpArticles?: boolean;
|
|
86
73
|
helpArticleOptions?: Array<unknown>;
|
|
@@ -103,7 +90,7 @@ withDefaults(defineProps<ISidebarProps>(), {
|
|
|
103
90
|
admin_email: '',
|
|
104
91
|
}),
|
|
105
92
|
logo: () => ({
|
|
106
|
-
alt: '
|
|
93
|
+
alt: '',
|
|
107
94
|
src: 'logo.svg',
|
|
108
95
|
iconSrc: 'icon.svg',
|
|
109
96
|
}),
|
|
@@ -111,7 +98,7 @@ withDefaults(defineProps<ISidebarProps>(), {
|
|
|
111
98
|
})
|
|
112
99
|
|
|
113
100
|
// Debounced Expand on Hover
|
|
114
|
-
let expandedTimer;
|
|
101
|
+
let expandedTimer = null;
|
|
115
102
|
function onHover() {
|
|
116
103
|
if(!expanded.value) {
|
|
117
104
|
expandedTimer = setTimeout(() => {
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
<script setup lang="ts">
|
|
15
15
|
import { useSidebar } from "#imports";
|
|
16
|
+
import type { IApplication } from "../../types";
|
|
16
17
|
|
|
17
18
|
defineProps<{
|
|
18
19
|
application: IApplication;
|
|
@@ -21,7 +22,7 @@ defineProps<{
|
|
|
21
22
|
|
|
22
23
|
const { state: expanded } = useSidebar();
|
|
23
24
|
|
|
24
|
-
function getActiveIcon(src){
|
|
25
|
+
function getActiveIcon(src: string){
|
|
25
26
|
return src.replace(".svg", "_active.svg");
|
|
26
27
|
};
|
|
27
28
|
</script>
|
|
@@ -29,7 +30,6 @@ function getActiveIcon(src){
|
|
|
29
30
|
<style scoped>
|
|
30
31
|
.a-nav-section {
|
|
31
32
|
box-shadow: inset 0px -1px 0px 0px var(--dscl-nav-section-border-bottom-color, var(--purple-65));
|
|
32
|
-
cursor: pointer;
|
|
33
33
|
min-height: 48px;
|
|
34
34
|
}
|
|
35
35
|
.a-nav-section.active {
|
|
@@ -52,6 +52,9 @@ function getActiveIcon(src){
|
|
|
52
52
|
padding: 0px 16px;
|
|
53
53
|
width: 100%;
|
|
54
54
|
}
|
|
55
|
+
.a-nav-section--link:not([href]) {
|
|
56
|
+
cursor: default;
|
|
57
|
+
}
|
|
55
58
|
.a-nav-section--link:focus-visible {
|
|
56
59
|
outline: var(--orange) auto 2px;
|
|
57
60
|
outline-offset: 0px;
|
|
@@ -44,9 +44,9 @@ function handleSelectedClick(index: number) {
|
|
|
44
44
|
function handleKeydownAction($event: KeyboardEvent, index: number) {
|
|
45
45
|
if ($event.key === "Enter" || $event.key === " ") {
|
|
46
46
|
emit("select-option", index);
|
|
47
|
-
|
|
48
|
-
handleKeydown($event, index);
|
|
47
|
+
$event?.target?.children[0]?.click();
|
|
49
48
|
}
|
|
49
|
+
handleKeydown($event, index);
|
|
50
50
|
}
|
|
51
51
|
</script>
|
|
52
52
|
|
|
File without changes
|