import { ENTER, SPACE } from '@angular/cdk/keycodes';
import * as i0 from '@angular/core';
import { inject, TemplateRef, Directive, EventEmitter, HostListener, ContentChild, Output, Input, ChangeDetectionStrategy, ViewEncapsulation, Component, NgModule } from '@angular/core';
import { warnOnce, KeyUtil } from '@fundamental-ngx/cdk/utils';
import { FD_DEFAULT_ICON_FONT_FAMILY } from '@fundamental-ngx/core/icon';
import { ObjectStatusComponent as ObjectStatusComponent$1 } from '@fundamental-ngx/core/object-status';

class PlatformObjectStatusTextDirective {
    constructor() {
        /**
         * Template reference.
         */
        this.templateRef = inject(TemplateRef);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PlatformObjectStatusTextDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
    static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.4", type: PlatformObjectStatusTextDirective, isStandalone: true, selector: "[fdpObjectStatusText]", ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PlatformObjectStatusTextDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: '[fdpObjectStatusText]',
                    standalone: true
                }]
        }] });
/**
 * @deprecated
 * Use `ObjectStatus` from `@fundamental-ngx/core/object-status` instead.
 */
class ObjectStatusComponent {
    /** @hidden */
    constructor() {
        /** Glyph font family */
        this.glyphFont = FD_DEFAULT_ICON_FONT_FAMILY;
        /** Whether to use secondary set of indication colors. */
        this.secondaryIndication = false;
        /** Event sent when button is clicked */
        this.objectStatusClick = new EventEmitter();
        warnOnce('ObjectStatusComponent is deprecated. Use ObjectStatusComponent from @fundamental-ngx/core instead.');
    }
    /** @hidden */
    _onKeydown($event) {
        if (this.clickable && KeyUtil.isKeyCode($event, [ENTER, SPACE])) {
            $event.preventDefault();
            this.objectStatusClick.emit($event);
        }
    }
    /**
     *  Handles button click
     */
    onObjectStatusClick($event) {
        if (this.clickable) {
            this.objectStatusClick.emit($event);
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: ObjectStatusComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.4", type: ObjectStatusComponent, isStandalone: true, selector: "fdp-object-status", inputs: { status: "status", glyph: "glyph", glyphFont: "glyphFont", indicationColor: "indicationColor", secondaryIndication: "secondaryIndication", clickable: "clickable", inverted: "inverted", large: "large", label: "label", ariaLabel: "ariaLabel", title: "title" }, outputs: { objectStatusClick: "objectStatusClick" }, host: { listeners: { "keydown": "_onKeydown($event)" } }, queries: [{ propertyName: "_textDirective", first: true, predicate: PlatformObjectStatusTextDirective, descendants: true }], ngImport: i0, template: "<span\n    fd-object-status\n    [attr.role]=\"clickable ? 'button' : null\"\n    [status]=\"status\"\n    [glyph]=\"glyph\"\n    [glyphFont]=\"glyphFont\"\n    [indicationColor]=\"indicationColor\"\n    [clickable]=\"clickable\"\n    [inverted]=\"inverted\"\n    [large]=\"large\"\n    [attr.aria-label]=\"ariaLabel\"\n    [attr.title]=\"title ? title : label\"\n    (click)=\"onObjectStatusClick($event)\"\n    [label]=\"label\"\n    [secondaryIndication]=\"secondaryIndication\"\n    [textTemplate]=\"_textDirective?.templateRef\"\n></span>\n", dependencies: [{ kind: "component", type: ObjectStatusComponent$1, selector: "[fd-object-status]", inputs: ["class", "status", "glyph", "glyphFont", "label", "glyphAriaLabel", "indicationColor", "clickable", "inverted", "large", "secondaryIndication", "textTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: ObjectStatusComponent, decorators: [{
            type: Component,
            args: [{ selector: 'fdp-object-status', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [ObjectStatusComponent$1], template: "<span\n    fd-object-status\n    [attr.role]=\"clickable ? 'button' : null\"\n    [status]=\"status\"\n    [glyph]=\"glyph\"\n    [glyphFont]=\"glyphFont\"\n    [indicationColor]=\"indicationColor\"\n    [clickable]=\"clickable\"\n    [inverted]=\"inverted\"\n    [large]=\"large\"\n    [attr.aria-label]=\"ariaLabel\"\n    [attr.title]=\"title ? title : label\"\n    (click)=\"onObjectStatusClick($event)\"\n    [label]=\"label\"\n    [secondaryIndication]=\"secondaryIndication\"\n    [textTemplate]=\"_textDirective?.templateRef\"\n></span>\n" }]
        }], ctorParameters: () => [], propDecorators: { status: [{
                type: Input
            }], glyph: [{
                type: Input
            }], glyphFont: [{
                type: Input
            }], indicationColor: [{
                type: Input
            }], secondaryIndication: [{
                type: Input
            }], clickable: [{
                type: Input
            }], inverted: [{
                type: Input
            }], large: [{
                type: Input
            }], label: [{
                type: Input
            }], ariaLabel: [{
                type: Input
            }], title: [{
                type: Input
            }], objectStatusClick: [{
                type: Output
            }], _textDirective: [{
                type: ContentChild,
                args: [PlatformObjectStatusTextDirective]
            }], _onKeydown: [{
                type: HostListener,
                args: ['keydown', ['$event']]
            }] } });

/**
 * @deprecated
 * Use `ObjectStatusComponent` import instead.
 */
class PlatformObjectStatusModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PlatformObjectStatusModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.4", ngImport: i0, type: PlatformObjectStatusModule, imports: [ObjectStatusComponent, PlatformObjectStatusTextDirective], exports: [ObjectStatusComponent, PlatformObjectStatusTextDirective] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PlatformObjectStatusModule, imports: [ObjectStatusComponent] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.4", ngImport: i0, type: PlatformObjectStatusModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [ObjectStatusComponent, PlatformObjectStatusTextDirective],
                    exports: [ObjectStatusComponent, PlatformObjectStatusTextDirective]
                }]
        }] });

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

export { ObjectStatusComponent, PlatformObjectStatusModule, PlatformObjectStatusTextDirective };
//# sourceMappingURL=fundamental-ngx-platform-object-status.mjs.map
