@descope/web-components-ui 3.25.0 → 3.26.1
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/cjs/index.cjs.js +22 -6
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +23 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/DescopeDev.js.map +1 -1
- package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -1
- package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js.map +1 -1
- package/dist/umd/descope-new-password-index-js.js +1 -1
- package/dist/umd/descope-new-password-index-js.js.map +1 -1
- package/dist/umd/descope-policy-validation-index-js.js +1 -1
- package/dist/umd/descope-policy-validation-index-js.js.map +1 -1
- package/dist/umd/index.js +1 -1
- package/package.json +45 -45
- package/src/components/descope-new-password/NewPasswordClass.js +1 -0
- package/src/components/descope-new-password/descope-new-password-internal/NewPasswordInternal.js +1 -0
- package/src/components/descope-policy-validation/PolicyValidationClass.js +21 -6
- package/stories/descope-policy-validation.stories.js +21 -1
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -24750,6 +24750,7 @@ const overrideAttrs = [
|
|
|
24750
24750
|
'data-password-policy-actual-passwordstrength',
|
|
24751
24751
|
'data-password-policy-value-disallowedchars',
|
|
24752
24752
|
'data-password-policy-value-email',
|
|
24753
|
+
'data-password-policy-value-reuse',
|
|
24753
24754
|
];
|
|
24754
24755
|
const dataAttrs = ['data', 'active-policies', 'overrides', ...overrideAttrs];
|
|
24755
24756
|
const policyAttrs = ['label', 'value', ...dataAttrs];
|
|
@@ -24846,6 +24847,13 @@ class RawPolicyValidation extends createBaseClass({ componentName: componentName
|
|
|
24846
24847
|
}
|
|
24847
24848
|
}
|
|
24848
24849
|
|
|
24850
|
+
if (attrName === 'data-password-policy-value-reuse') {
|
|
24851
|
+
const ln = Number(newValue);
|
|
24852
|
+
if (!Number.isNaN(ln) && ln > 0) {
|
|
24853
|
+
this.#overrides = { ...this.#overrides, reuse: { value: `${ln}` } };
|
|
24854
|
+
}
|
|
24855
|
+
}
|
|
24856
|
+
|
|
24849
24857
|
if (attrName === 'data-password-policy-value-passwordstrength') {
|
|
24850
24858
|
const passwordStrength = parseInt(newValue);
|
|
24851
24859
|
if (!Number.isNaN(passwordStrength) && passwordStrength >= 0) {
|
|
@@ -24964,17 +24972,17 @@ class RawPolicyValidation extends createBaseClass({ componentName: componentName
|
|
|
24964
24972
|
});
|
|
24965
24973
|
}
|
|
24966
24974
|
|
|
24967
|
-
|
|
24975
|
+
const items = this.#activePolicies.reduce((results, id) => {
|
|
24968
24976
|
const policy = policies.find((p) => p.id === id);
|
|
24969
24977
|
|
|
24970
24978
|
if (!policy) {
|
|
24971
24979
|
return results;
|
|
24972
24980
|
}
|
|
24973
24981
|
|
|
24974
|
-
const { pattern, message, data, compare } = policy;
|
|
24982
|
+
const { pattern, message, data, compare, info } = policy;
|
|
24975
24983
|
const normalizedCompare = typeof compare === 'string' ? compare.toUpperCase() : compare;
|
|
24976
24984
|
|
|
24977
|
-
if ((!pattern && !compare) || !message) {
|
|
24985
|
+
if ((!pattern && !compare && !info) || !message) {
|
|
24978
24986
|
return results;
|
|
24979
24987
|
}
|
|
24980
24988
|
|
|
@@ -24983,7 +24991,11 @@ class RawPolicyValidation extends createBaseClass({ componentName: componentName
|
|
|
24983
24991
|
id,
|
|
24984
24992
|
};
|
|
24985
24993
|
|
|
24986
|
-
if (
|
|
24994
|
+
if (info) {
|
|
24995
|
+
// informational rule the client can't check (e.g. password reuse):
|
|
24996
|
+
// `valid` stays undefined, so it renders neutral and never blocks `isValid`
|
|
24997
|
+
validationResult.info = true;
|
|
24998
|
+
} else if (pattern) {
|
|
24987
24999
|
const exp = new RegExp(interpolateString(pattern, data));
|
|
24988
25000
|
validationResult.valid = exp.test(this.value);
|
|
24989
25001
|
} else if (normalizedCompare === 'STR_NEQ_CI') {
|
|
@@ -25012,14 +25024,17 @@ class RawPolicyValidation extends createBaseClass({ componentName: componentName
|
|
|
25012
25024
|
|
|
25013
25025
|
return results;
|
|
25014
25026
|
}, []);
|
|
25027
|
+
|
|
25028
|
+
// informational rules always render last
|
|
25029
|
+
return items.sort((a, b) => Number(!!a.info) - Number(!!b.info));
|
|
25015
25030
|
}
|
|
25016
25031
|
|
|
25017
25032
|
get isValid() {
|
|
25018
25033
|
return !this.validate().some(({ valid }) => valid === false);
|
|
25019
25034
|
}
|
|
25020
25035
|
|
|
25021
|
-
buildValidationItem({ valid, message }) {
|
|
25022
|
-
const status = !this.value ? 'none' : valid;
|
|
25036
|
+
buildValidationItem({ valid, message, info }) {
|
|
25037
|
+
const status = !this.value || info ? 'none' : valid;
|
|
25023
25038
|
const li = document.createElement('li');
|
|
25024
25039
|
li.className = 'item';
|
|
25025
25040
|
li.dataset.valid = status;
|
|
@@ -25140,6 +25155,7 @@ const customMixin$4 = (superclass) =>
|
|
|
25140
25155
|
'data-password-policy-value-passwordstrength',
|
|
25141
25156
|
'data-password-policy-value-disallowedchars',
|
|
25142
25157
|
'data-password-policy-value-email',
|
|
25158
|
+
'data-password-policy-value-reuse',
|
|
25143
25159
|
'label-type',
|
|
25144
25160
|
'manual-visibility-toggle',
|
|
25145
25161
|
],
|