wunderbaum 0.1.0 → 0.2.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/README.md +1 -1
- package/dist/wunderbaum.css +1 -1
- package/dist/wunderbaum.d.ts +14 -7
- package/dist/wunderbaum.esm.js +95 -30
- package/dist/wunderbaum.esm.min.js +18 -18
- package/dist/wunderbaum.esm.min.js.map +1 -1
- package/dist/wunderbaum.umd.js +95 -30
- package/dist/wunderbaum.umd.min.js +20 -20
- package/dist/wunderbaum.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/types.ts +1 -0
- package/src/wb_ext_edit.ts +1 -1
- package/src/wb_ext_filter.ts +0 -4
- package/src/wb_ext_keynav.ts +25 -1
- package/src/wb_node.ts +13 -0
- package/src/wunderbaum.ts +61 -8
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
-->
|
|
13
13
|
|
|
14
14
|
> Potential successor of [Fancytree](https://github.com/mar10/fancytree).<br>
|
|
15
|
-
> **NOTE: Status
|
|
15
|
+
> **NOTE: Status _beta_. Do not use in production!**
|
|
16
16
|
|
|
17
17
|
[](https://mar10.github.io/wunderbaum/demo/)
|
|
18
18
|
|
package/dist/wunderbaum.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Wunderbaum style sheet (generated from wunderbaum.scss)
|
|
3
3
|
* Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
|
|
4
|
-
* v0.
|
|
4
|
+
* v0.2.0, Tue, 17 Jan 2023 19:26:18 GMT (https://github.com/mar10/wunderbaum)
|
|
5
5
|
*/div.wunderbaum{box-sizing:border-box;height:100%;min-height:4px;background-color:#fff;margin:0;padding:0;font-family:Helvetica,sans-serif;font-size:14px;color:#56534c;border:2px solid #56534c;border-radius:4px;background-clip:content-box;overflow-x:auto;overflow-y:scroll}div.wunderbaum:focus,div.wunderbaum:focus-within{border-color:#275dc5}div.wunderbaum.wb-disabled{opacity:0.7;pointer-events:none}div.wunderbaum div.wb-list-container{position:relative;min-height:4px}div.wunderbaum div.wb-header{position:sticky;top:0;z-index:2}div.wunderbaum div.wb-header,div.wunderbaum div.wb-list-container{overflow:unset}div.wunderbaum div.wb-row{position:absolute;width:100%;height:22px;line-height:22px;border:1px solid transparent}div.wunderbaum.wb-fixed-col span.wb-col:first-of-type{position:sticky;left:0;z-index:1;background-color:#fff}div.wunderbaum.wb-fixed-col div.wb-header span.wb-col:first-of-type{background-color:#dedede}div.wunderbaum.wb-fixed-col div.wb-node-list div.wb-row.wb-active span.wb-col:first-of-type,div.wunderbaum.wb-fixed-col div.wb-node-list div.wb-row.wb-selected span.wb-col:first-of-type{background-color:#e5f3fb}div.wunderbaum.wb-fixed-col div.wb-node-list div.wb-row.wb-active:hover span.wb-col:first-of-type,div.wunderbaum.wb-fixed-col div.wb-node-list div.wb-row.wb-selected:hover span.wb-col:first-of-type{background-color:#dceff8}div.wunderbaum.wb-fixed-col div.wb-node-list div.wb-row:hover span.wb-col:first-of-type{background-color:#f7fcfe}div.wunderbaum.wb-fixed-col:not(:focus-within) div.wb-node-list div.wb-row.wb-active span.wb-col:first-of-type,div.wunderbaum.wb-fixed-col:not(:focus-within) div.wb-node-list div.wb-row.wb-selected span.wb-col:first-of-type,div.wunderbaum.wb-fixed-col:not(:focus) div.wb-node-list div.wb-row.wb-active span.wb-col:first-of-type,div.wunderbaum.wb-fixed-col:not(:focus) div.wb-node-list div.wb-row.wb-selected span.wb-col:first-of-type{background-color:#f0f0f0;border-color:#acacac}div.wunderbaum.wb-fixed-col:not(:focus-within) div.wb-node-list div.wb-row.wb-active span.wb-col:first-of-type:hover span.wb-col:first-of-type,div.wunderbaum.wb-fixed-col:not(:focus-within) div.wb-node-list div.wb-row.wb-selected span.wb-col:first-of-type:hover span.wb-col:first-of-type,div.wunderbaum.wb-fixed-col:not(:focus) div.wb-node-list div.wb-row.wb-active span.wb-col:first-of-type:hover span.wb-col:first-of-type,div.wunderbaum.wb-fixed-col:not(:focus) div.wb-node-list div.wb-row.wb-selected span.wb-col:first-of-type:hover span.wb-col:first-of-type{background-color:#eaeaea}div.wunderbaum:not(:focus-within) div.wb-node-list div.wb-row.wb-active,div.wunderbaum:not(:focus-within) div.wb-node-list div.wb-row.wb-selected,div.wunderbaum:not(:focus) div.wb-node-list div.wb-row.wb-active,div.wunderbaum:not(:focus) div.wb-node-list div.wb-row.wb-selected{background-color:#f0f0f0;border-color:#acacac}div.wunderbaum:not(:focus-within) div.wb-node-list div.wb-row.wb-active:hover,div.wunderbaum:not(:focus-within) div.wb-node-list div.wb-row.wb-selected:hover,div.wunderbaum:not(:focus) div.wb-node-list div.wb-row.wb-active:hover,div.wunderbaum:not(:focus) div.wb-node-list div.wb-row.wb-selected:hover{background-color:#eaeaea}div.wunderbaum.wb-alternate div.wb-node-list div.wb-row:nth-of-type(even):not(.wb-active):not(.wb-selected){background-color:#f7f7f7}div.wunderbaum.wb-alternate div.wb-node-list div.wb-row:nth-of-type(even):not(.wb-active):not(.wb-selected):hover{background-color:#f3f3f3}div.wunderbaum div.wb-node-list div.wb-row:hover{background-color:#f7fcfe}div.wunderbaum div.wb-node-list div.wb-row.wb-active,div.wunderbaum div.wb-node-list div.wb-row.wb-selected{background-color:#e5f3fb}div.wunderbaum div.wb-node-list div.wb-row.wb-active:hover,div.wunderbaum div.wb-node-list div.wb-row.wb-selected:hover{background-color:#dceff8}div.wunderbaum div.wb-node-list div.wb-row.wb-focus:not(.wb-active){border-style:dotted;border-color:#70c0e7}div.wunderbaum div.wb-node-list div.wb-row.wb-active{border-style:solid;border-color:#70c0e7}div.wunderbaum div.wb-node-list div.wb-row.wb-active:hover{border-color:#26a0da}div.wunderbaum div.wb-node-list div.wb-row.wb-loading{font-style:italic}div.wunderbaum div.wb-node-list div.wb-row.wb-busy,div.wunderbaum div.wb-node-list div.wb-row i.wb-busy,div.wunderbaum div.wb-node-list div.wb-row .wb-col.wb-busy{font-style:italic;background:repeating-linear-gradient(45deg, transparent, transparent 3.88px, #dedede 3.88px, #dedede 7.78px);animation:wb-busy-animation 2s linear infinite}div.wunderbaum div.wb-node-list div.wb-row.wb-error,div.wunderbaum div.wb-node-list div.wb-row.wb-status-error{color:#b5373b}div.wunderbaum div.wb-header{position:sticky;height:22px;border-bottom:1px solid #56534c;padding:0;background-color:#dedede}div.wunderbaum div.wb-header span.wb-col{font-weight:bold;overflow:visible}div.wunderbaum div.wb-header span.wb-col-title{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}div.wunderbaum div.wb-header span.wb-col-resizer{position:absolute;top:0;right:-1px;width:3px;border:none;border-right:2px solid #56534c;height:100%;cursor:col-resize}div.wunderbaum span.wb-col{position:absolute;display:inline-block;overflow:hidden;height:20px;line-height:20px;padding:0 2px;border-right:1px solid #dedede;white-space:nowrap}div.wunderbaum span.wb-col:last-of-type{border-right:none}div.wunderbaum span.wb-node{user-select:none}div.wunderbaum span.wb-node i.wb-checkbox,div.wunderbaum span.wb-node i.wb-expander,div.wunderbaum span.wb-node i.wb-icon,div.wunderbaum span.wb-node i.wb-indent{height:20px;width:20px;padding:2px 2px;display:inline-block}div.wunderbaum span.wb-node i.bi::before{vertical-align:baseline}div.wunderbaum span.wb-node img.wb-icon{width:16px;height:16px;padding:2px 2px}div.wunderbaum span.wb-node i.wb-indent::before{content:"\00a0"}div.wunderbaum span.wb-node i.wb-expander.wb-spin,div.wunderbaum span.wb-node i.wb-icon.wb-spin{height:unset;width:unset;padding:0 3px;animation:wb-spin-animation 2s linear infinite}div.wunderbaum span.wb-node span.wb-title{min-width:1em;vertical-align:top;overflow-x:hidden;display:inline-block;white-space:nowrap;text-overflow:ellipsis}div.wunderbaum.wb-grid div.wb-header div.wb-row span.wb-col:hover{background-color:#c5c5c5}div.wunderbaum.wb-grid.wb-cell-mode div.wb-header div.wb-row span.wb-col.wb-active{background-color:#dceff8}div.wunderbaum.wb-grid div.wb-node-list div.wb-row{border-bottom-color:#dedede}div.wunderbaum.wb-grid div.wb-node-list div.wb-row:hover:not(.wb-active):not(.wb-selected){background-color:#f7fcfe}div.wunderbaum.wb-grid div.wb-node-list div.wb-row.wb-active{border-bottom-color:#70c0e7}div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col{border-right:1px solid #dedede}div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col input.wb-input-edit,div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col>input[type="color"],div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col>input[type="date"],div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col>input[type="datetime"],div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col>input[type="datetime-local"],div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col>input[type="email"],div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col>input[type="month"],div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col>input[type="number"],div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col>input[type="password"],div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col>input[type="search"],div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col>input[type="tel"],div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col>input[type="text"],div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col>input[type="time"],div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col>input[type="url"],div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col>input[type="week"],div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col>select{width:100%;max-height:20px;border:none}div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col>input:focus,div.wunderbaum.wb-grid div.wb-node-list div.wb-row span.wb-col>select:focus{border:1px dashed #70c0e7}div.wunderbaum.wb-grid.wb-cell-mode div.wb-row:not(.wb-colspan).wb-active span.wb-col.wb-active{background-color:#b3b3b3}div.wunderbaum.wb-grid.wb-cell-mode:focus-within div.wb-row:not(.wb-colspan):not(.wb-selected) span.wb-col.wb-active,div.wunderbaum.wb-grid.wb-cell-mode:focus div.wb-row:not(.wb-colspan):not(.wb-selected) span.wb-col.wb-active{background-color:#f7fcfe}div.wunderbaum.wb-grid.wb-cell-mode:focus-within div.wb-row:not(.wb-colspan):not(.wb-selected).wb-active,div.wunderbaum.wb-grid.wb-cell-mode:focus div.wb-row:not(.wb-colspan):not(.wb-selected).wb-active{background-color:#f7fcfe}div.wunderbaum.wb-grid.wb-cell-mode:focus-within div.wb-row:not(.wb-colspan):not(.wb-selected).wb-active span.wb-col.wb-active,div.wunderbaum.wb-grid.wb-cell-mode:focus div.wb-row:not(.wb-colspan):not(.wb-selected).wb-active span.wb-col.wb-active{background-color:#7dc6e9}div.wunderbaum.wb-grid.wb-alternate div.wb-node-list div.wb-row:nth-of-type(even):not(.wb-active):not(.wb-selected){background-color:#f7f7f7}div.wunderbaum.wb-grid.wb-alternate div.wb-node-list div.wb-row:nth-of-type(even):not(.wb-active):not(.wb-selected):hover{background-color:#f3f3f3}div.wunderbaum.wb-grid:not(:focus-within) div.wb-node-list div.wb-row,div.wunderbaum.wb-grid:not(:focus) div.wb-node-list div.wb-row{border-bottom-color:#dedede}div.wunderbaum.wb-ext-filter-dim div.wb-node-list div.wb-row,div.wunderbaum.wb-ext-filter-hide div.wb-node-list div.wb-row{color:#dedede}div.wunderbaum.wb-ext-filter-dim div.wb-node-list div.wb-row.wb-submatch,div.wunderbaum.wb-ext-filter-hide div.wb-node-list div.wb-row.wb-submatch{color:#868581}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{color:#56534c}div.wunderbaum div.wb-row.wb-drag-source{opacity:0.5}div.wunderbaum div.wb-row.wb-drag-source .wb-node{background-color:#d3d2ce}div.wunderbaum div.wb-row.wb-drop-target{overflow:visible}div.wunderbaum div.wb-row.wb-drop-target .wb-node{background-color:#d4ecf8;overflow:visible}div.wunderbaum div.wb-row.wb-drop-target .wb-node .wb-icon{position:relative;overflow:visible}div.wunderbaum div.wb-row.wb-drop-target .wb-node .wb-icon::after{position:absolute;z-index:1000;content:url(../docs/assets/drop_marker_16x32.png);left:0;top:3px}div.wunderbaum div.wb-row.wb-drop-target.wb-drop-before .wb-node .wb-icon::after{content:url(../docs/assets/drop_marker_insert_16x64.png);left:0;top:-8px}div.wunderbaum div.wb-row.wb-drop-target.wb-drop-after .wb-node .wb-icon::after{content:url(../docs/assets/drop_marker_insert_16x64.png);left:0;top:14px}div.wunderbaum.wb-rainbow i.wb-expander:nth-child(4n+1),div.wunderbaum.wb-rainbow i.wb-indent:nth-child(4n+1){background:#ffffe8}div.wunderbaum.wb-rainbow i.wb-expander:nth-child(4n+2),div.wunderbaum.wb-rainbow i.wb-indent:nth-child(4n+2){background:#f0fff0}div.wunderbaum.wb-rainbow i.wb-expander:nth-child(4n+3),div.wunderbaum.wb-rainbow i.wb-indent:nth-child(4n+3){background:#fff0ff}div.wunderbaum.wb-rainbow i.wb-expander:nth-child(4n+4),div.wunderbaum.wb-rainbow i.wb-indent:nth-child(4n+4){background:#eafdfd}div.wunderbaum.wb-fade-expander i.wb-expander{transition:color 1.5s;color:rgba(86,83,76,0)}div.wunderbaum.wb-fade-expander div.wb-row.wb-loading i.wb-expander,div.wunderbaum.wb-fade-expander:hover i.wb-expander,div.wunderbaum.wb-fade-expander:focus i.wb-expander,div.wunderbaum.wb-fade-expander:focus-within i.wb-expander,div.wunderbaum.wb-fade-expander [class*="wb-statusnode-"] i.wb-expander{transition:color 0.6s;color:#56534c}div.wunderbaum div.wb-row.wb-skeleton span.wb-title,div.wunderbaum div.wb-row.wb-skeleton i.wb-icon{animation:wb-skeleton-animation 1s linear infinite alternate;border-radius:0.25em;color:transparent;opacity:0.7}div.wunderbaum.wb-checkbox-auto-hide i.wb-checkbox{visibility:hidden}div.wunderbaum.wb-checkbox-auto-hide .wb-row:hover i.wb-checkbox,div.wunderbaum.wb-checkbox-auto-hide .wb-row.wb-selected i.wb-checkbox{visibility:unset}div.wunderbaum.wb-checkbox-auto-hide:focus .wb-row.wb-active i.wb-checkbox,div.wunderbaum.wb-checkbox-auto-hide:focus-within .wb-row.wb-active i.wb-checkbox{visibility:unset}.wb-helper-center{text-align:center}.wb-helper-disabled{color:#8c877c}.wb-helper-hidden{display:none}.wb-helper-invalid{color:#b5373b}.wb-helper-lazy-expander{color:#26a0da}.wb-helper-link{cursor:pointer}.wb-no-select{user-select:none;-webkit-user-select:none}.wb-no-select span.wb-title{user-select:contain;-webkit-user-select:contain}.wb-helper-start,.wb-helper-start>input{text-align:left}.wb-helper-end,.wb-helper-end>input{text-align:right}.wb-rtl .wb-helper-start,.wb-rtl .wb-helper-start>input{text-align:right}.wb-rtl .wb-helper-end,.wb-rtl .wb-helper-end>input{text-align:left}.wb-col input[type="checkbox"]:indeterminate{color:#8c877c;background-color:red}.wb-col input:invalid{color:#b5373b;background-color:#f5ddde}@keyframes wb-spin-animation{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes wb-skeleton-animation{0%{background-color:#a3b8c2}100%{background-color:#f0f3f5}}@keyframes wb-busy-animation{0%{background-position:0 0}100%{background-position:0 22px}}
|
package/dist/wunderbaum.d.ts
CHANGED
|
@@ -1392,6 +1392,7 @@ declare module "types" {
|
|
|
1392
1392
|
preventScroll?: boolean;
|
|
1393
1393
|
isDataChange?: boolean;
|
|
1394
1394
|
top?: number;
|
|
1395
|
+
resizeCols?: boolean;
|
|
1395
1396
|
}
|
|
1396
1397
|
/** Possible values for {@link scrollIntoView()}. */
|
|
1397
1398
|
export interface ScrollIntoViewOptions {
|
|
@@ -1755,14 +1756,10 @@ declare module "wb_ext_filter" {
|
|
|
1755
1756
|
_applyFilterImpl(filter: string | NodeFilterCallback, branchMode: boolean, _opts: any): number;
|
|
1756
1757
|
/**
|
|
1757
1758
|
* [ext-filter] Dim or hide nodes.
|
|
1758
|
-
*
|
|
1759
|
-
* @param {boolean} [options={autoExpand: false, leavesOnly: false}]
|
|
1760
1759
|
*/
|
|
1761
1760
|
filterNodes(filter: string | NodeFilterCallback, options: FilterNodesOptions): void;
|
|
1762
1761
|
/**
|
|
1763
1762
|
* [ext-filter] Dim or hide whole branches.
|
|
1764
|
-
*
|
|
1765
|
-
* @param {boolean} [options={autoExpand: false}]
|
|
1766
1763
|
*/
|
|
1767
1764
|
filterBranches(filter: string | NodeFilterCallback, options: FilterNodesOptions): void;
|
|
1768
1765
|
/**
|
|
@@ -1950,7 +1947,7 @@ declare module "wunderbaum" {
|
|
|
1950
1947
|
import "./wunderbaum.scss";
|
|
1951
1948
|
import * as util from "util";
|
|
1952
1949
|
import { ExtensionsDict, WunderbaumExtension } from "wb_extension_base";
|
|
1953
|
-
import { ApplyCommandType, ChangeType, ColumnDefinitionList, ExpandAllOptions, FilterModeType, MatcherCallback, NavModeEnum, NodeStatusType, NodeStringCallback, NodeTypeDefinitionMap, ScrollToOptions, SetActiveOptions, SetModifiedOptions, SetStatusOptions, WbEventInfo, ApplyCommandOptions, AddChildrenOptions, UpdateColumnsOptions, VisitRowsOptions } from "types";
|
|
1950
|
+
import { ApplyCommandType, ChangeType, ColumnDefinitionList, ExpandAllOptions, FilterModeType, MatcherCallback, NavModeEnum, NodeStatusType, NodeStringCallback, NodeTypeDefinitionMap, ScrollToOptions, SetActiveOptions, SetModifiedOptions, SetStatusOptions, WbEventInfo, ApplyCommandOptions, AddChildrenOptions, UpdateColumnsOptions, VisitRowsOptions, NodeFilterCallback, FilterNodesOptions } from "types";
|
|
1954
1951
|
import { WunderbaumNode } from "wb_node";
|
|
1955
1952
|
import { WunderbaumOptions } from "wb_options";
|
|
1956
1953
|
/**
|
|
@@ -2301,8 +2298,10 @@ declare module "wunderbaum" {
|
|
|
2301
2298
|
setStatus(status: NodeStatusType, options?: SetStatusOptions): WunderbaumNode | null;
|
|
2302
2299
|
/** Add or redefine node type definitions. */
|
|
2303
2300
|
setTypes(types: any, replace?: boolean): void;
|
|
2304
|
-
/** Update column headers and width.
|
|
2305
|
-
|
|
2301
|
+
/** Update column headers and width.
|
|
2302
|
+
* Return true if at least one column width changed.
|
|
2303
|
+
*/
|
|
2304
|
+
updateColumns(options?: UpdateColumnsOptions): boolean;
|
|
2306
2305
|
/** Create/update header markup from `this.columns` definition.
|
|
2307
2306
|
* @internal
|
|
2308
2307
|
*/
|
|
@@ -2384,6 +2383,14 @@ declare module "wunderbaum" {
|
|
|
2384
2383
|
* ```
|
|
2385
2384
|
*/
|
|
2386
2385
|
enableUpdate(flag: boolean): void;
|
|
2386
|
+
/**
|
|
2387
|
+
* [ext-filter] Dim or hide nodes.
|
|
2388
|
+
*/
|
|
2389
|
+
filterNodes(filter: string | NodeFilterCallback, options: FilterNodesOptions): void;
|
|
2390
|
+
/**
|
|
2391
|
+
* [ext-filter] Dim or hide whole branches.
|
|
2392
|
+
*/
|
|
2393
|
+
filterBranches(filter: string | NodeFilterCallback, options: FilterNodesOptions): void;
|
|
2387
2394
|
/**
|
|
2388
2395
|
* [ext-filter] Reset the filter.
|
|
2389
2396
|
*
|
package/dist/wunderbaum.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Wunderbaum - util
|
|
3
3
|
* Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
|
|
4
|
-
* v0.
|
|
4
|
+
* v0.2.0, Tue, 17 Jan 2023 19:26:18 GMT (https://github.com/mar10/wunderbaum)
|
|
5
5
|
*/
|
|
6
6
|
/** @module util */
|
|
7
7
|
/** Readable names for `MouseEvent.button` */
|
|
@@ -707,7 +707,7 @@ var util = /*#__PURE__*/Object.freeze({
|
|
|
707
707
|
/*!
|
|
708
708
|
* Wunderbaum - types
|
|
709
709
|
* Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
|
|
710
|
-
* v0.
|
|
710
|
+
* v0.2.0, Tue, 17 Jan 2023 19:26:18 GMT (https://github.com/mar10/wunderbaum)
|
|
711
711
|
*/
|
|
712
712
|
/** Possible values for `setModified()`. */
|
|
713
713
|
var ChangeType;
|
|
@@ -759,7 +759,7 @@ var NavModeEnum;
|
|
|
759
759
|
/*!
|
|
760
760
|
* Wunderbaum - wb_extension_base
|
|
761
761
|
* Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
|
|
762
|
-
* v0.
|
|
762
|
+
* v0.2.0, Tue, 17 Jan 2023 19:26:18 GMT (https://github.com/mar10/wunderbaum)
|
|
763
763
|
*/
|
|
764
764
|
class WunderbaumExtension {
|
|
765
765
|
constructor(tree, id, defaults) {
|
|
@@ -1050,7 +1050,7 @@ function debounce(func, wait = 0, options = {}) {
|
|
|
1050
1050
|
/*!
|
|
1051
1051
|
* Wunderbaum - ext-filter
|
|
1052
1052
|
* Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
|
|
1053
|
-
* v0.
|
|
1053
|
+
* v0.2.0, Tue, 17 Jan 2023 19:26:18 GMT (https://github.com/mar10/wunderbaum)
|
|
1054
1054
|
*/
|
|
1055
1055
|
const START_MARKER = "\uFFF7";
|
|
1056
1056
|
const END_MARKER = "\uFFF8";
|
|
@@ -1234,16 +1234,12 @@ class FilterExtension extends WunderbaumExtension {
|
|
|
1234
1234
|
}
|
|
1235
1235
|
/**
|
|
1236
1236
|
* [ext-filter] Dim or hide nodes.
|
|
1237
|
-
*
|
|
1238
|
-
* @param {boolean} [options={autoExpand: false, leavesOnly: false}]
|
|
1239
1237
|
*/
|
|
1240
1238
|
filterNodes(filter, options) {
|
|
1241
1239
|
return this._applyFilterNoUpdate(filter, false, options);
|
|
1242
1240
|
}
|
|
1243
1241
|
/**
|
|
1244
1242
|
* [ext-filter] Dim or hide whole branches.
|
|
1245
|
-
*
|
|
1246
|
-
* @param {boolean} [options={autoExpand: false}]
|
|
1247
1243
|
*/
|
|
1248
1244
|
filterBranches(filter, options) {
|
|
1249
1245
|
return this._applyFilterNoUpdate(filter, true, options);
|
|
@@ -1355,7 +1351,7 @@ function _markFuzzyMatchedChars(text, matches, escapeTitles = true) {
|
|
|
1355
1351
|
/*!
|
|
1356
1352
|
* Wunderbaum - ext-keynav
|
|
1357
1353
|
* Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
|
|
1358
|
-
* v0.
|
|
1354
|
+
* v0.2.0, Tue, 17 Jan 2023 19:26:18 GMT (https://github.com/mar10/wunderbaum)
|
|
1359
1355
|
*/
|
|
1360
1356
|
const QUICKSEARCH_DELAY = 500;
|
|
1361
1357
|
class KeynavExtension extends WunderbaumExtension {
|
|
@@ -1382,11 +1378,10 @@ class KeynavExtension extends WunderbaumExtension {
|
|
|
1382
1378
|
var _a;
|
|
1383
1379
|
const ace = (_a = this.tree
|
|
1384
1380
|
.getActiveColElem()) === null || _a === void 0 ? void 0 : _a.querySelector("input:focus,select:focus");
|
|
1385
|
-
console.log(`_isCurInputFocused`, ace);
|
|
1386
1381
|
return !!ace;
|
|
1387
1382
|
}
|
|
1388
1383
|
onKeyEvent(data) {
|
|
1389
|
-
const event = data.event, tree = this.tree, opts = data.options, activate = !event.ctrlKey || opts.autoActivate, curInput = this._getEmbeddedInputElem(event.target), navModeOption = opts.navigationModeOption;
|
|
1384
|
+
const event = data.event, tree = this.tree, opts = data.options, activate = !event.ctrlKey || opts.autoActivate, curInput = this._getEmbeddedInputElem(event.target), inputHasFocus = curInput && this._isCurInputFocused(), navModeOption = opts.navigationModeOption;
|
|
1390
1385
|
// isCellEditMode = tree.navMode === NavigationMode.cellEdit;
|
|
1391
1386
|
let focusNode, eventName = eventToString(event), node = data.node, handled = true;
|
|
1392
1387
|
// tree.log(`onKeyEvent: ${eventName}, curInput`, curInput);
|
|
@@ -1423,6 +1418,22 @@ class KeynavExtension extends WunderbaumExtension {
|
|
|
1423
1418
|
// -----------------------------------------------------------------------
|
|
1424
1419
|
// --- Row Mode ---
|
|
1425
1420
|
// -----------------------------------------------------------------------
|
|
1421
|
+
if (inputHasFocus) {
|
|
1422
|
+
// If editing an embedded input control, let the control handle all
|
|
1423
|
+
// keys. Only Enter and Escape should apply / discard, but keep the
|
|
1424
|
+
// keyboard focus.
|
|
1425
|
+
switch (eventName) {
|
|
1426
|
+
case "Enter":
|
|
1427
|
+
curInput.blur();
|
|
1428
|
+
tree.setFocus();
|
|
1429
|
+
break;
|
|
1430
|
+
case "Escape":
|
|
1431
|
+
node.render();
|
|
1432
|
+
tree.setFocus();
|
|
1433
|
+
break;
|
|
1434
|
+
}
|
|
1435
|
+
return;
|
|
1436
|
+
}
|
|
1426
1437
|
// --- Quick-Search
|
|
1427
1438
|
if (opts.quicksearch &&
|
|
1428
1439
|
eventName.length === 1 &&
|
|
@@ -1524,6 +1535,11 @@ class KeynavExtension extends WunderbaumExtension {
|
|
|
1524
1535
|
if (eventName === "Escape") {
|
|
1525
1536
|
// Discard changes
|
|
1526
1537
|
node.render();
|
|
1538
|
+
// Keep cell-nav mode
|
|
1539
|
+
node.logDebug(`Reset focused input`);
|
|
1540
|
+
tree.setFocus();
|
|
1541
|
+
tree.setColumn(tree.activeColIdx);
|
|
1542
|
+
return;
|
|
1527
1543
|
// } else if (!INPUT_BREAKOUT_KEYS.has(eventName)) {
|
|
1528
1544
|
}
|
|
1529
1545
|
else if (eventName !== "Enter") {
|
|
@@ -1598,8 +1614,11 @@ class KeynavExtension extends WunderbaumExtension {
|
|
|
1598
1614
|
break;
|
|
1599
1615
|
case "Escape":
|
|
1600
1616
|
tree.setFocus(); // Blur prev. input if any
|
|
1617
|
+
node.log(`keynav: focus tree...`);
|
|
1601
1618
|
if (tree.isCellNav() && navModeOption !== NavModeEnum.cell) {
|
|
1619
|
+
node.log(`keynav: setCellNav(false)`);
|
|
1602
1620
|
tree.setCellNav(false); // row-nav mode
|
|
1621
|
+
tree.setFocus(); //
|
|
1603
1622
|
handled = true;
|
|
1604
1623
|
}
|
|
1605
1624
|
break;
|
|
@@ -1672,7 +1691,7 @@ class KeynavExtension extends WunderbaumExtension {
|
|
|
1672
1691
|
/*!
|
|
1673
1692
|
* Wunderbaum - ext-logger
|
|
1674
1693
|
* Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
|
|
1675
|
-
* v0.
|
|
1694
|
+
* v0.2.0, Tue, 17 Jan 2023 19:26:18 GMT (https://github.com/mar10/wunderbaum)
|
|
1676
1695
|
*/
|
|
1677
1696
|
class LoggerExtension extends WunderbaumExtension {
|
|
1678
1697
|
constructor(tree) {
|
|
@@ -1712,7 +1731,7 @@ class LoggerExtension extends WunderbaumExtension {
|
|
|
1712
1731
|
/*!
|
|
1713
1732
|
* Wunderbaum - common
|
|
1714
1733
|
* Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
|
|
1715
|
-
* v0.
|
|
1734
|
+
* v0.2.0, Tue, 17 Jan 2023 19:26:18 GMT (https://github.com/mar10/wunderbaum)
|
|
1716
1735
|
*/
|
|
1717
1736
|
const DEFAULT_DEBUGLEVEL = 4; // Replaced by rollup script
|
|
1718
1737
|
/**
|
|
@@ -1952,7 +1971,7 @@ function inflateSourceData(source) {
|
|
|
1952
1971
|
/*!
|
|
1953
1972
|
* Wunderbaum - ext-dnd
|
|
1954
1973
|
* Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
|
|
1955
|
-
* v0.
|
|
1974
|
+
* v0.2.0, Tue, 17 Jan 2023 19:26:18 GMT (https://github.com/mar10/wunderbaum)
|
|
1956
1975
|
*/
|
|
1957
1976
|
const nodeMimeType = "application/x-wunderbaum-node";
|
|
1958
1977
|
class DndExtension extends WunderbaumExtension {
|
|
@@ -2225,7 +2244,7 @@ class DndExtension extends WunderbaumExtension {
|
|
|
2225
2244
|
/*!
|
|
2226
2245
|
* Wunderbaum - drag_observer
|
|
2227
2246
|
* Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
|
|
2228
|
-
* v0.
|
|
2247
|
+
* v0.2.0, Tue, 17 Jan 2023 19:26:18 GMT (https://github.com/mar10/wunderbaum)
|
|
2229
2248
|
*/
|
|
2230
2249
|
/**
|
|
2231
2250
|
* Convert mouse- and touch events to 'dragstart', 'drag', and 'dragstop'.
|
|
@@ -2361,7 +2380,7 @@ class DragObserver {
|
|
|
2361
2380
|
/*!
|
|
2362
2381
|
* Wunderbaum - ext-grid
|
|
2363
2382
|
* Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
|
|
2364
|
-
* v0.
|
|
2383
|
+
* v0.2.0, Tue, 17 Jan 2023 19:26:18 GMT (https://github.com/mar10/wunderbaum)
|
|
2365
2384
|
*/
|
|
2366
2385
|
class GridExtension extends WunderbaumExtension {
|
|
2367
2386
|
constructor(tree) {
|
|
@@ -2398,7 +2417,7 @@ class GridExtension extends WunderbaumExtension {
|
|
|
2398
2417
|
/*!
|
|
2399
2418
|
* Wunderbaum - deferred
|
|
2400
2419
|
* Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
|
|
2401
|
-
* v0.
|
|
2420
|
+
* v0.2.0, Tue, 17 Jan 2023 19:26:18 GMT (https://github.com/mar10/wunderbaum)
|
|
2402
2421
|
*/
|
|
2403
2422
|
/**
|
|
2404
2423
|
* Implement a ES6 Promise, that exposes a resolve() and reject() method.
|
|
@@ -2451,7 +2470,7 @@ class Deferred {
|
|
|
2451
2470
|
/*!
|
|
2452
2471
|
* Wunderbaum - wunderbaum_node
|
|
2453
2472
|
* Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
|
|
2454
|
-
* v0.
|
|
2473
|
+
* v0.2.0, Tue, 17 Jan 2023 19:26:18 GMT (https://github.com/mar10/wunderbaum)
|
|
2455
2474
|
*/
|
|
2456
2475
|
/** Top-level properties that can be passed with `data`. */
|
|
2457
2476
|
const NODE_PROPS = new Set([
|
|
@@ -3919,6 +3938,19 @@ class WunderbaumNode {
|
|
|
3919
3938
|
this._createIcon(nodeElem, iconSpan, !expanderSpan);
|
|
3920
3939
|
}
|
|
3921
3940
|
}
|
|
3941
|
+
// Adjust column width
|
|
3942
|
+
if (opts.resizeCols !== false && !this.isColspan()) {
|
|
3943
|
+
const colElems = rowDiv.querySelectorAll("span.wb-col");
|
|
3944
|
+
let idx = 0;
|
|
3945
|
+
let ofs = 0;
|
|
3946
|
+
for (let colDef of this.tree.columns) {
|
|
3947
|
+
const colElem = colElems[idx];
|
|
3948
|
+
colElem.style.left = `${ofs}px`;
|
|
3949
|
+
colElem.style.width = `${colDef._widthPx}px`;
|
|
3950
|
+
idx++;
|
|
3951
|
+
ofs += colDef._widthPx;
|
|
3952
|
+
}
|
|
3953
|
+
}
|
|
3922
3954
|
}
|
|
3923
3955
|
/**
|
|
3924
3956
|
* Create or update node's markup.
|
|
@@ -4390,7 +4422,7 @@ WunderbaumNode.sequence = 0;
|
|
|
4390
4422
|
/*!
|
|
4391
4423
|
* Wunderbaum - ext-edit
|
|
4392
4424
|
* Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
|
|
4393
|
-
* v0.
|
|
4425
|
+
* v0.2.0, Tue, 17 Jan 2023 19:26:18 GMT (https://github.com/mar10/wunderbaum)
|
|
4394
4426
|
*/
|
|
4395
4427
|
// const START_MARKER = "\uFFF7";
|
|
4396
4428
|
class EditExtension extends WunderbaumExtension {
|
|
@@ -4481,7 +4513,7 @@ class EditExtension extends WunderbaumExtension {
|
|
|
4481
4513
|
const trigger = this.getPluginOption("trigger");
|
|
4482
4514
|
// const inputElem =
|
|
4483
4515
|
// event.target && event.target.closest("input,[contenteditable]");
|
|
4484
|
-
// tree.logDebug(`_preprocessKeyEvent: ${eventName}`);
|
|
4516
|
+
// tree.logDebug(`_preprocessKeyEvent: ${eventName}, editing:${this.isEditingTitle()}`);
|
|
4485
4517
|
// --- Title editing: apply/discard ---
|
|
4486
4518
|
// if (inputElem) {
|
|
4487
4519
|
if (this.isEditingTitle()) {
|
|
@@ -4685,8 +4717,8 @@ class EditExtension extends WunderbaumExtension {
|
|
|
4685
4717
|
* https://github.com/mar10/wunderbaum
|
|
4686
4718
|
*
|
|
4687
4719
|
* Released under the MIT license.
|
|
4688
|
-
* @version v0.
|
|
4689
|
-
* @date
|
|
4720
|
+
* @version v0.2.0
|
|
4721
|
+
* @date Tue, 17 Jan 2023 19:26:18 GMT
|
|
4690
4722
|
*/
|
|
4691
4723
|
class WbSystemRoot extends WunderbaumNode {
|
|
4692
4724
|
constructor(tree) {
|
|
@@ -4973,6 +5005,7 @@ class Wunderbaum {
|
|
|
4973
5005
|
return false;
|
|
4974
5006
|
}
|
|
4975
5007
|
if (node && info.colIdx === 0 && node.isExpandable()) {
|
|
5008
|
+
this._callMethod("edit._stopEditTitle");
|
|
4976
5009
|
node.setExpanded(!node.isExpanded());
|
|
4977
5010
|
}
|
|
4978
5011
|
});
|
|
@@ -4989,7 +5022,16 @@ class Wunderbaum {
|
|
|
4989
5022
|
});
|
|
4990
5023
|
onEvent(this.element, "focusin focusout", (e) => {
|
|
4991
5024
|
const flag = e.type === "focusin";
|
|
5025
|
+
const targetNode = Wunderbaum.getNode(e);
|
|
4992
5026
|
this._callEvent("focus", { flag: flag, event: e });
|
|
5027
|
+
if (flag && this.isRowNav() && !this.isEditing()) {
|
|
5028
|
+
if (opts.navigationModeOption === NavModeEnum.row) {
|
|
5029
|
+
targetNode === null || targetNode === void 0 ? void 0 : targetNode.setActive();
|
|
5030
|
+
}
|
|
5031
|
+
else {
|
|
5032
|
+
this.setCellNav();
|
|
5033
|
+
}
|
|
5034
|
+
}
|
|
4993
5035
|
if (!flag) {
|
|
4994
5036
|
this._callMethod("edit._stopEditTitle", true, {
|
|
4995
5037
|
event: e,
|
|
@@ -6121,7 +6163,9 @@ class Wunderbaum {
|
|
|
6121
6163
|
}
|
|
6122
6164
|
}
|
|
6123
6165
|
}
|
|
6124
|
-
/** Update column headers and width.
|
|
6166
|
+
/** Update column headers and width.
|
|
6167
|
+
* Return true if at least one column width changed.
|
|
6168
|
+
*/
|
|
6125
6169
|
updateColumns(options) {
|
|
6126
6170
|
options = Object.assign({ calculateCols: true, updateRows: true }, options);
|
|
6127
6171
|
const defaultMinWidth = 4;
|
|
@@ -6129,6 +6173,8 @@ class Wunderbaum {
|
|
|
6129
6173
|
const isGrid = this.isGrid();
|
|
6130
6174
|
// Shorten last column width to avoid h-scrollbar
|
|
6131
6175
|
const FIX_ADJUST_LAST_COL = 2;
|
|
6176
|
+
const columns = this.columns;
|
|
6177
|
+
const col0 = columns[0];
|
|
6132
6178
|
let totalWidth = 0;
|
|
6133
6179
|
let totalWeight = 0;
|
|
6134
6180
|
let fixedWidth = 0;
|
|
@@ -6138,11 +6184,17 @@ class Wunderbaum {
|
|
|
6138
6184
|
this.setCellNav(false);
|
|
6139
6185
|
}
|
|
6140
6186
|
if (options.calculateCols) {
|
|
6187
|
+
if (col0.id !== "*") {
|
|
6188
|
+
throw new Error(`First column must have id '*': got '${col0.id}'`);
|
|
6189
|
+
}
|
|
6141
6190
|
// Gather width definitions
|
|
6142
6191
|
this._columnsById = {};
|
|
6143
|
-
for (let col of
|
|
6192
|
+
for (let col of columns) {
|
|
6144
6193
|
this._columnsById[col.id] = col;
|
|
6145
6194
|
let cw = col.width;
|
|
6195
|
+
if (col.id === "*" && col !== col0) {
|
|
6196
|
+
throw new Error(`Column id '*' must be defined only once: '${col.title}'`);
|
|
6197
|
+
}
|
|
6146
6198
|
if (!cw || cw === "*") {
|
|
6147
6199
|
col._weight = 1.0;
|
|
6148
6200
|
totalWeight += 1.0;
|
|
@@ -6161,13 +6213,13 @@ class Wunderbaum {
|
|
|
6161
6213
|
fixedWidth += px;
|
|
6162
6214
|
}
|
|
6163
6215
|
else {
|
|
6164
|
-
error(`Invalid column width: ${cw}`);
|
|
6216
|
+
error(`Invalid column width: ${cw} (expected string ending with 'px' or number, e.g. "<num>px" or <int>)`);
|
|
6165
6217
|
}
|
|
6166
6218
|
}
|
|
6167
6219
|
// Share remaining space between non-fixed columns
|
|
6168
6220
|
const restPx = Math.max(0, vpWidth - fixedWidth);
|
|
6169
6221
|
let ofsPx = 0;
|
|
6170
|
-
for (let col of
|
|
6222
|
+
for (let col of columns) {
|
|
6171
6223
|
let minWidth;
|
|
6172
6224
|
if (col._weight) {
|
|
6173
6225
|
const cmw = col.minWidth;
|
|
@@ -6189,7 +6241,7 @@ class Wunderbaum {
|
|
|
6189
6241
|
col._ofsPx = ofsPx;
|
|
6190
6242
|
ofsPx += col._widthPx;
|
|
6191
6243
|
}
|
|
6192
|
-
|
|
6244
|
+
columns[columns.length - 1]._widthPx -= FIX_ADJUST_LAST_COL;
|
|
6193
6245
|
totalWidth = ofsPx - FIX_ADJUST_LAST_COL;
|
|
6194
6246
|
}
|
|
6195
6247
|
// if (this.options.fixedCol) {
|
|
@@ -6208,6 +6260,7 @@ class Wunderbaum {
|
|
|
6208
6260
|
this._updateRows();
|
|
6209
6261
|
}
|
|
6210
6262
|
}
|
|
6263
|
+
return modified;
|
|
6211
6264
|
}
|
|
6212
6265
|
/** Create/update header markup from `this.columns` definition.
|
|
6213
6266
|
* @internal
|
|
@@ -6292,8 +6345,8 @@ class Wunderbaum {
|
|
|
6292
6345
|
height = wantHeight;
|
|
6293
6346
|
}
|
|
6294
6347
|
// console.profile(`_updateViewportImmediately()`)
|
|
6295
|
-
this.updateColumns({ updateRows: false });
|
|
6296
|
-
this._updateRows({ newNodesOnly: newNodesOnly });
|
|
6348
|
+
const modified = this.updateColumns({ updateRows: false });
|
|
6349
|
+
this._updateRows({ newNodesOnly: newNodesOnly && !modified });
|
|
6297
6350
|
// console.profileEnd(`_updateViewportImmediately()`)
|
|
6298
6351
|
if (this.options.connectTopBreadcrumb) {
|
|
6299
6352
|
let path = (_a = this.getTopmostVpNode(true)) === null || _a === void 0 ? void 0 : _a.getPath(false, "title", " > ");
|
|
@@ -6620,6 +6673,18 @@ class Wunderbaum {
|
|
|
6620
6673
|
/* ---------------------------------------------------------------------------
|
|
6621
6674
|
* FILTER
|
|
6622
6675
|
* -------------------------------------------------------------------------*/
|
|
6676
|
+
/**
|
|
6677
|
+
* [ext-filter] Dim or hide nodes.
|
|
6678
|
+
*/
|
|
6679
|
+
filterNodes(filter, options) {
|
|
6680
|
+
return this.extensions.filter.filterNodes(filter, options);
|
|
6681
|
+
}
|
|
6682
|
+
/**
|
|
6683
|
+
* [ext-filter] Dim or hide whole branches.
|
|
6684
|
+
*/
|
|
6685
|
+
filterBranches(filter, options) {
|
|
6686
|
+
return this.extensions.filter.filterBranches(filter, options);
|
|
6687
|
+
}
|
|
6623
6688
|
/**
|
|
6624
6689
|
* [ext-filter] Reset the filter.
|
|
6625
6690
|
*
|
|
@@ -6647,7 +6712,7 @@ class Wunderbaum {
|
|
|
6647
6712
|
}
|
|
6648
6713
|
Wunderbaum.sequence = 0;
|
|
6649
6714
|
/** Wunderbaum release version number "MAJOR.MINOR.PATCH". */
|
|
6650
|
-
Wunderbaum.version = "v0.
|
|
6715
|
+
Wunderbaum.version = "v0.2.0"; // Set to semver by 'grunt release'
|
|
6651
6716
|
/** Expose some useful methods of the util.ts module as `Wunderbaum.util`. */
|
|
6652
6717
|
Wunderbaum.util = util;
|
|
6653
6718
|
|