Skip to content

fix(AnalyticalTable - TypeScript): fix incorrect setFilter type #6842

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ export const CustomFilter: Story = {
}
return rows;
}, []);
const columns = useMemo(
const columns: AnalyticalTableColumnDefinition[] = useMemo(
() => [
{
Header: 'Custom Column Filter',
Expand Down
4 changes: 2 additions & 2 deletions packages/main/src/components/AnalyticalTable/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export interface ColumnType extends Omit<AnalyticalTableColumnDefinition, 'id'>
*
* __Note:__ If set to `undefined`, the filter is removed.
*/
setFilter?: (val: string | undefined) => void;
setFilter?: (val: string | string[] | undefined) => void;
sortDescFirst?: boolean;
sortedIndex?: number;
toggleHidden?: (hidden?: boolean) => void;
Expand Down Expand Up @@ -153,7 +153,7 @@ export interface TableInstance {
*
* __Note:__ If set to `undefined`, the filter is removed.
*/
setFilter?: (columnId: string, filterValue: string | undefined) => void;
setFilter?: (columnId: string, filterValue: string | string[] | undefined) => void;
setGlobalFilter?: (filterValue: string) => void;
setGroupBy?: (columnIds: string[]) => void;
setHiddenColumns?: (columnIds: string[]) => void;
Expand Down
Loading