import * as i0 from '@angular/core';
import { input, model, output, booleanAttribute, effect, Component } from '@angular/core';
import { SelectButton } from 'primeng/selectbutton';
import * as i1 from '@angular/forms';
import { FormsModule } from '@angular/forms';

class Tabs {
    options = input([], ...(ngDevMode ? [{ debugName: "options" }] : []));
    optionLabel = input('label', ...(ngDevMode ? [{ debugName: "optionLabel" }] : []));
    optionValue = input('value', ...(ngDevMode ? [{ debugName: "optionValue" }] : []));
    active = model(null, ...(ngDevMode ? [{ debugName: "active" }] : []));
    onChange = output();
    size = input(...(ngDevMode ? [undefined, { debugName: "size" }] : []));
    fluid = input(false, { ...(ngDevMode ? { debugName: "fluid" } : {}), transform: booleanAttribute });
    disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
    // TODO: make a decision about this maybe we should remove it
    constructor() {
        effect(() => {
            const options = this.options();
            if (options && options.length > 0 && !this.active()) {
                this.active.set(options[0].value);
            }
        });
    }
    onTabChange(value) {
        this.onChange.emit(value);
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.3", ngImport: i0, type: Tabs, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.3", type: Tabs, isStandalone: true, selector: "mt-tabs", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionLabel: { classPropertyName: "optionLabel", publicName: "optionLabel", isSignal: true, isRequired: false, transformFunction: null }, optionValue: { classPropertyName: "optionValue", publicName: "optionValue", isSignal: true, isRequired: false, transformFunction: null }, active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { active: "activeChange", onChange: "onChange" }, host: { properties: { "class.w-full": "fluid()" }, classAttribute: "grid gap-1" }, ngImport: i0, template: "<p-selectbutton\n  [options]=\"options()\"\n  [(ngModel)]=\"active\"\n  (ngModelChange)=\"onTabChange($event)\"\n  [optionLabel]=\"optionLabel()\"\n  [optionValue]=\"optionValue()\"\n  styleClass=\"my-tabs-button\"\n  [size]=\"size()\"\n  [fluid]=\"fluid()\"\n  [disabled]=\"disabled()\"\n  unselectable\n/>\n", styles: [""], dependencies: [{ kind: "component", type: SelectButton, selector: "p-selectButton, p-selectbutton, p-select-button", inputs: ["options", "optionLabel", "optionValue", "optionDisabled", "unselectable", "tabindex", "multiple", "allowEmpty", "styleClass", "ariaLabelledBy", "dataKey", "autofocus", "size", "fluid"], outputs: ["onOptionClick", "onChange"] }, { kind: "ngmodule", type: FormsModule }, { 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: "21.0.3", ngImport: i0, type: Tabs, decorators: [{
            type: Component,
            args: [{ selector: 'mt-tabs', standalone: true, imports: [SelectButton, FormsModule], host: {
                        class: 'grid gap-1',
                        '[class.w-full]': 'fluid()',
                    }, template: "<p-selectbutton\n  [options]=\"options()\"\n  [(ngModel)]=\"active\"\n  (ngModelChange)=\"onTabChange($event)\"\n  [optionLabel]=\"optionLabel()\"\n  [optionValue]=\"optionValue()\"\n  styleClass=\"my-tabs-button\"\n  [size]=\"size()\"\n  [fluid]=\"fluid()\"\n  [disabled]=\"disabled()\"\n  unselectable\n/>\n" }]
        }], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], optionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabel", required: false }] }], optionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionValue", required: false }] }], active: [{ type: i0.Input, args: [{ isSignal: true, alias: "active", required: false }] }, { type: i0.Output, args: ["activeChange"] }], onChange: [{ type: i0.Output, args: ["onChange"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });

/**
 * Generated bundle index. Do not edit.
 */

export { Tabs };
//# sourceMappingURL=masterteam-components-tabs.mjs.map
