Compare commits

...
4 Commits
5 changed files with 21 additions and 14 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "react-table",
"version": "6.5.0",
"version": "6.5.1",
"description": "A fast, lightweight, opinionated table and datagrid built on React",
"license": "MIT",
"homepage": "https://github.com/tannerlinsley/react-table#readme",
+9 -9
View File
@@ -171,11 +171,11 @@ export default {
rowsText: 'rows',
// Components
TableComponent: _.makeTemplateComponent('rt-table'),
TheadComponent: _.makeTemplateComponent('rt-thead'),
TbodyComponent: _.makeTemplateComponent('rt-tbody'),
TrGroupComponent: _.makeTemplateComponent('rt-tr-group'),
TrComponent: _.makeTemplateComponent('rt-tr'),
TableComponent: _.makeTemplateComponent('rt-table', 'Table'),
TheadComponent: _.makeTemplateComponent('rt-thead', 'Thead'),
TbodyComponent: _.makeTemplateComponent('rt-tbody', 'Tbody'),
TrGroupComponent: _.makeTemplateComponent('rt-tr-group', 'TrGroup'),
TrComponent: _.makeTemplateComponent('rt-tr', 'Tr'),
ThComponent: ({ toggleSort, className, children, ...rest }) => {
return (
<div
@@ -189,8 +189,8 @@ export default {
</div>
)
},
TdComponent: _.makeTemplateComponent('rt-td'),
TfootComponent: _.makeTemplateComponent('rt-tfoot'),
TdComponent: _.makeTemplateComponent('rt-td', 'Td'),
TfootComponent: _.makeTemplateComponent('rt-tfoot', 'Tfoot'),
FilterComponent: ({ filter, onChange }) =>
<input
type='text'
@@ -237,7 +237,7 @@ export default {
{loadingText}
</div>
</div>,
NoDataComponent: _.makeTemplateComponent('rt-noData'),
ResizerComponent: _.makeTemplateComponent('rt-resizer'),
NoDataComponent: _.makeTemplateComponent('rt-noData', 'NoData'),
ResizerComponent: _.makeTemplateComponent('rt-resizer', 'Resizer'),
PadRowComponent: () => <span>&nbsp;</span>,
}
+2 -1
View File
@@ -709,8 +709,9 @@ export default class ReactTable extends Methods(Lifecycle(Component)) {
width: `${width}px`,
maxWidth: `${maxWidth}px`,
}}
{...tdProps.rest}
{...interactionProps}
{...tdProps.rest}
{...columnProps.rest}
>
{resolvedCell}
</TdComponent>
+2 -1
View File
@@ -88,7 +88,8 @@ export default Base =>
this.props.collapseOnSortingChange) ||
oldState.filtered !== newResolvedState.filtered ||
oldState.showFilters !== newResolvedState.showFilters ||
(!newResolvedState.frozen &&
(oldState.sortedData &&
!newResolvedState.frozen &&
oldState.resolvedData !== newResolvedState.resolvedData &&
this.props.collapseOnDataChange)
) {
+7 -2
View File
@@ -121,11 +121,16 @@ function sum (arr) {
}, 0)
}
function makeTemplateComponent (compClass) {
return ({ children, className, ...rest }) =>
function makeTemplateComponent (compClass, displayName) {
if (!displayName) {
throw new Error('No displayName found for template component:', compClass)
}
const cmp = ({ children, className, ...rest }) =>
<div className={classnames(compClass, className)} {...rest}>
{children}
</div>
cmp.displayName = displayName
return cmp
}
function groupBy (xs, key) {