@eclipse-scout/core 22.0.0-beta.1 → 22.0.0

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 (60) hide show
  1. package/dist/eclipse-scout-core-theme-dark.css +135 -46
  2. package/dist/eclipse-scout-core-theme-dark.css.map +1 -1
  3. package/dist/eclipse-scout-core-theme.css +134 -45
  4. package/dist/eclipse-scout-core-theme.css.map +1 -1
  5. package/dist/eclipse-scout-core.js +744 -640
  6. package/dist/eclipse-scout-core.js.map +1 -1
  7. package/package.json +2 -2
  8. package/src/App.js +86 -17
  9. package/src/RemoteApp.js +1 -0
  10. package/src/desktop/Desktop.js +3 -3
  11. package/src/desktop/desktoptab/DesktopTab.less +14 -0
  12. package/src/desktop/notification/DesktopNotification.js +33 -8
  13. package/src/desktop/outline/Outline.js +2 -32
  14. package/src/desktop/outline/Outline.less +14 -6
  15. package/src/desktop/outline/OutlineViewButton.js +1 -0
  16. package/src/desktop/viewbutton/ViewButtonBox.js +2 -2
  17. package/src/filechooser/FileChooser.js +2 -1
  18. package/src/form/Form.js +11 -3
  19. package/src/form/fields/groupbox/GroupBox.less +3 -1
  20. package/src/glasspane/DeferredGlassPaneTarget.js +2 -2
  21. package/src/index.js +2 -1
  22. package/src/login/LoginBox.less +8 -1
  23. package/src/main.less +1 -1
  24. package/src/menu/ComboMenu.js +22 -17
  25. package/src/menu/ComboMenu.less +71 -26
  26. package/src/menu/ContextMenuPopup.js +3 -2
  27. package/src/menu/ContextMenuPopup.less +1 -1
  28. package/src/menu/EllipsisMenu.js +4 -0
  29. package/src/menu/Menu.js +24 -11
  30. package/src/menu/menubar/MenuBar.js +2 -19
  31. package/src/menu/menubar/MenuBarBox.js +3 -34
  32. package/src/menu/menubar/MenuBarLayout.js +6 -19
  33. package/src/menu/menubox/MenuBoxLayout.js +1 -1
  34. package/src/menu/menus.js +4 -10
  35. package/src/messagebox/MessageBox.js +3 -22
  36. package/src/modeselector/ModeSelectorLayout.js +11 -6
  37. package/src/notification/Notification.js +15 -14
  38. package/src/popup/Popup.js +3 -20
  39. package/src/session/BusyIndicator.js +2 -1
  40. package/src/session/Session.js +4 -63
  41. package/src/status/Status.js +2 -1
  42. package/src/style/colors-dark.less +3 -1
  43. package/src/style/colors.less +2 -0
  44. package/src/style/sizes.less +5 -3
  45. package/src/table/Table.js +7 -3
  46. package/src/table/Table.less +13 -3
  47. package/src/table/columns/Column.js +4 -0
  48. package/src/tile/fields/htmlfield/TileHtmlField.js +28 -0
  49. package/src/tooltip/Tooltip.less +7 -5
  50. package/src/tree/LazyNodeFilter.js +24 -15
  51. package/src/tree/Tree.js +112 -143
  52. package/src/tree/Tree.less +2 -2
  53. package/src/tree/TreeLayout.js +1 -1
  54. package/src/tree/TreeNode.js +2 -2
  55. package/src/util/Device.js +6 -2
  56. package/src/widget/FilterSupport.js +6 -4
  57. package/src/widget/FilterSupport.less +38 -9
  58. package/src/widget/LoadingSupport.js +1 -1
  59. package/src/widget/Widget.js +41 -36
  60. package/src/widget/WidgetSupport.js +1 -1
@@ -18,25 +18,32 @@
18
18
  background-color: transparent;
19
19
  }
20
20
 
21
- & > .menu-item:not(:first-child) {
22
- margin-left: 3px;
23
-
24
- &::before {
25
- content: '';
26
- position: absolute;
27
- left: -1px;
28
- top: 7px;
29
- height: calc(100% - 14px);
30
- width: 1px;
31
- background-color: @border-color;
21
+ & > .menu-item {
22
+ &:not(.first) {
23
+ margin-left: 3px;
24
+
25
+ &::before {
26
+ content: '';
27
+ position: absolute;
28
+ left: -1px;
29
+ top: 7px;
30
+ height: calc(100% - 14px);
31
+ width: 1px;
32
+ background-color: @border-color;
33
+ }
32
34
  }
33
- }
34
35
 
35
- &:not(.disabled).child-selected,
36
- &:not(.disabled):hover {
37
- & > .menu-item:not(:first-child)::before {
36
+ &:focus::before {
38
37
  display: none;
39
38
  }
39
+
40
+ &:not(.disabled):hover,
41
+ &.selected {
42
+ &::before,
43
+ & ~ .menu-item::before {
44
+ display: none;
45
+ }
46
+ }
40
47
  }
41
48
  }
42
49
 
@@ -45,14 +52,19 @@
45
52
 
46
53
  & > .menu-item {
47
54
  border: 1px solid @button-border-color;
55
+ flex-grow: 1;
48
56
 
49
- &:not(:last-child) {
57
+ &.menu-icononly:not(.first.last) { // Rule must not be applied if combo menu contains only one item
58
+ flex-grow: 0;
59
+ }
60
+
61
+ &:not(.last) {
50
62
  border-top-right-radius: 0;
51
63
  border-bottom-right-radius: 0;
52
64
  border-right: 0;
53
65
  }
54
66
 
55
- &:not(:first-child) {
67
+ &:not(.first) {
56
68
  border-top-left-radius: 0;
57
69
  border-bottom-left-radius: 0;
58
70
  border-left: 0;
@@ -62,31 +74,64 @@
62
74
  .disabled& {
63
75
  border-color: @button-disabled-color;
64
76
  }
77
+
78
+ &:focus {
79
+ z-index: 1; // Allows box-shadow to draw over the right menu-item
80
+ }
65
81
  }
66
82
 
67
83
  &.default {
68
84
  & > .menu-item {
69
85
  .button.default();
70
86
 
87
+ &::before {
88
+ background-color: @default-combo-menu-separator-color;
89
+ }
90
+
71
91
  &.selected {
72
92
  background-color: @default-button-selected-background-color;
73
93
  border-color: @default-button-selected-background-color;
74
94
  }
95
+
96
+ &.disabled {
97
+ color: @disabled-inverted-color;
98
+
99
+ &:hover, &.active, &:active, &.selected {
100
+ background-color: @default-button-background-color;
101
+ border-color: @default-button-background-color;
102
+ }
103
+ }
75
104
  }
76
105
  }
77
106
  }
78
107
 
79
- .context-menu {
80
- & > .combo-menu {
81
- padding: 0;
108
+ .context-menu > .combo-menu {
109
+ padding: 0;
82
110
 
83
- & > .menu-item {
84
- color: @context-menu-item-color;
85
- padding-top: @context-menu-item-padding-y;
86
- padding-bottom: @context-menu-item-padding-y;
111
+ & > .menu-item {
112
+ color: @context-menu-item-color;
113
+ padding: @context-menu-item-padding-y @context-menu-item-padding-right @context-menu-item-padding-y @context-menu-item-padding-left;
114
+ flex-grow: 1;
115
+ justify-content: start;
116
+ border-radius: 0;
117
+
118
+ & > .font-icon {
119
+ color: @context-menu-item-icon-color;
120
+ }
121
+
122
+ &.menu-textandicon > .icon {
123
+ margin-right: @context-menu-item-icon-margin-right;
124
+ }
125
+
126
+ &.menu-icononly:not(.first.last) { // Rule must not be applied if combo menu contains only one item
127
+ flex-grow: 0;
128
+ }
129
+
130
+ &.disabled {
131
+ color: @menu-item-disabled-color;
87
132
 
88
- &:first-child {
89
- margin-left: @context-menu-item-padding-left - @menu-item-padding-x;
133
+ & > .font-icon {
134
+ color: @menu-item-disabled-color;
90
135
  }
91
136
  }
92
137
  }
@@ -367,8 +367,9 @@ export default class ContextMenuPopup extends Popup {
367
367
 
368
368
  // prevent loosing original parent
369
369
  let originalParent = menu.parent;
370
- if (this.cloneMenuItems && !menu.cloneOf) {
371
- // clone will recursively also clone all child actions.
370
+ // Clone menu items but only clone once unless it is for a different context menu (e.g. a context menu of a combo menu inside a context menu)
371
+ // Clone will recursively also clone all child actions.
372
+ if (this.cloneMenuItems && !menu.cloneOf || !this.has(menu)) {
372
373
  menu = menu.clone({
373
374
  parent: this,
374
375
  textPosition: Action.TextPosition.DEFAULT
@@ -47,7 +47,7 @@
47
47
  }
48
48
 
49
49
  &.menu-textandicon > .icon {
50
- margin-right: 14px;
50
+ margin-right: @context-menu-item-icon-margin-right;
51
51
  }
52
52
 
53
53
  &.selected {
@@ -57,4 +57,8 @@ export default class EllipsisMenu extends Menu {
57
57
  isTabTarget() {
58
58
  return super.isTabTarget() && !this.hidden;
59
59
  }
60
+
61
+ _childrenForEnabledComputed() {
62
+ return this.childActions;
63
+ }
60
64
  }
package/src/menu/Menu.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2014-2018 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
@@ -343,7 +343,8 @@ export default class Menu extends Action {
343
343
  }
344
344
 
345
345
  isTabTarget() {
346
- return this.enabledComputed && this.visible && !this.overflown && (this.isButton() || !this.separator);
346
+ return this.enabledComputed && this.visible && !this.overflown && (this.isButton() || !this.separator)
347
+ && (!this.parentMenu || this.parentMenu.visible && !this.parentMenu.overflown); // Necessary for ComboMenu -> must return false if ComboMenu (parentMenu) is not shown
347
348
  }
348
349
 
349
350
  /**
@@ -591,9 +592,9 @@ export default class Menu extends Action {
591
592
  * @override Widget.js
592
593
  */
593
594
  _setInheritAccessibility(inheritAccessibility) {
594
- this._setProperty('inheritAccessibility', inheritAccessibility);
595
- if (this.initialized) {
596
- this._findRootMenu().recomputeEnabled();
595
+ let changed = this._setProperty('inheritAccessibility', inheritAccessibility);
596
+ if (changed) {
597
+ this._recomputeEnabledInMenuHierarchy();
597
598
  }
598
599
  }
599
600
 
@@ -601,16 +602,28 @@ export default class Menu extends Action {
601
602
  * @override Widget.js
602
603
  */
603
604
  _setEnabled(enabled) {
604
- this._setProperty('enabled', enabled);
605
- if (this.initialized) {
606
- this._findRootMenu().recomputeEnabled();
605
+ let changed = this._setProperty('enabled', enabled);
606
+ if (changed) {
607
+ this._recomputeEnabledInMenuHierarchy();
607
608
  }
608
609
  }
609
610
 
610
611
  _setVisible(visible) {
611
- this._setProperty('visible', visible);
612
- if (this.initialized) {
613
- this._findRootMenu().recomputeEnabled();
612
+ let changed = this._setProperty('visible', visible);
613
+ if (changed) {
614
+ this._recomputeEnabledInMenuHierarchy();
615
+ }
616
+ }
617
+
618
+ _recomputeEnabledInMenuHierarchy() {
619
+ if (!this.initialized) {
620
+ return;
621
+ }
622
+ let rootMenu = this._findRootMenu();
623
+ rootMenu.recomputeEnabled();
624
+ if (rootMenu !== this) {
625
+ // necessary in case this menu or a parent menu has inheritAccessibility=false. Because then this menu and its children are skipped in the line above!
626
+ this.recomputeEnabled();
614
627
  }
615
628
  }
616
629
 
@@ -8,22 +8,7 @@
8
8
  * Contributors:
9
9
  * BSI Business Systems Integration AG - initial API and implementation
10
10
  */
11
- import {
12
- arrays,
13
- GroupBoxMenuItemsOrder,
14
- HtmlComponent,
15
- keys,
16
- KeyStrokeContext,
17
- Menu,
18
- MenuBarLayout,
19
- MenuBarLeftKeyStroke,
20
- MenuBarRightKeyStroke,
21
- MenuDestinations,
22
- menus,
23
- scout,
24
- Widget,
25
- widgets
26
- } from '../../index';
11
+ import {arrays, GroupBoxMenuItemsOrder, HtmlComponent, keys, KeyStrokeContext, Menu, MenuBarLayout, MenuBarLeftKeyStroke, MenuBarRightKeyStroke, MenuDestinations, menus, scout, Widget, widgets} from '../../index';
27
12
  import ComboMenu from '../ComboMenu';
28
13
 
29
14
  export default class MenuBar extends Widget {
@@ -302,9 +287,7 @@ export default class MenuBar extends Widget {
302
287
  if (this.defaultMenu && this.defaultMenu.isTabTarget()) {
303
288
  this.setTabbableMenu(this.defaultMenu);
304
289
  } else {
305
- this.setTabbableMenu(arrays.find(this.orderedMenuItems.all, item => {
306
- return item.isTabTarget();
307
- }));
290
+ this.setTabbableMenu(arrays.find(this.orderedMenuItems.all, item => item.isTabTarget()));
308
291
  }
309
292
  }
310
293
  }
@@ -17,12 +17,6 @@ export default class MenuBarBox extends Widget {
17
17
  this.menuItems = [];
18
18
  this.tooltipPosition = MenuBar.Position.TOP;
19
19
  this._addWidgetProperties('menuItems');
20
- this._menuItemPropertyChangeHandler = this._onMenuItemPropertyChange.bind(this);
21
- }
22
-
23
- _destroy() {
24
- super._destroy();
25
- this._removeMenuHandlers();
26
20
  }
27
21
 
28
22
  _render() {
@@ -53,21 +47,12 @@ export default class MenuBarBox extends Widget {
53
47
  }
54
48
 
55
49
  _setMenuItems(menuItems) {
56
- // remove property listeners of old menu items.
57
- this._removeMenuHandlers();
58
-
59
50
  this._setProperty('menuItems', menuItems);
60
- // add property listener of new menus
61
- this._addMenuHandlers();
62
51
  this._updateTooltipPosition();
63
52
  }
64
53
 
65
54
  _removeMenuItems() {
66
- this._removeMenuHandlers();
67
- this.menuItems.forEach(item => {
68
- item.overflow = false;
69
- item.remove();
70
- });
55
+ this.menuItems.forEach(item => item.remove());
71
56
  }
72
57
 
73
58
  _renderMenuItems() {
@@ -81,18 +66,6 @@ export default class MenuBarBox extends Widget {
81
66
  }
82
67
  }
83
68
 
84
- _addMenuHandlers() {
85
- this.menuItems.forEach(function(item) {
86
- item.off('propertyChange', this._menuItemPropertyChangeHandler);
87
- }, this);
88
- }
89
-
90
- _removeMenuHandlers() {
91
- this.menuItems.forEach(function(item) {
92
- item.off('propertyChange', this._menuItemPropertyChangeHandler);
93
- }, this);
94
- }
95
-
96
69
  _renderVisible() {
97
70
  super._renderVisible();
98
71
  this.revalidateLayout();
@@ -100,9 +73,7 @@ export default class MenuBarBox extends Widget {
100
73
 
101
74
  _onMenuItemPropertyChange(event) {
102
75
  if (event.propertyName === 'visible') {
103
- this.setVisible(this.menuItems.some(m => {
104
- return m.visible && !m.ellipsis;
105
- }));
76
+ this.setVisible(this.menuItems.some(m => m.visible && !m.ellipsis));
106
77
  }
107
78
  }
108
79
 
@@ -116,8 +87,6 @@ export default class MenuBarBox extends Widget {
116
87
  }
117
88
 
118
89
  _updateTooltipPosition() {
119
- this.menuItems.forEach(function(item) {
120
- item.setTooltipPosition(this.tooltipPosition);
121
- }, this);
90
+ this.menuItems.forEach(item => item.setTooltipPosition(this.tooltipPosition));
122
91
  }
123
92
  }
@@ -25,10 +25,7 @@ export default class MenuBarLayout extends AbstractLayout {
25
25
  let menuItems = this._menuBar.orderedMenuItems.left.concat(this._menuBar.orderedMenuItems.right);
26
26
  let visibleMenuItems = this.visibleMenuItems();
27
27
  let htmlContainer = HtmlComponent.get($container);
28
-
29
- let ellipsis = arrays.find(menuItems, menuItem => {
30
- return menuItem.ellipsis;
31
- });
28
+ let ellipsis = arrays.find(menuItems, menuItem => menuItem.ellipsis);
32
29
 
33
30
  this._setFirstLastMenuMarker(visibleMenuItems); // is required to determine available size correctly
34
31
  this.preferredLayoutSize($container, {
@@ -40,31 +37,21 @@ export default class MenuBarLayout extends AbstractLayout {
40
37
  if (ellipsis && this._overflowMenuItems.length > 0) {
41
38
  ellipsis.setHidden(false);
42
39
  }
43
- visibleMenuItems.forEach(menuItem => {
44
- menuItem._setOverflown(false);
45
- }, this);
46
-
47
- this._overflowMenuItems.forEach(menuItem => {
48
- menuItem._setOverflown(true);
49
- });
40
+ visibleMenuItems.forEach(menuItem => menuItem._setOverflown(false));
41
+ this._overflowMenuItems.forEach(menuItem => menuItem._setOverflown(true));
50
42
  if (ellipsis && this._overflowMenuItems.length === 0) {
51
43
  ellipsis.setHidden(true);
52
44
  }
53
45
  // remove all separators
54
- this._overflowMenuItems = this._overflowMenuItems.filter(menuItem => {
55
- return !menuItem.separator;
56
- });
46
+ this._overflowMenuItems = this._overflowMenuItems.filter(menuItem => !menuItem.separator);
57
47
 
58
- // set childActions to empty array to prevent the menuItems from calling remove.
59
48
  if (ellipsis) {
60
49
  ellipsis._closePopup();
61
50
  ellipsis.setChildActions(this._overflowMenuItems);
62
51
  }
63
52
 
64
53
  // trigger menu items layout
65
- visibleMenuItems.forEach(menuItem => {
66
- menuItem.validateLayout();
67
- });
54
+ visibleMenuItems.forEach(menuItem => menuItem.validateLayout());
68
55
 
69
56
  visibleMenuItems.forEach(menuItem => {
70
57
  // Make sure open popups are at the correct position after layouting
@@ -123,7 +110,7 @@ export default class MenuBarLayout extends AbstractLayout {
123
110
  /**
124
111
  * Moves menu items into _overflowMenuItems until prefSize.width is smaller than prefWidth.
125
112
  * The moved menu items will be removed from the given visibleMenuItems parameter.
126
- * @returns {number} the calculated preferred size
113
+ * @returns {Dimension} the calculated preferred size
127
114
  */
128
115
  _prefSizeWithOverflow(visibleMenuItems, prefWidth) {
129
116
  let overflowableIndexes = [];
@@ -204,7 +204,7 @@ export default class MenuBoxLayout extends AbstractLayout {
204
204
  _createAndRenderEllipsis($container) {
205
205
  let ellipsis = menuUtil.createEllipsisMenu({
206
206
  parent: this.menuBox,
207
- horizontalAlignment: 1,
207
+ hidden: false,
208
208
  compact: this.menuBox.compact
209
209
  });
210
210
  ellipsis.uiCssClass = this.menuBox.uiMenuCssClass;
package/src/menu/menus.js CHANGED
@@ -8,8 +8,7 @@
8
8
  * Contributors:
9
9
  * BSI Business Systems Integration AG - initial API and implementation
10
10
  */
11
- import {arrays, icons, MenuDestinations, scout} from '../index';
12
- import $ from 'jquery';
11
+ import {arrays, MenuDestinations, scout} from '../index';
13
12
 
14
13
  export function filterAccordingToSelection(prefix, selectionLength, menus, destination, onlyVisible, enableDisableKeyStroke, notAllowedTypes) {
15
14
  let allowedTypes = [];
@@ -163,17 +162,12 @@ export function _checkType(menu, types) {
163
162
  }
164
163
 
165
164
  export function createEllipsisMenu(options) {
166
- let defaults = {
167
- iconId: icons.ELLIPSIS_V,
168
- tabbable: false
169
- };
170
- options = $.extend({}, defaults, options);
171
- return scout.create('Menu', options);
165
+ return scout.create('EllipsisMenu', options);
172
166
  }
173
167
 
174
168
  export function moveMenuIntoEllipsis(menu, ellipsis) {
175
169
  menu.remove();
176
- menu.overflow = true;
170
+ menu._setOverflown(true);
177
171
  menu.overflowMenu = ellipsis;
178
172
 
179
173
  let menusInEllipsis = ellipsis.childActions.slice();
@@ -182,7 +176,7 @@ export function moveMenuIntoEllipsis(menu, ellipsis) {
182
176
  }
183
177
 
184
178
  export function removeMenuFromEllipsis(menu, $parent) {
185
- menu.overflow = false;
179
+ menu._setOverflown(false);
186
180
  menu.overflowMenu = null;
187
181
  if (!menu.rendered) {
188
182
  menu.render($parent);
@@ -1,5 +1,5 @@
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
@@ -8,26 +8,7 @@
8
8
  * Contributors:
9
9
  * BSI Business Systems Integration AG - initial API and implementation
10
10
  */
11
- import {
12
- AbortKeyStroke,
13
- BoxButtons,
14
- ClickActiveElementKeyStroke,
15
- clipboard,
16
- CopyKeyStroke,
17
- FocusAdjacentElementKeyStroke,
18
- FocusRule,
19
- Form,
20
- GlassPaneRenderer,
21
- HtmlComponent,
22
- keys,
23
- KeyStrokeContext,
24
- MessageBoxLayout,
25
- objects,
26
- scout,
27
- Status,
28
- strings,
29
- Widget
30
- } from '../index';
11
+ import {AbortKeyStroke, BoxButtons, ClickActiveElementKeyStroke, clipboard, CopyKeyStroke, FocusAdjacentElementKeyStroke, FocusRule, Form, GlassPaneRenderer, HtmlComponent, keys, KeyStrokeContext, MessageBoxLayout, objects, scout, Status, strings, Widget} from '../index';
31
12
 
32
13
  export default class MessageBox extends Widget {
33
14
 
@@ -51,7 +32,7 @@ export default class MessageBox extends Widget {
51
32
  this.noButton = null;
52
33
  this.cancelButton = null;
53
34
  this.abortButton = null; // button to be executed when abort() is called, e.g. when ESCAPE is pressed. points to the last (most right) button in the list (one of yes, no or cancel)
54
-
35
+ this.inheritAccessibility = false; // do not inherit enabled-state by default. Otherwise the MessageBox cannot be closed anymore
55
36
  this.$content = null;
56
37
  this.$header = null;
57
38
  this.$body = null;
@@ -38,12 +38,17 @@ export default class ModeSelectorLayout extends AbstractLayout {
38
38
  });
39
39
 
40
40
  let maxWidth = 0;
41
- this.modeSelector.modes.forEach(mode => {
42
- let modeWidth = mode.htmlComp.prefSize().width;
43
- if (modeWidth > maxWidth) {
44
- maxWidth = modeWidth;
45
- }
46
- });
41
+ this.modeSelector.modes
42
+ .filter(mode => mode.rendered)
43
+ .forEach(mode => {
44
+ let oldModeStyle = mode.$container.attr('style');
45
+ mode.$container.css('flex', 'none');
46
+ let modeWidth = mode.htmlComp.prefSize().width;
47
+ if (modeWidth > maxWidth) {
48
+ maxWidth = modeWidth;
49
+ }
50
+ mode.$container.attrOrRemove('style', oldModeStyle);
51
+ });
47
52
 
48
53
  this.modeSelector.$container.attrOrRemove('style', oldStyle);
49
54
 
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2014-2017 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
@@ -18,7 +18,6 @@ export default class Notification extends Widget {
18
18
  this.status = Status.info();
19
19
  this.closable = false;
20
20
  this.htmlEnabled = false;
21
- this.iconId = null;
22
21
  this._icon = null;
23
22
  }
24
23
 
@@ -28,15 +27,15 @@ export default class Notification extends Widget {
28
27
  // this allows to set the properties severity and message directly on the model object
29
28
  // without having a status object. because it's more convenient when you must create
30
29
  // a notification programmatically.
31
- if (model.severity || model.message) {
30
+ if (model.severity || model.message || model.iconId) {
32
31
  this.status = new Status({
33
32
  severity: scout.nvl(model.severity, this.status.severity),
34
- message: scout.nvl(model.message, this.status.message)
33
+ message: scout.nvl(model.message, this.status.message),
34
+ iconId: scout.nvl(model.iconId, this.status.iconId)
35
35
  });
36
36
  }
37
37
  texts.resolveTextProperty(this.status, 'message', this.session);
38
38
  this._setStatus(this.status);
39
- this._setIconId(this.iconId);
40
39
  }
41
40
 
42
41
  _render() {
@@ -55,7 +54,6 @@ export default class Notification extends Widget {
55
54
  _renderProperties() {
56
55
  super._renderProperties();
57
56
  this._renderStatus();
58
- this._renderIconId();
59
57
  this._renderClosable();
60
58
  }
61
59
 
@@ -80,6 +78,7 @@ export default class Notification extends Widget {
80
78
  _renderStatus() {
81
79
  if (this.status) {
82
80
  this.$container.addClass(this.status.cssClass());
81
+ this._renderIconId();
83
82
  }
84
83
  this._renderMessage();
85
84
  }
@@ -98,15 +97,17 @@ export default class Notification extends Widget {
98
97
  }
99
98
 
100
99
  setIconId(iconId) {
101
- this.setProperty('iconId', iconId);
102
- }
103
-
104
- _setIconId(iconId) {
105
- this._setProperty('iconId', iconId);
100
+ if (!this.status) {
101
+ this.status = Status.info();
102
+ }
103
+ this.status.iconId = iconId;
104
+ if (this.rendered) {
105
+ this._renderStatus();
106
+ }
106
107
  }
107
108
 
108
109
  _renderIconId() {
109
- let hasIcon = !!this.iconId;
110
+ let hasIcon = this.status && !!this.status.iconId;
110
111
  this.$container.toggleClass('has-icon', hasIcon);
111
112
  this.$container.toggleClass('no-icon', !hasIcon);
112
113
  if (hasIcon) {
@@ -118,13 +119,13 @@ export default class Notification extends Widget {
118
119
 
119
120
  _renderIcon() {
120
121
  if (this._icon) {
121
- this._icon.setIconDesc(this.iconId);
122
+ this._icon.setIconDesc(this.status.iconId);
122
123
  return;
123
124
  }
124
125
 
125
126
  this._icon = scout.create('Icon', {
126
127
  parent: this,
127
- iconDesc: this.iconId,
128
+ iconDesc: this.status.iconId,
128
129
  prepend: true
129
130
  });
130
131
  this._icon.one('destroy', () => {
@@ -8,25 +8,7 @@
8
8
  * Contributors:
9
9
  * BSI Business Systems Integration AG - initial API and implementation
10
10
  */
11
- import {
12
- CloseKeyStroke,
13
- DialogLayout,
14
- Dimension,
15
- Event,
16
- FocusRule,
17
- GlassPaneRenderer,
18
- graphics,
19
- HtmlComponent,
20
- Insets,
21
- KeyStrokeContext,
22
- Point,
23
- PopupLayout,
24
- Rectangle,
25
- scout,
26
- scrollbars,
27
- strings,
28
- Widget
29
- } from '../index';
11
+ import {CloseKeyStroke, DialogLayout, Dimension, Event, FocusRule, GlassPaneRenderer, graphics, HtmlComponent, Insets, KeyStrokeContext, Point, PopupLayout, Rectangle, scout, scrollbars, strings, Widget} from '../index';
30
12
  import $ from 'jquery';
31
13
 
32
14
  export default class Popup extends Widget {
@@ -547,7 +529,8 @@ export default class Popup extends Widget {
547
529
  // processing the mousedown event, it's too late to detach the event and we must
548
530
  // deal with that situation by checking the rendered flag. Otherwise we would
549
531
  // run into an error later, since the $container is not available anymore.
550
- if (!this.rendered) {
532
+ // Use the internal flag because popup should be closed even if the parent removal is pending due to a remove animation
533
+ if (!this._rendered) {
551
534
  return;
552
535
  }
553
536
  if (this._isMouseDownOutside(event)) {
@@ -1,5 +1,5 @@
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
@@ -20,6 +20,7 @@ export default class BusyIndicator extends Widget {
20
20
  this.details = null;
21
21
  this.cancelButton = null;
22
22
  this.boxButtons = null;
23
+ this.inheritAccessibility = false; // do not inherit enabled-state. BusyIndicator must always be enabled even if parent is disabled
23
24
 
24
25
  this.$content = null;
25
26
  this.$buttons = null;