wunderbaum 0.12.1 → 0.13.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 +9 -0
- package/dist/wunderbaum.css.map +1 -1
- package/dist/wunderbaum.d.ts +147 -44
- package/dist/wunderbaum.esm.js +353 -187
- package/dist/wunderbaum.esm.min.js +26 -26
- package/dist/wunderbaum.esm.min.js.map +1 -1
- package/dist/wunderbaum.umd.js +353 -187
- package/dist/wunderbaum.umd.min.js +29 -29
- package/dist/wunderbaum.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/common.ts +27 -3
- package/src/types.ts +115 -12
- package/src/util.ts +0 -13
- package/src/wb_ext_edit.ts +1 -1
- package/src/wb_ext_filter.ts +117 -42
- package/src/wb_extension_base.ts +3 -2
- package/src/wb_node.ts +24 -96
- package/src/wb_options.ts +6 -12
- package/src/wunderbaum.scss +9 -1
- package/src/wunderbaum.ts +264 -40
package/dist/wunderbaum.css
CHANGED
|
@@ -428,6 +428,11 @@ div.wunderbaum.wb-checkbox-auto-hide:focus .wb-row.wb-active i.wb-checkbox, div.
|
|
|
428
428
|
}
|
|
429
429
|
|
|
430
430
|
/* --- TOOL CLASSES --- */
|
|
431
|
+
a.wb-breadcrumb {
|
|
432
|
+
cursor: pointer;
|
|
433
|
+
text-decoration: none;
|
|
434
|
+
}
|
|
435
|
+
|
|
431
436
|
.wb-helper-center {
|
|
432
437
|
text-align: center;
|
|
433
438
|
}
|
|
@@ -461,6 +466,10 @@ div.wunderbaum.wb-checkbox-auto-hide:focus .wb-row.wb-active i.wb-checkbox, div.
|
|
|
461
466
|
user-select: contain;
|
|
462
467
|
}
|
|
463
468
|
|
|
469
|
+
button.wb-filter-hide {
|
|
470
|
+
font-weight: bolder;
|
|
471
|
+
}
|
|
472
|
+
|
|
464
473
|
/* RTL support */
|
|
465
474
|
.wb-helper-start,
|
|
466
475
|
.wb-helper-start > input {
|
package/dist/wunderbaum.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../src/wunderbaum.scss"],"names":[],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AA6EA;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;AAyBA;AAwRA;AAoHA;AA8BA;AAgEA;AAEA;AAUA;AAoBA;AAYA;;AAjkBA;EAEE;;AAIF;EACE;EACA;;AAGF;EACE;EAEA;;AAMF;EACE;EACA;EACA;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;EACA;;AACA;EACE;;AAKJ;EACE;EACA;;AAEA;EACE;EACA;;AAKN;EACE;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAIJ;EACE;EACA;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;
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../src/wunderbaum.scss"],"names":[],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AA6EA;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;AAyBA;AAwRA;AAoHA;AA8BA;AAgEA;AAEA;AAUA;AAoBA;AAYA;;AAjkBA;EAEE;;AAIF;EACE;EACA;;AAGF;EACE;EAEA;;AAMF;EACE;EACA;EACA;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;EACA;;AACA;EACE;;AAKJ;EACE;EACA;;AAEA;EACE;EACA;;AAKN;EACE;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAIJ;EACE;EACA;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;AACA;EACE;EACA;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;;AAEA;EACE;EACA;;;AAOJ;EACE;;;AAIF;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
|
@@ -425,7 +425,7 @@ declare module "common" {
|
|
|
425
425
|
* Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
|
|
426
426
|
* @VERSION, @DATE (https://github.com/mar10/wunderbaum)
|
|
427
427
|
*/
|
|
428
|
-
import {
|
|
428
|
+
import { ApplyCommandType, NavigationType, SourceObjectType, IconMapType, MatcherCallback } from "types";
|
|
429
429
|
import { WunderbaumNode } from "wb_node";
|
|
430
430
|
export const DEFAULT_DEBUGLEVEL = 4;
|
|
431
431
|
/**
|
|
@@ -459,9 +459,7 @@ declare module "common" {
|
|
|
459
459
|
*
|
|
460
460
|
*/
|
|
461
461
|
export const iconMaps: {
|
|
462
|
-
[key: string]:
|
|
463
|
-
[key: string]: string;
|
|
464
|
-
};
|
|
462
|
+
[key: string]: IconMapType;
|
|
465
463
|
};
|
|
466
464
|
export const KEY_NODATA = "__not_found__";
|
|
467
465
|
/** Define which keys are handled by embedded <input> control, and should
|
|
@@ -473,8 +471,12 @@ declare module "common" {
|
|
|
473
471
|
/** Dict keys that are evaluated by source loader (others are added to `tree.data` instead). */
|
|
474
472
|
export const RESERVED_TREE_SOURCE_KEYS: Set<string>;
|
|
475
473
|
/** Map `KeyEvent.key` to navigation action. */
|
|
476
|
-
export const
|
|
477
|
-
[key: string]:
|
|
474
|
+
export const KEY_TO_NAVIGATION_MAP: {
|
|
475
|
+
[key: string]: NavigationType;
|
|
476
|
+
};
|
|
477
|
+
/** Map `KeyEvent.key` to navigation action. */
|
|
478
|
+
export const KEY_TO_COMMAND_MAP: {
|
|
479
|
+
[key: string]: ApplyCommandType;
|
|
478
480
|
};
|
|
479
481
|
/** Return a callback that returns true if the node title matches the string
|
|
480
482
|
* or regular expression.
|
|
@@ -540,7 +542,7 @@ declare module "deferred" {
|
|
|
540
542
|
}
|
|
541
543
|
declare module "wb_node" {
|
|
542
544
|
import { Wunderbaum } from "wunderbaum";
|
|
543
|
-
import { AddChildrenOptions, ApplyCommandOptions, ApplyCommandType, ChangeType, CheckboxOption, ExpandAllOptions, IconOption, InsertNodeType, MakeVisibleOptions, MatcherCallback, NavigateOptions, NodeAnyCallback, NodeStatusType, NodeStringCallback, NodeToDictCallback, NodeVisitCallback, NodeVisitResponse, RenderOptions, ResetOrderOptions, ScrollIntoViewOptions, SetActiveOptions, SetExpandedOptions, SetSelectedOptions, SetStatusOptions, SortByPropertyOptions, SortCallback, SourceType, TooltipOption, TristateType, WbNodeData } from "types";
|
|
545
|
+
import { AddChildrenOptions, ApplyCommandOptions, ApplyCommandType, ChangeType, CheckboxOption, ExpandAllOptions, IconOption, InsertNodeType, MakeVisibleOptions, MatcherCallback, NavigateOptions, NavigationType, NodeAnyCallback, NodeStatusType, NodeStringCallback, NodeToDictCallback, NodeVisitCallback, NodeVisitResponse, RenderOptions, ResetOrderOptions, ScrollIntoViewOptions, SetActiveOptions, SetExpandedOptions, SetSelectedOptions, SetStatusOptions, SortByPropertyOptions, SortCallback, SourceType, TooltipOption, TristateType, WbNodeData } from "types";
|
|
544
546
|
/**
|
|
545
547
|
* A single tree node.
|
|
546
548
|
*
|
|
@@ -612,7 +614,11 @@ declare module "wb_node" {
|
|
|
612
614
|
_errorInfo: any | null;
|
|
613
615
|
_partsel: boolean;
|
|
614
616
|
_partload: boolean;
|
|
615
|
-
|
|
617
|
+
/**
|
|
618
|
+
* > 0 if matched (-1 to keep system nodes visible);
|
|
619
|
+
* Added and removed by filter code.
|
|
620
|
+
*/
|
|
621
|
+
match?: number;
|
|
616
622
|
subMatchCount?: number;
|
|
617
623
|
/** @internal */
|
|
618
624
|
titleWithHighlight?: string;
|
|
@@ -730,7 +736,7 @@ declare module "wb_node" {
|
|
|
730
736
|
*
|
|
731
737
|
* @see {@link Wunderbaum.findRelatedNode|tree.findRelatedNode()}
|
|
732
738
|
*/
|
|
733
|
-
findRelatedNode(where:
|
|
739
|
+
findRelatedNode(where: NavigationType, includeHidden?: boolean): any;
|
|
734
740
|
/**
|
|
735
741
|
* Iterator version of {@link WunderbaumNode.format}.
|
|
736
742
|
*/
|
|
@@ -847,7 +853,7 @@ declare module "wb_node" {
|
|
|
847
853
|
* @see {@link WunderbaumNode.isAncestorOf}
|
|
848
854
|
*/
|
|
849
855
|
isParentOf(other: WunderbaumNode): boolean;
|
|
850
|
-
/**
|
|
856
|
+
/** Return true if this node is partially loaded. @experimental */
|
|
851
857
|
isPartload(): boolean;
|
|
852
858
|
/** Return true if this node is partially selected (tri-state). */
|
|
853
859
|
isPartsel(): boolean;
|
|
@@ -922,7 +928,7 @@ declare module "wb_node" {
|
|
|
922
928
|
* e.g. `ArrowLeft` = 'left'.
|
|
923
929
|
* @param options
|
|
924
930
|
*/
|
|
925
|
-
navigate(where: string, options?: NavigateOptions): Promise<any>;
|
|
931
|
+
navigate(where: NavigationType | string, options?: NavigateOptions): Promise<any>;
|
|
926
932
|
/** Delete this node and all descendants. */
|
|
927
933
|
remove(): void;
|
|
928
934
|
/** Remove all descendants of this node. */
|
|
@@ -930,7 +936,7 @@ declare module "wb_node" {
|
|
|
930
936
|
/** Remove all HTML markup from the DOM. */
|
|
931
937
|
removeMarkup(): void;
|
|
932
938
|
protected _getRenderInfo(): any;
|
|
933
|
-
protected _createIcon(
|
|
939
|
+
protected _createIcon(parentElem: HTMLElement, replaceChild: HTMLElement | null, showLoading: boolean): HTMLElement | null;
|
|
934
940
|
/**
|
|
935
941
|
* Create a whole new `<div class="wb-row">` element.
|
|
936
942
|
* @see {@link WunderbaumNode._render}
|
|
@@ -1118,7 +1124,7 @@ declare module "wb_options" {
|
|
|
1118
1124
|
* Copyright (c) 2021-2025, Martin Wendt. Released under the MIT license.
|
|
1119
1125
|
* @VERSION, @DATE (https://github.com/mar10/wunderbaum)
|
|
1120
1126
|
*/
|
|
1121
|
-
import { ColumnDefinitionList, DndOptionsType, DynamicBoolOption, DynamicBoolOrStringOption, DynamicCheckboxOption, DynamicIconOption, EditOptionsType, FilterOptionsType, NavModeEnum, NodeTypeDefinitionMap, SelectModeType, WbActivateEventType, WbButtonClickEventType, WbCancelableEventResultType, WbChangeEventType, WbClickEventType, WbDeactivateEventType, WbErrorEventType, WbExpandEventType, WbIconBadgeCallback, WbIconBadgeEventResultType, WbInitEventType, WbKeydownEventType, WbNodeData, WbNodeEventType, WbReceiveEventType, WbRenderEventType, WbSelectEventType, WbTreeEventType } from "types";
|
|
1127
|
+
import { ColumnDefinitionList, DndOptionsType, DynamicBoolOption, DynamicBoolOrStringOption, DynamicCheckboxOption, DynamicIconOption, EditOptionsType, FilterOptionsType, IconMapType, NavModeEnum, NodeTypeDefinitionMap, SelectModeType, TranslationsType, WbActivateEventType, WbButtonClickEventType, WbCancelableEventResultType, WbChangeEventType, WbClickEventType, WbDeactivateEventType, WbErrorEventType, WbExpandEventType, WbIconBadgeCallback, WbIconBadgeEventResultType, WbInitEventType, WbKeydownEventType, WbNodeData, WbNodeEventType, WbReceiveEventType, WbRenderEventType, WbSelectEventType, WbTreeEventType } from "types";
|
|
1122
1128
|
/**
|
|
1123
1129
|
* Available options for {@link wunderbaum.Wunderbaum}.
|
|
1124
1130
|
*
|
|
@@ -1193,16 +1199,8 @@ declare module "wb_options" {
|
|
|
1193
1199
|
skeleton?: boolean;
|
|
1194
1200
|
/**
|
|
1195
1201
|
* Translation map for some system messages.
|
|
1196
|
-
* Default:
|
|
1197
|
-
* ```js
|
|
1198
|
-
* strings: {
|
|
1199
|
-
* loading: "Loading...",
|
|
1200
|
-
* loadError: "Error",
|
|
1201
|
-
* noData: "No data",
|
|
1202
|
-
* }
|
|
1203
|
-
* ```
|
|
1204
1202
|
*/
|
|
1205
|
-
strings?:
|
|
1203
|
+
strings?: TranslationsType;
|
|
1206
1204
|
/**
|
|
1207
1205
|
* 0:quiet, 1:errors, 2:warnings, 3:info, 4:verbose
|
|
1208
1206
|
* Default: 3 (4 in local debug environment)
|
|
@@ -1231,9 +1229,7 @@ declare module "wb_options" {
|
|
|
1231
1229
|
* Note: the icon font must be loaded separately.
|
|
1232
1230
|
* Default: "bootstrap"
|
|
1233
1231
|
*/
|
|
1234
|
-
iconMap?: string |
|
|
1235
|
-
[key: string]: string;
|
|
1236
|
-
};
|
|
1232
|
+
iconMap?: string | IconMapType;
|
|
1237
1233
|
/**
|
|
1238
1234
|
* Collapse siblings when a node is expanded.
|
|
1239
1235
|
* Default: false
|
|
@@ -1254,10 +1250,10 @@ declare module "wb_options" {
|
|
|
1254
1250
|
*/
|
|
1255
1251
|
adjustHeight?: boolean;
|
|
1256
1252
|
/**
|
|
1257
|
-
* HTMLElement that receives the top nodes breadcrumb.
|
|
1253
|
+
* HTMLElement or selector that receives the top nodes breadcrumb.
|
|
1258
1254
|
* Default: undefined
|
|
1259
1255
|
*/
|
|
1260
|
-
connectTopBreadcrumb?: HTMLElement;
|
|
1256
|
+
connectTopBreadcrumb?: HTMLElement | string;
|
|
1261
1257
|
/**
|
|
1262
1258
|
* Default: NavModeEnum.startRow
|
|
1263
1259
|
*/
|
|
@@ -1632,6 +1628,32 @@ declare module "types" {
|
|
|
1632
1628
|
/** Other data is passed to `node.data` and can be accessed via `node.data.NAME` */
|
|
1633
1629
|
[key: string]: unknown;
|
|
1634
1630
|
}
|
|
1631
|
+
/** A plain object (dictionary) that defines node icons. */
|
|
1632
|
+
export interface IconMapType {
|
|
1633
|
+
error: string;
|
|
1634
|
+
loading: string;
|
|
1635
|
+
noData: string;
|
|
1636
|
+
expanderExpanded: string;
|
|
1637
|
+
expanderCollapsed: string;
|
|
1638
|
+
expanderLazy: string;
|
|
1639
|
+
checkChecked: string;
|
|
1640
|
+
checkUnchecked: string;
|
|
1641
|
+
checkUnknown: string;
|
|
1642
|
+
radioChecked: string;
|
|
1643
|
+
radioUnchecked: string;
|
|
1644
|
+
radioUnknown: string;
|
|
1645
|
+
folder: string;
|
|
1646
|
+
folderOpen: string;
|
|
1647
|
+
folderLazy: string;
|
|
1648
|
+
doc: string;
|
|
1649
|
+
colSortable: string;
|
|
1650
|
+
colSortAsc: string;
|
|
1651
|
+
colSortDesc: string;
|
|
1652
|
+
colFilter: string;
|
|
1653
|
+
colFilterActive: string;
|
|
1654
|
+
colMenu: string;
|
|
1655
|
+
[key: string]: string;
|
|
1656
|
+
}
|
|
1635
1657
|
/** A callback that receives a node instance and returns a string value. */
|
|
1636
1658
|
export type WbCancelableEventResultType = false | void;
|
|
1637
1659
|
export interface WbTreeEventType {
|
|
@@ -1889,6 +1911,19 @@ declare module "types" {
|
|
|
1889
1911
|
[key: string]: unknown;
|
|
1890
1912
|
}
|
|
1891
1913
|
export type ColumnDefinitionList = Array<ColumnDefinition>;
|
|
1914
|
+
/**
|
|
1915
|
+
* Used by {@link Wunderbaum.getState} and {@link Wunderbaum.setState}.
|
|
1916
|
+
*/
|
|
1917
|
+
export interface TreeStateDefinition {
|
|
1918
|
+
/** The active node's key if any. */
|
|
1919
|
+
activeKey: string | null;
|
|
1920
|
+
/** The active column index if any. */
|
|
1921
|
+
activeColIdx: number | null;
|
|
1922
|
+
/** List of selected node's keys. */
|
|
1923
|
+
selectedKeys: Array<string> | undefined;
|
|
1924
|
+
/** List of expanded node's keys. */
|
|
1925
|
+
expandedKeys: Array<string> | undefined;
|
|
1926
|
+
}
|
|
1892
1927
|
/**
|
|
1893
1928
|
* Column information (passed to the `render` event).
|
|
1894
1929
|
*/
|
|
@@ -1931,9 +1966,10 @@ declare module "types" {
|
|
|
1931
1966
|
/** The affected column's span tag if any. */
|
|
1932
1967
|
colElem?: HTMLSpanElement;
|
|
1933
1968
|
}
|
|
1934
|
-
export type FilterModeType = null | "dim" | "hide";
|
|
1969
|
+
export type FilterModeType = null | "mark" | "dim" | "hide";
|
|
1935
1970
|
export type SelectModeType = "single" | "multi" | "hier";
|
|
1936
|
-
export type
|
|
1971
|
+
export type NavigationType = "down" | "first" | "firstCol" | "last" | "lastCol" | "left" | "nextMatch" | "pageDown" | "pageUp" | "parent" | "prevMatch" | "right" | "up";
|
|
1972
|
+
export type ApplyCommandType = NavigationType | "addChild" | "addSibling" | "collapse" | "collapseAll" | "copy" | "cut" | "edit" | "expand" | "expandAll" | "indent" | "moveDown" | "moveUp" | "outdent" | "paste" | "remove" | "rename" | "toggleSelect";
|
|
1937
1973
|
export type NodeFilterResponse = "skip" | "branch" | boolean | void;
|
|
1938
1974
|
export type NodeFilterCallback = (node: WunderbaumNode) => NodeFilterResponse;
|
|
1939
1975
|
/**
|
|
@@ -1993,6 +2029,23 @@ declare module "types" {
|
|
|
1993
2029
|
/** Row mode only */
|
|
1994
2030
|
row = "row"
|
|
1995
2031
|
}
|
|
2032
|
+
/** Translatable strings. */
|
|
2033
|
+
export type TranslationsType = {
|
|
2034
|
+
/** @default "Loading..." */
|
|
2035
|
+
loading: string;
|
|
2036
|
+
/** @default "Error" */
|
|
2037
|
+
loadError: string;
|
|
2038
|
+
/** @default "No data" */
|
|
2039
|
+
noData: string;
|
|
2040
|
+
/** @default " » " */
|
|
2041
|
+
breadcrumbDelimiter: string;
|
|
2042
|
+
/** @default "Found ${matches} of ${count}" */
|
|
2043
|
+
queryResult: string;
|
|
2044
|
+
/** @default "No result" */
|
|
2045
|
+
noMatch: string;
|
|
2046
|
+
/** @default "${match} of ${matches}" */
|
|
2047
|
+
matchIndex: string;
|
|
2048
|
+
};
|
|
1996
2049
|
/** Possible values for {@link WunderbaumNode.addChildren}. */
|
|
1997
2050
|
export interface AddChildrenOptions {
|
|
1998
2051
|
/** Insert children before this node (or index)
|
|
@@ -2071,6 +2124,18 @@ declare module "types" {
|
|
|
2071
2124
|
/** Display a 'no data' status node if result is empty @default true */
|
|
2072
2125
|
noData?: boolean | string;
|
|
2073
2126
|
}
|
|
2127
|
+
/** Possible values for {@link Wunderbaum.getState}. */
|
|
2128
|
+
export interface GetStateOptions {
|
|
2129
|
+
/** Include the expanded keys. @default true */
|
|
2130
|
+
expandedKeys?: boolean;
|
|
2131
|
+
/** Include the selected keys. @default true */
|
|
2132
|
+
selectedKeys?: boolean;
|
|
2133
|
+
}
|
|
2134
|
+
/** Possible values for {@link Wunderbaum.setState}. */
|
|
2135
|
+
export interface SetStateOptions {
|
|
2136
|
+
/** Recursively load lazy nodes as needed. @default false */
|
|
2137
|
+
expandLazy?: boolean;
|
|
2138
|
+
}
|
|
2074
2139
|
/** Possible values for {@link WunderbaumNode.makeVisible}. */
|
|
2075
2140
|
export interface MakeVisibleOptions {
|
|
2076
2141
|
/** Do not animate expand (currently not implemented). @default false */
|
|
@@ -2246,6 +2311,17 @@ declare module "types" {
|
|
|
2246
2311
|
* until the start node is reached again @default false */
|
|
2247
2312
|
wrap?: boolean;
|
|
2248
2313
|
}
|
|
2314
|
+
/**
|
|
2315
|
+
* Passed as tree option.filer.connect to configure automatic integration of
|
|
2316
|
+
* filter UI controls. @experimental
|
|
2317
|
+
*/
|
|
2318
|
+
export interface FilterConnectType {
|
|
2319
|
+
inputElem: string | HTMLInputElement | null;
|
|
2320
|
+
modeButton?: string | HTMLButtonElement | null;
|
|
2321
|
+
nextButton?: string | HTMLButtonElement | HTMLAnchorElement | null;
|
|
2322
|
+
prevButton?: string | HTMLButtonElement | HTMLAnchorElement | null;
|
|
2323
|
+
matchInfoElem?: string | HTMLElement | null;
|
|
2324
|
+
}
|
|
2249
2325
|
/**
|
|
2250
2326
|
* Passed as tree options to configure default filtering behavior.
|
|
2251
2327
|
*
|
|
@@ -2254,10 +2330,12 @@ declare module "types" {
|
|
|
2254
2330
|
*/
|
|
2255
2331
|
export type FilterOptionsType = {
|
|
2256
2332
|
/**
|
|
2257
|
-
* Element or selector of
|
|
2333
|
+
* Element or selector of input controls and buttons for filter query strings.
|
|
2334
|
+
* @experimental
|
|
2335
|
+
* @since 0.13
|
|
2258
2336
|
* @default null
|
|
2259
2337
|
*/
|
|
2260
|
-
|
|
2338
|
+
connect?: null | FilterConnectType;
|
|
2261
2339
|
/**
|
|
2262
2340
|
* Re-apply last filter if lazy data is loaded
|
|
2263
2341
|
* @default true
|
|
@@ -2504,6 +2582,7 @@ declare module "types" {
|
|
|
2504
2582
|
export type LoggerOptionsType = object;
|
|
2505
2583
|
}
|
|
2506
2584
|
declare module "wb_extension_base" {
|
|
2585
|
+
import { WunderbaumOptions } from "wb_options";
|
|
2507
2586
|
import { Wunderbaum } from "wunderbaum";
|
|
2508
2587
|
export type ExtensionsDict = {
|
|
2509
2588
|
[key: string]: WunderbaumExtension<any>;
|
|
@@ -2512,7 +2591,7 @@ declare module "wb_extension_base" {
|
|
|
2512
2591
|
enabled: boolean;
|
|
2513
2592
|
readonly id: string;
|
|
2514
2593
|
readonly tree: Wunderbaum;
|
|
2515
|
-
readonly treeOpts:
|
|
2594
|
+
readonly treeOpts: WunderbaumOptions;
|
|
2516
2595
|
readonly extensionOpts: any;
|
|
2517
2596
|
constructor(tree: Wunderbaum, id: string, defaults: TOptions);
|
|
2518
2597
|
/** Called on tree (re)init after all extensions are added, but before loading.*/
|
|
@@ -2529,11 +2608,17 @@ declare module "wb_ext_filter" {
|
|
|
2529
2608
|
import { Wunderbaum } from "wunderbaum";
|
|
2530
2609
|
import { WunderbaumExtension } from "wb_extension_base";
|
|
2531
2610
|
export class FilterExtension extends WunderbaumExtension<FilterOptionsType> {
|
|
2532
|
-
queryInput
|
|
2611
|
+
queryInput: HTMLInputElement | null;
|
|
2612
|
+
prevButton: HTMLElement | HTMLAnchorElement | null;
|
|
2613
|
+
nextButton: HTMLElement | HTMLAnchorElement | null;
|
|
2614
|
+
modeButton: HTMLButtonElement | null;
|
|
2615
|
+
matchInfoElem: HTMLElement | null;
|
|
2533
2616
|
lastFilterArgs: IArguments | null;
|
|
2534
2617
|
constructor(tree: Wunderbaum);
|
|
2535
2618
|
init(): void;
|
|
2536
2619
|
setPluginOption(name: string, value: any): void;
|
|
2620
|
+
_updatedConnectedControls(): void;
|
|
2621
|
+
_connectControls(): void;
|
|
2537
2622
|
_applyFilterNoUpdate(filter: string | RegExp | NodeFilterCallback, _opts: FilterNodesOptions): number;
|
|
2538
2623
|
_applyFilterImpl(filter: string | RegExp | NodeFilterCallback, _opts: FilterNodesOptions): number;
|
|
2539
2624
|
/**
|
|
@@ -2779,7 +2864,7 @@ declare module "wunderbaum" {
|
|
|
2779
2864
|
*/
|
|
2780
2865
|
import * as util from "util";
|
|
2781
2866
|
import { ExtensionsDict, WunderbaumExtension } from "wb_extension_base";
|
|
2782
|
-
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, SortByPropertyOptions, SortCallback, SourceType, UpdateOptions, VisitRowsOptions, WbEventInfo, WbNodeData } from "types";
|
|
2867
|
+
import { AddChildrenOptions, ApplyCommandOptions, ApplyCommandType, ChangeType, ColumnDefinitionList, DynamicBoolOption, DynamicCheckboxOption, DynamicIconOption, DynamicStringOption, DynamicTooltipOption, ExpandAllOptions, FilterModeType, FilterNodesOptions, IconMapType, GetStateOptions, MatcherCallback, NavigationType, NavModeEnum, NodeFilterCallback, NodeStatusType, NodeStringCallback, NodeToDictCallback, NodeTypeDefinitionMap, NodeVisitCallback, RenderFlag, ScrollToOptions, SetActiveOptions, SetColumnOptions, SetStateOptions, SetStatusOptions, SortByPropertyOptions, SortCallback, SourceType, TreeStateDefinition, UpdateOptions, VisitRowsOptions, WbEventInfo, WbNodeData } from "types";
|
|
2783
2868
|
import { WunderbaumNode } from "wb_node";
|
|
2784
2869
|
import { WunderbaumOptions } from "wb_options";
|
|
2785
2870
|
import { DebouncedFunction } from "debounce";
|
|
@@ -2855,6 +2940,8 @@ declare module "wunderbaum" {
|
|
|
2855
2940
|
/** Expose some useful methods of the util.ts module as `tree._util`. */
|
|
2856
2941
|
_util: typeof util;
|
|
2857
2942
|
/** Filter options (used as defaults for calls to {@link Wunderbaum.filterNodes} ) */
|
|
2943
|
+
breadcrumb: HTMLElement | null;
|
|
2944
|
+
/** Filter options (used as defaults for calls to {@link Wunderbaum.filterNodes} ) */
|
|
2858
2945
|
filterMode: FilterModeType;
|
|
2859
2946
|
/** @internal Use `setColumn()`/`getActiveColElem()` to access. */
|
|
2860
2947
|
activeColIdx: number;
|
|
@@ -2881,9 +2968,7 @@ declare module "wunderbaum" {
|
|
|
2881
2968
|
/**
|
|
2882
2969
|
* Return the icon-function -> icon-definition mapping.
|
|
2883
2970
|
*/
|
|
2884
|
-
get iconMap():
|
|
2885
|
-
[key: string]: string;
|
|
2886
|
-
};
|
|
2971
|
+
get iconMap(): IconMapType;
|
|
2887
2972
|
/**
|
|
2888
2973
|
* Return a WunderbaumNode instance from element or event.
|
|
2889
2974
|
*/
|
|
@@ -2930,14 +3015,19 @@ declare module "wunderbaum" {
|
|
|
2930
3015
|
_callEvent(type: string, extra?: any): any;
|
|
2931
3016
|
/** Return the node for given row index. */
|
|
2932
3017
|
protected _getNodeByRowIdx(idx: number): WunderbaumNode | null;
|
|
2933
|
-
/** Return the topmost visible node in the viewport.
|
|
3018
|
+
/** Return the topmost visible node in the viewport.
|
|
3019
|
+
* @param complete If `false`, the node is considered visible if at least one
|
|
3020
|
+
* pixel is visible.
|
|
3021
|
+
*/
|
|
2934
3022
|
getTopmostVpNode(complete?: boolean): WunderbaumNode;
|
|
2935
3023
|
/** Return the lowest visible node in the viewport. */
|
|
2936
3024
|
getLowestVpNode(complete?: boolean): WunderbaumNode;
|
|
2937
|
-
/** Return preceeding visible node in the viewport. */
|
|
2938
|
-
protected _getPrevNodeInView(node?: WunderbaumNode, ofs?: number): WunderbaumNode;
|
|
2939
3025
|
/** Return following visible node in the viewport. */
|
|
2940
|
-
protected _getNextNodeInView(node?: WunderbaumNode,
|
|
3026
|
+
protected _getNextNodeInView(node?: WunderbaumNode, options?: {
|
|
3027
|
+
ofs?: number;
|
|
3028
|
+
reverse?: boolean;
|
|
3029
|
+
cb?: (n: WunderbaumNode) => boolean;
|
|
3030
|
+
}): WunderbaumNode;
|
|
2941
3031
|
/**
|
|
2942
3032
|
* Append (or insert) a list of toplevel nodes.
|
|
2943
3033
|
*
|
|
@@ -3011,6 +3101,9 @@ declare module "wunderbaum" {
|
|
|
3011
3101
|
* @param visible if true, nodes that are hidden due to collapsed parents are ignored.
|
|
3012
3102
|
*/
|
|
3013
3103
|
count(visible?: boolean): number;
|
|
3104
|
+
/** Return the number of *unique* nodes in the data model, i.e. unique `node.refKey`.
|
|
3105
|
+
*/
|
|
3106
|
+
countUnique(): number;
|
|
3014
3107
|
/** @internal sanity check. */
|
|
3015
3108
|
_check(): void;
|
|
3016
3109
|
/**
|
|
@@ -3051,7 +3144,7 @@ declare module "wunderbaum" {
|
|
|
3051
3144
|
* and wrap-around at the end.
|
|
3052
3145
|
* Used by quicksearch and keyboard navigation.
|
|
3053
3146
|
*/
|
|
3054
|
-
findNextNode(match: string | MatcherCallback, startNode?: WunderbaumNode | null): WunderbaumNode | null;
|
|
3147
|
+
findNextNode(match: string | MatcherCallback, startNode?: WunderbaumNode | null, reverse?: boolean): WunderbaumNode | null;
|
|
3055
3148
|
/**
|
|
3056
3149
|
* Find a node relative to another node.
|
|
3057
3150
|
*
|
|
@@ -3061,7 +3154,7 @@ declare module "wunderbaum" {
|
|
|
3061
3154
|
* e.g. `$.ui.keyCode.LEFT` = 'left'.
|
|
3062
3155
|
* @param includeHidden Not yet implemented
|
|
3063
3156
|
*/
|
|
3064
|
-
findRelatedNode(node: WunderbaumNode, where:
|
|
3157
|
+
findRelatedNode(node: WunderbaumNode, where: NavigationType, includeHidden?: boolean): any;
|
|
3065
3158
|
/**
|
|
3066
3159
|
* Iterator version of {@link Wunderbaum.format}.
|
|
3067
3160
|
*/
|
|
@@ -3105,6 +3198,10 @@ declare module "wunderbaum" {
|
|
|
3105
3198
|
* Return the first top level node if any (not the invisible root node).
|
|
3106
3199
|
*/
|
|
3107
3200
|
getFirstChild(): WunderbaumNode;
|
|
3201
|
+
/**
|
|
3202
|
+
* Return the last top level node if any (not the invisible root node).
|
|
3203
|
+
*/
|
|
3204
|
+
getLastChild(): WunderbaumNode;
|
|
3108
3205
|
/**
|
|
3109
3206
|
* Return the node that currently has keyboard focus or null.
|
|
3110
3207
|
* Alias for {@link Wunderbaum.focusNode}.
|
|
@@ -3190,6 +3287,10 @@ declare module "wunderbaum" {
|
|
|
3190
3287
|
/** Set or remove keyboard focus to the tree container. */
|
|
3191
3288
|
setFocus(flag?: boolean): void;
|
|
3192
3289
|
_setFocusNode(node: WunderbaumNode | null): void;
|
|
3290
|
+
/** Return the current selection/expansion/activation status. @experimental */
|
|
3291
|
+
getState(options: GetStateOptions): TreeStateDefinition;
|
|
3292
|
+
/** Apply selection/expansion/activation status. @experimental */
|
|
3293
|
+
setState(state: TreeStateDefinition, options: SetStateOptions): void;
|
|
3193
3294
|
/**
|
|
3194
3295
|
* Schedule an update request to reflect a tree change.
|
|
3195
3296
|
* The render operation is async and debounced unless the `immediate` option
|
|
@@ -3250,7 +3351,6 @@ declare module "wunderbaum" {
|
|
|
3250
3351
|
* Return true if at least one column width changed.
|
|
3251
3352
|
*/
|
|
3252
3353
|
_updateColumnWidths(): boolean;
|
|
3253
|
-
protected _insertIcon(icon: string, elem: HTMLElement): void;
|
|
3254
3354
|
/** Create/update header markup from `this.columns` definition.
|
|
3255
3355
|
* @internal
|
|
3256
3356
|
*/
|
|
@@ -3266,6 +3366,9 @@ declare module "wunderbaum" {
|
|
|
3266
3366
|
* pending async changes if any.
|
|
3267
3367
|
*/
|
|
3268
3368
|
updatePendingModifications(): void;
|
|
3369
|
+
/** @internal */
|
|
3370
|
+
_createNodeIcon(node: WunderbaumNode, showLoading: boolean, showBadge: boolean): HTMLElement | null;
|
|
3371
|
+
private _updateTopBreadcrumb;
|
|
3269
3372
|
/**
|
|
3270
3373
|
* This is the actual update method, which is wrapped inside a throttle method.
|
|
3271
3374
|
* It calls `updateColumns()` and `_updateRows()`.
|