-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[material-ui][SpeedDialAction] Add slots, slotProps and deprecate tooltip* props, FabProps #45065
Conversation
Netlify deploy previewSpeedDialAction: parsed: +1.01% , gzip: +0.82% Bundle size reportDetails of bundle changes (Toolpad) |
This comment was marked as outdated.
This comment was marked as outdated.
@siriwatknp PR is ready for review |
expectedClassName: classes.fab, | ||
testWithElement: null, | ||
testWithComponent: CustomButton, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other slots are missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added tooltip
slot, but for other slots to render tooltipOpen
should be true, since SpeedDialAction
describeConference doesn't support both, I've written tests for other slots seperatly here
If you don't mind, can you do it directly in this PR? |
@@ -3,50 +3,81 @@ import findComponentDefaultProps from '../../util/findComponentDefaultProps'; | |||
import assignObject from '../../util/assignObject'; | |||
import appendAttribute from '../../util/appendAttribute'; | |||
|
|||
function moveJsxPropIntoSlotProps(j, element, propName, slotName) { | |||
function moveJsxPropIntoSlotProps(j, element, propName, slotName, slotPropName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current version of moveJsxPropIntoSlotProps
doesn't support moving a prop under specific key inside slotProps.
For example current version doesn't support below transformation
From
<SpeedDialAction tooltipPlacement='top'
/>
To
<SpeedDialAction slotProps={{tooltip:{placement:"top"}}}
/>
So i've made changes in this file to support this
Done, This PR is ready for review |
packages/mui-material/src/SpeedDialAction/SpeedDialAction.test.js
Outdated
Show resolved
Hide resolved
packages/mui-material/src/SpeedDialAction/SpeedDialAction.test.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job. Left some comments.
ping @siriwatknp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job.
part of #41281
This PR adds
fab
,tooltip
,staticTooltip
,staticTooltipLabel
slots, and deprecates tooltip* props and FabProps