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 authored and jtomic-croz committed Jan 30, 2024
1 parent e9e77f7 commit 596e9f3
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 @@ -211,9 +211,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 596e9f3

Please sign in to comment.