@node-projects/web-component-designer-widgets-wunderbaum 0.1.12 → 0.1.14

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.
@@ -11,7 +11,7 @@ export class BindableObjectsBrowser extends BaseCustomWebComponentConstructorApp
11
11
  objectDoubleclicked = new TypedEvent;
12
12
  static style = css ``;
13
13
  static template = html `
14
- <div id="tree" style="height: 100%; overflow: auto;" class="wb-skeleton wb-initializing wb-no-select wb-alternate">
14
+ <div id="tree" style="height: 100%; overflow: auto; box-sizing: border-box;" class="wb-skeleton wb-initializing wb-no-select wb-alternate">
15
15
  </div>`;
16
16
  constructor() {
17
17
  super();
@@ -40,6 +40,7 @@ export class BindableObjectsBrowser extends BaseCustomWebComponentConstructorApp
40
40
  })));
41
41
  });
42
42
  },
43
+ //@ts-ignore
43
44
  dblclick: (e) => {
44
45
  this.objectDoubleclicked.emit();
45
46
  return true;
@@ -20,7 +20,7 @@ export class PaletteTreeView extends BaseCustomWebComponentConstructorAppend {
20
20
  <div style="height: 100%;">
21
21
  <input id="input" style="width: 100%; height: 25px; box-sizing: border-box;" placeholder="Filter..." autocomplete="off">
22
22
  <div style="height: calc(100% - 26px);">
23
- <div id="treetable" class="wb-alternate" style="min-width: 100%;"></div>
23
+ <div id="treetable" class="wb-alternate" style="min-width: 100%; box-sizing: border-box;"></div>
24
24
  </div>
25
25
  </div>`;
26
26
  serviceContainer;
@@ -50,7 +50,7 @@ export class TreeViewExtended extends BaseCustomWebComponentConstructorAppend {
50
50
  <div style="height: 100%;">
51
51
  <input id="input" style="width: 100%; box-sizing: border-box; height:27px;" placeholder="Filter... (regex)" autocomplete="off">
52
52
  <div style="height: calc(100% - 23px);">
53
- <div id="treetable" class="wb-alternate" style="min-width: 100%;"></div>
53
+ <div id="treetable" class="wb-alternate" style="min-width: 100%; box-sizing: border-box;"></div>
54
54
  </div>
55
55
  </div>`;
56
56
  constructor() {
@@ -62,6 +62,11 @@ export class TreeViewExtended extends BaseCustomWebComponentConstructorAppend {
62
62
  this._filterNodes();
63
63
  };
64
64
  this._treeDiv = this._getDomElement('treetable');
65
+ this._treeDiv.onscroll = () => {
66
+ for (let e of this._treeDiv.querySelectorAll('.cmd')) {
67
+ e.style.right = '-' + this._treeDiv.scrollLeft + 'px';
68
+ }
69
+ };
65
70
  }
66
71
  _filterNodes() {
67
72
  let match = this._filter.value;
@@ -121,6 +126,7 @@ export class TreeViewExtended extends BaseCustomWebComponentConstructorAppend {
121
126
  this._tree = new Wunderbaum({
122
127
  ...defaultOptions,
123
128
  element: this._treeDiv,
129
+ //@ts-ignore
124
130
  click: (e) => {
125
131
  if (e.event) { // only for clicked items, not when elements selected via code.
126
132
  let node = e.node;
@@ -209,6 +215,10 @@ export class TreeViewExtended extends BaseCustomWebComponentConstructorAppend {
209
215
  e.nodeElem.oncontextmenu = (e) => this.showDesignItemContextMenu(item, e);
210
216
  e.nodeElem.onmouseenter = (e) => item.instanceServiceContainer.designerCanvas.showHoverExtension(item.element, e);
211
217
  e.nodeElem.onmouseleave = (e) => item.instanceServiceContainer.designerCanvas.showHoverExtension(null, e);
218
+ let sp = document.createElement("span");
219
+ sp.style.display = "inline-block";
220
+ sp.style.width = "42px";
221
+ e.nodeElem.appendChild(sp);
212
222
  if (item && item.nodeType === NodeType.Element && item !== item.instanceServiceContainer.contentService.rootDesignItem) {
213
223
  let d = document.createElement("div");
214
224
  d.className = "cmd";
@@ -255,10 +265,15 @@ export class TreeViewExtended extends BaseCustomWebComponentConstructorAppend {
255
265
  this._highlight(event.selectedElements);
256
266
  }
257
267
  _recomputeTree(rootItem) {
258
- this._tree.root.removeChildren();
259
- this._getChildren(rootItem, null);
260
- this._tree.expandAll();
261
- this._filterNodes();
268
+ try {
269
+ this._tree.root.removeChildren();
270
+ this._getChildren(rootItem, null);
271
+ this._tree.expandAll();
272
+ this._filterNodes();
273
+ }
274
+ catch (err) {
275
+ console.error(err);
276
+ }
262
277
  }
263
278
  _getChildren(item, currentNode) {
264
279
  if (currentNode == null) {
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.12",
4
+ "version": "0.1.14",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "author": "jochen.kuehner@gmx.de",