@mozaic-ds/angular 2.0.32 → 2.0.34

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mozaic-ds/angular",
3
- "version": "2.0.32",
3
+ "version": "2.0.34",
4
4
  "type": "module",
5
5
  "peerDependencies": {
6
6
  "@angular/common": ">=20.3.15",
@@ -3627,20 +3627,25 @@ declare class TreeStateService<T = unknown> {
3627
3627
  readonly expandedIds: _angular_core.WritableSignal<Set<string | number>>;
3628
3628
  readonly loadingIds: _angular_core.WritableSignal<Set<string | number>>;
3629
3629
  readonly internalNodes: _angular_core.WritableSignal<TreeNode<T>[]>;
3630
+ readonly loadChildrenFn: _angular_core.WritableSignal<LoadChildrenFn<T> | null>;
3630
3631
  readonly flatVisibleNodes: _angular_core.Signal<FlatNode<T>[]>;
3631
3632
  private _flatten;
3632
3633
  setExpanded(ids: Set<string | number>): void;
3633
3634
  toggleExpanded(id: string | number): void;
3635
+ expandAndLoad(node: TreeNode<T>): Observable<void>;
3634
3636
  addLoading(id: string | number): void;
3635
3637
  removeLoading(id: string | number): void;
3636
3638
  patchChildren(nodeId: string | number, children: TreeNode<T>[]): void;
3637
3639
  private _patchNode;
3640
+ findNode(nodeId: string | number): TreeNode<T> | null;
3641
+ private _findNodeRecursive;
3638
3642
  findParentId(nodeId: string | number): string | number | null;
3639
3643
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<TreeStateService<any>, never>;
3640
3644
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<TreeStateService<any>>;
3641
3645
  }
3642
3646
 
3643
3647
  declare class TreeSelectionService<T = unknown> {
3648
+ private readonly stateService;
3644
3649
  readonly selectedIds: _angular_core.WritableSignal<Set<string | number>>;
3645
3650
  readonly selectionMode: _angular_core.WritableSignal<TreeSelectionMode>;
3646
3651
  readonly rootNodes: _angular_core.WritableSignal<TreeNode<T>[]>;
@@ -3649,14 +3654,45 @@ declare class TreeSelectionService<T = unknown> {
3649
3654
  setRootNodes(nodes: TreeNode<T>[]): void;
3650
3655
  isSelected(id: string | number): boolean;
3651
3656
  isDisabled(node: TreeNode<T>, ancestors: TreeNode<T>[]): boolean;
3657
+ /**
3658
+ * A node is indeterminate when it has loaded children AND
3659
+ * some (but not all) of its leaf-level descendants are selected.
3660
+ */
3652
3661
  isIndeterminate(node: TreeNode<T>): boolean;
3662
+ /**
3663
+ * A node is checked when:
3664
+ * - Leaf node (no children or children not loaded): its ID is in selectedIds
3665
+ * - Parent with loaded children: ALL leaf descendants are selected
3666
+ */
3653
3667
  isCheckedComputed(node: TreeNode<T>): boolean;
3668
+ /**
3669
+ * Select a node: add all leaf descendant IDs (or the node's own ID if leaf).
3670
+ */
3654
3671
  selectNode(node: TreeNode<T>): void;
3672
+ /**
3673
+ * Deselect a node: remove all leaf descendant IDs (or the node's own ID if leaf).
3674
+ * Also remove the node's own ID in case it's in the set from external sources.
3675
+ */
3655
3676
  deselectNode(node: TreeNode<T>): void;
3656
3677
  toggleNode(node: TreeNode<T>): void;
3657
- private _collectEnabledIds;
3658
- private _collectEnabledDescendantIds;
3678
+ /**
3679
+ * Called when children are loaded for a node.
3680
+ * - If parent ID was in selectedIds: replace it with children's leaf IDs (propagate down).
3681
+ * - If parent ID was NOT in selectedIds: remove any orphan children IDs that
3682
+ * may have been left from a prior bulk operation (e.g. Select All → deselect parent).
3683
+ */
3684
+ propagateOnChildrenLoaded(parentId: string | number): void;
3685
+ /**
3686
+ * Collect leaf-level IDs (terminal nodes that have no loaded children).
3687
+ * Returns empty array if the node itself is a leaf.
3688
+ */
3689
+ private _collectLeafIds;
3690
+ /**
3691
+ * Collect ALL descendant IDs (both parents and leaves) for thorough cleanup on deselect.
3692
+ */
3693
+ private _collectAllDescendantIds;
3659
3694
  readonly allSelectedIds: _angular_core.Signal<Set<string | number>>;
3695
+ private _resolveNode;
3660
3696
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<TreeSelectionService<any>, never>;
3661
3697
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<TreeSelectionService<any>>;
3662
3698
  }
@@ -3706,6 +3742,8 @@ declare class MozTreeComponent<T = unknown> {
3706
3742
  onTreeFocus(): void;
3707
3743
  onExpandChange(): void;
3708
3744
  onSelectionChange(ids: Set<string | number>): void;
3745
+ expandPath(path: Array<string | number>): Promise<void>;
3746
+ scrollToNode(nodeId: string | number): void;
3709
3747
  expandAll(): void;
3710
3748
  collapseAll(): void;
3711
3749
  trackNode(_index: number, node: TreeNode<T>): string | number;