@eclipse-scout/core 22.0.11 → 22.0.19

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 (36) hide show
  1. package/dist/eclipse-scout-core-d110a434bcc809661ce5.min.js +2 -0
  2. package/dist/eclipse-scout-core-d110a434bcc809661ce5.min.js.map +1 -0
  3. package/dist/eclipse-scout-core-theme-dark-fd0e080c10f65e67b68b.min.css +1 -0
  4. package/dist/eclipse-scout-core-theme-dark.css +20 -5
  5. package/dist/eclipse-scout-core-theme-dark.css.map +1 -1
  6. package/dist/eclipse-scout-core-theme-f3a61fbc12acf8e27fcc.min.css +1 -0
  7. package/dist/eclipse-scout-core-theme.css +20 -5
  8. package/dist/eclipse-scout-core-theme.css.map +1 -1
  9. package/dist/eclipse-scout-core.js +184 -105
  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 +1 -0
  14. package/src/desktop/DesktopDense.less +24 -6
  15. package/src/desktop/OpenUriHandler.js +5 -5
  16. package/src/form/fields/FormField.js +1 -1
  17. package/src/form/fields/datefield/DateField.js +2 -0
  18. package/src/form/fields/sequencebox/SequenceBox.js +20 -3
  19. package/src/form/fields/stringfield/StringField.js +9 -1
  20. package/src/session/Session.js +21 -18
  21. package/src/table/Table.js +2 -3
  22. package/src/table/columns/ColumnOptimalWidthMeasurer.js +1 -1
  23. package/src/testing/JasmineScoutUtil.js +127 -0
  24. package/src/testing/index.js +7 -3
  25. package/src/tile/TileGrid.js +5 -15
  26. package/src/tile/TileGridLayout.js +21 -11
  27. package/src/tile/accordion/TileAccordion.js +4 -23
  28. package/src/tile/accordion/TileAccordionLayout.js +39 -2
  29. package/src/tree/Tree.js +4 -0
  30. package/src/util/arrays.js +4 -0
  31. package/src/util/objects.js +4 -1
  32. package/src/widget/FilterSupport.js +19 -8
  33. package/dist/eclipse-scout-core-e5e8740e3649f5b9f279.min.js +0 -2
  34. package/dist/eclipse-scout-core-e5e8740e3649f5b9f279.min.js.map +0 -1
  35. package/dist/eclipse-scout-core-theme-74b63e0d57bed407a729.min.css +0 -1
  36. package/dist/eclipse-scout-core-theme-dark-b82aea152f416e38ce7f.min.css +0 -1
@@ -1,9 +1,9 @@
1
1
  /*
2
- * Copyright (c) 2010-2021 BSI Business Systems Integration AG.
2
+ * Copyright (c) 2010-2022 BSI Business Systems Integration AG.
3
3
  * All rights reserved. This program and the accompanying materials
4
4
  * are made available under the terms of the Eclipse Public License v1.0
5
5
  * which accompanies this distribution, and is available at
6
- * http://www.eclipse.org/legal/epl-v10.html
6
+ * https://www.eclipse.org/legal/epl-v10.html
7
7
  *
8
8
  * Contributors:
9
9
  * BSI Business Systems Integration AG - initial API and implementation
@@ -19,8 +19,45 @@ export default class TileAccordionLayout extends AccordionLayout {
19
19
  }
20
20
 
21
21
  layout($container) {
22
+ let previousGroupHeights = this.tileAccordion.groups
23
+ .map(group => group.body)
24
+ .map(tileGrid => this._getTileGridHeight(tileGrid));
25
+
22
26
  super.layout($container);
23
27
  this._updateFilterFieldMaxWidth($container);
28
+
29
+ this.tileAccordion.groups
30
+ .map(group => group.body)
31
+ .forEach((tileGrid, index) => this._updateTileGridViewPort(tileGrid, previousGroupHeights[index]));
32
+ }
33
+
34
+ _updateTileGridViewPort(tileGrid, previousHeight) {
35
+ if (!tileGrid.rendered || !tileGrid.htmlComp || previousHeight <= 0) {
36
+ return;
37
+ }
38
+
39
+ let newHeight = this._getTileGridHeight(tileGrid);
40
+ if (previousHeight === newHeight && tileGrid.virtual) {
41
+ // The viewPort of the virtual tileGrid has not been updated as no layout update was done for the grid because its height is unchanged.
42
+ // But as there might be more space available in the accordion now (its height might have changed), enforce a viewPort update to ensure all necessary tiles are rendered.
43
+ tileGrid.setViewRangeSize(tileGrid.calculateViewRangeSize(), false);
44
+ tileGrid.htmlComp.layout.updateViewPort();
45
+ }
46
+ }
47
+
48
+ _getTileGridHeight(tileGrid) {
49
+ if (!tileGrid) {
50
+ return 0;
51
+ }
52
+ let htmlComp = tileGrid.htmlComp;
53
+ if (!htmlComp) {
54
+ return 0;
55
+ }
56
+ let size = tileGrid.htmlComp.sizeCached;
57
+ if (!size) {
58
+ return 0;
59
+ }
60
+ return size.height;
24
61
  }
25
62
 
26
63
  _updateFilterFieldMaxWidth($container) {
package/src/tree/Tree.js CHANGED
@@ -2926,6 +2926,10 @@ export default class Tree extends Widget {
2926
2926
  } else if (newWidth > this.maxNodeWidth) {
2927
2927
  this.maxNodeWidth = newWidth;
2928
2928
  this.nodeWidthDirty = true;
2929
+ } else if (newWidth === oldWidth && newWidth === 0) {
2930
+ // newWidth and oldWidth are 0: this might be because the tree is invisible while a node is added:
2931
+ // Mark as dirty to update the width later during layouting (when the tree gets visible and the width is available)
2932
+ this.nodeWidthDirty = true;
2929
2933
  }
2930
2934
  node.width = newWidth;
2931
2935
  }, this);
@@ -12,6 +12,10 @@ import {objects, strings} from '../index';
12
12
 
13
13
  /**
14
14
  * Ensures the given parameter is an array
15
+ *
16
+ * @template T
17
+ * @param {T[]|T|null} array
18
+ * @return T[]
15
19
  */
16
20
  export function ensure(array) {
17
21
  if (array === undefined || array === null) {
@@ -127,6 +127,9 @@ export function someProperties(obj, properties) {
127
127
  });
128
128
  }
129
129
 
130
+ /**
131
+ * @return {*}
132
+ */
130
133
  export function valueCopy(obj) {
131
134
  // Nothing to be done for immutable things
132
135
  if (obj === undefined || obj === null || typeof obj !== 'object') {
@@ -220,7 +223,7 @@ export function findChildObjectByKey(parentObj, property, propertyValue) {
220
223
  * @return Object Returns the selected object.
221
224
  * @throws Throws an error, if the provided parameters are malformed, or a property could not be found/a id property filter does not find any elements.
222
225
  */
223
- function getByPath(object, path) {
226
+ export function getByPath(object, path) {
224
227
  scout.assertParameter('object', object, Object);
225
228
  scout.assertParameter('path', path);
226
229
 
@@ -3,7 +3,7 @@
3
3
  * All rights reserved. This program and the accompanying materials
4
4
  * are made available under the terms of the Eclipse Public License v1.0
5
5
  * which accompanies this distribution, and is available at
6
- * http://www.eclipse.org/legal/epl-v10.html
6
+ * https://www.eclipse.org/legal/epl-v10.html
7
7
  *
8
8
  * Contributors:
9
9
  * BSI Business Systems Integration AG - initial API and implementation
@@ -125,13 +125,11 @@ export default class FilterSupport extends WidgetSupport {
125
125
 
126
126
  this._filterField.$field.attr('tabIndex', -1);
127
127
 
128
- let color = styles.getFirstOpaqueBackgroundColor(this._filterField.$container),
129
- colorRgba = $.extend(true, {red: 0, green: 0, blue: 0, alpha: 1}, styles.rgb(color)),
130
- transparent50Color = 'rgba(' + colorRgba.red + ', ' + colorRgba.green + ', ' + colorRgba.blue + ', ' + 0.5 + ')',
131
- transparent80Color = 'rgba(' + colorRgba.red + ', ' + colorRgba.green + ', ' + colorRgba.blue + ', ' + 0.8 + ')';
132
- this._filterField.$container.css('--filter-field-background-color', color);
133
- this._filterField.$container.css('--filter-field-transparent-50-background-color', transparent50Color);
134
- this._filterField.$container.css('--filter-field-transparent-80-background-color', transparent80Color);
128
+ if (!this.widget.rendered) {
129
+ this.widget.session.layoutValidator.schedulePostValidateFunction(this._updateFilterFieldBackgroundColor.bind(this));
130
+ } else {
131
+ this._updateFilterFieldBackgroundColor();
132
+ }
135
133
 
136
134
  this._textFilter = this._createTextFilter();
137
135
  this._textFilter.synthetic = true;
@@ -164,6 +162,19 @@ export default class FilterSupport extends WidgetSupport {
164
162
  this._filterField.keyStrokeContext.registerKeyStroke(this._exitFilterFieldKeyStroke);
165
163
  }
166
164
 
165
+ _updateFilterFieldBackgroundColor() {
166
+ if (!this._filterField || !this._filterField.rendered) {
167
+ return;
168
+ }
169
+ let color = styles.getFirstOpaqueBackgroundColor(this._filterField.$container),
170
+ colorRgba = $.extend(true, {red: 0, green: 0, blue: 0, alpha: 1}, styles.rgb(color)),
171
+ transparent50Color = 'rgba(' + colorRgba.red + ', ' + colorRgba.green + ', ' + colorRgba.blue + ', ' + 0.5 + ')',
172
+ transparent80Color = 'rgba(' + colorRgba.red + ', ' + colorRgba.green + ', ' + colorRgba.blue + ', ' + 0.8 + ')';
173
+ this._filterField.$container.css('--filter-field-background-color', color);
174
+ this._filterField.$container.css('--filter-field-transparent-50-background-color', transparent50Color);
175
+ this._filterField.$container.css('--filter-field-transparent-80-background-color', transparent80Color);
176
+ }
177
+
167
178
  _onFilterFieldDisplayTextChanged(event) {
168
179
  if (this._filterField && this._filterField.rendered) {
169
180
  this._filterField.$container.toggleClass('empty', !event.newValue);