Shivam Mishra
2024-10-02 13:06:30 +05:30
committed by GitHub
parent e0bf2bd9d4
commit 42f6621afb
661 changed files with 15939 additions and 31194 deletions

View File

@@ -18,7 +18,6 @@ defineProps({
<template>
<button
class="inline-flex relative items-center p-1.5 w-fit h-8 gap-1.5 rounded-lg hover:bg-slate-50 dark:hover:bg-slate-800 active:bg-slate-75 dark:active:bg-slate-800"
@click="$emit('click')"
>
<slot name="leftIcon">
<fluent-icon

View File

@@ -38,15 +38,19 @@ const props = defineProps({
},
});
const emit = defineEmits(['onSearch']);
const emit = defineEmits(['onSearch', 'select']);
const searchTerm = ref('');
const onSearch = debounce(value => {
searchTerm.value = value;
const debouncedEmit = debounce(value => {
emit('onSearch', value);
}, 300);
const onSearch = value => {
searchTerm.value = value;
debouncedEmit();
};
const filteredListItems = computed(() => {
if (!searchTerm.value) return props.listItems;
return picoSearch(props.listItems, searchTerm.value, ['name']);
@@ -84,7 +88,7 @@ const shouldShowEmptyState = computed(() => {
:input-placeholder="inputPlaceholder"
:show-clear-filter="showClearFilter"
@input="onSearch"
@click="$emit('removeFilter')"
@remove="$emit('removeFilter')"
/>
</slot>
<slot name="listItem">
@@ -103,7 +107,7 @@ const shouldShowEmptyState = computed(() => {
:button-text="item.name"
:icon="item.icon"
:icon-color="item.iconColor"
@click="$emit('click', item)"
@click.stop.prevent="emit('select', item)"
/>
</slot>
</div>

View File

@@ -22,10 +22,6 @@ defineProps({
<template>
<button
class="relative inline-flex items-center justify-start w-full p-3 border-0 rounded-none first:rounded-t-xl last:rounded-b-xl h-11 hover:bg-slate-50 dark:hover:bg-slate-700 active:bg-slate-75 dark:active:bg-slate-800"
@click.stop.prevent="$emit('click')"
@mouseenter="$emit('mouseenter')"
@mouseleave="$emit('mouseleave')"
@focus="$emit('focus')"
>
<div class="inline-flex items-center gap-3 overflow-hidden">
<fluent-icon

View File

@@ -1,4 +1,5 @@
<script setup>
import { defineEmits } from 'vue';
defineProps({
inputValue: {
type: String,
@@ -13,6 +14,8 @@ defineProps({
default: false,
},
});
const emit = defineEmits(['input', 'remove']);
</script>
<template>
@@ -30,7 +33,7 @@ defineProps({
class="w-full mb-0 text-sm bg-white dark:bg-slate-800 text-slate-800 dark:text-slate-75 reset-base"
:placeholder="inputPlaceholder"
:value="inputValue"
@input="$emit('input', $event.target.value)"
@input="emit('input', $event.target.value)"
/>
</div>
<!-- Clear filter button -->
@@ -40,7 +43,7 @@ defineProps({
variant="clear"
color-scheme="primary"
class="!px-1 !py-1.5"
@click="$emit('click')"
@click="emit('remove')"
>
{{ $t('REPORT.FILTER_ACTIONS.CLEAR_FILTER') }}
</woot-button>