@arsedizioni/ars-utils 21.2.269 → 21.2.271
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/fesm2022/arsedizioni-ars-utils-help.mjs +30 -24
- package/fesm2022/arsedizioni-ars-utils-help.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-ui.application.mjs +71 -48
- package/fesm2022/arsedizioni-ars-utils-ui.application.mjs.map +1 -1
- package/package.json +1 -1
- package/types/arsedizioni-ars-utils-help.d.ts +12 -12
- package/types/arsedizioni-ars-utils-ui.application.d.ts +30 -19
package/package.json
CHANGED
|
@@ -2,9 +2,8 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { OnInit, OnDestroy, AfterViewInit } from '@angular/core';
|
|
3
3
|
import { Folder, ApiResult } from '@arsedizioni/ars-utils/core';
|
|
4
4
|
import { BreakpointObserver } from '@angular/cdk/layout';
|
|
5
|
-
import { FlatTreeControl } from '@angular/cdk/tree';
|
|
6
5
|
import { MatSidenav } from '@angular/material/sidenav';
|
|
7
|
-
import {
|
|
6
|
+
import { MatTree } from '@angular/material/tree';
|
|
8
7
|
import * as rxjs from 'rxjs';
|
|
9
8
|
import { BehaviorSubject } from 'rxjs';
|
|
10
9
|
|
|
@@ -78,19 +77,14 @@ declare class HelpViewerComponent implements OnInit, OnDestroy, AfterViewInit {
|
|
|
78
77
|
protected indexNode: IndexInfo | undefined;
|
|
79
78
|
private readonly history;
|
|
80
79
|
protected readonly canGoBack: i0.Signal<boolean>;
|
|
81
|
-
/**
|
|
82
|
-
* Manage flat tree view
|
|
83
|
-
*/
|
|
84
80
|
private tree;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
protected
|
|
81
|
+
readonly matTree: i0.Signal<MatTree<IndexNode, IndexNode>>;
|
|
82
|
+
/** Provides the level of a flat node to the tree component. */
|
|
83
|
+
protected readonly levelAccessor: (node: IndexNode) => number;
|
|
84
|
+
/** Flat list of all tree nodes used as the tree data source. */
|
|
85
|
+
protected readonly flatNodes: i0.WritableSignal<IndexNode[]>;
|
|
88
86
|
private folders?;
|
|
89
|
-
private getChildren;
|
|
90
|
-
private getLevel;
|
|
91
|
-
private isExpandable;
|
|
92
87
|
protected hasChild: (_: number, _node: IndexNode) => boolean;
|
|
93
|
-
protected transformer: (item: IndexInfo, level: number) => IndexNode;
|
|
94
88
|
ngOnInit(): void;
|
|
95
89
|
ngOnDestroy(): void;
|
|
96
90
|
ngAfterViewInit(): void;
|
|
@@ -128,6 +122,12 @@ declare class HelpViewerComponent implements OnInit, OnDestroy, AfterViewInit {
|
|
|
128
122
|
* and all its ancestor nodes.
|
|
129
123
|
*/
|
|
130
124
|
private expandCurrentFolder;
|
|
125
|
+
/**
|
|
126
|
+
* Recursively flattens a nested IndexInfo tree into a depth-first ordered array of IndexNodes.
|
|
127
|
+
* @param items - Root-level nodes to flatten.
|
|
128
|
+
* @param level - Current depth level.
|
|
129
|
+
*/
|
|
130
|
+
private flattenNodes;
|
|
131
131
|
/**
|
|
132
132
|
* Retrieves and displays a help chapter by id.
|
|
133
133
|
* Optionally scrolls to an anchor or pixel offset after loading.
|
|
@@ -4,8 +4,7 @@ import { Searchable, SearchBag, NameValueItem, DateInterval, SearchFilterMetadat
|
|
|
4
4
|
import { MatFormFieldAppearance, MatFormFieldControl } from '@angular/material/form-field';
|
|
5
5
|
import { MatDialogRef } from '@angular/material/dialog';
|
|
6
6
|
import { DialogService } from '@arsedizioni/ars-utils/ui';
|
|
7
|
-
import {
|
|
8
|
-
import { MatTreeFlatDataSource } from '@angular/material/tree';
|
|
7
|
+
import { MatTree } from '@angular/material/tree';
|
|
9
8
|
import { BehaviorSubject, Subject } from 'rxjs';
|
|
10
9
|
import { NgForm, ControlValueAccessor, NgControl } from '@angular/forms';
|
|
11
10
|
import { MatCheckboxChange } from '@angular/material/checkbox';
|
|
@@ -383,23 +382,22 @@ declare class SelectTreeDialogComponent implements OnInit {
|
|
|
383
382
|
/** Dialog configuration, injected and exposed as a signal. */
|
|
384
383
|
protected readonly dialogData: _angular_core.WritableSignal<SelectTreeDialogData>;
|
|
385
384
|
private readonly tree;
|
|
386
|
-
|
|
387
|
-
protected
|
|
388
|
-
|
|
385
|
+
/** Reference to the Material tree component. */
|
|
386
|
+
protected readonly matTree: _angular_core.Signal<MatTree<ItemNode, ItemNode>>;
|
|
387
|
+
/** Provides children of a tree node to the tree component. */
|
|
388
|
+
protected readonly childrenAccessor: (node: ItemNode) => ItemNode[];
|
|
389
|
+
/** Root nodes used as the tree data source. */
|
|
390
|
+
protected readonly treeNodes: _angular_core.WritableSignal<ItemNode[]>;
|
|
389
391
|
/** Currently selected tree node. */
|
|
390
|
-
protected readonly currentNode: _angular_core.WritableSignal<
|
|
392
|
+
protected readonly currentNode: _angular_core.WritableSignal<ItemNode>;
|
|
393
|
+
/** Current filter text, bound via ngModel. */
|
|
391
394
|
protected filterText: string;
|
|
392
|
-
|
|
393
|
-
protected
|
|
395
|
+
/** Nodes matching the current filter text. */
|
|
396
|
+
protected readonly filteredItems: _angular_core.WritableSignal<ItemNode[]>;
|
|
397
|
+
/** Index of the currently highlighted filtered node. */
|
|
398
|
+
protected readonly filterIndex: _angular_core.WritableSignal<number>;
|
|
394
399
|
protected readonly canAppend: _angular_core.WritableSignal<boolean>;
|
|
395
|
-
|
|
396
|
-
* Manage flat tree view
|
|
397
|
-
*/
|
|
398
|
-
private getChildren;
|
|
399
|
-
private getLevel;
|
|
400
|
-
private isExpandable;
|
|
401
|
-
protected hasChild: (_: number, _node: SelectableNode) => boolean;
|
|
402
|
-
protected transformer: (item: ItemNode, level: number) => SelectableNode;
|
|
400
|
+
protected hasChild: (_: number, node: ItemNode) => boolean;
|
|
403
401
|
ngOnInit(): void;
|
|
404
402
|
/**
|
|
405
403
|
* Confirm the current selection and close the dialog.
|
|
@@ -410,7 +408,7 @@ declare class SelectTreeDialogComponent implements OnInit {
|
|
|
410
408
|
* @param e - The mouse event (propagation is stopped).
|
|
411
409
|
* @param node - The node that was clicked.
|
|
412
410
|
*/
|
|
413
|
-
protected select(e: MouseEvent, node:
|
|
411
|
+
protected select(e: MouseEvent, node: ItemNode): void;
|
|
414
412
|
/**
|
|
415
413
|
* Clear the active filter text.
|
|
416
414
|
*/
|
|
@@ -426,9 +424,22 @@ declare class SelectTreeDialogComponent implements OnInit {
|
|
|
426
424
|
protected nextFiltered(): void;
|
|
427
425
|
/**
|
|
428
426
|
* Expand a node and all of its parent nodes.
|
|
429
|
-
* @param node - The
|
|
427
|
+
* @param node - The node to expand.
|
|
428
|
+
* @returns Always false.
|
|
429
|
+
*/
|
|
430
|
+
expand(node: ItemNode): boolean;
|
|
431
|
+
/**
|
|
432
|
+
* Recursively get all nodes in depth-first order.
|
|
433
|
+
* @param nodes - Root nodes to traverse.
|
|
434
|
+
* @param result - Accumulator array.
|
|
435
|
+
*/
|
|
436
|
+
private getAllNodes;
|
|
437
|
+
/**
|
|
438
|
+
* Recursively find a node by id.
|
|
439
|
+
* @param nodes - Nodes to search.
|
|
440
|
+
* @param id - The id to find.
|
|
430
441
|
*/
|
|
431
|
-
|
|
442
|
+
private findInTree;
|
|
432
443
|
/**
|
|
433
444
|
* Append a new node to the tree.
|
|
434
445
|
* @param node - The node to insert.
|