Commit Graph
122 Commits
Author SHA1 Message Date
ironicbrewandGitHub b9f7bda223 Updated react-dnd package (#1939)
+ Prevents code sandbox from crashing the dnd example
2020-03-06 15:28:59 -07:00
343e76ce65 Fix useFlexLayout table min-width (#1924)
* Fix useFlexLayout table min-width

* Delete .size-snapshot.json

Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
2020-03-06 14:57:36 -07:00
Josh StevensandGitHub a52a2e1265 Fix code sandbox for kitchen sink (#1915)
There's an error on this page that says `useGroupBy` must come after `useFilters`
2020-02-21 06:58:41 -07:00
Tanner Linsley 917cfcc910 Better plugin order api 2020-02-15 20:00:42 -07:00
Tanner Linsley b161d6d47b Update App.js 2020-02-15 12:53:00 -07:00
Tanner Linsley 083e81dc81 Normalize API method names and row modesl, add expandAll functionality including prop getter 2020-02-15 12:43:09 -07:00
2bf99aaea0 docs(examples/material-ui-enhanced-table): Add more Material UI table (#1847)
* docs(examples/material-ui-enhanced-table): add more Material UI table

This enhanced Material UI table demonstrates client side pagination, sorting, global search, add
row, and delete row.

* Update EnhancedTable.js

Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
2020-02-14 13:19:55 -07:00
Ovieh MosleyandGitHub c984796190 Update App.js (#1858)
Fixed typo.
2020-02-14 12:55:42 -07:00
Tanner Linsley 7dc9b85165 Polish merge conflicts and changelog updates 2020-02-14 12:12:24 -07:00
Tanner Linsley 21826a93e0 Merge branch 'master' of https://github.com/react-tools/react-table 2020-02-14 11:27:19 -07:00
Tanner Linsley b989a8fa76 Changed: Tests, aggregation, hooks, columnVisibility, docs 2020-02-14 11:23:05 -07:00
Muhaimin CSandTanner Linsley 8e310bd0e6 fix typo (#1815) 2020-01-08 16:32:50 -07:00
dependabot[bot]andTanner Linsley 68606bb77c Bump handlebars from 4.1.2 to 4.6.0 in /examples/column-hiding (#1841)
Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.1.2 to 4.6.0.
- [Release notes](https://github.com/wycats/handlebars.js/releases)
- [Changelog](https://github.com/wycats/handlebars.js/blob/master/release-notes.md)
- [Commits](https://github.com/wycats/handlebars.js/compare/v4.1.2...v4.6.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
2020-01-08 16:32:22 -07:00
dependabot[bot]andTanner Linsley 9d97ac29a6 Bump handlebars from 4.1.2 to 4.5.3 in /examples/column-hiding (#1817)
Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.1.2 to 4.5.3.
- [Release notes](https://github.com/wycats/handlebars.js/releases)
- [Changelog](https://github.com/wycats/handlebars.js/blob/master/release-notes.md)
- [Commits](https://github.com/wycats/handlebars.js/compare/v4.1.2...v4.5.3)

Signed-off-by: dependabot[bot] <support@github.com>
2020-01-08 16:31:08 -07:00
dependabot[bot]andTanner Linsley b018ed64ed Bump handlebars from 4.1.2 to 4.5.3 in /examples/basic (#1818)
Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.1.2 to 4.5.3.
- [Release notes](https://github.com/wycats/handlebars.js/releases)
- [Changelog](https://github.com/wycats/handlebars.js/blob/master/release-notes.md)
- [Commits](https://github.com/wycats/handlebars.js/compare/v4.1.2...v4.5.3)

Signed-off-by: dependabot[bot] <support@github.com>
2020-01-08 16:30:56 -07:00
dependabot[bot]andTanner Linsley 71e7c542c4 Bump handlebars from 4.1.2 to 4.5.3 in /examples/grouping (#1819)
Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.1.2 to 4.5.3.
- [Release notes](https://github.com/wycats/handlebars.js/releases)
- [Changelog](https://github.com/wycats/handlebars.js/blob/master/release-notes.md)
- [Commits](https://github.com/wycats/handlebars.js/compare/v4.1.2...v4.5.3)

Signed-off-by: dependabot[bot] <support@github.com>
2020-01-08 16:30:46 -07:00
dependabot[bot]andTanner Linsley e3223ed1b9 Bump handlebars from 4.1.2 to 4.5.3 in /examples/row-selection (#1820)
Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.1.2 to 4.5.3.
- [Release notes](https://github.com/wycats/handlebars.js/releases)
- [Changelog](https://github.com/wycats/handlebars.js/blob/master/release-notes.md)
- [Commits](https://github.com/wycats/handlebars.js/compare/v4.1.2...v4.5.3)

Signed-off-by: dependabot[bot] <support@github.com>
2020-01-08 16:30:37 -07:00
gargrohandTanner Linsley 59c4558dc8 grouping txt (#1837)
* grouping txt

* Update App.js
2020-01-08 16:29:21 -07:00
ggascoigneandTanner Linsley 1d8ffb18f7 Add fixed width column support to useFlexLayout (#1810)
* Add fixed width column support to useFlexLayout

*  Allow useFlexLayout to honor canResize by calculating flex width separately from total width.
*  Update example to show the selection checkbox since that's a common fixed width use case.
*  Add example for right aligning columns.
*  Tweaked the styles for the table to better align the resize handles (since it made verifying the rest easier when they weren't misaligned by the scroll bar width)

Note that the resize behavior is still rather strange, but that's a separate problem that this change didn't really effect.

* swich to react-table@latest
2019-12-25 19:59:43 -07:00
Saurabh MauryaandTanner Linsley 66cc06365c Bootstrap example (#1801)
* Added bootstrap as an example UI library

* Rename folder
2019-12-21 09:06:38 -07:00
Tanner Linsley d18f1ba4d8 Add global filtering support via useGlobalFilter 2019-12-18 13:22:58 -07:00
Tanner Linsley 30a40aa0a2 Change meta signature for hooks 2019-12-18 11:54:43 -07:00
Tanner Linsley cb59098685 Fix column hiding, add useControlledStat hook 2019-12-18 10:39:35 -07:00
Tanner Linsley b48cddb92b Add back useFlexLayout and full-width-resizable-table example 2019-12-17 20:41:28 -07:00
Tanner Linsley ee18cf4b89 Add streaming rows snapshot 2019-12-17 19:31:09 -07:00
Chris NorwoodandTanner Linsley 632ea28c4b Update to use React.Fragment spread with row props (#1781) 2019-12-13 18:08:01 -07:00
Tanner Linsley c8d2180e5b Create sandbox.config.json 2019-12-13 00:52:32 -07:00
Tanner Linsley bca95b0928 Fix selection examples 2019-12-13 00:43:54 -07:00
Tanner Linsley 4143208334 Fix prefilteredRows 2019-12-13 00:41:10 -07:00
Tanner Linsley 9fa1396f26 Mucho updates 2019-12-13 00:22:30 -07:00
Tanner Linsley ddfa0fa227 Death of the path, fix some hooks, fix selectedRows
- Fixed an issue where dependency hooks were not being reduced properly, thus the table would rerender unnecessarily
- Renamed `toggleRowSelectedAll` to `toggleAllRowsSelected`. Duh...
- Added an `indeterminate` boolean prop to the default props for row selection toggle prop getters
- Renamed `selectedRowPaths` to `selectedRowIds`, which also no longer contains paths, but row IDs
- Grouped or nested row selection actions and state are now derived, instead of tracked in state.
- Rows now have a new property called `id`, which existed before and was derived from the `getRowId` option
- Rows now also have an `isSomeSelected` prop when using the `useRowSelect` hook, which denotes that at least one subRow is selected (if applicable)
- Rows' `path` property has been deprecated in favor of `id`
- Expanded state is now tracked with row IDs instead of paths
- RowState is now tracked with row IDs instead of paths
- `toggleExpandedByPath` has been renamed to `toggleExpandedById`, and thus accepts a row ID now, instead of a row path
2019-12-10 23:04:34 -07:00
Tanner Linsley 0c43e19091 Fix useResizeColumns bug 2019-12-10 14:58:31 -07:00
dependabot[bot]andTanner Linsley 7222c1cb2b Bump eslint-utils from 1.4.0 to 1.4.3 in /examples/row-selection (#1754)
Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.4.0 to 1.4.3.
- [Release notes](https://github.com/mysticatea/eslint-utils/releases)
- [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.4.0...v1.4.3)

Signed-off-by: dependabot[bot] <support@github.com>
2019-12-10 11:51:39 -07:00
Tanner Linsley 690190081f Merge branch 'master' of https://github.com/react-tools/react-table 2019-12-10 11:37:07 -07:00
Tanner Linsley 4a3311035d Added/updated hooks reorganization of hooks, new hook rules
- The exported (but undocumented) `applyHooks` function has been deprecated. Please use either `reduceHooks` or `loopHooks` utilities in your custom plugins now.
- The exported (but undocumented) `applyPropHooks` function has been deprecated. Please use the `makePropGetter` utility in your custom plugins now.
- Added the `reduceHooks` exported utility which is used to reduce a value through a collection of hooks. Each hook must return a value (mutation is discouraged)
- Added the `loopHooks` exported utility which is used to loop over a collection of hooks. Hooks are not allowed to return a value (mutation is encouraged)
- Prop-getter hook functions now support returning an array (in addition to the typical object of props). When an array is returned, each item in the array is smart-merged into a new props object (meaning it will intelligently compose and override styles and className)
- Added the `makePropGetter` exported utility which is used to create prop getters from a prop getter hook.
- Prop-getter function supplied to the table have 2 new overloaded options (in addition to the typical object of props):
  - `Function(props, instance, ...row/col/context) => Array<props> | props` - If a function is passed to a prop getter function, it will receive the previous props, the table instance, and potentially more context arguments. It is then be expected to return either an array of new props (to be smart-merged with styles and classes, the latest values taking priority over the previous values) or a props object (which will replace all previous props)
  - `Array<props>` - If an array is passed to a prop getter function, each prop object in the array will be smart-merged with styles and classes into the props from previous hooks (with the latest values taking priority over the previous values).
- Extracted default hooks into separate file.
- Added the `useOptions` plugin hook, which allows a plugin to reduce/modify the initial options being passed to the table
- Converted almost all usages of `instanceRef.current` to use `useGetLatest(instanceRef.current)` to help with avoiding memory leaks and to be more terse.
- Converted all previous prop-getter definitions to use the new `makePropGetter`
- Reorganized plugin hooks to declare as many hooks in the main plugin function as opposed to in the `useInstance` hook.
- Changed the `useInstanceBeforeDimensions` hook to be a `loopHooks` call instead of a reducer. An error will be thrown now if any of these hook functions returns a value (to discourage mutation of the instance)
- Changed the `useInstance` hook to be a `loopHooks` call instead of a reducer. An error will be thrown now if any of these hook functions returns a value (to discourage mutation of the instance)
- Change the `prepareRow` hook to be a `loopHooks` call instead of a reducer. An error will be thrown now if any of these hook functions returns a value (to discourage mutation of the row)
2019-12-10 11:35:05 -07:00
Jakob Hjelmer NielsenandTanner Linsley ccc89379da .add touch events to useResizeColumns (#1748)
.add onTouchStart to mergeProps
.add touch-action css to resizer
.mod increase resizer width or it is very hard to activate using touch devices
2019-12-10 06:39:02 -07:00
Tanner Linsley 614f40f47d Fix controlled pagination example 2019-12-09 10:12:36 -07:00
dependabot[bot]andTanner Linsley 2955335df1 Bump eslint-utils from 1.4.0 to 1.4.3 in /examples/grouping (#1730)
Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.4.0 to 1.4.3.
- [Release notes](https://github.com/mysticatea/eslint-utils/releases)
- [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.4.0...v1.4.3)

Signed-off-by: dependabot[bot] <support@github.com>
2019-12-06 16:42:41 -07:00
Tanner Linsley 562a2feaef v7.0.0-rc.2 2019-12-06 16:30:08 -07:00
dependabot[bot]andTanner Linsley b92e25c21a Bump eslint-utils from 1.4.0 to 1.4.3 in /examples/basic (#1720)
Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.4.0 to 1.4.3.
- [Release notes](https://github.com/mysticatea/eslint-utils/releases)
- [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.4.0...v1.4.3)

Signed-off-by: dependabot[bot] <support@github.com>
2019-12-05 23:17:00 -05:00
Tanner Linsley 438ce81fc5 Update API doc links 2019-12-05 23:14:23 -05:00
Tanner Linsley a33a008608 Add Footer Support 2019-12-05 23:11:50 -05:00
dependabot[bot]andTanner Linsley e5d672b9ea Bump eslint-utils from 1.4.0 to 1.4.3 in /examples/column-hiding (#1717)
Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.4.0 to 1.4.3.
- [Release notes](https://github.com/mysticatea/eslint-utils/releases)
- [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.4.0...v1.4.3)

Signed-off-by: dependabot[bot] <support@github.com>
2019-12-05 15:48:41 -05:00
Tanner LinsleyandGitHub 8ba553871f Add useColumnVisibility as core hook (#1700)
* Update utils.js

* Update useTable.js

* Create useColumnVisibility.js

* Update useColumnVisibility.js

* Update useColumnVisibility.js

* Convert to core hook, use new reducerHanndler/actions

* Add useColumnVisibility internal hook
2019-12-05 15:45:25 -05:00
Tanner Linsley 9727202b14 Update Example 2019-12-05 09:17:59 -05:00
Tanner Linsley 57cc5dc7d0 Update selectedRowPaths in examples 2019-12-04 22:52:14 -05:00
Aaron AgarunovandTanner Linsley 5c2b8302c0 Remove getTableHeaderProps destructured from useTable (#1706) 2019-12-04 14:26:28 -05:00
Tanner LinsleyandGitHub 1bbc89cedb Update App.js 2019-12-03 13:28:16 -07:00
Tanner LinsleyandGitHub 184ec448af Update README.md 2019-12-03 13:25:51 -07:00
Tanner Linsley 5d81f95d9b Upgrade examples to use "latest" 2019-12-03 12:55:01 -07:00