Skip to content

Commit

Permalink
Merge branch 'master' of github.com:apxor/react-cohort-graph
Browse files Browse the repository at this point in the history
  • Loading branch information
arajajyothibabu committed Nov 4, 2018
2 parents a2d8e45 + 4291cb2 commit d46bdc6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
9 changes: 5 additions & 4 deletions lib/reactcohortgraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -2775,6 +2775,7 @@ var ReactCohortGraph = function (_React$Component) {
customEmptyDataMessage = _props2.customEmptyDataMessage,
labelFormatter = _props2.labelFormatter,
headerFormatter = _props2.headerFormatter,
showHeaderValues = _props2.showHeaderValues,
_props2$bodyCellStyle = _props2.bodyCellStyles,
bodyCellStyles = _props2$bodyCellStyle === undefined ? {} : _props2$bodyCellStyle,
_props2$headerCellSty = _props2.headerCellStyles,
Expand Down Expand Up @@ -2829,7 +2830,7 @@ var ReactCohortGraph = function (_React$Component) {
'div',
{ style: TableHeadingStyles },
header.map(function (headerCell, i) {
return _this2.isFixed(i) && _react2.default.createElement(_components.HeaderCell, _extends({ tableCellStyles: tableCellStyles, headerLabelStyles: headerLabelStyles, style: headerCellStyles, key: "header" + i }, headerCell, { headerFormatter: headerFormatter, valueType: valueType }));
return _this2.isFixed(i) && _react2.default.createElement(_components.HeaderCell, _extends({ tableCellStyles: tableCellStyles, headerLabelStyles: headerLabelStyles, style: headerCellStyles, key: "header" + i }, headerCell, { headerFormatter: headerFormatter, showHeaderValues: showHeaderValues, valueType: valueType }));
})
),
_react2.default.createElement(
Expand Down Expand Up @@ -2860,7 +2861,7 @@ var ReactCohortGraph = function (_React$Component) {
'div',
{ style: TableHeadingStyles },
header.map(function (headerCell, i) {
return !_this2.isFixed(i) && _react2.default.createElement(_components.HeaderCell, _extends({ tableCellStyles: tableCellStyles, style: headerCellStyles, key: "header" + i }, headerCell, { headerFormatter: headerFormatter, valueType: valueType }));
return !_this2.isFixed(i) && _react2.default.createElement(_components.HeaderCell, _extends({ tableCellStyles: tableCellStyles, style: headerCellStyles, key: "header" + i }, headerCell, { headerFormatter: headerFormatter, showHeaderValues: showHeaderValues, valueType: valueType }));
})
),
_react2.default.createElement(
Expand Down Expand Up @@ -3447,11 +3448,11 @@ var HeaderCell = exports.HeaderCell = function HeaderCell(props) {
{ style: (0, _styles.headerLabel)(props.headerLabelStyles) },
renderHeader(props)
),
_react2.default.createElement(
props.showHeaderValues ? _react2.default.createElement(
'span',
{ style: (0, _styles.headerValue)({}) },
renderValue(props)
)
) : null
);
};

Expand Down
2 changes: 1 addition & 1 deletion lib/reactcohortgraph.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/ReactCohortGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class ReactCohortGraph extends React.Component {

render(){
const {
showEmptyDataMessage = true, customEmptyDataMessage, labelFormatter, headerFormatter,
showEmptyDataMessage = true, customEmptyDataMessage, labelFormatter, headerFormatter, showHeaderValues,
bodyCellStyles = {}, headerCellStyles = {},
tableStyles, tableRowStyles, tableHeadingStyles,
tableBodyStyles, fixedTablePartStyles, wrapperStyles,
Expand Down Expand Up @@ -132,7 +132,7 @@ class ReactCohortGraph extends React.Component {
<div style={TableHeadingStyles}>
{
header.map((headerCell, i) =>
this.isFixed(i) && <HeaderCell tableCellStyles={tableCellStyles} headerLabelStyles={headerLabelStyles} style={headerCellStyles} key={"header" + i} {...headerCell} headerFormatter={headerFormatter} valueType={valueType} />
this.isFixed(i) && <HeaderCell tableCellStyles={tableCellStyles} headerLabelStyles={headerLabelStyles} style={headerCellStyles} key={"header" + i} {...headerCell} headerFormatter={headerFormatter} showHeaderValues={showHeaderValues} valueType={valueType} />
)
}
</div>
Expand All @@ -157,7 +157,7 @@ class ReactCohortGraph extends React.Component {
<div style={TableHeadingStyles}>
{
header.map((headerCell, i) =>
!this.isFixed(i) && <HeaderCell tableCellStyles={tableCellStyles} style={headerCellStyles} key={"header" + i} {...headerCell} headerFormatter={headerFormatter} valueType={valueType} />
!this.isFixed(i) && <HeaderCell tableCellStyles={tableCellStyles} style={headerCellStyles} key={"header" + i} {...headerCell} headerFormatter={headerFormatter} showHeaderValues={showHeaderValues} valueType={valueType} />
)
}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const renderHeader = props => {
export const HeaderCell = (props) => (
<div style={{...tableCell(props.tableCellStyles), backgroundColor: props.color, ...props.style}}>
<p style={headerLabel(props.headerLabelStyles)}>{renderHeader(props)}</p>
<span style={headerValue({})}>{renderValue(props)}</span>
{props.showHeaderValues ? (<span style={headerValue({})}>{renderValue(props)}</span>) : null}
</div>
);

Expand Down

0 comments on commit d46bdc6

Please sign in to comment.