adminforth 3.33.0 → 3.33.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.
@@ -17,9 +17,10 @@
17
17
  :class="{
18
18
  'block': showDropdown,
19
19
  'hidden': !showDropdown,
20
- 'left-0 md:left-auto': checkboxes && checkboxes.length > 0
20
+ 'left-0': openToRight,
21
+ 'right-0': !openToRight
21
22
  }"
22
- class="absolute z-30 mt-3 bg-lightThreeDotsMenuBodyBackground divide-y divide-gray-100 rounded-lg shadow w-max max-w-64 dark:bg-darkThreeDotsMenuBodyBackground dark:divide-gray-600 right-0">
23
+ class="absolute z-50 mt-3 bg-lightThreeDotsMenuBodyBackground divide-y divide-gray-100 rounded-lg shadow w-max max-w-64 dark:bg-darkThreeDotsMenuBodyBackground dark:divide-gray-600">
23
24
  <ul class="py-2 text-sm text-lightThreeDotsMenuBodyText dark:text-darkThreeDotsMenuBodyText" aria-labelledby="dropdownMenuIconButton">
24
25
  <li v-for="(item, i) in threeDotsDropdownItems" :key="`dropdown-item-${i}`">
25
26
  <div
@@ -102,7 +103,7 @@ import { useCoreStore } from '@/stores/core';
102
103
  import { useAdminforth } from '@/adminforth';
103
104
  import { useRoute, useRouter } from 'vue-router';
104
105
  import CallActionWrapper from '@/components/CallActionWrapper.vue'
105
- import { ref, type ComponentPublicInstance, onMounted, onUnmounted } from 'vue';
106
+ import { ref, nextTick, type ComponentPublicInstance, onMounted, onUnmounted } from 'vue';
106
107
  import type { AdminForthActionFront, AdminForthBulkActionFront, AdminForthComponentDeclarationFull } from '@/types/Common';
107
108
  import { Spinner, Button } from '@/afcl';
108
109
 
@@ -112,6 +113,7 @@ const coreStore = useCoreStore();
112
113
  const router = useRouter();
113
114
  const threeDotsDropdownItemsRefs = ref<Array<ComponentPublicInstance | null>>([]);
114
115
  const showDropdown = ref(false);
116
+ const openToRight = ref(true);
115
117
  const actionLoadingStates = ref<Record<string, boolean>>({});
116
118
  const dropdownRef = ref<HTMLElement | null>(null);
117
119
  const buttonTriggerRef = ref<ComponentPublicInstance | null>(null);
@@ -188,8 +190,14 @@ async function injectedComponentClick(index: number, event?: MouseEvent) {
188
190
  showDropdown.value = false;
189
191
  }
190
192
 
191
- function toggleDropdownVisibility() {
193
+ async function toggleDropdownVisibility() {
192
194
  showDropdown.value = !showDropdown.value;
195
+ if (!showDropdown.value) return;
196
+ await nextTick();
197
+ const triggerRect = (buttonTriggerRef.value!.$el as HTMLElement).getBoundingClientRect();
198
+ const appEl = document.getElementById('app')!;
199
+ const appContentRight = appEl.getBoundingClientRect().right - parseFloat(getComputedStyle(appEl).paddingRight);
200
+ openToRight.value = triggerRect.left + dropdownRef.value!.offsetWidth <= appContentRight;
193
201
  }
194
202
 
195
203
  function handleClickOutside(e: MouseEvent) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "3.33.0",
3
+ "version": "3.33.2",
4
4
  "description": "OpenSource Agent-Native forth-generation admin panel",
5
5
  "keywords": [
6
6
  "adminforth",
@@ -105,7 +105,7 @@
105
105
  "execa": "^9.5.2",
106
106
  "fs-extra": "^11.2.0",
107
107
  "fuse.js": "^7.0.0",
108
- "handlebars": "^4.7.9",
108
+ "handlebars": "^4.7.10",
109
109
  "inquirer": "^12.3.0",
110
110
  "ip-address": "^10.7.2",
111
111
  "jiti": "^2.4.2",