Skip to content

Commit

Permalink
virtualized sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
priley86 committed Jan 26, 2019
1 parent d04e4c0 commit b23bde8
Show file tree
Hide file tree
Showing 12 changed files with 480 additions and 62 deletions.
4 changes: 2 additions & 2 deletions packages/patternfly-4/react-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"gatsby"
],
"scripts": {
"docbuild": "node build/copyDocs.js && gatsby build",
"pr-build": "node build/copyDocs.js && gatsby build --prefix-paths",
"docbuild": "node build/copyDocs.js && node --max_old_space_size=4096 ./node_modules/.bin/gatsby build",
"pr-build": "node build/copyDocs.js && node --max_old_space_size=4096 ./node_modules/.bin/gatsby build --prefix-paths",
"develop": "gatsby develop"
},
"browserslist": [
Expand Down
11 changes: 8 additions & 3 deletions packages/patternfly-4/react-table/src/components/Table/Body.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,18 @@ class ContextBody extends React.Component {
onRow = (row, props) => {
const { onRowClick, onRow } = this.props;

// if we have a parent onRow, call it to retrieve the resulting props
const parentRowProps = onRow ? onRow(row, props) : {};
// if we have an extended onRow, call it to retrieve the resulting props
const extendedRowProps = onRow ? onRow(row, props) : {};
const rowProps = {
...props,
...row.props,
...extendedRowProps
};
return {
isExpanded: row.isExpanded,
isOpen: row.isOpen,
onClick: event => onRowClick(event, row, props),
...parentRowProps
...rowProps
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { tableExpandableRow, modifiers } from '@patternfly/patternfly-next/components/Table/table.css';
import { css } from '@patternfly/react-styles';

const RowWrapper = ({ isOpen, isExpanded, trRef, ...props }) => (
const RowWrapper = ({ isOpen, isExpanded, trRef, rowIndex, rowKey, ...props }) => (
<tr
{...props}
ref={trRef}
Expand All @@ -13,13 +13,17 @@ const RowWrapper = ({ isOpen, isExpanded, trRef, ...props }) => (
);

RowWrapper.propTypes = {
trRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.instanceOf(Element) })]),
trRef: PropTypes.object,
rowIndex: PropTypes.number,
rowKey: PropTypes.string,
isOpen: PropTypes.bool,
isExpanded: PropTypes.bool
};

RowWrapper.defaultProps = {
trRef: undefined,
rowIndex: undefined,
rowKey: undefined,
isOpen: undefined,
isExpanded: undefined
};
Expand Down
Loading

0 comments on commit b23bde8

Please sign in to comment.