@descope/web-components-ui 1.0.201 → 1.0.203

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
@@ -6220,7 +6220,7 @@ class ButtonSelectionGroupInternalClass extends createBaseInputClass({
6220
6220
  }
6221
6221
 
6222
6222
  onClick(e) {
6223
- if (!this.isReadonly && e.target !== e.currentTarget) {
6223
+ if (e.target !== e.currentTarget) {
6224
6224
  if (e.target === this.getSelectedNode() && this.allowDeselect) {
6225
6225
  this.removeSelected();
6226
6226
  } else {
@@ -6266,6 +6266,10 @@ class ButtonSelectionGroupInternalClass extends createBaseInputClass({
6266
6266
  });
6267
6267
  }
6268
6268
 
6269
+ onReadOnlyChange() {
6270
+ this.querySelector('slot').toggleAttribute('inert', this.isReadonly);
6271
+ }
6272
+
6269
6273
  getValidity() {
6270
6274
  if (this.isRequired && !this.value) {
6271
6275
  return { valueMissing: true };
@@ -6280,6 +6284,9 @@ class ButtonSelectionGroupInternalClass extends createBaseInputClass({
6280
6284
  case 'size':
6281
6285
  this.onSizeChange();
6282
6286
  break;
6287
+ case 'readonly':
6288
+ this.onReadOnlyChange();
6289
+ break;
6283
6290
  }
6284
6291
  });
6285
6292
  }
@@ -6289,14 +6296,16 @@ class ButtonSelectionGroupInternalClass extends createBaseInputClass({
6289
6296
  this.addEventListener('focus', (e) => {
6290
6297
  // we want to ignore focus events we are dispatching
6291
6298
  if (e.isTrusted) {
6292
- this.items[0].focus();
6299
+ this.items[0]?.focus();
6293
6300
  }
6294
6301
  });
6295
6302
 
6296
6303
  super.init?.();
6297
6304
  this.setDefaultValue();
6298
6305
 
6299
- observeAttributes(this, this.onObservedAttributeChange.bind(this), { includeAttrs: ['size'] });
6306
+ observeAttributes(this, this.onObservedAttributeChange.bind(this), {
6307
+ includeAttrs: ['size', 'readonly'],
6308
+ });
6300
6309
 
6301
6310
  this.querySelector('slot').addEventListener('click', this.onClick.bind(this));
6302
6311
  }