@everymatrix/general-registration-multistep 1.87.23 → 1.87.25

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.
@@ -16410,17 +16410,15 @@ const TelInput = class {
16410
16410
  clearTimeout(this.debounceTime);
16411
16411
  }
16412
16412
  this.debounceTime = setTimeout(() => {
16413
- this.isValid = this.setValidity();
16413
+ this.isValid = this.isValidValue();
16414
16414
  this.errorMessage = this.setErrorMessage();
16415
16415
  this.emitValueHandler(true);
16416
16416
  }, 500);
16417
16417
  };
16418
16418
  this.handleBlur = () => {
16419
- if (!this.touched) {
16420
- this.isValid = this.setValidity();
16421
- this.errorMessage = this.setErrorMessage();
16422
- this.touched = true;
16423
- }
16419
+ this.touched = true;
16420
+ this.isValid = this.isValidValue();
16421
+ this.errorMessage = this.setErrorMessage();
16424
16422
  };
16425
16423
  this.setClientStyling = () => {
16426
16424
  let sheet = document.createElement('style');
@@ -16516,7 +16514,7 @@ const TelInput = class {
16516
16514
  // end custom styling area
16517
16515
  }
16518
16516
  componentDidLoad() {
16519
- this.isValid = this.setValidity();
16517
+ this.isValid = this.isValidValue();
16520
16518
  if (this.defaultValue) {
16521
16519
  this.value = this.defaultValue;
16522
16520
  this.valueHandler({ name: this.name, value: this.value, type: 'tel' });
@@ -16540,8 +16538,29 @@ const TelInput = class {
16540
16538
  this.value = { prefix: this.prefixValue, phone: this.phoneValue };
16541
16539
  this.emitValueHandler(true);
16542
16540
  }
16543
- setValidity() {
16544
- return this.inputReference.validity.valid;
16541
+ isValidValue() {
16542
+ if (!this.inputReference) {
16543
+ return false;
16544
+ }
16545
+ if (this.validation.mandatory && (!this.phoneValue || this.phoneValue.trim() === '')) {
16546
+ return false;
16547
+ }
16548
+ if (!this.phoneValue || this.phoneValue.trim() === '') {
16549
+ return !this.validation.mandatory;
16550
+ }
16551
+ if (this.validation.minLength && this.phoneValue.length < this.validation.minLength) {
16552
+ return false;
16553
+ }
16554
+ if (this.validation.maxLength && this.phoneValue.length > this.validation.maxLength) {
16555
+ return false;
16556
+ }
16557
+ if (this.validationPattern) {
16558
+ const patternRegex = new RegExp(this.validationPattern);
16559
+ if (!patternRegex.test(this.phoneValue)) {
16560
+ return false;
16561
+ }
16562
+ }
16563
+ return true;
16545
16564
  }
16546
16565
  setPattern() {
16547
16566
  var _a, _b;
@@ -16556,7 +16575,10 @@ const TelInput = class {
16556
16575
  const errorMessage = (_b = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _b === void 0 ? void 0 : _b.errorMessage;
16557
16576
  return translate$1(`${errorCode}`, this.language) ? translate$1(`${errorCode}`, this.language) : errorMessage;
16558
16577
  }
16559
- if (this.inputReference.validity.tooShort || this.inputReference.validity.tooLong) {
16578
+ if (this.inputReference.validity.tooShort
16579
+ || this.inputReference.validity.tooLong
16580
+ || (this.validation.minLength && this.phoneValue && this.phoneValue.length < this.validation.minLength)
16581
+ || (this.validation.maxLength && this.phoneValue && this.phoneValue.length > this.validation.maxLength)) {
16560
16582
  return translate$1('lengthError', this.language, { values: { minLength: this.validation.minLength, maxLength: this.validation.maxLength } });
16561
16583
  }
16562
16584
  if (this.inputReference.validity.valueMissing) {
@@ -16575,8 +16597,8 @@ const TelInput = class {
16575
16597
  if (this.touched) {
16576
16598
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
16577
16599
  }
16578
- return index.h("div", { key: '7296f134bff80795ab52a1a27eb059ab2f3c0c87', class: `tel__wrapper ${this.autofilled ? 'tel__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { key: 'c9b1fdf501299398bcda1e59e65bb0a7d6b7de43', class: 'tel__wrapper--flex-label' }, index.h("label", { key: 'e7e6858fc61e2b6ea8974f8b4dc8d67a5fcb07b4', class: `tel__label ${this.validation.mandatory ? 'tel__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), index.h("div", { key: '6c9cc9a3c74e8cd06224e2663d4c363e5d8fb3c0', class: 'tel__wrapper--relative' }, this.tooltip &&
16579
- index.h("img", { key: '17e85d6050d4796bf5b057c901631a87b25d3b40', class: 'tel__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), index.h("div", { key: 'cb2e8b93e5663c92a2fd114d1fe1c9d9e09ebc83', class: `tel__wrapper--flex ${invalidClass}` }, index.h("vaadin-combo-box", { key: 'fb1c3ab06d19e9ed7bbdf7effe8f25a1f7d9fe15', class: 'tel__prefix', items: this.phoneCodesOptions, value: this.prefixValue, readOnly: this.disablePhonePrefix, onChange: (e) => this.handlePrefixInput(e) }), index.h("input", { key: 'd2701f0bdca4122c18fd43d311ea8c5e2536b1f5', type: "tel", ref: (el) => this.inputReference = el, id: `${this.name}__input`, readOnly: this.autofilled, class: `tel__input`, value: (_a = this.phoneValue) !== null && _a !== void 0 ? _a : '', placeholder: `${this.placeholder}`, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, pattern: this.validationPattern, onInput: this.handleInput, onBlur: this.handleBlur })), index.h("small", { key: 'a685ceea5c99f29d992fd5291f67934a22d6997c', class: 'tel__error-message' }, this.errorMessage));
16600
+ return index.h("div", { key: 'f534de21d5597a3e90912eb87fff893511d09920', class: `tel__wrapper ${this.autofilled ? 'tel__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, index.h("div", { key: '431fb8cbaea0d2244847823ea4d04d8c73a5341c', class: 'tel__wrapper--flex-label' }, index.h("label", { key: '2eb210b2f0c2e0e632997f59fe7aa667578f72fd', class: `tel__label ${this.validation.mandatory ? 'tel__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), index.h("div", { key: '2d912b828f7d9475a1bbb5bac13495779f31198e', class: 'tel__wrapper--relative' }, this.tooltip &&
16601
+ index.h("img", { key: 'ce4433263d27dc9d3fb2caf45069d7a92e9ae3a7', class: 'tel__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), index.h("div", { key: '480cd17eafb4f2ff1e396531429177cb3130eb95', class: `tel__wrapper--flex ${invalidClass}` }, index.h("vaadin-combo-box", { key: '5f2292c8509e5f68786d0f462c689102b1c75dc3', class: 'tel__prefix', items: this.phoneCodesOptions, value: this.prefixValue, readOnly: this.disablePhonePrefix, onChange: (e) => this.handlePrefixInput(e) }), index.h("input", { key: '77232e119eed4960f5e1d809507b8585dd112256', type: "tel", ref: (el) => this.inputReference = el, id: `${this.name}__input`, readOnly: this.autofilled, class: `tel__input`, value: (_a = this.phoneValue) !== null && _a !== void 0 ? _a : '', placeholder: `${this.placeholder}`, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, pattern: this.validationPattern, onInput: this.handleInput, onBlur: this.handleBlur })), index.h("small", { key: '0d925cee41881c8c822073790e26ca7dc4a81049', class: 'tel__error-message' }, this.errorMessage));
16580
16602
  }
16581
16603
  static get watchers() { return {
16582
16604
  "clientStyling": ["handleStylingChange"],
@@ -16406,17 +16406,15 @@ const TelInput = class {
16406
16406
  clearTimeout(this.debounceTime);
16407
16407
  }
16408
16408
  this.debounceTime = setTimeout(() => {
16409
- this.isValid = this.setValidity();
16409
+ this.isValid = this.isValidValue();
16410
16410
  this.errorMessage = this.setErrorMessage();
16411
16411
  this.emitValueHandler(true);
16412
16412
  }, 500);
16413
16413
  };
16414
16414
  this.handleBlur = () => {
16415
- if (!this.touched) {
16416
- this.isValid = this.setValidity();
16417
- this.errorMessage = this.setErrorMessage();
16418
- this.touched = true;
16419
- }
16415
+ this.touched = true;
16416
+ this.isValid = this.isValidValue();
16417
+ this.errorMessage = this.setErrorMessage();
16420
16418
  };
16421
16419
  this.setClientStyling = () => {
16422
16420
  let sheet = document.createElement('style');
@@ -16512,7 +16510,7 @@ const TelInput = class {
16512
16510
  // end custom styling area
16513
16511
  }
16514
16512
  componentDidLoad() {
16515
- this.isValid = this.setValidity();
16513
+ this.isValid = this.isValidValue();
16516
16514
  if (this.defaultValue) {
16517
16515
  this.value = this.defaultValue;
16518
16516
  this.valueHandler({ name: this.name, value: this.value, type: 'tel' });
@@ -16536,8 +16534,29 @@ const TelInput = class {
16536
16534
  this.value = { prefix: this.prefixValue, phone: this.phoneValue };
16537
16535
  this.emitValueHandler(true);
16538
16536
  }
16539
- setValidity() {
16540
- return this.inputReference.validity.valid;
16537
+ isValidValue() {
16538
+ if (!this.inputReference) {
16539
+ return false;
16540
+ }
16541
+ if (this.validation.mandatory && (!this.phoneValue || this.phoneValue.trim() === '')) {
16542
+ return false;
16543
+ }
16544
+ if (!this.phoneValue || this.phoneValue.trim() === '') {
16545
+ return !this.validation.mandatory;
16546
+ }
16547
+ if (this.validation.minLength && this.phoneValue.length < this.validation.minLength) {
16548
+ return false;
16549
+ }
16550
+ if (this.validation.maxLength && this.phoneValue.length > this.validation.maxLength) {
16551
+ return false;
16552
+ }
16553
+ if (this.validationPattern) {
16554
+ const patternRegex = new RegExp(this.validationPattern);
16555
+ if (!patternRegex.test(this.phoneValue)) {
16556
+ return false;
16557
+ }
16558
+ }
16559
+ return true;
16541
16560
  }
16542
16561
  setPattern() {
16543
16562
  var _a, _b;
@@ -16552,7 +16571,10 @@ const TelInput = class {
16552
16571
  const errorMessage = (_b = this.validation.custom.find(customValidation => customValidation.rule === 'regex')) === null || _b === void 0 ? void 0 : _b.errorMessage;
16553
16572
  return translate$1(`${errorCode}`, this.language) ? translate$1(`${errorCode}`, this.language) : errorMessage;
16554
16573
  }
16555
- if (this.inputReference.validity.tooShort || this.inputReference.validity.tooLong) {
16574
+ if (this.inputReference.validity.tooShort
16575
+ || this.inputReference.validity.tooLong
16576
+ || (this.validation.minLength && this.phoneValue && this.phoneValue.length < this.validation.minLength)
16577
+ || (this.validation.maxLength && this.phoneValue && this.phoneValue.length > this.validation.maxLength)) {
16556
16578
  return translate$1('lengthError', this.language, { values: { minLength: this.validation.minLength, maxLength: this.validation.maxLength } });
16557
16579
  }
16558
16580
  if (this.inputReference.validity.valueMissing) {
@@ -16571,8 +16593,8 @@ const TelInput = class {
16571
16593
  if (this.touched) {
16572
16594
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
16573
16595
  }
16574
- return h$1("div", { key: '7296f134bff80795ab52a1a27eb059ab2f3c0c87', class: `tel__wrapper ${this.autofilled ? 'tel__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h$1("div", { key: 'c9b1fdf501299398bcda1e59e65bb0a7d6b7de43', class: 'tel__wrapper--flex-label' }, h$1("label", { key: 'e7e6858fc61e2b6ea8974f8b4dc8d67a5fcb07b4', class: `tel__label ${this.validation.mandatory ? 'tel__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h$1("div", { key: '6c9cc9a3c74e8cd06224e2663d4c363e5d8fb3c0', class: 'tel__wrapper--relative' }, this.tooltip &&
16575
- h$1("img", { key: '17e85d6050d4796bf5b057c901631a87b25d3b40', class: 'tel__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h$1("div", { key: 'cb2e8b93e5663c92a2fd114d1fe1c9d9e09ebc83', class: `tel__wrapper--flex ${invalidClass}` }, h$1("vaadin-combo-box", { key: 'fb1c3ab06d19e9ed7bbdf7effe8f25a1f7d9fe15', class: 'tel__prefix', items: this.phoneCodesOptions, value: this.prefixValue, readOnly: this.disablePhonePrefix, onChange: (e) => this.handlePrefixInput(e) }), h$1("input", { key: 'd2701f0bdca4122c18fd43d311ea8c5e2536b1f5', type: "tel", ref: (el) => this.inputReference = el, id: `${this.name}__input`, readOnly: this.autofilled, class: `tel__input`, value: (_a = this.phoneValue) !== null && _a !== void 0 ? _a : '', placeholder: `${this.placeholder}`, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, pattern: this.validationPattern, onInput: this.handleInput, onBlur: this.handleBlur })), h$1("small", { key: 'a685ceea5c99f29d992fd5291f67934a22d6997c', class: 'tel__error-message' }, this.errorMessage));
16596
+ return h$1("div", { key: 'f534de21d5597a3e90912eb87fff893511d09920', class: `tel__wrapper ${this.autofilled ? 'tel__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h$1("div", { key: '431fb8cbaea0d2244847823ea4d04d8c73a5341c', class: 'tel__wrapper--flex-label' }, h$1("label", { key: '2eb210b2f0c2e0e632997f59fe7aa667578f72fd', class: `tel__label ${this.validation.mandatory ? 'tel__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h$1("div", { key: '2d912b828f7d9475a1bbb5bac13495779f31198e', class: 'tel__wrapper--relative' }, this.tooltip &&
16597
+ h$1("img", { key: 'ce4433263d27dc9d3fb2caf45069d7a92e9ae3a7', class: 'tel__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h$1("div", { key: '480cd17eafb4f2ff1e396531429177cb3130eb95', class: `tel__wrapper--flex ${invalidClass}` }, h$1("vaadin-combo-box", { key: '5f2292c8509e5f68786d0f462c689102b1c75dc3', class: 'tel__prefix', items: this.phoneCodesOptions, value: this.prefixValue, readOnly: this.disablePhonePrefix, onChange: (e) => this.handlePrefixInput(e) }), h$1("input", { key: '77232e119eed4960f5e1d809507b8585dd112256', type: "tel", ref: (el) => this.inputReference = el, id: `${this.name}__input`, readOnly: this.autofilled, class: `tel__input`, value: (_a = this.phoneValue) !== null && _a !== void 0 ? _a : '', placeholder: `${this.placeholder}`, required: this.validation.mandatory, minlength: this.validation.minLength, maxlength: this.validation.maxLength, pattern: this.validationPattern, onInput: this.handleInput, onBlur: this.handleBlur })), h$1("small", { key: '0d925cee41881c8c822073790e26ca7dc4a81049', class: 'tel__error-message' }, this.errorMessage));
16576
16598
  }
16577
16599
  static get watchers() { return {
16578
16600
  "clientStyling": ["handleStylingChange"],