Skip to content

Commit 4a21ffb

Browse files
authored
fix(AnalyticalTable - TypeScript): fix incorrect setFilter type (#6842)
1 parent bf5187d commit 4a21ffb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/main/src/components/AnalyticalTable/AnalyticalTable.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ export const CustomFilter: Story = {
529529
}
530530
return rows;
531531
}, []);
532-
const columns = useMemo(
532+
const columns: AnalyticalTableColumnDefinition[] = useMemo(
533533
() => [
534534
{
535535
Header: 'Custom Column Filter',

packages/main/src/components/AnalyticalTable/types/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export interface ColumnType extends Omit<AnalyticalTableColumnDefinition, 'id'>
6969
*
7070
* __Note:__ If set to `undefined`, the filter is removed.
7171
*/
72-
setFilter?: (val: string | undefined) => void;
72+
setFilter?: (val: string | string[] | undefined) => void;
7373
sortDescFirst?: boolean;
7474
sortedIndex?: number;
7575
toggleHidden?: (hidden?: boolean) => void;
@@ -153,7 +153,7 @@ export interface TableInstance {
153153
*
154154
* __Note:__ If set to `undefined`, the filter is removed.
155155
*/
156-
setFilter?: (columnId: string, filterValue: string | undefined) => void;
156+
setFilter?: (columnId: string, filterValue: string | string[] | undefined) => void;
157157
setGlobalFilter?: (filterValue: string) => void;
158158
setGroupBy?: (columnIds: string[]) => void;
159159
setHiddenColumns?: (columnIds: string[]) => void;

0 commit comments

Comments
 (0)