@autoafleveren/ui 1.6.2 → 1.6.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autoafleveren/ui",
3
- "version": "1.6.2",
3
+ "version": "1.6.4",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist/*",
@@ -128,6 +128,7 @@
128
128
  ...domClassesPerType[type],
129
129
  ...domClassesPerMenu[props.context ? 'contextMenu' : 'actionBar'],
130
130
  props.action.component ? 'has-submenu' : '',
131
+ props.action.component && confirm ? 'bg-zinc-600' : '',
131
132
  ]"
132
133
  class="relative cursor-pointer rounded-md transition-colors duration-200"
133
134
  >
@@ -84,10 +84,6 @@
84
84
  openIndex.value = index;
85
85
  }
86
86
 
87
- function focus(event: MouseEvent): void {
88
- (event.target as HTMLDivElement | undefined)?.focus();
89
- }
90
-
91
87
  defineExpose({ isOpen, open, close, submit });
92
88
  onClickOutside(contextMenuElement, close);
93
89
  onEscape(close);
@@ -139,7 +135,6 @@
139
135
  @confirm="deactivate"
140
136
  @confirmed="activate"
141
137
  @close="close"
142
- @mouseenter="focus"
143
138
  @open="() => onItemOpen(index)"
144
139
  >
145
140
  <span class="text-base">{{ action.name }}</span>
@@ -2,4 +2,6 @@ export interface Options {
2
2
  childTargetClass?: string;
3
3
  allowOutsideClick?: boolean;
4
4
  preventScroll?: boolean;
5
+ clickOutsideDeactivates?: boolean;
6
+ returnFocusOnDeactivate?: boolean;
5
7
  }
@@ -8,7 +8,7 @@ import type { Options } from './index.d';
8
8
 
9
9
  export function useFocusTrap(
10
10
  target: MaybeRefOrGetter<Arrayable<MaybeRefOrGetter<string> | MaybeComputedElementRef>>,
11
- options: Options = { allowOutsideClick: true, preventScroll: false },
11
+ options: Options = { allowOutsideClick: true, preventScroll: false, clickOutsideDeactivates: true, returnFocusOnDeactivate: true },
12
12
  ) {
13
13
  const isActive = ref<boolean>(false);
14
14
  const { activate: activateTrap, deactivate: deactivateTrap } = useFocusTrapVueUse(target, options);