Skip to content

Commit 2d43e39

Browse files
committed
comments
1 parent 212979e commit 2d43e39

File tree

5 files changed

+18
-14
lines changed

5 files changed

+18
-14
lines changed

src/lib/paginator/_paginator-theme.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
$foreground: map-get($theme, foreground);
88

99
.mat-paginator,
10-
.mat-paginator-page-length-select .mat-select-trigger {
10+
.mat-paginator-page-size .mat-select-trigger {
1111
color: mat-color($foreground, secondary-text);
1212
}
1313

@@ -33,7 +33,7 @@
3333
}
3434
}
3535

36-
.mat-paginator-page-length-select .mat-select-trigger {
36+
.mat-paginator-page-size .mat-select-trigger {
3737
font: {
3838
family: mat-font-family($config);
3939
size: mat-font-size($config, caption);

src/lib/paginator/paginator.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
<div class="mat-paginator-page-length-select">
2-
<div class="mat-paginator-items-per-page-label">
1+
<div class="mat-paginator-page-size">
2+
<div class="mat-paginator-page-size-label">
33
{{_intl.itemsPerPageLabel}}
44
</div>
55

66
<md-select *ngIf="_displayedPageSizeOptions.length > 1"
7+
class="mat-paginator-page-size-select"
78
[ngModel]="pageSize"
89
[aria-label]="_intl.itemsPerPageLabel"
910
(change)="_changePageSize($event.value)">

src/lib/paginator/paginator.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,20 @@
44

55
### Basic use
66
Each paginator instance requires:
7-
* The current page index
87
* The number of items per page
98
* The total number of items being paged
109

10+
The current page index defaults to 0, but can be explicitly set via pageIndex.
11+
1112
When the user interacts with the paginator, a `PageEvent` will be fired that can be used to update
1213
any associated data view.
1314

1415
### Page size options
1516
The paginator displays a dropdown of page sizes for the user to choose from. The options for this
1617
dropdown can be set via `pageSizeOptions`
1718

19+
The current pageSize will always appear in the dropdown, even if it is not included in pageSizeOptions.
20+
1821
### Internationalization
1922
The labels for the paginator can be customized by providing your own instance of `MdPaginatorIntl`.
2023
This will allow you to change the following:

src/lib/paginator/paginator.scss

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ $mat-paginator-button-increment-icon-margin: 16px;
2222
padding: $mat-paginator-padding;
2323
}
2424

25-
.mat-paginator-items-per-page-label {
26-
margin: $mat-paginator-items-per-page-label-margin;
27-
}
28-
29-
.mat-paginator-page-length-select {
25+
.mat-paginator-page-size {
3026
display: flex;
3127
align-items: center;
28+
}
3229

33-
.mat-select {
34-
margin: $mat-paginator-selector-margin;
35-
}
30+
.mat-paginator-page-size-label {
31+
margin: $mat-paginator-items-per-page-label-margin;
32+
}
33+
34+
.mat-paginator-page-size-select {
35+
margin: $mat-paginator-selector-margin;
3636

3737
.mat-select-trigger {
3838
min-width: $mat-paginator-selector-trigger-min-width;

src/lib/paginator/paginator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export class MdPaginator implements OnInit {
6363
this._pageSize = pageSize;
6464
this._updateDisplayedPageSizeOptions();
6565
}
66-
private _pageSize: number;
66+
private _pageSize: number = 0;
6767

6868
/** The set of provided page size options to display to the user. */
6969
@Input()

0 commit comments

Comments
 (0)