wunderbaum 0.0.3 → 0.0.4
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 +130 -34
- package/dist/wunderbaum.esm.js +359 -270
- package/dist/wunderbaum.esm.min.js +19 -19
- package/dist/wunderbaum.esm.min.js.map +1 -1
- package/dist/wunderbaum.umd.js +359 -270
- package/dist/wunderbaum.umd.min.js +22 -23
- package/dist/wunderbaum.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/common.ts +10 -2
- package/src/deferred.ts +12 -2
- package/src/util.ts +81 -3
- package/src/wb_extension_base.ts +3 -3
- package/src/wb_node.ts +239 -158
- package/src/wb_options.ts +52 -18
- package/src/wunderbaum.scss +86 -23
- package/src/wunderbaum.ts +42 -36
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
Wunderbaum is a rewrite of the [Fancytree](https://github.com/mar10/fancytree)
|
|
15
15
|
library. Major features include
|
|
16
16
|
|
|
17
|
-
- **
|
|
17
|
+
- **Treegrid** control with emphasis on "tree".<br>
|
|
18
18
|
Depending on the number of columns and nesting depth, Wunderbaum can also be
|
|
19
19
|
used as a **plain tree**, **plain grid**, or a **simple list** control.
|
|
20
20
|
- **Performant** and efficient handling of **big data structures**.
|
package/dist/wunderbaum.css
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Wunderbaum style sheet (generated from wunderbaum.scss)
|
|
3
3
|
* Copyright (c) 2021-2022, Martin Wendt. Released under the MIT license.
|
|
4
4
|
* @VERSION, @DATE (https://github.com/mar10/wunderbaum)
|
|
5
|
-
*/div.wunderbaum{box-sizing:border-box;height:100%;margin:0;padding:0;font-family:Helvetica,sans-serif;font-size:14px;color:#56534c;border:1px solid #56534c;overflow:hidden}div.wunderbaum div.wb-scroll-container{position:relative;overflow:auto;min-height:4px}div.wunderbaum div.wb-row{position:absolute;width:100%;height:22px;line-height:22px;border:1px solid transparent}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 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-dirty,div.wunderbaum div.wb-node-list div.wb-row .wb-col.wb-dirty{font-style:italic;background:repeating-linear-gradient(45deg, #f7fcfe, #f7fcfe 5px, #dedede 5px, #dedede 10px);animation:wb-dirty-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:relative;height:22px;border-bottom:1px solid #56534c;padding:0;background-color:#dedede}div.wunderbaum div.wb-header span.wb-col{font-weight:bold}div.wunderbaum span.wb-col{position:absolute;display:inline-block;height:20px;line-height:20px;padding:0 2px;border-right:1px solid #dedede;overflow:visible}div.wunderbaum span.wb-col:last-of-type{border-right:none}div.wunderbaum span.wb-col span.wb-col-title{width:100%;overflow:hidden;text-overflow:ellipsis}div.wunderbaum span.wb-col 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-node{user-select:none}div.wunderbaum i.wb-checkbox,div.wunderbaum i.wb-expander,div.wunderbaum i.wb-icon,div.wunderbaum i.wb-indent{height:20px;width:20px;padding:2px 2px;display:inline-block}div.wunderbaum i.bi::before{vertical-align:baseline}div.wunderbaum img.wb-icon{width:16px;height:16px;padding:2px 2px}div.wunderbaum i.wb-indent::before{content:"\00a0"}div.wunderbaum i.wb-expander.wb-spin,div.wunderbaum i.wb-icon.wb-spin{height:unset;width:unset;padding:0 3px;animation:wb-spin-animation 2s linear infinite}div.wunderbaum span.wb-title{min-width:1em;display:inline-block;vertical-align:top;overflow-x:hidden;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%}div.wunderbaum.wb-grid.wb-cell-mode div.wb-row{background-color:#fcfcfc}div.wunderbaum.wb-grid.wb-cell-mode div.wb-row span.wb-col.wb-active{background-color:#f7fcfe}div.wunderbaum.wb-grid.wb-cell-mode div.wb-row.wb-active{background-color:#f7fcfe}div.wunderbaum.wb-grid.wb-cell-mode div.wb-row.wb-active span.wb-col.wb-active{background-color:#26a0da}div.wunderbaum.wb-grid.wb-cell-mode.wb-cell-edit-mode div.wb-row.wb-active span.wb-col.wb-active{background-color:#b5373b}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:#fcfcfc}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:#f7fcfe}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-helper-start{text-align:left}.wb-helper-end{text-align:right}.wb-rtl .wb-helper-start{text-align:right}.wb-rtl .wb-helper-end{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-dirty-animation{0%{background-position:0 0}100%{background-position:-70px 0}}
|
|
5
|
+
*/div.wunderbaum{box-sizing:border-box;height:100%;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:hidden}div.wunderbaum:focus,div.wunderbaum:focus-within{border-color:#275dc5}div.wunderbaum div.wb-scroll-container{position:relative;overflow:auto;min-height:4px}div.wunderbaum div.wb-row{position:absolute;width:100%;height:22px;line-height:22px;border:1px solid transparent}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 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-dirty,div.wunderbaum div.wb-node-list div.wb-row .wb-col.wb-dirty{font-style:italic;background:repeating-linear-gradient(45deg, #f7fcfe, #f7fcfe 5px, #dedede 5px, #dedede 10px);animation:wb-dirty-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:relative;height:22px;border-bottom:1px solid #56534c;padding:0;background-color:#dedede}div.wunderbaum div.wb-header span.wb-col{font-weight:bold}div.wunderbaum span.wb-col{position:absolute;display:inline-block;height:20px;line-height:20px;padding:0 2px;border-right:1px solid #dedede;overflow:visible}div.wunderbaum span.wb-col:last-of-type{border-right:none}div.wunderbaum span.wb-col span.wb-col-title{width:100%;overflow:hidden;text-overflow:ellipsis}div.wunderbaum span.wb-col 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-node{user-select:none}div.wunderbaum i.wb-checkbox,div.wunderbaum i.wb-expander,div.wunderbaum i.wb-icon,div.wunderbaum i.wb-indent{height:20px;width:20px;padding:2px 2px;display:inline-block}div.wunderbaum i.bi::before{vertical-align:baseline}div.wunderbaum img.wb-icon{width:16px;height:16px;padding:2px 2px}div.wunderbaum i.wb-indent::before{content:"\00a0"}div.wunderbaum i.wb-expander.wb-spin,div.wunderbaum i.wb-icon.wb-spin{height:unset;width:unset;padding:0 3px;animation:wb-spin-animation 2s linear infinite}div.wunderbaum span.wb-title{min-width:1em;display:inline-block;vertical-align:top;overflow-x:hidden;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%}div.wunderbaum.wb-grid.wb-cell-mode div.wb-row{background-color:#fff}div.wunderbaum.wb-grid.wb-cell-mode div.wb-row span.wb-col.wb-active{background-color:#f7fcfe}div.wunderbaum.wb-grid.wb-cell-mode div.wb-row.wb-active{background-color:#f7fcfe}div.wunderbaum.wb-grid.wb-cell-mode div.wb-row.wb-active span.wb-col.wb-active{background-color:#26a0da}div.wunderbaum.wb-grid.wb-cell-mode.wb-cell-edit-mode div.wb-row.wb-active span.wb-col.wb-active{background-color:#b5373b}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:#fcfcfc}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:#f7fcfe}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-helper-start{text-align:left}.wb-helper-end{text-align:right}.wb-rtl .wb-helper-start{text-align:right}.wb-rtl .wb-helper-end{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-dirty-animation{0%{background-position:0 0}100%{background-position:-70px 0}}
|
package/dist/wunderbaum.d.ts
CHANGED
|
@@ -165,7 +165,7 @@ declare module "util" {
|
|
|
165
165
|
*/
|
|
166
166
|
export function overrideMethod(instance: any, methodName: string, handler: FunctionType, ctx?: any): void;
|
|
167
167
|
/** Run function after ms milliseconds and return a promise that resolves when done. */
|
|
168
|
-
export function setTimeoutPromise(callback: (...args: any[]) => void, ms: number): Promise<unknown>;
|
|
168
|
+
export function setTimeoutPromise(this: unknown, callback: (...args: any[]) => void, ms: number): Promise<unknown>;
|
|
169
169
|
/**
|
|
170
170
|
* Wait `ms` microseconds.
|
|
171
171
|
*
|
|
@@ -200,6 +200,19 @@ declare module "util" {
|
|
|
200
200
|
export function toSet(val: any): Set<string>;
|
|
201
201
|
/**Return a canonical string representation for an object's type (e.g. 'array', 'number', ...) */
|
|
202
202
|
export function type(obj: any): string;
|
|
203
|
+
/**
|
|
204
|
+
* Return a function that can be called instead of `callback`, but guarantees
|
|
205
|
+
* a limited execution rate.
|
|
206
|
+
* The execution rate is calculated based on the runtime duration of the
|
|
207
|
+
* previous call.
|
|
208
|
+
* Example:
|
|
209
|
+
* ```js
|
|
210
|
+
* throttledFoo = util.addaptiveThrottle(foo.bind(this), {});
|
|
211
|
+
* throttledFoo();
|
|
212
|
+
* throttledFoo();
|
|
213
|
+
* ```
|
|
214
|
+
*/
|
|
215
|
+
export function addaptiveThrottle(this: unknown, callback: (...args: any[]) => void, options: any): (...args: any[]) => void;
|
|
203
216
|
}
|
|
204
217
|
declare module "deferred" {
|
|
205
218
|
/*!
|
|
@@ -210,9 +223,19 @@ declare module "deferred" {
|
|
|
210
223
|
type PromiseCallbackType = (val: any) => void;
|
|
211
224
|
type finallyCallbackType = () => void;
|
|
212
225
|
/**
|
|
213
|
-
*
|
|
226
|
+
* Implement a ES6 Promise, that exposes a resolve() and reject() method.
|
|
214
227
|
*
|
|
215
|
-
* Loosely mimics
|
|
228
|
+
* Loosely mimics {@link https://api.jquery.com/category/deferred-object/ | jQuery.Deferred}.
|
|
229
|
+
* Example:
|
|
230
|
+
* ```js
|
|
231
|
+
* function foo() {
|
|
232
|
+
* let dfd = new Deferred(),
|
|
233
|
+
* ...
|
|
234
|
+
* dfd.resolve('foo')
|
|
235
|
+
* ...
|
|
236
|
+
* return dfd.promise();
|
|
237
|
+
* }
|
|
238
|
+
* ```
|
|
216
239
|
*/
|
|
217
240
|
export class Deferred {
|
|
218
241
|
private _promise;
|
|
@@ -423,6 +446,21 @@ declare module "wb_options" {
|
|
|
423
446
|
* ...
|
|
424
447
|
* });
|
|
425
448
|
* ```
|
|
449
|
+
*
|
|
450
|
+
* Event handlers are also passed as callbacks
|
|
451
|
+
*
|
|
452
|
+
* ```js
|
|
453
|
+
* const tree = new mar10.Wunderbaum({
|
|
454
|
+
* ...
|
|
455
|
+
* init: (e) => {
|
|
456
|
+
* console.log(`Tree ${e.tree} was initialized and loaded.`)
|
|
457
|
+
* },
|
|
458
|
+
* activate: (e) => {
|
|
459
|
+
* console.log(`Node ${e.node} was activated.`)
|
|
460
|
+
* },
|
|
461
|
+
* ...
|
|
462
|
+
* });
|
|
463
|
+
* ```
|
|
426
464
|
*/
|
|
427
465
|
export interface WunderbaumOptions {
|
|
428
466
|
/**
|
|
@@ -524,21 +562,21 @@ declare module "wb_options" {
|
|
|
524
562
|
filter: any;
|
|
525
563
|
grid: any;
|
|
526
564
|
/**
|
|
527
|
-
*
|
|
528
|
-
* Check `e.error` for status.
|
|
565
|
+
*
|
|
529
566
|
* @category Callback
|
|
530
567
|
*/
|
|
531
|
-
|
|
568
|
+
activate?: (e: WbNodeEventType) => void;
|
|
532
569
|
/**
|
|
533
570
|
*
|
|
534
571
|
* @category Callback
|
|
535
572
|
*/
|
|
536
|
-
|
|
573
|
+
change?: (e: WbNodeEventType) => void;
|
|
537
574
|
/**
|
|
538
575
|
*
|
|
576
|
+
* Return `false` to prevent default handling, e.g. activating the node.
|
|
539
577
|
* @category Callback
|
|
540
578
|
*/
|
|
541
|
-
|
|
579
|
+
click?: (e: WbTreeEventType) => void;
|
|
542
580
|
/**
|
|
543
581
|
*
|
|
544
582
|
* @category Callback
|
|
@@ -548,40 +586,47 @@ declare module "wb_options" {
|
|
|
548
586
|
*
|
|
549
587
|
* @category Callback
|
|
550
588
|
*/
|
|
551
|
-
|
|
589
|
+
discard?: (e: WbNodeEventType) => void;
|
|
552
590
|
/**
|
|
553
591
|
*
|
|
554
592
|
* @category Callback
|
|
555
593
|
*/
|
|
556
|
-
|
|
594
|
+
enhanceTitle?: (e: WbNodeEventType) => void;
|
|
557
595
|
/**
|
|
558
596
|
*
|
|
559
597
|
* @category Callback
|
|
560
598
|
*/
|
|
561
|
-
|
|
599
|
+
error?: (e: WbTreeEventType) => void;
|
|
562
600
|
/**
|
|
563
601
|
*
|
|
602
|
+
* Check `e.flag` for status.
|
|
564
603
|
* @category Callback
|
|
565
604
|
*/
|
|
566
|
-
|
|
605
|
+
focus?: (e: WbTreeEventType) => void;
|
|
567
606
|
/**
|
|
568
|
-
*
|
|
607
|
+
* Fires when the tree markup was created and the initial source data was loaded.
|
|
608
|
+
* Typical use cases would be activating a node, setting focus, enabling other
|
|
609
|
+
* controls on the page, etc.<br>
|
|
610
|
+
* Check `e.error` for status.
|
|
569
611
|
* @category Callback
|
|
570
612
|
*/
|
|
571
|
-
|
|
613
|
+
init?: (e: WbTreeEventType) => void;
|
|
572
614
|
/**
|
|
573
615
|
*
|
|
574
|
-
* Check `e.flag` for status.
|
|
575
616
|
* @category Callback
|
|
576
617
|
*/
|
|
577
|
-
|
|
618
|
+
keydown?: (e: WbNodeEventType) => void;
|
|
578
619
|
/**
|
|
579
|
-
*
|
|
620
|
+
* Fires when a node that was marked 'lazy', is expanded for the first time.
|
|
621
|
+
* Typically we return an endpoint URL or the Promise of a fetch request that
|
|
622
|
+
* provides a (potentially nested) list of child nodes.
|
|
580
623
|
* @category Callback
|
|
581
624
|
*/
|
|
582
|
-
|
|
625
|
+
lazyLoad?: (e: WbNodeEventType) => void;
|
|
583
626
|
/**
|
|
584
|
-
*
|
|
627
|
+
* Fires when data was loaded (initial request, reload, or lazy loading),
|
|
628
|
+
* after the data is applied and rendered.
|
|
629
|
+
* @category Callback
|
|
585
630
|
*/
|
|
586
631
|
load?: (e: WbNodeEventType) => void;
|
|
587
632
|
/**
|
|
@@ -589,12 +634,19 @@ declare module "wb_options" {
|
|
|
589
634
|
*/
|
|
590
635
|
modifyChild?: (e: WbNodeEventType) => void;
|
|
591
636
|
/**
|
|
592
|
-
*
|
|
637
|
+
* Fires when data was fetched (initial request, reload, or lazy loading),
|
|
638
|
+
* but before the data is applied and rendered.
|
|
639
|
+
* Here we can modify and adjust the received data, for example to convert an
|
|
640
|
+
* external response to native Wunderbaum syntax.
|
|
593
641
|
* @category Callback
|
|
594
642
|
*/
|
|
595
643
|
receive?: (e: WbNodeEventType) => void;
|
|
596
644
|
/**
|
|
597
|
-
*
|
|
645
|
+
* Fires when a node is about to be displayed.
|
|
646
|
+
* The default HTML markup is already created, but not yet added to the DOM.
|
|
647
|
+
* Now we can tweak the markup, create HTML elements in this node's column
|
|
648
|
+
* cells, etc.
|
|
649
|
+
* See also `Custom Rendering` for details.
|
|
598
650
|
* @category Callback
|
|
599
651
|
*/
|
|
600
652
|
render?: (e: WbNodeEventType) => void;
|
|
@@ -609,6 +661,11 @@ declare module "wb_options" {
|
|
|
609
661
|
* @category Callback
|
|
610
662
|
*/
|
|
611
663
|
select?: (e: WbNodeEventType) => void;
|
|
664
|
+
/**
|
|
665
|
+
* Fires when the viewport content was updated, after scroling, expanding etc.
|
|
666
|
+
* @category Callback
|
|
667
|
+
*/
|
|
668
|
+
update?: (e: WbTreeEventType) => void;
|
|
612
669
|
}
|
|
613
670
|
}
|
|
614
671
|
declare module "wb_node" {
|
|
@@ -689,7 +746,7 @@ declare module "wb_node" {
|
|
|
689
746
|
* node._callEvent("edit.beforeEdit", {foo: 42})
|
|
690
747
|
* ```
|
|
691
748
|
*/
|
|
692
|
-
_callEvent(
|
|
749
|
+
_callEvent(type: string, extra?: any): any;
|
|
693
750
|
/**
|
|
694
751
|
* Append (or insert) a list of child nodes.
|
|
695
752
|
*
|
|
@@ -874,8 +931,34 @@ declare module "wb_node" {
|
|
|
874
931
|
[key: string]: any;
|
|
875
932
|
};
|
|
876
933
|
protected _createIcon(parentElem: HTMLElement, replaceChild?: HTMLElement): HTMLElement | null;
|
|
877
|
-
/**
|
|
878
|
-
|
|
934
|
+
/**
|
|
935
|
+
* Create a whole new `<div class="wb-row">` element.
|
|
936
|
+
* @see {@link Wunderbaumode.render}
|
|
937
|
+
*/
|
|
938
|
+
protected _render_markup(opts: any): void;
|
|
939
|
+
/**
|
|
940
|
+
* Render `node.title`, `.icon` into an existing row.
|
|
941
|
+
*
|
|
942
|
+
* @see {@link Wunderbaumode.render}
|
|
943
|
+
*/
|
|
944
|
+
protected _render_data(opts: any): void;
|
|
945
|
+
/**
|
|
946
|
+
* Update row classes to reflect active, focuses, etc.
|
|
947
|
+
* @see {@link Wunderbaumode.render}
|
|
948
|
+
*/
|
|
949
|
+
protected _render_status(opts: any): void;
|
|
950
|
+
/**
|
|
951
|
+
* Create or update node's markup.
|
|
952
|
+
*
|
|
953
|
+
* `options.change` defaults to ChangeType.data, which updates the title,
|
|
954
|
+
* icon, and status. It also triggers the `render` event, that lets the user
|
|
955
|
+
* create or update the content of embeded cell elements.<br>
|
|
956
|
+
*
|
|
957
|
+
* If only the status or other class-only modifications have changed,
|
|
958
|
+
* `options.change` should be set to ChangeType.status instead for best
|
|
959
|
+
* efficiency.
|
|
960
|
+
*/
|
|
961
|
+
render(options?: any): void;
|
|
879
962
|
/**
|
|
880
963
|
* Remove all children, collapse, and set the lazy-flag, so that the lazyLoad
|
|
881
964
|
* event is triggered on next expand.
|
|
@@ -930,7 +1013,13 @@ declare module "wb_node" {
|
|
|
930
1013
|
setIcon(): void;
|
|
931
1014
|
/** Change node's {@link key} and/or {@link refKey}. */
|
|
932
1015
|
setKey(key: string | null, refKey: string | null): void;
|
|
933
|
-
/**
|
|
1016
|
+
/**
|
|
1017
|
+
* Schedule a render, typically called to update after a status or data change.
|
|
1018
|
+
*
|
|
1019
|
+
* `change` defaults to 'data', which handles modifcations of title, icon,
|
|
1020
|
+
* and column content. It can be reduced to 'ChangeType.status' if only
|
|
1021
|
+
* active/focus/selected state has changed.
|
|
1022
|
+
*/
|
|
934
1023
|
setModified(change?: ChangeType): void;
|
|
935
1024
|
/** Modify the check/uncheck state. */
|
|
936
1025
|
setSelected(flag?: boolean, options?: SetSelectedOptions): void;
|
|
@@ -999,7 +1088,7 @@ declare module "common" {
|
|
|
999
1088
|
export type NodeVisitResponse = "skip" | boolean | void;
|
|
1000
1089
|
export type NodeVisitCallback = (node: WunderbaumNode) => NodeVisitResponse;
|
|
1001
1090
|
export type WbTreeEventType = {
|
|
1002
|
-
|
|
1091
|
+
type: string;
|
|
1003
1092
|
event: Event;
|
|
1004
1093
|
tree: Wunderbaum;
|
|
1005
1094
|
[key: string]: unknown;
|
|
@@ -1016,12 +1105,20 @@ declare module "common" {
|
|
|
1016
1105
|
export type AddNodeType = "before" | "after" | "prependChild" | "appendChild";
|
|
1017
1106
|
export type DndModeType = "before" | "after" | "over";
|
|
1018
1107
|
export enum ChangeType {
|
|
1108
|
+
/** Re-render the whole viewport, headers, and all rows. */
|
|
1019
1109
|
any = "any",
|
|
1110
|
+
/** Update current row title, icon, columns, and status. */
|
|
1111
|
+
data = "data",
|
|
1112
|
+
/** Redraw the header and update the width of all row columns. */
|
|
1113
|
+
header = "header",
|
|
1114
|
+
/** Re-render the whole current row. */
|
|
1020
1115
|
row = "row",
|
|
1116
|
+
/** Alias for 'any'. */
|
|
1021
1117
|
structure = "structure",
|
|
1118
|
+
/** Update current row's classes, to reflect active, selected, ... */
|
|
1022
1119
|
status = "status",
|
|
1023
|
-
|
|
1024
|
-
|
|
1120
|
+
/** Update the 'top' property of all rows. */
|
|
1121
|
+
vscroll = "vscroll"
|
|
1025
1122
|
}
|
|
1026
1123
|
export enum NodeStatusType {
|
|
1027
1124
|
ok = "ok",
|
|
@@ -1427,7 +1524,6 @@ declare module "wunderbaum" {
|
|
|
1427
1524
|
import { ExtensionsDict, WunderbaumExtension } from "wb_extension_base";
|
|
1428
1525
|
import { NavigationMode, ChangeType, FilterModeType, MatcherType, NodeStatusType, TargetType as NodeRegion, ApplyCommandType } from "common";
|
|
1429
1526
|
import { WunderbaumNode } from "wb_node";
|
|
1430
|
-
import { DebouncedFunction } from "debounce";
|
|
1431
1527
|
import { WunderbaumOptions } from "wb_options";
|
|
1432
1528
|
/**
|
|
1433
1529
|
* A persistent plain object or array.
|
|
@@ -1450,7 +1546,7 @@ declare module "wunderbaum" {
|
|
|
1450
1546
|
readonly scrollContainer: HTMLDivElement;
|
|
1451
1547
|
/** The `div.wb-node-list` element that contains all visible div.wb-row child elements. */
|
|
1452
1548
|
readonly nodeListElement: HTMLDivElement;
|
|
1453
|
-
protected readonly _updateViewportThrottled:
|
|
1549
|
+
protected readonly _updateViewportThrottled: (...args: any) => void;
|
|
1454
1550
|
protected extensionList: WunderbaumExtension[];
|
|
1455
1551
|
protected extensions: ExtensionsDict;
|
|
1456
1552
|
/** Merged options from constructor args and tree- and extension defaults. */
|
|
@@ -1534,13 +1630,13 @@ declare module "wunderbaum" {
|
|
|
1534
1630
|
* tree._callEvent("edit.beforeEdit", {foo: 42})
|
|
1535
1631
|
* ```
|
|
1536
1632
|
*/
|
|
1537
|
-
_callEvent(
|
|
1633
|
+
_callEvent(type: string, extra?: any): any;
|
|
1538
1634
|
/** Return the node for given row index. */
|
|
1539
1635
|
protected _getNodeByRowIdx(idx: number): WunderbaumNode | null;
|
|
1540
1636
|
/** Return the topmost visible node in the viewport. */
|
|
1541
|
-
|
|
1637
|
+
getTopmostVpNode(complete?: boolean): WunderbaumNode;
|
|
1542
1638
|
/** Return the lowest visible node in the viewport. */
|
|
1543
|
-
|
|
1639
|
+
getLowestVpNode(complete?: boolean): WunderbaumNode;
|
|
1544
1640
|
/** Return preceeding visible node in the viewport. */
|
|
1545
1641
|
protected _getPrevNodeInView(node?: WunderbaumNode, ofs?: number): WunderbaumNode;
|
|
1546
1642
|
/** Return following visible node in the viewport. */
|
|
@@ -1781,7 +1877,7 @@ declare module "wunderbaum" {
|
|
|
1781
1877
|
* tree.enableUpdate(false);
|
|
1782
1878
|
* // ... (long running operation that would trigger many updates)
|
|
1783
1879
|
* foo();
|
|
1784
|
-
* // ... NOTE: make sure that async operations have finished
|
|
1880
|
+
* // ... NOTE: make sure that async operations have finished, e.g.
|
|
1785
1881
|
* await foo();
|
|
1786
1882
|
* } finally {
|
|
1787
1883
|
* tree.enableUpdate(true);
|