Commit Graph

305 Commits

Author SHA1 Message Date
Hugo Bove
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
gargroh
83ee60d715 [useTable] Manage layout to honor column's show property (#1594) 2019-10-14 09:24:05 -06:00
Andrey Ivlev
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
4842bc061d fix: fix includeAll filter type, add filteredRows 2019-10-07 10:27:18 -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
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
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
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 Bove
69e13b87c3 feat(useexpanded, usepagination): omit subRows from rows (#1562)
Added useExpanded 'expandSubRows' option
2019-10-02 06:51:14 -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
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
gargroh
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
5f0e7cab8b fix: fix colspan prop to use column visibility
Fixes #1555
2019-09-30 07:31:43 -06:00
tannerlinsley
f552c94972 fix(usepagination): fix unstable callbacks
Closes #1549
2019-09-26 13:21:34 -06:00
tannerlinsley
dfad9151c3 fix(expandedrows): fix in-page row expansion for paginateExpandedRows 2019-09-13 07:33:53 -06:00
Codar
aea76facf1 isAllRowsSelected can only be true if there are rows. (#1504) 2019-09-09 08:49:40 -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
tannerlinsley
072967b771 fix: fix defaultColumn.sortType, fix useGroupBy plugin order warning 2019-09-05 11:07:25 -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
tannerlinsley
bb8b10ca64 Merge branch 'master' of https://github.com/react-tools/react-table 2019-08-28 10:51:10 -06:00
gargroh
8742ce39c2 [useSort] Provide API to clear sorting at column level (#1476)
* [useSort] Provide API to clear sorting at column level

* updated docs
2019-08-28 10:51:04 -06:00
tannerlinsley
0486c5c787 fix: fix column-ordering example 2019-08-28 10:50:33 -06:00
tannerlinsley
b0d6169848 feat: added useColumnOrder + examples 2019-08-27 09:59:52 -06:00
tannerlinsley
abe723a87d fix: fix header group and header placeholder IDs 2019-08-27 07:11:01 -06:00
tannerlinsley
f0293f5511 fix: getRowID instead of getRowPathID 2019-08-26 09:38:14 -06:00
tannerlinsley
3b42c72e7c fix: better naming, fix header regen, getSubRows, getRowPathID 2019-08-26 09:27:07 -06:00
tannerlinsley
4665006109 fix(use-row-select): fix selection issue casued by wrong startsWith key 2019-08-23 09:24:36 -06:00
tannerlinsley
4537f28a8d fix: fix header regeneration and colspan, better sorting 2019-08-22 14:46:33 -06:00
tannerlinsley
785b524d3c fix: removed useFlexLayout, fixed dot notation for accessors 2019-08-20 12:55:50 -06:00
tannerlinsley
aab49949db fix: rename some booleans to use 'is' prefix, added new logo 2019-08-20 09:31:11 -06:00
tannerlinsley
4a45cd6574 Merge branch 'master' of https://github.com/react-tools/react-table 2019-08-19 16:41:49 -06:00
tannerlinsley
f59efde6fe fix: fix path getters, better plugin hook integration, renaming things 2019-08-19 16:38:42 -06:00
Domenuch
64e9d91e3c Allow row generator to listen for column changes (#1442)
* added column dependency to row generator memo listeners

* added assertion to stop an infinite loop inside usePagination
2019-08-19 15:00:33 -06:00
Codar
af37eead5b Sub rows are selected if the parent row is selected. (#1444)
* Sub rows are selected if the parent row is selected.

* Parent rows are updated accordingly if a subRow is selected.

* Updated useRowSelect snapshot tests to test subRow selection.
2019-08-18 17:40:02 -06:00
Paweł Dąbrowski
3f0bb0a0dd fix(use-sort-by): sorting now ignores column ids that no longer exist (#1454)
* fix(use-sort-by): sorting now ignores column ids that no longer exist

* fix(use-filters): filtering no longer fails when column doesn't exist

* fix(use-sortby): filtering out invalid sortBys before sorting
2019-08-16 09:14:30 -06:00
tannerlinsley
40884e9a44 style: lock prettier version, fix sorting example 2019-08-16 07:20:52 -06:00
tannerlinsley
98466e6414 docs(docs): improve docs 2019-08-15 15:32:03 -06:00
tannerlinsley
d9a4b6bd85 refactor: improve renderer function ergonomics
The renderer function for headers, columns, cells, aggregates, filters, etc used to mix properties
from all of those contexts, including rows. Now thow contexts are located on their own reserved
properties, eg. `Cell: ({ cell: { value}, row, column, ...instance }) => value`

BREAKING CHANGE: The renderer function for headers, columns, cells, aggregates, filters, etc used
2019-08-15 14:16:52 -06:00
tannerlinsley
d50ec588bc fix(use-pagination): fixed use pagination pageIndex bug
Use pagination will no longer synchronously reset the pageIndex to 0 on mount
2019-08-15 09:55:22 -06:00
tannerlinsley
f9242f604d fix(usesortby): fix usesortby merge regression 2019-08-15 09:04:07 -06:00
Eugene Krevenets
59f6a768a7 improve(use-table): use single instance of defaultColumn property (#1451)
in case of using construction like:
```
{
  defaultColumn = {}
}
```
`defaultColumn` will get new instance each time, so as result it force to recalculation each of `React.useMemo`.
2019-08-15 08:58:42 -06:00
Maximilian Brandau
bcd0da7379 fix: update colSpan (#1447)
Only count visible columns for determining the colSpan

fix #1446
2019-08-15 08:57:22 -06:00
tannerlinsley
696edacd48 fix(use-flex-layout): fix flex layout hook to use new internal hooks 2019-08-15 08:36:33 -06:00
Eugene Krevenets
c77ffacdc9 improve(sort): don't sort subrows less than 2 characters (#1449)
it improves performance because cuts a lot of sorting manipulations
2019-08-15 08:11:12 -06:00
gargroh
d4303a2468 [v7] useSort - Multisort functionality: Limit max cols and optional shift key (#1433)
* [v7] useSort - Multisort functionality: Limit `multiSort` number and configurable shift key

1. Provide configuration for multisort that pressing shift key is not compulsory

2. Configurable limit on max number of columns for multisort, like configuration has been provided that `maxMultiSortColCount` is 3, suppose currenlty table is sorted by `[A, B, C]` and then clicking `D` for sorting should result in table sorted by `[B, C , D]`

* update readme for new multisort options

* Use `isMultiSortEvent` function 

so as to make `shift` key optional or take decision based on other parameters for multisorting

* `isMultiSortEvent` updated readme
2019-08-14 10:47:02 -06:00
tannerlinsley
a667b7cb13 fix(use-pagination): better controlled/manual use-pagination 2019-08-06 22:32:17 -06:00
tannerlinsley
5145a632c9 Merge branch 'master' of https://github.com/react-tools/react-table 2019-08-06 20:01:11 -06:00