Skip to content

Commit

Permalink
Fix primefaces#7102: DataView fix listTemplate typescript def
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Sep 3, 2024
1 parent cfe5b03 commit 998b72e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions components/lib/datatable/DataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -1503,9 +1503,9 @@ 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 998b72e

Please sign in to comment.