@luftborn/custom-elements 2.6.2 → 2.6.4
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/demo/index.js +13 -5
- package/demo/index.min.js +12 -4
- package/demo/index.min.js.map +1 -1
- package/dist/elements/CustomRegularExpression/CustomRegularExpressionElement.js +7 -1
- package/dist/elements/CustomRegularExpression/CustomRegularExpressionElement.js.map +1 -1
- package/dist/elements/DropDownList/DropDownListElement.js +1 -1
- package/dist/elements/DropDownList/DropDownListElement.js.map +1 -1
- package/dist/framework/Validation/Validators/SEPersonalNumber.js +4 -2
- package/dist/framework/Validation/Validators/SEPersonalNumber.js.map +1 -1
- package/package.json +1 -1
- package/src/elements/CustomRegularExpression/CustomRegularExpressionElement.ts +6 -1
- package/src/elements/DropDownList/DropDownListElement.ts +1 -1
- package/src/framework/Validation/Validators/SEPersonalNumber.ts +4 -1
package/demo/index.min.js
CHANGED
|
@@ -3184,7 +3184,13 @@ var CustomRegularExpressionElement = /** @class */ (function (_super) {
|
|
|
3184
3184
|
});
|
|
3185
3185
|
Object.defineProperty(CustomRegularExpressionElement.prototype, "valid", {
|
|
3186
3186
|
get: function () {
|
|
3187
|
-
|
|
3187
|
+
if (!this.text.value) {
|
|
3188
|
+
return this.text.validity.valid;
|
|
3189
|
+
}
|
|
3190
|
+
else if (this.customValue) {
|
|
3191
|
+
var regexp = new RegExp(this.customValue);
|
|
3192
|
+
return regexp.test(this.text.value);
|
|
3193
|
+
}
|
|
3188
3194
|
},
|
|
3189
3195
|
enumerable: false,
|
|
3190
3196
|
configurable: true
|
|
@@ -3347,7 +3353,7 @@ var DropDownListElement = /** @class */ (function (_super) {
|
|
|
3347
3353
|
function DropDownListElement() {
|
|
3348
3354
|
var _this = _super.call(this) || this;
|
|
3349
3355
|
_this.optionTemplate = "\n\t\t<option value='{0}'>\n\t\t{1}\n\t\t</option>";
|
|
3350
|
-
_this.placeholderOptionTemplate = "\n\t\t<option selected disabled id=\"placeholder-option\">\n\t\t{0}\n\t\t</option>";
|
|
3356
|
+
_this.placeholderOptionTemplate = "\n\t\t<option selected disabled id=\"placeholder-option\" value=\"\">\n\t\t{0}\n\t\t</option>";
|
|
3351
3357
|
return _this;
|
|
3352
3358
|
}
|
|
3353
3359
|
Object.defineProperty(DropDownListElement.prototype, "value", {
|
|
@@ -6437,6 +6443,9 @@ var SEPersonalNumberValidator = /** @class */ (function () {
|
|
|
6437
6443
|
}
|
|
6438
6444
|
SEPersonalNumberValidator.prototype.isSatisfiedBy = function (input, allowEmpty) {
|
|
6439
6445
|
if (allowEmpty === void 0) { allowEmpty = true; }
|
|
6446
|
+
if (allowEmpty && !input) {
|
|
6447
|
+
return true;
|
|
6448
|
+
}
|
|
6440
6449
|
// Format: 10 or 12 digits [YY]YYMMDD[-/+]NNNN and pass checksum validation
|
|
6441
6450
|
var match = input
|
|
6442
6451
|
.replace(/[ +-]/g, '')
|
|
@@ -6444,8 +6453,7 @@ var SEPersonalNumberValidator = /** @class */ (function () {
|
|
|
6444
6453
|
if (!match)
|
|
6445
6454
|
return false; // not matching regex
|
|
6446
6455
|
var _a = match.slice(1).map(Number), month = _a[1], day = _a[2];
|
|
6447
|
-
return ((
|
|
6448
|
-
this.validateDayAndMonth(month, day) &&
|
|
6456
|
+
return (this.validateDayAndMonth(month, day) &&
|
|
6449
6457
|
this.validateChecksum(input));
|
|
6450
6458
|
};
|
|
6451
6459
|
SEPersonalNumberValidator.prototype.validateDayAndMonth = function (month, day) {
|