wunderbaum 0.0.3 → 0.0.6

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/src/common.ts CHANGED
@@ -4,16 +4,13 @@
4
4
  * @VERSION, @DATE (https://github.com/mar10/wunderbaum)
5
5
  */
6
6
 
7
+ import { MatcherType } from "./types";
7
8
  import { escapeRegex } from "./util";
8
9
  import { WunderbaumNode } from "./wb_node";
9
- import { Wunderbaum } from "./wunderbaum";
10
-
11
- // export type WunderbaumOptions = any;
12
- export type MatcherType = (node: WunderbaumNode) => boolean;
13
- export type BoolOptionResolver = (node: WunderbaumNode) => boolean;
14
10
 
15
11
  export const DEFAULT_DEBUGLEVEL = 4; // Replaced by rollup script
16
12
  export const ROW_HEIGHT = 22;
13
+ // export const HEADER_HEIGHT = ROW_HEIGHT;
17
14
  export const ICON_WIDTH = 20;
18
15
  export const ROW_EXTRA_PAD = 7; // 2x $col-padding-x + 3px rounding errors
19
16
  export const RENDER_MIN_PREFETCH = 5;
@@ -22,86 +19,11 @@ export const TEST_IMG = new RegExp(/\.|\//); // strings are considered image url
22
19
  // export const RECURSIVE_REQUEST_ERROR = "$recursive_request";
23
20
  // export const INVALID_REQUEST_TARGET_ERROR = "$request_target_invalid";
24
21
 
25
- export type NodeAnyCallback = (node: WunderbaumNode) => any;
26
-
27
- export type NodeVisitResponse = "skip" | boolean | void;
28
- export type NodeVisitCallback = (node: WunderbaumNode) => NodeVisitResponse;
29
-
30
- // type WithWildcards<T> = T & { [key: string]: unknown };
31
- export type WbTreeEventType = {
32
- name: string;
33
- event: Event;
34
- tree: Wunderbaum;
35
- // node?: WunderbaumNode;
36
- [key: string]: unknown;
37
- };
38
- export type WbNodeEventType = WbTreeEventType & {
39
- node: WunderbaumNode;
40
- };
41
-
42
- export type WbTreeCallbackType = (e: WbTreeEventType) => any;
43
- export type WbNodeCallbackType = (e: WbNodeEventType) => any;
44
-
45
- export type FilterModeType = null | "dim" | "hide";
46
- export type ApplyCommandType =
47
- | "moveUp"
48
- | "moveDown"
49
- | "indent"
50
- | "outdent"
51
- | "remove"
52
- | "rename"
53
- | "addChild"
54
- | "addSibling"
55
- | "cut"
56
- | "copy"
57
- | "paste"
58
- | "down"
59
- | "first"
60
- | "last"
61
- | "left"
62
- | "pageDown"
63
- | "pageUp"
64
- | "parent"
65
- | "right"
66
- | "up";
67
-
68
- export type NodeFilterResponse = "skip" | "branch" | boolean | void;
69
- export type NodeFilterCallback = (node: WunderbaumNode) => NodeFilterResponse;
70
- export type AddNodeType = "before" | "after" | "prependChild" | "appendChild";
71
- export type DndModeType = "before" | "after" | "over";
72
-
73
- export enum ChangeType {
74
- any = "any",
75
- row = "row",
76
- structure = "structure",
77
- status = "status",
78
- vscroll = "vscroll",
79
- header = "header",
80
- }
81
-
82
- export enum NodeStatusType {
83
- ok = "ok",
84
- loading = "loading",
85
- error = "error",
86
- noData = "noData",
87
- // paging = "paging",
88
- }
89
-
90
- /**Define the subregion of a node, where an event occurred. */
91
- export enum TargetType {
92
- unknown = "",
93
- checkbox = "checkbox",
94
- column = "column",
95
- expander = "expander",
96
- icon = "icon",
97
- prefix = "prefix",
98
- title = "title",
99
- }
100
-
101
22
  export let iconMap = {
102
23
  error: "bi bi-exclamation-triangle",
103
- // loading: "bi bi-hourglass-split",
104
- loading: "bi bi-arrow-repeat wb-spin",
24
+ // loading: "bi bi-hourglass-split wb-busy",
25
+ loading: "bi bi-chevron-right wb-busy",
26
+ // loading: "bi bi-arrow-repeat wb-spin",
105
27
  // loading: '<div class="spinner-border spinner-border-sm" role="status"> <span class="visually-hidden">Loading...</span> </div>',
106
28
  // noData: "bi bi-search",
107
29
  noData: "bi bi-question-circle",
@@ -124,51 +46,9 @@ export let iconMap = {
124
46
 
125
47
  export const KEY_NODATA = "__not_found__";
126
48
 
127
- export enum NavigationModeOption {
128
- startRow = "startRow", // Start with row mode, but allow cell-nav mode
129
- cell = "cell", // Cell-nav mode only
130
- startCell = "startCell", // Start in cell-nav mode, but allow row mode
131
- row = "row", // Row mode only
132
- }
133
-
134
- export enum NavigationMode {
135
- row = "row",
136
- cellNav = "cellNav",
137
- cellEdit = "cellEdit",
138
- }
139
-
140
- export type SetActiveOptions = {
141
- /** Generate (de)activate event, even if node already has this status. */
142
- retrigger?: boolean;
143
- /** Don not generate (de)activate event. */
144
- noEvents?: boolean;
145
- /** Optional original event that will be passed to the (de)activat handler. */
146
- event?: Event;
147
- /** Call {@link setColumn}. */
148
- colIdx?: number;
149
- };
150
-
151
- export type SetExpandedOptions = {
152
- /** Ignore {@link minExpandLevel}. @default false */
153
- force?: boolean;
154
- /** Avoid smooth scrolling. @default false */
155
- noAnimation?: boolean;
156
- /** Do not send events. @default false */
157
- noEvents?: boolean;
158
- /** Scroll to bring expanded nodes into viewport. @default false */
159
- scrollIntoView?: boolean;
160
- };
161
-
162
- export type SetSelectedOptions = {
163
- /** Ignore restrictions. @default false */
164
- force?: boolean;
165
- /** Do not send events. @default false */
166
- noEvents?: boolean;
167
- };
168
-
169
49
  /** Define which keys are handled by embedded <input> control, and should
170
- * *not* be passed to tree navigation handler in cell-edit mode: */
171
- export const INPUT_KEYS = {
50
+ * *not* be passed to tree navigation handler in cell-edit mode. */
51
+ export const INPUT_KEYS: { [key: string]: Array<string> } = {
172
52
  text: ["left", "right", "home", "end", "backspace"],
173
53
  number: ["up", "down", "left", "right", "home", "end", "backspace"],
174
54
  checkbox: [],
@@ -178,10 +58,22 @@ export const INPUT_KEYS = {
178
58
  "select-multiple": ["up", "down"],
179
59
  };
180
60
 
61
+ /** Dict keys that are evaluated by source loader (others are added to `tree.data` instead). */
62
+ export const RESERVED_TREE_SOURCE_KEYS: Set<string> = new Set([
63
+ "children",
64
+ "columns",
65
+ "format", // reserved for future use
66
+ "keyMap", // reserved for future use
67
+ "positional", // reserved for future use
68
+ "typeList", // reserved for future use
69
+ "types",
70
+ "version", // reserved for future use
71
+ ]);
72
+
181
73
  /** Key codes that trigger grid navigation, even when inside an input element. */
182
- export const NAVIGATE_IN_INPUT_KEYS: Set<string> = new Set([
183
- "ArrowDown",
184
- "ArrowUp",
74
+ export const INPUT_BREAKOUT_KEYS: Set<string> = new Set([
75
+ // "ArrowDown",
76
+ // "ArrowUp",
185
77
  "Enter",
186
78
  "Escape",
187
79
  ]);
@@ -212,7 +104,7 @@ export const KEY_TO_ACTION_DICT: { [key: string]: string } = {
212
104
  Subtract: "collapse",
213
105
  };
214
106
 
215
- /** */
107
+ /** Return a callback that returns true if the node title contains a substring (case-insensitive). */
216
108
  export function makeNodeTitleMatcher(s: string): MatcherType {
217
109
  s = escapeRegex(s.toLowerCase());
218
110
  return function (node: WunderbaumNode) {
@@ -220,7 +112,7 @@ export function makeNodeTitleMatcher(s: string): MatcherType {
220
112
  };
221
113
  }
222
114
 
223
- /** */
115
+ /** Return a callback that returns true if the node title starts with a string (case-insensitive). */
224
116
  export function makeNodeTitleStartMatcher(s: string): MatcherType {
225
117
  s = escapeRegex(s);
226
118
  const reMatch = new RegExp("^" + s, "i");
package/src/deferred.ts CHANGED
@@ -8,9 +8,19 @@ type PromiseCallbackType = (val: any) => void;
8
8
  type finallyCallbackType = () => void;
9
9
 
10
10
  /**
11
- * Deferred is a ES6 Promise, that exposes the resolve() and reject()` method.
11
+ * Implement a ES6 Promise, that exposes a resolve() and reject() method.
12
12
  *
13
- * Loosely mimics [`jQuery.Deferred`](https://api.jquery.com/category/deferred-object/).
13
+ * Loosely mimics {@link https://api.jquery.com/category/deferred-object/ | jQuery.Deferred}.
14
+ * Example:
15
+ * ```js
16
+ * function foo() {
17
+ * let dfd = new Deferred(),
18
+ * ...
19
+ * dfd.resolve('foo')
20
+ * ...
21
+ * return dfd.promise();
22
+ * }
23
+ * ```
14
24
  */
15
25
  export class Deferred {
16
26
  private _promise: Promise<any>;
package/src/types.ts ADDED
@@ -0,0 +1,470 @@
1
+ /*!
2
+ * Wunderbaum - types
3
+ * Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
4
+ * @VERSION, @DATE (https://github.com/mar10/wunderbaum)
5
+ */
6
+
7
+ import { WunderbaumNode } from "./wb_node";
8
+ import { Wunderbaum } from "./wunderbaum";
9
+
10
+ // export type WunderbaumOptions = any;
11
+ export type MatcherType = (node: WunderbaumNode) => boolean;
12
+ export type BoolOptionResolver = (node: WunderbaumNode) => boolean;
13
+
14
+ export type NodeAnyCallback = (node: WunderbaumNode) => any;
15
+
16
+ export type NodeVisitResponse = "skip" | boolean | void;
17
+ export type NodeVisitCallback = (node: WunderbaumNode) => NodeVisitResponse;
18
+
19
+ // type WithWildcards<T> = T & { [key: string]: unknown };
20
+ export interface WbTreeEventType {
21
+ /** Name of the event. */
22
+ type: string;
23
+ /** The affected tree. */
24
+ tree: Wunderbaum;
25
+ /** Originating HTML event, e.g. `click` if any. */
26
+ event?: Event;
27
+ // [key: string]: unknown;
28
+ }
29
+
30
+ export interface WbNodeEventType extends WbTreeEventType {
31
+ /** The affected target node. */
32
+ node: WunderbaumNode;
33
+ /**
34
+ * Contains the node's type information, i.e. `tree.types[node.type]` if
35
+ * defined. Set to `{}` otherwise. @see {@link Wunderbaum.types}
36
+ */
37
+ typeInfo: NodeTypeDefinition;
38
+ }
39
+
40
+ export interface WbRenderEventType extends WbNodeEventType {
41
+ /**
42
+ * True if the node's markup was not yet created. In this case the render
43
+ * event should create embeddeb input controls (in addition to update the
44
+ * values according to to current node data).
45
+ */
46
+ isNew: boolean;
47
+ /** True if the node only displays the title and is stretched over all remaining columns. */
48
+ isColspan: boolean;
49
+ // /** */
50
+ // isDataChange: boolean;
51
+ /** The node's `<span class='wb-node'>` element. */
52
+ nodeElem: HTMLSpanElement;
53
+ /**
54
+ * Array of node's `<span class='wb-col'>` elements.
55
+ * The first element is `<span class='wb-node wb-col'>`, which contains the
56
+ * node title and icon (`idx: 0`, id: '*'`).
57
+ */
58
+ allColInfosById: ColumnEventInfos;
59
+ /**
60
+ * Array of node's `<span class='wb-node'>` elements, *that should be rendered*.
61
+ * In contrast to `allColInfosById`, the node title is not part of this array.
62
+ * If node.isColspan() is true, this array is empty (`[]`).
63
+ */
64
+ renderColInfosById: ColumnEventInfos;
65
+ }
66
+
67
+ /**
68
+ * Contains the node's type information, i.e. `tree.types[node.type]` if
69
+ * defined. @see {@link Wunderbaum.types}
70
+ */
71
+ export interface NodeTypeDefinition {
72
+ // /** Type ID that matches `node.type`. */
73
+ // id: string;
74
+ /** En/disable checkbox for matching nodes.*/
75
+ checkbox?: boolean | BoolOptionResolver;
76
+ /** En/disable checkbox for matching nodes.*/
77
+ colspan?: boolean | BoolOptionResolver;
78
+ /** Optional class names that are added to all `div.wb-row` elements of matching nodes.*/
79
+ classes?: string;
80
+ /**Default icon for matching nodes.*/
81
+ icon?: boolean | string | BoolOptionResolver;
82
+ /**
83
+ * See also {@link WunderbaumNode.getOption|WunderbaumNode.getOption()}
84
+ * to evaluate `node.NAME` setting and `tree.types[node.type].NAME`.
85
+ */
86
+ // and more
87
+ [key: string]: unknown;
88
+ // _any: any;
89
+ }
90
+
91
+ // /**
92
+ // * Contains the node's type information, i.e. `tree.types[node.type]` if
93
+ // * defined. @see {@link Wunderbaum.types}
94
+ // */
95
+ // export type NodeTypeInfo = {
96
+ // icon?: string;
97
+ // classes?: string;
98
+ // // and more
99
+ // [key: string]: unknown;
100
+ // };
101
+ export type NodeTypeDefinitions = { [type: string]: NodeTypeDefinition };
102
+
103
+ /**
104
+ * @see {@link `Wunderbaum.columns`}
105
+ */
106
+ export interface ColumnDefinition {
107
+ /** Column ID as defined in `tree.columns` definition ("*" for title column). */
108
+ id: string;
109
+ // /** */
110
+ // idx: number;
111
+ /** Column header (defaults to id) */
112
+ title: string;
113
+ /** Column header tooltip (optional) */
114
+ tooltip?: string;
115
+ /** Column width or weight.
116
+ * Either an absolute pixel value (e.g. `"50px"`) or a relative weight (e.g. `1`)
117
+ * that is used to calculate the width inside the remaining available space.
118
+ * Default: `"*"`, which is interpreted as `1`.
119
+ */
120
+ width?: string | number;
121
+ /** Only used for columns with a relative weight.
122
+ * Default: `4px`.
123
+ */
124
+ minWidth?: string | number;
125
+ /** Optional class names that are added to all `span.wb-col` elements of that column.*/
126
+ classes?: string;
127
+ /** Optional HTML content that is rendered into all `span.wb-col` elements of that column.*/
128
+ html?: string;
129
+ // Internal use:
130
+ _weight?: number;
131
+ _widthPx?: number;
132
+ _ofsPx?: number;
133
+ }
134
+ export type ColumnDefinitionList = Array<ColumnDefinition>;
135
+
136
+ export interface ColumnEventInfo {
137
+ /** Column ID as defined in `tree.columns` definition ("*" for title column). */
138
+ id: string;
139
+ /** Column index (0: leftmost title column). */
140
+ idx: number;
141
+ /** The cell's `<span class='wb-col'>` element (null for plain trees). */
142
+ elem: HTMLSpanElement | null;
143
+ /** The value of `tree.columns[]` for the current index. */
144
+ info: ColumnDefinition;
145
+ }
146
+ export type ColumnEventInfos = { [colId: string]: ColumnEventInfo };
147
+
148
+ export type WbTreeCallbackType = (e: WbTreeEventType) => any;
149
+ export type WbNodeCallbackType = (e: WbNodeEventType) => any;
150
+ export type WbRenderCallbackType = (e: WbRenderEventType) => void;
151
+
152
+ export type FilterModeType = null | "dim" | "hide";
153
+ export type ApplyCommandType =
154
+ | "moveUp"
155
+ | "moveDown"
156
+ | "indent"
157
+ | "outdent"
158
+ | "remove"
159
+ | "rename"
160
+ | "addChild"
161
+ | "addSibling"
162
+ | "cut"
163
+ | "copy"
164
+ | "paste"
165
+ | "down"
166
+ | "first"
167
+ | "last"
168
+ | "left"
169
+ | "pageDown"
170
+ | "pageUp"
171
+ | "parent"
172
+ | "right"
173
+ | "up";
174
+
175
+ export type NodeFilterResponse = "skip" | "branch" | boolean | void;
176
+ export type NodeFilterCallback = (node: WunderbaumNode) => NodeFilterResponse;
177
+ export type AddNodeType = "before" | "after" | "prependChild" | "appendChild";
178
+ export type DndModeType = "before" | "after" | "over";
179
+
180
+ /** Possible values for `setModified()`. */
181
+ export enum ChangeType {
182
+ /** Re-render the whole viewport, headers, and all rows. */
183
+ any = "any",
184
+ /** Update current row title, icon, columns, and status. */
185
+ data = "data",
186
+ /** Redraw the header and update the width of all row columns. */
187
+ header = "header",
188
+ /** Re-render the whole current row. */
189
+ row = "row",
190
+ /** Alias for 'any'. */
191
+ structure = "structure",
192
+ /** Update current row's classes, to reflect active, selected, ... */
193
+ status = "status",
194
+ /** Update the 'top' property of all rows. */
195
+ vscroll = "vscroll",
196
+ }
197
+
198
+ /** Possible values for `setStatus()`. */
199
+ export enum NodeStatusType {
200
+ ok = "ok",
201
+ loading = "loading",
202
+ error = "error",
203
+ noData = "noData",
204
+ // paging = "paging",
205
+ }
206
+
207
+ /** Define the subregion of a node, where an event occurred. */
208
+ export enum TargetType {
209
+ unknown = "",
210
+ checkbox = "checkbox",
211
+ column = "column",
212
+ expander = "expander",
213
+ icon = "icon",
214
+ prefix = "prefix",
215
+ title = "title",
216
+ }
217
+
218
+ /** Initial navigation mode and possible transition. */
219
+ export enum NavigationOptions {
220
+ startRow = "startRow", // Start with row mode, but allow cell-nav mode
221
+ cell = "cell", // Cell-nav mode only
222
+ startCell = "startCell", // Start in cell-nav mode, but allow row mode
223
+ row = "row", // Row mode only
224
+ }
225
+
226
+ // /** Tree's current navigation mode (see `tree.setNavigationMode()`). */
227
+ // export enum NavigationMode {
228
+ // row = "row",
229
+ // cellNav = "cellNav",
230
+ // // cellEdit = "cellEdit",
231
+ // }
232
+
233
+ /** Possible values for `node.makeVisible()`. */
234
+ export interface MakeVisibleOptions {
235
+ /** Do not animate expand (currently not implemented). @default false */
236
+ noAnimation?: boolean;
237
+ /** Scroll node into visible viewport area if required. @default true */
238
+ scrollIntoView?: boolean;
239
+ /** Do not send events. @default false */
240
+ noEvents?: boolean;
241
+ }
242
+
243
+ /** Possible values for `node.scrollIntoView()`. */
244
+ export interface ScrollIntoViewOptions {
245
+ /** Do not animate (currently not implemented). @default false */
246
+ noAnimation?: boolean;
247
+ /** Do not send events. @default false */
248
+ noEvents?: boolean;
249
+ /** Keep this node visible at the top in any case. */
250
+ topNode?: WunderbaumNode;
251
+ /** Add N pixel offset at top. */
252
+ ofsY?: number;
253
+ }
254
+
255
+ /** Possible values for `tree.scrollTo()`. */
256
+ export interface ScrollToOptions extends ScrollIntoViewOptions {
257
+ /** Which node to scroll into the viewport.*/
258
+ node: WunderbaumNode;
259
+ }
260
+
261
+ /** Possible values for `node.setActive()`. */
262
+ export interface SetActiveOptions {
263
+ /** Generate (de)activate event, even if node already has this status (default: false). */
264
+ retrigger?: boolean;
265
+ /** Do not generate (de)activate event (default: false). */
266
+ noEvents?: boolean;
267
+ /** Set node as focused node (default: true). */
268
+ focusNode?: boolean;
269
+ /** Set node as focused node (default: false). */
270
+ focusTree?: boolean;
271
+ /** Optional original event that will be passed to the (de)activate handler. */
272
+ event?: Event;
273
+ /** Call {@link setColumn}. */
274
+ colIdx?: number;
275
+ }
276
+
277
+ /** Possible values for `node.setExpanded()`. */
278
+ export interface SetExpandedOptions {
279
+ /** Ignore {@link minExpandLevel}. @default false */
280
+ force?: boolean;
281
+ /** Immediately update viewport (async otherwise). @default false */
282
+ immediate?: boolean;
283
+ /** Do not animate expand (currently not implemented). @default false */
284
+ noAnimation?: boolean;
285
+ /** Do not send events. @default false */
286
+ noEvents?: boolean;
287
+ /** Scroll up to bring expanded nodes into viewport. @default false */
288
+ scrollIntoView?: boolean;
289
+ }
290
+
291
+ /** Possible values for `node.setSetModified()`. */
292
+ export interface SetModifiedOptions {
293
+ /** Force immediate redraw instead of throttled/async mode. @default false */
294
+ immediate?: boolean;
295
+ /** Remove HTML markup of all rendered nodes before redraw. @default false */
296
+ removeMarkup?: boolean;
297
+ }
298
+
299
+ /** Possible values for `node.setSelected()`. */
300
+ export interface SetSelectedOptions {
301
+ /** Ignore restrictions. @default false */
302
+ force?: boolean;
303
+ /** Do not send events. @default false */
304
+ noEvents?: boolean;
305
+ }
306
+
307
+ /** Possible values for `node.setSetModified()`. */
308
+ export interface SetStatusOptions {
309
+ /** Displayed as status node title. */
310
+ message?: string;
311
+ /** Used as tooltip. */
312
+ details?: string;
313
+ }
314
+
315
+ /* -----------------------------------------------------------------------------
316
+ * wb_ext_dnd
317
+ */
318
+ export type DropRegionType = "over" | "before" | "after";
319
+ export type DropRegionTypeSet = Set<DropRegionType>;
320
+ // type AllowedDropRegionType =
321
+ // | "after"
322
+ // | "afterBefore"
323
+ // // | "afterBeforeOver" // == all == true
324
+ // | "afterOver"
325
+ // | "all" // == true
326
+ // | "before"
327
+ // | "beforeOver"
328
+ // | "none" // == false == "" == null
329
+ // | "over"; // == "child"
330
+
331
+ export type DndOptionsType = {
332
+ /**
333
+ * Expand nodes after n milliseconds of hovering
334
+ * Default: 1500
335
+ */
336
+ autoExpandMS: 1500;
337
+ // /**
338
+ // * Additional offset for drop-marker with hitMode = "before"/"after"
339
+ // * Default:
340
+ // */
341
+ // dropMarkerInsertOffsetX: -16;
342
+ // /**
343
+ // * Absolute position offset for .fancytree-drop-marker relatively to ..fancytree-title (icon/img near a node accepting drop)
344
+ // * Default:
345
+ // */
346
+ // dropMarkerOffsetX: -24;
347
+ // /**
348
+ // * Root Container used for drop marker (could be a shadow root)
349
+ // * (#1021 `document.body` is not available yet)
350
+ // * Default:
351
+ // */
352
+ // dropMarkerParent: "body";
353
+ /**
354
+ * true: Drag multiple (i.e. selected) nodes. Also a callback() is allowed
355
+ * Default: false
356
+ */
357
+ multiSource: false;
358
+ /**
359
+ * Restrict the possible cursor shapes and modifier operations (can also be set in the dragStart event)
360
+ * Default: "all"
361
+ */
362
+ effectAllowed: "all";
363
+ // /**
364
+ // * 'copy'|'link'|'move'|'auto'(calculate from `effectAllowed`+modifier keys) or callback(node, data) that returns such string.
365
+ // * Default:
366
+ // */
367
+ // dropEffect: "auto";
368
+ /**
369
+ * Default dropEffect ('copy', 'link', or 'move') when no modifier is pressed (overide in dragDrag, dragOver).
370
+ * Default: "move"
371
+ */
372
+ dropEffectDefault: string;
373
+ /**
374
+ * Prevent dropping nodes from different Wunderbaum trees
375
+ * Default: false
376
+ */
377
+ preventForeignNodes: boolean;
378
+ /**
379
+ * Prevent dropping items on unloaded lazy Wunderbaum tree nodes
380
+ * Default: true
381
+ */
382
+ preventLazyParents: boolean;
383
+ /**
384
+ * Prevent dropping items other than Wunderbaum tree nodes
385
+ * Default: false
386
+ */
387
+ preventNonNodes: boolean;
388
+ /**
389
+ * Prevent dropping nodes on own descendants
390
+ * Default: true
391
+ */
392
+ preventRecursion: boolean;
393
+ /**
394
+ * Prevent dropping nodes under same direct parent
395
+ * Default: false
396
+ */
397
+ preventSameParent: false;
398
+ /**
399
+ * Prevent dropping nodes 'before self', etc. (move only)
400
+ * Default: true
401
+ */
402
+ preventVoidMoves: boolean;
403
+ /**
404
+ * Enable auto-scrolling while dragging
405
+ * Default: true
406
+ */
407
+ scroll: boolean;
408
+ /**
409
+ * Active top/bottom margin in pixel
410
+ * Default: 20
411
+ */
412
+ scrollSensitivity: 20;
413
+ /**
414
+ * Pixel per event
415
+ * Default: 5
416
+ */
417
+ scrollSpeed: 5;
418
+ // /**
419
+ // * Allow dragging of nodes to different IE windows
420
+ // * Default: false
421
+ // */
422
+ // setTextTypeJson: boolean;
423
+ /**
424
+ * Optional callback passed to `toDict` on dragStart @since 2.38
425
+ * Default: null
426
+ */
427
+ sourceCopyHook: null;
428
+ // Events (drag support)
429
+ /**
430
+ * Callback(sourceNode, data), return true, to enable dnd drag
431
+ * Default: null
432
+ */
433
+ dragStart?: WbNodeEventType;
434
+ /**
435
+ * Callback(sourceNode, data)
436
+ * Default: null
437
+ */
438
+ dragDrag: null;
439
+ /**
440
+ * Callback(sourceNode, data)
441
+ * Default: null
442
+ */
443
+ dragEnd: null;
444
+ // Events (drop support)
445
+ /**
446
+ * Callback(targetNode, data), return true, to enable dnd drop
447
+ * Default: null
448
+ */
449
+ dragEnter: null;
450
+ /**
451
+ * Callback(targetNode, data)
452
+ * Default: null
453
+ */
454
+ dragOver: null;
455
+ /**
456
+ * Callback(targetNode, data), return false to prevent autoExpand
457
+ * Default: null
458
+ */
459
+ dragExpand: null;
460
+ /**
461
+ * Callback(targetNode, data)
462
+ * Default: null
463
+ */
464
+ dragDrop: null;
465
+ /**
466
+ * Callback(targetNode, data)
467
+ * Default: null
468
+ */
469
+ dragLeave: null;
470
+ };