@truenas/ui-components 0.3.23 → 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
|
@@ -5,11 +5,11 @@ import { ControlValueAccessor, NgControl, AbstractControl } from '@angular/forms
|
|
|
5
5
|
import { ComponentHarness, BaseHarnessFilters, HarnessPredicate, TestKey, HarnessLoader } from '@angular/cdk/testing';
|
|
6
6
|
import { SafeHtml, SafeResourceUrl, DomSanitizer } from '@angular/platform-browser';
|
|
7
7
|
import { ComponentFixture } from '@angular/core/testing';
|
|
8
|
-
import { SelectionModel, DataSource } from '@angular/cdk/collections';
|
|
8
|
+
import { SelectionModel, DataSource, CollectionViewer } from '@angular/cdk/collections';
|
|
9
9
|
import * as rxjs from 'rxjs';
|
|
10
10
|
import { Observable, BehaviorSubject } from 'rxjs';
|
|
11
11
|
import * as i1 from '@angular/cdk/tree';
|
|
12
|
-
import { CdkTree,
|
|
12
|
+
import { CdkTree, CdkTreeNode, CdkNestedTreeNode, CdkTreeNodeOutletContext, CdkTreeNodeDef } from '@angular/cdk/tree';
|
|
13
13
|
export { FlatTreeControl } from '@angular/cdk/tree';
|
|
14
14
|
import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
|
|
15
15
|
import { Overlay } from '@angular/cdk/overlay';
|
|
@@ -6444,6 +6444,52 @@ declare class TnTablePagerHarness extends ComponentHarness {
|
|
|
6444
6444
|
interface TnTablePagerHarnessFilters extends BaseHarnessFilters {
|
|
6445
6445
|
}
|
|
6446
6446
|
|
|
6447
|
+
/**
|
|
6448
|
+
* Interface for tree expansion state management.
|
|
6449
|
+
* This interface replaces the deprecated TreeControl from @angular/cdk/tree.
|
|
6450
|
+
*
|
|
6451
|
+
* It provides the same methods as the deprecated TreeControl interface
|
|
6452
|
+
* without directly referencing the deprecated type.
|
|
6453
|
+
*
|
|
6454
|
+
* Both FlatTreeControl and NestedTreeControl implement all these methods,
|
|
6455
|
+
* so this interface maintains full compatibility with existing code.
|
|
6456
|
+
*/
|
|
6457
|
+
interface TnTreeExpansion<T, K = T> {
|
|
6458
|
+
/** The saved tree nodes data for `expandAll` action. */
|
|
6459
|
+
dataNodes: T[];
|
|
6460
|
+
/** The expansion model */
|
|
6461
|
+
expansionModel: SelectionModel<K>;
|
|
6462
|
+
/** Whether the data node is expanded or collapsed. Return true if it's expanded. */
|
|
6463
|
+
isExpanded(dataNode: T): boolean;
|
|
6464
|
+
/** Get all descendants of a data node */
|
|
6465
|
+
getDescendants(dataNode: T): T[];
|
|
6466
|
+
/** Expand or collapse data node */
|
|
6467
|
+
toggle(dataNode: T): void;
|
|
6468
|
+
/** Expand one data node */
|
|
6469
|
+
expand(dataNode: T): void;
|
|
6470
|
+
/** Collapse one data node */
|
|
6471
|
+
collapse(dataNode: T): void;
|
|
6472
|
+
/** Expand all the dataNodes in the tree */
|
|
6473
|
+
expandAll(): void;
|
|
6474
|
+
/** Collapse all the dataNodes in the tree */
|
|
6475
|
+
collapseAll(): void;
|
|
6476
|
+
/** Toggle a data node by expand/collapse it and all its descendants */
|
|
6477
|
+
toggleDescendants(dataNode: T): void;
|
|
6478
|
+
/** Expand a data node and all its descendants */
|
|
6479
|
+
expandDescendants(dataNode: T): void;
|
|
6480
|
+
/** Collapse a data node and all its descendants */
|
|
6481
|
+
collapseDescendants(dataNode: T): void;
|
|
6482
|
+
/** Get depth of a given data node, return the level number. This is for flat tree node. */
|
|
6483
|
+
readonly getLevel: (dataNode: T) => number;
|
|
6484
|
+
/**
|
|
6485
|
+
* Whether the data node is expandable. Returns true if expandable.
|
|
6486
|
+
* This is for flat tree node.
|
|
6487
|
+
*/
|
|
6488
|
+
readonly isExpandable: (dataNode: T) => boolean;
|
|
6489
|
+
/** Gets a stream that emits whenever the given data node's children change. */
|
|
6490
|
+
readonly getChildren: (dataNode: T) => Observable<T[]> | T[] | undefined | null;
|
|
6491
|
+
}
|
|
6492
|
+
|
|
6447
6493
|
/** Flat node with expandable and level information */
|
|
6448
6494
|
interface TnFlatTreeNode<T = unknown> {
|
|
6449
6495
|
data: T;
|
|
@@ -6464,18 +6510,42 @@ declare class TnTreeFlattener<T, F> {
|
|
|
6464
6510
|
}
|
|
6465
6511
|
/**
|
|
6466
6512
|
* Data source for flat tree.
|
|
6513
|
+
*
|
|
6514
|
+
* Optionally supports client-side filtering and sorting: set `filterPredicate`
|
|
6515
|
+
* (and call `filter(query)`) and/or `sortComparer`. Both are opt-in; when unset
|
|
6516
|
+
* the datasource behaves exactly as before.
|
|
6467
6517
|
*/
|
|
6468
|
-
declare class TnTreeFlatDataSource<T, F> extends DataSource<F> {
|
|
6518
|
+
declare class TnTreeFlatDataSource<T, F, K = F> extends DataSource<F> {
|
|
6469
6519
|
private _treeControl;
|
|
6470
6520
|
private _treeFlattener;
|
|
6521
|
+
/** When set, `filter(query)` re-renders the tree from `filterPredicate(data, query)`. */
|
|
6522
|
+
filterPredicate?: (data: T[], query: string) => T[];
|
|
6523
|
+
/** When set, incoming `data` is sorted (top level) before flattening. */
|
|
6524
|
+
sortComparer?: (a: T, b: T) => number;
|
|
6471
6525
|
private _flattenedData;
|
|
6472
6526
|
private _expandedData;
|
|
6473
6527
|
private _data;
|
|
6474
|
-
|
|
6528
|
+
private _filteredData;
|
|
6529
|
+
private filterValue;
|
|
6530
|
+
private readonly filterChanged$;
|
|
6531
|
+
constructor(_treeControl: TnTreeExpansion<F, K>, _treeFlattener: TnTreeFlattener<T, F>);
|
|
6475
6532
|
get data(): T[];
|
|
6476
6533
|
set data(value: T[]);
|
|
6534
|
+
/** The currently filtered (unflattened) data; equals `data` while no filter query is active. */
|
|
6535
|
+
get filteredData(): T[];
|
|
6477
6536
|
connect(): Observable<F[]>;
|
|
6478
6537
|
disconnect(): void;
|
|
6538
|
+
/** Filters the tree using `filterPredicate` (debounced). No-op until `filterPredicate` is set. */
|
|
6539
|
+
filter(query: string): void;
|
|
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
|
+
*/
|
|
6548
|
+
private detectFilterChanges;
|
|
6479
6549
|
private _getExpandedNodesWithLevel;
|
|
6480
6550
|
}
|
|
6481
6551
|
declare class TnTreeComponent<T, K = T> extends CdkTree<T, K> {
|
|
@@ -6497,6 +6567,24 @@ declare class TnTreeNodeComponent<T, K = T> extends CdkTreeNode<T, K> {
|
|
|
6497
6567
|
}
|
|
6498
6568
|
|
|
6499
6569
|
declare class TnNestedTreeNodeComponent<T, K = T> extends CdkNestedTreeNode<T, K> {
|
|
6570
|
+
/**
|
|
6571
|
+
* Accessible label for the built-in toggle button. Pass a translated string;
|
|
6572
|
+
* defaults to the previous hardcoded value.
|
|
6573
|
+
*/
|
|
6574
|
+
readonly toggleAriaLabel: _angular_core.InputSignal<string>;
|
|
6575
|
+
/** Semantic test-id base applied to the built-in toggle button (`button-` prefixed). */
|
|
6576
|
+
readonly toggleTestId: _angular_core.InputSignal<TnTestIdValue>;
|
|
6577
|
+
/**
|
|
6578
|
+
* Suppresses the built-in toggle button (and its alignment spacer) so the
|
|
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).
|
|
6584
|
+
*/
|
|
6585
|
+
readonly hideToggle: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
6586
|
+
private readonly changeDetectorRef;
|
|
6587
|
+
private destroyed;
|
|
6500
6588
|
constructor();
|
|
6501
6589
|
/** The tree node's level in the tree */
|
|
6502
6590
|
get level(): number;
|
|
@@ -6504,8 +6592,24 @@ declare class TnNestedTreeNodeComponent<T, K = T> extends CdkNestedTreeNode<T, K
|
|
|
6504
6592
|
get isExpandable(): boolean;
|
|
6505
6593
|
/** Whether the tree node is expanded */
|
|
6506
6594
|
get isExpanded(): boolean;
|
|
6595
|
+
/**
|
|
6596
|
+
* CDK inserts child node views synchronously from `ngAfterContentInit`, i.e.
|
|
6597
|
+
* mid-change-detection. Because the outlet here lives in PROJECTED content
|
|
6598
|
+
* whose view container has already been traversed for the current pass, the
|
|
6599
|
+
* new views would miss their first check and trip dev-mode NG0100. Defer the
|
|
6600
|
+
* insertion to a microtask so the views are created outside change detection
|
|
6601
|
+
* and get a normal first check on the pass that `markForCheck` schedules.
|
|
6602
|
+
*/
|
|
6603
|
+
protected updateChildrenNodes(children?: T[]): void;
|
|
6604
|
+
/**
|
|
6605
|
+
* Toggles the node; with the Alt key held, toggles the node together with all
|
|
6606
|
+
* of its descendants. Replaces `cdkTreeNodeToggle` on the built-in button so
|
|
6607
|
+
* the Alt behavior is deterministic (a stacked template listener would run in
|
|
6608
|
+
* an unspecified order relative to the CDK toggle's own click handler).
|
|
6609
|
+
*/
|
|
6610
|
+
protected toggleNode(event: Event): void;
|
|
6507
6611
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TnNestedTreeNodeComponent<any, any>, never>;
|
|
6508
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TnNestedTreeNodeComponent<any, any>, "tn-nested-tree-node", ["tnNestedTreeNode"], {}, {}, never, ["*", "[slot=children]"], true,
|
|
6612
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TnNestedTreeNodeComponent<any, any>, "tn-nested-tree-node", ["tnNestedTreeNode"], { "toggleAriaLabel": { "alias": "toggleAriaLabel"; "required": false; "isSignal": true; }; "toggleTestId": { "alias": "toggleTestId"; "required": false; "isSignal": true; }; "hideToggle": { "alias": "hideToggle"; "required": false; "isSignal": true; }; }, {}, never, ["*", "[slot=children]"], true, [{ directive: typeof TnTestIdDirective; inputs: { "tnTestId": "testId"; }; outputs: {}; }]>;
|
|
6509
6613
|
}
|
|
6510
6614
|
|
|
6511
6615
|
declare class TnTreeNodeOutletDirective {
|
|
@@ -6513,6 +6617,246 @@ declare class TnTreeNodeOutletDirective {
|
|
|
6513
6617
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<TnTreeNodeOutletDirective, "[tnTreeNodeOutlet]", never, {}, {}, never, never, true, [{ directive: typeof i1.CdkTreeNodeOutlet; inputs: {}; outputs: {}; }]>;
|
|
6514
6618
|
}
|
|
6515
6619
|
|
|
6620
|
+
/**
|
|
6621
|
+
* Data source for nested trees (`tn-nested-tree-node`).
|
|
6622
|
+
*
|
|
6623
|
+
* Optionally supports client-side filtering and sorting: set `filterPredicate`
|
|
6624
|
+
* (and call `filter(query)`) and/or `sortComparer` (applied recursively through
|
|
6625
|
+
* `children`). Both are opt-in.
|
|
6626
|
+
*/
|
|
6627
|
+
declare class TnNestedTreeDataSource<T extends {
|
|
6628
|
+
children?: T[];
|
|
6629
|
+
}> extends DataSource<T> {
|
|
6630
|
+
/** When set, `filter(query)` re-renders the tree from `filterPredicate(data, query)`. */
|
|
6631
|
+
filterPredicate?: (data: T[], query: string) => T[];
|
|
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
|
+
*/
|
|
6641
|
+
sortComparer?: (a: T, b: T) => number;
|
|
6642
|
+
private filterValue;
|
|
6643
|
+
private readonly filterChanged$;
|
|
6644
|
+
private readonly _data;
|
|
6645
|
+
private readonly _filteredData;
|
|
6646
|
+
get data(): T[];
|
|
6647
|
+
set data(value: T[]);
|
|
6648
|
+
constructor(initialData?: T[]);
|
|
6649
|
+
connect(collectionViewer: CollectionViewer): Observable<T[]>;
|
|
6650
|
+
disconnect(): void;
|
|
6651
|
+
/** Filters the tree using `filterPredicate` (debounced). No-op until `filterPredicate` is set. */
|
|
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
|
+
*/
|
|
6660
|
+
private detectFilterChanges;
|
|
6661
|
+
private sort;
|
|
6662
|
+
}
|
|
6663
|
+
|
|
6664
|
+
/**
|
|
6665
|
+
* Factory functions for creating tree controls without triggering deprecation warnings
|
|
6666
|
+
* in consuming code.
|
|
6667
|
+
*
|
|
6668
|
+
* ## Why we still use deprecated TreeControl classes
|
|
6669
|
+
*
|
|
6670
|
+
* Angular CDK deprecated TreeControl, FlatTreeControl, and NestedTreeControl in v19,
|
|
6671
|
+
* with plans to remove them in v21. However, a complete replacement API has not been
|
|
6672
|
+
* provided yet.
|
|
6673
|
+
*
|
|
6674
|
+
* ### The Problem with Current Migration Path
|
|
6675
|
+
*
|
|
6676
|
+
* The deprecation message suggests using `levelAccessor` or `childrenAccessor` on CdkTree,
|
|
6677
|
+
* but these are only for describing your data structure - they don't provide:
|
|
6678
|
+
*
|
|
6679
|
+
* 1. **Programmatic access to expansion state** - CdkTree's `_expansionModel` is private
|
|
6680
|
+
* 2. **Access to data nodes** - Needed for operations like `expandAll()`
|
|
6681
|
+
* 3. **Helper methods** - Like `getDescendants()`, `isExpandable()`, `getLevel()`
|
|
6682
|
+
* 4. **External expansion control** - Data sources need to react to expansion changes
|
|
6683
|
+
*
|
|
6684
|
+
* ### Our Solution: Centralized Technical Debt
|
|
6685
|
+
*
|
|
6686
|
+
* This file encapsulates ALL usage of deprecated TreeControl classes:
|
|
6687
|
+
*
|
|
6688
|
+
* - Consumers work with the `TnTreeExpansion` interface (not deprecated)
|
|
6689
|
+
* - When Angular provides a proper replacement API, only this file changes and the
|
|
6690
|
+
* `TnTreeExpansion` interface stays stable, making the migration transparent
|
|
6691
|
+
*
|
|
6692
|
+
* @see https://github.com/angular/components/issues/29856 - GitHub issue discussing the migration gap
|
|
6693
|
+
*/
|
|
6694
|
+
/** Optional configuration for flat tree control */
|
|
6695
|
+
interface FlatTreeControlOptions<T, K> {
|
|
6696
|
+
trackBy?: (dataNode: T) => K;
|
|
6697
|
+
}
|
|
6698
|
+
/** Optional configuration for nested tree control */
|
|
6699
|
+
interface NestedTreeControlOptions<T, K> {
|
|
6700
|
+
isExpandable?: (dataNode: T) => boolean;
|
|
6701
|
+
trackBy?: (dataNode: T) => K;
|
|
6702
|
+
}
|
|
6703
|
+
/**
|
|
6704
|
+
* Creates a flat tree control for managing expansion state of flat tree structures.
|
|
6705
|
+
*
|
|
6706
|
+
* @param getLevel - Function that returns the level/depth of a node
|
|
6707
|
+
* @param isExpandable - Function that returns whether a node can be expanded
|
|
6708
|
+
* @param options - Optional configuration including trackBy function
|
|
6709
|
+
* @returns TnTreeExpansion instance for managing tree state
|
|
6710
|
+
*
|
|
6711
|
+
* @example
|
|
6712
|
+
* ```ts
|
|
6713
|
+
* const treeControl = createFlatTreeControl<DatasetDetails, string>(
|
|
6714
|
+
* (dataset) => (dataset?.name?.split('/')?.length || 0) - 1,
|
|
6715
|
+
* (dataset) => Number(dataset?.children?.length) > 0,
|
|
6716
|
+
* { trackBy: (dataset) => dataset.id }
|
|
6717
|
+
* );
|
|
6718
|
+
* ```
|
|
6719
|
+
*/
|
|
6720
|
+
declare function createFlatTreeControl<T, K = T>(getLevel: (dataNode: T) => number, isExpandable: (dataNode: T) => boolean, options?: FlatTreeControlOptions<T, K>): TnTreeExpansion<T, K>;
|
|
6721
|
+
/**
|
|
6722
|
+
* Creates a nested tree control for managing expansion state of nested tree structures.
|
|
6723
|
+
*
|
|
6724
|
+
* @param getChildren - Function that returns the children of a node
|
|
6725
|
+
* @param options - Optional configuration including isExpandable and trackBy functions
|
|
6726
|
+
* @returns TnTreeExpansion instance for managing tree state
|
|
6727
|
+
*
|
|
6728
|
+
* @example
|
|
6729
|
+
* ```ts
|
|
6730
|
+
* const treeControl = createNestedTreeControl<VDevNode, string>(
|
|
6731
|
+
* (vdev) => vdev.children,
|
|
6732
|
+
* { trackBy: (vdev) => vdev.guid }
|
|
6733
|
+
* );
|
|
6734
|
+
* ```
|
|
6735
|
+
*/
|
|
6736
|
+
declare function createNestedTreeControl<T, K = T>(getChildren: (dataNode: T) => Observable<T[]> | T[] | undefined | null, options?: NestedTreeControlOptions<T, K>): TnTreeExpansion<T, K>;
|
|
6737
|
+
|
|
6738
|
+
/** Filters for finding `TnTreeNodeHarness` instances. */
|
|
6739
|
+
interface TnTreeNodeHarnessFilters extends BaseHarnessFilters {
|
|
6740
|
+
/** Only find nodes whose text matches the given value. */
|
|
6741
|
+
text?: string | RegExp;
|
|
6742
|
+
/** Only find nodes whose expansion state matches. */
|
|
6743
|
+
expanded?: boolean;
|
|
6744
|
+
/** Only find nodes at the given 0-based level (root nodes are 0). */
|
|
6745
|
+
level?: number;
|
|
6746
|
+
}
|
|
6747
|
+
/** Filters for finding `TnTreeHarness` instances. */
|
|
6748
|
+
type TnTreeHarnessFilters = BaseHarnessFilters;
|
|
6749
|
+
/**
|
|
6750
|
+
* Harness for interacting with a single `tn-tree-node` or `tn-nested-tree-node`.
|
|
6751
|
+
*
|
|
6752
|
+
* Levels are 0-based (root nodes are level 0), matching the values consumers pass
|
|
6753
|
+
* to tree controls — the DOM's 1-based `aria-level` is converted internally.
|
|
6754
|
+
*/
|
|
6755
|
+
declare class TnTreeNodeHarness extends ComponentHarness {
|
|
6756
|
+
static hostSelector: string;
|
|
6757
|
+
/** The built-in nested-node toggle button (absent on flat nodes, leaves, and `hideToggle` nodes). */
|
|
6758
|
+
private readonly nestedToggle;
|
|
6759
|
+
/** The flat node's row, which acts as its toggle surface. */
|
|
6760
|
+
private readonly flatRow;
|
|
6761
|
+
/**
|
|
6762
|
+
* Gets a `HarnessPredicate` that can be used to search for a tree node with
|
|
6763
|
+
* specific attributes.
|
|
6764
|
+
*
|
|
6765
|
+
* @param options Options for filtering which instances are considered a match.
|
|
6766
|
+
* @returns A `HarnessPredicate` configured with the given options.
|
|
6767
|
+
*/
|
|
6768
|
+
static with(options?: TnTreeNodeHarnessFilters): HarnessPredicate<TnTreeNodeHarness>;
|
|
6769
|
+
/**
|
|
6770
|
+
* Gets the node's own text, excluding any descendant tree nodes and the
|
|
6771
|
+
* built-in toggle button.
|
|
6772
|
+
*
|
|
6773
|
+
* @returns Promise resolving to the node's text.
|
|
6774
|
+
*/
|
|
6775
|
+
getText(): Promise<string>;
|
|
6776
|
+
/**
|
|
6777
|
+
* Gets the node's 0-based level (root nodes are 0).
|
|
6778
|
+
*
|
|
6779
|
+
* @returns Promise resolving to the level.
|
|
6780
|
+
*/
|
|
6781
|
+
getLevel(): Promise<number>;
|
|
6782
|
+
/**
|
|
6783
|
+
* Whether the node is expandable (advertises `aria-expanded`).
|
|
6784
|
+
*
|
|
6785
|
+
* @returns Promise resolving to true if the node is expandable.
|
|
6786
|
+
*/
|
|
6787
|
+
isExpandable(): Promise<boolean>;
|
|
6788
|
+
/**
|
|
6789
|
+
* Whether an expandable node is currently expanded.
|
|
6790
|
+
*
|
|
6791
|
+
* @returns Promise resolving to true if `aria-expanded="true"`.
|
|
6792
|
+
*/
|
|
6793
|
+
isExpanded(): Promise<boolean>;
|
|
6794
|
+
/**
|
|
6795
|
+
* Toggles the node's expansion by clicking its toggle surface — the built-in
|
|
6796
|
+
* toggle button on a nested node, or the row itself on a flat node. Throws for
|
|
6797
|
+
* nested nodes rendered with `hideToggle` (interact with the custom toggle
|
|
6798
|
+
* directly in that case).
|
|
6799
|
+
*/
|
|
6800
|
+
toggle(): Promise<void>;
|
|
6801
|
+
/**
|
|
6802
|
+
* Toggles the node together with all of its descendants (Alt+click on the
|
|
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.
|
|
6808
|
+
*/
|
|
6809
|
+
toggleWithDescendants(): Promise<void>;
|
|
6810
|
+
/**
|
|
6811
|
+
* Expands the node if it is expandable and currently collapsed.
|
|
6812
|
+
*/
|
|
6813
|
+
expand(): Promise<void>;
|
|
6814
|
+
/**
|
|
6815
|
+
* Collapses the node if it is currently expanded.
|
|
6816
|
+
*/
|
|
6817
|
+
collapse(): Promise<void>;
|
|
6818
|
+
private getToggle;
|
|
6819
|
+
}
|
|
6820
|
+
/**
|
|
6821
|
+
* Harness for interacting with `tn-tree` in tests.
|
|
6822
|
+
*
|
|
6823
|
+
* @example
|
|
6824
|
+
* ```typescript
|
|
6825
|
+
* const tree = await loader.getHarness(TnTreeHarness);
|
|
6826
|
+
* const roots = await tree.getNodes({ level: 0 });
|
|
6827
|
+
* await roots[0].expand();
|
|
6828
|
+
* expect(await tree.getNodeTexts()).toContain('child');
|
|
6829
|
+
* ```
|
|
6830
|
+
*/
|
|
6831
|
+
declare class TnTreeHarness extends ComponentHarness {
|
|
6832
|
+
static hostSelector: string;
|
|
6833
|
+
/**
|
|
6834
|
+
* Gets a `HarnessPredicate` that can be used to search for a tree with
|
|
6835
|
+
* specific attributes.
|
|
6836
|
+
*
|
|
6837
|
+
* @param options Options for filtering which instances are considered a match.
|
|
6838
|
+
* @returns A `HarnessPredicate` configured with the given options.
|
|
6839
|
+
*/
|
|
6840
|
+
static with(options?: TnTreeHarnessFilters): HarnessPredicate<TnTreeHarness>;
|
|
6841
|
+
/**
|
|
6842
|
+
* Gets the harnesses for the tree's nodes (all levels, in document order).
|
|
6843
|
+
*
|
|
6844
|
+
* Note: nested trees render collapsed subtrees into the DOM (hidden via CSS),
|
|
6845
|
+
* so nodes under a collapsed parent are still returned — filter by `level` or
|
|
6846
|
+
* check the parent's `isExpanded()` when visibility matters.
|
|
6847
|
+
*
|
|
6848
|
+
* @param filter Optional filter to narrow the nodes.
|
|
6849
|
+
* @returns Promise resolving to the matching node harnesses.
|
|
6850
|
+
*/
|
|
6851
|
+
getNodes(filter?: TnTreeNodeHarnessFilters): Promise<TnTreeNodeHarness[]>;
|
|
6852
|
+
/**
|
|
6853
|
+
* Gets the text of every node currently rendered, in document order.
|
|
6854
|
+
*
|
|
6855
|
+
* @returns Promise resolving to an array of node texts.
|
|
6856
|
+
*/
|
|
6857
|
+
getNodeTexts(): Promise<string[]>;
|
|
6858
|
+
}
|
|
6859
|
+
|
|
6516
6860
|
/**
|
|
6517
6861
|
* A single flattened tree node prepared for virtual-scroll rendering.
|
|
6518
6862
|
*
|
|
@@ -9410,5 +9754,5 @@ declare const TN_THEME_DEFINITIONS: readonly TnThemeDefinition[];
|
|
|
9410
9754
|
*/
|
|
9411
9755
|
declare const THEME_MAP: Map<TnTheme, TnThemeDefinition>;
|
|
9412
9756
|
|
|
9413
|
-
export { CommonShortcuts, DEFAULT_THEME, DiskIconComponent, DiskType, FileSizePipe, InputType, LIGHT_THEME, LabelMarkupPipe, LabelTextPipe, LinuxModifierKeys, LinuxShortcuts, ModifierKeys, QuickShortcuts, ShortcutBuilder, StripMntPrefixPipe, THEME_MAP, THEME_STORAGE_KEY, TN_FORM_FIELD_CONTEXT, TN_FORM_FIELD_ERRORS, TN_TABLE_PAGER_DEFAULT_LABELS, TN_TABLE_PAGER_LABELS, TN_TEST_ATTR, TN_THEME_DEFINITIONS, TnAutocompleteComponent, TnAutocompleteHarness, TnBannerActionDirective, TnBannerComponent, TnBannerHarness, TnBrandedSpinnerComponent, TnButtonComponent, TnButtonHarness, TnButtonToggleComponent, TnButtonToggleGroupComponent, TnButtonToggleGroupHarness, TnButtonToggleHarness, TnCalendarComponent, TnCalendarHeaderComponent, TnCardComponent, TnCardFooterActionsDirective, TnCardHeaderActionsDirective, TnCardHeaderDirective, TnCellDefDirective, TnCheckboxComponent, TnCheckboxHarness, TnCheckboxLabelDirective, TnChipComponent, TnChipHarness, TnChipInputComponent, TnChipInputHarness, TnConfirmDialogComponent, TnDateInputComponent, TnDateInputHarness, TnDateRangeInputComponent, TnDateRangeInputHarness, TnDetailRowDefDirective, TnDialog, TnDialogHarness, TnDialogShellComponent, TnDialogTesting, TnDividerComponent, TnDividerDirective, TnDrawerComponent, TnDrawerContainerComponent, TnDrawerContainerHarness, TnDrawerContentComponent, TnDrawerHarness, TnEmptyComponent, TnEmptyHarness, TnExpansionPanelComponent, TnExpansionPanelHarness, TnFileInputComponent, TnFileInputHarness, TnFilePickerComponent, TnFilePickerPopupComponent, TnFormFieldComponent, TnFormFieldHarness, TnFormSectionComponent, TnFormSectionHarness, TnHeaderCellDefDirective, TnIconButtonComponent, TnIconButtonHarness, TnIconComponent, TnIconHarness, TnIconRegistryService, TnIconTesting, TnInputComponent, TnInputDirective, TnInputHarness, TnKeyboardShortcutComponent, TnKeyboardShortcutService, TnListAvatarDirective, TnListComponent, TnListIconDirective, TnListItemComponent, TnListItemLineDirective, TnListItemPrimaryDirective, TnListItemSecondaryDirective, TnListItemTitleDirective, TnListItemTrailingDirective, TnListOptionComponent, TnListSubheaderComponent, TnMenuActivateHoverDirective, TnMenuComponent, TnMenuHarness, TnMenuItemComponent, TnMenuTesting, TnMenuTriggerDirective, TnMonthViewComponent, TnMultiYearViewComponent, TnNestedTreeNodeComponent, TnParticleProgressBarComponent, TnProgressBarComponent, TnRadioComponent, TnRadioHarness, TnSelectComponent, TnSelectHarness, TnSelectionListComponent, TnSidePanelActionDirective, TnSidePanelComponent, TnSidePanelHarness, TnSidePanelHeaderActionDirective, TnSlideToggleComponent, TnSlideToggleHarness, TnSliderComponent, TnSliderThumbDirective, TnSliderWithLabelDirective, TnSpinnerComponent, TnSpriteLoaderService, TnStepComponent, TnStepperComponent, TnStepperHarness, TnStepperNextDirective, TnStepperPreviousDirective, TnTabComponent, TnTabHarness, TnTabPanelComponent, TnTabPanelHarness, TnTableColumnDirective, TnTableComponent, TnTableHarness, TnTablePagerComponent, TnTablePagerHarness, TnTabsComponent, TnTabsHarness, TnTestIdDirective, TnTheme, TnThemeService, TnTimeInputComponent, TnToastComponent, TnToastMock, TnToastPosition, TnToastRef, TnToastService, TnToastTesting, TnToastType, TnTooltipComponent, TnTooltipDirective, TnTreeComponent, TnTreeFlatDataSource, TnTreeFlattener, TnTreeNodeComponent, TnTreeNodeOutletDirective, TnTreeVirtualScrollNodeOutletDirective, TnTreeVirtualScrollViewComponent, TnTreeVirtualScrollViewHarness, TruncatePathPipe, WindowsModifierKeys, WindowsShortcuts, composeTestId, controlTestId, createLucideLibrary, createShortcut, defaultSpriteBasePath, defaultSpriteConfigPath, defaultTreeItemSize, formatSize, injectTnFormFieldAria, kebabTestSegment, labelMarkupToHtml, labelMarkupToText, libIconMarker, optionTestId, parseLabelMarkup, parseSize, registerLucideIcons, scopeTestId, setupLucideIntegration, tnIconMarker, writeTestId };
|
|
9414
|
-
export type { AutocompleteHarnessFilters, BannerHarnessFilters, ButtonHarnessFilters, ButtonToggleHarnessFilters, CalendarCell, CheckboxHarnessFilters, ChipColor, ChipHarnessFilters, CreateFolderEvent, DateInputHarnessFilters, DateRange, DateRangeInputHarnessFilters, DialogHarnessFilters, EmptyHarnessFilters, ExpansionPanelHarnessFilters, FileInputHarnessFilters, FilePickerCallbacks, FilePickerError, FilePickerMode, FileSystemItem, FormFieldHarnessFilters, FormSectionHarnessFilters, IconButtonHarnessFilters, IconHarnessFilters, IconLibrary, IconLibraryType, IconResult, IconSize, IconSource, IconTestingMockOverrides, InputHarnessFilters, KeyCombination, LabelMarkupSegment, LabelMarkupSegmentType, LabelType, LucideIconOptions, MenuHarnessFilters, MockIconRegistry, MockSpriteLoader, PathSegment, PlatformType, ProgressBarMode, RadioHarnessFilters, ResolvedIcon, SelectHarnessFilters, ShortcutHandler, SidePanelHarnessFilters, SizeStandard, SlideToggleColor, SlideToggleHarnessFilters, SpinnerMode, SpriteConfig, StepperHarnessFilters, SubscriptSizing, TabChangeEvent, TabHarnessFilters, TabPanelHarnessFilters, TabsHarnessFilters, TnAutocompleteOption, TnBannerType, TnButtonToggleType, TnCardAction, TnCardControl, TnCardFooterLink, TnCardHeaderStatus, TnChipInputHarnessFilters, TnChipInputOption, TnConfirmDialogData, TnDialogDefaults, TnDialogOpenTarget, TnDrawerMode, TnDrawerPosition, TnEmptySize, TnFlatTreeNode, TnFormFieldAriaBindings, TnFormFieldContext, TnFormFieldErrorMessage, TnFormFieldErrorMessages, TnFormFieldErrorResolver, TnMenuItem, TnOptionTestIdSource, TnSelectOption, TnSelectOptionGroup, TnSelectionChange, TnSortEvent, TnTableDataProvider, TnTableDataSource, TnTableHarnessFilters, TnTablePagerHarnessFilters, TnTablePagerLabels, TnTablePagination, TnTestAttrName, TnTestIdValue, TnThemeDefinition, TnToastCall, TnToastConfig, TnTreeVirtualNodeData, TnTreeVirtualScrollViewHarnessFilters, TooltipPosition, YearCell };
|
|
9757
|
+
export { CommonShortcuts, DEFAULT_THEME, DiskIconComponent, DiskType, FileSizePipe, InputType, LIGHT_THEME, LabelMarkupPipe, LabelTextPipe, LinuxModifierKeys, LinuxShortcuts, ModifierKeys, QuickShortcuts, ShortcutBuilder, StripMntPrefixPipe, THEME_MAP, THEME_STORAGE_KEY, TN_FORM_FIELD_CONTEXT, TN_FORM_FIELD_ERRORS, TN_TABLE_PAGER_DEFAULT_LABELS, TN_TABLE_PAGER_LABELS, TN_TEST_ATTR, TN_THEME_DEFINITIONS, TnAutocompleteComponent, TnAutocompleteHarness, TnBannerActionDirective, TnBannerComponent, TnBannerHarness, TnBrandedSpinnerComponent, TnButtonComponent, TnButtonHarness, TnButtonToggleComponent, TnButtonToggleGroupComponent, TnButtonToggleGroupHarness, TnButtonToggleHarness, TnCalendarComponent, TnCalendarHeaderComponent, TnCardComponent, TnCardFooterActionsDirective, TnCardHeaderActionsDirective, TnCardHeaderDirective, TnCellDefDirective, TnCheckboxComponent, TnCheckboxHarness, TnCheckboxLabelDirective, TnChipComponent, TnChipHarness, TnChipInputComponent, TnChipInputHarness, TnConfirmDialogComponent, TnDateInputComponent, TnDateInputHarness, TnDateRangeInputComponent, TnDateRangeInputHarness, TnDetailRowDefDirective, TnDialog, TnDialogHarness, TnDialogShellComponent, TnDialogTesting, TnDividerComponent, TnDividerDirective, TnDrawerComponent, TnDrawerContainerComponent, TnDrawerContainerHarness, TnDrawerContentComponent, TnDrawerHarness, TnEmptyComponent, TnEmptyHarness, TnExpansionPanelComponent, TnExpansionPanelHarness, TnFileInputComponent, TnFileInputHarness, TnFilePickerComponent, TnFilePickerPopupComponent, TnFormFieldComponent, TnFormFieldHarness, TnFormSectionComponent, TnFormSectionHarness, TnHeaderCellDefDirective, TnIconButtonComponent, TnIconButtonHarness, TnIconComponent, TnIconHarness, TnIconRegistryService, TnIconTesting, TnInputComponent, TnInputDirective, TnInputHarness, TnKeyboardShortcutComponent, TnKeyboardShortcutService, TnListAvatarDirective, TnListComponent, TnListIconDirective, TnListItemComponent, TnListItemLineDirective, TnListItemPrimaryDirective, TnListItemSecondaryDirective, TnListItemTitleDirective, TnListItemTrailingDirective, TnListOptionComponent, TnListSubheaderComponent, TnMenuActivateHoverDirective, TnMenuComponent, TnMenuHarness, TnMenuItemComponent, TnMenuTesting, TnMenuTriggerDirective, TnMonthViewComponent, TnMultiYearViewComponent, TnNestedTreeDataSource, TnNestedTreeNodeComponent, TnParticleProgressBarComponent, TnProgressBarComponent, TnRadioComponent, TnRadioHarness, TnSelectComponent, TnSelectHarness, TnSelectionListComponent, TnSidePanelActionDirective, TnSidePanelComponent, TnSidePanelHarness, TnSidePanelHeaderActionDirective, TnSlideToggleComponent, TnSlideToggleHarness, TnSliderComponent, TnSliderThumbDirective, TnSliderWithLabelDirective, TnSpinnerComponent, TnSpriteLoaderService, TnStepComponent, TnStepperComponent, TnStepperHarness, TnStepperNextDirective, TnStepperPreviousDirective, TnTabComponent, TnTabHarness, TnTabPanelComponent, TnTabPanelHarness, TnTableColumnDirective, TnTableComponent, TnTableHarness, TnTablePagerComponent, TnTablePagerHarness, TnTabsComponent, TnTabsHarness, TnTestIdDirective, TnTheme, TnThemeService, TnTimeInputComponent, TnToastComponent, TnToastMock, TnToastPosition, TnToastRef, TnToastService, TnToastTesting, TnToastType, TnTooltipComponent, TnTooltipDirective, TnTreeComponent, TnTreeFlatDataSource, TnTreeFlattener, TnTreeHarness, TnTreeNodeComponent, TnTreeNodeHarness, TnTreeNodeOutletDirective, TnTreeVirtualScrollNodeOutletDirective, TnTreeVirtualScrollViewComponent, TnTreeVirtualScrollViewHarness, TruncatePathPipe, WindowsModifierKeys, WindowsShortcuts, composeTestId, controlTestId, createFlatTreeControl, createLucideLibrary, createNestedTreeControl, createShortcut, defaultSpriteBasePath, defaultSpriteConfigPath, defaultTreeItemSize, formatSize, injectTnFormFieldAria, kebabTestSegment, labelMarkupToHtml, labelMarkupToText, libIconMarker, optionTestId, parseLabelMarkup, parseSize, registerLucideIcons, scopeTestId, setupLucideIntegration, tnIconMarker, writeTestId };
|
|
9758
|
+
export type { AutocompleteHarnessFilters, BannerHarnessFilters, ButtonHarnessFilters, ButtonToggleHarnessFilters, CalendarCell, CheckboxHarnessFilters, ChipColor, ChipHarnessFilters, CreateFolderEvent, DateInputHarnessFilters, DateRange, DateRangeInputHarnessFilters, DialogHarnessFilters, EmptyHarnessFilters, ExpansionPanelHarnessFilters, FileInputHarnessFilters, FilePickerCallbacks, FilePickerError, FilePickerMode, FileSystemItem, FlatTreeControlOptions, FormFieldHarnessFilters, FormSectionHarnessFilters, IconButtonHarnessFilters, IconHarnessFilters, IconLibrary, IconLibraryType, IconResult, IconSize, IconSource, IconTestingMockOverrides, InputHarnessFilters, KeyCombination, LabelMarkupSegment, LabelMarkupSegmentType, LabelType, LucideIconOptions, MenuHarnessFilters, MockIconRegistry, MockSpriteLoader, NestedTreeControlOptions, PathSegment, PlatformType, ProgressBarMode, RadioHarnessFilters, ResolvedIcon, SelectHarnessFilters, ShortcutHandler, SidePanelHarnessFilters, SizeStandard, SlideToggleColor, SlideToggleHarnessFilters, SpinnerMode, SpriteConfig, StepperHarnessFilters, SubscriptSizing, TabChangeEvent, TabHarnessFilters, TabPanelHarnessFilters, TabsHarnessFilters, TnAutocompleteOption, TnBannerType, TnButtonToggleType, TnCardAction, TnCardControl, TnCardFooterLink, TnCardHeaderStatus, TnChipInputHarnessFilters, TnChipInputOption, TnConfirmDialogData, TnDialogDefaults, TnDialogOpenTarget, TnDrawerMode, TnDrawerPosition, TnEmptySize, TnFlatTreeNode, TnFormFieldAriaBindings, TnFormFieldContext, TnFormFieldErrorMessage, TnFormFieldErrorMessages, TnFormFieldErrorResolver, TnMenuItem, TnOptionTestIdSource, TnSelectOption, TnSelectOptionGroup, TnSelectionChange, TnSortEvent, TnTableDataProvider, TnTableDataSource, TnTableHarnessFilters, TnTablePagerHarnessFilters, TnTablePagerLabels, TnTablePagination, TnTestAttrName, TnTestIdValue, TnThemeDefinition, TnToastCall, TnToastConfig, TnTreeExpansion, TnTreeHarnessFilters, TnTreeNodeHarnessFilters, TnTreeVirtualNodeData, TnTreeVirtualScrollViewHarnessFilters, TooltipPosition, YearCell };
|