import { CommonModule } from '@angular/common';
import { Component, EventEmitter, Input, Output } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/router";
import * as i2 from "@angular/common";
export class PagninationComponent {
    constructor(router) {
        this.router = router;
        this.totalPages = 1;
        this.currentPage = 1;
        this.paginationChange = new EventEmitter();
        this.bound = 5;
    }
    ngOnInit() {
    }
    goToNext() {
        this.paginationChange.emit(this.currentPage + 1);
        // this.router.navigate(['/list'], { queryParams: {pageNo: this.currentPage +1} });
    }
    goToPrev() {
        this.paginationChange.emit(this.currentPage - 1);
        // this.router.navigate(['/list'], { queryParams: {pageNo: this.currentPage -1} });
    }
    goToSelection(index) {
        this.currentPage = index + 1;
        this.paginationChange.emit(this.currentPage);
        // this.router.navigate(['/list'], { queryParams: {pageNo: this.currentPage} });
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PagninationComponent, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: PagninationComponent, isStandalone: true, selector: "simpo-pagnination", inputs: { totalPages: "totalPages", currentPage: "currentPage" }, outputs: { paginationChange: "paginationChange" }, ngImport: i0, template: "<section class=\"d-flex w-100 justify-content-center main-section\">\n    <div class=\"pagniation-btn\" (click)=\"goToPrev()\" [style.visibility]=\"currentPage == 1 ? 'hidden' : 'visible'\">Prev</div>\n    <ng-container *ngFor=\"let _ of [].constructor(totalPages); let idx = index\">\n        <span class=\"pagniation-btn\" [ngClass]=\"{'selected-page': (idx +1) == currentPage}\" (click)=\"goToSelection(idx)\">{{idx +1}}</span>\n    </ng-container>\n    <!-- <div *ngIf=\"totalPages > 6\" class=\"d-flex align-items-center\">\n        <span class=\"pagniation-btn fs-2\">...</span>\n        <span class=\"pagniation-btn\">{{totalPages}}</span>\n    </div> -->\n    <div class=\"pagniation-btn\" (click)=\"goToNext()\" [style.visibility]=\"currentPage == totalPages ? 'hidden' : 'visible'\">Next</div>\n</section>\n", styles: [".pagniation-btn{font-size:14px;padding:5px;border-radius:2px;width:45px;height:40px;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#000}.selected-page{background-color:#000;color:#fff}@media only screen and (max-width: 475px){.main-section{position:relative;right:22px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PagninationComponent, decorators: [{
            type: Component,
            args: [{ selector: 'simpo-pagnination', standalone: true, imports: [
                        CommonModule
                    ], template: "<section class=\"d-flex w-100 justify-content-center main-section\">\n    <div class=\"pagniation-btn\" (click)=\"goToPrev()\" [style.visibility]=\"currentPage == 1 ? 'hidden' : 'visible'\">Prev</div>\n    <ng-container *ngFor=\"let _ of [].constructor(totalPages); let idx = index\">\n        <span class=\"pagniation-btn\" [ngClass]=\"{'selected-page': (idx +1) == currentPage}\" (click)=\"goToSelection(idx)\">{{idx +1}}</span>\n    </ng-container>\n    <!-- <div *ngIf=\"totalPages > 6\" class=\"d-flex align-items-center\">\n        <span class=\"pagniation-btn fs-2\">...</span>\n        <span class=\"pagniation-btn\">{{totalPages}}</span>\n    </div> -->\n    <div class=\"pagniation-btn\" (click)=\"goToNext()\" [style.visibility]=\"currentPage == totalPages ? 'hidden' : 'visible'\">Next</div>\n</section>\n", styles: [".pagniation-btn{font-size:14px;padding:5px;border-radius:2px;width:45px;height:40px;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#000}.selected-page{background-color:#000;color:#fff}@media only screen and (max-width: 475px){.main-section{position:relative;right:22px}}\n"] }]
        }], ctorParameters: () => [{ type: i1.Router }], propDecorators: { totalPages: [{
                type: Input
            }], currentPage: [{
                type: Input
            }], paginationChange: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64, 