import * as i0 from '@angular/core';
import { InjectionToken, EventEmitter, HostBinding, Output, Input, 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 { BaseComponent } from '@fundamental-ngx/platform/shared';
import { ContentDensityModule } from '@fundamental-ngx/core/content-density';

const FDP_BUTTON = new InjectionToken('FdpButtonComponent');

/**
 * @deprecated
 * Button component is deprecated. Use `fd-button` from `@fundamental-ngx/core` instead.
 */
class ButtonComponent extends BaseComponent {
    /**
     * @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).'*/
    set buttonType(value) {
        this.fdType = value;
    }
    get buttonType() {
        return this.fdType;
    }
    /** @deprecated use toggled input property instead
     * aria-selected for acccesiblity to the native HTML button
     */
    set ariaSelected(value) {
        warnOnce('Property ariaSelected is deprecated. Use `toggled` input property instead.');
        this._ariaSelected = value;
    }
    get ariaSelected() {
        return this._ariaSelected;
    }
    /** @deprecated use toggled input property instead
     * propagate aria-pressed for accessiblity to the native HTML button
     */
    set ariaPressed(value) {
        warnOnce('Property ariaPressed is deprecated. Use `toggled` input property instead.');
        this._ariaPressed = value;
    }
    get ariaPressed() {
        return this._ariaPressed;
    }
    /** @hidden */
    constructor() {
        super();
        /** Position of glyph related to text */
        this.glyphPosition = 'before';
        /** Glyph font family */
        this.glyphFont = FD_DEFAULT_ICON_FONT_FAMILY;
        /** 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 = 'standard';
        /** Event sent when button is clicked */
        this.buttonClicked = new EventEmitter();
        /**
         * Take host element out of tab order, so that child button can
         * be properly focused on.
         */
        this.tabIndex = '-1';
        warnOnce("Platform's ButtonComponent is deprecated and will be removed in the next major release. Consider using Core's ButtonComponent instead.");
    }
    /**
     *  Handles button click
     */
    onBtnClick($event) {
        this.buttonClicked.emit($event);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.4", type: ButtonComponent, isStandalone: true, selector: "fdp-button", inputs: { glyphPosition: "glyphPosition", label: "label", glyph: "glyph", glyphFont: "glyphFont", buttonType: "buttonType", fdType: "fdType", toggled: "toggled", title: "title", ariaSelected: "ariaSelected", ariaDisabled: "ariaDisabled", ariaExpanded: "ariaExpanded", ariaControlsId: "ariaControlsId", ariaPressed: "ariaPressed", type: "type", value: "value" }, outputs: { buttonClicked: "buttonClicked" }, host: { attributes: { "role": "button" }, properties: { "attr.tabindex": "this.tabIndex" } }, providers: [
            {
                provide: FDP_BUTTON,
                useExisting: ButtonComponent
            }
        ], usesInheritance: true, 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]=\"toggled || ariaPressed || ariaSelected\"\n    [glyph]=\"glyph\"\n    [glyphFont]=\"glyphFont\"\n    [disabled]=\"disabled\"\n    [fdType]=\"buttonType\"\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: ["class", "id"], exportAs: ["fd-button"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: ButtonComponent, decorators: [{
            type: Component,
            args: [{ selector: 'fdp-button', providers: [
                        {
                            provide: FDP_BUTTON,
                            useExisting: ButtonComponent
                        }
                    ], imports: [ButtonComponent$1], host: {
                        role: 'button'
                    }, 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]=\"toggled || ariaPressed || ariaSelected\"\n    [glyph]=\"glyph\"\n    [glyphFont]=\"glyphFont\"\n    [disabled]=\"disabled\"\n    [fdType]=\"buttonType\"\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: { glyphPosition: [{
                type: Input
            }], label: [{
                type: Input
            }], glyph: [{
                type: Input
            }], glyphFont: [{
                type: Input
            }], buttonType: [{
                type: Input
            }], fdType: [{
                type: Input
            }], toggled: [{
                type: Input
            }], title: [{
                type: Input
            }], ariaSelected: [{
                type: Input
            }], ariaDisabled: [{
                type: Input
            }], ariaExpanded: [{
                type: Input
            }], ariaControlsId: [{
                type: Input
            }], ariaPressed: [{
                type: Input
            }], type: [{
                type: Input
            }], value: [{
                type: Input
            }], buttonClicked: [{
                type: Output
            }], tabIndex: [{
                type: HostBinding,
                args: ['attr.tabindex']
            }] } });
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: "20.1.4", ngImport: i0, type: PlatformButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.4", ngImport: i0, type: PlatformButtonModule, imports: [ButtonComponent, ContentDensityModule], exports: [ButtonComponent, ContentDensityModule] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PlatformButtonModule, imports: [ButtonComponent, ContentDensityModule, ContentDensityModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", 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
