@luftborn/custom-elements 2.6.3 → 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.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
- return this.text.validity.valid;
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
@@ -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 ((!allowEmpty ? !!input : true) &&
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) {