import * as i0 from '@angular/core';
import { EventEmitter, HostBinding, Output, Input, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
import { warnOnce } from '@fundamental-ngx/cdk/utils';
import { ButtonComponent } 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';

/**
 * @deprecated
 * Button component is deprecated. Use `fd-button` from `@fundamental-ngx/core/button` with `@fundamental-ngx/core/menu` instead.
 */
class MenuButtonComponent extends BaseComponent {
    /** @hidden */
    constructor(_elementRef) {
        super();
        this._elementRef = _elementRef;
        /** Glyph font family */
        this.iconFont = FD_DEFAULT_ICON_FONT_FAMILY;
        /** Event sent when menu-button is clicked */
        this.buttonClicked = new EventEmitter();
        warnOnce('MenuButtonComponent is deprecated. Use `fd-button` from `@fundamental-ngx/core/button` with `@fundamental-ngx/core/menu` instead.');
    }
    /**
     * @hidden disabling fd-button does not disables menu button.
     * because menu trigger is on menu-button; menu gets open.
     * to prevent this, need to apply disabled at menu-button level as well.
     */
    get menuButtonDisabled() {
        return this.disabled;
    }
    /** @hidden tabindex for button. */
    get tabindex() {
        return this.disabled ? -1 : 0;
    }
    /**
     *  Handles menu-button click
     */
    onButtonClick($event) {
        this.buttonClicked.emit($event);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MenuButtonComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.4", type: MenuButtonComponent, isStandalone: true, selector: "fdp-menu-button", inputs: { label: "label", title: "title", icon: "icon", iconFont: "iconFont", type: "type" }, outputs: { buttonClicked: "buttonClicked" }, host: { properties: { "class.fd-menu-button--disabled": "this.menuButtonDisabled" } }, usesInheritance: true, ngImport: i0, template: "<button\n    fd-button\n    [attr.id]=\"id\"\n    [attr.name]=\"name\"\n    [fdMenu]=\"true\"\n    [label]=\"label\"\n    [glyph]=\"icon\"\n    [glyphFont]=\"iconFont\"\n    [disabled]=\"disabled\"\n    [attr.aria-disabled]=\"disabled\"\n    [attr.aria-labelledby]=\"ariaLabelledBy ? ariaLabelledBy + ' ' + id : null\"\n    [attr.aria-label]=\"ariaLabel\"\n    (click)=\"onButtonClick($event)\"\n    [fdType]=\"type\"\n    [attr.tabindex]=\"tabindex\"\n    [attr.title]=\"title\"\n    [attr.aria-haspopup]=\"true\"\n>\n    <ng-content></ng-content>\n</button>\n", styles: [":host{display:inline-block}:host(.fd-menu-button--disabled){cursor:not-allowed;pointer-events:none}\n"], dependencies: [{ kind: "component", type: ButtonComponent, selector: "button[fd-button], a[fd-button], span[fd-button]", inputs: ["class", "id"], exportAs: ["fd-button"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: MenuButtonComponent, decorators: [{
            type: Component,
            args: [{ selector: 'fdp-menu-button', changeDetection: ChangeDetectionStrategy.OnPush, imports: [ButtonComponent], template: "<button\n    fd-button\n    [attr.id]=\"id\"\n    [attr.name]=\"name\"\n    [fdMenu]=\"true\"\n    [label]=\"label\"\n    [glyph]=\"icon\"\n    [glyphFont]=\"iconFont\"\n    [disabled]=\"disabled\"\n    [attr.aria-disabled]=\"disabled\"\n    [attr.aria-labelledby]=\"ariaLabelledBy ? ariaLabelledBy + ' ' + id : null\"\n    [attr.aria-label]=\"ariaLabel\"\n    (click)=\"onButtonClick($event)\"\n    [fdType]=\"type\"\n    [attr.tabindex]=\"tabindex\"\n    [attr.title]=\"title\"\n    [attr.aria-haspopup]=\"true\"\n>\n    <ng-content></ng-content>\n</button>\n", styles: [":host{display:inline-block}:host(.fd-menu-button--disabled){cursor:not-allowed;pointer-events:none}\n"] }]
        }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { label: [{
                type: Input
            }], title: [{
                type: Input
            }], icon: [{
                type: Input
            }], iconFont: [{
                type: Input
            }], type: [{
                type: Input
            }], buttonClicked: [{
                type: Output
            }], menuButtonDisabled: [{
                type: HostBinding,
                args: ['class.fd-menu-button--disabled']
            }] } });

class PlatformMenuButtonModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PlatformMenuButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.4", ngImport: i0, type: PlatformMenuButtonModule, imports: [MenuButtonComponent, ContentDensityModule], exports: [MenuButtonComponent, ContentDensityModule] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PlatformMenuButtonModule, imports: [MenuButtonComponent, ContentDensityModule, ContentDensityModule] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PlatformMenuButtonModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [MenuButtonComponent, ContentDensityModule],
                    exports: [MenuButtonComponent, ContentDensityModule]
                }]
        }] });

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

export { MenuButtonComponent, PlatformMenuButtonModule };
//# sourceMappingURL=fundamental-ngx-platform-menu-button.mjs.map
