Skip to content

Commit

Permalink
#182 - Rename prop enableMultiSort to multiSort
Browse files Browse the repository at this point in the history
  • Loading branch information
imikulec committed Jan 30, 2024
1 parent 1645068 commit 91d9beb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions libs/data-display/src/DataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export type DataTableProps<T extends object> = {
* Enable or disable multi-column sorting.
* When set to true, users can sort by multiple columns simultaneously.
*/
enableMultiSort?: boolean;
multiSort?: boolean;
} & DataTableTokensProps;

type DataTableTokensProps = {
Expand Down Expand Up @@ -469,7 +469,7 @@ function DataTable<T extends object>({
firstColumnFixed,
lastColumnFixed,
className,
enableMultiSort = false,
multiSort = false,
...props
}: DataTableProps<T>) {
const primaryRow = findChild("DataTablePrimaryRow", children);
Expand Down Expand Up @@ -622,7 +622,7 @@ function DataTable<T extends object>({
className={tableHeaderClassName}
title={column.title}
onClick={() => {
toggleSortBy(column.id, undefined, enableMultiSort);
toggleSortBy(column.id, undefined, multiSort);
}}
>
<DataTableHeader alignHeader={alignHeader} {...column}>
Expand Down
4 changes: 2 additions & 2 deletions storybook/src/data-display/DataTable.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ To enable multi-column sorting, follow these steps:
}, [dataTableState.sortBy]);
```

**3.** Set the `enableMultiSort` prop to `true` in the DataTable component to enable multi-column sorting:
**3.** Set the `multiSort` prop to `true` in the DataTable component to enable multi-column sorting:
```tsx
<DataTable data={sortedData} hook={dataTableHook} defaultSortBy={dataTableState.sortBy} enableMultiSort>
<DataTable data={sortedData} hook={dataTableHook} defaultSortBy={dataTableState.sortBy} multiSort>
<DataTable.Column header="ID" accessor="id" canSort={false} />
<DataTable.Column header="Name" accessor="name" canSort={true} />
<DataTable.Column header="Surname" accessor="surname" canSort={true} />
Expand Down

0 comments on commit 91d9beb

Please sign in to comment.