paginator.mjs 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. import * as i0 from '@angular/core';
  2. import { Injectable, Optional, SkipSelf, InjectionToken, inject, ChangeDetectorRef, numberAttribute, EventEmitter, booleanAttribute, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, NgModule } from '@angular/core';
  3. import { Subject, ReplaySubject } from 'rxjs';
  4. import { _IdGenerator } from '@angular/cdk/a11y';
  5. import { j as MatFormField } from './form-field-DqPi4knt.mjs';
  6. import { g as MatSelect, M as MatSelectModule } from './module-Cbt8Fcmv.mjs';
  7. import { e as MatTooltip, h as MatTooltipModule } from './module-C9K6ZqpI.mjs';
  8. import { M as MatOption } from './option-ChV6uQgD.mjs';
  9. import { M as MatIconButton } from './icon-button-D1J0zeqv.mjs';
  10. import { MatButtonModule } from './button.mjs';
  11. import '@angular/cdk/bidi';
  12. import '@angular/cdk/coercion';
  13. import '@angular/cdk/platform';
  14. import '@angular/common';
  15. import 'rxjs/operators';
  16. import '@angular/cdk/observers/private';
  17. import '@angular/cdk/overlay';
  18. import '@angular/cdk/scrolling';
  19. import '@angular/cdk/collections';
  20. import '@angular/cdk/keycodes';
  21. import '@angular/forms';
  22. import './error-options-Dm2JJUbF.mjs';
  23. import './error-state-Dtb1IHM-.mjs';
  24. import './index-DOxJc1m4.mjs';
  25. import './index-SYVYjXwK.mjs';
  26. import './common-module-WayjW0Pb.mjs';
  27. import './ripple-BT3tzh6F.mjs';
  28. import '@angular/cdk/private';
  29. import './pseudo-checkbox-module-CAX2sutq.mjs';
  30. import './pseudo-checkbox-CJ7seqQH.mjs';
  31. import './module-BXZhw7pQ.mjs';
  32. import '@angular/cdk/observers';
  33. import '@angular/cdk/portal';
  34. import './structural-styles-BQUT6wsL.mjs';
  35. import './ripple-loader-Ce3DAhPW.mjs';
  36. /**
  37. * To modify the labels and text displayed, create a new instance of MatPaginatorIntl and
  38. * include it in a custom provider
  39. */
  40. class MatPaginatorIntl {
  41. /**
  42. * Stream to emit from when labels are changed. Use this to notify components when the labels have
  43. * changed after initialization.
  44. */
  45. changes = new Subject();
  46. /** A label for the page size selector. */
  47. itemsPerPageLabel = 'Items per page:';
  48. /** A label for the button that increments the current page. */
  49. nextPageLabel = 'Next page';
  50. /** A label for the button that decrements the current page. */
  51. previousPageLabel = 'Previous page';
  52. /** A label for the button that moves to the first page. */
  53. firstPageLabel = 'First page';
  54. /** A label for the button that moves to the last page. */
  55. lastPageLabel = 'Last page';
  56. /** A label for the range of items within the current page and the length of the whole list. */
  57. getRangeLabel = (page, pageSize, length) => {
  58. if (length == 0 || pageSize == 0) {
  59. return `0 of ${length}`;
  60. }
  61. length = Math.max(length, 0);
  62. const startIndex = page * pageSize;
  63. // If the start index exceeds the list length, do not try and fix the end index to the end.
  64. const endIndex = startIndex < length ? Math.min(startIndex + pageSize, length) : startIndex + pageSize;
  65. return `${startIndex + 1} – ${endIndex} of ${length}`;
  66. };
  67. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatPaginatorIntl, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
  68. static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatPaginatorIntl, providedIn: 'root' });
  69. }
  70. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatPaginatorIntl, decorators: [{
  71. type: Injectable,
  72. args: [{ providedIn: 'root' }]
  73. }] });
  74. /**
  75. * @docs-private
  76. * @deprecated No longer used, will be removed.
  77. * @breaking-change 21.0.0
  78. */
  79. function MAT_PAGINATOR_INTL_PROVIDER_FACTORY(parentIntl) {
  80. return parentIntl || new MatPaginatorIntl();
  81. }
  82. /**
  83. * @docs-private
  84. * @deprecated No longer used, will be removed.
  85. * @breaking-change 21.0.0
  86. */
  87. const MAT_PAGINATOR_INTL_PROVIDER = {
  88. // If there is already an MatPaginatorIntl available, use that. Otherwise, provide a new one.
  89. provide: MatPaginatorIntl,
  90. deps: [[new Optional(), new SkipSelf(), MatPaginatorIntl]],
  91. useFactory: MAT_PAGINATOR_INTL_PROVIDER_FACTORY,
  92. };
  93. /** The default page size if there is no page size and there are no provided page size options. */
  94. const DEFAULT_PAGE_SIZE = 50;
  95. /**
  96. * Change event object that is emitted when the user selects a
  97. * different page size or navigates to another page.
  98. */
  99. class PageEvent {
  100. /** The current page index. */
  101. pageIndex;
  102. /**
  103. * Index of the page that was selected previously.
  104. * @breaking-change 8.0.0 To be made into a required property.
  105. */
  106. previousPageIndex;
  107. /** The current page size. */
  108. pageSize;
  109. /** The current total number of items being paged. */
  110. length;
  111. }
  112. /** Injection token that can be used to provide the default options for the paginator module. */
  113. const MAT_PAGINATOR_DEFAULT_OPTIONS = new InjectionToken('MAT_PAGINATOR_DEFAULT_OPTIONS');
  114. /**
  115. * Component to provide navigation between paged information. Displays the size of the current
  116. * page, user-selectable options to change that size, what items are being shown, and
  117. * navigational button to go to the previous or next page.
  118. */
  119. class MatPaginator {
  120. _intl = inject(MatPaginatorIntl);
  121. _changeDetectorRef = inject(ChangeDetectorRef);
  122. /** If set, styles the "page size" form field with the designated style. */
  123. _formFieldAppearance;
  124. /** ID for the DOM node containing the paginator's items per page label. */
  125. _pageSizeLabelId = inject(_IdGenerator).getId('mat-paginator-page-size-label-');
  126. _intlChanges;
  127. _isInitialized = false;
  128. _initializedStream = new ReplaySubject(1);
  129. /**
  130. * Theme color of the underlying form controls. This API is supported in M2
  131. * themes only,it has no effect in M3 themes. For color customization in M3, see https://material.angular.dev/components/paginator/styling.
  132. *
  133. * For information on applying color variants in M3, see
  134. * https://material.angular.dev/guide/material-2-theming#optional-add-backwards-compatibility-styles-for-color-variants
  135. */
  136. color;
  137. /** The zero-based page index of the displayed list of items. Defaulted to 0. */
  138. get pageIndex() {
  139. return this._pageIndex;
  140. }
  141. set pageIndex(value) {
  142. this._pageIndex = Math.max(value || 0, 0);
  143. this._changeDetectorRef.markForCheck();
  144. }
  145. _pageIndex = 0;
  146. /** The length of the total number of items that are being paginated. Defaulted to 0. */
  147. get length() {
  148. return this._length;
  149. }
  150. set length(value) {
  151. this._length = value || 0;
  152. this._changeDetectorRef.markForCheck();
  153. }
  154. _length = 0;
  155. /** Number of items to display on a page. By default set to 50. */
  156. get pageSize() {
  157. return this._pageSize;
  158. }
  159. set pageSize(value) {
  160. this._pageSize = Math.max(value || 0, 0);
  161. this._updateDisplayedPageSizeOptions();
  162. }
  163. _pageSize;
  164. /** The set of provided page size options to display to the user. */
  165. get pageSizeOptions() {
  166. return this._pageSizeOptions;
  167. }
  168. set pageSizeOptions(value) {
  169. this._pageSizeOptions = (value || []).map(p => numberAttribute(p, 0));
  170. this._updateDisplayedPageSizeOptions();
  171. }
  172. _pageSizeOptions = [];
  173. /** Whether to hide the page size selection UI from the user. */
  174. hidePageSize = false;
  175. /** Whether to show the first/last buttons UI to the user. */
  176. showFirstLastButtons = false;
  177. /** Used to configure the underlying `MatSelect` inside the paginator. */
  178. selectConfig = {};
  179. /** Whether the paginator is disabled. */
  180. disabled = false;
  181. /** Event emitted when the paginator changes the page size or page index. */
  182. page = new EventEmitter();
  183. /** Displayed set of page size options. Will be sorted and include current page size. */
  184. _displayedPageSizeOptions;
  185. /** Emits when the paginator is initialized. */
  186. initialized = this._initializedStream;
  187. constructor() {
  188. const _intl = this._intl;
  189. const defaults = inject(MAT_PAGINATOR_DEFAULT_OPTIONS, {
  190. optional: true,
  191. });
  192. this._intlChanges = _intl.changes.subscribe(() => this._changeDetectorRef.markForCheck());
  193. if (defaults) {
  194. const { pageSize, pageSizeOptions, hidePageSize, showFirstLastButtons } = defaults;
  195. if (pageSize != null) {
  196. this._pageSize = pageSize;
  197. }
  198. if (pageSizeOptions != null) {
  199. this._pageSizeOptions = pageSizeOptions;
  200. }
  201. if (hidePageSize != null) {
  202. this.hidePageSize = hidePageSize;
  203. }
  204. if (showFirstLastButtons != null) {
  205. this.showFirstLastButtons = showFirstLastButtons;
  206. }
  207. }
  208. this._formFieldAppearance = defaults?.formFieldAppearance || 'outline';
  209. }
  210. ngOnInit() {
  211. this._isInitialized = true;
  212. this._updateDisplayedPageSizeOptions();
  213. this._initializedStream.next();
  214. }
  215. ngOnDestroy() {
  216. this._initializedStream.complete();
  217. this._intlChanges.unsubscribe();
  218. }
  219. /** Advances to the next page if it exists. */
  220. nextPage() {
  221. if (this.hasNextPage()) {
  222. this._navigate(this.pageIndex + 1);
  223. }
  224. }
  225. /** Move back to the previous page if it exists. */
  226. previousPage() {
  227. if (this.hasPreviousPage()) {
  228. this._navigate(this.pageIndex - 1);
  229. }
  230. }
  231. /** Move to the first page if not already there. */
  232. firstPage() {
  233. // hasPreviousPage being false implies at the start
  234. if (this.hasPreviousPage()) {
  235. this._navigate(0);
  236. }
  237. }
  238. /** Move to the last page if not already there. */
  239. lastPage() {
  240. // hasNextPage being false implies at the end
  241. if (this.hasNextPage()) {
  242. this._navigate(this.getNumberOfPages() - 1);
  243. }
  244. }
  245. /** Whether there is a previous page. */
  246. hasPreviousPage() {
  247. return this.pageIndex >= 1 && this.pageSize != 0;
  248. }
  249. /** Whether there is a next page. */
  250. hasNextPage() {
  251. const maxPageIndex = this.getNumberOfPages() - 1;
  252. return this.pageIndex < maxPageIndex && this.pageSize != 0;
  253. }
  254. /** Calculate the number of pages */
  255. getNumberOfPages() {
  256. if (!this.pageSize) {
  257. return 0;
  258. }
  259. return Math.ceil(this.length / this.pageSize);
  260. }
  261. /**
  262. * Changes the page size so that the first item displayed on the page will still be
  263. * displayed using the new page size.
  264. *
  265. * For example, if the page size is 10 and on the second page (items indexed 10-19) then
  266. * switching so that the page size is 5 will set the third page as the current page so
  267. * that the 10th item will still be displayed.
  268. */
  269. _changePageSize(pageSize) {
  270. // Current page needs to be updated to reflect the new page size. Navigate to the page
  271. // containing the previous page's first item.
  272. const startIndex = this.pageIndex * this.pageSize;
  273. const previousPageIndex = this.pageIndex;
  274. this.pageIndex = Math.floor(startIndex / pageSize) || 0;
  275. this.pageSize = pageSize;
  276. this._emitPageEvent(previousPageIndex);
  277. }
  278. /** Checks whether the buttons for going forwards should be disabled. */
  279. _nextButtonsDisabled() {
  280. return this.disabled || !this.hasNextPage();
  281. }
  282. /** Checks whether the buttons for going backwards should be disabled. */
  283. _previousButtonsDisabled() {
  284. return this.disabled || !this.hasPreviousPage();
  285. }
  286. /**
  287. * Updates the list of page size options to display to the user. Includes making sure that
  288. * the page size is an option and that the list is sorted.
  289. */
  290. _updateDisplayedPageSizeOptions() {
  291. if (!this._isInitialized) {
  292. return;
  293. }
  294. // If no page size is provided, use the first page size option or the default page size.
  295. if (!this.pageSize) {
  296. this._pageSize =
  297. this.pageSizeOptions.length != 0 ? this.pageSizeOptions[0] : DEFAULT_PAGE_SIZE;
  298. }
  299. this._displayedPageSizeOptions = this.pageSizeOptions.slice();
  300. if (this._displayedPageSizeOptions.indexOf(this.pageSize) === -1) {
  301. this._displayedPageSizeOptions.push(this.pageSize);
  302. }
  303. // Sort the numbers using a number-specific sort function.
  304. this._displayedPageSizeOptions.sort((a, b) => a - b);
  305. this._changeDetectorRef.markForCheck();
  306. }
  307. /** Emits an event notifying that a change of the paginator's properties has been triggered. */
  308. _emitPageEvent(previousPageIndex) {
  309. this.page.emit({
  310. previousPageIndex,
  311. pageIndex: this.pageIndex,
  312. pageSize: this.pageSize,
  313. length: this.length,
  314. });
  315. }
  316. /** Navigates to a specific page index. */
  317. _navigate(index) {
  318. const previousIndex = this.pageIndex;
  319. if (index !== previousIndex) {
  320. this.pageIndex = index;
  321. this._emitPageEvent(previousIndex);
  322. }
  323. }
  324. /**
  325. * Callback invoked when one of the navigation buttons is called.
  326. * @param targetIndex Index to which the paginator should navigate.
  327. * @param isDisabled Whether the button is disabled.
  328. */
  329. _buttonClicked(targetIndex, isDisabled) {
  330. // Note that normally disabled buttons won't dispatch the click event, but the paginator ones
  331. // do, because we're using `disabledInteractive` to allow them to be focusable. We need to
  332. // check here to avoid the navigation.
  333. if (!isDisabled) {
  334. this._navigate(targetIndex);
  335. }
  336. }
  337. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatPaginator, deps: [], target: i0.ɵɵFactoryTarget.Component });
  338. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.6", type: MatPaginator, isStandalone: true, selector: "mat-paginator", inputs: { color: "color", pageIndex: ["pageIndex", "pageIndex", numberAttribute], length: ["length", "length", numberAttribute], pageSize: ["pageSize", "pageSize", numberAttribute], pageSizeOptions: "pageSizeOptions", hidePageSize: ["hidePageSize", "hidePageSize", booleanAttribute], showFirstLastButtons: ["showFirstLastButtons", "showFirstLastButtons", booleanAttribute], selectConfig: "selectConfig", disabled: ["disabled", "disabled", booleanAttribute] }, outputs: { page: "page" }, host: { attributes: { "role": "group" }, classAttribute: "mat-mdc-paginator" }, exportAs: ["matPaginator"], ngImport: i0, template: "<div class=\"mat-mdc-paginator-outer-container\">\n <div class=\"mat-mdc-paginator-container\">\n @if (!hidePageSize) {\n <div class=\"mat-mdc-paginator-page-size\">\n <div class=\"mat-mdc-paginator-page-size-label\" [attr.id]=\"_pageSizeLabelId\">\n {{_intl.itemsPerPageLabel}}\n </div>\n\n @if (_displayedPageSizeOptions.length > 1) {\n <mat-form-field\n [appearance]=\"_formFieldAppearance!\"\n [color]=\"color\"\n class=\"mat-mdc-paginator-page-size-select\">\n <mat-select\n #selectRef\n [value]=\"pageSize\"\n [disabled]=\"disabled\"\n [aria-labelledby]=\"_pageSizeLabelId\"\n [panelClass]=\"selectConfig.panelClass || ''\"\n [disableOptionCentering]=\"selectConfig.disableOptionCentering\"\n (selectionChange)=\"_changePageSize($event.value)\"\n hideSingleSelectionIndicator>\n @for (pageSizeOption of _displayedPageSizeOptions; track pageSizeOption) {\n <mat-option [value]=\"pageSizeOption\">\n {{pageSizeOption}}\n </mat-option>\n }\n </mat-select>\n <div class=\"mat-mdc-paginator-touch-target\" (click)=\"selectRef.open()\"></div>\n </mat-form-field>\n }\n\n @if (_displayedPageSizeOptions.length <= 1) {\n <div class=\"mat-mdc-paginator-page-size-value\">{{pageSize}}</div>\n }\n </div>\n }\n\n <div class=\"mat-mdc-paginator-range-actions\">\n <div class=\"mat-mdc-paginator-range-label\" aria-live=\"polite\">\n {{_intl.getRangeLabel(pageIndex, pageSize, length)}}\n </div>\n\n <!--\n The buttons use `disabledInteractive` so that they can retain focus if they become disabled,\n otherwise focus is moved to the document body. However, users should not be able to navigate\n into these buttons, so `tabindex` is set to -1 when disabled.\n -->\n\n @if (showFirstLastButtons) {\n <button mat-icon-button type=\"button\"\n class=\"mat-mdc-paginator-navigation-first\"\n (click)=\"_buttonClicked(0, _previousButtonsDisabled())\"\n [attr.aria-label]=\"_intl.firstPageLabel\"\n [matTooltip]=\"_intl.firstPageLabel\"\n [matTooltipDisabled]=\"_previousButtonsDisabled()\"\n matTooltipPosition=\"above\"\n [disabled]=\"_previousButtonsDisabled()\"\n [tabindex]=\"_previousButtonsDisabled() ? -1 : null\"\n disabledInteractive>\n <svg class=\"mat-mdc-paginator-icon\"\n viewBox=\"0 0 24 24\"\n focusable=\"false\"\n aria-hidden=\"true\">\n <path d=\"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z\"/>\n </svg>\n </button>\n }\n <button mat-icon-button type=\"button\"\n class=\"mat-mdc-paginator-navigation-previous\"\n (click)=\"_buttonClicked(pageIndex - 1, _previousButtonsDisabled())\"\n [attr.aria-label]=\"_intl.previousPageLabel\"\n [matTooltip]=\"_intl.previousPageLabel\"\n [matTooltipDisabled]=\"_previousButtonsDisabled()\"\n matTooltipPosition=\"above\"\n [disabled]=\"_previousButtonsDisabled()\"\n [tabindex]=\"_previousButtonsDisabled() ? -1 : null\"\n disabledInteractive>\n <svg class=\"mat-mdc-paginator-icon\"\n viewBox=\"0 0 24 24\"\n focusable=\"false\"\n aria-hidden=\"true\">\n <path d=\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\"/>\n </svg>\n </button>\n <button mat-icon-button type=\"button\"\n class=\"mat-mdc-paginator-navigation-next\"\n (click)=\"_buttonClicked(pageIndex + 1, _nextButtonsDisabled())\"\n [attr.aria-label]=\"_intl.nextPageLabel\"\n [matTooltip]=\"_intl.nextPageLabel\"\n [matTooltipDisabled]=\"_nextButtonsDisabled()\"\n matTooltipPosition=\"above\"\n [disabled]=\"_nextButtonsDisabled()\"\n [tabindex]=\"_nextButtonsDisabled() ? -1 : null\"\n disabledInteractive>\n <svg class=\"mat-mdc-paginator-icon\"\n viewBox=\"0 0 24 24\"\n focusable=\"false\"\n aria-hidden=\"true\">\n <path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"/>\n </svg>\n </button>\n @if (showFirstLastButtons) {\n <button mat-icon-button type=\"button\"\n class=\"mat-mdc-paginator-navigation-last\"\n (click)=\"_buttonClicked(getNumberOfPages() - 1, _nextButtonsDisabled())\"\n [attr.aria-label]=\"_intl.lastPageLabel\"\n [matTooltip]=\"_intl.lastPageLabel\"\n [matTooltipDisabled]=\"_nextButtonsDisabled()\"\n matTooltipPosition=\"above\"\n [disabled]=\"_nextButtonsDisabled()\"\n [tabindex]=\"_nextButtonsDisabled() ? -1 : null\"\n disabledInteractive>\n <svg class=\"mat-mdc-paginator-icon\"\n viewBox=\"0 0 24 24\"\n focusable=\"false\"\n aria-hidden=\"true\">\n <path d=\"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z\"/>\n </svg>\n </button>\n }\n </div>\n </div>\n</div>\n", styles: [".mat-mdc-paginator{display:block;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-paginator-container-text-color, var(--mat-sys-on-surface));background-color:var(--mat-paginator-container-background-color, var(--mat-sys-surface));font-family:var(--mat-paginator-container-text-font, var(--mat-sys-body-small-font));line-height:var(--mat-paginator-container-text-line-height, var(--mat-sys-body-small-line-height));font-size:var(--mat-paginator-container-text-size, var(--mat-sys-body-small-size));font-weight:var(--mat-paginator-container-text-weight, var(--mat-sys-body-small-weight));letter-spacing:var(--mat-paginator-container-text-tracking, var(--mat-sys-body-small-tracking));--mat-form-field-container-height:var(--mat-paginator-form-field-container-height, 40px);--mat-form-field-container-vertical-padding:var(--mat-paginator-form-field-container-vertical-padding, 8px)}.mat-mdc-paginator .mat-mdc-select-value{font-size:var(--mat-paginator-select-trigger-text-size, var(--mat-sys-body-small-size))}.mat-mdc-paginator .mat-mdc-form-field-subscript-wrapper{display:none}.mat-mdc-paginator .mat-mdc-select{line-height:1.5}.mat-mdc-paginator-outer-container{display:flex}.mat-mdc-paginator-container{display:flex;align-items:center;justify-content:flex-end;padding:0 8px;flex-wrap:wrap;width:100%;min-height:var(--mat-paginator-container-size, 56px)}.mat-mdc-paginator-page-size{display:flex;align-items:baseline;margin-right:8px}[dir=rtl] .mat-mdc-paginator-page-size{margin-right:0;margin-left:8px}.mat-mdc-paginator-page-size-label{margin:0 4px}.mat-mdc-paginator-page-size-select{margin:0 4px;width:84px}.mat-mdc-paginator-range-label{margin:0 32px 0 24px}.mat-mdc-paginator-range-actions{display:flex;align-items:center}.mat-mdc-paginator-icon{display:inline-block;width:28px;fill:var(--mat-paginator-enabled-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-icon-button[aria-disabled] .mat-mdc-paginator-icon{fill:var(--mat-paginator-disabled-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}[dir=rtl] .mat-mdc-paginator-icon{transform:rotate(180deg)}@media(forced-colors: active){.mat-mdc-icon-button[aria-disabled] .mat-mdc-paginator-icon,.mat-mdc-paginator-icon{fill:currentColor}.mat-mdc-paginator-range-actions .mat-mdc-icon-button{outline:solid 1px}.mat-mdc-paginator-range-actions .mat-mdc-icon-button[aria-disabled]{color:GrayText}}.mat-mdc-paginator-touch-target{display:var(--mat-paginator-touch-target-display, block);position:absolute;top:50%;left:50%;width:84px;height:48px;background-color:rgba(0,0,0,0);transform:translate(-50%, -50%);cursor:pointer}\n"], dependencies: [{ kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "component", type: MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "directive", type: MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  339. }
  340. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatPaginator, decorators: [{
  341. type: Component,
  342. args: [{ selector: 'mat-paginator', exportAs: 'matPaginator', host: {
  343. 'class': 'mat-mdc-paginator',
  344. 'role': 'group',
  345. }, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [MatFormField, MatSelect, MatOption, MatIconButton, MatTooltip], template: "<div class=\"mat-mdc-paginator-outer-container\">\n <div class=\"mat-mdc-paginator-container\">\n @if (!hidePageSize) {\n <div class=\"mat-mdc-paginator-page-size\">\n <div class=\"mat-mdc-paginator-page-size-label\" [attr.id]=\"_pageSizeLabelId\">\n {{_intl.itemsPerPageLabel}}\n </div>\n\n @if (_displayedPageSizeOptions.length > 1) {\n <mat-form-field\n [appearance]=\"_formFieldAppearance!\"\n [color]=\"color\"\n class=\"mat-mdc-paginator-page-size-select\">\n <mat-select\n #selectRef\n [value]=\"pageSize\"\n [disabled]=\"disabled\"\n [aria-labelledby]=\"_pageSizeLabelId\"\n [panelClass]=\"selectConfig.panelClass || ''\"\n [disableOptionCentering]=\"selectConfig.disableOptionCentering\"\n (selectionChange)=\"_changePageSize($event.value)\"\n hideSingleSelectionIndicator>\n @for (pageSizeOption of _displayedPageSizeOptions; track pageSizeOption) {\n <mat-option [value]=\"pageSizeOption\">\n {{pageSizeOption}}\n </mat-option>\n }\n </mat-select>\n <div class=\"mat-mdc-paginator-touch-target\" (click)=\"selectRef.open()\"></div>\n </mat-form-field>\n }\n\n @if (_displayedPageSizeOptions.length <= 1) {\n <div class=\"mat-mdc-paginator-page-size-value\">{{pageSize}}</div>\n }\n </div>\n }\n\n <div class=\"mat-mdc-paginator-range-actions\">\n <div class=\"mat-mdc-paginator-range-label\" aria-live=\"polite\">\n {{_intl.getRangeLabel(pageIndex, pageSize, length)}}\n </div>\n\n <!--\n The buttons use `disabledInteractive` so that they can retain focus if they become disabled,\n otherwise focus is moved to the document body. However, users should not be able to navigate\n into these buttons, so `tabindex` is set to -1 when disabled.\n -->\n\n @if (showFirstLastButtons) {\n <button mat-icon-button type=\"button\"\n class=\"mat-mdc-paginator-navigation-first\"\n (click)=\"_buttonClicked(0, _previousButtonsDisabled())\"\n [attr.aria-label]=\"_intl.firstPageLabel\"\n [matTooltip]=\"_intl.firstPageLabel\"\n [matTooltipDisabled]=\"_previousButtonsDisabled()\"\n matTooltipPosition=\"above\"\n [disabled]=\"_previousButtonsDisabled()\"\n [tabindex]=\"_previousButtonsDisabled() ? -1 : null\"\n disabledInteractive>\n <svg class=\"mat-mdc-paginator-icon\"\n viewBox=\"0 0 24 24\"\n focusable=\"false\"\n aria-hidden=\"true\">\n <path d=\"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z\"/>\n </svg>\n </button>\n }\n <button mat-icon-button type=\"button\"\n class=\"mat-mdc-paginator-navigation-previous\"\n (click)=\"_buttonClicked(pageIndex - 1, _previousButtonsDisabled())\"\n [attr.aria-label]=\"_intl.previousPageLabel\"\n [matTooltip]=\"_intl.previousPageLabel\"\n [matTooltipDisabled]=\"_previousButtonsDisabled()\"\n matTooltipPosition=\"above\"\n [disabled]=\"_previousButtonsDisabled()\"\n [tabindex]=\"_previousButtonsDisabled() ? -1 : null\"\n disabledInteractive>\n <svg class=\"mat-mdc-paginator-icon\"\n viewBox=\"0 0 24 24\"\n focusable=\"false\"\n aria-hidden=\"true\">\n <path d=\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\"/>\n </svg>\n </button>\n <button mat-icon-button type=\"button\"\n class=\"mat-mdc-paginator-navigation-next\"\n (click)=\"_buttonClicked(pageIndex + 1, _nextButtonsDisabled())\"\n [attr.aria-label]=\"_intl.nextPageLabel\"\n [matTooltip]=\"_intl.nextPageLabel\"\n [matTooltipDisabled]=\"_nextButtonsDisabled()\"\n matTooltipPosition=\"above\"\n [disabled]=\"_nextButtonsDisabled()\"\n [tabindex]=\"_nextButtonsDisabled() ? -1 : null\"\n disabledInteractive>\n <svg class=\"mat-mdc-paginator-icon\"\n viewBox=\"0 0 24 24\"\n focusable=\"false\"\n aria-hidden=\"true\">\n <path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"/>\n </svg>\n </button>\n @if (showFirstLastButtons) {\n <button mat-icon-button type=\"button\"\n class=\"mat-mdc-paginator-navigation-last\"\n (click)=\"_buttonClicked(getNumberOfPages() - 1, _nextButtonsDisabled())\"\n [attr.aria-label]=\"_intl.lastPageLabel\"\n [matTooltip]=\"_intl.lastPageLabel\"\n [matTooltipDisabled]=\"_nextButtonsDisabled()\"\n matTooltipPosition=\"above\"\n [disabled]=\"_nextButtonsDisabled()\"\n [tabindex]=\"_nextButtonsDisabled() ? -1 : null\"\n disabledInteractive>\n <svg class=\"mat-mdc-paginator-icon\"\n viewBox=\"0 0 24 24\"\n focusable=\"false\"\n aria-hidden=\"true\">\n <path d=\"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z\"/>\n </svg>\n </button>\n }\n </div>\n </div>\n</div>\n", styles: [".mat-mdc-paginator{display:block;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-paginator-container-text-color, var(--mat-sys-on-surface));background-color:var(--mat-paginator-container-background-color, var(--mat-sys-surface));font-family:var(--mat-paginator-container-text-font, var(--mat-sys-body-small-font));line-height:var(--mat-paginator-container-text-line-height, var(--mat-sys-body-small-line-height));font-size:var(--mat-paginator-container-text-size, var(--mat-sys-body-small-size));font-weight:var(--mat-paginator-container-text-weight, var(--mat-sys-body-small-weight));letter-spacing:var(--mat-paginator-container-text-tracking, var(--mat-sys-body-small-tracking));--mat-form-field-container-height:var(--mat-paginator-form-field-container-height, 40px);--mat-form-field-container-vertical-padding:var(--mat-paginator-form-field-container-vertical-padding, 8px)}.mat-mdc-paginator .mat-mdc-select-value{font-size:var(--mat-paginator-select-trigger-text-size, var(--mat-sys-body-small-size))}.mat-mdc-paginator .mat-mdc-form-field-subscript-wrapper{display:none}.mat-mdc-paginator .mat-mdc-select{line-height:1.5}.mat-mdc-paginator-outer-container{display:flex}.mat-mdc-paginator-container{display:flex;align-items:center;justify-content:flex-end;padding:0 8px;flex-wrap:wrap;width:100%;min-height:var(--mat-paginator-container-size, 56px)}.mat-mdc-paginator-page-size{display:flex;align-items:baseline;margin-right:8px}[dir=rtl] .mat-mdc-paginator-page-size{margin-right:0;margin-left:8px}.mat-mdc-paginator-page-size-label{margin:0 4px}.mat-mdc-paginator-page-size-select{margin:0 4px;width:84px}.mat-mdc-paginator-range-label{margin:0 32px 0 24px}.mat-mdc-paginator-range-actions{display:flex;align-items:center}.mat-mdc-paginator-icon{display:inline-block;width:28px;fill:var(--mat-paginator-enabled-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-icon-button[aria-disabled] .mat-mdc-paginator-icon{fill:var(--mat-paginator-disabled-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}[dir=rtl] .mat-mdc-paginator-icon{transform:rotate(180deg)}@media(forced-colors: active){.mat-mdc-icon-button[aria-disabled] .mat-mdc-paginator-icon,.mat-mdc-paginator-icon{fill:currentColor}.mat-mdc-paginator-range-actions .mat-mdc-icon-button{outline:solid 1px}.mat-mdc-paginator-range-actions .mat-mdc-icon-button[aria-disabled]{color:GrayText}}.mat-mdc-paginator-touch-target{display:var(--mat-paginator-touch-target-display, block);position:absolute;top:50%;left:50%;width:84px;height:48px;background-color:rgba(0,0,0,0);transform:translate(-50%, -50%);cursor:pointer}\n"] }]
  346. }], ctorParameters: () => [], propDecorators: { color: [{
  347. type: Input
  348. }], pageIndex: [{
  349. type: Input,
  350. args: [{ transform: numberAttribute }]
  351. }], length: [{
  352. type: Input,
  353. args: [{ transform: numberAttribute }]
  354. }], pageSize: [{
  355. type: Input,
  356. args: [{ transform: numberAttribute }]
  357. }], pageSizeOptions: [{
  358. type: Input
  359. }], hidePageSize: [{
  360. type: Input,
  361. args: [{ transform: booleanAttribute }]
  362. }], showFirstLastButtons: [{
  363. type: Input,
  364. args: [{ transform: booleanAttribute }]
  365. }], selectConfig: [{
  366. type: Input
  367. }], disabled: [{
  368. type: Input,
  369. args: [{ transform: booleanAttribute }]
  370. }], page: [{
  371. type: Output
  372. }] } });
  373. class MatPaginatorModule {
  374. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatPaginatorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
  375. static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.6", ngImport: i0, type: MatPaginatorModule, imports: [MatButtonModule, MatSelectModule, MatTooltipModule, MatPaginator], exports: [MatPaginator] });
  376. static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatPaginatorModule, providers: [MAT_PAGINATOR_INTL_PROVIDER], imports: [MatButtonModule, MatSelectModule, MatTooltipModule, MatPaginator] });
  377. }
  378. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: MatPaginatorModule, decorators: [{
  379. type: NgModule,
  380. args: [{
  381. imports: [MatButtonModule, MatSelectModule, MatTooltipModule, MatPaginator],
  382. exports: [MatPaginator],
  383. providers: [MAT_PAGINATOR_INTL_PROVIDER],
  384. }]
  385. }] });
  386. export { MAT_PAGINATOR_DEFAULT_OPTIONS, MAT_PAGINATOR_INTL_PROVIDER, MAT_PAGINATOR_INTL_PROVIDER_FACTORY, MatPaginator, MatPaginatorIntl, MatPaginatorModule, PageEvent };
  387. //# sourceMappingURL=paginator.mjs.map