import { Component, EventEmitter, HostBinding, Input, Output } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { FormLabelDirective, FormSelectDirective } from '../../form';
import * as i0 from "@angular/core";
import * as i1 from "@angular/forms";
export class SmartTableItemsPerPageSelectorComponent {
    constructor() {
        this.#itemsPerPage = 5;
        this.itemsPerPageLabel = 'Items per page:';
        this.itemsPerPageOptions = [5, 10, 20, 50];
        this.itemsPerPageChange = new EventEmitter();
    }
    set itemsPerPage(value) {
        if (this.#itemsPerPage != value) {
            this.#itemsPerPage = value;
            this.itemsPerPageChange.emit(value);
        }
    }
    get itemsPerPage() {
        return this.#itemsPerPage;
    }
    #itemsPerPage;
    get hostClasses() {
        return {
            row: true
        };
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: SmartTableItemsPerPageSelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.6", type: SmartTableItemsPerPageSelectorComponent, isStandalone: true, selector: "c-smart-table-items-per-page-selector", inputs: { itemsPerPage: "itemsPerPage", itemsPerPageLabel: "itemsPerPageLabel", itemsPerPageOptions: "itemsPerPageOptions" }, outputs: { itemsPerPageChange: "itemsPerPageChange" }, host: { properties: { "class": "this.hostClasses" } }, ngImport: i0, template: "<label cLabel=\"col\" class=\"col-sm-auto\">{{ itemsPerPageLabel }}</label>\n<div class=\"col-auto\">\n  <select [(ngModel)]=\"itemsPerPage\" cSelect name=\"itemsPerPageSelector\">\n    @for (option of itemsPerPageOptions; track option; let i = $index) {\n      <option [ngValue]=\"option\">{{ option }}</option>\n    }\n  </select>\n</div>\n", dependencies: [{ kind: "directive", type: FormSelectDirective, selector: "select[cSelect]", inputs: ["sizing", "valid"] }, { kind: "directive", type: FormLabelDirective, selector: "[cLabel]", inputs: ["cLabel", "sizing"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: SmartTableItemsPerPageSelectorComponent, decorators: [{
            type: Component,
            args: [{ selector: 'c-smart-table-items-per-page-selector', imports: [FormSelectDirective, FormLabelDirective, FormsModule], standalone: true, template: "<label cLabel=\"col\" class=\"col-sm-auto\">{{ itemsPerPageLabel }}</label>\n<div class=\"col-auto\">\n  <select [(ngModel)]=\"itemsPerPage\" cSelect name=\"itemsPerPageSelector\">\n    @for (option of itemsPerPageOptions; track option; let i = $index) {\n      <option [ngValue]=\"option\">{{ option }}</option>\n    }\n  </select>\n</div>\n" }]
        }], propDecorators: { itemsPerPage: [{
                type: Input
            }], itemsPerPageLabel: [{
                type: Input
            }], itemsPerPageOptions: [{
                type: Input
            }], itemsPerPageChange: [{
                type: Output
            }], hostClasses: [{
                type: HostBinding,
                args: ['class']
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnQtdGFibGUtaXRlbXMtcGVyLXBhZ2Utc2VsZWN0b3IuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY29yZXVpLWFuZ3VsYXIvc3JjL2xpYi9zbWFydC10YWJsZS9zbWFydC10YWJsZS1pdGVtcy1wZ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