@descope/web-components-ui 1.0.200 → 1.0.201

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.esm.js CHANGED
@@ -6211,13 +6211,17 @@ class ButtonSelectionGroupInternalClass extends createBaseInputClass({
6211
6211
  return this.getAttribute('size') || 'md';
6212
6212
  }
6213
6213
 
6214
+ get allowDeselect() {
6215
+ return this.getAttribute('allow-deselect') === 'true';
6216
+ }
6217
+
6214
6218
  removeSelected() {
6215
6219
  this.getSelectedNode()?.removeAttribute('selected');
6216
6220
  }
6217
6221
 
6218
6222
  onClick(e) {
6219
6223
  if (!this.isReadonly && e.target !== e.currentTarget) {
6220
- if (e.target === this.getSelectedNode()) {
6224
+ if (e.target === this.getSelectedNode() && this.allowDeselect) {
6221
6225
  this.removeSelected();
6222
6226
  } else {
6223
6227
  this.setSelected(e.target);
@@ -6386,7 +6390,9 @@ const customMixin = (superclass) =>
6386
6390
 
6387
6391
  this.inputElement = this.shadowRoot.querySelector(componentName$3);
6388
6392
 
6389
- forwardAttrs(this, this.inputElement, { includeAttrs: ['size', 'default-value'] });
6393
+ forwardAttrs(this, this.inputElement, {
6394
+ includeAttrs: ['size', 'default-value', 'allow-deselect'],
6395
+ });
6390
6396
 
6391
6397
  this.renderItems();
6392
6398