/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
 */
import { Directive, ElementRef, Input, NgModule, Optional, Inject, Self } from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
var IgxFocusDirective = /** @class */ (function () {
    function IgxFocusDirective(element, comp) {
        this.element = element;
        this.comp = comp;
        this.focusState = true;
    }
    Object.defineProperty(IgxFocusDirective.prototype, "focused", {
        /**
         * Returns the state of the igxFocus.
         * ```typescript
         * @ViewChild('focusContainer', {read: IgxFocusDirective})
         * public igxFocus: IgxFocusDirective;
         * let isFocusOn = this.igxFocus.focused;
         * ```
         * @memberof IgxFocusDirective
         */
        get: /**
         * Returns the state of the igxFocus.
         * ```typescript
         * \@ViewChild('focusContainer', {read: IgxFocusDirective})
         * public igxFocus: IgxFocusDirective;
         * let isFocusOn = this.igxFocus.focused;
         * ```
         * \@memberof IgxFocusDirective
         * @return {?}
         */
        function () {
            return this.focusState;
        },
        /**
         * Sets the state of the igxFocus.
         * ```html
         * <igx-input-group >
         *  <input #focusContainer igxInput [igxFocus]="true"/>
         * </igx-input-group>
         * ```
         * @memberof IgxFocusDirective
         */
        set: /**
         * Sets the state of the igxFocus.
         * ```html
         * <igx-input-group >
         *  <input #focusContainer igxInput [igxFocus]="true"/>
         * </igx-input-group>
         * ```
         * \@memberof IgxFocusDirective
         * @param {?} val
         * @return {?}
         */
        function (val) {
            this.focusState = val;
            this.trigger();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxFocusDirective.prototype, "nativeElement", {
        /**
         * Gets the native element of the igxFocus.
         * ```typescript
         * @ViewChild('focusContainer', {read: IgxFocusDirective})
         * public igxFocus: IgxFocusDirective;
         * let igxFocusNativeElement = this.igxFocus.nativeElement;
         * ```
         * @memberof IgxFocusDirective
         */
        get: /**
         * Gets the native element of the igxFocus.
         * ```typescript
         * \@ViewChild('focusContainer', {read: IgxFocusDirective})
         * public igxFocus: IgxFocusDirective;
         * let igxFocusNativeElement = this.igxFocus.nativeElement;
         * ```
         * \@memberof IgxFocusDirective
         * @return {?}
         */
        function () {
            if (this.comp && this.comp[0] && this.comp[0].getEditElement) {
                return ((/** @type {?} */ (this.comp[0]))).getEditElement();
            }
            return this.element.nativeElement;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * Triggers the igxFocus state.
     * ```typescript
     * @ViewChild('focusContainer', {read: IgxFocusDirective})
     * public igxFocus: IgxFocusDirective;
     * this.igxFocus.trigger();
     * ```
     * @memberof IgxFocusDirective
     */
    /**
     * Triggers the igxFocus state.
     * ```typescript
     * \@ViewChild('focusContainer', {read: IgxFocusDirective})
     * public igxFocus: IgxFocusDirective;
     * this.igxFocus.trigger();
     * ```
     * \@memberof IgxFocusDirective
     * @return {?}
     */
    IgxFocusDirective.prototype.trigger = /**
     * Triggers the igxFocus state.
     * ```typescript
     * \@ViewChild('focusContainer', {read: IgxFocusDirective})
     * public igxFocus: IgxFocusDirective;
     * this.igxFocus.trigger();
     * ```
     * \@memberof IgxFocusDirective
     * @return {?}
     */
    function () {
        var _this = this;
        if (this.focusState) {
            requestAnimationFrame(function () { return _this.nativeElement.focus(); });
        }
    };
    IgxFocusDirective.decorators = [
        { type: Directive, args: [{
                    exportAs: 'igxFocus',
                    selector: '[igxFocus]'
                },] }
    ];
    /** @nocollapse */
    IgxFocusDirective.ctorParameters = function () { return [
        { type: ElementRef },
        { type: Array, decorators: [{ type: Inject, args: [NG_VALUE_ACCESSOR,] }, { type: Self }, { type: Optional }] }
    ]; };
    IgxFocusDirective.propDecorators = {
        focused: [{ type: Input, args: ['igxFocus',] }]
    };
    return IgxFocusDirective;
}());
export { IgxFocusDirective };
if (false) {
    /**
     * @type {?}
     * @private
     */
    IgxFocusDirective.prototype.focusState;
    /**
     * @type {?}
     * @private
     */
    IgxFocusDirective.prototype.element;
    /**
     * @type {?}
     * @private
     */
    IgxFocusDirective.prototype.comp;
}
/**
 * @hidden
 */
var IgxFocusModule = /** @class */ (function () {
    function IgxFocusModule() {
    }
    IgxFocusModule.decorators = [
        { type: NgModule, args: [{
                    declarations: [IgxFocusDirective],
                    exports: [IgxFocusDirective]
                },] }
    ];
    return IgxFocusModule;
}());
export { IgxFocusModule };
//# sourceMappingURL=data:application/json;base64, 