react-flexigrid
Version:
A React table component designed to allow presenting millions of rows of data.
56 lines (48 loc) • 2.99 kB
JavaScript
import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
import { shallowEqual } from './utils';
export function shouldUpdateHeader(oldProps, nextProps) {
var a = oldProps.leftFixedColumns,
b = oldProps.scrollableColumns,
c = oldProps.rightFixedColumns,
d = oldProps.leftFixedLeafColumns,
e = oldProps.scrollableLeafColumns,
f = oldProps.rightFixedLeafColumns,
g = oldProps.leftFixedColumnsWidth,
h = oldProps.scrollableColumnsWidth,
i = oldProps.rightFixedColumnsWidth,
j = oldProps.scrollableColumnsToRender,
k = oldProps.scrollableLeafColumnsToRender,
oldOtherProps = _objectWithoutProperties(oldProps, ['leftFixedColumns', 'scrollableColumns', 'rightFixedColumns', 'leftFixedLeafColumns', 'scrollableLeafColumns', 'rightFixedLeafColumns', 'leftFixedColumnsWidth', 'scrollableColumnsWidth', 'rightFixedColumnsWidth', 'scrollableColumnsToRender', 'scrollableLeafColumnsToRender']);
var leftFixedColumns = nextProps.leftFixedColumns,
scrollableColumns = nextProps.scrollableColumns,
rightFixedColumns = nextProps.rightFixedColumns,
leftFixedLeafColumns = nextProps.leftFixedLeafColumns,
scrollableLeafColumns = nextProps.scrollableLeafColumns,
rightFixedLeafColumns = nextProps.rightFixedLeafColumns,
leftFixedColumnsWidth = nextProps.leftFixedColumnsWidth,
scrollableColumnsWidth = nextProps.scrollableColumnsWidth,
rightFixedColumnsWidth = nextProps.rightFixedColumnsWidth,
scrollableColumnsToRender = nextProps.scrollableColumnsToRender,
scrollableLeafColumnsToRender = nextProps.scrollableLeafColumnsToRender,
nextOtherProps = _objectWithoutProperties(nextProps, ['leftFixedColumns', 'scrollableColumns', 'rightFixedColumns', 'leftFixedLeafColumns', 'scrollableLeafColumns', 'rightFixedLeafColumns', 'leftFixedColumnsWidth', 'scrollableColumnsWidth', 'rightFixedColumnsWidth', 'scrollableColumnsToRender', 'scrollableLeafColumnsToRender']);
return !shallowEqual(oldOtherProps, nextOtherProps);
}
export function shouldUpdateBody(oldProps, nextProps) {
return shouldUpdateHeader(oldProps, nextProps);
}
export function shouldUpdateRow(oldProps, nextProps) {
return shouldUpdateHeader(oldProps, nextProps);
}
export function shouldUpdateCellGroup(oldProps, nextProps) {
var a = oldProps.columns,
b = oldProps.leafColumns,
c = oldProps.columnsToRender,
d = oldProps.leafColumnsToRender,
oldOtherProps = _objectWithoutProperties(oldProps, ['columns', 'leafColumns', 'columnsToRender', 'leafColumnsToRender']);
var columns = nextProps.columns,
leafColumns = nextProps.leafColumns,
columnsToRender = nextProps.columnsToRender,
leafColumnsToRender = nextProps.leafColumnsToRender,
nextOtherProps = _objectWithoutProperties(nextProps, ['columns', 'leafColumns', 'columnsToRender', 'leafColumnsToRender']);
return !shallowEqual(oldOtherProps, nextOtherProps);
}