@openui5/sap.f 1.133.2 → 1.135.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 -7
- package/THIRDPARTY.txt +2 -23
- package/package.json +4 -4
- package/src/sap/f/.library +1 -1
- package/src/sap/f/Avatar.js +1 -1
- package/src/sap/f/AvatarGroup.js +1 -1
- package/src/sap/f/AvatarGroupItem.js +1 -1
- package/src/sap/f/CalendarAppointmentInCard.js +1 -1
- package/src/sap/f/CalendarInCard.js +1 -1
- package/src/sap/f/Card.js +1 -1
- package/src/sap/f/CardBase.js +170 -36
- package/src/sap/f/CardRenderer.js +16 -8
- package/src/sap/f/DynamicPage.js +12 -1
- package/src/sap/f/DynamicPageAccessibleLandmarkInfo.js +1 -1
- package/src/sap/f/DynamicPageHeader.js +1 -1
- package/src/sap/f/DynamicPageRenderer.js +1 -1
- package/src/sap/f/DynamicPageTitle.js +34 -1
- package/src/sap/f/FlexibleColumnLayout.js +1 -1
- package/src/sap/f/FlexibleColumnLayoutAccessibleLandmarkInfo.js +1 -1
- package/src/sap/f/FlexibleColumnLayoutData.js +1 -1
- package/src/sap/f/FlexibleColumnLayoutDataForDesktop.js +1 -1
- package/src/sap/f/FlexibleColumnLayoutDataForTablet.js +1 -1
- package/src/sap/f/FlexibleColumnLayoutSemanticHelper.js +1 -1
- package/src/sap/f/GridContainer.js +60 -110
- package/src/sap/f/GridContainerItemLayoutData.js +1 -1
- package/src/sap/f/GridContainerRenderer.js +8 -3
- package/src/sap/f/GridContainerSettings.js +2 -2
- package/src/sap/f/GridContainerUtils.js +8 -0
- package/src/sap/f/GridList.js +1 -1
- package/src/sap/f/GridListItem.js +1 -1
- package/src/sap/f/IllustratedMessage.js +1 -1
- package/src/sap/f/Illustration.js +1 -1
- package/src/sap/f/PlanningCalendarInCardLegend.js +1 -1
- package/src/sap/f/ProductSwitch.js +1 -1
- package/src/sap/f/ProductSwitchItem.js +1 -1
- package/src/sap/f/SearchManager.js +1 -1
- package/src/sap/f/ShellBar.js +3 -4
- package/src/sap/f/ShellBarRenderer.js +1 -0
- package/src/sap/f/SidePanel.js +1 -1
- package/src/sap/f/SidePanelItem.js +1 -1
- package/src/sap/f/cards/BaseHeader.js +61 -32
- package/src/sap/f/cards/BaseHeaderRenderer.js +212 -3
- package/src/sap/f/cards/Header.js +2 -8
- package/src/sap/f/cards/HeaderRenderer.js +0 -161
- package/src/sap/f/cards/NumericHeader.js +3 -9
- package/src/sap/f/cards/NumericHeaderRenderer.js +54 -126
- package/src/sap/f/cards/NumericIndicators.js +1 -1
- package/src/sap/f/cards/NumericSideIndicator.js +1 -1
- package/src/sap/f/cards/loading/AnalyticalPlaceholder.js +1 -1
- package/src/sap/f/cards/loading/CalendarPlaceholder.js +1 -1
- package/src/sap/f/cards/loading/GenericPlaceholder.js +1 -1
- package/src/sap/f/cards/loading/ListPlaceholder.js +1 -1
- package/src/sap/f/cards/loading/ObjectPlaceholder.js +1 -1
- package/src/sap/f/cards/loading/PlaceholderBase.js +1 -1
- package/src/sap/f/cards/loading/TablePlaceholder.js +1 -1
- package/src/sap/f/cards/loading/TimelinePlaceholder.js +1 -1
- package/src/sap/f/changeHandler/MoveDynamicPageTitleActions.js +1 -1
- package/src/sap/f/delegate/GridContainerItemNavigation.js +24 -202
- package/src/sap/f/delegate/GridItemNavigation.js +23 -10
- package/src/sap/f/dnd/GridDragOver.js +1 -1
- package/src/sap/f/dnd/GridDropInfo.js +1 -1
- package/src/sap/f/library.js +36 -2
- package/src/sap/f/messagebundle.properties +4 -4
- package/src/sap/f/messagebundle_ar.properties +0 -2
- package/src/sap/f/messagebundle_bg.properties +0 -2
- package/src/sap/f/messagebundle_ca.properties +0 -2
- package/src/sap/f/messagebundle_cnr.properties +0 -2
- package/src/sap/f/messagebundle_cs.properties +0 -2
- package/src/sap/f/messagebundle_cy.properties +0 -2
- package/src/sap/f/messagebundle_da.properties +0 -2
- package/src/sap/f/messagebundle_de.properties +0 -2
- package/src/sap/f/messagebundle_el.properties +0 -2
- package/src/sap/f/messagebundle_en.properties +0 -2
- package/src/sap/f/messagebundle_en_GB.properties +0 -2
- package/src/sap/f/messagebundle_en_US_saprigi.properties +2 -2
- package/src/sap/f/messagebundle_es.properties +0 -2
- package/src/sap/f/messagebundle_es_MX.properties +0 -2
- package/src/sap/f/messagebundle_et.properties +0 -2
- package/src/sap/f/messagebundle_fi.properties +0 -2
- package/src/sap/f/messagebundle_fr.properties +1 -3
- package/src/sap/f/messagebundle_fr_CA.properties +0 -2
- package/src/sap/f/messagebundle_hi.properties +0 -2
- package/src/sap/f/messagebundle_hr.properties +0 -2
- package/src/sap/f/messagebundle_hu.properties +0 -2
- package/src/sap/f/messagebundle_id.properties +0 -2
- package/src/sap/f/messagebundle_it.properties +0 -2
- package/src/sap/f/messagebundle_iw.properties +0 -2
- package/src/sap/f/messagebundle_ja.properties +0 -2
- package/src/sap/f/messagebundle_kk.properties +0 -2
- package/src/sap/f/messagebundle_ko.properties +0 -2
- package/src/sap/f/messagebundle_lt.properties +0 -2
- package/src/sap/f/messagebundle_lv.properties +0 -2
- package/src/sap/f/messagebundle_mk.properties +0 -2
- package/src/sap/f/messagebundle_ms.properties +0 -2
- package/src/sap/f/messagebundle_nl.properties +0 -2
- package/src/sap/f/messagebundle_no.properties +0 -2
- package/src/sap/f/messagebundle_pl.properties +0 -2
- package/src/sap/f/messagebundle_pt.properties +0 -2
- package/src/sap/f/messagebundle_pt_PT.properties +0 -2
- package/src/sap/f/messagebundle_ro.properties +1 -3
- package/src/sap/f/messagebundle_ru.properties +0 -2
- package/src/sap/f/messagebundle_sh.properties +0 -2
- package/src/sap/f/messagebundle_sk.properties +0 -2
- package/src/sap/f/messagebundle_sl.properties +0 -2
- package/src/sap/f/messagebundle_sr.properties +0 -2
- package/src/sap/f/messagebundle_sv.properties +0 -2
- package/src/sap/f/messagebundle_th.properties +0 -2
- package/src/sap/f/messagebundle_tr.properties +0 -2
- package/src/sap/f/messagebundle_uk.properties +2 -4
- package/src/sap/f/messagebundle_vi.properties +0 -2
- package/src/sap/f/messagebundle_zh_CN.properties +0 -2
- package/src/sap/f/messagebundle_zh_TW.properties +0 -2
- package/src/sap/f/semantic/AddAction.js +1 -1
- package/src/sap/f/semantic/CloseAction.js +1 -1
- package/src/sap/f/semantic/CopyAction.js +1 -1
- package/src/sap/f/semantic/DeleteAction.js +1 -1
- package/src/sap/f/semantic/DiscussInJamAction.js +1 -1
- package/src/sap/f/semantic/EditAction.js +1 -1
- package/src/sap/f/semantic/ExitFullScreenAction.js +1 -1
- package/src/sap/f/semantic/FavoriteAction.js +1 -1
- package/src/sap/f/semantic/FlagAction.js +1 -1
- package/src/sap/f/semantic/FooterMainAction.js +1 -1
- package/src/sap/f/semantic/FullScreenAction.js +1 -1
- package/src/sap/f/semantic/MainAction.js +1 -1
- package/src/sap/f/semantic/MessagesIndicator.js +1 -1
- package/src/sap/f/semantic/NegativeAction.js +1 -1
- package/src/sap/f/semantic/PositiveAction.js +1 -1
- package/src/sap/f/semantic/PrintAction.js +1 -1
- package/src/sap/f/semantic/SemanticButton.js +1 -1
- package/src/sap/f/semantic/SemanticConfiguration.js +1 -1
- package/src/sap/f/semantic/SemanticControl.js +1 -1
- package/src/sap/f/semantic/SemanticPage.js +1 -1
- package/src/sap/f/semantic/SemanticToggleButton.js +1 -1
- package/src/sap/f/semantic/SendEmailAction.js +1 -1
- package/src/sap/f/semantic/SendMessageAction.js +1 -1
- package/src/sap/f/semantic/ShareInJamAction.js +1 -1
- package/src/sap/f/semantic/TitleMainAction.js +1 -1
- package/src/sap/f/shellBar/AdditionalContentSupport.js +1 -1
- package/src/sap/f/shellBar/CoPilot.js +1 -1
- package/src/sap/f/shellBar/ControlSpacer.js +1 -1
- package/src/sap/f/shellBar/Factory.js +7 -1
- package/src/sap/f/shellBar/Search.js +1 -1
- package/src/sap/f/themes/base/CalendarPlaceholder.less +16 -4
- package/src/sap/f/themes/base/Card.less +93 -41
- package/src/sap/f/themes/base/CardBadge.less +10 -5
- package/src/sap/f/themes/base/CardHeaders.less +26 -37
- package/src/sap/f/themes/base/CardLoading.less +34 -23
- package/src/sap/f/themes/base/DynamicPage.less +5 -0
- package/src/sap/f/themes/base/GridContainer.less +16 -18
- package/src/sap/f/themes/base/GridListItem.less +14 -13
- package/src/sap/f/themes/sap_hcb/base_Card.less +3 -10
- package/src/sap/f/themes/sap_hcb/base_GridContainer.less +0 -13
- package/LICENSES/LicenseRef-tzdata-PublicDomain.txt +0 -5
|
@@ -10,159 +10,87 @@ sap.ui.define([
|
|
|
10
10
|
], function (BaseHeaderRenderer, Renderer) {
|
|
11
11
|
"use strict";
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
const NumericHeaderRenderer = Renderer.extend(BaseHeaderRenderer);
|
|
14
14
|
NumericHeaderRenderer.apiVersion = 2;
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* @param {sap.ui.core.RenderManager} oRm The RenderManager that can be used for writing to the render output buffer
|
|
20
|
-
* @param {sap.f.cards.NumericHeader} oNumericHeader An object representation of the control that should be rendered
|
|
17
|
+
* @override
|
|
21
18
|
*/
|
|
22
|
-
NumericHeaderRenderer.
|
|
23
|
-
|
|
24
|
-
oError = oNumericHeader.getAggregation("_error"),
|
|
25
|
-
bRenderAsLink = oNumericHeader.isLink(),
|
|
26
|
-
oToolbar = oNumericHeader.getToolbar();
|
|
27
|
-
|
|
28
|
-
oRm.openStart("div", oNumericHeader)
|
|
29
|
-
.class("sapFCardHeader")
|
|
30
|
-
.class("sapFCardNumericHeader");
|
|
31
|
-
|
|
32
|
-
if (bLoading) {
|
|
33
|
-
oRm.class("sapFCardHeaderLoading");
|
|
34
|
-
}
|
|
19
|
+
NumericHeaderRenderer.renderHeaderAttributes = function (oRm, oHeader) {
|
|
20
|
+
oRm.class("sapFCardNumericHeader");
|
|
35
21
|
|
|
36
|
-
if (
|
|
37
|
-
oRm.class("sapFCardSectionClickable");
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (oNumericHeader.getIconSrc() && oNumericHeader.getIconVisible()) {
|
|
41
|
-
oRm.class("sapFCardHeaderHasIcon");
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (oNumericHeader.getNumber() && oNumericHeader.getNumberVisible()) {
|
|
22
|
+
if (oHeader.getNumber() && oHeader.getNumberVisible()) {
|
|
45
23
|
oRm.class("sapFCardHeaderHasNumber");
|
|
46
24
|
}
|
|
25
|
+
};
|
|
47
26
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
27
|
+
/**
|
|
28
|
+
* @override
|
|
29
|
+
*/
|
|
30
|
+
NumericHeaderRenderer.hasNumericPart = function (oHeader) {
|
|
31
|
+
const oBindingInfos = oHeader.mBindingInfos;
|
|
32
|
+
const bHasMainIndicator = oHeader.getNumber() || oHeader.isBound("number");
|
|
33
|
+
const bHasSideIndicators = oHeader.getSideIndicators().length > 0;
|
|
34
|
+
const bHasDetails = oHeader.getDetails() || oBindingInfos.details;
|
|
35
|
+
const bHasDataTimestamp = oHeader.getDataTimestamp() || oBindingInfos.dataTimestamp;
|
|
36
|
+
|
|
37
|
+
return bHasMainIndicator || bHasSideIndicators || bHasDetails || bHasDataTimestamp;
|
|
38
|
+
};
|
|
53
39
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
40
|
+
/**
|
|
41
|
+
* @override
|
|
42
|
+
*/
|
|
43
|
+
NumericHeaderRenderer.renderNumericPart = function (oRm, oHeader) {
|
|
44
|
+
if (oHeader.getProperty("useTileLayout")) {
|
|
45
|
+
return;
|
|
59
46
|
}
|
|
60
47
|
|
|
61
|
-
|
|
62
|
-
.class("sapFCardHeaderContent");
|
|
48
|
+
const oMicroChart = oHeader.getMicroChart();
|
|
63
49
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
50
|
+
oRm.openStart("div")
|
|
51
|
+
.class("sapFCardNumericHeaderNumericPart")
|
|
52
|
+
.class("sapFCardHeaderLastPart")
|
|
53
|
+
.openEnd();
|
|
67
54
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
role: oNumericHeader.getFocusableElementAriaRole(),
|
|
72
|
-
roledescription: oNumericHeader.getAriaRoleDescription()
|
|
73
|
-
});
|
|
74
|
-
}
|
|
55
|
+
oRm.openStart("div")
|
|
56
|
+
.class("sapFCardHeaderNumericPartFirstLine")
|
|
57
|
+
.openEnd();
|
|
75
58
|
|
|
76
|
-
|
|
59
|
+
this._renderIndicators(oRm, oHeader);
|
|
77
60
|
|
|
78
|
-
if (
|
|
79
|
-
oRm.renderControl(
|
|
80
|
-
} else {
|
|
81
|
-
NumericHeaderRenderer.renderHeaderText(oRm, oNumericHeader);
|
|
82
|
-
NumericHeaderRenderer.renderAvatarAndIndicatorsLine(oRm, oNumericHeader);
|
|
83
|
-
NumericHeaderRenderer.renderDetails(oRm, oNumericHeader);
|
|
84
|
-
BaseHeaderRenderer.renderBanner(oRm, oNumericHeader);
|
|
61
|
+
if (oMicroChart) {
|
|
62
|
+
oRm.renderControl(oMicroChart);
|
|
85
63
|
}
|
|
86
64
|
|
|
87
|
-
|
|
88
|
-
oRm.close("a");
|
|
89
|
-
} else {
|
|
90
|
-
oRm.close("div");
|
|
91
|
-
}
|
|
65
|
+
oRm.close("div"); // sapFCardHeaderNumericPartFirstLine
|
|
92
66
|
|
|
93
|
-
|
|
94
|
-
NumericHeaderRenderer.renderToolbar(oRm, oNumericHeader);
|
|
95
|
-
}
|
|
67
|
+
this._renderDetails(oRm, oHeader);
|
|
96
68
|
|
|
97
69
|
oRm.close("div");
|
|
98
70
|
};
|
|
99
71
|
|
|
100
72
|
/**
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
* @param {sap.ui.core.RenderManager} oRm The RenderManager that can be used for writing to the render output buffer
|
|
104
|
-
* @param {sap.f.cards.NumericHeader} oNumericHeader An object representation of the control that should be rendered
|
|
105
|
-
*/
|
|
106
|
-
NumericHeaderRenderer.renderToolbar = function (oRm, oNumericHeader) {
|
|
107
|
-
var oToolbar = oNumericHeader.getToolbar();
|
|
108
|
-
|
|
109
|
-
if (oToolbar) {
|
|
110
|
-
oRm.openStart("div")
|
|
111
|
-
.class("sapFCardHeaderToolbarCont")
|
|
112
|
-
.openEnd();
|
|
113
|
-
|
|
114
|
-
oRm.renderControl(oToolbar);
|
|
115
|
-
|
|
116
|
-
oRm.close("div");
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Render title and subtitle texts.
|
|
122
|
-
*
|
|
123
|
-
* @param {sap.ui.core.RenderManager} oRm The RenderManager that can be used for writing to the render output buffer
|
|
124
|
-
* @param {sap.f.cards.NumericHeader} oNumericHeader An object representation of the control that should be rendered
|
|
73
|
+
* @override
|
|
125
74
|
*/
|
|
126
|
-
NumericHeaderRenderer.
|
|
127
|
-
var oTitle = oNumericHeader.getAggregation("_title"),
|
|
128
|
-
sStatus = oNumericHeader.getStatusText(),
|
|
129
|
-
oBindingInfos = oNumericHeader.mBindingInfos;
|
|
130
|
-
|
|
131
|
-
// TODO reuse title and subtitle rendering from the default header if possible
|
|
75
|
+
NumericHeaderRenderer.renderMainContentInTileLayout = function (oRm, oHeader) {
|
|
132
76
|
oRm.openStart("div")
|
|
133
77
|
.class("sapFCardHeaderText")
|
|
134
78
|
.openEnd();
|
|
135
79
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
.openEnd();
|
|
139
|
-
|
|
140
|
-
if (oTitle) {
|
|
141
|
-
if (oBindingInfos.title) {
|
|
142
|
-
oTitle.addStyleClass("sapFCardHeaderItemBinded");
|
|
143
|
-
}
|
|
144
|
-
oTitle.addStyleClass("sapFCardTitle");
|
|
145
|
-
oRm.renderControl(oTitle);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
if (sStatus && oNumericHeader.getStatusVisible()) {
|
|
149
|
-
oRm.openStart("span", oNumericHeader.getId() + "-status")
|
|
150
|
-
.class("sapFCardStatus");
|
|
151
|
-
|
|
152
|
-
if (oBindingInfos.statusText) {
|
|
153
|
-
oRm.class("sapFCardHeaderItemBinded");
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
oRm.openEnd()
|
|
157
|
-
.text(sStatus)
|
|
158
|
-
.close("span");
|
|
159
|
-
}
|
|
80
|
+
BaseHeaderRenderer.renderMainPartFirstLine(oRm, oHeader);
|
|
81
|
+
this._renderSubtitle(oRm, oHeader);
|
|
160
82
|
|
|
161
83
|
oRm.close("div");
|
|
162
84
|
|
|
163
|
-
|
|
85
|
+
this._renderAvatarAndIndicatorsLine(oRm, oHeader);
|
|
86
|
+
this._renderDetails(oRm, oHeader);
|
|
87
|
+
};
|
|
164
88
|
|
|
165
|
-
|
|
89
|
+
/**
|
|
90
|
+
* @override
|
|
91
|
+
*/
|
|
92
|
+
NumericHeaderRenderer.renderMainPartSecondLine = function (oRm, oHeader) {
|
|
93
|
+
this._renderSubtitle(oRm, oHeader);
|
|
166
94
|
};
|
|
167
95
|
|
|
168
96
|
/**
|
|
@@ -171,7 +99,7 @@ sap.ui.define([
|
|
|
171
99
|
* @param {sap.ui.core.RenderManager} oRm The RenderManager that can be used for writing to the render output buffer
|
|
172
100
|
* @param {sap.f.cards.NumericHeader} oNumericHeader An object representation of the control that should be rendered
|
|
173
101
|
*/
|
|
174
|
-
NumericHeaderRenderer.
|
|
102
|
+
NumericHeaderRenderer._renderSubtitle = function(oRm, oNumericHeader) {
|
|
175
103
|
var oBindingInfos = oNumericHeader.mBindingInfos,
|
|
176
104
|
oSubtitle = oNumericHeader.getAggregation("_subtitle"),
|
|
177
105
|
oUnitOfMeasurement = oNumericHeader.getAggregation("_unitOfMeasurement"),
|
|
@@ -210,13 +138,13 @@ sap.ui.define([
|
|
|
210
138
|
* @param {sap.ui.core.RenderManager} oRm The RenderManager that can be used for writing to the render output buffer
|
|
211
139
|
* @param {sap.f.cards.NumericHeader} oNH An object representation of the control that should be rendered
|
|
212
140
|
*/
|
|
213
|
-
NumericHeaderRenderer.
|
|
141
|
+
NumericHeaderRenderer._renderAvatarAndIndicatorsLine = function(oRm, oNH) {
|
|
214
142
|
oRm.openStart("div")
|
|
215
143
|
.class("sapFCardAvatarAndIndicatorsLine")
|
|
216
144
|
.openEnd();
|
|
217
145
|
|
|
218
146
|
BaseHeaderRenderer.renderAvatar(oRm, oNH);
|
|
219
|
-
|
|
147
|
+
this._renderIndicators(oRm, oNH);
|
|
220
148
|
|
|
221
149
|
var oMicroChart = oNH.getMicroChart();
|
|
222
150
|
if (oMicroChart) {
|
|
@@ -232,7 +160,7 @@ sap.ui.define([
|
|
|
232
160
|
* @param {sap.ui.core.RenderManager} oRm The RenderManager that can be used for writing to the render output buffer
|
|
233
161
|
* @param {sap.f.cards.NumericHeader} oNH An object representation of the control that should be rendered
|
|
234
162
|
*/
|
|
235
|
-
NumericHeaderRenderer.
|
|
163
|
+
NumericHeaderRenderer._renderIndicators = function(oRm, oNH) {
|
|
236
164
|
if (!oNH.getNumber() && !oNH.isBound("number") && oNH.getSideIndicators().length === 0) {
|
|
237
165
|
return;
|
|
238
166
|
}
|
|
@@ -255,7 +183,7 @@ sap.ui.define([
|
|
|
255
183
|
* @param {sap.ui.core.RenderManager} oRm The RenderManager that can be used for writing to the render output buffer
|
|
256
184
|
* @param {sap.f.cards.NumericHeader} oNumericHeader An object representation of the control that should be rendered
|
|
257
185
|
*/
|
|
258
|
-
NumericHeaderRenderer.
|
|
186
|
+
NumericHeaderRenderer._renderDetails = function(oRm, oNumericHeader) {
|
|
259
187
|
var oBindingInfos = oNumericHeader.mBindingInfos,
|
|
260
188
|
oDetails = oNumericHeader.getAggregation("_details"),
|
|
261
189
|
bHasDetails = oNumericHeader.getDetails() || oBindingInfos.details,
|
|
@@ -5,32 +5,16 @@
|
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
7
7
|
"sap/ui/core/Element",
|
|
8
|
-
"sap/ui/core/delegate/ItemNavigation",
|
|
9
8
|
"./GridItemNavigation",
|
|
10
|
-
"sap/ui/dom/containsOrEquals",
|
|
11
9
|
"sap/ui/thirdparty/jquery",
|
|
12
10
|
"sap/ui/dom/jquery/Selectors" // provides jQuery custom selector ":sapTabbable"
|
|
13
11
|
], function(
|
|
14
12
|
Element,
|
|
15
|
-
ItemNavigation,
|
|
16
13
|
GridItemNavigation,
|
|
17
|
-
containsOrEquals,
|
|
18
14
|
jQuery
|
|
19
15
|
) {
|
|
20
16
|
"use strict";
|
|
21
17
|
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* When the GridContainer list item is focused, the control inside received a virtual focus.
|
|
25
|
-
* @private
|
|
26
|
-
* @param {sap.ui.core.Control} oControl The control
|
|
27
|
-
*/
|
|
28
|
-
function doVirtualFocusin(oControl) {
|
|
29
|
-
if (oControl.onfocusin) {
|
|
30
|
-
oControl.onfocusin();
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
18
|
/**
|
|
35
19
|
* Constructor for a new <code>sap.f.delegate.GridContainerItemNavigation</code>.
|
|
36
20
|
*
|
|
@@ -41,7 +25,7 @@ sap.ui.define([
|
|
|
41
25
|
*
|
|
42
26
|
*
|
|
43
27
|
* @author SAP SE
|
|
44
|
-
* @version 1.
|
|
28
|
+
* @version 1.135.0
|
|
45
29
|
*
|
|
46
30
|
* @extends sap.f.delegate.GridItemNavigation
|
|
47
31
|
*
|
|
@@ -50,36 +34,19 @@ sap.ui.define([
|
|
|
50
34
|
* @alias sap.f.delegate.GridContainerItemNavigation
|
|
51
35
|
*/
|
|
52
36
|
var GridContainerItemNavigation = GridItemNavigation.extend("sap.f.delegate.GridContainerItemNavigation", /** @lends sap.f.delegate.GridContainerItemNavigation.prototype */ {
|
|
53
|
-
constructor: function() {
|
|
54
|
-
GridItemNavigation.apply(this, arguments);
|
|
55
|
-
|
|
56
|
-
this.attachEvent(ItemNavigation.Events.FocusLeave, this._onFocusLeave, this);
|
|
57
|
-
}
|
|
58
37
|
});
|
|
59
38
|
|
|
60
|
-
GridContainerItemNavigation.prototype._onFocusLeave = function(oEvent) {
|
|
61
|
-
var currentFocused = this.getFocusedDomRef();
|
|
62
|
-
this.getItemDomRefs().forEach(function(item, index) {
|
|
63
|
-
if (currentFocused === item) {
|
|
64
|
-
var nextFocusableIndex = index++;
|
|
65
|
-
this.setFocusedIndex(nextFocusableIndex);
|
|
66
|
-
}
|
|
67
|
-
}.bind(this));
|
|
68
|
-
};
|
|
69
|
-
|
|
70
39
|
/**
|
|
71
40
|
* Forward tab before or after GridContainer
|
|
72
41
|
*
|
|
73
42
|
* @protected
|
|
74
43
|
*/
|
|
75
44
|
GridContainerItemNavigation.prototype.forwardTab = function(bForward) {
|
|
76
|
-
|
|
77
45
|
var sId = this._getRootDomRefId() + "-" + (bForward ? "after" : "before");
|
|
78
|
-
|
|
79
46
|
document.getElementById(sId).focus();
|
|
80
47
|
};
|
|
81
48
|
|
|
82
|
-
GridContainerItemNavigation.prototype._getRootDomRefId = function(
|
|
49
|
+
GridContainerItemNavigation.prototype._getRootDomRefId = function() {
|
|
83
50
|
return this.getRootDomRef().getAttribute("id");
|
|
84
51
|
};
|
|
85
52
|
|
|
@@ -124,7 +91,8 @@ sap.ui.define([
|
|
|
124
91
|
* @protected
|
|
125
92
|
*/
|
|
126
93
|
GridContainerItemNavigation.prototype.onsaptabprevious = function(oEvent) {
|
|
127
|
-
if (!oEvent.target.classList.contains("sapFGridContainerItemWrapper")
|
|
94
|
+
if (!oEvent.target.classList.contains("sapFGridContainerItemWrapper") &&
|
|
95
|
+
!oEvent.target.parentElement.classList.contains("sapFGridContainerItemWrapper")) {
|
|
128
96
|
this._lastFocusedElement = oEvent.target;
|
|
129
97
|
return;
|
|
130
98
|
}
|
|
@@ -134,74 +102,11 @@ sap.ui.define([
|
|
|
134
102
|
this.forwardTab(false);
|
|
135
103
|
}
|
|
136
104
|
|
|
137
|
-
// SHIFT + TAB out of the GridContainer should
|
|
105
|
+
// SHIFT + TAB out of the GridContainer should focus the last focused grid cell
|
|
138
106
|
this._lastFocusedElement = null;
|
|
139
107
|
this.forwardTab(false);
|
|
140
108
|
};
|
|
141
109
|
|
|
142
|
-
/**
|
|
143
|
-
* Handles the onmousedown event
|
|
144
|
-
* Sets the focus to the item if it occured on an item
|
|
145
|
-
*
|
|
146
|
-
* @param {jQuery.Event} oEvent the browser event
|
|
147
|
-
* @private
|
|
148
|
-
*/
|
|
149
|
-
GridContainerItemNavigation.prototype.onmousedown = function(oEvent) {
|
|
150
|
-
|
|
151
|
-
this._bIsMouseDown = true;
|
|
152
|
-
this._oMouseDownTarget = oEvent.target;
|
|
153
|
-
|
|
154
|
-
document.addEventListener("mouseup", this._onMouseUp.bind(this), {once:true});
|
|
155
|
-
|
|
156
|
-
ItemNavigation.prototype.onmousedown.call(this, oEvent);
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
GridContainerItemNavigation.prototype.onmouseup = function(oEvent) {
|
|
160
|
-
this._onMouseUp();
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
GridContainerItemNavigation.prototype._onMouseUp = function () {
|
|
164
|
-
var $listItem = jQuery(this._oMouseDownTarget).closest('.sapFGridContainerItemWrapperNoVisualFocus'),
|
|
165
|
-
oControl;
|
|
166
|
-
|
|
167
|
-
if (!this._bIsMouseDown) {
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
if ($listItem.length) {
|
|
172
|
-
oControl = Element.closestTo($listItem.children()[0]);
|
|
173
|
-
|
|
174
|
-
// if the list item visual focus is displayed by the currently focused control,
|
|
175
|
-
// move the focus to the list item
|
|
176
|
-
if (oControl && oControl.getFocusDomRef() === document.activeElement) {
|
|
177
|
-
this._lastFocusedElement = null;
|
|
178
|
-
$listItem.trigger("focus");
|
|
179
|
-
doVirtualFocusin(oControl);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
this._bIsMouseDown = false;
|
|
184
|
-
this._oMouseDownTarget = null;
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Handles 'dragend' event.
|
|
189
|
-
* Used to release the mouse down flag. Needed because the browser will not fire 'mouseup' event after drag and drop.
|
|
190
|
-
*/
|
|
191
|
-
GridContainerItemNavigation.prototype.ondragend = function() {
|
|
192
|
-
this._bIsMouseDown = false;
|
|
193
|
-
this._oMouseDownTarget = null;
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* Handles 'drop' event.
|
|
198
|
-
* Used to release the mouse down flag. Needed because the browser will not fire 'mouseup' event after drag and drop.
|
|
199
|
-
*/
|
|
200
|
-
GridContainerItemNavigation.prototype.ondrop = function() {
|
|
201
|
-
this._bIsMouseDown = false;
|
|
202
|
-
this._oMouseDownTarget = null;
|
|
203
|
-
};
|
|
204
|
-
|
|
205
110
|
/**
|
|
206
111
|
* Handles the <code>focusin</code> event.
|
|
207
112
|
*
|
|
@@ -223,24 +128,22 @@ sap.ui.define([
|
|
|
223
128
|
// focus is coming in the grid container from Shift + Tab
|
|
224
129
|
if (oEvent.target === this._getGridInstance().getDomRef("after") && !this.getRootDomRef().contains(oEvent.relatedTarget)) {
|
|
225
130
|
this._focusPrevious(oEvent);
|
|
226
|
-
return;
|
|
227
131
|
}
|
|
228
132
|
|
|
229
|
-
var
|
|
230
|
-
oControl;
|
|
133
|
+
var oTarget = oEvent.target;
|
|
231
134
|
|
|
232
|
-
|
|
233
|
-
|
|
135
|
+
// update the focused index of item navigation when inner elements are focused
|
|
136
|
+
if (!oTarget.matches(".sapFGridContainerItemWrapper")) {
|
|
137
|
+
var oFocusableItem = oTarget.closest(".sapFGridContainerItemWrapper");
|
|
234
138
|
|
|
235
|
-
if (
|
|
236
|
-
|
|
139
|
+
if (oFocusableItem) {
|
|
140
|
+
if (!oFocusableItem.classList.contains(".sapFGCFocusable")) {
|
|
141
|
+
oFocusableItem = oFocusableItem.firstChild;
|
|
142
|
+
}
|
|
237
143
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
this._lastFocusedElement = null;
|
|
242
|
-
$listItem.trigger("focus");
|
|
243
|
-
return;
|
|
144
|
+
var iFocusableIndex = this.getItemDomRefs().indexOf(oFocusableItem);
|
|
145
|
+
if (iFocusableIndex >= 0) {
|
|
146
|
+
this.setFocusedIndex(iFocusableIndex);
|
|
244
147
|
}
|
|
245
148
|
}
|
|
246
149
|
}
|
|
@@ -272,101 +175,20 @@ sap.ui.define([
|
|
|
272
175
|
$FocusCandidate.add($TabbableChildren).eq(-1).focus();
|
|
273
176
|
};
|
|
274
177
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
* @param {int} iIndex Index of the item to focus
|
|
279
|
-
* @param {jQuery.Event} oEvent Event that leads to focus change
|
|
280
|
-
* @override
|
|
281
|
-
* @private
|
|
282
|
-
*/
|
|
283
|
-
GridContainerItemNavigation.prototype.focusItem = function(iIndex, oEvent) {
|
|
284
|
-
var oItemItemNavigation,
|
|
285
|
-
oInnerControl,
|
|
286
|
-
oInnerControlFocusDomRef;
|
|
287
|
-
|
|
288
|
-
if (iIndex === this.iFocusedIndex && this.aItemDomRefs[this.iFocusedIndex] === document.activeElement) {
|
|
289
|
-
this.fireEvent(ItemNavigation.Events.FocusAgain, {
|
|
290
|
-
index: iIndex,
|
|
291
|
-
event: oEvent
|
|
292
|
-
});
|
|
293
|
-
return; // item already focused -> nothing to do
|
|
178
|
+
GridContainerItemNavigation.prototype.getInnerFocusItem = function (oItem) {
|
|
179
|
+
if (!oItem.classList.contains("sapFGCFocusable")) {
|
|
180
|
+
oItem = oItem.firstChild;
|
|
294
181
|
}
|
|
295
182
|
|
|
296
|
-
|
|
297
|
-
index: iIndex,
|
|
298
|
-
event: oEvent
|
|
299
|
-
});
|
|
300
|
-
|
|
301
|
-
this.setFocusedIndex(iIndex);
|
|
302
|
-
this.bISetFocus = true;
|
|
303
|
-
|
|
304
|
-
if (oEvent && jQuery(this.aItemDomRefs[this.iFocusedIndex]).data("sap.INRoot")) {
|
|
305
|
-
|
|
306
|
-
// store event type for nested ItemNavigations
|
|
307
|
-
oItemItemNavigation = jQuery(this.aItemDomRefs[this.iFocusedIndex]).data("sap.INRoot");
|
|
308
|
-
oItemItemNavigation._sFocusEvent = oEvent.type;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
// this is what the GridContainer changes
|
|
312
|
-
////////////////////////////////////////////
|
|
313
|
-
if (!oEvent) {
|
|
314
|
-
this.resetFocusPosition();
|
|
315
|
-
}
|
|
316
|
-
if (!this._bIsMouseDown && this.aItemDomRefs.length) {
|
|
317
|
-
this.aItemDomRefs[this.iFocusedIndex].focus();
|
|
318
|
-
|
|
319
|
-
// make the DOM element that has the outline focus to be visible in the view area
|
|
320
|
-
oInnerControl = Element.closestTo(this.aItemDomRefs[this.iFocusedIndex].firstChild);
|
|
321
|
-
|
|
322
|
-
if (oInnerControl) {
|
|
323
|
-
oInnerControlFocusDomRef = oInnerControl.getFocusDomRef();
|
|
324
|
-
|
|
325
|
-
if (oInnerControlFocusDomRef) {
|
|
326
|
-
this.scrollIntoViewIfNeeded(oInnerControlFocusDomRef);
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
/////////////////////////////////////////////
|
|
331
|
-
|
|
332
|
-
this.fireEvent(ItemNavigation.Events.AfterFocus, {
|
|
333
|
-
index: iIndex,
|
|
334
|
-
event: oEvent
|
|
335
|
-
});
|
|
183
|
+
return oItem;
|
|
336
184
|
};
|
|
337
185
|
|
|
338
|
-
GridContainerItemNavigation.prototype.
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
oElementRect;
|
|
342
|
-
|
|
343
|
-
// find the closest parent container with scroll
|
|
344
|
-
while (oParentDomRef &&
|
|
345
|
-
oParentDomRef.offsetWidth >= oParentDomRef.scrollWidth &&
|
|
346
|
-
oParentDomRef.offsetHeight >= oParentDomRef.scrollHeight) {
|
|
347
|
-
oParentDomRef = oParentDomRef.parentElement;
|
|
186
|
+
GridContainerItemNavigation.prototype.getWrapperItem = function (oItem) {
|
|
187
|
+
if (!oItem.classList.contains("sapFGridContainerItemWrapper")) {
|
|
188
|
+
oItem = oItem.closest(".sapFGridContainerItemWrapper");
|
|
348
189
|
}
|
|
349
190
|
|
|
350
|
-
|
|
351
|
-
return;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
// we need to check according to its parent
|
|
355
|
-
oParentDomRef = oParentDomRef.parentElement;
|
|
356
|
-
|
|
357
|
-
if (!oParentDomRef) {
|
|
358
|
-
return;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
oContainerRect = oParentDomRef.getBoundingClientRect();
|
|
362
|
-
oElementRect = oElementDomRef.getBoundingClientRect();
|
|
363
|
-
|
|
364
|
-
if (oElementRect.top < oContainerRect.top ||
|
|
365
|
-
oElementRect.bottom > oContainerRect.bottom ||
|
|
366
|
-
oElementRect.right > oContainerRect.right ||
|
|
367
|
-
oElementRect.left < oContainerRect.left) {
|
|
368
|
-
oElementDomRef.scrollIntoView();
|
|
369
|
-
}
|
|
191
|
+
return oItem;
|
|
370
192
|
};
|
|
371
193
|
|
|
372
194
|
return GridContainerItemNavigation;
|