File tree Expand file tree Collapse file tree 1 file changed +36
-3
lines changed Expand file tree Collapse file tree 1 file changed +36
-3
lines changed Original file line number Diff line number Diff line change @@ -2,9 +2,14 @@ import { t } from '@lingui/core/macro';
22import {
33 ActionIcon ,
44 Alert ,
5+ Divider ,
56 Group ,
7+ HoverCard ,
68 Indicator ,
9+ Paper ,
710 Space ,
11+ Stack ,
12+ Text ,
813 Tooltip
914} from '@mantine/core' ;
1015import {
@@ -28,6 +33,7 @@ import type { InvenTreeTableProps } from '@lib/types/Tables';
2833import { showNotification } from '@mantine/notifications' ;
2934import { Boundary } from '../components/Boundary' ;
3035import { PrintingActions } from '../components/buttons/PrintingActions' ;
36+ import { StylishText } from '../components/items/StylishText' ;
3137import useDataExport from '../hooks/UseDataExport' ;
3238import { useDeleteApiFormModal } from '../hooks/UseForm' ;
3339import { TableColumnSelect } from './ColumnSelect' ;
@@ -242,9 +248,36 @@ export default function InvenTreeTableHeader({
242248 aria-label = 'table-select-filters'
243249 >
244250 < Tooltip label = { t `Table Filters` } position = 'top-end' >
245- < IconFilter
246- onClick = { ( ) => setFiltersVisible ( ! filtersVisible ) }
247- />
251+ < HoverCard
252+ position = 'bottom-end'
253+ withinPortal = { true }
254+ disabled = { ! tableState . filterSet . activeFilters ?. length }
255+ >
256+ < HoverCard . Target >
257+ < IconFilter
258+ onClick = { ( ) => setFiltersVisible ( ! filtersVisible ) }
259+ />
260+ </ HoverCard . Target >
261+ < HoverCard . Dropdown >
262+ < Paper p = 'sm' withBorder >
263+ < Stack gap = 'xs' >
264+ < StylishText size = 'md' > { t `Active Filters` } </ StylishText >
265+ < Divider />
266+ { tableState . filterSet . activeFilters ?. map ( ( filter ) => (
267+ < Group
268+ key = { filter . name }
269+ justify = 'space-between'
270+ gap = 'xl'
271+ wrap = 'nowrap'
272+ >
273+ < Text size = 'sm' > { filter . label } </ Text >
274+ < Text size = 'xs' > { filter . displayValue } </ Text >
275+ </ Group >
276+ ) ) }
277+ </ Stack >
278+ </ Paper >
279+ </ HoverCard . Dropdown >
280+ </ HoverCard >
248281 </ Tooltip >
249282 </ ActionIcon >
250283 </ Indicator >
You can’t perform that action at this time.
0 commit comments