ngx-bootstrap
Version:
Angular Bootstrap
566 lines (559 loc) • 29.7 kB
JavaScript
import * as i0 from '@angular/core';
import { Injectable, forwardRef, EventEmitter, Input, Output, Component, NgModule } from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { NgClass, NgIf, NgTemplateOutlet, NgFor, CommonModule } from '@angular/common';
// todo: split
/** Provides default values for Pagination and pager components */
class PaginationConfig {
constructor() {
this.main = {
itemsPerPage: 10,
boundaryLinks: false,
directionLinks: true,
firstText: 'First',
previousText: 'Previous',
nextText: 'Next',
lastText: 'Last',
pageBtnClass: '',
rotate: true
};
this.pager = {
itemsPerPage: 15,
previousText: '« Previous',
nextText: 'Next »',
pageBtnClass: '',
align: true
};
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: PaginationConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: PaginationConfig, providedIn: 'root' }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: PaginationConfig, decorators: [{
type: Injectable,
args: [{
providedIn: 'root'
}]
}] });
const PAGER_CONTROL_VALUE_ACCESSOR = {
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => PagerComponent),
multi: true
};
class PagerComponent {
constructor(elementRef, paginationConfig, changeDetection) {
this.elementRef = elementRef;
this.changeDetection = changeDetection;
/** if `true` aligns each link to the sides of pager */
this.align = false;
/** if false first and last buttons will be hidden */
this.boundaryLinks = false;
/** if false previous and next buttons will be hidden */
this.directionLinks = true;
// labels
/** first button text */
this.firstText = 'First';
/** previous button text */
this.previousText = '« Previous';
/** next button text */
this.nextText = 'Next »';
/** last button text */
this.lastText = 'Last';
/** if true current page will in the middle of pages list */
this.rotate = true;
// css
/** add class to <code><li\></code> */
this.pageBtnClass = '';
/** if true pagination component will be disabled */
this.disabled = false;
/** fired when total pages count changes, $event:number equals to total pages count */
this.numPages = new EventEmitter();
/** fired when page was changed, $event:{page, itemsPerPage} equals to
* object with current page index and number of items per page
*/
this.pageChanged = new EventEmitter();
this.onChange = Function.prototype;
this.onTouched = Function.prototype;
this.classMap = '';
this.inited = false;
this._itemsPerPage = 15;
this._totalItems = 0;
this._totalPages = 0;
this._page = 1;
this.elementRef = elementRef;
if (!this.config) {
this.configureOptions(Object.assign({}, paginationConfig.main, paginationConfig.pager));
}
}
/** maximum number of items per page. If value less than 1 will display all items on one page */
get itemsPerPage() {
return this._itemsPerPage;
}
set itemsPerPage(v) {
this._itemsPerPage = v;
this.totalPages = this.calculateTotalPages();
}
/** total number of items in all pages */
get totalItems() {
return this._totalItems;
}
set totalItems(v) {
this._totalItems = v;
this.totalPages = this.calculateTotalPages();
}
get totalPages() {
return this._totalPages;
}
set totalPages(v) {
this._totalPages = v;
this.numPages.emit(v);
if (this.inited) {
this.selectPage(this.page);
}
}
get page() {
return this._page;
}
set page(value) {
const _previous = this._page;
this._page = value > this.totalPages ? this.totalPages : value || 1;
this.changeDetection.markForCheck();
if (_previous === this._page || typeof _previous === 'undefined') {
return;
}
this.pageChanged.emit({
page: this._page,
itemsPerPage: this.itemsPerPage
});
}
configureOptions(config) {
this.config = Object.assign({}, config);
}
ngOnInit() {
if (typeof window !== 'undefined') {
this.classMap = this.elementRef.nativeElement.getAttribute('class') || '';
}
// watch for maxSize
if (typeof this.maxSize === 'undefined') {
this.maxSize = this.config?.maxSize || 0;
}
if (typeof this.rotate === 'undefined') {
this.rotate = !!this.config?.rotate;
}
if (typeof this.boundaryLinks === 'undefined') {
this.boundaryLinks = !!this.config?.boundaryLinks;
}
if (typeof this.directionLinks === 'undefined') {
this.directionLinks = !!this.config?.directionLinks;
}
if (typeof this.pageBtnClass === 'undefined') {
this.pageBtnClass = this.config?.pageBtnClass || '';
}
// base class
if (typeof this.itemsPerPage === 'undefined') {
this.itemsPerPage = this.config?.itemsPerPage || 0;
}
this.totalPages = this.calculateTotalPages();
// this class
this.pages = this.getPages(this.page, this.totalPages);
this.inited = true;
}
writeValue(value) {
this.page = value;
this.pages = this.getPages(this.page, this.totalPages);
}
getText(key) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return this[`${key}Text`] || this.config[`${key}Text`];
}
noPrevious() {
return this.page === 1;
}
noNext() {
return this.page === this.totalPages;
}
registerOnChange(fn) {
this.onChange = fn;
}
registerOnTouched(fn) {
this.onTouched = fn;
}
selectPage(page, event) {
if (event) {
event.preventDefault();
}
if (!this.disabled) {
if (event && event.target) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const target = event.target;
target.blur();
}
this.writeValue(page);
this.onChange(this.page);
}
}
// Create page object used in template
makePage(num, text, active) {
return { text, number: num, active };
}
getPages(currentPage, totalPages) {
const pages = [];
// Default page limits
let startPage = 1;
let endPage = totalPages;
const isMaxSized = typeof this.maxSize !== 'undefined' && this.maxSize < totalPages;
// recompute if maxSize
if (isMaxSized && this.maxSize) {
if (this.rotate) {
// Current page is displayed in the middle of the visible ones
startPage = Math.max(currentPage - Math.floor(this.maxSize / 2), 1);
endPage = startPage + this.maxSize - 1;
// Adjust if limit is exceeded
if (endPage > totalPages) {
endPage = totalPages;
startPage = endPage - this.maxSize + 1;
}
}
else {
// Visible pages are paginated with maxSize
startPage =
(Math.ceil(currentPage / this.maxSize) - 1) * this.maxSize + 1;
// Adjust last page if limit is exceeded
endPage = Math.min(startPage + this.maxSize - 1, totalPages);
}
}
// Add page number links
for (let num = startPage; num <= endPage; num++) {
const page = this.makePage(num, num.toString(), num === currentPage);
pages.push(page);
}
// Add links to move between page sets
if (isMaxSized && !this.rotate) {
if (startPage > 1) {
const previousPageSet = this.makePage(startPage - 1, '...', false);
pages.unshift(previousPageSet);
}
if (endPage < totalPages) {
const nextPageSet = this.makePage(endPage + 1, '...', false);
pages.push(nextPageSet);
}
}
return pages;
}
// base class
calculateTotalPages() {
const totalPages = this.itemsPerPage < 1
? 1
: Math.ceil(this.totalItems / this.itemsPerPage);
return Math.max(totalPages || 0, 1);
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: PagerComponent, deps: [{ token: i0.ElementRef }, { token: PaginationConfig }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.2", type: PagerComponent, isStandalone: true, selector: "pager", inputs: { align: "align", maxSize: "maxSize", boundaryLinks: "boundaryLinks", directionLinks: "directionLinks", firstText: "firstText", previousText: "previousText", nextText: "nextText", lastText: "lastText", rotate: "rotate", pageBtnClass: "pageBtnClass", disabled: "disabled", itemsPerPage: "itemsPerPage", totalItems: "totalItems" }, outputs: { numPages: "numPages", pageChanged: "pageChanged" }, providers: [PAGER_CONTROL_VALUE_ACCESSOR], ngImport: i0, template: "<ul class=\"pager\">\n <li [class.disabled]=\"noPrevious()\" [class.previous]=\"align\"\n [ngClass]=\"{'pull-left': align, 'float-left': align}\"\n class=\"{{ pageBtnClass }}\">\n <a href (click)=\"selectPage(page - 1, $event)\">{{ getText('previous') }}</a>\n </li>\n <li [class.disabled]=\"noNext()\" [class.next]=\"align\"\n [ngClass]=\"{'pull-right': align, 'float-right': align}\"\n class=\"{{ pageBtnClass }}\">\n <a href (click)=\"selectPage(page + 1, $event)\">{{ getText('next') }}</a>\n </li>\n</ul>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: PagerComponent, decorators: [{
type: Component,
args: [{ selector: 'pager', providers: [PAGER_CONTROL_VALUE_ACCESSOR], standalone: true, imports: [NgClass], template: "<ul class=\"pager\">\n <li [class.disabled]=\"noPrevious()\" [class.previous]=\"align\"\n [ngClass]=\"{'pull-left': align, 'float-left': align}\"\n class=\"{{ pageBtnClass }}\">\n <a href (click)=\"selectPage(page - 1, $event)\">{{ getText('previous') }}</a>\n </li>\n <li [class.disabled]=\"noNext()\" [class.next]=\"align\"\n [ngClass]=\"{'pull-right': align, 'float-right': align}\"\n class=\"{{ pageBtnClass }}\">\n <a href (click)=\"selectPage(page + 1, $event)\">{{ getText('next') }}</a>\n </li>\n</ul>\n" }]
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: PaginationConfig }, { type: i0.ChangeDetectorRef }], propDecorators: { align: [{
type: Input
}], maxSize: [{
type: Input
}], boundaryLinks: [{
type: Input
}], directionLinks: [{
type: Input
}], firstText: [{
type: Input
}], previousText: [{
type: Input
}], nextText: [{
type: Input
}], lastText: [{
type: Input
}], rotate: [{
type: Input
}], pageBtnClass: [{
type: Input
}], disabled: [{
type: Input
}], numPages: [{
type: Output
}], pageChanged: [{
type: Output
}], itemsPerPage: [{
type: Input
}], totalItems: [{
type: Input
}] } });
const PAGINATION_CONTROL_VALUE_ACCESSOR = {
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => PaginationComponent),
multi: true
};
class PaginationComponent {
constructor(elementRef, paginationConfig, changeDetection) {
this.elementRef = elementRef;
this.changeDetection = changeDetection;
/** if `true` aligns each link to the sides of pager */
this.align = true;
/** if false first and last buttons will be hidden */
this.boundaryLinks = false;
/** if false previous and next buttons will be hidden */
this.directionLinks = true;
/** if true current page will in the middle of pages list */
this.rotate = true;
// css
/** add class to <code><li\></code> */
this.pageBtnClass = '';
/** if true pagination component will be disabled */
this.disabled = false;
/** fired when total pages count changes, $event:number equals to total pages count */
this.numPages = new EventEmitter();
/** fired when page was changed, $event:{page, itemsPerPage} equals to object
* with current page index and number of items per page
*/
this.pageChanged = new EventEmitter();
this.onChange = Function.prototype;
this.onTouched = Function.prototype;
this.classMap = '';
this.inited = false;
this._itemsPerPage = 10;
this._totalItems = 0;
this._totalPages = 0;
this._page = 1;
this.elementRef = elementRef;
if (!this.config) {
this.configureOptions(paginationConfig.main);
}
}
/** maximum number of items per page. If value less than 1 will display all items on one page */
get itemsPerPage() {
return this._itemsPerPage;
}
set itemsPerPage(v) {
this._itemsPerPage = v;
this.totalPages = this.calculateTotalPages();
}
/** total number of items in all pages */
get totalItems() {
return this._totalItems;
}
set totalItems(v) {
this._totalItems = v;
this.totalPages = this.calculateTotalPages();
}
get totalPages() {
return this._totalPages;
}
set totalPages(v) {
this._totalPages = v;
this.numPages.emit(v);
if (this.inited) {
this.selectPage(this.page);
}
}
get page() {
return this._page;
}
set page(value) {
const _previous = this._page;
this._page = value > this.totalPages ? this.totalPages : value || 1;
this.changeDetection.markForCheck();
if (_previous === this._page || typeof _previous === 'undefined') {
return;
}
this.pageChanged.emit({
page: this._page,
itemsPerPage: this.itemsPerPage
});
}
configureOptions(config) {
this.config = Object.assign({}, config);
}
ngOnInit() {
if (typeof window !== 'undefined') {
this.classMap = this.elementRef.nativeElement.getAttribute('class') || '';
}
// watch for maxSize
if (typeof this.maxSize === 'undefined') {
this.maxSize = this.config?.maxSize || 0;
}
if (typeof this.rotate === 'undefined') {
this.rotate = !!this.config?.rotate;
}
if (typeof this.boundaryLinks === 'undefined') {
this.boundaryLinks = !!this.config?.boundaryLinks;
}
if (typeof this.directionLinks === 'undefined') {
this.directionLinks = !!this.config?.directionLinks;
}
if (typeof this.pageBtnClass === 'undefined') {
this.pageBtnClass = this.config?.pageBtnClass || '';
}
// base class
if (typeof this.itemsPerPage === 'undefined') {
this.itemsPerPage = this.config?.itemsPerPage || 0;
}
this.totalPages = this.calculateTotalPages();
// this class
this.pages = this.getPages(this.page, this.totalPages);
this.inited = true;
}
writeValue(value) {
this.page = value;
this.pages = this.getPages(this.page, this.totalPages);
}
getText(key) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return this[`${key}Text`] || this.config[`${key}Text`];
}
noPrevious() {
return this.page === 1;
}
noNext() {
return this.page === this.totalPages;
}
registerOnChange(fn) {
this.onChange = fn;
}
registerOnTouched(fn) {
this.onTouched = fn;
}
selectPage(page, event) {
if (event) {
event.preventDefault();
}
if (!this.disabled) {
if (event && event.target) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const target = event.target;
target.blur();
}
this.writeValue(page);
this.onChange(this.page);
}
}
// Create page object used in template
makePage(num, text, active) {
return { text, number: num, active };
}
getPages(currentPage, totalPages) {
const pages = [];
// Default page limits
let startPage = 1;
let endPage = totalPages;
const isMaxSized = typeof this.maxSize !== 'undefined' && this.maxSize < totalPages;
// recompute if maxSize
if (isMaxSized && this.maxSize) {
if (this.rotate) {
// Current page is displayed in the middle of the visible ones
startPage = Math.max(currentPage - Math.floor(this.maxSize / 2), 1);
endPage = startPage + this.maxSize - 1;
// Adjust if limit is exceeded
if (endPage > totalPages) {
endPage = totalPages;
startPage = endPage - this.maxSize + 1;
}
}
else {
// Visible pages are paginated with maxSize
startPage =
(Math.ceil(currentPage / this.maxSize) - 1) * this.maxSize + 1;
// Adjust last page if limit is exceeded
endPage = Math.min(startPage + this.maxSize - 1, totalPages);
}
}
// Add page number links
for (let num = startPage; num <= endPage; num++) {
const page = this.makePage(num, num.toString(), num === currentPage);
pages.push(page);
}
// Add links to move between page sets
if (isMaxSized && !this.rotate) {
if (startPage > 1) {
const previousPageSet = this.makePage(startPage - 1, '...', false);
pages.unshift(previousPageSet);
}
if (endPage < totalPages) {
const nextPageSet = this.makePage(endPage + 1, '...', false);
pages.push(nextPageSet);
}
}
return pages;
}
// base class
calculateTotalPages() {
const totalPages = this.itemsPerPage < 1
? 1
: Math.ceil(this.totalItems / this.itemsPerPage);
return Math.max(totalPages || 0, 1);
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: PaginationComponent, deps: [{ token: i0.ElementRef }, { token: PaginationConfig }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.2", type: PaginationComponent, isStandalone: true, selector: "pagination", inputs: { align: "align", maxSize: "maxSize", boundaryLinks: "boundaryLinks", directionLinks: "directionLinks", firstText: "firstText", previousText: "previousText", nextText: "nextText", lastText: "lastText", rotate: "rotate", pageBtnClass: "pageBtnClass", disabled: "disabled", customPageTemplate: "customPageTemplate", customNextTemplate: "customNextTemplate", customPreviousTemplate: "customPreviousTemplate", customFirstTemplate: "customFirstTemplate", customLastTemplate: "customLastTemplate", itemsPerPage: "itemsPerPage", totalItems: "totalItems" }, outputs: { numPages: "numPages", pageChanged: "pageChanged" }, providers: [PAGINATION_CONTROL_VALUE_ACCESSOR], ngImport: i0, template: "<ul class=\"pagination\" [ngClass]=\"classMap\">\n <li class=\"pagination-first page-item\"\n *ngIf=\"boundaryLinks\"\n [class.disabled]=\"noPrevious() || disabled\">\n <a class=\"page-link\" href (click)=\"selectPage(1, $event)\">\n <ng-container [ngTemplateOutlet]=\"customFirstTemplate || defaultFirstTemplate\"\n [ngTemplateOutletContext]=\"{disabled: noPrevious() || disabled, currentPage: page}\">\n </ng-container>\n </a>\n </li>\n\n <li class=\"pagination-prev page-item\"\n *ngIf=\"directionLinks\"\n [class.disabled]=\"noPrevious() || disabled\">\n <a class=\"page-link\" href (click)=\"selectPage(page - 1, $event)\">\n <ng-container [ngTemplateOutlet]=\"customPreviousTemplate || defaultPreviousTemplate\"\n [ngTemplateOutletContext]=\"{disabled: noPrevious() || disabled, currentPage: page}\">\n </ng-container>\n </a>\n </li>\n\n <li *ngFor=\"let pg of pages\"\n [class.active]=\"pg.active\"\n [class.disabled]=\"disabled && !pg.active\"\n class=\"pagination-page page-item\">\n <a class=\"page-link\" href (click)=\"selectPage(pg.number, $event)\">\n <ng-container [ngTemplateOutlet]=\"customPageTemplate || defaultPageTemplate\"\n [ngTemplateOutletContext]=\"{disabled: disabled, $implicit: pg, currentPage: page}\">\n </ng-container>\n </a>\n </li>\n\n <li class=\"pagination-next page-item\"\n *ngIf=\"directionLinks\"\n [class.disabled]=\"noNext() || disabled\">\n <a class=\"page-link\" href (click)=\"selectPage(page + 1, $event)\">\n <ng-container [ngTemplateOutlet]=\"customNextTemplate || defaultNextTemplate\"\n [ngTemplateOutletContext]=\"{disabled: noNext() || disabled, currentPage: page}\">\n </ng-container>\n </a>\n </li>\n\n <li class=\"pagination-last page-item\"\n *ngIf=\"boundaryLinks\"\n [class.disabled]=\"noNext() || disabled\">\n <a class=\"page-link\" href (click)=\"selectPage(totalPages, $event)\">\n <ng-container [ngTemplateOutlet]=\"customLastTemplate || defaultLastTemplate\"\n [ngTemplateOutletContext]=\"{disabled: noNext() || disabled, currentPage: page}\">\n </ng-container>\n </a>\n </li>\n</ul>\n\n<ng-template #defaultPageTemplate let-page>{{ page.text }}</ng-template>\n\n<ng-template #defaultNextTemplate>{{ getText('next') }}</ng-template>\n\n<ng-template #defaultPreviousTemplate>{{ getText('previous') }}</ng-template>\n\n<ng-template #defaultFirstTemplate>{{ getText('first') }}</ng-template>\n\n<ng-template #defaultLastTemplate>{{ getText('last') }}</ng-template>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: PaginationComponent, decorators: [{
type: Component,
args: [{ selector: 'pagination', providers: [PAGINATION_CONTROL_VALUE_ACCESSOR], standalone: true, imports: [NgClass, NgIf, NgTemplateOutlet, NgFor], template: "<ul class=\"pagination\" [ngClass]=\"classMap\">\n <li class=\"pagination-first page-item\"\n *ngIf=\"boundaryLinks\"\n [class.disabled]=\"noPrevious() || disabled\">\n <a class=\"page-link\" href (click)=\"selectPage(1, $event)\">\n <ng-container [ngTemplateOutlet]=\"customFirstTemplate || defaultFirstTemplate\"\n [ngTemplateOutletContext]=\"{disabled: noPrevious() || disabled, currentPage: page}\">\n </ng-container>\n </a>\n </li>\n\n <li class=\"pagination-prev page-item\"\n *ngIf=\"directionLinks\"\n [class.disabled]=\"noPrevious() || disabled\">\n <a class=\"page-link\" href (click)=\"selectPage(page - 1, $event)\">\n <ng-container [ngTemplateOutlet]=\"customPreviousTemplate || defaultPreviousTemplate\"\n [ngTemplateOutletContext]=\"{disabled: noPrevious() || disabled, currentPage: page}\">\n </ng-container>\n </a>\n </li>\n\n <li *ngFor=\"let pg of pages\"\n [class.active]=\"pg.active\"\n [class.disabled]=\"disabled && !pg.active\"\n class=\"pagination-page page-item\">\n <a class=\"page-link\" href (click)=\"selectPage(pg.number, $event)\">\n <ng-container [ngTemplateOutlet]=\"customPageTemplate || defaultPageTemplate\"\n [ngTemplateOutletContext]=\"{disabled: disabled, $implicit: pg, currentPage: page}\">\n </ng-container>\n </a>\n </li>\n\n <li class=\"pagination-next page-item\"\n *ngIf=\"directionLinks\"\n [class.disabled]=\"noNext() || disabled\">\n <a class=\"page-link\" href (click)=\"selectPage(page + 1, $event)\">\n <ng-container [ngTemplateOutlet]=\"customNextTemplate || defaultNextTemplate\"\n [ngTemplateOutletContext]=\"{disabled: noNext() || disabled, currentPage: page}\">\n </ng-container>\n </a>\n </li>\n\n <li class=\"pagination-last page-item\"\n *ngIf=\"boundaryLinks\"\n [class.disabled]=\"noNext() || disabled\">\n <a class=\"page-link\" href (click)=\"selectPage(totalPages, $event)\">\n <ng-container [ngTemplateOutlet]=\"customLastTemplate || defaultLastTemplate\"\n [ngTemplateOutletContext]=\"{disabled: noNext() || disabled, currentPage: page}\">\n </ng-container>\n </a>\n </li>\n</ul>\n\n<ng-template #defaultPageTemplate let-page>{{ page.text }}</ng-template>\n\n<ng-template #defaultNextTemplate>{{ getText('next') }}</ng-template>\n\n<ng-template #defaultPreviousTemplate>{{ getText('previous') }}</ng-template>\n\n<ng-template #defaultFirstTemplate>{{ getText('first') }}</ng-template>\n\n<ng-template #defaultLastTemplate>{{ getText('last') }}</ng-template>\n" }]
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: PaginationConfig }, { type: i0.ChangeDetectorRef }], propDecorators: { align: [{
type: Input
}], maxSize: [{
type: Input
}], boundaryLinks: [{
type: Input
}], directionLinks: [{
type: Input
}], firstText: [{
type: Input
}], previousText: [{
type: Input
}], nextText: [{
type: Input
}], lastText: [{
type: Input
}], rotate: [{
type: Input
}], pageBtnClass: [{
type: Input
}], disabled: [{
type: Input
}], customPageTemplate: [{
type: Input
}], customNextTemplate: [{
type: Input
}], customPreviousTemplate: [{
type: Input
}], customFirstTemplate: [{
type: Input
}], customLastTemplate: [{
type: Input
}], numPages: [{
type: Output
}], pageChanged: [{
type: Output
}], itemsPerPage: [{
type: Input
}], totalItems: [{
type: Input
}] } });
class PaginationModule {
// @deprecated method not required anymore, will be deleted in v19.0.0
static forRoot() {
return {
ngModule: PaginationModule,
providers: []
};
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: PaginationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.0.2", ngImport: i0, type: PaginationModule, imports: [CommonModule, PagerComponent, PaginationComponent], exports: [PagerComponent, PaginationComponent] }); }
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: PaginationModule, imports: [CommonModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: PaginationModule, decorators: [{
type: NgModule,
args: [{
imports: [CommonModule, PagerComponent, PaginationComponent],
exports: [PagerComponent, PaginationComponent]
}]
}] });
/**
* Generated bundle index. Do not edit.
*/
export { PagerComponent, PaginationComponent, PaginationConfig, PaginationModule };
//# sourceMappingURL=ngx-bootstrap-pagination.mjs.map