From c5df61def64df677ac3572990f68c037a7f8e2a1 Mon Sep 17 00:00:00 2001 From: Dakota Murphy Date: Mon, 2 Jul 2018 12:29:51 -0400 Subject: [PATCH 1/4] add expandIcon Props --- .../src/ExpansionPanelSummary/ExpansionPanelSummary.d.ts | 2 ++ .../src/ExpansionPanelSummary/ExpansionPanelSummary.js | 7 +++++++ pages/api/expansion-panel-summary.md | 1 + 3 files changed, 10 insertions(+) diff --git a/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.d.ts b/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.d.ts index 922baea5816ce1..eac5bdcd3bd402 100644 --- a/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.d.ts +++ b/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.d.ts @@ -1,12 +1,14 @@ import * as React from 'react'; import { StandardProps } from '..'; import { ButtonBaseProps } from '../ButtonBase'; +import { IconButtonProps } from '../IconButton'; export interface ExpansionPanelSummaryProps extends StandardProps { disabled?: boolean; expanded?: boolean; expandIcon?: React.ReactNode; + expandIconProps?: IconButtonProps; onChange?: React.ReactEventHandler<{}>; } diff --git a/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.js b/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.js index 73d0ea36dddca8..1c61a0bd306517 100644 --- a/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.js +++ b/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.js @@ -99,6 +99,7 @@ class ExpansionPanelSummary extends React.Component { disabled, expanded, expandIcon, + expandIconProps, onChange, ...other } = this.props; @@ -137,6 +138,7 @@ class ExpansionPanelSummary extends React.Component { component="div" tabIndex={-1} aria-hidden="true" + {...expandIconProps} > {expandIcon} @@ -174,6 +176,10 @@ ExpansionPanelSummary.propTypes = { * The icon to display as the expand indicator. */ expandIcon: PropTypes.node, + /** + * Properties to pass to the underlying IconButton component wrapping the Expand Icon + */ + expandIconProps: PropTypes.object, /** * @ignore */ @@ -186,6 +192,7 @@ ExpansionPanelSummary.propTypes = { ExpansionPanelSummary.defaultProps = { disabled: false, + expandIconProps: {} }; ExpansionPanelSummary.muiName = 'ExpansionPanelSummary'; diff --git a/pages/api/expansion-panel-summary.md b/pages/api/expansion-panel-summary.md index 0dba68a098d32e..7a2e9c472078c9 100644 --- a/pages/api/expansion-panel-summary.md +++ b/pages/api/expansion-panel-summary.md @@ -18,6 +18,7 @@ title: ExpansionPanelSummary API | children | node |   | The content of the expansion panel summary. | | classes | object |   | Override or extend the styles applied to the component. See [CSS API](#css-api) below for more details. | | expandIcon | node |   | The icon to display as the expand indicator. | +| expandIconProps | object |   | Optional props that will be passed to the underlying IconButton component wrapping the Expand Icon | Any other properties supplied will be spread to the root element ([ButtonBase](/api/button-base)). From 202ffb2cbeec6cce70fa08e48f8561e71d4b1a67 Mon Sep 17 00:00:00 2001 From: Dakota Murphy Date: Mon, 2 Jul 2018 12:49:06 -0400 Subject: [PATCH 2/4] fix lint-issues --- .../src/ExpansionPanelSummary/ExpansionPanelSummary.js | 2 +- pages/api/expansion-panel-summary.md | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.js b/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.js index 1c61a0bd306517..04488d1a45247c 100644 --- a/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.js +++ b/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.js @@ -192,7 +192,7 @@ ExpansionPanelSummary.propTypes = { ExpansionPanelSummary.defaultProps = { disabled: false, - expandIconProps: {} + expandIconProps: {}, }; ExpansionPanelSummary.muiName = 'ExpansionPanelSummary'; diff --git a/pages/api/expansion-panel-summary.md b/pages/api/expansion-panel-summary.md index 7a2e9c472078c9..0dba68a098d32e 100644 --- a/pages/api/expansion-panel-summary.md +++ b/pages/api/expansion-panel-summary.md @@ -18,7 +18,6 @@ title: ExpansionPanelSummary API | children | node |   | The content of the expansion panel summary. | | classes | object |   | Override or extend the styles applied to the component. See [CSS API](#css-api) below for more details. | | expandIcon | node |   | The icon to display as the expand indicator. | -| expandIconProps | object |   | Optional props that will be passed to the underlying IconButton component wrapping the Expand Icon | Any other properties supplied will be spread to the root element ([ButtonBase](/api/button-base)). From 24336829c450e530c862a736384b69df5dd2975f Mon Sep 17 00:00:00 2001 From: Dakota Murphy Date: Mon, 2 Jul 2018 12:55:53 -0400 Subject: [PATCH 3/4] add @ignore --- .../src/ExpansionPanelSummary/ExpansionPanelSummary.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.js b/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.js index 04488d1a45247c..fabfffa2090b52 100644 --- a/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.js +++ b/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.js @@ -177,6 +177,7 @@ ExpansionPanelSummary.propTypes = { */ expandIcon: PropTypes.node, /** + * @ignore * Properties to pass to the underlying IconButton component wrapping the Expand Icon */ expandIconProps: PropTypes.object, From dfe5301f9da42e28b2174a3e66f01a160e0c3a02 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Mon, 2 Jul 2018 21:40:39 +0200 Subject: [PATCH 4/4] rename IconButtonProps --- .../ExpansionPanelSummary/ExpansionPanelSummary.d.ts | 2 +- .../src/ExpansionPanelSummary/ExpansionPanelSummary.js | 10 ++++------ pages/api/expansion-panel-summary.md | 1 + 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.d.ts b/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.d.ts index eac5bdcd3bd402..3e34eea848d44f 100644 --- a/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.d.ts +++ b/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.d.ts @@ -8,7 +8,7 @@ export interface ExpansionPanelSummaryProps disabled?: boolean; expanded?: boolean; expandIcon?: React.ReactNode; - expandIconProps?: IconButtonProps; + IconButtonProps?: Partial; onChange?: React.ReactEventHandler<{}>; } diff --git a/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.js b/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.js index fabfffa2090b52..5f84db9f2de13f 100644 --- a/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.js +++ b/packages/material-ui/src/ExpansionPanelSummary/ExpansionPanelSummary.js @@ -99,7 +99,7 @@ class ExpansionPanelSummary extends React.Component { disabled, expanded, expandIcon, - expandIconProps, + IconButtonProps, onChange, ...other } = this.props; @@ -138,7 +138,7 @@ class ExpansionPanelSummary extends React.Component { component="div" tabIndex={-1} aria-hidden="true" - {...expandIconProps} + {...IconButtonProps} > {expandIcon} @@ -177,10 +177,9 @@ ExpansionPanelSummary.propTypes = { */ expandIcon: PropTypes.node, /** - * @ignore - * Properties to pass to the underlying IconButton component wrapping the Expand Icon + * Properties applied to the `TouchRipple` element wrapping the expand icon. */ - expandIconProps: PropTypes.object, + IconButtonProps: PropTypes.object, /** * @ignore */ @@ -193,7 +192,6 @@ ExpansionPanelSummary.propTypes = { ExpansionPanelSummary.defaultProps = { disabled: false, - expandIconProps: {}, }; ExpansionPanelSummary.muiName = 'ExpansionPanelSummary'; diff --git a/pages/api/expansion-panel-summary.md b/pages/api/expansion-panel-summary.md index 0dba68a098d32e..93b7f8b697ddcc 100644 --- a/pages/api/expansion-panel-summary.md +++ b/pages/api/expansion-panel-summary.md @@ -18,6 +18,7 @@ title: ExpansionPanelSummary API | children | node |   | The content of the expansion panel summary. | | classes | object |   | Override or extend the styles applied to the component. See [CSS API](#css-api) below for more details. | | expandIcon | node |   | The icon to display as the expand indicator. | +| IconButtonProps | object |   | Properties applied to the `TouchRipple` element wrapping the expand icon. | Any other properties supplied will be spread to the root element ([ButtonBase](/api/button-base)).