@globalbrain/sefirot 2.31.1 → 2.32.0
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.
|
@@ -36,6 +36,7 @@ const props = defineProps<{
|
|
|
36
36
|
|
|
37
37
|
const emit = defineEmits<{
|
|
38
38
|
(e: 'click'): void
|
|
39
|
+
(e: 'disabled-click'): void
|
|
39
40
|
}>()
|
|
40
41
|
|
|
41
42
|
const classes = computed(() => [
|
|
@@ -57,7 +58,9 @@ const computedTag = computed(() => {
|
|
|
57
58
|
})
|
|
58
59
|
|
|
59
60
|
function handleClick(): void {
|
|
60
|
-
|
|
61
|
+
if (!props.loading) {
|
|
62
|
+
props.disabled ? emit('disabled-click') : emit('click')
|
|
63
|
+
}
|
|
61
64
|
}
|
|
62
65
|
</script>
|
|
63
66
|
|
|
@@ -18,13 +18,17 @@ const props = defineProps<{
|
|
|
18
18
|
const input = ref<HTMLElement | null>(null)
|
|
19
19
|
const query = ref('')
|
|
20
20
|
|
|
21
|
+
const enabledOptions = computed(() => {
|
|
22
|
+
return unref(props.options).filter((o) => !o.disabled)
|
|
23
|
+
})
|
|
24
|
+
|
|
21
25
|
const fuse = computed(() => {
|
|
22
|
-
return new Fuse(unref(
|
|
26
|
+
return new Fuse(unref(enabledOptions), { keys: ['label'] })
|
|
23
27
|
})
|
|
24
28
|
|
|
25
29
|
const filteredOptions = computed(() => {
|
|
26
30
|
return (!props.search || !query.value)
|
|
27
|
-
? unref(
|
|
31
|
+
? unref(enabledOptions)
|
|
28
32
|
: fuse.value.search(query.value).map((r) => r.item)
|
|
29
33
|
})
|
|
30
34
|
|