Skip to content

Commit e350381

Browse files
committed
feat: enhance documentation with checkbox filter
1 parent 2b2f1a3 commit e350381

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

packages/module/patternfly-docs/content/extensions/data-view/examples/Functionality/Functionality.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ source: react
1111
# If you use typescript, the name of the interface to display props for
1212
# These are found through the sourceProps function provided in patternfly-docs.source.js
1313
sortValue: 3
14-
propComponents: ['DataViewFilters', 'DataViewTextFilter']
14+
propComponents: ['DataViewFilters', 'DataViewTextFilter', 'DataViewCheckboxFilter']
1515
sourceLink: https://github.com/patternfly/react-data-view/blob/main/packages/module/patternfly-docs/content/extensions/data-view/examples/Functionality/Functionality.md
1616
---
1717
import { useMemo } from 'react';
@@ -23,6 +23,7 @@ import { DataViewToolbar } from '@patternfly/react-data-view/dist/dynamic/DataVi
2323
import { DataViewTable } from '@patternfly/react-data-view/dist/dynamic/DataViewTable';
2424
import { DataViewFilters } from '@patternfly/react-data-view/dist/dynamic/DataViewFilters';
2525
import { DataViewTextFilter } from '@patternfly/react-data-view/dist/dynamic/DataViewTextFilter';
26+
import { DataViewCheckboxFilter } from '@patternfly/react-data-view/dist/dynamic/DataViewCheckboxFilter';
2627

2728
This is a list of functionality you can use to manage data displayed in the **data view**.
2829

@@ -92,7 +93,7 @@ The `useDataViewSelection` hook manages the selection state of the data view.
9293
Enables filtering of data records in the data view and displays the applied filter chips.
9394

9495
### Toolbar usage
95-
The data view toolbar can include a set of filters by passing a React node to the `filters` property. You can use predefined components `DataViewFilters` and `DataViewTextFilter` to customize and handle filtering directly in the toolbar. The `DataViewFilters` is a wrapper allowing conditional filtering using multiple attributes. If you need just a single filter, you can use `DataViewTextFilter` or a different filter component alone. Props of these filter components are listed at the bottom of this page.
96+
The data view toolbar can include a set of filters by passing a React node to the `filters` property. You can use predefined components `DataViewFilters`, `DataViewTextFilter` and `DataViewCheckboxFilter` to customize and handle filtering directly in the toolbar. The `DataViewFilters` is a wrapper allowing conditional filtering using multiple attributes. If you need just a single filter, you can use `DataViewTextFilter`, `DataViewCheckboxFilter` or a different filter component alone. Props of these filter components are listed at the bottom of this page.
9697

9798
You can decide between passing `value` and `onChange` event to every filter separately or pass `values` and `onChange` to the `DataViewFilters` wrapper which make them available to its children. Props directly passed to child filters have a higher priority than the "inherited" ones.
9899

@@ -101,7 +102,7 @@ You can decide between passing `value` and `onChange` event to every filter sepa
101102
The `useDataViewFilters` hook manages the filter state of the data view. It allows you to define default filter values, synchronize filter state with URL parameters, and handle filter changes efficiently.
102103

103104
**Initial values:**
104-
- `initialFilters` object with default filter values
105+
- `initialFilters` object with default filter values (if the filter param allows multiple values, pass an array)
105106
- optional `searchParams` object for managing URL-based filter state
106107
- optional `setSearchParams` function to update the URL when filters are modified
107108

packages/module/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,8 @@ export * from './DataViewTable';
2525
export { default as DataViewEventsContext } from './DataViewEventsContext';
2626
export * from './DataViewEventsContext';
2727

28+
export { default as DataViewCheckboxFilter } from './DataViewCheckboxFilter';
29+
export * from './DataViewCheckboxFilter';
30+
2831
export { default as DataView } from './DataView';
2932
export * from './DataView';

0 commit comments

Comments
 (0)