@luftborn/custom-elements 2.6.3 → 2.7.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/demo/index.js +16 -4
- package/demo/index.min.js +15 -3
- 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/InternationaPhoneNumber/InternationaPhoneNumberElement.js +4 -0
- package/dist/elements/InternationaPhoneNumber/InternationaPhoneNumberElement.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/InternationaPhoneNumber/InternationaPhoneNumberElement.ts +4 -0
- 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
|
|
@@ -3830,6 +3836,10 @@ var IntPhoneFieldElement = /** @class */ (function (_super) {
|
|
|
3830
3836
|
if (this.required) {
|
|
3831
3837
|
this.phone.setAttribute('required', '');
|
|
3832
3838
|
}
|
|
3839
|
+
if (this.placeholder) {
|
|
3840
|
+
this.phone.setAttribute('placeholder', this.placeholder);
|
|
3841
|
+
this.intlTelInput.options.autoPlaceholder = 'off';
|
|
3842
|
+
}
|
|
3833
3843
|
};
|
|
3834
3844
|
IntPhoneFieldElement.prototype.setIntlTelInput = function () {
|
|
3835
3845
|
var _this = this;
|
|
@@ -6437,6 +6447,9 @@ var SEPersonalNumberValidator = /** @class */ (function () {
|
|
|
6437
6447
|
}
|
|
6438
6448
|
SEPersonalNumberValidator.prototype.isSatisfiedBy = function (input, allowEmpty) {
|
|
6439
6449
|
if (allowEmpty === void 0) { allowEmpty = true; }
|
|
6450
|
+
if (allowEmpty && !input) {
|
|
6451
|
+
return true;
|
|
6452
|
+
}
|
|
6440
6453
|
// Format: 10 or 12 digits [YY]YYMMDD[-/+]NNNN and pass checksum validation
|
|
6441
6454
|
var match = input
|
|
6442
6455
|
.replace(/[ +-]/g, '')
|
|
@@ -6444,8 +6457,7 @@ var SEPersonalNumberValidator = /** @class */ (function () {
|
|
|
6444
6457
|
if (!match)
|
|
6445
6458
|
return false; // not matching regex
|
|
6446
6459
|
var _a = match.slice(1).map(Number), month = _a[1], day = _a[2];
|
|
6447
|
-
return ((
|
|
6448
|
-
this.validateDayAndMonth(month, day) &&
|
|
6460
|
+
return (this.validateDayAndMonth(month, day) &&
|
|
6449
6461
|
this.validateChecksum(input));
|
|
6450
6462
|
};
|
|
6451
6463
|
SEPersonalNumberValidator.prototype.validateDayAndMonth = function (month, day) {
|