Skip to content

Commit

Permalink
Fix #7102: DataView fix listTemplate typescript def (#7105)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Sep 3, 2024
1 parent cfe5b03 commit b98c996
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions components/lib/datatable/DataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -1503,9 +1503,10 @@ export const DataTable = React.forwardRef((inProps, ref) => {
filter(props.globalFilter, 'global', props.globalFilterMatchMode);
} else {
// #3819 was filtering but now reset filter state
if (d_filtersState["global"]) {
if (d_filtersState['global']) {
let filters = { ...d_filtersState };
delete filters["global"];

delete filters['global'];
setD_filtersState(filters);
onFilterApply(filters);
}
Expand Down
7 changes: 4 additions & 3 deletions components/lib/dataview/dataview.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,11 @@ export interface DataViewProps extends Omit<React.DetailedHTMLProps<React.HTMLAt
itemTemplate?(item: any, layout?: 'list' | 'grid' | (string & Record<string, unknown>)): React.ReactNode | undefined;
/**
* Function that gets the options along with the layout mode and returns the content.
* @param {*} item - Current item.
* @param {'list' | 'grid' | (string & Record<string, unknown>)} layout - Current layout.
* @param {*} items - Array of items to be rendered.
* @param {'list' | 'grid' | (string & Record<string, unknown>)} [layout] - Current layout mode.
* @returns {React.ReactNode | React.ReactNode[] | undefined} The content to be rendered.
*/
listTemplate?(items: any[], layout?: 'list' | 'grid' | (string & Record<string, unknown>)): React.ReactNode[] | undefined;
listTemplate?(items: any[], layout?: 'list' | 'grid' | (string & Record<string, unknown>)): React.ReactNode | React.ReactNode[] | undefined;
/**
* Used to get the child elements of the component.
* @readonly
Expand Down

0 comments on commit b98c996

Please sign in to comment.