@node-projects/web-component-designer-widgets-wunderbaum 0.1.23 → 0.1.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,3 @@
1
- /// <reference types="wunderbaum" />
2
1
  import { BaseCustomWebComponentConstructorAppend } from '@node-projects/base-custom-webcomponent';
3
2
  import { ITreeView, InstanceServiceContainer, IDesignItem, ContextMenu, ISelectionChangedEvent } from '@node-projects/web-component-designer';
4
3
  import { WunderbaumNode } from 'wb_node';
@@ -64,7 +64,11 @@ export class TreeViewExtended extends BaseCustomWebComponentConstructorAppend {
64
64
  static template = html `
65
65
  <div style="height: 100%;">
66
66
  <input id="input" style="width: 100%; box-sizing: border-box; height:27px;" placeholder="Filter... (regex)" autocomplete="off">
67
- <div style="height: calc(100% - 23px);">
67
+ <div style="height: 18px; border: solid black 1px; padding-left:2px; background: gray;">
68
+ <svg id="expandAll" style="width: 16px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M64 80a16 16 0 0 0-16 16v320a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V96a16 16 0 0 0-16-16zM0 96a64 64 0 0 1 64-64h320a64 64 0 0 1 64 64v320a64 64 0 0 1-64 64H64a64 64 0 0 1-64-64zm200 248v-64h-64a24 24 0 1 1 0-48h64v-64a24 24 0 1 1 48 0v64h64a24 24 0 1 1 0 48h-64v64a24 24 0 1 1-48 0"></path></svg>
69
+ <svg id="collapseAll" style="width: 16px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M64 80a16 16 0 0 0-16 16v320a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V96a16 16 0 0 0-16-16zM0 96a64 64 0 0 1 64-64h320a64 64 0 0 1 64 64v320a64 64 0 0 1-64 64H64a64 64 0 0 1-64-64zm152 136h144a24 24 0 1 1 0 48H152a24 24 0 1 1 0-48"></path></svg>
70
+ </div>
71
+ <div style="height: calc(100% - 46px);">
68
72
  <div id="treetable" class="wb-alternate" style="min-width: 100%; box-sizing: border-box;"></div>
69
73
  </div>
70
74
  </div>`;
@@ -82,6 +86,22 @@ export class TreeViewExtended extends BaseCustomWebComponentConstructorAppend {
82
86
  e.style.right = '-' + this._treeDiv.scrollLeft + 'px';
83
87
  }
84
88
  };
89
+ const expand = this._getDomElement('expandAll');
90
+ expand.onclick = () => {
91
+ this._tree.root
92
+ .visit((node) => {
93
+ if (!node.isExpanded())
94
+ node.setExpanded(true);
95
+ });
96
+ };
97
+ const collapse = this._getDomElement('collapseAll');
98
+ collapse.onclick = () => {
99
+ this._tree.root
100
+ .visit((node) => {
101
+ if (node.isExpanded())
102
+ node.setExpanded(false);
103
+ });
104
+ };
85
105
  }
86
106
  _filterNodes() {
87
107
  let match = this._filter.value;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "description": "web-component-designer addon: Widgets using wunderbaum",
3
3
  "name": "@node-projects/web-component-designer-widgets-wunderbaum",
4
- "version": "0.1.23",
4
+ "version": "0.1.25",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "author": "jochen.kuehner@gmx.de",