mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Table Panel: Update column filters to use Stack component (#83800)
* Update filter list to use stack * Remove dead comments
This commit is contained in:
@@ -4,7 +4,7 @@ import { FixedSizeList as List } from 'react-window';
|
|||||||
|
|
||||||
import { GrafanaTheme2, formattedValueToString, getValueFormat, SelectableValue } from '@grafana/data';
|
import { GrafanaTheme2, formattedValueToString, getValueFormat, SelectableValue } from '@grafana/data';
|
||||||
|
|
||||||
import { ButtonSelect, Checkbox, FilterInput, HorizontalGroup, Label, VerticalGroup } from '..';
|
import { ButtonSelect, Checkbox, FilterInput, Label, Stack } from '..';
|
||||||
import { useStyles2, useTheme2 } from '../../themes';
|
import { useStyles2, useTheme2 } from '../../themes';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -169,11 +169,11 @@ export const FilterList = ({
|
|||||||
}, [onChange, values, items, selectedItems]);
|
}, [onChange, values, items, selectedItems]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<VerticalGroup spacing="md">
|
<Stack direction="column" gap={0.25}>
|
||||||
{!showOperators && <FilterInput placeholder="Filter values" onChange={setSearchFilter} value={searchFilter} />}
|
{!showOperators && <FilterInput placeholder="Filter values" onChange={setSearchFilter} value={searchFilter} />}
|
||||||
{showOperators && (
|
{showOperators && (
|
||||||
<HorizontalGroup>
|
<Stack direction="row" gap={0}>
|
||||||
<ButtonSelect<string>
|
<ButtonSelect
|
||||||
variant="canvas"
|
variant="canvas"
|
||||||
options={OPERATORS}
|
options={OPERATORS}
|
||||||
onChange={setOperator}
|
onChange={setOperator}
|
||||||
@@ -181,7 +181,7 @@ export const FilterList = ({
|
|||||||
tooltip={operator.description}
|
tooltip={operator.description}
|
||||||
/>
|
/>
|
||||||
<FilterInput placeholder="Filter values" onChange={setSearchFilter} value={searchFilter} />
|
<FilterInput placeholder="Filter values" onChange={setSearchFilter} value={searchFilter} />
|
||||||
</HorizontalGroup>
|
</Stack>
|
||||||
)}
|
)}
|
||||||
{!items.length && <Label>No values</Label>}
|
{!items.length && <Label>No values</Label>}
|
||||||
{items.length && (
|
{items.length && (
|
||||||
@@ -206,7 +206,7 @@ export const FilterList = ({
|
|||||||
</List>
|
</List>
|
||||||
)}
|
)}
|
||||||
{items.length && (
|
{items.length && (
|
||||||
<VerticalGroup spacing="xs">
|
<Stack direction="column" gap={0.25}>
|
||||||
<div className={cx(styles.selectDivider)} />
|
<div className={cx(styles.selectDivider)} />
|
||||||
<div className={cx(styles.filterListRow)}>
|
<div className={cx(styles.filterListRow)}>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
@@ -217,9 +217,9 @@ export const FilterList = ({
|
|||||||
onChange={onSelectChanged}
|
onChange={onSelectChanged}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</VerticalGroup>
|
</Stack>
|
||||||
)}
|
)}
|
||||||
</VerticalGroup>
|
</Stack>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user