feat: ingested width logic, useAbsoluteLayout useBlockLayout

Width options (`width`, `minWidth`, `maxWidth`) options are now a part of the core column object.
useBlockLayout and useAbsoluteLayout hooks now use this new internalized information to implement
their layouts. Those examples have been updated. A virtualized-rows example has also been added to
show off how the useBlockLayout hook can be used to virtualize rows with react-window.
This commit is contained in:
tannerlinsley
2019-10-01 14:03:11 -06:00
parent f70d38e061
commit 247687ee08
77 changed files with 22255 additions and 362 deletions
+8 -2
View File
@@ -35,7 +35,13 @@ const Styles = styled.div`
function Table({ columns, data }) {
// Use the state and functions returned from useTable to build your UI
const { getTableProps, headerGroups, rows, prepareRow } = useTable({
const {
getTableProps,
getTableBodyProps,
headerGroups,
rows,
prepareRow,
} = useTable({
columns,
data,
})
@@ -52,7 +58,7 @@ function Table({ columns, data }) {
</tr>
))}
</thead>
<tbody>
<tbody {...getTableBodyProps()}>
{rows.map(
(row, i) =>
prepareRow(row) || (