@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.
- package/dist/eclipse-scout-core-theme-dark.css +135 -46
- package/dist/eclipse-scout-core-theme-dark.css.map +1 -1
- package/dist/eclipse-scout-core-theme.css +134 -45
- package/dist/eclipse-scout-core-theme.css.map +1 -1
- package/dist/eclipse-scout-core.js +744 -640
- package/dist/eclipse-scout-core.js.map +1 -1
- package/package.json +2 -2
- package/src/App.js +86 -17
- package/src/RemoteApp.js +1 -0
- package/src/desktop/Desktop.js +3 -3
- package/src/desktop/desktoptab/DesktopTab.less +14 -0
- package/src/desktop/notification/DesktopNotification.js +33 -8
- package/src/desktop/outline/Outline.js +2 -32
- package/src/desktop/outline/Outline.less +14 -6
- package/src/desktop/outline/OutlineViewButton.js +1 -0
- package/src/desktop/viewbutton/ViewButtonBox.js +2 -2
- package/src/filechooser/FileChooser.js +2 -1
- package/src/form/Form.js +11 -3
- package/src/form/fields/groupbox/GroupBox.less +3 -1
- package/src/glasspane/DeferredGlassPaneTarget.js +2 -2
- package/src/index.js +2 -1
- package/src/login/LoginBox.less +8 -1
- package/src/main.less +1 -1
- package/src/menu/ComboMenu.js +22 -17
- package/src/menu/ComboMenu.less +71 -26
- package/src/menu/ContextMenuPopup.js +3 -2
- package/src/menu/ContextMenuPopup.less +1 -1
- package/src/menu/EllipsisMenu.js +4 -0
- package/src/menu/Menu.js +24 -11
- package/src/menu/menubar/MenuBar.js +2 -19
- package/src/menu/menubar/MenuBarBox.js +3 -34
- package/src/menu/menubar/MenuBarLayout.js +6 -19
- package/src/menu/menubox/MenuBoxLayout.js +1 -1
- package/src/menu/menus.js +4 -10
- package/src/messagebox/MessageBox.js +3 -22
- package/src/modeselector/ModeSelectorLayout.js +11 -6
- package/src/notification/Notification.js +15 -14
- package/src/popup/Popup.js +3 -20
- package/src/session/BusyIndicator.js +2 -1
- package/src/session/Session.js +4 -63
- package/src/status/Status.js +2 -1
- package/src/style/colors-dark.less +3 -1
- package/src/style/colors.less +2 -0
- package/src/style/sizes.less +5 -3
- package/src/table/Table.js +7 -3
- package/src/table/Table.less +13 -3
- package/src/table/columns/Column.js +4 -0
- package/src/tile/fields/htmlfield/TileHtmlField.js +28 -0
- package/src/tooltip/Tooltip.less +7 -5
- package/src/tree/LazyNodeFilter.js +24 -15
- package/src/tree/Tree.js +112 -143
- package/src/tree/Tree.less +2 -2
- package/src/tree/TreeLayout.js +1 -1
- package/src/tree/TreeNode.js +2 -2
- package/src/util/Device.js +6 -2
- package/src/widget/FilterSupport.js +6 -4
- package/src/widget/FilterSupport.less +38 -9
- package/src/widget/LoadingSupport.js +1 -1
- package/src/widget/Widget.js +41 -36
- package/src/widget/WidgetSupport.js +1 -1
package/src/session/Session.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
|
|
@@ -319,7 +319,6 @@ export default class Session {
|
|
|
319
319
|
}
|
|
320
320
|
|
|
321
321
|
function onAjaxFail(jqXHR, textStatus, errorThrown, ...args) {
|
|
322
|
-
this._setApplicationLoading(false);
|
|
323
322
|
this._processErrorResponse(jqXHR, textStatus, errorThrown, request);
|
|
324
323
|
return $.rejectedPromise(jqXHR, textStatus, errorThrown, ...args);
|
|
325
324
|
}
|
|
@@ -423,6 +422,8 @@ export default class Session {
|
|
|
423
422
|
// Extract client session data without creating a model adapter for it. It is (currently) only used to transport the desktop's adapterId.
|
|
424
423
|
let clientSessionData = this._getAdapterData(data.startupData.clientSession);
|
|
425
424
|
this.desktop = this.getOrCreateWidget(clientSessionData.desktop, this.rootAdapter.widget);
|
|
425
|
+
App.get()._triggerDesktopReady(this.desktop);
|
|
426
|
+
|
|
426
427
|
let renderDesktopImpl = function() {
|
|
427
428
|
this._renderDesktop();
|
|
428
429
|
|
|
@@ -444,6 +445,7 @@ export default class Session {
|
|
|
444
445
|
this._resumeBackgroundJobPolling();
|
|
445
446
|
|
|
446
447
|
this.ready = true;
|
|
448
|
+
App.get()._triggerSessionReady(this);
|
|
447
449
|
|
|
448
450
|
$.log.isInfoEnabled() && $.log.info('Session initialized. Detected ' + Device.get());
|
|
449
451
|
if ($.log.isDebugEnabled()) {
|
|
@@ -1070,7 +1072,6 @@ export default class Session {
|
|
|
1070
1072
|
}
|
|
1071
1073
|
this._fatalMessagesOnScreen[errorCode] = true;
|
|
1072
1074
|
}
|
|
1073
|
-
this._setApplicationLoading(false);
|
|
1074
1075
|
|
|
1075
1076
|
options = options || {};
|
|
1076
1077
|
let model = {
|
|
@@ -1394,62 +1395,6 @@ export default class Session {
|
|
|
1394
1395
|
return request;
|
|
1395
1396
|
}
|
|
1396
1397
|
|
|
1397
|
-
_setApplicationLoading(applicationLoading) {
|
|
1398
|
-
if (applicationLoading) {
|
|
1399
|
-
this._applicationLoadingTimeoutId = setTimeout(() => {
|
|
1400
|
-
if (!this.desktop || !this.desktop.rendered) {
|
|
1401
|
-
this._renderApplicationLoading();
|
|
1402
|
-
}
|
|
1403
|
-
}, 200);
|
|
1404
|
-
} else {
|
|
1405
|
-
clearTimeout(this._applicationLoadingTimeoutId);
|
|
1406
|
-
this._applicationLoadingTimeoutId = null;
|
|
1407
|
-
this._removeApplicationLoading();
|
|
1408
|
-
}
|
|
1409
|
-
}
|
|
1410
|
-
|
|
1411
|
-
_renderApplicationLoading() {
|
|
1412
|
-
let $body = $('body'),
|
|
1413
|
-
$loadingRoot = $body.children('.application-loading-root');
|
|
1414
|
-
if (!$loadingRoot.length) {
|
|
1415
|
-
$loadingRoot = $body.appendDiv('application-loading-root')
|
|
1416
|
-
.addClass('application-loading-root')
|
|
1417
|
-
.fadeIn();
|
|
1418
|
-
}
|
|
1419
|
-
this._renderApplicationLoadingElement($loadingRoot, 'application-loading01');
|
|
1420
|
-
this._renderApplicationLoadingElement($loadingRoot, 'application-loading02');
|
|
1421
|
-
this._renderApplicationLoadingElement($loadingRoot, 'application-loading03');
|
|
1422
|
-
}
|
|
1423
|
-
|
|
1424
|
-
_renderApplicationLoadingElement($loadingRoot, cssClass) {
|
|
1425
|
-
if ($loadingRoot.children('.' + cssClass).length) {
|
|
1426
|
-
return;
|
|
1427
|
-
}
|
|
1428
|
-
// noinspection JSValidateTypes
|
|
1429
|
-
$loadingRoot.appendDiv(cssClass).hide()
|
|
1430
|
-
.fadeIn();
|
|
1431
|
-
}
|
|
1432
|
-
|
|
1433
|
-
_removeApplicationLoading() {
|
|
1434
|
-
let $loadingRoot = $('body').children('.application-loading-root');
|
|
1435
|
-
// the fadeout animation only contains a to-value and no from-value
|
|
1436
|
-
// therefore set the current value to the elements style
|
|
1437
|
-
$loadingRoot.css('opacity', $loadingRoot.css('opacity'));
|
|
1438
|
-
if ($loadingRoot.css('opacity') == 1) {
|
|
1439
|
-
$loadingRoot.addClass('fadeout and-more');
|
|
1440
|
-
} else {
|
|
1441
|
-
$loadingRoot.addClass('fadeout');
|
|
1442
|
-
}
|
|
1443
|
-
if (Device.get().supportsCssAnimation()) {
|
|
1444
|
-
$loadingRoot.oneAnimationEnd(() => {
|
|
1445
|
-
$loadingRoot.remove();
|
|
1446
|
-
});
|
|
1447
|
-
} else {
|
|
1448
|
-
// fallback for old browsers that do not support the animation-end event
|
|
1449
|
-
$loadingRoot.remove();
|
|
1450
|
-
}
|
|
1451
|
-
}
|
|
1452
|
-
|
|
1453
1398
|
_processEvents(events) {
|
|
1454
1399
|
let i = 0;
|
|
1455
1400
|
while (i < events.length) {
|
|
@@ -1493,9 +1438,6 @@ export default class Session {
|
|
|
1493
1438
|
start() {
|
|
1494
1439
|
$.log.isInfoEnabled() && $.log.info('Session starting...');
|
|
1495
1440
|
|
|
1496
|
-
// After a short time, display a loading animation (will be removed again in _renderDesktop)
|
|
1497
|
-
this._setApplicationLoading(true);
|
|
1498
|
-
|
|
1499
1441
|
// Send startup request
|
|
1500
1442
|
return this._sendStartupRequest();
|
|
1501
1443
|
}
|
|
@@ -1545,7 +1487,6 @@ export default class Session {
|
|
|
1545
1487
|
_renderDesktop() {
|
|
1546
1488
|
this.desktop.render(this.$entryPoint);
|
|
1547
1489
|
this.desktop.invalidateLayoutTree(false);
|
|
1548
|
-
this._setApplicationLoading(false);
|
|
1549
1490
|
}
|
|
1550
1491
|
|
|
1551
1492
|
_onLogout(event) {
|
package/src/status/Status.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
|
|
@@ -16,6 +16,7 @@ export default class Status {
|
|
|
16
16
|
constructor(model) {
|
|
17
17
|
this.message = null;
|
|
18
18
|
this.severity = Status.Severity.ERROR;
|
|
19
|
+
this.iconId = null;
|
|
19
20
|
this.code = 0;
|
|
20
21
|
this.children = null;
|
|
21
22
|
this.deletable = true;
|
|
@@ -164,13 +164,15 @@
|
|
|
164
164
|
@desktop-navigation-body-in-background-background-color: @palette-gray-9;
|
|
165
165
|
@desktop-navigation-color: @text-color;
|
|
166
166
|
@desktop-navigation-handle-background-color: @desktop-navigation-body-background-color;
|
|
167
|
+
@default-combo-menu-separator-color: @text-inverted-color;
|
|
167
168
|
@dimmed-background-color: @palette-gray-9;
|
|
168
169
|
@group-header-color: @text-color-2;
|
|
169
170
|
@notification-ok-background-color: fade(@palette-green-5, 60%);
|
|
170
171
|
@notification-info-background-color: fade(@accent-color-5, 60%);
|
|
171
172
|
@notification-warning-background-color: fade(@palette-orange-5, 60%);
|
|
172
173
|
@notification-error-background-color: fade(@palette-red-5, 50%);
|
|
173
|
-
@outline-group-background-color: @palette-gray-
|
|
174
|
+
@outline-group-background-color: @palette-gray-6-1;
|
|
175
|
+
@outline-in-background-group-background-color: @palette-gray-7;
|
|
174
176
|
@outline-node-selected-icon-color: @palette-gray-6-1;
|
|
175
177
|
@outline-breadcrumb-border-color: @palette-gray-6; // Needs to be a solid color for compact mode to make selection background not shine through
|
|
176
178
|
@planner-activity-color: @text-inverted-color;
|
package/src/style/colors.less
CHANGED
|
@@ -239,6 +239,7 @@
|
|
|
239
239
|
@default-button-background-color: @selected-background-color;
|
|
240
240
|
@default-button-color: @selected-color;
|
|
241
241
|
@default-button-hover-background-color: @selected-hover-background-color;
|
|
242
|
+
@default-combo-menu-separator-color: @border-color;
|
|
242
243
|
@desktop-bench-background-color: @background-color;
|
|
243
244
|
@desktop-bench-drop-shadow-color: fade(@palette-black, 10%);
|
|
244
245
|
@desktop-bench-tab-area-background-color: @dimmed-background-color;
|
|
@@ -309,6 +310,7 @@
|
|
|
309
310
|
@outline-breadcrumb-child-background-color: @desktop-navigation-body-background-color;
|
|
310
311
|
@outline-breadcrumb-node-active-background-color: @hover-background-color;
|
|
311
312
|
@outline-group-background-color: @accent-color-0;
|
|
313
|
+
@outline-in-background-group-background-color: darken(@desktop-navigation-body-in-background-background-color, 5%);
|
|
312
314
|
@outline-in-background-selection-background-color: @selected-disabled-background-color;
|
|
313
315
|
@outline-in-background-selection-color: @outline-selection-color;
|
|
314
316
|
@outline-selection-background-color: @selected-background-color;
|
package/src/style/sizes.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
|
|
@@ -26,9 +26,10 @@
|
|
|
26
26
|
@drop-shadow-blur: 13px;
|
|
27
27
|
@drop-shadow-large-y: 8px;
|
|
28
28
|
@drop-shadow-large-blur: 32px;
|
|
29
|
-
@filter-field-bottom:
|
|
30
|
-
@filter-field-right:
|
|
29
|
+
@filter-field-bottom: 8px;
|
|
30
|
+
@filter-field-right: 8px;
|
|
31
31
|
@filter-field-height: @logical-grid-row-height;
|
|
32
|
+
@filter-field-height-dense: @logical-grid-row-height-dense;
|
|
32
33
|
@filter-field-width: 190px;
|
|
33
34
|
@filter-field-min-width: 75px;
|
|
34
35
|
@filter-field-max-width: 60%;
|
|
@@ -136,6 +137,7 @@
|
|
|
136
137
|
@context-menu-item-padding-y: 8px;
|
|
137
138
|
@context-menu-item-padding-left: 16px;
|
|
138
139
|
@context-menu-item-padding-right: 16px;
|
|
140
|
+
@context-menu-item-icon-margin-right: 14px;
|
|
139
141
|
@dashboard-tile-label-padding-bottom: 5px;
|
|
140
142
|
@dashboard-tile-label-large-padding-bottom: 10px;
|
|
141
143
|
@dashboard-tile-drop-shadow-light-alpha: 0.05;
|
package/src/table/Table.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
|
|
@@ -2199,7 +2199,7 @@ export default class Table extends Widget {
|
|
|
2199
2199
|
let cell, column, predicate;
|
|
2200
2200
|
|
|
2201
2201
|
predicate = function(column) {
|
|
2202
|
-
if (column.guiOnly) {
|
|
2202
|
+
if (!column.isVisible() || column.guiOnly) {
|
|
2203
2203
|
// does not support tabbing
|
|
2204
2204
|
return false;
|
|
2205
2205
|
}
|
|
@@ -3056,6 +3056,7 @@ export default class Table extends Widget {
|
|
|
3056
3056
|
this.ensureRowRendered(row);
|
|
3057
3057
|
let popup = column.startCellEdit(row, field);
|
|
3058
3058
|
this.cellEditorPopup = popup;
|
|
3059
|
+
this.$container.toggleClass('has-cell-editor-popup', !!popup);
|
|
3059
3060
|
return popup;
|
|
3060
3061
|
}
|
|
3061
3062
|
|
|
@@ -3754,7 +3755,7 @@ export default class Table extends Widget {
|
|
|
3754
3755
|
addFilter(filter, applyFilter = true) {
|
|
3755
3756
|
if (filter instanceof TableUserFilter) {
|
|
3756
3757
|
let previousFilter = this.getFilter(filter.createKey());
|
|
3757
|
-
this.filterSupport.removeFilter(previousFilter);
|
|
3758
|
+
this.filterSupport.removeFilter(previousFilter, false);
|
|
3758
3759
|
}
|
|
3759
3760
|
|
|
3760
3761
|
let added = this.filterSupport.addFilter(filter, applyFilter);
|
|
@@ -5384,6 +5385,9 @@ export default class Table extends Widget {
|
|
|
5384
5385
|
let destroyEditor = () => {
|
|
5385
5386
|
this.cellEditorPopup.destroy();
|
|
5386
5387
|
this.cellEditorPopup = null;
|
|
5388
|
+
if (this.$container) {
|
|
5389
|
+
this.$container.removeClass('has-cell-editor-popup');
|
|
5390
|
+
}
|
|
5387
5391
|
if (callback) {
|
|
5388
5392
|
callback();
|
|
5389
5393
|
}
|
package/src/table/Table.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
|
|
@@ -121,20 +121,30 @@
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
& > .filter-field {
|
|
124
|
-
--filter-field-max-bottom: calc(~'50% - ' (
|
|
124
|
+
--filter-field-max-bottom: calc(~'50% - ' (var(--filter-field-height) + var(--controls-height)) / 2);
|
|
125
125
|
|
|
126
126
|
&:not(.focused).empty {
|
|
127
127
|
--filter-field-max-bottom: calc(~'50% - ' (@filter-field-icon-size + var(--controls-height)) / 2);
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
.has-menubar.menubar-bottom& {
|
|
131
|
-
--filter-field-max-bottom: calc(~'50% - ' (
|
|
131
|
+
--filter-field-max-bottom: calc(~'50% - ' (var(--filter-field-height) + var(--controls-height)) / 2);
|
|
132
132
|
bottom: calc(min(var(--filter-field-bottom), var(--filter-field-max-bottom)) + var(--menubar-height));
|
|
133
133
|
|
|
134
134
|
&:not(.focused).empty {
|
|
135
135
|
--filter-field-max-bottom: calc(~'50% - ' (@filter-field-icon-size + var(--controls-height)) / 2);
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
|
+
|
|
139
|
+
.has-cell-editor-popup& {
|
|
140
|
+
opacity: 0;
|
|
141
|
+
visibility: hidden;
|
|
142
|
+
|
|
143
|
+
// start the "fade out" transition right away
|
|
144
|
+
--filter-field-opacity-transition-delay: 0s;
|
|
145
|
+
// set visibility to hidden right after the "fade out" transition ends
|
|
146
|
+
--filter-field-visibility-transition-delay: calc(@filter-field-transition-duration + var(--filter-field-opacity-transition-delay));
|
|
147
|
+
}
|
|
138
148
|
}
|
|
139
149
|
}
|
|
140
150
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2010-2022 BSI Business Systems Integration AG.
|
|
3
|
+
* All rights reserved. This program and the accompanying materials
|
|
4
|
+
* are made available under the terms of the Eclipse Public License v1.0
|
|
5
|
+
* which accompanies this distribution, and is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-v10.html
|
|
7
|
+
*
|
|
8
|
+
* Contributors:
|
|
9
|
+
* BSI Business Systems Integration AG - initial API and implementation
|
|
10
|
+
*/
|
|
11
|
+
import {HtmlField} from '../../../index';
|
|
12
|
+
|
|
13
|
+
export default class TileHtmlField extends HtmlField {
|
|
14
|
+
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
_render() {
|
|
20
|
+
super._render();
|
|
21
|
+
|
|
22
|
+
this.$container.addClass('scrollbar-y-outside');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
_installScrollbars(options) {
|
|
26
|
+
return super._installScrollbars($.extend(true, {}, options, {scrollShadow: 'gradient'}));
|
|
27
|
+
}
|
|
28
|
+
}
|
package/src/tooltip/Tooltip.less
CHANGED
|
@@ -17,11 +17,6 @@
|
|
|
17
17
|
#scout.drop-shadow(@y: 4px, @blur: 6px, @alpha: 5%);
|
|
18
18
|
max-width: 300px;
|
|
19
19
|
white-space: normal;
|
|
20
|
-
|
|
21
|
-
&.has-menus {
|
|
22
|
-
padding-top: 6px;
|
|
23
|
-
padding-bottom: 6px;
|
|
24
|
-
}
|
|
25
20
|
}
|
|
26
21
|
|
|
27
22
|
.tooltip-content {
|
|
@@ -37,6 +32,7 @@
|
|
|
37
32
|
font-weight: @font-weight-bold;
|
|
38
33
|
padding-left: @context-menu-item-padding-left;
|
|
39
34
|
padding-right: @context-menu-item-padding-right;
|
|
35
|
+
padding-top: @tooltip-padding-y + 6px;
|
|
40
36
|
}
|
|
41
37
|
|
|
42
38
|
& .small {
|
|
@@ -53,6 +49,12 @@
|
|
|
53
49
|
|
|
54
50
|
.tooltip-menus {
|
|
55
51
|
position: relative;
|
|
52
|
+
background-color: inherit; // Necessary if arrow has a border
|
|
53
|
+
padding-bottom: 6px;
|
|
54
|
+
|
|
55
|
+
.no-text > & {
|
|
56
|
+
padding-top: 6px;
|
|
57
|
+
}
|
|
56
58
|
|
|
57
59
|
& > .menu-item {
|
|
58
60
|
display: flex;
|
|
@@ -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
|
|
@@ -8,27 +8,36 @@
|
|
|
8
8
|
* Contributors:
|
|
9
9
|
* BSI Business Systems Integration AG - initial API and implementation
|
|
10
10
|
*/
|
|
11
|
+
|
|
11
12
|
export default class LazyNodeFilter {
|
|
12
13
|
|
|
13
|
-
constructor(tree) {
|
|
14
|
+
constructor(tree) {
|
|
14
15
|
this.tree = tree;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
accept(node) {
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
if (node.expanded) {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
// not expanded: remove lazy expand marker (forget lazy expanded children)
|
|
23
|
+
node.childNodes.forEach(child => child._lazyNodeFilterAccepted = false);
|
|
24
|
+
|
|
25
|
+
if (!node.parentNode || !node.parentNode.expandedLazy || !node.parentNode.lazyExpandingEnabled || !this.tree.lazyExpandingEnabled) {
|
|
26
|
+
// no lazy expanding supported
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// if this node is not expanded and parent is lazyExpanding.
|
|
31
|
+
for (let i = 0; i < this.tree.selectedNodes.length; i++) {
|
|
32
|
+
let selectedNode = this.tree.selectedNodes[i];
|
|
33
|
+
if (typeof selectedNode === 'string') {
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
if (selectedNode == node) {
|
|
37
|
+
node._lazyNodeFilterAccepted = true;
|
|
38
|
+
return true;
|
|
29
39
|
}
|
|
30
|
-
return false;
|
|
31
40
|
}
|
|
32
|
-
return
|
|
41
|
+
return !!node._lazyNodeFilterAccepted;
|
|
33
42
|
}
|
|
34
43
|
}
|