@@ -37,6 +37,7 @@ import {
37
37
CanDisableCtor ,
38
38
CanDisable ,
39
39
} from '@angular/material/core' ;
40
+ import { MatFormFieldAppearance } from '@angular/material/form-field' ;
40
41
41
42
/** The default page size if there is no page size and there are no provided page size options. */
42
43
const DEFAULT_PAGE_SIZE = 50 ;
@@ -76,6 +77,9 @@ export interface MatPaginatorDefaultOptions {
76
77
77
78
/** Whether to show the first/last buttons UI to the user. */
78
79
showFirstLastButtons ?: boolean ;
80
+
81
+ /** The default form-field appearance to apply to the page size options selector. */
82
+ formFieldAppearance ?: MatFormFieldAppearance ;
79
83
}
80
84
81
85
/** Injection token that can be used to provide the default options for the paginator module. */
@@ -172,6 +176,9 @@ export class MatPaginator extends _MatPaginatorBase implements OnInit, OnDestroy
172
176
/** Displayed set of page size options. Will be sorted and include current page size. */
173
177
_displayedPageSizeOptions : number [ ] ;
174
178
179
+ /** If set, styles the "page size" form field with the designated style. */
180
+ _formFieldAppearance ?: MatFormFieldAppearance ;
181
+
175
182
constructor ( public _intl : MatPaginatorIntl ,
176
183
private _changeDetectorRef : ChangeDetectorRef ,
177
184
@Optional ( ) @Inject ( MAT_PAGINATOR_DEFAULT_OPTIONS )
@@ -180,7 +187,13 @@ export class MatPaginator extends _MatPaginatorBase implements OnInit, OnDestroy
180
187
this . _intlChanges = _intl . changes . subscribe ( ( ) => this . _changeDetectorRef . markForCheck ( ) ) ;
181
188
182
189
if ( defaults ) {
183
- const { pageSize, pageSizeOptions, hidePageSize, showFirstLastButtons} = defaults ;
190
+ const {
191
+ pageSize,
192
+ pageSizeOptions,
193
+ hidePageSize,
194
+ showFirstLastButtons,
195
+ formFieldAppearance,
196
+ } = defaults ;
184
197
185
198
if ( pageSize != null ) {
186
199
this . _pageSize = pageSize ;
@@ -197,6 +210,10 @@ export class MatPaginator extends _MatPaginatorBase implements OnInit, OnDestroy
197
210
if ( showFirstLastButtons != null ) {
198
211
this . _showFirstLastButtons = showFirstLastButtons ;
199
212
}
213
+
214
+ if ( formFieldAppearance != null ) {
215
+ this . _formFieldAppearance = formFieldAppearance ;
216
+ }
200
217
}
201
218
}
202
219
0 commit comments