/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { Injectable, Optional, SkipSelf } from '@angular/core'; import { Subject } from 'rxjs'; import * as i0 from "@angular/core"; /** * To modify the labels and text displayed, create a new instance of MatPaginatorIntl and * include it in a custom provider */ export class MatPaginatorIntl { constructor() { /** * Stream to emit from when labels are changed. Use this to notify components when the labels have * changed after initialization. */ this.changes = new Subject(); /** A label for the page size selector. */ this.itemsPerPageLabel = 'Items per page:'; /** A label for the button that increments the current page. */ this.nextPageLabel = 'Next page'; /** A label for the button that decrements the current page. */ this.previousPageLabel = 'Previous page'; /** A label for the button that moves to the first page. */ this.firstPageLabel = 'First page'; /** A label for the button that moves to the last page. */ this.lastPageLabel = 'Last page'; /** A label for the range of items within the current page and the length of the whole list. */ this.getRangeLabel = (page, pageSize, length) => { if (length == 0 || pageSize == 0) { return `0 of ${length}`; } length = Math.max(length, 0); const startIndex = page * pageSize; // If the start index exceeds the list length, do not try and fix the end index to the end. const endIndex = startIndex < length ? Math.min(startIndex + pageSize, length) : startIndex + pageSize; return `${startIndex + 1} – ${endIndex} of ${length}`; }; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatPaginatorIntl, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); } static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatPaginatorIntl, providedIn: 'root' }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatPaginatorIntl, decorators: [{ type: Injectable, args: [{ providedIn: 'root' }] }] }); /** @docs-private */ export function MAT_PAGINATOR_INTL_PROVIDER_FACTORY(parentIntl) { return parentIntl || new MatPaginatorIntl(); } /** @docs-private */ export const MAT_PAGINATOR_INTL_PROVIDER = { // If there is already an MatPaginatorIntl available, use that. Otherwise, provide a new one. provide: MatPaginatorIntl, deps: [[new Optional(), new SkipSelf(), MatPaginatorIntl]], useFactory: MAT_PAGINATOR_INTL_PROVIDER_FACTORY, }; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFnaW5hdG9yLWludGwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbWF0ZXJpYWwvcGFnaW5hdG9yL3BhZ2luYXRvci1pbnRsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRztBQUVILE9BQU8sRUFBQyxVQUFVLEVBQUUsUUFBUSxFQUFFLFFBQVEsRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUM3RCxPQUFPLEVBQUMsT0FBTyxFQUFDLE1BQU0sTUFBTSxDQUFDOztBQUU3Qjs7O0dBR0c7QUFFSCxNQUFNLE9BQU8sZ0JBQWdCO0lBRDdCO1FBRUU7OztXQUdHO1FBQ00sWUFBTyxHQUFrQixJQUFJLE9BQU8sRUFBUSxDQUFDO1FBRXRELDBDQUEwQztRQUMxQyxzQkFBaUIsR0FBVyxpQkFBaUIsQ0FBQztRQUU5QywrREFBK0Q7UUFDL0Qsa0JBQWEsR0FBVyxXQUFXLENBQUM7UUFFcEMsK0RBQStEO1FBQy9ELHNCQUFpQixHQUFXLGVBQWUsQ0FBQztRQUU1QywyREFBMkQ7UUFDM0QsbUJBQWMsR0FBVyxZQUFZLENBQUM7UUFFdEMsMERBQTBEO1FBQzFELGtCQUFhLEdBQVcsV0FBVyxDQUFDO1FBRXBDLCtGQUErRjtRQUMvRixrQkFBYSxHQUErRCxDQUMxRSxJQUFZLEVBQ1osUUFBZ0IsRUFDaEIsTUFBYyxFQUNkLEVBQUU7WUFDRixJQUFJLE1BQU0sSUFBSSxDQUFDLElBQUksUUFBUSxJQUFJLENBQUMsRUFBRTtnQkFDaEMsT0FBTyxRQUFRLE1BQU0sRUFBRSxDQ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