@openui5/sap.tnt 1.136.1 → 1.138.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.toml +0 -28
- package/THIRDPARTY.txt +1 -25
- 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 +90 -80
- package/src/sap/tnt/NavigationListGroup.js +15 -22
- package/src/sap/tnt/NavigationListItem.js +36 -45
- package/src/sap/tnt/NavigationListItemBase.js +109 -65
- package/src/sap/tnt/NavigationListMenuItem.js +52 -157
- package/src/sap/tnt/NavigationListMenuItemRenderer.js +121 -0
- package/src/sap/tnt/NavigationListRenderer.js +7 -1
- package/src/sap/tnt/SideNavigation.js +32 -6
- package/src/sap/tnt/ToolHeader.js +1 -1
- package/src/sap/tnt/ToolHeaderUtilitySeparator.js +1 -1
- package/src/sap/tnt/ToolPage.js +1 -1
- package/src/sap/tnt/library.js +2 -2
- package/src/sap/tnt/messagebundle.properties +14 -2
- package/src/sap/tnt/messagebundle_ar.properties +8 -0
- package/src/sap/tnt/messagebundle_bg.properties +8 -0
- package/src/sap/tnt/messagebundle_ca.properties +8 -0
- package/src/sap/tnt/messagebundle_cnr.properties +8 -0
- package/src/sap/tnt/messagebundle_cs.properties +8 -0
- package/src/sap/tnt/messagebundle_cy.properties +8 -0
- package/src/sap/tnt/messagebundle_da.properties +8 -0
- package/src/sap/tnt/messagebundle_de.properties +8 -0
- package/src/sap/tnt/messagebundle_el.properties +8 -0
- package/src/sap/tnt/messagebundle_en.properties +8 -0
- package/src/sap/tnt/messagebundle_en_GB.properties +8 -0
- package/src/sap/tnt/messagebundle_en_US_saprigi.properties +8 -0
- package/src/sap/tnt/messagebundle_es.properties +8 -0
- package/src/sap/tnt/messagebundle_es_MX.properties +8 -0
- package/src/sap/tnt/messagebundle_et.properties +8 -0
- package/src/sap/tnt/messagebundle_fi.properties +8 -0
- package/src/sap/tnt/messagebundle_fr.properties +8 -0
- package/src/sap/tnt/messagebundle_fr_CA.properties +8 -0
- package/src/sap/tnt/messagebundle_hi.properties +8 -0
- package/src/sap/tnt/messagebundle_hr.properties +8 -0
- package/src/sap/tnt/messagebundle_hu.properties +8 -0
- package/src/sap/tnt/messagebundle_id.properties +8 -0
- package/src/sap/tnt/messagebundle_it.properties +8 -0
- package/src/sap/tnt/messagebundle_iw.properties +8 -0
- package/src/sap/tnt/messagebundle_ja.properties +8 -0
- package/src/sap/tnt/messagebundle_kk.properties +8 -0
- package/src/sap/tnt/messagebundle_ko.properties +8 -0
- package/src/sap/tnt/messagebundle_lt.properties +8 -0
- package/src/sap/tnt/messagebundle_lv.properties +8 -0
- package/src/sap/tnt/messagebundle_mk.properties +10 -2
- package/src/sap/tnt/messagebundle_ms.properties +8 -0
- package/src/sap/tnt/messagebundle_nl.properties +8 -0
- package/src/sap/tnt/messagebundle_no.properties +8 -0
- package/src/sap/tnt/messagebundle_pl.properties +8 -0
- package/src/sap/tnt/messagebundle_pt.properties +8 -0
- package/src/sap/tnt/messagebundle_pt_PT.properties +8 -0
- package/src/sap/tnt/messagebundle_ro.properties +8 -0
- package/src/sap/tnt/messagebundle_ru.properties +8 -0
- package/src/sap/tnt/messagebundle_sh.properties +8 -0
- package/src/sap/tnt/messagebundle_sk.properties +8 -0
- package/src/sap/tnt/messagebundle_sl.properties +8 -0
- package/src/sap/tnt/messagebundle_sr.properties +8 -0
- package/src/sap/tnt/messagebundle_sv.properties +8 -0
- package/src/sap/tnt/messagebundle_th.properties +8 -0
- package/src/sap/tnt/messagebundle_tr.properties +8 -0
- package/src/sap/tnt/messagebundle_uk.properties +8 -0
- package/src/sap/tnt/messagebundle_vi.properties +8 -0
- package/src/sap/tnt/messagebundle_zh_CN.properties +8 -0
- package/src/sap/tnt/messagebundle_zh_TW.properties +8 -0
- package/src/sap/tnt/themes/base/NavigationList.less +51 -48
- package/src/sap/tnt/themes/base/fonts/SAP-icons-TNT.json +9 -1
- package/src/sap/tnt/themes/base/fonts/SAP-icons-TNT.woff2 +0 -0
- package/src/sap/tnt/themes/base/fonts/horizon/SAP-icons-TNT.woff2 +0 -0
- package/src/sap/tnt/themes/sap_hcb/base_NavigationList.less +52 -87
|
@@ -12,6 +12,7 @@ sap.ui.define([
|
|
|
12
12
|
"sap/ui/core/Renderer",
|
|
13
13
|
"sap/ui/core/IconPool",
|
|
14
14
|
"sap/ui/core/library",
|
|
15
|
+
"sap/ui/core/Lib",
|
|
15
16
|
"sap/ui/events/KeyCodes",
|
|
16
17
|
"sap/ui/util/openWindow",
|
|
17
18
|
"sap/ui/util/defaultLinkTypes",
|
|
@@ -23,6 +24,7 @@ sap.ui.define([
|
|
|
23
24
|
Renderer,
|
|
24
25
|
IconPool,
|
|
25
26
|
coreLibrary,
|
|
27
|
+
Lib,
|
|
26
28
|
KeyCodes,
|
|
27
29
|
openWindow,
|
|
28
30
|
defaultLinkTypes,
|
|
@@ -57,7 +59,7 @@ sap.ui.define([
|
|
|
57
59
|
* @extends sap.tnt.NavigationListItemBase
|
|
58
60
|
*
|
|
59
61
|
* @author SAP SE
|
|
60
|
-
* @version 1.
|
|
62
|
+
* @version 1.138.0
|
|
61
63
|
*
|
|
62
64
|
* @constructor
|
|
63
65
|
* @public
|
|
@@ -90,7 +92,7 @@ sap.ui.define([
|
|
|
90
92
|
*
|
|
91
93
|
* <b>Guidelines:</b>
|
|
92
94
|
* <ul>
|
|
93
|
-
* <li>
|
|
95
|
+
* <li>Items that have a set href and target set to <code>_blank</code> should not be selectable.</li>
|
|
94
96
|
* <li>Items that trigger actions (with design "Action") should not be selectable.</li>
|
|
95
97
|
* </ul>
|
|
96
98
|
*
|
|
@@ -103,6 +105,7 @@ sap.ui.define([
|
|
|
103
105
|
/**
|
|
104
106
|
* Defines the link target URI. Supports standard hyperlink behavior. If a JavaScript action should be triggered,
|
|
105
107
|
* this should not be set, but instead an event handler for the <code>select</code> event should be registered.
|
|
108
|
+
*
|
|
106
109
|
*/
|
|
107
110
|
href: { type: "sap.ui.core.URI", group: "Data", defaultValue: null },
|
|
108
111
|
|
|
@@ -111,7 +114,14 @@ sap.ui.define([
|
|
|
111
114
|
*
|
|
112
115
|
* Options are the standard values for window.open() supported by browsers:
|
|
113
116
|
* <code>_self</code>, <code>_top</code>, <code>_blank</code>, <code>_parent</code>, <code>_search</code>.
|
|
114
|
-
* Alternatively, a frame name can be entered.
|
|
117
|
+
* Alternatively, a frame name can be entered.
|
|
118
|
+
*
|
|
119
|
+
* <b>Guidelines:</b>
|
|
120
|
+
* <ul>
|
|
121
|
+
* <li>Use only when <code>href</code> property is set.</li>
|
|
122
|
+
* <li>Items that have a set href and target set to <code>_blank</code> should not have children</li>
|
|
123
|
+
* <li>Items that have a set href, should not use target for internal navigation/li>
|
|
124
|
+
* </ul>
|
|
115
125
|
*/
|
|
116
126
|
target: { type: "string", group: "Behavior", defaultValue: null },
|
|
117
127
|
|
|
@@ -157,10 +167,12 @@ sap.ui.define([
|
|
|
157
167
|
NavigationListItem._getInvisibleText = function () {
|
|
158
168
|
if (!this._invisibleText) {
|
|
159
169
|
this._invisibleText = new InvisibleText().toStatic();
|
|
170
|
+
this._invisibleText.setText(Lib.getResourceBundleFor("sap.tnt").getText("NAVIGATION_LIST_EXTERNAL_LINK_DESCRIPTION"));
|
|
160
171
|
}
|
|
161
172
|
return this._invisibleText;
|
|
162
173
|
};
|
|
163
174
|
|
|
175
|
+
|
|
164
176
|
/**
|
|
165
177
|
* Creates a popup list.
|
|
166
178
|
*
|
|
@@ -249,7 +261,9 @@ sap.ui.define([
|
|
|
249
261
|
const oItemInPopup = oEvent.getParameter("item"),
|
|
250
262
|
oRealItem = Element.getElementById(oItemInPopup.getKey());
|
|
251
263
|
|
|
252
|
-
oRealItem._firePress(
|
|
264
|
+
if (!oRealItem._firePress(oEvent, oRealItem)) {
|
|
265
|
+
oEvent.preventDefault();
|
|
266
|
+
}
|
|
253
267
|
};
|
|
254
268
|
|
|
255
269
|
/**
|
|
@@ -284,16 +298,6 @@ sap.ui.define([
|
|
|
284
298
|
}
|
|
285
299
|
};
|
|
286
300
|
|
|
287
|
-
/**
|
|
288
|
-
* Gets DOM reference of the accessibility element.
|
|
289
|
-
*
|
|
290
|
-
* @private
|
|
291
|
-
* @returns {HTMLElement} dom ref
|
|
292
|
-
*/
|
|
293
|
-
NavigationListItem.prototype._getAccessibilityRef = function () {
|
|
294
|
-
return this.getDomRef().querySelector(".sapTntNLIFirstLevel");
|
|
295
|
-
};
|
|
296
|
-
|
|
297
301
|
/**
|
|
298
302
|
* Handles tap event.
|
|
299
303
|
*
|
|
@@ -331,18 +335,8 @@ sap.ui.define([
|
|
|
331
335
|
return;
|
|
332
336
|
}
|
|
333
337
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
if ((oEvent.key ? oEvent.key === "Enter" : oEvent.keyCode === KeyCodes.ENTER) && !bHasModifierKey) {
|
|
337
|
-
this.getDomRef().classList.add("sapTntNLIActive");
|
|
338
|
+
if ((oEvent.key ? oEvent.key === "Enter" : oEvent.keyCode === KeyCodes.ENTER) ) {
|
|
338
339
|
this.ontap(oEvent);
|
|
339
|
-
} else if ((oEvent.key ? oEvent.key === " " : oEvent.keyCode === KeyCodes.SPACE) && !bHasModifierKey) {
|
|
340
|
-
this.getDomRef().classList.add("sapTntNLIActive");
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
//onkeyup is not called when new page is opened
|
|
344
|
-
if (this.getHref() && this.getTarget() === "_blank") {
|
|
345
|
-
this.getDomRef().classList.remove("sapTntNLIActive");
|
|
346
340
|
}
|
|
347
341
|
|
|
348
342
|
NavigationListItemBase.prototype.onkeydown.apply(this, arguments);
|
|
@@ -353,16 +347,8 @@ sap.ui.define([
|
|
|
353
347
|
return;
|
|
354
348
|
}
|
|
355
349
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
if ((oEvent.key ? oEvent.key === "Enter" : oEvent.keyCode === KeyCodes.ENTER) && !bHasModifierKey) {
|
|
359
|
-
this.getDomRef().classList.remove("sapTntNLIActive");
|
|
360
|
-
} else if ((oEvent.key ? oEvent.key === " " : oEvent.keyCode === KeyCodes.SPACE)) {
|
|
361
|
-
this.getDomRef().classList.remove("sapTntNLIActive");
|
|
362
|
-
|
|
363
|
-
if (!bHasModifierKey) {
|
|
364
|
-
this.ontap(oEvent);
|
|
365
|
-
}
|
|
350
|
+
if ((oEvent.key ? oEvent.key === " " : oEvent.keyCode === KeyCodes.SPACE)) {
|
|
351
|
+
this.ontap(oEvent);
|
|
366
352
|
}
|
|
367
353
|
|
|
368
354
|
if (oEvent.srcControl.getLevel() === 1) {
|
|
@@ -405,6 +391,7 @@ sap.ui.define([
|
|
|
405
391
|
oRM.openStart("li", this)
|
|
406
392
|
.attr("role", "none");
|
|
407
393
|
|
|
394
|
+
|
|
408
395
|
if (!bListExpanded) {
|
|
409
396
|
if (aItems.length && bEnabled) {
|
|
410
397
|
oRM.class("sapTntNLINotExpandedTriangle");
|
|
@@ -429,7 +416,7 @@ sap.ui.define([
|
|
|
429
416
|
label: this.getText()
|
|
430
417
|
});
|
|
431
418
|
|
|
432
|
-
if (!this.getExpanded()) {
|
|
419
|
+
if (!this.getExpanded() && !this._animateCollapse || this._animateExpand) {
|
|
433
420
|
oRM.class("sapTntNLIItemsContainerHidden");
|
|
434
421
|
}
|
|
435
422
|
|
|
@@ -486,7 +473,7 @@ sap.ui.define([
|
|
|
486
473
|
bSelected = true;
|
|
487
474
|
}
|
|
488
475
|
|
|
489
|
-
if (!bListExpanded && aItems.includes(oNavigationList._selectedItem)) {
|
|
476
|
+
if ((!bListExpanded || !bExpanded) && aItems.includes(oNavigationList._selectedItem)) {
|
|
490
477
|
oRM.class("sapTntNLISelected");
|
|
491
478
|
bSelected = true;
|
|
492
479
|
}
|
|
@@ -526,6 +513,7 @@ sap.ui.define([
|
|
|
526
513
|
|
|
527
514
|
if (this._isOverflow) {
|
|
528
515
|
oLinkAriaProps.haspopup = "menu";
|
|
516
|
+
oLinkAriaProps.label = this._resourceBundleTnt.getText("NAVIGATION_LIST_OVERFLOW_ITEM_LABEL");
|
|
529
517
|
}
|
|
530
518
|
|
|
531
519
|
if (bSelectable) {
|
|
@@ -655,10 +643,12 @@ sap.ui.define([
|
|
|
655
643
|
oRM.attr("title", sTooltip);
|
|
656
644
|
}
|
|
657
645
|
|
|
658
|
-
if (
|
|
659
|
-
oRM.attr("
|
|
646
|
+
if (bDisabled) {
|
|
647
|
+
oRM.attr("aria-disabled", "true");
|
|
660
648
|
}
|
|
661
649
|
|
|
650
|
+
oRM.attr("tabindex", "-1");
|
|
651
|
+
|
|
662
652
|
if (sHref) {
|
|
663
653
|
oRM.attr("href", sHref);
|
|
664
654
|
}
|
|
@@ -668,6 +658,11 @@ sap.ui.define([
|
|
|
668
658
|
.attr("rel", defaultLinkTypes("", sTarget));
|
|
669
659
|
}
|
|
670
660
|
|
|
661
|
+
if (sHref && sTarget === "_blank") {
|
|
662
|
+
const oInvisibleText = NavigationListItem._getInvisibleText();
|
|
663
|
+
oRM.attr("aria-describedby", oInvisibleText.getId());
|
|
664
|
+
}
|
|
665
|
+
|
|
671
666
|
oRM.openEnd();
|
|
672
667
|
};
|
|
673
668
|
|
|
@@ -806,7 +801,7 @@ sap.ui.define([
|
|
|
806
801
|
NavigationListItem.prototype._getFocusDomRefs = function () {
|
|
807
802
|
const aDomRefs = [];
|
|
808
803
|
|
|
809
|
-
if (!this.
|
|
804
|
+
if (!this.getVisible()) {
|
|
810
805
|
return aDomRefs;
|
|
811
806
|
}
|
|
812
807
|
|
|
@@ -815,7 +810,7 @@ sap.ui.define([
|
|
|
815
810
|
}
|
|
816
811
|
|
|
817
812
|
if (this._isListExpanded() && this.getExpanded()) {
|
|
818
|
-
aDomRefs.push(...this.getDomRef().querySelectorAll(".sapTntNLISecondLevel
|
|
813
|
+
aDomRefs.push(...this.getDomRef().querySelectorAll(".sapTntNLISecondLevel a"));
|
|
819
814
|
}
|
|
820
815
|
|
|
821
816
|
return aDomRefs;
|
|
@@ -885,9 +880,5 @@ sap.ui.define([
|
|
|
885
880
|
|
|
886
881
|
NavigationListItem.prototype.onmouseover = NavigationListItem.prototype.onfocusout;
|
|
887
882
|
|
|
888
|
-
NavigationListItem.prototype._hasModifierKey = function hasModifierKeys(oEvent) {
|
|
889
|
-
return oEvent.shiftKey || oEvent.altKey || oEvent.ctrlKey || oEvent.metaKey;
|
|
890
|
-
};
|
|
891
|
-
|
|
892
883
|
return NavigationListItem;
|
|
893
884
|
});
|
|
@@ -29,7 +29,7 @@ sap.ui.define([
|
|
|
29
29
|
* @extends sap.ui.core.Item
|
|
30
30
|
*
|
|
31
31
|
* @author SAP SE
|
|
32
|
-
* @version 1.
|
|
32
|
+
* @version 1.138.0
|
|
33
33
|
*
|
|
34
34
|
* @constructor
|
|
35
35
|
* @public
|
|
@@ -79,11 +79,36 @@ sap.ui.define([
|
|
|
79
79
|
* @since 1.133
|
|
80
80
|
*/
|
|
81
81
|
press: {
|
|
82
|
+
allowPreventDefault: true,
|
|
82
83
|
parameters: {
|
|
83
84
|
/**
|
|
84
85
|
* The pressed item.
|
|
85
86
|
*/
|
|
86
|
-
item: { type: "sap.ui.core.Item" }
|
|
87
|
+
item: { type: "sap.ui.core.Item" },
|
|
88
|
+
/**
|
|
89
|
+
* Indicates whether the CTRL key was pressed when the link was selected.
|
|
90
|
+
* @since 1.137
|
|
91
|
+
*/
|
|
92
|
+
ctrlKey: { type: "boolean" },
|
|
93
|
+
/**
|
|
94
|
+
* Indicates whether the Shift key was pressed when the link was selected.
|
|
95
|
+
* @since 1.137
|
|
96
|
+
*/
|
|
97
|
+
shiftKey: { type: "boolean" },
|
|
98
|
+
/**
|
|
99
|
+
* Indicates whether the Alt key was pressed when the link was selected.
|
|
100
|
+
* @since 1.137
|
|
101
|
+
*/
|
|
102
|
+
altKey: { type: "boolean" },
|
|
103
|
+
/**
|
|
104
|
+
* Indicates whether the "meta" key was pressed when the link was selected.
|
|
105
|
+
*
|
|
106
|
+
* On Macintosh keyboards, this is the command key (⌘).
|
|
107
|
+
* On Windows keyboards, this is the windows key (⊞).
|
|
108
|
+
*
|
|
109
|
+
* @since 1.137
|
|
110
|
+
*/
|
|
111
|
+
metaKey: { type: "boolean" }
|
|
87
112
|
}
|
|
88
113
|
}
|
|
89
114
|
}
|
|
@@ -184,12 +209,6 @@ sap.ui.define([
|
|
|
184
209
|
*/
|
|
185
210
|
NavigationListItemBase.prototype._getFocusDomRefs = function () { };
|
|
186
211
|
|
|
187
|
-
/**
|
|
188
|
-
* Gets DOM reference of the accessibility element.
|
|
189
|
-
* @abstract
|
|
190
|
-
*/
|
|
191
|
-
NavigationListItemBase.prototype._getAccessibilityRef = function () { };
|
|
192
|
-
|
|
193
212
|
/**
|
|
194
213
|
* Returns the <code>sap.ui.core.Icon</code> control used to display the expand/collapse icon.
|
|
195
214
|
*
|
|
@@ -280,11 +299,42 @@ sap.ui.define([
|
|
|
280
299
|
* @private
|
|
281
300
|
*/
|
|
282
301
|
NavigationListItemBase.prototype.onkeydown = function (oEvent) {
|
|
302
|
+
const bRtl = Localization.getRTL();
|
|
303
|
+
|
|
283
304
|
if (oEvent.key ? oEvent.key === " " : oEvent.keyCode === KeyCodes.SPACE) {
|
|
284
305
|
oEvent.preventDefault();
|
|
285
306
|
}
|
|
286
307
|
|
|
308
|
+
if (this._isInsidePopover()) {
|
|
309
|
+
if ((oEvent.which == KeyCodes.ARROW_LEFT && !bRtl) || (oEvent.which == KeyCodes.ARROW_RIGHT && bRtl)) {
|
|
310
|
+
this.getNavigationList().oParent.close();
|
|
311
|
+
// prevent ItemNavigation to move the focus to the next/previous item
|
|
312
|
+
oEvent.stopPropagation();
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
if ((oEvent.which == KeyCodes.ARROW_RIGHT && !bRtl) || (oEvent.which == KeyCodes.ARROW_LEFT && bRtl)) {
|
|
316
|
+
// prevent ItemNavigation to move the focus to the next/previous item
|
|
317
|
+
oEvent.stopPropagation();
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
|
|
287
323
|
if (!this._isListExpanded()) {
|
|
324
|
+
if ((oEvent.which == KeyCodes.ARROW_RIGHT && !bRtl) || (oEvent.which == KeyCodes.ARROW_LEFT && bRtl)) {
|
|
325
|
+
if (this.getItems().length > 0 ) {
|
|
326
|
+
this.ontap(oEvent);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
// prevent ItemNavigation to move the focus to the next/previous item
|
|
330
|
+
oEvent.stopPropagation();
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
if ((oEvent.which == KeyCodes.ARROW_LEFT && !bRtl) || (oEvent.which == KeyCodes.ARROW_RIGHT && bRtl)) {
|
|
334
|
+
// prevent ItemNavigation to move the focus to the next/previous item
|
|
335
|
+
oEvent.stopPropagation();
|
|
336
|
+
}
|
|
337
|
+
|
|
288
338
|
return;
|
|
289
339
|
}
|
|
290
340
|
|
|
@@ -297,30 +347,33 @@ sap.ui.define([
|
|
|
297
347
|
}
|
|
298
348
|
|
|
299
349
|
if (this.getLevel() !== 0) {
|
|
350
|
+
|
|
351
|
+
if (oEvent.which == KeyCodes.ARROW_RIGHT && !bRtl || oEvent.which == KeyCodes.ARROW_LEFT && bRtl ||
|
|
352
|
+
oEvent.which == KeyCodes.ARROW_LEFT && !bRtl || oEvent.which == KeyCodes.ARROW_RIGHT && bRtl) {
|
|
353
|
+
// prevent ItemNavigation to move the focus to the next/previous item
|
|
354
|
+
oEvent.stopPropagation();
|
|
355
|
+
}
|
|
356
|
+
|
|
300
357
|
return;
|
|
301
358
|
}
|
|
302
359
|
|
|
303
|
-
const bRtl = Localization.getRTL();
|
|
304
|
-
|
|
305
360
|
// KeyCodes.MINUS is not returning 189
|
|
306
361
|
if ((oEvent.shiftKey && oEvent.which == 189) ||
|
|
307
362
|
oEvent.which == KeyCodes.NUMPAD_MINUS ||
|
|
308
363
|
(oEvent.which == KeyCodes.ARROW_RIGHT && bRtl) ||
|
|
309
364
|
(oEvent.which == KeyCodes.ARROW_LEFT && !bRtl)) {
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
}
|
|
365
|
+
this.collapse();
|
|
366
|
+
oEvent.preventDefault();
|
|
367
|
+
// prevent ItemNavigation to move the focus to the next/previous item
|
|
368
|
+
oEvent.stopPropagation();
|
|
315
369
|
} else if (oEvent.which == KeyCodes.NUMPAD_PLUS ||
|
|
316
370
|
(oEvent.shiftKey && oEvent.which == KeyCodes.PLUS) ||
|
|
317
371
|
oEvent.which == KeyCodes.ARROW_LEFT && bRtl ||
|
|
318
372
|
oEvent.which == KeyCodes.ARROW_RIGHT && !bRtl) {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
}
|
|
373
|
+
this.expand();
|
|
374
|
+
oEvent.preventDefault();
|
|
375
|
+
// prevent ItemNavigation to move the focus to the next/previous item
|
|
376
|
+
oEvent.stopPropagation();
|
|
324
377
|
}
|
|
325
378
|
};
|
|
326
379
|
|
|
@@ -332,13 +385,10 @@ sap.ui.define([
|
|
|
332
385
|
* @returns {boolean} whether the event was handled
|
|
333
386
|
*/
|
|
334
387
|
NavigationListItemBase.prototype.ontap = function (oEvent) {
|
|
335
|
-
const oParams = {
|
|
336
|
-
item: this
|
|
337
|
-
};
|
|
338
|
-
|
|
339
388
|
if (this.getEnabled() && !(oEvent.srcControl.isA("sap.ui.core.Icon")) && !this._isOverflow && !(!this.getNavigationList().getExpanded() && this.getItems().length)) {
|
|
340
|
-
this._firePress(
|
|
341
|
-
|
|
389
|
+
if (!this._firePress(oEvent, this)) {
|
|
390
|
+
return true;
|
|
391
|
+
}
|
|
342
392
|
oEvent.stopPropagation();
|
|
343
393
|
}
|
|
344
394
|
|
|
@@ -349,6 +399,7 @@ sap.ui.define([
|
|
|
349
399
|
oEvent.setMarked("subItem");
|
|
350
400
|
|
|
351
401
|
if (!this.getEnabled() || !this.getAllParentsEnabled()) {
|
|
402
|
+
oEvent.stopPropagation();
|
|
352
403
|
return true;
|
|
353
404
|
}
|
|
354
405
|
|
|
@@ -361,14 +412,36 @@ sap.ui.define([
|
|
|
361
412
|
|
|
362
413
|
/**
|
|
363
414
|
* Fires a press event on an item.
|
|
364
|
-
* @param {
|
|
415
|
+
* @param {sap.ui.base.Event} oEvent press event
|
|
416
|
+
* @param {sap.tnt.NavigationListMenuItem|sap.tnt.NavigationListItem} oItem The item that triggered the event
|
|
417
|
+
* @returns {boolean} whether the event was successfully fired
|
|
365
418
|
* @private
|
|
366
419
|
*/
|
|
367
|
-
NavigationListItemBase.prototype._firePress = function(
|
|
420
|
+
NavigationListItemBase.prototype._firePress = function(oEvent, oItem) {
|
|
368
421
|
const oNavList = this.getNavigationList();
|
|
422
|
+
const oParams = oEvent.getParameters ? oEvent.getParameters() : {
|
|
423
|
+
item: oItem,
|
|
424
|
+
ctrlKey: !!oEvent.ctrlKey,
|
|
425
|
+
shiftKey: !!oEvent.shiftKey,
|
|
426
|
+
altKey: !!oEvent.altKey,
|
|
427
|
+
metaKey: !!oEvent.metaKey
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
if (!this.getEnabled()) {
|
|
431
|
+
return false;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
if (!this.firePress(oParams)) {
|
|
435
|
+
oEvent.preventDefault();
|
|
436
|
+
return false;
|
|
437
|
+
}
|
|
369
438
|
|
|
370
|
-
oNavList?.fireItemPress({
|
|
371
|
-
|
|
439
|
+
if (!oNavList?.fireItemPress(oParams)) {
|
|
440
|
+
oEvent.preventDefault();
|
|
441
|
+
return false;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
return true;
|
|
372
445
|
};
|
|
373
446
|
|
|
374
447
|
/**
|
|
@@ -412,36 +485,16 @@ sap.ui.define([
|
|
|
412
485
|
* @returns {boolean} whether the items will be expanded
|
|
413
486
|
*/
|
|
414
487
|
NavigationListItemBase.prototype.expand = function () {
|
|
415
|
-
if (this.getExpanded() || !this.getHasExpander() || this.getItems().length == 0 || this.getLevel() !== 0) {
|
|
488
|
+
if (!this.getEnabled() || this.getExpanded() || !this.getHasExpander() || this.getItems().length == 0 || this.getLevel() !== 0) {
|
|
416
489
|
return false;
|
|
417
490
|
}
|
|
418
491
|
|
|
419
|
-
this.setProperty("expanded", true
|
|
420
|
-
this.
|
|
421
|
-
.setSrc(COLLAPSE_ICON_SRC)
|
|
422
|
-
.setTooltip(this._getExpandIconTooltip(false));
|
|
423
|
-
|
|
424
|
-
this._getAccessibilityRef().setAttribute("aria-expanded", "true");
|
|
425
|
-
|
|
426
|
-
const $container = this.$().find(".sapTntNLIItemsContainer").first();
|
|
427
|
-
$container.stop(true, true).slideDown("fast", () => {
|
|
428
|
-
this._updateContainerVisibility();
|
|
429
|
-
this.getNavigationList()?._updateNavItems();
|
|
430
|
-
});
|
|
492
|
+
this.setProperty("expanded", true);
|
|
493
|
+
this._animateExpand = true;
|
|
431
494
|
|
|
432
495
|
return true;
|
|
433
496
|
};
|
|
434
497
|
|
|
435
|
-
NavigationListItemBase.prototype._updateContainerVisibility = function () {
|
|
436
|
-
const oContainerRef = this.getDomRef()?.querySelector(".sapTntNLIItemsContainer");
|
|
437
|
-
if (oContainerRef) {
|
|
438
|
-
if (this.getExpanded()) {
|
|
439
|
-
oContainerRef.classList.remove("sapTntNLIItemsContainerHidden");
|
|
440
|
-
} else {
|
|
441
|
-
oContainerRef.classList.add("sapTntNLIItemsContainerHidden");
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
};
|
|
445
498
|
|
|
446
499
|
/**
|
|
447
500
|
* Collapses the child items (works only on first-level items).
|
|
@@ -449,22 +502,13 @@ sap.ui.define([
|
|
|
449
502
|
* @returns {boolean} whether the items will be collapsed
|
|
450
503
|
*/
|
|
451
504
|
NavigationListItemBase.prototype.collapse = function () {
|
|
452
|
-
if (!this.getExpanded() || !this.getHasExpander() || this.getItems().length == 0 || this.getLevel() !== 0) {
|
|
505
|
+
if (!this.getEnabled() || !this.getExpanded() || !this.getHasExpander() || this.getItems().length == 0 || this.getLevel() !== 0) {
|
|
453
506
|
return false;
|
|
454
507
|
}
|
|
455
508
|
|
|
456
|
-
this.setProperty("expanded", false
|
|
457
|
-
this.
|
|
458
|
-
.setSrc(EXPAND_ICON_SRC)
|
|
459
|
-
.setTooltip(this._getExpandIconTooltip(true));
|
|
460
|
-
|
|
461
|
-
this._getAccessibilityRef().setAttribute("aria-expanded", "false");
|
|
509
|
+
this.setProperty("expanded", false);
|
|
510
|
+
this._animateCollapse = true;
|
|
462
511
|
|
|
463
|
-
const $container = this.$().find(".sapTntNLIItemsContainer").first();
|
|
464
|
-
$container.stop(true, true).slideUp("fast", () => {
|
|
465
|
-
this._updateContainerVisibility();
|
|
466
|
-
this.getNavigationList()?._updateNavItems();
|
|
467
|
-
});
|
|
468
512
|
|
|
469
513
|
return true;
|
|
470
514
|
};
|