@descope/web-components-ui 1.0.353 → 1.0.355

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/dist/index.esm.js CHANGED
@@ -771,6 +771,7 @@ const errorAttributes = {
771
771
  patternMismatch: 'data-errormessage-pattern-mismatch',
772
772
  tooShort: 'data-errormessage-pattern-mismatch-too-short',
773
773
  tooLong: 'data-errormessage-pattern-mismatch-too-long',
774
+ typeMismatch: 'data-errormessage-type-mismatch',
774
775
  };
775
776
 
776
777
  const validationTargetSymbol = Symbol('validationTarget');
@@ -829,6 +830,11 @@ const inputValidationMixin = (superclass) =>
829
830
  return `At most ${this.getAttribute('max-items-selection')} items are allowed.`;
830
831
  }
831
832
 
833
+ // eslint-disable-next-line class-methods-use-this
834
+ get defaultErrorMsgTypeMismatch() {
835
+ return `Please match the requested type.`;
836
+ }
837
+
832
838
  getErrorMessage(flags) {
833
839
  const {
834
840
  valueMissing,
@@ -852,6 +858,10 @@ const inputValidationMixin = (superclass) =>
852
858
  this.getAttribute(errorAttributes.patternMismatch) ||
853
859
  this.defaultErrorMsgPatternMismatch
854
860
  );
861
+ case typeMismatch:
862
+ return (
863
+ this.getAttribute(errorAttributes.typeMismatch) || this.defaultErrorMsgTypeMismatch
864
+ );
855
865
  case tooShort:
856
866
  return this.getAttribute(errorAttributes.tooShort) || this.defaultErrorMsgTooShort;
857
867
  case tooLong:
@@ -7032,13 +7042,14 @@ class NewPasswordInternal extends BaseInputClass$4 {
7032
7042
  }
7033
7043
 
7034
7044
  getValidity() {
7035
- if (!this.policyPanel.isValid) {
7036
- return { patternMismatch: true };
7037
- }
7038
-
7039
7045
  if (this.isRequired && !this.value) {
7040
7046
  return { valueMissing: true };
7041
7047
  }
7048
+
7049
+ if (this.value && !this.policyPanel.isValid) {
7050
+ return { typeMismatch: true };
7051
+ }
7052
+
7042
7053
  if (this.hasConfirm && this.confirmInput && this.value !== this.confirmInput.value) {
7043
7054
  return { patternMismatch: true };
7044
7055
  }