-
Notifications
You must be signed in to change notification settings - Fork 6.8k
feat(material-experimental/mdc-paginator): implement MDC-based paginator #20607
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
export declare function MAT_PAGINATOR_INTL_PROVIDER_FACTORY(parentIntl: MatPaginatorIntl): MatPaginatorIntl; | ||
|
||
export declare class MatPaginator extends _MatPaginatorBase implements OnInit, OnDestroy, CanDisable, HasInitialized { | ||
export declare abstract class _MatPaginatorBase<O extends { |
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.
These API changes are because I moved the logic into a base class.
Implements `mat-paginator` on top of MDC Web and the logic from the existing paginator. The structural styles are close to what we have in the current paginator, while the theming and typography are implemented on top of MDC's mixins. Furthermore, we're using the MDC versions of `mat-select` and `mat-button` inside the paginator. There are the following gotchas in this implementation: 1. The `mat-form-field` inside the paginator is set to always use the densest layout possible. This is necessary, because the MDC form field is too tall by default. 2. We hide one internal element from the form field, because it throws off the vertical alignment and is only used for hints and error messages which the paginator doesn't have. 3. I had to duplicate the `MatPaginatorDefaultOptions` interface, because the appearance of the MDC form field doesn't support the `legacy` and `standard` values.
71bf5a9
to
a484b85
Compare
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
Caretaker note: this isn't merge-safe since it touched the all-theme and thus needs a build file update before triggering presubmit |
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. |
Implements
mat-paginator
on top of MDC Web and the logic from the existing paginator. The structural styles are close to what we have in the current paginator, while the theming and typography are implemented on top of MDC's mixins. Furthermore, we're using the MDC versions ofmat-select
andmat-button
inside the paginator.There are the following gotchas in this implementation:
mat-form-field
inside the paginator is set to always use the densest layout possible. This is necessary, because the MDC form field is too tall by default.MatPaginatorDefaultOptions
interface, because the appearance of the MDC form field doesn't support thelegacy
andstandard
values.Note: doesn't include a test harness, because it depends on #20603. I'll make a follow-up PR to add it.