@descope/web-components-ui 1.53.0 → 1.55.0

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
@@ -11508,7 +11508,7 @@ class RawPolicyValidation extends createBaseClass$1({ componentName: componentNa
11508
11508
 
11509
11509
  if (attrName === 'data-password-policy-value-passwordstrength') {
11510
11510
  const passwordStrength = parseInt(newValue);
11511
- if (!Number.isNaN(passwordStrength) && passwordStrength > 0) {
11511
+ if (!Number.isNaN(passwordStrength) && passwordStrength >= 0) {
11512
11512
  this.#overrides = {
11513
11513
  ...this.#overrides,
11514
11514
  passwordstrength: {
@@ -11521,7 +11521,7 @@ class RawPolicyValidation extends createBaseClass$1({ componentName: componentNa
11521
11521
 
11522
11522
  if (attrName === 'data-password-policy-actual-passwordstrength') {
11523
11523
  const ln = Number(newValue);
11524
- if (!Number.isNaN(ln) && ln > 0) {
11524
+ if (!Number.isNaN(ln) && ln >= 0) {
11525
11525
  this.#overrides = {
11526
11526
  ...this.#overrides,
11527
11527
  passwordstrength: { ...this.#overrides?.passwordstrength, actual: ln },
@@ -11606,7 +11606,11 @@ class RawPolicyValidation extends createBaseClass$1({ componentName: componentNa
11606
11606
  const exp = new RegExp(interpolateString(pattern, data));
11607
11607
  validationResult.valid = exp.test(this.value);
11608
11608
  } else if (compare) {
11609
- validationResult.valid = this.compareValues(compare, data.expected, data.actual);
11609
+ validationResult.valid = this.compareValues(
11610
+ compare,
11611
+ data?.expected ?? -1,
11612
+ data?.actual ?? -1
11613
+ );
11610
11614
  }
11611
11615
 
11612
11616
  results.push(validationResult);
@@ -12043,14 +12047,14 @@ class NewPasswordInternal extends BaseInputClass$6 {
12043
12047
 
12044
12048
  // sync input value to policy validation panel
12045
12049
  this.passwordInput.addEventListener('input', (e) => {
12046
- this.passwordStrength.addEventListener(
12050
+ this.passwordStrength?.addEventListener(
12047
12051
  'score-changed',
12048
12052
  ({ detail }) => {
12049
12053
  this.policyPanel.setAttribute('data-password-policy-actual-passwordstrength', detail);
12050
12054
  },
12051
12055
  { once: true }
12052
12056
  );
12053
- this.passwordStrength.setAttribute('value', e.target.value);
12057
+ this.passwordStrength?.setAttribute('value', e.target.value);
12054
12058
  this.policyPanel.setAttribute('value', e.target.value);
12055
12059
  });
12056
12060
 
@@ -14189,7 +14193,12 @@ const multiSelectComboBoxMixin = (superclass) =>
14189
14193
 
14190
14194
  // eslint-disable-next-line class-methods-use-this
14191
14195
  #renderItem = ({ displayName, value, label }) => {
14192
- return `<span data-name="${label}" data-id="${value}">${displayName || label}</span>`;
14196
+ const ele = document.createElement('span');
14197
+ ele.setAttribute('data-name', label);
14198
+ ele.setAttribute('data-id', value);
14199
+ ele.textContent = displayName || label;
14200
+
14201
+ return ele.outerHTML;
14193
14202
  };
14194
14203
 
14195
14204
  #data;