| 107 | imports: [MatFormField, MatSelect, MatOption, MatIconButton, MatTooltip], |
| 108 | }) |
| 109 | export class MatPaginator implements OnInit, OnDestroy { |
| 110 | _intl = inject(MatPaginatorIntl); |
| 111 | private _changeDetectorRef = inject(ChangeDetectorRef); |
| 112 | |
| 113 | /** If set, styles the "page size" form field with the designated style. */ |
| 114 | _formFieldAppearance?: MatFormFieldAppearance; |
| 115 | |
| 116 | /** ID for the DOM node containing the paginator's items per page label. */ |
| 117 | readonly _pageSizeLabelId = inject(_IdGenerator).getId('mat-paginator-page-size-label-'); |
| 118 | |
| 119 | private _intlChanges: Subscription; |
| 120 | private _isInitialized = false; |
| 121 | private _initializedStream = new ReplaySubject<void>(1); |
| 122 | |
| 123 | /** |
| 124 | * Theme color of the underlying form controls. This API is supported in M2 |
| 125 | * themes only,it has no effect in M3 themes. For color customization in M3, see https://material.angular.dev/components/paginator/styling. |
| 126 | * |
| 127 | * For information on applying color variants in M3, see |
| 128 | * https://material.angular.dev/guide/material-2-theming#optional-add-backwards-compatibility-styles-for-color-variants |
| 129 | */ |
| 130 | @Input() color: ThemePalette; |
| 131 | |
| 132 | /** The zero-based page index of the displayed list of items. Defaulted to 0. */ |
| 133 | @Input({transform: numberAttribute}) |
| 134 | get pageIndex(): number { |
| 135 | return this._pageIndex; |
| 136 | } |
| 137 | set pageIndex(value: number) { |
| 138 | this._pageIndex = Math.max(value || 0, 0); |
| 139 | this._changeDetectorRef.markForCheck(); |
| 140 | } |
| 141 | private _pageIndex = 0; |
| 142 | |
| 143 | /** The length of the total number of items that are being paginated. Defaulted to 0. */ |
| 144 | @Input({transform: numberAttribute}) |
| 145 | get length(): number { |
| 146 | return this._length; |
| 147 | } |
| 148 | set length(value: number) { |
| 149 | this._length = value || 0; |
| 150 | this._changeDetectorRef.markForCheck(); |
| 151 | } |
| 152 | private _length = 0; |
| 153 | |
| 154 | /** Number of items to display on a page. By default set to 50. */ |
| 155 | @Input({transform: numberAttribute}) |
| 156 | get pageSize(): number { |
| 157 | return this._pageSize; |
| 158 | } |
| 159 | set pageSize(value: number) { |
| 160 | this._pageSize = Math.max(value || 0, 0); |
| 161 | this._updateDisplayedPageSizeOptions(); |
| 162 | } |
| 163 | private _pageSize!: number; |
| 164 | |
| 165 | /** The set of provided page size options to display to the user. */ |
| 166 | @Input() |