/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes} checked by tsc
 */
import { Directive, ElementRef, Input, NgModule } from '@angular/core';
var IgxFocusDirective = /** @class */ (function () {
    function IgxFocusDirective(element) {
        this.element = element;
        this.focusState = true;
    }
    Object.defineProperty(IgxFocusDirective.prototype, "focused", {
        get: /**
         * @return {?}
         */
        function () {
            return this.focusState;
        },
        set: /**
         * @param {?} val
         * @return {?}
         */
        function (val) {
            this.focusState = val;
            this.trigger();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxFocusDirective.prototype, "nativeElement", {
        get: /**
         * @return {?}
         */
        function () {
            return this.element.nativeElement;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @return {?}
     */
    IgxFocusDirective.prototype.trigger = /**
     * @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, },
    ]; };
    IgxFocusDirective.propDecorators = {
        "focused": [{ type: Input, args: ['igxFocus',] },],
    };
    return IgxFocusDirective;
}());
export { IgxFocusDirective };
function IgxFocusDirective_tsickle_Closure_declarations() {
    /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
    IgxFocusDirective.decorators;
    /**
     * @nocollapse
     * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>)})>}
     */
    IgxFocusDirective.ctorParameters;
    /** @type {!Object<string,!Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
    IgxFocusDirective.propDecorators;
    /** @type {?} */
    IgxFocusDirective.prototype.focusState;
    /** @type {?} */
    IgxFocusDirective.prototype.element;
}
var IgxFocusModule = /** @class */ (function () {
    function IgxFocusModule() {
    }
    IgxFocusModule.decorators = [
        { type: NgModule, args: [{
                    declarations: [IgxFocusDirective],
                    exports: [IgxFocusDirective]
                },] },
    ];
    return IgxFocusModule;
}());
export { IgxFocusModule };
function IgxFocusModule_tsickle_Closure_declarations() {
    /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
    IgxFocusModule.decorators;
    /**
     * @nocollapse
     * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>)})>}
     */
    IgxFocusModule.ctorParameters;
}

//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9jdXMuZGlyZWN0aXZlLmpzIiwic291cmNlUm9vdCI6Im5nOi8vaWduaXRldWktYW5ndWxhci8iLCJzb3VyY2VzIjpbImxpYi9kaXJlY3RpdmVzL2ZvY3VzL2ZvY3VzLmRpcmVjdGl2ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxVQUFVLEVBQUUsS0FBSyxFQUFFLFFBQVEsRUFBRSxNQUFNLGVBQWUsQ0FBQzs7SUF3Qm5FLDJCQUFvQixPQUFtQjtRQUFuQixZQUFPLEdBQVAsT0FBTyxDQUFZOzBCQWhCbEIsSUFBSTtLQWdCbUI7MEJBYnhDLHNDQUFPOzs7OztZQUNQLE1BQU0sQ0FBQyxJQUFJLENBQUMsVUFBVSxDQUFDOzs7Ozs7UUFHM0IsVUFBWSxHQUFZO1lBQ3BCLElBQUksQ0FBQyxVQUFVLEdBQUcsR0FBRyxDQUFDO1lBQ3RCLElBQUksQ0FBQyxPQUFPLEVBQUUsQ0FBQztTQUNsQjs7OztJQUVELHNCQUFJLDRDQUFhOzs7O1FBQWpCO1lBQ0ksTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsYUFBYSxDQUFDO1NBQ3JDOzs7T0FBQTs7OztJQUlELG1DQUFPOzs7SUFBUDtRQUFBLGlCQUlDO1FBSEcsRUFBRSxDQ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