ketekny-ui-kit 1.0.58 → 1.0.60

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,7 +1,7 @@
1
1
  {
2
2
  "name": "ketekny-ui-kit",
3
3
  "type": "module",
4
- "version": "1.0.58",
4
+ "version": "1.0.60",
5
5
  "description": "A Vue 3 UI component library with Tailwind CSS styling",
6
6
  "main": "index.js",
7
7
  "files": [
package/src/ui/kMenu.vue CHANGED
@@ -36,7 +36,7 @@
36
36
  : 'top-[-7px] border-l border-t border-primary/20',
37
37
  ]"
38
38
  :style="{ left: `${chevronOffset}px` }"></span>
39
- <slot name="items">
39
+ <slot name="items" :close-menu="closeMenu" :close="closeMenu" :select="handleLinkClick">
40
40
  <ul class="p-2">
41
41
  <li v-for="(link, index) in normalizedLinks" :key="link.key || `${link.label}-${index}`">
42
42
  <component
@@ -131,10 +131,20 @@ export default {
131
131
  event.preventDefault();
132
132
  return;
133
133
  }
134
- if (typeof link?.action === "function") link.action(link, event);
135
- if (typeof link?.onClick === "function") link.onClick(link, event);
136
- this.$emit("select", link);
137
- if (this.closeOnSelect) this.closeMenu();
134
+
135
+ const runSelectionHandlers = () => {
136
+ if (typeof link?.action === "function") link.action(link, event);
137
+ if (typeof link?.onClick === "function") link.onClick(link, event);
138
+ this.$emit("select", link);
139
+ };
140
+
141
+ if (this.closeOnSelect) {
142
+ this.closeMenu();
143
+ window.setTimeout(runSelectionHandlers, 0);
144
+ return;
145
+ }
146
+
147
+ runSelectionHandlers();
138
148
  },
139
149
  handleClickOutside(event) {
140
150
  const clickedTrigger = this.$refs.menuRef?.contains(event.target);
@@ -12,7 +12,10 @@
12
12
  :class="[defaultStyle, hasError ? errorStyle : '', disabled ? disabledStyle : '']"
13
13
  :aria-label="label || 'Select option'"
14
14
  >
15
- <SelectValue :placeholder="placeholder" class="block pr-10 truncate" />
15
+ <SelectValue
16
+ :placeholder="placeholder"
17
+ class="block pr-10 truncate text-gray-700 data-[placeholder]:text-gray-400 dark:text-slate-100 dark:data-[placeholder]:text-slate-500"
18
+ />
16
19
 
17
20
  <button
18
21
  v-if="clearable && isSelectionSet && !disabled"