chore: more cleanups
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
<script setup>
|
||||
defineProps({
|
||||
message: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<div
|
||||
class="flex items-center justify-center h-10 text-sm text-slate-500 dark:text-slate-300"
|
||||
>
|
||||
{{ message }}
|
||||
</div>
|
||||
</template>
|
||||
@@ -31,6 +31,5 @@ defineProps({
|
||||
class="flex-shrink-0 text-slate-900 dark:text-slate-50"
|
||||
/>
|
||||
</div>
|
||||
<slot name="dropdown" />
|
||||
</button>
|
||||
</template>
|
||||
|
||||
+17
-23
@@ -3,7 +3,6 @@ import { ref, computed } from 'vue';
|
||||
import { picoSearch } from '@scmmishra/pico-search';
|
||||
import SearchIssueItem from './SearchIssueItem.vue';
|
||||
import SearchBar from './SearchBar.vue';
|
||||
import SearchEmptyState from './SearchEmptyState.vue';
|
||||
|
||||
const props = defineProps({
|
||||
items: {
|
||||
@@ -29,11 +28,11 @@ const filteredItems = computed(() => {
|
||||
return picoSearch(props.items, searchTerm.value, ['name']);
|
||||
});
|
||||
|
||||
const isDropdownListEmpty = computed(() => {
|
||||
const isListEmpty = computed(() => {
|
||||
return !filteredItems.value.length;
|
||||
});
|
||||
|
||||
const isFilterActive = id => {
|
||||
const isActive = id => {
|
||||
if (!props.selectedId) return false;
|
||||
return id === props.selectedId;
|
||||
};
|
||||
@@ -43,25 +42,20 @@ const isFilterActive = id => {
|
||||
class="absolute z-20 w-full bg-white border shadow dark:bg-slate-800 rounded-xl border-slate-50 dark:border-slate-700/50 max-h-[400px]"
|
||||
@click.stop
|
||||
>
|
||||
<slot name="search">
|
||||
<search-bar
|
||||
:input-value="searchTerm"
|
||||
@input="onSearch"
|
||||
@click="$emit('removeFilter')"
|
||||
/>
|
||||
</slot>
|
||||
<slot name="listItem">
|
||||
<search-empty-state
|
||||
v-if="isDropdownListEmpty"
|
||||
:message="$t('REPORT.FILTER_ACTIONS.EMPTY_LIST')"
|
||||
/>
|
||||
<search-issue-item
|
||||
v-for="item in filteredItems"
|
||||
:key="item.id"
|
||||
:is-active="isFilterActive(item.id)"
|
||||
:button-text="item.name"
|
||||
@click="$emit('click', item)"
|
||||
/>
|
||||
</slot>
|
||||
<search-bar :input-value="searchTerm" @input="onSearch" />
|
||||
|
||||
<div
|
||||
v-if="isListEmpty"
|
||||
class="flex items-center justify-center h-10 text-sm text-slate-500 dark:text-slate-300"
|
||||
>
|
||||
{{ $t('INTEGRATION_SETTINGS.LINEAR.LINK.EMPTY_LIST') }}
|
||||
</div>
|
||||
<search-issue-item
|
||||
v-for="item in filteredItems"
|
||||
:key="item.id"
|
||||
:is-active="isActive(item.id)"
|
||||
:button-text="item.name"
|
||||
@click="$emit('click', item)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user