mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
Poprawki filtrów
This commit is contained in:
@@ -22,15 +22,21 @@
|
|||||||
<h1 v-if="trainFilterList.length != 0">{{ $t('options.filter-title') }}</h1>
|
<h1 v-if="trainFilterList.length != 0">{{ $t('options.filter-title') }}</h1>
|
||||||
|
|
||||||
<div class="options_filters">
|
<div class="options_filters">
|
||||||
<button
|
<div class="filter-option" v-for="filter in trainFilterList">
|
||||||
v-for="filter in trainFilterList"
|
<button class="btn--option" :data-disabled="!filter.isActive" @click="onFilterChange(filter)">
|
||||||
class="filter-option btn--option"
|
{{ $t(`options.filter-${filter.id}`) }}
|
||||||
:class="{ checked: filter.isActive }"
|
</button>
|
||||||
:id="filter.id"
|
</div>
|
||||||
@click="onFilterChange(filter)"
|
</div>
|
||||||
>
|
|
||||||
{{ $t(`options.filter-${filter.id}`) }}
|
<div class="options_filters">
|
||||||
</button>
|
<div class="filter-option">
|
||||||
|
<button @click="clearAllFilters">WYŁĄCZ WSZYSTKIE FILTRY</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="filter-option">
|
||||||
|
<button @click="resetAllFilters">ZRESETUJ FILTRY</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h1>{{ $t('options.search-title') }}</h1>
|
<h1>{{ $t('options.search-title') }}</h1>
|
||||||
@@ -66,7 +72,6 @@ import SelectBox from '../Global/SelectBox.vue';
|
|||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: { SelectBox, ActionButton },
|
components: { SelectBox, ActionButton },
|
||||||
emits: ['onSearchConfirm'],
|
|
||||||
mixins: [imageMixin],
|
mixins: [imageMixin],
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
@@ -105,13 +110,24 @@ export default defineComponent({
|
|||||||
onSorterChange(item: { id: string | number; value: string }) {
|
onSorterChange(item: { id: string | number; value: string }) {
|
||||||
this.sorterActive.id = item.id;
|
this.sorterActive.id = item.id;
|
||||||
this.sorterActive.dir = -1;
|
this.sorterActive.dir = -1;
|
||||||
this.$emit('onSearchConfirm');
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onFilterChange(filter: TrainFilter) {
|
onFilterChange(filter: TrainFilter) {
|
||||||
filter.isActive = !filter.isActive;
|
filter.isActive = !filter.isActive;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
clearAllFilters() {
|
||||||
|
this.trainFilterList.forEach((filter) => {
|
||||||
|
filter.isActive = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
resetAllFilters() {
|
||||||
|
this.trainFilterList.forEach((filter) => {
|
||||||
|
filter.isActive = true;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
onInputClear(id: 'driver' | 'train') {
|
onInputClear(id: 'driver' | 'train') {
|
||||||
if (id == 'driver') this.searchedDriver = '';
|
if (id == 'driver') this.searchedDriver = '';
|
||||||
if (id == 'train') this.searchedTrain = '';
|
if (id == 'train') this.searchedTrain = '';
|
||||||
@@ -226,16 +242,13 @@ h1 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.filter-option {
|
.filter-option {
|
||||||
&#abandoned {
|
button {
|
||||||
color: salmon;
|
color: white;
|
||||||
}
|
font-weight: bold;
|
||||||
|
|
||||||
&#fulfilled {
|
&[data-disabled='true'] {
|
||||||
color: lightgreen;
|
color: #888;
|
||||||
}
|
}
|
||||||
|
|
||||||
&#active {
|
|
||||||
color: lightblue;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -230,10 +230,6 @@ button {
|
|||||||
border-radius: 0.25em;
|
border-radius: 0.25em;
|
||||||
padding: 0.25em 0.5em;
|
padding: 0.25em 0.5em;
|
||||||
|
|
||||||
&:hover:not(:disabled) {
|
|
||||||
background-color: #3c3c3c;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.checked {
|
&.checked {
|
||||||
color: var(--clr-primary);
|
color: var(--clr-primary);
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|||||||
Reference in New Issue
Block a user