wunderbaum 0.1.1 → 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 +9 -5
- package/dist/wunderbaum.esm.js +75 -26
- package/dist/wunderbaum.esm.min.js +17 -17
- package/dist/wunderbaum.esm.min.js.map +1 -1
- package/dist/wunderbaum.umd.js +75 -26
- package/dist/wunderbaum.umd.min.js +22 -22
- package/dist/wunderbaum.umd.min.js.map +1 -1
- package/package.json +1 -1
- 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/wunderbaum.ts +51 -3
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
|
@@ -1756,14 +1756,10 @@ declare module "wb_ext_filter" {
|
|
|
1756
1756
|
_applyFilterImpl(filter: string | NodeFilterCallback, branchMode: boolean, _opts: any): number;
|
|
1757
1757
|
/**
|
|
1758
1758
|
* [ext-filter] Dim or hide nodes.
|
|
1759
|
-
*
|
|
1760
|
-
* @param {boolean} [options={autoExpand: false, leavesOnly: false}]
|
|
1761
1759
|
*/
|
|
1762
1760
|
filterNodes(filter: string | NodeFilterCallback, options: FilterNodesOptions): void;
|
|
1763
1761
|
/**
|
|
1764
1762
|
* [ext-filter] Dim or hide whole branches.
|
|
1765
|
-
*
|
|
1766
|
-
* @param {boolean} [options={autoExpand: false}]
|
|
1767
1763
|
*/
|
|
1768
1764
|
filterBranches(filter: string | NodeFilterCallback, options: FilterNodesOptions): void;
|
|
1769
1765
|
/**
|
|
@@ -1951,7 +1947,7 @@ declare module "wunderbaum" {
|
|
|
1951
1947
|
import "./wunderbaum.scss";
|
|
1952
1948
|
import * as util from "util";
|
|
1953
1949
|
import { ExtensionsDict, WunderbaumExtension } from "wb_extension_base";
|
|
1954
|
-
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";
|
|
1955
1951
|
import { WunderbaumNode } from "wb_node";
|
|
1956
1952
|
import { WunderbaumOptions } from "wb_options";
|
|
1957
1953
|
/**
|
|
@@ -2387,6 +2383,14 @@ declare module "wunderbaum" {
|
|
|
2387
2383
|
* ```
|
|
2388
2384
|
*/
|
|
2389
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;
|
|
2390
2394
|
/**
|
|
2391
2395
|
* [ext-filter] Reset the filter.
|
|
2392
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([
|
|
@@ -4403,7 +4422,7 @@ WunderbaumNode.sequence = 0;
|
|
|
4403
4422
|
/*!
|
|
4404
4423
|
* Wunderbaum - ext-edit
|
|
4405
4424
|
* Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
|
|
4406
|
-
* v0.
|
|
4425
|
+
* v0.2.0, Tue, 17 Jan 2023 19:26:18 GMT (https://github.com/mar10/wunderbaum)
|
|
4407
4426
|
*/
|
|
4408
4427
|
// const START_MARKER = "\uFFF7";
|
|
4409
4428
|
class EditExtension extends WunderbaumExtension {
|
|
@@ -4494,7 +4513,7 @@ class EditExtension extends WunderbaumExtension {
|
|
|
4494
4513
|
const trigger = this.getPluginOption("trigger");
|
|
4495
4514
|
// const inputElem =
|
|
4496
4515
|
// event.target && event.target.closest("input,[contenteditable]");
|
|
4497
|
-
// tree.logDebug(`_preprocessKeyEvent: ${eventName}`);
|
|
4516
|
+
// tree.logDebug(`_preprocessKeyEvent: ${eventName}, editing:${this.isEditingTitle()}`);
|
|
4498
4517
|
// --- Title editing: apply/discard ---
|
|
4499
4518
|
// if (inputElem) {
|
|
4500
4519
|
if (this.isEditingTitle()) {
|
|
@@ -4698,8 +4717,8 @@ class EditExtension extends WunderbaumExtension {
|
|
|
4698
4717
|
* https://github.com/mar10/wunderbaum
|
|
4699
4718
|
*
|
|
4700
4719
|
* Released under the MIT license.
|
|
4701
|
-
* @version v0.
|
|
4702
|
-
* @date
|
|
4720
|
+
* @version v0.2.0
|
|
4721
|
+
* @date Tue, 17 Jan 2023 19:26:18 GMT
|
|
4703
4722
|
*/
|
|
4704
4723
|
class WbSystemRoot extends WunderbaumNode {
|
|
4705
4724
|
constructor(tree) {
|
|
@@ -4986,6 +5005,7 @@ class Wunderbaum {
|
|
|
4986
5005
|
return false;
|
|
4987
5006
|
}
|
|
4988
5007
|
if (node && info.colIdx === 0 && node.isExpandable()) {
|
|
5008
|
+
this._callMethod("edit._stopEditTitle");
|
|
4989
5009
|
node.setExpanded(!node.isExpanded());
|
|
4990
5010
|
}
|
|
4991
5011
|
});
|
|
@@ -5002,7 +5022,16 @@ class Wunderbaum {
|
|
|
5002
5022
|
});
|
|
5003
5023
|
onEvent(this.element, "focusin focusout", (e) => {
|
|
5004
5024
|
const flag = e.type === "focusin";
|
|
5025
|
+
const targetNode = Wunderbaum.getNode(e);
|
|
5005
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
|
+
}
|
|
5006
5035
|
if (!flag) {
|
|
5007
5036
|
this._callMethod("edit._stopEditTitle", true, {
|
|
5008
5037
|
event: e,
|
|
@@ -6144,6 +6173,8 @@ class Wunderbaum {
|
|
|
6144
6173
|
const isGrid = this.isGrid();
|
|
6145
6174
|
// Shorten last column width to avoid h-scrollbar
|
|
6146
6175
|
const FIX_ADJUST_LAST_COL = 2;
|
|
6176
|
+
const columns = this.columns;
|
|
6177
|
+
const col0 = columns[0];
|
|
6147
6178
|
let totalWidth = 0;
|
|
6148
6179
|
let totalWeight = 0;
|
|
6149
6180
|
let fixedWidth = 0;
|
|
@@ -6153,11 +6184,17 @@ class Wunderbaum {
|
|
|
6153
6184
|
this.setCellNav(false);
|
|
6154
6185
|
}
|
|
6155
6186
|
if (options.calculateCols) {
|
|
6187
|
+
if (col0.id !== "*") {
|
|
6188
|
+
throw new Error(`First column must have id '*': got '${col0.id}'`);
|
|
6189
|
+
}
|
|
6156
6190
|
// Gather width definitions
|
|
6157
6191
|
this._columnsById = {};
|
|
6158
|
-
for (let col of
|
|
6192
|
+
for (let col of columns) {
|
|
6159
6193
|
this._columnsById[col.id] = col;
|
|
6160
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
|
+
}
|
|
6161
6198
|
if (!cw || cw === "*") {
|
|
6162
6199
|
col._weight = 1.0;
|
|
6163
6200
|
totalWeight += 1.0;
|
|
@@ -6182,7 +6219,7 @@ class Wunderbaum {
|
|
|
6182
6219
|
// Share remaining space between non-fixed columns
|
|
6183
6220
|
const restPx = Math.max(0, vpWidth - fixedWidth);
|
|
6184
6221
|
let ofsPx = 0;
|
|
6185
|
-
for (let col of
|
|
6222
|
+
for (let col of columns) {
|
|
6186
6223
|
let minWidth;
|
|
6187
6224
|
if (col._weight) {
|
|
6188
6225
|
const cmw = col.minWidth;
|
|
@@ -6204,7 +6241,7 @@ class Wunderbaum {
|
|
|
6204
6241
|
col._ofsPx = ofsPx;
|
|
6205
6242
|
ofsPx += col._widthPx;
|
|
6206
6243
|
}
|
|
6207
|
-
|
|
6244
|
+
columns[columns.length - 1]._widthPx -= FIX_ADJUST_LAST_COL;
|
|
6208
6245
|
totalWidth = ofsPx - FIX_ADJUST_LAST_COL;
|
|
6209
6246
|
}
|
|
6210
6247
|
// if (this.options.fixedCol) {
|
|
@@ -6636,6 +6673,18 @@ class Wunderbaum {
|
|
|
6636
6673
|
/* ---------------------------------------------------------------------------
|
|
6637
6674
|
* FILTER
|
|
6638
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
|
+
}
|
|
6639
6688
|
/**
|
|
6640
6689
|
* [ext-filter] Reset the filter.
|
|
6641
6690
|
*
|
|
@@ -6663,7 +6712,7 @@ class Wunderbaum {
|
|
|
6663
6712
|
}
|
|
6664
6713
|
Wunderbaum.sequence = 0;
|
|
6665
6714
|
/** Wunderbaum release version number "MAJOR.MINOR.PATCH". */
|
|
6666
|
-
Wunderbaum.version = "v0.
|
|
6715
|
+
Wunderbaum.version = "v0.2.0"; // Set to semver by 'grunt release'
|
|
6667
6716
|
/** Expose some useful methods of the util.ts module as `Wunderbaum.util`. */
|
|
6668
6717
|
Wunderbaum.util = util;
|
|
6669
6718
|
|