-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
result filter for policy detail results
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
- Loading branch information
Frank Jogeleit
committed
Mar 12, 2024
1 parent
63f61b5
commit 8e27f99
Showing
7 changed files
with
140 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<template> | ||
<v-select | ||
multiple | ||
clearable | ||
density="compact" | ||
:items="items" | ||
variant="outlined" | ||
hide-details | ||
label="Results" | ||
closable-chips | ||
:model-value="modelValue" | ||
@update:model-value="input" | ||
v-bind="$attrs" | ||
style="min-width: 200px;" | ||
> | ||
<template v-slot:selection="{ item, index }"> | ||
<v-chip v-if="index < 2"> | ||
<span>{{ item.title }}</span> | ||
</v-chip> | ||
<span v-if="index === 2" class="text-caption align-self-center"> | ||
(+{{ modelValue.length - 2 }} others) | ||
</span> | ||
</template> | ||
</v-select> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import {Status} from "../../types"; | ||
const props = defineProps<{ source?: string; modelValue: string[] }>(); | ||
const items: Status[] = [ | ||
Status.PASS, | ||
Status.FAIL, | ||
Status.WARN, | ||
Status.SKIP, | ||
] | ||
const emit = defineEmits<{ 'update:modelValue': [status: string[]] }>() | ||
const input = (current) => emit('update:modelValue', current); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<template> | ||
<v-infinite-scroll :onLoad="load" class="no-scrollbar pb-0 mb-0" v-if="loaded.length"> | ||
<template v-for="item in loaded" :key="item"> | ||
<slot :item="item" /> | ||
</template> | ||
<template #empty></template> | ||
</v-infinite-scroll> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { useInfinite } from "~/composables/infinite"; | ||
const props = defineProps<{ list: any[]; defaultLoadings?: number }>() | ||
const list = ref<any[]>(props.list) | ||
watch(() => props.list, () => { list.value = props.list }, { immediate: true }) | ||
const { load, loaded } = useInfinite(list, props.defaultLoadings) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters