All files / src/fieldcontrols ShortText.js

0% Statements 0/21
0% Branches 0/32
0% Functions 0/3
0% Lines 0/17
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31                                                             
"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;
};
Object.defineProperty(exports, "__esModule", { value: true });
const aurelia_framework_1 = require("aurelia-framework");
const FieldBaseControl_1 = require("./FieldBaseControl");
const aurelia_validation_1 = require("aurelia-validation");
const material_components_web_1 = require("material-components-web/dist/material-components-web");
let ShortText = class ShortText extends FieldBaseControl_1.FieldBaseControl {
    get rules() {
        const parentRules = super.rules;
        let thisRules = this.settings && aurelia_validation_1.ValidationRules
            .ensure('value')
            .minLength(this.settings.MinLength || 0)
            .maxLength(this.settings.MaxLength || Infinity)
            .matches(this.settings.Regex && new RegExp(this.settings.Regex) || new RegExp('')).rules || [];
        return [...parentRules, ...thisRules];
    }
    attached() {
        this.mdcTextField = new material_components_web_1.textfield.MDCTextfield(this.textfield);
    }
};
ShortText = __decorate([
    aurelia_framework_1.customElement('short-text')
], ShortText);
exports.ShortText = ShortText;
//# sourceMappingURL=ShortText.js.map