@apptegy/nuxt-navigation 0.1.26 → 0.1.28

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@apptegy/nuxt-navigation",
3
3
  "configKey": "@apptegy/nuxt-navigation",
4
- "version": "0.1.26",
4
+ "version": "0.1.28",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.8.4",
7
7
  "unbuild": "unknown"
@@ -20,7 +20,8 @@
20
20
  <NuxtLink v-if="expanded" class="no-link-style" :to="homepageUrl">
21
21
  <slot name="logo">
22
22
  <div class="navbar--logo">
23
- <img :src="brandLogo">
23
+ <img v-if="brandLogo" :src="brandLogo">
24
+ <ThrillshareLogo v-else />
24
25
  <div v-if="!brand?.hide_school_name">
25
26
  <div class="school-name"> {{ brand?.school_name }} </div>
26
27
  <div v-if="brand?.school_tag_line" class="school-tag">{{ brand.school_tag_line }}</div>
@@ -70,9 +71,9 @@
70
71
  </template>
71
72
 
72
73
  <script setup lang="ts">
73
- import { useSidebar, useBranding, ref } from '#imports';
74
+ import { useSidebar, useBranding, ref, watch } from '#imports';
74
75
  import type { IApplication, IUser } from "../../types";
75
- import tsBrandLogo from '../../assets/thrillshare-logo-white.svg';
76
+ import ThrillshareLogo from './Icons/ThrillshareLogo.vue';
76
77
 
77
78
  interface ILogo {
78
79
  alt: string;
@@ -114,11 +115,20 @@ const props = withDefaults(defineProps<ISidebarProps>(), {
114
115
  clientId: undefined,
115
116
  });
116
117
 
118
+ const emit = defineEmits<{
119
+ (e: 'toggle-expand', width: number): void
120
+ }>();
121
+
117
122
  const { state: expanded } = useSidebar();
118
123
  const { brand, getBrandingStyles } = await useBranding(props.clientId);
119
124
 
120
- const brandLogo = ref(brand.value?.logo_light || tsBrandLogo);
125
+ const brandLogo = ref(brand.value?.logo_light);
121
126
 
127
+ // Emit event when expanded changes with the
128
+ // width of the component.
129
+ watch(expanded, (value) => {
130
+ emit('toggle-expand', value ? 264 : 64);
131
+ })
122
132
 
123
133
  // Debounced Expand on Hover
124
134
  let expandedTimer = null;
@@ -14,7 +14,7 @@
14
14
  <script setup lang="ts">
15
15
  import { useSidebar } from "#imports";
16
16
  import type { IApplication } from "../../types";
17
- import icons from "./Icons/iconPaths.json";
17
+ import icons from "../../assets/iconPaths.json";
18
18
 
19
19
  const props = defineProps<{
20
20
  application: IApplication;
@@ -1,22 +1,4 @@
1
1
  export declare function useBranding(clientId?: number): Promise<{
2
- brand: import("vue").Ref<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
- }>;
2
+ brand: any;
3
+ getBrandingStyles: any;
22
4
  }>;
@@ -1,5 +1,5 @@
1
1
  import { computed, ref, useRuntimeConfig } from "#imports";
2
- let brand = ref(null);
2
+ const brand = ref(null);
3
3
  export async function useBranding(clientId) {
4
4
  if (clientId !== void 0) {
5
5
  const config = useRuntimeConfig();
@@ -13,7 +13,7 @@ export async function useBranding(clientId) {
13
13
  }
14
14
  const brandPrimaryColor = computed(() => brand.value?.colors?.primary_color.hex || "#000000");
15
15
  const getBrandingStyles = computed(() => {
16
- if (!brand.value.logo_dark && !brand.value.logo_light || !brand.value) {
16
+ if (!brand.value?.logo_dark && !brand.value?.logo_light || !brand.value) {
17
17
  brand.value = null;
18
18
  return {};
19
19
  }
@@ -3,8 +3,8 @@ export declare function useDropdown(options: Array<unknown>, dropdownOptionsRef:
3
3
  searchable: boolean;
4
4
  trackBy?: string;
5
5
  }): {
6
- active: Ref<boolean>;
7
- searchQuery: Ref<string>;
6
+ active: any;
7
+ searchQuery: any;
8
8
  toggleDropdown: ($event: KeyboardEvent | MouseEvent) => Promise<void>;
9
9
  openDropdown: () => void;
10
10
  closeDropdown: () => void;
@@ -12,5 +12,5 @@ export declare function useDropdown(options: Array<unknown>, dropdownOptionsRef:
12
12
  keydownActionsOnTrigger: (event: KeyboardEvent) => void;
13
13
  handleKeydown: (event: KeyboardEvent, index: number) => number | undefined;
14
14
  handleDropdownSearch: (inputValue: KeyboardEvent & InputEvent) => void;
15
- debouncedFocus: import("lodash").DebouncedFunc<(idx: number) => void>;
15
+ debouncedFocus: any;
16
16
  };
@@ -18,17 +18,20 @@ export function useDropdown(options, dropdownOptionsRef, dropdownTriggerRef, con
18
18
  active.value = false;
19
19
  }
20
20
  function onClickOutsideHandler() {
21
- if (!active.value) return;
21
+ if (!active.value)
22
+ return;
22
23
  closeDropdown();
23
24
  }
24
25
  function keydownActionsOnTrigger(event) {
25
- if (event.ctrlKey || event.metaKey || event.shiftKey) return;
26
+ if (event.ctrlKey || event.metaKey || event.shiftKey)
27
+ return;
26
28
  if (event.key !== "Tab") {
27
29
  event.preventDefault();
28
30
  }
29
31
  switch (event.key) {
30
32
  case "Tab":
31
- if (!active.value) return;
33
+ if (!active.value)
34
+ return;
32
35
  closeDropdown();
33
36
  break;
34
37
  case "ArrowDown":
@@ -93,7 +96,8 @@ export function useDropdown(options, dropdownOptionsRef, dropdownTriggerRef, con
93
96
  }
94
97
  }
95
98
  function handleKeydown(event, index) {
96
- if (event.ctrlKey || event.metaKey || event.shiftKey) return;
99
+ if (event.ctrlKey || event.metaKey || event.shiftKey)
100
+ return;
97
101
  if (event.altKey && event.key === "ArrowUp") {
98
102
  closeDropdown();
99
103
  dropdownTriggerRef.value.focus();
@@ -127,13 +131,15 @@ export function useDropdown(options, dropdownOptionsRef, dropdownTriggerRef, con
127
131
  });
128
132
  break;
129
133
  case "ArrowDown":
130
- if (index === options.length - 1) break;
134
+ if (index === options.length - 1)
135
+ break;
131
136
  nextTick(() => {
132
137
  dropdownOptionsRef.value[index + 1].focus();
133
138
  });
134
139
  return index;
135
140
  case "ArrowUp":
136
- if (index === 0) break;
141
+ if (index === 0)
142
+ break;
137
143
  nextTick(() => {
138
144
  dropdownOptionsRef.value[index - 1].focus();
139
145
  });
@@ -170,7 +176,8 @@ export function useDropdown(options, dropdownOptionsRef, dropdownTriggerRef, con
170
176
  dropdownOptionsRef.value[idx].focus();
171
177
  }, 500);
172
178
  function handleDropdownSearch(inputValue) {
173
- if (!config.searchable) return;
179
+ if (!config.searchable)
180
+ return;
174
181
  if (inputValue.key == "Backspace") {
175
182
  searchQuery.value = searchQuery.value.slice(0, -1);
176
183
  return;
@@ -1,5 +1,5 @@
1
1
  export declare function useSidebar(): {
2
- state: import("vue").Ref<boolean>;
2
+ state: any;
3
3
  toggleSidebar: () => void;
4
- sidebarWidth: import("vue").ComputedRef<"264px" | "0px">;
4
+ sidebarWidth: any;
5
5
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apptegy/nuxt-navigation",
3
- "version": "0.1.26",
3
+ "version": "0.1.28",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -26,25 +26,26 @@
26
26
  "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
27
27
  },
28
28
  "dependencies": {
29
- "@nuxt/kit": "^3.15.2",
30
- "@vueuse/components": "11.3.0",
29
+ "@apptegy/nuxt-intl": "2.1.2",
30
+ "@nuxt/kit": "^3.15.4",
31
+ "@vueuse/components": "12.5.0",
31
32
  "lodash": "^4.17.21"
32
33
  },
33
34
  "devDependencies": {
34
- "@nuxt/devtools": "^1.7.0",
35
- "@nuxt/eslint-config": "^0.7.2",
35
+ "@nuxt/devtools": "^2.0.0",
36
+ "@nuxt/eslint-config": "^1.0.1",
36
37
  "@nuxt/module-builder": "^0.8.4",
37
- "@nuxt/schema": "^3.14.1592",
38
- "@nuxt/test-utils": "^3.14.4",
39
- "@types/node": "^20.17.9",
38
+ "@nuxt/schema": "^3.15.4",
39
+ "@nuxt/test-utils": "^3.15.4",
40
+ "@types/node": "^20.17.17",
40
41
  "changelogen": "^0.5.7",
41
- "eslint": "^9.15.0",
42
- "nuxt": "^3.15.2",
43
- "sass": "^1.81.0",
44
- "typescript": "^5.7.2",
45
- "vitest": "^2.1.6",
42
+ "eslint": "^9.20.0",
43
+ "nuxt": "^3.15.4",
44
+ "sass": "^1.84.0",
45
+ "typescript": "^5.6.3",
46
+ "vitest": "^2.1.9",
46
47
  "vue": "^3.5.13",
47
- "vue-tsc": "^2.1.10"
48
+ "vue-tsc": "^2.2.0"
48
49
  },
49
- "gitHead": "38d12a2193d87b19281075e010698ed2f0beb009"
50
+ "gitHead": "5b4a6d2e7c7db960b48e86b8056967f70547c784"
50
51
  }