wunderbaum 0.8.3 → 0.9.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 -1
- package/dist/wunderbaum.css.map +1 -1
- package/dist/wunderbaum.d.ts +105 -100
- package/dist/wunderbaum.esm.js +174 -133
- package/dist/wunderbaum.esm.min.js +32 -32
- package/dist/wunderbaum.esm.min.js.map +1 -1
- package/dist/wunderbaum.umd.js +174 -133
- package/dist/wunderbaum.umd.min.js +34 -34
- package/dist/wunderbaum.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/common.ts +1 -1
- package/src/debounce.ts +7 -12
- package/src/deferred.ts +1 -1
- package/src/drag_observer.ts +1 -1
- package/src/types.ts +34 -55
- package/src/util.ts +4 -4
- package/src/wb_ext_dnd.ts +1 -1
- package/src/wb_ext_edit.ts +1 -1
- package/src/wb_ext_filter.ts +66 -45
- package/src/wb_ext_grid.ts +1 -1
- package/src/wb_ext_keynav.ts +1 -1
- package/src/wb_ext_logger.ts +1 -1
- package/src/wb_extension_base.ts +1 -1
- package/src/wb_node.ts +26 -8
- package/src/wb_options.ts +1 -1
- package/src/wunderbaum.scss +7 -1
- package/src/wunderbaum.ts +32 -7
package/dist/wunderbaum.css
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
/*!
|
|
3
3
|
* Wunderbaum style sheet (generated from wunderbaum.scss)
|
|
4
|
-
* Copyright (c) 2021-
|
|
4
|
+
* Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
|
|
5
5
|
* @VERSION, @DATE (https://github.com/mar10/wunderbaum)
|
|
6
6
|
*/
|
|
7
7
|
:root,
|
|
@@ -333,6 +333,9 @@ div.wunderbaum.wb-ext-filter-dim div.wb-node-list div.wb-row.wb-submatch, div.wu
|
|
|
333
333
|
div.wunderbaum.wb-ext-filter-dim div.wb-node-list div.wb-row.wb-match, div.wunderbaum.wb-ext-filter-hide div.wb-node-list div.wb-row.wb-match {
|
|
334
334
|
color: var(--wb-node-text-color);
|
|
335
335
|
}
|
|
336
|
+
div.wunderbaum.wb-ext-filter-hide.wb-ext-filter-hide-expanders div.wb-node-list div.wb-row:not(.wb-submatch) i.wb-expander {
|
|
337
|
+
visibility: hidden;
|
|
338
|
+
}
|
|
336
339
|
div.wunderbaum div.wb-row.wb-drag-source {
|
|
337
340
|
opacity: 0.5;
|
|
338
341
|
}
|
package/dist/wunderbaum.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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;AAwQA;AAoHA;
|
|
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;AAwQA;AAoHA;AA8BA;AAgEA;AAEA;AAUA;AAoBA;AAYA;;AA/iBA;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;AAqBA;;AAhBA;AAAA;AAAA;AAAA;EAIE;EACA;EACA;EACA;;AAGF;AAAA;EAEE;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;;AAMJ;EACE;;AAaJ;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;EACE;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;;;AAIJ;AAAA;AAAA;AAMA;EACE;EACA;;;AAGF;EAGE;;;AAGF;EACE;;;AAKF;EACE;IACE;;EAGF;IACE;;;AAIJ;EACE;IACE;;EAGF;IACE;;;AAIJ;EACE;IACE;;EAGF;IACE","file":"wunderbaum.css"}
|
package/dist/wunderbaum.d.ts
CHANGED
|
@@ -6,12 +6,17 @@ declare module "debounce" {
|
|
|
6
6
|
*/
|
|
7
7
|
type Procedure = (...args: any[]) => any;
|
|
8
8
|
type DebounceOptions = {
|
|
9
|
+
/** Specify invoking on the leading edge of the timeout. @default false */
|
|
9
10
|
leading?: boolean;
|
|
11
|
+
/** The maximum time `func` is allowed to be delayed before it's invoked.*/
|
|
10
12
|
maxWait?: number;
|
|
13
|
+
/** Specify invoking on the trailing edge of the timeout. @default true */
|
|
11
14
|
trailing?: boolean;
|
|
12
15
|
};
|
|
13
16
|
type ThrottleOptions = {
|
|
17
|
+
/** Specify invoking on the leading edge of the timeout. @default true */
|
|
14
18
|
leading?: boolean;
|
|
19
|
+
/** Specify invoking on the trailing edge of the timeout. @default true */
|
|
15
20
|
trailing?: boolean;
|
|
16
21
|
};
|
|
17
22
|
export interface DebouncedFunction<F extends Procedure> {
|
|
@@ -51,13 +56,7 @@ declare module "debounce" {
|
|
|
51
56
|
* @param {number} [wait=0]
|
|
52
57
|
* The number of milliseconds to delay; if omitted, `requestAnimationFrame` is
|
|
53
58
|
* used (if available).
|
|
54
|
-
* @param
|
|
55
|
-
* @param {boolean} [options.leading=false]
|
|
56
|
-
* Specify invoking on the leading edge of the timeout.
|
|
57
|
-
* @param {number} [options.maxWait]
|
|
58
|
-
* The maximum time `func` is allowed to be delayed before it's invoked.
|
|
59
|
-
* @param {boolean} [options.trailing=true]
|
|
60
|
-
* Specify invoking on the trailing edge of the timeout.
|
|
59
|
+
* @param [options={}] The options object.
|
|
61
60
|
* @returns {Function} Returns the new debounced function.
|
|
62
61
|
* @example
|
|
63
62
|
*
|
|
@@ -112,11 +111,7 @@ declare module "debounce" {
|
|
|
112
111
|
* @param {number} [wait=0]
|
|
113
112
|
* The number of milliseconds to throttle invocations to; if omitted,
|
|
114
113
|
* `requestAnimationFrame` is used (if available).
|
|
115
|
-
* @param
|
|
116
|
-
* @param {boolean} [options.leading=true]
|
|
117
|
-
* Specify invoking on the leading edge of the timeout.
|
|
118
|
-
* @param {boolean} [options.trailing=true]
|
|
119
|
-
* Specify invoking on the trailing edge of the timeout.
|
|
114
|
+
* @param [options={}] The options object.
|
|
120
115
|
* @returns {Function} Returns the new throttled function.
|
|
121
116
|
* @example
|
|
122
117
|
*
|
|
@@ -135,7 +130,7 @@ declare module "debounce" {
|
|
|
135
130
|
declare module "util" {
|
|
136
131
|
/*!
|
|
137
132
|
* Wunderbaum - util
|
|
138
|
-
* Copyright (c) 2021-
|
|
133
|
+
* Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
|
|
139
134
|
* @VERSION, @DATE (https://github.com/mar10/wunderbaum)
|
|
140
135
|
*/
|
|
141
136
|
/** @module util */
|
|
@@ -189,7 +184,7 @@ declare module "util" {
|
|
|
189
184
|
* Iterate over Object properties or array elements.
|
|
190
185
|
*
|
|
191
186
|
* @param obj `Object`, `Array` or null
|
|
192
|
-
* @param callback
|
|
187
|
+
* @param callback called for every item.
|
|
193
188
|
* `this` also contains the item.
|
|
194
189
|
* Return `false` to stop the iteration.
|
|
195
190
|
*/
|
|
@@ -310,7 +305,7 @@ declare module "util" {
|
|
|
310
305
|
/**
|
|
311
306
|
* Bind one or more event handlers directly to an [EventTarget](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget).
|
|
312
307
|
*
|
|
313
|
-
* @param
|
|
308
|
+
* @param rootTarget EventTarget or selector
|
|
314
309
|
* @param eventNames
|
|
315
310
|
* @param handler
|
|
316
311
|
*/
|
|
@@ -326,7 +321,7 @@ declare module "util" {
|
|
|
326
321
|
* });
|
|
327
322
|
* ```
|
|
328
323
|
*
|
|
329
|
-
* @param
|
|
324
|
+
* @param rootTarget EventTarget or selector
|
|
330
325
|
* @param eventNames
|
|
331
326
|
* @param selector
|
|
332
327
|
* @param handler
|
|
@@ -398,7 +393,7 @@ declare module "util" {
|
|
|
398
393
|
declare module "common" {
|
|
399
394
|
/*!
|
|
400
395
|
* Wunderbaum - common
|
|
401
|
-
* Copyright (c) 2021-
|
|
396
|
+
* Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
|
|
402
397
|
* @VERSION, @DATE (https://github.com/mar10/wunderbaum)
|
|
403
398
|
*/
|
|
404
399
|
import { MatcherCallback, SourceObjectType } from "types";
|
|
@@ -470,7 +465,7 @@ declare module "common" {
|
|
|
470
465
|
declare module "deferred" {
|
|
471
466
|
/*!
|
|
472
467
|
* Wunderbaum - deferred
|
|
473
|
-
* Copyright (c) 2021-
|
|
468
|
+
* Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
|
|
474
469
|
* @VERSION, @DATE (https://github.com/mar10/wunderbaum)
|
|
475
470
|
*/
|
|
476
471
|
type PromiseCallbackType = (val: any) => void;
|
|
@@ -511,7 +506,7 @@ declare module "deferred" {
|
|
|
511
506
|
}
|
|
512
507
|
declare module "wb_node" {
|
|
513
508
|
import { Wunderbaum } from "wunderbaum";
|
|
514
|
-
import { AddChildrenOptions, ApplyCommandOptions, ApplyCommandType, ChangeType, CheckboxOption, ExpandAllOptions, IconOption, InsertNodeType, MakeVisibleOptions, MatcherCallback, NavigateOptions, NodeAnyCallback, NodeStatusType, NodeStringCallback, NodeToDictCallback, NodeVisitCallback, NodeVisitResponse, RenderOptions, ScrollIntoViewOptions, SetActiveOptions, SetExpandedOptions, SetSelectedOptions, SetStatusOptions, SortCallback, SourceType, TristateType, WbNodeData } from "types";
|
|
509
|
+
import { AddChildrenOptions, ApplyCommandOptions, ApplyCommandType, ChangeType, CheckboxOption, ExpandAllOptions, IconOption, InsertNodeType, MakeVisibleOptions, MatcherCallback, NavigateOptions, NodeAnyCallback, NodeStatusType, NodeStringCallback, NodeToDictCallback, NodeVisitCallback, NodeVisitResponse, RenderOptions, ScrollIntoViewOptions, SetActiveOptions, SetExpandedOptions, SetSelectedOptions, SetStatusOptions, SortCallback, SourceType, TooltipOption, TristateType, WbNodeData } from "types";
|
|
515
510
|
/**
|
|
516
511
|
* A single tree node.
|
|
517
512
|
*
|
|
@@ -728,7 +723,7 @@ declare module "wb_node" {
|
|
|
728
723
|
getParentList(includeRoot?: boolean, includeSelf?: boolean): any[];
|
|
729
724
|
/** Return a string representing the hierachical node path, e.g. "a/b/c".
|
|
730
725
|
* @param includeSelf
|
|
731
|
-
* @param
|
|
726
|
+
* @param part property name or callback
|
|
732
727
|
* @param separator
|
|
733
728
|
*/
|
|
734
729
|
getPath(includeSelf?: boolean, part?: keyof WunderbaumNode | NodeAnyCallback, separator?: string): string;
|
|
@@ -740,6 +735,8 @@ declare module "wb_node" {
|
|
|
740
735
|
hasChildren(): boolean;
|
|
741
736
|
/** Return true if node has className set. */
|
|
742
737
|
hasClass(className: string): boolean;
|
|
738
|
+
/** Return true if node ist the currently focused node. */
|
|
739
|
+
hasFocus(): boolean;
|
|
743
740
|
/** Return true if this node is the currently active tree node. */
|
|
744
741
|
isActive(): boolean;
|
|
745
742
|
/** Return true if this node is a direct or indirect parent of `other`.
|
|
@@ -768,7 +765,7 @@ declare module "wb_node" {
|
|
|
768
765
|
isExpandable(andCollapsed?: boolean): boolean;
|
|
769
766
|
/** Return true if _this_ node is currently in edit-title mode.
|
|
770
767
|
*
|
|
771
|
-
* See {@link
|
|
768
|
+
* See {@link WunderbaumNode.startEditTitle}.
|
|
772
769
|
*/
|
|
773
770
|
isEditingTitle(): boolean;
|
|
774
771
|
/** Return true if this node is currently expanded. */
|
|
@@ -899,8 +896,8 @@ declare module "wb_node" {
|
|
|
899
896
|
*
|
|
900
897
|
* The result is compatible with node.addChildren().
|
|
901
898
|
*
|
|
902
|
-
* @param include child nodes
|
|
903
|
-
* @param callback
|
|
899
|
+
* @param recursive include child nodes
|
|
900
|
+
* @param callback is called for every node, in order to allow
|
|
904
901
|
* modifications.
|
|
905
902
|
* Return `false` to ignore this node or `"skip"` to include this node
|
|
906
903
|
* without its children.
|
|
@@ -985,6 +982,8 @@ declare module "wb_node" {
|
|
|
985
982
|
setStatus(status: NodeStatusType, options?: SetStatusOptions): WunderbaumNode | null;
|
|
986
983
|
/** Rename this node. */
|
|
987
984
|
setTitle(title: string): void;
|
|
985
|
+
/** Set the node tooltip. */
|
|
986
|
+
setTooltip(tooltip: TooltipOption): void;
|
|
988
987
|
_sortChildren(cmp: SortCallback, deep: boolean): void;
|
|
989
988
|
/**
|
|
990
989
|
* Sort child list by title or custom criteria.
|
|
@@ -1029,8 +1028,9 @@ declare module "wb_node" {
|
|
|
1029
1028
|
* Stop iteration, if fn() returns false.<br>
|
|
1030
1029
|
* Return false if iteration was stopped.
|
|
1031
1030
|
*
|
|
1032
|
-
* @param
|
|
1031
|
+
* @param callback the callback function.
|
|
1033
1032
|
* Return false to stop iteration.
|
|
1033
|
+
* @param includeSelf include this node in the iteration.
|
|
1034
1034
|
*/
|
|
1035
1035
|
visitSiblings(callback: (node: WunderbaumNode) => boolean | void, includeSelf?: boolean): boolean;
|
|
1036
1036
|
/**
|
|
@@ -1042,7 +1042,7 @@ declare module "wb_node" {
|
|
|
1042
1042
|
declare module "wb_options" {
|
|
1043
1043
|
/*!
|
|
1044
1044
|
* Wunderbaum - utils
|
|
1045
|
-
* Copyright (c) 2021-
|
|
1045
|
+
* Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
|
|
1046
1046
|
* @VERSION, @DATE (https://github.com/mar10/wunderbaum)
|
|
1047
1047
|
*/
|
|
1048
1048
|
import { ColumnDefinitionList, DndOptionsType, DynamicBoolOption, DynamicBoolOrStringOption, DynamicCheckboxOption, DynamicIconOption, EditOptionsType, FilterOptionsType, NavModeEnum, NodeTypeDefinitionMap, SelectModeType, WbActivateEventType, WbCancelableEventResultType, WbChangeEventType, WbClickEventType, WbDeactivateEventType, WbErrorEventType, WbExpandEventType, WbIconBadgeCallback, WbIconBadgeEventResultType, WbInitEventType, WbKeydownEventType, WbNodeData, WbNodeEventType, WbReceiveEventType, WbRenderEventType, WbSelectEventType, WbTreeEventType } from "types";
|
|
@@ -1377,7 +1377,7 @@ declare module "wb_options" {
|
|
|
1377
1377
|
declare module "types" {
|
|
1378
1378
|
/*!
|
|
1379
1379
|
* Wunderbaum - types
|
|
1380
|
-
* Copyright (c) 2021-
|
|
1380
|
+
* Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
|
|
1381
1381
|
* @VERSION, @DATE (https://github.com/mar10/wunderbaum)
|
|
1382
1382
|
*/
|
|
1383
1383
|
import { WunderbaumNode } from "wb_node";
|
|
@@ -1394,6 +1394,8 @@ declare module "types" {
|
|
|
1394
1394
|
* or a boolean value that indicates if the default icon should be used or hidden.
|
|
1395
1395
|
*/
|
|
1396
1396
|
export type IconOption = boolean | string;
|
|
1397
|
+
/** Show/hide tooltip or display a string. */
|
|
1398
|
+
export type TooltipOption = boolean | string;
|
|
1397
1399
|
export interface SourceAjaxType {
|
|
1398
1400
|
url: string;
|
|
1399
1401
|
params?: any;
|
|
@@ -1448,6 +1450,7 @@ declare module "types" {
|
|
|
1448
1450
|
export type DynamicBoolOrStringOption = boolean | string | BoolOrStringOptionResolver;
|
|
1449
1451
|
export type DynamicCheckboxOption = CheckboxOption | BoolOrStringOptionResolver;
|
|
1450
1452
|
export type DynamicIconOption = IconOption | BoolOrStringOptionResolver;
|
|
1453
|
+
export type DynamicTooltipOption = TooltipOption | BoolOrStringOptionResolver;
|
|
1451
1454
|
/** A plain object (dictionary) that represents a node instance. */
|
|
1452
1455
|
export interface WbNodeData {
|
|
1453
1456
|
checkbox?: CheckboxOption;
|
|
@@ -1777,9 +1780,9 @@ declare module "types" {
|
|
|
1777
1780
|
}
|
|
1778
1781
|
/** Initial navigation mode and possible transition. */
|
|
1779
1782
|
export enum NavModeEnum {
|
|
1780
|
-
startRow = "startRow",
|
|
1781
|
-
cell = "cell"
|
|
1782
|
-
startCell = "startCell",
|
|
1783
|
+
startRow = "startRow",// Start with row mode, but allow cell-nav mode
|
|
1784
|
+
cell = "cell",// Cell-nav mode only
|
|
1785
|
+
startCell = "startCell",// Start in cell-nav mode, but allow row mode
|
|
1783
1786
|
row = "row"
|
|
1784
1787
|
}
|
|
1785
1788
|
/** Possible values for {@link WunderbaumNode.addChildren()}. */
|
|
@@ -1812,15 +1815,31 @@ declare module "types" {
|
|
|
1812
1815
|
/** Keep active node visible @default true */
|
|
1813
1816
|
keepActiveNodeVisible?: boolean;
|
|
1814
1817
|
}
|
|
1815
|
-
/**
|
|
1818
|
+
/**
|
|
1819
|
+
* Possible option values for {@link Wunderbaum.filterNodes()}.
|
|
1820
|
+
* The defaults are inherited from the tree instances ´tree.options.filter`
|
|
1821
|
+
* settings (see also {@link FilterOptionsType}).
|
|
1822
|
+
*/
|
|
1816
1823
|
export interface FilterNodesOptions {
|
|
1817
|
-
|
|
1818
|
-
|
|
1824
|
+
/** Expand all branches that contain matches while filtered @default false */
|
|
1825
|
+
autoExpand?: boolean;
|
|
1826
|
+
/** Whether to implicitly match all children of matched nodes @default false */
|
|
1827
|
+
matchBranch?: boolean;
|
|
1828
|
+
/** Match single characters in order, e.g. 'fb' will match 'FooBar' @default false */
|
|
1819
1829
|
fuzzy?: boolean;
|
|
1820
|
-
|
|
1830
|
+
/**Hide expanders if all child nodes are hidden by filter @default false */
|
|
1821
1831
|
hideExpanders?: boolean;
|
|
1822
|
-
|
|
1823
|
-
|
|
1832
|
+
/** Highlight matches by wrapping inside `<mark>` tags.
|
|
1833
|
+
* Does not work for filter callbacks.
|
|
1834
|
+
* @default true
|
|
1835
|
+
*/
|
|
1836
|
+
highlight?: boolean;
|
|
1837
|
+
/** Match end nodes only @default false */
|
|
1838
|
+
leavesOnly?: boolean;
|
|
1839
|
+
/** Grayout unmatched nodes (pass 'hide' to remove instead) @default 'dim' */
|
|
1840
|
+
mode?: FilterModeType;
|
|
1841
|
+
/** Display a 'no data' status node if result is empty @default true */
|
|
1842
|
+
noData?: boolean | string;
|
|
1824
1843
|
}
|
|
1825
1844
|
/** Possible values for {@link WunderbaumNode.makeVisible()}. */
|
|
1826
1845
|
export interface MakeVisibleOptions {
|
|
@@ -1890,7 +1909,7 @@ declare module "types" {
|
|
|
1890
1909
|
*/
|
|
1891
1910
|
edit?: boolean;
|
|
1892
1911
|
}
|
|
1893
|
-
/** Possible values for {@link
|
|
1912
|
+
/** Possible values for {@link Wunderbaum.setColumn()} `options` argument. */
|
|
1894
1913
|
export interface SetColumnOptions {
|
|
1895
1914
|
/**
|
|
1896
1915
|
* Focus embedded input control of the grid cell if any .
|
|
@@ -1951,6 +1970,12 @@ declare module "types" {
|
|
|
1951
1970
|
* until the start node is reached again @default false */
|
|
1952
1971
|
wrap?: boolean;
|
|
1953
1972
|
}
|
|
1973
|
+
/**
|
|
1974
|
+
* Passed as tree options to configure default filtering behavior.
|
|
1975
|
+
*
|
|
1976
|
+
* @see {@link Wunderbaum.filterNodes}
|
|
1977
|
+
* @see {@link FilterNodesOptions}
|
|
1978
|
+
*/
|
|
1954
1979
|
export type FilterOptionsType = {
|
|
1955
1980
|
/**
|
|
1956
1981
|
* Element or selector of an input control for filter query strings
|
|
@@ -1962,53 +1987,7 @@ declare module "types" {
|
|
|
1962
1987
|
* @default true
|
|
1963
1988
|
*/
|
|
1964
1989
|
autoApply?: boolean;
|
|
1965
|
-
|
|
1966
|
-
* Expand all branches that contain matches while filtered
|
|
1967
|
-
* @default false
|
|
1968
|
-
*/
|
|
1969
|
-
autoExpand?: boolean;
|
|
1970
|
-
/**
|
|
1971
|
-
* Show a badge with number of matching child nodes near parent icons
|
|
1972
|
-
* @default true
|
|
1973
|
-
*/
|
|
1974
|
-
counter?: boolean;
|
|
1975
|
-
/**
|
|
1976
|
-
* Match single characters in order, e.g. 'fb' will match 'FooBar'
|
|
1977
|
-
* @default false
|
|
1978
|
-
*/
|
|
1979
|
-
fuzzy?: boolean;
|
|
1980
|
-
/**
|
|
1981
|
-
* Hide counter badge if parent is expanded
|
|
1982
|
-
* @default true
|
|
1983
|
-
*/
|
|
1984
|
-
hideExpandedCounter?: boolean;
|
|
1985
|
-
/**
|
|
1986
|
-
* Hide expanders if all child nodes are hidden by filter
|
|
1987
|
-
* @default false;
|
|
1988
|
-
*/
|
|
1989
|
-
hideExpanders?: boolean;
|
|
1990
|
-
/**
|
|
1991
|
-
* Highlight matches by wrapping inside <mark> tags
|
|
1992
|
-
* @default true
|
|
1993
|
-
*/
|
|
1994
|
-
highlight?: boolean;
|
|
1995
|
-
/**
|
|
1996
|
-
* Match end nodes only
|
|
1997
|
-
* @default false
|
|
1998
|
-
*/
|
|
1999
|
-
leavesOnly?: boolean;
|
|
2000
|
-
/**
|
|
2001
|
-
* Grayout unmatched nodes (pass "hide" to remove unmatched node instead)
|
|
2002
|
-
* @default 'dim'
|
|
2003
|
-
*/
|
|
2004
|
-
mode?: FilterModeType;
|
|
2005
|
-
/**
|
|
2006
|
-
* Display a 'no data' status node if result is empty (hide-mode only).
|
|
2007
|
-
* Pass false to simply show an empy pane, or pass a string to customize the message.
|
|
2008
|
-
* @default true
|
|
2009
|
-
*/
|
|
2010
|
-
noData?: boolean | string;
|
|
2011
|
-
};
|
|
1990
|
+
} & FilterNodesOptions;
|
|
2012
1991
|
/**
|
|
2013
1992
|
* Note: <br>
|
|
2014
1993
|
* This options are used for renaming node titles. <br>
|
|
@@ -2279,16 +2258,21 @@ declare module "wb_ext_filter" {
|
|
|
2279
2258
|
constructor(tree: Wunderbaum);
|
|
2280
2259
|
init(): void;
|
|
2281
2260
|
setPluginOption(name: string, value: any): void;
|
|
2282
|
-
_applyFilterNoUpdate(filter: string |
|
|
2283
|
-
_applyFilterImpl(filter: string |
|
|
2261
|
+
_applyFilterNoUpdate(filter: string | RegExp | NodeFilterCallback, _opts: FilterNodesOptions): number;
|
|
2262
|
+
_applyFilterImpl(filter: string | RegExp | NodeFilterCallback, _opts: FilterNodesOptions): number;
|
|
2284
2263
|
/**
|
|
2285
2264
|
* [ext-filter] Dim or hide nodes.
|
|
2286
2265
|
*/
|
|
2287
|
-
filterNodes(filter: string | NodeFilterCallback, options: FilterNodesOptions):
|
|
2266
|
+
filterNodes(filter: string | RegExp | NodeFilterCallback, options: FilterNodesOptions): number;
|
|
2288
2267
|
/**
|
|
2289
2268
|
* [ext-filter] Dim or hide whole branches.
|
|
2269
|
+
* @deprecated Use {@link filterNodes} instead and set `options.matchBranch: true`.
|
|
2270
|
+
*/
|
|
2271
|
+
filterBranches(filter: string | NodeFilterCallback, options: FilterNodesOptions): number;
|
|
2272
|
+
/**
|
|
2273
|
+
* [ext-filter] Return the number of matched nodes.
|
|
2290
2274
|
*/
|
|
2291
|
-
|
|
2275
|
+
countMatches(): number;
|
|
2292
2276
|
/**
|
|
2293
2277
|
* [ext-filter] Re-apply current filter.
|
|
2294
2278
|
*/
|
|
@@ -2302,7 +2286,7 @@ declare module "wb_ext_filter" {
|
|
|
2302
2286
|
declare module "wb_ext_keynav" {
|
|
2303
2287
|
/*!
|
|
2304
2288
|
* Wunderbaum - ext-keynav
|
|
2305
|
-
* Copyright (c) 2021-
|
|
2289
|
+
* Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
|
|
2306
2290
|
* @VERSION, @DATE (https://github.com/mar10/wunderbaum)
|
|
2307
2291
|
*/
|
|
2308
2292
|
import { KeynavOptionsType } from "types";
|
|
@@ -2318,7 +2302,7 @@ declare module "wb_ext_keynav" {
|
|
|
2318
2302
|
declare module "wb_ext_logger" {
|
|
2319
2303
|
/*!
|
|
2320
2304
|
* Wunderbaum - ext-logger
|
|
2321
|
-
* Copyright (c) 2021-
|
|
2305
|
+
* Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
|
|
2322
2306
|
* @VERSION, @DATE (https://github.com/mar10/wunderbaum)
|
|
2323
2307
|
*/
|
|
2324
2308
|
import { LoggerOptionsType } from "types";
|
|
@@ -2382,7 +2366,7 @@ declare module "wb_ext_dnd" {
|
|
|
2382
2366
|
declare module "drag_observer" {
|
|
2383
2367
|
/*!
|
|
2384
2368
|
* Wunderbaum - drag_observer
|
|
2385
|
-
* Copyright (c) 2021-
|
|
2369
|
+
* Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
|
|
2386
2370
|
* @VERSION, @DATE (https://github.com/mar10/wunderbaum)
|
|
2387
2371
|
*/
|
|
2388
2372
|
export type DragCallbackArgType = {
|
|
@@ -2442,7 +2426,7 @@ declare module "drag_observer" {
|
|
|
2442
2426
|
declare module "wb_ext_grid" {
|
|
2443
2427
|
/*!
|
|
2444
2428
|
* Wunderbaum - ext-grid
|
|
2445
|
-
* Copyright (c) 2021-
|
|
2429
|
+
* Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
|
|
2446
2430
|
* @VERSION, @DATE (https://github.com/mar10/wunderbaum)
|
|
2447
2431
|
*/
|
|
2448
2432
|
import { Wunderbaum } from "wunderbaum";
|
|
@@ -2459,7 +2443,7 @@ declare module "wb_ext_grid" {
|
|
|
2459
2443
|
declare module "wb_ext_edit" {
|
|
2460
2444
|
/*!
|
|
2461
2445
|
* Wunderbaum - ext-edit
|
|
2462
|
-
* Copyright (c) 2021-
|
|
2446
|
+
* Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
|
|
2463
2447
|
* @VERSION, @DATE (https://github.com/mar10/wunderbaum)
|
|
2464
2448
|
*/
|
|
2465
2449
|
import { Wunderbaum } from "wunderbaum";
|
|
@@ -2498,7 +2482,7 @@ declare module "wunderbaum" {
|
|
|
2498
2482
|
*
|
|
2499
2483
|
* A treegrid control.
|
|
2500
2484
|
*
|
|
2501
|
-
* Copyright (c) 2021-
|
|
2485
|
+
* Copyright (c) 2021-2024, Martin Wendt (https://wwWendt.de).
|
|
2502
2486
|
* https://github.com/mar10/wunderbaum
|
|
2503
2487
|
*
|
|
2504
2488
|
* Released under the MIT license.
|
|
@@ -2507,7 +2491,7 @@ declare module "wunderbaum" {
|
|
|
2507
2491
|
*/
|
|
2508
2492
|
import * as util from "util";
|
|
2509
2493
|
import { ExtensionsDict, WunderbaumExtension } from "wb_extension_base";
|
|
2510
|
-
import { AddChildrenOptions, ApplyCommandOptions, ApplyCommandType, ChangeType, ColumnDefinitionList, DynamicBoolOption, DynamicCheckboxOption, DynamicIconOption, DynamicStringOption, ExpandAllOptions, FilterModeType, FilterNodesOptions, MatcherCallback, NavModeEnum, NodeFilterCallback, NodeStatusType, NodeStringCallback, NodeToDictCallback, NodeTypeDefinitionMap, NodeVisitCallback, RenderFlag, ScrollToOptions, SetActiveOptions, SetColumnOptions, SetStatusOptions, SortCallback, SourceType, UpdateOptions, VisitRowsOptions, WbEventInfo, WbNodeData } from "types";
|
|
2494
|
+
import { AddChildrenOptions, ApplyCommandOptions, ApplyCommandType, ChangeType, ColumnDefinitionList, DynamicBoolOption, DynamicCheckboxOption, DynamicIconOption, DynamicStringOption, DynamicTooltipOption, ExpandAllOptions, FilterModeType, FilterNodesOptions, MatcherCallback, NavModeEnum, NodeFilterCallback, NodeStatusType, NodeStringCallback, NodeToDictCallback, NodeTypeDefinitionMap, NodeVisitCallback, RenderFlag, ScrollToOptions, SetActiveOptions, SetColumnOptions, SetStatusOptions, SortCallback, SourceType, UpdateOptions, VisitRowsOptions, WbEventInfo, WbNodeData } from "types";
|
|
2511
2495
|
import { WunderbaumNode } from "wb_node";
|
|
2512
2496
|
import { WunderbaumOptions } from "wb_options";
|
|
2513
2497
|
import { DebouncedFunction } from "debounce";
|
|
@@ -2561,10 +2545,15 @@ declare module "wunderbaum" {
|
|
|
2561
2545
|
types: NodeTypeDefinitionMap;
|
|
2562
2546
|
/** List of column definitions. */
|
|
2563
2547
|
columns: ColumnDefinitionList;
|
|
2548
|
+
/** Show/hide a checkbox or radiobutton. */
|
|
2564
2549
|
checkbox?: DynamicCheckboxOption;
|
|
2550
|
+
/** Show/hide a node icon. */
|
|
2565
2551
|
icon?: DynamicIconOption;
|
|
2552
|
+
/** Show/hide a tooltip for the node icon. */
|
|
2566
2553
|
iconTooltip?: DynamicStringOption;
|
|
2567
|
-
tooltip
|
|
2554
|
+
/** Show/hide a tooltip. */
|
|
2555
|
+
tooltip?: DynamicTooltipOption;
|
|
2556
|
+
/** Define a node checkbox as readonly. */
|
|
2568
2557
|
unselectable?: DynamicBoolOption;
|
|
2569
2558
|
protected _columnsById: {
|
|
2570
2559
|
[key: string]: any;
|
|
@@ -2577,6 +2566,7 @@ declare module "wunderbaum" {
|
|
|
2577
2566
|
static util: typeof util;
|
|
2578
2567
|
/** Expose some useful methods of the util.ts module as `tree._util`. */
|
|
2579
2568
|
_util: typeof util;
|
|
2569
|
+
/** Filter options (used as defaults for calls to {@link Wunderbaum.filterNodes} ) */
|
|
2580
2570
|
filterMode: FilterModeType;
|
|
2581
2571
|
/** @internal Use `setColumn()`/`getActiveColElem()` to access. */
|
|
2582
2572
|
activeColIdx: number;
|
|
@@ -2716,7 +2706,7 @@ declare module "wunderbaum" {
|
|
|
2716
2706
|
* });
|
|
2717
2707
|
* ```
|
|
2718
2708
|
*/
|
|
2719
|
-
runWithDeferredUpdate(func: () => any, hint?: any):
|
|
2709
|
+
runWithDeferredUpdate(func: () => any, hint?: any): any;
|
|
2720
2710
|
/** Recursively expand all expandable nodes (triggers lazy load if needed). */
|
|
2721
2711
|
expandAll(flag?: boolean, options?: ExpandAllOptions): Promise<void>;
|
|
2722
2712
|
/** Recursively select all nodes. */
|
|
@@ -2952,7 +2942,7 @@ declare module "wunderbaum" {
|
|
|
2952
2942
|
sortChildren(cmp?: SortCallback | null, deep?: boolean): void;
|
|
2953
2943
|
/** Convert tree to an array of plain objects.
|
|
2954
2944
|
*
|
|
2955
|
-
* @param callback
|
|
2945
|
+
* @param callback is called for every node, in order to allow
|
|
2956
2946
|
* modifications.
|
|
2957
2947
|
* Return `false` to ignore this node or `"skip"` to include this node
|
|
2958
2948
|
* without its children.
|
|
@@ -3041,13 +3031,28 @@ declare module "wunderbaum" {
|
|
|
3041
3031
|
*/
|
|
3042
3032
|
enableUpdate(flag: boolean): void;
|
|
3043
3033
|
/**
|
|
3044
|
-
* Dim or hide nodes.
|
|
3034
|
+
* Dim or hide unmatched nodes.
|
|
3035
|
+
* @param filter a string to match against node titles, or a callback function.
|
|
3036
|
+
* @param options filter options. Defaults to the `tree.options.filter` settings.
|
|
3037
|
+
* @returns the number of nodes that match the filter.
|
|
3038
|
+
* @example
|
|
3039
|
+
* ```ts
|
|
3040
|
+
* tree.filterNodes("foo", {mode: 'dim', fuzzy: true});
|
|
3041
|
+
* // or pass a callback
|
|
3042
|
+
* tree.filterNodes((node) => { return node.data.foo === true }, {mode: 'hide'});
|
|
3043
|
+
* ```
|
|
3044
|
+
*/
|
|
3045
|
+
filterNodes(filter: string | RegExp | NodeFilterCallback, options: FilterNodesOptions): number;
|
|
3046
|
+
/**
|
|
3047
|
+
* Return the number of nodes that match the current filter.
|
|
3048
|
+
* @see {@link Wunderbaum.filterNodes}
|
|
3045
3049
|
*/
|
|
3046
|
-
|
|
3050
|
+
countMatches(): number;
|
|
3047
3051
|
/**
|
|
3048
3052
|
* Dim or hide whole branches.
|
|
3053
|
+
* @deprecated Use {@link filterNodes} instead and set `options.matchBranch: true`.
|
|
3049
3054
|
*/
|
|
3050
|
-
filterBranches(filter: string | NodeFilterCallback, options: FilterNodesOptions):
|
|
3055
|
+
filterBranches(filter: string | NodeFilterCallback, options: FilterNodesOptions): number;
|
|
3051
3056
|
/**
|
|
3052
3057
|
* Reset the filter.
|
|
3053
3058
|
*/
|