@memberjunction/ng-trees 0.0.1 → 3.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/dist/lib/events/tree-events.d.ts +267 -0
- package/dist/lib/events/tree-events.d.ts.map +1 -0
- package/dist/lib/events/tree-events.js +383 -0
- package/dist/lib/events/tree-events.js.map +1 -0
- package/dist/lib/models/tree-types.d.ts +254 -0
- package/dist/lib/models/tree-types.d.ts.map +1 -0
- package/dist/lib/models/tree-types.js +57 -0
- package/dist/lib/models/tree-types.js.map +1 -0
- package/dist/lib/ng-trees.module.d.ts +16 -0
- package/dist/lib/ng-trees.module.d.ts.map +1 -0
- package/dist/lib/ng-trees.module.js +47 -0
- package/dist/lib/ng-trees.module.js.map +1 -0
- package/dist/lib/tree/tree.component.d.ts +353 -0
- package/dist/lib/tree/tree.component.d.ts.map +1 -0
- package/dist/lib/tree/tree.component.js +1695 -0
- package/dist/lib/tree/tree.component.js.map +1 -0
- package/dist/lib/tree-dropdown/tree-dropdown.component.d.ts +295 -0
- package/dist/lib/tree-dropdown/tree-dropdown.component.d.ts.map +1 -0
- package/dist/lib/tree-dropdown/tree-dropdown.component.js +1012 -0
- package/dist/lib/tree-dropdown/tree-dropdown.component.js.map +1 -0
- package/dist/public-api.d.ts +9 -0
- package/dist/public-api.d.ts.map +1 -0
- package/dist/public-api.js +16 -0
- package/dist/public-api.js.map +1 -0
- package/package.json +40 -6
- package/README.md +0 -45
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tree Event System for @memberjunction/ng-trees
|
|
3
|
+
*
|
|
4
|
+
* Follows the Before/After cancelable event pattern from entity-data-grid.
|
|
5
|
+
* Before events can be canceled, After events are informational.
|
|
6
|
+
*/
|
|
7
|
+
import { TreeNode, TreeBranchConfig, TreeLeafConfig } from '../models/tree-types';
|
|
8
|
+
export type TreeComponentRef = unknown;
|
|
9
|
+
/**
|
|
10
|
+
* Base class for all tree events
|
|
11
|
+
*/
|
|
12
|
+
export declare class TreeEventArgs {
|
|
13
|
+
/** The tree component that raised the event */
|
|
14
|
+
readonly Tree: TreeComponentRef;
|
|
15
|
+
/** Timestamp when event was raised */
|
|
16
|
+
readonly Timestamp: Date;
|
|
17
|
+
constructor(tree: TreeComponentRef);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Base class for cancelable events (Before events)
|
|
21
|
+
*/
|
|
22
|
+
export declare class CancelableTreeEventArgs extends TreeEventArgs {
|
|
23
|
+
/** Set to true to cancel the operation */
|
|
24
|
+
Cancel: boolean;
|
|
25
|
+
/** Optional reason for cancellation (for logging/debugging) */
|
|
26
|
+
CancelReason?: string;
|
|
27
|
+
constructor(tree: TreeComponentRef);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Base class for node-related events
|
|
31
|
+
*/
|
|
32
|
+
export declare class NodeEventArgs extends TreeEventArgs {
|
|
33
|
+
/** The node involved in the event */
|
|
34
|
+
readonly Node: TreeNode;
|
|
35
|
+
constructor(tree: TreeComponentRef, node: TreeNode);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Base class for cancelable node events
|
|
39
|
+
*/
|
|
40
|
+
export declare class CancelableNodeEventArgs extends NodeEventArgs {
|
|
41
|
+
/** Set to true to cancel the operation */
|
|
42
|
+
Cancel: boolean;
|
|
43
|
+
/** Optional reason for cancellation */
|
|
44
|
+
CancelReason?: string;
|
|
45
|
+
constructor(tree: TreeComponentRef, node: TreeNode);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Fired before a node is selected - can be canceled
|
|
49
|
+
*/
|
|
50
|
+
export declare class BeforeNodeSelectEventArgs extends CancelableNodeEventArgs {
|
|
51
|
+
/** Whether this is adding to selection (multi-select) or replacing */
|
|
52
|
+
readonly IsAdditive: boolean;
|
|
53
|
+
/** Current selection before this change */
|
|
54
|
+
readonly CurrentSelection: TreeNode[];
|
|
55
|
+
constructor(tree: TreeComponentRef, node: TreeNode, isAdditive: boolean, currentSelection: TreeNode[]);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Fired after a node is selected
|
|
59
|
+
*/
|
|
60
|
+
export declare class AfterNodeSelectEventArgs extends NodeEventArgs {
|
|
61
|
+
/** Whether this was additive selection */
|
|
62
|
+
readonly WasAdditive: boolean;
|
|
63
|
+
/** New selection state */
|
|
64
|
+
readonly NewSelection: TreeNode[];
|
|
65
|
+
/** Previous selection state */
|
|
66
|
+
readonly PreviousSelection: TreeNode[];
|
|
67
|
+
constructor(tree: TreeComponentRef, node: TreeNode, wasAdditive: boolean, newSelection: TreeNode[], previousSelection: TreeNode[]);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Fired before a node is deselected - can be canceled
|
|
71
|
+
*/
|
|
72
|
+
export declare class BeforeNodeDeselectEventArgs extends CancelableNodeEventArgs {
|
|
73
|
+
/** Current selection before this change */
|
|
74
|
+
readonly CurrentSelection: TreeNode[];
|
|
75
|
+
constructor(tree: TreeComponentRef, node: TreeNode, currentSelection: TreeNode[]);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Fired after a node is deselected
|
|
79
|
+
*/
|
|
80
|
+
export declare class AfterNodeDeselectEventArgs extends NodeEventArgs {
|
|
81
|
+
/** New selection state */
|
|
82
|
+
readonly NewSelection: TreeNode[];
|
|
83
|
+
/** Previous selection state */
|
|
84
|
+
readonly PreviousSelection: TreeNode[];
|
|
85
|
+
constructor(tree: TreeComponentRef, node: TreeNode, newSelection: TreeNode[], previousSelection: TreeNode[]);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Fired before a node is expanded - can be canceled
|
|
89
|
+
*/
|
|
90
|
+
export declare class BeforeNodeExpandEventArgs extends CancelableNodeEventArgs {
|
|
91
|
+
constructor(tree: TreeComponentRef, node: TreeNode);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Fired after a node is expanded
|
|
95
|
+
*/
|
|
96
|
+
export declare class AfterNodeExpandEventArgs extends NodeEventArgs {
|
|
97
|
+
/** Number of visible children after expansion */
|
|
98
|
+
readonly ChildCount: number;
|
|
99
|
+
constructor(tree: TreeComponentRef, node: TreeNode, childCount: number);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Fired before a node is collapsed - can be canceled
|
|
103
|
+
*/
|
|
104
|
+
export declare class BeforeNodeCollapseEventArgs extends CancelableNodeEventArgs {
|
|
105
|
+
constructor(tree: TreeComponentRef, node: TreeNode);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Fired after a node is collapsed
|
|
109
|
+
*/
|
|
110
|
+
export declare class AfterNodeCollapseEventArgs extends NodeEventArgs {
|
|
111
|
+
constructor(tree: TreeComponentRef, node: TreeNode);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Fired before a node click is processed - can be canceled
|
|
115
|
+
*/
|
|
116
|
+
export declare class BeforeNodeClickEventArgs extends CancelableNodeEventArgs {
|
|
117
|
+
/** The mouse event */
|
|
118
|
+
readonly MouseEvent: MouseEvent;
|
|
119
|
+
constructor(tree: TreeComponentRef, node: TreeNode, mouseEvent: MouseEvent);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Fired after a node click
|
|
123
|
+
*/
|
|
124
|
+
export declare class AfterNodeClickEventArgs extends NodeEventArgs {
|
|
125
|
+
/** The mouse event */
|
|
126
|
+
readonly MouseEvent: MouseEvent;
|
|
127
|
+
constructor(tree: TreeComponentRef, node: TreeNode, mouseEvent: MouseEvent);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Fired before a node double-click - can be canceled
|
|
131
|
+
*/
|
|
132
|
+
export declare class BeforeNodeDoubleClickEventArgs extends CancelableNodeEventArgs {
|
|
133
|
+
/** The mouse event */
|
|
134
|
+
readonly MouseEvent: MouseEvent;
|
|
135
|
+
constructor(tree: TreeComponentRef, node: TreeNode, mouseEvent: MouseEvent);
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Fired after a node double-click
|
|
139
|
+
*/
|
|
140
|
+
export declare class AfterNodeDoubleClickEventArgs extends NodeEventArgs {
|
|
141
|
+
/** The mouse event */
|
|
142
|
+
readonly MouseEvent: MouseEvent;
|
|
143
|
+
constructor(tree: TreeComponentRef, node: TreeNode, mouseEvent: MouseEvent);
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Fired before data load - can be canceled or configs modified
|
|
147
|
+
*/
|
|
148
|
+
export declare class BeforeDataLoadEventArgs extends CancelableTreeEventArgs {
|
|
149
|
+
/** The branch configuration that will be used */
|
|
150
|
+
readonly BranchConfig: TreeBranchConfig;
|
|
151
|
+
/** The leaf configuration that will be used (if any) */
|
|
152
|
+
readonly LeafConfig?: TreeLeafConfig;
|
|
153
|
+
/** Set to modify the extra filter for branches */
|
|
154
|
+
ModifiedBranchFilter?: string;
|
|
155
|
+
/** Set to modify the extra filter for leaves */
|
|
156
|
+
ModifiedLeafFilter?: string;
|
|
157
|
+
constructor(tree: TreeComponentRef, branchConfig: TreeBranchConfig, leafConfig?: TreeLeafConfig);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Fired after data load
|
|
161
|
+
*/
|
|
162
|
+
export declare class AfterDataLoadEventArgs extends TreeEventArgs {
|
|
163
|
+
/** Whether the load was successful */
|
|
164
|
+
readonly Success: boolean;
|
|
165
|
+
/** Total number of branch nodes loaded */
|
|
166
|
+
readonly BranchCount: number;
|
|
167
|
+
/** Total number of leaf nodes loaded */
|
|
168
|
+
readonly LeafCount: number;
|
|
169
|
+
/** Total number of all nodes */
|
|
170
|
+
readonly TotalNodes: number;
|
|
171
|
+
/** Time taken to load in milliseconds */
|
|
172
|
+
readonly LoadTimeMs: number;
|
|
173
|
+
/** Error message if load failed */
|
|
174
|
+
readonly Error?: string;
|
|
175
|
+
constructor(tree: TreeComponentRef, success: boolean, branchCount: number, leafCount: number, loadTimeMs: number, error?: string);
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Fired before search is applied - can be canceled or modified
|
|
179
|
+
*/
|
|
180
|
+
export declare class BeforeSearchEventArgs extends CancelableTreeEventArgs {
|
|
181
|
+
/** The search text entered */
|
|
182
|
+
readonly SearchText: string;
|
|
183
|
+
/** Set to modify the search text */
|
|
184
|
+
ModifiedSearchText?: string;
|
|
185
|
+
constructor(tree: TreeComponentRef, searchText: string);
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Fired after search is applied
|
|
189
|
+
*/
|
|
190
|
+
export declare class AfterSearchEventArgs extends TreeEventArgs {
|
|
191
|
+
/** The search text that was used */
|
|
192
|
+
readonly SearchText: string;
|
|
193
|
+
/** Number of nodes matching the search */
|
|
194
|
+
readonly MatchCount: number;
|
|
195
|
+
/** Number of branch nodes matching */
|
|
196
|
+
readonly BranchMatchCount: number;
|
|
197
|
+
/** Number of leaf nodes matching */
|
|
198
|
+
readonly LeafMatchCount: number;
|
|
199
|
+
/** The matching nodes */
|
|
200
|
+
readonly MatchedNodes: TreeNode[];
|
|
201
|
+
constructor(tree: TreeComponentRef, searchText: string, matchedNodes: TreeNode[]);
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Fired when search is cleared
|
|
205
|
+
*/
|
|
206
|
+
export declare class SearchClearedEventArgs extends TreeEventArgs {
|
|
207
|
+
/** The previous search text */
|
|
208
|
+
readonly PreviousSearchText: string;
|
|
209
|
+
constructor(tree: TreeComponentRef, previousSearchText: string);
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Fired before dropdown opens - can be canceled
|
|
213
|
+
*/
|
|
214
|
+
export declare class BeforeDropdownOpenEventArgs extends CancelableTreeEventArgs {
|
|
215
|
+
constructor(tree: TreeComponentRef);
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Fired after dropdown opens
|
|
219
|
+
*/
|
|
220
|
+
export declare class AfterDropdownOpenEventArgs extends TreeEventArgs {
|
|
221
|
+
/** The position where dropdown was rendered */
|
|
222
|
+
readonly Position: 'above' | 'below';
|
|
223
|
+
constructor(tree: TreeComponentRef, position: 'above' | 'below');
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Fired before dropdown closes - can be canceled
|
|
227
|
+
*/
|
|
228
|
+
export declare class BeforeDropdownCloseEventArgs extends CancelableTreeEventArgs {
|
|
229
|
+
/** Reason for closing */
|
|
230
|
+
readonly Reason: 'selection' | 'escape' | 'outsideClick' | 'programmatic';
|
|
231
|
+
constructor(tree: TreeComponentRef, reason: 'selection' | 'escape' | 'outsideClick' | 'programmatic');
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Fired after dropdown closes
|
|
235
|
+
*/
|
|
236
|
+
export declare class AfterDropdownCloseEventArgs extends TreeEventArgs {
|
|
237
|
+
/** Reason dropdown was closed */
|
|
238
|
+
readonly Reason: 'selection' | 'escape' | 'outsideClick' | 'programmatic';
|
|
239
|
+
constructor(tree: TreeComponentRef, reason: 'selection' | 'escape' | 'outsideClick' | 'programmatic');
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Fired before keyboard navigation - can be canceled
|
|
243
|
+
*/
|
|
244
|
+
export declare class BeforeKeyboardNavigateEventArgs extends CancelableTreeEventArgs {
|
|
245
|
+
/** The keyboard event */
|
|
246
|
+
readonly KeyboardEvent: KeyboardEvent;
|
|
247
|
+
/** The key that was pressed */
|
|
248
|
+
readonly Key: string;
|
|
249
|
+
/** The currently focused node (if any) */
|
|
250
|
+
readonly CurrentNode: TreeNode | null;
|
|
251
|
+
/** The node that will be focused */
|
|
252
|
+
readonly TargetNode: TreeNode | null;
|
|
253
|
+
constructor(tree: TreeComponentRef, keyboardEvent: KeyboardEvent, currentNode: TreeNode | null, targetNode: TreeNode | null);
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Fired after keyboard navigation
|
|
257
|
+
*/
|
|
258
|
+
export declare class AfterKeyboardNavigateEventArgs extends TreeEventArgs {
|
|
259
|
+
/** The key that was pressed */
|
|
260
|
+
readonly Key: string;
|
|
261
|
+
/** The previously focused node */
|
|
262
|
+
readonly PreviousNode: TreeNode | null;
|
|
263
|
+
/** The newly focused node */
|
|
264
|
+
readonly CurrentNode: TreeNode | null;
|
|
265
|
+
constructor(tree: TreeComponentRef, key: string, previousNode: TreeNode | null, currentNode: TreeNode | null);
|
|
266
|
+
}
|
|
267
|
+
//# sourceMappingURL=tree-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-events.d.ts","sourceRoot":"","sources":["../../../src/lib/events/tree-events.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGlF,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC;AAMvC;;GAEG;AACH,qBAAa,aAAa;IACtB,+CAA+C;IAC/C,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAEhC,sCAAsC;IACtC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;gBAEb,IAAI,EAAE,gBAAgB;CAIrC;AAED;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,aAAa;IACtD,0CAA0C;IAC1C,MAAM,EAAE,OAAO,CAAS;IAExB,+DAA+D;IAC/D,YAAY,CAAC,EAAE,MAAM,CAAC;gBAEV,IAAI,EAAE,gBAAgB;CAGrC;AAED;;GAEG;AACH,qBAAa,aAAc,SAAQ,aAAa;IAC5C,qCAAqC;IACrC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;gBAEZ,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ;CAIrD;AAED;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,aAAa;IACtD,0CAA0C;IAC1C,MAAM,EAAE,OAAO,CAAS;IAExB,uCAAuC;IACvC,YAAY,CAAC,EAAE,MAAM,CAAC;gBAEV,IAAI,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AAG,cAAc,GAAG,cAAc,CAAC;gBAE9D,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,WAAW,GAAG,QAAQ,GAAG,cAAc,GAAG,cAAc;CAIvG;AAMD;;GAEG;AACH,qBAAa,+BAAgC,SAAQ,uBAAuB;IACxE,yBAAyB;IACzB,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IAEtC,+BAA+B;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB,0CAA0C;IAC1C,QAAQ,CAAC,WAAW,EAAE,QAAQ,GAAG,IAAI,CAAC;IAEtC,oCAAoC;IACpC,QAAQ,CAAC,UAAU,EAAE,QAAQ,GAAG,IAAI,CAAC;gBAGjC,IAAI,EAAE,gBAAgB,EACtB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,QAAQ,GAAG,IAAI,EAC5B,UAAU,EAAE,QAAQ,GAAG,IAAI;CAQlC;AAED;;GAEG;AACH,qBAAa,8BAA+B,SAAQ,aAAa;IAC7D,+BAA+B;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB,kCAAkC;IAClC,QAAQ,CAAC,YAAY,EAAE,QAAQ,GAAG,IAAI,CAAC;IAEvC,6BAA6B;IAC7B,QAAQ,CAAC,WAAW,EAAE,QAAQ,GAAG,IAAI,CAAC;gBAGlC,IAAI,EAAE,gBAAgB,EACtB,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,QAAQ,GAAG,IAAI,EAC7B,WAAW,EAAE,QAAQ,GAAG,IAAI;CAOnC"}
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tree Event System for @memberjunction/ng-trees
|
|
3
|
+
*
|
|
4
|
+
* Follows the Before/After cancelable event pattern from entity-data-grid.
|
|
5
|
+
* Before events can be canceled, After events are informational.
|
|
6
|
+
*/
|
|
7
|
+
// ========================================
|
|
8
|
+
// Base Event Classes
|
|
9
|
+
// ========================================
|
|
10
|
+
/**
|
|
11
|
+
* Base class for all tree events
|
|
12
|
+
*/
|
|
13
|
+
export class TreeEventArgs {
|
|
14
|
+
/** The tree component that raised the event */
|
|
15
|
+
Tree;
|
|
16
|
+
/** Timestamp when event was raised */
|
|
17
|
+
Timestamp;
|
|
18
|
+
constructor(tree) {
|
|
19
|
+
this.Tree = tree;
|
|
20
|
+
this.Timestamp = new Date();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Base class for cancelable events (Before events)
|
|
25
|
+
*/
|
|
26
|
+
export class CancelableTreeEventArgs extends TreeEventArgs {
|
|
27
|
+
/** Set to true to cancel the operation */
|
|
28
|
+
Cancel = false;
|
|
29
|
+
/** Optional reason for cancellation (for logging/debugging) */
|
|
30
|
+
CancelReason;
|
|
31
|
+
constructor(tree) {
|
|
32
|
+
super(tree);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Base class for node-related events
|
|
37
|
+
*/
|
|
38
|
+
export class NodeEventArgs extends TreeEventArgs {
|
|
39
|
+
/** The node involved in the event */
|
|
40
|
+
Node;
|
|
41
|
+
constructor(tree, node) {
|
|
42
|
+
super(tree);
|
|
43
|
+
this.Node = node;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Base class for cancelable node events
|
|
48
|
+
*/
|
|
49
|
+
export class CancelableNodeEventArgs extends NodeEventArgs {
|
|
50
|
+
/** Set to true to cancel the operation */
|
|
51
|
+
Cancel = false;
|
|
52
|
+
/** Optional reason for cancellation */
|
|
53
|
+
CancelReason;
|
|
54
|
+
constructor(tree, node) {
|
|
55
|
+
super(tree, node);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// ========================================
|
|
59
|
+
// Node Selection Events
|
|
60
|
+
// ========================================
|
|
61
|
+
/**
|
|
62
|
+
* Fired before a node is selected - can be canceled
|
|
63
|
+
*/
|
|
64
|
+
export class BeforeNodeSelectEventArgs extends CancelableNodeEventArgs {
|
|
65
|
+
/** Whether this is adding to selection (multi-select) or replacing */
|
|
66
|
+
IsAdditive;
|
|
67
|
+
/** Current selection before this change */
|
|
68
|
+
CurrentSelection;
|
|
69
|
+
constructor(tree, node, isAdditive, currentSelection) {
|
|
70
|
+
super(tree, node);
|
|
71
|
+
this.IsAdditive = isAdditive;
|
|
72
|
+
this.CurrentSelection = [...currentSelection];
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Fired after a node is selected
|
|
77
|
+
*/
|
|
78
|
+
export class AfterNodeSelectEventArgs extends NodeEventArgs {
|
|
79
|
+
/** Whether this was additive selection */
|
|
80
|
+
WasAdditive;
|
|
81
|
+
/** New selection state */
|
|
82
|
+
NewSelection;
|
|
83
|
+
/** Previous selection state */
|
|
84
|
+
PreviousSelection;
|
|
85
|
+
constructor(tree, node, wasAdditive, newSelection, previousSelection) {
|
|
86
|
+
super(tree, node);
|
|
87
|
+
this.WasAdditive = wasAdditive;
|
|
88
|
+
this.NewSelection = [...newSelection];
|
|
89
|
+
this.PreviousSelection = [...previousSelection];
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Fired before a node is deselected - can be canceled
|
|
94
|
+
*/
|
|
95
|
+
export class BeforeNodeDeselectEventArgs extends CancelableNodeEventArgs {
|
|
96
|
+
/** Current selection before this change */
|
|
97
|
+
CurrentSelection;
|
|
98
|
+
constructor(tree, node, currentSelection) {
|
|
99
|
+
super(tree, node);
|
|
100
|
+
this.CurrentSelection = [...currentSelection];
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Fired after a node is deselected
|
|
105
|
+
*/
|
|
106
|
+
export class AfterNodeDeselectEventArgs extends NodeEventArgs {
|
|
107
|
+
/** New selection state */
|
|
108
|
+
NewSelection;
|
|
109
|
+
/** Previous selection state */
|
|
110
|
+
PreviousSelection;
|
|
111
|
+
constructor(tree, node, newSelection, previousSelection) {
|
|
112
|
+
super(tree, node);
|
|
113
|
+
this.NewSelection = [...newSelection];
|
|
114
|
+
this.PreviousSelection = [...previousSelection];
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
// ========================================
|
|
118
|
+
// Node Expand/Collapse Events
|
|
119
|
+
// ========================================
|
|
120
|
+
/**
|
|
121
|
+
* Fired before a node is expanded - can be canceled
|
|
122
|
+
*/
|
|
123
|
+
export class BeforeNodeExpandEventArgs extends CancelableNodeEventArgs {
|
|
124
|
+
constructor(tree, node) {
|
|
125
|
+
super(tree, node);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Fired after a node is expanded
|
|
130
|
+
*/
|
|
131
|
+
export class AfterNodeExpandEventArgs extends NodeEventArgs {
|
|
132
|
+
/** Number of visible children after expansion */
|
|
133
|
+
ChildCount;
|
|
134
|
+
constructor(tree, node, childCount) {
|
|
135
|
+
super(tree, node);
|
|
136
|
+
this.ChildCount = childCount;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Fired before a node is collapsed - can be canceled
|
|
141
|
+
*/
|
|
142
|
+
export class BeforeNodeCollapseEventArgs extends CancelableNodeEventArgs {
|
|
143
|
+
constructor(tree, node) {
|
|
144
|
+
super(tree, node);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Fired after a node is collapsed
|
|
149
|
+
*/
|
|
150
|
+
export class AfterNodeCollapseEventArgs extends NodeEventArgs {
|
|
151
|
+
constructor(tree, node) {
|
|
152
|
+
super(tree, node);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
// ========================================
|
|
156
|
+
// Node Click Events
|
|
157
|
+
// ========================================
|
|
158
|
+
/**
|
|
159
|
+
* Fired before a node click is processed - can be canceled
|
|
160
|
+
*/
|
|
161
|
+
export class BeforeNodeClickEventArgs extends CancelableNodeEventArgs {
|
|
162
|
+
/** The mouse event */
|
|
163
|
+
MouseEvent;
|
|
164
|
+
constructor(tree, node, mouseEvent) {
|
|
165
|
+
super(tree, node);
|
|
166
|
+
this.MouseEvent = mouseEvent;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Fired after a node click
|
|
171
|
+
*/
|
|
172
|
+
export class AfterNodeClickEventArgs extends NodeEventArgs {
|
|
173
|
+
/** The mouse event */
|
|
174
|
+
MouseEvent;
|
|
175
|
+
constructor(tree, node, mouseEvent) {
|
|
176
|
+
super(tree, node);
|
|
177
|
+
this.MouseEvent = mouseEvent;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Fired before a node double-click - can be canceled
|
|
182
|
+
*/
|
|
183
|
+
export class BeforeNodeDoubleClickEventArgs extends CancelableNodeEventArgs {
|
|
184
|
+
/** The mouse event */
|
|
185
|
+
MouseEvent;
|
|
186
|
+
constructor(tree, node, mouseEvent) {
|
|
187
|
+
super(tree, node);
|
|
188
|
+
this.MouseEvent = mouseEvent;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Fired after a node double-click
|
|
193
|
+
*/
|
|
194
|
+
export class AfterNodeDoubleClickEventArgs extends NodeEventArgs {
|
|
195
|
+
/** The mouse event */
|
|
196
|
+
MouseEvent;
|
|
197
|
+
constructor(tree, node, mouseEvent) {
|
|
198
|
+
super(tree, node);
|
|
199
|
+
this.MouseEvent = mouseEvent;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
// ========================================
|
|
203
|
+
// Data Loading Events
|
|
204
|
+
// ========================================
|
|
205
|
+
/**
|
|
206
|
+
* Fired before data load - can be canceled or configs modified
|
|
207
|
+
*/
|
|
208
|
+
export class BeforeDataLoadEventArgs extends CancelableTreeEventArgs {
|
|
209
|
+
/** The branch configuration that will be used */
|
|
210
|
+
BranchConfig;
|
|
211
|
+
/** The leaf configuration that will be used (if any) */
|
|
212
|
+
LeafConfig;
|
|
213
|
+
/** Set to modify the extra filter for branches */
|
|
214
|
+
ModifiedBranchFilter;
|
|
215
|
+
/** Set to modify the extra filter for leaves */
|
|
216
|
+
ModifiedLeafFilter;
|
|
217
|
+
constructor(tree, branchConfig, leafConfig) {
|
|
218
|
+
super(tree);
|
|
219
|
+
this.BranchConfig = { ...branchConfig };
|
|
220
|
+
this.LeafConfig = leafConfig ? { ...leafConfig } : undefined;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Fired after data load
|
|
225
|
+
*/
|
|
226
|
+
export class AfterDataLoadEventArgs extends TreeEventArgs {
|
|
227
|
+
/** Whether the load was successful */
|
|
228
|
+
Success;
|
|
229
|
+
/** Total number of branch nodes loaded */
|
|
230
|
+
BranchCount;
|
|
231
|
+
/** Total number of leaf nodes loaded */
|
|
232
|
+
LeafCount;
|
|
233
|
+
/** Total number of all nodes */
|
|
234
|
+
TotalNodes;
|
|
235
|
+
/** Time taken to load in milliseconds */
|
|
236
|
+
LoadTimeMs;
|
|
237
|
+
/** Error message if load failed */
|
|
238
|
+
Error;
|
|
239
|
+
constructor(tree, success, branchCount, leafCount, loadTimeMs, error) {
|
|
240
|
+
super(tree);
|
|
241
|
+
this.Success = success;
|
|
242
|
+
this.BranchCount = branchCount;
|
|
243
|
+
this.LeafCount = leafCount;
|
|
244
|
+
this.TotalNodes = branchCount + leafCount;
|
|
245
|
+
this.LoadTimeMs = loadTimeMs;
|
|
246
|
+
this.Error = error;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
// ========================================
|
|
250
|
+
// Search Events
|
|
251
|
+
// ========================================
|
|
252
|
+
/**
|
|
253
|
+
* Fired before search is applied - can be canceled or modified
|
|
254
|
+
*/
|
|
255
|
+
export class BeforeSearchEventArgs extends CancelableTreeEventArgs {
|
|
256
|
+
/** The search text entered */
|
|
257
|
+
SearchText;
|
|
258
|
+
/** Set to modify the search text */
|
|
259
|
+
ModifiedSearchText;
|
|
260
|
+
constructor(tree, searchText) {
|
|
261
|
+
super(tree);
|
|
262
|
+
this.SearchText = searchText;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Fired after search is applied
|
|
267
|
+
*/
|
|
268
|
+
export class AfterSearchEventArgs extends TreeEventArgs {
|
|
269
|
+
/** The search text that was used */
|
|
270
|
+
SearchText;
|
|
271
|
+
/** Number of nodes matching the search */
|
|
272
|
+
MatchCount;
|
|
273
|
+
/** Number of branch nodes matching */
|
|
274
|
+
BranchMatchCount;
|
|
275
|
+
/** Number of leaf nodes matching */
|
|
276
|
+
LeafMatchCount;
|
|
277
|
+
/** The matching nodes */
|
|
278
|
+
MatchedNodes;
|
|
279
|
+
constructor(tree, searchText, matchedNodes) {
|
|
280
|
+
super(tree);
|
|
281
|
+
this.SearchText = searchText;
|
|
282
|
+
this.MatchedNodes = [...matchedNodes];
|
|
283
|
+
this.MatchCount = matchedNodes.length;
|
|
284
|
+
this.BranchMatchCount = matchedNodes.filter(n => n.Type === 'branch').length;
|
|
285
|
+
this.LeafMatchCount = matchedNodes.filter(n => n.Type === 'leaf').length;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Fired when search is cleared
|
|
290
|
+
*/
|
|
291
|
+
export class SearchClearedEventArgs extends TreeEventArgs {
|
|
292
|
+
/** The previous search text */
|
|
293
|
+
PreviousSearchText;
|
|
294
|
+
constructor(tree, previousSearchText) {
|
|
295
|
+
super(tree);
|
|
296
|
+
this.PreviousSearchText = previousSearchText;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
// ========================================
|
|
300
|
+
// Dropdown Events
|
|
301
|
+
// ========================================
|
|
302
|
+
/**
|
|
303
|
+
* Fired before dropdown opens - can be canceled
|
|
304
|
+
*/
|
|
305
|
+
export class BeforeDropdownOpenEventArgs extends CancelableTreeEventArgs {
|
|
306
|
+
constructor(tree) {
|
|
307
|
+
super(tree);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Fired after dropdown opens
|
|
312
|
+
*/
|
|
313
|
+
export class AfterDropdownOpenEventArgs extends TreeEventArgs {
|
|
314
|
+
/** The position where dropdown was rendered */
|
|
315
|
+
Position;
|
|
316
|
+
constructor(tree, position) {
|
|
317
|
+
super(tree);
|
|
318
|
+
this.Position = position;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Fired before dropdown closes - can be canceled
|
|
323
|
+
*/
|
|
324
|
+
export class BeforeDropdownCloseEventArgs extends CancelableTreeEventArgs {
|
|
325
|
+
/** Reason for closing */
|
|
326
|
+
Reason;
|
|
327
|
+
constructor(tree, reason) {
|
|
328
|
+
super(tree);
|
|
329
|
+
this.Reason = reason;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Fired after dropdown closes
|
|
334
|
+
*/
|
|
335
|
+
export class AfterDropdownCloseEventArgs extends TreeEventArgs {
|
|
336
|
+
/** Reason dropdown was closed */
|
|
337
|
+
Reason;
|
|
338
|
+
constructor(tree, reason) {
|
|
339
|
+
super(tree);
|
|
340
|
+
this.Reason = reason;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
// ========================================
|
|
344
|
+
// Keyboard Navigation Events
|
|
345
|
+
// ========================================
|
|
346
|
+
/**
|
|
347
|
+
* Fired before keyboard navigation - can be canceled
|
|
348
|
+
*/
|
|
349
|
+
export class BeforeKeyboardNavigateEventArgs extends CancelableTreeEventArgs {
|
|
350
|
+
/** The keyboard event */
|
|
351
|
+
KeyboardEvent;
|
|
352
|
+
/** The key that was pressed */
|
|
353
|
+
Key;
|
|
354
|
+
/** The currently focused node (if any) */
|
|
355
|
+
CurrentNode;
|
|
356
|
+
/** The node that will be focused */
|
|
357
|
+
TargetNode;
|
|
358
|
+
constructor(tree, keyboardEvent, currentNode, targetNode) {
|
|
359
|
+
super(tree);
|
|
360
|
+
this.KeyboardEvent = keyboardEvent;
|
|
361
|
+
this.Key = keyboardEvent.key;
|
|
362
|
+
this.CurrentNode = currentNode;
|
|
363
|
+
this.TargetNode = targetNode;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Fired after keyboard navigation
|
|
368
|
+
*/
|
|
369
|
+
export class AfterKeyboardNavigateEventArgs extends TreeEventArgs {
|
|
370
|
+
/** The key that was pressed */
|
|
371
|
+
Key;
|
|
372
|
+
/** The previously focused node */
|
|
373
|
+
PreviousNode;
|
|
374
|
+
/** The newly focused node */
|
|
375
|
+
CurrentNode;
|
|
376
|
+
constructor(tree, key, previousNode, currentNode) {
|
|
377
|
+
super(tree);
|
|
378
|
+
this.Key = key;
|
|
379
|
+
this.PreviousNode = previousNode;
|
|
380
|
+
this.CurrentNode = currentNode;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
//# sourceMappingURL=tree-events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree-events.js","sourceRoot":"","sources":["../../../src/lib/events/tree-events.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,2CAA2C;AAC3C,qBAAqB;AACrB,2CAA2C;AAE3C;;GAEG;AACH,MAAM,OAAO,aAAa;IACtB,+CAA+C;IACtC,IAAI,CAAmB;IAEhC,sCAAsC;IAC7B,SAAS,CAAO;IAEzB,YAAY,IAAsB;QAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;IAChC,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,aAAa;IACtD,0CAA0C;IAC1C,MAAM,GAAY,KAAK,CAAC;IAExB,+DAA+D;IAC/D,YAAY,CAAU;IAEtB,YAAY,IAAsB;QAC9B,KAAK,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,aAAa;IAC5C,qCAAqC;IAC5B,IAAI,CAA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