-
Notifications
You must be signed in to change notification settings - Fork 6.8k
feat(material-experimental): add MDC-based mat-option and mdc-core entry point #19557
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
Conversation
02af64c
to
1bb841e
Compare
MatOptionSelectionChange, | ||
MatOptionParentComponent, | ||
MAT_OPTION_PARENT_COMPONENT, | ||
_countGroupLabelsBeforeOption, |
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.
do we need to re-export these internal things?
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.
Yes, it's something we're reusing in mat-select
and mat-autocomplete
.
<span class="mdc-list-item__text">{{ label }} <ng-content></ng-content></span> | ||
</label> | ||
|
||
<ng-content select="mat-option, ng-container"></ng-content> |
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.
Hmm, do we include ng-container
in the existing version too? Feels kinda yucky, but I can see why we'd do that
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.
That's what we have in the current version. It's there, because sometimes people wrap multiple options in an ng-container
so they can use a single ngIf
rather than having to repeat it on each option.
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.
Yeah I figured, wish Angular could fix it somehow instead of us trying to work around it. It works in this case because we can pretty much assume we know where the user is trying to put the ng-container
, but its not always so clear
I've reworked the PR based on the feedback. |
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.
LGTM
|
||
.mat-mdc-option { | ||
// Note that we include this private mixin, because the public | ||
// one adds a bunch of styles that we aren't using for the menu. |
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.
For a follow-up: It might be good capturing things we actually need. If we come back to this in the future, we don't know what is actually needed / what the public mixin currently provides that we don't need.
…try point - Sets up the MDC-based `mat-option` and `mat-optgroup` which are a prerequisite for the MDC-based `mat-select` and `mat-autocomplete`. - Adds a new `mdc-core` entry point which is the equivalent of `material/core`. We'll need this in the future for other things like an MDC-based `mat-core-theme` and for the elevation styles.
…try point (#19557) - Sets up the MDC-based `mat-option` and `mat-optgroup` which are a prerequisite for the MDC-based `mat-select` and `mat-autocomplete`. - Adds a new `mdc-core` entry point which is the equivalent of `material/core`. We'll need this in the future for other things like an MDC-based `mat-core-theme` and for the elevation styles. (cherry picked from commit d1607cb)
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
mat-option
andmat-optgroup
which are a prerequisite for the MDC-basedmat-select
andmat-autocomplete
.mdc-core
entry point which is the equivalent ofmaterial/core
. We'll need this in the future for other things like an MDC-basedmat-core-theme
and for the elevation styles.