@apptegy/nuxt-navigation 0.2.7-alpha.0 → 0.2.9
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/Header.vue.d.ts +6 -11
- package/dist/runtime/components/Nav/HelpArticles.vue +5 -11
- package/dist/runtime/components/Nav/HelpArticles.vue.d.ts +8 -0
- package/dist/runtime/components/Nav/Icons/ApptegyLogo.vue +1 -5
- package/dist/runtime/components/Nav/Sidebar.vue +6 -4
- package/dist/runtime/components/Nav/Sidebar.vue.d.ts +9 -10
- package/dist/runtime/types/index.d.ts +12 -3
- package/package.json +7 -3
package/dist/module.json
CHANGED
|
@@ -160,6 +160,7 @@ const props = defineProps({
|
|
|
160
160
|
useLogoutEmit: { type: Boolean, required: false },
|
|
161
161
|
userDropdownOptions: { type: Array, required: true }
|
|
162
162
|
});
|
|
163
|
+
defineSlots();
|
|
163
164
|
const { $t, $intl, $ld } = useNuxtApp();
|
|
164
165
|
const emit = defineEmits([
|
|
165
166
|
"selected-option",
|
|
@@ -200,7 +201,7 @@ const notificationsPanel = computed(() => {
|
|
|
200
201
|
return null;
|
|
201
202
|
}
|
|
202
203
|
return mapNotificationsApiResponse(notificationsResponse.value, {
|
|
203
|
-
locale:
|
|
204
|
+
locale: $intl.locale,
|
|
204
205
|
dateLabels: notificationDateLabels.value,
|
|
205
206
|
retentionLabel: $t("navigation.notificationsPanel.retentionLabel"),
|
|
206
207
|
tabs: [
|
|
@@ -17,17 +17,12 @@ interface IUserDropdown {
|
|
|
17
17
|
userDropdownOptions: Array<unknown>;
|
|
18
18
|
}
|
|
19
19
|
type __VLS_Props = IHeaderProps & IUserDropdown;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
'user-controls'?: (props: typeof __VLS_5) => any;
|
|
27
|
-
} & {
|
|
28
|
-
searchbar?: (props: typeof __VLS_7) => any;
|
|
29
|
-
} & {
|
|
30
|
-
notifications?: (props: typeof __VLS_17) => any;
|
|
20
|
+
type __VLS_Slots = {
|
|
21
|
+
breadcrumbs?: () => unknown;
|
|
22
|
+
'org-select'?: () => unknown;
|
|
23
|
+
'user-controls'?: () => unknown;
|
|
24
|
+
searchbar?: () => unknown;
|
|
25
|
+
notifications?: () => unknown;
|
|
31
26
|
};
|
|
32
27
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {
|
|
33
28
|
notifications: INotificationsHeaderModel | null;
|
|
@@ -83,29 +83,23 @@
|
|
|
83
83
|
</template>
|
|
84
84
|
|
|
85
85
|
<script setup>
|
|
86
|
-
import {
|
|
86
|
+
import { navigateTo, useNuxtApp } from "#imports";
|
|
87
87
|
import { ref, computed, onMounted } from "vue";
|
|
88
88
|
const { $ld } = useNuxtApp();
|
|
89
|
-
const { userProfile } = useAuth();
|
|
90
89
|
const props = defineProps({
|
|
91
90
|
helpArticleOptions: { type: Array, required: true, default: () => [] },
|
|
92
91
|
settingsRoute: { type: String, required: true, default: "" },
|
|
93
92
|
schoolWebsite: { type: String, required: true, default: "" },
|
|
94
93
|
showHelpArticles: { type: Boolean, required: true, default: false },
|
|
95
|
-
collapsed: { type: Boolean, required: true }
|
|
94
|
+
collapsed: { type: Boolean, required: true },
|
|
95
|
+
userRoomsRole: { type: [String, null], required: false, default: void 0 }
|
|
96
96
|
});
|
|
97
|
-
const { state: expandedSidebar } = useSidebar();
|
|
98
97
|
const expanded = ref(false);
|
|
99
98
|
const helpBtnActions = ref();
|
|
100
99
|
const dropdownScrollHeight = ref(0);
|
|
101
100
|
const isDropdown = ref(false);
|
|
102
|
-
const isRoomsUser = computed(() =>
|
|
103
|
-
|
|
104
|
-
});
|
|
105
|
-
const userRoomsRole = computed(() => {
|
|
106
|
-
return userProfile.value?.roles?.rooms;
|
|
107
|
-
});
|
|
108
|
-
const hasArticles = computed(() => !!props.helpArticleOptions?.values?.length);
|
|
101
|
+
const isRoomsUser = computed(() => !!props.userRoomsRole);
|
|
102
|
+
const userRoomsRole = computed(() => props.userRoomsRole);
|
|
109
103
|
const isBeaconNavEnabled = computed(() => {
|
|
110
104
|
return Boolean($ld?.flags?.beaconNavEnabled);
|
|
111
105
|
});
|
|
@@ -4,11 +4,19 @@ interface IHelpArticlesProps {
|
|
|
4
4
|
schoolWebsite: string;
|
|
5
5
|
showHelpArticles: boolean;
|
|
6
6
|
collapsed: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* The user's rooms role, used only as a styling hook
|
|
9
|
+
* (`help-btn-<role>` class). Passed in by the consumer instead of the
|
|
10
|
+
* component reaching into the host app's auth composable — the package
|
|
11
|
+
* must not assume which auth module the consumer runs.
|
|
12
|
+
*/
|
|
13
|
+
userRoomsRole?: string | null;
|
|
7
14
|
}
|
|
8
15
|
declare const _default: import("vue").DefineComponent<IHelpArticlesProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IHelpArticlesProps> & Readonly<{}>, {
|
|
9
16
|
helpArticleOptions: Array<unknown>;
|
|
10
17
|
settingsRoute: string;
|
|
11
18
|
schoolWebsite: string;
|
|
12
19
|
showHelpArticles: boolean;
|
|
20
|
+
userRoomsRole: string | null;
|
|
13
21
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
22
|
export default _default;
|
|
@@ -17,14 +17,10 @@
|
|
|
17
17
|
</template>
|
|
18
18
|
|
|
19
19
|
<script setup>
|
|
20
|
-
|
|
21
|
-
const props = defineProps({
|
|
20
|
+
defineProps({
|
|
22
21
|
useLightLogo: {
|
|
23
22
|
type: Boolean,
|
|
24
23
|
default: false
|
|
25
24
|
}
|
|
26
25
|
});
|
|
27
|
-
const fillColor = computed(() => {
|
|
28
|
-
return props.useLightLogo ? "#FFFFFF" : "#503462";
|
|
29
|
-
});
|
|
30
26
|
</script>
|
|
@@ -115,8 +115,8 @@
|
|
|
115
115
|
<slot name="switcher" />
|
|
116
116
|
<ul class="navbar-applications">
|
|
117
117
|
<li
|
|
118
|
-
v-for="application of applications"
|
|
119
|
-
:key="application.
|
|
118
|
+
v-for="(application, applicationIndex) of applications"
|
|
119
|
+
:key="`${applicationIndex}:${application.text}`"
|
|
120
120
|
>
|
|
121
121
|
<NavSidebarSection
|
|
122
122
|
v-if="isBeaconNavEnabled || expanded || isCurrentApplication(application) || isMobile"
|
|
@@ -136,6 +136,7 @@
|
|
|
136
136
|
:settings-route="settingsRoute"
|
|
137
137
|
:school-website="schoolWebsite"
|
|
138
138
|
:collapsed="!expanded && !isMobile"
|
|
139
|
+
:user-rooms-role="userRoomsRole"
|
|
139
140
|
/>
|
|
140
141
|
<NavImpersonateInfoPanel
|
|
141
142
|
v-if="impersonatedUser.show"
|
|
@@ -182,14 +183,14 @@ import ApptegyLogo from "./Icons/ApptegyLogo.vue";
|
|
|
182
183
|
import { useWindowSize } from "@vueuse/core";
|
|
183
184
|
import Unpinned from "./Icons/Unpinned.vue";
|
|
184
185
|
import Pinned from "./Icons/Pinned.vue";
|
|
185
|
-
import PAvatar from "primevue/avatar";
|
|
186
186
|
const { $t, $ld } = useNuxtApp();
|
|
187
187
|
const props = defineProps({
|
|
188
|
-
clientId: { type: Number, required:
|
|
188
|
+
clientId: { type: Number, required: false, default: void 0 },
|
|
189
189
|
applications: { type: Array, required: true, default: () => [] },
|
|
190
190
|
currentApplication: { type: String, required: false, default: "media" },
|
|
191
191
|
homepageUrl: { type: String, required: false, default: "/" },
|
|
192
192
|
showHelpArticles: { type: Boolean, required: false, default: true },
|
|
193
|
+
userRoomsRole: { type: [String, null], required: false },
|
|
193
194
|
helpArticleOptions: { type: Array, required: false, default: () => [] },
|
|
194
195
|
impersonatedUser: { type: Object, required: false, default: () => ({
|
|
195
196
|
show: false,
|
|
@@ -212,6 +213,7 @@ const props = defineProps({
|
|
|
212
213
|
showCollapseButton: { type: Boolean, required: false, default: false }
|
|
213
214
|
});
|
|
214
215
|
const emit = defineEmits(["toggle-expand"]);
|
|
216
|
+
defineSlots();
|
|
215
217
|
const isCurrentApplication = (application) => isSameApplication(props.currentApplication, application.text);
|
|
216
218
|
const { state: expanded } = useSidebar();
|
|
217
219
|
const { brand, getBrandingStyles } = await useBranding(props.clientId);
|
|
@@ -5,11 +5,14 @@ interface ILogo {
|
|
|
5
5
|
iconSrc: string;
|
|
6
6
|
}
|
|
7
7
|
interface ISidebarProps {
|
|
8
|
-
|
|
8
|
+
/** Optional: branding is skipped when absent (useBranding guards undefined). */
|
|
9
|
+
clientId?: number;
|
|
9
10
|
applications: Array<IApplication>;
|
|
10
11
|
currentApplication?: IApplication['text'];
|
|
11
12
|
homepageUrl?: string;
|
|
12
13
|
showHelpArticles?: boolean;
|
|
14
|
+
/** Rooms role styling hook, forwarded to NavHelpArticles. */
|
|
15
|
+
userRoomsRole?: string | null;
|
|
13
16
|
helpArticleOptions?: Array<unknown>;
|
|
14
17
|
impersonatedUser?: IUser;
|
|
15
18
|
logo?: ILogo;
|
|
@@ -21,15 +24,11 @@ interface ISidebarProps {
|
|
|
21
24
|
schoolWebsite: string;
|
|
22
25
|
showCollapseButton?: boolean;
|
|
23
26
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
switcher?: (
|
|
29
|
-
} & {
|
|
30
|
-
default?: (props: typeof __VLS_48) => any;
|
|
31
|
-
} & {
|
|
32
|
-
logo?: (props: typeof __VLS_60) => any;
|
|
27
|
+
type __VLS_Slots = {
|
|
28
|
+
/** The ACTIVE application's section items. */
|
|
29
|
+
default?: () => unknown;
|
|
30
|
+
logo?: () => unknown;
|
|
31
|
+
switcher?: () => unknown;
|
|
33
32
|
};
|
|
34
33
|
declare const __VLS_component: import("vue").DefineComponent<ISidebarProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
35
34
|
"toggle-expand": (width: number) => any;
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One entry of the auth-service `navigation` userinfo claim
|
|
3
|
+
* (ClaimHelper.navigation_for). Fields are nullable exactly where the claim
|
|
4
|
+
* emits null, so consumers can pass claim entries without casting.
|
|
5
|
+
*/
|
|
1
6
|
export interface IApplication {
|
|
2
|
-
id: number;
|
|
7
|
+
id: number | null;
|
|
3
8
|
text: string;
|
|
4
|
-
url: string;
|
|
9
|
+
url: string | null;
|
|
5
10
|
img_src: string;
|
|
6
|
-
target?: string;
|
|
11
|
+
target?: string | null;
|
|
12
|
+
api_url?: string | null;
|
|
13
|
+
has_children?: boolean | null;
|
|
14
|
+
client_id?: number;
|
|
15
|
+
apptegy_region?: string | null;
|
|
7
16
|
}
|
|
8
17
|
export interface IUser {
|
|
9
18
|
show: boolean;
|
package/package.json
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apptegy/nuxt-navigation",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"import": "./dist/module.mjs",
|
|
8
8
|
"types": "./dist/types.d.mts"
|
|
9
9
|
},
|
|
10
|
-
"./locale/*": "./locale/*"
|
|
10
|
+
"./locale/*": "./locale/*",
|
|
11
|
+
"./types": {
|
|
12
|
+
"types": "./dist/runtime/types/index.d.ts",
|
|
13
|
+
"import": "./dist/runtime/types/index.js"
|
|
14
|
+
}
|
|
11
15
|
},
|
|
12
16
|
"main": "./dist/module.mjs",
|
|
13
17
|
"files": [
|
|
@@ -51,5 +55,5 @@
|
|
|
51
55
|
"vue": "^3.5.13",
|
|
52
56
|
"vue-tsc": "^3.0.3"
|
|
53
57
|
},
|
|
54
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "a94ec5e9545e55240cb97c9d3e126a34fb0b1e5f"
|
|
55
59
|
}
|