Skip to content

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

Merged
merged 1 commit into from
Sep 29, 2020

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Sep 20, 2020

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.

Note: doesn't include a test harness, because it depends on #20603. I'll make a follow-up PR to add it.

Angular_Material_-_Google_Chrome_2020-09-20_15-26-55

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Sep 20, 2020
@crisbeto crisbeto added G This is is related to a Google internal issue P2 The issue is important to a large percentage of users, with a workaround target: minor This PR is targeted for the next minor release labels Sep 20, 2020
@crisbeto crisbeto marked this pull request as ready for review September 20, 2020 13:09
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 {
Copy link
Member Author

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.
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jelbourn jelbourn added action: merge The PR is ready for merge by the caretaker merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note labels Sep 21, 2020
@jelbourn
Copy link
Member

Caretaker note: this isn't merge-safe since it touched the all-theme and thus needs a build file update before triggering presubmit

@mmalerba mmalerba merged commit d87ae3c into angular:master Sep 29, 2020
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement G This is is related to a Google internal issue merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note P2 The issue is important to a large percentage of users, with a workaround target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants