@mozaic-ds/angular 2.1.6 → 2.1.7

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.1.6",
3
+ "version": "2.1.7",
4
4
  "type": "module",
5
5
  "peerDependencies": {
6
6
  "@angular/common": ">=20.3.15",
@@ -2599,6 +2599,15 @@ declare class TreeStateService<T = unknown> {
2599
2599
  setExpanded(ids: Set<string | number>): void;
2600
2600
  toggleExpanded(id: string | number): void;
2601
2601
  expandAndLoad(node: TreeNode<T>): Observable<void>;
2602
+ /**
2603
+ * Loads a node's children on demand when they haven't been loaded yet.
2604
+ * Idempotent: a no-op (emits `[]`) when there is no `loadChildrenFn`, the
2605
+ * node is already loading, or its children are already present. This is the
2606
+ * single load primitive shared by the click-driven `expandAndLoad` and the
2607
+ * declarative auto-load effect in `MozTreeComponent` — so expanding a node
2608
+ * by clicking it and by writing to `expandedIds` go through the same path.
2609
+ */
2610
+ loadChildrenFor(node: TreeNode<T>): Observable<TreeNode<T>[]>;
2602
2611
  addLoading(id: string | number): void;
2603
2612
  removeLoading(id: string | number): void;
2604
2613
  patchChildren(nodeId: string | number, children: TreeNode<T>[]): void;
@@ -2725,7 +2734,19 @@ declare class MozTreeComponent<T = unknown> {
2725
2734
  onTreeFocus(): void;
2726
2735
  onExpandChange(): void;
2727
2736
  onSelectionChange(ids: Set<string | number>): void;
2737
+ /**
2738
+ * Convenience helper for the "expand a deep path, then scroll to it" pattern.
2739
+ * Adds every ancestor in `path` (all ids except the last) to `expandedIds`,
2740
+ * which lets the declarative auto-load effect fetch each lazy level, then
2741
+ * resolves once those levels have finished loading — so callers can safely
2742
+ * `scrollToNode(path.at(-1))` afterwards.
2743
+ *
2744
+ * Plain declarative usage — binding `[(expandedIds)]` and writing to it — does
2745
+ * not need this method; the tree loads expanded lazy nodes on its own. It
2746
+ * exists only to give an awaitable signal that the deep node is now visible.
2747
+ */
2728
2748
  expandPath(path: Array<string | number>): Promise<void>;
2749
+ private _waitForChildren;
2729
2750
  scrollToNode(nodeId: string | number): void;
2730
2751
  expandAll(): void;
2731
2752
  collapseAll(): void;