@descope/web-components-ui 1.0.352 → 1.0.354
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index.cjs.js +10 -0
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +25 -6
- 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 +1 -1
- package/src/components/descope-new-password/descope-new-password-internal/NewPasswordInternal.js +15 -6
- 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
|
}
|
@@ -7068,10 +7079,18 @@ class NewPasswordInternal extends BaseInputClass$4 {
|
|
7068
7079
|
renderInputs() {
|
7069
7080
|
const template = `
|
7070
7081
|
<div>
|
7071
|
-
<descope-password
|
7082
|
+
<descope-password
|
7083
|
+
autocomplete="new-password"
|
7084
|
+
manual-visibility-toggle="true"
|
7085
|
+
data-id="password"
|
7086
|
+
></descope-password>
|
7072
7087
|
<descope-policy-validation></descope-policy-validation>
|
7073
7088
|
</div>
|
7074
|
-
<descope-password
|
7089
|
+
<descope-password
|
7090
|
+
autocomplete="new-password"
|
7091
|
+
manual-visibility-toggle="true"
|
7092
|
+
data-id="confirm"
|
7093
|
+
></descope-password>
|
7075
7094
|
`;
|
7076
7095
|
|
7077
7096
|
this.wrapperEle.innerHTML = template;
|