wunderbaum 0.4.0 → 0.5.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/wunderbaum.css +4 -3
- package/dist/wunderbaum.css.map +1 -1
- package/dist/wunderbaum.d.ts +118 -47
- package/dist/wunderbaum.esm.js +81 -63
- package/dist/wunderbaum.esm.min.js +21 -21
- package/dist/wunderbaum.esm.min.js.map +1 -1
- package/dist/wunderbaum.umd.js +81 -63
- package/dist/wunderbaum.umd.min.js +21 -21
- package/dist/wunderbaum.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/common.ts +44 -24
- package/src/types.ts +80 -19
- package/src/wb_ext_dnd.ts +1 -1
- package/src/wb_node.ts +27 -26
- package/src/wb_options.ts +24 -4
- package/src/wunderbaum.scss +16 -3
- package/src/wunderbaum.ts +23 -1
package/dist/wunderbaum.css
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license.
|
|
5
5
|
* @VERSION, @DATE (https://github.com/mar10/wunderbaum)
|
|
6
6
|
*/
|
|
7
|
-
:root
|
|
7
|
+
:root,
|
|
8
|
+
:host {
|
|
8
9
|
--wb-font-stack: Helvetica, sans-serif;
|
|
9
10
|
--wb-error-color: #b5373b;
|
|
10
11
|
--wb-node-text-color: #56534c;
|
|
@@ -347,13 +348,13 @@ div.wunderbaum div.wb-row.wb-drop-target .wb-node .wb-icon {
|
|
|
347
348
|
div.wunderbaum div.wb-row.wb-drop-target .wb-node .wb-icon::after {
|
|
348
349
|
position: absolute;
|
|
349
350
|
z-index: 1000;
|
|
350
|
-
content: url(
|
|
351
|
+
content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAQCAMAAABA3o1rAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACKUExURe/v9/f39+//7+f35+f/79bW5wgIawwYd97e55Tnpc731rjA2d7350LOY1LWa7Xvvf///wAQcyAze97e773vxnuczgA5pQBCpdb33rXvxu//9whjxgBaxlKU1oOz5ABz3gB73tbn99bW1rXe/wCM9xiU997v/97e3gCc/xil/9bv/wic/+/3/wAAALM9X5QAAAAudFJOU////////////////////////////////////////////////////////////wCCj3NVAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAqUlEQVQoU6WQ2w6CMAxA54agsCHq1HlFBREv/f/fs1tHAoaoiedlbXrWtGXwhV8FNqAXuAi4DwkShmE0cgGIcSwCCgkSkrAxpEonot0DhQxJptFsbnOpdNdgsFh6VtYwyqzTmG+oijDY7hr22E4qY7QybeGQe46nsxP0Wwc3Q1GWl+qKec8MlqKubxX+xzV7tkDuD1+3d+heigT2zGx/hCMUeUj4wL8CwAsW1kqCTugMCwAAAABJRU5ErkJggg==);
|
|
351
352
|
left: 0;
|
|
352
353
|
top: calc((22px - --wb-icon-height) / 2);
|
|
353
354
|
}
|
|
354
355
|
div.wunderbaum div.wb-row.wb-drop-target.wb-drop-before .wb-node .wb-icon::after,
|
|
355
356
|
div.wunderbaum div.wb-row.wb-drop-target.wb-drop-after .wb-node .wb-icon::after {
|
|
356
|
-
content: url(
|
|
357
|
+
content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAMAAACROYkbAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACNUExURe/v9/f39+//7+f35+f/79bW5wgIawwYd97e55Tnpc731rjA2d7350LOY1LWa7Xvvf///wAQcyAze97e773vxgAAAHuczgA5pQBCpdb33rXvxu//9whjxgBaxlKU1oOz5ABz3gB73tbn99bW1rXe/wCM9xiU997v/97e3gCc/xil/9bv/wic/+/3/wAAAParqS4AAAAvdFJOU/////////////////////////////////////////////////////////////8AWqU49wAAAAlwSFlzAAAOwwAADsMBx2+oZAAAALlJREFUOE/FktsSgiAQhglMS8WstKLzQTM77Ps/XguL16I208cFyzB8/LPAYCC/ErARzcCFx23pBgnGfjAxBYhpKDwq3SBB5DeGWCYz0SUDClIkmgeLpV7HMiNDbrbbYbBaWzbaoKTaJiHfQe5oYLA/NBwxTiyVyqTSghYwox4MTmfL5XozgqxjAtODoizv1QPXPXqgKer6WeH9+Iw9XgF5ve15/Q+6/SQSsE+q8yMcocoREgzg3wKAL4vrpBIKREShAAAAAElFTkSuQmCC);
|
|
357
358
|
left: 0;
|
|
358
359
|
top: calc((22px - --wb-icon-height) / 2 - 11px);
|
|
359
360
|
}
|
package/dist/wunderbaum.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../src/wunderbaum.scss"],"names":[],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AA2EA;
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../src/wunderbaum.scss"],"names":[],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AA2EA;AAAA;EAME;EAGA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAGA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EAEA;;;AAMF;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;EACA;EAGA;AAsBA;AAuBA;AAkQA;AAoHA;AAwBA;AAgEA;AAEA;AAUA;AAoBA;AAYA;;AAniBA;EAEE;;AAIF;EACE;EACA;;AAGF;EACE;EAEA;;AAMF;EACE;EACA;EACA;;AAGF;AAAA;EAEE;;AAKF;EACE;EACA;EACA;EACA;EACA;;AAMA;EACE;EACA;EACA;EACA;;AAIA;EACE;;AAKF;EAEE;;AAGF;EAEE;;AAGF;EACE;;AAOA;EAEE;EACA;;AAEA;EACE;;AAaN;EAEE;EACA;;AAEA;EACE;;AAON;EACE;;AAEA;EACE;;AAOF;EACE;;AAGF;EAEE;;AAGA;EACE;;AAKJ;EACE;EACA;;AAGF;EAEE;EACA;;AAEA;EAEE;;AAIJ;EACE;;AAGF;AAAA;AAAA;EAGE;EAcA;EASA;;AAGF;EAEE;;AAON;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;EAIA;;AAIF;EACE;EACA;EACA;EACA;;AAGF;EACE;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;;AAIJ;EACE;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAIJ;EACE;AAeA;;AAVA;AAAA;AAAA;AAAA;EAIE;EACA;EACA;EACA;;AAIF;EACE;;AAGF;EACE;EACA;EACA;;AAMA;EACE;;AAIJ;AAAA;EAEE;EACA;EACA;EACA;;AAGF;EACE;EAEA;EACA;EACA;EACA;EACA;;AAUI;EACE;;AAON;EACE;;AAIJ;EACE;;AAEA;EACE;;AAIF;EACE;;AAGF;EACE;;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;EAgBE;EACA;EACA;;AAGF;AAAA;EAEE;;AAcA;EACE;;AAWJ;EACE;;AAGF;EACE;;AAEA;EACE;;AAON;EACE;;AAEA;EACE;;AAQJ;EACE;;AASJ;EACE;;AAEA;EACE;;AAGF;EACE;;AAcN;EACE;;AAEA;EACE;;AAIJ;EACE;;AAEA;EACE;EACA;;AAGA;EACE;EACA;;AAEA;EAGE;EACA;EAGA;EACA;EACA;;AAgBR;AAAA;EAIE;EACA;EACA;;AAKF;EACE;;AAUE;AAAA;EAEE;;AAFF;AAAA;EAEE;;AAFF;AAAA;EAEE;;AAFF;AAAA;EAEE;;AAOJ;EAIE;EACA;;AAGF;AAAA;EAKE;EACA;;AAMF;AAAA;EAEE;EACA;EACA;EACA;;AAOF;EACE;;AAGF;AAAA;EAEE;;AAKA;EACE;;;AAMR;AAEA;EACE;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;;AAEA;EACE;EACA;;;AAQJ;AACA;AAAA;EAEE;;;AAGF;AAAA;EAEE;;;AAIA;AAAA;EAEE;;AAGF;AAAA;EAEE;;;AAIJ;AAAA;AAAA;AAMA;EACE;EACA;;;AAGF;EAEE;EACA;;;AAGF;EACE;IACE;;EAGF;IACE;;;AAIJ;EACE;IACE;;EAGF;IACE;;;AAIJ;EACE;IACE;;EAGF;IACE","file":"wunderbaum.css"}
|
package/dist/wunderbaum.d.ts
CHANGED
|
@@ -285,23 +285,10 @@ declare module "common" {
|
|
|
285
285
|
* Default node icons.
|
|
286
286
|
* Requires bootstrap icons https://icons.getbootstrap.com
|
|
287
287
|
*/
|
|
288
|
-
export const
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
expanderExpanded: string;
|
|
293
|
-
expanderCollapsed: string;
|
|
294
|
-
expanderLazy: string;
|
|
295
|
-
checkChecked: string;
|
|
296
|
-
checkUnchecked: string;
|
|
297
|
-
checkUnknown: string;
|
|
298
|
-
radioChecked: string;
|
|
299
|
-
radioUnchecked: string;
|
|
300
|
-
radioUnknown: string;
|
|
301
|
-
folder: string;
|
|
302
|
-
folderOpen: string;
|
|
303
|
-
folderLazy: string;
|
|
304
|
-
doc: string;
|
|
288
|
+
export const iconMaps: {
|
|
289
|
+
[key: string]: {
|
|
290
|
+
[key: string]: string;
|
|
291
|
+
};
|
|
305
292
|
};
|
|
306
293
|
export const KEY_NODATA = "__not_found__";
|
|
307
294
|
/** Define which keys are handled by embedded <input> control, and should
|
|
@@ -371,7 +358,7 @@ declare module "deferred" {
|
|
|
371
358
|
}
|
|
372
359
|
declare module "wb_node" {
|
|
373
360
|
import { Wunderbaum } from "wunderbaum";
|
|
374
|
-
import { AddChildrenOptions, InsertNodeType, ApplyCommandOptions, ApplyCommandType, ChangeType, ExpandAllOptions, MakeVisibleOptions, MatcherCallback, NavigateOptions, NodeAnyCallback, NodeStatusType, NodeStringCallback, NodeVisitCallback, NodeVisitResponse, RenderOptions, ScrollIntoViewOptions, SetActiveOptions, SetExpandedOptions, SetSelectedOptions, SetStatusOptions, SortCallback, NodeToDictCallback, WbNodeData, TristateType } from "types";
|
|
361
|
+
import { AddChildrenOptions, InsertNodeType, ApplyCommandOptions, ApplyCommandType, ChangeType, ExpandAllOptions, MakeVisibleOptions, MatcherCallback, NavigateOptions, NodeAnyCallback, NodeStatusType, NodeStringCallback, NodeVisitCallback, NodeVisitResponse, RenderOptions, ScrollIntoViewOptions, SetActiveOptions, SetExpandedOptions, SetSelectedOptions, SetStatusOptions, SortCallback, NodeToDictCallback, WbNodeData, TristateType, CheckboxOption, IconOption, SourceType } from "types";
|
|
375
362
|
/**
|
|
376
363
|
* A single tree node.
|
|
377
364
|
*
|
|
@@ -397,27 +384,27 @@ declare module "wb_node" {
|
|
|
397
384
|
*/
|
|
398
385
|
readonly refKey: string | undefined;
|
|
399
386
|
children: WunderbaumNode[] | null;
|
|
400
|
-
checkbox?:
|
|
387
|
+
checkbox?: CheckboxOption;
|
|
401
388
|
radiogroup?: boolean;
|
|
402
389
|
/** If true, (in grid mode) no cells are rendered, except for the node title.*/
|
|
403
390
|
colspan?: boolean;
|
|
404
|
-
icon?:
|
|
405
|
-
lazy
|
|
391
|
+
icon?: IconOption;
|
|
392
|
+
lazy?: boolean;
|
|
406
393
|
/** Expansion state.
|
|
407
394
|
* @see {@link isExpandable}, {@link isExpanded}, {@link setExpanded}. */
|
|
408
|
-
expanded
|
|
395
|
+
expanded?: boolean;
|
|
409
396
|
/** Selection state.
|
|
410
397
|
* @see {@link isSelected}, {@link setSelected}, {@link toggleSelected}. */
|
|
411
|
-
selected
|
|
398
|
+
selected?: boolean;
|
|
412
399
|
unselectable?: boolean;
|
|
413
400
|
type?: string;
|
|
414
|
-
tooltip?: string;
|
|
401
|
+
tooltip?: string | boolean;
|
|
415
402
|
/** Additional classes added to `div.wb-row`.
|
|
416
403
|
* @see {@link hasClass}, {@link setClass}. */
|
|
417
404
|
classes: Set<string> | null;
|
|
418
405
|
/** Custom data that was passed to the constructor */
|
|
419
406
|
data: any;
|
|
420
|
-
statusNodeType?:
|
|
407
|
+
statusNodeType?: NodeStatusType;
|
|
421
408
|
_isLoading: boolean;
|
|
422
409
|
_requestId: number;
|
|
423
410
|
_errorInfo: any | null;
|
|
@@ -666,7 +653,7 @@ declare module "wb_node" {
|
|
|
666
653
|
protected _loadSourceObject(source: any, level?: number): void;
|
|
667
654
|
_fetchWithOptions(source: any): Promise<any>;
|
|
668
655
|
/** Download data from the cloud, then call `.update()`. */
|
|
669
|
-
load(source:
|
|
656
|
+
load(source: SourceType): Promise<void>;
|
|
670
657
|
/**Load content of a lazy node. */
|
|
671
658
|
loadLazy(forceReload?: boolean): Promise<void>;
|
|
672
659
|
/** Alias for `logDebug` */
|
|
@@ -703,7 +690,7 @@ declare module "wb_node" {
|
|
|
703
690
|
/** Remove all HTML markup from the DOM. */
|
|
704
691
|
removeMarkup(): void;
|
|
705
692
|
protected _getRenderInfo(): any;
|
|
706
|
-
protected _createIcon(parentElem: HTMLElement, replaceChild: HTMLElement | null, showLoading: boolean): HTMLElement | null;
|
|
693
|
+
protected _createIcon(iconMap: any, parentElem: HTMLElement, replaceChild: HTMLElement | null, showLoading: boolean): HTMLElement | null;
|
|
707
694
|
/**
|
|
708
695
|
* Create a whole new `<div class="wb-row">` element.
|
|
709
696
|
* @see {@link WunderbaumNode._render}
|
|
@@ -879,7 +866,7 @@ declare module "wb_options" {
|
|
|
879
866
|
* Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license.
|
|
880
867
|
* @VERSION, @DATE (https://github.com/mar10/wunderbaum)
|
|
881
868
|
*/
|
|
882
|
-
import {
|
|
869
|
+
import { ColumnDefinitionList, DndOptionsType, DynamicBoolOption, DynamicBoolOrStringOption, DynamicCheckboxOption, DynamicIconOption, NavModeEnum, NodeTypeDefinitionMap, SelectModeType, WbActivateEventType, WbChangeEventType, WbClickEventType, WbDeactivateEventType, WbEnhanceTitleEventType, WbErrorEventType, WbInitEventType, WbKeydownEventType, WbNodeData, WbNodeEventType, WbReceiveEventType, WbRenderEventType, WbTreeEventType } from "types";
|
|
883
870
|
/**
|
|
884
871
|
* Available options for [[Wunderbaum]].
|
|
885
872
|
*
|
|
@@ -978,6 +965,15 @@ declare module "wb_options" {
|
|
|
978
965
|
* Default: 22
|
|
979
966
|
*/
|
|
980
967
|
rowHeightPx?: number;
|
|
968
|
+
/**
|
|
969
|
+
* Icon font definition. May be a string (e.g. "fontawesome6" or "bootstrap")
|
|
970
|
+
* or a map of `iconName: iconClass` pairs.
|
|
971
|
+
* Note: the icon font must be loaded separately.
|
|
972
|
+
* Default: "bootstrap"
|
|
973
|
+
*/
|
|
974
|
+
iconMap?: string | {
|
|
975
|
+
[key: string]: string;
|
|
976
|
+
};
|
|
981
977
|
/**
|
|
982
978
|
* Collapse siblings when a node is expanded.
|
|
983
979
|
* Default: false
|
|
@@ -1006,10 +1002,20 @@ declare module "wb_options" {
|
|
|
1006
1002
|
showSpinner?: boolean;
|
|
1007
1003
|
/**
|
|
1008
1004
|
* If true, render a checkbox before the node tile to allow selection with the
|
|
1009
|
-
* mouse.
|
|
1005
|
+
* mouse. Pass `"radio"` to render a radio button instead.
|
|
1010
1006
|
* Default: false.
|
|
1011
1007
|
*/
|
|
1012
|
-
checkbox?:
|
|
1008
|
+
checkbox?: DynamicCheckboxOption;
|
|
1009
|
+
/** Optional callback to render icons per node. */
|
|
1010
|
+
icon?: DynamicIconOption;
|
|
1011
|
+
/** Optional callback to render a tooltip for the icon. */
|
|
1012
|
+
iconTooltip?: DynamicBoolOrStringOption;
|
|
1013
|
+
/** Optional callback to render a tooltip for the node title.
|
|
1014
|
+
* Pass `true` to use the node's `title` property as tooltip.
|
|
1015
|
+
*/
|
|
1016
|
+
tooltip?: DynamicBoolOrStringOption;
|
|
1017
|
+
/** Optional callback to make a node unselectable. */
|
|
1018
|
+
unselectable?: DynamicBoolOption;
|
|
1013
1019
|
/**
|
|
1014
1020
|
* Default: true
|
|
1015
1021
|
*/
|
|
@@ -1160,6 +1166,36 @@ declare module "types" {
|
|
|
1160
1166
|
import { Wunderbaum } from "wunderbaum";
|
|
1161
1167
|
/** A value that can either be true, false, or undefined. */
|
|
1162
1168
|
export type TristateType = boolean | undefined;
|
|
1169
|
+
/** Show/hide checkbox or display a radiobutton icon instead. */
|
|
1170
|
+
export type CheckboxOption = boolean | "radio";
|
|
1171
|
+
/** An icon may either be
|
|
1172
|
+
* a string-tag that references an entry in the `iconMap` (e.g. `"folderOpen"`)),
|
|
1173
|
+
* an HTML string that contains a `<` and is used as-is,
|
|
1174
|
+
* an image URL string that contains a `.` or `/` and is rendered as `<img src='...'>`,
|
|
1175
|
+
* a class string such as `"bi bi-folder"`,
|
|
1176
|
+
* or a boolean value that indicates if the default icon should be used or hidden.
|
|
1177
|
+
*/
|
|
1178
|
+
export type IconOption = boolean | string;
|
|
1179
|
+
export interface SourceAjaxType {
|
|
1180
|
+
url: string;
|
|
1181
|
+
params?: any;
|
|
1182
|
+
body?: any;
|
|
1183
|
+
options?: RequestInit;
|
|
1184
|
+
}
|
|
1185
|
+
export type SourceListType = Array<WbNodeData>;
|
|
1186
|
+
export interface SourceObjectType {
|
|
1187
|
+
_format?: "nested" | "flat";
|
|
1188
|
+
types?: NodeTypeDefinitionMap;
|
|
1189
|
+
columns?: ColumnDefinitionList;
|
|
1190
|
+
children: SourceListType;
|
|
1191
|
+
_keyMap?: {
|
|
1192
|
+
[key: string]: string;
|
|
1193
|
+
};
|
|
1194
|
+
_typeList?: Array<string>;
|
|
1195
|
+
_positional?: Array<string>;
|
|
1196
|
+
}
|
|
1197
|
+
/** Possible initilization for tree nodes. */
|
|
1198
|
+
export type SourceType = string | SourceListType | SourceAjaxType | SourceObjectType;
|
|
1163
1199
|
/** Passed to `find...()` methods. Should return true if node matches. */
|
|
1164
1200
|
export type MatcherCallback = (node: WunderbaumNode) => boolean;
|
|
1165
1201
|
/** Passed to `sortChildren()` methods. Should return -1, 0, or 1. */
|
|
@@ -1180,17 +1216,39 @@ declare module "types" {
|
|
|
1180
1216
|
export type NodeToDictCallback = (dict: WbNodeData, node: WunderbaumNode) => NodeVisitResponse;
|
|
1181
1217
|
/** A callback that receives a node instance and returns a string value. */
|
|
1182
1218
|
export type NodeSelectCallback = (node: WunderbaumNode) => boolean | void;
|
|
1219
|
+
/**
|
|
1220
|
+
* See also {@link WunderbaumNode.getOption|WunderbaumNode.getOption()}
|
|
1221
|
+
* to evaluate `node.NAME` setting and `tree.types[node.type].NAME`.
|
|
1222
|
+
*/
|
|
1223
|
+
export type DynamicBoolOption = boolean | BoolOptionResolver;
|
|
1224
|
+
export type DynamicStringOption = string | BoolOptionResolver;
|
|
1225
|
+
export type DynamicBoolOrStringOption = boolean | string | BoolOrStringOptionResolver;
|
|
1226
|
+
export type DynamicCheckboxOption = CheckboxOption | BoolOrStringOptionResolver;
|
|
1227
|
+
export type DynamicIconOption = IconOption | BoolOrStringOptionResolver;
|
|
1183
1228
|
/** A plain object (dictionary) that represents a node instance. */
|
|
1184
1229
|
export interface WbNodeData {
|
|
1185
|
-
|
|
1230
|
+
checkbox?: CheckboxOption;
|
|
1231
|
+
children?: Array<WbNodeData>;
|
|
1232
|
+
classes?: string;
|
|
1233
|
+
colspan?: boolean;
|
|
1234
|
+
expanded?: boolean;
|
|
1235
|
+
icon?: IconOption;
|
|
1236
|
+
iconTooltip?: boolean | string;
|
|
1186
1237
|
key?: string;
|
|
1238
|
+
lazy?: boolean;
|
|
1239
|
+
/** Make child nodes single-select radio buttons. */
|
|
1240
|
+
radiogroup?: boolean;
|
|
1187
1241
|
refKey?: string;
|
|
1188
|
-
expanded?: boolean;
|
|
1189
1242
|
selected?: boolean;
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1243
|
+
statusNodeType?: NodeStatusType;
|
|
1244
|
+
title: string;
|
|
1245
|
+
tooltip?: boolean | string;
|
|
1246
|
+
type?: string;
|
|
1247
|
+
unselectable?: boolean;
|
|
1248
|
+
/** @internal */
|
|
1249
|
+
_treeId?: string;
|
|
1250
|
+
/** Other data is passed to `node.data` and can be accessed via `node.data.NAME` */
|
|
1251
|
+
[key: string]: unknown;
|
|
1194
1252
|
}
|
|
1195
1253
|
export interface WbTreeEventType {
|
|
1196
1254
|
/** Name of the event. */
|
|
@@ -1284,21 +1342,21 @@ declare module "types" {
|
|
|
1284
1342
|
}
|
|
1285
1343
|
/**
|
|
1286
1344
|
* Contains the node's type information, i.e. `tree.types[node.type]` if
|
|
1287
|
-
* defined.
|
|
1345
|
+
* defined.
|
|
1346
|
+
* @see {@link Wunderbaum.types} and {@link WunderbaumNode.getOption|WunderbaumNode.getOption()}
|
|
1347
|
+
* to evaluate `node.NAME` setting and `tree.types[node.type].NAME`.
|
|
1288
1348
|
*/
|
|
1289
1349
|
export interface NodeTypeDefinition {
|
|
1290
1350
|
/** En/disable checkbox for matching nodes. */
|
|
1291
|
-
checkbox?:
|
|
1351
|
+
checkbox?: CheckboxOption;
|
|
1292
1352
|
/** Optional class names that are added to all `div.wb-row` elements of matching nodes. */
|
|
1293
1353
|
classes?: string;
|
|
1294
1354
|
/** Only show title and hide other columns if any. */
|
|
1295
|
-
colspan?: boolean
|
|
1355
|
+
colspan?: boolean;
|
|
1296
1356
|
/** Default icon for matching nodes. */
|
|
1297
|
-
icon?:
|
|
1298
|
-
/**
|
|
1299
|
-
|
|
1300
|
-
* to evaluate `node.NAME` setting and `tree.types[node.type].NAME`.
|
|
1301
|
-
*/
|
|
1357
|
+
icon?: IconOption;
|
|
1358
|
+
/** Default icon for matching nodes. */
|
|
1359
|
+
iconTooltip?: string | boolean;
|
|
1302
1360
|
[key: string]: unknown;
|
|
1303
1361
|
}
|
|
1304
1362
|
export type NodeTypeDefinitionMap = {
|
|
@@ -1338,6 +1396,7 @@ declare module "types" {
|
|
|
1338
1396
|
_weight?: number;
|
|
1339
1397
|
_widthPx?: number;
|
|
1340
1398
|
_ofsPx?: number;
|
|
1399
|
+
[key: string]: unknown;
|
|
1341
1400
|
}
|
|
1342
1401
|
export type ColumnDefinitionList = Array<ColumnDefinition>;
|
|
1343
1402
|
/**
|
|
@@ -1419,7 +1478,8 @@ declare module "types" {
|
|
|
1419
1478
|
ok = "ok",
|
|
1420
1479
|
loading = "loading",
|
|
1421
1480
|
error = "error",
|
|
1422
|
-
noData = "noData"
|
|
1481
|
+
noData = "noData",
|
|
1482
|
+
paging = "paging"
|
|
1423
1483
|
}
|
|
1424
1484
|
/** Define the subregion of a node, where an event occurred. */
|
|
1425
1485
|
export enum NodeRegion {
|
|
@@ -2070,7 +2130,7 @@ declare module "wunderbaum" {
|
|
|
2070
2130
|
*/
|
|
2071
2131
|
import * as util from "util";
|
|
2072
2132
|
import { ExtensionsDict, WunderbaumExtension } from "wb_extension_base";
|
|
2073
|
-
import { ApplyCommandType, ChangeType, ColumnDefinitionList, ExpandAllOptions, FilterModeType, MatcherCallback, NavModeEnum, NodeStatusType, NodeStringCallback, NodeTypeDefinitionMap, ScrollToOptions, SetActiveOptions, UpdateOptions, SetStatusOptions, WbEventInfo, ApplyCommandOptions, AddChildrenOptions, VisitRowsOptions, NodeFilterCallback, FilterNodesOptions, RenderFlag, NodeVisitCallback, SortCallback, NodeToDictCallback, WbNodeData } from "types";
|
|
2133
|
+
import { ApplyCommandType, ChangeType, ColumnDefinitionList, ExpandAllOptions, FilterModeType, MatcherCallback, NavModeEnum, NodeStatusType, NodeStringCallback, NodeTypeDefinitionMap, ScrollToOptions, SetActiveOptions, UpdateOptions, SetStatusOptions, WbEventInfo, ApplyCommandOptions, AddChildrenOptions, VisitRowsOptions, NodeFilterCallback, FilterNodesOptions, RenderFlag, NodeVisitCallback, SortCallback, NodeToDictCallback, WbNodeData, DynamicCheckboxOption, SourceType, DynamicIconOption, DynamicStringOption, DynamicBoolOption } from "types";
|
|
2074
2134
|
import { WunderbaumNode } from "wb_node";
|
|
2075
2135
|
import { WunderbaumOptions } from "wb_options";
|
|
2076
2136
|
/**
|
|
@@ -2117,6 +2177,11 @@ declare module "wunderbaum" {
|
|
|
2117
2177
|
types: NodeTypeDefinitionMap;
|
|
2118
2178
|
/** List of column definitions. */
|
|
2119
2179
|
columns: ColumnDefinitionList;
|
|
2180
|
+
checkbox?: DynamicCheckboxOption;
|
|
2181
|
+
icon?: DynamicIconOption;
|
|
2182
|
+
iconTooltip?: DynamicStringOption;
|
|
2183
|
+
tooltip?: DynamicStringOption;
|
|
2184
|
+
unselectable?: DynamicBoolOption;
|
|
2120
2185
|
protected _columnsById: {
|
|
2121
2186
|
[key: string]: any;
|
|
2122
2187
|
};
|
|
@@ -2151,6 +2216,12 @@ declare module "wunderbaum" {
|
|
|
2151
2216
|
* ```
|
|
2152
2217
|
*/
|
|
2153
2218
|
static getTree(el?: Element | Event | number | string | WunderbaumNode): Wunderbaum | null;
|
|
2219
|
+
/**
|
|
2220
|
+
* Return the icon-function -> icon-definition mapping.
|
|
2221
|
+
*/
|
|
2222
|
+
get iconMap(): {
|
|
2223
|
+
[key: string]: string;
|
|
2224
|
+
};
|
|
2154
2225
|
/**
|
|
2155
2226
|
* Return a WunderbaumNode instance from element or event.
|
|
2156
2227
|
*/
|
|
@@ -2530,7 +2601,7 @@ declare module "wunderbaum" {
|
|
|
2530
2601
|
* Previous data is cleared. Note that also column- and type defintions may
|
|
2531
2602
|
* be passed with the `source` object.
|
|
2532
2603
|
*/
|
|
2533
|
-
load(source:
|
|
2604
|
+
load(source: SourceType): Promise<void>;
|
|
2534
2605
|
/**
|
|
2535
2606
|
* Disable render requests during operations that would trigger many updates.
|
|
2536
2607
|
*
|