Compare commits

...
Author SHA1 Message Date
Tanner Linsley 96a185af59 v7.0.0-rc.10 2019-12-13 00:45:01 -07:00
Tanner Linsley 8c5f5084d2 Merge branch 'master' of https://github.com/react-tools/react-table 2019-12-13 00:44:18 -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
size-plugin[bot]andGitHub a3fb80fb81 🧝🏻 👷🏽‍♀️ update sizes-es.json 👍 2019-12-13 07:28:24 +00:00
size-plugin[bot]andGitHub 77f7eb689d 🇲🇩 🐏 update sizes-cjs.json 👍 2019-12-13 07:28:23 +00:00
Tanner Linsley d421cb52c5 Merge branch 'master' of https://github.com/react-tools/react-table 2019-12-13 00:26:06 -07:00
Tanner Linsley 81dcfd8dec Merge branch 'master' of https://github.com/react-tools/react-table 2019-12-13 00:25:27 -07:00
Tanner Linsley 9fa1396f26 Mucho updates 2019-12-13 00:22:30 -07:00
Jason LawandTanner Linsley 0de4f69f14 Fix useRowSelect shouldExist (#1774) 2019-12-13 00:16:30 -07:00
size-plugin[bot]andGitHub dafd1a1972 😵 📆 update sizes-cjs.json 👍 2019-12-12 15:55:20 +00:00
size-plugin[bot]andGitHub cd5f7e6968 👩🏼‍🎓 👸🏼 update sizes-es.json 👍 2019-12-12 15:55:19 +00:00
Peng XiaoandTanner Linsley 32ae1a52e4 fix: render components should include memo/forwardRef (#1764) 2019-12-12 08:51:37 -07:00
Yarin BenadoandTanner Linsley 1509fc0438 Rename manualSorting to manualSortBy to reflect API changes (#1770) 2019-12-12 08:50:05 -07:00
Tanner LinsleyandGitHub 048f118279 Update README.md 2019-12-11 16:31:33 -07:00
Tanner LinsleyandGitHub e661d90d48 Update README.md 2019-12-11 15:43:57 -07:00
size-plugin[bot]andGitHub a9c04ca3dc 🩳 👨🏼 update sizes-es.json 👍 2019-12-11 06:08:38 +00:00
size-plugin[bot]andGitHub 1f18260a70 ✉️ 🇧🇫 update sizes-cjs.json 👍 2019-12-11 06:08:37 +00:00
Tanner Linsley 3109ca4d37 Merge branch 'master' of https://github.com/react-tools/react-table 2019-12-10 23:06:52 -07:00
Tanner Linsley b517ee13d5 v7.0.0-rc.9 2019-12-10 23:05:57 -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
size-plugin[bot]andGitHub 63c6a56e38 🇪🇸 🏄🏾‍♀️ update sizes-es.json 👍 2019-12-10 23:36:27 +00:00
size-plugin[bot]andGitHub 213caf6544 👦 📎 update sizes-cjs.json 👍 2019-12-10 23:36:25 +00:00
Tanner Linsley 42b78d52ca v7.0.0-rc.8 2019-12-10 16:35:19 -07:00
Tanner Linsley 68fd89af3c Fix props clobbering
Fixes #1755
2019-12-10 16:34:23 -07:00
Tanner Linsley 0c43e19091 Fix useResizeColumns bug 2019-12-10 14:58:31 -07:00
size-plugin[bot]andGitHub 08bb50ae48 🧑🏻‍🤝‍🧑🏻 🔔 update sizes-es.json 👍 2019-12-10 19:44:09 +00:00
size-plugin[bot]andGitHub 0fcc9e608c 🇰🇪 🍐 update sizes-cjs.json 👍 2019-12-10 19:44:08 +00:00
Tanner Linsley 15125f9326 Update useColumnVisibility.js 2019-12-10 12:42:19 -07:00
Tanner Linsley b8701f260a Update CHANGELOG.md 2019-12-10 12:33:44 -07:00
Tanner Linsley 70bdd272e5 Merge branch 'master' of https://github.com/react-tools/react-table 2019-12-10 11:59:39 -07:00
size-plugin[bot]andGitHub 5ad648d9da 🇧🇸 👮🏽‍♂️ update sizes-es.json 👍 2019-12-10 18:58:59 +00:00
size-plugin[bot]andGitHub 117dc54439 💻 🙍🏾‍♀️ update sizes-cjs.json 👍 2019-12-10 18:58:58 +00:00
Tanner Linsley d8f0174d80 v7.0.0-rc.7 2019-12-10 11:57:54 -07:00
Tanner Linsley cf9517fe7a Merge branch 'master' of https://github.com/react-tools/react-table 2019-12-10 11:57:21 -07:00
Tanner Linsley e1fd921f07 Add useFinalInstance plugin hook 2019-12-10 11:56:41 -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
size-plugin[bot]andGitHub e984934e92 👩🏽‍⚖️ 🕵🏾‍♀️ update sizes-es.json 👍 2019-12-10 18:44:23 +00:00
size-plugin[bot]andGitHub 938bdd9885 🧏🏾 ✡️ update sizes-cjs.json 👍 2019-12-10 18:44:22 +00:00
Tanner Linsley 88a0d86d60 Update .size-snapshot.json 2019-12-10 11:42:31 -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
size-plugin[bot]andGitHub a73ee145b3 💍 ️ update sizes-cjs.json 👍 2019-12-10 13:42:08 +00:00
size-plugin[bot]andGitHub b0d2044e22 🤫 💪🏻 update sizes-es.json 👍 2019-12-10 13:42:07 +00: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 9563dae006 Update README.md 2019-12-09 10:51:07 -07:00
Tanner Linsley d35d190708 Merge branch 'master' of https://github.com/react-tools/react-table 2019-12-09 10:51:05 -07:00
Tanner Linsley 614f40f47d Fix controlled pagination example 2019-12-09 10:12:36 -07:00
size-plugin[bot]andGitHub 5846c86605 👨‍💻 🛹 update sizes-es.json 👍 2019-12-09 17:02:19 +00:00
size-plugin[bot]andGitHub c5fb154d9b ⛹🏻‍♂️ 🏋🏼‍♀️ update sizes-cjs.json 👍 2019-12-09 17:02:18 +00:00
Tanner Linsley 5e6952db93 v7.0.0-rc.6 2019-12-09 09:53:29 -07:00
Tanner Linsley ac43ef2e38 Merge branch 'master' of https://github.com/react-tools/react-table 2019-12-09 09:52:50 -07:00
Tanner Linsley 9de699bfd3 Add/rename a few hooks, fix useColumnVisibility header deps
- The `columnsBeforeHeaderGroups` and `columnsBeforeHeaderGroupsDeps` hooks have been renamed to `flatColumns` and `flatColumnsDeps` respectively, which better reflects what they are used for, rather than their order, which can remain implicit.
- Added `headerGroups` and `headerGroupDeps` hooks, which, similar to `flatColumns`, allow you to decorate (and trigger) the memoized header group generation.
- Added `columns` and `columnsDeps` hooks, which, similar to `flatColumns` and `headerGroups`, allow you to decorate (and trigger) the memoized column generation/decoration.
- The new hook order is as follows: `columns/columnsDeps` => `flatColumns/flatColumnsDeps` => `headerGroups/headerGroupsDeps`
- `useColumnVisibility` now uses the new `headerGroupsDeps` hook to trigger header group regeneration when visibility changes
2019-12-09 09:52:27 -07:00
size-plugin[bot]andGitHub 38d82a0397 📘 🍫 update sizes-es.json 👍 2019-12-09 02:40:17 +00:00
size-plugin[bot]andGitHub 863bf50206 🍊 👨🏾‍🎨 update sizes-cjs.json 👍 2019-12-09 02:40:16 +00:00
Tanner Linsley 492ba8a4f9 Update Changelog 2019-12-08 19:35:55 -07:00
Tanner Linsley e0ad323bd8 v7.0.0-rc.5 2019-12-08 19:32:45 -07:00
Tanner Linsley c1e4fb8956 v7.0.0-rc.4 2019-12-08 19:26:49 -07:00
Bart NagelandTanner Linsley 1ac1d99f23 Fix link in documentation (#1733) 2019-12-06 21:51:34 -07:00
size-plugin[bot]andGitHub e5b991751a 🏊🏿‍♂️ 🧜🏻‍♂️ update sizes-cjs.json 👍 2019-12-07 03:49:50 +00:00
Bart NagelandTanner Linsley 8dc6559e64 Fix row.toggleExpanded(bool) (#1732)
The wrong variable was being checked against `undefined`, so the row was
always being toggled, rather than taking the parameter into account.
2019-12-06 20:39:45 -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 8c090a734b Merge branch 'master' of https://github.com/react-tools/react-table 2019-12-06 16:36:50 -07:00
Tanner Linsley 439ebad063 Update faq.md 2019-12-06 16:36:17 -07:00
size-plugin[bot]andGitHub 2ef6e13657 🧎🏼 🤳🏽 update sizes-es.json 👍 2019-12-06 23:35:30 +00:00
size-plugin[bot]andGitHub 6338b32bd8 🧝🏽‍♂️ 🇲🇦 update sizes-cjs.json 👍 2019-12-06 23:35:29 +00:00
Tanner Linsley 67544d33ff v7.0.0-rc.3 2019-12-06 16:33:41 -07:00
Tanner Linsley 3fa2cdf388 Merge branch 'master' of https://github.com/react-tools/react-table 2019-12-06 16:30:42 -07:00
Tanner Linsley 562a2feaef v7.0.0-rc.2 2019-12-06 16:30:08 -07:00
AlbericoandTanner Linsley 176986a07a docs(docs/api/readme.md): fix to useTable link that was giving 404 (#1726)
In the /docs/api/README.md the useTable link was linking to the file ./usetable.md that doesn't
exist, now it links to ./useTable
2019-12-06 10:25:15 -05:00
size-plugin[bot]andGitHub f824fea2ef 🙍🏿 ♟️ update sizes-es.json 👍 2019-12-06 08:21:02 +00:00
size-plugin[bot]andGitHub ace8f56371 🇦🇪 💨 update sizes-cjs.json 👍 2019-12-06 08:21:01 +00:00
gargrohandTanner Linsley 3d5249b716 [useSortBy] updating missed key rename (#1724) 2019-12-06 03:19:28 -05:00
ggascoigneandTanner Linsley 546cb4e076 put useFilters docs in correct file (#1723) 2019-12-06 01:18:48 -05:00
size-plugin[bot]andGitHub d1677dfebb 🇻🇨 🤰🏻 update sizes-es.json 👍 2019-12-06 04:37:44 +00:00
size-plugin[bot]andGitHub 4868d7835f 😖 💇🏾‍♀️ update sizes-cjs.json 👍 2019-12-06 04:37:43 +00:00
Tanner Linsley a152704fde v7.0.0-rc.1 2019-12-05 23:36:14 -05:00
Tanner Linsley 32033b7095 Merge branch 'master' of https://github.com/react-tools/react-table 2019-12-05 23:19:38 -05:00
Tanner Linsley f73d87ac5d v7.0.0-rc.0
Fixes #1573
Fixes #1719
Fixes #1718
2019-12-05 23:18:48 -05: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
size-plugin[bot]andGitHub 536217e430 ⛹🏿‍♂️ 🦻🏻 update sizes-es.json 👍 2019-12-06 04:16:18 +00:00
size-plugin[bot]andGitHub d038c6e781 😒 🐜 update sizes-cjs.json 👍 2019-12-06 04:16:17 +00:00
Tanner Linsley 438ce81fc5 Update API doc links 2019-12-05 23:14:23 -05:00
Tanner Linsley 7a0688aa63 Merge branch 'master' of https://github.com/react-tools/react-table 2019-12-05 23:14:17 -05:00
Tanner Linsley a33a008608 Add Footer Support 2019-12-05 23:11:50 -05:00
size-plugin[bot]andGitHub 67dd1d23b1 🕓 😞 update sizes-cjs.json 👍 2019-12-05 20:56:38 +00:00
size-plugin[bot]andGitHub 4aad402644 📸 🤟🏼 update sizes-es.json 👍 2019-12-05 20:56:37 +00:00
Tanner Linsley 75acd4a35b Merge branch 'master' of https://github.com/react-tools/react-table 2019-12-05 15:51:30 -05:00
Tanner Linsley a170d33956 7.0.0-beta.28 2019-12-05 15:51:09 -05:00
size-plugin[bot]andGitHub 4c9d868a12 🧜🏽‍♀️ 🧖‍♀️ update sizes-cjs.json 👍 2019-12-05 20:48:59 +00:00
size-plugin[bot]andGitHub 08d6e2da71 🦽 🟪 update sizes-es.json 👍 2019-12-05 20:48:58 +00:00
Martin BrennerandTanner Linsley 7169b3100b Remove tooltip if columnDisableSortBy (#1685)
* Remove tooltip if columnDisableSortBy

* update sorting test snapshot
2019-12-05 15:48:57 -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 LinsleyandGitHub 3097997734 Merge 9727202b14 into master 2019-12-05 09:18:01 -05:00
Tanner Linsley 9727202b14 Update Example 2019-12-05 09:17:59 -05:00
size-plugin[bot]andGitHub 6cb52cc3a6 🤦🏽‍♀️ 🦑 update sizes-cjs.json 👍 2019-12-05 14:17:13 +00:00
size-plugin[bot]andGitHub ee4f3f1d75 🇳🇮 🈚️ update sizes-es.json 👍 2019-12-05 14:17:12 +00:00
Martin BrennerandTanner Linsley 487abd2119 pass the instance with updated rows (#1714) 2019-12-05 09:14:07 -05:00
Tanner Linsley 9829927fab Update installation.md 2019-12-04 22:54:31 -05:00
Tanner Linsley d838238e95 Merge branch 'master' of https://github.com/react-tools/react-table 2019-12-04 22:54:22 -05:00
Tanner Linsley 57cc5dc7d0 Update selectedRowPaths in examples 2019-12-04 22:52:14 -05:00
size-plugin[bot]andGitHub 2ddd7731fa 👠 🤏 update sizes-es.json 👍 2019-12-05 03:48:58 +00:00
size-plugin[bot]andGitHub b65c853d09 🤵🏿 🧎🏻 update sizes-cjs.json 👍 2019-12-05 03:48:57 +00:00
Tanner Linsley 974eab7f5f Merge branch 'master' of https://github.com/react-tools/react-table 2019-12-04 22:47:06 -05:00
Tanner Linsley b687cc01f0 7.0.0-beta.27 2019-12-04 22:46:53 -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 0e243e28a8 v7.0.0-beta.26 2019-12-03 12:57:59 -07:00
Tanner Linsley 5d81f95d9b Upgrade examples to use "latest" 2019-12-03 12:55:01 -07:00
Tanner Linsley 403bb2848b Merge branch 'master' of https://github.com/react-tools/react-table 2019-12-03 12:54:51 -07:00
Tanner Linsley 1b1fda6815 Remove typescript dep 2019-12-03 12:54:35 -07:00
Cody SchwebkeandTanner Linsley 7014647b4a fix: fix crash in useSortBy resetSortBy action (#1695) 2019-12-03 12:52:08 -07:00
onnadi-saandTanner Linsley 872cb49242 Change An -> A (#1693) 2019-12-03 12:31:03 -07:00
onnadi-saandTanner Linsley 945bf18ee0 Fix typo (#1692) 2019-12-03 12:04:18 -07:00
size-plugin[bot]andGitHub 1e321f22d3 🇱🇧 👩🏾‍🚒 update sizes-es.json 👍 2019-12-03 16:44:30 +00:00
size-plugin[bot]andGitHub 2740e55d76 🎴 🤗 update sizes-cjs.json 👍 2019-12-03 16:44:29 +00:00
Tanner Linsley 6b88340051 Merge branch 'master' of https://github.com/react-tools/react-table 2019-12-03 09:42:27 -07:00
Tanner Linsley 92603b6a70 v7.0.0-beta.24 2019-12-03 09:40:53 -07:00
size-plugin[bot]andGitHub 09c212ec6c 👭🏾 🚜 update sizes-es.json 👍 2019-12-03 03:50:37 +00:00
size-plugin[bot]andGitHub 482cef191f 👳🏼‍♀️ 😆 update sizes-cjs.json 👍 2019-12-03 03:50:37 +00:00
Roman KovtunandTanner Linsley d7da8b631d Fix issue with missing columnId in updater on column spread (#1682) 2019-12-02 20:49:04 -07:00
size-plugin[bot]andGitHub 85153d287f 🏃‍♂️ ⏺️ create sizes-es.json 👍 2019-12-03 00:08:05 +00:00
size-plugin[bot]andGitHub c7ac522da3 👩🏾🤝👨🏽 🌈 create sizes-cjs.json 👍 2019-12-03 00:08:04 +00:00
anotherjsguyandTanner Linsley 5393ebc7fa setup size-plugin-bot (#1677)
* setup size-plugin-bot

* Update package.json
2019-12-02 17:06:31 -07:00
Tanner Linsley f74e347a06 v7.0.0-beta.23 2019-12-02 16:53:57 -07:00
Tanner Linsley ef29b639bd Update CHANGELOG.md 2019-12-02 16:52:37 -07:00
Tanner Linsley 12b5d05ba2 Fix column resizing 2019-12-02 16:52:10 -07:00
Tanner Linsley f9a6273184 Rename useMain and useBeforeDimensions hooks 2019-12-02 16:12:23 -07:00
Tanner Linsley 83f889dad5 v7.0.0-beta.22 2019-12-02 12:29:46 -07:00
Tanner Linsley 49674a094a Update README.md 2019-12-02 11:18:06 -07:00
Tanner Linsley 6cb84037e1 v7.0.0-beta.21 2019-12-02 09:22:33 -07:00
Tanner Linsley 1682aef117 Removed deprecated defaultState export 2019-12-02 09:21:34 -07:00
Tanner Linsley b1cf2e91dd Update README.md 2019-12-02 01:30:52 -07:00
Tanner Linsley 127a7fca87 v7.0.0-beta.20 2019-12-02 01:28:28 -07:00
Tanner Linsley dac4744727 v7.0.0-beta.19 2019-12-01 00:23:42 -07:00
Tanner Linsley f27263ebbd v7.0.0-beta.17 2019-12-01 00:05:03 -07:00
Tanner Linsley 31450f1e73 v7.0.0-beta.16 2019-11-30 23:37:47 -07:00
Tanner Linsley 14a9248595 Fix row selection when used with grouping 2019-11-30 23:19:45 -07:00
Tanner Linsley 58ae9edafc Merge branch 'master' of https://github.com/react-tools/react-table 2019-11-30 22:28:53 -07:00
Tanner Linsley 50f2e84929 Fix memoization in depGetters 2019-11-30 22:28:30 -07:00
Andros Rosa LlopandTanner Linsley 764a8ce281 Fix default resetSelectedRowsDeps (#1663)
* This one also is listening to rows, instead of data.
2019-11-29 21:14:25 -07:00
Jason LawandTanner Linsley 0a512adaf0 fix: memory leak fix (#1610)
* fix: memory leak

* Style change
2019-11-29 21:14:04 -07:00
Tanner Linsley ee92b152ba Remove service workers 2019-11-28 12:25:36 -07:00
Tanner Linsley 301ab1b991 v7.0.0-beta.15 2019-11-25 12:48:07 -07:00
Andros Rosa LlopandTanner Linsley e924b80709 Fix types of getRowID & getSubRows (#1651)
Closes: https://github.com/tannerlinsley/react-table/issues/1628
2019-11-25 12:25:09 -07:00
Andros Rosa LlopandTanner Linsley 2ecdfbd24e [Fix] defaultGetResetPageDeps should listen to data, not rows (#1658)
Related to: https://github.com/tannerlinsley/react-table/issues/1657

Discussion: https://spectrum.chat/react-table/general/v7-maximum-update-depth-exceeded-usegroupby-useexpanded-with-usepagination~2c25e2b8-7a61-4c32-84b3-87db458701c2

Thanks to @iamjon for identifying usePagination was the culprit.
I then checked the last changes made to it, and noticed it was previously listening to data and now it listened to rows (which I believe is a new reference on each render), causing infinite loop on one of its effects.

I tested this change on my project and everything seems ok now.
2019-11-25 12:24:20 -07:00
Andros Rosa LlopandTanner Linsley 461aa0df96 Types: getGroupByToggleProps was lost (#1654)
* There it was, on an unused UseGroupByHeaderProps interface, while it should have been on UseGroupByColumnProps.
2019-11-22 19:31:14 -07:00
Tanner Linsley f7d0d5662e v7.0.0-beta.14 2019-11-20 12:20:14 -07:00
Tanner Linsley 3187061041 Use effect dependency user call 2019-11-20 12:09:24 -07:00
Tanner Linsley e2728d0fdb Add full-width-table example 2019-11-20 11:16:30 -07:00
Tanner Linsley c80dfabed4 Update README.md 2019-11-20 10:48:52 -07:00
Tanner Linsley aae70e1189 Update package.json 2019-11-20 10:46:47 -07:00
Tanner Linsley 354ee238e8 Add size-snapshot rollup plugin, upgrade node_modules, remove archives 2019-11-20 10:45:44 -07:00
Tanner Linsley cdcf11b4b0 v7.0.0-beta.13 2019-11-20 10:26:13 -07:00
Tanner Linsley b3a4a9db72 Update CHANGELOG.md 2019-11-20 10:25:40 -07:00
Tanner Linsley df30b97956 Update CHANGELOG.md 2019-11-20 10:24:41 -07:00
Tanner Linsley 58028e45fc Rename disableGrouping, remove propTypes, update Readme 2019-11-20 10:23:52 -07:00
Tanner Linsley 108ea1d358 Update README.md 2019-11-20 09:50:04 -07:00
Tanner Linsley aea60278b1 Disable workflows and use travis for now 2019-11-20 09:46:05 -07:00
Tanner Linsley 27cd93f4bf Merge branch 'master' of https://github.com/react-tools/react-table 2019-11-20 09:40:06 -07:00
Tanner Linsley ed3dd9e6b5 Add "default" sort/filter/groupBy options for non accessors, rename disableGrouping 2019-11-20 09:35:40 -07:00
BobandTanner Linsley 1b3730f5cb docs: drag and drop example using react dnd (#1627)
* docs: drag and drop example using react dnd

* docs: add row DnD example to examples list
2019-11-20 08:45:20 -07:00
Christian LehnerandTanner Linsley 81faac54ac fixed typo. the key is called data instead of rows (#1632) 2019-11-20 08:44:30 -07:00
Tanner Linsley 50b00b67c5 Added data-driven-classes-and-styles example
- Also updated snapshots
2019-11-20 08:43:57 -07:00
Nicolas BeauvaisandTanner Linsley 1be9f59180 Fix typo (#1645) 2019-11-20 08:00:07 -07:00
Igor KatsubaandTanner Linsley 6ccdce9908 Refactoring aggregations.js (#1646)
* Update aggregations.js

* Update aggregations.js
2019-11-18 14:18:48 -07:00
Tanner LinsleyandGitHub dd0d6d6640 Update README.md 2019-11-14 07:46:04 -07:00
Tanner LinsleyandGitHub ae37a77c9b Update README.md 2019-11-14 07:42:51 -07:00
Tanner Linsley a5e9653165 Merge branch 'master' of https://github.com/react-tools/react-table 2019-11-05 14:41:26 -07:00
ggascoigneandTanner Linsley 3b03ea32f5 remove Record from HeaderProps and CellProps (#1601)
These definitions mask errors in the other definitions and there are better
ways of extending these.

See https://github.com/tannerlinsley/react-table/pull/1597 for an
example of an existing prototype that was missing but harder to find
because of these definitions.
2019-11-05 14:37:06 -07:00
Josh HaleandTanner Linsley 61f0ded1d9 Fix simple typo in comments. (#1606) 2019-11-05 14:36:46 -07:00
yvanzoandTanner Linsley 4c013ba214 fix: empty class attribute (#1619)
The above `join` returns an empty `className` JSX attribute when
called on an empty array, setting an empty `class` HTML attribute.

fix #1618
2019-11-05 14:29:36 -07:00
Tanner Linsley 1d0c6f5b34 Update api.md 2019-11-05 14:10:55 -07:00
Tanner Linsley e00704fbce Test 2019-11-05 14:04:23 -07:00
Tanner LinsleyandGitHub 8ca57779a3 Update README.md 2019-11-05 13:45:30 -07:00
Tanner LinsleyandGitHub 1ba08abf74 Update README.md 2019-11-05 13:42:59 -07:00
Tanner LinsleyandGitHub c1b7abd886 Update README.md 2019-11-05 13:42:00 -07:00
Tanner Linsley c4d3ff79cb Merge branch 'master' of https://github.com/react-tools/react-table 2019-11-04 22:57:28 -07:00
Tanner LinsleyandGitHub 7b4a3cb3ec Update README.md 2019-11-04 22:54:11 -07:00
Tanner LinsleyandGitHub 43f116da76 Update README.md 2019-11-04 22:53:54 -07:00
Tanner Linsley 00f223d78d Merge branch 'master' of https://github.com/react-tools/react-table 2019-11-04 22:50:33 -07:00
Tanner LinsleyandGitHub 3747f26a3f Update README.md 2019-11-04 22:50:13 -07:00
Chuck DanielssonandTanner Linsley 9698677982 Update syntax in examples (#1631) 2019-11-04 22:29:31 -07:00
Tanner LinsleyandGitHub 0e92ec2415 Update README.md 2019-11-04 11:58:22 -07:00
Tanner LinsleyandGitHub bb505aad58 Update README.md 2019-11-04 11:57:52 -07:00
Tanner LinsleyandGitHub c4ac495d55 Update README.md 2019-10-30 18:01:55 -06:00
Tanner LinsleyandGitHub e0c85b8b02 Update README.md 2019-10-30 17:59:52 -06:00
Tanner LinsleyandGitHub 578af7964e Update README.md 2019-10-30 17:59:29 -06:00
Michael StramelandTanner Linsley 4b7c85624b Add selectedFlatRows (#1597) 2019-10-14 16:17:37 -06:00
Hugo BoveandTanner Linsley 1ea677331c fix(usegroupby): column.disableGrouping inverted logic (#1596)
unlike other hooks, the column.disableGrouping actually enabled grouping for a column
2019-10-14 09:25:22 -06:00
gargrohandTanner Linsley 83ee60d715 [useTable] Manage layout to honor column's show property (#1594) 2019-10-14 09:24:05 -06:00
Nattasit MoonchanabahtandTanner Linsley 9c7b1e3313 ♻️ Refactor code (#1588) 2019-10-12 16:25:33 -06:00
Christian MurphyandTanner Linsley 62924dea9b refactor: update complex types to use Array<> syntax (#1587)
re-enables dtslint array type rule
2019-10-10 15:39:32 -06:00
Michael LiandTanner Linsley 062a8c12b5 update selectedRows based on 7.0.beta.8 (#1586) 2019-10-10 15:37:26 -06:00
Roman KomarovandTanner Linsley 720fb21d60 docs(readme): adds a react-table-v6 package note (#1576) 2019-10-10 06:55:13 -06:00
Christian MurphyandTanner Linsley 777aa2b863 test: validate typings using dtslint (#1581)
* test: validate typings using dtslint

* build: switch typescript into strict mode
2019-10-09 17:48:11 -06:00
ggascoigneandTanner Linsley 51aa8e2eff fix react-table-config.d.ts (#1582)
It turns out that pulling the types directly from a package slightly
changes how visible they are to the consuming application.  This makes
sense, previously we explicitly adding the react-table module to the
global namespace an so didn't need explicit imports, but now that's not
the case.  So add explicit imports.
2019-10-09 17:47:34 -06:00
Christian MurphyandTanner Linsley 0d7a0d5aea ci: setup github actions continuous integration workflow (#1578)
* ci: setup github actions continuous integration workflow

* docs: add GitHub Action CI badge

* ci: remove travis ci in favor of github actions ci
2019-10-09 16:54:03 -06:00
Tanner Linsley fb94eaf103 v7.0.0-beta.12 2019-10-09 15:43:14 -06:00
Tanner Linsley 409c050cbf Merge branch 'master' of https://github.com/react-tools/react-table 2019-10-09 15:42:24 -06:00
ggascoigneandTanner Linsley cee24c74d8 Add typescript docs (#1564)
* Add typescript docs

* update for beta.10 and feedback
2019-10-09 15:42:09 -06:00
Michael StramelandTanner Linsley 499f21c349 Remove package-lock.json (#1579) 2019-10-09 15:19:04 -06:00
Tanner Linsley 2a39d5a21c v7.0.0-beta.11 2019-10-09 15:15:39 -06:00
36ba233e27 Updating types (#1535)
* Attempt to bring into alignment

fix plugin hook definitions

Remove old prop

Format

fix Header and Cell props

Rename prop

Abstract props to definitions

fix bad generic

fix typo

Revert "fix typo"

This reverts commit 1ca58c5d8fb017bb0af79dd4aa4f0cd296e7a7e8.

fix

* Remove documented prop

* Tweaks

* Re-add comment

* Some updates

* more changes

* Convert to interfaces

* more fixes

* rename sortByFn params

* Fixes

* Fix setFilter

* Hopefully the last changes

* Bump TypeScript Version for declaration file

Co-Authored-By: Christian Murphy <christian.murphy.42@gmail.com>

* format

* Linting

* fix typo

* expose defaultState

* swap aggregatedValue

* Allow cellvalue for accessor function return

* modifications

* manually added changes from ggascoigne

* remove changes from examples folder
2019-10-09 15:15:00 -06:00
Christian MurphyandTanner Linsley c7dfc45e2e ci: test cross platform (#1559)
* ci: test cross platform

Test on Node.js 10 and 12, long term release support versions.
Test on Linux, Mac, and Windows machines.

* fix: update ic-ci-cli to version 2

includes fixes to support windows

* ci: disable yarn gpg

* ci: double quote string for windows ci
2019-10-09 15:13:17 -06:00
Tanner LinsleyandGitHub 9dd36263fb Update README.md 2019-10-08 10:17:45 -06:00
Tanner Linsley 227f7905b0 Upgrade controlled pagination example for deduped fetching 2019-10-08 09:49:23 -06:00
Tanner Linsley f1ad032587 Update controlled pagination example 2019-10-08 09:46:06 -06:00
Tanner LinsleyandGitHub 93703d027c Update README.md 2019-10-08 09:38:30 -06:00
GeoffandTanner Linsley 75fb61a17f Update concepts.md (#1572)
Some grammatical errors are fixed.
2019-10-07 20:43:53 -06:00
Andrey IvlevandTanner Linsley 7c73a7a631 Fix isClassComponent function (#1571)
`Object.getPrototypeOf(component)` returns React `function Component()` function itself, not `Component.prototype`.
2019-10-07 12:17:22 -06:00
tannerlinsley cbb18368b2 v7.0.0-beta.10 2019-10-07 10:27:56 -06:00
tannerlinsley 4842bc061d fix: fix includeAll filter type, add filteredRows 2019-10-07 10:27:18 -06:00
tannerlinsley 0477ef26ca Merge branch 'master' of https://github.com/react-tools/react-table 2019-10-05 20:50:29 -06:00
tannerlinsley 82734fc898 v7.0.0-beta.9 2019-10-05 20:49:21 -06:00
tannerlinsley bbfc6428b7 refactor(usetable/usetablestate): integrate useTableState into useTable
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.
2019-10-05 20:48:28 -06:00
eclissi91andTanner Linsley 280ef16a75 Update api.md (#1567)
I have corrected typo of this issue #1565
2019-10-04 09:01:19 -06:00
tannerlinsley 7db7d59b3d v7.0.0-beta.8 2019-10-03 15:33:00 -06:00
tannerlinsley e43968c684 feat(userowselect): add selectedFlatRows, rename state.selectedRows
Added instance.selectedFlatRows to know which row objects are currently selecte
2019-10-03 14:08:34 -06:00
tannerlinsley e5c04614c1 v7.0.0-beta.7 2019-10-03 13:40:22 -06:00
tannerlinsley 0ef0bc4126 fix(userowselect): useRowSelect fixed to take into account filters
useRowSelect now takes into account filtered data when doing selectAll toggling and
isAllRowsSelected state.
2019-10-03 13:39:35 -06:00
tannerlinsley ef67b15c07 Merge branch 'master' of https://github.com/react-tools/react-table 2019-10-03 08:39:12 -06:00
Tanner Linsley d248be8877 Fix sandbox loop protection 2019-10-03 08:38:33 -06:00
tannerlinsley ea0799763d v7.0.0-beta.6 2019-10-03 08:26:45 -06:00
tannerlinsley 98fffc3819 Merge branch 'master' of https://github.com/react-tools/react-table 2019-10-03 08:26:13 -06:00
tannerlinsley de7f5c9385 feat(useresizecolumns): added useResizeColumns 2019-10-03 08:25:36 -06:00
Hugo BoveandTanner Linsley 69e13b87c3 feat(useexpanded, usepagination): omit subRows from rows (#1562)
Added useExpanded 'expandSubRows' option
2019-10-02 06:51:14 -06:00
tannerlinsley 727f4157c1 v7.0.0-beta.5 2019-10-01 20:49:07 -06:00
tannerlinsley 3f9ba8daba chore: user terser 2019-10-01 20:48:12 -06:00
tannerlinsley 3de1bbc3a7 v7.0.0-beta.4 2019-10-01 20:35:25 -06:00
tannerlinsley 7d84f86612 fix: cleanup 2019-10-01 20:34:37 -06:00
tannerlinsley 40477c1c83 fix: do not error on unkonwn user actions, side-effect-free 2019-10-01 20:33:55 -06:00
tannerlinsley 906988c35a Merge branch 'master' of https://github.com/react-tools/react-table 2019-10-01 14:26:11 -06:00
tannerlinsley 07d879f5bb docs(docs - example): updated example docs 2019-10-01 14:25:36 -06:00
Tanner LinsleyandGitHub e18f371623 Update README.md 2019-10-01 14:08:01 -06:00
tannerlinsley 76a55b5103 v7.0.0-beta.3 2019-10-01 14:04:05 -06:00
tannerlinsley 247687ee08 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.
2019-10-01 14:03:11 -06:00
Julian BöhnkeandTanner Linsley f70d38e061 add material-ui table component example (#1557)
* add material-ui table component example

* remove unused styled-components package

* update to react-table@nex

* update sandbox link

* update docs

* Update examples.md
2019-09-30 12:48:10 -06:00
gargrohandTanner Linsley b6fdb99f06 useAbsoluteLayout: Enable react-table to build with divs (#1522)
* 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
2019-09-30 07:40:35 -06:00
tannerlinsley 488da2ecc5 v7.0.0-beta.2 2019-09-30 07:32:56 -06:00
tannerlinsley 5f0e7cab8b fix: fix colspan prop to use column visibility
Fixes #1555
2019-09-30 07:31:43 -06:00
Nick OomsandTanner Linsley e2e67ed181 Added "in" to make the sentence more readable (#1554) 2019-09-28 06:44:01 -06:00
goldenLunchboxandTanner Linsley c8857a2871 Update api.md (#1551)
The state variable seemed to be missing in the useTable part (row 481) and I felt the need to comment on an additional import being needed.
2019-09-27 05:43:13 -06:00
Tanner LinsleyandGitHub 98583d35f3 Update README.md 2019-09-26 13:28:31 -06:00
tannerlinsley 0a1bf55a2c Merge branch 'master' of https://github.com/react-tools/react-table 2019-09-26 13:23:03 -06:00
tannerlinsley 54b4f8a5d1 v7.0.0-beta.1 2019-09-26 13:22:14 -06:00
tannerlinsley f552c94972 fix(usepagination): fix unstable callbacks
Closes #1549
2019-09-26 13:21:34 -06:00
ggascoigneandTanner Linsley 7ab6385839 TypeScript updates (#1521)
* 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
2019-09-20 09:37:45 -06:00
Tanner LinsleyandGitHub b8ed02cadc Update README.md 2019-09-17 15:44:02 -06:00
Tanner LinsleyandGitHub c3e917f13b Update README.md 2019-09-17 15:42:36 -06:00
tannerlinsley 7e6d719af4 docs(changelog): update changelog 2019-09-13 09:24:24 -06:00
tannerlinsley da678d0a61 Merge branch 'master' of https://github.com/react-tools/react-table 2019-09-13 09:22:09 -06:00
Tanner LinsleyandGitHub c3fe4c7fd8 Update README.md 2019-09-13 09:22:03 -06:00
tannerlinsley 45036054cb v7.0.0-beta.0 2019-09-13 09:09:44 -06:00
tannerlinsley 8d3a97c9a2 v7.0.0-alpha.36 2019-09-13 07:35:15 -06:00
tannerlinsley fb0eb3646a Merge branch 'master' of https://github.com/react-tools/react-table 2019-09-13 07:34:22 -06:00
tannerlinsley dfad9151c3 fix(expandedrows): fix in-page row expansion for paginateExpandedRows 2019-09-13 07:33:53 -06:00
Michael StramelandTanner Linsley c618542f6e Don't publish types (#1515) 2019-09-12 21:29:15 -06:00
Michael StramelandTanner Linsley 670a92734e Add typings (#1511) 2019-09-12 09:39:53 -06:00
Andrey NikonovandTanner Linsley c91130075b Fix typo (#1513) 2019-09-12 08:56:16 -06:00
Andrey NikonovandTanner Linsley c4a8eb147c Fix typo (#1512) 2019-09-12 08:56:04 -06:00
Tanner LinsleyandGitHub 388cb85f0a Update README.md 2019-09-10 13:17:12 -06:00
CodarandTanner Linsley aea76facf1 isAllRowsSelected can only be true if there are rows. (#1504) 2019-09-09 08:49:40 -06:00
tannerlinsley f829cd0222 v7.0.0-alpha.35 2019-09-09 08:25:09 -06:00
tannerlinsley 0a03ea3a75 fix: better flexRender utility (supports JSX elements now) 2019-09-09 08:24:08 -06:00
tannerlinsley 0aa55dac08 fix: fixed disablePageResetOnDataChangeRef dependencies
disablePageResetOnDataChangeRef will no longer trigger page resets when changed
2019-09-09 08:21:15 -06:00
Eddie HongandTanner Linsley 15778fe467 Fix typo in installation.md (#1498) 2019-09-06 10:59:47 -06:00
tannerlinsley ca23da0342 v7.0.0-alpha.34 2019-09-05 11:08:12 -06:00
tannerlinsley 072967b771 fix: fix defaultColumn.sortType, fix useGroupBy plugin order warning 2019-09-05 11:07:25 -06:00
tannerlinsley da9e94091f chore: removed unused example 2019-09-03 07:15:19 -06:00
Tanner LinsleyandGitHub a98ec48b20 Update README.md 2019-09-03 07:01:58 -06:00
Tanner LinsleyandGitHub 1e2ca74f96 Update README.md 2019-09-03 06:59:15 -06:00
Tanner LinsleyandGitHub aaa9459389 Update api.md 2019-09-03 06:33:07 -06:00
Tanner LinsleyandGitHub 7884f33486 Update README.md 2019-09-02 21:37:31 -06:00
Brian QianandTanner Linsley 6193a33c89 Changed docs to include sortType options for useSortBy (#1489)
* Update api.md

* Update README.md
2019-09-02 19:32:35 -06:00
tannerlinsley 0e54ef0005 v7.0.0-alpha.33 2019-08-29 09:27:31 -06:00
tannerlinsley b10446b8c4 fix: useExpanded uses flat array for state
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
2019-08-29 09:14:11 -06:00
560 changed files with 118904 additions and 70319 deletions
+2 -1
View File
@@ -3,7 +3,8 @@
[
"@babel/preset-env",
{
"modules": false
"modules": false,
"loose": true
}
],
"@babel/react"
+11 -9
View File
@@ -1,7 +1,6 @@
---
name: Bug report
about: Create a report to help us improve
---
# Using v6?
@@ -10,13 +9,14 @@ v6 is now considered feature complete to its current abilities and limitations.
# Using v7?
Thanks for using the alpha version of React Table v7! We're very excited about it.
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 '....'
@@ -32,15 +32,17 @@ Use a new [react-table codesandbox](https://codesandbox.io/s/m5lxzzpz69) to repr
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]
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.
+27
View File
@@ -0,0 +1,27 @@
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build-and-test:
name: '${{ matrix.platform }}: node.js ${{ matrix.node-version }}'
strategy:
matrix:
platform: [ubuntu-latest, windows-latest, macos-latest]
node-version: [10, 12]
runs-on: ${{ matrix.platform }}
env:
CI: true
steps:
- name: Checkout
uses: actions/checkout@master
- name: Set up Node.js
uses: actions/setup-node@master
with:
node-version: ${{ matrix.node-version }}
- name: Build and test
run: |
yarn install
yarn test
+3
View File
@@ -0,0 +1,3 @@
size-files:
- sizes-cjs.json
- sizes-es.json
+1
View File
@@ -10,3 +10,4 @@ react-table.css
.idea
.DS_Store
.history
package-lock.json
+1 -1
View File
@@ -1,6 +1,6 @@
module.exports = {
hooks: {
'pre-commit': 'lint-staged && yarn test:ci',
'commit-msg': 'commitlint -E HUSKY_GIT_PARAMS',
// 'commit-msg': 'commitlint -E HUSKY_GIT_PARAMS',
},
}
+1
View File
@@ -0,0 +1 @@
package-lock=false
+40
View File
@@ -0,0 +1,40 @@
{
"dist/index.js": {
"bundled": 104720,
"minified": 48438,
"gzipped": 13005
},
"dist/index.es.js": {
"bundled": 103833,
"minified": 47648,
"gzipped": 12849,
"treeshaked": {
"rollup": {
"code": 80,
"import_statements": 21
},
"webpack": {
"code": 8227
}
}
},
"dist\\index.js": {
"bundled": 105386,
"minified": 49565,
"gzipped": 13008
},
"dist\\index.es.js": {
"bundled": 104543,
"minified": 48815,
"gzipped": 12856,
"treeshaked": {
"rollup": {
"code": 80,
"import_statements": 21
},
"webpack": {
"code": 8444
}
}
}
}
+13 -2
View File
@@ -1,7 +1,18 @@
language: node_js
node_js:
- "10"
- 10
- 12
os:
- linux
- osx
- windows
env:
global:
- YARN_GPG=no
cache: yarn
script: npm test
script: yarn test
+213
View File
@@ -1,3 +1,216 @@
## 7.0.0-rc.10
- Optimizations made to make accessors, prop getters and other internals much faster. 10x in some cases!
- Fixed docs for `usePagination` to have `pageIndex` and `pageSize` only available on the state object, not the instance
- Added a plugin order restriction to make sure `useResizeColumns` always comes before `useAbsoluteLayout`
- Fixed the `useFinalInstance` hook to not have an empty array as the first meta argument passed.
- Fixed an issue where memoized or ref-forwarded components could not be used as cell renderers
- The `toggleExpandedById` action has been renamed to `toggleExpanded`
- Added the `toggleAllExpanded` action
- Added the `setExpanded` action
- Changed `row.isAggregated` to `row.isGrouped`
- `state.expanded` and `state.selectedRowIds` are now objects (`{[rowId]: Bool}`), not arrays. This should help with mid-to-large size datasets while also being serializable (instead of a Set(), which is not as reliable)
- `state.filters` is now an array of objects (`{id, value}`). Since filters do have order and can be applied incrementally, it should be an array to ensure correct order.
- Moved the `flatColumns` and `flatColumnsDeps` hooks to be after row/data materialization. These hooks can then manipulate the `flatColumns` object after all data has been accessed without triggering row materialization again.
- Added the `row.allCells` property and the `cellColumns` reducer hook to determine which cells to create for each row. These cells are placed into `row.allCells`. The resulting cell array is not meant to be used for display in templating and is only made available for convenience and/or advanced templating.
- Added the `cells` reducer hook to determine which cells from the `row.allCells` array that should be placed into `row.cells`. The resulting cell array is the one that is intended for display in templating.
- Reducers are now passed the actual instance variable, not the instanceRef
- Added the `makeRenderer` utility (also exported)
- Removed `column.groupByBoundary` functionality. If needed, use the `flatColumns` hook to decorate, reorganize or re-order groupBy columns
- Fixed grouped row.id's to be truly unique
## 7.0.0-rc.9
- 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
## 7.0.0-rc.8
- Fix an issue where `useResizeColumns` would crash when using the resizer prop getter
- Fix an issue where `useBlockLayout` was clobbering props sent to headers
## 7.0.0-rc.7
Removed:
- `applyHooks` (exported but undocumented) function has been deprecated. Please use either `reduceHooks` or `loopHooks` utilities in your custom plugins now.
- `applyPropHooks` (exported but undocumented) function has been deprecated. Please use the `makePropGetter` utility in your custom plugins now.
Added:
- `reduceHooks` exported utility which is used to reduce a value through a collection of hooks. Each hook must return a value (mutation is discouraged)
- `loopHooks` exported utility which is used to loop over a collection of hooks. Hooks are not allowed to return a value (mutation is encouraged)
- `makePropGetter` exported utility which is used to create prop getters from a prop getter hook.
- `useOptions` plugin hook, which allows a plugin to reduce/modify the initial options being passed to the table
- `useFinalInstance` plugin hook, which allows a plugin access to the final table instance before it is returned to the user.
Modified:
- 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)
- 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.
- 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 encourage 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 encourage 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 encourage mutation of the row)
## 7.0.0-rc.6
- The `columnsBeforeHeaderGroups` and `columnsBeforeHeaderGroupsDeps` hooks have been renamed to `flatColumns` and `flatColumnsDeps` respectively, which better reflects what they are used for, rather than their order, which can remain implicit.
- Added `headerGroups` and `headerGroupDeps` hooks, which, similar to `flatColumns`, allow you to decorate (and trigger) the memoized header group generation.
- Added `columns` and `columnsDeps` hooks, which, similar to `flatColumns` and `headerGroups`, allow you to decorate (and trigger) the memoized column generation/decoration.
- The new hook order is as follows: `columns/columnsDeps` => `flatColumns/flatColumnsDeps` => `headerGroups/headerGroupsDeps`
- `useColumnVisibility` now uses the new `headerGroupsDeps` hook to trigger header group regeneration when visibility changes
## 7.0.0-rc.5
- Fixed an issue where the exported `useAsyncDebounce` method would crash if its promise throw an error.
## 7.0.0-rc.4
- A maintenance release, purely intended to update the @latest tag (which was overwritten by a v6 publish)
## 7.0.0-rc.3
- Fixed an issue where `column.clearSortBy` would crash
## 7.0.0-rc.2
- `reducerHandlers` has been deprecated in favor of the new `stateReducers` hook.
- The `previousState` and `instanceRef` are now both generally available in state reducers for convenience.
- The global action property `action.instanceRef` has been deprecated.
- The `reducer` option has been renamed to `stateReducer` and in addition to passing a single reducer function now also supports passing an array of reducers
- Renamed `manualSorting` to be `manualSortBy` to be consistent with other naming conventions
- Removed the `getResetPageDeps` option in favor of the new `autoResetPage` option.
- Removed the `getResetFilterDeps` option in favor of the new `autoResetFilters` option.
- Removed the `getResetSortByDeps` option in favor of the new `autoResetSortBy` option.
- Removed the `getResetGroupByDeps` option in favor of the new `autoResetGroupBy` option.
- Removed the `getResetExpandedDeps` option in favor of the new `autoResetExpanded` option.
- Added a new exported utility called `useAsyncDebounce` to aid with external async side-effects.
- A new `useGetLatest` hook is used internally to track latest instances in a less ref-driven and verbose way.
- A new `useMountedLayoutEffect` hooks is now used internally to handle post-mount side-effects, mostly dealing with autoReset functionality
- Plugin hooks are now "consumed" using an internal `useConsumeHookGetter` hook. When they are consumed, they can no longer be manipulated past that point in the table lifecycle. This should help ensure people are using them in a relatively safe order with consistent expectations.
- Drastically "reduced" the reducer logic itself to be easier to understand and to be a stable reference for the life of the table. This change also means that the reducer must no longer be double-run/back-compared by React for changes in closure, thus actions and stateReducers (including user state reducers) will only fire once per action.
- Removed `debug` and related logging. It has been somewhat useful during development, but is now very noisy in the code. We can debug lifecycle and performance as needed from here on out.
- Removed unnecessary exports from `./utils.js` and moved all intentionally exported utilities to a new `./publicUtils.js` file.
## 7.0.0-rc.1
- Minor regex optimizations during row path creation
## 7.0.0-rc.0
- Added the support for the `Footer` renderer, `column.getFooterProps`, `footerGroups` and `footerGroup.getFooterProps`
## 7.0.0-beta.28
- Added the `useColumnVisibility` plugin as a core plugin along with several new instance and column-level methods to control column visibility
- Added the "column-hiding" example
## 7.0.0-beta.27
- Added the `useControlledState` option, which allows for hook-context control of the resolved internal table state
## 7.0.0-beta.26
- Fixed an issue where the table would crash if useSortBy was reset via the resetSortBy action
- Updated all of the examples to use the "react-table@latest" tag.
- `utils` is no longer an exported variable and instead, all of the individual util methods are exported at the root level of the library.
## 7.0.0-beta.25
- Fixed an issue where `useRowState` would crash due to invalid initial state of previous cell state on `columnId` lookup
## 7.0.0-beta.24
- Changed `selectedRowIds` to use a `Set()` instead of an array for performance.
- Removed types and related files from the repo. The community will now maintain types externally on Definitely Typed
## 7.0.0-beta.23
- The internal `useMain` hook has been renamed to `useInstance`
- The internal `useBeforeDimensions` hook has been renamed to `useInstanceBeforeDimensions`
- Fixed an issue where `useResizeColumns` wasn't working properly
## 7.0.0-beta.22
- Fixed an issue where `useRowState` would crash due to invalid initial state attempting to spread into the new state
## 7.0.0-beta.21
- Removed deprecated `defaultState` export
## 7.0.0-beta.20
- Internals have been reworked to use `useReducer` instead of `useState` for stability and architecture
- The `state` option has been removed in favor of using a custom reducer
- The `reducer` option has been changed to a new function signature: `function (newState, action, oldState) => newState`
- The `setState` table instance method is no longer supported
- The `dispatch` table instanced method was added
- The `ReactTable.actions` export is now a plain object of action types mapped to identically named action strings
- The `ReactTable.reducerHandlers` export was added, which is a plain object of plugin hook names mapped to their respective reducer functions
## 7.0.0-beta.19
- Added an `isAggregated` boolean parameter to the `aggregate` function signature
## 7.0.0-beta.16
- Removed service workers from examples
- Fixed a memory leak when `instance` was referenced in function closures
- Fixed an issue where the table would infinitely rerender due to incorrect effect dependencies
- Fixed an issue where row grouping and row selection would not work properly together.
## 7.0.0-beta.15
- Fixed an issue where `defaultGetResetPageDeps` was using `data` instead of `rows`
## 7.0.0-beta.14
- Removed
- `disablePageResetOnDataChange` option. use the `getResetPageDeps` option now.
- Added
- `getResetPageDeps` option
- `getResetFilterDeps` option
- `getResetSortByDeps` option
- `getResetGroupByDeps` option
- `getResetExpandedDeps` option
## 7.0.0-beta.13
- Added options
- `defaultCanSort`
- `defaultCanFilter`
- `defaultCanGroupBy`
- `column.defaultCanSort`
- `column.defaultCanFilter`
- `column.defaultCanGroupBy`
- Renamed
- `disableGrouping` to `disableGroupBy`
- `disableSorting` to `disableSortBy`
- `disableGroupBy` to `disableGroupBy`
- `column.disableGrouping` to `column.disableGroupBy`
- `column.disableSorting` to `column.disableSortBy`
- `column.disableGroupBy` to `column.disableGroupBy`
- Removed propType definitions. Since types are now being maintained, it makes little sense to also maintain these. Cooincidentally, this also saves some bundle size in some scenarios where they may not be removed properly by a developer's bundler.
## 7.0.0-beta.0
- 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
+108 -54
View File
@@ -4,33 +4,24 @@
Hooks for building **lightweight, fast and extendable datagrids** for React
<a href="https://travis-ci.org/tannerlinsley/react-table" target="\_parent">
<img alt="" src="https://travis-ci.org/tannerlinsley/react-table.svg?branch=master" />
</a>
<a href="https://npmjs.com/package/react-table" target="\_parent">
<img alt="" src="https://img.shields.io/npm/dm/react-table.svg" />
</a>
<a href="https://spectrum.chat/react-table">
<img alt="Join the community on Spectrum" src="https://withspectrum.github.io/badge/badge.svg" />
</a>
<a href="https://github.com/tannerlinsley/react-table" target="\_parent">
<img alt="" src="https://img.shields.io/github/stars/tannerlinsley/react-table.svg?style=social&label=Star" />
</a>
<a href="https://twitter.com/tannerlinsley" target="\_parent">
<img alt="" src="https://img.shields.io/twitter/follow/tannerlinsley.svg?style=social&label=Follow" />
</a>
<br />
<br />
<a href="https://patreon.com/tannerlinsley">
<img width="180" alt="" src="https://raw.githubusercontent.com/tannerlinsley/files/master/images/patreon/become-a-patron.png" />
</a>
[![#TanStack](https://img.shields.io/twitter/url?color=%2308a0e9&label=%23TanStack&style=social&url=https%3A%2F%2Ftwitter.com%2Fintent%2Ftweet%3Fbutton_hashtag%3DTanStack)](https://twitter.com/intent/tweet?button_hashtag=TanStack)
<br />
<br />
<!-- [![GitHub Actions CI](https://github.com/tannerlinsley/react-table/workflows/CI/badge.svg)](https://github.com/tannerlinsley/react-table/actions) -->
[![Travis CI](https://travis-ci.org/tannerlinsley/react-table.svg?branch=master)](https://travis-ci.org/tannerlinsley/react-table)
[![Bundlephobia](https://badgen.net/bundlephobia/minzip/react-table@next)](https://bundlephobia.com/result?p=react-table@next)
[![NPM Package](https://img.shields.io/npm/dm/react-table.svg)](https://npmjs.com/package/react-table)
[![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/react-table)
[![GitHub Stars](https://img.shields.io/github/stars/tannerlinsley/react-table.svg?style=social&label=Star)](https://github.com/tannerlinsley/react-table)
[![Twitter Followers](https://img.shields.io/twitter/follow/tannerlinsley.svg?style=social&label=Follow)](https://twitter.com/tannerlinsley)
Enjoy this library? Try them all! [React Query](https://github.com/tannerlinsley/react-query), [React Form](https://github.com/tannerlinsley/react-form), [React Charts](https://github.com/tannerlinsley/react-charts)
### [Become a Sponsor](https://github.com/sponsors/tannerlinsley/)
## Features
- Lightweight (4kb - 11kb depending on features and tree-shaking)
- Lightweight (5kb - 12kb+ depending on features used and tree-shaking)
- Headless (100% customizable, Bring-your-own-UI)
- Auto out of the box, fully controllable API
- Sorting (Multi and Stable)
@@ -40,39 +31,64 @@ Hooks for building **lightweight, fast and extendable datagrids** for React
- 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
## Documentation
- [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
- [API](./docs/api/README.md) - Get to know React Table's API
- [FAQ](./docs/faq.md) - Learn how to use React Table for specific challenges and tasks
- [Previous Versions](#previous-versions)
- [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
## Sponsors
**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)
This library is being built and maintained by me, @tannerlinsley and I am always in need of more support to keep this project afloat. If you would like to get additional support, add your logo or name on this README, or simply just contribute to my open source Sponsorship goal, [visit my Github Sponsors page!](https://github.com/sponsors/tannerlinsley/)
<table>
<tbody>
<tr>
<td align="center" valign="middle">
<a href="https://patreon.com/tannerlinsley" target="_blank">
<img width='200' src="https://raw.githubusercontent.com/tannerlinsley/files/master/images/patreon/platinum.png">
<a href="https://github.com/sponsors/tannerlinsley" target="_blank">
<img width='150' src="https://raw.githubusercontent.com/tannerlinsley/files/master/images/patreon/diamond.png">
</a>
</td>
<td align="center" valign="middle">
<a href="https://github.com/sponsors/tannerlinsley" target="_blank">
Become a Sponsor!
</a>
</td>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<td align="center" valign="middle">
<a href="https://github.com/sponsors/tannerlinsley/" target="_blank">
<img width='150' src="https://raw.githubusercontent.com/tannerlinsley/files/master/images/patreon/platinum.png">
</a>
</td>
<td align="center" valign="middle">
<a href="https://tryretool.com/?utm_source=sponsor&utm_campaign=react_table" target="_blank">
<img width='350' src="https://raw.githubusercontent.com/tannerlinsley/files/master/images/patreon/sponsor-retool.png">
<img width='225' src="https://raw.githubusercontent.com/tannerlinsley/files/master/images/patreon/sponsor-retool.png">
</a>
</td>
<td align="center" valign="middle">
<a href="http://bjntech.com/index.html&utm_campaign=react_table" target="_blank">
<img width='250' src="https://raw.githubusercontent.com/tannerlinsley/files/master/images/patreon/sponsor-bjn.png">
<a href="http://bjntech.com/index.html?utm_campaign=react_table" target="_blank">
<img width='225' src="https://raw.githubusercontent.com/tannerlinsley/files/master/images/patreon/sponsor-bjn.png">
</a>
</td>
<td align="center" valign="middle">
<a href="https://github.com/sponsors/tannerlinsley" target="_blank">
Become a Sponsor!
</a>
</td>
</tr>
@@ -83,18 +99,23 @@ Hooks for building **lightweight, fast and extendable datagrids** for React
<tbody>
<tr>
<td align="center" valign="middle">
<a href="https://patreon.com/tannerlinsley" target="_blank">
<img width='200' src="https://raw.githubusercontent.com/tannerlinsley/files/master/images/patreon/gold.png">
<a href="https://github.com/sponsors/tannerlinsley/" target="_blank">
<img width='150' src="https://raw.githubusercontent.com/tannerlinsley/files/master/images/patreon/gold.png">
</a>
</td>
<td align="center" valign="middle">
<a href="https://nozzle.io" target="_blank">
<img width='230' src="https://nozzle.io/img/logo-blue.png">
<img width='225' src="https://nozzle.io/img/logo-blue.png">
</a>
</td>
<td align="center" valign="middle">
<a href="https://zappi.io/web/" target="_blank">
<img width='230' src="https://raw.githubusercontent.com/tannerlinsley/files/master/images/patreon/sponsor-zappi.png">
<img width='225' src="https://raw.githubusercontent.com/tannerlinsley/files/master/images/patreon/sponsor-zappi.png">
</a>
</td>
<td align="center" valign="middle">
<a href="https://github.com/sponsors/tannerlinsley" target="_blank">
Become a Sponsor!
</a>
</td>
</tr>
@@ -105,13 +126,13 @@ Hooks for building **lightweight, fast and extendable datagrids** for React
<tbody>
<tr>
<td align="center" valign="middle">
<a href="https://patreon.com/tannerlinsley" target="_blank">
<img width='200' src="https://raw.githubusercontent.com/tannerlinsley/files/master/images/patreon/silver.png">
<a href="https://github.com/sponsors/tannerlinsley/" target="_blank">
<img width='150' src="https://raw.githubusercontent.com/tannerlinsley/files/master/images/patreon/silver.png">
</a>
</td>
<td align="center" valign="middle">
<a href="https://patreon.com/tannerlinsley" target="_blank">
<img src="https://raw.githubusercontent.com/tannerlinsley/files/master/images/patreon/silver-placeholder.png">
<a href="https://github.com/sponsors/tannerlinsley" target="_blank">
Become a Sponsor!
</a>
</td>
</tr>
@@ -122,13 +143,20 @@ Hooks for building **lightweight, fast and extendable datagrids** for React
<tbody>
<tr>
<td valign="top">
<a href="https://patreon.com/tannerlinsley">
<img width='200' src="https://raw.githubusercontent.com/tannerlinsley/files/master/images/patreon/supporters.png" />
<a href="https://github.com/sponsors/tannerlinsley/">
<img width='150' src="https://raw.githubusercontent.com/tannerlinsley/files/master/images/patreon/supporters.png" />
</a>
</td>
<td>
<div><a href="https://www.metso.com/">Pekka</a></div>
<div>Jon Eickmeier</div>
<ul>
<li>Jon Eickmeier</li>
<li><a href="https://github.com/Shah-Sahab">Syed Hussain<a></li>
</ul>
</td>
<td>
<a href="https://github.com/sponsors/tannerlinsley" target="_blank">
Become a Supporter!
</a>
</td>
</tr>
</tbody>
@@ -138,22 +166,48 @@ Hooks for building **lightweight, fast and extendable datagrids** for React
<tbody>
<tr>
<td valign="top">
<a href="https://patreon.com/tannerlinsley">
<img width='200' src="https://raw.githubusercontent.com/tannerlinsley/files/master/images/patreon/fans.png" />
<a href="https://github.com/sponsors/tannerlinsley/">
<img width='150' src="https://raw.githubusercontent.com/tannerlinsley/files/master/images/patreon/fans.png" />
</a>
</td>
<td>
<div>Sortmy.games</div>
<div>Hugo Meissner</div>
<div>Benoit Leger-Derville</div>
<div>Thomas Funk</div>
<div>Dan Houle</div>
<div>David Pickut</div>
<ul>
<li>Sortmy.games</li>
<li>Hugo Meissner</li>
<li>Benoit Leger-Derville</li>
<li>Thomas Funk</li>
<li>Dan Houle</li>
<li>David Pickut</li>
<li>Jordan Soltman</li>
<li>Robert Tajnšek</li>
<li>Pekka Tapani</li>
<li>Eric Lanehart (@pushred)</li>
<li>Anish P Patel (@anishpatelyaadada)</li>
</ul>
</td>
<td>
<a href="https://github.com/sponsors/tannerlinsley" target="_blank">
Become a Fan!
</a>
</td>
</tr>
</tbody>
</table>
<a href="https://patreon.com/tannerlinsley">
<img width="150" alt="" src="https://raw.githubusercontent.com/tannerlinsley/files/master/images/patreon/become-a-patron.png" />
</a>
### [Become a Sponsor](https://github.com/sponsors/tannerlinsley/)
## Previous Versions
### Version 6
v6 is a great library and while it is still available to install and use, I am no longer 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.
#### Where are the docs for the older v6 version?
Please [visit the v6 branch](https://github.com/tannerlinsley/react-table/tree/v6)
#### I want to migrate from v6 to v7. How do I do that?
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.
In case you would need to have both v6 and v7 in one app during the migration process (large codebase, complex use cases), you can either (1) fork and maintain your own local version of React Table v6 or (2) install the [`react-table-6` alias package](https://www.npmjs.com/package/react-table-6) for use alongside the `react-table` package.
+5
View File
@@ -0,0 +1,5 @@
# Using TypeScript with React-Table
Types for React Table are maintained externally by the Typescript community and are located at https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-table.
Because React Table is not written in Typescript and the types are not maintained by the core team, there are no guarantees around the types always being up to date or working perfectly. If this is an issue for you, please contribute to the community types and discuss solutions there.
File diff suppressed because it is too large Load Diff
@@ -1,23 +0,0 @@
{
"name": "react-table-100k-rows-aggregation",
"version": "0.0.7",
"description": null,
"keywords": [],
"main": "index.js",
"dependencies": {
"react-table": "6.5.3",
"react-dom": "15.5.3",
"react": "15.5.3",
"namor": "1.0.1",
"lodash": "4.17.4"
},
"devDependencies": {
"react-scripts": "1.0.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

@@ -1,38 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
@@ -1,52 +0,0 @@
import React from "react";
import namor from "namor";
import "./index.css";
const range = len => {
const arr = [];
for (let i = 0; i < len; i++) {
arr.push(i);
}
return arr;
};
const newPerson = () => {
const statusChance = Math.random();
return {
firstName: namor.generate({ words: 1, numbers: 0 }),
lastName: namor.generate({ words: 1, numbers: 0 }),
age: Math.floor(Math.random() * 30),
visits: Math.floor(Math.random() * 100),
progress: Math.floor(Math.random() * 100),
status:
statusChance > 0.66
? "relationship"
: statusChance > 0.33 ? "complicated" : "single"
};
};
export function makeData(len = 5553) {
return range(len).map(d => {
return {
...newPerson(),
children: range(10).map(newPerson)
};
});
}
export const Logo = () =>
<div style={{ margin: '1rem auto', display: 'flex', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'center'}}>
For more examples, visit {''}
<br />
<a href="https://github.com/react-tools/react-table" target="_blank">
<img
src="https://github.com/react-tools/media/raw/master/logo-react-table.png"
style={{ width: `150px`, margin: ".5em auto .3em" }}
/>
</a>
</div>;
export const Tips = () =>
<div style={{ textAlign: "center" }}>
<em>Tip: Hold shift when sorting to multi-sort!</em>
</div>;
@@ -1,52 +0,0 @@
// In production, we register a service worker to serve assets from local cache.
// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on the "N+1" visit to a page, since previously
// cached resources are updated in the background.
// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
// This link also includes instructions on opting out of this behavior.
export default function register() {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
window.addEventListener('load', () => {
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
navigator.serviceWorker
.register(swUrl)
.then(registration => {
// eslint-disable-next-line no-param-reassign
registration.onupdatefound = () => {
const installingWorker = registration.installing;
installingWorker.onstatechange = () => {
if (installingWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// At this point, the old content will have been purged and
// the fresh content will have been added to the cache.
// It's the perfect time to display a "New content is
// available; please refresh." message in your web app.
console.log('New content is available; please refresh.'); // eslint-disable-line no-console
} else {
// At this point, everything has been precached.
// It's the perfect time to display a
// "Content is cached for offline use." message.
console.log('Content is cached for offline use.'); // eslint-disable-line no-console
}
}
};
};
})
.catch(error => {
console.error('Error during service worker registration:', error);
});
});
}
}
export function unregister() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready.then(registration => {
registration.unregister();
});
}
}
@@ -1,5 +0,0 @@
body {
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 300;
font-size: 14px;
}
@@ -1,85 +0,0 @@
import React from "react";
import { render } from "react-dom";
import { makeData, Logo, Tips } from "./Utils";
import _ from "lodash";
// Import React Table
import ReactTable from "react-table";
import "react-table/react-table.css";
class App extends React.Component {
constructor() {
super();
this.state = {
data: makeData(100000)
};
}
render() {
const { data } = this.state;
return (
<div>
<br />
<strong>Note: Having the console open will slow performance</strong>
<br />
<br />
<ReactTable
data={data}
columns={[
{
Header: "Name",
columns: [
{
Header: "First Name",
accessor: "firstName"
},
{
Header: "Last Name",
id: "lastName",
accessor: d => d.lastName
}
]
},
{
Header: "Info",
columns: [
{
Header: "Age",
accessor: "age",
aggregate: vals => _.round(_.mean(vals)),
Aggregated: row => {
return (
<span>
{row.value} (avg)
</span>
);
}
},
{
Header: "Visits",
accessor: "visits",
aggregate: vals => _.sum(vals)
}
]
}
]}
pivotBy={["firstName", "lastName"]}
defaultPageSize={10}
className="-striped -highlight"
SubComponent={row => {
return (
<div style={{ padding: "20px" }}>
<em>Sub Component!</em>
</div>
);
}}
/>
<br />
<Tips />
<Logo />
</div>
);
}
}
render(<App />, document.getElementById("root"));
@@ -1,14 +0,0 @@
{
"name": "react-table-100k-rows-aggregation",
"version": "1.0.0",
"description": "",
"keywords": [],
"main": "index.js",
"dependencies": {
"react-table": "6.5.3",
"react-dom": "15.5.3",
"react": "15.5.3",
"namor": "1.0.1",
"lodash": "4.17.4"
}
}
File diff suppressed because it is too large Load Diff
@@ -1,28 +0,0 @@
{
"name": "react-table-cell-renderers",
"version": "0.0.12",
"description": null,
"keywords": [
"react",
"react-table",
"datagrid",
"grid",
"table"
],
"main": "index.js",
"dependencies": {
"react-table": "6.5.3",
"react-dom": "15.5.3",
"react": "15.5.3",
"namor": "1.0.1"
},
"devDependencies": {
"react-scripts": "1.0.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

@@ -1,38 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
@@ -1,52 +0,0 @@
import React from "react";
import namor from "namor";
import "./index.css";
const range = len => {
const arr = [];
for (let i = 0; i < len; i++) {
arr.push(i);
}
return arr;
};
const newPerson = () => {
const statusChance = Math.random();
return {
firstName: namor.generate({ words: 1, numbers: 0 }),
lastName: namor.generate({ words: 1, numbers: 0 }),
age: Math.floor(Math.random() * 30),
visits: Math.floor(Math.random() * 100),
progress: Math.floor(Math.random() * 100),
status:
statusChance > 0.66
? "relationship"
: statusChance > 0.33 ? "complicated" : "single"
};
};
export function makeData(len = 5553) {
return range(len).map(d => {
return {
...newPerson(),
children: range(10).map(newPerson)
};
});
}
export const Logo = () =>
<div style={{ margin: '1rem auto', display: 'flex', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'center'}}>
For more examples, visit {''}
<br />
<a href="https://github.com/react-tools/react-table" target="_blank">
<img
src="https://github.com/react-tools/media/raw/master/logo-react-table.png"
style={{ width: `150px`, margin: ".5em auto .3em" }}
/>
</a>
</div>;
export const Tips = () =>
<div style={{ textAlign: "center" }}>
<em>Tip: Hold shift when sorting to multi-sort!</em>
</div>;
@@ -1,52 +0,0 @@
// In production, we register a service worker to serve assets from local cache.
// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on the "N+1" visit to a page, since previously
// cached resources are updated in the background.
// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
// This link also includes instructions on opting out of this behavior.
export default function register() {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
window.addEventListener('load', () => {
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
navigator.serviceWorker
.register(swUrl)
.then(registration => {
// eslint-disable-next-line no-param-reassign
registration.onupdatefound = () => {
const installingWorker = registration.installing;
installingWorker.onstatechange = () => {
if (installingWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// At this point, the old content will have been purged and
// the fresh content will have been added to the cache.
// It's the perfect time to display a "New content is
// available; please refresh." message in your web app.
console.log('New content is available; please refresh.'); // eslint-disable-line no-console
} else {
// At this point, everything has been precached.
// It's the perfect time to display a
// "Content is cached for offline use." message.
console.log('Content is cached for offline use.'); // eslint-disable-line no-console
}
}
};
};
})
.catch(error => {
console.error('Error during service worker registration:', error);
});
});
}
}
export function unregister() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready.then(registration => {
registration.unregister();
});
}
}
@@ -1,5 +0,0 @@
body {
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 300;
font-size: 14px;
}
@@ -1,91 +0,0 @@
import React from "react";
import { render } from "react-dom";
import { makeData, Logo, Tips } from "./Utils";
// Import React Table
import ReactTable from "react-table";
import "react-table/react-table.css";
class App extends React.Component {
constructor() {
super();
this.state = {
data: makeData()
};
}
render() {
const { data } = this.state;
return (
<div>
<ReactTable
data={data}
columns={[{
Header: 'Name',
columns: [{
Header: 'First Name',
accessor: 'firstName'
}, {
Header: 'Last Name',
id: 'lastName',
accessor: d => d.lastName
}]
}, {
Header: 'Info',
columns: [{
Header: 'Profile Progress',
accessor: 'progress',
Cell: row => (
<div
style={{
width: '100%',
height: '100%',
backgroundColor: '#dadada',
borderRadius: '2px'
}}
>
<div
style={{
width: `${row.value}%`,
height: '100%',
backgroundColor: row.value > 66 ? '#85cc00'
: row.value > 33 ? '#ffbf00'
: '#ff2e00',
borderRadius: '2px',
transition: 'all .2s ease-out'
}}
/>
</div>
)
}, {
Header: 'Status',
accessor: 'status',
Cell: row => (
<span>
<span style={{
color: row.value === 'relationship' ? '#ff2e00'
: row.value === 'complicated' ? '#ffbf00'
: '#57d500',
transition: 'all .3s ease'
}}>
&#x25cf;
</span> {
row.value === 'relationship' ? 'In a relationship'
: row.value === 'complicated' ? `It's complicated`
: 'Single'
}
</span>
)
}]
}]}
defaultPageSize={10}
className="-striped -highlight"
/>
<br />
<Tips />
<Logo />
</div>
);
}
}
render(<App />, document.getElementById("root"));
@@ -1,19 +0,0 @@
{
"name": "react-table-cell-renderers",
"version": "1.0.0",
"description": "",
"keywords": [
"react",
"react-table",
"datagrid",
"grid",
"table"
],
"main": "index.js",
"dependencies": {
"react-table": "6.5.3",
"react-dom": "15.5.3",
"react": "15.5.3",
"namor": "1.0.1"
}
}
File diff suppressed because it is too large Load Diff
@@ -1,22 +0,0 @@
{
"name": "react-table-controlled-table",
"version": "0.0.2",
"description": null,
"keywords": [],
"main": "index.js",
"dependencies": {
"react-table": "6.5.3",
"react-dom": "15.5.3",
"react": "15.5.3",
"namor": "1.0.1"
},
"devDependencies": {
"react-scripts": "1.0.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

@@ -1,38 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
@@ -1,52 +0,0 @@
import React from "react";
import namor from "namor";
import "./index.css";
const range = len => {
const arr = [];
for (let i = 0; i < len; i++) {
arr.push(i);
}
return arr;
};
const newPerson = () => {
const statusChance = Math.random();
return {
firstName: namor.generate({ words: 1, numbers: 0 }),
lastName: namor.generate({ words: 1, numbers: 0 }),
age: Math.floor(Math.random() * 30),
visits: Math.floor(Math.random() * 100),
progress: Math.floor(Math.random() * 100),
status:
statusChance > 0.66
? "relationship"
: statusChance > 0.33 ? "complicated" : "single"
};
};
export function makeData(len = 5553) {
return range(len).map(d => {
return {
...newPerson(),
children: range(10).map(newPerson)
};
});
}
export const Logo = () =>
<div style={{ margin: '1rem auto', display: 'flex', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'center'}}>
For more examples, visit {''}
<br />
<a href="https://github.com/react-tools/react-table" target="_blank">
<img
src="https://github.com/react-tools/media/raw/master/logo-react-table.png"
style={{ width: `150px`, margin: ".5em auto .3em" }}
/>
</a>
</div>;
export const Tips = () =>
<div style={{ textAlign: "center" }}>
<em>Tip: Hold shift when sorting to multi-sort!</em>
</div>;
@@ -1,52 +0,0 @@
// In production, we register a service worker to serve assets from local cache.
// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on the "N+1" visit to a page, since previously
// cached resources are updated in the background.
// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
// This link also includes instructions on opting out of this behavior.
export default function register() {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
window.addEventListener('load', () => {
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
navigator.serviceWorker
.register(swUrl)
.then(registration => {
// eslint-disable-next-line no-param-reassign
registration.onupdatefound = () => {
const installingWorker = registration.installing;
installingWorker.onstatechange = () => {
if (installingWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// At this point, the old content will have been purged and
// the fresh content will have been added to the cache.
// It's the perfect time to display a "New content is
// available; please refresh." message in your web app.
console.log('New content is available; please refresh.'); // eslint-disable-line no-console
} else {
// At this point, everything has been precached.
// It's the perfect time to display a
// "Content is cached for offline use." message.
console.log('Content is cached for offline use.'); // eslint-disable-line no-console
}
}
};
};
})
.catch(error => {
console.error('Error during service worker registration:', error);
});
});
}
}
export function unregister() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready.then(registration => {
registration.unregister();
});
}
}
@@ -1,5 +0,0 @@
body {
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 300;
font-size: 14px;
}
@@ -1,97 +0,0 @@
import React from "react";
import { render } from "react-dom";
import { makeData, Logo, Tips } from "./Utils";
// Import React Table
import ReactTable from "react-table";
import "react-table/react-table.css";
const data = makeData()
const makeDefaultState = () => ({
sorted: [],
page: 0,
pageSize: 10,
expanded: {},
resized: [],
filtered: []
});
class App extends React.Component {
constructor() {
super();
this.state = makeDefaultState();
this.resetState = this.resetState.bind(this);
}
resetState() {
this.setState(makeDefaultState());
}
render() {
return (
<div>
<div>
<button onClick={this.resetState}>Reset State</button>
</div>
<pre>
<code>
<strong>this.state ===</strong>{" "}
{JSON.stringify(this.state, null, 2)}
</code>
</pre>
<ReactTable
data={data}
columns={[
{
Header: "Name",
columns: [
{
Header: "First Name",
accessor: "firstName"
},
{
Header: "Last Name",
id: "lastName",
accessor: d => d.lastName,
width: 170
}
]
},
{
Header: "Info",
columns: [
{
Header: "Age",
accessor: "age"
}
]
}
]}
pivotBy={["lastName"]}
filterable
defaultPageSize={10}
className="-striped -highlight"
// Controlled props
sorted={this.state.sorted}
page={this.state.page}
pageSize={this.state.pageSize}
expanded={this.state.expanded}
resized={this.state.resized}
filtered={this.state.filtered}
// Callbacks
onSortedChange={sorted => this.setState({ sorted })}
onPageChange={page => this.setState({ page })}
onPageSizeChange={(pageSize, page) =>
this.setState({ page, pageSize })}
onExpandedChange={expanded => this.setState({ expanded })}
onResizedChange={resized => this.setState({ resized })}
onFilteredChange={filtered => this.setState({ filtered })}
/>
<br />
<Tips />
<Logo />
</div>
);
}
}
render(<App />, document.getElementById("root"));
@@ -1,13 +0,0 @@
{
"name": "react-table-controlled-table",
"version": "1.0.0",
"description": "",
"keywords": [],
"main": "index.js",
"dependencies": {
"react-table": "6.5.3",
"react-dom": "15.5.3",
"react": "15.5.3",
"namor": "1.0.1"
}
}
File diff suppressed because it is too large Load Diff
@@ -1,22 +0,0 @@
{
"name": "react-table-custom-column-widths",
"version": "0.0.2",
"description": null,
"keywords": [],
"main": "index.js",
"dependencies": {
"react-table": "6.5.3",
"react-dom": "15.5.3",
"react": "15.5.3",
"namor": "1.0.1"
},
"devDependencies": {
"react-scripts": "1.0.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

@@ -1,38 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
@@ -1,52 +0,0 @@
import React from "react";
import namor from "namor";
import "./index.css";
const range = len => {
const arr = [];
for (let i = 0; i < len; i++) {
arr.push(i);
}
return arr;
};
const newPerson = () => {
const statusChance = Math.random();
return {
firstName: namor.generate({ words: 1, numbers: 0 }),
lastName: namor.generate({ words: 1, numbers: 0 }),
age: Math.floor(Math.random() * 30),
visits: Math.floor(Math.random() * 100),
progress: Math.floor(Math.random() * 100),
status:
statusChance > 0.66
? "relationship"
: statusChance > 0.33 ? "complicated" : "single"
};
};
export function makeData(len = 5553) {
return range(len).map(d => {
return {
...newPerson(),
children: range(10).map(newPerson)
};
});
}
export const Logo = () =>
<div style={{ margin: '1rem auto', display: 'flex', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'center'}}>
For more examples, visit {''}
<br />
<a href="https://github.com/react-tools/react-table" target="_blank">
<img
src="https://github.com/react-tools/media/raw/master/logo-react-table.png"
style={{ width: `150px`, margin: ".5em auto .3em" }}
/>
</a>
</div>;
export const Tips = () =>
<div style={{ textAlign: "center" }}>
<em>Tip: Hold shift when sorting to multi-sort!</em>
</div>;
@@ -1,52 +0,0 @@
// In production, we register a service worker to serve assets from local cache.
// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on the "N+1" visit to a page, since previously
// cached resources are updated in the background.
// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
// This link also includes instructions on opting out of this behavior.
export default function register() {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
window.addEventListener('load', () => {
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
navigator.serviceWorker
.register(swUrl)
.then(registration => {
// eslint-disable-next-line no-param-reassign
registration.onupdatefound = () => {
const installingWorker = registration.installing;
installingWorker.onstatechange = () => {
if (installingWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// At this point, the old content will have been purged and
// the fresh content will have been added to the cache.
// It's the perfect time to display a "New content is
// available; please refresh." message in your web app.
console.log('New content is available; please refresh.'); // eslint-disable-line no-console
} else {
// At this point, everything has been precached.
// It's the perfect time to display a
// "Content is cached for offline use." message.
console.log('Content is cached for offline use.'); // eslint-disable-line no-console
}
}
};
};
})
.catch(error => {
console.error('Error during service worker registration:', error);
});
});
}
}
export function unregister() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready.then(registration => {
registration.unregister();
});
}
}
@@ -1,5 +0,0 @@
body {
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 300;
font-size: 14px;
}
@@ -1,61 +0,0 @@
import React from "react";
import { render } from "react-dom";
import { makeData, Logo, Tips } from "./Utils";
// Import React Table
import ReactTable from "react-table";
import "react-table/react-table.css";
class App extends React.Component {
constructor() {
super();
this.state = {
data: makeData()
};
}
render() {
const { data } = this.state;
return (
<div>
<ReactTable
data={data}
columns={[
{
Header: "Name",
columns: [
{
Header: "First Name",
accessor: "firstName",
maxWidth: 200
},
{
Header: "Last Name",
id: "lastName",
accessor: d => d.lastName,
width: 300
}
]
},
{
Header: "Info",
columns: [
{
Header: "Age",
accessor: "age",
minWidth: 400
}
]
}
]}
defaultPageSize={10}
className="-striped -highlight"
/>
<br />
<Tips />
<Logo />
</div>
);
}
}
render(<App />, document.getElementById("root"));
@@ -1,13 +0,0 @@
{
"name": "react-table-custom-column-widths",
"version": "1.0.0",
"description": "",
"keywords": [],
"main": "index.js",
"dependencies": {
"react-table": "6.5.3",
"react-dom": "15.5.3",
"react": "15.5.3",
"namor": "1.0.1"
}
}
@@ -1,21 +0,0 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
/node_modules
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
File diff suppressed because it is too large Load Diff
@@ -1,22 +0,0 @@
{
"name": "react-table-custom-component-props",
"version": "0.0.3",
"description": null,
"keywords": [],
"main": "index.js",
"dependencies": {
"react-table": "6.5.3",
"react-dom": "15.5.3",
"react": "15.5.3",
"namor": "1.0.1"
},
"devDependencies": {
"react-scripts": "1.0.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

@@ -1,38 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
@@ -1,15 +0,0 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "192x192",
"type": "image/png"
}
],
"start_url": "./index.html",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
@@ -1,52 +0,0 @@
import React from "react";
import namor from "namor";
import "./index.css";
const range = len => {
const arr = [];
for (let i = 0; i < len; i++) {
arr.push(i);
}
return arr;
};
const newPerson = () => {
const statusChance = Math.random();
return {
firstName: namor.generate({ words: 1, numbers: 0 }),
lastName: namor.generate({ words: 1, numbers: 0 }),
age: Math.floor(Math.random() * 30),
visits: Math.floor(Math.random() * 100),
progress: Math.floor(Math.random() * 100),
status:
statusChance > 0.66
? "relationship"
: statusChance > 0.33 ? "complicated" : "single"
};
};
export function makeData(len = 5553) {
return range(len).map(d => {
return {
...newPerson(),
children: range(10).map(newPerson)
};
});
}
export const Logo = () =>
<div style={{ margin: '1rem auto', display: 'flex', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'center'}}>
For more examples, visit {''}
<br />
<a href="https://github.com/react-tools/react-table" target="_blank">
<img
src="https://github.com/react-tools/media/raw/master/logo-react-table.png"
style={{ width: `150px`, margin: ".5em auto .3em" }}
/>
</a>
</div>;
export const Tips = () =>
<div style={{ textAlign: "center" }}>
<em>Tip: Hold shift when sorting to multi-sort!</em>
</div>;
@@ -1,52 +0,0 @@
// In production, we register a service worker to serve assets from local cache.
// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on the "N+1" visit to a page, since previously
// cached resources are updated in the background.
// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
// This link also includes instructions on opting out of this behavior.
export default function register() {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
window.addEventListener('load', () => {
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
navigator.serviceWorker
.register(swUrl)
.then(registration => {
// eslint-disable-next-line no-param-reassign
registration.onupdatefound = () => {
const installingWorker = registration.installing;
installingWorker.onstatechange = () => {
if (installingWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// At this point, the old content will have been purged and
// the fresh content will have been added to the cache.
// It's the perfect time to display a "New content is
// available; please refresh." message in your web app.
console.log('New content is available; please refresh.'); // eslint-disable-line no-console
} else {
// At this point, everything has been precached.
// It's the perfect time to display a
// "Content is cached for offline use." message.
console.log('Content is cached for offline use.'); // eslint-disable-line no-console
}
}
};
};
})
.catch(error => {
console.error('Error during service worker registration:', error);
});
});
}
}
export function unregister() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready.then(registration => {
registration.unregister();
});
}
}
@@ -1,5 +0,0 @@
body {
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 300;
font-size: 14px;
}
@@ -1,87 +0,0 @@
import React from "react";
import { render } from "react-dom";
import { makeData, Logo, Tips } from "./Utils";
// Import React Table
import ReactTable from "react-table";
import "react-table/react-table.css";
class App extends React.Component {
constructor() {
super();
this.state = {
data: makeData()
};
}
render() {
const { data } = this.state;
return (
<div>
<br />
<strong>Open your console and hover over some cells!</strong>
<br />
<br />
<ReactTable
data={data}
columns={[
{
Header: "Name",
columns: [
{
Header: "First Name",
accessor: "firstName"
},
{
Header: "Last Name",
id: "lastName",
accessor: d => d.lastName
}
]
},
{
Header: "Info",
columns: [
{
Header: "Age",
accessor: "age"
},
{
Header: "Status",
accessor: "status"
}
]
},
{
Header: "Stats",
columns: [
{
Header: "Visits",
accessor: "visits"
}
]
}
]}
getTdProps={(state, rowInfo, column, instance) => {
return {
onMouseEnter: e =>
console.log("Cell - onMouseEnter", {
state,
rowInfo,
column,
instance,
event: e
})
};
}}
defaultPageSize={10}
className="-striped -highlight"
/>
<br />
<Tips />
<Logo />
</div>
);
}
}
render(<App />, document.getElementById("root"));
@@ -1,13 +0,0 @@
{
"name": "react-table-custom-component-props",
"version": "1.0.0",
"description": "",
"keywords": [],
"main": "index.js",
"dependencies": {
"react-table": "6.5.3",
"react-dom": "15.5.3",
"react": "15.5.3",
"namor": "1.0.1"
}
}
@@ -1,21 +0,0 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
/node_modules
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
File diff suppressed because it is too large Load Diff
@@ -1,22 +0,0 @@
{
"name": "react-table-custom-expander-position",
"version": "0.0.2",
"description": null,
"keywords": [],
"main": "index.js",
"dependencies": {
"react-table": "6.5.3",
"react-dom": "15.5.3",
"react": "15.5.3",
"namor": "1.0.1"
},
"devDependencies": {
"react-scripts": "1.0.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

@@ -1,38 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
@@ -1,15 +0,0 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "192x192",
"type": "image/png"
}
],
"start_url": "./index.html",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
@@ -1,52 +0,0 @@
import React from "react";
import namor from "namor";
import "./index.css";
const range = len => {
const arr = [];
for (let i = 0; i < len; i++) {
arr.push(i);
}
return arr;
};
const newPerson = () => {
const statusChance = Math.random();
return {
firstName: namor.generate({ words: 1, numbers: 0 }),
lastName: namor.generate({ words: 1, numbers: 0 }),
age: Math.floor(Math.random() * 30),
visits: Math.floor(Math.random() * 100),
progress: Math.floor(Math.random() * 100),
status:
statusChance > 0.66
? "relationship"
: statusChance > 0.33 ? "complicated" : "single"
};
};
export function makeData(len = 5553) {
return range(len).map(d => {
return {
...newPerson(),
children: range(10).map(newPerson)
};
});
}
export const Logo = () =>
<div style={{ margin: '1rem auto', display: 'flex', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'center'}}>
For more examples, visit {''}
<br />
<a href="https://github.com/react-tools/react-table" target="_blank">
<img
src="https://github.com/react-tools/media/raw/master/logo-react-table.png"
style={{ width: `150px`, margin: ".5em auto .3em" }}
/>
</a>
</div>;
export const Tips = () =>
<div style={{ textAlign: "center" }}>
<em>Tip: Hold shift when sorting to multi-sort!</em>
</div>;
@@ -1,52 +0,0 @@
// In production, we register a service worker to serve assets from local cache.
// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on the "N+1" visit to a page, since previously
// cached resources are updated in the background.
// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
// This link also includes instructions on opting out of this behavior.
export default function register() {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
window.addEventListener('load', () => {
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
navigator.serviceWorker
.register(swUrl)
.then(registration => {
// eslint-disable-next-line no-param-reassign
registration.onupdatefound = () => {
const installingWorker = registration.installing;
installingWorker.onstatechange = () => {
if (installingWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// At this point, the old content will have been purged and
// the fresh content will have been added to the cache.
// It's the perfect time to display a "New content is
// available; please refresh." message in your web app.
console.log('New content is available; please refresh.'); // eslint-disable-line no-console
} else {
// At this point, everything has been precached.
// It's the perfect time to display a
// "Content is cached for offline use." message.
console.log('Content is cached for offline use.'); // eslint-disable-line no-console
}
}
};
};
})
.catch(error => {
console.error('Error during service worker registration:', error);
});
});
}
}
export function unregister() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready.then(registration => {
registration.unregister();
});
}
}
@@ -1,5 +0,0 @@
body {
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 300;
font-size: 14px;
}
@@ -1,87 +0,0 @@
import React from "react";
import { render } from "react-dom";
import { makeData, Logo, Tips } from "./Utils";
// Import React Table
import ReactTable from "react-table";
import "react-table/react-table.css";
class App extends React.Component {
constructor() {
super();
this.state = {
data: makeData()
};
}
render() {
const { data } = this.state;
return (
<div>
<ReactTable
data={data}
columns={[
{
Header: "Name",
columns: [
{
Header: "First Name",
accessor: "firstName",
Footer: () =>
<div style={{ textAlign: "center" }}>First Name</div>
},
{
Header: "Last Name",
accessor: "lastName",
Footer: () =>
<div style={{ textAlign: "center" }}>Last Name</div>
}
]
},
{
Header: "Info",
columns: [
{
Header: "Age",
accessor: "age",
Footer: () => <div style={{ textAlign: "center" }}>Age</div>
}
]
},
{
Header: "Expand",
columns: [
{
expander: true,
Header: () => <strong>More</strong>,
width: 65,
Expander: ({ isExpanded, ...rest }) =>
<div>
{isExpanded
? <span>&#x2299;</span>
: <span>&#x2295;</span>}
</div>,
style: {
cursor: "pointer",
fontSize: 25,
padding: "0",
textAlign: "center",
userSelect: "none"
},
Footer: () => <span>&hearts;</span>
}
]
}
]}
defaultPageSize={10}
className="-striped -highlight"
SubComponent={() => <div style={{padding: '10px'}}>Hello</div>}
/>
<br />
<Tips />
<Logo />
</div>
);
}
}
render(<App />, document.getElementById("root"));
@@ -1,13 +0,0 @@
{
"name": "react-table-custom-expander-position",
"version": "1.0.0",
"description": "",
"keywords": [],
"main": "index.js",
"dependencies": {
"react-table": "6.5.3",
"react-dom": "15.5.3",
"react": "15.5.3",
"namor": "1.0.1"
}
}
@@ -1,21 +0,0 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
/node_modules
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
File diff suppressed because it is too large Load Diff
@@ -1,23 +0,0 @@
{
"name": "react-table-custom-filtering",
"version": "0.0.7",
"description": null,
"keywords": [],
"main": "index.js",
"dependencies": {
"react-table": "6.5.3",
"react-dom": "15.5.3",
"react": "15.5.3",
"namor": "1.0.1",
"match-sorter": "1.8.1"
},
"devDependencies": {
"react-scripts": "1.0.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

@@ -1,38 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
@@ -1,15 +0,0 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "192x192",
"type": "image/png"
}
],
"start_url": "./index.html",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
@@ -1,52 +0,0 @@
import React from "react";
import namor from "namor";
import "./index.css";
const range = len => {
const arr = [];
for (let i = 0; i < len; i++) {
arr.push(i);
}
return arr;
};
const newPerson = () => {
const statusChance = Math.random();
return {
firstName: namor.generate({ words: 1, numbers: 0 }),
lastName: namor.generate({ words: 1, numbers: 0 }),
age: Math.floor(Math.random() * 30),
visits: Math.floor(Math.random() * 100),
progress: Math.floor(Math.random() * 100),
status:
statusChance > 0.66
? "relationship"
: statusChance > 0.33 ? "complicated" : "single"
};
};
export function makeData(len = 5553) {
return range(len).map(d => {
return {
...newPerson(),
children: range(10).map(newPerson)
};
});
}
export const Logo = () =>
<div style={{ margin: '1rem auto', display: 'flex', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'center'}}>
For more examples, visit {''}
<br />
<a href="https://github.com/react-tools/react-table" target="_blank">
<img
src="https://github.com/react-tools/media/raw/master/logo-react-table.png"
style={{ width: `150px`, margin: ".5em auto .3em" }}
/>
</a>
</div>;
export const Tips = () =>
<div style={{ textAlign: "center" }}>
<em>Tip: Hold shift when sorting to multi-sort!</em>
</div>;
@@ -1,52 +0,0 @@
// In production, we register a service worker to serve assets from local cache.
// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on the "N+1" visit to a page, since previously
// cached resources are updated in the background.
// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
// This link also includes instructions on opting out of this behavior.
export default function register() {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
window.addEventListener('load', () => {
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
navigator.serviceWorker
.register(swUrl)
.then(registration => {
// eslint-disable-next-line no-param-reassign
registration.onupdatefound = () => {
const installingWorker = registration.installing;
installingWorker.onstatechange = () => {
if (installingWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// At this point, the old content will have been purged and
// the fresh content will have been added to the cache.
// It's the perfect time to display a "New content is
// available; please refresh." message in your web app.
console.log('New content is available; please refresh.'); // eslint-disable-line no-console
} else {
// At this point, everything has been precached.
// It's the perfect time to display a
// "Content is cached for offline use." message.
console.log('Content is cached for offline use.'); // eslint-disable-line no-console
}
}
};
};
})
.catch(error => {
console.error('Error during service worker registration:', error);
});
});
}
}
export function unregister() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready.then(registration => {
registration.unregister();
});
}
}
@@ -1,5 +0,0 @@
body {
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 300;
font-size: 14px;
}
@@ -1,93 +0,0 @@
import React from "react";
import { render } from "react-dom";
import { makeData, Logo, Tips } from "./Utils";
import matchSorter from 'match-sorter'
// Import React Table
import ReactTable from "react-table";
import "react-table/react-table.css";
class App extends React.Component {
constructor() {
super();
this.state = {
data: makeData()
};
}
render() {
const { data } = this.state;
return (
<div>
<ReactTable
data={data}
filterable
defaultFilterMethod={(filter, row) =>
String(row[filter.id]) === filter.value}
columns={[
{
Header: "Name",
columns: [
{
Header: "First Name",
accessor: "firstName",
filterMethod: (filter, row) =>
row[filter.id].startsWith(filter.value) &&
row[filter.id].endsWith(filter.value)
},
{
Header: "Last Name",
id: "lastName",
accessor: d => d.lastName,
filterMethod: (filter, rows) =>
matchSorter(rows, filter.value, { keys: ["lastName"] }),
filterAll: true
}
]
},
{
Header: "Info",
columns: [
{
Header: "Age",
accessor: "age"
},
{
Header: "Over 21",
accessor: "age",
id: "over",
Cell: ({ value }) => (value >= 21 ? "Yes" : "No"),
filterMethod: (filter, row) => {
if (filter.value === "all") {
return true;
}
if (filter.value === "true") {
return row[filter.id] >= 21;
}
return row[filter.id] < 21;
},
Filter: ({ filter, onChange }) =>
<select
onChange={event => onChange(event.target.value)}
style={{ width: "100%" }}
value={filter ? filter.value : "all"}
>
<option value="all">Show All</option>
<option value="true">Can Drink</option>
<option value="false">Can't Drink</option>
</select>
}
]
}
]}
defaultPageSize={10}
className="-striped -highlight"
/>
<br />
<Tips />
<Logo />
</div>
);
}
}
render(<App />, document.getElementById("root"));
@@ -1,14 +0,0 @@
{
"name": "react-table-custom-filtering",
"version": "1.0.0",
"description": "",
"keywords": [],
"main": "index.js",
"dependencies": {
"react-table": "6.5.3",
"react-dom": "15.5.3",
"react": "15.5.3",
"namor": "1.0.1",
"match-sorter": "1.8.1"
}
}
@@ -1,21 +0,0 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
/node_modules
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
File diff suppressed because it is too large Load Diff
@@ -1,22 +0,0 @@
{
"name": "react-table-custom-no-data-text",
"version": "0.0.3",
"description": null,
"keywords": [],
"main": "index.js",
"dependencies": {
"react-table": "6.5.3",
"react-dom": "15.5.3",
"react": "15.5.3",
"namor": "1.0.1"
},
"devDependencies": {
"react-scripts": "1.0.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

@@ -1,38 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
@@ -1,15 +0,0 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "192x192",
"type": "image/png"
}
],
"start_url": "./index.html",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
@@ -1,52 +0,0 @@
import React from "react";
import namor from "namor";
import "./index.css";
const range = len => {
const arr = [];
for (let i = 0; i < len; i++) {
arr.push(i);
}
return arr;
};
const newPerson = () => {
const statusChance = Math.random();
return {
firstName: namor.generate({ words: 1, numbers: 0 }),
lastName: namor.generate({ words: 1, numbers: 0 }),
age: Math.floor(Math.random() * 30),
visits: Math.floor(Math.random() * 100),
progress: Math.floor(Math.random() * 100),
status:
statusChance > 0.66
? "relationship"
: statusChance > 0.33 ? "complicated" : "single"
};
};
export function makeData(len = 5553) {
return range(len).map(d => {
return {
...newPerson(),
children: range(10).map(newPerson)
};
});
}
export const Logo = () =>
<div style={{ margin: '1rem auto', display: 'flex', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'center'}}>
For more examples, visit {''}
<br />
<a href="https://github.com/react-tools/react-table" target="_blank">
<img
src="https://github.com/react-tools/media/raw/master/logo-react-table.png"
style={{ width: `150px`, margin: ".5em auto .3em" }}
/>
</a>
</div>;
export const Tips = () =>
<div style={{ textAlign: "center" }}>
<em>Tip: Hold shift when sorting to multi-sort!</em>
</div>;
@@ -1,52 +0,0 @@
// In production, we register a service worker to serve assets from local cache.
// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on the "N+1" visit to a page, since previously
// cached resources are updated in the background.
// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
// This link also includes instructions on opting out of this behavior.
export default function register() {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
window.addEventListener('load', () => {
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
navigator.serviceWorker
.register(swUrl)
.then(registration => {
// eslint-disable-next-line no-param-reassign
registration.onupdatefound = () => {
const installingWorker = registration.installing;
installingWorker.onstatechange = () => {
if (installingWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// At this point, the old content will have been purged and
// the fresh content will have been added to the cache.
// It's the perfect time to display a "New content is
// available; please refresh." message in your web app.
console.log('New content is available; please refresh.'); // eslint-disable-line no-console
} else {
// At this point, everything has been precached.
// It's the perfect time to display a
// "Content is cached for offline use." message.
console.log('Content is cached for offline use.'); // eslint-disable-line no-console
}
}
};
};
})
.catch(error => {
console.error('Error during service worker registration:', error);
});
});
}
}
export function unregister() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready.then(registration => {
registration.unregister();
});
}
}
@@ -1,5 +0,0 @@
body {
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 300;
font-size: 14px;
}
@@ -1,65 +0,0 @@
import React from "react";
import { render } from "react-dom";
import { Logo, Tips } from "./Utils";
// Import React Table
import ReactTable from "react-table";
import "react-table/react-table.css";
class App extends React.Component {
render() {
return (
<div>
<ReactTable
data={[]}
noDataText="Oh Noes!"
columns={[
{
Header: "Name",
columns: [
{
Header: "First Name",
accessor: "firstName"
},
{
Header: "Last Name",
id: "lastName",
accessor: d => d.lastName
}
]
},
{
Header: "Info",
columns: [
{
Header: "Age",
accessor: "age"
},
{
Header: "Status",
accessor: "status"
}
]
},
{
Header: "Stats",
columns: [
{
Header: "Visits",
accessor: "visits"
}
]
}
]}
defaultPageSize={10}
className="-striped -highlight"
/>
<br />
<Tips />
<Logo />
</div>
);
}
}
render(<App />, document.getElementById("root"));
@@ -1,13 +0,0 @@
{
"name": "react-table-custom-no-data-text",
"version": "1.0.0",
"description": "",
"keywords": [],
"main": "index.js",
"dependencies": {
"react-table": "6.5.3",
"react-dom": "15.5.3",
"react": "15.5.3",
"namor": "1.0.1"
}
}
@@ -1,21 +0,0 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
/node_modules
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
File diff suppressed because it is too large Load Diff
@@ -1,22 +0,0 @@
{
"name": "react-table-custom-sorting",
"version": "0.0.2",
"description": null,
"keywords": [],
"main": "index.js",
"dependencies": {
"react-table": "6.5.3",
"react-dom": "15.5.3",
"react": "15.5.3",
"namor": "1.0.1"
},
"devDependencies": {
"react-scripts": "1.0.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

@@ -1,38 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
@@ -1,15 +0,0 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "192x192",
"type": "image/png"
}
],
"start_url": "./index.html",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
@@ -1,52 +0,0 @@
import React from "react";
import namor from "namor";
import "./index.css";
const range = len => {
const arr = [];
for (let i = 0; i < len; i++) {
arr.push(i);
}
return arr;
};
const newPerson = () => {
const statusChance = Math.random();
return {
firstName: namor.generate({ words: 1, numbers: 0 }),
lastName: namor.generate({ words: 1, numbers: 0 }),
age: Math.floor(Math.random() * 30),
visits: Math.floor(Math.random() * 100),
progress: Math.floor(Math.random() * 100),
status:
statusChance > 0.66
? "relationship"
: statusChance > 0.33 ? "complicated" : "single"
};
};
export function makeData(len = 5553) {
return range(len).map(d => {
return {
...newPerson(),
children: range(10).map(newPerson)
};
});
}
export const Logo = () =>
<div style={{ margin: '1rem auto', display: 'flex', flexWrap: 'wrap', alignItems: 'center', justifyContent: 'center'}}>
For more examples, visit {''}
<br />
<a href="https://github.com/react-tools/react-table" target="_blank">
<img
src="https://github.com/react-tools/media/raw/master/logo-react-table.png"
style={{ width: `150px`, margin: ".5em auto .3em" }}
/>
</a>
</div>;
export const Tips = () =>
<div style={{ textAlign: "center" }}>
<em>Tip: Hold shift when sorting to multi-sort!</em>
</div>;
@@ -1,52 +0,0 @@
// In production, we register a service worker to serve assets from local cache.
// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on the "N+1" visit to a page, since previously
// cached resources are updated in the background.
// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
// This link also includes instructions on opting out of this behavior.
export default function register() {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
window.addEventListener('load', () => {
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
navigator.serviceWorker
.register(swUrl)
.then(registration => {
// eslint-disable-next-line no-param-reassign
registration.onupdatefound = () => {
const installingWorker = registration.installing;
installingWorker.onstatechange = () => {
if (installingWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// At this point, the old content will have been purged and
// the fresh content will have been added to the cache.
// It's the perfect time to display a "New content is
// available; please refresh." message in your web app.
console.log('New content is available; please refresh.'); // eslint-disable-line no-console
} else {
// At this point, everything has been precached.
// It's the perfect time to display a
// "Content is cached for offline use." message.
console.log('Content is cached for offline use.'); // eslint-disable-line no-console
}
}
};
};
})
.catch(error => {
console.error('Error during service worker registration:', error);
});
});
}
}
export function unregister() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready.then(registration => {
registration.unregister();
});
}
}

Some files were not shown because too many files have changed in this diff Show More