Releases: neolution-ch/react-data-table
Release 5.0.2-beta.1
Fixed
- endless loop on
paginationstate when paginating client-side
Added
- auto
pageIndex resetwhen paginating server side
Release 5.0.2-beta.0
Fixed
- endless loop on
paginationstate when paginating client-side
Release 5.0.1
Fixed
sortingandcolumnFilterscan be possibly undefined for notuseReactDataTablehook
Release 5.0.0
Changed
- the
reset iconwill now reset the table to the initialState if provided, otherwise to the first value of the state - π₯ the
sortingaccepts now a strongly typed object instead of a list - π₯ the
columnFilterscan be used only defining afilter typeto datatable hooks
Removed
- π₯ utilities
getColumnFilterFromModelandgetModelFromColumnFilterare not exposed anymore
Release 4.2.0
Added
- option
dragAndDropOptionsto enable drag-and-drop rows via@dnd-kitpackage.
Added
- option
cellClassNameadded to the column meta to add class names to every cell of a column - option
headerClassNameadded to the column meta to add class names to every header of a column - option
footerStyleadded to the column meta to add styles to every footer of a column - option
footerClassNameadded to the column meta to add class names to every footer of a column
Release 4.1.0
Added
- option
hidePageSizeChangeadded to hide the possibility to change the page size
Release 4.0.0
Added
- Skeletons for when the data is loading
Changed
-
π₯ Fundamentally changed how this package works. The state is now managed by the consumer of this package. This means that the consumer has to provide the data and the functions to update the data. The package only provides the UI components to display the data. This change was necessary to make the package more flexible and to allow the consumer to use the package in a wider range of use cases. Behind the scenes, the package uses the
useTablehook from the@tanstack/react-tablepackage. The consumer can use theuseTablehook directly if he wants to. TheReactDataTablecomponent is just a wrapper around theuseTablehook. TheReactDataTablecomponent is still the recommended way to use this package. -
π₯ renamed
possiblePageItemCountstopageSizes. -
π₯
columnsis now of typeColumnDef<TData, TValue>from the@tanstack/react-tablepackage. Please refer to the documentation of the@tanstack/react-tablepackage for more information: https://tanstack.com/table/v8/docs/api/core/table#columns (there are additional custom fields in the column.meta object defined by us:src/react-table.d.ts)
Removed
- π₯ removed
rowHighlight. UserowStyleinstead. - π₯ removed
enablePredefinedSortprop. UseinitialState.sortinginstead. Orstate.sortingif you want to manage the state yourself. - π₯ removed
predefinedFilterprop. UseinitialState. - π₯ removed
ascprop. UseinitialState.sortinginstead. Orstate.sortingif you want to manage the state yourself. - π₯ removed
predefinedItemsPerPageprop. UseinitialState.pagination.pageSizeinstead. Orstate.pagination.pageSizeif you want to manage the state yourself. - π₯ removed
orderByprop. UseinitialState.sortinginstead. Orstate.sortingif you want to manage the state yourself. - π₯ removed
clientprop. Usedataprop instead and manage the state of the data yourself. - π₯ removed
queryprop. Usedataprop instead and manage the state of the data yourself. - π₯ removed
handlersprop. Since the state is now managed by the user, the user is responsible for updating the data. - π₯ removed
actionsprops. You can easily define whatever actions you would like to have in thecolumnsprop.
This is an example of how you could configure the actions column:
import { createColumnHelper } from "@tanstack/react-table";
const columnHelper = createColumnHelper<YourData>();
columnHelper.display({
id: "edit",
header: () => <span>Aktionen</span>,
cell: (props) => (
<>
<Link href={{ pathname: "/addresses/[addressId]", query: { addressId: props.row.getValue("addressId") } }}>
<FontAwesomeIcon icon={faEye} style={{ marginRight: "5px" }} />
</Link>
<FontAwesomeIcon
icon={faTrash}
style={{ marginRight: "5px" }}
onClick={async () => {
// do something
}}
/>
</>
),
}),Release 4.0.0-beta.4
Added
- Skeletons for when the data is loading
Changed
-
π₯ Fundamentally changed how this package works. The state is now managed by the consumer of this package. This means that the consumer has to provide the data and the functions to update the data. The package only provides the UI components to display the data. This change was necessary to make the package more flexible and to allow the consumer to use the package in a wider range of use cases. Behind the scenes, the package uses the
useTablehook from the@tanstack/react-tablepackage. The consumer can use theuseTablehook directly if he wants to. TheReactDataTablecomponent is just a wrapper around theuseTablehook. TheReactDataTablecomponent is still the recommended way to use this package. -
π₯ renamed
possiblePageItemCountstopageSizes. -
π₯
columnsis now of typeColumnDef<TData, TValue>from the@tanstack/react-tablepackage. Please refer to the documentation of the@tanstack/react-tablepackage for more information: https://tanstack.com/table/v8/docs/api/core/table#columns
Removed
- π₯ removed
rowHighlight. UserowStyleinstead. - π₯ removed
enablePredefinedSortprop. UseinitialState.sortinginstead. Orstate.sortingif you want to manage the state yourself. - π₯ removed
predefinedFilterprop. Use `initialState. - π₯ removed
ascprop. UseinitialState.sortinginstead. Orstate.sortingif you want to manage the state yourself.
columnFiltersinstead. Orstate.columnFilters` if you want to manage the state yourself. - π₯ removed
predefinedItemsPerPageprop. UseinitialState.pagination.pageSizeinstead. Orstate.pagination.pageSizeif you want to manage the state yourself. - π₯ removed
orderByprop. UseinitialState.sortinginstead. Orstate.sortingif you want to manage the state yourself. - π₯ removed
clientprop. Usedataprop instead and manage the state of the data yourself. - π₯ removed
queryprop. Usedataprop instead and manage the state of the data yourself. - π₯ removed
handlersprop. Since the state is now managed by the user, the user is responsible for updating the data. - π₯ removed
actionsprops. You can easily define whatever actions you would like to have in thecolumnsprop.
This is an example of how you could configure the actions column:
import { createColumnHelper } from "@tanstack/react-table";
const columnHelper = createColumnHelper<YourData>();
columnHelper.display({
id: "edit",
header: () => <span>Aktionen</span>,
cell: (props) => (
<>
<Link href={{ pathname: "/addresses/[addressId]", query: { addressId: props.row.getValue("addressId") } }}>
<FontAwesomeIcon icon={faEye} style={{ marginRight: "5px" }} />
</Link>
<FontAwesomeIcon
icon={faTrash}
style={{ marginRight: "5px" }}
onClick={async () => {
// do something
}}
/>
</>
),
}),Release 4.0.0-beta.3
Added
- Skeletons for when the data is loading
Changed
-
π₯ Fundamentally changed how this package works. The state is now managed by the consumer of this package. This means that the consumer has to provide the data and the functions to update the data. The package only provides the UI components to display the data. This change was necessary to make the package more flexible and to allow the consumer to use the package in a wider range of use cases. Behind the scenes, the package uses the
useTablehook from the@tanstack/react-tablepackage. The consumer can use theuseTablehook directly if he wants to. TheReactDataTablecomponent is just a wrapper around theuseTablehook. TheReactDataTablecomponent is still the recommended way to use this package. -
π₯ renamed
possiblePageItemCountstopageSizes. -
π₯
columnsis now of typeColumnDef<TData, TValue>from the@tanstack/react-tablepackage. Please refer to the documentation of the@tanstack/react-tablepackage for more information: https://tanstack.com/table/v8/docs/api/core/table#columns
Removed
- π₯ removed
rowHighlight. UserowStyleinstead. - π₯ removed
enablePredefinedSortprop. UseinitialState.sortinginstead. Orstate.sortingif you want to manage the state yourself. - π₯ removed
predefinedFilterprop. Use `initialState. - π₯ removed
ascprop. UseinitialState.sortinginstead. Orstate.sortingif you want to manage the state yourself.
columnFiltersinstead. Orstate.columnFilters` if you want to manage the state yourself. - π₯ removed
predefinedItemsPerPageprop. UseinitialState.pagination.pageSizeinstead. Orstate.pagination.pageSizeif you want to manage the state yourself. - π₯ removed
orderByprop. UseinitialState.sortinginstead. Orstate.sortingif you want to manage the state yourself. - π₯ removed
clientprop. Usedataprop instead and manage the state of the data yourself. - π₯ removed
queryprop. Usedataprop instead and manage the state of the data yourself. - π₯ removed
handlersprop. Since the state is now managed by the user, the user is responsible for updating the data. - π₯ removed
actionsprops. You can easily define whatever actions you would like to have in thecolumnsprop.
This is an example of how you could configure the actions column:
import { createColumnHelper } from "@tanstack/react-table";
const columnHelper = createColumnHelper<YourData>();
columnHelper.display({
id: "edit",
header: () => <span>Aktionen</span>,
cell: (props) => (
<>
<Link href={{ pathname: "/addresses/[addressId]", query: { addressId: props.row.getValue("addressId") } }}>
<FontAwesomeIcon icon={faEye} style={{ marginRight: "5px" }} />
</Link>
<FontAwesomeIcon
icon={faTrash}
style={{ marginRight: "5px" }}
onClick={async () => {
// do something
}}
/>
</>
),
}),Release 4.0.0-beta.2
Added
- Skeletons for when the data is loading
Changed
-
π₯ Fundamentally changed how this package works. The state is now managed by the consumer of this package. This means that the consumer has to provide the data and the functions to update the data. The package only provides the UI components to display the data. This change was necessary to make the package more flexible and to allow the consumer to use the package in a wider range of use cases. Behind the scenes, the package uses the
useTablehook from the@tanstack/react-tablepackage. The consumer can use theuseTablehook directly if he wants to. TheReactDataTablecomponent is just a wrapper around theuseTablehook. TheReactDataTablecomponent is still the recommended way to use this package. -
π₯ renamed
possiblePageItemCountstopageSizes. -
π₯
columnsis now of typeColumnDef<TData, TValue>from the@tanstack/react-tablepackage. Please refer to the documentation of the@tanstack/react-tablepackage for more information: https://tanstack.com/table/v8/docs/api/core/table#columns
Removed
- π₯ removed
rowHighlight. UserowStyleinstead. - π₯ removed
enablePredefinedSortprop. UseinitialState.sortinginstead. Orstate.sortingif you want to manage the state yourself. - π₯ removed
predefinedFilterprop. Use `initialState. - π₯ removed
ascprop. UseinitialState.sortinginstead. Orstate.sortingif you want to manage the state yourself.
columnFiltersinstead. Orstate.columnFilters` if you want to manage the state yourself. - π₯ removed
predefinedItemsPerPageprop. UseinitialState.pagination.pageSizeinstead. Orstate.pagination.pageSizeif you want to manage the state yourself. - π₯ removed
orderByprop. UseinitialState.sortinginstead. Orstate.sortingif you want to manage the state yourself. - π₯ removed
clientprop. Usedataprop instead and manage the state of the data yourself. - π₯ removed
queryprop. Usedataprop instead and manage the state of the data yourself. - π₯ removed
handlersprop. Since the state is now managed by the user, the user is responsible for updating the data. - π₯ removed
actionsprops. You can easily define whatever actions you would like to have in thecolumnsprop.
This is an example of how you could configure the actions column:
import { createColumnHelper } from "@tanstack/react-table";
const columnHelper = createColumnHelper<YourData>();
columnHelper.display({
id: "edit",
header: () => <span>Aktionen</span>,
cell: (props) => (
<>
<Link href={{ pathname: "/addresses/[addressId]", query: { addressId: props.row.getValue("addressId") } }}>
<FontAwesomeIcon icon={faEye} style={{ marginRight: "5px" }} />
</Link>
<FontAwesomeIcon
icon={faTrash}
style={{ marginRight: "5px" }}
onClick={async () => {
// do something
}}
/>
</>
),
}),