@mescius/wijmo.nav 5.20232.939

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/index.d.ts ADDED
@@ -0,0 +1,1413 @@
1
+ /*!
2
+ *
3
+ * Wijmo Library 5.20232.939
4
+ * https://developer.mescius.com/wijmo
5
+ *
6
+ * Copyright(c) MESCIUS inc. All rights reserved.
7
+ *
8
+ * Licensed under the End-User License Agreement For MESCIUS Wijmo Software.
9
+ * us.sales@mescius.com
10
+ * https://developer.mescius.com/wijmo/licensing
11
+ *
12
+ */
13
+ /**
14
+ * {@module wijmo.nav}
15
+ * Defines navigation controls including the #see:TabPanel, {@link TreeView},
16
+ * and associated classes.
17
+ */
18
+ /**
19
+ *
20
+ */
21
+ export declare var ___keepComment: any;
22
+ import { Binding, EventArgs, CancelEventArgs, Control, Event, ObservableArray } from '@grapecity/wijmo';
23
+ import * as selfModule from '@grapecity/wijmo.nav';
24
+ /**
25
+ * The {@link TabPanel} enables content organization at a high level,
26
+ * such as switching between views, data sets, or functional aspects
27
+ * of an application.
28
+ *
29
+ * Tabs are presented as a single row above their associated content.
30
+ * Tab headers succinctly describe the content within.
31
+ *
32
+ * Tabs can be selected with the mouse or keyboard, and automatically
33
+ * update the content to reflect the current selection.
34
+ *
35
+ * The example below shows how you can use a {@link TabPanel} to organize
36
+ * content into pages:
37
+ *
38
+ * {@sample Nav/TabPanel/Overview Example}
39
+ */
40
+ export declare class TabPanel extends Control {
41
+ private _tabs;
42
+ private _selectedIndex;
43
+ private _toAnim;
44
+ private _eAnim;
45
+ private _animated;
46
+ private _autoSwitch;
47
+ private _dRoot;
48
+ private _dTabHeaders;
49
+ private _dTabPanes;
50
+ /**
51
+ * Gets or sets the template used to instantiate {@link TabPanel} controls.
52
+ */
53
+ static controlTemplate: string;
54
+ /**
55
+ * Initializes a new instance of the {@link TabPanel} class.
56
+ *
57
+ * @param element The DOM element that hosts the control, or a CSS selector for the host element (e.g. '#theCtrl').
58
+ * @param options The JavaScript object containing initialization data for the control.
59
+ * @param keepChildren Whether to keep child elements. If set to true, the caller becomes responsible for
60
+ * populating the {@link tabs} array based on the DOM).
61
+ */
62
+ constructor(element: any, options?: any, keepChildren?: boolean, removeChildren?: boolean);
63
+ /**
64
+ * Gets an array of {@link Tab} objects whose {@link Tab.header} and
65
+ * {@link Tab.pane} properties determine the content of the
66
+ * {@link TabPanel} control.
67
+ */
68
+ readonly tabs: ObservableArray<Tab>;
69
+ /**
70
+ * Gets or sets the index of the currently selected (active) tab.
71
+ */
72
+ selectedIndex: number;
73
+ /**
74
+ * Gets or sets the {@link Tab} object that is currently selected.
75
+ */
76
+ selectedTab: Tab;
77
+ /**
78
+ * Gets or sets a value that determines whether tab changes should be animated
79
+ * with a fade-in effect.
80
+ *
81
+ * The default value for this property is **true**.
82
+ */
83
+ isAnimated: boolean;
84
+ /**
85
+ * Gets or sets a value that determines whether the control should switch
86
+ * tabs automatically when the user selects a tab using the arrow keys.
87
+ *
88
+ * The default value for this property is **true**, which causes the
89
+ * control to switch tabs when the user presses the arrow keys.
90
+ * In this mode, the Tab key selects the next element in the tab sequence,
91
+ * which excludes non-selected tab headers.
92
+ *
93
+ * When {@link autoSwitch} is set to **false**, pressing the arrow keys
94
+ * or the Tab key moves the focus to the next or previous tab header,
95
+ * but does not switch tabs. Pressing the **Enter** or **Space** keys
96
+ * is required to activate the tab that has the focus.
97
+ *
98
+ * In most cases, the default value provides adequate (accessible)
99
+ * behavior, but some users may prefer to set {@link autoSwitch} to false.
100
+ * For a more detailed discussion of this topic, please see the
101
+ * <a href="https://www.w3.org/TR/wai-aria-practices/#kbd_selection_follows_focus" target="_blank">W3C ARIA practices</a>
102
+ * and
103
+ * <a href="http://simplyaccessible.com/article/danger-aria-tabs/" target="_blank">SimplyAccessible</a> articles.
104
+ */
105
+ autoSwitch: boolean;
106
+ /**
107
+ * Gets a {@link Tab} by id or by header content.
108
+ *
109
+ * @param id Id of the {@link Tab} to retrieve.
110
+ */
111
+ getTab(id: string): Tab;
112
+ /**
113
+ * Occurs when the value of the {@link selectedIndex} property changes.
114
+ */
115
+ readonly selectedIndexChanged: Event<TabPanel, EventArgs>;
116
+ /**
117
+ * Raises the {@link selectedIndexChanged} event.
118
+ */
119
+ onSelectedIndexChanged(e?: EventArgs): void;
120
+ _populateControl(): void;
121
+ _validateSelection(): void;
122
+ private _updateContent;
123
+ private _removeChildren;
124
+ private _click;
125
+ private _keydown;
126
+ private _getTabIndex;
127
+ private _getNextIndex;
128
+ _setIsDisabled(value: boolean): void;
129
+ _setTabOrder(value: number): void;
130
+ _updateTabIndex(): void;
131
+ }
132
+ /**
133
+ * Represents a tab within a {@link TabPanel} control.
134
+ *
135
+ * Tabs have two elements: a header and a pane. The header displays
136
+ * the tab title and the pane represents the tab content.
137
+ */
138
+ export declare class Tab {
139
+ private _hdr;
140
+ private _pane;
141
+ private _p;
142
+ /**
143
+ * Initializes a new instance of the {@link Tab} class.
144
+ *
145
+ * @param header Element or CSS selector for the element that contains the Tab header.
146
+ * @param pane Element or CSS selector for the element that contains the Tab content.
147
+ */
148
+ constructor(header: any, pane: any);
149
+ /**
150
+ * Gets a reference to the {@link TabPanel} that contains this Tab.
151
+ */
152
+ readonly tabPanel: TabPanel;
153
+ /**
154
+ * Gets the tab's header element.
155
+ */
156
+ readonly header: HTMLElement;
157
+ /**
158
+ * Gets the tab's content element.
159
+ */
160
+ readonly pane: HTMLElement;
161
+ /**
162
+ * Gets or sets a value that determines whether this {@link Tab} is disabled.
163
+ */
164
+ isDisabled: boolean;
165
+ /**
166
+ * Gets or sets a value that determines whether this {@link Tab} is visible.
167
+ */
168
+ isVisible: boolean;
169
+ _setParts(header: HTMLElement, pane: HTMLElement): void;
170
+ _setPanel(panel: TabPanel): void;
171
+ }
172
+ /**
173
+ * The {@link Accordion} control is a vertically stacked set of
174
+ * interactive headings that each contain a title.
175
+ *
176
+ * The headings function as controls that enable users to reveal
177
+ * or hide their associated sections of content.
178
+ *
179
+ * Accordions are commonly used to reduce the need to scroll when
180
+ * presenting multiple sections of content on a single page.
181
+ */
182
+ export declare class Accordion extends Control {
183
+ private _panes;
184
+ private _selectedIndex;
185
+ private _animated;
186
+ private _autoSwitch;
187
+ private _alCollapseAll;
188
+ private _alExpandMany;
189
+ private _autoSwitching;
190
+ private _hidePane;
191
+ /**
192
+ * Initializes a new instance of the {@link Accordion} class.
193
+ *
194
+ * @param element The DOM element that hosts the control, or a CSS selector for the host element (e.g. '#theCtrl').
195
+ * @param options The JavaScript object containing initialization data for the control.
196
+ * @param keepChildren Whether to keep child elements. If set to true, the caller becomes responsible for
197
+ * populating the {@link tabs} array based on the DOM).
198
+ */
199
+ constructor(element: any, options?: any, keepChildren?: boolean);
200
+ /**
201
+ * Gets an array of {@link AccordionPane} objects whose {@link AccordionPane.header} and
202
+ * {@link AccordionPane.content} properties determine the content of the
203
+ * {@link Accordion} control.
204
+ */
205
+ readonly panes: ObservableArray<AccordionPane>;
206
+ /**
207
+ * Gets or sets the index of the currently selected (active) pane.
208
+ */
209
+ selectedIndex: number;
210
+ /**
211
+ * Gets or sets the {@link AccordionPane} object that is currently selected.
212
+ */
213
+ selectedPane: AccordionPane;
214
+ /**
215
+ * Gets or sets a value that determines whether collapsing or
216
+ * expanding panes should be animated.
217
+ *
218
+ * The default value for this property is **true**.
219
+ */
220
+ isAnimated: boolean;
221
+ /**
222
+ * Gets or sets a value that determines whether the {@link Accordion}
223
+ * shows collapsed/expanded icons in the pane headers.
224
+ *
225
+ * The default value for this property is **true**.
226
+ */
227
+ showIcons: boolean;
228
+ /**
229
+ * Gets or sets a value that determines whether the control should switch
230
+ * panes automatically when the user selects a tab using the arrow keys.
231
+ *
232
+ * When {@link autoSwitch} is set to true (the default value), pressing the
233
+ * arrow keys automatically switches panes. Pressing the tab key selects
234
+ * the next element in the tab sequence, which excludes non-selected
235
+ * pane headers.
236
+ *
237
+ * When {@link autoSwitch} is set to false, pressing the arrow keys or the
238
+ * tab key moves the focus to the next or previous pane header, but does
239
+ * not switch panes. Pressing the Enter or Space keys is required to
240
+ * activate the pane that has the focus.
241
+ *
242
+ * In most cases, the default value provides adequate (accessible)
243
+ * behavior, but some users may prefer to set {@link autoSwitch} to false.
244
+ * For a more detailed discussion of this topic, please see the
245
+ * <a href="https://www.w3.org/TR/wai-aria-practices/#kbd_selection_follows_focus" target="_blank">W3C ARIA practices</a>
246
+ * and
247
+ * <a href="http://simplyaccessible.com/article/danger-aria-tabs/" target="_blank">SimplyAccessible</a> articles.
248
+ */
249
+ autoSwitch: boolean;
250
+ /**
251
+ * Gets or sets a value that determines whether users should be allowed
252
+ * to collapse all the items.
253
+ *
254
+ * The default value for this property is **false**, which ensures
255
+ * one item is always expanded.
256
+ */
257
+ allowCollapseAll: boolean;
258
+ /**
259
+ * Gets or sets a value that determines whether users should be allowed
260
+ * to expand multiple panes at a time.
261
+ *
262
+ * The default value for this property is **false**, which ensures
263
+ * only one pane is expanded at a time.
264
+ */
265
+ allowExpandMany: boolean;
266
+ /**
267
+ * Gets an {@link AccordionPane} by id or by header content.
268
+ *
269
+ * @param id Id of the {@link AccordionPane} to retrieve.
270
+ */
271
+ getPane(id: string): AccordionPane;
272
+ /**
273
+ * Occurs when the value of the {@link selectedIndex} property changes.
274
+ */
275
+ readonly selectedIndexChanged: Event<Accordion, EventArgs>;
276
+ /**
277
+ * Raises the {@link selectedIndexChanged} event.
278
+ */
279
+ onSelectedIndexChanged(e?: EventArgs): void;
280
+ _populateControl(): void;
281
+ _validateSelection(): void;
282
+ private _updateContent;
283
+ private _updatePanesTabIndex;
284
+ protected _setTabOrder(value: number): void;
285
+ private _click;
286
+ private _keydown;
287
+ private _getPaneIndex;
288
+ private _getNextIndex;
289
+ private _getIndexOfPane;
290
+ private _getNextActiveIndex;
291
+ _togglePane(pane: AccordionPane, collapse: boolean): void;
292
+ }
293
+ /**
294
+ * Represents a pane in an {@link Accordion} control.
295
+ *
296
+ * Panes have two elements: header and content.
297
+ * The header displays the pane title and the content is a
298
+ * collapsible element that shows the pane content.
299
+ */
300
+ export declare class AccordionPane {
301
+ private _hdr;
302
+ private _content;
303
+ private _acc;
304
+ /**
305
+ * Initializes a new instance of the {@link AccordionPane} class.
306
+ *
307
+ * @param header Element or CSS selector for the element that contains the pane header.
308
+ * @param content Element or CSS selector for the element that contains the pane content.
309
+ */
310
+ constructor(header: any, content: any);
311
+ /**
312
+ * Gets a reference to the {@link Accordion} that contains this Tab.
313
+ */
314
+ readonly accordion: Accordion;
315
+ /**
316
+ * Gets the pane's header element.
317
+ */
318
+ readonly header: HTMLElement;
319
+ /**
320
+ * Gets the panes's content element.
321
+ */
322
+ readonly content: HTMLElement;
323
+ /**
324
+ * Gets or sets a value that determines whether this {@link AccordionPane} is disabled.
325
+ */
326
+ isDisabled: boolean;
327
+ /**
328
+ * Gets or sets a value that determines whether this {@link AccordionPane} is visible.
329
+ */
330
+ isVisible: boolean;
331
+ /**
332
+ * Gets or sets a value that determines whether this {@link AccordionPane} is expanded or collapsed.
333
+ */
334
+ isCollapsed: boolean;
335
+ _setParts(header: HTMLElement, content: HTMLElement): void;
336
+ _setAccordion(accordion: Accordion): void;
337
+ }
338
+ /**
339
+ * Provides arguments for the {@link TreeView.formatItem} event.
340
+ */
341
+ export declare class FormatNodeEventArgs extends EventArgs {
342
+ _data: any;
343
+ _e: HTMLElement;
344
+ _level: number;
345
+ /**
346
+ * Initializes a new instance of the {@link FormatNodeEventArgs} class.
347
+ *
348
+ * @param dataItem Data item represented by the node.
349
+ * @param element Element that represents the node being formatted.
350
+ * @param level The outline level of the node being formatted.
351
+ */
352
+ constructor(dataItem: any, element: HTMLElement, level: number);
353
+ /**
354
+ * Gets the data item being formatted.
355
+ */
356
+ readonly dataItem: any;
357
+ /**
358
+ * Gets a reference to the element that represents the node being formatted.
359
+ */
360
+ readonly element: HTMLElement;
361
+ /**
362
+ * Gets the outline level of the node being formatted.
363
+ */
364
+ readonly level: number;
365
+ }
366
+ /**
367
+ * Provides arguments for {@link TreeNode}-related events.
368
+ */
369
+ export declare class TreeNodeEventArgs extends CancelEventArgs {
370
+ _node: TreeNode;
371
+ /**
372
+ * Initializes a new instance of the {@link TreeNodeEventArgs} class.
373
+ *
374
+ * @param node {@link TreeNode} that this event refers to.
375
+ */
376
+ constructor(node: TreeNode);
377
+ /**
378
+ * Gets the {@link TreeNode} that this event refers to.
379
+ */
380
+ readonly node: TreeNode;
381
+ }
382
+ /**
383
+ * Provides arguments for {@link TreeNode} drag-drop events.
384
+ */
385
+ export declare class TreeNodeDragDropEventArgs extends CancelEventArgs {
386
+ _src: TreeNode;
387
+ _tgt: TreeNode;
388
+ _pos: DropPosition;
389
+ /**
390
+ * Initializes a new instance of the {@link TreeNodeEventArgs} class.
391
+ *
392
+ * @param dragSource {@link TreeNode} being dragged.
393
+ * @param dropTarget {@link TreeNode} where the source is being dropped.
394
+ * @param position {@link DropPosition} that this event refers to.
395
+ */
396
+ constructor(dragSource: TreeNode, dropTarget: TreeNode, position: DropPosition);
397
+ /**
398
+ * Gets a reference to the {@link TreeNode} being dragged.
399
+ */
400
+ readonly dragSource: TreeNode;
401
+ /**
402
+ * Gets a reference to the current {@link TreeNode} target.
403
+ */
404
+ readonly dropTarget: TreeNode;
405
+ /**
406
+ * Gets or sets the {@link DropPosition} value that specifies where
407
+ * the {@link TreeNode} will be dropped.
408
+ */
409
+ position: DropPosition;
410
+ }
411
+ /**
412
+ * Specifies the position where a {@link TreeNode} is being dropped during
413
+ * a drag and drop operation.
414
+ */
415
+ export declare enum DropPosition {
416
+ /** The node will become the previous sibling of the target node. */
417
+ Before = 0,
418
+ /** The node will become the next sibling of the target node. */
419
+ After = 1,
420
+ /** The node will become the last child of the target node. */
421
+ Into = 2
422
+ }
423
+ /**
424
+ * Class that represents a node in a {@link TreeView}.
425
+ */
426
+ export declare class TreeNode {
427
+ _t: TreeView;
428
+ _e: HTMLElement;
429
+ /**
430
+ * Initializes a new instance of a {@link TreeNode}.
431
+ *
432
+ * @param treeView {@link TreeView} that contains the node.
433
+ * @param nodeElement HTML element that represents the node on the {@link TreeView}.
434
+ */
435
+ constructor(treeView: TreeView, nodeElement: HTMLElement);
436
+ /**
437
+ * Gets the data item that this node represents.
438
+ */
439
+ readonly dataItem: any;
440
+ /**
441
+ * Gets the HTML element that represents this node on the {@link TreeView}.
442
+ */
443
+ readonly element: HTMLElement;
444
+ /**
445
+ * Gets a reference to the {@link TreeView} that contains this node.
446
+ */
447
+ readonly treeView: TreeView;
448
+ /**
449
+ * Ensures that a node is visible by expanding any collapsed
450
+ * ancestors and scrolling the element into view.
451
+ */
452
+ ensureVisible(): void;
453
+ /**
454
+ * Checks whether this node refers to the same element as another node.
455
+ *
456
+ * @param node @TreeNode to compare with this one.
457
+ */
458
+ equals(node: TreeNode): boolean;
459
+ /**
460
+ * Selects this node.
461
+ */
462
+ select(): void;
463
+ /**
464
+ * Gets this node's index within the parent's node collection.
465
+ */
466
+ readonly index: number;
467
+ /**
468
+ * Gets this node's parent node.
469
+ *
470
+ * This property returns null for top-level nodes.
471
+ */
472
+ readonly parentNode: TreeNode;
473
+ /**
474
+ * Gets this node's level.
475
+ *
476
+ * Top-level nodes have level zero.
477
+ */
478
+ readonly level: number;
479
+ /**
480
+ * Gets a value that indicates whether this node has child nodes.
481
+ */
482
+ readonly hasChildren: boolean;
483
+ /**
484
+ * Gets a value that indicates whether this node has pending child nodes
485
+ * that will be lazy-loaded when the node is expanded.
486
+ */
487
+ readonly hasPendingChildren: boolean;
488
+ /**
489
+ * Gets an array containing this node's child nodes.
490
+ *
491
+ * This property returns null if the node has no children.
492
+ */
493
+ readonly nodes: TreeNode[];
494
+ /**
495
+ * Gets the HTMLInputElement that represents the checkbox associated
496
+ * with this node.
497
+ */
498
+ readonly checkBox: HTMLInputElement;
499
+ /**
500
+ * Gets or sets a value that determines whether this node is expanded or collapsed.
501
+ */
502
+ isCollapsed: boolean;
503
+ /**
504
+ * Gets or sets a value that determines whether this node is checked.
505
+ *
506
+ * When the value of this property changes, child and ancestor nodes
507
+ * are automatically updated, and the parent {@link TreeView}'s
508
+ * {@link TreeView.checkedItemsChanged} event is raised.
509
+ */
510
+ isChecked: boolean;
511
+ /**
512
+ * Gets or sets a value that determines whether this node is disabled.
513
+ *
514
+ * Disabled nodes cannot get mouse or keyboard events.
515
+ *
516
+ * If the {@link collapseWhenDisabled} proprety is set to true, disabling
517
+ * a node also collapses it.
518
+ */
519
+ isDisabled: boolean;
520
+ /**
521
+ * Gets a reference to the previous node in the view.
522
+ *
523
+ * @param visible Whether to return only visible nodes (whose ancestors are not collapsed).
524
+ * @param enabled Whether to return only enabled nodes (whose ancestors are not disabled).
525
+ */
526
+ previous(visible?: boolean, enabled?: boolean): TreeNode;
527
+ /**
528
+ * Gets a reference to the next node in the view.
529
+ *
530
+ * @param visible Whether to return only visible nodes (whose ancestors are not collapsed).
531
+ * @param enabled Whether to return only enabled nodes (whose ancestors are not disabled).
532
+ */
533
+ next(visible?: boolean, enabled?: boolean): TreeNode;
534
+ /**
535
+ * Gets a reference to the previous sibling node in the view.
536
+ */
537
+ previousSibling(): TreeNode;
538
+ /**
539
+ * Gets a reference to the next sibling node in the view.
540
+ */
541
+ nextSibling(): TreeNode;
542
+ /**
543
+ * Sets the collapsed state of the node.
544
+ *
545
+ * @param collapsed Whether to collapse or expand the node.
546
+ * @param animate Whether to use animation when applying the new state.
547
+ * @param collapseSiblings Whether to collapse sibling nodes when expanding
548
+ * this node.
549
+ */
550
+ setCollapsed(collapsed: boolean, animate?: boolean, collapseSiblings?: boolean): void;
551
+ /**
552
+ * Sets the checked state of this node and its children.
553
+ *
554
+ * @param checked Whether to check or uncheck the node and its children.
555
+ * @param updateParent Whether to update the checked state of this node's
556
+ * ancestor nodes.
557
+ */
558
+ setChecked(checked: boolean, updateParent?: boolean): void;
559
+ /**
560
+ * Removes this {@link TreeNode} from a {@link TreeView}.
561
+ */
562
+ remove(): void;
563
+ /**
564
+ * Adds a child node at a specific position.
565
+ *
566
+ * @param index Index of the new child node.
567
+ * @param dataItem Data item used to create the new node.
568
+ * @return The {@link TreeNode} that was added.
569
+ */
570
+ addChildNode(index: number, dataItem: any): TreeNode;
571
+ /**
572
+ * Refreshes a node to reflect data changes.
573
+ *
574
+ * @param dataItem New node data. If not provided, the node is refreshed
575
+ * based on its original data item (which presumably has been updated).
576
+ */
577
+ refresh(dataItem?: any): void;
578
+ /**
579
+ * Moves this {@link TreeNode} to a new position on the {@link TreeView}.
580
+ *
581
+ * @param refNode Reference {@link TreeNode} that defines the location
582
+ * where the node will be moved.
583
+ * @param position Whether to move the node before, after, or into
584
+ * the reference node.
585
+ * @return True if the node was moved successfully.
586
+ */
587
+ move(refNode: any, position: DropPosition): boolean;
588
+ /**
589
+ * Gets the array that contains the items for this {@link TreeNode}.
590
+ *
591
+ * This property is read-only. It returns an array that is a
592
+ * member of the parent {@link TreeView}'s {@link TreeView.itemsSource} array.
593
+ */
594
+ readonly itemsSource: any[];
595
+ _pse(e: HTMLElement): HTMLElement;
596
+ _contains(node: TreeNode): boolean;
597
+ _getArray(): any[];
598
+ _moveElements(refNode: any, position: DropPosition): void;
599
+ _updateState(): void;
600
+ _updateEmptyState(): void;
601
+ _updateCheckedState(): void;
602
+ static _getChildNodes(treeView: TreeView, nodeList: HTMLElement): TreeNode[];
603
+ static _isNode(e: HTMLElement): boolean;
604
+ static _isNodeList(e: HTMLElement): boolean;
605
+ static _isEmpty(node: HTMLElement): boolean;
606
+ static _isCollapsed(node: HTMLElement): boolean;
607
+ static _assertNode(node: HTMLElement): void;
608
+ static _assertNodeList(nodeList: HTMLElement): void;
609
+ }
610
+ /**
611
+ * Class that handles hierarchical (multi-level) bindings.
612
+ */
613
+ export declare class _BindingArray {
614
+ _path: any;
615
+ _bindings: Binding[];
616
+ _maxLevel: number;
617
+ /**
618
+ * Initializes a new instance of a _BindingArray.
619
+ *
620
+ * @param path String or array of strings to create bindings from.
621
+ */
622
+ constructor(path?: any);
623
+ /**
624
+ * Gets or sets the names of the properties used for binding.
625
+ */
626
+ path: any;
627
+ /**
628
+ * Gets the binding value for a given data item at a given level.
629
+ *
630
+ * @param dataItem Object that contains the data.
631
+ * @param level Binding level to use for retrieving the data.
632
+ */
633
+ getValue(dataItem: any, level: number): any;
634
+ /**
635
+ * Sets the binding value on a given data item at a given level.
636
+ *
637
+ * @param dataItem Object that contains the data.
638
+ * @param level Binding level to use for retrieving the data.
639
+ * @param value Value to apply to the data item.
640
+ */
641
+ setValue(dataItem: any, level: number, value: any): void;
642
+ }
643
+ /**
644
+ * Represents a function used to load child nodes asynchronously (lazy-load).
645
+ */
646
+ export interface ILazyLoad {
647
+ /**
648
+ * @param node {@link TreeNode} being opened and populated.
649
+ * @param callback {@link ILazyLoadCallback} to be invoked when the node data becomes available.
650
+ */
651
+ (node: TreeNode, callback: ILazyLoadCallback): void;
652
+ }
653
+ /**
654
+ * Represents a callback method used to add lazy-loaded nodes to a {@link TreeNode}.
655
+ */
656
+ export interface ILazyLoadCallback {
657
+ /**
658
+ * @param items Array containing child items for the node being lazy-loaded.
659
+ */
660
+ (items: any[]): void;
661
+ }
662
+ /**
663
+ * The {@link TreeView} control displays a hierarchical list of {@link TreeNode}
664
+ * objects which may contain text, checkboxes, images, or arbitrary HTML
665
+ * content.
666
+ *
667
+ * A {@link TreeView} is typically used to display the headings in a document,
668
+ * the entries in an index, the files and directories on a disk, or any other
669
+ * kind of information that might usefully be displayed as a hierarchy.
670
+ *
671
+ * After creating a {@link TreeView}, you will typically set the following
672
+ * properties:
673
+ *
674
+ * <ol>
675
+ * <li>
676
+ * {@link itemsSource}: an array that contains the data to be displayed on the
677
+ * tree.</li>
678
+ * <li>
679
+ * {@link displayMemberPath}: the name of the data item property that contains
680
+ * the text to display on the nodes (defaults to 'header'), and</li>
681
+ * <li>
682
+ * {@link childItemsPath}: the name of the data item property that contains the
683
+ * node's child items (defaults to 'items').</li>
684
+ * </ol>
685
+ *
686
+ * The {@link TreeView} control supports the following keyboard commands:
687
+ *
688
+ * <table>
689
+ * <thead>
690
+ * <tr><th>Key Combination</th><th>Action</th></tr>
691
+ * </thead>
692
+ * <tbody>
693
+ * <tr><td>Up/Down</td><td>Select the previous/next visible node</td></tr>
694
+ * <tr><td>Left</td><td>Collapse the selected node if it has child nodes, select the parent node otherwise</td></tr>
695
+ * <tr><td>Right</td><td>Expand the selected node if it has child nodes</td></tr>
696
+ * <tr><td>Home/End</td><td>Select the first/last visible nodes</td></tr>
697
+ * <tr><td>Space</td><td>Toggle the checkbox in the current node (see the {@link showCheckboxes} property)</td></tr>
698
+ * <tr><td>Other characters</td><td>Search for nodes that contain the text typed (multi-character auto-search)</td></tr>
699
+ * </tbody>
700
+ * </table>
701
+ *
702
+ * The example below builds a simple tree and allows you to see the effect
703
+ * of the TreeView's main properties:
704
+ *
705
+ * {@sample Nav/TreeView/Behavior/purejs Example}
706
+ */
707
+ export declare class TreeView extends Control {
708
+ static _DATAITEM_KEY: string;
709
+ static _AS_DLY: number;
710
+ static _AN_DLY: number;
711
+ static _CND: string;
712
+ static _CNDL: string;
713
+ static _CEMP: string;
714
+ static _CNDT: string;
715
+ static _CNDC: string;
716
+ static _CSEL: string;
717
+ static _CCLD: string;
718
+ static _CCLG: string;
719
+ static _CLDG: string;
720
+ _root: HTMLElement;
721
+ private _items;
722
+ _selNode: TreeNode;
723
+ _itmPath: _BindingArray;
724
+ _chkPath: _BindingArray;
725
+ private _prevSel;
726
+ private _dspPath;
727
+ private _imgPath;
728
+ private _dd;
729
+ private _html;
730
+ private _animated;
731
+ private _chkOnClick;
732
+ private _collOnClick;
733
+ private _xpndOnClick;
734
+ private _xpndOnLoad;
735
+ private _autoColl;
736
+ private _showChk;
737
+ private _collapseWhenDisabled;
738
+ private _chkItems;
739
+ private _ldLvl;
740
+ private _srch;
741
+ private _toSrch;
742
+ private _lazyLoad;
743
+ private _isDirty;
744
+ private _srcChanged;
745
+ private _isReadOnly;
746
+ private _edtNode;
747
+ private _toItemsChanged;
748
+ private _prevDragState;
749
+ private options;
750
+ /**
751
+ * Gets or sets the template used to instantiate {@link TreeView} controls.
752
+ */
753
+ static controlTemplate: string;
754
+ /**
755
+ * Initializes a new instance of the {@link TreeView} class.
756
+ *
757
+ * @param element The DOM element that hosts the control, or a CSS selector for the host element (e.g. '#theCtrl').
758
+ * @param options The JavaScript object containing initialization data for the control.
759
+ */
760
+ constructor(element: any, options?: any);
761
+ /**
762
+ * Gets or sets the array that contains the {@link TreeView} items.
763
+ *
764
+ * {@link TreeView} #see:itemsSource arrays usually have a hierarchical
765
+ * structure with items that contain child items. There is no fixed
766
+ * limit to the depth of the items.
767
+ *
768
+ * For example, the array below would generate a tree with three
769
+ * top-level nodes, each with two child nodes:
770
+ *
771
+ * ```typescript
772
+ * import { TreeView } from '@grapecity/wijmo.nav';
773
+ * var tree = new TreeView('#treeView', {
774
+ * displayMemberPath: 'header',
775
+ * childItemsPath: 'items',
776
+ * itemsSource: [
777
+ * { header: '1 first', items: [
778
+ * { header: '1.1 first child' },
779
+ * { header: '1.2 second child' },
780
+ * ] },
781
+ * { header: '2 second', items: [
782
+ * { header: '3.1 first child' },
783
+ * { header: '3.2 second child' },
784
+ * ] },
785
+ * { header: '3 third', items: [
786
+ * { header: '3.1 first child' },
787
+ * { header: '3.2 second child' },
788
+ * ] }
789
+ * ]
790
+ * });
791
+ * ```
792
+ */
793
+ itemsSource: any[];
794
+ /**
795
+ * Gets or sets the name of the property (or properties) that contains
796
+ * the child items for each node.
797
+ *
798
+ * The default value for this property is the string **"items"**.
799
+ *
800
+ * In most cases, the property that contains the child items is the
801
+ * same for all data items on the tree. In these cases, set the
802
+ * {@link childItemsPath} to that name.
803
+ *
804
+ * In some cases, however, items at different levels use different
805
+ * properties to store their child items. For example, you could have
806
+ * a tree with categories, products, and orders. In that case, you
807
+ * would set the {@link childItemsPath} to an array such as this:
808
+ *
809
+ * <pre>// categories have products, products have orders:
810
+ * tree.childItemsPath = [ 'Products', 'Orders' ];</pre>
811
+ */
812
+ childItemsPath: string | string[];
813
+ /**
814
+ * Gets or sets the name of the property (or properties) to use as
815
+ * the visual representation of the nodes.
816
+ *
817
+ * The default value for this property is the string **"header"**.
818
+ *
819
+ * In most cases, the property that contains the node text is the
820
+ * same for all data items on the tree. In these cases, set the
821
+ * {@link displayMemberPath} to that name.
822
+ *
823
+ * In some cases, however, items at different levels use different
824
+ * properties to represent them. For example, you could have
825
+ * a tree with categories, products, and orders. In that case, you
826
+ * might set the {@link displayMemberPath} to an array such as this:
827
+ *
828
+ * <pre>// categories, products, and orders have different headers:
829
+ * tree.displayMemberPath = [ 'CategoryName', 'ProductName', 'OrderID' ];</pre>
830
+ */
831
+ displayMemberPath: string | string[];
832
+ /**
833
+ * Gets or sets the name of the property (or properties) to use as a
834
+ * source of images for the nodes.
835
+ *
836
+ * The default value for this property is an empty string, which
837
+ * means no images are added to the nodes.
838
+ */
839
+ imageMemberPath: string | string[];
840
+ /**
841
+ * Gets or sets the name of the property (or properties) to bind
842
+ * to the node's checked state.
843
+ *
844
+ * See also the {@link showCheckboxes} property and the
845
+ * {@link checkedItemsChanged} event.
846
+ */
847
+ checkedMemberPath: string | string[];
848
+ /**
849
+ * Gets or sets a value indicating whether items are bound to
850
+ * plain text or HTML.
851
+ *
852
+ * The default value for this property is **false**.
853
+ */
854
+ isContentHtml: boolean;
855
+ /**
856
+ * Gets or sets a value that determines whether the {@link TreeView}
857
+ * should add checkboxes to nodes and manage their state.
858
+ *
859
+ * This property can be used only on trees without lazy-loaded
860
+ * nodes (see the {@link lazyLoadFunction} property).
861
+ *
862
+ * See also the {@link checkedItems} property and {@link checkedItemsChanged}
863
+ * event.
864
+ *
865
+ * The default value for this property is **false**.
866
+ */
867
+ showCheckboxes: boolean;
868
+ /**
869
+ * Gets or sets a value that determines if sibling nodes should be
870
+ * collapsed when a node is expanded.
871
+ *
872
+ * The default value for this property is **true**, because in
873
+ * most cases collapsing nodes that are not in use helps keep the
874
+ * UI clean.
875
+ */
876
+ autoCollapse: boolean;
877
+ /**
878
+ * Gets or sets a value that determines whether nodes should be
879
+ * collapsed when they are disabled.
880
+ *
881
+ * The default value for this property is **true**.
882
+ */
883
+ collapseWhenDisabled: boolean;
884
+ /**
885
+ * Gets or sets a value that indicates whether to use animations when
886
+ * expanding or collapsing nodes.
887
+ *
888
+ * The default value for this property is **true**.
889
+ */
890
+ isAnimated: boolean;
891
+ /**
892
+ * Gets or sets a value that determines whether users can edit the
893
+ * text in the nodes.
894
+ *
895
+ * When the {@link isReadOnly} property is set to false, users may
896
+ * edit the content of the tree nodes by typing directly into the nodes.
897
+ * The F2 key can also be used to enter edit mode with the whole node
898
+ * content selected.
899
+ *
900
+ * You may customize the editing behavior using the following methods
901
+ * and events:
902
+ *
903
+ * **Methods**: {@link startEditing}, {@link finishEditing}.
904
+ *
905
+ * **Events**: {@link nodeEditStarting}, {@link nodeEditStarted},
906
+ * {@link nodeEditEnding}, {@link nodeEditEnded}.
907
+ *
908
+ * The default value for this property is **true**.
909
+ */
910
+ isReadOnly: boolean;
911
+ /**
912
+ * Starts editing a given {@link TreeNode}.
913
+ *
914
+ * @param node {@link TreeNode} to edit. If not provided, the currently
915
+ * selected node is used.
916
+ *
917
+ * @return True if the edit operation started successfully.
918
+ */
919
+ startEditing(node?: TreeNode): boolean;
920
+ /**
921
+ * Commits any pending edits and exits edit mode.
922
+ *
923
+ * @param cancel Whether pending edits should be canceled or committed.
924
+ * @return True if the edit operation finished successfully.
925
+ */
926
+ finishEditing(cancel?: boolean): boolean;
927
+ /**
928
+ * Gets or sets a value that determines whether users can drag and drop nodes
929
+ * within the {@link TreeView}.
930
+ *
931
+ * The default value for this property is **false**.
932
+ */
933
+ allowDragging: boolean;
934
+ /**
935
+ * Gets or sets a value that determines whether to toggle checkboxes
936
+ * when the user clicks the node header.
937
+ *
938
+ * The default value for this property is **false**, which causes
939
+ * checkboxes to be toggled only when the user clicks the checkbox
940
+ * itself (not the node header).
941
+ *
942
+ * See also the {@link showCheckboxes} property and the {@link checkedItemsChanged} event.
943
+ */
944
+ checkOnClick: boolean;
945
+ /**
946
+ * Gets or sets a value that determines whether to expand collapsed
947
+ * nodes when the user clicks the node header.
948
+ *
949
+ * The default value for this property is **true**.
950
+ *
951
+ * When this property is set to **false**, users have to click the
952
+ * expand/collapse icons to collapse the node.
953
+ * Clicking the node header will select the node if it is not selected,
954
+ * and will start editing the node if it is selected (and if the
955
+ * {@link isReadOnly} property is set to false).
956
+ *
957
+ * See also the {@link collapseOnClick} property.
958
+ */
959
+ expandOnClick: boolean;
960
+ /**
961
+ * Gets or sets a value that determines whether to collapse expanded
962
+ * nodes when the user clicks the node header.
963
+ *
964
+ * The default value for this property is **false**.
965
+ *
966
+ * When this property is set to **false**, users have to click the
967
+ * expand/collapse icons to collapse the node.
968
+ * Clicking the node header will select the node if it is not selected,
969
+ * and will start editing the node if it is selected (and if the
970
+ * {@link isReadOnly} property is set to false).
971
+ *
972
+ * See also the {@link expandOnClick} property.
973
+ */
974
+ collapseOnClick: boolean;
975
+ /**
976
+ * Gets or sets a value that determines whether to automatically expand the
977
+ * first node when the tree is loaded.
978
+ *
979
+ * The default value for this property is **true**. If you set it to false,
980
+ * all nodes will be initially collapsed.
981
+ */
982
+ expandOnLoad: boolean;
983
+ /**
984
+ * Gets or sets the data item that is currently selected.
985
+ */
986
+ selectedItem: any;
987
+ /**
988
+ * Gets or sets the {@link TreeNode} that is currently selected.
989
+ */
990
+ selectedNode: TreeNode;
991
+ /**
992
+ * Gets an array containing the text of all nodes from the root
993
+ * to the currently selected node.
994
+ */
995
+ readonly selectedPath: string[];
996
+ /**
997
+ * Gets an array containing the items that are currently checked.
998
+ *
999
+ * The array returned includes only items that have no children.
1000
+ * This is because checkboxes in parent items are used to check
1001
+ * or uncheck the child items.
1002
+ *
1003
+ * See also the {@link showCheckboxes} property and the
1004
+ * {@link checkedItemsChanged} event.
1005
+ *
1006
+ * For example:
1007
+ *
1008
+ * ```typescript
1009
+ * import { TreeView } from '@grapecity/wijmo.nav';
1010
+ * var treeViewChk = new TreeView('#gsTreeViewChk', {
1011
+ * displayMemberPath: 'header',
1012
+ * childItemsPath: 'items',
1013
+ * showCheckboxes: true,
1014
+ * itemsSource: items,
1015
+ * checkedItemsChanged: function (s, e) {
1016
+ * var items = s.checkedItems,
1017
+ * msg = '';
1018
+ * if (items.length) {
1019
+ * msg = '&lt;p&gt;&lt;b&gt;Selected Items:&lt;/b&gt;&lt;/p&gt;&lt;ol&gt;\r\n';
1020
+ * for (var i = 0; i &lt; items.length; i++) {
1021
+ * msg += '&lt;li&gt;' + items[i].header + '&lt;/li&gt;\r\n';
1022
+ * }
1023
+ * msg += '&lt;/ol&gt;';
1024
+ * }
1025
+ * document.getElementById('gsTreeViewChkStatus').innerHTML = msg;
1026
+ * }
1027
+ * });
1028
+ * ```
1029
+ */
1030
+ checkedItems: any[];
1031
+ /**
1032
+ * Checks or unchecks all checkboxes on the tree.
1033
+ *
1034
+ * @param check Whether to check or uncheck all checkboxes.
1035
+ */
1036
+ checkAllItems(check: boolean): void;
1037
+ /**
1038
+ * Gets the total number of items in the tree.
1039
+ */
1040
+ readonly totalItemCount: number;
1041
+ /**
1042
+ * Gets or sets a function that loads child nodes on demand.
1043
+ *
1044
+ * The {@link lazyLoadFunction} takes two parameters: the node being
1045
+ * expanded and a callback to be invoked when the data becomes
1046
+ * available.
1047
+ *
1048
+ * The callback function tells the {@link TreeView} that the node
1049
+ * loading process has been completed. It should always be called,
1050
+ * even if there are errors when loading the data.
1051
+ *
1052
+ * For example:
1053
+ *
1054
+ * ```typescript
1055
+ * import { TreeView } from '@grapecity/wijmo.nav';
1056
+ * var treeViewLazyLoad = new TreeView('#treeViewLazyLoad', {
1057
+ * displayMemberPath: 'header',
1058
+ * childItemsPath: 'items',
1059
+ * itemsSource: [ // start with three lazy-loaded nodes
1060
+ * { header: 'Lazy Node 1', items: []},
1061
+ * { header: 'Lazy Node 2', items: [] },
1062
+ * { header: 'Lazy Node 3', items: [] }
1063
+ * ],
1064
+ * lazyLoadFunction: function (node, callback) {
1065
+ * setTimeout(function () { // simulate http delay
1066
+ * var result = [ // simulate result
1067
+ * { header: 'Another lazy node...', items: [] },
1068
+ * { header: 'A non-lazy node without children' },
1069
+ * { header: 'A non-lazy node with child nodes', items: [
1070
+ * { header: 'hello' },
1071
+ * { header: 'world' }
1072
+ * ]}
1073
+ * ];
1074
+ * callback(result); // return result to control
1075
+ * }, 2500); // simulated 2.5 sec http delay
1076
+ * }
1077
+ *});
1078
+ * ```
1079
+ *
1080
+ * Trees with lazy-loaded nodes have some restrictions: their nodes
1081
+ * may not have checkboxes (see the {@link showCheckboxes} property) and
1082
+ * the {@link collapseToLevel} method will not expand collapsed nodes
1083
+ * that have not been loaded yet.
1084
+ */
1085
+ lazyLoadFunction: ILazyLoad;
1086
+ /**
1087
+ * Gets a reference to the first {@link TreeNode} in the {@link TreeView}.
1088
+ *
1089
+ * @param visible Whether to return only visible nodes (whose ancestors are not collapsed).
1090
+ * @param enabled Whether to return only enabled nodes (whose ancestors are not disabled).
1091
+ */
1092
+ getFirstNode(visible?: boolean, enabled?: boolean): TreeNode;
1093
+ /**
1094
+ * Gets a reference to the last {@link TreeNode} in the {@link TreeView}.
1095
+ *
1096
+ * @param visible Whether to return only visible nodes (whose ancestors are not collapsed).
1097
+ * @param enabled Whether to return only enabled nodes (whose ancestors are not disabled).
1098
+ */
1099
+ getLastNode(visible?: boolean, enabled?: boolean): TreeNode;
1100
+ /**
1101
+ * Gets an array of {@link TreeNode} objects representing the nodes
1102
+ * currently loaded.
1103
+ */
1104
+ readonly nodes: TreeNode[];
1105
+ /**
1106
+ * Gets the {@link TreeNode} object representing a given data item.
1107
+ *
1108
+ * @param item The data item to look for.
1109
+ */
1110
+ getNode(item: any): TreeNode;
1111
+ /**
1112
+ * Adds a child node at a specific position.
1113
+ *
1114
+ * @param index Index of the new child node.
1115
+ * @param dataItem Data item used to create the new node.
1116
+ * @return The {@link TreeNode} that was added.
1117
+ */
1118
+ addChildNode(index: number, dataItem: any): TreeNode;
1119
+ /**
1120
+ * Collapses all the tree items to a given level.
1121
+ *
1122
+ * This method will typically expand or collapse multiple nodes
1123
+ * at once. But it will not perform lazy-loading on any nodes,
1124
+ * so collapsed nodes that must be lazy-loaded will not be
1125
+ * expanded.
1126
+ *
1127
+ * @param level Maximum node level to show.
1128
+ */
1129
+ collapseToLevel(level: number): void;
1130
+ /**
1131
+ * Loads the tree using data from the current {@link itemsSource}.
1132
+ *
1133
+ * @param preserveOutlineState Whether to preserve the outline state when loading the
1134
+ * tree data. Defaults to false.
1135
+ */
1136
+ loadTree(preserveOutlineState?: boolean): void;
1137
+ /**
1138
+ * Occurs when the value of the {@link itemsSource} property changes.
1139
+ */
1140
+ readonly itemsSourceChanged: Event<TreeView, EventArgs>;
1141
+ /**
1142
+ * Raises the {@link itemsSourceChanged} event.
1143
+ */
1144
+ onItemsSourceChanged(e?: EventArgs): void;
1145
+ /**
1146
+ * Occurs before the tree items are generated.
1147
+ */
1148
+ readonly loadingItems: Event<TreeView, CancelEventArgs>;
1149
+ /**
1150
+ * Raises the {@link loadingItems} event.
1151
+ * @return True if the event was not canceled.
1152
+ */
1153
+ onLoadingItems(e?: CancelEventArgs): boolean;
1154
+ /**
1155
+ * Occurs after the tree items have been generated.
1156
+ */
1157
+ readonly loadedItems: Event<TreeView, EventArgs>;
1158
+ /**
1159
+ * Raises the {@link loadedItems} event.
1160
+ */
1161
+ onLoadedItems(e?: EventArgs): void;
1162
+ /**
1163
+ * Occurs when the user clicks an item or presses the Enter key and an item is selected.
1164
+ *
1165
+ * This event is typically used in navigation trees. Use the {@link selectedItem} property
1166
+ * to get the item that was clicked.
1167
+ */
1168
+ readonly itemClicked: Event<TreeView, EventArgs>;
1169
+ /**
1170
+ * Raises the {@link itemClicked} event.
1171
+ */
1172
+ onItemClicked(e?: EventArgs): void;
1173
+ /**
1174
+ * Occurs when the value of the {@link selectedItem} property changes.
1175
+ */
1176
+ readonly selectedItemChanged: Event<TreeView, EventArgs>;
1177
+ /**
1178
+ * Raises the {@link selectedItemChanged} event.
1179
+ */
1180
+ onSelectedItemChanged(e?: EventArgs): void;
1181
+ /**
1182
+ * Occurs when the value of the {@link checkedItems} property changes.
1183
+ *
1184
+ * See also the {@link showCheckboxes} and {@link checkOnClick}
1185
+ * properties.
1186
+ */
1187
+ readonly checkedItemsChanged: Event<TreeView, EventArgs>;
1188
+ /**
1189
+ * Raises the {@link checkedItemsChanged} event.
1190
+ */
1191
+ onCheckedItemsChanged(e?: EventArgs): void;
1192
+ /**
1193
+ * Occurs before the value of the {@link TreeNode.isCollapsed} property changes.
1194
+ */
1195
+ readonly isCollapsedChanging: Event<TreeView, TreeNodeEventArgs>;
1196
+ /**
1197
+ * Raises the {@link isCollapsedChanging} event.
1198
+ *
1199
+ * @param e {@link TreeNodeEventArgs} that contains the event data.
1200
+ * @return True if the event was not canceled.
1201
+ */
1202
+ onIsCollapsedChanging(e: TreeNodeEventArgs): boolean;
1203
+ /**
1204
+ * Occurs after the value of the {@link TreeNode.isCollapsed} property changes.
1205
+ */
1206
+ readonly isCollapsedChanged: Event<TreeView, TreeNodeEventArgs>;
1207
+ /**
1208
+ * Raises the {@link isCollapsedChanged} event.
1209
+ *
1210
+ * @param e {@link TreeNodeEventArgs} that contains the event data.
1211
+ */
1212
+ onIsCollapsedChanged(e: TreeNodeEventArgs): void;
1213
+ /**
1214
+ * Occurs before the value of the {@link TreeNode.isChecked} property changes.
1215
+ */
1216
+ readonly isCheckedChanging: Event<TreeView, TreeNodeEventArgs>;
1217
+ /**
1218
+ * Raises the {@link isCheckedChanging} event.
1219
+ *
1220
+ * @param e {@link TreeNodeEventArgs} that contains the event data.
1221
+ * @return True if the event was not canceled.
1222
+ */
1223
+ onIsCheckedChanging(e: TreeNodeEventArgs): boolean;
1224
+ /**
1225
+ * Occurs after the value of the {@link TreeNode.isChecked} property changes.
1226
+ */
1227
+ readonly isCheckedChanged: Event<TreeView, TreeNodeEventArgs>;
1228
+ /**
1229
+ * Raises the {@link isCheckedChanged} event.
1230
+ *
1231
+ * @param e {@link TreeNodeEventArgs} that contains the event data.
1232
+ */
1233
+ onIsCheckedChanged(e: TreeNodeEventArgs): void;
1234
+ /**
1235
+ * Occurs when an element representing a node has been created.
1236
+ *
1237
+ * This event can be used to format nodes for display.
1238
+ *
1239
+ * The example below uses the **formatItem** event to add a "new"
1240
+ * badge to the right of new items on the tree.
1241
+ *
1242
+ * ```typescript
1243
+ * import { TreeView } from '@grapecity/wijmo.nav';
1244
+ * var treeViewFmtItem = new TreeView('#treeViewFmtItem', {
1245
+ * displayMemberPath: 'header',
1246
+ * childItemsPath: 'items',
1247
+ * itemsSource: items,
1248
+ * formatItem: function (s, e) {
1249
+ * if (e.dataItem.newItem) {
1250
+ * let img = wijmo.createElement('<img style="margin-left:6px" src="resources/new.png">');
1251
+ * e.element.appendChild(img);
1252
+ * }
1253
+ * }
1254
+ * });
1255
+ * ```
1256
+ */
1257
+ readonly formatItem: Event<TreeView, FormatNodeEventArgs>;
1258
+ /**
1259
+ * Raises the {@link formatItem} event.
1260
+ *
1261
+ * @param e {@link FormatNodeEventArgs} that contains the event data.
1262
+ */
1263
+ onFormatItem(e: FormatNodeEventArgs): void;
1264
+ /**
1265
+ * Occurs when the user starts dragging a node.
1266
+ *
1267
+ * This event only occurs if the {@link allowDragging} property is set to true.
1268
+ *
1269
+ * You may prevent nodes from being dragged by setting the event's
1270
+ * **cancel** parameter to true.
1271
+ */
1272
+ readonly dragStart: Event<TreeView, TreeNodeEventArgs>;
1273
+ /**
1274
+ * Raises the {@link dragStart} event.
1275
+ *
1276
+ * @param e {@link TreeNodeEventArgs} that contains the event data.
1277
+ * @return True if the event was not canceled.
1278
+ */
1279
+ onDragStart(e: TreeNodeEventArgs): boolean;
1280
+ /**
1281
+ * Occurs while the user drags a node over other nodes on the {@link TreeView}.
1282
+ *
1283
+ * This event only occurs if the {@link allowDragging} property is set to true.
1284
+ *
1285
+ * You may prevent drop operations over certain nodes and/or positions by
1286
+ * setting the event's **cancel** parameter to true.
1287
+ */
1288
+ readonly dragOver: Event<TreeView, TreeNodeDragDropEventArgs>;
1289
+ /**
1290
+ * Raises the {@link dragOver} event.
1291
+ *
1292
+ * @param e {@link TreeNodeDragDropEventArgs} that contains the event data.
1293
+ * @return True if the event was not canceled.
1294
+ */
1295
+ onDragOver(e: TreeNodeDragDropEventArgs): boolean;
1296
+ /**
1297
+ * Occurs when the user drops a on the {@link TreeView}.
1298
+ *
1299
+ * @return True if the event was not canceled.
1300
+ */
1301
+ readonly drop: Event<TreeView, TreeNodeDragDropEventArgs>;
1302
+ /**
1303
+ * Raises the {@link drop} event.
1304
+ *
1305
+ * @param e {@link TreeNodeDragDropEventArgs} that contains the event data.
1306
+ */
1307
+ onDrop(e: TreeNodeDragDropEventArgs): boolean;
1308
+ /**
1309
+ * Occurs when the user finishes a drag/drop operation, either by dropping
1310
+ * a node into a new location or by canceling the operation with the mouse
1311
+ * or keyboard.
1312
+ */
1313
+ readonly dragEnd: Event<TreeView, EventArgs>;
1314
+ /**
1315
+ * Raises the {@link dragEnd} event.
1316
+ */
1317
+ onDragEnd(e?: EventArgs): void;
1318
+ /**
1319
+ * Occurs before a {@link TreeNode} enters edit mode.
1320
+ */
1321
+ readonly nodeEditStarting: Event<TreeView, TreeNodeEventArgs>;
1322
+ /**
1323
+ * Raises the {@link nodeEditStarting} event.
1324
+ *
1325
+ * @param e {@link TreeNodeEventArgs} that contains the event data.
1326
+ * @return True if the event was not canceled.
1327
+ */
1328
+ onNodeEditStarting(e: TreeNodeEventArgs): boolean;
1329
+ /**
1330
+ * Occurs after a {@link TreeNode} has entered edit mode.
1331
+ */
1332
+ readonly nodeEditStarted: Event<TreeView, TreeNodeEventArgs>;
1333
+ /**
1334
+ * Raises the {@link nodeEditStarted} event.
1335
+ *
1336
+ * @param e {@link TreeNodeEventArgs} that contains the event data.
1337
+ */
1338
+ onNodeEditStarted(e: TreeNodeEventArgs): void;
1339
+ /**
1340
+ * Occurs before a {@link TreeNode} exits edit mode.
1341
+ */
1342
+ readonly nodeEditEnding: Event<TreeView, TreeNodeEventArgs>;
1343
+ /**
1344
+ * Raises the {@link nodeEditEnding} event.
1345
+ *
1346
+ * @param e {@link TreeNodeEventArgs} that contains the event data.
1347
+ * @return True if the event was not canceled.
1348
+ */
1349
+ onNodeEditEnding(e: TreeNodeEventArgs): boolean;
1350
+ /**
1351
+ * Occurs after a {@link TreeNode} has exited edit mode.
1352
+ */
1353
+ readonly nodeEditEnded: Event<TreeView, TreeNodeEventArgs>;
1354
+ /**
1355
+ * Raises the {@link nodeEditEnded} event.
1356
+ *
1357
+ * @param e {@link TreeNodeEventArgs} that contains the event data.
1358
+ */
1359
+ onNodeEditEnded(e: TreeNodeEventArgs): void;
1360
+ /**
1361
+ * Overridden to re-populate the tree.
1362
+ *
1363
+ * @param fullUpdate Indicates whether to update the control layout as well as the content.
1364
+ */
1365
+ refresh(fullUpdate?: boolean): void;
1366
+ _updateFocus(oldNode: TreeNode): void;
1367
+ private _updateTabIndex;
1368
+ protected _setTabOrder(value: number): void;
1369
+ _raiseCheckedItemsChanged(): void;
1370
+ _reload(): void;
1371
+ _createNode(dataItem: any): TreeNode;
1372
+ private _mousedown;
1373
+ private _click;
1374
+ private _keydown;
1375
+ private _keypress;
1376
+ private _findNext;
1377
+ private _loadTree;
1378
+ private _addItem;
1379
+ private _collapseToLevel;
1380
+ _lazyLoadNode(node: TreeNode): void;
1381
+ private _lazyLoadCallback;
1382
+ private _lazyLoadNodeDone;
1383
+ private isTxtSelected;
1384
+ }
1385
+ /**
1386
+ * Class that handles drag/drop operations for a {@link TreeView}.
1387
+ */
1388
+ export declare class _TreeDragDropManager {
1389
+ private _tree;
1390
+ private _dragstartBnd;
1391
+ private _dragoverBnd;
1392
+ private _dragendBnd;
1393
+ private _dropBnd;
1394
+ private static _dMarker;
1395
+ private static _drgSrc;
1396
+ /**
1397
+ * Initializes a new instance of a {@link _TreeViewDragDropManager}.
1398
+ *
1399
+ * @param treeView {@link TreeView} managed by this {@link _TreeViewDragDropManager}.
1400
+ */
1401
+ constructor(treeView: TreeView);
1402
+ /**
1403
+ * Disposes of this {@link _TreeViewDragDropManager}
1404
+ */
1405
+ dispose(): void;
1406
+ private _dragstart;
1407
+ private _dragover;
1408
+ private _drop;
1409
+ private _dragend;
1410
+ private _keydown;
1411
+ private _handleDragDrop;
1412
+ private _showDragMarker;
1413
+ }