edvoyui-component-library-test-flight 0.0.225 → 0.0.227

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.
@@ -14,6 +14,9 @@ declare function __VLS_template(): {
14
14
  menuitem: MenuItem;
15
15
  }): any;
16
16
  actionName?(_: {}): any;
17
+ emptySubmenu?(_: {
18
+ menuitem: MenuItem;
19
+ }): any;
17
20
  submenu?(_: {
18
21
  subItem: MenuItem;
19
22
  }): any;
@@ -76,6 +76,11 @@
76
76
  <div
77
77
  class="p-2 overflow-y-auto overscroll-auto max-h-[50svh] min-h-0 scrollbar--thin"
78
78
  >
79
+ <slot
80
+ v-if="item.subMenu.length === 0"
81
+ name="emptySubmenu"
82
+ :menuitem="item"
83
+ />
79
84
  <div
80
85
  v-for="subItem in item.subMenu"
81
86
  :key="subItem.text"
@@ -21,10 +21,13 @@
21
21
 
22
22
  <button
23
23
  v-if="isExpanded"
24
+ type="button"
25
+ aria-label="Clear search"
24
26
  :class="
25
27
  inputValue ? ' absolute inset-y-0 right-3 ' : ' hidden '
26
28
  "
27
- @click="(searchQuery=''), emit('update:modelValue', '')"
29
+ @mousedown.prevent
30
+ @click.stop="clearSearch"
28
31
  >
29
32
  <svg
30
33
  xmlns="http://www.w3.org/2000/svg"
@@ -105,6 +108,13 @@ async function expandInput() {
105
108
  input.value?.focus();
106
109
  }
107
110
 
111
+ async function clearSearch() {
112
+ searchQuery.value = "";
113
+ emit("update:modelValue", "");
114
+ await nextTick();
115
+ input.value?.focus();
116
+ }
117
+
108
118
  const inputValue = computed(() => {
109
119
  return props.modelValue === 0 ? true : !!props.modelValue;
110
120
  });
@@ -58,7 +58,7 @@
58
58
  :class="[
59
59
  inputValue
60
60
  ? 'top-3.5 text-xs text-gray-400 cursor-default max-w-max'
61
- : 'top-1/2 text-sm text-gray-700 cursor-pointer h-14 pt-5 pb-4 bg-transparent ring-0 ring-gray-200 group-hover:top-3.5 group-hover:py-0 group-hover:h-auto bg-white group-hover:text-xs group-hover:w-max w-[88%] group-hover:-translate-y-1/2 group-hover:text-gray-400',
61
+ : 'top-1/2 text-sm text-gray-700 cursor-pointer h-14 pt-5 pb-4 bg-transparent ring-0 ring-gray-200 bg-white',
62
62
  disabled ? ' cursor-not-allowed' : '',
63
63
  required && `after:content-['*'] after:ml-0.5 after:text-red-500`,
64
64
  ]"