@descope/web-components-ui 1.0.197 → 1.0.199
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 +20 -10
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +21 -11
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/descope-button-selection-group-descope-button-selection-group-internal-index-js.js +1 -1
- package/dist/umd/descope-button-selection-group-index-js.js +1 -1
- package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js +1 -1
- package/package.json +1 -1
- package/src/components/descope-button-selection-group/ButtonSelectionGroupClass.js +17 -1
- package/src/components/descope-button-selection-group/descope-button-selection-group-internal/ButtonSelectionGroupInternalClass.js +10 -15
- package/src/components/phone-fields/descope-phone-field/descope-phone-field-internal/PhoneFieldInternal.js +1 -1
package/dist/cjs/index.cjs.js
CHANGED
@@ -7571,9 +7571,13 @@ class ButtonSelectionGroupInternalClass extends createBaseInputClass({
|
|
7571
7571
|
this.getSelectedNode()?.removeAttribute('selected');
|
7572
7572
|
}
|
7573
7573
|
|
7574
|
-
|
7575
|
-
if (!this.isReadonly) {
|
7576
|
-
|
7574
|
+
onClick(e) {
|
7575
|
+
if (!this.isReadonly && e.target !== e.currentTarget) {
|
7576
|
+
if (e.target === this.getSelectedNode()) {
|
7577
|
+
this.removeSelected();
|
7578
|
+
} else {
|
7579
|
+
this.setSelected(e.target);
|
7580
|
+
}
|
7577
7581
|
this.#dispatchChange();
|
7578
7582
|
}
|
7579
7583
|
}
|
@@ -7586,7 +7590,7 @@ class ButtonSelectionGroupInternalClass extends createBaseInputClass({
|
|
7586
7590
|
}
|
7587
7591
|
|
7588
7592
|
get value() {
|
7589
|
-
return this.getSelectedNode()?.value;
|
7593
|
+
return this.getSelectedNode()?.value || '';
|
7590
7594
|
}
|
7591
7595
|
|
7592
7596
|
set value(value) {
|
@@ -7646,12 +7650,7 @@ class ButtonSelectionGroupInternalClass extends createBaseInputClass({
|
|
7646
7650
|
|
7647
7651
|
observeAttributes(this, this.onObservedAttributeChange.bind(this), { includeAttrs: ['size'] });
|
7648
7652
|
|
7649
|
-
|
7650
|
-
addedNodes.forEach((node) => {
|
7651
|
-
node.addEventListener('click', this.onNodeClick.bind(this));
|
7652
|
-
node.setAttribute('size', this.size);
|
7653
|
-
});
|
7654
|
-
});
|
7653
|
+
this.querySelector('slot').addEventListener('click', this.onClick.bind(this));
|
7655
7654
|
}
|
7656
7655
|
}
|
7657
7656
|
|
@@ -7674,6 +7673,10 @@ const customMixin = (superclass) =>
|
|
7674
7673
|
this.renderItems();
|
7675
7674
|
}
|
7676
7675
|
|
7676
|
+
get size() {
|
7677
|
+
return this.inputElement?.size;
|
7678
|
+
}
|
7679
|
+
|
7677
7680
|
get data() {
|
7678
7681
|
if (this.#data) return this.#data;
|
7679
7682
|
|
@@ -7744,6 +7747,13 @@ const customMixin = (superclass) =>
|
|
7744
7747
|
this.renderItems();
|
7745
7748
|
|
7746
7749
|
observeAttributes(this, this.renderItems.bind(this), { includeAttrs: ['data'] });
|
7750
|
+
|
7751
|
+
// we want new items to get the size
|
7752
|
+
observeChildren(this, ({ addedNodes }) => {
|
7753
|
+
addedNodes.forEach((node) => {
|
7754
|
+
node.setAttribute('size', this.size);
|
7755
|
+
});
|
7756
|
+
});
|
7747
7757
|
}
|
7748
7758
|
};
|
7749
7759
|
|