"use strict";
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
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 __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
var core_1 = require("@angular/core");
var typescript_angular_utilities_1 = require("typescript-angular-utilities");
var __object = typescript_angular_utilities_1.services.object;
var __array = typescript_angular_utilities_1.services.array;
var __guid = typescript_angular_utilities_1.services.guid;
var validationInput_1 = require("../validationInput");
var componentValidator_service_1 = require("../../../services/componentValidator/componentValidator.service");
var form_1 = require("../../form/form");
var input_1 = require("../input");
var TextboxComponent = (function (_super) {
    __extends(TextboxComponent, _super);
    function TextboxComponent(rlForm, componentValidator, object, array, guid) {
        var _this = _super.call(this, rlForm, componentValidator, object, array, guid) || this;
        _this.inputType = 'textbox';
        return _this;
    }
    TextboxComponent.prototype.ngOnInit = function () {
        _super.prototype.ngOnInit.call(this);
        this.value = this.value || '';
    };
    TextboxComponent.prototype.onChange = function (text) {
        this.setValue(text);
    };
    TextboxComponent.prototype.focus = function () {
        this.input.nativeElement.focus();
    };
    return TextboxComponent;
}(validationInput_1.ValidatedInputComponent));
__decorate([
    core_1.Input(),
    __metadata("design:type", Number)
], TextboxComponent.prototype, "maxlength", void 0);
__decorate([
    core_1.ViewChild('input'),
    __metadata("design:type", core_1.ElementRef)
], TextboxComponent.prototype, "input", void 0);
TextboxComponent = __decorate([
    core_1.Component({
        selector: 'rlTextbox',
        template: require('./textbox.html'),
        inputs: validationInput_1.validationInputs,
        outputs: validationInput_1.baseOutputs,
        providers: [componentValidator_service_1.ComponentValidator],
        animations: input_1.baseAnimations,
    }),
    __param(0, core_1.Optional()),
    __metadata("design:paramtypes", [form_1.FormComponent,
        componentValidator_service_1.ComponentValidator, __object.ObjectUtility, __array.ArrayUtility, __guid.GuidService])
], TextboxComponent);
exports.TextboxComponent = TextboxComponent;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGV4dGJveC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRleHRib3gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsc0NBQTBGO0FBRTFGLDZFQUF3RDtBQUN4RCxJQUFPLFFBQVEsR0FBRyx1Q0FBUSxDQUFDLE1BQU0sQ0FBQztBQUNsQyxJQUFPLE9BQU8sR0FBRyx1Q0FBUSxDQUFDLEtBQUssQ0FBQztBQUNoQyxJQUFPLE1BQU0sR0FBRyx1Q0FBUSxDQUFDLElBQUksQ0FBQztBQUU5QixzREFBNEY7QUFDNUYsOEdBQXFHO0FBQ3JHLHdDQUFnRDtBQUVoRCxrQ0FBMEM7QUFVMUMsSUFBYSxnQkFBZ0I7SUFBUyxvQ0FBK0I7SUFLcEUsMEJBQXlCLE1BQXFCLEVBQzFDLGtCQUFzQyxFQUN0QyxNQUE4QixFQUM5QixLQUEyQixFQUMzQixJQUF3QjtRQUo1QixZQUtDLGtCQUFNLE1BQU0sRUFBRSxrQkFBa0IsRUFBRSxNQUFNLEVBQUUsS0FBSyxFQUFFLElBQUksQ0FBQyxTQUV0RDtRQURBLEtBQUksQ0FBQyxTQUFTLEdBQUcsU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