@vixoniccom/modules 2.16.2-dev.1 → 2.17.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [2.17.0-dev.0](https://bitbucket.org/rexmas_cl/modules/compare/v2.16.2...v2.17.0-dev.0) (2024-01-17)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* validate-input method was added to textaarea input ([81da128](https://bitbucket.org/rexmas_cl/modules/commit/81da1282bdb97444ad44c52675b7f757508b0684))
|
|
11
|
+
|
|
12
|
+
### [2.16.2](https://bitbucket.org/rexmas_cl/modules/compare/v2.16.2-dev.1...v2.16.2) (2024-01-09)
|
|
13
|
+
|
|
5
14
|
### [2.16.2-dev.1](https://bitbucket.org/rexmas_cl/modules/compare/v2.16.2-dev.0...v2.16.2-dev.1) (2023-12-22)
|
|
6
15
|
|
|
7
16
|
|
|
@@ -28,6 +28,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.TextArea = void 0;
|
|
30
30
|
var text_input_1 = require("./text-input");
|
|
31
|
+
var validation_1 = require("../utils/validation");
|
|
31
32
|
var TextArea = /** @class */ (function (_super) {
|
|
32
33
|
__extends(TextArea, _super);
|
|
33
34
|
function TextArea(options) {
|
|
@@ -37,6 +38,28 @@ var TextArea = /** @class */ (function (_super) {
|
|
|
37
38
|
_this.html = options.html || false;
|
|
38
39
|
return _this;
|
|
39
40
|
}
|
|
41
|
+
TextArea.prototype.validateInput = function (value) {
|
|
42
|
+
var length;
|
|
43
|
+
var errors = [];
|
|
44
|
+
errors = errors.concat(validation_1.Validator.required(value, this.required));
|
|
45
|
+
if (this.pattern && value) {
|
|
46
|
+
var reg = new RegExp(this.pattern);
|
|
47
|
+
if (!reg.exec(value))
|
|
48
|
+
errors = errors.concat({ type: 'pattern' });
|
|
49
|
+
}
|
|
50
|
+
if (this.range) {
|
|
51
|
+
if (this.html) {
|
|
52
|
+
var auxValue = (value === null || value === void 0 ? void 0 : value.replace(/<[^>]*>/g, '').trim()) || '';
|
|
53
|
+
length = (auxValue === null || auxValue === void 0 ? void 0 : auxValue.length) || 0;
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
57
|
+
}
|
|
58
|
+
errors = errors.concat(validation_1.Validator.min(length, this.range.min));
|
|
59
|
+
errors = errors.concat(validation_1.Validator.max(length, this.range.max));
|
|
60
|
+
}
|
|
61
|
+
return errors;
|
|
62
|
+
};
|
|
40
63
|
TextArea.fromJSON = function (value) {
|
|
41
64
|
var parsed = text_input_1.TextInput.parseJSON(value);
|
|
42
65
|
return new TextArea(__assign(__assign({}, parsed), { rows: value.rows, html: value.html }));
|