wunderbaum 0.8.4 → 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.
@@ -1,7 +1,7 @@
1
1
  @charset "UTF-8";
2
2
  /*!
3
3
  * Wunderbaum style sheet (generated from wunderbaum.scss)
4
- * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license.
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
  }
@@ -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;AAwBA;AAgEA;AAEA;AAUA;AAoBA;AAYA;;AAziBA;EAEE;;AAIF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A;;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"}
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;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A;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"}
@@ -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 {Object} [options={}] The options object.
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 {Object} [options={}] The options object.
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-2023, Martin Wendt. Released under the MIT license.
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(index, item) called for every item.
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 element EventTarget or selector
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 element EventTarget or selector
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-2023, Martin Wendt. Released under the MIT license.
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-2023, Martin Wendt. Released under the MIT license.
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;
@@ -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 node property name or callback
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 Wunderbaum.startEditTitle} to check if any node is currently edited.
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(dict, node) is called for every node, in order to allow
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.
@@ -1031,8 +1028,9 @@ declare module "wb_node" {
1031
1028
  * Stop iteration, if fn() returns false.<br>
1032
1029
  * Return false if iteration was stopped.
1033
1030
  *
1034
- * @param {function} fn the callback function.
1031
+ * @param callback the callback function.
1035
1032
  * Return false to stop iteration.
1033
+ * @param includeSelf include this node in the iteration.
1036
1034
  */
1037
1035
  visitSiblings(callback: (node: WunderbaumNode) => boolean | void, includeSelf?: boolean): boolean;
1038
1036
  /**
@@ -1044,7 +1042,7 @@ declare module "wb_node" {
1044
1042
  declare module "wb_options" {
1045
1043
  /*!
1046
1044
  * Wunderbaum - utils
1047
- * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license.
1045
+ * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
1048
1046
  * @VERSION, @DATE (https://github.com/mar10/wunderbaum)
1049
1047
  */
1050
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";
@@ -1379,7 +1377,7 @@ declare module "wb_options" {
1379
1377
  declare module "types" {
1380
1378
  /*!
1381
1379
  * Wunderbaum - types
1382
- * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license.
1380
+ * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
1383
1381
  * @VERSION, @DATE (https://github.com/mar10/wunderbaum)
1384
1382
  */
1385
1383
  import { WunderbaumNode } from "wb_node";
@@ -1782,9 +1780,9 @@ declare module "types" {
1782
1780
  }
1783
1781
  /** Initial navigation mode and possible transition. */
1784
1782
  export enum NavModeEnum {
1785
- startRow = "startRow",
1786
- cell = "cell",
1787
- 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
1788
1786
  row = "row"
1789
1787
  }
1790
1788
  /** Possible values for {@link WunderbaumNode.addChildren()}. */
@@ -1817,15 +1815,31 @@ declare module "types" {
1817
1815
  /** Keep active node visible @default true */
1818
1816
  keepActiveNodeVisible?: boolean;
1819
1817
  }
1820
- /** Possible values for {@link Wunderbaum.filterNodes()} and {@link Wunderbaum.filterBranches()}. */
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
+ */
1821
1823
  export interface FilterNodesOptions {
1822
- mode?: string;
1823
- leavesOnly?: boolean;
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 */
1824
1829
  fuzzy?: boolean;
1825
- highlight?: boolean;
1830
+ /**Hide expanders if all child nodes are hidden by filter @default false */
1826
1831
  hideExpanders?: boolean;
1827
- autoExpand?: boolean;
1828
- noData?: boolean;
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;
1829
1843
  }
1830
1844
  /** Possible values for {@link WunderbaumNode.makeVisible()}. */
1831
1845
  export interface MakeVisibleOptions {
@@ -1895,7 +1909,7 @@ declare module "types" {
1895
1909
  */
1896
1910
  edit?: boolean;
1897
1911
  }
1898
- /** Possible values for {@link WunderbaumNode.setColumn()} `options` argument. */
1912
+ /** Possible values for {@link Wunderbaum.setColumn()} `options` argument. */
1899
1913
  export interface SetColumnOptions {
1900
1914
  /**
1901
1915
  * Focus embedded input control of the grid cell if any .
@@ -1956,6 +1970,12 @@ declare module "types" {
1956
1970
  * until the start node is reached again @default false */
1957
1971
  wrap?: boolean;
1958
1972
  }
1973
+ /**
1974
+ * Passed as tree options to configure default filtering behavior.
1975
+ *
1976
+ * @see {@link Wunderbaum.filterNodes}
1977
+ * @see {@link FilterNodesOptions}
1978
+ */
1959
1979
  export type FilterOptionsType = {
1960
1980
  /**
1961
1981
  * Element or selector of an input control for filter query strings
@@ -1967,53 +1987,7 @@ declare module "types" {
1967
1987
  * @default true
1968
1988
  */
1969
1989
  autoApply?: boolean;
1970
- /**
1971
- * Expand all branches that contain matches while filtered
1972
- * @default false
1973
- */
1974
- autoExpand?: boolean;
1975
- /**
1976
- * Show a badge with number of matching child nodes near parent icons
1977
- * @default true
1978
- */
1979
- counter?: boolean;
1980
- /**
1981
- * Match single characters in order, e.g. 'fb' will match 'FooBar'
1982
- * @default false
1983
- */
1984
- fuzzy?: boolean;
1985
- /**
1986
- * Hide counter badge if parent is expanded
1987
- * @default true
1988
- */
1989
- hideExpandedCounter?: boolean;
1990
- /**
1991
- * Hide expanders if all child nodes are hidden by filter
1992
- * @default false;
1993
- */
1994
- hideExpanders?: boolean;
1995
- /**
1996
- * Highlight matches by wrapping inside <mark> tags
1997
- * @default true
1998
- */
1999
- highlight?: boolean;
2000
- /**
2001
- * Match end nodes only
2002
- * @default false
2003
- */
2004
- leavesOnly?: boolean;
2005
- /**
2006
- * Grayout unmatched nodes (pass "hide" to remove unmatched node instead)
2007
- * @default 'dim'
2008
- */
2009
- mode?: FilterModeType;
2010
- /**
2011
- * Display a 'no data' status node if result is empty (hide-mode only).
2012
- * Pass false to simply show an empy pane, or pass a string to customize the message.
2013
- * @default true
2014
- */
2015
- noData?: boolean | string;
2016
- };
1990
+ } & FilterNodesOptions;
2017
1991
  /**
2018
1992
  * Note: <br>
2019
1993
  * This options are used for renaming node titles. <br>
@@ -2284,16 +2258,21 @@ declare module "wb_ext_filter" {
2284
2258
  constructor(tree: Wunderbaum);
2285
2259
  init(): void;
2286
2260
  setPluginOption(name: string, value: any): void;
2287
- _applyFilterNoUpdate(filter: string | NodeFilterCallback, branchMode: boolean, _opts: any): void;
2288
- _applyFilterImpl(filter: string | NodeFilterCallback, branchMode: boolean, _opts: any): number;
2261
+ _applyFilterNoUpdate(filter: string | RegExp | NodeFilterCallback, _opts: FilterNodesOptions): number;
2262
+ _applyFilterImpl(filter: string | RegExp | NodeFilterCallback, _opts: FilterNodesOptions): number;
2289
2263
  /**
2290
2264
  * [ext-filter] Dim or hide nodes.
2291
2265
  */
2292
- filterNodes(filter: string | NodeFilterCallback, options: FilterNodesOptions): void;
2266
+ filterNodes(filter: string | RegExp | NodeFilterCallback, options: FilterNodesOptions): number;
2293
2267
  /**
2294
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.
2295
2274
  */
2296
- filterBranches(filter: string | NodeFilterCallback, options: FilterNodesOptions): void;
2275
+ countMatches(): number;
2297
2276
  /**
2298
2277
  * [ext-filter] Re-apply current filter.
2299
2278
  */
@@ -2307,7 +2286,7 @@ declare module "wb_ext_filter" {
2307
2286
  declare module "wb_ext_keynav" {
2308
2287
  /*!
2309
2288
  * Wunderbaum - ext-keynav
2310
- * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license.
2289
+ * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
2311
2290
  * @VERSION, @DATE (https://github.com/mar10/wunderbaum)
2312
2291
  */
2313
2292
  import { KeynavOptionsType } from "types";
@@ -2323,7 +2302,7 @@ declare module "wb_ext_keynav" {
2323
2302
  declare module "wb_ext_logger" {
2324
2303
  /*!
2325
2304
  * Wunderbaum - ext-logger
2326
- * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license.
2305
+ * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
2327
2306
  * @VERSION, @DATE (https://github.com/mar10/wunderbaum)
2328
2307
  */
2329
2308
  import { LoggerOptionsType } from "types";
@@ -2387,7 +2366,7 @@ declare module "wb_ext_dnd" {
2387
2366
  declare module "drag_observer" {
2388
2367
  /*!
2389
2368
  * Wunderbaum - drag_observer
2390
- * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license.
2369
+ * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
2391
2370
  * @VERSION, @DATE (https://github.com/mar10/wunderbaum)
2392
2371
  */
2393
2372
  export type DragCallbackArgType = {
@@ -2447,7 +2426,7 @@ declare module "drag_observer" {
2447
2426
  declare module "wb_ext_grid" {
2448
2427
  /*!
2449
2428
  * Wunderbaum - ext-grid
2450
- * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license.
2429
+ * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
2451
2430
  * @VERSION, @DATE (https://github.com/mar10/wunderbaum)
2452
2431
  */
2453
2432
  import { Wunderbaum } from "wunderbaum";
@@ -2464,7 +2443,7 @@ declare module "wb_ext_grid" {
2464
2443
  declare module "wb_ext_edit" {
2465
2444
  /*!
2466
2445
  * Wunderbaum - ext-edit
2467
- * Copyright (c) 2021-2023, Martin Wendt. Released under the MIT license.
2446
+ * Copyright (c) 2021-2024, Martin Wendt. Released under the MIT license.
2468
2447
  * @VERSION, @DATE (https://github.com/mar10/wunderbaum)
2469
2448
  */
2470
2449
  import { Wunderbaum } from "wunderbaum";
@@ -2503,7 +2482,7 @@ declare module "wunderbaum" {
2503
2482
  *
2504
2483
  * A treegrid control.
2505
2484
  *
2506
- * Copyright (c) 2021-2023, Martin Wendt (https://wwWendt.de).
2485
+ * Copyright (c) 2021-2024, Martin Wendt (https://wwWendt.de).
2507
2486
  * https://github.com/mar10/wunderbaum
2508
2487
  *
2509
2488
  * Released under the MIT license.
@@ -2587,6 +2566,7 @@ declare module "wunderbaum" {
2587
2566
  static util: typeof util;
2588
2567
  /** Expose some useful methods of the util.ts module as `tree._util`. */
2589
2568
  _util: typeof util;
2569
+ /** Filter options (used as defaults for calls to {@link Wunderbaum.filterNodes} ) */
2590
2570
  filterMode: FilterModeType;
2591
2571
  /** @internal Use `setColumn()`/`getActiveColElem()` to access. */
2592
2572
  activeColIdx: number;
@@ -2726,7 +2706,7 @@ declare module "wunderbaum" {
2726
2706
  * });
2727
2707
  * ```
2728
2708
  */
2729
- runWithDeferredUpdate(func: () => any, hint?: any): void;
2709
+ runWithDeferredUpdate(func: () => any, hint?: any): any;
2730
2710
  /** Recursively expand all expandable nodes (triggers lazy load if needed). */
2731
2711
  expandAll(flag?: boolean, options?: ExpandAllOptions): Promise<void>;
2732
2712
  /** Recursively select all nodes. */
@@ -2962,7 +2942,7 @@ declare module "wunderbaum" {
2962
2942
  sortChildren(cmp?: SortCallback | null, deep?: boolean): void;
2963
2943
  /** Convert tree to an array of plain objects.
2964
2944
  *
2965
- * @param callback(dict, node) is called for every node, in order to allow
2945
+ * @param callback is called for every node, in order to allow
2966
2946
  * modifications.
2967
2947
  * Return `false` to ignore this node or `"skip"` to include this node
2968
2948
  * without its children.
@@ -3051,13 +3031,28 @@ declare module "wunderbaum" {
3051
3031
  */
3052
3032
  enableUpdate(flag: boolean): void;
3053
3033
  /**
3054
- * 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}
3055
3049
  */
3056
- filterNodes(filter: string | NodeFilterCallback, options: FilterNodesOptions): void;
3050
+ countMatches(): number;
3057
3051
  /**
3058
3052
  * Dim or hide whole branches.
3053
+ * @deprecated Use {@link filterNodes} instead and set `options.matchBranch: true`.
3059
3054
  */
3060
- filterBranches(filter: string | NodeFilterCallback, options: FilterNodesOptions): void;
3055
+ filterBranches(filter: string | NodeFilterCallback, options: FilterNodesOptions): number;
3061
3056
  /**
3062
3057
  * Reset the filter.
3063
3058
  */