change default filter density and color

This commit is contained in:
Gauthier Roebroeck 2026-03-25 14:37:52 +08:00
parent 2f7f7ea474
commit 243b72362c
6 changed files with 21 additions and 14 deletions

View file

@ -31,7 +31,6 @@
v-model="model"
v-model:mode="modelMode"
:items="shownItems"
color="primary"
:show-mode-selector="showModeSelector"
@load-more="emit('loadMore')"
></FilterList>

View file

@ -36,7 +36,7 @@ export const Default: Story = {
export const Color: Story = {
args: {
color: 'primary',
color: 'red',
modelValue: 'include',
},
}

View file

@ -1,12 +1,18 @@
<template>
<v-list-item
:title="label"
density="compact"
@click="cycle()"
><template #prepend
><v-icon
>
<template #prepend>
<v-icon
:icon="icon"
:color="!!model ? color : undefined" /></template
></v-list-item>
:color="!!model ? color : undefined"
/></template>
<template #title
><span class="text-body-medium">{{ label }}</span></template
>
</v-list-item>
</template>
<script setup lang="ts">
@ -23,7 +29,7 @@ const emit = defineEmits<{
const {
label,
triState = true,
color,
color = 'primary',
} = defineProps<{
/**
* Label shown next to the checkbox.
@ -34,7 +40,7 @@ const {
*/
triState?: boolean
/**
* Base color. Applies to the checkbox when the value is not `undefined`.
* Base color. Applies to the checkbox when the value is not `undefined`. Defaults to 'primary'.
*/
color?: string
}>()

View file

@ -2,7 +2,6 @@
<FilterList
v-model="model"
:items="items"
color="primary"
/>
</template>

View file

@ -2,7 +2,6 @@
<FilterList
v-model="model"
:items="items"
color="primary"
/>
</template>

View file

@ -1,6 +1,6 @@
<template>
<v-list-item
:title="sortOption.label"
density="compact"
@click="cycle()"
>
<template #prepend>
@ -16,6 +16,10 @@
:class="!!model && !!number ? '' : 'opacity-0'"
/>
</template>
<template #title
><span class="text-body-medium">{{ sortOption.label }}</span></template
>
</v-list-item>
</template>
@ -38,7 +42,7 @@ const emit = defineEmits<{
const {
sortOption,
number,
color,
color = 'primary',
mandatory = false,
} = defineProps<{
sortOption: SortOption
@ -47,7 +51,7 @@ const {
*/
number?: number
/**
* Base color. Applies to the icon when the value is not `undefined`.
* Base color. Applies to the icon when the value is not `undefined`. Defaults to 'primary'.
*/
color?: string
mandatory?: boolean