import * as i0 from '@angular/core';
import { InjectionToken, input, booleanAttribute, output, computed, effect, Component, NgModule } from '@angular/core';
import { warnOnce } from '@fundamental-ngx/cdk/utils';
import { ButtonComponent as ButtonComponent$1 } from '@fundamental-ngx/core/button';
import { FD_DEFAULT_ICON_FONT_FAMILY } from '@fundamental-ngx/core/icon';
import { ContentDensityModule } from '@fundamental-ngx/core/content-density';

const FDP_BUTTON = new InjectionToken('FdpButtonComponent');

let platformButtonId = 0;
/**
 * @deprecated
 * Button component is deprecated. Use `fd-button` from `@fundamental-ngx/core` instead.
 */
class ButtonComponent {
    /** @hidden */
    constructor() {
        /** Button ID - default value is provided if not set */
        this.id = input(`fdp-button-${++platformButtonId}`, ...(ngDevMode ? [{ debugName: "id" }] : []));
        /** Name for the element */
        this.name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : []));
        /** Width of the element */
        this.width = input(...(ngDevMode ? [undefined, { debugName: "width" }] : []));
        /** Disabled status of the element */
        this.disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
        /** Sets the `aria-label` attribute to the element */
        this.ariaLabel = input(...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : []));
        /** Sets the `aria-labelledby` attribute to the element */
        this.ariaLabelledBy = input(...(ngDevMode ? [undefined, { debugName: "ariaLabelledBy" }] : []));
        /** Sets the `aria-describedby` attribute to the element */
        this.ariaDescribedBy = input(...(ngDevMode ? [undefined, { debugName: "ariaDescribedBy" }] : []));
        /** Position of glyph related to text */
        this.glyphPosition = input('before', ...(ngDevMode ? [{ debugName: "glyphPosition" }] : []));
        /** Text rendered inside button component */
        this.label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
        /** The icon to include in the button. See the icon page for the list of icons */
        this.glyph = input(...(ngDevMode ? [undefined, { debugName: "glyph" }] : []));
        /** Glyph font family */
        this.glyphFont = input(FD_DEFAULT_ICON_FONT_FAMILY, ...(ngDevMode ? [{ debugName: "glyphFont" }] : []));
        /** The type of the button. Types include:
         * 'standard' | 'positive' | 'negative' | 'attention' | 'half' | 'ghost' | 'transparent' | 'emphasized' | 'menu'.
         * Leave empty for default (Standard button).
         * Default value is set to 'standard'
         */
        this.fdType = input('standard', ...(ngDevMode ? [{ debugName: "fdType" }] : []));
        /**
         * @deprecated
         * Use `fdType` property.
         * The buttonType of the button. Types includes
         * 'standard','positive', 'negative', 'attention', 'ghost',
         * 'transparent', 'emphasized','menu'.
         * Leave empty for default (standard button).
         */
        this.buttonType = input(...(ngDevMode ? [undefined, { debugName: "buttonType" }] : []));
        /** Whether button is in toggled state */
        this.toggled = input(false, { ...(ngDevMode ? { debugName: "toggled" } : {}), transform: booleanAttribute });
        /** arialabel, tooltip for button, intended to be used when the button only contains an icon */
        this.title = input(...(ngDevMode ? [undefined, { debugName: "title" }] : []));
        /** @deprecated use toggled input property instead
         * aria-selected for accessibility to the native HTML button
         */
        this.ariaSelected = input(false, { ...(ngDevMode ? { debugName: "ariaSelected" } : {}), transform: booleanAttribute });
        /** aria-disabled for accessibility to the native HTML button */
        this.ariaDisabled = input(false, { ...(ngDevMode ? { debugName: "ariaDisabled" } : {}), transform: booleanAttribute });
        /** propagate aria-expanded for accessibility to the native HTML button */
        this.ariaExpanded = input(false, { ...(ngDevMode ? { debugName: "ariaExpanded" } : {}), transform: booleanAttribute });
        /** propagate aria-controls for accessibility to the native HTML button */
        this.ariaControlsId = input(...(ngDevMode ? [undefined, { debugName: "ariaControlsId" }] : []));
        /** @deprecated use toggled input property instead
         * propagate aria-pressed for accessibility to the native HTML button
         */
        this.ariaPressed = input(false, { ...(ngDevMode ? { debugName: "ariaPressed" } : {}), transform: booleanAttribute });
        /** Specifies the type to the native HTML button */
        this.type = input(...(ngDevMode ? [undefined, { debugName: "type" }] : []));
        /** Specifies an initial value to the native HTML button */
        this.value = input(...(ngDevMode ? [undefined, { debugName: "value" }] : []));
        /** Event sent when button is clicked */
        this.buttonClicked = output();
        /** @hidden Computed to determine effective fdType (buttonType overrides fdType if provided) */
        this._effectiveFdType = computed(() => this.buttonType() || this.fdType(), ...(ngDevMode ? [{ debugName: "_effectiveFdType" }] : []));
        /** @hidden Computed to determine effective toggled state */
        this._effectiveToggled = computed(() => this.toggled() || this.ariaPressed() || this.ariaSelected(), ...(ngDevMode ? [{ debugName: "_effectiveToggled" }] : []));
        warnOnce("Platform's ButtonComponent is deprecated and will be removed in the next major release. Consider using Core's ButtonComponent instead.");
        // Warn about deprecated inputs
        effect(() => {
            if (this.ariaSelected()) {
                warnOnce('Property ariaSelected is deprecated. Use `toggled` input property instead.');
            }
        });
        effect(() => {
            if (this.ariaPressed()) {
                warnOnce('Property ariaPressed is deprecated. Use `toggled` input property instead.');
            }
        });
    }
    /**
     * Programmatically set the disabled state.
     * Implements ButtonModel interface.
     * Note: Cannot directly set signal inputs. This method exists for interface compatibility.
     */
    setDisabled(_value) {
        console.warn('setDisabled() cannot modify signal input. Use template binding [disabled]="value" instead.');
    }
    /**
     * Get the current disabled state.
     * Implements ButtonModel interface.
     */
    isDisabled() {
        return this.disabled();
    }
    /**
     * Programmatically set the button type.
     * Implements ButtonModel interface.
     * Note: Cannot directly set signal inputs. This method exists for interface compatibility.
     */
    setFdType(_value) {
        console.warn('setFdType() cannot modify signal input. Use template binding [fdType]="value" instead.');
    }
    /**
     * Get the current button type.
     * Implements ButtonModel interface.
     */
    getFdType() {
        return this._effectiveFdType();
    }
    /**
     * No-op method for interface compatibility.
     * Implements ButtonModel interface.
     * Signal-based components don't need manual change detection.
     */
    markForCheck() {
        // No-op: signals automatically trigger change detection
    }
    /**
     * Handles button click
     */
    onBtnClick($event) {
        this.buttonClicked.emit($event);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.0", type: ButtonComponent, isStandalone: true, selector: "fdp-button", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "ariaLabelledBy", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedBy: { classPropertyName: "ariaDescribedBy", publicName: "ariaDescribedBy", isSignal: true, isRequired: false, transformFunction: null }, glyphPosition: { classPropertyName: "glyphPosition", publicName: "glyphPosition", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, glyph: { classPropertyName: "glyph", publicName: "glyph", isSignal: true, isRequired: false, transformFunction: null }, glyphFont: { classPropertyName: "glyphFont", publicName: "glyphFont", isSignal: true, isRequired: false, transformFunction: null }, fdType: { classPropertyName: "fdType", publicName: "fdType", isSignal: true, isRequired: false, transformFunction: null }, buttonType: { classPropertyName: "buttonType", publicName: "buttonType", isSignal: true, isRequired: false, transformFunction: null }, toggled: { classPropertyName: "toggled", publicName: "toggled", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, ariaSelected: { classPropertyName: "ariaSelected", publicName: "ariaSelected", isSignal: true, isRequired: false, transformFunction: null }, ariaDisabled: { classPropertyName: "ariaDisabled", publicName: "ariaDisabled", isSignal: true, isRequired: false, transformFunction: null }, ariaExpanded: { classPropertyName: "ariaExpanded", publicName: "ariaExpanded", isSignal: true, isRequired: false, transformFunction: null }, ariaControlsId: { classPropertyName: "ariaControlsId", publicName: "ariaControlsId", isSignal: true, isRequired: false, transformFunction: null }, ariaPressed: { classPropertyName: "ariaPressed", publicName: "ariaPressed", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { buttonClicked: "buttonClicked" }, host: { attributes: { "role": "button" }, properties: { "attr.tabindex": "-1" } }, providers: [
            {
                provide: FDP_BUTTON,
                useExisting: ButtonComponent
            }
        ], ngImport: i0, template: "<button\n    #fdButton\n    fd-button\n    [attr.id]=\"id()\"\n    [attr.name]=\"name()\"\n    [ariaLabel]=\"ariaLabel()\"\n    [attr.aria-controls]=\"ariaControlsId()\"\n    [attr.aria-expanded]=\"ariaExpanded()\"\n    [attr.aria-disabled]=\"ariaDisabled()\"\n    [attr.title]=\"!!glyph() && !label() ? title() : null\"\n    [attr.value]=\"value()\"\n    [glyphPosition]=\"glyphPosition()\"\n    [label]=\"label()\"\n    [type]=\"type()\"\n    [toggled]=\"_effectiveToggled()\"\n    [glyph]=\"glyph()\"\n    [glyphFont]=\"glyphFont()\"\n    [disabled]=\"disabled()\"\n    [fdType]=\"_effectiveFdType()\"\n    class=\"fd-ellipsis\"\n    [class.is-disabled]=\"ariaDisabled()\"\n    [style.width]=\"width()\"\n    (click)=\"onBtnClick($event)\"\n></button>\n", styles: [":host{display:inline-block}:host(:focus){outline:none}.fd-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}\n"], dependencies: [{ kind: "component", type: ButtonComponent$1, selector: "button[fd-button], a[fd-button], span[fd-button]", inputs: ["id"], exportAs: ["fd-button"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: ButtonComponent, decorators: [{
            type: Component,
            args: [{ selector: 'fdp-button', providers: [
                        {
                            provide: FDP_BUTTON,
                            useExisting: ButtonComponent
                        }
                    ], imports: [ButtonComponent$1], host: {
                        role: 'button',
                        '[attr.tabindex]': '-1'
                    }, template: "<button\n    #fdButton\n    fd-button\n    [attr.id]=\"id()\"\n    [attr.name]=\"name()\"\n    [ariaLabel]=\"ariaLabel()\"\n    [attr.aria-controls]=\"ariaControlsId()\"\n    [attr.aria-expanded]=\"ariaExpanded()\"\n    [attr.aria-disabled]=\"ariaDisabled()\"\n    [attr.title]=\"!!glyph() && !label() ? title() : null\"\n    [attr.value]=\"value()\"\n    [glyphPosition]=\"glyphPosition()\"\n    [label]=\"label()\"\n    [type]=\"type()\"\n    [toggled]=\"_effectiveToggled()\"\n    [glyph]=\"glyph()\"\n    [glyphFont]=\"glyphFont()\"\n    [disabled]=\"disabled()\"\n    [fdType]=\"_effectiveFdType()\"\n    class=\"fd-ellipsis\"\n    [class.is-disabled]=\"ariaDisabled()\"\n    [style.width]=\"width()\"\n    (click)=\"onBtnClick($event)\"\n></button>\n", styles: [":host{display:inline-block}:host(:focus){outline:none}.fd-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}\n"] }]
        }], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledBy", required: false }] }], ariaDescribedBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaDescribedBy", required: false }] }], glyphPosition: [{ type: i0.Input, args: [{ isSignal: true, alias: "glyphPosition", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], glyph: [{ type: i0.Input, args: [{ isSignal: true, alias: "glyph", required: false }] }], glyphFont: [{ type: i0.Input, args: [{ isSignal: true, alias: "glyphFont", required: false }] }], fdType: [{ type: i0.Input, args: [{ isSignal: true, alias: "fdType", required: false }] }], buttonType: [{ type: i0.Input, args: [{ isSignal: true, alias: "buttonType", required: false }] }], toggled: [{ type: i0.Input, args: [{ isSignal: true, alias: "toggled", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], ariaSelected: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaSelected", required: false }] }], ariaDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaDisabled", required: false }] }], ariaExpanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaExpanded", required: false }] }], ariaControlsId: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaControlsId", required: false }] }], ariaPressed: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaPressed", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], buttonClicked: [{ type: i0.Output, args: ["buttonClicked"] }] } });
class DeprecatedButtonAriaSelected {
    constructor() {
        /** @hidden */
        this.message = 'ariaSelected input property is deprecated.';
        /** @hidden */
        this.alternative = {
            name: 'Use [toggled] input property instead',
            link: ['/platform', 'button'],
            fragment: 'state'
        };
    }
}
class DeprecatedButtonAriaPressed {
    constructor() {
        /** @hidden */
        this.message = 'ariaPressed input property is deprecated.';
        /** @hidden */
        this.alternative = {
            name: 'Use [toggled] input property instead',
            link: ['/platform', 'button'],
            fragment: 'state'
        };
    }
}

/**
 * @deprecated
 * Use direct imports of components and directives.
 */
class PlatformButtonModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: PlatformButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.0", ngImport: i0, type: PlatformButtonModule, imports: [ButtonComponent, ContentDensityModule], exports: [ButtonComponent, ContentDensityModule] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: PlatformButtonModule, imports: [ButtonComponent, ContentDensityModule, ContentDensityModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: PlatformButtonModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [ButtonComponent, ContentDensityModule],
                    exports: [ButtonComponent, ContentDensityModule]
                }]
        }] });

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

export { ButtonComponent, DeprecatedButtonAriaPressed, DeprecatedButtonAriaSelected, FDP_BUTTON, PlatformButtonModule };
//# sourceMappingURL=fundamental-ngx-platform-button.mjs.map
