@apptegy/nuxt-navigation 0.1.1 → 0.1.2

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.1",
4
+ "version": "0.1.2",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.8.1",
7
7
  "unbuild": "unknown"
@@ -104,8 +104,11 @@ function handleSelectedClick(index: number) {
104
104
  }
105
105
 
106
106
  function handleKeydownAction(userSettingsOptions: any[], idx: number, $event: { key: string | boolean; }, optionRef: { focus: () => void; }[], dropdownTriggerRef: { focus: () => void; }) {
107
- emit('select-setting', idx);
108
- handleKeydown(userSettingsOptions, idx, $event, optionRef, dropdownTriggerRef);
107
+ if ($event.key === 'Enter' || $event.key === ' ') {
108
+ emit('select-setting', idx);
109
+ } else {
110
+ handleKeydown(userSettingsOptions, idx, $event, optionRef, dropdownTriggerRef);
111
+ }
109
112
  }
110
113
 
111
114
  function toggleSidebar() {
@@ -23,7 +23,7 @@
23
23
  <img v-if="isDropdown" src="../../assets/img/help-toggle.svg" alt="" class="help-center-btn-icon" />
24
24
  <img v-else src="../../assets/img/help.svg" alt="" class="help-center-btn-icon" />
25
25
  <span v-if="navbarExpanded">
26
- {{ isDropdown ? $t('dscl.navigation.helpCenter') : $t('dscl.navigation.helpArticles') }}
26
+ {{ isDropdown ? $t('navigation.helpCenter') : $t('navigation.helpArticles') }}
27
27
  </span>
28
28
  <img
29
29
  v-if="isDropdown && navbarExpanded && !hasArticles"
@@ -21,9 +21,7 @@
21
21
  </div>
22
22
  </div>
23
23
  </div>
24
- <!-- add plus icon -->
25
24
  </button>
26
- <!-- <img v-else src="../../assets/img/impersonate-user.svg" alt="" class="user-icon" /> -->
27
25
  </div>
28
26
  </template>
29
27
 
@@ -25,7 +25,7 @@
25
25
  />
26
26
  <span v-if="selectedOrg.intranet" class="intranet selected">
27
27
  <a-icon icon="16:lock-locked" ></a-icon>
28
- {{ $t('dscl.navigation.intranet') }}
28
+ {{ $t('navigation.intranet') }}
29
29
  </span>
30
30
  <!-- <Icon
31
31
  style="margin-bottom: 2px"
@@ -52,10 +52,10 @@
52
52
  <div class="selected-space">
53
53
  <!-- <Icon v-if="option === selectedOrg" name-or-path="success" size="tiny" /> -->
54
54
  </div>
55
- <span :class="{ pinned: option.pinned, 'item-flex': true }">{{ option?.name || option.label }}
55
+ <span :class="{ pinned: option.pinned, 'item-flex': true }">{{ optionLabel(option) }}
56
56
  <span v-if="option.intranet" class="intranet selected">
57
57
  <a-icon icon="16:lock-locked"></a-icon>
58
- {{ $t('dscl.navigation.intranet') }}
58
+ {{ $t('navigation.intranet') }}
59
59
  </span>
60
60
  </span>
61
61
  </div>
@@ -80,7 +80,6 @@ const {
80
80
  keydownActionsOnTrigger,
81
81
  handleKeydown,
82
82
  handleDropdownSearch,
83
- // focusDropdownItem,
84
83
  } = useDropdown();
85
84
 
86
85
  interface IOrgSelectProps {
@@ -88,11 +87,18 @@ interface IOrgSelectProps {
88
87
  selectedOrg: {};
89
88
  };
90
89
 
91
- const dropdownTriggerRef = ref();
92
- const optionRef = ref();
90
+ withDefaults(defineProps<IOrgSelectProps>(), {
91
+ selectedOrg: {
92
+ name: '',
93
+ intranet: false
94
+ }
95
+ });
93
96
 
94
97
  const props = defineProps<IOrgSelectProps>();
95
98
 
99
+ const dropdownTriggerRef = ref();
100
+ const optionRef = ref();
101
+
96
102
  const sortedOrgs = computed(() => {
97
103
  return [...props.orgs].sort((a, b) => {
98
104
  if (a.pinned && !b.pinned) {
@@ -105,9 +111,13 @@ const sortedOrgs = computed(() => {
105
111
  });
106
112
  });
107
113
  const orgDropdownLabel = computed(() => {
108
- return useNuxtApp().$t('navigation.orgDropdown') || 'Select Organization'
114
+ return $t('navigation.orgDropdown') || 'Select Organization'
109
115
  })
110
116
 
117
+ function optionLabel(option) {
118
+ return option?.name || option.label
119
+ }
120
+
111
121
  function handleSelectedClick(index: number) {
112
122
  emit('selected', index);
113
123
  closeDropdown();
@@ -5,7 +5,7 @@
5
5
  aria-label="Main"
6
6
  :class="{ expanded }"
7
7
  >
8
- <a
8
+ <a
9
9
  ref="skip-to-content"
10
10
  href="#main-content-section"
11
11
  class="skip-to-content"
@@ -94,6 +94,7 @@ withDefaults(defineProps<ISidebarProps>(), {
94
94
  currentApplication: 'media',
95
95
  homepageUrl: '/',
96
96
  showHelpArticles: true,
97
+ expanded: true,
97
98
  helpArticleOptions: () => [],
98
99
  impersonatedUser: {
99
100
  show: false,
@@ -111,9 +112,6 @@ withDefaults(defineProps<ISidebarProps>(), {
111
112
  </script>
112
113
 
113
114
  <style scoped>
114
- /* * {
115
- outline: 2px solid red;
116
- } */
117
115
  .navbar {
118
116
  grid-area: navsidebar;
119
117
  display: grid;
@@ -140,6 +138,7 @@ withDefaults(defineProps<ISidebarProps>(), {
140
138
  .navbar--logo {
141
139
  padding: 16px;
142
140
  background-color: var(--dscl-nav-background-color, var(--purple-70));
141
+ overflow: hidden;
143
142
  }
144
143
  .navbar--content {
145
144
  display: flex;
@@ -1,6 +1,6 @@
1
1
  export declare function useDropdown(): {
2
- active: any;
3
- newQuery: any;
2
+ active: import("vue").Ref<boolean>;
3
+ newQuery: import("vue").Ref<string>;
4
4
  toggleDropdown: ($event: {
5
5
  key: string;
6
6
  }, optionRef: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apptegy/nuxt-navigation",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -29,6 +29,7 @@
29
29
  "@nuxt/kit": "^3.12.3"
30
30
  },
31
31
  "devDependencies": {
32
+ "@iconify/vue": "^4.1.2",
32
33
  "@nuxt/devtools": "^1.3.9",
33
34
  "@nuxt/eslint-config": "^0.3.13",
34
35
  "@apptegy/icons": "2.10.0",
@@ -36,9 +37,10 @@
36
37
  "@nuxt/schema": "^3.12.3",
37
38
  "@nuxt/test-utils": "^3.13.1",
38
39
  "@types/node": "^20.14.10",
40
+ "@vueuse/components": "10.11.0",
39
41
  "changelogen": "^0.5.5",
40
42
  "eslint": "^9.7.0",
41
- "lodash": "^4.17.15",
43
+ "lodash": "^4.17.21",
42
44
  "nuxt": "^3.12.3",
43
45
  "sass": "^1.77.8",
44
46
  "typescript": "^5.5.3",