Skip to content

Commit

Permalink
feat: use chip instead of badge in SelectFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin-Guillemin committed Nov 21, 2023
1 parent a9cf6be commit 5e1f07c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
4 changes: 4 additions & 0 deletions src/main/webapp/src/assets/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
.modal-flex-item {
width: 50%;
}

.account-filter {
max-width: 30em;
}
}

.v-move,
Expand Down
14 changes: 8 additions & 6 deletions src/main/webapp/src/components/filter/SelectFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,21 @@ const modelValue = computed<Array<number | string>>({
rounded="xl"
variant="solo"
density="compact"
prepend-inner-icon="fas fa-filter"
flat
chips
multiple
hide-details
class="select-filter"
>
<template #prepend-inner>
<v-badge v-if="modelValue.length > 0" :content="modelValue.length" color="info">
<v-icon icon="fas fa-filter" />
</v-badge>
<v-icon v-else icon="fas fa-filter" />
<template #chip="{ props, item }">
<v-chip v-bind="props" rounded>
<div class="d-flex flex-row align-center">
<v-icon v-if="item.raw.color" icon="fas fa-circle" :color="item.raw.color" class="mr-2" />
<div>{{ t(item.raw.i18n) }}</div>
</div>
</v-chip>
</template>
<template #chip />
<template #item="{ props, item }">
<v-list-item v-bind="props" title="">
<div class="d-flex flex-row align-center">
Expand Down
4 changes: 3 additions & 1 deletion src/main/webapp/src/views/structure/AdministrativeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ const accountStates = ref<Array<string>>([Etat.Valide]);
<template>
<v-container fluid>
<div class="d-flex align-center justify-end mb-4 mb-sm-0">
<select-filter v-if="filterAccountStates" v-model="accountStates" :items="filterAccountStates" />
<div class="account-filter">
<select-filter v-if="filterAccountStates" v-model="accountStates" :items="filterAccountStates" />
</div>
</div>
<filieres-layout :filieres="administrative" :account-states="accountStates" />

Expand Down
4 changes: 3 additions & 1 deletion src/main/webapp/src/views/structure/TeachingView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ const accountStates = ref<Array<string>>([Etat.Valide]);
<template>
<v-container fluid>
<div class="d-flex justify-end mb-4 mb-sm-0">
<select-filter v-if="filterAccountStates" v-model="accountStates" :items="filterAccountStates" />
<div class="account-filter">
<select-filter v-if="filterAccountStates" v-model="accountStates" :items="filterAccountStates" />
</div>
</div>
<filieres-layout :filieres="teaching" :account-states="accountStates" />

Expand Down

0 comments on commit 5e1f07c

Please sign in to comment.