@descope/web-components-ui 1.0.353 → 1.0.355
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +21 -0
- package/dist/cjs/index.cjs.js +10 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +15 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/4978.js +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -1
- package/dist/umd/descope-new-password-index-js.js +1 -1
- package/package.json +2 -2
- package/src/components/descope-new-password/descope-new-password-internal/NewPasswordInternal.js +5 -4
- package/src/mixins/inputValidationMixin.js +10 -0
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
|
}
|