@nanahoshi/mona-ui 0.1.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/README.md +25 -0
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +590 -0
- package/fesm2022/nanahoshi-mona-ui-avatar.mjs +168 -0
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +220 -0
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +225 -0
- package/fesm2022/nanahoshi-mona-ui-button.mjs +497 -0
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +1569 -0
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +339 -0
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +453 -0
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +200 -0
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +853 -0
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +923 -0
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +495 -0
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +686 -0
- package/fesm2022/nanahoshi-mona-ui-common.mjs +642 -0
- package/fesm2022/nanahoshi-mona-ui-contextmenu.mjs +485 -0
- package/fesm2022/nanahoshi-mona-ui-date-input.mjs +132 -0
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +460 -0
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +659 -0
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +828 -0
- package/fesm2022/nanahoshi-mona-ui-dropdown-button.mjs +523 -0
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +615 -0
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +701 -0
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +1400 -0
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +245 -0
- package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +170 -0
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +680 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-cell.component-B9SQH5N-.mjs +105 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-DlLwcCFT.mjs +42 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-Dgea-O0X.mjs +130 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-toggle.component-DIUutx9s.mjs +773 -0
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DRHycGIh.mjs +240 -0
- package/fesm2022/nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-C3eZIaJK.mjs +5374 -0
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-internal-filter-input.mjs +87 -0
- package/fesm2022/nanahoshi-mona-ui-internal-indicator-icon.mjs +154 -0
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +1356 -0
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +2263 -0
- package/fesm2022/nanahoshi-mona-ui-internal.mjs +379 -0
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +630 -0
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +527 -0
- package/fesm2022/nanahoshi-mona-ui-list.mjs +4 -0
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +966 -0
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +641 -0
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +536 -0
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +597 -0
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +790 -0
- package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +83 -0
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +325 -0
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +1559 -0
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +1321 -0
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +294 -0
- package/fesm2022/nanahoshi-mona-ui-query.mjs +175 -0
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +339 -0
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +565 -0
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +1049 -0
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +636 -0
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +843 -0
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +537 -0
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +308 -0
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +664 -0
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +111 -0
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +369 -0
- package/fesm2022/nanahoshi-mona-ui-theme.mjs +314 -0
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +450 -0
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +723 -0
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +716 -0
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +733 -0
- package/fesm2022/nanahoshi-mona-ui-window.mjs +1329 -0
- package/fesm2022/nanahoshi-mona-ui.mjs +9 -0
- package/package.json +289 -0
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +223 -0
- package/types/nanahoshi-mona-ui-avatar.d.ts +642 -0
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +70 -0
- package/types/nanahoshi-mona-ui-button-group.d.ts +77 -0
- package/types/nanahoshi-mona-ui-button.d.ts +111 -0
- package/types/nanahoshi-mona-ui-calendar.d.ts +262 -0
- package/types/nanahoshi-mona-ui-check-box.d.ts +133 -0
- package/types/nanahoshi-mona-ui-chip.d.ts +130 -0
- package/types/nanahoshi-mona-ui-circular-progress-bar.d.ts +113 -0
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +201 -0
- package/types/nanahoshi-mona-ui-color-palette.d.ts +102 -0
- package/types/nanahoshi-mona-ui-color-picker.d.ts +156 -0
- package/types/nanahoshi-mona-ui-combo-box.d.ts +232 -0
- package/types/nanahoshi-mona-ui-common.d.ts +386 -0
- package/types/nanahoshi-mona-ui-contextmenu.d.ts +129 -0
- package/types/nanahoshi-mona-ui-date-input.d.ts +60 -0
- package/types/nanahoshi-mona-ui-date-picker.d.ts +177 -0
- package/types/nanahoshi-mona-ui-datetime-picker.d.ts +199 -0
- package/types/nanahoshi-mona-ui-dialog.d.ts +261 -0
- package/types/nanahoshi-mona-ui-dropdown-button.d.ts +159 -0
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +219 -0
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +176 -0
- package/types/nanahoshi-mona-ui-editor.d.ts +113 -0
- package/types/nanahoshi-mona-ui-expansion-panel.d.ts +87 -0
- package/types/nanahoshi-mona-ui-fieldset.d.ts +68 -0
- package/types/nanahoshi-mona-ui-filter.d.ts +115 -0
- package/types/nanahoshi-mona-ui-grid.d.ts +1114 -0
- package/types/nanahoshi-mona-ui-internal-filter-input.d.ts +25 -0
- package/types/nanahoshi-mona-ui-internal-indicator-icon.d.ts +28 -0
- package/types/nanahoshi-mona-ui-internal-list.d.ts +269 -0
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +391 -0
- package/types/nanahoshi-mona-ui-internal.d.ts +136 -0
- package/types/nanahoshi-mona-ui-list-box.d.ts +225 -0
- package/types/nanahoshi-mona-ui-list-view.d.ts +188 -0
- package/types/nanahoshi-mona-ui-list.d.ts +1 -0
- package/types/nanahoshi-mona-ui-menubar.d.ts +198 -0
- package/types/nanahoshi-mona-ui-multi-select.d.ts +247 -0
- package/types/nanahoshi-mona-ui-notification.d.ts +106 -0
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +161 -0
- package/types/nanahoshi-mona-ui-pager.d.ts +238 -0
- package/types/nanahoshi-mona-ui-placeholder.d.ts +35 -0
- package/types/nanahoshi-mona-ui-popover.d.ts +130 -0
- package/types/nanahoshi-mona-ui-popup-menu.d.ts +412 -0
- package/types/nanahoshi-mona-ui-popup.d.ts +485 -0
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +139 -0
- package/types/nanahoshi-mona-ui-query.d.ts +89 -0
- package/types/nanahoshi-mona-ui-radio-button.d.ts +128 -0
- package/types/nanahoshi-mona-ui-scroll-view.d.ts +166 -0
- package/types/nanahoshi-mona-ui-slider.d.ts +305 -0
- package/types/nanahoshi-mona-ui-split-button.d.ts +182 -0
- package/types/nanahoshi-mona-ui-splitter.d.ts +70 -0
- package/types/nanahoshi-mona-ui-stepper.d.ts +173 -0
- package/types/nanahoshi-mona-ui-switch.d.ts +125 -0
- package/types/nanahoshi-mona-ui-tabs.d.ts +158 -0
- package/types/nanahoshi-mona-ui-text-area.d.ts +42 -0
- package/types/nanahoshi-mona-ui-text-box.d.ts +164 -0
- package/types/nanahoshi-mona-ui-theme.d.ts +23 -0
- package/types/nanahoshi-mona-ui-time-picker.d.ts +184 -0
- package/types/nanahoshi-mona-ui-time-selector.d.ts +143 -0
- package/types/nanahoshi-mona-ui-tooltip.d.ts +130 -0
- package/types/nanahoshi-mona-ui-tree-view.d.ts +274 -0
- package/types/nanahoshi-mona-ui-window.d.ts +295 -0
- package/types/nanahoshi-mona-ui.d.ts +2 -0
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { TemplateRef } from '@angular/core';
|
|
3
|
+
import { ImmutableSet, Selector, List, Predicate } from '@mirei/ts-collections';
|
|
4
|
+
import { Observable, Subject, BehaviorSubject, ReplaySubject } from 'rxjs';
|
|
5
|
+
import { PreventableEvent, FilterableOptions, FilterChangeEvent } from '@nanahoshi/mona-ui/common';
|
|
6
|
+
|
|
7
|
+
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";
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
type DataStructure = "flat" | "hierarchical";
|
|
38
|
+
|
|
39
|
+
interface DisableOptions {
|
|
40
|
+
/**
|
|
41
|
+
* @description Determines whether the children of the node should be disabled as well.
|
|
42
|
+
*/
|
|
43
|
+
disableChildren: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* @description Determines if the disabling is enabled.
|
|
46
|
+
*/
|
|
47
|
+
enabled: boolean;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
interface DraggableOptions {
|
|
51
|
+
/**
|
|
52
|
+
* @description Determines if the dragging is enabled.
|
|
53
|
+
*/
|
|
54
|
+
enabled: boolean;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
interface NodeItem<T> {
|
|
58
|
+
data: T;
|
|
59
|
+
hasChildren: boolean;
|
|
60
|
+
uid: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
declare class TreeNode<T> {
|
|
64
|
+
readonly checked: _angular_core.WritableSignal<boolean>;
|
|
65
|
+
readonly children: _angular_core.WritableSignal<ImmutableSet<TreeNode<T>>>;
|
|
66
|
+
readonly data: T;
|
|
67
|
+
readonly loading: _angular_core.WritableSignal<boolean>;
|
|
68
|
+
readonly uid: string;
|
|
69
|
+
index: string;
|
|
70
|
+
parent: TreeNode<T> | null;
|
|
71
|
+
constructor(data: T);
|
|
72
|
+
clone(): TreeNode<T>;
|
|
73
|
+
isDescendantOf(node: TreeNode<T>): boolean;
|
|
74
|
+
get nodeItem(): NodeItem<T>;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
type DropPosition = "before" | "after" | "inside" | "outside";
|
|
78
|
+
interface DropPositionChangeEvent<T> {
|
|
79
|
+
position: DropPosition;
|
|
80
|
+
targetNode: TreeNode<T> | null;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
interface ExpandableOptions {
|
|
84
|
+
/**
|
|
85
|
+
* @description Determines if the expanding is enabled.
|
|
86
|
+
*/
|
|
87
|
+
enabled: boolean;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
declare class NodeCheckEvent<T> extends PreventableEvent {
|
|
91
|
+
#private;
|
|
92
|
+
constructor(node: TreeNode<T>, event: MouseEvent | KeyboardEvent);
|
|
93
|
+
get nodeItem(): NodeItem<T>;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
declare class NodeClickEvent<T> extends PreventableEvent {
|
|
97
|
+
#private;
|
|
98
|
+
constructor(node: TreeNode<T>, event: MouseEvent);
|
|
99
|
+
get nodeItem(): NodeItem<T>;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
declare abstract class NodeEvent<T> extends PreventableEvent<MouseEvent | TouchEvent> {
|
|
103
|
+
#private;
|
|
104
|
+
protected constructor(type: string, node: TreeNode<T>, event: MouseEvent | TouchEvent);
|
|
105
|
+
get nodeItem(): NodeItem<T>;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
declare class NodeDragEndEvent<T> extends NodeEvent<T> {
|
|
109
|
+
constructor(node: TreeNode<T>, event: MouseEvent | TouchEvent);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
declare class NodeDragEvent<T> {
|
|
113
|
+
#private;
|
|
114
|
+
constructor(node: TreeNode<T>, targetNode: TreeNode<T> | null, event: MouseEvent | TouchEvent);
|
|
115
|
+
get nodeItem(): NodeItem<T>;
|
|
116
|
+
get originalEvent(): MouseEvent | TouchEvent;
|
|
117
|
+
get targetNodeItem(): NodeItem<T> | null;
|
|
118
|
+
get type(): string;
|
|
119
|
+
}
|
|
120
|
+
declare class InternalNodeDragEvent<T> {
|
|
121
|
+
#private;
|
|
122
|
+
constructor(dragEvent: NodeDragEvent<T>, dropAllowed: boolean);
|
|
123
|
+
get dragEvent(): NodeDragEvent<T>;
|
|
124
|
+
get dropAllowed(): boolean;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
declare class NodeDragStartEvent<T> extends NodeEvent<T> {
|
|
128
|
+
constructor(node: TreeNode<T>, event: MouseEvent | TouchEvent);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
interface NodeMoveSnapshot {
|
|
132
|
+
readonly originalIndex: number;
|
|
133
|
+
readonly originalParentUid: string | null;
|
|
134
|
+
readonly sourceNodeUid: string;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
interface ITreeView<T> {
|
|
138
|
+
moveNode(source: NodeItem<T>, target: NodeItem<T>, position: DropPosition): NodeMoveSnapshot | null;
|
|
139
|
+
undoMoveNode(snapshot: NodeMoveSnapshot): void;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
declare class NodeDropEvent<T> extends NodeEvent<T> {
|
|
143
|
+
#private;
|
|
144
|
+
constructor(params: NodeDropEventArgs<T>);
|
|
145
|
+
get position(): DropPosition;
|
|
146
|
+
get sourceNode(): NodeItem<T>;
|
|
147
|
+
get targetNode(): NodeItem<T>;
|
|
148
|
+
get treeView(): ITreeView<T>;
|
|
149
|
+
}
|
|
150
|
+
declare class NodeDropEventSansTree<T> extends NodeEvent<T> {
|
|
151
|
+
#private;
|
|
152
|
+
constructor(params: NodeDropEventArgsSansTree<T>);
|
|
153
|
+
get event(): MouseEvent | TouchEvent;
|
|
154
|
+
get position(): DropPosition;
|
|
155
|
+
get sourceNode(): TreeNode<T>;
|
|
156
|
+
get targetNode(): TreeNode<T>;
|
|
157
|
+
}
|
|
158
|
+
interface NodeDropEventArgs<T> {
|
|
159
|
+
event: MouseEvent | TouchEvent;
|
|
160
|
+
position: DropPosition;
|
|
161
|
+
sourceNode: TreeNode<T>;
|
|
162
|
+
targetNode: TreeNode<T>;
|
|
163
|
+
treeView: ITreeView<T>;
|
|
164
|
+
}
|
|
165
|
+
type NodeDropEventArgsSansTree<T> = Omit<NodeDropEventArgs<T>, "treeView">;
|
|
166
|
+
|
|
167
|
+
declare class NodeSelectEvent<T> extends PreventableEvent {
|
|
168
|
+
#private;
|
|
169
|
+
constructor(node: TreeNode<T>, event: MouseEvent | KeyboardEvent);
|
|
170
|
+
get nodeItem(): NodeItem<T>;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
interface TreeNodeCheckEvent<T> {
|
|
174
|
+
checked: boolean;
|
|
175
|
+
node: TreeNode<T>;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
interface TreeNodeExpandEvent<T> {
|
|
179
|
+
expanded: boolean;
|
|
180
|
+
node: TreeNode<T>;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
interface TreeNodeSelectEvent<T> {
|
|
184
|
+
node: TreeNode<T>;
|
|
185
|
+
selected: boolean;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
type SelectableOptions = {
|
|
189
|
+
/**
|
|
190
|
+
* @description Determines if the selection functionality is active.
|
|
191
|
+
*/
|
|
192
|
+
enabled: boolean;
|
|
193
|
+
/**
|
|
194
|
+
* @description Determines whether only the children of the node should be selectable.
|
|
195
|
+
*/
|
|
196
|
+
childrenOnly: boolean;
|
|
197
|
+
} & (SingleSelectionConfig | MultipleSelectionConfig);
|
|
198
|
+
interface SingleSelectionConfig {
|
|
199
|
+
/**
|
|
200
|
+
* @description Allows only one item to be selected at a time.
|
|
201
|
+
*/
|
|
202
|
+
mode: "single";
|
|
203
|
+
/**
|
|
204
|
+
* @description Determines if clicking an already selected item will deselect it.
|
|
205
|
+
*/
|
|
206
|
+
toggleable?: boolean;
|
|
207
|
+
}
|
|
208
|
+
interface MultipleSelectionConfig {
|
|
209
|
+
/**
|
|
210
|
+
* @description Allows multiple items to be selected simultaneously.
|
|
211
|
+
*/
|
|
212
|
+
mode: "multiple";
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
type ChildrenSelector<T> = string | Selector<T, Iterable<T> | Observable<Iterable<T>>>;
|
|
216
|
+
type NodeKeySelector<T, K = any> = string | Selector<T, K> | null;
|
|
217
|
+
|
|
218
|
+
declare class TreeService<T> {
|
|
219
|
+
#private;
|
|
220
|
+
readonly animationTemporarilyDisabled: _angular_core.WritableSignal<boolean>;
|
|
221
|
+
readonly animationEnabled: _angular_core.WritableSignal<boolean>;
|
|
222
|
+
readonly blur$: Subject<FocusEvent>;
|
|
223
|
+
readonly checkBy: _angular_core.WritableSignal<NodeKeySelector<T>>;
|
|
224
|
+
readonly checkableOptions: _angular_core.WritableSignal<CheckableOptions>;
|
|
225
|
+
readonly checkedKeys$: Observable<ImmutableSet<any>>;
|
|
226
|
+
readonly children: _angular_core.WritableSignal<ChildrenSelector<T>>;
|
|
227
|
+
readonly disableBy: _angular_core.WritableSignal<NodeKeySelector<T>>;
|
|
228
|
+
readonly disableOptions: _angular_core.WritableSignal<DisableOptions>;
|
|
229
|
+
readonly disabledKeys: _angular_core.WritableSignal<ImmutableSet<any>>;
|
|
230
|
+
readonly draggableOptions: _angular_core.WritableSignal<DraggableOptions>;
|
|
231
|
+
readonly dragging: _angular_core.WritableSignal<boolean>;
|
|
232
|
+
readonly dragging$: Observable<boolean>;
|
|
233
|
+
readonly dropAllowed: _angular_core.WritableSignal<boolean>;
|
|
234
|
+
readonly dropPositionChange$: BehaviorSubject<DropPositionChangeEvent<T> | null>;
|
|
235
|
+
readonly dropPositionSignal: _angular_core.Signal<DropPositionChangeEvent<T> | null>;
|
|
236
|
+
readonly expandBy: _angular_core.WritableSignal<NodeKeySelector<T>>;
|
|
237
|
+
readonly expandableOptions: _angular_core.WritableSignal<ExpandableOptions>;
|
|
238
|
+
readonly expandedKeys: _angular_core.Signal<ImmutableSet<any>>;
|
|
239
|
+
readonly expandedKeys$: Observable<ImmutableSet<any>>;
|
|
240
|
+
readonly filterableOptions: _angular_core.WritableSignal<FilterableOptions>;
|
|
241
|
+
readonly filter$: ReplaySubject<string>;
|
|
242
|
+
readonly filterChange$: Subject<FilterChangeEvent>;
|
|
243
|
+
readonly filterPlaceholder: _angular_core.WritableSignal<string>;
|
|
244
|
+
readonly filterText: _angular_core.Signal<string>;
|
|
245
|
+
readonly focus$: Subject<FocusEvent>;
|
|
246
|
+
readonly navigatedNode: _angular_core.WritableSignal<TreeNode<T> | null>;
|
|
247
|
+
readonly nodeCheck$: Subject<NodeCheckEvent<T>>;
|
|
248
|
+
readonly nodeCheckChange$: Subject<TreeNodeCheckEvent<T>>;
|
|
249
|
+
readonly nodeClick$: Subject<NodeClickEvent<T>>;
|
|
250
|
+
readonly nodeDrag$: Subject<InternalNodeDragEvent<T>>;
|
|
251
|
+
readonly nodeDragEnd$: Subject<NodeDragEndEvent<T>>;
|
|
252
|
+
readonly nodeDragStart$: Subject<NodeDragStartEvent<T>>;
|
|
253
|
+
readonly nodeDrop$: Subject<NodeDropEventSansTree<T>>;
|
|
254
|
+
readonly nodeExpand$: Subject<TreeNodeExpandEvent<T>>;
|
|
255
|
+
readonly nodeSelect$: Subject<NodeSelectEvent<T>>;
|
|
256
|
+
readonly nodeSelectChange$: Subject<TreeNodeSelectEvent<T>>;
|
|
257
|
+
readonly nodeSet: _angular_core.WritableSignal<ImmutableSet<TreeNode<T>>>;
|
|
258
|
+
readonly nodeTemplate: _angular_core.WritableSignal<TemplateRef<any> | null>;
|
|
259
|
+
readonly selectBy: _angular_core.WritableSignal<NodeKeySelector<T>>;
|
|
260
|
+
readonly selectableOptions: _angular_core.WritableSignal<SelectableOptions>;
|
|
261
|
+
readonly selectedKeys: _angular_core.WritableSignal<ImmutableSet<any>>;
|
|
262
|
+
readonly selectedKeys$: Observable<ImmutableSet<any>>;
|
|
263
|
+
readonly selectedNodes: _angular_core.Signal<ImmutableSet<TreeNode<T>>>;
|
|
264
|
+
readonly selectionChange$: Subject<NodeItem<T>>;
|
|
265
|
+
readonly textField: _angular_core.WritableSignal<string | Selector<T, string>>;
|
|
266
|
+
readonly viewNodeSet: _angular_core.Signal<ImmutableSet<TreeNode<T>>>;
|
|
267
|
+
constructor();
|
|
268
|
+
static flatten<T>(nodes: Iterable<TreeNode<T>>): List<TreeNode<T>>;
|
|
269
|
+
clearFilter(): void;
|
|
270
|
+
detachNode(node: TreeNode<T>): void;
|
|
271
|
+
getNodeByUid(uid: string): TreeNode<T> | null;
|
|
272
|
+
getNodeElementId(uid: string): string;
|
|
273
|
+
getNodeText(node: TreeNode<T>): string;
|
|
274
|
+
hasChildren(node: TreeNode<T> | null): boolean;
|
|
275
|
+
insertNodeAtIndex(node: TreeNode<T>, parentUid: string | null, index: number): void;
|
|
276
|
+
isCheckable(node: TreeNode<T>): boolean;
|
|
277
|
+
isChecked(node: TreeNode<T>): boolean;
|
|
278
|
+
isDisabled(node: TreeNode<T>): boolean;
|
|
279
|
+
isExpanded(node: TreeNode<T>): boolean;
|
|
280
|
+
isIndeterminate(node: TreeNode<T>): boolean;
|
|
281
|
+
isNavigated(node: TreeNode<T>): boolean;
|
|
282
|
+
isSelected(node: TreeNode<T>): boolean;
|
|
283
|
+
isTreeFiltered(): boolean;
|
|
284
|
+
isVisible(node: TreeNode<T>): boolean;
|
|
285
|
+
loadNodeChildren(node: TreeNode<T>): void;
|
|
286
|
+
moveNode(sourceNode: TreeNode<T>, targetNode: TreeNode<T>, position: DropPosition): void;
|
|
287
|
+
navigate(direction: "next" | "previous" | "first" | "last"): TreeNode<T> | null;
|
|
288
|
+
notifySelectionChange(node: TreeNode<T>): void;
|
|
289
|
+
setAnimationEnabled(enabled: boolean): void;
|
|
290
|
+
setChildrenSelector(selector: string | Selector<T, Iterable<T> | Observable<Iterable<T>>>): void;
|
|
291
|
+
setCheckBy(selector: NodeKeySelector<T>): void;
|
|
292
|
+
setCheckableOptions(options: Partial<CheckableOptions>): void;
|
|
293
|
+
setCheckedKeys(keys: Iterable<any>): void;
|
|
294
|
+
setData(data: Iterable<T>): void;
|
|
295
|
+
setDataStructure(structure: DataStructure): void;
|
|
296
|
+
setDisableBy(selector: NodeKeySelector<T>): void;
|
|
297
|
+
setDisableOptions(options: Partial<DisableOptions>): void;
|
|
298
|
+
setDisabledKeys(keys: Iterable<any>): void;
|
|
299
|
+
setDraggableOptions(options: Partial<DraggableOptions>): void;
|
|
300
|
+
setExpandBy(selector: NodeKeySelector<T>): void;
|
|
301
|
+
setExpandableOptions(options: Partial<ExpandableOptions>): void;
|
|
302
|
+
setExpandedKeys(keys: Iterable<any>): void;
|
|
303
|
+
setFilterableOptions(options: Partial<FilterableOptions>): void;
|
|
304
|
+
setFlatIdField(field: string): void;
|
|
305
|
+
setFlatParentIdField(field: string): void;
|
|
306
|
+
setHasCheckboxPredicate(fn: ((data: T, uid: string) => boolean) | null): void;
|
|
307
|
+
setHasChildrenPredicate(predicate: Predicate<any> | null): void;
|
|
308
|
+
setNodeCheck(node: TreeNode<T>, checked: boolean): void;
|
|
309
|
+
setNodeExpand(node: TreeNode<T>, expanded: boolean): void;
|
|
310
|
+
setNodeSelect(node: TreeNode<T>, selected: boolean): void;
|
|
311
|
+
setSelectBy(selector: NodeKeySelector<T>): void;
|
|
312
|
+
setSelectableOptions(options: Partial<SelectableOptions>): void;
|
|
313
|
+
setSelectedDataItems(dataItems: Iterable<T>): void;
|
|
314
|
+
setSelectedKeys(keys: Iterable<any>): void;
|
|
315
|
+
setTextField(selector: string | Selector<T, string>): void;
|
|
316
|
+
getCheckKey(node: TreeNode<T>): any;
|
|
317
|
+
getDisableKey(node: TreeNode<T>): any;
|
|
318
|
+
private applyCheckedKeysToNodes;
|
|
319
|
+
private computeVisibleUids;
|
|
320
|
+
private createFlatNodes;
|
|
321
|
+
private createHierarchicalNodes;
|
|
322
|
+
private createNodeDictionary;
|
|
323
|
+
private createNodes;
|
|
324
|
+
private getExpandKey;
|
|
325
|
+
private getChildNodes;
|
|
326
|
+
private getDataItemSelectKey;
|
|
327
|
+
private getParentNodes;
|
|
328
|
+
private getSelectKey;
|
|
329
|
+
private isAnyParentCollapsed;
|
|
330
|
+
private isAnyParentDisabled;
|
|
331
|
+
private isFiltered;
|
|
332
|
+
private loadCheckedKeysForChildren;
|
|
333
|
+
private moveNodeAfter;
|
|
334
|
+
private moveNodeBefore;
|
|
335
|
+
private moveNodeInside;
|
|
336
|
+
private navigateToNextNode;
|
|
337
|
+
private navigateToPreviousNode;
|
|
338
|
+
private recalculateCheckedAncestors;
|
|
339
|
+
private restoreExpandedChildren;
|
|
340
|
+
private updateNodeIndices;
|
|
341
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TreeService<any>, never>;
|
|
342
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<TreeService<any>>;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
declare class TreeComponent<T> {
|
|
346
|
+
#private;
|
|
347
|
+
protected readonly activeDescendantId: _angular_core.Signal<string | null>;
|
|
348
|
+
protected readonly baseClass: _angular_core.Signal<string>;
|
|
349
|
+
readonly ariaLabel: _angular_core.InputSignal<string>;
|
|
350
|
+
readonly treeService: TreeService<T>;
|
|
351
|
+
readonly nodeTemplate: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
352
|
+
readonly data: _angular_core.InputSignal<Iterable<T> | undefined>;
|
|
353
|
+
constructor();
|
|
354
|
+
private handleMouseMoveWhileDragging;
|
|
355
|
+
private isMouseOutsideTree;
|
|
356
|
+
private notifyDropPositionChange;
|
|
357
|
+
private setFocusSubscription;
|
|
358
|
+
private setKeydownSubscription;
|
|
359
|
+
private setNodeDragHandlerSubscription;
|
|
360
|
+
private setSubscriptions;
|
|
361
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TreeComponent<any>, never>;
|
|
362
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TreeComponent<any>, "mona-tree", never, { "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; }, {}, ["nodeTemplate"], never, true, never>;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
declare class TreeNodeTemplateDirective {
|
|
366
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TreeNodeTemplateDirective, never>;
|
|
367
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<TreeNodeTemplateDirective, "ng-template[monaTreeNodeTemplate]", never, {}, {}, never, never, true, never>;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Moves a node within a generic flat tree structure that uses parentId references.
|
|
372
|
+
* @param treeData - The flat array of tree nodes.
|
|
373
|
+
* @param event - The drag-and-drop event payload.
|
|
374
|
+
* @param idKey - The property key used to uniquely identify each node (e.g., 'id').
|
|
375
|
+
* @param parentIdKey - The property key holding the parent node's id, or null for roots (e.g., 'parentId').
|
|
376
|
+
* @returns A new array representing the updated flat tree, with the moved node's parentIdKey updated.
|
|
377
|
+
*/
|
|
378
|
+
declare function moveFlatTreeNode<T extends Record<string, any>>(treeData: Iterable<T>, event: NodeDropEvent<T>, idKey: keyof T, parentIdKey: keyof T): T[];
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* Moves a node within a generic hierarchical tree structure.
|
|
382
|
+
* @param treeData - The array of tree nodes.
|
|
383
|
+
* @param event - The drag-and-drop event payload.
|
|
384
|
+
* @param idKey - The property key used to identify nodes (e.g., 'id').
|
|
385
|
+
* @param childrenKey - The property key containing the nested items (e.g., 'items').
|
|
386
|
+
* @returns A new array representing the updated tree structure.
|
|
387
|
+
*/
|
|
388
|
+
declare function moveTreeNode<T extends Record<string, any>>(treeData: Iterable<T>, event: NodeDropEvent<T>, idKey: keyof T, childrenKey: keyof T): T[];
|
|
389
|
+
|
|
390
|
+
export { InternalNodeDragEvent, NodeCheckEvent, NodeClickEvent, NodeDragEndEvent, NodeDragEvent, NodeDragStartEvent, NodeDropEvent, NodeDropEventSansTree, NodeEvent, NodeSelectEvent, TreeComponent, TreeNode, TreeNodeTemplateDirective, TreeService, moveFlatTreeNode, moveTreeNode };
|
|
391
|
+
export type { CheckableOptions, ChildrenSelector, DataStructure, DisableOptions, DraggableOptions, DropPosition, DropPositionChangeEvent, ExpandableOptions, ITreeView, NodeDropEventArgs, NodeDropEventArgsSansTree, NodeItem, NodeKeySelector, NodeMoveSnapshot, SelectableOptions, TreeNodeCheckEvent, TreeNodeExpandEvent, TreeNodeSelectEvent };
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { ElementRef, DestroyRef, Signal } from '@angular/core';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { OverlayRef } from '@angular/cdk/overlay';
|
|
5
|
+
|
|
6
|
+
type AttributeConfig = Record<string, unknown>;
|
|
7
|
+
|
|
8
|
+
declare class AttributeBinderDirective {
|
|
9
|
+
#private;
|
|
10
|
+
readonly attributes: i0.InputSignal<AttributeConfig>;
|
|
11
|
+
constructor();
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AttributeBinderDirective, never>;
|
|
13
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AttributeBinderDirective, "[monaAttributeBinder]", never, { "attributes": { "alias": "monaAttributeBinder"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface ColorScheme {
|
|
17
|
+
colors: string[];
|
|
18
|
+
columns: number;
|
|
19
|
+
name: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface RGB {
|
|
23
|
+
r: number | null;
|
|
24
|
+
g: number | null;
|
|
25
|
+
b: number | null;
|
|
26
|
+
}
|
|
27
|
+
interface RGBA extends RGB {
|
|
28
|
+
a: number | null;
|
|
29
|
+
}
|
|
30
|
+
interface HSV {
|
|
31
|
+
h: number | null;
|
|
32
|
+
s: number | null;
|
|
33
|
+
v: number | null;
|
|
34
|
+
}
|
|
35
|
+
interface HSVA extends HSV {
|
|
36
|
+
a: number | null;
|
|
37
|
+
}
|
|
38
|
+
type RGBChannel = keyof RGB;
|
|
39
|
+
type RGBAChannel = keyof RGBA;
|
|
40
|
+
type HSVChannel = keyof HSV;
|
|
41
|
+
type Channel = RGBAChannel | HSVChannel;
|
|
42
|
+
interface HSL {
|
|
43
|
+
h: number | null;
|
|
44
|
+
s: number | null;
|
|
45
|
+
l: number | null;
|
|
46
|
+
}
|
|
47
|
+
interface HSLA extends HSL {
|
|
48
|
+
a: number | null;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
declare const isValidHex: (hex: string) => boolean;
|
|
52
|
+
declare const isValidHsla: (hslaText: string) => boolean;
|
|
53
|
+
declare const isValidRgb: (rgbText: string) => boolean;
|
|
54
|
+
|
|
55
|
+
declare const hex2rgba: (hex: string) => RGBA;
|
|
56
|
+
|
|
57
|
+
declare const hsla2hsva: (hue: number | null, saturation: number | null, lightness: number | null, alpha: number | null) => HSVA;
|
|
58
|
+
|
|
59
|
+
declare const hsva2rgba: (hue: number | null, saturation: number | null, value: number | null, alpha: number | null) => RGBA;
|
|
60
|
+
|
|
61
|
+
declare const rgba2hex: (r: number | null, g: number | null, b: number | null, a: number | null) => string;
|
|
62
|
+
|
|
63
|
+
declare const rgba2hsla: (red: number | null, green: number | null, blue: number | null, alpha: number | null) => HSLA;
|
|
64
|
+
|
|
65
|
+
declare const rgba2hsva: (r: number | null, g: number | null, b: number | null, a: number | null) => HSVA;
|
|
66
|
+
|
|
67
|
+
declare const string2Hsla: (hslText: string) => HSLA;
|
|
68
|
+
|
|
69
|
+
declare const string2rgba: (rgbText: string) => RGBA;
|
|
70
|
+
|
|
71
|
+
type Action<P = void, R = void> = (arg: P) => R;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Generates a unique control ID for an element.
|
|
75
|
+
* The ID consists of a prefix, a random hexadecimal string, and a suffix.
|
|
76
|
+
* @param {number} [level=0] - The nesting level of the element. This increases the length of the generated ID.
|
|
77
|
+
* @param {number} [length=7] - The base length of the random part of the ID.
|
|
78
|
+
* @returns {string} A unique control ID string for use for elements.
|
|
79
|
+
*/
|
|
80
|
+
declare const createElementControlId: (level?: number, length?: number) => string;
|
|
81
|
+
|
|
82
|
+
declare function focusElement(host: HTMLElement, element: HTMLElement | ElementRef<HTMLElement> | string): void;
|
|
83
|
+
|
|
84
|
+
declare const rxFromResize: (target: Element | Iterable<Element>, options?: ResizeObserverOptions) => Observable<ResizeObserverEntry[]>;
|
|
85
|
+
|
|
86
|
+
declare const rxTimeout: (destroyRef: DestroyRef, fn: Action, delay?: number) => void;
|
|
87
|
+
|
|
88
|
+
type VariantInputs<T> = {
|
|
89
|
+
[K in keyof T]-?: Signal<T[K]>;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
declare const restoreOverlayScroll: (overlayRef: OverlayRef, element: HTMLElement) => void;
|
|
93
|
+
|
|
94
|
+
interface WindowStyleSettings {
|
|
95
|
+
maxHeight?: number;
|
|
96
|
+
maxWidth?: number;
|
|
97
|
+
minHeight?: number;
|
|
98
|
+
minWidth?: number;
|
|
99
|
+
top?: number;
|
|
100
|
+
left?: number;
|
|
101
|
+
windowClass?: string | string[];
|
|
102
|
+
}
|
|
103
|
+
declare const setWindowStyles: (element: HTMLElement, settings: WindowStyleSettings) => void;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Converts a number or a string into a CSS-compliant value.
|
|
107
|
+
* - If the input is a number (e.g., 100), it appends 'px'.
|
|
108
|
+
* - If the input is a numeric string (e.g., "100"), it appends 'px'.
|
|
109
|
+
* - If the input is a string with a unit (e.g., "100px", "10rem"), it returns it as is.
|
|
110
|
+
*
|
|
111
|
+
* @param value The number or string to convert.
|
|
112
|
+
* @returns A CSS-compliant string value.
|
|
113
|
+
*/
|
|
114
|
+
declare const toCssValue: (value: number | string | undefined | null) => string;
|
|
115
|
+
|
|
116
|
+
declare enum NavigationKeys {
|
|
117
|
+
ArrowUp = "ArrowUp",
|
|
118
|
+
ArrowDown = "ArrowDown",
|
|
119
|
+
ArrowLeft = "ArrowLeft",
|
|
120
|
+
ArrowRight = "ArrowRight",
|
|
121
|
+
Enter = "Enter",
|
|
122
|
+
Escape = "Escape",
|
|
123
|
+
Home = "Home",
|
|
124
|
+
End = "End",
|
|
125
|
+
PageDown = "PageDown",
|
|
126
|
+
PageUp = "PageUp",
|
|
127
|
+
Space = " "
|
|
128
|
+
}
|
|
129
|
+
declare const NavigationKeysList: string[];
|
|
130
|
+
declare const isNavigationKey: (key: string) => boolean;
|
|
131
|
+
|
|
132
|
+
declare const isTypeaheadKey: (key: string) => boolean;
|
|
133
|
+
declare const setupTypeahead: (typeaheadKey$: Observable<string>) => Observable<string>;
|
|
134
|
+
|
|
135
|
+
export { AttributeBinderDirective, NavigationKeys, NavigationKeysList, createElementControlId, focusElement, hex2rgba, hsla2hsva, hsva2rgba, isNavigationKey, isTypeaheadKey, isValidHex, isValidHsla, isValidRgb, restoreOverlayScroll, rgba2hex, rgba2hsla, rgba2hsva, rxFromResize, rxTimeout, setWindowStyles, setupTypeahead, string2Hsla, string2rgba, toCssValue };
|
|
136
|
+
export type { Action, AttributeConfig, Channel, ColorScheme, HSL, HSLA, HSV, HSVA, HSVChannel, RGB, RGBA, RGBAChannel, RGBChannel, VariantInputs, WindowStyleSettings };
|