From b98c9965f9084b53a63d9e8849afcd369ac6924d Mon Sep 17 00:00:00 2001 From: Melloware Date: Tue, 3 Sep 2024 07:49:34 -0400 Subject: [PATCH] Fix #7102: DataView fix listTemplate typescript def (#7105) --- components/lib/datatable/DataTable.js | 5 +++-- components/lib/dataview/dataview.d.ts | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/components/lib/datatable/DataTable.js b/components/lib/datatable/DataTable.js index c6ba016526..2323dd701c 100644 --- a/components/lib/datatable/DataTable.js +++ b/components/lib/datatable/DataTable.js @@ -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); } diff --git a/components/lib/dataview/dataview.d.ts b/components/lib/dataview/dataview.d.ts index 8a32a3b2fd..57d2fa6a56 100755 --- a/components/lib/dataview/dataview.d.ts +++ b/components/lib/dataview/dataview.d.ts @@ -339,10 +339,11 @@ export interface DataViewProps extends Omit)): 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)} layout - Current layout. + * @param {*} items - Array of items to be rendered. + * @param {'list' | 'grid' | (string & Record)} [layout] - Current layout mode. + * @returns {React.ReactNode | React.ReactNode[] | undefined} The content to be rendered. */ - listTemplate?(items: any[], layout?: 'list' | 'grid' | (string & Record)): React.ReactNode[] | undefined; + listTemplate?(items: any[], layout?: 'list' | 'grid' | (string & Record)): React.ReactNode | React.ReactNode[] | undefined; /** * Used to get the child elements of the component. * @readonly