Skip to content

Commit a16e8e2

Browse files
Merge pull request #116 from nselikoff/aggregator-controls
Expose aggregator outlet to allow rendering additional content in aggregatorCell
2 parents 33c77e9 + 1216b41 commit a16e8e2

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"test:jest": "jest",
2626
"test": "npm run test:eslint && npm run test:prettier && npm run test:jest",
2727
"clean": "rm -rf __tests__ PivotTable.js* PivotTableUI.js* PlotlyRenderers.js* TableRenderers.js* Utilities.js* pivottable.css",
28-
"doPublish": "npm run clean && cp src/pivottable.css . && babel src --out-dir=. --source-maps --presets=env,react --plugins babel-plugin-add-module-exports && npm publish",
28+
"build": "npm run clean && cp src/pivottable.css . && babel src --out-dir=. --source-maps --presets=env,react --plugins babel-plugin-add-module-exports",
29+
"doPublish": "npm run build && npm publish",
2930
"postpublish": "npm run clean",
3031
"deploy": "webpack -p && mv bundle.js examples && cd examples && git init && git add . && git commit -m build && git push --force [email protected]:plotly/react-pivottable.git master:gh-pages && rm -rf .git bundle.js"
3132
},

src/PivotTableUI.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,10 @@ class PivotTableUI extends React.PureComponent {
375375
const numValsAllowed =
376376
this.props.aggregators[this.props.aggregatorName]([])().numInputs || 0;
377377

378+
const aggregatorCellOutlet = this.props.aggregators[
379+
this.props.aggregatorName
380+
]([])().outlet;
381+
378382
const rendererName =
379383
this.props.rendererName in this.props.renderers
380384
? this.props.rendererName
@@ -468,6 +472,7 @@ class PivotTableUI extends React.PureComponent {
468472
/>,
469473
i + 1 !== numValsAllowed ? <br key={`br${i}`} /> : null,
470474
])}
475+
{aggregatorCellOutlet && aggregatorCellOutlet(this.props.data)}
471476
</td>
472477
);
473478

0 commit comments

Comments
 (0)