@nanahoshi/mona-ui 0.27.2 → 0.28.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.
- package/docs/api/chart.md +2 -2
- package/docs/api/popup.md +1 -1
- package/docs/api/theme.md +2 -2
- package/docs/chart.md +14 -0
- package/docs/editor.md +2 -0
- package/docs/installation.md +147 -15
- package/docs/introduction.md +37 -15
- package/docs/theming-built-in-themes.md +67 -0
- package/docs/theming-custom-colors.md +274 -0
- package/docs/theming-custom-themes.md +168 -0
- package/docs/theming.md +164 -248
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +1089 -603
- package/fesm2022/nanahoshi-mona-ui-avatar.mjs +369 -184
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +658 -371
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +513 -359
- package/fesm2022/nanahoshi-mona-ui-button.mjs +622 -517
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +2070 -1573
- package/fesm2022/nanahoshi-mona-ui-card.mjs +620 -316
- package/fesm2022/nanahoshi-mona-ui-chart.mjs +61151 -64921
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +646 -317
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +737 -516
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +441 -242
- package/fesm2022/nanahoshi-mona-ui-collapsible.mjs +443 -390
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +1138 -814
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +1114 -959
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +858 -504
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +1181 -742
- package/fesm2022/nanahoshi-mona-ui-command.mjs +1454 -853
- package/fesm2022/nanahoshi-mona-ui-common.mjs +569 -743
- package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +978 -532
- package/fesm2022/nanahoshi-mona-ui-date-input.mjs +283 -266
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +973 -451
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +1203 -658
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +1415 -936
- package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +1165 -568
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +1142 -677
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +1018 -734
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +3589 -2122
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +577 -359
- package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +311 -151
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +1086 -718
- package/fesm2022/nanahoshi-mona-ui-grid-grid-colgroup.component-NhONCVIX.mjs +77 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-Djv8ZnT5.mjs +480 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-WbXAzGCa.mjs +470 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-DkWTD3pN.mjs +2115 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DAHqTwBJ.mjs +330 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid.styles-BmLU-3zP.mjs +3766 -0
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +5418 -2
- package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +1379 -1079
- package/fesm2022/nanahoshi-mona-ui-i18n.mjs +4451 -5077
- package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +344 -143
- package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +257 -127
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +2080 -1829
- package/fesm2022/nanahoshi-mona-ui-internal-popup-menu.mjs +103 -141
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +2498 -2706
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +722 -1007
- package/fesm2022/nanahoshi-mona-ui-label.mjs +313 -202
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +1308 -1009
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +1411 -677
- package/fesm2022/nanahoshi-mona-ui-list.mjs +1 -6
- package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +556 -577
- package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +530 -573
- package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +530 -573
- package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +533 -576
- package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +530 -571
- package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +530 -571
- package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +576 -591
- package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +530 -565
- package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +520 -555
- package/fesm2022/nanahoshi-mona-ui-locales.mjs +59 -77
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +1411 -829
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +1326 -702
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +763 -675
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +1306 -826
- package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +1122 -897
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +1110 -651
- package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +95 -53
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +559 -397
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +2323 -1694
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +1657 -1455
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +441 -267
- package/fesm2022/nanahoshi-mona-ui-query.mjs +211 -340
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +1017 -548
- package/fesm2022/nanahoshi-mona-ui-rating.mjs +874 -624
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +1130 -917
- package/fesm2022/nanahoshi-mona-ui-segmented.mjs +705 -455
- package/fesm2022/nanahoshi-mona-ui-sheet.mjs +461 -283
- package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +2791 -2449
- package/fesm2022/nanahoshi-mona-ui-skeleton.mjs +145 -90
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +1563 -1103
- package/fesm2022/nanahoshi-mona-ui-spinner.mjs +738 -673
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +1287 -647
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +1313 -909
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +761 -540
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +611 -280
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +1393 -841
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +142 -73
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +876 -374
- package/fesm2022/nanahoshi-mona-ui-theme.mjs +1465 -1449
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +897 -443
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +1100 -703
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +789 -538
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +1361 -805
- package/fesm2022/nanahoshi-mona-ui-window.mjs +2145 -1531
- package/fesm2022/nanahoshi-mona-ui.mjs +1 -8
- package/llms.txt +6 -2
- package/package.json +62 -23
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +367 -233
- package/types/nanahoshi-mona-ui-avatar.d.ts +722 -649
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +134 -103
- package/types/nanahoshi-mona-ui-button-group.d.ts +213 -152
- package/types/nanahoshi-mona-ui-button.d.ts +227 -166
- package/types/nanahoshi-mona-ui-calendar.d.ts +324 -259
- package/types/nanahoshi-mona-ui-card.d.ts +125 -111
- package/types/nanahoshi-mona-ui-chart.d.ts +10483 -7326
- package/types/nanahoshi-mona-ui-check-box.d.ts +293 -180
- package/types/nanahoshi-mona-ui-chip.d.ts +208 -141
- package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +194 -133
- package/types/nanahoshi-mona-ui-collapsible.d.ts +103 -87
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +281 -213
- package/types/nanahoshi-mona-ui-color-palette.d.ts +201 -138
- package/types/nanahoshi-mona-ui-color-picker.d.ts +283 -194
- package/types/nanahoshi-mona-ui-combo-box.d.ts +401 -262
- package/types/nanahoshi-mona-ui-command.d.ts +279 -191
- package/types/nanahoshi-mona-ui-common.d.ts +354 -385
- package/types/nanahoshi-mona-ui-contextmenu.d.ts +142 -117
- package/types/nanahoshi-mona-ui-date-input.d.ts +79 -96
- package/types/nanahoshi-mona-ui-date-picker.d.ts +338 -208
- package/types/nanahoshi-mona-ui-datetime-picker.d.ts +413 -259
- package/types/nanahoshi-mona-ui-dialog.d.ts +470 -381
- package/types/nanahoshi-mona-ui-dropdown-button.d.ts +216 -168
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +369 -243
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +231 -217
- package/types/nanahoshi-mona-ui-editor.d.ts +302 -235
- package/types/nanahoshi-mona-ui-expansion-panel.d.ts +140 -109
- package/types/nanahoshi-mona-ui-fieldset.d.ts +98 -68
- package/types/nanahoshi-mona-ui-filter.d.ts +150 -124
- package/types/nanahoshi-mona-ui-grid.d.ts +1956 -1678
- package/types/nanahoshi-mona-ui-i18n-icu.d.ts +25 -34
- package/types/nanahoshi-mona-ui-i18n.d.ts +987 -1052
- package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +118 -71
- package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +56 -27
- package/types/nanahoshi-mona-ui-internal-list.d.ts +474 -408
- package/types/nanahoshi-mona-ui-internal-popup-menu.d.ts +143 -150
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +493 -506
- package/types/nanahoshi-mona-ui-internal.d.ts +195 -213
- package/types/nanahoshi-mona-ui-label.d.ts +108 -78
- package/types/nanahoshi-mona-ui-list-box.d.ts +392 -322
- package/types/nanahoshi-mona-ui-list-view.d.ts +423 -282
- package/types/nanahoshi-mona-ui-list.d.ts +2 -1
- package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-de-de.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-es-es.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-id-id.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-it-it.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +540 -542
- package/types/nanahoshi-mona-ui-locales.d.ts +17 -19
- package/types/nanahoshi-mona-ui-menubar.d.ts +210 -181
- package/types/nanahoshi-mona-ui-multi-select.d.ts +416 -276
- package/types/nanahoshi-mona-ui-notification.d.ts +140 -151
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +407 -270
- package/types/nanahoshi-mona-ui-otp-input.d.ts +364 -241
- package/types/nanahoshi-mona-ui-pager.d.ts +379 -301
- package/types/nanahoshi-mona-ui-placeholder.d.ts +35 -28
- package/types/nanahoshi-mona-ui-popover.d.ts +176 -134
- package/types/nanahoshi-mona-ui-popup-menu.d.ts +488 -344
- package/types/nanahoshi-mona-ui-popup.d.ts +698 -560
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +197 -137
- package/types/nanahoshi-mona-ui-query.d.ts +82 -88
- package/types/nanahoshi-mona-ui-radio-button.d.ts +434 -269
- package/types/nanahoshi-mona-ui-rating.d.ts +348 -254
- package/types/nanahoshi-mona-ui-scroll-view.d.ts +244 -172
- package/types/nanahoshi-mona-ui-segmented.d.ts +250 -175
- package/types/nanahoshi-mona-ui-sheet.d.ts +115 -63
- package/types/nanahoshi-mona-ui-sidebar.d.ts +653 -493
- package/types/nanahoshi-mona-ui-skeleton.d.ts +55 -39
- package/types/nanahoshi-mona-ui-slider.d.ts +503 -354
- package/types/nanahoshi-mona-ui-spinner.d.ts +125 -112
- package/types/nanahoshi-mona-ui-split-button.d.ts +241 -196
- package/types/nanahoshi-mona-ui-splitter.d.ts +124 -78
- package/types/nanahoshi-mona-ui-stepper.d.ts +206 -181
- package/types/nanahoshi-mona-ui-switch.d.ts +197 -131
- package/types/nanahoshi-mona-ui-tabs.d.ts +349 -248
- package/types/nanahoshi-mona-ui-text-area.d.ts +52 -36
- package/types/nanahoshi-mona-ui-text-box.d.ts +349 -218
- package/types/nanahoshi-mona-ui-theme.d.ts +415 -408
- package/types/nanahoshi-mona-ui-time-picker.d.ts +357 -217
- package/types/nanahoshi-mona-ui-time-selector.d.ts +255 -170
- package/types/nanahoshi-mona-ui-tooltip.d.ts +222 -144
- package/types/nanahoshi-mona-ui-tree-view.d.ts +466 -308
- package/types/nanahoshi-mona-ui-window.d.ts +494 -399
- package/types/nanahoshi-mona-ui.d.ts +1 -2
- package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-row.component-DjNnVxHE.mjs +0 -181
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-ihQIKeP-.mjs +0 -208
- package/fesm2022/nanahoshi-mona-ui-grid-grid-row.component-BpnybNcs.mjs +0 -1082
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-CYlgfc7c.mjs +0 -186
- package/fesm2022/nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-LCzfCYd3.mjs +0 -7568
|
@@ -1,552 +1,542 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
*/
|
|
36
|
-
mode?: "multiple" | "single";
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { TemplateRef } from "@angular/core";
|
|
3
|
+
import { ImmutableSet, List, Predicate, Selector } from "@mirei/ts-collections";
|
|
4
|
+
import { FilterChangeEvent, FilterableOptions, PreventableEvent } from "@nanahoshi/mona-ui/common";
|
|
5
|
+
import { BehaviorSubject, Observable, ReplaySubject, Subject } from "rxjs";
|
|
6
|
+
import { MonaTreeViewMessages } from "@nanahoshi/mona-ui/i18n";
|
|
7
|
+
export interface CheckableOptions {
|
|
8
|
+
/**
|
|
9
|
+
* @description Determines whether checking a node should also check its children.
|
|
10
|
+
* Only applicable when `mode` is set to `multiple`.
|
|
11
|
+
*/
|
|
12
|
+
checkChildren?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* @description Determines whether checking a node should also check its disabled children.
|
|
15
|
+
* Only applicable when `mode` is set to `multiple`.
|
|
16
|
+
*/
|
|
17
|
+
checkDisabledChildren?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* @description Determines whether checking a node should also check its parents.
|
|
20
|
+
* Only applicable when `mode` is set to `multiple`.
|
|
21
|
+
*/
|
|
22
|
+
checkParents?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* @description Determines whether only the children of the node should be checkable.
|
|
25
|
+
*/
|
|
26
|
+
childrenOnly?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* @description Determines if the checkboxes are enabled.
|
|
29
|
+
*/
|
|
30
|
+
enabled?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* @description Specifies the check mode.
|
|
33
|
+
*/
|
|
34
|
+
mode?: "multiple" | "single";
|
|
37
35
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
*/
|
|
49
|
-
enabled: boolean;
|
|
36
|
+
export type DataStructure = "flat" | "hierarchical";
|
|
37
|
+
export interface DisableOptions {
|
|
38
|
+
/**
|
|
39
|
+
* @description Determines whether the children of the node should be disabled as well.
|
|
40
|
+
*/
|
|
41
|
+
disableChildren: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* @description Determines if the disabling is enabled.
|
|
44
|
+
*/
|
|
45
|
+
enabled: boolean;
|
|
50
46
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
enabled: boolean;
|
|
47
|
+
export interface DraggableOptions {
|
|
48
|
+
/**
|
|
49
|
+
* @description Determines if the dragging is enabled.
|
|
50
|
+
*/
|
|
51
|
+
enabled: boolean;
|
|
57
52
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
uid: string;
|
|
53
|
+
export interface NodeItem<T> {
|
|
54
|
+
data: T;
|
|
55
|
+
hasChildren: boolean;
|
|
56
|
+
uid: string;
|
|
63
57
|
}
|
|
64
|
-
|
|
65
58
|
/**
|
|
66
59
|
* A node of a tree, wrapping its data item. Read `data`, `uid` and `nodeItem`; the tree keeps the rest, and writing to it
|
|
67
60
|
* would put the node out of step with the tree.
|
|
68
61
|
*/
|
|
69
|
-
declare class TreeNode<T> {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
62
|
+
export declare class TreeNode<T> {
|
|
63
|
+
/** @hidden Whether the node is checked. The tree keeps it in step with the checked keys. */
|
|
64
|
+
readonly checked: import("@angular/core").WritableSignal<boolean>;
|
|
65
|
+
/** @hidden The node's child nodes, in display order. */
|
|
66
|
+
readonly children: import("@angular/core").WritableSignal<ImmutableSet<TreeNode<T>>>;
|
|
67
|
+
/** The data item this node was created from. */
|
|
68
|
+
readonly data: T;
|
|
69
|
+
/** @hidden Whether the last load of this node's children from an asynchronous children selector failed. */
|
|
70
|
+
readonly loadFailed: import("@angular/core").WritableSignal<boolean>;
|
|
71
|
+
/** @hidden Whether the node's children are being loaded from an asynchronous children selector. */
|
|
72
|
+
readonly loading: import("@angular/core").WritableSignal<boolean>;
|
|
73
|
+
/** A unique id generated for the node when it is created. */
|
|
74
|
+
readonly uid: string;
|
|
75
|
+
/**
|
|
76
|
+
* Whether children from an asynchronous children selector have been loaded. Loaded children are cached,
|
|
77
|
+
* so collapsing and re-expanding the node does not request them again.
|
|
78
|
+
* @hidden
|
|
79
|
+
*/
|
|
80
|
+
childrenLoaded: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* The node's position in the tree as dot-separated zero-based indices from the root, such as `"0.2.1"` for
|
|
83
|
+
* the second child of the third child of the first root node.
|
|
84
|
+
* @hidden
|
|
85
|
+
*/
|
|
86
|
+
index: string;
|
|
87
|
+
/** @hidden The node's parent node, or `null` for a root node. */
|
|
88
|
+
parent: TreeNode<T> | null;
|
|
89
|
+
constructor(data: T);
|
|
90
|
+
/** @hidden Copies the node and its children. */
|
|
91
|
+
clone(): TreeNode<T>;
|
|
92
|
+
/** @hidden Whether the node sits anywhere below `node`. */
|
|
93
|
+
isDescendantOf(node: TreeNode<T>): boolean;
|
|
94
|
+
/** A plain snapshot of the node (its data, uid and whether it has children), as the tree view's events carry it. */
|
|
95
|
+
get nodeItem(): NodeItem<T>;
|
|
103
96
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
targetNode: TreeNode<T> | null;
|
|
97
|
+
export type DropPosition = "before" | "after" | "inside" | "outside";
|
|
98
|
+
export interface DropPositionChangeEvent<T> {
|
|
99
|
+
position: DropPosition;
|
|
100
|
+
targetNode: TreeNode<T> | null;
|
|
109
101
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
enabled: boolean;
|
|
102
|
+
export interface ExpandableOptions {
|
|
103
|
+
/**
|
|
104
|
+
* @description Determines if the expanding is enabled.
|
|
105
|
+
*/
|
|
106
|
+
enabled: boolean;
|
|
116
107
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
get nodeItem(): NodeItem<T>;
|
|
108
|
+
export declare class NodeCheckEvent<T> extends PreventableEvent {
|
|
109
|
+
#private;
|
|
110
|
+
constructor(node: TreeNode<T>, event: MouseEvent | KeyboardEvent);
|
|
111
|
+
get nodeItem(): NodeItem<T>;
|
|
122
112
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
get nodeItem(): NodeItem<T>;
|
|
113
|
+
export declare class NodeClickEvent<T> extends PreventableEvent {
|
|
114
|
+
#private;
|
|
115
|
+
constructor(node: TreeNode<T>, event: MouseEvent);
|
|
116
|
+
get nodeItem(): NodeItem<T>;
|
|
128
117
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
get nodeItem(): NodeItem<T>;
|
|
118
|
+
export declare abstract class NodeEvent<T, E extends Event = MouseEvent | TouchEvent> extends PreventableEvent<E> {
|
|
119
|
+
#private;
|
|
120
|
+
protected constructor(type: string, node: TreeNode<T>, event: E);
|
|
121
|
+
get nodeItem(): NodeItem<T>;
|
|
134
122
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
constructor(node: TreeNode<T>, event: MouseEvent | TouchEvent);
|
|
123
|
+
export declare class NodeDragEndEvent<T> extends NodeEvent<T> {
|
|
124
|
+
constructor(node: TreeNode<T>, event: MouseEvent | TouchEvent);
|
|
138
125
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
get type(): string;
|
|
126
|
+
export declare class NodeDragEvent<T> {
|
|
127
|
+
#private;
|
|
128
|
+
constructor(node: TreeNode<T>, targetNode: TreeNode<T> | null, event: MouseEvent | TouchEvent);
|
|
129
|
+
get nodeItem(): NodeItem<T>;
|
|
130
|
+
get originalEvent(): MouseEvent | TouchEvent;
|
|
131
|
+
get targetNodeItem(): NodeItem<T> | null;
|
|
132
|
+
get type(): string;
|
|
147
133
|
}
|
|
148
|
-
declare class InternalNodeDragEvent<T> {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
134
|
+
export declare class InternalNodeDragEvent<T> {
|
|
135
|
+
#private;
|
|
136
|
+
constructor(dragEvent: NodeDragEvent<T>, dropAllowed: boolean);
|
|
137
|
+
get dragEvent(): NodeDragEvent<T>;
|
|
138
|
+
get dropAllowed(): boolean;
|
|
153
139
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
constructor(node: TreeNode<T>, event: MouseEvent | TouchEvent);
|
|
140
|
+
export declare class NodeDragStartEvent<T> extends NodeEvent<T> {
|
|
141
|
+
constructor(node: TreeNode<T>, event: MouseEvent | TouchEvent);
|
|
157
142
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
readonly sourceNodeUid: string;
|
|
143
|
+
export interface NodeMoveSnapshot {
|
|
144
|
+
readonly originalIndex: number;
|
|
145
|
+
readonly originalParentUid: string | null;
|
|
146
|
+
readonly sourceNodeUid: string;
|
|
163
147
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
undoMoveNode(snapshot: NodeMoveSnapshot): void;
|
|
148
|
+
export interface ITreeView<T> {
|
|
149
|
+
moveNode(source: NodeItem<T>, target: NodeItem<T>, position: DropPosition): NodeMoveSnapshot | null;
|
|
150
|
+
undoMoveNode(snapshot: NodeMoveSnapshot): void;
|
|
168
151
|
}
|
|
169
|
-
|
|
170
152
|
/**
|
|
171
153
|
* A request to move a node: a drop, or a keyboard move (Ctrl+Shift+Arrow), whose original event is then the
|
|
172
154
|
* `KeyboardEvent`.
|
|
173
155
|
*/
|
|
174
|
-
declare class NodeDropEvent<T> extends NodeEvent<T, NodeDropOriginalEvent> {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
156
|
+
export declare class NodeDropEvent<T> extends NodeEvent<T, NodeDropOriginalEvent> {
|
|
157
|
+
#private;
|
|
158
|
+
constructor(params: NodeDropEventArgs<T>);
|
|
159
|
+
get position(): DropPosition;
|
|
160
|
+
get sourceNode(): NodeItem<T>;
|
|
161
|
+
get targetNode(): NodeItem<T>;
|
|
162
|
+
get treeView(): ITreeView<T>;
|
|
181
163
|
}
|
|
182
|
-
declare class NodeDropEventSansTree<T> extends NodeEvent<T, NodeDropOriginalEvent> {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
164
|
+
export declare class NodeDropEventSansTree<T> extends NodeEvent<T, NodeDropOriginalEvent> {
|
|
165
|
+
#private;
|
|
166
|
+
constructor(params: NodeDropEventArgsSansTree<T>);
|
|
167
|
+
get event(): NodeDropOriginalEvent;
|
|
168
|
+
get position(): DropPosition;
|
|
169
|
+
get sourceNode(): TreeNode<T>;
|
|
170
|
+
get targetNode(): TreeNode<T>;
|
|
189
171
|
}
|
|
190
172
|
/** The event behind a `nodeDrop`: the pointer event of a drop, or the key press of a keyboard move. */
|
|
191
|
-
type NodeDropOriginalEvent = MouseEvent | TouchEvent | KeyboardEvent;
|
|
192
|
-
interface NodeDropEventArgs<T> {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
173
|
+
export type NodeDropOriginalEvent = MouseEvent | TouchEvent | KeyboardEvent;
|
|
174
|
+
export interface NodeDropEventArgs<T> {
|
|
175
|
+
event: NodeDropOriginalEvent;
|
|
176
|
+
position: DropPosition;
|
|
177
|
+
sourceNode: TreeNode<T>;
|
|
178
|
+
targetNode: TreeNode<T>;
|
|
179
|
+
treeView: ITreeView<T>;
|
|
198
180
|
}
|
|
199
|
-
type NodeDropEventArgsSansTree<T> = Omit<NodeDropEventArgs<T>, "treeView">;
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
get nodeItem(): NodeItem<T>;
|
|
181
|
+
export type NodeDropEventArgsSansTree<T> = Omit<NodeDropEventArgs<T>, "treeView">;
|
|
182
|
+
export declare class NodeSelectEvent<T> extends PreventableEvent {
|
|
183
|
+
#private;
|
|
184
|
+
constructor(node: TreeNode<T>, event: MouseEvent | KeyboardEvent);
|
|
185
|
+
get nodeItem(): NodeItem<T>;
|
|
205
186
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
childrenOnly: boolean;
|
|
187
|
+
export type SelectableOptions = {
|
|
188
|
+
/**
|
|
189
|
+
* @description Determines if the selection functionality is active.
|
|
190
|
+
*/
|
|
191
|
+
enabled: boolean;
|
|
192
|
+
/**
|
|
193
|
+
* @description Determines whether only the children of the node should be selectable.
|
|
194
|
+
*/
|
|
195
|
+
childrenOnly: boolean;
|
|
216
196
|
} & (SingleSelectionConfig | MultipleSelectionConfig);
|
|
217
|
-
interface SingleSelectionConfig {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
197
|
+
export interface SingleSelectionConfig {
|
|
198
|
+
/**
|
|
199
|
+
* @description Allows only one item to be selected at a time.
|
|
200
|
+
*/
|
|
201
|
+
mode: "single";
|
|
202
|
+
/**
|
|
203
|
+
* @description Determines if clicking an already selected item will deselect it.
|
|
204
|
+
*/
|
|
205
|
+
toggleable?: boolean;
|
|
226
206
|
}
|
|
227
|
-
interface MultipleSelectionConfig {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
207
|
+
export interface MultipleSelectionConfig {
|
|
208
|
+
/**
|
|
209
|
+
* @description Allows multiple items to be selected simultaneously.
|
|
210
|
+
*/
|
|
211
|
+
mode: "multiple";
|
|
232
212
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
node: TreeNode<T>;
|
|
213
|
+
export interface TreeNodeCheckEvent<T> {
|
|
214
|
+
checked: boolean;
|
|
215
|
+
node: TreeNode<T>;
|
|
237
216
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
node: TreeNode<T>;
|
|
217
|
+
export interface TreeNodeExpandEvent<T> {
|
|
218
|
+
expanded: boolean;
|
|
219
|
+
node: TreeNode<T>;
|
|
242
220
|
}
|
|
243
|
-
|
|
244
221
|
/** The ways Ctrl+Shift+Arrow moves a node: past a sibling, into the previous sibling, or out of its parent. */
|
|
245
222
|
type TreeKeyboardMoveDirection = "down" | "in" | "out" | "up";
|
|
246
223
|
/** Where a keyboard move takes a node. */
|
|
247
224
|
interface TreeKeyboardMove<T> {
|
|
248
|
-
|
|
249
|
-
|
|
225
|
+
readonly position: Exclude<DropPosition, "outside">;
|
|
226
|
+
readonly targetNode: TreeNode<T>;
|
|
250
227
|
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
selected: boolean;
|
|
228
|
+
export interface TreeNodeSelectEvent<T> {
|
|
229
|
+
node: TreeNode<T>;
|
|
230
|
+
selected: boolean;
|
|
255
231
|
}
|
|
256
|
-
|
|
257
|
-
type
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
readonly
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TreeService<any>, never>;
|
|
478
|
-
static ɵprov: _angular_core.ɵɵInjectableDeclaration<TreeService<any>>;
|
|
232
|
+
export type ChildrenSelector<T> = string | Selector<T, Iterable<T> | Observable<Iterable<T>>>;
|
|
233
|
+
export type NodeKeySelector<T, K = unknown> = string | Selector<T, K> | null;
|
|
234
|
+
export declare class TreeService<T> {
|
|
235
|
+
#private;
|
|
236
|
+
readonly animationEnabled: import("@angular/core").WritableSignal<boolean>;
|
|
237
|
+
readonly animationTemporarilyDisabled: import("@angular/core").WritableSignal<boolean>;
|
|
238
|
+
readonly blur$: Subject<FocusEvent>;
|
|
239
|
+
readonly checkBy: import("@angular/core").WritableSignal<NodeKeySelector<T>>;
|
|
240
|
+
readonly checkableOptions: import("@angular/core").WritableSignal<CheckableOptions>;
|
|
241
|
+
/**
|
|
242
|
+
* The checked keys after the user checks or unchecks a node. Keys set from code, and keys the tree derives on its
|
|
243
|
+
* own (parents with `checkParents`, lazily loaded children of a checked node, ancestors after a move), aren't
|
|
244
|
+
* reported here.
|
|
245
|
+
*/
|
|
246
|
+
readonly checkedKeysChange$: Subject<ImmutableSet<unknown>>;
|
|
247
|
+
readonly children: import("@angular/core").WritableSignal<ChildrenSelector<T>>;
|
|
248
|
+
/**
|
|
249
|
+
* A node's children failed to load from an asynchronous children selector. The node is collapsed again (not
|
|
250
|
+
* reported through `expandedKeysChange$`), and expanding it retries the load.
|
|
251
|
+
*/
|
|
252
|
+
readonly childrenLoadError$: Subject<{
|
|
253
|
+
readonly error: unknown;
|
|
254
|
+
readonly node: TreeNode<T>;
|
|
255
|
+
}>;
|
|
256
|
+
/** A node started loading its children from an asynchronous children selector. */
|
|
257
|
+
readonly childrenLoadStart$: Subject<TreeNode<T>>;
|
|
258
|
+
readonly disableBy: import("@angular/core").WritableSignal<NodeKeySelector<T>>;
|
|
259
|
+
readonly disableOptions: import("@angular/core").WritableSignal<DisableOptions>;
|
|
260
|
+
readonly disabledKeys: import("@angular/core").WritableSignal<ImmutableSet<unknown>>;
|
|
261
|
+
readonly draggableOptions: import("@angular/core").WritableSignal<DraggableOptions>;
|
|
262
|
+
readonly dragging: import("@angular/core").WritableSignal<boolean>;
|
|
263
|
+
readonly dragging$: Observable<boolean>;
|
|
264
|
+
readonly dropAllowed: import("@angular/core").WritableSignal<boolean>;
|
|
265
|
+
readonly dropPositionChange$: BehaviorSubject<DropPositionChangeEvent<T> | null>;
|
|
266
|
+
readonly dropPositionSignal: import("@angular/core").Signal<DropPositionChangeEvent<T> | null>;
|
|
267
|
+
readonly expandBy: import("@angular/core").WritableSignal<NodeKeySelector<T>>;
|
|
268
|
+
readonly expandableOptions: import("@angular/core").WritableSignal<ExpandableOptions>;
|
|
269
|
+
readonly expandedKeys: import("@angular/core").Signal<ImmutableSet<unknown>>;
|
|
270
|
+
/**
|
|
271
|
+
* The expanded keys after the user expands or collapses a node outside filtering. The expansion a filter applies,
|
|
272
|
+
* and the user's changes to it while filtering, are view state and aren't reported.
|
|
273
|
+
*/
|
|
274
|
+
readonly expandedKeysChange$: Subject<ImmutableSet<unknown>>;
|
|
275
|
+
readonly filter$: ReplaySubject<string>;
|
|
276
|
+
readonly filterChange$: Subject<FilterChangeEvent>;
|
|
277
|
+
readonly filterPlaceholder: import("@angular/core").WritableSignal<string>;
|
|
278
|
+
/** The applied filter. Typing is debounced by the filter input; a filter set from code applies at once. */
|
|
279
|
+
readonly filterText: import("@angular/core").Signal<string>;
|
|
280
|
+
readonly filterableOptions: import("@angular/core").Signal<FilterableOptions>;
|
|
281
|
+
readonly focus$: Subject<FocusEvent>;
|
|
282
|
+
/** The number of nodes whose text matches the filter (their ancestors, shown for context, aren't counted). */
|
|
283
|
+
readonly matchCount: import("@angular/core").Signal<number>;
|
|
284
|
+
readonly navigatedNode: import("@angular/core").WritableSignal<TreeNode<T> | null>;
|
|
285
|
+
readonly nodeCheck$: Subject<NodeCheckEvent<T>>;
|
|
286
|
+
readonly nodeCheckChange$: Subject<TreeNodeCheckEvent<T>>;
|
|
287
|
+
readonly nodeClick$: Subject<NodeClickEvent<T>>;
|
|
288
|
+
readonly nodeDrag$: Subject<InternalNodeDragEvent<T>>;
|
|
289
|
+
readonly nodeDragEnd$: Subject<NodeDragEndEvent<T>>;
|
|
290
|
+
readonly nodeDragStart$: Subject<NodeDragStartEvent<T>>;
|
|
291
|
+
readonly nodeDrop$: Subject<NodeDropEventSansTree<T>>;
|
|
292
|
+
readonly nodeExpand$: Subject<TreeNodeExpandEvent<T>>;
|
|
293
|
+
readonly nodeSelect$: Subject<NodeSelectEvent<T>>;
|
|
294
|
+
readonly nodeSelectChange$: Subject<TreeNodeSelectEvent<T>>;
|
|
295
|
+
readonly nodeSet: import("@angular/core").WritableSignal<ImmutableSet<TreeNode<T>>>;
|
|
296
|
+
readonly nodeTemplate: import("@angular/core").WritableSignal<TemplateRef<unknown> | null>;
|
|
297
|
+
readonly selectBy: import("@angular/core").WritableSignal<NodeKeySelector<T>>;
|
|
298
|
+
readonly selectableOptions: import("@angular/core").WritableSignal<SelectableOptions>;
|
|
299
|
+
readonly selectedKeys: import("@angular/core").WritableSignal<ImmutableSet<unknown>>;
|
|
300
|
+
/** The selected keys after the user selects or deselects a node. Keys set from code aren't reported. */
|
|
301
|
+
readonly selectedKeysChange$: Subject<ImmutableSet<unknown>>;
|
|
302
|
+
readonly selectedNodes: import("@angular/core").Signal<ImmutableSet<TreeNode<T>>>;
|
|
303
|
+
readonly selectionChange$: Subject<NodeItem<T>>;
|
|
304
|
+
readonly textField: import("@angular/core").WritableSignal<string | Selector<T, string>>;
|
|
305
|
+
readonly viewNodeSet: import("@angular/core").Signal<ImmutableSet<TreeNode<T>>>;
|
|
306
|
+
constructor();
|
|
307
|
+
/** Whether two key sets hold the same keys, in any order. */
|
|
308
|
+
/** Reads a field of a data item by name (for the string forms of the key, id and children selectors). */
|
|
309
|
+
private static readField;
|
|
310
|
+
private static sameKeys;
|
|
311
|
+
static flatten<T>(nodes: Iterable<TreeNode<T>>): List<TreeNode<T>>;
|
|
312
|
+
clearFilter(): void;
|
|
313
|
+
detachNode(node: TreeNode<T>): void;
|
|
314
|
+
/**
|
|
315
|
+
* Expands every expandable, enabled sibling of a node (the `*` key of the WAI-ARIA tree pattern).
|
|
316
|
+
*/
|
|
317
|
+
expandSiblings(node: TreeNode<T>): void;
|
|
318
|
+
/**
|
|
319
|
+
* The node of the current nodes that stands for `node`: the node itself, or after a data refresh rebuilt the
|
|
320
|
+
* nodes, the node of the same data item (or, for flat data, of the same id).
|
|
321
|
+
*/
|
|
322
|
+
findCounterpart(node: TreeNode<T>): TreeNode<T> | null;
|
|
323
|
+
/**
|
|
324
|
+
* Finds the next visible node whose text starts with `prefix` (case-insensitive), wrapping around. Used for
|
|
325
|
+
* typeahead: a first character searches after the navigated node, and each further character keeps the
|
|
326
|
+
* navigated node while it still matches.
|
|
327
|
+
*/
|
|
328
|
+
findNodeByText(prefix: string): TreeNode<T> | null;
|
|
329
|
+
getCheckKey(node: TreeNode<T>): unknown;
|
|
330
|
+
getDisableKey(node: TreeNode<T>): unknown;
|
|
331
|
+
/**
|
|
332
|
+
* Where a keyboard move takes a node: before its previous or after its next visible sibling (`"up"`, `"down"`),
|
|
333
|
+
* inside its previous visible sibling as the last child (`"in"`), or after its parent (`"out"`). `null` when the
|
|
334
|
+
* node can't move that way or is disabled.
|
|
335
|
+
*/
|
|
336
|
+
getKeyboardMove(node: TreeNode<T>, direction: TreeKeyboardMoveDirection): TreeKeyboardMove<T> | null;
|
|
337
|
+
getNodeByUid(uid: string): TreeNode<T> | null;
|
|
338
|
+
getNodeElementId(uid: string): string;
|
|
339
|
+
/** What identifies a node's data item across data refreshes: its id for flat data, else the item itself. */
|
|
340
|
+
getNodeIdentity(node: TreeNode<T>): unknown;
|
|
341
|
+
getNodeText(node: TreeNode<T>): string;
|
|
342
|
+
hasChildren(node: TreeNode<T> | null): boolean;
|
|
343
|
+
insertNodeAtIndex(node: TreeNode<T>, parentUid: string | null, index: number): void;
|
|
344
|
+
isCheckable(node: TreeNode<T>): boolean;
|
|
345
|
+
isChecked(node: TreeNode<T>): boolean;
|
|
346
|
+
isDisabled(node: TreeNode<T>): boolean;
|
|
347
|
+
isExpanded(node: TreeNode<T>): boolean;
|
|
348
|
+
isIndeterminate(node: TreeNode<T>): boolean;
|
|
349
|
+
isNavigated(node: TreeNode<T>): boolean;
|
|
350
|
+
isSelected(node: TreeNode<T>): boolean;
|
|
351
|
+
isTreeFiltered(): boolean;
|
|
352
|
+
isVisible(node: TreeNode<T>): boolean;
|
|
353
|
+
/**
|
|
354
|
+
* Loads the children of a node from an asynchronous children selector.
|
|
355
|
+
* Children are loaded once and cached; pass `reload` to request them again. A new load cancels a pending one.
|
|
356
|
+
*/
|
|
357
|
+
loadNodeChildren(node: TreeNode<T>, reload?: boolean): void;
|
|
358
|
+
/**
|
|
359
|
+
* Moves a node relative to a target node. Moving a node onto itself or into its own subtree is ignored,
|
|
360
|
+
* because it would detach the subtree and create a parent cycle, and so is moving it inside its own parent or
|
|
361
|
+
* a disabled node, or `"outside"`.
|
|
362
|
+
* @returns whether the node moved.
|
|
363
|
+
*/
|
|
364
|
+
moveNode(sourceNode: TreeNode<T>, targetNode: TreeNode<T>, position: DropPosition): boolean;
|
|
365
|
+
navigate(direction: "next" | "previous" | "first" | "last"): TreeNode<T> | null;
|
|
366
|
+
notifySelectionChange(node: TreeNode<T>): void;
|
|
367
|
+
/**
|
|
368
|
+
* Whether selecting `node` the way the user does (a click, or Enter) changes the selection. It doesn't for the
|
|
369
|
+
* selected node of a single selection that can't be toggled off.
|
|
370
|
+
*/
|
|
371
|
+
selectionWouldChange(node: TreeNode<T>): boolean;
|
|
372
|
+
setAnimationEnabled(enabled: boolean): void;
|
|
373
|
+
setCheckBy(selector: NodeKeySelector<T>): void;
|
|
374
|
+
setCheckableOptions(options: Partial<CheckableOptions>): void;
|
|
375
|
+
setCheckedKeys(keys: Iterable<unknown>): void;
|
|
376
|
+
setChildrenSelector(selector: string | Selector<T, Iterable<T> | Observable<Iterable<T>>>): void;
|
|
377
|
+
setData(data: Iterable<T>): void;
|
|
378
|
+
setDataStructure(structure: DataStructure): void;
|
|
379
|
+
setDisableBy(selector: NodeKeySelector<T>): void;
|
|
380
|
+
setDisableOptions(options: Partial<DisableOptions>): void;
|
|
381
|
+
setDisabledKeys(keys: Iterable<unknown>): void;
|
|
382
|
+
setDraggableOptions(options: Partial<DraggableOptions>): void;
|
|
383
|
+
setExpandBy(selector: NodeKeySelector<T>): void;
|
|
384
|
+
setExpandableOptions(options: Partial<ExpandableOptions>): void;
|
|
385
|
+
setExpandedKeys(keys: Iterable<unknown>): void;
|
|
386
|
+
setFilterableOptions(options: Partial<FilterableOptions>): void;
|
|
387
|
+
setFlatIdField(field: string): void;
|
|
388
|
+
setFlatParentIdField(field: string): void;
|
|
389
|
+
setHasCheckboxPredicate(fn: ((data: T, uid: string) => boolean) | null): void;
|
|
390
|
+
setHasChildrenPredicate(predicate: Predicate<T> | null): void;
|
|
391
|
+
setNodeCheck(node: TreeNode<T>, checked: boolean): void;
|
|
392
|
+
setNodeExpand(node: TreeNode<T>, expanded: boolean): void;
|
|
393
|
+
/** @returns whether the selection changed. */
|
|
394
|
+
setNodeSelect(node: TreeNode<T>, selected: boolean): boolean;
|
|
395
|
+
setSelectBy(selector: NodeKeySelector<T>): void;
|
|
396
|
+
setSelectableOptions(options: Partial<SelectableOptions>): void;
|
|
397
|
+
setSelectedDataItems(dataItems: Iterable<T>): void;
|
|
398
|
+
setSelectedKeys(keys: Iterable<unknown>): void;
|
|
399
|
+
setTextField(selector: string | Selector<T, string>): void;
|
|
400
|
+
/**
|
|
401
|
+
* Expands or collapses a node the way user interaction does: disabled nodes are left alone, children of an
|
|
402
|
+
* asynchronous children selector are loaded on first expand, and `nodeExpand$` is notified. Without expanding
|
|
403
|
+
* (every node is then open), nothing changes.
|
|
404
|
+
* @returns whether the expand state changed.
|
|
405
|
+
*/
|
|
406
|
+
toggleNodeExpand(node: TreeNode<T>, expanded: boolean): boolean;
|
|
407
|
+
private applyCheckedKeysToNodes;
|
|
408
|
+
private computeVisibleUids;
|
|
409
|
+
private createFlatNodes;
|
|
410
|
+
/**
|
|
411
|
+
* Builds tree nodes for hierarchical data, reusing the existing node of each data item so node state survives
|
|
412
|
+
* a data refresh. A data object that appears more than once gets a node of its own for every extra occurrence.
|
|
413
|
+
*/
|
|
414
|
+
private createHierarchicalNodes;
|
|
415
|
+
private createNodeDictionary;
|
|
416
|
+
private createNodes;
|
|
417
|
+
/**
|
|
418
|
+
* The derived check state of a parent: `true` when all of its check-state children are checked,
|
|
419
|
+
* or `null` when it has none (its own state then stands).
|
|
420
|
+
*/
|
|
421
|
+
private deriveParentChecked;
|
|
422
|
+
/**
|
|
423
|
+
* Children that determine a parent's derived check state: those with a checkbox and, unless
|
|
424
|
+
* `checkDisabledChildren` is set, only enabled ones, because the user cannot change disabled children.
|
|
425
|
+
*/
|
|
426
|
+
private getCheckStateChildren;
|
|
427
|
+
private getChildNodes;
|
|
428
|
+
private getDataItemSelectKey;
|
|
429
|
+
private getExpandKey;
|
|
430
|
+
private getParentNodes;
|
|
431
|
+
private getSelectKey;
|
|
432
|
+
private isAnyParentCollapsed;
|
|
433
|
+
private isFiltered;
|
|
434
|
+
/**
|
|
435
|
+
* Keeps `aria-activedescendant` on a rendered node: when the active node is hidden by a collapse or a filter, the
|
|
436
|
+
* nearest visible ancestor takes over (else the first visible node); a node re-created by new data with the same
|
|
437
|
+
* uid is swapped in.
|
|
438
|
+
*/
|
|
439
|
+
private keepNavigatedNodeVisible;
|
|
440
|
+
private loadCheckedKeysForChildren;
|
|
441
|
+
/** Loads the children of the expanded, shown nodes whose children come from an observable and aren't loaded. */
|
|
442
|
+
private loadExpandedNodes;
|
|
443
|
+
private moveNodeAfter;
|
|
444
|
+
private moveNodeBefore;
|
|
445
|
+
private moveNodeInside;
|
|
446
|
+
private navigateToNextNode;
|
|
447
|
+
private navigateToPreviousNode;
|
|
448
|
+
private recalculateCheckedAncestors;
|
|
449
|
+
private restoreExpandedChildren;
|
|
450
|
+
private updateNodeIndices;
|
|
451
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TreeService<any>, never>;
|
|
452
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
479
453
|
}
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
454
|
+
export declare class TreeComponent<T> {
|
|
455
|
+
#private;
|
|
456
|
+
protected readonly activeDescendantId: import("@angular/core").Signal<string | null>;
|
|
457
|
+
protected readonly baseClass: import("@angular/core").Signal<string>;
|
|
458
|
+
protected readonly isRtl: import("@angular/core").Signal<boolean>;
|
|
459
|
+
protected readonly keyShortcuts: import("@angular/core").Signal<"Control+Shift+ArrowUp Control+Shift+ArrowDown Control+Shift+ArrowLeft Control+Shift+ArrowRight" | null>;
|
|
460
|
+
protected readonly messages: import("@angular/core").Signal<import("@nanahoshi/mona-ui/i18n").MonaTreeViewMessages>;
|
|
461
|
+
/**
|
|
462
|
+
* With checkboxes, nodes report `aria-checked` and not `aria-selected`, so the tree isn't multiselectable in the
|
|
463
|
+
* `aria-selected` sense.
|
|
464
|
+
*/
|
|
465
|
+
protected readonly multiselectable: import("@angular/core").Signal<true | null>;
|
|
466
|
+
readonly ariaDescribedBy: import("@angular/core").InputSignal<string>;
|
|
467
|
+
readonly ariaLabel: import("@angular/core").InputSignal<string>;
|
|
468
|
+
readonly ariaLabelledBy: import("@angular/core").InputSignal<string>;
|
|
469
|
+
readonly data: import("@angular/core").InputSignal<Iterable<T> | undefined>;
|
|
470
|
+
readonly nodeTemplate: import("@angular/core").Signal<TemplateRef<any> | undefined>;
|
|
471
|
+
readonly treeService: TreeService<T>;
|
|
472
|
+
constructor();
|
|
473
|
+
/**
|
|
474
|
+
* Once the tree has rendered after a keyboard move, finds out whether the `nodeDrop` handler applied it (through
|
|
475
|
+
* `data` or `moveNode`). A move that was applied keeps the node active, opens the node it went into, and is
|
|
476
|
+
* announced.
|
|
477
|
+
*/
|
|
478
|
+
private afterKeyboardMove;
|
|
479
|
+
/** Ctrl+Shift+Arrow (Cmd+Shift+Arrow on macOS) moves the active node while dragging is on. */
|
|
480
|
+
private handleMoveKey;
|
|
481
|
+
private handlePointerMoveWhileDragging;
|
|
482
|
+
private isPointerOutsideTree;
|
|
483
|
+
/**
|
|
484
|
+
* Whether a key event is meant for the tree: from the tree itself or one of its nodes. Keys pressed in controls
|
|
485
|
+
* of a node template (or in a tree nested in one) are left to those controls.
|
|
486
|
+
*/
|
|
487
|
+
private isTreeKeyTarget;
|
|
488
|
+
private locationOf;
|
|
489
|
+
private moveDirection;
|
|
490
|
+
/**
|
|
491
|
+
* Asks for a keyboard move the way a drop does: `nodeDrop` is emitted, and its handler applies the move. The
|
|
492
|
+
* keyboard event is the drop event's original event.
|
|
493
|
+
*/
|
|
494
|
+
private moveWithKeyboard;
|
|
495
|
+
private notifyDropPositionChange;
|
|
496
|
+
private setFocusSubscription;
|
|
497
|
+
private setKeydownSubscription;
|
|
498
|
+
private setNodeDragHandlerSubscription;
|
|
499
|
+
private setSubscriptions;
|
|
500
|
+
private setTypeaheadSubscription;
|
|
501
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TreeComponent<any>, never>;
|
|
502
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TreeComponent<any>, "mona-tree", never, {
|
|
503
|
+
"ariaDescribedBy": {
|
|
504
|
+
"alias": "ariaDescribedBy";
|
|
505
|
+
"required": false;
|
|
506
|
+
"isSignal": true;
|
|
507
|
+
};
|
|
508
|
+
"ariaLabel": {
|
|
509
|
+
"alias": "ariaLabel";
|
|
510
|
+
"required": false;
|
|
511
|
+
"isSignal": true;
|
|
512
|
+
};
|
|
513
|
+
"ariaLabelledBy": {
|
|
514
|
+
"alias": "ariaLabelledBy";
|
|
515
|
+
"required": false;
|
|
516
|
+
"isSignal": true;
|
|
517
|
+
};
|
|
518
|
+
"data": {
|
|
519
|
+
"alias": "data";
|
|
520
|
+
"required": false;
|
|
521
|
+
"isSignal": true;
|
|
522
|
+
};
|
|
523
|
+
}, {}, ["nodeTemplate"], never, true, never>;
|
|
530
524
|
}
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<TreeNodeTemplateDirective, "ng-template[monaTreeNodeTemplate]", never, {}, {}, never, never, true, never>;
|
|
525
|
+
export declare class TreeNodeTemplateDirective {
|
|
526
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TreeNodeTemplateDirective, never>;
|
|
527
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TreeNodeTemplateDirective, "ng-template[monaTreeNodeTemplate]", never, {}, {}, never, never, true, never>;
|
|
535
528
|
}
|
|
536
|
-
|
|
537
|
-
declare const TREE_DEFAULT_MESSAGES: MonaTreeViewMessages;
|
|
538
|
-
|
|
529
|
+
export declare const TREE_DEFAULT_MESSAGES: MonaTreeViewMessages;
|
|
539
530
|
/**
|
|
540
531
|
* Reports that the children of a node couldn't be loaded from an asynchronous children selector. The node is
|
|
541
532
|
* collapsed again, and expanding it retries the load.
|
|
542
533
|
*/
|
|
543
534
|
interface ChildrenLoadErrorEvent<T> {
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
535
|
+
/** What the children observable errored with. */
|
|
536
|
+
readonly error: unknown;
|
|
537
|
+
/** The node whose children failed to load. */
|
|
538
|
+
readonly node: NodeItem<T>;
|
|
548
539
|
}
|
|
549
|
-
|
|
550
540
|
/**
|
|
551
541
|
* Moves a node within a generic flat tree structure that uses parentId references.
|
|
552
542
|
* @param treeData - The flat array of tree nodes.
|
|
@@ -557,8 +547,7 @@ interface ChildrenLoadErrorEvent<T> {
|
|
|
557
547
|
* The array is returned unchanged when the position is "outside" or the target is the dragged node or one of its
|
|
558
548
|
* descendants, which would otherwise create a parent cycle.
|
|
559
549
|
*/
|
|
560
|
-
declare function moveFlatTreeNode<T extends object>(treeData: Iterable<T>, event: NodeDropEvent<T>, idKey: keyof T, parentIdKey: keyof T): T[];
|
|
561
|
-
|
|
550
|
+
export declare function moveFlatTreeNode<T extends object>(treeData: Iterable<T>, event: NodeDropEvent<T>, idKey: keyof T, parentIdKey: keyof T): T[];
|
|
562
551
|
/**
|
|
563
552
|
* Moves a node within a generic hierarchical tree structure.
|
|
564
553
|
* @param treeData - The array of tree nodes.
|
|
@@ -570,7 +559,5 @@ declare function moveFlatTreeNode<T extends object>(treeData: Iterable<T>, event
|
|
|
570
559
|
* The move is skipped, returning the tree unchanged, when the position is "outside", the target is missing,
|
|
571
560
|
* or the target is the dragged node or one of its descendants, so a node is never lost or made its own ancestor.
|
|
572
561
|
*/
|
|
573
|
-
declare function moveTreeNode<T extends object>(treeData: Iterable<T>, event: NodeDropEvent<T>, idKey: keyof T, childrenKey: keyof T): T[];
|
|
574
|
-
|
|
575
|
-
export { InternalNodeDragEvent, NodeCheckEvent, NodeClickEvent, NodeDragEndEvent, NodeDragEvent, NodeDragStartEvent, NodeDropEvent, NodeDropEventSansTree, NodeEvent, NodeSelectEvent, TREE_DEFAULT_MESSAGES, TreeComponent, TreeNode, TreeNodeTemplateDirective, TreeService, moveFlatTreeNode, moveTreeNode };
|
|
576
|
-
export type { CheckableOptions, ChildrenLoadErrorEvent, ChildrenSelector, DataStructure, DisableOptions, DraggableOptions, DropPosition, DropPositionChangeEvent, ExpandableOptions, ITreeView, MultipleSelectionConfig, NodeDropEventArgs, NodeDropEventArgsSansTree, NodeDropOriginalEvent, NodeItem, NodeKeySelector, NodeMoveSnapshot, SelectableOptions, SingleSelectionConfig, TreeKeyboardMove, TreeKeyboardMoveDirection, TreeNodeCheckEvent, TreeNodeExpandEvent, TreeNodeSelectEvent };
|
|
562
|
+
export declare function moveTreeNode<T extends object>(treeData: Iterable<T>, event: NodeDropEvent<T>, idKey: keyof T, childrenKey: keyof T): T[];
|
|
563
|
+
export type { ChildrenLoadErrorEvent, TreeKeyboardMove, TreeKeyboardMoveDirection };
|