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 +1 -1
- package/src/ui/kMenu.vue +15 -5
- package/src/ui/kSelect.vue +4 -1
package/package.json
CHANGED
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
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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);
|
package/src/ui/kSelect.vue
CHANGED
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
:class="[defaultStyle, hasError ? errorStyle : '', disabled ? disabledStyle : '']"
|
|
13
13
|
:aria-label="label || 'Select option'"
|
|
14
14
|
>
|
|
15
|
-
<SelectValue
|
|
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"
|