@apptegy/nuxt-navigation 1.0.0-alpha.1 → 1.0.0
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/README.md +70 -5
- package/dist/module.cjs +5 -0
- package/dist/module.d.mts +2 -3
- package/dist/module.d.ts +7 -0
- package/dist/module.json +2 -5
- package/dist/module.mjs +3 -7
- package/dist/runtime/assets/icons/24/Minus.svg +5 -0
- package/dist/runtime/assets/icons/24/Plus.svg +5 -0
- package/dist/runtime/assets/thrillshare-logo-white.svg +1 -22
- package/dist/runtime/components/Nav/Avatar.vue +23 -46
- package/dist/runtime/components/Nav/Header.vue +159 -161
- package/dist/runtime/components/Nav/HelpArticles.vue +61 -119
- package/dist/runtime/components/Nav/ImpersonateInfoPanel.vue +32 -45
- package/dist/runtime/components/Nav/OrgSelect.vue +117 -162
- package/dist/runtime/components/Nav/Sidebar.vue +109 -216
- package/dist/runtime/components/Nav/SidebarItem.vue +17 -44
- package/dist/runtime/components/Nav/SidebarSection.vue +38 -88
- package/dist/runtime/components/Nav/SubMenu.vue +4 -0
- package/dist/runtime/components/Nav/SubMenuItem.vue +7 -6
- package/dist/runtime/composables/accessibleActions.d.ts +33 -0
- package/dist/runtime/composables/accessibleActions.js +195 -0
- package/dist/types.d.mts +1 -3
- package/dist/types.d.ts +1 -0
- package/package.json +33 -31
- package/dist/runtime/api/brand.d.ts +0 -3
- package/dist/runtime/api/brand.js +0 -8
- package/dist/runtime/assets/checkmark.svg +0 -3
- package/dist/runtime/assets/hamburger.svg +0 -3
- package/dist/runtime/assets/iconPaths.json +0 -13
- package/dist/runtime/assets/icons/24/Metadata.svg +0 -4
- package/dist/runtime/assets/impersonation.svg +0 -6
- package/dist/runtime/assets/poweredby-icon.svg +0 -3
- package/dist/runtime/assets/poweredby.svg +0 -19
- package/dist/runtime/components/Nav/Avatar.vue.d.ts +0 -16
- package/dist/runtime/components/Nav/Breadcrumb.vue.d.ts +0 -12
- package/dist/runtime/components/Nav/Header.vue.d.ts +0 -39
- package/dist/runtime/components/Nav/HelpArticles.vue.d.ts +0 -14
- package/dist/runtime/components/Nav/Icons/ApptegyLogo.vue +0 -30
- package/dist/runtime/components/Nav/Icons/ApptegyLogo.vue.d.ts +0 -14
- package/dist/runtime/components/Nav/Icons/Pinned.vue +0 -9
- package/dist/runtime/components/Nav/Icons/Pinned.vue.d.ts +0 -2
- package/dist/runtime/components/Nav/Icons/SidebarToggle.vue +0 -15
- package/dist/runtime/components/Nav/Icons/SidebarToggle.vue.d.ts +0 -2
- package/dist/runtime/components/Nav/Icons/ThrillshareLogo.vue +0 -25
- package/dist/runtime/components/Nav/Icons/ThrillshareLogo.vue.d.ts +0 -2
- package/dist/runtime/components/Nav/Icons/Unpinned.vue +0 -9
- package/dist/runtime/components/Nav/Icons/Unpinned.vue.d.ts +0 -2
- package/dist/runtime/components/Nav/Icons/UserDropdownMenu.vue +0 -5
- package/dist/runtime/components/Nav/Icons/UserDropdownMenu.vue.d.ts +0 -2
- package/dist/runtime/components/Nav/ImpersonateInfoPanel.vue.d.ts +0 -12
- package/dist/runtime/components/Nav/OrgSelect.vue.d.ts +0 -16
- package/dist/runtime/components/Nav/Sidebar.vue.d.ts +0 -53
- package/dist/runtime/components/Nav/SidebarItem.vue.d.ts +0 -20
- package/dist/runtime/components/Nav/SidebarSection.vue.d.ts +0 -18
- package/dist/runtime/components/Nav/SidebarToggle.vue +0 -28
- package/dist/runtime/components/Nav/SidebarToggle.vue.d.ts +0 -2
- package/dist/runtime/components/Nav/SubMenu.vue.d.ts +0 -12
- package/dist/runtime/components/Nav/SubMenuItem.vue.d.ts +0 -22
- package/dist/runtime/components/Nav/UserDropdown.vue +0 -178
- package/dist/runtime/components/Nav/UserDropdown.vue.d.ts +0 -19
- package/dist/runtime/composables/useBranding.d.ts +0 -22
- package/dist/runtime/composables/useBranding.js +0 -35
- package/dist/runtime/composables/useDropdown.d.ts +0 -19
- package/dist/runtime/composables/useDropdown.js +0 -236
- package/dist/runtime/composables/useSidebar.d.ts +0 -5
- package/dist/runtime/composables/useSidebar.js +0 -13
- package/dist/runtime/types/index.d.ts +0 -13
- package/dist/runtime/types/index.js +0 -0
- package/locale/en.json +0 -20
- package/locale/index.js +0 -7
- /package/dist/runtime/assets/{icon.svg → thrillshare-icon-white.svg} +0 -0
|
@@ -1,53 +1,47 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
<button class="a-nav-section--title"
|
|
2
|
+
<div class="a-nav-section animated" id="impersonate-info">
|
|
3
|
+
<button v-if="navbarExpanded" class="a-nav-section--title" @click="expanded = !expanded">
|
|
4
4
|
<div class="a-nav-section-title-wrapper">
|
|
5
5
|
<div class="user-grid">
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
</
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
<p class="info email">{{ impersonatedUser.email }}</p>
|
|
12
|
-
<svg class="panel-icon" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
13
|
-
<path v-if="expanded" d="M12 5V12M12 12L12 19M12 12L19 12M12 12H5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
14
|
-
<path v-else d="M19 12L12 12H5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
15
|
-
</svg>
|
|
16
|
-
</template>
|
|
6
|
+
<img src="../../assets/img/impersonate-user.svg" alt="" class="user-icon" />
|
|
7
|
+
<p class="info">{{ impersonatedUser.client }}</p>
|
|
8
|
+
<p class="info email">{{ impersonatedUser.email }}</p>
|
|
9
|
+
<img v-if="!expanded " class="panel-icon" src="../../assets/icons/24/plus.svg" alt="" />
|
|
10
|
+
<img v-else class="panel-icon" src="../../assets/icons/24/minus.svg" alt="" />
|
|
17
11
|
</div>
|
|
18
12
|
<div
|
|
19
13
|
ref="dropdownWrapper"
|
|
20
|
-
:style="{ 'max-height': `${expanded &&
|
|
14
|
+
:style="{ 'max-height': `${expanded && navbarExpanded ? dropdownScrollHeight : 0}px` }"
|
|
21
15
|
class="a-nav-section-title-dropdown-wrapper"
|
|
22
16
|
>
|
|
23
17
|
<div class="user-grid">
|
|
24
|
-
|
|
25
|
-
<
|
|
26
|
-
<
|
|
27
|
-
</svg>
|
|
28
|
-
<template v-if="sidebarExpanded">
|
|
29
|
-
<p class="info">{{ impersonatedUser.client }}</p>
|
|
30
|
-
<p class="info email">{{ impersonatedUser.admin_email }}</p>
|
|
31
|
-
</template>
|
|
18
|
+
<img src="../../assets/img/user.svg" alt="" class="user-icon" />
|
|
19
|
+
<p class="info">{{ impersonatedUser.client }}</p>
|
|
20
|
+
<p class="info">{{ impersonatedUser.admin_email }}</p>
|
|
32
21
|
</div>
|
|
33
22
|
</div>
|
|
34
23
|
</div>
|
|
24
|
+
<!-- add plus icon -->
|
|
35
25
|
</button>
|
|
26
|
+
<!-- <img v-else src="../../assets/img/impersonate-user.svg" alt="" class="user-icon" /> -->
|
|
36
27
|
</div>
|
|
37
28
|
</template>
|
|
38
29
|
|
|
39
|
-
<script setup>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
impersonatedUser: {
|
|
43
|
-
});
|
|
44
|
-
|
|
30
|
+
<script setup lang="ts">
|
|
31
|
+
const props = defineProps<{
|
|
32
|
+
navbarExpanded: boolean;
|
|
33
|
+
impersonatedUser: {};
|
|
34
|
+
}>();
|
|
35
|
+
|
|
45
36
|
const expanded = ref(false);
|
|
37
|
+
|
|
46
38
|
const dropdownScrollHeight = ref(0);
|
|
47
39
|
const dropdownWrapper = ref();
|
|
40
|
+
|
|
48
41
|
onMounted(() => {
|
|
49
|
-
dropdownScrollHeight.value = dropdownWrapper.value?.scrollHeight
|
|
50
|
-
})
|
|
42
|
+
dropdownScrollHeight.value = dropdownWrapper.value?.scrollHeight
|
|
43
|
+
})
|
|
44
|
+
|
|
51
45
|
</script>
|
|
52
46
|
|
|
53
47
|
<style scoped>
|
|
@@ -55,18 +49,18 @@ onMounted(() => {
|
|
|
55
49
|
cursor: pointer;
|
|
56
50
|
height: fit-content;
|
|
57
51
|
overflow: hidden;
|
|
58
|
-
background-color: var(--nav-background-color,
|
|
52
|
+
background-color: var(--dscl-nav-background-color, var(--purple-70));
|
|
59
53
|
}
|
|
60
54
|
.a-nav-section.animated {
|
|
61
55
|
transition: overflow 0.5s ease-in-out;
|
|
62
56
|
}
|
|
63
57
|
.a-nav-section--title {
|
|
64
|
-
color: var(--nav-
|
|
58
|
+
color: var(--dscl-nav-font-color, var(--dscl-light-font, var(--primary-white)));
|
|
65
59
|
display: flex;
|
|
66
60
|
justify-content: space-between;
|
|
67
61
|
background: none;
|
|
68
62
|
border: none;
|
|
69
|
-
border-top: 1px var(--nav-border-
|
|
63
|
+
border-top: 1px var(--dscl-nav-section-border-bottom-color, var(--purple-65)) solid;
|
|
70
64
|
padding: 0;
|
|
71
65
|
width: 100%;
|
|
72
66
|
cursor: pointer;
|
|
@@ -91,41 +85,34 @@ onMounted(() => {
|
|
|
91
85
|
padding: 12px 0;
|
|
92
86
|
}
|
|
93
87
|
.a-nav-section--title .a-nav-section-title-wrapper .user-grid .user-icon {
|
|
94
|
-
color: var(--nav-icon-color, #222222);
|
|
95
88
|
grid-row: 1/span 2;
|
|
96
|
-
background:
|
|
89
|
+
background: #504764;
|
|
97
90
|
border-radius: 4px;
|
|
98
91
|
padding: 4px;
|
|
99
92
|
margin-right: auto;
|
|
100
93
|
margin-left: 16px;
|
|
101
94
|
}
|
|
102
95
|
.a-nav-section--title .a-nav-section-title-wrapper .user-grid .info {
|
|
103
|
-
color: var(--
|
|
96
|
+
color: var(--primary-white);
|
|
104
97
|
margin: 0;
|
|
105
98
|
grid-row: 1;
|
|
106
99
|
grid-column: 2;
|
|
107
100
|
font-size: 12px;
|
|
108
101
|
font-style: normal;
|
|
109
|
-
font-weight:
|
|
102
|
+
font-weight: 450;
|
|
110
103
|
line-height: 16px;
|
|
111
104
|
letter-spacing: 0.4px;
|
|
112
|
-
max-width: 165px;
|
|
113
|
-
overflow: hidden;
|
|
114
|
-
text-overflow: ellipsis;
|
|
115
105
|
}
|
|
116
106
|
.a-nav-section--title .a-nav-section-title-wrapper .user-grid .email {
|
|
117
107
|
grid-column: 2;
|
|
118
108
|
grid-row: 2;
|
|
119
109
|
margin-top: 4px;
|
|
120
|
-
color:
|
|
110
|
+
color: #CAC2D0;
|
|
121
111
|
font-size: 11px;
|
|
122
112
|
font-style: normal;
|
|
123
|
-
font-weight:
|
|
113
|
+
font-weight: 450;
|
|
124
114
|
line-height: 12px;
|
|
125
115
|
letter-spacing: 0.4px;
|
|
126
|
-
max-width: 165px;
|
|
127
|
-
overflow: hidden;
|
|
128
|
-
text-overflow: ellipsis;
|
|
129
116
|
}
|
|
130
117
|
.a-nav-section--title .a-nav-section-title-wrapper .user-grid .panel-icon {
|
|
131
118
|
transition: transform 0.2s ease-in-out;
|
|
@@ -1,85 +1,7 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { useDropdown, useNuxtApp, useAppConfig, computed, ref, watch, onBeforeUpdate } from "#imports";
|
|
3
|
-
import { vOnClickOutside } from "@vueuse/components";
|
|
4
|
-
const { $t } = useNuxtApp();
|
|
5
|
-
const appConfig = useAppConfig();
|
|
6
|
-
const zIndex = computed(() => appConfig?.navigation?.zIndex || 100);
|
|
7
|
-
const emit = defineEmits(["update:model-value"]);
|
|
8
|
-
const dropdownTriggerRef = ref();
|
|
9
|
-
const inputRef = ref();
|
|
10
|
-
const optionRefs = ref([]);
|
|
11
|
-
const props = defineProps({
|
|
12
|
-
orgs: { type: Array, required: true },
|
|
13
|
-
modelValue: { type: Number, required: true }
|
|
14
|
-
});
|
|
15
|
-
const localSelectedOrgId = ref(props.modelValue);
|
|
16
|
-
watch(() => props.modelValue, (newValue) => {
|
|
17
|
-
localSelectedOrgId.value = newValue;
|
|
18
|
-
});
|
|
19
|
-
const selectedOrg = computed(() => {
|
|
20
|
-
return props.orgs.find(({ id }) => id == localSelectedOrgId.value);
|
|
21
|
-
});
|
|
22
|
-
const {
|
|
23
|
-
active,
|
|
24
|
-
searchQuery,
|
|
25
|
-
highlightedIndex,
|
|
26
|
-
toggleDropdown,
|
|
27
|
-
closeDropdown,
|
|
28
|
-
onClickOutsideHandler,
|
|
29
|
-
keydownActionsOnTrigger,
|
|
30
|
-
handleKeydown,
|
|
31
|
-
handleDropdownSearch
|
|
32
|
-
} = useDropdown(props.orgs, optionRefs, inputRef, {
|
|
33
|
-
searchable: true,
|
|
34
|
-
trackBy: "name"
|
|
35
|
-
});
|
|
36
|
-
const sortedOrgs = computed(() => {
|
|
37
|
-
return [...props.orgs].sort((a, b) => {
|
|
38
|
-
if (a.pinned && !b.pinned) {
|
|
39
|
-
return -1;
|
|
40
|
-
} else if (!a.pinned && b.pinned) {
|
|
41
|
-
return 1;
|
|
42
|
-
} else {
|
|
43
|
-
return 0;
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
const highlightedOrg = computed(() => {
|
|
48
|
-
if (highlightedIndex.value >= 0 && highlightedIndex.value < props.orgs.length) {
|
|
49
|
-
return props.orgs[highlightedIndex.value];
|
|
50
|
-
}
|
|
51
|
-
return null;
|
|
52
|
-
});
|
|
53
|
-
onBeforeUpdate(() => {
|
|
54
|
-
optionRefs.value = [];
|
|
55
|
-
});
|
|
56
|
-
function setOptionRef(el, option) {
|
|
57
|
-
if (el) {
|
|
58
|
-
const index = props.orgs.findIndex((org) => org.id === option.id);
|
|
59
|
-
optionRefs.value[index] = el;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
function handleSelectedOrg($event, orgId) {
|
|
63
|
-
const orgIndex = props.orgs.findIndex((org) => org.id === orgId);
|
|
64
|
-
if ($event.type == "click") {
|
|
65
|
-
localSelectedOrgId.value = orgId;
|
|
66
|
-
emit("update:model-value", orgId);
|
|
67
|
-
closeDropdown();
|
|
68
|
-
} else if ($event.type == "keydown") {
|
|
69
|
-
const keyEvent = $event;
|
|
70
|
-
if (keyEvent.key === "Enter" || keyEvent.key === " ") {
|
|
71
|
-
localSelectedOrgId.value = orgId;
|
|
72
|
-
emit("update:model-value", orgId);
|
|
73
|
-
}
|
|
74
|
-
handleKeydown(keyEvent, orgIndex);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
</script>
|
|
78
|
-
|
|
79
1
|
<template>
|
|
80
2
|
<div class="org-selection">
|
|
81
3
|
<label id="org-dropdown-label" class="sr-only">
|
|
82
|
-
{{
|
|
4
|
+
{{ orgDropdownLabel }}
|
|
83
5
|
</label>
|
|
84
6
|
<div
|
|
85
7
|
ref="dropdownTriggerRef"
|
|
@@ -89,55 +11,51 @@ function handleSelectedOrg($event, orgId) {
|
|
|
89
11
|
aria-haspopup="listbox"
|
|
90
12
|
role="combobox"
|
|
91
13
|
class="dropdown-trigger"
|
|
92
|
-
>
|
|
14
|
+
>
|
|
93
15
|
<input
|
|
94
16
|
ref="inputRef"
|
|
95
|
-
|
|
17
|
+
is="input"
|
|
96
18
|
class="org-title"
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
@
|
|
101
|
-
@
|
|
102
|
-
|
|
103
|
-
<span v-if="selectedOrg?.intranet" class="badge selected">
|
|
104
|
-
<Icon name="lucide:lock" size="12" />
|
|
105
|
-
{{ $t("navigation.orgBadge") }}
|
|
106
|
-
</span>
|
|
107
|
-
<Icon
|
|
108
|
-
:name="active ? 'lucide:chevron-up' : 'lucide:chevron-down'"
|
|
109
|
-
size="16"
|
|
110
|
-
@keydown="keydownActionsOnTrigger"
|
|
111
|
-
@click.prevent="toggleDropdown"
|
|
19
|
+
type="text"
|
|
20
|
+
placeholder="Start typing to search"
|
|
21
|
+
:value="active? newQuery : selectedOrg.name"
|
|
22
|
+
@keydown="keydownActionsOnTrigger($event, orgs, optionRef, dropdownTriggerRef, true, inputRef)"
|
|
23
|
+
@click.prevent="toggleDropdown($event, optionRef)"
|
|
24
|
+
@input="handleDropdownSearch($event, sortedOrgs, optionRef)"
|
|
112
25
|
/>
|
|
26
|
+
<span v-if="selectedOrg.intranet" class="intranet selected">
|
|
27
|
+
<a-icon icon="16:lock-locked" ></a-icon>
|
|
28
|
+
{{ $t('dscl.navigation.intranet') }}
|
|
29
|
+
</span>
|
|
30
|
+
<!-- <Icon
|
|
31
|
+
style="margin-bottom: 2px"
|
|
32
|
+
:name-or-path="`dropdown${active ? '-up' : ''}`"
|
|
33
|
+
size="tiny"
|
|
34
|
+
reduced
|
|
35
|
+
variant="info"
|
|
36
|
+
/> -->
|
|
113
37
|
</div>
|
|
114
|
-
<div
|
|
115
|
-
v-show="active"
|
|
116
|
-
id="organizations-options-list"
|
|
117
|
-
class="dropdown"
|
|
118
|
-
role="listbox"
|
|
119
|
-
>
|
|
38
|
+
<div v-show="active" id="organizations-options-list" class="dropdown" role="listbox">
|
|
120
39
|
<div
|
|
121
|
-
v-for="option in sortedOrgs"
|
|
122
|
-
:key="option.id"
|
|
123
|
-
:ref="(el) => setOptionRef(el, option)"
|
|
40
|
+
v-for="(option, idx) in sortedOrgs"
|
|
124
41
|
v-on-click-outside="onClickOutsideHandler"
|
|
42
|
+
ref="optionRef"
|
|
43
|
+
:key="option.name"
|
|
125
44
|
role="option"
|
|
126
45
|
class="org-option"
|
|
127
|
-
:class="{
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
tabindex="0"
|
|
133
|
-
@keydown="handleSelectedOrg($event, option.id)"
|
|
134
|
-
@click="handleSelectedOrg($event, option.id)"
|
|
46
|
+
:class="{ selected: option === selectedOrg }"
|
|
47
|
+
:aria-selected="!!String(option === selectedOrg)"
|
|
48
|
+
tabindex="-1"
|
|
49
|
+
@keydown="handleKeydownAction(orgs, idx, $event, optionRef, dropdownTriggerRef)"
|
|
50
|
+
@click="handleSelectedClick(idx)"
|
|
135
51
|
>
|
|
136
|
-
<
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
52
|
+
<div class="selected-space">
|
|
53
|
+
<!-- <Icon v-if="option === selectedOrg" name-or-path="success" size="tiny" /> -->
|
|
54
|
+
</div>
|
|
55
|
+
<span :class="{ pinned: option.pinned, 'item-flex': true }">{{ option?.name || option.label }}
|
|
56
|
+
<span v-if="option.intranet" class="intranet selected">
|
|
57
|
+
<a-icon icon="16:lock-locked"></a-icon>
|
|
58
|
+
{{ $t('dscl.navigation.intranet') }}
|
|
141
59
|
</span>
|
|
142
60
|
</span>
|
|
143
61
|
</div>
|
|
@@ -145,57 +63,104 @@ function handleSelectedOrg($event, orgId) {
|
|
|
145
63
|
</div>
|
|
146
64
|
</template>
|
|
147
65
|
|
|
66
|
+
<script setup lang="ts">
|
|
67
|
+
import { useDropdown } from '../../composables/accessibleActions.js';
|
|
68
|
+
import { vOnClickOutside } from '@vueuse/components';
|
|
69
|
+
import { ref, computed } from 'vue'
|
|
70
|
+
const { $t } = useNuxtApp();
|
|
71
|
+
|
|
72
|
+
const emit = defineEmits(['selected']);
|
|
73
|
+
|
|
74
|
+
const {
|
|
75
|
+
active,
|
|
76
|
+
newQuery,
|
|
77
|
+
toggleDropdown,
|
|
78
|
+
closeDropdown,
|
|
79
|
+
onClickOutsideHandler,
|
|
80
|
+
keydownActionsOnTrigger,
|
|
81
|
+
handleKeydown,
|
|
82
|
+
handleDropdownSearch,
|
|
83
|
+
// focusDropdownItem,
|
|
84
|
+
} = useDropdown();
|
|
85
|
+
|
|
86
|
+
interface IOrgSelectProps {
|
|
87
|
+
orgs: Array<any>;
|
|
88
|
+
selectedOrg: {};
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const dropdownTriggerRef = ref();
|
|
92
|
+
const optionRef = ref();
|
|
93
|
+
|
|
94
|
+
const props = defineProps<IOrgSelectProps>();
|
|
95
|
+
|
|
96
|
+
const sortedOrgs = computed(() => {
|
|
97
|
+
return [...props.orgs].sort((a, b) => {
|
|
98
|
+
if (a.pinned && !b.pinned) {
|
|
99
|
+
return -1;
|
|
100
|
+
} else if (!a.pinned && b.pinned) {
|
|
101
|
+
return 1;
|
|
102
|
+
} else {
|
|
103
|
+
return 0;
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
const orgDropdownLabel = computed(() => {
|
|
108
|
+
return useNuxtApp().$t('navigation.orgDropdown') || 'Select Organization'
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
function handleSelectedClick(index: number) {
|
|
112
|
+
emit('selected', index);
|
|
113
|
+
closeDropdown();
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function handleKeydownAction(orgs: string | any[], idx: number, $event: { key: string | boolean; }, optionRef: { focus: () => void; }[], dropdownTriggerRef: { focus: () => void; }) {
|
|
117
|
+
emit('selected', idx);
|
|
118
|
+
handleKeydown(orgs, idx, $event, optionRef, dropdownTriggerRef);
|
|
119
|
+
}
|
|
120
|
+
</script>
|
|
121
|
+
|
|
148
122
|
<style scoped>
|
|
149
123
|
#organizations-options-list {
|
|
150
124
|
position: absolute;
|
|
151
125
|
width: 300px;
|
|
152
126
|
max-height: 300px;
|
|
153
127
|
overflow-y: auto;
|
|
154
|
-
background-color:
|
|
155
|
-
z-index:
|
|
128
|
+
background-color: white;
|
|
129
|
+
z-index: 50;
|
|
156
130
|
}
|
|
157
131
|
|
|
158
132
|
.org-selection {
|
|
159
|
-
border-radius: 4px 4px 0 0;
|
|
160
|
-
}
|
|
161
|
-
.org-selection:focus-within {
|
|
162
|
-
outline: 2px var(--purple) solid;
|
|
163
|
-
}
|
|
164
|
-
.org-selection .dropdown-trigger {
|
|
165
133
|
width: 300px;
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
justify-content: space-between;
|
|
171
|
-
border-radius: 4px 4px 0 0;
|
|
172
|
-
border: 0;
|
|
173
|
-
border-bottom: 1px solid var(--dscl-forms-underline, var(--grey-50));
|
|
174
|
-
background: var(--dscl-forms-bg, var(--grey-10));
|
|
134
|
+
margin-right: 25px;
|
|
135
|
+
}
|
|
136
|
+
.org-selection .dropdown-trigger:focus-visible {
|
|
137
|
+
outline: 2px #000FFF solid;
|
|
175
138
|
}
|
|
176
139
|
.org-selection .dropdown-trigger .org-title {
|
|
177
140
|
line-height: 16px;
|
|
178
|
-
width:
|
|
141
|
+
width: 300px;
|
|
179
142
|
padding: 12px;
|
|
180
143
|
letter-spacing: 0.4px;
|
|
181
144
|
touch-action: manipulation;
|
|
182
|
-
color:
|
|
145
|
+
color: #333;
|
|
183
146
|
height: 40px;
|
|
184
|
-
|
|
147
|
+
display: flex;
|
|
148
|
+
justify-content: space-between;
|
|
149
|
+
align-items: center;
|
|
185
150
|
padding: 8px;
|
|
186
|
-
|
|
151
|
+
border-radius: 4px 4px 0 0;
|
|
152
|
+
border: 0;
|
|
153
|
+
border-bottom: 1px solid var(--dscl-forms-underline, #747474);
|
|
154
|
+
background: var(--dscl-forms-bg, #fbfbfb);
|
|
187
155
|
white-space: nowrap;
|
|
188
156
|
cursor: pointer;
|
|
189
157
|
}
|
|
190
|
-
.org-selection .
|
|
191
|
-
|
|
192
|
-
}
|
|
193
|
-
.org-selection .dropdown {
|
|
194
|
-
border-radius: 0 0 4px 4px;
|
|
195
|
-
box-shadow: 0px 6px 20px 0px rgba(0, 0, 0, 0.06);
|
|
158
|
+
.org-selection .intranet {
|
|
159
|
+
background-color: var(--purple-50);
|
|
196
160
|
}
|
|
197
161
|
.org-selection .dropdown .org-option {
|
|
198
|
-
|
|
162
|
+
display: block;
|
|
163
|
+
padding: 12px;
|
|
199
164
|
min-height: 40px;
|
|
200
165
|
line-height: 16px;
|
|
201
166
|
text-decoration: none;
|
|
@@ -203,41 +168,31 @@ function handleSelectedOrg($event, orgId) {
|
|
|
203
168
|
position: relative;
|
|
204
169
|
cursor: pointer;
|
|
205
170
|
}
|
|
206
|
-
.org-selection .dropdown .org-option.selected {
|
|
207
|
-
background-image: url("../../assets/checkmark.svg");
|
|
208
|
-
background-repeat: no-repeat;
|
|
209
|
-
background-position: center left 15px;
|
|
210
|
-
color: var(--purple);
|
|
211
|
-
}
|
|
212
|
-
.org-selection .dropdown .org-option.highlighted {
|
|
213
|
-
background-color: #f8f6fc;
|
|
214
|
-
}
|
|
215
171
|
.org-selection .dropdown .org-option:focus-visible, .org-selection .dropdown .org-option:hover {
|
|
216
|
-
background-color: #
|
|
172
|
+
background-color: #F8F6FC;
|
|
217
173
|
}
|
|
218
174
|
.org-selection .custom-search {
|
|
219
175
|
margin: 8px 16px;
|
|
220
176
|
}
|
|
221
177
|
.org-selection .item-flex {
|
|
222
178
|
display: flex;
|
|
223
|
-
gap:
|
|
179
|
+
gap: 10px;
|
|
224
180
|
align-items: center;
|
|
225
181
|
width: 100%;
|
|
226
182
|
justify-content: space-between;
|
|
227
183
|
}
|
|
228
|
-
.org-selection .
|
|
184
|
+
.org-selection .intranet {
|
|
229
185
|
display: inline-flex;
|
|
230
186
|
align-items: center;
|
|
231
187
|
background-color: var(--purple-50);
|
|
232
188
|
padding: 2px 4px;
|
|
233
189
|
color: white;
|
|
234
|
-
border-radius:
|
|
235
|
-
text-transform: uppercase;
|
|
190
|
+
border-radius: 4px;
|
|
236
191
|
}
|
|
237
|
-
.org-selection .
|
|
192
|
+
.org-selection .intranet svg {
|
|
238
193
|
margin-right: 4px;
|
|
239
194
|
}
|
|
240
|
-
.org-selection .
|
|
195
|
+
.org-selection .intranet.selected {
|
|
241
196
|
background-color: var(--grey-50);
|
|
242
197
|
}
|
|
243
198
|
</style>
|