From 080e82abfe5cd6a41a66702d0d06546723cab8c0 Mon Sep 17 00:00:00 2001 From: Aaron Schwartz Date: Thu, 11 May 2017 12:00:50 -0700 Subject: [PATCH] Cleanup Changelog and lint errors --- CHANGELOG.md | 30 ++++++++++++++++++++++-------- src/index.js | 14 ++++++++------ 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f96b7c8..cd37e14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,12 +6,15 @@ - `Pivot` - Custom renderer for Pivoted Cells (utilizes `Expander` and `PivotValue`) - `PivotValue` - Custom renderer for Pivot cell values (deprecates the undocumented `pivotRender` option) - `Expander` - Custom renderer for Pivot cell Expander -- Pivot Columns are now visibly separate and sorted/filtered independently. -- Custom sorting methods per instance via `defaultSortMethod` and per column via `column.sortMethod` -- Prevent transitions while column resizing for a smoother resize effect. -- You may now use `column.resizable` to restrict or allow resizing for specific columns -- Disable text selection while resizing columns. +- Added custom sorting methods per table via `defaultSortMethod` and per column via `column.sortMethod` +- Pivot columns are now visibly separate and sorted/filtered independently. +- Added `column.resizable` to override global table `resizable` option for specific columns. +- Added `column.sortable` to override global table `sortable` option for specific columns. +- Added `column.filterable` to override global table `filterable` option for specific columns. +- Added `defaultExpanded` table option. - All callbacks can now be utilized without needing to hoist and manage the piece of state they export. That is what their prop counterparts are for, so now the corresponding prop is used instead of the callback to detect a "fully controlled" state. +- Prevent transitions while column resizing for a smoother resize effect. +- Disable text selection while resizing columns. ##### Breaking API Changes @@ -23,8 +26,19 @@ - Callbacks now provide the destination state as the primary parameter(s). This makes hoisting and controlling the state in redux or component state much easier. eg. - `onSorting` no longer requires you to build your own toggle logic - `onResize` no longer requires you to build your own resize logic -- The `onChange` callback is now deprecated in favor of the better labeled `onFetchData` prop, which will always fires when a new data model needs to be fetched (or if not using `manual`, when new data is materialized internally). -- The `filtering` prop has been renamed to `filters` for simplicity and consistency. -- The `onFilteringChange` callback has been renamed to `onFilterChange` for simplicity and consistency. +- Renamed `onChange` callback -> `onFetchData` which will always fire when a new data model needs to be fetched (or if not using `manual`, when new data is materialized internally). +- Renamed `filtering` -> `filtered` +- Renamed `sorting` -> `sorted` +- Renamed `expandedRows` -> `expanded` +- Renamed `resizing` -> `resized` +- Renamed `defaultResizing` -> `defaultResized` +- Renamed `defaultFiltering` -> `defaultFiltered` +- Renamed `defaultSorting` -> `defaultSorted` +- Renamed `onSortingChange` -> `onSortedChange` +- Renamed `onFilteringChange` -> `onFilteredChange` +- Renamed `onResize` -> `onResizedChange` +- Renamed `onExpandRow` -> `onExpandedChange` +- Renamed `showFilters` -> `filterable` +- Renamed `hideFilter` -> `filterable` (Column option. Note the true/false value is now flipped.) - `cellInfo.row` and `rowInfo.row` now reference the materialize data for the table. To reference the original row, use `cellInfo.original` and `rowInfo.original` - Removed `pivotRender` column option. You can now control how the value is displayed by overriding the `PivotValueComponent` or the individual column's `PivotValue` renderer. See [Pivoting Options Story](https://react-table.js.org/?selectedKind=2.%20Demos&selectedStory=Pivoting%20Options&full=0&down=1&left=1&panelRight=0&downPanel=kadirahq%2Fstorybook-addon-actions%2Factions-panel) for a reference on how to customize pivot column rendering. diff --git a/src/index.js b/src/index.js index 4aefcc3..8b2e380 100644 --- a/src/index.js +++ b/src/index.js @@ -528,12 +528,14 @@ export default class ReactTable extends Methods(Lifecycle(Component)) { const ResolvedAggregatedComponent = column.Aggregated || (!column.aggregate ? AggregatedComponent : column.Cell) const ResolvedExpanderComponent = column.Expander || ExpanderComponent const ResolvedPivotValueComponent = column.PivotValue || PivotValueComponent - const DefaultResolvedPivotComponent = PivotComponent || (props => ( -
- - -
- )) + const DefaultResolvedPivotComponent = PivotComponent || ( + props => ( +
+ + +
+ ) + ) const ResolvedPivotComponent = column.Pivot || DefaultResolvedPivotComponent // Is this cell expandable?