@apptegy/nuxt-navigation 0.1.87 → 0.1.88
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/assets/impersonation.svg +6 -0
- package/dist/runtime/components/Nav/Avatar.vue +38 -5
- package/dist/runtime/components/Nav/Avatar.vue.d.ts +4 -0
- package/dist/runtime/components/Nav/Header.vue +1 -0
- package/dist/runtime/components/Nav/UserDropdown.vue +2 -2
- package/dist/runtime/components/Nav/UserDropdown.vue.d.ts +2 -0
- package/dist/runtime/composables/useSidebar.d.ts +1 -1
- package/package.json +3 -3
package/dist/module.json
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg width="14" height="12" viewBox="0 0 14 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.6263 1.6087C13.0678 2.13532 13.3333 2.81151 13.3333 3.54897C13.3333 5.22916 11.9559 6.59105 10.2565 6.59105C10.1797 6.59105 10.1036 6.58826 10.0282 6.58278C10.1737 6.83855 10.2567 7.13375 10.2567 7.44821C10.2566 7.73741 10.1864 8.01033 10.0619 8.25129C11.0877 8.74406 11.795 9.78216 11.7952 10.9856C11.7952 11.5456 11.3356 12 10.7692 12H2.56467C1.99821 12 1.53867 11.5456 1.53867 10.9856C1.53881 9.78225 2.2461 8.74396 3.27171 8.25107C3.14726 8.01017 3.07705 7.73732 3.077 7.44821C3.077 7.13376 3.16002 6.83855 3.30555 6.58278C3.23004 6.58826 3.15377 6.59105 3.07683 6.59105C1.37761 6.59088 0 5.22905 0 3.54897C7.92599e-05 2.81135 0.265697 2.13503 0.707484 1.60836C0.585132 1.44137 0.513 1.23606 0.513 1.01408C0.513 0.454021 0.972207 0 1.53867 0H4.61567C5.18213 0 5.64133 0.454021 5.64133 1.01408C5.64133 1.2362 5.56911 1.44165 5.4466 1.6087C5.85423 2.09487 6.11177 2.70851 6.14899 3.38016H7.18434C7.22158 2.70836 7.47929 2.09458 7.88715 1.60836C7.7648 1.44137 7.69267 1.23605 7.69267 1.01408C7.69267 0.454021 8.15187 0 8.71833 0H11.7953C12.3618 0 12.821 0.454021 12.821 1.01408C12.821 1.2362 12.7488 1.44165 12.6263 1.6087ZM8.90015 2.02817C8.47434 2.39969 8.20577 2.94329 8.20567 3.54897C8.20567 4.66898 9.12373 5.57762 10.2565 5.57779C11.3894 5.57779 12.3085 4.66909 12.3085 3.54897C12.3084 2.94329 12.0396 2.39969 11.6136 2.02817H8.90015ZM5.64083 8.70988C5.64083 9.12681 6.24532 9.46433 6.66701 9.46433C7.0887 9.46433 7.69283 9.12681 7.69283 8.70988C7.69284 8.57344 7.74842 8.44248 7.84708 8.34709C7.94289 8.25457 8.07191 8.20267 8.20583 8.20267H8.46759C8.8892 8.20267 9.23051 7.86502 9.23067 7.44821C9.23067 7.03128 8.88929 6.6926 8.46759 6.6926H8.20583C7.96517 6.6926 7.75636 6.52752 7.70452 6.29516L7.28033 4.39457H6.05334L5.62915 6.29516C5.57734 6.52735 5.36945 6.69237 5.129 6.6926H4.86607C4.44452 6.69277 4.103 7.03138 4.103 7.44821C4.10316 7.86492 4.44462 8.2025 4.86607 8.20267H5.129L5.2295 8.21307C5.32786 8.23262 5.41926 8.28053 5.49126 8.35171C5.58728 8.44677 5.64082 8.57552 5.64083 8.70988ZM1.026 3.54897C1.0261 2.94329 1.29467 2.39969 1.72048 2.02817H4.43389C4.85992 2.39969 5.12874 2.94329 5.12883 3.54897C5.12883 4.66909 4.20975 5.57779 3.07683 5.57779C1.94407 5.57762 1.026 4.66898 1.026 3.54897Z" fill="black"/>
|
|
3
|
+
<path d="M1.026 3.54897C1.0261 2.94329 1.29467 2.39969 1.72048 2.02817H4.43389C4.85992 2.39969 5.12874 2.94329 5.12883 3.54897C5.12883 4.66909 4.20975 5.57779 3.07683 5.57779C1.94407 5.57762 1.026 4.66898 1.026 3.54897Z" fill="#C8D5F0"/>
|
|
4
|
+
<path d="M8.90015 2.02817C8.47434 2.39969 8.20577 2.94329 8.20567 3.54897C8.20567 4.66898 9.12373 5.57762 10.2565 5.57779C11.3894 5.57779 12.3085 4.66909 12.3085 3.54897C12.3084 2.94329 12.0396 2.39969 11.6136 2.02817H8.90015Z" fill="#C8D5F0"/>
|
|
5
|
+
<path d="M5.64083 8.70988C5.64083 9.12681 6.24532 9.46433 6.66701 9.46433C7.0887 9.46433 7.69283 9.12681 7.69283 8.70988C7.69284 8.57344 7.74842 8.44248 7.84708 8.34709C7.94289 8.25457 8.07191 8.20267 8.20583 8.20267H8.46759C8.8892 8.20267 9.23051 7.86502 9.23067 7.44821C9.23067 7.03128 8.88929 6.6926 8.46759 6.6926H8.20583C7.96517 6.6926 7.75636 6.52752 7.70452 6.29516L7.28033 4.39457H6.05334L5.62915 6.29516C5.57734 6.52735 5.36945 6.69237 5.129 6.6926H4.86607C4.44452 6.69277 4.103 7.03138 4.103 7.44821C4.10316 7.86492 4.44462 8.2025 4.86607 8.20267H5.129L5.2295 8.21307C5.32786 8.23262 5.41926 8.28053 5.49126 8.35171C5.58728 8.44677 5.64082 8.57552 5.64083 8.70988Z" fill="#E4B7B7"/>
|
|
6
|
+
</svg>
|
|
@@ -1,15 +1,33 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
<div class="avatar-container">
|
|
3
|
+
<img v-if="src" :src="src" class="avatar-size" alt="">
|
|
4
|
+
<span v-else class="avatar-size">
|
|
5
|
+
{{ initials }}
|
|
6
|
+
</span>
|
|
7
|
+
<svg
|
|
8
|
+
v-if="isImpersonated"
|
|
9
|
+
class="impersonation-badge"
|
|
10
|
+
width="14"
|
|
11
|
+
height="12"
|
|
12
|
+
viewBox="0 0 14 12"
|
|
13
|
+
fill="none"
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
aria-label="Impersonated user"
|
|
16
|
+
>
|
|
17
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.6263 1.6087C13.0678 2.13532 13.3333 2.81151 13.3333 3.54897C13.3333 5.22916 11.9559 6.59105 10.2565 6.59105C10.1797 6.59105 10.1036 6.58826 10.0282 6.58278C10.1737 6.83855 10.2567 7.13375 10.2567 7.44821C10.2566 7.73741 10.1864 8.01033 10.0619 8.25129C11.0877 8.74406 11.795 9.78216 11.7952 10.9856C11.7952 11.5456 11.3356 12 10.7692 12H2.56467C1.99821 12 1.53867 11.5456 1.53867 10.9856C1.53881 9.78225 2.2461 8.74396 3.27171 8.25107C3.14726 8.01017 3.07705 7.73732 3.077 7.44821C3.077 7.13376 3.16002 6.83855 3.30555 6.58278C3.23004 6.58826 3.15377 6.59105 3.07683 6.59105C1.37761 6.59088 0 5.22905 0 3.54897C7.92599e-05 2.81135 0.265697 2.13503 0.707484 1.60836C0.585132 1.44137 0.513 1.23606 0.513 1.01408C0.513 0.454021 0.972207 0 1.53867 0H4.61567C5.18213 0 5.64133 0.454021 5.64133 1.01408C5.64133 1.2362 5.56911 1.44165 5.4466 1.6087C5.85423 2.09487 6.11177 2.70851 6.14899 3.38016H7.18434C7.22158 2.70836 7.47929 2.09458 7.88715 1.60836C7.7648 1.44137 7.69267 1.23605 7.69267 1.01408C7.69267 0.454021 8.15187 0 8.71833 0H11.7953C12.3618 0 12.821 0.454021 12.821 1.01408C12.821 1.2362 12.7488 1.44165 12.6263 1.6087ZM8.90015 2.02817C8.47434 2.39969 8.20577 2.94329 8.20567 3.54897C8.20567 4.66898 9.12373 5.57762 10.2565 5.57779C11.3894 5.57779 12.3085 4.66909 12.3085 3.54897C12.3084 2.94329 12.0396 2.39969 11.6136 2.02817H8.90015ZM5.64083 8.70988C5.64083 9.12681 6.24532 9.46433 6.66701 9.46433C7.0887 9.46433 7.69283 9.12681 7.69283 8.70988C7.69284 8.57344 7.74842 8.44248 7.84708 8.34709C7.94289 8.25457 8.07191 8.20267 8.20583 8.20267H8.46759C8.8892 8.20267 9.23051 7.86502 9.23067 7.44821C9.23067 7.03128 8.88929 6.6926 8.46759 6.6926H8.20583C7.96517 6.6926 7.75636 6.52752 7.70452 6.29516L7.28033 4.39457H6.05334L5.62915 6.29516C5.57734 6.52735 5.36945 6.69237 5.129 6.6926H4.86607C4.44452 6.69277 4.103 7.03138 4.103 7.44821C4.10316 7.86492 4.44462 8.2025 4.86607 8.20267H5.129L5.2295 8.21307C5.32786 8.23262 5.41926 8.28053 5.49126 8.35171C5.58728 8.44677 5.64082 8.57552 5.64083 8.70988ZM1.026 3.54897C1.0261 2.94329 1.29467 2.39969 1.72048 2.02817H4.43389C4.85992 2.39969 5.12874 2.94329 5.12883 3.54897C5.12883 4.66909 4.20975 5.57779 3.07683 5.57779C1.94407 5.57762 1.026 4.66898 1.026 3.54897Z" fill="black"/>
|
|
18
|
+
<path d="M1.026 3.54897C1.0261 2.94329 1.29467 2.39969 1.72048 2.02817H4.43389C4.85992 2.39969 5.12874 2.94329 5.12883 3.54897C5.12883 4.66909 4.20975 5.57779 3.07683 5.57779C1.94407 5.57762 1.026 4.66898 1.026 3.54897Z" fill="#C8D5F0"/>
|
|
19
|
+
<path d="M8.90015 2.02817C8.47434 2.39969 8.20577 2.94329 8.20567 3.54897C8.20567 4.66898 9.12373 5.57762 10.2565 5.57779C11.3894 5.57779 12.3085 4.66909 12.3085 3.54897C12.3084 2.94329 12.0396 2.39969 11.6136 2.02817H8.90015Z" fill="#C8D5F0"/>
|
|
20
|
+
<path d="M5.64083 8.70988C5.64083 9.12681 6.24532 9.46433 6.66701 9.46433C7.0887 9.46433 7.69283 9.12681 7.69283 8.70988C7.69284 8.57344 7.74842 8.44248 7.84708 8.34709C7.94289 8.25457 8.07191 8.20267 8.20583 8.20267H8.46759C8.8892 8.20267 9.23051 7.86502 9.23067 7.44821C9.23067 7.03128 8.88929 6.6926 8.46759 6.6926H8.20583C7.96517 6.6926 7.75636 6.52752 7.70452 6.29516L7.28033 4.39457H6.05334L5.62915 6.29516C5.57734 6.52735 5.36945 6.69237 5.129 6.6926H4.86607C4.44452 6.69277 4.103 7.03138 4.103 7.44821C4.10316 7.86492 4.44462 8.2025 4.86607 8.20267H5.129L5.2295 8.21307C5.32786 8.23262 5.41926 8.28053 5.49126 8.35171C5.58728 8.44677 5.64082 8.57552 5.64083 8.70988Z" fill="#E4B7B7"/>
|
|
21
|
+
</svg>
|
|
22
|
+
</div>
|
|
6
23
|
</template>
|
|
7
24
|
|
|
8
25
|
<script setup>
|
|
9
26
|
import { computed } from "vue";
|
|
10
27
|
const props = defineProps({
|
|
11
28
|
src: { type: String, required: false },
|
|
12
|
-
name: { type: String, required: true }
|
|
29
|
+
name: { type: String, required: true },
|
|
30
|
+
isImpersonated: { type: Boolean, required: false }
|
|
13
31
|
});
|
|
14
32
|
const initials = computed(() => {
|
|
15
33
|
const initials2 = props.name.match(/\b\w/g) || [];
|
|
@@ -22,6 +40,13 @@ const initials = computed(() => {
|
|
|
22
40
|
--size: 32px;
|
|
23
41
|
}
|
|
24
42
|
|
|
43
|
+
.avatar-container {
|
|
44
|
+
position: relative;
|
|
45
|
+
display: inline-flex;
|
|
46
|
+
width: var(--size);
|
|
47
|
+
height: var(--size);
|
|
48
|
+
}
|
|
49
|
+
|
|
25
50
|
span {
|
|
26
51
|
display: inline-flex;
|
|
27
52
|
align-items: center;
|
|
@@ -48,4 +73,12 @@ img {
|
|
|
48
73
|
object-fit: cover;
|
|
49
74
|
border: 2px solid var(--purple-20);
|
|
50
75
|
}
|
|
76
|
+
|
|
77
|
+
.impersonation-badge {
|
|
78
|
+
position: absolute;
|
|
79
|
+
top: -4px;
|
|
80
|
+
left: 20px;
|
|
81
|
+
width: 14px;
|
|
82
|
+
height: 1px;
|
|
83
|
+
}
|
|
51
84
|
</style>
|
|
@@ -7,6 +7,10 @@ interface IAvatarProps {
|
|
|
7
7
|
* Defines the name value that will be displayed as initials alongside the avatar.
|
|
8
8
|
*/
|
|
9
9
|
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* Indicates if the user is being impersonated.
|
|
12
|
+
*/
|
|
13
|
+
isImpersonated?: boolean;
|
|
10
14
|
}
|
|
11
15
|
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
16
|
export default _default;
|
|
@@ -5,6 +5,7 @@ const appConfig = useAppConfig();
|
|
|
5
5
|
const zIndex = computed(() => appConfig?.navigation?.zIndex || 100);
|
|
6
6
|
const props = defineProps({
|
|
7
7
|
user: { type: Object, required: true },
|
|
8
|
+
impersonatedUser: { type: Object, required: false },
|
|
8
9
|
userDropdownOptions: { type: Array, required: true }
|
|
9
10
|
});
|
|
10
11
|
const dropdownTriggerRef = ref();
|
|
@@ -60,7 +61,7 @@ function handleKeydownAction($event, index) {
|
|
|
60
61
|
<div class="user-info">
|
|
61
62
|
<span class="user-info-title">{{ $t("navigation.userDropdown") }}</span>
|
|
62
63
|
<div class="user-info-details">
|
|
63
|
-
<NavAvatar :name="user.name" :src="user.avatar" style="--size: 40px"/>
|
|
64
|
+
<NavAvatar :name="user.name" :src="user.avatar" :is-impersonated="impersonatedUser?.show" style="--size: 40px"/>
|
|
64
65
|
<div class="user-info-details-container">
|
|
65
66
|
<span class="user-info-name"> {{ user.name }} </span>
|
|
66
67
|
<span class="user-info-email"> {{ user.email }} </span>
|
|
@@ -99,7 +100,6 @@ function handleKeydownAction($event, index) {
|
|
|
99
100
|
color: var(--purple);
|
|
100
101
|
background: var(--purple-20);
|
|
101
102
|
border-radius: 16px;
|
|
102
|
-
overflow: hidden;
|
|
103
103
|
text-align: left;
|
|
104
104
|
position: relative;
|
|
105
105
|
display: flex;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apptegy/nuxt-navigation",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.88",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@apptegy/nuxt-intl": "^2.4.
|
|
29
|
+
"@apptegy/nuxt-intl": "^2.4.3",
|
|
30
30
|
"@nuxt/kit": "^3.17.0",
|
|
31
31
|
"@vueuse/components": "^12.0.0",
|
|
32
32
|
"@vueuse/core": "^12.0.0"
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"vue": "^3.5.13",
|
|
47
47
|
"vue-tsc": "^3.0.3"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "87f016cb69eccb384992982e147e1af6e14800f9"
|
|
50
50
|
}
|