(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@rxweb/framework'), require('@angular/common')) :
    typeof define === 'function' && define.amd ? define('@rxweb/angular/focus', ['exports', '@angular/core', '@rxweb/framework', '@angular/common'], factory) :
    (global = global || self, factory((global.rxweb = global.rxweb || {}, global.rxweb.angular = global.rxweb.angular || {}, global.rxweb.angular.focus = {}), global['@angular/core'], global['@rxweb/framework'], global.ng.common));
}(this, (function (exports, core, framework, common) { 'use strict';

    var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
        if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
        else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
        return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    var RxFocusDirective = /** @class */ (function () {
        function RxFocusDirective(elementRef) {
            this.elementRef = elementRef;
            this.element = this.elementRef.nativeElement;
        }
        Object.defineProperty(RxFocusDirective.prototype, "focus", {
            get: function () {
                return this._focus;
            },
            set: function (value) {
                this._focus = value;
                if (this.focusDirective)
                    this.focusDirective.bind(this._focus);
            },
            enumerable: true,
            configurable: true
        });
        ;
        RxFocusDirective.prototype.ngAfterViewInit = function () {
            this.focusDirective = new framework.FocusDirective(this.element);
            this.focusDirective.bind(this.focus === "" || this.focus);
        };
        RxFocusDirective.prototype.ngOnDestroy = function () {
            this.element = undefined;
        };
        RxFocusDirective.ctorParameters = function () { return [
            { type: core.ElementRef }
        ]; };
        __decorate([
            core.Input()
        ], RxFocusDirective.prototype, "componentId", void 0);
        __decorate([
            core.Input('rxFocus')
        ], RxFocusDirective.prototype, "focus", null);
        RxFocusDirective = __decorate([
            core.Directive({
                selector: '[rxFocus]',
            })
        ], RxFocusDirective);
        return RxFocusDirective;
    }());
    var RxFocusModule = /** @class */ (function () {
        function RxFocusModule() {
        }
        RxFocusModule = __decorate([
            core.NgModule({
                imports: [common.CommonModule],
                exports: [RxFocusDirective],
                declarations: [RxFocusDirective]
            })
        ], RxFocusModule);
        return RxFocusModule;
    }());

    exports.RxFocusDirective = RxFocusDirective;
    exports.RxFocusModule = RxFocusModule;

    Object.defineProperty(exports, '__esModule', { value: true });

})));
//# sourceMappingURL=rxweb-angular-focus.umd.js.map
