@descope/web-components-ui 1.0.391 → 1.0.392

Sign up to get free protection for your applications and to get access to all the features.
@@ -16060,11 +16060,31 @@ class RawScopesList extends createBaseClass({ componentName: componentName$3, ba
16060
16060
  return this.getAttribute('size') || 'sm';
16061
16061
  }
16062
16062
 
16063
+ #getChildNodes() {
16064
+ return Array.from(this.shadowRoot.querySelector('div').children);
16065
+ }
16066
+
16067
+ // eslint-disable-next-line class-methods-use-this
16068
+ reportValidity() {
16069
+ this.checkValidity();
16070
+ }
16071
+
16072
+ // eslint-disable-next-line class-methods-use-this
16073
+ checkValidity() {
16074
+ return this.data.every((item) => !item.required || this.value.includes(item.id));
16075
+ }
16076
+
16063
16077
  get value() {
16064
- return Array.from(this.shadowRoot.querySelector('div').children).reduce(
16065
- (acc, el) => ({ ...acc, [el.getAttribute('data-id')]: el.checked }),
16066
- {}
16067
- );
16078
+ return this.#getChildNodes()
16079
+ .filter((node) => node.checked)
16080
+ .map((node) => node.getAttribute('data-id'));
16081
+ }
16082
+
16083
+ set value(val = []) {
16084
+ this.#getChildNodes().forEach((node) => {
16085
+ // eslint-disable-next-line no-param-reassign
16086
+ node.checked = val.includes(node.getAttribute('data-id'));
16087
+ });
16068
16088
  }
16069
16089
 
16070
16090
  get variant() {