@openui5/sap.tnt 1.115.1 → 1.116.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/.reuse/dep5 +0 -5
- package/THIRDPARTY.txt +1 -7
- package/package.json +3 -3
- package/src/sap/tnt/.library +1 -1
- package/src/sap/tnt/InfoLabel.js +1 -1
- package/src/sap/tnt/NavigationList.js +226 -4
- package/src/sap/tnt/NavigationListItem.js +47 -21
- package/src/sap/tnt/NavigationListRenderer.js +5 -1
- package/src/sap/tnt/SideNavigation.js +2 -143
- package/src/sap/tnt/SideNavigationRenderer.js +0 -16
- package/src/sap/tnt/ToolHeader.js +1 -2
- package/src/sap/tnt/ToolHeaderUtilitySeparator.js +1 -1
- package/src/sap/tnt/ToolPage.js +1 -1
- package/src/sap/tnt/ToolPageRenderer.js +6 -2
- package/src/sap/tnt/library.js +2 -2
- package/src/sap/tnt/messagebundle.properties +4 -1
- package/src/sap/tnt/messagebundle_ar.properties +2 -0
- package/src/sap/tnt/messagebundle_bg.properties +2 -0
- package/src/sap/tnt/messagebundle_ca.properties +2 -0
- package/src/sap/tnt/messagebundle_cs.properties +2 -0
- package/src/sap/tnt/messagebundle_cy.properties +2 -0
- package/src/sap/tnt/messagebundle_da.properties +2 -0
- package/src/sap/tnt/messagebundle_de.properties +2 -0
- package/src/sap/tnt/messagebundle_el.properties +2 -0
- package/src/sap/tnt/messagebundle_en.properties +2 -0
- package/src/sap/tnt/messagebundle_en_GB.properties +2 -0
- package/src/sap/tnt/messagebundle_en_US_sappsd.properties +2 -0
- package/src/sap/tnt/messagebundle_en_US_saprigi.properties +2 -0
- package/src/sap/tnt/messagebundle_en_US_saptrc.properties +2 -0
- package/src/sap/tnt/messagebundle_es.properties +2 -0
- package/src/sap/tnt/messagebundle_es_MX.properties +2 -0
- package/src/sap/tnt/messagebundle_et.properties +2 -0
- package/src/sap/tnt/messagebundle_fi.properties +3 -1
- package/src/sap/tnt/messagebundle_fr.properties +2 -0
- package/src/sap/tnt/messagebundle_fr_CA.properties +2 -0
- package/src/sap/tnt/messagebundle_hi.properties +2 -0
- package/src/sap/tnt/messagebundle_hr.properties +2 -0
- package/src/sap/tnt/messagebundle_hu.properties +2 -0
- package/src/sap/tnt/messagebundle_id.properties +2 -0
- package/src/sap/tnt/messagebundle_it.properties +2 -0
- package/src/sap/tnt/messagebundle_iw.properties +2 -0
- package/src/sap/tnt/messagebundle_ja.properties +2 -0
- package/src/sap/tnt/messagebundle_kk.properties +2 -0
- package/src/sap/tnt/messagebundle_ko.properties +2 -0
- package/src/sap/tnt/messagebundle_lt.properties +2 -0
- package/src/sap/tnt/messagebundle_lv.properties +2 -0
- package/src/sap/tnt/messagebundle_ms.properties +2 -0
- package/src/sap/tnt/messagebundle_nl.properties +2 -0
- package/src/sap/tnt/messagebundle_no.properties +2 -0
- package/src/sap/tnt/messagebundle_pl.properties +2 -0
- package/src/sap/tnt/messagebundle_pt.properties +2 -0
- package/src/sap/tnt/messagebundle_pt_PT.properties +2 -0
- package/src/sap/tnt/messagebundle_ro.properties +2 -0
- package/src/sap/tnt/messagebundle_ru.properties +2 -0
- package/src/sap/tnt/messagebundle_sh.properties +2 -0
- package/src/sap/tnt/messagebundle_sk.properties +2 -0
- package/src/sap/tnt/messagebundle_sl.properties +2 -0
- package/src/sap/tnt/messagebundle_sv.properties +2 -0
- package/src/sap/tnt/messagebundle_th.properties +2 -0
- package/src/sap/tnt/messagebundle_tr.properties +2 -0
- package/src/sap/tnt/messagebundle_uk.properties +2 -0
- package/src/sap/tnt/messagebundle_vi.properties +2 -0
- package/src/sap/tnt/messagebundle_zh_CN.properties +2 -0
- package/src/sap/tnt/messagebundle_zh_TW.properties +2 -0
- package/src/sap/tnt/themes/base/NavigationList.less +27 -1
- package/src/sap/tnt/themes/base/SideNavigation.less +13 -57
- package/src/sap/tnt/themes/base/ToolHeader.less +12 -5
- package/src/sap/tnt/themes/base/ToolPage.less +4 -2
package/.reuse/dep5
CHANGED
|
@@ -457,11 +457,6 @@ Comment: these files belong to: UI5 Web Components
|
|
|
457
457
|
|
|
458
458
|
# Outside of Libraries:
|
|
459
459
|
|
|
460
|
-
Files: src/testsuite-utils/src/main/resources/META-INF/less/less.js
|
|
461
|
-
Copyright: 2009-2014, Alexis Sellier <self@cloudhead.net>
|
|
462
|
-
License: Apache-2.0
|
|
463
|
-
Comment: these files belong to: LESS
|
|
464
|
-
|
|
465
460
|
Files: lib/jsdoc/ui5/plugin.js
|
|
466
461
|
Copyright:
|
|
467
462
|
2009-2023 SAP SE or an SAP affiliate company and OpenUI5 contributors
|
package/THIRDPARTY.txt
CHANGED
|
@@ -460,19 +460,13 @@ Contained in: src/sap.ui.webc.main/src/sap/ui/webc/main/thirdparty/*.*
|
|
|
460
460
|
|
|
461
461
|
Outside of Libraries:
|
|
462
462
|
|
|
463
|
-
Component: LESS, version: 1.6.3
|
|
464
|
-
Copyright: 2009-2014, Alexis Sellier <self@cloudhead.net>
|
|
465
|
-
License: Apache-2.0
|
|
466
|
-
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
|
|
467
|
-
Contained in: src/testsuite-utils/src/main/resources/META-INF/less/less.js
|
|
468
|
-
|
|
469
463
|
Component: JSDoc 3, version: 3.6.7
|
|
470
464
|
Copyright: 2011-present Michael Mathews micmath@gmail.com and the contributors to JSDoc
|
|
471
465
|
License: Apache-2.0
|
|
472
466
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
|
|
473
467
|
Contained in: lib/jsdoc/ui5/plugin.js
|
|
474
468
|
|
|
475
|
-
Component: SAP Theming Base Content, version: 11.
|
|
469
|
+
Component: SAP Theming Base Content, version: 11.4.2
|
|
476
470
|
Copyright: SAP SE or an SAP affiliate company and Theming Base Content contributors
|
|
477
471
|
License: Apache-2.0
|
|
478
472
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openui5/sap.tnt",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.116.0",
|
|
4
4
|
"description": "OpenUI5 UI Library sap.tnt",
|
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"url": "https://github.com/SAP/openui5.git"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@openui5/sap.m": "1.
|
|
18
|
-
"@openui5/sap.ui.core": "1.
|
|
17
|
+
"@openui5/sap.m": "1.116.0",
|
|
18
|
+
"@openui5/sap.ui.core": "1.116.0"
|
|
19
19
|
}
|
|
20
20
|
}
|
package/src/sap/tnt/.library
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<copyright>OpenUI5
|
|
7
7
|
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
8
8
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.</copyright>
|
|
9
|
-
<version>1.
|
|
9
|
+
<version>1.116.0</version>
|
|
10
10
|
|
|
11
11
|
<documentation>SAPUI5 library with responsive controls.</documentation>
|
|
12
12
|
|
package/src/sap/tnt/InfoLabel.js
CHANGED
|
@@ -8,23 +8,35 @@
|
|
|
8
8
|
sap.ui.define([
|
|
9
9
|
"sap/ui/thirdparty/jquery",
|
|
10
10
|
'./library',
|
|
11
|
+
'sap/ui/core/Core',
|
|
11
12
|
'sap/ui/core/Element',
|
|
12
13
|
'sap/ui/core/Control',
|
|
14
|
+
'sap/ui/core/ResizeHandler',
|
|
15
|
+
'sap/ui/core/Popup',
|
|
13
16
|
'sap/m/Popover',
|
|
14
17
|
'sap/ui/core/delegate/ItemNavigation',
|
|
15
18
|
'sap/ui/core/InvisibleText',
|
|
19
|
+
"./NavigationListItem",
|
|
16
20
|
"./NavigationListRenderer",
|
|
21
|
+
"sap/m/Menu",
|
|
22
|
+
"sap/m/MenuItem",
|
|
17
23
|
"sap/base/Log"
|
|
18
24
|
],
|
|
19
25
|
function(
|
|
20
26
|
jQuery,
|
|
21
27
|
library,
|
|
28
|
+
Core,
|
|
22
29
|
Element,
|
|
23
30
|
Control,
|
|
31
|
+
ResizeHandler,
|
|
32
|
+
Popup,
|
|
24
33
|
Popover,
|
|
25
34
|
ItemNavigation,
|
|
26
35
|
InvisibleText,
|
|
36
|
+
NavigationListItem,
|
|
27
37
|
NavigationListRenderer,
|
|
38
|
+
Menu,
|
|
39
|
+
MenuItem,
|
|
28
40
|
Log
|
|
29
41
|
) {
|
|
30
42
|
"use strict";
|
|
@@ -41,7 +53,7 @@ sap.ui.define([
|
|
|
41
53
|
* @extends sap.ui.core.Control
|
|
42
54
|
*
|
|
43
55
|
* @author SAP SE
|
|
44
|
-
* @version 1.
|
|
56
|
+
* @version 1.116.0
|
|
45
57
|
*
|
|
46
58
|
* @constructor
|
|
47
59
|
* @public
|
|
@@ -73,7 +85,12 @@ sap.ui.define([
|
|
|
73
85
|
/**
|
|
74
86
|
* The items displayed in the list.
|
|
75
87
|
*/
|
|
76
|
-
items: {type: "sap.tnt.NavigationListItem", multiple: true, singularName: "item"}
|
|
88
|
+
items: {type: "sap.tnt.NavigationListItem", multiple: true, singularName: "item"},
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* The overflow item.
|
|
92
|
+
*/
|
|
93
|
+
_overflowItem: {type: "sap.tnt.NavigationListItem", multiple: false, visibility: "hidden"}
|
|
77
94
|
},
|
|
78
95
|
associations: {
|
|
79
96
|
/**
|
|
@@ -132,6 +149,7 @@ sap.ui.define([
|
|
|
132
149
|
* Called before the control is rendered.
|
|
133
150
|
*/
|
|
134
151
|
NavigationList.prototype.onBeforeRendering = function () {
|
|
152
|
+
this._deregisterResizeHandler();
|
|
135
153
|
|
|
136
154
|
// make sure the initial selected item (if any) is correct
|
|
137
155
|
var selectedKey = this.getSelectedKey();
|
|
@@ -144,6 +162,198 @@ sap.ui.define([
|
|
|
144
162
|
NavigationList.prototype.onAfterRendering = function () {
|
|
145
163
|
this._itemNavigation.setRootDomRef(this.getDomRef());
|
|
146
164
|
this._itemNavigation.setItemDomRefs(this._getDomRefs());
|
|
165
|
+
|
|
166
|
+
if (this.getExpanded()) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// clear the vertical scroll when collapsed
|
|
171
|
+
this.getDomRef().scrollTop = 0;
|
|
172
|
+
this._resizeListenerId = ResizeHandler.register(this.getDomRef().parentNode, this._resize.bind(this));
|
|
173
|
+
|
|
174
|
+
if (Core.isThemeApplied()) {
|
|
175
|
+
this._updateOverflowItems();
|
|
176
|
+
} else {
|
|
177
|
+
Core.attachThemeChanged(this._handleThemeLoad, this);
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
NavigationList.prototype._deregisterResizeHandler = function () {
|
|
182
|
+
if (this._resizeListenerId) {
|
|
183
|
+
ResizeHandler.deregister(this._resizeListenerId);
|
|
184
|
+
this._resizeListenerId = null;
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
NavigationList.prototype._handleThemeLoad = function () {
|
|
189
|
+
this._updateOverflowItems();
|
|
190
|
+
Core.detachThemeChanged(this._handleThemeLoad, this);
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
NavigationList.prototype._resize = function () {
|
|
194
|
+
this._updateOverflowItems();
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
NavigationList.prototype._updateOverflowItems = function () {
|
|
198
|
+
var domRef = this.getDomRef(),
|
|
199
|
+
computedStyle,
|
|
200
|
+
items,
|
|
201
|
+
overflowItem,
|
|
202
|
+
selectedItem,
|
|
203
|
+
listHeight,
|
|
204
|
+
itemsHeight = 0;
|
|
205
|
+
|
|
206
|
+
if (this.getExpanded() || !domRef) {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
items = domRef.querySelectorAll("li:not(.sapTnTNavLIOverflow)");
|
|
211
|
+
overflowItem = domRef.querySelector(".sapTnTNavLIOverflow");
|
|
212
|
+
|
|
213
|
+
if (!overflowItem) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
overflowItem.classList.add("sapTnTNavLIHiddenItem");
|
|
218
|
+
|
|
219
|
+
items.forEach(function (item) {
|
|
220
|
+
item.classList.remove("sapTnTNavLIHiddenItem");
|
|
221
|
+
itemsHeight += item.offsetHeight;
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
computedStyle = window.getComputedStyle(domRef);
|
|
225
|
+
listHeight = domRef.offsetHeight - parseFloat(computedStyle.paddingTop) - parseFloat(computedStyle.paddingBottom);
|
|
226
|
+
|
|
227
|
+
if (listHeight >= itemsHeight) {
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
overflowItem.classList.remove("sapTnTNavLIHiddenItem");
|
|
232
|
+
itemsHeight = overflowItem.offsetHeight;
|
|
233
|
+
|
|
234
|
+
selectedItem = domRef.querySelector(".sapTntNavLIItemSelected");
|
|
235
|
+
if (selectedItem) {
|
|
236
|
+
selectedItem = selectedItem.parentNode;
|
|
237
|
+
itemsHeight += selectedItem.offsetHeight;
|
|
238
|
+
computedStyle = window.getComputedStyle(selectedItem);
|
|
239
|
+
itemsHeight += parseFloat(computedStyle.marginTop) + parseFloat(computedStyle.marginBottom);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
items.forEach(function (item) {
|
|
243
|
+
if (item === selectedItem) {
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
itemsHeight += item.offsetHeight;
|
|
248
|
+
computedStyle = window.getComputedStyle(item);
|
|
249
|
+
itemsHeight += parseFloat(computedStyle.marginTop) + parseFloat(computedStyle.marginBottom);
|
|
250
|
+
|
|
251
|
+
if (itemsHeight >= listHeight) {
|
|
252
|
+
item.classList.add("sapTnTNavLIHiddenItem");
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
NavigationList.prototype._getOverflowItem = function () {
|
|
258
|
+
var overflowItem = this.getAggregation("_overflowItem");
|
|
259
|
+
if (!overflowItem) {
|
|
260
|
+
overflowItem = new NavigationListItem({
|
|
261
|
+
text: Core.getLibraryResourceBundle("sap.tnt").getText("NAVIGATION_LIST_NAVIGATION_OVERFLOW"),
|
|
262
|
+
icon: "sap-icon://overflow",
|
|
263
|
+
selectable: false,
|
|
264
|
+
select: this._overflowPress.bind(this)
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
overflowItem._isOverflow = true;
|
|
268
|
+
|
|
269
|
+
this.setAggregation("_overflowItem", overflowItem);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
return overflowItem;
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
NavigationList.prototype._overflowPress = function (event) {
|
|
276
|
+
var menu = this._createOverflowMenu();
|
|
277
|
+
menu.openBy(event.getSource(), false, Popup.Dock.EndCenter);
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
NavigationList.prototype._createOverflowMenu = function () {
|
|
281
|
+
var menu = new Menu({
|
|
282
|
+
items: this._createNavigationMenuItems(),
|
|
283
|
+
itemSelected: function (event) {
|
|
284
|
+
var selectedItem = event.getParameter("item"),
|
|
285
|
+
selectedItemDomRef;
|
|
286
|
+
|
|
287
|
+
this._selectItem({
|
|
288
|
+
item: selectedItem._navItem
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
selectedItemDomRef = this.getDomRef().querySelector(".sapTntNavLIItemSelected");
|
|
292
|
+
|
|
293
|
+
if (selectedItemDomRef) {
|
|
294
|
+
selectedItemDomRef.parentNode.focus();
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
menu.close();
|
|
298
|
+
menu.destroy();
|
|
299
|
+
}.bind(this)
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
menu.addStyleClass("sapTntNavLIMenu");
|
|
303
|
+
|
|
304
|
+
// override this method, so we can have a selection
|
|
305
|
+
// on a menu item with subitems
|
|
306
|
+
menu._handleMenuItemSelect = function(oEvent) {
|
|
307
|
+
var oUnfdItem = oEvent.getParameter("item"),
|
|
308
|
+
oMenuItem;
|
|
309
|
+
|
|
310
|
+
if (!oUnfdItem) {
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
oMenuItem = this._findMenuItemByUnfdMenuItem(oUnfdItem);
|
|
315
|
+
|
|
316
|
+
if (oMenuItem) {
|
|
317
|
+
this.fireItemSelected({item: oMenuItem});
|
|
318
|
+
}
|
|
319
|
+
}.bind(menu);
|
|
320
|
+
|
|
321
|
+
this.addDependent(menu);
|
|
322
|
+
|
|
323
|
+
return menu;
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
NavigationList.prototype._createNavigationMenuItems = function () {
|
|
327
|
+
var items = this.getItems(),
|
|
328
|
+
menuItems = [];
|
|
329
|
+
|
|
330
|
+
items.forEach(function (item) {
|
|
331
|
+
if (!item.getVisible() || !item.getDomRef().classList.contains("sapTnTNavLIHiddenItem")) {
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
var menuItem = new MenuItem({
|
|
336
|
+
icon: item.getIcon(),
|
|
337
|
+
text: item.getText(),
|
|
338
|
+
enabled: item.getEnabled()
|
|
339
|
+
});
|
|
340
|
+
menuItem._navItem = item;
|
|
341
|
+
|
|
342
|
+
item.getItems().forEach(function (subItem) {
|
|
343
|
+
var subMenuItem = new MenuItem({
|
|
344
|
+
icon: subItem.getIcon(),
|
|
345
|
+
text: subItem.getText(),
|
|
346
|
+
enabled: subItem.getEnabled()
|
|
347
|
+
});
|
|
348
|
+
subMenuItem._navItem = subItem;
|
|
349
|
+
|
|
350
|
+
menuItem.addItem(subMenuItem);
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
menuItems.push(menuItem);
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
return menuItems;
|
|
147
357
|
};
|
|
148
358
|
|
|
149
359
|
NavigationList.prototype._updateNavItems = function () {
|
|
@@ -155,10 +365,10 @@ sap.ui.define([
|
|
|
155
365
|
* @private
|
|
156
366
|
*/
|
|
157
367
|
NavigationList.prototype._getDomRefs = function () {
|
|
158
|
-
|
|
159
368
|
var domRefs = [],
|
|
160
369
|
items = this.getItems(),
|
|
161
|
-
isExpanded = this.getExpanded()
|
|
370
|
+
isExpanded = this.getExpanded(),
|
|
371
|
+
overflowItemDomRef = this.getAggregation("_overflowItem").getDomRef();
|
|
162
372
|
|
|
163
373
|
for (var i = 0; i < items.length; i++) {
|
|
164
374
|
if (isExpanded) {
|
|
@@ -168,6 +378,10 @@ sap.ui.define([
|
|
|
168
378
|
}
|
|
169
379
|
}
|
|
170
380
|
|
|
381
|
+
if (!isExpanded && overflowItemDomRef) {
|
|
382
|
+
domRefs.push(overflowItemDomRef);
|
|
383
|
+
}
|
|
384
|
+
|
|
171
385
|
return domRefs;
|
|
172
386
|
};
|
|
173
387
|
|
|
@@ -212,6 +426,8 @@ sap.ui.define([
|
|
|
212
426
|
if (this._popover) {
|
|
213
427
|
this._popover.destroy();
|
|
214
428
|
}
|
|
429
|
+
|
|
430
|
+
this._deregisterResizeHandler();
|
|
215
431
|
};
|
|
216
432
|
|
|
217
433
|
/**
|
|
@@ -307,6 +523,9 @@ sap.ui.define([
|
|
|
307
523
|
if (typeof selectedItem !== 'string' && !isNavigationListItem) {
|
|
308
524
|
Log.warning('Type of selectedItem association should be string or instance of sap.tnt.NavigationListItem. New value was not set.');
|
|
309
525
|
this.setAssociation('selectedItem', null, true);
|
|
526
|
+
|
|
527
|
+
this._updateOverflowItems();
|
|
528
|
+
|
|
310
529
|
return this;
|
|
311
530
|
}
|
|
312
531
|
|
|
@@ -324,6 +543,9 @@ sap.ui.define([
|
|
|
324
543
|
if (navigationListItem) {
|
|
325
544
|
navigationListItem._select();
|
|
326
545
|
this._selectedItem = navigationListItem;
|
|
546
|
+
|
|
547
|
+
this._updateOverflowItems();
|
|
548
|
+
|
|
327
549
|
return this;
|
|
328
550
|
}
|
|
329
551
|
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
// Provides control sap.tnt.NavigationListItem.
|
|
8
8
|
sap.ui.define(["sap/ui/thirdparty/jquery", "./library", 'sap/ui/core/Core', "sap/ui/core/Item", 'sap/ui/core/Icon',
|
|
9
|
-
'
|
|
9
|
+
'sap/ui/core/InvisibleText', 'sap/ui/core/Renderer', 'sap/ui/core/IconPool', "sap/ui/events/KeyCodes", "sap/ui/core/library",
|
|
10
10
|
// jQuery Plugin "addAriaLabelledBy"
|
|
11
11
|
"sap/ui/util/openWindow", "sap/ui/util/defaultLinkTypes", "sap/ui/dom/jquery/Aria"],
|
|
12
12
|
function(jQuery, library, Core, Item, Icon,
|
|
13
|
-
|
|
13
|
+
InvisibleText, Renderer, IconPool, KeyCodes, coreLibrary, openWindow, defaultLinkTypes) {
|
|
14
14
|
"use strict";
|
|
15
15
|
|
|
16
16
|
|
|
@@ -32,7 +32,7 @@ sap.ui.define(["sap/ui/thirdparty/jquery", "./library", 'sap/ui/core/Core', "sap
|
|
|
32
32
|
* @extends sap.ui.core.Item
|
|
33
33
|
*
|
|
34
34
|
* @author SAP SE
|
|
35
|
-
* @version 1.
|
|
35
|
+
* @version 1.116.0
|
|
36
36
|
*
|
|
37
37
|
* @constructor
|
|
38
38
|
* @public
|
|
@@ -64,6 +64,15 @@ sap.ui.define(["sap/ui/thirdparty/jquery", "./library", 'sap/ui/core/Core', "sap
|
|
|
64
64
|
*/
|
|
65
65
|
visible : {type : "boolean", group : "Appearance", defaultValue : true},
|
|
66
66
|
|
|
67
|
+
/**
|
|
68
|
+
* Specifies if the item can be selected.
|
|
69
|
+
*
|
|
70
|
+
* @since 1.116
|
|
71
|
+
* @experimental Since 1.116. Disclaimer: this property is in a beta state
|
|
72
|
+
* - incompatible API changes may be done before its official public release.
|
|
73
|
+
*/
|
|
74
|
+
selectable : {type : "boolean", group : "Behavior", defaultValue : true},
|
|
75
|
+
|
|
67
76
|
/**
|
|
68
77
|
* Defines the link target URI. Supports standard hyperlink behavior. If a JavaScript action should be triggered,
|
|
69
78
|
* this should not be set, but instead an event handler for the <code>select</code> event should be registered.
|
|
@@ -244,7 +253,6 @@ sap.ui.define(["sap/ui/thirdparty/jquery", "./library", 'sap/ui/core/Core', "sap
|
|
|
244
253
|
* @private
|
|
245
254
|
*/
|
|
246
255
|
NavigationListItem.prototype.createPopupList = function () {
|
|
247
|
-
|
|
248
256
|
var newSubItems = [],
|
|
249
257
|
list = this.getNavigationList(),
|
|
250
258
|
selectedItem = list.getSelectedItem(),
|
|
@@ -263,6 +271,7 @@ sap.ui.define(["sap/ui/thirdparty/jquery", "./library", 'sap/ui/core/Core', "sap
|
|
|
263
271
|
text: subItem.getText(),
|
|
264
272
|
textDirection: subItem.getTextDirection(),
|
|
265
273
|
enabled: subItem.getEnabled(),
|
|
274
|
+
selectable: subItem.getSelectable(),
|
|
266
275
|
href: subItem.getHref(),
|
|
267
276
|
target: subItem.getTarget(),
|
|
268
277
|
tooltip: subItem.getTooltip()
|
|
@@ -280,6 +289,7 @@ sap.ui.define(["sap/ui/thirdparty/jquery", "./library", 'sap/ui/core/Core', "sap
|
|
|
280
289
|
var newGroup = new NavigationListItem({
|
|
281
290
|
expanded: true,
|
|
282
291
|
hasExpander: false,
|
|
292
|
+
selectable: this.getSelectable(),
|
|
283
293
|
key: this.getId(),
|
|
284
294
|
text: this.getText(),
|
|
285
295
|
enabled: this.getEnabled(),
|
|
@@ -290,7 +300,9 @@ sap.ui.define(["sap/ui/thirdparty/jquery", "./library", 'sap/ui/core/Core', "sap
|
|
|
290
300
|
items: newSubItems
|
|
291
301
|
});
|
|
292
302
|
|
|
293
|
-
var
|
|
303
|
+
var navigationListClass = list.getMetadata().getClass().prototype.constructor;
|
|
304
|
+
|
|
305
|
+
var navList = new navigationListClass({
|
|
294
306
|
itemSelect: this.onPopupItemSelect.bind(this),
|
|
295
307
|
items: [
|
|
296
308
|
newGroup
|
|
@@ -335,7 +347,9 @@ sap.ui.define(["sap/ui/thirdparty/jquery", "./library", 'sap/ui/core/Core', "sap
|
|
|
335
347
|
|
|
336
348
|
this.fireSelect(params);
|
|
337
349
|
|
|
338
|
-
|
|
350
|
+
if (this.getSelectable()) {
|
|
351
|
+
navList._selectItem(params);
|
|
352
|
+
}
|
|
339
353
|
|
|
340
354
|
this._openUrl();
|
|
341
355
|
};
|
|
@@ -533,11 +547,11 @@ sap.ui.define(["sap/ui/thirdparty/jquery", "./library", 'sap/ui/core/Core', "sap
|
|
|
533
547
|
text = this.getText(),
|
|
534
548
|
href = this.getHref(),
|
|
535
549
|
target = this.getTarget(),
|
|
550
|
+
selectable = this.getSelectable(),
|
|
536
551
|
tooltip,
|
|
537
552
|
ariaProps = {
|
|
538
553
|
level: '1',
|
|
539
554
|
role: 'treeitem',
|
|
540
|
-
selected: false,
|
|
541
555
|
roledescription: this._resourceBundleTNTLib.getText("NAVIGATION_LIST_ITEM_ROLE_DESCRIPTION_TREE_ITEM")
|
|
542
556
|
},
|
|
543
557
|
expanderVisible = this.getItems().length > 0 && this.getHasExpander();
|
|
@@ -551,10 +565,13 @@ sap.ui.define(["sap/ui/thirdparty/jquery", "./library", 'sap/ui/core/Core', "sap
|
|
|
551
565
|
rm.class("sapTntNavLIItem");
|
|
552
566
|
rm.class("sapTntNavLIGroup");
|
|
553
567
|
|
|
554
|
-
if (
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
568
|
+
if (selectable) {
|
|
569
|
+
if (control._selectedItem === this) {
|
|
570
|
+
ariaProps.selected = true;
|
|
571
|
+
rm.class("sapTntNavLIItemSelected");
|
|
572
|
+
} else {
|
|
573
|
+
ariaProps.selected = false;
|
|
574
|
+
}
|
|
558
575
|
}
|
|
559
576
|
|
|
560
577
|
if (!this.getEnabled()) {
|
|
@@ -639,9 +656,9 @@ sap.ui.define(["sap/ui/thirdparty/jquery", "./library", 'sap/ui/core/Core', "sap
|
|
|
639
656
|
expanded = this.getExpanded(),
|
|
640
657
|
isListExpanded = this._isListExpanded(),
|
|
641
658
|
tooltip,
|
|
659
|
+
selectable = this.getSelectable(),
|
|
642
660
|
ariaProps = {
|
|
643
|
-
role: 'menuitemradio',
|
|
644
|
-
checked: false,
|
|
661
|
+
role: selectable ? 'menuitemradio' : 'menuitem',
|
|
645
662
|
roledescription: this._resourceBundleTNTLib.getText("NAVIGATION_LIST_ITEM_ROLE_DESCRIPTION_MENUITEM")
|
|
646
663
|
};
|
|
647
664
|
|
|
@@ -666,8 +683,15 @@ sap.ui.define(["sap/ui/thirdparty/jquery", "./library", 'sap/ui/core/Core', "sap
|
|
|
666
683
|
ariaProps.haspopup = "tree";
|
|
667
684
|
}
|
|
668
685
|
|
|
669
|
-
if (
|
|
670
|
-
|
|
686
|
+
if (this._isOverflow) {
|
|
687
|
+
rm.class("sapTnTNavLIOverflow");
|
|
688
|
+
rm.class("sapTnTNavLIHiddenItem");
|
|
689
|
+
rm.attr("tabindex", "-1");
|
|
690
|
+
ariaProps.haspopup = "menu";
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
if (selectable) {
|
|
694
|
+
ariaProps.checked = control._selectedItem === this;
|
|
671
695
|
}
|
|
672
696
|
|
|
673
697
|
// ARIA
|
|
@@ -710,14 +734,13 @@ sap.ui.define(["sap/ui/thirdparty/jquery", "./library", 'sap/ui/core/Core', "sap
|
|
|
710
734
|
* @private
|
|
711
735
|
*/
|
|
712
736
|
NavigationListItem.prototype.renderSecondLevelNavItem = function (rm, control) {
|
|
713
|
-
|
|
714
737
|
var group = this.getParent(),
|
|
715
738
|
href = this.getHref(),
|
|
716
739
|
target = this.getTarget(),
|
|
740
|
+
selectable = this.getSelectable(),
|
|
717
741
|
ariaProps = {
|
|
718
742
|
role: 'treeitem',
|
|
719
743
|
level: '2',
|
|
720
|
-
selected: false,
|
|
721
744
|
roledescription: this._resourceBundleTNTLib.getText("NAVIGATION_LIST_ITEM_ROLE_DESCRIPTION_TREE_ITEM")
|
|
722
745
|
};
|
|
723
746
|
|
|
@@ -725,10 +748,13 @@ sap.ui.define(["sap/ui/thirdparty/jquery", "./library", 'sap/ui/core/Core', "sap
|
|
|
725
748
|
rm.class("sapTntNavLIItem");
|
|
726
749
|
rm.class("sapTntNavLIGroupItem");
|
|
727
750
|
|
|
728
|
-
if (
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
751
|
+
if (selectable) {
|
|
752
|
+
if (control._selectedItem === this) {
|
|
753
|
+
ariaProps.selected = true;
|
|
754
|
+
rm.class("sapTntNavLIItemSelected");
|
|
755
|
+
} else {
|
|
756
|
+
ariaProps.selected = false;
|
|
757
|
+
}
|
|
732
758
|
}
|
|
733
759
|
|
|
734
760
|
if (!this.getEnabled() || !group.getEnabled()) {
|
|
@@ -33,7 +33,8 @@ sap.ui.define([
|
|
|
33
33
|
groups = control.getItems(),
|
|
34
34
|
expanded = control.getExpanded(),
|
|
35
35
|
visibleGroups = [],
|
|
36
|
-
hasGroupWithIcon = false
|
|
36
|
+
hasGroupWithIcon = false,
|
|
37
|
+
overflowItem = control._getOverflowItem();
|
|
37
38
|
|
|
38
39
|
//Checking which groups should render
|
|
39
40
|
groups.forEach(function (group) {
|
|
@@ -81,6 +82,9 @@ sap.ui.define([
|
|
|
81
82
|
group.render(rm, control);
|
|
82
83
|
});
|
|
83
84
|
|
|
85
|
+
if (!expanded) {
|
|
86
|
+
overflowItem.render(rm, control);
|
|
87
|
+
}
|
|
84
88
|
|
|
85
89
|
rm.close("ul");
|
|
86
90
|
};
|