@everymatrix/general-registration 1.90.23 → 1.90.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.
@@ -14512,7 +14512,7 @@ if (typeof window != "undefined") {
14512
14512
  }
14513
14513
  };
14514
14514
  };
14515
- customElements.define = n(customElements.define), import('./PlayerConsents-C93YUnq0-2e7ff8d3.js').then((e) => e.P).then(({ default: e }) => {
14515
+ customElements.define = n(customElements.define), import('./PlayerConsents-Duni8Aqx-dd7cf325.js').then((e) => e.P).then(({ default: e }) => {
14516
14516
  !customElements.get("player-consents") && customElements.define("player-consents", e.element);
14517
14517
  });
14518
14518
  }
@@ -16616,6 +16616,7 @@ const TelInput = class {
16616
16616
  }
16617
16617
  this.debounceTime = setTimeout(() => {
16618
16618
  this.isValid = this.isValidValue();
16619
+ this.applyCustomError();
16619
16620
  this.errorMessage = this.setErrorMessage();
16620
16621
  this.emitValueHandler(true);
16621
16622
  }, 500);
@@ -16623,6 +16624,7 @@ const TelInput = class {
16623
16624
  this.handleBlur = () => {
16624
16625
  this.touched = true;
16625
16626
  this.isValid = this.isValidValue();
16627
+ this.applyCustomError();
16626
16628
  this.errorMessage = this.setErrorMessage();
16627
16629
  };
16628
16630
  this.name = undefined;
@@ -16680,6 +16682,60 @@ const TelInput = class {
16680
16682
  this.showTooltip = false;
16681
16683
  }
16682
16684
  }
16685
+ resetValidationState() {
16686
+ this.lastCustomErrorKey = undefined;
16687
+ this.lastCustomErrorMessage = undefined;
16688
+ this.inputReference.setCustomValidity('');
16689
+ }
16690
+ isMissingValue(value) {
16691
+ return this.validation.mandatory && value === '';
16692
+ }
16693
+ isFixedLength(value) {
16694
+ const min = this.validation.minLength;
16695
+ const max = this.validation.maxLength;
16696
+ return !!(min && max && min === max && value.length !== min);
16697
+ }
16698
+ isTooShort(value) {
16699
+ const min = this.validation.minLength;
16700
+ return !!(min && value.length < min);
16701
+ }
16702
+ isTooLong(value) {
16703
+ const max = this.validation.maxLength;
16704
+ return !!(max && value.length > max);
16705
+ }
16706
+ failsPattern(value) {
16707
+ if (!this.validationPattern)
16708
+ return false;
16709
+ let patternRegex;
16710
+ try {
16711
+ patternRegex = new RegExp(this.validationPattern);
16712
+ }
16713
+ catch (e) {
16714
+ console.warn('Invalid validationPattern:', this.validationPattern, e);
16715
+ return false;
16716
+ }
16717
+ return !patternRegex.test(value);
16718
+ }
16719
+ failsCustomRules(value) {
16720
+ const customs = (this.validation.custom || [])
16721
+ .filter(c => c.rule === 'regex' && c.pattern);
16722
+ // Skip the first rule (already validated in failsPattern)
16723
+ const [, ...additionalRules] = customs;
16724
+ for (const rule of additionalRules) {
16725
+ let regex;
16726
+ try {
16727
+ regex = new RegExp(rule.pattern);
16728
+ }
16729
+ catch (e) {
16730
+ console.warn('Invalid regex pattern:', rule.pattern, e);
16731
+ continue;
16732
+ }
16733
+ if (!regex.test(value)) {
16734
+ return true;
16735
+ }
16736
+ }
16737
+ return false;
16738
+ }
16683
16739
  connectedCallback() {
16684
16740
  var _a;
16685
16741
  this.validationPattern = this.setPattern();
@@ -16742,52 +16798,26 @@ const TelInput = class {
16742
16798
  this.emitValueHandler(true);
16743
16799
  }
16744
16800
  isValidValue() {
16745
- if (!this.inputReference) {
16801
+ var _a, _b;
16802
+ if (!this.inputReference)
16746
16803
  return false;
16747
- }
16748
- this.inputReference.setCustomValidity('');
16749
- this.lastCustomErrorKey = undefined;
16750
- this.lastCustomErrorMessage = undefined;
16751
- if (this.validation.mandatory && (!this.phoneValue || this.phoneValue.trim() === '')) {
16804
+ this.resetValidationState();
16805
+ const value = (_b = (_a = this.phoneValue) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : '';
16806
+ const isEmpty = value === '';
16807
+ if (this.isMissingValue(value))
16752
16808
  return false;
16753
- }
16754
- if (!this.phoneValue || this.phoneValue.trim() === '') {
16755
- return !this.validation.mandatory;
16756
- }
16757
- if (this.validation.minLength && this.phoneValue.length < this.validation.minLength) {
16809
+ if (isEmpty)
16810
+ return true;
16811
+ if (this.isFixedLength(value))
16758
16812
  return false;
16759
- }
16760
- if (this.validation.maxLength && this.phoneValue.length > this.validation.maxLength) {
16813
+ if (this.isTooShort(value))
16814
+ return false;
16815
+ if (this.isTooLong(value))
16816
+ return false;
16817
+ if (this.failsPattern(value))
16818
+ return false;
16819
+ if (this.failsCustomRules(value))
16761
16820
  return false;
16762
- }
16763
- if (this.validationPattern) {
16764
- const patternRegex = new RegExp(this.validationPattern);
16765
- if (!patternRegex.test(this.phoneValue)) {
16766
- return false;
16767
- }
16768
- }
16769
- if (this.enableCustomRegexValidation) {
16770
- const customs = (this.validation.custom || []).filter(c => c.rule === 'regex' && c.pattern);
16771
- if (customs.length > 1) {
16772
- // First regex is used as <input> pattern; validate only the remaining rules here
16773
- const additionalRules = customs.slice(1);
16774
- for (const rule of additionalRules) {
16775
- let regex;
16776
- try {
16777
- regex = new RegExp(rule.pattern);
16778
- }
16779
- catch (_a) {
16780
- continue;
16781
- }
16782
- if (!regex.test(this.phoneValue)) {
16783
- this.lastCustomErrorKey = rule.errorKey;
16784
- this.lastCustomErrorMessage = rule.errorMessage;
16785
- this.inputReference.setCustomValidity('customError');
16786
- return false;
16787
- }
16788
- }
16789
- }
16790
- }
16791
16821
  return true;
16792
16822
  }
16793
16823
  setPattern() {
@@ -16829,6 +16859,27 @@ const TelInput = class {
16829
16859
  return translated ? translated : (this.lastCustomErrorMessage || '');
16830
16860
  }
16831
16861
  }
16862
+ applyCustomError() {
16863
+ const customs = (this.validation.custom || [])
16864
+ .filter(c => c.rule === 'regex' && c.pattern);
16865
+ const [, ...additionalRules] = customs;
16866
+ for (const rule of additionalRules) {
16867
+ let regex;
16868
+ try {
16869
+ regex = new RegExp(rule.pattern);
16870
+ }
16871
+ catch (e) {
16872
+ console.warn('[applyCustomError] invalid regex pattern:', rule.pattern, e);
16873
+ continue;
16874
+ }
16875
+ if (!regex.test(this.phoneValue)) {
16876
+ this.lastCustomErrorKey = rule.errorKey;
16877
+ this.lastCustomErrorMessage = rule.errorMessage;
16878
+ this.inputReference.setCustomValidity('customError');
16879
+ return;
16880
+ }
16881
+ }
16882
+ }
16832
16883
  renderTooltip() {
16833
16884
  if (this.showTooltip) {
16834
16885
  return (h("div", { class: `tel__tooltip ${this.showTooltip ? 'visible' : ''}`, ref: (el) => this.tooltipReference = el, innerHTML: this.tooltip }));
@@ -16841,8 +16892,8 @@ const TelInput = class {
16841
16892
  if (this.touched) {
16842
16893
  invalidClass = this.isValid == true || this.isValid == undefined ? '' : 'text__input--invalid';
16843
16894
  }
16844
- return h("div", { key: 'e33193abf4094e4dac87b9cb7d95aaaf4bd8827c', class: `tel__wrapper ${this.autofilled ? 'tel__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '3978e74f9decf4c6d632268e73507878d3aca0da', class: 'tel__wrapper--flex-label' }, h("label", { key: '1b7711f58ab7fc7e48ea6fa889334d64eeb2bfb4', class: `tel__label ${this.validation.mandatory ? 'tel__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: 'a768af0e4a2c07fcf4b996814650493057120697', class: 'tel__wrapper--relative' }, this.tooltip &&
16845
- h("img", { key: 'b7f302055d8a4739baa8dece656780fa2183665a', class: 'tel__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("div", { key: 'd095e9e0666096278466d134e06f2985611f9f4d', class: `tel__wrapper--flex ${invalidClass}` }, h("vaadin-combo-box", { key: 'd336c7ee95ad77d513a3d485786d8774f11f91fc', class: 'tel__prefix', items: this.phoneCodesOptions, value: this.prefixValue, readOnly: this.disablePhonePrefix, onChange: (e) => this.handlePrefixInput(e) }), h("input", { key: '5f403eb589e0ae8ee2284d2bd30a60850a33fb20', 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("small", { key: 'b4f7dca6a67471828af759437927c57ca5a89c99', class: 'tel__error-message' }, this.errorMessage));
16895
+ return h("div", { key: '82da44bb2bacec9efb3631e377978d678e766919', class: `tel__wrapper ${this.autofilled ? 'tel__wrapper--autofilled' : ''} ${this.name}__input`, ref: el => this.stylingContainer = el }, h("div", { key: '4ca8d6dde2d3f8e15e2d26d593297519e0c94053', class: 'tel__wrapper--flex-label' }, h("label", { key: '3b0e2736fd47537b2ecd80cf49a146992d59474e', class: `tel__label ${this.validation.mandatory ? 'tel__label--required' : ''}`, htmlFor: `${this.name}__input` }, this.displayName), h("div", { key: '1577aafc7b68128e91cdfe9ddc563bbad9d7b901', class: 'tel__wrapper--relative' }, this.tooltip &&
16896
+ h("img", { key: 'cb6576e1248fc52f937c685d59d994a1d098d7cc', class: 'tel__tooltip-icon', src: tooltipIconSvg, alt: "", ref: (el) => this.tooltipIconReference = el, onClick: () => this.showTooltip = !this.showTooltip }), this.renderTooltip())), h("div", { key: 'a1e9f3c68691fbb61947cd41c0ffddcd124b4bbb', class: `tel__wrapper--flex ${invalidClass}` }, h("vaadin-combo-box", { key: '9aa33a487f019ee7393e29a0ce0d1836a23f5e09', class: 'tel__prefix', items: this.phoneCodesOptions, value: this.prefixValue, readOnly: this.disablePhonePrefix, onChange: (e) => this.handlePrefixInput(e) }), h("input", { key: '21d69c041b9a5f5f6fb1e6d7b392945cafe99e87', 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("small", { key: '76febe89ad7ee581eb5fc79658d81123da08ccdd', class: 'tel__error-message' }, this.errorMessage));
16846
16897
  }
16847
16898
  static get watchers() { return {
16848
16899
  "clientStyling": ["handleClientStylingChange"],
@@ -1 +1 @@
1
- import{S as i,i as s,s as l,f as t,k as e,a as n,e as a,b as r,n as d,d as c,o,g as p,h as u,j as f,c as m}from"./PlayerConsents-C93YUnq0-2e7ff8d3.js";function g(i){n(i,"svelte-gnt082",".LoaderContainer{display:flex;justify-content:center}.lds-ellipsis{display:inline-block;position:relative;width:80px;height:80px}.lds-ellipsis div{position:absolute;top:33px;width:13px;height:13px;border-radius:50%;background:#d1d1d1;animation-timing-function:cubic-bezier(0, 1, 1, 0)}.lds-ellipsis div:nth-child(1){left:8px;animation:lds-ellipsis1 0.6s infinite}.lds-ellipsis div:nth-child(2){left:8px;animation:lds-ellipsis2 0.6s infinite}.lds-ellipsis div:nth-child(3){left:32px;animation:lds-ellipsis2 0.6s infinite}.lds-ellipsis div:nth-child(4){left:56px;animation:lds-ellipsis3 0.6s infinite}@keyframes lds-ellipsis1{0%{transform:scale(0)}100%{transform:scale(1)}}@keyframes lds-ellipsis3{0%{transform:scale(1)}100%{transform:scale(0)}}@keyframes lds-ellipsis2{0%{transform:translate(0, 0)}100%{transform:translate(24px, 0)}}")}function h(i){let s;return{c(){s=a("div"),s.innerHTML='<section class="LoaderContainer"><div class="lds-ellipsis"><div></div><div></div><div></div><div></div></div></section>'},m(l,t){r(l,s,t),i[4](s)},p:d,i:d,o:d,d(l){l&&c(s),i[4](null)}}}function y(i,s,l){let t,{clientstyling:e=""}=s,{clientstylingurl:n=""}=s,{mbsource:a}=s;return o((()=>()=>{})),i.$$set=i=>{"clientstyling"in i&&l(1,e=i.clientstyling),"clientstylingurl"in i&&l(2,n=i.clientstylingurl),"mbsource"in i&&l(3,a=i.mbsource)},i.$$.update=()=>{3&i.$$.dirty&&e&&t&&p(t,e),5&i.$$.dirty&&n&&t&&u(t,n),9&i.$$.dirty&&a&&t&&f(t,`${a}.Style`,void 0)},[t,e,n,a,function(i){m[i?"unshift":"push"]((()=>{t=i,l(0,t)}))}]}class v extends i{constructor(i){super(),s(this,i,y,h,l,{clientstyling:1,clientstylingurl:2,mbsource:3},g)}get clientstyling(){return this.$$.ctx[1]}set clientstyling(i){this.$$set({clientstyling:i}),t()}get clientstylingurl(){return this.$$.ctx[2]}set clientstylingurl(i){this.$$set({clientstylingurl:i}),t()}get mbsource(){return this.$$.ctx[3]}set mbsource(i){this.$$set({mbsource:i}),t()}}e(v,{clientstyling:{},clientstylingurl:{},mbsource:{}},[],[],!0);export{v as default}
1
+ import{S as i,i as s,s as l,f as t,k as n,a as e,e as a,b as r,n as d,d as c,o,g as u,h as p,j as f,c as m}from"./PlayerConsents-Duni8Aqx-dd7cf325.js";function g(i){e(i,"svelte-gnt082",".LoaderContainer{display:flex;justify-content:center}.lds-ellipsis{display:inline-block;position:relative;width:80px;height:80px}.lds-ellipsis div{position:absolute;top:33px;width:13px;height:13px;border-radius:50%;background:#d1d1d1;animation-timing-function:cubic-bezier(0, 1, 1, 0)}.lds-ellipsis div:nth-child(1){left:8px;animation:lds-ellipsis1 0.6s infinite}.lds-ellipsis div:nth-child(2){left:8px;animation:lds-ellipsis2 0.6s infinite}.lds-ellipsis div:nth-child(3){left:32px;animation:lds-ellipsis2 0.6s infinite}.lds-ellipsis div:nth-child(4){left:56px;animation:lds-ellipsis3 0.6s infinite}@keyframes lds-ellipsis1{0%{transform:scale(0)}100%{transform:scale(1)}}@keyframes lds-ellipsis3{0%{transform:scale(1)}100%{transform:scale(0)}}@keyframes lds-ellipsis2{0%{transform:translate(0, 0)}100%{transform:translate(24px, 0)}}")}function h(i){let s;return{c(){s=a("div"),s.innerHTML='<section class="LoaderContainer"><div class="lds-ellipsis"><div></div><div></div><div></div><div></div></div></section>'},m(l,t){r(l,s,t),i[4](s)},p:d,i:d,o:d,d(l){l&&c(s),i[4](null)}}}function y(i,s,l){let t,{clientstyling:n=""}=s,{clientstylingurl:e=""}=s,{mbsource:a}=s;return o((()=>()=>{})),i.$$set=i=>{"clientstyling"in i&&l(1,n=i.clientstyling),"clientstylingurl"in i&&l(2,e=i.clientstylingurl),"mbsource"in i&&l(3,a=i.mbsource)},i.$$.update=()=>{3&i.$$.dirty&&n&&t&&u(t,n),5&i.$$.dirty&&e&&t&&p(t,e),9&i.$$.dirty&&a&&t&&f(t,`${a}.Style`,void 0)},[t,n,e,a,function(i){m[i?"unshift":"push"]((()=>{t=i,l(0,t)}))}]}class v extends i{constructor(i){super(),s(this,i,y,h,l,{clientstyling:1,clientstylingurl:2,mbsource:3},g)}get clientstyling(){return this.$$.ctx[1]}set clientstyling(i){this.$$set({clientstyling:i}),t()}get clientstylingurl(){return this.$$.ctx[2]}set clientstylingurl(i){this.$$set({clientstylingurl:i}),t()}get mbsource(){return this.$$.ctx[3]}set mbsource(i){this.$$set({mbsource:i}),t()}}n(v,{clientstyling:{},clientstylingurl:{},mbsource:{}},[],[],!0);export{v as default}