adminforth 1.2.88 → 1.2.90

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.
@@ -158,11 +158,13 @@ export default class AdminForthRestAPI {
158
158
  }
159
159
  };
160
160
  function processMenuItem(menuItem) {
161
- if (menuItem.badge) {
162
- if (typeof menuItem.badge === 'function') {
163
- menuItem.badge = menuItem.badge(adminUser);
161
+ return __awaiter(this, void 0, void 0, function* () {
162
+ if (menuItem.badge) {
163
+ if (typeof menuItem.badge === 'function') {
164
+ menuItem.badge = yield menuItem.badge(adminUser);
165
+ }
164
166
  }
165
- }
167
+ });
166
168
  }
167
169
  let newMenu = [];
168
170
  for (let menuItem of this.adminforth.config.menu) {
@@ -187,10 +187,10 @@ export default class AdminForthRestAPI {
187
187
 
188
188
  }
189
189
 
190
- function processMenuItem(menuItem) {
190
+ async function processMenuItem(menuItem) {
191
191
  if (menuItem.badge) {
192
192
  if (typeof menuItem.badge === 'function') {
193
- menuItem.badge = menuItem.badge(adminUser);
193
+ menuItem.badge = await menuItem.badge(adminUser);
194
194
  }
195
195
  }
196
196
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "1.2.88",
3
+ "version": "1.2.90",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/spa/src/App.vue CHANGED
@@ -84,9 +84,15 @@
84
84
  :aria-controls="`dropdown-example${i}`"
85
85
  :data-collapse-toggle="`dropdown-example${i}`"
86
86
  >
87
+
87
88
  <component v-if="item.icon" :is="getIcon(item.icon)" class="w-5 h-5 text-lightSidebarIcons group-hover:text-lightSidebarIconsHover transition duration-75 dark:group-hover:text-darkSidebarIconsHover dark:text-darkSidebarIcons" ></component>
88
89
 
89
- <span class="flex-1 ms-3 text-left rtl:text-right whitespace-nowrap">{{ item.label }}</span>
90
+ <span class="flex-1 ms-3 text-left rtl:text-right whitespace-nowrap">{{ item.label }}
91
+
92
+ <span v-if="item.badge" class="inline-flex items-center justify-center w-3 h-3 p-3 ms-3 text-sm font-medium rounded-full bg-lightAnnouncementBG dark:bg-darkAnnouncementBG
93
+ fill-lightAnnouncementText dark:fill-darkAccent text-lightAnnouncementText dark:text-darkAccent">{{ item.badge }}</span>
94
+ </span>
95
+
90
96
  <svg :class="{'rotate-180': opened.includes(i) }" class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
91
97
  <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 4 4 4-4"/>
92
98
  </svg>
@@ -95,12 +101,12 @@
95
101
  <ul :id="`dropdown-example${i}`" role="none" class="pt-1 space-y-1" :class="{ 'hidden': !opened.includes(i) }">
96
102
  <template v-for="(child, j) in item.children" :key="`menu-${i}-${j}`">
97
103
  <li>
98
- <MenuLink :item="child" isChild="true" />
99
- </li>
104
+ <MenuLink :item="child" isChild="true" />
105
+ </li>
100
106
  </template>
101
- </ul>
102
- </li>
103
- <li v-else>
107
+ </ul>
108
+ </li>
109
+ <li v-else>
104
110
  <MenuLink :item="item" />
105
111
  </li>
106
112
  </template>