adminforth 4.27.1 → 4.27.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.
@@ -11,8 +11,10 @@
11
11
  'pl-2.5 pr-3': isChild && !isSidebarIconOnly && !isSidebarHovering,
12
12
  'pl-6 pr-3': isChild && isSidebarIconOnly && isSidebarHovering,
13
13
  'w-full': !isSidebarIconOnly || isSidebarHovering,
14
- 'px-3': !isChild && (!isSidebarIconOnly || isSidebarHovering),
15
- 'w-10 h-9 ml-1 px-3': isSidebarIconOnly && !isSidebarHovering,
14
+ 'px-3': !isChild && !isSidebarIconOnly,
15
+ 'pl-4 pr-3': !isChild && isSidebarIconOnly && isSidebarHovering,
16
+ 'h-9': isSidebarIconOnly,
17
+ 'w-10 ml-1 px-3': isSidebarIconOnly && !isSidebarHovering,
16
18
  'bg-lightSidebarItemActive text-lightSidebarTextActive font-medium dark:bg-darkSidebarItemActive dark:text-darkSidebarTextActive': isItemActive(item)
17
19
  }"
18
20
  >
@@ -65,7 +65,7 @@
65
65
 
66
66
  <ul class="af-sidebar-container space-y-0.5 text-sm" >
67
67
  <template v-if="!iconOnlySidebarEnabled || !isSidebarIconOnly" v-for="(item, i) in coreStore.menu" :key="`menu-${i}`">
68
- <div v-if="item.type === 'divider'" class="my-2 mx-2 border-t border-lightSidebarDevider dark:border-darkSidebarDevider"></div>
68
+ <div v-if="item.type === 'divider'" class="flex items-center h-4 mx-2"><div class="w-full border-t border-lightSidebarDevider dark:border-darkSidebarDevider"></div></div>
69
69
  <div v-else-if="item.type === 'gap'" class="flex items-center justify-center h-4"></div>
70
70
  <div v-else-if="item.type === 'heading'" class="flex items-center justify-left px-3 pt-3 pb-1 text-xs font-medium tracking-wide text-lightSidebarHeading dark:text-darkSidebarHeading
71
71
  ">{{ item.label }}</div>
@@ -113,16 +113,23 @@
113
113
  </li>
114
114
  </template>
115
115
  <template v-if="iconOnlySidebarEnabled && isSidebarIconOnly" v-for="(item, i) in coreStore.menu" :key="`menu-${i}`">
116
- <div v-if="item.type === 'divider'" class="my-2 mx-2 border-t border-lightSidebarDevider dark:border-darkSidebarDevider"></div>
116
+ <div v-if="item.type === 'divider'" class="flex items-center h-4 mx-2">
117
+ <div class="w-full border-t border-lightSidebarDevider dark:border-darkSidebarDevider" :class="{ invisible: !isSidebarHovering && isNextTo(i, 'heading') }"></div>
118
+ </div>
117
119
  <div v-else-if="item.type === 'gap'" class="flex items-center justify-center h-4"></div>
118
- <div v-else-if="item.type === 'heading' && isSidebarHovering" class="flex items-center justify-left px-3 h-8 text-xs font-medium tracking-wide text-lightSidebarHeading dark:text-darkSidebarHeading
119
- ">{{ item.label }}</div>
120
- <div v-else-if="item.type === 'heading' && !isSidebarHovering" class="opacity-0 w-1 h-8">{{ item.label }}</div>
120
+ <div v-else-if="item.type === 'heading' && isSidebarHovering" class="flex items-center justify-left pl-4 pr-3 text-xs font-medium tracking-wide text-lightSidebarHeading dark:text-darkSidebarHeading
121
+ " :class="isNextTo(i, 'divider') ? 'h-6' : 'h-8'">{{ item.label }}</div>
122
+ <div v-else-if="item.type === 'heading' && !isSidebarHovering" class="flex items-center mx-2" :class="isNextTo(i, 'divider') ? 'h-6' : 'h-8'" :aria-label="item.label as string">
123
+ <div class="w-full border-t border-lightSidebarDevider dark:border-darkSidebarDevider" :class="{
124
+ 'translate-y-[9px]': coreStore.menu[i + 1]?.type === 'divider',
125
+ '-translate-y-[9px]': coreStore.menu[i - 1]?.type === 'divider',
126
+ }"></div>
127
+ </div>
121
128
  <li v-else-if="item.children" class="af-sidebar-expand-container">
122
129
  <button @click="clickOnMenuItem(item)" type="button" class="af-sidebar-expand-button relative flex items-center h-9 py-2 text-sm text-lightSidebarText rounded-default group hover:bg-lightSidebarItemHover hover:text-lightSidebarTextHover dark:text-darkSidebarText dark:hover:bg-darkSidebarItemHover dark:hover:text-darkSidebarTextHover"
123
130
  :class="[
124
131
  isGroupOpened(item) ? 'af-sidebar-dropdown-expanded' : 'af-sidebar-dropdown-collapsed',
125
- isSidebarIconOnly && !isSidebarHovering ? 'w-10 ml-1 px-3' : 'w-full px-3'
132
+ isSidebarIconOnly && !isSidebarHovering ? 'w-10 ml-1 px-3' : 'w-full pl-4 pr-3'
126
133
  ]"
127
134
  :aria-controls="`dropdown-example${i}`"
128
135
  >
@@ -395,6 +402,11 @@ function isGroupOpened(item: AdminForthConfigMenuItem) {
395
402
  return openedGroups.value[item.itemId!] ?? item.open;
396
403
  }
397
404
 
405
+ function isNextTo(i: number, type: AdminForthConfigMenuItem['type']) {
406
+ const menu = coreStore.menu;
407
+ return menu[i - 1]?.type === type || menu[i + 1]?.type === type;
408
+ }
409
+
398
410
  function clickOnMenuItem(item: AdminForthConfigMenuItem) {
399
411
  openedGroups.value[item.itemId!] = !isGroupOpened(item);
400
412
  localStorage.setItem(OPENED_GROUPS_LS_KEY, JSON.stringify(openedGroups.value));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "4.27.1",
3
+ "version": "4.27.2",
4
4
  "description": "OpenSource Agent-Native forth-generation admin panel",
5
5
  "keywords": [
6
6
  "adminforth",