@@ -37,6 +37,7 @@ import {
3737 CanDisableCtor ,
3838 CanDisable ,
3939} from '@angular/material/core' ;
40+ import { MatFormFieldAppearance } from '@angular/material/form-field' ;
4041
4142/** The default page size if there is no page size and there are no provided page size options. */
4243const DEFAULT_PAGE_SIZE = 50 ;
@@ -76,6 +77,9 @@ export interface MatPaginatorDefaultOptions {
7677
7778 /** Whether to show the first/last buttons UI to the user. */
7879 showFirstLastButtons ?: boolean ;
80+
81+ /** The default form-field appearance to apply to the page size options selector. */
82+ formFieldAppearance ?: MatFormFieldAppearance ;
7983}
8084
8185/** 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
172176 /** Displayed set of page size options. Will be sorted and include current page size. */
173177 _displayedPageSizeOptions : number [ ] ;
174178
179+ /** If set, styles the "page size" form field with the designated style. */
180+ _formFieldAppearance ?: MatFormFieldAppearance ;
181+
175182 constructor ( public _intl : MatPaginatorIntl ,
176183 private _changeDetectorRef : ChangeDetectorRef ,
177184 @Optional ( ) @Inject ( MAT_PAGINATOR_DEFAULT_OPTIONS )
@@ -180,7 +187,13 @@ export class MatPaginator extends _MatPaginatorBase implements OnInit, OnDestroy
180187 this . _intlChanges = _intl . changes . subscribe ( ( ) => this . _changeDetectorRef . markForCheck ( ) ) ;
181188
182189 if ( defaults ) {
183- const { pageSize, pageSizeOptions, hidePageSize, showFirstLastButtons} = defaults ;
190+ const {
191+ pageSize,
192+ pageSizeOptions,
193+ hidePageSize,
194+ showFirstLastButtons,
195+ formFieldAppearance,
196+ } = defaults ;
184197
185198 if ( pageSize != null ) {
186199 this . _pageSize = pageSize ;
@@ -197,6 +210,10 @@ export class MatPaginator extends _MatPaginatorBase implements OnInit, OnDestroy
197210 if ( showFirstLastButtons != null ) {
198211 this . _showFirstLastButtons = showFirstLastButtons ;
199212 }
213+
214+ if ( formFieldAppearance != null ) {
215+ this . _formFieldAppearance = formFieldAppearance ;
216+ }
200217 }
201218 }
202219
0 commit comments