@descope/web-components-ui 1.0.391 → 1.0.392

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
@@ -14574,11 +14574,31 @@ class RawScopesList extends createBaseClass({ componentName: componentName$2, ba
14574
14574
  return this.getAttribute('size') || 'sm';
14575
14575
  }
14576
14576
 
14577
+ #getChildNodes() {
14578
+ return Array.from(this.shadowRoot.querySelector('div').children);
14579
+ }
14580
+
14581
+ // eslint-disable-next-line class-methods-use-this
14582
+ reportValidity() {
14583
+ this.checkValidity();
14584
+ }
14585
+
14586
+ // eslint-disable-next-line class-methods-use-this
14587
+ checkValidity() {
14588
+ return this.data.every((item) => !item.required || this.value.includes(item.id));
14589
+ }
14590
+
14577
14591
  get value() {
14578
- return Array.from(this.shadowRoot.querySelector('div').children).reduce(
14579
- (acc, el) => ({ ...acc, [el.getAttribute('data-id')]: el.checked }),
14580
- {}
14581
- );
14592
+ return this.#getChildNodes()
14593
+ .filter((node) => node.checked)
14594
+ .map((node) => node.getAttribute('data-id'));
14595
+ }
14596
+
14597
+ set value(val = []) {
14598
+ this.#getChildNodes().forEach((node) => {
14599
+ // eslint-disable-next-line no-param-reassign
14600
+ node.checked = val.includes(node.getAttribute('data-id'));
14601
+ });
14582
14602
  }
14583
14603
 
14584
14604
  get variant() {