paginator.d-CexYxFq4.d.ts 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. import * as i0 from '@angular/core';
  2. import { Optional, InjectionToken, OnInit, OnDestroy, EventEmitter } from '@angular/core';
  3. import { T as ThemePalette } from './palette.d-BSSFKjO6.js';
  4. import { Subject, Observable } from 'rxjs';
  5. import { h as MatFormFieldAppearance } from './form-field.d-CMA_QQ0R.js';
  6. /**
  7. * To modify the labels and text displayed, create a new instance of MatPaginatorIntl and
  8. * include it in a custom provider
  9. */
  10. declare class MatPaginatorIntl {
  11. /**
  12. * Stream to emit from when labels are changed. Use this to notify components when the labels have
  13. * changed after initialization.
  14. */
  15. readonly changes: Subject<void>;
  16. /** A label for the page size selector. */
  17. itemsPerPageLabel: string;
  18. /** A label for the button that increments the current page. */
  19. nextPageLabel: string;
  20. /** A label for the button that decrements the current page. */
  21. previousPageLabel: string;
  22. /** A label for the button that moves to the first page. */
  23. firstPageLabel: string;
  24. /** A label for the button that moves to the last page. */
  25. lastPageLabel: string;
  26. /** A label for the range of items within the current page and the length of the whole list. */
  27. getRangeLabel: (page: number, pageSize: number, length: number) => string;
  28. static ɵfac: i0.ɵɵFactoryDeclaration<MatPaginatorIntl, never>;
  29. static ɵprov: i0.ɵɵInjectableDeclaration<MatPaginatorIntl>;
  30. }
  31. /**
  32. * @docs-private
  33. * @deprecated No longer used, will be removed.
  34. * @breaking-change 21.0.0
  35. */
  36. declare function MAT_PAGINATOR_INTL_PROVIDER_FACTORY(parentIntl: MatPaginatorIntl): MatPaginatorIntl;
  37. /**
  38. * @docs-private
  39. * @deprecated No longer used, will be removed.
  40. * @breaking-change 21.0.0
  41. */
  42. declare const MAT_PAGINATOR_INTL_PROVIDER: {
  43. provide: typeof MatPaginatorIntl;
  44. deps: Optional[][];
  45. useFactory: typeof MAT_PAGINATOR_INTL_PROVIDER_FACTORY;
  46. };
  47. /** Object that can used to configure the underlying `MatSelect` inside a `MatPaginator`. */
  48. interface MatPaginatorSelectConfig {
  49. /** Whether to center the active option over the trigger. */
  50. disableOptionCentering?: boolean;
  51. /** Classes to be passed to the select panel. */
  52. panelClass?: string | string[] | Set<string> | {
  53. [key: string]: any;
  54. };
  55. }
  56. /**
  57. * Change event object that is emitted when the user selects a
  58. * different page size or navigates to another page.
  59. */
  60. declare class PageEvent {
  61. /** The current page index. */
  62. pageIndex: number;
  63. /**
  64. * Index of the page that was selected previously.
  65. * @breaking-change 8.0.0 To be made into a required property.
  66. */
  67. previousPageIndex?: number;
  68. /** The current page size. */
  69. pageSize: number;
  70. /** The current total number of items being paged. */
  71. length: number;
  72. }
  73. /** Object that can be used to configure the default options for the paginator module. */
  74. interface MatPaginatorDefaultOptions {
  75. /** Number of items to display on a page. By default set to 50. */
  76. pageSize?: number;
  77. /** The set of provided page size options to display to the user. */
  78. pageSizeOptions?: number[];
  79. /** Whether to hide the page size selection UI from the user. */
  80. hidePageSize?: boolean;
  81. /** Whether to show the first/last buttons UI to the user. */
  82. showFirstLastButtons?: boolean;
  83. /** The default form-field appearance to apply to the page size options selector. */
  84. formFieldAppearance?: MatFormFieldAppearance;
  85. }
  86. /** Injection token that can be used to provide the default options for the paginator module. */
  87. declare const MAT_PAGINATOR_DEFAULT_OPTIONS: InjectionToken<MatPaginatorDefaultOptions>;
  88. /**
  89. * Component to provide navigation between paged information. Displays the size of the current
  90. * page, user-selectable options to change that size, what items are being shown, and
  91. * navigational button to go to the previous or next page.
  92. */
  93. declare class MatPaginator implements OnInit, OnDestroy {
  94. _intl: MatPaginatorIntl;
  95. private _changeDetectorRef;
  96. /** If set, styles the "page size" form field with the designated style. */
  97. _formFieldAppearance?: MatFormFieldAppearance;
  98. /** ID for the DOM node containing the paginator's items per page label. */
  99. readonly _pageSizeLabelId: string;
  100. private _intlChanges;
  101. private _isInitialized;
  102. private _initializedStream;
  103. /**
  104. * Theme color of the underlying form controls. This API is supported in M2
  105. * themes only,it has no effect in M3 themes. For color customization in M3, see https://material.angular.dev/components/paginator/styling.
  106. *
  107. * For information on applying color variants in M3, see
  108. * https://material.angular.dev/guide/material-2-theming#optional-add-backwards-compatibility-styles-for-color-variants
  109. */
  110. color: ThemePalette;
  111. /** The zero-based page index of the displayed list of items. Defaulted to 0. */
  112. get pageIndex(): number;
  113. set pageIndex(value: number);
  114. private _pageIndex;
  115. /** The length of the total number of items that are being paginated. Defaulted to 0. */
  116. get length(): number;
  117. set length(value: number);
  118. private _length;
  119. /** Number of items to display on a page. By default set to 50. */
  120. get pageSize(): number;
  121. set pageSize(value: number);
  122. private _pageSize;
  123. /** The set of provided page size options to display to the user. */
  124. get pageSizeOptions(): number[];
  125. set pageSizeOptions(value: number[] | readonly number[]);
  126. private _pageSizeOptions;
  127. /** Whether to hide the page size selection UI from the user. */
  128. hidePageSize: boolean;
  129. /** Whether to show the first/last buttons UI to the user. */
  130. showFirstLastButtons: boolean;
  131. /** Used to configure the underlying `MatSelect` inside the paginator. */
  132. selectConfig: MatPaginatorSelectConfig;
  133. /** Whether the paginator is disabled. */
  134. disabled: boolean;
  135. /** Event emitted when the paginator changes the page size or page index. */
  136. readonly page: EventEmitter<PageEvent>;
  137. /** Displayed set of page size options. Will be sorted and include current page size. */
  138. _displayedPageSizeOptions: number[];
  139. /** Emits when the paginator is initialized. */
  140. initialized: Observable<void>;
  141. /** Inserted by Angular inject() migration for backwards compatibility */
  142. constructor(...args: unknown[]);
  143. ngOnInit(): void;
  144. ngOnDestroy(): void;
  145. /** Advances to the next page if it exists. */
  146. nextPage(): void;
  147. /** Move back to the previous page if it exists. */
  148. previousPage(): void;
  149. /** Move to the first page if not already there. */
  150. firstPage(): void;
  151. /** Move to the last page if not already there. */
  152. lastPage(): void;
  153. /** Whether there is a previous page. */
  154. hasPreviousPage(): boolean;
  155. /** Whether there is a next page. */
  156. hasNextPage(): boolean;
  157. /** Calculate the number of pages */
  158. getNumberOfPages(): number;
  159. /**
  160. * Changes the page size so that the first item displayed on the page will still be
  161. * displayed using the new page size.
  162. *
  163. * For example, if the page size is 10 and on the second page (items indexed 10-19) then
  164. * switching so that the page size is 5 will set the third page as the current page so
  165. * that the 10th item will still be displayed.
  166. */
  167. _changePageSize(pageSize: number): void;
  168. /** Checks whether the buttons for going forwards should be disabled. */
  169. _nextButtonsDisabled(): boolean;
  170. /** Checks whether the buttons for going backwards should be disabled. */
  171. _previousButtonsDisabled(): boolean;
  172. /**
  173. * Updates the list of page size options to display to the user. Includes making sure that
  174. * the page size is an option and that the list is sorted.
  175. */
  176. private _updateDisplayedPageSizeOptions;
  177. /** Emits an event notifying that a change of the paginator's properties has been triggered. */
  178. private _emitPageEvent;
  179. /** Navigates to a specific page index. */
  180. private _navigate;
  181. /**
  182. * Callback invoked when one of the navigation buttons is called.
  183. * @param targetIndex Index to which the paginator should navigate.
  184. * @param isDisabled Whether the button is disabled.
  185. */
  186. protected _buttonClicked(targetIndex: number, isDisabled: boolean): void;
  187. static ɵfac: i0.ɵɵFactoryDeclaration<MatPaginator, never>;
  188. static ɵcmp: i0.ɵɵComponentDeclaration<MatPaginator, "mat-paginator", ["matPaginator"], { "color": { "alias": "color"; "required": false; }; "pageIndex": { "alias": "pageIndex"; "required": false; }; "length": { "alias": "length"; "required": false; }; "pageSize": { "alias": "pageSize"; "required": false; }; "pageSizeOptions": { "alias": "pageSizeOptions"; "required": false; }; "hidePageSize": { "alias": "hidePageSize"; "required": false; }; "showFirstLastButtons": { "alias": "showFirstLastButtons"; "required": false; }; "selectConfig": { "alias": "selectConfig"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "page": "page"; }, never, never, true, never>;
  189. static ngAcceptInputType_pageIndex: unknown;
  190. static ngAcceptInputType_length: unknown;
  191. static ngAcceptInputType_pageSize: unknown;
  192. static ngAcceptInputType_hidePageSize: unknown;
  193. static ngAcceptInputType_showFirstLastButtons: unknown;
  194. static ngAcceptInputType_disabled: unknown;
  195. }
  196. export { MatPaginator as M, PageEvent as P, MAT_PAGINATOR_DEFAULT_OPTIONS as c, MatPaginatorIntl as d, MAT_PAGINATOR_INTL_PROVIDER_FACTORY as e, MAT_PAGINATOR_INTL_PROVIDER as f };
  197. export type { MatPaginatorSelectConfig as a, MatPaginatorDefaultOptions as b };