@mokmaard/dar-component-object
Version:
for creating flow
69 lines • 2.21 kB
JavaScript
;
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 });
exports.TextField = void 0;
const enum_1 = require("../enum");
const Field_1 = require("./Field");
const class_validator_1 = require("class-validator");
class TextField extends Field_1.Field {
maxLength = 255;
minLength = 0;
isTextArea = false;
rows = 4;
values = [];
constructor() {
super();
this.setType(enum_1.FieldType.TEXT);
}
setIsTextArea(isTextArea) {
this.isTextArea = isTextArea;
return this;
}
getIsTextArea() {
return this.isTextArea;
}
setRows(rows) {
this.rows = rows;
return this;
}
getRows() {
return this.rows;
}
setMaxLength(maxLength) {
this.maxLength = maxLength;
return this;
}
setMinLength(minLength) {
this.minLength = minLength;
return this;
}
getMaxLength() {
return this.maxLength;
}
getMinLength() {
return this.minLength;
}
}
exports.TextField = TextField;
__decorate([
(0, class_validator_1.IsNumber)()
], TextField.prototype, "maxLength", void 0);
__decorate([
(0, class_validator_1.IsNumber)()
], TextField.prototype, "minLength", void 0);
__decorate([
(0, class_validator_1.IsBoolean)()
], TextField.prototype, "isTextArea", void 0);
__decorate([
(0, class_validator_1.IsNumber)()
], TextField.prototype, "rows", void 0);
__decorate([
(0, class_validator_1.IsArray)(),
(0, class_validator_1.IsString)({ each: true })
], TextField.prototype, "values", void 0);
//# sourceMappingURL=TextField.js.map