@truenas/ui-components 0.3.24 → 0.3.25

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": "@truenas/ui-components",
3
- "version": "0.3.24",
3
+ "version": "0.3.25",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org",
6
6
  "access": "public"
@@ -6515,7 +6515,7 @@ declare class TnTreeFlattener<T, F> {
6515
6515
  * (and call `filter(query)`) and/or `sortComparer`. Both are opt-in; when unset
6516
6516
  * the datasource behaves exactly as before.
6517
6517
  */
6518
- declare class TnTreeFlatDataSource<T, F> extends DataSource<F> {
6518
+ declare class TnTreeFlatDataSource<T, F, K = F> extends DataSource<F> {
6519
6519
  private _treeControl;
6520
6520
  private _treeFlattener;
6521
6521
  /** When set, `filter(query)` re-renders the tree from `filterPredicate(data, query)`. */
@@ -6528,17 +6528,23 @@ declare class TnTreeFlatDataSource<T, F> extends DataSource<F> {
6528
6528
  private _filteredData;
6529
6529
  private filterValue;
6530
6530
  private readonly filterChanged$;
6531
- private readonly disconnect$;
6532
- constructor(_treeControl: TnTreeExpansion<F>, _treeFlattener: TnTreeFlattener<T, F>);
6531
+ constructor(_treeControl: TnTreeExpansion<F, K>, _treeFlattener: TnTreeFlattener<T, F>);
6533
6532
  get data(): T[];
6534
6533
  set data(value: T[]);
6535
- /** The currently filtered (unflattened) data; equals `data` until `filter()` is used. */
6534
+ /** The currently filtered (unflattened) data; equals `data` while no filter query is active. */
6536
6535
  get filteredData(): T[];
6537
6536
  connect(): Observable<F[]>;
6538
6537
  disconnect(): void;
6539
6538
  /** Filters the tree using `filterPredicate` (debounced). No-op until `filterPredicate` is set. */
6540
6539
  filter(query: string): void;
6541
6540
  private flattenData;
6541
+ /**
6542
+ * Deliberately NOT torn down in `disconnect()`: CdkTree disconnects the
6543
+ * datasource when the tree is destroyed, but the same instance may be
6544
+ * reconnected (e.g. a tree behind an `@if`), and filtering must survive that.
6545
+ * The pipeline only references the datasource's own subjects, so it holds no
6546
+ * external resources and is collected with the instance.
6547
+ */
6542
6548
  private detectFilterChanges;
6543
6549
  private _getExpandedNodesWithLevel;
6544
6550
  }
@@ -6571,6 +6577,10 @@ declare class TnNestedTreeNodeComponent<T, K = T> extends CdkNestedTreeNode<T, K
6571
6577
  /**
6572
6578
  * Suppresses the built-in toggle button (and its alignment spacer) so the
6573
6579
  * consumer can render a fully custom toggle in the projected content.
6580
+ *
6581
+ * The built-in button is the only keyboard/AT-operable expand control this
6582
+ * component guarantees — when hiding it, the projected replacement must be
6583
+ * an accessible control (a real button with an aria-label, not a bare icon).
6574
6584
  */
6575
6585
  readonly hideToggle: _angular_core.InputSignalWithTransform<boolean, unknown>;
6576
6586
  private readonly changeDetectorRef;
@@ -6619,13 +6629,20 @@ declare class TnNestedTreeDataSource<T extends {
6619
6629
  }> extends DataSource<T> {
6620
6630
  /** When set, `filter(query)` re-renders the tree from `filterPredicate(data, query)`. */
6621
6631
  filterPredicate?: (data: T[], query: string) => T[];
6622
- /** When set, incoming `data` is sorted recursively before rendering. */
6632
+ /**
6633
+ * When set, incoming `data` is sorted recursively before rendering.
6634
+ *
6635
+ * Note: sorting REWRITES `children` arrays on the caller's node objects
6636
+ * (a new sorted array is assigned per node). Node object identity is
6637
+ * preserved — deliberately, since tree controls track expansion state by
6638
+ * node identity — but don't pass an object graph that is shared with code
6639
+ * relying on the original child order.
6640
+ */
6623
6641
  sortComparer?: (a: T, b: T) => number;
6624
6642
  private filterValue;
6625
6643
  private readonly filterChanged$;
6626
6644
  private readonly _data;
6627
6645
  private readonly _filteredData;
6628
- private readonly disconnect$;
6629
6646
  get data(): T[];
6630
6647
  set data(value: T[]);
6631
6648
  constructor(initialData?: T[]);
@@ -6633,6 +6650,13 @@ declare class TnNestedTreeDataSource<T extends {
6633
6650
  disconnect(): void;
6634
6651
  /** Filters the tree using `filterPredicate` (debounced). No-op until `filterPredicate` is set. */
6635
6652
  filter(query: string): void;
6653
+ /**
6654
+ * Deliberately NOT torn down in `disconnect()`: CdkTree disconnects the
6655
+ * datasource when the tree is destroyed, but the same instance may be
6656
+ * reconnected (e.g. a tree behind an `@if`), and filtering must survive that.
6657
+ * The pipeline only references the datasource's own subjects, so it holds no
6658
+ * external resources and is collected with the instance.
6659
+ */
6636
6660
  private detectFilterChanges;
6637
6661
  private sort;
6638
6662
  }
@@ -6777,6 +6801,10 @@ declare class TnTreeNodeHarness extends ComponentHarness {
6777
6801
  /**
6778
6802
  * Toggles the node together with all of its descendants (Alt+click on the
6779
6803
  * built-in nested-node toggle).
6804
+ *
6805
+ * Only nested nodes honor the Alt modifier — on a flat node the row's
6806
+ * `cdkTreeNodeToggle` is not Alt-aware, so this degrades to a plain
6807
+ * single-level toggle.
6780
6808
  */
6781
6809
  toggleWithDescendants(): Promise<void>;
6782
6810
  /**