@agorapulse/ui-components 20.1.5 → 20.1.6

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.
@@ -403,6 +403,18 @@ const computeNumberOfDisplayableChildrenOnUnfold = (entry) => {
403
403
  }
404
404
  return 0;
405
405
  };
406
+ const computeSelectableUids = (entries) => {
407
+ return entries.flatMap(entry => computeSelectableUidsByEntry(entry));
408
+ };
409
+ const computeSelectableUidsByEntry = (entry) => {
410
+ if (isInternalNavSelectorEntryALeaf(entry) && !entry.disabled) {
411
+ return [entry.uid, ...entry.details.filter(detail => !detail.hidden).map(detail => detail.uid)];
412
+ }
413
+ if (isInternalNavSelectorEntryANode(entry)) {
414
+ return [entry.uid, ...entry.children.flatMap(child => computeSelectableUidsByEntry(child))];
415
+ }
416
+ return [];
417
+ };
406
418
 
407
419
  /**
408
420
  * Class to handle the folding and unfolding of nav selector entries.
@@ -2783,8 +2795,9 @@ class NavSelectorComponent {
2783
2795
  untracked(() => this.navSelectorState.updateDetailsDisplayedLimit(detailsDisplayedLimit));
2784
2796
  });
2785
2797
  effect(() => {
2786
- const selectedEntryUids = this.selectedEntryUids();
2787
2798
  const isInit = !!this.navSelectorState.entries().length;
2799
+ const selectableEntryUids = computeSelectableUids(this.navSelectorState.entries());
2800
+ const selectedEntryUids = this.selectedEntryUids().filter(uid => selectableEntryUids.includes(uid));
2788
2801
  untracked(() => isInit && this.navSelectorState.onSelectionChange(selectedEntryUids));
2789
2802
  });
2790
2803
  effect(() => {