@apptegy/nuxt-navigation 0.1.75 → 0.1.77
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/Icons/Pinned.vue +9 -0
- package/dist/runtime/components/Nav/Sidebar.vue +43 -19
- package/package.json +2 -2
- package/dist/runtime/components/Nav/Icons/UnlockedPin.vue +0 -16
- /package/dist/runtime/components/Nav/Icons/{LockedPin.vue.d.ts → Pinned.vue.d.ts} +0 -0
- /package/dist/runtime/components/Nav/Icons/{LockedPin.vue → Unpinned.vue} +0 -0
- /package/dist/runtime/components/Nav/Icons/{UnlockedPin.vue.d.ts → Unpinned.vue.d.ts} +0 -0
package/dist/module.json
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<path d="M10.667 0.708008C11.186 0.708137 11.6846 0.91431 12.0518 1.28125C12.4188 1.64834 12.6258 2.14691 12.626 2.66602C12.626 3.1852 12.4187 3.68356 12.0518 4.05078C11.6846 4.41792 11.1862 4.62487 10.667 4.625C10.6563 4.62508 10.6454 4.62926 10.6377 4.63672C10.63 4.64437 10.6261 4.65522 10.626 4.66602V7.17285L10.6328 7.27051C10.6464 7.36774 10.6803 7.46185 10.7324 7.5459C10.7844 7.62963 10.8529 7.70153 10.9336 7.75684L11.0186 7.80664L11.0225 7.80859L12.2051 8.40625C12.5311 8.5683 12.8061 8.81858 12.998 9.12793C13.19 9.43741 13.2917 9.79503 13.292 10.1592V10.666C13.292 11.0084 13.156 11.3379 12.9141 11.5801C12.672 11.822 12.3432 11.9578 12.001 11.958H8.62598V14.666C8.62598 15.0109 8.34578 15.2906 8.00098 15.291C7.6558 15.291 7.37598 15.0112 7.37598 14.666V11.958H4.00098C3.65844 11.958 3.32914 11.8223 3.08691 11.5801C2.84468 11.3378 2.70801 11.0086 2.70801 10.666V10.1592L2.71387 10.0234C2.73613 9.70682 2.83494 9.39883 3.00293 9.12793C3.19491 8.81864 3.46988 8.56825 3.7959 8.40625L4.97852 7.80859L4.98242 7.80664C5.10016 7.74801 5.20019 7.65767 5.26953 7.5459C5.32151 7.46193 5.35555 7.36761 5.36914 7.27051L5.37598 7.17285V4.66602C5.37579 4.65524 5.3709 4.64437 5.36328 4.63672C5.3556 4.62912 5.34478 4.62512 5.33398 4.625C4.81463 4.625 4.31647 4.418 3.94922 4.05078C3.58206 3.68354 3.37598 3.18532 3.37598 2.66602C3.37616 2.14688 3.58212 1.64835 3.94922 1.28125C4.31642 0.91436 4.81488 0.708008 5.33398 0.708008H10.667Z" fill="#2D2D2D"/>
|
|
4
|
+
</svg>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<style scoped>
|
|
8
|
+
svg{height:16px!important;width:16px!important}
|
|
9
|
+
</style>
|
|
@@ -20,27 +20,27 @@
|
|
|
20
20
|
<div :class="['header-actions', { 'collapsed': !expanded && !isMobile }]">
|
|
21
21
|
<NuxtLink v-if="expanded" class="no-link-style" :to="homepageUrl">
|
|
22
22
|
<slot name="logo">
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
</div>
|
|
23
|
+
<div class="navbar--logo" :class="{ 'big-logo': _brandLogoWidth > 80 }">
|
|
24
|
+
<img v-if="brandLogo" ref="brandLogoRef" :src="brandLogo" :alt="$t('navigation.brandLogoAlt')">
|
|
25
|
+
<component
|
|
26
|
+
:is="ApptegyLogo"
|
|
27
|
+
v-else
|
|
28
|
+
:alt="$t('navigation.brandLogoAlt')"
|
|
29
|
+
:use-light-logo="isAdmin || Object.values(getBrandingStyles).length === 0"
|
|
30
|
+
/>
|
|
31
|
+
<div v-if="!brand?.hide_school_name">
|
|
32
|
+
<div class="school-name"> {{ brand?.school_name }} </div>
|
|
33
|
+
<div v-if="brand?.school_tag_line" class="school-tag">{{ brand.school_tag_line }}</div>
|
|
35
34
|
</div>
|
|
36
|
-
|
|
37
|
-
</
|
|
35
|
+
</div>
|
|
36
|
+
</slot>
|
|
37
|
+
</NuxtLink>
|
|
38
38
|
<div v-if="!isMobile && showCollapseButton">
|
|
39
39
|
<button v-if="lockedExpanded && !allowCollapse && expanded" class="hamburger-button" @click="closeSidebar" v-tooltip.bottom="'Unpin menu'">
|
|
40
|
-
<
|
|
40
|
+
<Pinned />
|
|
41
41
|
</button>
|
|
42
42
|
<button v-if="!lockedExpanded && allowCollapse && expanded" class="hamburger-button" @click="lockSidebar" v-tooltip.bottom="'Pin menu open'">
|
|
43
|
-
<
|
|
43
|
+
<Unpinned />
|
|
44
44
|
</button>
|
|
45
45
|
<button v-if="!lockedExpanded && allowCollapse && !expanded" class="hamburger-button">
|
|
46
46
|
<a-icon icon="24:hamburger" />
|
|
@@ -91,11 +91,11 @@
|
|
|
91
91
|
</template>
|
|
92
92
|
|
|
93
93
|
<script setup>
|
|
94
|
-
import { useSidebar, useBranding, useNuxtApp, ref, watch } from "#imports";
|
|
94
|
+
import { useSidebar, useBranding, useNuxtApp, ref, watch, computed, onMounted, onBeforeUnmount } from "#imports";
|
|
95
95
|
import ApptegyLogo from "./Icons/ApptegyLogo.vue";
|
|
96
|
-
import LockedPin from "./Icons/LockedPin.vue";
|
|
97
|
-
import UnlockedPin from "./Icons/UnlockedPin.vue";
|
|
98
96
|
import { useBreakpoints, breakpointsTailwind } from "@vueuse/core";
|
|
97
|
+
import Unpinned from "./Icons/Unpinned.vue";
|
|
98
|
+
import Pinned from "./Icons/Pinned.vue";
|
|
99
99
|
const { $t } = useNuxtApp();
|
|
100
100
|
const props = defineProps({
|
|
101
101
|
clientId: { type: Number, required: true, default: void 0 },
|
|
@@ -128,10 +128,30 @@ const emit = defineEmits(["toggle-expand"]);
|
|
|
128
128
|
const { state: expanded } = useSidebar();
|
|
129
129
|
const { brand, getBrandingStyles } = await useBranding(props.clientId);
|
|
130
130
|
const brandLogo = ref(brand.value?.logo_light);
|
|
131
|
+
const brandLogoRef = ref(null);
|
|
132
|
+
const brandLogoWidthPx = ref(0);
|
|
133
|
+
let brandLogoResizeObserver = null;
|
|
134
|
+
const _brandLogoWidth = computed(() => brandLogoWidthPx.value);
|
|
131
135
|
const breakpoints = useBreakpoints(breakpointsTailwind);
|
|
132
136
|
const isMobile = breakpoints.smaller("md");
|
|
133
137
|
const lockedExpanded = ref(true);
|
|
134
138
|
const allowCollapse = ref(false);
|
|
139
|
+
function updateBrandLogoWidth() {
|
|
140
|
+
brandLogoWidthPx.value = brandLogoRef.value?.clientWidth ?? 0;
|
|
141
|
+
}
|
|
142
|
+
onMounted(() => {
|
|
143
|
+
updateBrandLogoWidth();
|
|
144
|
+
if (brandLogoRef.value) {
|
|
145
|
+
brandLogoResizeObserver = new ResizeObserver(() => {
|
|
146
|
+
updateBrandLogoWidth();
|
|
147
|
+
});
|
|
148
|
+
brandLogoResizeObserver.observe(brandLogoRef.value);
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
onBeforeUnmount(() => {
|
|
152
|
+
brandLogoResizeObserver?.disconnect();
|
|
153
|
+
brandLogoResizeObserver = null;
|
|
154
|
+
});
|
|
135
155
|
watch(expanded, (value) => {
|
|
136
156
|
emit("toggle-expand", value ? 264 : 64);
|
|
137
157
|
});
|
|
@@ -223,6 +243,10 @@ function lockSidebar() {
|
|
|
223
243
|
align-items: center;
|
|
224
244
|
gap: 8px;
|
|
225
245
|
}
|
|
246
|
+
.navbar--logo.big-logo {
|
|
247
|
+
flex-direction: column;
|
|
248
|
+
align-items: flex-start;
|
|
249
|
+
}
|
|
226
250
|
.navbar--logo .school-name {
|
|
227
251
|
font-size: 16px;
|
|
228
252
|
font-style: normal;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apptegy/nuxt-navigation",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.77",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"vue": "^3.5.13",
|
|
47
47
|
"vue-tsc": "^3.0.3"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "112c6210e954838d100c8a5bf94c9f32d91152b1"
|
|
50
50
|
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
-
<g clip-path="url(#clip0_2001_18302)">
|
|
4
|
-
<path d="M7.99998 11.3333V14.6667M9.99998 6.22666V4.66666C9.99998 4.48985 10.0702 4.32028 10.1952 4.19526C10.3203 4.07023 10.4898 3.99999 10.6666 3.99999C11.0203 3.99999 11.3594 3.85952 11.6095 3.60947C11.8595 3.35942 12 3.02028 12 2.66666C12 2.31304 11.8595 1.9739 11.6095 1.72385C11.3594 1.4738 11.0203 1.33333 10.6666 1.33333H5.25998M1.33331 1.33333L14.6666 14.6667M5.99998 6V7.17333C5.99985 7.42138 5.93052 7.66449 5.79979 7.8753C5.66907 8.08611 5.48212 8.25628 5.25998 8.36666L4.07331 8.96666C3.85117 9.07705 3.66423 9.24721 3.5335 9.45803C3.40277 9.66884 3.33344 9.91194 3.33331 10.16V10.6667C3.33331 10.8435 3.40355 11.013 3.52858 11.1381C3.6536 11.2631 3.82317 11.3333 3.99998 11.3333H11.3333" stroke="#2D2D2D" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
-
</g>
|
|
6
|
-
<defs>
|
|
7
|
-
<clipPath id="clip0_2001_18302">
|
|
8
|
-
<rect width="16" height="16" fill="white"/>
|
|
9
|
-
</clipPath>
|
|
10
|
-
</defs>
|
|
11
|
-
</svg>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<style scoped>
|
|
15
|
-
svg{height:16px!important;width:16px!important}
|
|
16
|
-
</style>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|