From db624ee388d4bffe6992c4b76b5b60851b9e8f54 Mon Sep 17 00:00:00 2001 From: David Ballesteros Date: Thu, 9 Aug 2018 11:55:32 -0600 Subject: [PATCH 1/2] [Popover] Adding ModalClasses prop to popover component --- packages/material-ui/src/Popover/Popover.d.ts | 1 + packages/material-ui/src/Popover/Popover.js | 13 ++++++++++++- pages/api/popover.md | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/material-ui/src/Popover/Popover.d.ts b/packages/material-ui/src/Popover/Popover.d.ts index de2712c73405a9..faabdab2998a78 100644 --- a/packages/material-ui/src/Popover/Popover.d.ts +++ b/packages/material-ui/src/Popover/Popover.d.ts @@ -28,6 +28,7 @@ export interface PopoverProps getContentAnchorEl?: (element: HTMLElement) => HTMLElement; marginThreshold?: number; modal?: boolean; + ModalClasses?: ModalClassKey; PaperProps?: Partial; role?: string; transformOrigin?: PopoverOrigin; diff --git a/packages/material-ui/src/Popover/Popover.js b/packages/material-ui/src/Popover/Popover.js index 8c6689ded6ff26..514eaddc4afb90 100644 --- a/packages/material-ui/src/Popover/Popover.js +++ b/packages/material-ui/src/Popover/Popover.js @@ -278,6 +278,7 @@ class Popover extends React.Component { elevation, getContentAnchorEl, marginThreshold, + ModalClasses, onEnter, onEntered, onEntering, @@ -307,7 +308,13 @@ class Popover extends React.Component { containerProp || (anchorEl ? ownerDocument(getAnchorEl(anchorEl)).body : undefined); return ( - + elevation | number | 8 | The elevation of the popover. | | getContentAnchorEl | func |   | This function is called in order to retrieve the content anchor element. It's the opposite of the `anchorEl` property. The content anchor element should be an element inside the popover. It's used to correctly scroll and set the position of the popover. The positioning strategy tries to make the content anchor element just above the anchor element. | | marginThreshold | number | 16 | Specifies how close to the edge of the window the popover can appear. | +| ModalClasses | object |   | Override or extend the styles applied to the Modal component. See [CSS API](#css-api) below for more details. | | onClose | func |   | Callback fired when the component requests to be closed.

**Signature:**
`function(event: object) => void`
*event:* The event source of the callback. | | onEnter | func |   | Callback fired before the component is entering. | | onEntered | func |   | Callback fired when the component has entered. | From ae5ed405304fde16f0b0de2ca136efcbf316681b Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Fri, 10 Aug 2018 10:13:28 +0200 Subject: [PATCH 2/2] let's merge --- packages/material-ui/src/InputLabel/InputLabel.js | 2 +- packages/material-ui/src/Menu/Menu.js | 2 +- pages/api/input-label.md | 2 +- pages/api/menu.md | 2 +- pages/api/popover.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/material-ui/src/InputLabel/InputLabel.js b/packages/material-ui/src/InputLabel/InputLabel.js index 2a92be3c02a8b5..08fc7fa015b496 100644 --- a/packages/material-ui/src/InputLabel/InputLabel.js +++ b/packages/material-ui/src/InputLabel/InputLabel.js @@ -111,7 +111,7 @@ InputLabel.propTypes = { */ focused: PropTypes.bool, /** - * `classes` property applied to the `FormLabel` element. + * `classes` property applied to the [`FormLabel`](/api/form-label) element. */ FormLabelClasses: PropTypes.object, /** diff --git a/packages/material-ui/src/Menu/Menu.js b/packages/material-ui/src/Menu/Menu.js index 6218e65a0ac492..e24a1c2110d017 100644 --- a/packages/material-ui/src/Menu/Menu.js +++ b/packages/material-ui/src/Menu/Menu.js @@ -196,7 +196,7 @@ Menu.propTypes = { */ PaperProps: PropTypes.object, /** - * `classes` property applied to the `Popover` element. + * `classes` property applied to the [`Popover`](/api/popover) element. */ PopoverClasses: PropTypes.object, /** diff --git a/pages/api/input-label.md b/pages/api/input-label.md index 8f21612d1a086b..ce488e08b3cabc 100644 --- a/pages/api/input-label.md +++ b/pages/api/input-label.md @@ -21,7 +21,7 @@ title: InputLabel API | disabled | bool |   | If `true`, apply disabled class. | | error | bool |   | If `true`, the label will be displayed in an error state. | | focused | bool |   | If `true`, the input of this label is focused. | -| FormLabelClasses | object |   | `classes` property applied to the `FormLabel` element. | +| FormLabelClasses | object |   | `classes` property applied to the [`FormLabel`](/api/form-label) element. | | margin | enum: 'dense'
|   | If `dense`, will adjust vertical spacing. This is normally obtained via context from FormControl. | | required | bool |   | if `true`, the label will indicate that the input is required. | | shrink | bool |   | If `true`, the label is shrunk. | diff --git a/pages/api/menu.md b/pages/api/menu.md index ec799e64a74b35..552fa8b88e1234 100644 --- a/pages/api/menu.md +++ b/pages/api/menu.md @@ -28,7 +28,7 @@ title: Menu API | onExited | func |   | Callback fired when the Menu has exited. | | onExiting | func |   | Callback fired when the Menu is exiting. | | open * | bool |   | If `true`, the menu is visible. | -| PopoverClasses | object |   | `classes` property applied to the `Popover` element. | +| PopoverClasses | object |   | `classes` property applied to the [`Popover`](/api/popover) element. | | transitionDuration | union: number |
 { enter?: number, exit?: number } |
 enum: 'auto'

| 'auto' | The length of the transition in `ms`, or 'auto' | Any other properties supplied will be spread to the root element ([Popover](/api/popover)). diff --git a/pages/api/popover.md b/pages/api/popover.md index 722d6320ba20a5..73d19bb6dbd4a0 100644 --- a/pages/api/popover.md +++ b/pages/api/popover.md @@ -26,7 +26,7 @@ title: Popover API | elevation | number | 8 | The elevation of the popover. | | getContentAnchorEl | func |   | This function is called in order to retrieve the content anchor element. It's the opposite of the `anchorEl` property. The content anchor element should be an element inside the popover. It's used to correctly scroll and set the position of the popover. The positioning strategy tries to make the content anchor element just above the anchor element. | | marginThreshold | number | 16 | Specifies how close to the edge of the window the popover can appear. | -| ModalClasses | object |   | Override or extend the styles applied to the Modal component. See [CSS API](#css-api) below for more details. | +| ModalClasses | object |   | `classes` property applied to the [`Modal`](/api/modal) element. | | onClose | func |   | Callback fired when the component requests to be closed.

**Signature:**
`function(event: object) => void`
*event:* The event source of the callback. | | onEnter | func |   | Callback fired before the component is entering. | | onEntered | func |   | Callback fired when the component has entered. |