@scion/components 22.6.0 → 22.7.0

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.
@@ -0,0 +1,559 @@
1
+ import { MaybeSignal, SciComponentDescriptor, SciTemplateDescriptor } from '@scion/components/common';
2
+ import * as _angular_core from '@angular/core';
3
+ import { Signal, WritableSignal, Injector } from '@angular/core';
4
+ import { SciTableDatasourceProvider, SciTreeTableNode, SciTableCellContext, SciTableRowActionFactoryFn, SciTableEvent, ɵSciTable as _SciTable } from '@scion/components/table';
5
+ import { MaybeAsync, MaybeArray } from '@scion/toolkit/types';
6
+ import { Translatable } from '@scion/components/text';
7
+
8
+ type SciTreeDatasourceProvider<T, ID = never> = SciTableDatasourceProvider<T, ID>;
9
+ type SciTreeNode<T> = SciTreeTableNode<T>;
10
+ /**
11
+ * Provides an in-memory datasource for {@link SciTree} with built-in filtering.
12
+ *
13
+ * A datasource provides data to {@link SciTree}, passing each item to {@link SciTreeDescriptor.label} for display.
14
+ *
15
+ * This datasource requires all data to be loaded upfront. It invokes the passed child selector function for each item
16
+ * to construct the tree. Data is filtered in memory.
17
+ *
18
+ * If using custom labels, a {@link SciTreeDescriptor.matcher} is required to support {@link SciTree.filter}.
19
+ *
20
+ * For large datasets requiring pagination or server-side filtering and sorting, prefer implementing a custom datasource using {@link ɵprovideTreeDatasource}.
21
+ *
22
+ * IMPORTANT: Custom datasource support is experimental and currently exposed only as `ɵprovideTableDatasource`. The API and behavior may change in any version without notice.
23
+ *
24
+ * @example - Usage
25
+ * ```ts
26
+ * import {tree, provideTreeDatasource} from '@scion/components/tree';
27
+ * import {httpResource} from '@angular/common/http';
28
+ *
29
+ * const files = httpResource<File[]>(() => '/api/files', {defaultValue: []});
30
+ *
31
+ * const fileTree = tree({
32
+ * label: file => file.name,
33
+ * datasource: provideTreeDatasource(files.value, file => file.children),
34
+ * });
35
+ * ```
36
+ *
37
+ * @param root - Provides the root items to display in the tree.
38
+ * @param children - Function returning an item's children, or an empty array if the item has no children or is a leaf.
39
+ * Called eagerly for each item when initializing the tree, inside a reactive context that re-evaluates when tracked signals change.
40
+ *
41
+ * @see SciTreeDescriptor.datasource
42
+ */
43
+ declare function provideTreeDatasource<T>(root: Signal<T[]>, children: (item: T) => T[]): SciTreeDatasourceProvider<T>;
44
+ /**
45
+ * Provides a datasource for {@link SciTree}.
46
+ *
47
+ * A datasource provides data to {@link SciTree}, passing each item to {@link SciTreeDescriptor.label} for display.
48
+ * Filtering and sorting must be implemented by the datasource based on the provided filter and sort criteria.
49
+ *
50
+ * A tree is a hierarchical structure of nodes, represented by the datasource as a flat list of tree nodes.
51
+ * Each node references an item and its parent by ID, without containing the item itself. The tree requests items on demand when scrolled into view,
52
+ * allowing large datasets to be displayed without loading all items upfront. If the entire dataset is available locally, use {@link provideTreeDatasource}.
53
+ *
54
+ * {@link SciTree} constructs the tree from the returned nodes, starting with root nodes (nodes without a parent) and appending child nodes in array order.
55
+ * Child nodes can appear anywhere in the nodes list; they do not need to follow their parent.
56
+ *
57
+ * @example - Usage
58
+ * ```ts
59
+ * import {tree, provideTreeDatasource} from '@scion/components/tree';
60
+ * import {SciTreeNode} from '@scion/components/table';
61
+ * import {httpResource} from '@angular/common/http';
62
+ * import {toObservable} from '@angular/core/rxjs-interop';
63
+ *
64
+ * const files = httpResource<File[]>(() => '/api/files', {defaultValue: []});
65
+ *
66
+ * const fileTree = tree<File, string>({
67
+ * label: file => file.name,
68
+ * datasource: provideTreeDatasource({
69
+ * getTreeNodes: query => toObservable(httpResource<SciTreeNode<string>[]>(() => `/api/files?filter=${query.filter}`, {defaultValue: []}).value),
70
+ * getItems: guids => toObservable(httpResource<File[]>(() => ({url: `/api/files`, params: {guids}}), {defaultValue: []}).value),
71
+ * }),
72
+ * trackBy: file => file.guid,
73
+ * });
74
+ * ```
75
+ *
76
+ * @param datasource - Specifies the datasource.
77
+ *
78
+ * @docs-private Not public API. For internal use only.
79
+ * @experimental since 22.7.0; API and behavior may change in any version without notice.
80
+ */
81
+ declare function ɵprovideTreeDatasource<T, ID>(datasource: SciTreeDatasource<T, ID>): SciTableDatasourceProvider<T, ID>;
82
+ interface SciTreeDatasourceQuery {
83
+ filter?: string;
84
+ }
85
+ /**
86
+ * Represents a datasource for {@link SciTree}.
87
+ *
88
+ * A datasource provides data to {@link SciTree}, passing each item to {@link SciTreeDescriptor.label} for display.
89
+ * Filtering and sorting must be implemented by the datasource based on the provided filter and sort criteria.
90
+ *
91
+ * A tree is a hierarchical structure of nodes, represented by the datasource as a flat list of tree nodes.
92
+ * Each node references an item and its parent by ID, without containing the item itself. The tree requests items on demand when scrolled into view,
93
+ * allowing large datasets to be displayed without loading all items upfront. If the entire dataset is available locally, use {@link provideTreeDatasource}.
94
+ *
95
+ * {@link SciTree} constructs the tree from the returned nodes, starting with root nodes (nodes without a parent) and appending child nodes in array order.
96
+ * Child nodes can appear anywhere in the nodes list; they do not need to follow their parent.
97
+ */
98
+ interface SciTreeDatasource<T, ID> {
99
+ /**
100
+ * Returns a flat list of tree nodes matching the given filter and sort criteria.
101
+ *
102
+ * A tree node references an item and its parent by ID, without containing the item itself.
103
+ *
104
+ * Child nodes can appear anywhere in the list; they do not need to follow their parent. Siblings are added in the order they appear in the list.
105
+ *
106
+ * If a filter is set, return only the directly matching nodes (leaf or intermediate). Do not include their ancestors.
107
+ */
108
+ getTreeNodes(query: SciTreeDatasourceQuery): MaybeAsync<SciTreeNode<ID>[]>;
109
+ /**
110
+ * Resolves items for the specified IDs. Called as nodes scroll into view.
111
+ */
112
+ getItems(ids: ID[]): MaybeAsync<T[]>;
113
+ }
114
+
115
+ /**
116
+ * Represents a descriptor to configure {@link SciTreeComponent}.
117
+ *
118
+ * Defines the datasource, the display of node labels, and other display options. Requires a datasource and node label function.
119
+ */
120
+ interface SciTreeDescriptor<T, ID = T> {
121
+ /**
122
+ * Specifies the datasource to provide data to {@link SciTree}.
123
+ *
124
+ * Create a datasource using the {@link provideTreeDatasource} function and pass a signal containing the root items
125
+ * and a function that returns the children of a given item.
126
+ *
127
+ * @example - Usage
128
+ * ```ts
129
+ * import {tree, provideTreeDatasource} from '@scion/components/tree';
130
+ * import {httpResource} from '@angular/common/http';
131
+ *
132
+ * const files = httpResource<File[]>(() => '/api/files', {defaultValue: []});
133
+ *
134
+ * const fileTree = tree({
135
+ * label: file => file.name,
136
+ * datasource: provideTreeDatasource(files.value, file => file.children),
137
+ * });
138
+ * ```
139
+ *
140
+ * @see provideTreeDatasource
141
+ */
142
+ datasource: SciTreeDatasourceProvider<T, ID>;
143
+ /**
144
+ * Specifies the text or custom content to display for a tree node.
145
+ *
146
+ * Can be text or a translation key, or a {@link SciTreeNodeComponentDescriptor} or {@link SciTreeNodeTemplateDescriptor}.
147
+ *
148
+ * A translation key starts with the percent symbol (`%`) and may include parameters in matrix notation for text interpolation.
149
+ * SCION uses text providers to resolve translation keys. A text provider can be registered using {@link provideTextProvider}.
150
+ *
151
+ * The function:
152
+ * - Can call `inject` to get required dependencies.
153
+ * - Can call `toSignal` to convert an {@link Observable} to a {@link Signal}.
154
+ */
155
+ label: ((item: T) => MaybeSignal<Translatable | undefined>) | SciTreeNodeComponentDescriptor<T> | SciTreeNodeTemplateDescriptor<T>;
156
+ /**
157
+ * Specifies a custom matcher for {@link SciTree.filter}.
158
+ *
159
+ * If using the built-in in-memory datasource, defaults to matching node labels. Component and template labels require a custom matcher.
160
+ * For all other datasources, filtering is delegated to the datasource and this matcher is not used.
161
+ */
162
+ matcher?: (text: string, context: SciTreeNodeContext<T>) => boolean;
163
+ /**
164
+ * Controls whether the user can select a single node (`single`), multiple nodes (`multi`), or no nodes (`false`). Defaults to `multi`.
165
+ *
166
+ * Does not affect selection via {@link SciTree.select}.
167
+ */
168
+ selectable?: 'single' | 'multi' | false;
169
+ /**
170
+ * Configures actions to show when hovering over a node.
171
+ *
172
+ * @example
173
+ * ```ts
174
+ * import {tree} from '@scion/components/tree';
175
+ *
176
+ * tree({
177
+ * datasource: provideTreeDatasource(data, item => item.children),
178
+ * label: item => item.name,
179
+ * rowActions: (toolbar, item) => toolbar.addToolbarButton({
180
+ * icon: 'delete',
181
+ * onSelect: () => ...,
182
+ * }),
183
+ * });
184
+ * ```
185
+ *
186
+ * The function:
187
+ * - Is called per item with a {@link SciToolbarFactory} to contribute actions.
188
+ * - Runs in a reactive context and re-evaluates when tracked signals change.
189
+ * - Can call `inject` to get required dependencies.
190
+ */
191
+ nodeActions?: SciTreeNodeActionFactoryFn<T>;
192
+ /**
193
+ * Configures node bindings for tree nodes.
194
+ *
195
+ * Node bindings enable associating metadata and icons with a node. Metadata includes CSS shadow parts, CSS classes, and HTML attributes.
196
+ *
197
+ * @example
198
+ * ```ts
199
+ * import {tree} from '@scion/components/tree';
200
+ *
201
+ * tree({
202
+ * datasource: provideTreeDatasource(data, item => item.children),
203
+ * label: item => item.name,
204
+ * nodeBindings: (bindings, item, index) => bindings
205
+ * .addIconBinding(item.type === 'file' ? 'format_align_left' : 'folder')
206
+ * .addPartBinding(item.active ? 'node:active' : undefined),
207
+ * .addAttributeBinding('data-id', item.id)
208
+ * .addClassBinding(item.inactive ? 'inactive' : undefined),
209
+ * });
210
+ * ```
211
+ *
212
+ * Part attribute bindings make a node stylable by associating its cells with one or more HTML part attributes that can be referenced in CSS using the `::part()` CSS pseudo-element selector.
213
+ *
214
+ * ```scss
215
+ * sci-tree::part(node\:active node\:not\:selected) {
216
+ * background-color: lightgray;
217
+ * }
218
+ * ```
219
+ *
220
+ * The function:
221
+ * - Is called per item with a {@link SciTreeNodeBindingFactory} to register bindings.
222
+ * - Runs in a reactive context and re-evaluates when tracked signals change.
223
+ * - Can call `inject` to get required dependencies.
224
+ *
225
+ * @param bindings - Factory providing methods to register node bindings.
226
+ * @param item - Item associated with the node.
227
+ * @param index - Index of the node, zero-based.
228
+ */
229
+ nodeBindings?: SciTreeNodeBindingFactoryFn<T>;
230
+ /**
231
+ * Specifies the number of items to render before and after the viewport. Defaults to 10.
232
+ */
233
+ bufferSize?: number;
234
+ /**
235
+ * Specifies the number of items to load per page. Defaults to 50.
236
+ */
237
+ pageSize?: number;
238
+ /**
239
+ * Computes a unique and stable identity for items in the tree.
240
+ *
241
+ * Defaults to the item object reference. Used to identify items when loading data from the datasource and when tracking tree selection.
242
+ */
243
+ trackBy?: (item: T) => ID;
244
+ /**
245
+ * Specifies an injector used to create the tree. Defaults to the current injection context.
246
+ * The tree is disposed when the passed injector is destroyed.
247
+ */
248
+ injector?: Injector;
249
+ }
250
+ /**
251
+ * Represents a table for {@link SciTreeComponent}.
252
+ *
253
+ * Can be constructed using the {@link tree} function.
254
+ * Use to bind to `<sci-tree>` and interact with the tree.
255
+ *
256
+ * @see tree
257
+ * @see SciTreeComponent
258
+ */
259
+ interface SciTree<ID = unknown> {
260
+ /**
261
+ * Provides the active item, if any.
262
+ *
263
+ * The active item may differ from the selected items and is used as the target for keyboard navigation.
264
+ */
265
+ readonly activeItem: Signal<ID | undefined>;
266
+ /**
267
+ * Provides the selected items.
268
+ */
269
+ readonly selectedItems: Signal<Array<ID>>;
270
+ /**
271
+ * Controls whether the user can select a single node, multiple nodes, or nothing.
272
+ *
273
+ * Initialized from {@link SciTreeDescriptor.selectable}. Defaults to `multi`.
274
+ */
275
+ readonly selectable: WritableSignal<'single' | 'multi' | false>;
276
+ /**
277
+ * Filters nodes by the specified text.
278
+ *
279
+ * Can be used to connect an external filter field to the tree.
280
+ *
281
+ * If using the built-in in-memory datasource, matches node labels, or uses the custom matcher, if one is configured in {@link SciTreeDescriptor.matcher}. Component and template labels require a custom matcher.
282
+ * For all other datasources, filtering is delegated to the datasource.
283
+ *
284
+ * @param text - Text to filter by, or `null` to clear the filter.
285
+ */
286
+ filter(text: string | null): void;
287
+ /**
288
+ * Selects the specified nodes, replacing the current selection.
289
+ *
290
+ * Expands parent nodes of the selected nodes.
291
+ *
292
+ * @param id - ID or IDs of the nodes to select, or an empty array to clear the selection.
293
+ */
294
+ select(id: MaybeArray<ID>): void;
295
+ /**
296
+ * Expands all nodes in the tree.
297
+ */
298
+ expandAll(): void;
299
+ /**
300
+ * Collapses all nodes in the tree.
301
+ */
302
+ collapseAll(): void;
303
+ }
304
+ type SciTreeNodeContext<T> = SciTableCellContext<T, string | void>;
305
+ type SciTreeEvent<ID> = SciTableEvent<ID>;
306
+ type SciTreeNodeActionFactoryFn<T> = SciTableRowActionFactoryFn<T>;
307
+ type SciTreeNodeBindingFactoryFn<T> = (node: SciTreeNodeBindingFactory, item: T, index: number) => void;
308
+ interface SciTreeNodeBindingFactory {
309
+ /**
310
+ * Binds an icon to the node, displayed in the first column.
311
+ *
312
+ * ```ts
313
+ * import {tree} from '@scion/components/tree';
314
+ *
315
+ * tree({
316
+ * datasource: data,
317
+ * nodeBindings: node => node.addIconBinding('mail'),
318
+ * });
319
+ * ```
320
+ *
321
+ * SCION uses icon providers to render icons. An icon provider can be registered using {@link provideIconProvider}.
322
+ *
323
+ * Defaults to a Material icon provider if the application has not registered an icon provider, interpreting the icon as a Material Icon font ligature.
324
+ * Refer to https://fonts.google.com/icons for available Material icons and instructions on including the Material icon font.
325
+ */
326
+ addIconBinding(icon: string): this;
327
+ /**
328
+ * Adds the specified values as part attributes to the node, enabling for custom styling of the node, e.g., based on a condition.
329
+ *
330
+ * Example usage:
331
+ * ```ts
332
+ * tree({
333
+ * datasource: data,
334
+ * nodeBindings: (node, item, index) => node
335
+ * .addPartBinding(item.active ? 'node:active' : undefined),
336
+ * });
337
+ * ```
338
+ *
339
+ * ```scss
340
+ * sci-tree::part(node\:active node\:not\:selected) {
341
+ * background-color: green;
342
+ * }
343
+ * ```
344
+ */
345
+ addPartBinding(name: `node:${string}` | undefined): this;
346
+ /**
347
+ * Binds an HTML attribute to the node.
348
+ *
349
+ * Useful for end-to-end testing, such as associating a node with an item's primary key.
350
+ *
351
+ * ```ts
352
+ * import {tree} from '@scion/components/tree';
353
+ *
354
+ * tree({
355
+ * datasource: data,
356
+ * nodeBindings: (node, item) => node.addAttributeBinding('data-id', item.id),
357
+ * });
358
+ * ```
359
+ */
360
+ addAttributeBinding(name: string, value: unknown | undefined): this;
361
+ /**
362
+ * Binds a CSS class to the node.
363
+ */
364
+ addClassBinding(name: string | undefined): this;
365
+ }
366
+ interface SciTreeNodeComponentDescriptor<T> {
367
+ component: (item: T) => SciComponentDescriptor;
368
+ padding?: boolean;
369
+ }
370
+ interface SciTreeNodeTemplateDescriptor<T> {
371
+ template: (item: T) => SciTemplateDescriptor;
372
+ padding?: boolean;
373
+ }
374
+
375
+ /**
376
+ * Creates a tree for displaying a tree structure in {@link SciTreeComponent}.
377
+ *
378
+ * Pass a descriptor to configure the datasource and the display of node labels.
379
+ *
380
+ * Use the {@link provideTreeDatasource} function to create a datasource, passing a signal containing the root items and a
381
+ * function that returns the children of a given item.
382
+ *
383
+ * ```ts
384
+ * import {SciTreeComponent, tree, provideTreeDatasource} from '@scion/components/tree';
385
+ * import {httpResource} from '@angular/common/http';
386
+ *
387
+ * // Load data to display in the tree.
388
+ * const files = httpResource<File[]>(() => '/api/files', {defaultValue: []});
389
+ *
390
+ * // Create the tree and pass data.
391
+ * const fileTree = tree({
392
+ * label: file => file.name,
393
+ * datasource: provideTreeDatasource(files.value, file => file.children),
394
+ * });
395
+ * ```
396
+ *
397
+ * In the HTML, bind the created tree instance to `<sci-tree>`.
398
+ *
399
+ * ```html
400
+ * <sci-tree name="tree:files" [tree]="fileTree"/>
401
+ * ```
402
+ *
403
+ * Callback functions:
404
+ * - Run in a reactive context and re-evaluate when tracked signals change.
405
+ * - Can call `inject` to get required dependencies. The injection context is destroyed each time the function is called anew.
406
+ *
407
+ * This function:
408
+ * - Must be called within an injection context, or an explicit {@link Injector} passed.
409
+ * - Must be called in a non-reactive (non-tracking) context.
410
+ *
411
+ * @see SciTreeComponent
412
+ * @experimental since 22.7.0; API and behavior may change in any version without notice.
413
+ *
414
+ * @param descriptor - Configures the tree. Requires a datasource and node label function.
415
+ * @return Handle to bind to `<sci-tree>` and interact with the tree.
416
+ */
417
+ declare function tree<T>(descriptor: SciTreeDescriptor<T>): SciTree<T>;
418
+ /**
419
+ * Creates a tree for displaying a tree structure in {@link SciTreeComponent}.
420
+ *
421
+ * Pass a descriptor to configure the datasource and the display of node labels.
422
+ *
423
+ * Use the {@link provideTreeDatasource} function to create a datasource, passing a signal containing the root items and a
424
+ * function that returns the children of a given item.
425
+ *
426
+ * ```ts
427
+ * import {SciTreeComponent, tree, provideTreeDatasource} from '@scion/components/tree';
428
+ * import {httpResource} from '@angular/common/http';
429
+ *
430
+ * // Load data to display in the tree.
431
+ * const files = httpResource<File[]>(() => '/api/files', {defaultValue: []});
432
+ *
433
+ * // Create the tree and pass data.
434
+ * const fileTree = tree({
435
+ * label: file => file.name,
436
+ * datasource: provideTreeDatasource(files.value, file => file.children),
437
+ * });
438
+ * ```
439
+ *
440
+ * In the HTML, bind the created tree instance to `<sci-tree>`.
441
+ *
442
+ * ```html
443
+ * <sci-tree name="tree:files" [tree]="fileTree"/>
444
+ * ```
445
+ *
446
+ * Callback functions:
447
+ * - Run in a reactive context and re-evaluate when tracked signals change.
448
+ * - Can call `inject` to get required dependencies. The injection context is destroyed each time the function is called anew.
449
+ *
450
+ * This function:
451
+ * - Must be called within an injection context, or an explicit {@link Injector} passed.
452
+ * - Must be called in a non-reactive (non-tracking) context.
453
+ *
454
+ * @see SciTreeComponent
455
+ * @experimental since 22.7.0; API and behavior may change in any version without notice.
456
+ *
457
+ * @param descriptor - Configures the tree. Requires a datasource and node label function.
458
+ * @return Handle to bind to `<sci-tree>` and interact with the tree.
459
+ */
460
+ declare function tree<T, ID = T>(descriptor: SciTreeDescriptor<T, ID> & {
461
+ trackBy: (item: T) => ID;
462
+ }): SciTree<ID>;
463
+
464
+ declare class ɵSciTree<T = unknown, ID = T> implements SciTree<ID> {
465
+ readonly activeItem: Signal<ID | undefined>;
466
+ readonly selectedItems: Signal<Array<ID>>;
467
+ readonly selectable: WritableSignal<'single' | 'multi' | false>;
468
+ private readonly _table;
469
+ constructor(descriptor: SciTreeDescriptor<T, ID>);
470
+ get table(): _SciTable<T, ID>;
471
+ filter(text: string | null): void;
472
+ select(ids: MaybeArray<ID>): void;
473
+ expandAll(): void;
474
+ collapseAll(): void;
475
+ dispose(): void;
476
+ }
477
+
478
+ /**
479
+ * Provides a tree to display a tree structure.
480
+ *
481
+ * ### Usage
482
+ *
483
+ * Create a tree using the `tree()` function, passing a descriptor to configure the datasource and the display of node labels.
484
+ *
485
+ * Use the {@link provideTreeDatasource} function to create a datasource, passing a signal containing the root items and a
486
+ * function that returns the children of a given item.
487
+ *
488
+ * ```ts
489
+ * import {SciTreeComponent, tree, provideTreeDatasource} from '@scion/components/tree';
490
+ * import {httpResource} from '@angular/common/http';
491
+ *
492
+ * // Load data to display in the tree.
493
+ * const files = httpResource<File[]>(() => '/api/files', {defaultValue: []});
494
+ *
495
+ * // Create the tree and pass data.
496
+ * const fileTree = tree({
497
+ * label: file => file.name,
498
+ * datasource: provideTreeDatasource(files.value, file => file.children),
499
+ * });
500
+ * ```
501
+ *
502
+ * In the HTML, bind the created tree instance to `<sci-tree>` and assign it a name.
503
+ * The name must start with the `tree:` prefix and is used to store user settings.
504
+ *
505
+ * ```html
506
+ * <sci-tree name="tree:files" [tree]="fileTree"/>
507
+ * ```
508
+ *
509
+ * ### Fixed Node Height
510
+ *
511
+ * All nodes in the tree must have equal height, which is `2em` by default. The height can be changed per tree using the CSS variable `--sci-tree-node-height`.
512
+ *
513
+ * ```scss
514
+ * sci-tree {
515
+ * --sci-tree-node-height: 30px;
516
+ * }
517
+ * ```
518
+ *
519
+ * ### Styling
520
+ *
521
+ * The appearance of the tree can be customized using the following CSS variables, either globally in the `:root` or at the tree level.
522
+ *
523
+ * - `--sci-tree-node-height`
524
+ * - `--sci-tree-node-indent`
525
+ * - `--sci-tree-node-background-color-hover`
526
+ * - `--sci-tree-node-background-color-selected`
527
+ * - `--sci-tree-node-border-radius`
528
+ * - `--sci-tree-node-outline-color`
529
+ * - `--sci-tree-node-outline-width`
530
+ * - `--sci-tree-node-outline-style`
531
+ * - `--sci-tree-node-action-background-color`
532
+ * - `--sci-tree-node-action-background-color-selected`
533
+ *
534
+ * @experimental since 22.7.0; API and behavior may change in any version without notice.
535
+ */
536
+ declare class SciTreeComponent<T = unknown, ID = T> {
537
+ /**
538
+ * Specifies a unique tree identifier, used as the key for storing user preferences.
539
+ */
540
+ readonly name: _angular_core.InputSignal<`tree:${string}`>;
541
+ /**
542
+ * Specifies the tree definition and datasource.
543
+ */
544
+ readonly tree: _angular_core.InputSignalWithTransform<ɵSciTree<T, ID>, SciTree<ID>>;
545
+ /**
546
+ * Emits when the user double-clicks a node or presses `Enter` on selected nodes.
547
+ */
548
+ readonly primaryAction: _angular_core.OutputEmitterRef<SciTreeEvent<ID>>;
549
+ constructor();
550
+ /**
551
+ * Creates and attaches a {@link SciTableComponent} using this component as host.
552
+ */
553
+ private attachVirtualTable;
554
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<SciTreeComponent<any, any>, never>;
555
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<SciTreeComponent<any, any>, "sci-tree", never, { "name": { "alias": "name"; "required": true; "isSignal": true; }; "tree": { "alias": "tree"; "required": true; "isSignal": true; }; }, { "primaryAction": "primaryAction"; }, never, never, true, never>;
556
+ }
557
+
558
+ export { SciTreeComponent, provideTreeDatasource, tree, ɵprovideTreeDatasource };
559
+ export type { SciTree, SciTreeDatasource, SciTreeDatasourceProvider, SciTreeDatasourceQuery, SciTreeDescriptor, SciTreeNode, SciTreeNodeContext };