useTableState was an early and hasty abstraction that hasn't proved useful in many ways. Anything
you could do with useTableState, you could easily do using the same options (assuming they exist) in
the useTable hook. For this reason, state is now a first class citizen of the useTable hook, along
with more sane properties and option locations for anything pertaining to state.
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.
* useAbsoluteLayout: To build tables with divs
* Adding `placeholderOf` attribute to column
* Adding `useAbsoluteLayout` in index.js
* Adding `useAbsoluteLayout` example
* Adding `useAbsoluteLayout` in api docs
* Adding test for `useAbsoluteLayout` hook
* TypeScript updates
I've found that trying to get solid TypeScript typings for this library
are a bit of a challenge. The composable nature of the library means
that the types for the builtin functions are by their nature somewhat
minimal, and that the user needs to be able to extend those interfaces
to reflect the specific plugins that are in use.
With that in mind I propose something like this.
To get the best out of them, you then need to extend those interfaces
using declaration merging, see
https://www.typescriptlang.org/docs/handbook/declaration-merging.html
e.g.
```ts
declare module 'react-table-hooks' {
export interface TableInstance<D = any>
extends UseFiltersValues<D>,
UsePaginationValues<D>,
UseExpandedValues,
UseGroupByValues {}
export interface TableState<D = any>
extends UsePaginationState,
UseGroupByState,
UseSortbyState<D>,
UseFiltersState<D> {}
}
```
This also puts the ability to extend those types with any user defined
hooks completely in the users hands.
This gives the greatest flexibility, but I'll admit that it isn't
particularly obvious. Perhaps a typescript readme and example is needed.
* fix useExpanded type
* fix module name
* fix typo
* address review feedback
* add IdType, update Filters definition
useExpanded now uses a flat array of row path keys for tracking expanded state instead of nested
objects. This is both easier to use as a developer, but also enables expanding all rows or even
leaving nested rows in an expanded state, despite their parent rows' expanded state.
BREAKING CHANGE: See description
* Sub rows are selected if the parent row is selected.
* Parent rows are updated accordingly if a subRow is selected.
* Updated useRowSelect snapshot tests to test subRow selection.
* fix(use-sort-by): sorting now ignores column ids that no longer exist
* fix(use-filters): filtering no longer fails when column doesn't exist
* fix(use-sortby): filtering out invalid sortBys before sorting
The renderer function for headers, columns, cells, aggregates, filters, etc used to mix properties
from all of those contexts, including rows. Now thow contexts are located on their own reserved
properties, eg. `Cell: ({ cell: { value}, row, column, ...instance }) => value`
BREAKING CHANGE: The renderer function for headers, columns, cells, aggregates, filters, etc used
in case of using construction like:
```
{
defaultColumn = {}
}
```
`defaultColumn` will get new instance each time, so as result it force to recalculation each of `React.useMemo`.
* [v7] useSort - Multisort functionality: Limit `multiSort` number and configurable shift key
1. Provide configuration for multisort that pressing shift key is not compulsory
2. Configurable limit on max number of columns for multisort, like configuration has been provided that `maxMultiSortColCount` is 3, suppose currenlty table is sorted by `[A, B, C]` and then clicking `D` for sorting should result in table sorted by `[B, C , D]`
* update readme for new multisort options
* Use `isMultiSortEvent` function
so as to make `shift` key optional or take decision based on other parameters for multisorting
* `isMultiSortEvent` updated readme
* chore(package.json): use latest babel core, remove bridge
* test(.babelrc): add test environment so that Jest can use ES6 imports
* test(usetable): fix import
Since useColumns was relying on groupBy logic, this was code smell. I wanted useGroupBy to be able to add that logic all by itself and not have to have dependencies in the core of the table.
To fix that, I've moved the core column and row logic to the useTable hook and added a new hook 'columnsBeforeHeaderGroups' to allow useGroupBy to do what i needs in a more pure way.
* added assertion to check for show property inside column
* reverted previous change
* added a filter to weed out non-visible columns when calculating the size for grouped Headers
* added another case to the previous filter to factor in blank grouped Headers
* Fix pagination resetting to page zero with manualPagination
To be honest I'm not sure what this useLayoutEffect is there to do.
It has no visible effect if you don't use manualPagination, and if you
do it, simply jumps you back to the first page, defeating the point of
you having control of the pagination.
* Conditionally reset page on data change
Rather disable the whole page reset when filters, groupBy or sortBy
change, just because I wanted to disable the page reset on data change,
make that bit be conditional.
With that in mind, usePagination now accepts a
disablePageResetOnDataChange parameter.
V7 adds the option to remove a sort option, so it goes from asc -> desc
-> unset, then repeats. V6 just went from asc -> desc then repeated.
Personally I much preferred this, I think that there's a case to be made
that this is the more expected behavior.
I'm not sure if this is really the best way to fix this since it adds
yet another api option and I completely understand that that is less
than desirable, but I also would rather add an option than have to
duplicate the whole useSortBy hook.
This change allows you to technically use React Table without a layout hook. Under that assumption, you would need to come up with your own styling mechanisms for display.
The useSimpleLayout merely adds a single `width` style to the prop getters for column headers and cells.
The useFlexLayout is much more robust. Personally though, I have moved away from both, and am just using raw `display: table-row/table-cell` styles to let my tables display naturally.
* Install useSimpleLayout and adjust useTable and useRows as required.
* useSimpleLayout integration
* Minor final fix - replace .filter with .forEach
* Used a spread on the path.
Pagination elements are now customizable without having
to create a new Pagination component, that would
mostly mimic the existing one in terms of functionality.
* Adds import instructions to the HOC README
Also fixes up some language and remove other import instructions. It's better to just have the import instructions in just one place.
* Better visualizes a list of functions
I found the added Props by looking into the defaultProps.js when I could not find a way change the styling of the filter row.
Custom Props
Built-in Components
Every single built-in component's props can be dynamically extended using any one of these prop-callbacks:
<ReactTable
getProps={fn}
getTableProps={fn}
getTheadGroupProps={fn}
getTheadGroupTrProps={fn}
getTheadGroupThProps={fn}
getTheadProps={fn}
getTheadTrProps={fn}
getTheadThProps={fn}
+getTheadFilterProps={fn}
+getTheadFilterTrProps={fn}
+getTheadFilterThProps={fn}
* Add aria-label attributes to pagination jump and row count selector with a new prop to specify different text.
* Add new text props for labels to README
When rendering a class component using the `class extends React.Component {}` syntax, you would get an error `TypeError: Cannot call a class as a function` because the check to determine whether a component was a class component was insufficient. It seems pointless to even have a check, however, because the JSX syntax can render both class and functional components.
* initial commit
* update readme
* update examples and src
* edit readme
* use single instance of advancedExpandTable
* add in hoc codesandbox to docs, run eslint on new source file
* Also check ID field when finding pivot col in treeTableHOC
* Pass the ID if you've got one on treeTableHOC
* An expandable cell should never be hidden
* Fix typo
* Edit link to working codesandbox
Fix '100k Rows w/ Pivoting & Sub Components' example
Closes#870
* Add cross-env to remove environment variable errors on Windows
I think this is the most common way of setting columns or expanderDefaults.
I had to find issue #565 and then follow it to issue #394 to see explanations on how to do this.
I have used this library to develop a big application for my company and had been required to make the columns are foldable. I saw that feature is useful and would like to share with everybody. Especially to all developers who developed this great component.
Let me know if any issues with My component. I will fix it accordingly.
* Merge fork from master (#6)
* Examples Refactor + multiSort flag (#619)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* Docs testing cleanup (#645)
* Examples Refactor + multiSort flag (#619) (#4)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* Examples Refactor + multiSort flag (#619) (#5)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* Fork Update (#7)
* Examples Refactor + multiSort flag (#619)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* Docs testing cleanup (#645)
* Examples Refactor + multiSort flag (#619) (#4)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* Examples Refactor + multiSort flag (#619) (#5)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* Update README.md (#584)
* Update README.md
Missing " on Features list,
Extra comma removed
* Update README.md
Added space for component uniformity.
* Update the devDependencies for the linter (#596)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix ThComponent classnames ordering (#673)
Allow for custom classname to overwrite base styles
* Add column to getResizerProps (#667)
* CHANGELOG update
* Doco updates
fixed a typo - ‘row’ to ‘original’
added minimal dock on ‘minRows’
* Merge from original (#9)
* Examples Refactor + multiSort flag (#619)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* Docs testing cleanup (#645)
* Examples Refactor + multiSort flag (#619) (#4)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* Examples Refactor + multiSort flag (#619) (#5)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* Update README.md (#584)
* Update README.md
Missing " on Features list,
Extra comma removed
* Update README.md
Added space for component uniformity.
* Update the devDependencies for the linter (#596)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix ThComponent classnames ordering (#673)
Allow for custom classname to overwrite base styles
* Add column to getResizerProps (#667)
* CHANGELOG update for 6.7.5 (#679)
* Merge fork from master (#6)
* Examples Refactor + multiSort flag (#619)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* Docs testing cleanup (#645)
* Examples Refactor + multiSort flag (#619) (#4)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* Examples Refactor + multiSort flag (#619) (#5)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* Fork Update (#7)
* Examples Refactor + multiSort flag (#619)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* Docs testing cleanup (#645)
* Examples Refactor + multiSort flag (#619) (#4)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* Examples Refactor + multiSort flag (#619) (#5)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* Update README.md (#584)
* Update README.md
Missing " on Features list,
Extra comma removed
* Update README.md
Added space for component uniformity.
* Update the devDependencies for the linter (#596)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix ThComponent classnames ordering (#673)
Allow for custom classname to overwrite base styles
* Add column to getResizerProps (#667)
* CHANGELOG update
* Use preset-env instead of preset-es2015
Remove preset-stage-2 and use individual required plugins.
* Expose es module build
* Update scripts in package.json
* Use rollup for faster and lighter umd builds
Add non minified version of the build.
* Merge fork from master (#6)
* Examples Refactor + multiSort flag (#619)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* Docs testing cleanup (#645)
* Examples Refactor + multiSort flag (#619) (#4)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* Examples Refactor + multiSort flag (#619) (#5)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* Fork Update (#7)
* Examples Refactor + multiSort flag (#619)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* Docs testing cleanup (#645)
* Examples Refactor + multiSort flag (#619) (#4)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* Examples Refactor + multiSort flag (#619) (#5)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* Update README.md (#584)
* Update README.md
Missing " on Features list,
Extra comma removed
* Update README.md
Added space for component uniformity.
* Update the devDependencies for the linter (#596)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix ThComponent classnames ordering (#673)
Allow for custom classname to overwrite base styles
* Add column to getResizerProps (#667)
* CHANGELOG update
* Header focus bug fix
Fixes#685
* Merge fork from master (#6)
* Examples Refactor + multiSort flag (#619)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* Docs testing cleanup (#645)
* Examples Refactor + multiSort flag (#619) (#4)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* Examples Refactor + multiSort flag (#619) (#5)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* Fork Update (#7)
* Examples Refactor + multiSort flag (#619)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* Docs testing cleanup (#645)
* Examples Refactor + multiSort flag (#619) (#4)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* Examples Refactor + multiSort flag (#619) (#5)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* Update README.md (#584)
* Update README.md
Missing " on Features list,
Extra comma removed
* Update README.md
Added space for component uniformity.
* Update the devDependencies for the linter (#596)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix ThComponent classnames ordering (#673)
Allow for custom classname to overwrite base styles
* Add column to getResizerProps (#667)
* CHANGELOG update
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Examples Refactor + multiSort flag (#619) (#4)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* Examples Refactor + multiSort flag (#619) (#5)
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
Still requires some basic sanity test to ensure ReactTable does
not have any fundamental coding errors.
Modified some of the /docs code to help with manual testing.
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
* Refactor HOCs to /src/hoc
Still have to write the HOCReadme.md (still just a placeholder for now)
* Refactor complete
May need to remove some redundant code
* Text change for the HOC samples
* Introduced a 'multiSort' flag
Defaults to 'true'
A 'false' value will turn multi-sort off.
* refactor: Fix defaultProps.js linter errors
* refactor: Fix lifecycle.js linter errors
* refactor: Fix pagination.js linter errors
* refactor: Fix propTypes.js linter errors
* refactor: Fix utils.js linter errors
* refactor: Fix methods.js linter errors
* refactor: Fix index.js linter errors
* Fix for linter changes + CHANGELOG update
* chore: Update the devDependencies for the linter
* A few HOC examples for react-table.
Not really integrated with the whole codesandbox.io approach.
* Missing dependency - shortid
We have found that with longer documentation files, the position of the sponsor link is more effective in helping fund the project when it's higher in the readme.
The current css selectors, eg. `.ReactTable input` cause conflicts with `input` elements inside Cells. So changed it to `.ReactTable .-pagination input`.
This brings `rt-tfoot` into line with `rt-thead` in terms of flex behaviour.
Without this, it's possible for an `rt-tr` to be taller than its containing
`rt-tfoot` without causing it to expand, which causes the outer `rt-table` to
scroll vertically.
* Add column id to the rowInfo object (passed to render). Resolves#237
* Creating a new object instead of modifying existing rowInfo; Refs #253
* Code style compliance. Refs #253
* Prevent transitions while resizing for a smoother effect.
* Disable text selection when resizing columns
* Use PivotValueComponent instead of pivotRender
* Add changelog file
* Convert expander column to be more like a regular column.
* Update story.
* Simplify setting render on defaultExpander.
* Add more control over expander and pivot columns using the column.
* Fix default filtering on pivot column.
* Add comments.
* Add column resizing for non pivot columns.
* Fixing resizing UI issues and mobile functionality.
* Remove calling onChange during resize events so that server example doesn't refetch data every time a column resizes.
* Change precedence in 'getResolvedState'
* Previously existing props would overwrite passed in state
* Now passed in state gets precedence
* added a controlled table example to storybook
* Add column filtering.
* Fix javascript warning from yarn test. Compile storybook and docs.
* Pass standard linting
* Add support for filtering pivot columns.
* Build distribution files.
* Set page to max page available if data changes and has less pages than before.
Closes#159
* Add column filtering.
* Fix javascript warning from yarn test. Compile storybook and docs.
* Pass standard linting
* Add support for filtering pivot columns.
* Build distribution files.
* Rename CollapseOnPageChange to CollapseOnDataChange to more accurately reflect its purpose.
* Add support for collapseOnPageChange.
* Fix collapseOnPageChange efficiency.
* rough draft of "closeSubComponentOnDataChange" and "preventAutoSortWhenComponentIsOpen"
* changed flag name from ...component to ...subcomponent
* fixed problem with sorting not immediately being applied. passes tests now
* changed var names
* Cleanup and simplification
* Fix deps
* Better freezing strategy
* subcomponent reverse
v6 is now considered feature complete to its current abilities and limitations. We are not actively working to fix any issues for v6 any more. We will, however, merge any non-breaking pull requests submitted to fix anything in v6.
# Using v7?
Thanks for using the beta version of React Table v7! We're very excited about it.
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Codesandbox!**
Use a new [react-table codesandbox](https://codesandbox.io/s/m5lxzzpz69) to reproduce the issue.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
We do not track feature requests through Github. Please use the [Spectrum React Table Forum](https://spectrum.chat/react-table) to talk about new ideas and features.
We do not use Github to track general support. Please use our public support forum at https://spectrum.chat/react-table.
NOTE: If a support/help/question issue is opened, it will be closed immediately and be redirected to the forum. Thanks for helping us keep our issues clean and productive!
- Massive changes to the entire project and library. Please consult the README and documentation for more information regarding these changes.
## 6.8.6
#### Fixes & Optimizations
- Since `resolveData` is now capable of materializing data on it's own, the `data` prop is no longer required as a prop-type.
## 6.8.4
#### Fixes & Optimizations
- Only run `resolveData` prop when `data` prop has changed, not any others.
## 6.8.3
#### Fixes & Optimizations
- Allow the `resolveData` prop to alter or materialize new data when the `data` prop changes.
## 6.8.1
#### Fixes & Optimizations
- Updated eslint and code formatting
## 6.7.5
#### Fixes & Optimizations
- Now passes `column` to `getResizerProps` (#667)
- NOTE: `getResizerProps` is now only called if the column is resizable
- Fixes the `className` ordering in defaultProps for ThComponent (#673)
- NOTE: user supplied classNames now come at the end so they can extend the defaults
## 6.7.4
#### Fixes & Optimizations
- Fix Prop types for columns
## 6.7.3
#### Fixes & Optimizations
- Fix the rest of the proptypes
## 6.7.2
#### Fixes & Optimizations
-`getPropTypes` proptype check
## 6.7.1
#### Fixes & Optimizations
-`eslint-config` moved to dev deps
## 6.7.0
## 6.7.0-alpha-0
#### New Features
- Expose page/pageSize to rows/cells
- Supply sort direction to custom sort methods
#### Fixes & Optimizations
- README updates
- Linter cleanup
- Added PropTypes node module
- Deps, linting and style upgrades
## 6.6.0
#### Fixes & Optimizations
- moved repo to react-tools
- Doc examples moved to codesandbox.io
- README updates
- CSS refacting for rt-tfoot to match rt-thead
- CSS more specific for input and select
## 6.5.3
#### Fixes & Optimizations
-`onClick` proxying and eslint
## 6.5.2
#### New Features
- Provide onClick handleOriginal function - #406
#### Fixes & Optimizations
- README updates
-`makePathArray` in utils - #326
- Various fixes: #294, #376, #398, #415,
## 6.5.1
#### Fixes & Optimizations
-`defaultExpanded` now works correctly - #372
-`column.getProps().rest` props are now applied correctly
-`makeTemplateComponent` now supports `displayName` - #289
## 6.5.0
##### New Features
-`column.filterAll` - defaults to `false`, but when set to `true` will provide the entire array of rows to `filterMethod` as opposed to one row at a time. This allows for more fine-grained filtering using any method you can dream up. See the [Custom Filtering example](https://react-table.js.org/#/story/custom-filtering) for more info.
## 6.4.0
##### New Features
-`PadRowComponent` - the content rendered inside of a padding row. Defaults to a react component that renders ` `
## 6.3.0
##### New Features
-`defaultSortDesc` - allows you to set the default sorting direction for all columns to descending.
-`column.defaultSortDesc` - allows you to set the default sorting direction for a specific column. Falls back to the global `defaultSortDesc` when not set at all.
## 6.0.0
##### New Features
- New Renderers:
-`Aggregated` - Custom renderer for aggregated cells
-`Pivot` - Custom renderer for Pivoted Cells (utilizes `Expander` and `PivotValue`)
-`PivotValue` - Custom renderer for Pivot cell values (deprecates the undocumented `pivotRender` option)
-`Expander` - Custom renderer for Pivot cell Expander
- Added custom sorting methods per table via `defaultSortMethod` and per column via `column.sortMethod`
- Pivot columns are now visibly separate and sorted/filtered independently.
- Added `column.resizable` to override global table `resizable` option for specific columns.
- Added `column.sortable` to override global table `sortable` option for specific columns.
- Added `column.filterable` to override global table `filterable` option for specific columns.
- Added `defaultExpanded` table option.
- All callbacks can now be utilized without needing to hoist and manage the piece of state they export. That is what their prop counterparts are for, so now the corresponding prop is used instead of the callback to detect a "fully controlled" state.
- Prevent transitions while column resizing for a smoother resize effect.
- Disable text selection while resizing columns.
##### Breaking API Changes
- New Renderers:
-`Cell` - deprecates and replaces `render`
-`Header` - deprecates and replaces `header`
-`Footer` - deprecates and replaces `footer`
-`Filter`- deprecates and replaces `filterRender`
- Callbacks now provide the destination state as the primary parameter(s). This makes hoisting and controlling the state in redux or component state much easier. eg.
-`onSorting` no longer requires you to build your own toggle logic
-`onResize` no longer requires you to build your own resize logic
- Renamed `onChange` callback -> `onFetchData` which will always fire when a new data model needs to be fetched (or if not using `manual`, when new data is materialized internally).
- Renamed `hideFilter` -> `filterable` (Column option. Note the true/false value is now flipped.)
-`cellInfo.row` and `rowInfo.row` now reference the materialize data for the table. To reference the original row, use `cellInfo.original` and `rowInfo.original`
- Removed `pivotRender` column option. You can now control how the value is displayed by overriding the `PivotValueComponent` or the individual column's `PivotValue` renderer. See [Pivoting Options Story](https://react-table.js.org/?selectedKind=2.%20Demos&selectedStory=Pivoting%20Options&full=0&down=1&left=1&panelRight=0&downPanel=kadirahq%2Fstorybook-addon-actions%2Factions-panel) for a reference on how to customize pivot column rendering.
If you have questions about implementation details, help or support, then please use our dedicated community forum at [Spectrum.chat/react-table](https://spectrum.chat/react-table) **PLEASE NOTE:** If you choose to instead open an issue for your question, your issue will be immediately closed and redirected to the forum.
## Reporting Issues
If you have found what you think is a bug, please [file an issue](https://github.com/tannerlinsley/react-table/issues/new). **PLEASE NOTE:** Issues that are identified as implementation questions or non-issues will be immediately closed and redirected to [Spectrum.chat/react-table](https://spectrum.chat/react-table)
## Suggesting new features
If you are here to suggest a feature, first create an issue if it does not already exist. From there, we will discuss use-cases for the feature and then finally discuss how it could be implemented.
## Development
If you have been assigned to fix an issue or develop a new feature, please follow these steps to get started:
- Fork this repository
- Install dependencies by running `$ yarn`
- Link `react-table` locally by running `$ yarn link`
- Auto-build files as you edit by running `$ yarn start`
- Implement your changes and tests to files in the `src/` directory and corresponding test files
- To run examples, follow their individual directions. Usually this is just `$ yarn && yarn start`.
- To run examples using your local build, link to the local `react-table` by running `$ yarn link react-table` from the example's directory
- Lightweight at 4kb (and just 2kb more for styles)
-Fully customizable JSX and callbacks for everything
-Supports both Client-side & Server-side pagination and sorting
-Minimal design & easily themeable
-<a href="https://medium.com/@tannerlinsley/why-i-wrote-react-table-and-the-problems-it-has-solved-for-nozzle-others-445c4e93d4a8#.axza4ixba" target="\_blank">"Why I wrote React Table and the problems it has solved for Nozzle.io</a> by Tanner Linsley
- Lightweight (4kb - 9kb depending on features and tree-shaking)
-Headless (100% customizable, Bring-your-own-UI)
-Auto out of the box, fully controllable API
-Sorting (Multi and Stable)
-Filters
- Pivoting & Aggregation
- Row Selection
- Row Expansion
- Column Ordering
- Animatable
- Virtualizable
- Resizable
- Server-side/controlled data/state
- Extensible via hook-based plugin system
- <a href="https://medium.com/@tannerlinsley/why-i-wrote-react-table-and-the-problems-it-has-solved-for-nozzle-others-445c4e93d4a8#.axza4ixba" target="\_parent">"Why I wrote React Table and the problems it has solved for Nozzle.io"</a> by Tanner Linsley
React Table v7 is still under active development, and its API is still changing, albeit only slightly. For this reason, it is currently in an **beta** release state. It's estimated that it will be fully released as a stable version sometime during October 2019.
<a name="example"></a>
## Example
```javascript
importReactTablefrom'react-table'
#### Should I use v7@beta in production?
constdata=[{
name:'Tanner Linsley',
age:26,
friend:{
name:'Jason Maurer',
age:23,
}
},{
...
}]
You can use it in production as long as you lock in the beta version in your package.json and also accept that there may be unlikely, but possible bug fixes and/or API changes before it's official release.
v6 is a great library and is still the default install for `react-table`, however, I do not intend on offering any long-term support for it. If you intend to keep using v6, I recommend maintaining your own fork of the library and keeping it up to date for your version of React.
<a name="data"></a>
## Data
Simply pass the `data` prop anything that resembles an array or object. Client-side filtering and pagination is built in, and your table will update gracefully as you change any props. [Server-side data](#server-side-data) is also supported!
#### Where are the docs for the older v6 version?
Please [visit the v6 branch](https://github.com/tannerlinsley/react-table/tree/v6)
<a name="default-props"></a>
## Default Props
These are the default props for the main react component `<ReactTable />`
```javascript
{
// General
loading:false,// Whether to show the loading overlay or not
pageSize:20,// The default page size (this can be changed by the user if `showPageSizeOptions` is enabled)
minRows:0,// Ensure this many rows are always rendered, regardless of rows on page
showPagination:true,// Shows or hides the pagination component
showPageJump:true,// Shows or hides the pagination number input
showPageSizeOptions:true,// Enables the user to change the page size
pageSizeOptions:[5,10,20,25,50,100],// The available page size options
expanderColumnWidth:30,// default columnWidth for the expander column
#### I want to migrate from v6 to v7. How do I do that?
// Callbacks
onChange:(state,instance)=>null,// Anytime the internal state of the table changes, this will fire
onTrClick:(row,event)=>null,// Handler for row click events
The differences between the 2 versions are incredibly massive. Unfortunately, I cannot write a one-to-one upgrade guide for any of v6's API, simply because much of it is irrelevant with v7's headless approach. The best approach for migrating to v7 is to learn its API by reading the documentation and then following some of the examples to begin building your own table component.
// Text
previousText:'Previous',
nextText:'Next',
pageText:'Page',
ofText:'of',
rowsText:'rows',
## Documentation
// Classes
className:'-striped -highlight',// The most top level className for the component
tableClassName:'',// ClassName for the `table` element
theadClassName:'',// ClassName for the `thead` element
tbodyClassName:'',// ClassName for the `tbody` element
trClassName:'',// ClassName for all `tr` elements
trClassCallback:row=>null,// A call back to dynamically add classes (via the classnames module) to a row element
paginationClassName:''// ClassName for `pagination` element
// Styles
style:{},// Main style object for the component
tableStyle:{},// style object for the `table` component
theadStyle:{},// style object for the `thead` component
tbodyStyle:{},// style object for the `tbody` component
trStyle:{},// style object for the `tr` component
trStyleCallback:row=>{},// A call back to dynamically add styles to a row element
thStyle:{},// style object for the `th` component
tdStyle:{},// style object for the `td` component
paginationStyle:{},// style object for the `paginination` component
}
```
- [Installation](./docs/installation.md) - Walk through how to install React Table
- [Concepts](./docs/concepts.md) - Read how React Table works and how you can use it better
- [Examples](./docs/examples.md) - Experience and learn from some examples and guides of how to use React Table and implement common patterns
- [API](./docs/api.md) - Get to know React Table's API, how to use it and how to extend its functionality
- [Contributing](./CONTRIBUTING.md) - Become familiar with how to contribute back to React Table
- [Code of Conduct](./CODE_OF_CONDUCT.md) - Be a good React Table citizen by following these repository rules
You can easily override the core defaults like so:
## Sponsors
```javascript
import{ReactTableDefaults}from'react-table'
**React Table v7** is being built and maintained by me, @tannerlinsley and I am always in need of more Patreon support to keep this project afloat. If you would like to contribute to my Patreon goal for v7 and beyond, [visit my Patreon and help me out!](https://patreon.com/tannerlinsley)
id:'myProperty',// Conditional - A unique ID is required if the accessor is not a string or if you would like to override the column name used in server-side calls
sortable:true,
sort:'asc'or'desc',// used to determine the column sorting on init
show:true,// can be used to hide a column
minWidth:100// A minimum width for this column. If there is room, columns will flex to fill
className:'',// Set the classname of the `td` element of the column
style:{},// Set the style of the `td` element of the column
render:JSXeg.({value,rowValues,row,index,viewIndex})=><span>{value}</span>, //ProvideaJSXelementorstatelessfunctiontorenderwhateveryouwantasthecolumn's cell with access to the entire row
// value == the accessed value of the column
// rowValues == an object of all of the accessed values for the row
// row == the original row of data supplied to the table
// index == the original index of the data supplied to the table
// viewIndex == the index of the row in the current page
// Header & HeaderGroup Options
header: 'HeaderName' or JSX eg. ({data, column}) => <div>Header Name</div>,
headerClassName: '',// Set the classname of the `th` element of the column
headerStyle:{},// Set the style of the `th` element of the column
// Header Groups only
columns:[...]// See Header Groups section below
}]
```
<a name="styles"></a>
## Styles
React-table is built to be dropped into existing applications or styled from the ground up, but if you'd like a decent starting point, you can optionally include our default theme `react-table.css`. We think it looks great, honestly :)
<a name="header-groups"></a>
## Header Groups
To group columns with another header column, just nest your columns in a header column like so:
```javascript
constcolumns=[{
header:'Favorites',
columns:[{
header:'Color',
accessor:'favorites.color'
},{
header:'Food',
accessor:'favorites.food'
}{
header:'Actor',
accessor:'favorites.actor'
}]
}]
```
## Sub Tables & Components
By adding a `subComponent` props, you can easily add an expansion level to all root-level rows:
If you want to handle pagination, and sorting on the server, `react-table` makes it easy on you.
1. Feed React Table `data` from somewhere dynamic. eg. `state`, a redux store, etc...
1. Add `manual` as a prop. This informs React Table that you'll be handling sorting and pagination server-side
1. Subscribe to the `onChange` prop. This function is called at `compomentDidMount` and any time sorting or pagination is changed by the user
1. In the `onChange` callback, request your data using the provided information in the params of the function (state and instance)
1. Update your data with the rows to be displayed
1. Optionally set how many pages there are total
```javascript
<ReactTable
...
data={this.state.data}// should default to []
pages={this.state.pages}// should default to -1 (which means we don't know how many pages we have)
loading={this.state.loading}
manual// informs React Table that you'll be handling sorting and pagination server-side
onChange={(state,instance)=>{
// show the loading overlay
this.setState({loading:true})
// fetch your data
Axios.post('mysite.com/data',{
page:state.page,
pageSize:state.pageSize,
sorting:state.sorting
})
.then((res)=>{
// Update react-table
this.setState({
data:res.data.rows,
pages:res.data.pages,
loading:false
})
})
}}
/>
```
For a detailed example, take a peek at our [async table mockup](https://github.com/tannerlinsley/react-table/blob/master/example/src/screens/async.js)
<a name="multi-sort"></a>
## Multi-Sort
When clicking on a column header, hold shift to multi-sort! You can toggle `ascending``descending` and `none` for multi-sort columns. Clicking on a header without holding shift will clear the multi-sort and replace it with the single sort of that column. It's quite handy!
<a name="component-overrides"></a>
## Component Overrides
Though we wouldn't suggest it, `react-table` has the ability to change the core componentry it used to render it's table. You can do so by assigning a react component to it's corresponding global prop, or on a one-off basis like so:
```javascript
// Change the global default
import{ReactTableDefaults}from'react-table'
Object.assign(ReactTableDefaults,{
tableComponent:Component,
theadComponent:Component,
tbodyComponent:Component,
trComponent:Component,
thComponent:Component,
tdComponent:Component,
paginationComponent:Component,
previousComponent:Component,
nextComponent:Component,
loadingComponent:Component
})
// Or change per instance
<ReactTable
tableComponent={Component},
theadComponent={Component},
// etc...
/>
```
If you choose to change the core components React-Table uses to render, you must make sure your components support and utilized all of the neeeded features for that component to work properly. For a broad reference on how to do this, investigate [the source](https://github.com/tannerlinsley/react-table/blob/master/src/index.js) for the component you wish to replace.
## Contributing
To suggest a feature, create an issue if it does not already exist.
If you would like to help develop a suggested feature follow these steps:
- Fork this repo
-`npm install`
-`npm run watch`
- Implement your changes to files in the `src/` directory
- Submit PR for review
If you would like to preview your changes, you can link and utilize the example like so:
-`npm link`
-`cd example`
-`npm install`
-`npm link react-table`
-`npm run watch`
- Make changes to the example in `src/screens/index.js` if needed
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.