/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes} checked by tsc
 */
import { Directive, ElementRef, HostListener, Input, NgModule } from '@angular/core';
var IgxTextSelectionDirective = /** @class */ (function () {
    function IgxTextSelectionDirective(element) {
        this.element = element;
        this.selectionState = true;
    }
    Object.defineProperty(IgxTextSelectionDirective.prototype, "selected", {
        get: /**
         * @return {?}
         */
        function () {
            return this.selectionState;
        },
        set: /**
         * @param {?} val
         * @return {?}
         */
        function (val) {
            this.selectionState = val;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxTextSelectionDirective.prototype, "nativeElement", {
        get: /**
         * @return {?}
         */
        function () {
            return this.element.nativeElement;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * @return {?}
     */
    IgxTextSelectionDirective.prototype.onFocus = /**
     * @return {?}
     */
    function () {
        this.trigger();
    };
    /**
     * @return {?}
     */
    IgxTextSelectionDirective.prototype.trigger = /**
     * @return {?}
     */
    function () {
        var _this = this;
        if (this.selected && this.nativeElement.value.length) {
            requestAnimationFrame(function () { return _this.nativeElement.setSelectionRange(0, _this.nativeElement.value.length); });
        }
    };
    IgxTextSelectionDirective.decorators = [
        { type: Directive, args: [{
                    exportAs: 'igxTextSelection',
                    selector: '[igxTextSelection]'
                },] },
    ];
    /** @nocollapse */
    IgxTextSelectionDirective.ctorParameters = function () { return [
        { type: ElementRef, },
    ]; };
    IgxTextSelectionDirective.propDecorators = {
        "selected": [{ type: Input, args: ['igxTextSelection',] },],
        "onFocus": [{ type: HostListener, args: ['focus',] },],
    };
    return IgxTextSelectionDirective;
}());
export { IgxTextSelectionDirective };
function IgxTextSelectionDirective_tsickle_Closure_declarations() {
    /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
    IgxTextSelectionDirective.decorators;
    /**
     * @nocollapse
     * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>)})>}
     */
    IgxTextSelectionDirective.ctorParameters;
    /** @type {!Object<string,!Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
    IgxTextSelectionDirective.propDecorators;
    /** @type {?} */
    IgxTextSelectionDirective.prototype.selectionState;
    /** @type {?} */
    IgxTextSelectionDirective.prototype.element;
}
var IgxTextSelectionModule = /** @class */ (function () {
    function IgxTextSelectionModule() {
    }
    IgxTextSelectionModule.decorators = [
        { type: NgModule, args: [{
                    declarations: [IgxTextSelectionDirective],
                    exports: [IgxTextSelectionDirective]
                },] },
    ];
    return IgxTextSelectionModule;
}());
export { IgxTextSelectionModule };
function IgxTextSelectionModule_tsickle_Closure_declarations() {
    /** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
    IgxTextSelectionModule.decorators;
    /**
     * @nocollapse
     * @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>)})>}
     */
    IgxTextSelectionModule.ctorParameters;
}

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