also show filterActiveModule for HeaderFilters, change colour to red

This commit is contained in:
ma0068
2026-02-18 11:27:14 +01:00
parent f0597e99e5
commit 4b875bf019
3 changed files with 15 additions and 11 deletions
+1 -1
View File
@@ -183,7 +183,7 @@ html.fs_huge {
}
.has-filter .fa-filter {
color: var(--bs-success);
color: var(--bs-danger);
}
.override_filtercmpt_actions_style div.d-flex.align-items-baseline {
align-items: end !important;
@@ -225,7 +225,8 @@ export default {
expanded: [],
selectedColumnValues: [],
tagEndpoint: ApiTag,
currentEndpoint: null
currentEndpoint: null,
headerFilterActive: false
}
},
computed: {
@@ -543,6 +544,10 @@ export default {
},
resetFilter(){
this.$refs.listfilter.resetFilter();
this.$refs.table.clearFilters();
},
handleHeaderFilter(filterActive){
this.headerFilterActive = filterActive;
}
},
// TODO(chris): focusin, focusout, keydown and tabindex should be in the filter component
@@ -558,7 +563,6 @@ export default {
v-draggable:copyLink.capture="selectedDragObject"
@dragend="dragCleanup"
>
<core-filter-cmpt
ref="table"
:description="countsToHTML"
@@ -573,6 +577,7 @@ export default {
@click:new="actionNewPrestudent"
@table-built="translateTabulator"
:useSelectionSpan="false"
@headerFilterOn="handleHeaderFilter"
>
<template #actions>
@@ -586,14 +591,14 @@ export default {
></core-tag>
</template>
<template #actions v-if="filter.length">
<template #actions v-if="filter.length || headerFilterActive">
<div class="d-flex justify-content-center align-items-center gap-2 ps-4 position-absolute start-50 translate-middle-x">
<p class="text-success mb-0">
<p class="text-danger mb-0">
<strong>{{$p.t('filter','filterActive')}}</strong>
</p>
<button
class="btn btn-outline-success sm"
class="btn btn-outline-danger sm"
:title="$p.t('filter/filterDelete')"
@click="resetFilter"
>
@@ -605,7 +610,7 @@ export default {
<template #filter>
<div class="card">
<div class="card-body">
<list-filter ref="listfilter" @change="updateFilter" :filterActive="filter.length" />
<list-filter ref="listfilter" @change="updateFilter" :filterActive="filter.length"/>
</div>
</div>
</template>
+3 -4
View File
@@ -48,7 +48,8 @@ export const CoreFilterCmpt = {
'nwNewEntry',
'click:new',
'tableBuilt',
'uuidDefined'
'uuidDefined',
'headerFilterOn'
],
props: {
onNwNewEntry: Function, // NOTE(chris): Hack to get the nwNewEntry listener into $props
@@ -345,6 +346,7 @@ export const CoreFilterCmpt = {
this.tabulator.on("dataFiltered", filters => {
this.filterActive = filters.length > 0;
this.$emit("headerFilterOn", this.filterActive);
});
},
updateTabulator() {
@@ -377,9 +379,6 @@ export const CoreFilterCmpt = {
this.tabulator.setHeaderFilterValue(filter.field, filter.value);
});
},
/**
*
*/
getFilter() {
if (this.selectedFilter === null)
this.startFetchCmpt(