Skip to content

Commit

Permalink
[Modal] Add missing members to ModalOwnProps (#37568)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivp-dev committed Jun 21, 2023
1 parent 423c9fd commit d10c8fb
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/pages/base-ui/api/modal.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
"deprecationInfo": "Use the <code>onClose</code> prop with the <code>reason</code> argument to handle the <code>backdropClick</code> events."
},
"onClose": { "type": { "name": "func" } },
"onTransitionEnter": { "type": { "name": "func" } },
"onTransitionExited": { "type": { "name": "func" } },
"slotProps": {
"type": {
"name": "shape",
Expand Down
2 changes: 2 additions & 0 deletions docs/pages/material-ui/api/modal.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
"deprecationInfo": "Use the <code>onClose</code> prop with the <code>reason</code> argument to handle the <code>backdropClick</code> events."
},
"onClose": { "type": { "name": "func" } },
"onTransitionEnter": { "type": { "name": "func" } },
"onTransitionExited": { "type": { "name": "func" } },
"slotProps": {
"type": {
"name": "shape",
Expand Down
2 changes: 2 additions & 0 deletions docs/translations/api-docs-base/modal/modal.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"keepMounted": "Always keep the children in the DOM. This prop can be useful in SEO situation or when you want to maximize the responsiveness of the Modal.",
"onBackdropClick": "Callback fired when the backdrop is clicked.",
"onClose": "Callback fired when the component requests to be closed. The <code>reason</code> parameter can optionally be used to control the response to <code>onClose</code>.<br><br><strong>Signature:</strong><br><code>function(event: object, reason: string) =&gt; void</code><br><em>event:</em> The event source of the callback.<br><em>reason:</em> Can be: <code>&quot;escapeKeyDown&quot;</code>, <code>&quot;backdropClick&quot;</code>.",
"onTransitionEnter": "A function called when a transition enters.",
"onTransitionExited": "A function called when a transition has exited.",
"open": "If <code>true</code>, the component is shown.",
"slotProps": "The props used for each slot inside the Modal.",
"slots": "The components used for each slot inside the Modal. Either a string to use a HTML element or a component. See <a href=\"#slots\">Slots API</a> below for more details."
Expand Down
2 changes: 2 additions & 0 deletions docs/translations/api-docs/modal/modal.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"keepMounted": "Always keep the children in the DOM. This prop can be useful in SEO situation or when you want to maximize the responsiveness of the Modal.",
"onBackdropClick": "Callback fired when the backdrop is clicked.",
"onClose": "Callback fired when the component requests to be closed. The <code>reason</code> parameter can optionally be used to control the response to <code>onClose</code>.<br><br><strong>Signature:</strong><br><code>function(event: object, reason: string) =&gt; void</code><br><em>event:</em> The event source of the callback.<br><em>reason:</em> Can be: <code>&quot;escapeKeyDown&quot;</code>, <code>&quot;backdropClick&quot;</code>.",
"onTransitionEnter": "A function called when a transition enters.",
"onTransitionExited": "A function called when a transition has exited.",
"open": "If <code>true</code>, the component is shown.",
"slotProps": "The props used for each slot inside the Modal.",
"slots": "The components used for each slot inside the Modal. Either a string to use a HTML element or a component.",
Expand Down
8 changes: 8 additions & 0 deletions packages/mui-base/src/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,14 @@ Modal.propTypes /* remove-proptypes */ = {
* @param {string} reason Can be: `"escapeKeyDown"`, `"backdropClick"`.
*/
onClose: PropTypes.func,
/**
* A function called when a transition enters.
*/
onTransitionEnter: PropTypes.func,
/**
* A function called when a transition has exited.
*/
onTransitionExited: PropTypes.func,
/**
* If `true`, the component is shown.
*/
Expand Down
8 changes: 8 additions & 0 deletions packages/mui-base/src/Modal/Modal.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ export interface ModalOwnProps {
onClose?: {
bivarianceHack(event: {}, reason: 'backdropClick' | 'escapeKeyDown'): void;
}['bivarianceHack'];
/**
* A function called when a transition enters.
*/
onTransitionEnter?: () => void;
/**
* A function called when a transition has exited.
*/
onTransitionExited?: () => void;
/**
* If `true`, the component is shown.
*/
Expand Down
8 changes: 8 additions & 0 deletions packages/mui-material/src/Modal/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,14 @@ Modal.propTypes /* remove-proptypes */ = {
* @param {string} reason Can be: `"escapeKeyDown"`, `"backdropClick"`.
*/
onClose: PropTypes.func,
/**
* A function called when a transition enters.
*/
onTransitionEnter: PropTypes.func,
/**
* A function called when a transition has exited.
*/
onTransitionExited: PropTypes.func,
/**
* If `true`, the component is shown.
*/
Expand Down

0 comments on commit d10c8fb

Please sign in to comment.