Skip to content
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

fix(paginator): fix select baseline; support mobile #7610

Merged
merged 3 commits into from
Oct 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 43 additions & 39 deletions src/lib/paginator/paginator.html
Original file line number Diff line number Diff line change
@@ -1,43 +1,47 @@
<div class="mat-paginator-page-size">
<div class="mat-paginator-page-size-label">
{{_intl.itemsPerPageLabel}}
</div>
<div class="mat-paginator-container">
<div class="mat-paginator-page-size">
<div class="mat-paginator-page-size-label">
{{_intl.itemsPerPageLabel}}
</div>

<mat-form-field
*ngIf="_displayedPageSizeOptions.length > 1"
class="mat-paginator-page-size-select">
<mat-select
[value]="pageSize"
[aria-label]="_intl.itemsPerPageLabel"
(change)="_changePageSize($event.value)">
<mat-option *ngFor="let pageSizeOption of _displayedPageSizeOptions" [value]="pageSizeOption">
{{pageSizeOption}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field
*ngIf="_displayedPageSizeOptions.length > 1"
class="mat-paginator-page-size-select">
<mat-select
[value]="pageSize"
[aria-label]="_intl.itemsPerPageLabel"
(change)="_changePageSize($event.value)">
<mat-option *ngFor="let pageSizeOption of _displayedPageSizeOptions" [value]="pageSizeOption">
{{pageSizeOption}}
</mat-option>
</mat-select>
</mat-form-field>

<div *ngIf="_displayedPageSizeOptions.length <= 1">{{pageSize}}</div>
</div>
<div *ngIf="_displayedPageSizeOptions.length <= 1">{{pageSize}}</div>
</div>

<div class="mat-paginator-range-label">
{{_intl.getRangeLabel(pageIndex, pageSize, length)}}
</div>
<div class="mat-paginator-range-actions">
<div class="mat-paginator-range-label">
{{_intl.getRangeLabel(pageIndex, pageSize, length)}}
</div>

<button mat-icon-button type="button"
class="mat-paginator-navigation-previous"
(click)="previousPage()"
[attr.aria-label]="_intl.previousPageLabel"
[matTooltip]="_intl.previousPageLabel"
[matTooltipPosition]="'above'"
[disabled]="!hasPreviousPage()">
<div class="mat-paginator-increment"></div>
</button>
<button mat-icon-button type="button"
class="mat-paginator-navigation-next"
(click)="nextPage()"
[attr.aria-label]="_intl.nextPageLabel"
[matTooltip]="_intl.nextPageLabel"
[matTooltipPosition]="'above'"
[disabled]="!hasNextPage()">
<div class="mat-paginator-decrement"></div>
</button>
<button mat-icon-button type="button"
class="mat-paginator-navigation-previous"
(click)="previousPage()"
[attr.aria-label]="_intl.previousPageLabel"
[matTooltip]="_intl.previousPageLabel"
[matTooltipPosition]="'above'"
[disabled]="!hasPreviousPage()">
<div class="mat-paginator-increment"></div>
</button>
<button mat-icon-button type="button"
class="mat-paginator-navigation-next"
(click)="nextPage()"
[attr.aria-label]="_intl.nextPageLabel"
[matTooltip]="_intl.nextPageLabel"
[matTooltipPosition]="'above'"
[disabled]="!hasNextPage()">
<div class="mat-paginator-decrement"></div>
</button>
</div>
</div>
20 changes: 16 additions & 4 deletions src/lib/paginator/paginator.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
$mat-paginator-height: 56px;
$mat-paginator-padding: 0 8px;

$mat-paginator-page-size-margin-right: 8px;

$mat-paginator-items-per-page-label-margin: 0 4px;
$mat-paginator-selector-margin: 0 4px;
$mat-paginator-selector-margin: 6px 4px 0 4px;
$mat-paginator-selector-trigger-min-width: 56px;

$mat-paginator-range-label-margin: 0 32px;
$mat-paginator-range-actions-min-height: 48px;

$mat-paginator-range-label-margin: 0 32px 0 24px;

$mat-paginator-button-margin: 8px;
$mat-paginator-button-icon-height: 8px;
Expand All @@ -14,17 +18,19 @@ $mat-paginator-button-icon-width: 8px;
$mat-paginator-button-decrement-icon-margin: 12px;
$mat-paginator-button-increment-icon-margin: 16px;

.mat-paginator {
.mat-paginator-container {
display: flex;
align-items: center;
justify-content: flex-end;
min-height: $mat-paginator-height;
padding: $mat-paginator-padding;
flex-wrap: wrap-reverse;
}

.mat-paginator-page-size {
display: flex;
align-items: center;
align-items: baseline;
margin-right: $mat-paginator-page-size-margin-right;
}

.mat-paginator-page-size-label {
Expand Down Expand Up @@ -76,3 +82,9 @@ $mat-paginator-button-increment-icon-margin: 16px;
margin-right: $mat-paginator-button-increment-icon-margin;
}
}

.mat-paginator-range-actions {
display: flex;
align-items: center;
min-height: $mat-paginator-range-actions-min-height;
}