@eclipse-scout/core 22.0.1 → 22.0.2
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.
- package/dist/eclipse-scout-core-c98fb5230e71dcec75ce.min.js +2 -0
- package/dist/eclipse-scout-core-c98fb5230e71dcec75ce.min.js.map +1 -0
- package/dist/eclipse-scout-core-theme-6b2fef56e9e49231a49c.min.css +1 -0
- package/dist/eclipse-scout-core-theme-dark-d2bb274dd42f132bfca0.min.css +1 -0
- package/dist/eclipse-scout-core-theme-dark.css +367 -312
- package/dist/eclipse-scout-core-theme-dark.css.map +1 -1
- package/dist/eclipse-scout-core-theme.css +150 -95
- package/dist/eclipse-scout-core-theme.css.map +1 -1
- package/dist/eclipse-scout-core.js +371 -204
- package/dist/eclipse-scout-core.js.map +1 -1
- package/dist/file-list +7 -0
- package/dist/locales.json +47126 -0
- package/dist/texts.json +1153 -0
- package/package.json +2 -2
- package/src/action/Button.less +1 -0
- package/src/calendar/Calendar.js +40 -58
- package/src/calendar/Calendar.less +10 -10
- package/src/calendar/CalendarLayout.js +3 -1
- package/src/datepicker/DatePicker.less +1 -0
- package/src/desktop/desktoptab/DesktopTab.less +5 -2
- package/src/desktop/desktoptab/DesktopTabArea.less +7 -3
- package/src/desktop/navigation/DesktopNavigation.less +4 -0
- package/src/desktop/notification/DesktopNotification.js +11 -4
- package/src/desktop/notification/DesktopNotification.less +5 -3
- package/src/desktop/outline/Outline.less +4 -4
- package/src/desktop/viewbutton/ViewButton.less +13 -9
- package/src/desktop/viewbutton/ViewMenuTab.less +3 -2
- package/src/filechooser/FileChooser.less +1 -1
- package/src/form/Form.less +1 -0
- package/src/form/fields/LookupBox.js +2 -1
- package/src/form/fields/breadcrumbbarfield/BreadcrumbBarField.less +14 -0
- package/src/form/fields/groupbox/GroupBox.js +13 -9
- package/src/form/fields/groupbox/GroupBox.less +1 -0
- package/src/form/fields/htmlfield/HtmlField.less +0 -1
- package/src/form/fields/listbox/ListBox.js +8 -3
- package/src/form/fields/tabbox/TabAreaLayout.js +63 -66
- package/src/form/fields/tabbox/TabBox.js +4 -7
- package/src/form/fields/tabbox/TabBox.less +2 -1
- package/src/form/fields/tabbox/TabBoxHeaderLayout.js +5 -5
- package/src/glasspane/GlassPane.js +3 -3
- package/src/group/Group.less +1 -1
- package/src/index.less +1 -0
- package/src/jquery/jquery-scout.js +5 -4
- package/src/menu/ContextMenuPopup.less +9 -2
- package/src/menu/Menu.less +1 -0
- package/src/modeselector/Mode.less +15 -37
- package/src/modeselector/ModeSelector.js +1 -1
- package/src/modeselector/ModeSelector.less +2 -1
- package/src/planner/PlannerHeader.less +2 -1
- package/src/popup/Popup.js +24 -8
- package/src/popup/PopupLayout.js +2 -8
- package/src/scrollbar/Scrollbar.less +8 -1
- package/src/scrollbar/scrollbars.js +26 -4
- package/src/style/colors-dark.less +17 -10
- package/src/style/colors.less +11 -3
- package/src/style/fonts.less +5 -0
- package/src/style/mixins.less +16 -12
- package/src/style/sizes-dark.less +4 -1
- package/src/style/sizes.less +3 -4
- package/src/table/Table.js +37 -29
- package/src/table/Table.less +36 -13
- package/src/table/TableHeader.js +10 -8
- package/src/table/TableHeader.less +1 -0
- package/src/table/TableHeaderMenu.js +3 -1
- package/src/table/TableHeaderMenu.less +7 -2
- package/src/table/columns/BooleanColumn.js +2 -2
- package/src/table/columns/Column.js +3 -3
- package/src/table/editor/CellEditorPopup.js +8 -1
- package/src/tile/TileGrid.js +1 -1
- package/src/tile/TileGridLayout.js +2 -2
- package/src/tile/accordion/TileAccordion.js +16 -1
- package/src/tile/fields/FormFieldTile.less +18 -11
- package/src/tree/CompactTree.less +1 -1
- package/src/tree/Tree.less +1 -3
- package/src/util/arrays.js +24 -2
- package/src/util/objects.js +4 -1
- package/src/widget/Widget.js +11 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c)
|
|
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
|
|
@@ -30,32 +30,37 @@ export default class TabAreaLayout extends AbstractLayout {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
layout($container) {
|
|
33
|
-
let
|
|
34
|
-
htmlContainer = HtmlComponent.get($container),
|
|
33
|
+
let htmlContainer = HtmlComponent.get($container),
|
|
35
34
|
containerSize = htmlContainer.availableSize().subtract(htmlContainer.insets());
|
|
36
35
|
|
|
37
36
|
// compute visible and overflown tabs
|
|
38
37
|
this.preferredLayoutSize($container, {
|
|
39
38
|
widthHint: containerSize.width
|
|
40
39
|
});
|
|
40
|
+
this._layoutSelectionMarker();
|
|
41
|
+
}
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
this.visibleTabs.forEach(tabItem => {
|
|
47
|
-
tabItem.setOverflown(false);
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
this.overflowTabs.forEach(tabItem => {
|
|
51
|
-
tabItem.setOverflown(true);
|
|
52
|
-
});
|
|
43
|
+
_layoutSelectionMarker() {
|
|
44
|
+
let $selectionMarker = this.tabArea.$selectionMarker,
|
|
45
|
+
selectedTab = this.tabArea.selectedTab,
|
|
46
|
+
selectedItemBounds;
|
|
53
47
|
|
|
54
|
-
if (
|
|
55
|
-
|
|
48
|
+
if (selectedTab) {
|
|
49
|
+
$selectionMarker.setVisible(true);
|
|
50
|
+
selectedItemBounds = graphics.bounds(selectedTab.$container);
|
|
51
|
+
$selectionMarker.cssLeft(selectedItemBounds.x);
|
|
52
|
+
$selectionMarker.cssWidth(selectedItemBounds.width);
|
|
53
|
+
} else {
|
|
54
|
+
$selectionMarker.setVisible(false);
|
|
56
55
|
}
|
|
56
|
+
}
|
|
57
57
|
|
|
58
|
+
_updateEllipsis() {
|
|
59
|
+
let ellipsis = this.tabArea.ellipsis;
|
|
60
|
+
ellipsis.setHidden(this.overflowTabs.length < 1);
|
|
58
61
|
ellipsis.setText(this.overflowTabs.length + '');
|
|
62
|
+
this.visibleTabs.forEach(tabItem => tabItem.setOverflown(false));
|
|
63
|
+
this.overflowTabs.forEach(tabItem => tabItem.setOverflown(true));
|
|
59
64
|
|
|
60
65
|
ellipsis.setChildActions(this.overflowTabs.map(tab => {
|
|
61
66
|
let menu = scout.create('Menu', {
|
|
@@ -73,73 +78,54 @@ export default class TabAreaLayout extends AbstractLayout {
|
|
|
73
78
|
});
|
|
74
79
|
return menu;
|
|
75
80
|
}, this));
|
|
76
|
-
|
|
77
|
-
this._layoutSelectionMarker();
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
_layoutSelectionMarker() {
|
|
81
|
-
let $selectionMarker = this.tabArea.$selectionMarker,
|
|
82
|
-
selectedTab = this.tabArea.selectedTab,
|
|
83
|
-
selectedItemBounds;
|
|
84
|
-
|
|
85
|
-
if (selectedTab) {
|
|
86
|
-
$selectionMarker.setVisible(true);
|
|
87
|
-
selectedItemBounds = graphics.bounds(selectedTab.$container);
|
|
88
|
-
$selectionMarker.cssLeft(selectedItemBounds.x);
|
|
89
|
-
$selectionMarker.cssWidth(selectedItemBounds.width);
|
|
90
|
-
} else {
|
|
91
|
-
$selectionMarker.setVisible(false);
|
|
92
|
-
}
|
|
93
81
|
}
|
|
94
82
|
|
|
95
83
|
preferredLayoutSize($container, options) {
|
|
96
84
|
let htmlComp = HtmlComponent.get($container),
|
|
97
85
|
prefSize = new Dimension(0, 0),
|
|
98
|
-
prefWidth = Number.MAX_VALUE
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
86
|
+
prefWidth = Number.MAX_VALUE;
|
|
87
|
+
this.visibleTabs = this.tabArea.visibleTabs();
|
|
88
|
+
let overflowableIndexes = this.visibleTabs.map((tabItem, index) => {
|
|
89
|
+
if (tabItem.selected) {
|
|
90
|
+
return -1;
|
|
91
|
+
}
|
|
92
|
+
return index;
|
|
93
|
+
}).filter(index => index >= 0);
|
|
106
94
|
|
|
107
95
|
this.overflowTabs = [];
|
|
108
96
|
|
|
109
|
-
// consider avoid falsy 0 in
|
|
97
|
+
// consider avoid falsy 0 in tab-boxes a 0 withHint will be used to calculate the minimum width
|
|
110
98
|
if (options.widthHint === 0 || options.widthHint) {
|
|
111
99
|
prefWidth = options.widthHint - htmlComp.insets().horizontal();
|
|
112
100
|
}
|
|
113
101
|
|
|
114
102
|
// shortcut for minimum size.
|
|
115
103
|
if (prefWidth <= 0) {
|
|
116
|
-
return this._minSize(
|
|
104
|
+
return this._minSize(this.visibleTabs).add(htmlComp.insets());
|
|
117
105
|
}
|
|
118
106
|
|
|
119
|
-
|
|
120
|
-
this.
|
|
121
|
-
prefSize = this._prefSize(
|
|
107
|
+
this._setFirstLastMarker(this.visibleTabs);
|
|
108
|
+
this._updateEllipsis();
|
|
109
|
+
prefSize = this._prefSize(this.visibleTabs);
|
|
110
|
+
|
|
122
111
|
while (prefSize.width > prefWidth && overflowableIndexes.length > 0) {
|
|
123
|
-
overflowIndex = overflowableIndexes.splice(-1)[0];
|
|
124
|
-
this.overflowTabs.splice(0, 0,
|
|
125
|
-
|
|
126
|
-
this._setFirstLastMarker(
|
|
127
|
-
|
|
112
|
+
let overflowIndex = overflowableIndexes.splice(-1)[0];
|
|
113
|
+
this.overflowTabs.splice(0, 0, this.visibleTabs[overflowIndex]);
|
|
114
|
+
this.visibleTabs.splice(overflowIndex, 1);
|
|
115
|
+
this._setFirstLastMarker(this.visibleTabs);
|
|
116
|
+
this._updateEllipsis(); // update ellipsis here already so that the prefSize on the next line is correct
|
|
117
|
+
prefSize = this._prefSize(this.visibleTabs);
|
|
128
118
|
}
|
|
129
119
|
|
|
130
|
-
this.visibleTabs = visibleTabItems;
|
|
131
|
-
|
|
132
120
|
// Use the total available space if spreading tabs evenly.
|
|
133
121
|
if (this.tabArea.displayStyle === TabArea.DisplayStyle.SPREAD_EVEN) {
|
|
134
122
|
return graphics.prefSize($container, options);
|
|
135
123
|
}
|
|
136
|
-
|
|
137
124
|
return graphics.exactPrefSize(prefSize.add(htmlComp.insets()), options);
|
|
138
125
|
}
|
|
139
126
|
|
|
140
127
|
_minSize(tabItems) {
|
|
141
|
-
let visibleTabItems = []
|
|
142
|
-
prefSize;
|
|
128
|
+
let visibleTabItems = [];
|
|
143
129
|
this.overflowTabs = tabItems.filter(tabItem => {
|
|
144
130
|
if (tabItem.selected) {
|
|
145
131
|
visibleTabItems.push(tabItem);
|
|
@@ -150,23 +136,21 @@ export default class TabAreaLayout extends AbstractLayout {
|
|
|
150
136
|
|
|
151
137
|
this.visibleTabs = visibleTabItems;
|
|
152
138
|
this._setFirstLastMarker(visibleTabItems);
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
return prefSize;
|
|
139
|
+
return this._prefSize(visibleTabItems);
|
|
156
140
|
}
|
|
157
141
|
|
|
158
142
|
_prefSize(tabItems, considerEllipsis) {
|
|
159
|
-
let prefSize = tabItems
|
|
160
|
-
|
|
143
|
+
let prefSize = tabItems
|
|
144
|
+
.map(tabItem => this._tabItemSize(tabItem))
|
|
145
|
+
.reduce((prefSize, itemSize) => {
|
|
161
146
|
prefSize.height = Math.max(prefSize.height, itemSize.height);
|
|
162
147
|
prefSize.width += itemSize.width;
|
|
163
148
|
return prefSize;
|
|
164
|
-
}, new Dimension(0, 0))
|
|
165
|
-
ellipsisSize = new Dimension(0, 0);
|
|
149
|
+
}, new Dimension(0, 0));
|
|
166
150
|
|
|
167
151
|
considerEllipsis = scout.nvl(considerEllipsis, this.overflowTabs.length > 0);
|
|
168
152
|
if (considerEllipsis) {
|
|
169
|
-
ellipsisSize = this._tabItemSize(this.tabArea.ellipsis
|
|
153
|
+
let ellipsisSize = this._tabItemSize(this.tabArea.ellipsis);
|
|
170
154
|
prefSize.height = Math.max(prefSize.height, ellipsisSize.height);
|
|
171
155
|
prefSize.width += ellipsisSize.width;
|
|
172
156
|
}
|
|
@@ -193,8 +177,8 @@ export default class TabAreaLayout extends AbstractLayout {
|
|
|
193
177
|
}
|
|
194
178
|
}
|
|
195
179
|
|
|
196
|
-
_tabItemSize(
|
|
197
|
-
let prefSize,
|
|
180
|
+
_tabItemSize(item) {
|
|
181
|
+
let htmlComp = item.htmlComp, prefSize,
|
|
198
182
|
classList = htmlComp.$comp.attr('class');
|
|
199
183
|
|
|
200
184
|
// temporarily revert display style to default. otherwise the pref size of the tab item will be the size of the container.
|
|
@@ -208,6 +192,19 @@ export default class TabAreaLayout extends AbstractLayout {
|
|
|
208
192
|
prefSize = htmlComp.prefSize({
|
|
209
193
|
exact: true
|
|
210
194
|
}).add(graphics.margins(htmlComp.$comp));
|
|
195
|
+
if (item.fieldStatus && item.fieldStatus.htmlComp) {
|
|
196
|
+
let statusOverflownAndHidden = item.overflown && !item.fieldStatus.visible;
|
|
197
|
+
if (statusOverflownAndHidden) {
|
|
198
|
+
// overflown tabs have no fieldStatus: explicitly set to visible so that the real consumed space can be computed
|
|
199
|
+
item.fieldStatus.setVisible(true);
|
|
200
|
+
}
|
|
201
|
+
let statusWidth = item.fieldStatus.htmlComp.prefSize({includeMargin: true}).width;
|
|
202
|
+
if (statusOverflownAndHidden) {
|
|
203
|
+
// restore
|
|
204
|
+
item.fieldStatus.setVisible(false);
|
|
205
|
+
}
|
|
206
|
+
prefSize.width += statusWidth;
|
|
207
|
+
}
|
|
211
208
|
|
|
212
209
|
htmlComp.$comp.attrOrRemove('class', classList);
|
|
213
210
|
|
|
@@ -32,7 +32,6 @@ export default class TabBox extends CompositeField {
|
|
|
32
32
|
this._addPreserveOnPropertyChangeProperties(['selectedTab']);
|
|
33
33
|
|
|
34
34
|
this._tabBoxHeaderPropertyChangeHander = this._onTabBoxHeaderPropertyChange.bind(this);
|
|
35
|
-
this._selectedTabScrollTopChangeHandler = this._updateScrollShadow.bind(this);
|
|
36
35
|
}
|
|
37
36
|
|
|
38
37
|
/**
|
|
@@ -173,16 +172,17 @@ export default class TabBox extends CompositeField {
|
|
|
173
172
|
_renderSelectedTab() {
|
|
174
173
|
if (this.selectedTab) {
|
|
175
174
|
this.selectedTab.render(this._$tabContent);
|
|
176
|
-
this.selectedTab.
|
|
175
|
+
this.selectedTab.get$Scrollable().data('scroll-shadow-customizer', this._updateScrollShadow.bind(this));
|
|
177
176
|
}
|
|
178
177
|
if (this.rendered) {
|
|
178
|
+
this._updateScrollShadow();
|
|
179
179
|
HtmlComponent.get(this._$tabContent).invalidateLayoutTree();
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
_removeSelectedTab() {
|
|
184
184
|
if (this.selectedTab) {
|
|
185
|
-
this.selectedTab.
|
|
185
|
+
this.selectedTab.get$Scrollable().removeData('scroll-shadow-customizer');
|
|
186
186
|
this.selectedTab.remove();
|
|
187
187
|
}
|
|
188
188
|
}
|
|
@@ -195,14 +195,11 @@ export default class TabBox extends CompositeField {
|
|
|
195
195
|
let oldHasScrollShadowTop = this.$container.hasClass('has-scroll-shadow-top');
|
|
196
196
|
this.$container.toggleClass('has-scroll-shadow-top', hasScrollShadowTop);
|
|
197
197
|
if (oldHasScrollShadowTop !== hasScrollShadowTop) {
|
|
198
|
-
this.
|
|
198
|
+
this.invalidateLayoutTree(false);
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
// Enlarge header line if there is a shadow, but only if there is a header (controlled by labelVisible)
|
|
202
202
|
fields.adjustStatusPositionForScrollShadow(this, () => hasScrollShadowTop && this.labelVisible);
|
|
203
|
-
|
|
204
|
-
// Prevent flickering of status icon
|
|
205
|
-
this.validateLayout();
|
|
206
203
|
}
|
|
207
204
|
|
|
208
205
|
setTabAreaStyle(tabAreaStyle) {
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
& > .menubar {
|
|
75
75
|
position: absolute;
|
|
76
76
|
#scout.menubar-background-color-inherit();
|
|
77
|
-
border-bottom
|
|
77
|
+
border-bottom: none;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
& > .status {
|
|
@@ -163,6 +163,7 @@
|
|
|
163
163
|
display: inline-block;
|
|
164
164
|
vertical-align: middle;
|
|
165
165
|
padding: @tab-item-title-padding-top 0 @tab-item-title-padding-bottom;
|
|
166
|
+
margin-top: @text-margin-top;
|
|
166
167
|
|
|
167
168
|
.tab-area.has-sub-label > & {
|
|
168
169
|
padding-bottom: @group-box-title-with-sub-label-padding-bottom;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c)
|
|
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
|
|
@@ -34,14 +34,14 @@ export default class TabBoxHeaderLayout extends AbstractLayout {
|
|
|
34
34
|
this.tabBoxHeader.invalidateLayoutTree();
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
layout($container) {
|
|
37
|
+
layout($container) {
|
|
38
38
|
let htmlContainer = HtmlComponent.get($container),
|
|
39
39
|
tabArea = this.tabBoxHeader.tabArea,
|
|
40
40
|
tabAreaMargins = tabArea.htmlComp.margins(),
|
|
41
41
|
tabAreaPrefSize,
|
|
42
42
|
menuBar = this.tabBoxHeader.menuBar,
|
|
43
43
|
menuBarMargins = menuBar.htmlComp.margins(),
|
|
44
|
-
|
|
44
|
+
menuBarMinimumSize,
|
|
45
45
|
$status = this.tabBoxHeader.tabBox.$status,
|
|
46
46
|
statusSizeLarge = new Dimension(),
|
|
47
47
|
insets = htmlContainer.insets(),
|
|
@@ -49,7 +49,7 @@ export default class TabBoxHeaderLayout extends AbstractLayout {
|
|
|
49
49
|
exact: true
|
|
50
50
|
}).subtract(htmlContainer.insets());
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
menuBarMinimumSize = menuBar.htmlComp.prefSize({
|
|
53
53
|
widthHint: 0
|
|
54
54
|
});
|
|
55
55
|
|
|
@@ -59,7 +59,7 @@ export default class TabBoxHeaderLayout extends AbstractLayout {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
tabAreaPrefSize = tabArea.htmlComp.prefSize({
|
|
62
|
-
widthHint: containerSize.width -
|
|
62
|
+
widthHint: containerSize.width - menuBarMinimumSize.width - menuBarMargins.horizontal() - statusSizeLarge.width,
|
|
63
63
|
exact: false
|
|
64
64
|
});
|
|
65
65
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2010-
|
|
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,7 +8,7 @@
|
|
|
8
8
|
* Contributors:
|
|
9
9
|
* BSI Business Systems Integration AG - initial API and implementation
|
|
10
10
|
*/
|
|
11
|
-
import {
|
|
11
|
+
import {Widget} from '../index';
|
|
12
12
|
import $ from 'jquery';
|
|
13
13
|
|
|
14
14
|
export default class GlassPane extends Widget {
|
|
@@ -24,7 +24,7 @@ export default class GlassPane extends Widget {
|
|
|
24
24
|
|
|
25
25
|
this.$parent.addClass('glasspane-parent');
|
|
26
26
|
let cssPosition = this.$parent.css('position');
|
|
27
|
-
if (
|
|
27
|
+
if (cssPosition === 'static') {
|
|
28
28
|
this.$parent.css('position', 'relative');
|
|
29
29
|
}
|
|
30
30
|
|
package/src/group/Group.less
CHANGED
package/src/index.less
CHANGED
|
@@ -144,5 +144,6 @@
|
|
|
144
144
|
@import "tile/fields/tablefield/TileTableField";
|
|
145
145
|
@import "widget/FilterSupport";
|
|
146
146
|
@import "login/LoginBox";
|
|
147
|
+
@import "form/fields/breadcrumbbarfield/BreadcrumbBarField";
|
|
147
148
|
@import "breadcrumbbar/BreadcrumbBar";
|
|
148
149
|
@import "breadcrumbbar/BreadcrumbItem";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2010-
|
|
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
|
|
@@ -1049,16 +1049,17 @@ $.fn.oneAnimationEnd = function(handler) {
|
|
|
1049
1049
|
if (!handler) {
|
|
1050
1050
|
return this;
|
|
1051
1051
|
}
|
|
1052
|
-
|
|
1052
|
+
let oneHandler = event => {
|
|
1053
1053
|
if (event.target !== this[0]) {
|
|
1054
1054
|
// Ignore events that bubble up from child elements
|
|
1055
1055
|
return;
|
|
1056
1056
|
}
|
|
1057
1057
|
// Unregister listener to implement "one" semantics
|
|
1058
|
-
this.off(
|
|
1058
|
+
this.off('animationend webkitAnimationEnd', oneHandler);
|
|
1059
1059
|
// Notify actual event handler
|
|
1060
1060
|
handler(event);
|
|
1061
|
-
}
|
|
1061
|
+
};
|
|
1062
|
+
return this.on('animationend webkitAnimationEnd', oneHandler);
|
|
1062
1063
|
};
|
|
1063
1064
|
|
|
1064
1065
|
$.fn.hasAnimationClass = function() {
|
|
@@ -53,14 +53,21 @@
|
|
|
53
53
|
&.selected {
|
|
54
54
|
background-color: @item-selection-background-color;
|
|
55
55
|
|
|
56
|
+
&.has-popup {
|
|
57
|
+
color: @context-menu-item-color;
|
|
58
|
+
|
|
59
|
+
&.disabled {
|
|
60
|
+
color: @menu-item-disabled-color;
|
|
61
|
+
background-color: @item-selection-background-color;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
56
65
|
& > .submenu-icon {
|
|
57
66
|
transform: none;
|
|
58
67
|
}
|
|
59
68
|
}
|
|
60
69
|
|
|
61
70
|
&.expanded {
|
|
62
|
-
color: @active-color;
|
|
63
|
-
|
|
64
71
|
& > .submenu-icon {
|
|
65
72
|
#scout.submenu-icon-open();
|
|
66
73
|
}
|
package/src/menu/Menu.less
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2010-
|
|
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
|
|
@@ -9,10 +9,14 @@
|
|
|
9
9
|
* BSI Business Systems Integration AG - initial API and implementation
|
|
10
10
|
*/
|
|
11
11
|
.mode {
|
|
12
|
-
|
|
12
|
+
--padding-x: @mode-padding-x;
|
|
13
|
+
--padding-y: @mode-padding-y;
|
|
14
|
+
--border-width: @mode-border-width;
|
|
15
|
+
|
|
16
|
+
border: var(--border-width) solid @control-border-color;
|
|
13
17
|
border-radius: 0;
|
|
14
18
|
flex: 1 1 0;
|
|
15
|
-
padding:
|
|
19
|
+
padding: var(--padding-y) var(--padding-x);
|
|
16
20
|
#scout.overflow-ellipsis();
|
|
17
21
|
|
|
18
22
|
&.first {
|
|
@@ -29,12 +33,12 @@
|
|
|
29
33
|
|
|
30
34
|
&:not(.last):not(.selected) {
|
|
31
35
|
border-right: none;
|
|
32
|
-
padding-right:
|
|
36
|
+
padding-right: calc(var(--padding-x) + var(--border-width)); /* account for the missing border, so that text does not jump */
|
|
33
37
|
}
|
|
34
38
|
|
|
35
39
|
&.after-selected {
|
|
36
40
|
border-left: none;
|
|
37
|
-
padding-left:
|
|
41
|
+
padding-left: calc(var(--padding-x) + var(--border-width)); /* account for the missing border, so that text does not jump */
|
|
38
42
|
}
|
|
39
43
|
|
|
40
44
|
// override button (the selected mode cannot be clicked. therefore do not show hover and active colors)
|
|
@@ -68,28 +72,20 @@
|
|
|
68
72
|
}
|
|
69
73
|
|
|
70
74
|
.mode-selector.alternative {
|
|
71
|
-
border: @mode-alternative-border-width solid transparent;
|
|
72
75
|
|
|
73
76
|
& > .mode {
|
|
77
|
+
--border-width: 0px;
|
|
78
|
+
|
|
74
79
|
color: @mode-color;
|
|
75
|
-
border: none;
|
|
76
80
|
background-color: transparent;
|
|
77
81
|
border-radius: @button-border-radius;
|
|
78
82
|
|
|
79
|
-
&:not(.last):not(.selected) {
|
|
80
|
-
padding-right: @mode-padding-x;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
&.after-selected {
|
|
84
|
-
padding-left: @mode-padding-x;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
83
|
&:hover {
|
|
88
|
-
background-color:
|
|
84
|
+
background-color: @mode-alternative-hover-background-color;
|
|
89
85
|
}
|
|
90
86
|
|
|
91
87
|
&:active {
|
|
92
|
-
background-color:
|
|
88
|
+
background-color: @mode-alternative-active-background-color;
|
|
93
89
|
}
|
|
94
90
|
|
|
95
91
|
&.selected {
|
|
@@ -120,26 +116,8 @@
|
|
|
120
116
|
}
|
|
121
117
|
|
|
122
118
|
.dense .mode-selector {
|
|
123
|
-
|
|
124
119
|
& > .mode {
|
|
125
|
-
padding: @mode-padding-dense;
|
|
126
|
-
|
|
127
|
-
&:not(.last):not(.selected) {
|
|
128
|
-
padding-right: @mode-padding-dense-x + @mode-border-width; /* account for the missing border, so that text does not jump */
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
&.after-selected {
|
|
132
|
-
padding-left: @mode-padding-dense-x + @mode-border-width; /* account for the missing border, so that text does not jump */
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
&.alternative > .mode {
|
|
137
|
-
&:not(.last):not(.selected) {
|
|
138
|
-
padding-right: @mode-padding-dense-x;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
&.after-selected {
|
|
142
|
-
padding-left: @mode-padding-dense-x;
|
|
143
|
-
}
|
|
120
|
+
--padding-x: @mode-padding-dense-x;
|
|
121
|
+
--padding-y: @mode-padding-dense-y;
|
|
144
122
|
}
|
|
145
123
|
}
|
|
@@ -133,7 +133,7 @@ export default class ModeSelector extends Widget {
|
|
|
133
133
|
let selectedModePosX = 0, selectedModeWidth = 0;
|
|
134
134
|
if (this.selectedMode && this.selectedMode.$container) {
|
|
135
135
|
selectedModePosX = graphics.position(this.selectedMode.$container).x;
|
|
136
|
-
selectedModeWidth = graphics.size(this.selectedMode.$container).width;
|
|
136
|
+
selectedModeWidth = graphics.size(this.selectedMode.$container, {exact: true}).width;
|
|
137
137
|
}
|
|
138
138
|
this.$slider.cssLeft(selectedModePosX);
|
|
139
139
|
this.$slider.cssWidth(selectedModeWidth);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2010-
|
|
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
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
&.alternative {
|
|
23
23
|
background-color: @mode-alternative-background-color;
|
|
24
24
|
border-radius: @button-border-radius;
|
|
25
|
+
border: @mode-selector-alternative-border-width solid transparent;
|
|
25
26
|
|
|
26
27
|
&:not(.disabled) > .mode-slider {
|
|
27
28
|
display: block;
|
package/src/popup/Popup.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) 2010-
|
|
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,7 +8,7 @@
|
|
|
8
8
|
* Contributors:
|
|
9
9
|
* BSI Business Systems Integration AG - initial API and implementation
|
|
10
10
|
*/
|
|
11
|
-
import {CloseKeyStroke, DialogLayout, Dimension, Event, FocusRule, GlassPaneRenderer, graphics, HtmlComponent, Insets, KeyStrokeContext, Point, PopupLayout, Rectangle, scout, scrollbars, strings, Widget} from '../index';
|
|
11
|
+
import {CloseKeyStroke, DialogLayout, Dimension, Event, FocusRule, GlassPaneRenderer, graphics, HtmlComponent, Insets, KeyStrokeContext, Point, PopupLayout, Rectangle, scout, scrollbars, strings, Widget, widgets} from '../index';
|
|
12
12
|
import $ from 'jquery';
|
|
13
13
|
|
|
14
14
|
export default class Popup extends Widget {
|
|
@@ -185,18 +185,17 @@ export default class Popup extends Widget {
|
|
|
185
185
|
|
|
186
186
|
_openWithoutParent() {
|
|
187
187
|
// resolve parent for entry-point (don't change the actual property)
|
|
188
|
-
|
|
189
|
-
if (parent.destroyed) {
|
|
188
|
+
if (this.parent.destroyed) {
|
|
190
189
|
return;
|
|
191
190
|
}
|
|
192
|
-
if (parent.rendered || parent.rendering) {
|
|
193
|
-
this.open(
|
|
191
|
+
if (this.parent.rendered || this.parent.rendering) {
|
|
192
|
+
this.open(this._getDefaultOpen$Parent());
|
|
194
193
|
return;
|
|
195
194
|
}
|
|
196
195
|
|
|
197
196
|
// This is important for popups rendered in another (native) browser window. The DOM in the popup window
|
|
198
197
|
// is rendered later, so we must wait until that window is rendered and layouted. See popup-window.html.
|
|
199
|
-
parent.one('render', () => {
|
|
198
|
+
this.parent.one('render', () => {
|
|
200
199
|
this.session.layoutValidator.schedulePostValidateFunction(() => {
|
|
201
200
|
if (this.destroyed || this.rendered) {
|
|
202
201
|
return;
|
|
@@ -206,6 +205,14 @@ export default class Popup extends Widget {
|
|
|
206
205
|
});
|
|
207
206
|
}
|
|
208
207
|
|
|
208
|
+
/**
|
|
209
|
+
* Only called if parent.rendered or parent.rendering
|
|
210
|
+
* @return {$}
|
|
211
|
+
*/
|
|
212
|
+
_getDefaultOpen$Parent() {
|
|
213
|
+
return this.parent.entryPoint();
|
|
214
|
+
}
|
|
215
|
+
|
|
209
216
|
open($parent) {
|
|
210
217
|
if (!$parent) {
|
|
211
218
|
this._openWithoutParent();
|
|
@@ -442,6 +449,15 @@ export default class Popup extends Widget {
|
|
|
442
449
|
return cssClass;
|
|
443
450
|
}
|
|
444
451
|
|
|
452
|
+
_animateRemovalWhileRemovingParent() {
|
|
453
|
+
if (!this.$anchor) {
|
|
454
|
+
// Allow remove animations for popups without an anchor
|
|
455
|
+
return true;
|
|
456
|
+
}
|
|
457
|
+
// If parent is the anchor, prevent remove animation to ensure popup will be removed together with the anchor
|
|
458
|
+
return widgets.get(this.$anchor) !== this.parent;
|
|
459
|
+
}
|
|
460
|
+
|
|
445
461
|
_isRemovalPrevented() {
|
|
446
462
|
// If removal of a parent is pending due to an animation then don't return true to make sure popups are closed before the parent animation starts.
|
|
447
463
|
// However, if the popup itself is removed by an animation, removal should be prevented to ensure remove() won't run multiple times.
|
|
@@ -1037,7 +1053,7 @@ export default class Popup extends Widget {
|
|
|
1037
1053
|
|
|
1038
1054
|
_handleGlassPanes() {
|
|
1039
1055
|
let parentCoveredByGlassPane = this.session.focusManager.isElementCovertByGlassPane(this.parent.$container);
|
|
1040
|
-
// if a popup is covered by a glass pane the glass pane's need to be
|
|
1056
|
+
// if a popup is covered by a glass pane the glass pane's need to be re-rendered to ensure a glass pane is also painted over the popup
|
|
1041
1057
|
if (parentCoveredByGlassPane) {
|
|
1042
1058
|
this.session.focusManager.rerenderGlassPanes();
|
|
1043
1059
|
}
|
package/src/popup/PopupLayout.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c)
|
|
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
|
|
@@ -135,9 +135,6 @@ export default class PopupLayout extends AbstractLayout {
|
|
|
135
135
|
* @returns {Dimension}
|
|
136
136
|
*/
|
|
137
137
|
_calcMaxSize() {
|
|
138
|
-
// Position the popup at the desired location before doing any calculations to consider the preferred bounds
|
|
139
|
-
this._position(false);
|
|
140
|
-
|
|
141
138
|
let maxWidth, maxHeight,
|
|
142
139
|
htmlComp = this.popup.htmlComp,
|
|
143
140
|
windowPaddingX = this.popup.windowPaddingX,
|
|
@@ -159,7 +156,7 @@ export default class PopupLayout extends AbstractLayout {
|
|
|
159
156
|
horizontalAlignment = this.popup.horizontalAlignment,
|
|
160
157
|
verticalAlignment = this.popup.verticalAlignment;
|
|
161
158
|
|
|
162
|
-
// Decide whether the prefSize can be used or the popup needs to be
|
|
159
|
+
// Decide whether the prefSize can be used or the popup needs to be shrunken so that it fits into the viewport
|
|
163
160
|
// The decision is based on the preferred opening direction
|
|
164
161
|
// Example: The popup would like to be opened leftedge and bottom
|
|
165
162
|
// If there is enough space on the right and on the bottom -> pref size is used
|
|
@@ -219,9 +216,6 @@ export default class PopupLayout extends AbstractLayout {
|
|
|
219
216
|
* @returns {Insets}
|
|
220
217
|
*/
|
|
221
218
|
_calcMaxSizeAroundAnchor() {
|
|
222
|
-
// Position the popup at the desired location before doing any calculations because positioning adds CSS classes which might change margins
|
|
223
|
-
this._position(false);
|
|
224
|
-
|
|
225
219
|
let maxWidthLeft, maxWidthRight, maxHeightDown, maxHeightUp,
|
|
226
220
|
htmlComp = this.popup.htmlComp,
|
|
227
221
|
windowPaddingX = this.popup.windowPaddingX,
|