@eclipse-scout/core 22.0.29 → 22.0.34

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.
Files changed (38) hide show
  1. package/dist/eclipse-scout-core-0c86d1e671be93def26c.min.js +2 -0
  2. package/dist/eclipse-scout-core-0c86d1e671be93def26c.min.js.map +1 -0
  3. package/dist/eclipse-scout-core-theme-dark-17a1d77d53510e113a3c.min.css +1 -0
  4. package/dist/eclipse-scout-core-theme-dark.css +29 -4
  5. package/dist/eclipse-scout-core-theme-dark.css.map +1 -1
  6. package/dist/eclipse-scout-core-theme-dfed415a6b7fb17f3f4c.min.css +1 -0
  7. package/dist/eclipse-scout-core-theme.css +29 -4
  8. package/dist/eclipse-scout-core-theme.css.map +1 -1
  9. package/dist/eclipse-scout-core.js +8262 -26896
  10. package/dist/eclipse-scout-core.js.map +1 -1
  11. package/dist/file-list +4 -4
  12. package/package.json +2 -2
  13. package/src/App.js +31 -23
  14. package/src/ErrorHandler.js +3 -2
  15. package/src/RemoteApp.js +6 -13
  16. package/src/desktop/outline/Outline.js +3 -2
  17. package/src/desktop/outline/Outline.less +1 -0
  18. package/src/desktop/outline/OutlineLayout.js +1 -1
  19. package/src/desktop/outline/PageLayout.js +5 -2
  20. package/src/keystroke/KeyStroke.js +23 -18
  21. package/src/layout/graphics.js +15 -1
  22. package/src/main.less +1 -0
  23. package/src/popup/Popup.js +94 -15
  24. package/src/popup/Popup.less +6 -2
  25. package/src/session/Session.js +10 -5
  26. package/src/style/sizes.less +2 -0
  27. package/src/table/TableFooter.js +4 -4
  28. package/src/table/TableFooter.less +2 -2
  29. package/src/table/controls/TableControl.js +8 -3
  30. package/src/table/keystrokes/AbstractTableNavigationKeyStroke.js +1 -1
  31. package/src/tile/TileGrid.js +2 -1
  32. package/src/tree/Tree.js +46 -5
  33. package/src/tree/Tree.less +3 -1
  34. package/src/tree/TreeNode.js +4 -3
  35. package/dist/eclipse-scout-core-111d2d090dfd2183238f.min.js +0 -2
  36. package/dist/eclipse-scout-core-111d2d090dfd2183238f.min.js.map +0 -1
  37. package/dist/eclipse-scout-core-theme-dark-fd0e080c10f65e67b68b.min.css +0 -1
  38. package/dist/eclipse-scout-core-theme-f3a61fbc12acf8e27fcc.min.css +0 -1
@@ -197,6 +197,6 @@ export default class AbstractTableNavigationKeyStroke extends KeyStroke {
197
197
  }
198
198
 
199
199
  _isEnabled() {
200
- return !this.field.tileMode;
200
+ return !this.field.tileMode && super._isEnabled();
201
201
  }
202
202
  }
@@ -635,7 +635,8 @@ export default class TileGrid extends Widget {
635
635
  placeholders = [];
636
636
 
637
637
  if (tiles.length > 0) {
638
- lastX = tiles[tiles.length - 1].gridData.x;
638
+ let tile = tiles[tiles.length - 1];
639
+ lastX = tile.gridData.x + tile.gridData.w - 1;
639
640
  } else {
640
641
  // If there are no tiles, create one row with placeholders
641
642
  lastX = -1;
package/src/tree/Tree.js CHANGED
@@ -37,6 +37,7 @@ export default class Tree extends Widget {
37
37
  this.nodesMap = {}; // all nodes by id
38
38
  this.nodePaddingLevelCheckable = 23; /* padding for one tree-level if the tree is checkable */
39
39
  this.nodePaddingLevelNotCheckable = 18; /* padding for one tree-level if the tree is not checkable. this includes outline trees! */
40
+ this.nodePaddingLevelDiffParentHasIcon = null; /* is read from CSS */
40
41
  this.nodePaddingLeft = null; /* is read from CSS */
41
42
  this.nodeCheckBoxPaddingLeft = 29;
42
43
  this.nodeControlPaddingLeft = null; /* is read from CSS */
@@ -70,6 +71,7 @@ export default class Tree extends Widget {
70
71
 
71
72
  // contains all parents of a selected node, the selected node and the first level children
72
73
  this._inSelectionPathList = {};
74
+ this._changeNodeTaskScheduled = false;
73
75
  this.viewRangeRendered = new Range(0, 0);
74
76
  this.viewRangeSize = 20;
75
77
 
@@ -890,7 +892,7 @@ export default class Tree extends Widget {
890
892
 
891
893
  _renderNode(node) {
892
894
  let paddingLeft = this._computeNodePaddingLeft(node);
893
- node.render(this.$container, paddingLeft, this.checkable, this.enabledComputed);
895
+ node.render(this.$container, paddingLeft);
894
896
  return node.$node;
895
897
  }
896
898
 
@@ -953,7 +955,7 @@ export default class Tree extends Widget {
953
955
  let $control = $node.children('.tree-node-control');
954
956
  let $checkbox = $node.children('.tree-node-checkbox');
955
957
 
956
- node._updateControl($control, this);
958
+ node._updateControl($control);
957
959
  if (this.checkable) {
958
960
  if ($checkbox.length === 0) {
959
961
  node._renderCheckbox();
@@ -1312,7 +1314,7 @@ export default class Tree extends Widget {
1312
1314
  let node = $node.data('node');
1313
1315
  let paddingLeft = this._computeNodePaddingLeft(node);
1314
1316
  $node.cssPaddingLeft(objects.isNullOrUndefined(paddingLeft) ? '' : paddingLeft);
1315
- node._updateControl($node.children('.tree-node-control'), this);
1317
+ node._updateControl($node.children('.tree-node-control'));
1316
1318
  });
1317
1319
  }
1318
1320
 
@@ -2087,18 +2089,41 @@ export default class Tree extends Widget {
2087
2089
  if (this.isBreadcrumbStyleActive()) {
2088
2090
  return this.nodePaddingLeft;
2089
2091
  }
2090
- let padding = node.level * this.nodePaddingLevel + this.nodePaddingLeft;
2092
+ let padding = this.nodePaddingLeft + this._computeNodePaddingLeftForLevel(node);
2091
2093
  if (this.checkable) {
2092
2094
  padding += this.nodeCheckBoxPaddingLeft;
2093
2095
  }
2094
2096
  return padding;
2095
2097
  }
2096
2098
 
2099
+ _computeNodeControlPaddingLeft(node) {
2100
+ return this.nodeControlPaddingLeft + this._computeNodePaddingLeftForLevel(node);
2101
+ }
2102
+
2103
+ _computeNodePaddingLeftForLevel(node) {
2104
+ if (this.checkable || !this.nodePaddingLevelDiffParentHasIcon) {
2105
+ return node.level * this.nodePaddingLevel;
2106
+ }
2107
+ let padding = 0;
2108
+ let parentNode = node.parentNode;
2109
+ while (parentNode) {
2110
+ padding += this.nodePaddingLevel;
2111
+ // Increase the padding if the parent node has an icon to make the hierarchy more clear
2112
+ // This is not necessary if the child nodes have icons as well, the padding even looks too big, as it is the case for checkable trees.
2113
+ // We only check the first child node for an icon because that one has the biggest impact on the hierarchy visualization. It also increases performance a little.
2114
+ if (parentNode.iconId && !parentNode.childNodes[0].iconId) {
2115
+ padding += this.nodePaddingLevelDiffParentHasIcon;
2116
+ }
2117
+ parentNode = parentNode.parentNode;
2118
+ }
2119
+ return padding;
2120
+ }
2121
+
2097
2122
  /**
2098
2123
  * Reads the paddings from CSS and stores them in nodePaddingLeft and nodeControlPaddingLeft
2099
2124
  */
2100
2125
  _computeNodePaddings() {
2101
- if (this.nodePaddingLeft !== null && this.nodeControlPaddingLeft !== null) {
2126
+ if (this.nodePaddingLeft !== null && this.nodeControlPaddingLeft !== null && this.nodePaddingLevelDiffParentHasIcon !== null) {
2102
2127
  return;
2103
2128
  }
2104
2129
  let $dummyNode = this.$data.appendDiv('tree-node');
@@ -2109,6 +2134,9 @@ export default class Tree extends Widget {
2109
2134
  if (this.nodeControlPaddingLeft === null) {
2110
2135
  this.nodeControlPaddingLeft = $dummyNodeControl.cssPaddingLeft();
2111
2136
  }
2137
+ if (this.nodePaddingLevelDiffParentHasIcon === null) {
2138
+ this.nodePaddingLevelDiffParentHasIcon = this.$container.cssPxValue('--node-padding-level-diff-parent-has-icon');
2139
+ }
2112
2140
  $dummyNode.remove();
2113
2141
  }
2114
2142
 
@@ -3169,6 +3197,19 @@ export default class Tree extends Widget {
3169
3197
  this.applyFiltersForNode(node);
3170
3198
  if (this.rendered) {
3171
3199
  node._decorate();
3200
+ // The padding size of a node depends on whether the node or the parent node has an icon, see _computeNodePaddingLeftForLevel
3201
+ // Unfortunately, we cannot easily detect whether the icon has changed or not.
3202
+ // However, the padding calculation only needs to be done if the node that toggles the icon is visible and expanded or has an expanded parent.
3203
+ let paddingDirty = !!this.nodePaddingLevelDiffParentHasIcon && !!this.visibleNodesMap[node.id] && (node.expanded || !!node.parentNode);
3204
+ if (paddingDirty && !this._changeNodeTaskScheduled) {
3205
+ // Because the change node event is not batch capable, performance would slow down if many change node events are processed
3206
+ // To mitigate this, the updating is done later
3207
+ queueMicrotask(() => {
3208
+ this._updateNodePaddingsLeft();
3209
+ this._changeNodeTaskScheduled = false;
3210
+ });
3211
+ this._changeNodeTaskScheduled = true;
3212
+ }
3172
3213
  }
3173
3214
  this.trigger('nodeChanged', {
3174
3215
  node: node
@@ -10,6 +10,8 @@
10
10
  */
11
11
  .tree {
12
12
  position: relative;
13
+ // The value of the css variable is read by Tree.js and added to the level padding if the parent node has an icon
14
+ --node-padding-level-diff-parent-has-icon: @tree-node-padding-level-diff-parent-has-icon;
13
15
 
14
16
  &:focus,
15
17
  &.focused {
@@ -122,7 +124,7 @@
122
124
 
123
125
  & > .icon {
124
126
  vertical-align: top;
125
- padding-right: 9px;
127
+ padding-right: @tree-node-icon-padding-right;
126
128
  display: inline-block;
127
129
  text-align: center;
128
130
  min-width: @tree-node-icon-width;
@@ -253,12 +253,13 @@ export default class TreeNode {
253
253
 
254
254
  _renderControl() {
255
255
  let $control = this.$node.prependDiv('tree-node-control');
256
- this._updateControl($control, this.getTree());
256
+ this._updateControl($control);
257
257
  }
258
258
 
259
- _updateControl($control, tree) {
259
+ _updateControl($control) {
260
+ let tree = this.getTree();
260
261
  $control.toggleClass('checkable', tree.checkable);
261
- $control.cssPaddingLeft(tree.nodeControlPaddingLeft + this.level * tree.nodePaddingLevel);
262
+ $control.cssPaddingLeft(tree._computeNodeControlPaddingLeft(this));
262
263
  $control.setVisible(!this.leaf);
263
264
  }
264
265