mirror of
https://github.com/inventree/InvenTree.git
synced 2025-09-13 14:11:37 +00:00
@@ -2,9 +2,14 @@ import { t } from '@lingui/core/macro';
|
|||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
Alert,
|
Alert,
|
||||||
|
Divider,
|
||||||
Group,
|
Group,
|
||||||
|
HoverCard,
|
||||||
Indicator,
|
Indicator,
|
||||||
|
Paper,
|
||||||
Space,
|
Space,
|
||||||
|
Stack,
|
||||||
|
Text,
|
||||||
Tooltip
|
Tooltip
|
||||||
} from '@mantine/core';
|
} from '@mantine/core';
|
||||||
import {
|
import {
|
||||||
@@ -28,6 +33,7 @@ import type { InvenTreeTableProps } from '@lib/types/Tables';
|
|||||||
import { showNotification } from '@mantine/notifications';
|
import { showNotification } from '@mantine/notifications';
|
||||||
import { Boundary } from '../components/Boundary';
|
import { Boundary } from '../components/Boundary';
|
||||||
import { PrintingActions } from '../components/buttons/PrintingActions';
|
import { PrintingActions } from '../components/buttons/PrintingActions';
|
||||||
|
import { StylishText } from '../components/items/StylishText';
|
||||||
import useDataExport from '../hooks/UseDataExport';
|
import useDataExport from '../hooks/UseDataExport';
|
||||||
import { useDeleteApiFormModal } from '../hooks/UseForm';
|
import { useDeleteApiFormModal } from '../hooks/UseForm';
|
||||||
import { TableColumnSelect } from './ColumnSelect';
|
import { TableColumnSelect } from './ColumnSelect';
|
||||||
@@ -242,9 +248,36 @@ export default function InvenTreeTableHeader({
|
|||||||
aria-label='table-select-filters'
|
aria-label='table-select-filters'
|
||||||
>
|
>
|
||||||
<Tooltip label={t`Table Filters`} position='top-end'>
|
<Tooltip label={t`Table Filters`} position='top-end'>
|
||||||
<IconFilter
|
<HoverCard
|
||||||
onClick={() => setFiltersVisible(!filtersVisible)}
|
position='bottom-end'
|
||||||
/>
|
withinPortal={true}
|
||||||
|
disabled={!tableState.filterSet.activeFilters?.length}
|
||||||
|
>
|
||||||
|
<HoverCard.Target>
|
||||||
|
<IconFilter
|
||||||
|
onClick={() => setFiltersVisible(!filtersVisible)}
|
||||||
|
/>
|
||||||
|
</HoverCard.Target>
|
||||||
|
<HoverCard.Dropdown>
|
||||||
|
<Paper p='sm' withBorder>
|
||||||
|
<Stack gap='xs'>
|
||||||
|
<StylishText size='md'>{t`Active Filters`}</StylishText>
|
||||||
|
<Divider />
|
||||||
|
{tableState.filterSet.activeFilters?.map((filter) => (
|
||||||
|
<Group
|
||||||
|
key={filter.name}
|
||||||
|
justify='space-between'
|
||||||
|
gap='xl'
|
||||||
|
wrap='nowrap'
|
||||||
|
>
|
||||||
|
<Text size='sm'>{filter.label}</Text>
|
||||||
|
<Text size='xs'>{filter.displayValue}</Text>
|
||||||
|
</Group>
|
||||||
|
))}
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
|
</HoverCard.Dropdown>
|
||||||
|
</HoverCard>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
</Indicator>
|
</Indicator>
|
||||||
|
Reference in New Issue
Block a user