@apptegy/nuxt-navigation 0.1.60 → 0.1.61
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.d.mts +2 -1
- package/dist/module.json +5 -2
- package/dist/module.mjs +4 -1
- package/dist/runtime/components/Nav/Avatar.vue +8 -18
- package/dist/runtime/components/Nav/Avatar.vue.d.ts +12 -0
- package/dist/runtime/components/Nav/Breadcrumb.vue.d.ts +12 -0
- package/dist/runtime/components/Nav/Header.vue +7 -16
- package/dist/runtime/components/Nav/Header.vue.d.ts +32 -0
- package/dist/runtime/components/Nav/HelpArticles.vue +24 -38
- package/dist/runtime/components/Nav/HelpArticles.vue.d.ts +13 -0
- package/dist/runtime/components/Nav/Icons/ApptegyLogo.vue +7 -8
- package/dist/runtime/components/Nav/Icons/ApptegyLogo.vue.d.ts +14 -0
- package/dist/runtime/components/Nav/Icons/SidebarToggle.vue +2 -3
- package/dist/runtime/components/Nav/Icons/SidebarToggle.vue.d.ts +2 -0
- package/dist/runtime/components/Nav/Icons/ThrillshareLogo.vue.d.ts +2 -0
- package/dist/runtime/components/Nav/Icons/UserDropdownMenu.vue.d.ts +2 -0
- package/dist/runtime/components/Nav/ImpersonateInfoPanel.vue +7 -22
- package/dist/runtime/components/Nav/ImpersonateInfoPanel.vue.d.ts +12 -0
- package/dist/runtime/components/Nav/OrgSelect.vue +12 -30
- package/dist/runtime/components/Nav/OrgSelect.vue.d.ts +16 -0
- package/dist/runtime/components/Nav/Sidebar.vue +32 -69
- package/dist/runtime/components/Nav/Sidebar.vue.d.ts +59 -0
- package/dist/runtime/components/Nav/SidebarItem.vue +8 -9
- package/dist/runtime/components/Nav/SidebarItem.vue.d.ts +19 -0
- package/dist/runtime/components/Nav/SidebarSection.vue +6 -14
- package/dist/runtime/components/Nav/SidebarSection.vue.d.ts +17 -0
- package/dist/runtime/components/Nav/SidebarToggle.vue +4 -5
- package/dist/runtime/components/Nav/SidebarToggle.vue.d.ts +2 -0
- package/dist/runtime/components/Nav/SubMenu.vue +0 -4
- package/dist/runtime/components/Nav/SubMenu.vue.d.ts +12 -0
- package/dist/runtime/components/Nav/SubMenuItem.vue +3 -4
- package/dist/runtime/components/Nav/SubMenuItem.vue.d.ts +22 -0
- package/dist/runtime/components/Nav/UserDropdown.vue +14 -29
- package/dist/runtime/components/Nav/UserDropdown.vue.d.ts +17 -0
- package/dist/runtime/composables/useBranding.d.ts +20 -2
- package/dist/runtime/composables/useDropdown.d.ts +2 -2
- package/dist/runtime/composables/useDropdown.js +7 -14
- package/dist/runtime/composables/useSidebar.d.ts +1 -1
- package/dist/types.d.mts +3 -1
- package/package.json +17 -20
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -7
- package/dist/types.d.ts +0 -1
package/dist/module.d.mts
CHANGED
package/dist/module.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apptegy/nuxt-navigation",
|
|
3
|
+
"compatibility": {
|
|
4
|
+
"nuxt": ">=3.0.0"
|
|
5
|
+
},
|
|
3
6
|
"configKey": "@apptegy/nuxt-navigation",
|
|
4
|
-
"version": "0.1.
|
|
7
|
+
"version": "0.1.61",
|
|
5
8
|
"builder": {
|
|
6
|
-
"@nuxt/module-builder": "0.
|
|
9
|
+
"@nuxt/module-builder": "1.0.1",
|
|
7
10
|
"unbuild": "unknown"
|
|
8
11
|
}
|
|
9
12
|
}
|
package/dist/module.mjs
CHANGED
|
@@ -2,7 +2,10 @@ import { defineNuxtModule, createResolver, addComponentsDir, addImportsDir } fro
|
|
|
2
2
|
|
|
3
3
|
const module = defineNuxtModule({
|
|
4
4
|
meta: {
|
|
5
|
-
name: "@apptegy/nuxt-navigation"
|
|
5
|
+
name: "@apptegy/nuxt-navigation",
|
|
6
|
+
compatibility: {
|
|
7
|
+
nuxt: ">=3.0.0"
|
|
8
|
+
}
|
|
6
9
|
},
|
|
7
10
|
setup(_options, nuxt) {
|
|
8
11
|
const resolver = createResolver(import.meta.url);
|
|
@@ -5,25 +5,15 @@
|
|
|
5
5
|
</span>
|
|
6
6
|
</template>
|
|
7
7
|
|
|
8
|
-
<script setup
|
|
9
|
-
import { computed } from
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*/
|
|
15
|
-
src?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Defines the name value that will be displayed as initials alongside the avatar.
|
|
18
|
-
*/
|
|
19
|
-
name: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const props = defineProps<IAvatarProps>();
|
|
23
|
-
|
|
8
|
+
<script setup>
|
|
9
|
+
import { computed } from "vue";
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
src: { type: String, required: false },
|
|
12
|
+
name: { type: String, required: true }
|
|
13
|
+
});
|
|
24
14
|
const initials = computed(() => {
|
|
25
|
-
const
|
|
26
|
-
return ((
|
|
15
|
+
const initials2 = props.name.match(/\b\w/g) || [];
|
|
16
|
+
return ((initials2.shift() || "") + (initials2.pop() || "")).toUpperCase();
|
|
27
17
|
});
|
|
28
18
|
</script>
|
|
29
19
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface IAvatarProps {
|
|
2
|
+
/**
|
|
3
|
+
* Defines the src property of the image to be rendered.
|
|
4
|
+
*/
|
|
5
|
+
src?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Defines the name value that will be displayed as initials alongside the avatar.
|
|
8
|
+
*/
|
|
9
|
+
name: string;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: import("vue").DefineComponent<IAvatarProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IAvatarProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare var __VLS_7: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_7) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -13,22 +13,13 @@
|
|
|
13
13
|
</header>
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
|
-
<script setup
|
|
17
|
-
|
|
18
|
-
sticky
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
name: string;
|
|
24
|
-
email: string;
|
|
25
|
-
avatar?: string;
|
|
26
|
-
};
|
|
27
|
-
userDropdownOptions: Array<unknown>;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
defineProps<IHeaderProps & IUserDropdown>();
|
|
31
|
-
defineEmits(['selected-option']);
|
|
16
|
+
<script setup>
|
|
17
|
+
defineProps({
|
|
18
|
+
sticky: { type: Boolean, required: false },
|
|
19
|
+
user: { type: Object, required: true },
|
|
20
|
+
userDropdownOptions: { type: Array, required: true }
|
|
21
|
+
});
|
|
22
|
+
defineEmits(["selected-option"]);
|
|
32
23
|
</script>
|
|
33
24
|
|
|
34
25
|
<style scoped>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
interface IHeaderProps {
|
|
2
|
+
sticky?: boolean;
|
|
3
|
+
}
|
|
4
|
+
interface IUserDropdown {
|
|
5
|
+
user: {
|
|
6
|
+
name: string;
|
|
7
|
+
email: string;
|
|
8
|
+
avatar?: string;
|
|
9
|
+
};
|
|
10
|
+
userDropdownOptions: Array<unknown>;
|
|
11
|
+
}
|
|
12
|
+
type __VLS_Props = IHeaderProps & IUserDropdown;
|
|
13
|
+
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
|
|
14
|
+
type __VLS_Slots = {} & {
|
|
15
|
+
breadcrumbs?: (props: typeof __VLS_1) => any;
|
|
16
|
+
} & {
|
|
17
|
+
'org-select'?: (props: typeof __VLS_3) => any;
|
|
18
|
+
} & {
|
|
19
|
+
'user-controls'?: (props: typeof __VLS_5) => any;
|
|
20
|
+
};
|
|
21
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
|
+
"selected-option": (...args: any[]) => void;
|
|
23
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
24
|
+
"onSelected-option"?: ((...args: any[]) => any) | undefined;
|
|
25
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
27
|
+
export default _default;
|
|
28
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
29
|
+
new (): {
|
|
30
|
+
$slots: S;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
v-if="showHelpArticles"
|
|
16
16
|
:id="!isDropdown && 'help-btn'"
|
|
17
17
|
:class="[
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
'help-articles-btn',
|
|
19
|
+
!isDropdown && 'help-btn',
|
|
20
|
+
isRoomsUser && `help-btn-${userRoomsRole}`
|
|
21
|
+
]"
|
|
22
22
|
:aria-label="isDropdown ? $t('navigation.helpCenter') : $t('navigation.helpArticles')"
|
|
23
23
|
@click="expandDropdown"
|
|
24
24
|
>
|
|
@@ -41,60 +41,46 @@
|
|
|
41
41
|
</div>
|
|
42
42
|
</template>
|
|
43
43
|
|
|
44
|
-
<script setup
|
|
44
|
+
<script setup>
|
|
45
45
|
import { useSidebar, navigateTo, useAuth } from "#imports";
|
|
46
|
-
import { ref, computed, onMounted } from
|
|
47
|
-
|
|
48
|
-
interface IHelpArticlesProps {
|
|
49
|
-
helpArticleOptions: Array<unknown>;
|
|
50
|
-
settingsRoute: string;
|
|
51
|
-
schoolWebsite: string;
|
|
52
|
-
showHelpArticles: boolean;
|
|
53
|
-
};
|
|
54
|
-
|
|
46
|
+
import { ref, computed, onMounted } from "vue";
|
|
47
|
+
;
|
|
55
48
|
const { userProfile } = useAuth();
|
|
56
|
-
const props =
|
|
57
|
-
helpArticleOptions: () => [],
|
|
58
|
-
settingsRoute:
|
|
59
|
-
schoolWebsite:
|
|
60
|
-
showHelpArticles: false
|
|
61
|
-
})
|
|
62
|
-
|
|
49
|
+
const props = defineProps({
|
|
50
|
+
helpArticleOptions: { type: Array, required: true, default: () => [] },
|
|
51
|
+
settingsRoute: { type: String, required: true, default: "" },
|
|
52
|
+
schoolWebsite: { type: String, required: true, default: "" },
|
|
53
|
+
showHelpArticles: { type: Boolean, required: true, default: false }
|
|
54
|
+
});
|
|
63
55
|
const { state: expandedSidebar } = useSidebar();
|
|
64
|
-
|
|
65
56
|
const expanded = ref(false);
|
|
66
57
|
const helpBtnActions = ref();
|
|
67
58
|
const dropdownScrollHeight = ref(0);
|
|
68
59
|
const isDropdown = ref(false);
|
|
69
|
-
|
|
70
60
|
const isRoomsUser = computed(() => {
|
|
71
|
-
return !!userProfile.value?.roles?.rooms
|
|
61
|
+
return !!userProfile.value?.roles?.rooms;
|
|
72
62
|
});
|
|
73
|
-
|
|
74
63
|
const userRoomsRole = computed(() => {
|
|
75
|
-
return userProfile.value?.roles?.rooms
|
|
64
|
+
return userProfile.value?.roles?.rooms;
|
|
76
65
|
});
|
|
77
|
-
|
|
78
|
-
const hasArticles = computed(() => !!props.helpArticleOptions?.values?.length)
|
|
79
|
-
|
|
66
|
+
const hasArticles = computed(() => !!props.helpArticleOptions?.values?.length);
|
|
80
67
|
onMounted(() => {
|
|
81
68
|
isDropdown.value = !!props.helpArticleOptions?.values?.length;
|
|
82
69
|
dropdownScrollHeight.value = helpBtnActions.value?.scrollHeight + 12;
|
|
83
70
|
});
|
|
84
|
-
|
|
85
71
|
function expandDropdown() {
|
|
86
72
|
if (!isDropdown.value) return;
|
|
87
73
|
expanded.value = !expanded.value;
|
|
88
|
-
}
|
|
89
|
-
|
|
74
|
+
}
|
|
75
|
+
;
|
|
90
76
|
async function goToSettings() {
|
|
91
|
-
await navigateTo(`${props.settingsRoute}`, {external: true});
|
|
92
|
-
}
|
|
93
|
-
|
|
77
|
+
await navigateTo(`${props.settingsRoute}`, { external: true });
|
|
78
|
+
}
|
|
79
|
+
;
|
|
94
80
|
async function goToWebsite() {
|
|
95
|
-
await navigateTo(`${props.schoolWebsite}`, {external: true});
|
|
96
|
-
}
|
|
97
|
-
|
|
81
|
+
await navigateTo(`${props.schoolWebsite}`, { external: true });
|
|
82
|
+
}
|
|
83
|
+
;
|
|
98
84
|
</script>
|
|
99
85
|
|
|
100
86
|
<style scoped>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface IHelpArticlesProps {
|
|
2
|
+
helpArticleOptions: Array<unknown>;
|
|
3
|
+
settingsRoute: string;
|
|
4
|
+
schoolWebsite: string;
|
|
5
|
+
showHelpArticles: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: import("vue").DefineComponent<IHelpArticlesProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IHelpArticlesProps> & Readonly<{}>, {
|
|
8
|
+
helpArticleOptions: Array<unknown>;
|
|
9
|
+
settingsRoute: string;
|
|
10
|
+
schoolWebsite: string;
|
|
11
|
+
showHelpArticles: boolean;
|
|
12
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
export default _default;
|
|
@@ -15,17 +15,16 @@
|
|
|
15
15
|
</g>
|
|
16
16
|
</svg>
|
|
17
17
|
</template>
|
|
18
|
-
<script setup lang="ts">
|
|
19
|
-
import { computed } from 'vue';
|
|
20
18
|
|
|
19
|
+
<script setup>
|
|
20
|
+
import { computed } from "vue";
|
|
21
21
|
const props = defineProps({
|
|
22
22
|
useLightLogo: {
|
|
23
23
|
type: Boolean,
|
|
24
|
-
default: false
|
|
25
|
-
}
|
|
26
|
-
})
|
|
27
|
-
|
|
24
|
+
default: false
|
|
25
|
+
}
|
|
26
|
+
});
|
|
28
27
|
const fillColor = computed(() => {
|
|
29
|
-
return props.useLightLogo ?
|
|
28
|
+
return props.useLightLogo ? "#FFFFFF" : "#503462";
|
|
30
29
|
});
|
|
31
|
-
</script>
|
|
30
|
+
</script>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
useLightLogo: {
|
|
3
|
+
type: BooleanConstructor;
|
|
4
|
+
default: boolean;
|
|
5
|
+
};
|
|
6
|
+
}>, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
7
|
+
useLightLogo: {
|
|
8
|
+
type: BooleanConstructor;
|
|
9
|
+
default: boolean;
|
|
10
|
+
};
|
|
11
|
+
}>> & Readonly<{}>, {
|
|
12
|
+
useLightLogo: boolean;
|
|
13
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
14
|
+
export default _default;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
|
3
3
|
<rect x="4.3335" y="5.5" width="15.3333" height="13" rx="0.666667" stroke="currentColor"/>
|
|
4
|
-
<rect x="4.3335" y="5.5" :width="expanded ? 6: 2" height="13" rx="0.666667" fill="currentColor" stroke="currentColor" stroke-linecap="round"/>
|
|
4
|
+
<rect x="4.3335" y="5.5" :width="expanded ? 6 : 2" height="13" rx="0.666667" fill="currentColor" stroke="currentColor" stroke-linecap="round"/>
|
|
5
5
|
</svg>
|
|
6
6
|
</template>
|
|
7
7
|
|
|
8
|
-
<script setup
|
|
8
|
+
<script setup>
|
|
9
9
|
import { useSidebar } from "#imports";
|
|
10
|
-
|
|
11
10
|
const { state: expanded } = useSidebar();
|
|
12
11
|
</script>
|
|
13
12
|
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -36,33 +36,18 @@
|
|
|
36
36
|
</div>
|
|
37
37
|
</template>
|
|
38
38
|
|
|
39
|
-
<script setup
|
|
40
|
-
import { ref, onMounted, useSidebar } from
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
client: string;
|
|
45
|
-
email: string;
|
|
46
|
-
phone_number: string;
|
|
47
|
-
show: boolean;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
interface IPanelProps {
|
|
51
|
-
impersonatedUser: ImpersonatedUser;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
defineProps<IPanelProps>();
|
|
55
|
-
|
|
39
|
+
<script setup>
|
|
40
|
+
import { ref, onMounted, useSidebar } from "#imports";
|
|
41
|
+
defineProps({
|
|
42
|
+
impersonatedUser: { type: Object, required: true }
|
|
43
|
+
});
|
|
56
44
|
const { state: sidebarExpanded } = useSidebar();
|
|
57
|
-
|
|
58
45
|
const expanded = ref(false);
|
|
59
46
|
const dropdownScrollHeight = ref(0);
|
|
60
47
|
const dropdownWrapper = ref();
|
|
61
|
-
|
|
62
48
|
onMounted(() => {
|
|
63
|
-
dropdownScrollHeight.value = dropdownWrapper.value?.scrollHeight
|
|
64
|
-
})
|
|
65
|
-
|
|
49
|
+
dropdownScrollHeight.value = dropdownWrapper.value?.scrollHeight;
|
|
50
|
+
});
|
|
66
51
|
</script>
|
|
67
52
|
|
|
68
53
|
<style scoped>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface ImpersonatedUser {
|
|
2
|
+
admin_email: string;
|
|
3
|
+
client: string;
|
|
4
|
+
email: string;
|
|
5
|
+
phone_number: string;
|
|
6
|
+
show: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface IPanelProps {
|
|
9
|
+
impersonatedUser: ImpersonatedUser;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: import("vue").DefineComponent<IPanelProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IPanelProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
export default _default;
|
|
@@ -1,35 +1,19 @@
|
|
|
1
|
-
<script setup
|
|
1
|
+
<script setup>
|
|
2
2
|
import { useDropdown, useNuxtApp, useAppConfig, computed, ref } from "#imports";
|
|
3
3
|
import { vOnClickOutside } from "@vueuse/components";
|
|
4
|
-
|
|
5
4
|
const { $t } = useNuxtApp();
|
|
6
5
|
const appConfig = useAppConfig();
|
|
7
|
-
const zIndex = computed(() => appConfig?.navigation?.zIndex || 100)
|
|
8
|
-
|
|
9
|
-
interface IOrg {
|
|
10
|
-
name: string;
|
|
11
|
-
id: number;
|
|
12
|
-
intranet?: boolean;
|
|
13
|
-
pinned?: boolean;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
interface IOrgSelectProps {
|
|
17
|
-
orgs: Array<IOrg>;
|
|
18
|
-
modelValue: number;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const emit = defineEmits<{
|
|
22
|
-
"update:model-value": [index: number];
|
|
23
|
-
}>();
|
|
24
|
-
|
|
6
|
+
const zIndex = computed(() => appConfig?.navigation?.zIndex || 100);
|
|
7
|
+
const emit = defineEmits(["update:model-value"]);
|
|
25
8
|
const dropdownTriggerRef = ref();
|
|
26
9
|
const optionRef = ref();
|
|
27
10
|
const selectedOrg = computed(() => {
|
|
28
11
|
return props.orgs.find(({ id }) => id == props.modelValue);
|
|
29
12
|
});
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
13
|
+
const props = defineProps({
|
|
14
|
+
orgs: { type: Array, required: true },
|
|
15
|
+
modelValue: { type: Number, required: true }
|
|
16
|
+
});
|
|
33
17
|
const {
|
|
34
18
|
active,
|
|
35
19
|
searchQuery,
|
|
@@ -38,12 +22,11 @@ const {
|
|
|
38
22
|
onClickOutsideHandler,
|
|
39
23
|
keydownActionsOnTrigger,
|
|
40
24
|
handleKeydown,
|
|
41
|
-
handleDropdownSearch
|
|
25
|
+
handleDropdownSearch
|
|
42
26
|
} = useDropdown(props.orgs, optionRef, dropdownTriggerRef, {
|
|
43
27
|
searchable: true,
|
|
44
|
-
trackBy: "name"
|
|
28
|
+
trackBy: "name"
|
|
45
29
|
});
|
|
46
|
-
|
|
47
30
|
const sortedOrgs = computed(() => {
|
|
48
31
|
return [...props.orgs].sort((a, b) => {
|
|
49
32
|
if (a.pinned && !b.pinned) {
|
|
@@ -55,14 +38,13 @@ const sortedOrgs = computed(() => {
|
|
|
55
38
|
}
|
|
56
39
|
});
|
|
57
40
|
});
|
|
58
|
-
|
|
59
|
-
function handleSelectedOrg($event: KeyboardEvent | MouseEvent, orgId: number) {
|
|
41
|
+
function handleSelectedOrg($event, orgId) {
|
|
60
42
|
if ($event.type == "click") {
|
|
61
43
|
emit("update:model-value", orgId);
|
|
62
44
|
closeDropdown();
|
|
63
45
|
} else if ($event.type == "keydown") {
|
|
64
46
|
emit("update:model-value", orgId);
|
|
65
|
-
handleKeydown($event
|
|
47
|
+
handleKeydown($event, orgId);
|
|
66
48
|
}
|
|
67
49
|
}
|
|
68
50
|
</script>
|
|
@@ -96,7 +78,7 @@ function handleSelectedOrg($event: KeyboardEvent | MouseEvent, orgId: number) {
|
|
|
96
78
|
{{ $t("navigation.orgBadge") }}
|
|
97
79
|
</span>
|
|
98
80
|
<a-icon
|
|
99
|
-
:icon="active ? '16:carret-up': '16:carret-down'"
|
|
81
|
+
:icon="active ? '16:carret-up' : '16:carret-down'"
|
|
100
82
|
@keydown="keydownActionsOnTrigger"
|
|
101
83
|
@click.prevent="toggleDropdown"
|
|
102
84
|
@input="handleDropdownSearch"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface IOrg {
|
|
2
|
+
name: string;
|
|
3
|
+
id: number;
|
|
4
|
+
intranet?: boolean;
|
|
5
|
+
pinned?: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface IOrgSelectProps {
|
|
8
|
+
orgs: Array<IOrg>;
|
|
9
|
+
modelValue: number;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: import("vue").DefineComponent<IOrgSelectProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
+
"update:model-value": (index: number) => any;
|
|
13
|
+
}, string, import("vue").PublicProps, Readonly<IOrgSelectProps> & Readonly<{
|
|
14
|
+
"onUpdate:model-value"?: ((index: number) => any) | undefined;
|
|
15
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
export default _default;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
class="skip-to-content"
|
|
14
14
|
data-testid="skip-to-content"
|
|
15
15
|
>
|
|
16
|
-
{{ $t(
|
|
16
|
+
{{ $t("navigation.skipToContent") }}
|
|
17
17
|
</a>
|
|
18
18
|
<div :class="['navbar--wrapper', fixed && 'fixed']" >
|
|
19
19
|
<div class="navbar--header">
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
|
|
65
65
|
<slot name="logo">
|
|
66
66
|
<template v-if="brand">
|
|
67
|
-
<NuxtLink v-if="expanded ?
|
|
67
|
+
<NuxtLink v-if="expanded ? logo.src : logo.iconSrc" :to="homepageUrl">
|
|
68
68
|
<div class="navbar--footer-logo">
|
|
69
69
|
<img :src="expanded ? logo.src : logo.iconSrc" :alt="logo.alt || $t('navigation.logoAlt')">
|
|
70
70
|
</div>
|
|
@@ -76,93 +76,56 @@
|
|
|
76
76
|
</nav>
|
|
77
77
|
</template>
|
|
78
78
|
|
|
79
|
-
<script setup
|
|
80
|
-
import { useSidebar, useBranding, useNuxtApp, ref, watch } from
|
|
81
|
-
import
|
|
82
|
-
import ApptegyLogo from './Icons/ApptegyLogo.vue';
|
|
83
|
-
|
|
79
|
+
<script setup>
|
|
80
|
+
import { useSidebar, useBranding, useNuxtApp, ref, watch } from "#imports";
|
|
81
|
+
import ApptegyLogo from "./Icons/ApptegyLogo.vue";
|
|
84
82
|
const { $t } = useNuxtApp();
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
clientId: number;
|
|
94
|
-
applications: Array<IApplication>;
|
|
95
|
-
currentApplication?: IApplication['text'];
|
|
96
|
-
homepageUrl?: string;
|
|
97
|
-
showHelpArticles?: boolean;
|
|
98
|
-
helpArticleOptions?: Array<unknown>;
|
|
99
|
-
impersonatedUser?: IUser;
|
|
100
|
-
logo?: ILogo;
|
|
101
|
-
skipToContent: string;
|
|
102
|
-
useApptegyLogo?: boolean;
|
|
103
|
-
fixed?: boolean;
|
|
104
|
-
isAdmin?: boolean;
|
|
105
|
-
settingsRoute: string;
|
|
106
|
-
schoolWebsite: string;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
const props = withDefaults(defineProps<ISidebarProps>(), {
|
|
110
|
-
applications: () => [],
|
|
111
|
-
currentApplication: 'media',
|
|
112
|
-
homepageUrl: '/',
|
|
113
|
-
showHelpArticles: true,
|
|
114
|
-
helpArticleOptions: () => [],
|
|
115
|
-
impersonatedUser: () => ({
|
|
83
|
+
const props = defineProps({
|
|
84
|
+
clientId: { type: Number, required: true, default: void 0 },
|
|
85
|
+
applications: { type: Array, required: true, default: () => [] },
|
|
86
|
+
currentApplication: { type: String, required: false, default: "media" },
|
|
87
|
+
homepageUrl: { type: String, required: false, default: "/" },
|
|
88
|
+
showHelpArticles: { type: Boolean, required: false, default: true },
|
|
89
|
+
helpArticleOptions: { type: Array, required: false, default: () => [] },
|
|
90
|
+
impersonatedUser: { type: Object, required: false, default: () => ({
|
|
116
91
|
show: false,
|
|
117
92
|
email: "staff3@lms.com",
|
|
118
|
-
phone_number:
|
|
93
|
+
phone_number: "",
|
|
119
94
|
client: "Sales Demo",
|
|
120
|
-
admin_email:
|
|
121
|
-
}),
|
|
122
|
-
logo: () => ({
|
|
123
|
-
alt:
|
|
124
|
-
src:
|
|
125
|
-
iconSrc:
|
|
126
|
-
}),
|
|
127
|
-
skipToContent:
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
schoolWebsite: '',
|
|
95
|
+
admin_email: ""
|
|
96
|
+
}) },
|
|
97
|
+
logo: { type: Object, required: false, default: () => ({
|
|
98
|
+
alt: "",
|
|
99
|
+
src: "poweredby.svg",
|
|
100
|
+
iconSrc: "poweredby-icon.svg"
|
|
101
|
+
}) },
|
|
102
|
+
skipToContent: { type: String, required: true, default: "#main-content-section" },
|
|
103
|
+
useApptegyLogo: { type: Boolean, required: false, default: false },
|
|
104
|
+
fixed: { type: Boolean, required: false, default: false },
|
|
105
|
+
isAdmin: { type: Boolean, required: false, default: false },
|
|
106
|
+
settingsRoute: { type: String, required: true, default: "" },
|
|
107
|
+
schoolWebsite: { type: String, required: true, default: "" }
|
|
134
108
|
});
|
|
135
|
-
|
|
136
|
-
const emit = defineEmits<{
|
|
137
|
-
(e: 'toggle-expand', width: number): void
|
|
138
|
-
}>();
|
|
139
|
-
|
|
109
|
+
const emit = defineEmits(["toggle-expand"]);
|
|
140
110
|
const { state: expanded } = useSidebar();
|
|
141
111
|
const { brand, getBrandingStyles } = await useBranding(props.clientId);
|
|
142
|
-
|
|
143
112
|
const brandLogo = ref(brand.value?.logo_light);
|
|
144
|
-
|
|
145
|
-
// Emit event when expanded changes with the
|
|
146
|
-
// width of the component.
|
|
147
113
|
watch(expanded, (value) => {
|
|
148
|
-
emit(
|
|
149
|
-
})
|
|
150
|
-
|
|
151
|
-
// Debounced Expand on Hover
|
|
114
|
+
emit("toggle-expand", value ? 264 : 64);
|
|
115
|
+
});
|
|
152
116
|
let expandedTimer = null;
|
|
153
117
|
function onHover() {
|
|
154
|
-
if(!expanded.value) {
|
|
118
|
+
if (!expanded.value) {
|
|
155
119
|
expandedTimer = setTimeout(() => {
|
|
156
120
|
expanded.value = true;
|
|
157
121
|
}, 280);
|
|
158
122
|
}
|
|
159
123
|
}
|
|
160
124
|
function onHoverLeave() {
|
|
161
|
-
if(!expanded.value) {
|
|
125
|
+
if (!expanded.value) {
|
|
162
126
|
clearTimeout(expandedTimer);
|
|
163
127
|
}
|
|
164
128
|
}
|
|
165
|
-
|
|
166
129
|
</script>
|
|
167
130
|
|
|
168
131
|
<style scoped>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { IApplication, IUser } from "../../types/index.js";
|
|
2
|
+
interface ILogo {
|
|
3
|
+
alt: string;
|
|
4
|
+
src: string;
|
|
5
|
+
iconSrc: string;
|
|
6
|
+
}
|
|
7
|
+
interface ISidebarProps {
|
|
8
|
+
clientId: number;
|
|
9
|
+
applications: Array<IApplication>;
|
|
10
|
+
currentApplication?: IApplication['text'];
|
|
11
|
+
homepageUrl?: string;
|
|
12
|
+
showHelpArticles?: boolean;
|
|
13
|
+
helpArticleOptions?: Array<unknown>;
|
|
14
|
+
impersonatedUser?: IUser;
|
|
15
|
+
logo?: ILogo;
|
|
16
|
+
skipToContent: string;
|
|
17
|
+
useApptegyLogo?: boolean;
|
|
18
|
+
fixed?: boolean;
|
|
19
|
+
isAdmin?: boolean;
|
|
20
|
+
settingsRoute: string;
|
|
21
|
+
schoolWebsite: string;
|
|
22
|
+
}
|
|
23
|
+
declare var __VLS_6: {}, __VLS_13: {}, __VLS_20: {}, __VLS_32: {};
|
|
24
|
+
type __VLS_Slots = {} & {
|
|
25
|
+
logo?: (props: typeof __VLS_6) => any;
|
|
26
|
+
} & {
|
|
27
|
+
switcher?: (props: typeof __VLS_13) => any;
|
|
28
|
+
} & {
|
|
29
|
+
default?: (props: typeof __VLS_20) => any;
|
|
30
|
+
} & {
|
|
31
|
+
logo?: (props: typeof __VLS_32) => any;
|
|
32
|
+
};
|
|
33
|
+
declare const __VLS_component: import("vue").DefineComponent<ISidebarProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
34
|
+
"toggle-expand": (width: number) => any;
|
|
35
|
+
}, string, import("vue").PublicProps, Readonly<ISidebarProps> & Readonly<{
|
|
36
|
+
"onToggle-expand"?: ((width: number) => any) | undefined;
|
|
37
|
+
}>, {
|
|
38
|
+
helpArticleOptions: Array<unknown>;
|
|
39
|
+
settingsRoute: string;
|
|
40
|
+
schoolWebsite: string;
|
|
41
|
+
showHelpArticles: boolean;
|
|
42
|
+
fixed: boolean;
|
|
43
|
+
impersonatedUser: IUser;
|
|
44
|
+
clientId: number;
|
|
45
|
+
applications: Array<IApplication>;
|
|
46
|
+
currentApplication: IApplication["text"];
|
|
47
|
+
homepageUrl: string;
|
|
48
|
+
logo: ILogo;
|
|
49
|
+
skipToContent: string;
|
|
50
|
+
useApptegyLogo: boolean;
|
|
51
|
+
isAdmin: boolean;
|
|
52
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
53
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
54
|
+
export default _default;
|
|
55
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
56
|
+
new (): {
|
|
57
|
+
$slots: S;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
<script setup
|
|
1
|
+
<script setup>
|
|
2
2
|
import { useSidebar, computed, resolveComponent } from "#imports";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}>()
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
icon: { type: String, required: false },
|
|
5
|
+
active: { type: Boolean, required: false },
|
|
6
|
+
as: { type: String, required: false }
|
|
7
|
+
});
|
|
9
8
|
const { state: expanded } = useSidebar();
|
|
10
|
-
const component = computed(()=> props.as || resolveComponent("NuxtLink"));
|
|
9
|
+
const component = computed(() => props.as || resolveComponent("NuxtLink"));
|
|
11
10
|
</script>
|
|
12
11
|
|
|
13
12
|
<template>
|
|
14
|
-
<component :is="component" class="a-navbar-item" :class="{expanded, active}">
|
|
13
|
+
<component :is="component" class="a-navbar-item" :class="{ expanded, active }">
|
|
15
14
|
<slot name="icon">
|
|
16
15
|
<a-icon class="icon" :icon="icon" font-size="24px"/>
|
|
17
16
|
</slot>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
icon?: string;
|
|
3
|
+
active?: boolean;
|
|
4
|
+
as?: string;
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_7: {}, __VLS_14: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
icon?: (props: typeof __VLS_7) => any;
|
|
9
|
+
} & {
|
|
10
|
+
default?: (props: typeof __VLS_14) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
14
|
+
export default _default;
|
|
15
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
16
|
+
new (): {
|
|
17
|
+
$slots: S;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
<!-- eslint-disable vue/no-v-html -->
|
|
2
1
|
<template>
|
|
3
2
|
<div class="a-nav-section" :class="{ active }">
|
|
4
3
|
<NuxtLink class="a-nav-section--link" :to="active ? '' : application.url" :aria-label="appText">
|
|
@@ -12,23 +11,16 @@
|
|
|
12
11
|
</div>
|
|
13
12
|
</template>
|
|
14
13
|
|
|
15
|
-
<script setup
|
|
14
|
+
<script setup>
|
|
16
15
|
import { useSidebar, computed, ref } from "#imports";
|
|
17
|
-
import type { IApplication } from "../../types";
|
|
18
16
|
import icons from "../../assets/iconPaths.json";
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const appText = computed(() => props.application.text.replace("_", " "))
|
|
26
|
-
|
|
17
|
+
const props = defineProps({
|
|
18
|
+
application: { type: Object, required: true },
|
|
19
|
+
active: { type: Boolean, required: true }
|
|
20
|
+
});
|
|
21
|
+
const appText = computed(() => props.application.text.replace("_", " "));
|
|
27
22
|
const { state: expanded } = useSidebar();
|
|
28
|
-
|
|
29
23
|
const isOpen = ref(true);
|
|
30
|
-
|
|
31
|
-
|
|
32
24
|
</script>
|
|
33
25
|
|
|
34
26
|
<style scoped>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IApplication } from "../../types/index.js";
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
application: IApplication;
|
|
4
|
+
active: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_22: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
default?: (props: typeof __VLS_22) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<button class="sidebar-toggle" :aria-expanded="state" @click="toggleSidebar">
|
|
3
3
|
<NavIconsSidebarToggle />
|
|
4
|
-
<span class="sr-only"> {{ $t(
|
|
4
|
+
<span class="sr-only"> {{ $t("navigation.sidebarToggle") }}</span>
|
|
5
5
|
</button>
|
|
6
6
|
</template>
|
|
7
7
|
|
|
8
|
-
<script setup
|
|
9
|
-
import { useSidebar } from
|
|
10
|
-
|
|
11
|
-
const { state, toggleSidebar } = useSidebar()
|
|
8
|
+
<script setup>
|
|
9
|
+
import { useSidebar } from "#imports";
|
|
10
|
+
const { state, toggleSidebar } = useSidebar();
|
|
12
11
|
</script>
|
|
13
12
|
|
|
14
13
|
<style scoped>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
7
|
+
export default _default;
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
9
|
+
new (): {
|
|
10
|
+
$slots: S;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare var __VLS_12: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_12) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
6
|
+
icon: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
}>, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
|
+
icon: {
|
|
12
|
+
type: StringConstructor;
|
|
13
|
+
required: true;
|
|
14
|
+
};
|
|
15
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
16
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -1,47 +1,32 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
import { useDropdown, useAppConfig
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useDropdown, useAppConfig, computed, ref } from "#imports";
|
|
3
3
|
import { vOnClickOutside } from "@vueuse/components";
|
|
4
|
-
|
|
5
|
-
interface IUserDropdown {
|
|
6
|
-
user: {
|
|
7
|
-
name: string;
|
|
8
|
-
avatar?: string;
|
|
9
|
-
email: string;
|
|
10
|
-
};
|
|
11
|
-
userDropdownOptions: Array<{ label: string; url: string; }>;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
4
|
const appConfig = useAppConfig();
|
|
15
|
-
const zIndex = computed(() => appConfig?.navigation?.zIndex || 100)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
5
|
+
const zIndex = computed(() => appConfig?.navigation?.zIndex || 100);
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
user: { type: Object, required: true },
|
|
8
|
+
userDropdownOptions: { type: Array, required: true }
|
|
9
|
+
});
|
|
10
|
+
const dropdownTriggerRef = ref();
|
|
11
|
+
const dropdownOptionsRef = ref();
|
|
22
12
|
const {
|
|
23
13
|
active,
|
|
24
14
|
toggleDropdown,
|
|
25
15
|
closeDropdown,
|
|
26
16
|
keydownActionsOnTrigger,
|
|
27
17
|
handleKeydown,
|
|
28
|
-
onClickOutsideHandler
|
|
18
|
+
onClickOutsideHandler
|
|
29
19
|
} = useDropdown(
|
|
30
20
|
props.userDropdownOptions,
|
|
31
21
|
dropdownOptionsRef,
|
|
32
|
-
dropdownTriggerRef
|
|
22
|
+
dropdownTriggerRef
|
|
33
23
|
);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"select-option": [index: number];
|
|
37
|
-
}>();
|
|
38
|
-
|
|
39
|
-
function handleSelectedClick(index: number) {
|
|
24
|
+
const emit = defineEmits(["select-option"]);
|
|
25
|
+
function handleSelectedClick(index) {
|
|
40
26
|
emit("select-option", index);
|
|
41
27
|
closeDropdown();
|
|
42
28
|
}
|
|
43
|
-
|
|
44
|
-
function handleKeydownAction($event: KeyboardEvent, index: number) {
|
|
29
|
+
function handleKeydownAction($event, index) {
|
|
45
30
|
if ($event.key === "Enter" || $event.key === " ") {
|
|
46
31
|
emit("select-option", index);
|
|
47
32
|
$event?.target?.children[0]?.click();
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface IUserDropdown {
|
|
2
|
+
user: {
|
|
3
|
+
name: string;
|
|
4
|
+
avatar?: string;
|
|
5
|
+
email: string;
|
|
6
|
+
};
|
|
7
|
+
userDropdownOptions: Array<{
|
|
8
|
+
label: string;
|
|
9
|
+
url: string;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
12
|
+
declare const _default: import("vue").DefineComponent<IUserDropdown, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
"select-option": (index: number) => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<IUserDropdown> & Readonly<{
|
|
15
|
+
"onSelect-option"?: ((index: number) => any) | undefined;
|
|
16
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
export default _default;
|
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
export declare function useBranding(clientId?: number): Promise<{
|
|
2
|
-
brand:
|
|
3
|
-
getBrandingStyles:
|
|
2
|
+
brand: import("vue").Ref<null, null>;
|
|
3
|
+
getBrandingStyles: import("vue").ComputedRef<{
|
|
4
|
+
'--brand-color'?: undefined;
|
|
5
|
+
'--nav-background-color'?: undefined;
|
|
6
|
+
'--nav-text-color'?: undefined;
|
|
7
|
+
'--nav-border-colors'?: undefined;
|
|
8
|
+
'--nav-icon-background'?: undefined;
|
|
9
|
+
'--nav-icon-color'?: undefined;
|
|
10
|
+
'--nav-active-icon-background'?: undefined;
|
|
11
|
+
'--nav-active-icon-color'?: undefined;
|
|
12
|
+
} | {
|
|
13
|
+
'--brand-color': any;
|
|
14
|
+
'--nav-background-color': string;
|
|
15
|
+
'--nav-text-color': string;
|
|
16
|
+
'--nav-border-colors': string;
|
|
17
|
+
'--nav-icon-background': string;
|
|
18
|
+
'--nav-icon-color': string;
|
|
19
|
+
'--nav-active-icon-background': string;
|
|
20
|
+
'--nav-active-icon-color': string;
|
|
21
|
+
}>;
|
|
4
22
|
}>;
|
|
@@ -4,8 +4,8 @@ export declare function useDropdown(options: Array<OptionItem>, dropdownOptionsR
|
|
|
4
4
|
searchable: boolean;
|
|
5
5
|
trackBy?: string;
|
|
6
6
|
}): {
|
|
7
|
-
active:
|
|
8
|
-
searchQuery:
|
|
7
|
+
active: Ref<boolean, boolean>;
|
|
8
|
+
searchQuery: Ref<string, string>;
|
|
9
9
|
toggleDropdown: ($event: KeyboardEvent | MouseEvent) => Promise<void>;
|
|
10
10
|
openDropdown: () => void;
|
|
11
11
|
closeDropdown: () => void;
|
|
@@ -18,20 +18,17 @@ export function useDropdown(options, dropdownOptionsRef, dropdownTriggerRef, con
|
|
|
18
18
|
active.value = false;
|
|
19
19
|
}
|
|
20
20
|
function onClickOutsideHandler() {
|
|
21
|
-
if (!active.value)
|
|
22
|
-
return;
|
|
21
|
+
if (!active.value) return;
|
|
23
22
|
closeDropdown();
|
|
24
23
|
}
|
|
25
24
|
function keydownActionsOnTrigger(event) {
|
|
26
|
-
if (event.ctrlKey || event.metaKey || event.shiftKey)
|
|
27
|
-
return;
|
|
25
|
+
if (event.ctrlKey || event.metaKey || event.shiftKey) return;
|
|
28
26
|
if (event.key !== "Tab") {
|
|
29
27
|
event.preventDefault();
|
|
30
28
|
}
|
|
31
29
|
switch (event.key) {
|
|
32
30
|
case "Tab":
|
|
33
|
-
if (!active.value)
|
|
34
|
-
return;
|
|
31
|
+
if (!active.value) return;
|
|
35
32
|
closeDropdown();
|
|
36
33
|
break;
|
|
37
34
|
case "ArrowDown":
|
|
@@ -96,8 +93,7 @@ export function useDropdown(options, dropdownOptionsRef, dropdownTriggerRef, con
|
|
|
96
93
|
}
|
|
97
94
|
}
|
|
98
95
|
function handleKeydown(event, index) {
|
|
99
|
-
if (event.ctrlKey || event.metaKey || event.shiftKey)
|
|
100
|
-
return;
|
|
96
|
+
if (event.ctrlKey || event.metaKey || event.shiftKey) return;
|
|
101
97
|
if (event.altKey && event.key === "ArrowUp") {
|
|
102
98
|
closeDropdown();
|
|
103
99
|
dropdownTriggerRef.value.focus();
|
|
@@ -131,15 +127,13 @@ export function useDropdown(options, dropdownOptionsRef, dropdownTriggerRef, con
|
|
|
131
127
|
});
|
|
132
128
|
break;
|
|
133
129
|
case "ArrowDown":
|
|
134
|
-
if (index === options.length - 1)
|
|
135
|
-
break;
|
|
130
|
+
if (index === options.length - 1) break;
|
|
136
131
|
nextTick(() => {
|
|
137
132
|
dropdownOptionsRef.value[index + 1].focus();
|
|
138
133
|
});
|
|
139
134
|
return index;
|
|
140
135
|
case "ArrowUp":
|
|
141
|
-
if (index === 0)
|
|
142
|
-
break;
|
|
136
|
+
if (index === 0) break;
|
|
143
137
|
nextTick(() => {
|
|
144
138
|
dropdownOptionsRef.value[index - 1].focus();
|
|
145
139
|
});
|
|
@@ -176,8 +170,7 @@ export function useDropdown(options, dropdownOptionsRef, dropdownTriggerRef, con
|
|
|
176
170
|
dropdownOptionsRef.value[idx].focus();
|
|
177
171
|
}, 500);
|
|
178
172
|
function handleDropdownSearch(inputValue) {
|
|
179
|
-
if (!config.searchable)
|
|
180
|
-
return;
|
|
173
|
+
if (!config.searchable) return;
|
|
181
174
|
if (inputValue.key == "Backspace") {
|
|
182
175
|
searchQuery.value = searchQuery.value.slice(0, -1);
|
|
183
176
|
return;
|
package/dist/types.d.mts
CHANGED
package/package.json
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apptegy/nuxt-navigation",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.61",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
|
-
"types": "./dist/types.d.ts",
|
|
8
7
|
"import": "./dist/module.mjs",
|
|
9
|
-
"
|
|
8
|
+
"types": "./dist/types.d.mts"
|
|
10
9
|
},
|
|
11
10
|
"./locale/*": "./locale/*"
|
|
12
11
|
},
|
|
13
|
-
"main": "./dist/module.
|
|
14
|
-
"types": "./dist/types.d.ts",
|
|
12
|
+
"main": "./dist/module.mjs",
|
|
15
13
|
"files": [
|
|
16
14
|
"dist",
|
|
17
15
|
"locale"
|
|
@@ -28,26 +26,25 @@
|
|
|
28
26
|
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
|
|
29
27
|
},
|
|
30
28
|
"dependencies": {
|
|
31
|
-
"@apptegy/nuxt-intl": "2.
|
|
29
|
+
"@apptegy/nuxt-intl": "^2.2.0",
|
|
32
30
|
"@nuxt/kit": "^3.17.0",
|
|
33
|
-
"@vueuse/components": "12.
|
|
34
|
-
"@vueuse/core": "^12.
|
|
31
|
+
"@vueuse/components": "^12.0.0",
|
|
32
|
+
"@vueuse/core": "^12.0.0"
|
|
35
33
|
},
|
|
36
34
|
"devDependencies": {
|
|
37
|
-
"@nuxt/devtools": "^2.
|
|
38
|
-
"@nuxt/eslint-config": "^1.
|
|
39
|
-
"@nuxt/module-builder": "^0.
|
|
35
|
+
"@nuxt/devtools": "^2.6.2",
|
|
36
|
+
"@nuxt/eslint-config": "^1.6.0",
|
|
37
|
+
"@nuxt/module-builder": "^1.0.1",
|
|
40
38
|
"@nuxt/schema": "^3.17.0",
|
|
41
|
-
"@nuxt/test-utils": "^3.17.
|
|
42
|
-
"@types/node": "^
|
|
43
|
-
"
|
|
44
|
-
"eslint": "^9.25.1",
|
|
39
|
+
"@nuxt/test-utils": "^3.17.0",
|
|
40
|
+
"@types/node": "^22.0.0",
|
|
41
|
+
"eslint": "^9.31.0",
|
|
45
42
|
"nuxt": "^3.17.0",
|
|
46
|
-
"sass": "^1.
|
|
47
|
-
"typescript": "~5.
|
|
48
|
-
"vitest": "^3.
|
|
43
|
+
"sass": "^1.89.2",
|
|
44
|
+
"typescript": "~5.8.0",
|
|
45
|
+
"vitest": "^3.2.4",
|
|
49
46
|
"vue": "^3.5.13",
|
|
50
|
-
"vue-tsc": "^
|
|
47
|
+
"vue-tsc": "^3.0.3"
|
|
51
48
|
},
|
|
52
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "abf879ffbcaab70578099916ab9a3ef1c432b7b3"
|
|
53
50
|
}
|
package/dist/module.cjs
DELETED
package/dist/module.d.ts
DELETED
package/dist/types.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { type ModuleOptions, default } from './module'
|