@sapui5/sap.suite.ui.commons 1.119.0 → 1.120.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/package.json +1 -1
- package/src/sap/suite/ui/commons/.library +1 -1
- package/src/sap/suite/ui/commons/App.js +24 -0
- package/src/sap/suite/ui/commons/AppsContainer.js +30 -0
- package/src/sap/suite/ui/commons/AriaProperties.js +1 -1
- package/src/sap/suite/ui/commons/BaseApp.js +24 -0
- package/src/sap/suite/ui/commons/BaseAppPanel.js +104 -0
- package/src/sap/suite/ui/commons/BaseContainer.js +402 -0
- package/src/sap/suite/ui/commons/BaseContainerRenderer.js +34 -0
- package/src/sap/suite/ui/commons/BasePanel.js +75 -0
- package/src/sap/suite/ui/commons/CalculationBuilder.js +5 -4
- package/src/sap/suite/ui/commons/CalculationBuilderExpression.js +8 -6
- package/src/sap/suite/ui/commons/CalculationBuilderFunction.js +1 -1
- package/src/sap/suite/ui/commons/CalculationBuilderGroup.js +1 -1
- package/src/sap/suite/ui/commons/CalculationBuilderInput.js +9 -7
- package/src/sap/suite/ui/commons/CalculationBuilderItem.js +8 -7
- package/src/sap/suite/ui/commons/CalculationBuilderValidationResult.js +1 -1
- package/src/sap/suite/ui/commons/CalculationBuilderVariable.js +1 -1
- package/src/sap/suite/ui/commons/CardsPanel.js +149 -0
- package/src/sap/suite/ui/commons/ChartContainer.js +10 -8
- package/src/sap/suite/ui/commons/CloudFilePicker.js +60 -23
- package/src/sap/suite/ui/commons/ControlProxy.js +6 -5
- package/src/sap/suite/ui/commons/FavAppPanel.js +331 -0
- package/src/sap/suite/ui/commons/FrequentAppPanel.js +57 -0
- package/src/sap/suite/ui/commons/Group.js +21 -0
- package/src/sap/suite/ui/commons/InsightsContainer.js +30 -0
- package/src/sap/suite/ui/commons/MenuButton.js +21 -0
- package/src/sap/suite/ui/commons/MicroProcessFlow.js +10 -8
- package/src/sap/suite/ui/commons/MicroProcessFlowItem.js +5 -4
- package/src/sap/suite/ui/commons/NewsAndPageContainer.js +125 -0
- package/src/sap/suite/ui/commons/NewsPanel.js +282 -0
- package/src/sap/suite/ui/commons/Page.js +97 -0
- package/src/sap/suite/ui/commons/PagePanel.js +479 -0
- package/src/sap/suite/ui/commons/ProcessFlow.js +18 -16
- package/src/sap/suite/ui/commons/ProcessFlowConnection.js +3 -3
- package/src/sap/suite/ui/commons/ProcessFlowConnectionLabel.js +3 -3
- package/src/sap/suite/ui/commons/ProcessFlowLaneHeader.js +4 -3
- package/src/sap/suite/ui/commons/ProcessFlowNode.js +6 -4
- package/src/sap/suite/ui/commons/ProcessFlowRenderer.js +4 -3
- package/src/sap/suite/ui/commons/RecentAppPanel.js +57 -0
- package/src/sap/suite/ui/commons/SituationPanel.js +284 -0
- package/src/sap/suite/ui/commons/TaskPanel.js +378 -0
- package/src/sap/suite/ui/commons/TilesPanel.js +73 -0
- package/src/sap/suite/ui/commons/Timeline.designtime.js +2 -2
- package/src/sap/suite/ui/commons/Timeline.js +10 -6
- package/src/sap/suite/ui/commons/TimelineItem.js +4 -3
- package/src/sap/suite/ui/commons/TimelineItemRenderer.js +12 -6
- package/src/sap/suite/ui/commons/TimelineRenderManager.js +4 -3
- package/src/sap/suite/ui/commons/TimelineRenderer.js +6 -5
- package/src/sap/suite/ui/commons/ToDoPanel.js +733 -0
- package/src/sap/suite/ui/commons/ToDosContainer.js +175 -0
- package/src/sap/suite/ui/commons/Utils.js +4 -2
- package/src/sap/suite/ui/commons/collaboration/BaseHelperService.js +12 -2
- package/src/sap/suite/ui/commons/collaboration/CollaborationBusyDialog.fragment.xml +3 -0
- package/src/sap/suite/ui/commons/collaboration/CollaborationCardHelper.js +69 -0
- package/src/sap/suite/ui/commons/collaboration/CollaborationHelper.js +67 -58
- package/src/sap/suite/ui/commons/collaboration/ContactHelper.js +73 -75
- package/src/sap/suite/ui/commons/collaboration/ContactPopover.fragment.xml +0 -1
- package/src/sap/suite/ui/commons/collaboration/GraphApiConfig.js +3 -0
- package/src/sap/suite/ui/commons/collaboration/MinimalContactPopover.fragment.xml +52 -0
- package/src/sap/suite/ui/commons/collaboration/TeamsHelperService.js +241 -93
- package/src/sap/suite/ui/commons/collaboration/flpplugins/msplugin/Component.js +16 -2
- package/src/sap/suite/ui/commons/flexibility/changeHandler/PropertyChangeMapper.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/CropCustomShapeHistoryItem.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/CropEllipseHistoryItem.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/CropRectangleHistoryItem.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/CustomSizeItem.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/FilterHistoryItem.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/FlipHistoryItem.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/HistoryItem.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/ImageEditor.js +4 -3
- package/src/sap/suite/ui/commons/imageeditor/ImageEditorContainer.js +8 -6
- package/src/sap/suite/ui/commons/imageeditor/ImageEditorContainerRenderer.js +4 -3
- package/src/sap/suite/ui/commons/imageeditor/ImageEditorRenderer.js +4 -3
- package/src/sap/suite/ui/commons/imageeditor/ImageEditorResponsiveContainer.js +5 -4
- package/src/sap/suite/ui/commons/imageeditor/ResizeHistoryItem.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/RotateHistoryItem.js +1 -1
- package/src/sap/suite/ui/commons/library.js +47 -4
- package/src/sap/suite/ui/commons/messagebundle.properties +146 -0
- package/src/sap/suite/ui/commons/messagebundle_ar.properties +6 -2
- package/src/sap/suite/ui/commons/messagebundle_bg.properties +5 -1
- package/src/sap/suite/ui/commons/messagebundle_ca.properties +8 -4
- package/src/sap/suite/ui/commons/messagebundle_cs.properties +4 -0
- package/src/sap/suite/ui/commons/messagebundle_cy.properties +4 -0
- package/src/sap/suite/ui/commons/messagebundle_da.properties +5 -1
- package/src/sap/suite/ui/commons/messagebundle_de.properties +5 -1
- package/src/sap/suite/ui/commons/messagebundle_el.properties +13 -9
- package/src/sap/suite/ui/commons/messagebundle_en.properties +1 -4
- package/src/sap/suite/ui/commons/messagebundle_en_GB.properties +4 -0
- package/src/sap/suite/ui/commons/messagebundle_es.properties +6 -2
- package/src/sap/suite/ui/commons/messagebundle_es_MX.properties +7 -3
- package/src/sap/suite/ui/commons/messagebundle_et.properties +4 -0
- package/src/sap/suite/ui/commons/messagebundle_fi.properties +4 -0
- package/src/sap/suite/ui/commons/messagebundle_fr.properties +8 -4
- package/src/sap/suite/ui/commons/messagebundle_fr_CA.properties +9 -5
- package/src/sap/suite/ui/commons/messagebundle_hi.properties +7 -3
- package/src/sap/suite/ui/commons/messagebundle_hr.properties +10 -6
- package/src/sap/suite/ui/commons/messagebundle_hu.properties +8 -4
- package/src/sap/suite/ui/commons/messagebundle_id.properties +4 -0
- package/src/sap/suite/ui/commons/messagebundle_it.properties +12 -8
- package/src/sap/suite/ui/commons/messagebundle_iw.properties +4 -0
- package/src/sap/suite/ui/commons/messagebundle_ja.properties +13 -9
- package/src/sap/suite/ui/commons/messagebundle_kk.properties +9 -5
- package/src/sap/suite/ui/commons/messagebundle_ko.properties +10 -6
- package/src/sap/suite/ui/commons/messagebundle_lt.properties +4 -0
- package/src/sap/suite/ui/commons/messagebundle_lv.properties +6 -2
- package/src/sap/suite/ui/commons/messagebundle_mk.properties +499 -0
- package/src/sap/suite/ui/commons/messagebundle_ms.properties +9 -5
- package/src/sap/suite/ui/commons/messagebundle_nl.properties +7 -3
- package/src/sap/suite/ui/commons/messagebundle_no.properties +4 -0
- package/src/sap/suite/ui/commons/messagebundle_pl.properties +5 -1
- package/src/sap/suite/ui/commons/messagebundle_pt.properties +6 -2
- package/src/sap/suite/ui/commons/messagebundle_pt_PT.properties +5 -1
- package/src/sap/suite/ui/commons/messagebundle_ro.properties +6 -2
- package/src/sap/suite/ui/commons/messagebundle_ru.properties +6 -2
- package/src/sap/suite/ui/commons/messagebundle_sh.properties +5 -1
- package/src/sap/suite/ui/commons/messagebundle_sk.properties +4 -0
- package/src/sap/suite/ui/commons/messagebundle_sl.properties +7 -3
- package/src/sap/suite/ui/commons/messagebundle_sv.properties +7 -3
- package/src/sap/suite/ui/commons/messagebundle_th.properties +8 -4
- package/src/sap/suite/ui/commons/messagebundle_tr.properties +6 -2
- package/src/sap/suite/ui/commons/messagebundle_uk.properties +26 -22
- package/src/sap/suite/ui/commons/messagebundle_vi.properties +4 -0
- package/src/sap/suite/ui/commons/messagebundle_zh_CN.properties +4 -0
- package/src/sap/suite/ui/commons/messagebundle_zh_TW.properties +5 -1
- package/src/sap/suite/ui/commons/mockserver/mockServer.js +46 -1
- package/src/sap/suite/ui/commons/networkgraph/ElementBase.js +4 -3
- package/src/sap/suite/ui/commons/networkgraph/Graph.js +22 -14
- package/src/sap/suite/ui/commons/networkgraph/GraphMap.js +11 -9
- package/src/sap/suite/ui/commons/networkgraph/GraphRenderer.js +4 -3
- package/src/sap/suite/ui/commons/networkgraph/Group.js +6 -4
- package/src/sap/suite/ui/commons/networkgraph/KeyboardNavigator.js +4 -3
- package/src/sap/suite/ui/commons/networkgraph/Line.js +4 -3
- package/src/sap/suite/ui/commons/networkgraph/Node.js +9 -7
- package/src/sap/suite/ui/commons/networkgraph/Tooltip.js +4 -3
- package/src/sap/suite/ui/commons/statusindicator/Circle.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/CustomShape.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/DiscreteThreshold.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/FillingOption.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/LibraryShape.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/Path.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/PropertyThreshold.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/Rectangle.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/Shape.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/ShapeGroup.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/SimpleShape.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/StatusIndicator.js +8 -7
- package/src/sap/suite/ui/commons/statusindicator/StatusIndicatorRenderer.js +4 -3
- package/src/sap/suite/ui/commons/taccount/TAccount.js +4 -3
- package/src/sap/suite/ui/commons/taccount/TAccountGroup.js +8 -6
- package/src/sap/suite/ui/commons/taccount/TAccountItem.js +6 -5
- package/src/sap/suite/ui/commons/taccount/TAccountItemProperty.js +1 -1
- package/src/sap/suite/ui/commons/taccount/TAccountPanel.js +1 -1
- package/src/sap/suite/ui/commons/themes/base/BaseContainer.less +25 -0
- package/src/sap/suite/ui/commons/themes/base/InsightsContainer.less +3 -0
- package/src/sap/suite/ui/commons/themes/base/MicroProcessFlow.less +2 -2
- package/src/sap/suite/ui/commons/themes/base/NewsAndPagesContainer.less +32 -0
- package/src/sap/suite/ui/commons/themes/base/ToDosContainer.less +19 -0
- package/src/sap/suite/ui/commons/themes/base/library.source.less +4 -0
- package/src/sap/suite/ui/commons/themes/sap_horizon/ToDosContainer.less +1 -0
- package/src/sap/suite/ui/commons/themes/sap_horizon/library.source.less +2 -1
- package/src/sap/suite/ui/commons/themes/sap_horizon_dark/ToDosContainer.less +1 -0
- package/src/sap/suite/ui/commons/themes/sap_horizon_dark/library.source.less +2 -1
- package/src/sap/suite/ui/commons/util/BatchHelper.js +138 -0
- package/src/sap/suite/ui/commons/util/FeedItemUtils.js +3 -3
- package/src/sap/suite/ui/commons/util/PageIconsConstant.js +1496 -0
- package/src/sap/suite/ui/commons/util/imgNews/1.jpg +0 -0
- package/src/sap/suite/ui/commons/util/imgNews/2.jpg +0 -0
- package/src/sap/suite/ui/commons/util/imgNews/3.jpg +0 -0
- package/src/sap/suite/ui/commons/util/imgNews/4.jpg +0 -0
- package/src/sap/suite/ui/commons/util/imgNews/5.jpg +0 -0
- package/src/sap/suite/ui/commons/util/imgNews/6.jpg +0 -0
- package/src/sap/suite/ui/commons/util/imgNews/7.jpg +0 -0
- package/src/sap/suite/ui/commons/util/imgNews/8.jpg +0 -0
- package/src/sap/suite/ui/commons/windowmessages/CollaborationMessageBroker.js +14 -14
package/package.json
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
sap.ui.define([
|
|
2
|
+
"sap/suite/ui/commons/BaseApp"
|
|
3
|
+
], function (
|
|
4
|
+
BaseApp
|
|
5
|
+
) {
|
|
6
|
+
"use strict";
|
|
7
|
+
|
|
8
|
+
var App = BaseApp.extend("sap.suite.ui.commons.App", {
|
|
9
|
+
metadata : {
|
|
10
|
+
properties : {
|
|
11
|
+
icon: { type: "string", group: "Misc", defaultValue: '' },
|
|
12
|
+
url: { type: "string", group: "Misc", defaultValue: '' }
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
events:{}
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
App.prototype.launchApp = async (oEvent, sTargetURL,sTitle) => {
|
|
19
|
+
const oSpaceContentService = await sap.ushell.Container.getServiceAsync("SpaceContent");
|
|
20
|
+
oSpaceContentService.launchTileTarget(sTargetURL, sTitle);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return App;
|
|
24
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
sap.ui.define([
|
|
2
|
+
"sap/suite/ui/commons/BaseContainer",
|
|
3
|
+
"./library"
|
|
4
|
+
], function (
|
|
5
|
+
BaseContainer,
|
|
6
|
+
library
|
|
7
|
+
) {
|
|
8
|
+
"use strict";
|
|
9
|
+
|
|
10
|
+
var LayoutType = library.LayoutType;
|
|
11
|
+
|
|
12
|
+
var AppsContainer = BaseContainer.extend("sap.suite.ui.commons.AppsContainer", {
|
|
13
|
+
metadata:{
|
|
14
|
+
properties : {
|
|
15
|
+
layout: { type: "sap.suite.ui.commons.LayoutType", group: "Misc", visibility: "hidden" }
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
renderer: {
|
|
19
|
+
apiVersion: 2
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
AppsContainer.prototype.init = function () {
|
|
24
|
+
this.setLayout(LayoutType.SideBySide);
|
|
25
|
+
this.setTitle(this.getResourceBundle().getText("appsTitle"));
|
|
26
|
+
BaseContainer.prototype.init.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return AppsContainer;
|
|
30
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
sap.ui.define([
|
|
2
|
+
"sap/ui/core/Element"
|
|
3
|
+
], function (
|
|
4
|
+
Element
|
|
5
|
+
) {
|
|
6
|
+
"use strict";
|
|
7
|
+
|
|
8
|
+
var BaseApp = Element.extend("sap.suite.ui.commons.BaseApp", {
|
|
9
|
+
metadata : {
|
|
10
|
+
properties : {
|
|
11
|
+
title: { type: "string", group: "Misc", defaultValue: '' },
|
|
12
|
+
bgColor: { type: "string", group: "Misc", defaultValue: '' }
|
|
13
|
+
},
|
|
14
|
+
events: {
|
|
15
|
+
press: {}
|
|
16
|
+
},
|
|
17
|
+
aggregations: {
|
|
18
|
+
menuButtons: {type: "sap.suite.ui.commons.MenuButton", multiple: true, singularName: "menuButton"}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
return BaseApp;
|
|
24
|
+
});
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
sap.ui.define([
|
|
2
|
+
"sap/suite/ui/commons/BasePanel",
|
|
3
|
+
"sap/m/GenericTile",
|
|
4
|
+
"sap/m/HBox",
|
|
5
|
+
"sap/m/VBox",
|
|
6
|
+
"sap/m/IllustratedMessage",
|
|
7
|
+
"sap/ui/core/theming/Parameters",
|
|
8
|
+
"sap/ushell/utils/WindowUtils"
|
|
9
|
+
], function (
|
|
10
|
+
BasePanel,
|
|
11
|
+
GenericTile,
|
|
12
|
+
HBox,
|
|
13
|
+
VBox,
|
|
14
|
+
IllustratedMessage,
|
|
15
|
+
Parameters,
|
|
16
|
+
WindowUtils
|
|
17
|
+
) {
|
|
18
|
+
"use strict";
|
|
19
|
+
|
|
20
|
+
var BaseAppPanel = BasePanel.extend("sap.suite.ui.commons.BaseAppPanel", {
|
|
21
|
+
metadata : {
|
|
22
|
+
properties : {},
|
|
23
|
+
defaultAggregation: "apps",
|
|
24
|
+
aggregations: {
|
|
25
|
+
apps: {type: "sap.suite.ui.commons.App", singularName: "app", multiple: true}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
BaseAppPanel.prototype.getDefaultAppColor = function () {
|
|
31
|
+
const sLegendName = "sapLegendColor9";
|
|
32
|
+
return {
|
|
33
|
+
key: sLegendName,
|
|
34
|
+
value: Parameters.get({
|
|
35
|
+
name: sLegendName
|
|
36
|
+
}),
|
|
37
|
+
assigned: false
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
BaseAppPanel.prototype.setInnerControls = function(){
|
|
42
|
+
let aApps = this.getApps() || [];
|
|
43
|
+
if (!this._oWrapper) {
|
|
44
|
+
aApps = (aApps).map((app) => {
|
|
45
|
+
return new GenericTile({
|
|
46
|
+
id: `${app.getId()}--tile`,
|
|
47
|
+
scope: "ActionMore",
|
|
48
|
+
state: "Loaded",
|
|
49
|
+
mode:"IconMode",
|
|
50
|
+
sizeBehavior: "Small",
|
|
51
|
+
header: app.getTitle(),
|
|
52
|
+
tileBadge: app.getNumber?.(),
|
|
53
|
+
//subheader: "",
|
|
54
|
+
backgroundColor: app.getBgColor() || this.getDefaultAppColor()?.key,
|
|
55
|
+
tileIcon: app?.getIcon?.(),
|
|
56
|
+
url: WindowUtils.getLeanURL(app.getUrl()),
|
|
57
|
+
frameType: "TwoByHalf",
|
|
58
|
+
renderOnThemeChange: true,
|
|
59
|
+
dropAreaOffset: 4,
|
|
60
|
+
press: (e) => app.launchApp(e, app.getUrl(), app.getTitle())
|
|
61
|
+
}).addStyleClass("sapUiTinyMargin");
|
|
62
|
+
});
|
|
63
|
+
let oControl;
|
|
64
|
+
if (aApps.length) {
|
|
65
|
+
oControl = new HBox({
|
|
66
|
+
wrap: "Wrap",
|
|
67
|
+
backgroundDesign: "Solid",
|
|
68
|
+
items: [...aApps]
|
|
69
|
+
});
|
|
70
|
+
} else {
|
|
71
|
+
const oIllustratedMessage = new IllustratedMessage({
|
|
72
|
+
illustrationSize: "Spot",
|
|
73
|
+
illustrationType: "sapIllus-AddColumn",
|
|
74
|
+
title: this.getResourceBundle().getText("noAppsTitle"),
|
|
75
|
+
description: this.getNoDataText()
|
|
76
|
+
});
|
|
77
|
+
oControl = new VBox({
|
|
78
|
+
wrap: "Wrap",
|
|
79
|
+
backgroundDesign: "Solid",
|
|
80
|
+
items: [oIllustratedMessage]
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
this._oWrapper = oControl;
|
|
84
|
+
}
|
|
85
|
+
this.addContent(this._oWrapper);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
BaseAppPanel.prototype._ProcessAppArray = function (aApps) {
|
|
89
|
+
return aApps.filter(function (app) {
|
|
90
|
+
return app.appType === "Application";
|
|
91
|
+
}).map(function(aApp){
|
|
92
|
+
aApp.orgAppId = aApp.appId;
|
|
93
|
+
aApp.appId = aApp.url;
|
|
94
|
+
aApp.leanURL = WindowUtils.getLeanURL(aApp.url);
|
|
95
|
+
return aApp;
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
BaseAppPanel.prototype.init = function () {
|
|
100
|
+
BasePanel.prototype.init.apply(this, arguments);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
return BaseAppPanel;
|
|
104
|
+
});
|
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
sap.ui.define([
|
|
2
|
+
"sap/ui/core/Control",
|
|
3
|
+
"./library",
|
|
4
|
+
"sap/m/IconTabBar",
|
|
5
|
+
"sap/m/IconTabFilter",
|
|
6
|
+
"sap/m/Title",
|
|
7
|
+
"sap/m/HBox",
|
|
8
|
+
"sap/m/FlexBox",
|
|
9
|
+
"sap/m/Button",
|
|
10
|
+
"sap/ui/core/CustomData",
|
|
11
|
+
"sap/ui/core/Lib"
|
|
12
|
+
], function (
|
|
13
|
+
Control,
|
|
14
|
+
library,
|
|
15
|
+
IconTabBar,
|
|
16
|
+
IconTabFilter,
|
|
17
|
+
Title,
|
|
18
|
+
HBox,
|
|
19
|
+
FlexBox,
|
|
20
|
+
Button,
|
|
21
|
+
CustomData,
|
|
22
|
+
CoreLib
|
|
23
|
+
) {
|
|
24
|
+
"use strict";
|
|
25
|
+
|
|
26
|
+
const LayoutType = library.LayoutType;
|
|
27
|
+
|
|
28
|
+
const BaseContainer = Control.extend("sap.suite.ui.commons.BaseContainer", {
|
|
29
|
+
metadata : {
|
|
30
|
+
properties : {
|
|
31
|
+
title: { type: "string", group: "Misc", defaultValue: '' },
|
|
32
|
+
layout: { type: "sap.suite.ui.commons.LayoutType", group: "Misc", defaultValue: LayoutType.SideBySide },
|
|
33
|
+
selectedKey: { type: "string", group: "Misc", defaultValue: '' }
|
|
34
|
+
},
|
|
35
|
+
defaultAggregation: "content",
|
|
36
|
+
aggregations: {
|
|
37
|
+
content: { type: "sap.suite.ui.commons.BasePanel", singularName: "content", multiple: true },
|
|
38
|
+
actionButtons: { type: "sap.m.Button", multiple: true, singularName: "actionButton", visibility: "hidden" },
|
|
39
|
+
menuButtons: { type: "sap.suite.ui.commons.MenuButton", multiple: true, singularName: "menuButton", visibility: "hidden" }
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Get library resource bundle
|
|
46
|
+
*
|
|
47
|
+
* @returns {Object} library resource bundle
|
|
48
|
+
*/
|
|
49
|
+
BaseContainer.prototype.getResourceBundle = function () {
|
|
50
|
+
this._resBundle = this._resBundle || CoreLib.getResourceBundleFor("sap.suite.ui.commons");
|
|
51
|
+
return this._resBundle;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Init lifecycle method
|
|
56
|
+
*
|
|
57
|
+
*/
|
|
58
|
+
BaseContainer.prototype.init = function () {
|
|
59
|
+
this._createHeaderIfRequired(this);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Returns container header
|
|
64
|
+
*
|
|
65
|
+
* @returns {Object} container header
|
|
66
|
+
*/
|
|
67
|
+
BaseContainer.prototype.getHeader = function () {
|
|
68
|
+
return this._controlMap.get(`${this.getId()}-header`);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Create inner control for storing content from panel
|
|
73
|
+
*
|
|
74
|
+
*/
|
|
75
|
+
BaseContainer.prototype._createInnerControl = function () {
|
|
76
|
+
const layout = this.getLayout();
|
|
77
|
+
|
|
78
|
+
if (layout === LayoutType.Horizontal || layout === LayoutType.Vertical) {
|
|
79
|
+
if (!this._wrapper) {
|
|
80
|
+
this._wrapper = new FlexBox(`${this.getId()}-wrapper`, {
|
|
81
|
+
width: "100%",
|
|
82
|
+
renderType: "Bare"
|
|
83
|
+
}).addStyleClass("sapUiBaseWrapper");
|
|
84
|
+
this._wrapper.setParent(this);
|
|
85
|
+
}
|
|
86
|
+
this._wrapper.setDirection(layout === LayoutType.Horizontal ? "Row" : "Column");
|
|
87
|
+
} else if (!this._iconTabBar) {
|
|
88
|
+
this._iconTabBar = new IconTabBar(`${this.getId()}-iconTabBar`, {
|
|
89
|
+
expandable: false,
|
|
90
|
+
backgroundDesign: "Transparent",
|
|
91
|
+
headerMode: "Inline",
|
|
92
|
+
headerBackgroundDesign: "Transparent",
|
|
93
|
+
select: this.onPanelSelect.bind(this)
|
|
94
|
+
});
|
|
95
|
+
this._iconTabBar.setParent(this);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Returns inner control corresponding to the specified layout
|
|
101
|
+
*
|
|
102
|
+
* @returns {Object} inner control based on the layout
|
|
103
|
+
*/
|
|
104
|
+
BaseContainer.prototype.getInnerControl = function () {
|
|
105
|
+
return this.getLayout() === LayoutType.SideBySide ? this._iconTabBar : this._wrapper;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Adds corresponding control to panel. The control would be added to the
|
|
110
|
+
* corresponding target inner control based on the layout.
|
|
111
|
+
*
|
|
112
|
+
* @param {Object} panel - panel to which control must be added
|
|
113
|
+
* @param {Object} control - control to be added
|
|
114
|
+
*/
|
|
115
|
+
BaseContainer.prototype.addToPanel = function (panel, control) {
|
|
116
|
+
if (this.getLayout() === LayoutType.SideBySide) {
|
|
117
|
+
this._fetchTabFilter(panel)?.addContent(control);
|
|
118
|
+
} else {
|
|
119
|
+
this._controlMap.get(`${panel.getId()}-wrapper`)?.addItem(control);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Creates and returns IconTabBarFilter for the specified panel to be placed
|
|
125
|
+
* in the IconTabBar inner control in case of SideBySide layout
|
|
126
|
+
*
|
|
127
|
+
* @param {Object} panel - panel whose icon tab filter must be fetched
|
|
128
|
+
* @returns {Object} IconTabBarFilter for the specified panel
|
|
129
|
+
*/
|
|
130
|
+
BaseContainer.prototype._fetchTabFilter = function (panel) {
|
|
131
|
+
const id = `${panel.getId()}-tabFilter`;
|
|
132
|
+
this._controlMap = this._controlMap || new Map();
|
|
133
|
+
|
|
134
|
+
if (!this._controlMap.get(id)) {
|
|
135
|
+
const iconTabFilter = new IconTabFilter(id, {
|
|
136
|
+
key: panel.getKey(),
|
|
137
|
+
text: panel.getTitle()
|
|
138
|
+
});
|
|
139
|
+
iconTabFilter.addCustomData(
|
|
140
|
+
new CustomData({
|
|
141
|
+
key: "sap-ui-fastnavgroup",
|
|
142
|
+
value: "true",
|
|
143
|
+
writeToDom: true
|
|
144
|
+
})
|
|
145
|
+
);
|
|
146
|
+
this._controlMap.set(id, iconTabFilter);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
//Add panel content to the created filter
|
|
150
|
+
panel.getContent()?.forEach((oContent) => this._controlMap.get(id).addContent(oContent));
|
|
151
|
+
|
|
152
|
+
return this._controlMap.get(id);
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Creates and returns a button for the corresponding header ActionButton
|
|
157
|
+
* or MenuButton elements
|
|
158
|
+
*
|
|
159
|
+
* @param {Object} headerButton - ActionButton or MenuButton element
|
|
160
|
+
* @returns {Object} Button instance created for the header element
|
|
161
|
+
*/
|
|
162
|
+
BaseContainer.prototype._fetchHeaderButton = function (headerButton) {
|
|
163
|
+
const id = headerButton.getId();
|
|
164
|
+
this._controlMap = this._controlMap || new Map();
|
|
165
|
+
|
|
166
|
+
if (!this._controlMap.get(id)) {
|
|
167
|
+
this._controlMap.set(id, new Button(`${id}-btn`, {
|
|
168
|
+
type: "Transparent",
|
|
169
|
+
press: (oEvent) => headerButton.firePress({ button: oEvent.getSource() })
|
|
170
|
+
}));
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
//Update button details
|
|
174
|
+
const button = this._controlMap.get(id);
|
|
175
|
+
button.setText(headerButton.getText());
|
|
176
|
+
button.setIcon(headerButton.getIcon());
|
|
177
|
+
|
|
178
|
+
return button;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Returns the selected panel in the IconTabBar inner control in
|
|
183
|
+
* case of SideBySide layout
|
|
184
|
+
*
|
|
185
|
+
* @returns {Object} selected panel
|
|
186
|
+
*/
|
|
187
|
+
BaseContainer.prototype.getSelectedPanel = function () {
|
|
188
|
+
const panel = this.getContent()?.find((panel) => panel.getKey() === this.getSelectedKey()) || this.getContent()?.[0];
|
|
189
|
+
this.setProperty("selectedKey", panel?.getKey(), true);
|
|
190
|
+
|
|
191
|
+
return panel;
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
BaseContainer.prototype.setTitle = function (sTitle) {
|
|
195
|
+
//suppress invalidate to prevent container re-rendering. re-render only the concerned element
|
|
196
|
+
this.setProperty("title", sTitle, true);
|
|
197
|
+
this._controlMap?.get(`${this.getId()}-header-title`).setText(sTitle);
|
|
198
|
+
return this;
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* onBeforeRendering lifecycle method
|
|
203
|
+
*
|
|
204
|
+
*/
|
|
205
|
+
BaseContainer.prototype.onBeforeRendering = function () {
|
|
206
|
+
//create layout-specific inner control
|
|
207
|
+
this._createInnerControl();
|
|
208
|
+
|
|
209
|
+
//fetch and update container header
|
|
210
|
+
this.updateContainerHeader();
|
|
211
|
+
|
|
212
|
+
//add content from all panels to inner control
|
|
213
|
+
this._addAllPanelContent();
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Update container header information
|
|
218
|
+
*/
|
|
219
|
+
BaseContainer.prototype.updateContainerHeader = function () {
|
|
220
|
+
//clear container header elements
|
|
221
|
+
this._controlMap.get(this.getId() + "-header-contentLeft").removeAllItems();
|
|
222
|
+
this._controlMap.get(this.getId() + "-header-contentRight").removeAllItems();
|
|
223
|
+
|
|
224
|
+
//update container header elements
|
|
225
|
+
this._updateHeader(this);
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Returns header of the specified panel after updating it
|
|
230
|
+
*
|
|
231
|
+
* @param {Object} panel - panel to be updated
|
|
232
|
+
* @returns {Object} header associated with the panel
|
|
233
|
+
*/
|
|
234
|
+
BaseContainer.prototype.updateAndFetchPanelHeader = function (panel) {
|
|
235
|
+
const header = this._createHeaderIfRequired(panel);
|
|
236
|
+
const isTitleVisible = panel.getTitle()?.trim().length > 0;
|
|
237
|
+
|
|
238
|
+
//update panel header elements
|
|
239
|
+
this._updateHeader(panel);
|
|
240
|
+
|
|
241
|
+
//add header styling only if any of the header elements are visible
|
|
242
|
+
header.toggleStyleClass("sapUiPanelHeader", isTitleVisible || panel.getAggregation("menuButtons")?.length > 0 || panel.getAggregation("actionButtons")?.length > 0);
|
|
243
|
+
|
|
244
|
+
return header;
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Updates header information of a specified container or a panel
|
|
249
|
+
*
|
|
250
|
+
* @param {Object} control - can be container or panel
|
|
251
|
+
*/
|
|
252
|
+
BaseContainer.prototype._updateHeader = function (control) {
|
|
253
|
+
const isSideBySideLayout = this.getLayout() === LayoutType.SideBySide;
|
|
254
|
+
const isContainer = control.isA("sap.suite.ui.commons.BaseContainer");
|
|
255
|
+
|
|
256
|
+
//Update Title
|
|
257
|
+
this._controlMap.get(control.getId() + "-header-title").setText(control.getTitle());
|
|
258
|
+
this._controlMap.get(control.getId() + "-header-title").setVisible(control.getTitle()?.trim().length > 0);
|
|
259
|
+
|
|
260
|
+
//Update Menu Buttons
|
|
261
|
+
(isContainer && isSideBySideLayout ? this.getSelectedPanel() : control)
|
|
262
|
+
.getAggregation("menuButtons")
|
|
263
|
+
?.forEach((oMenuButton) => this._controlMap.get(control.getId() + "-header-contentLeft").addItem(this._fetchHeaderButton(oMenuButton)));
|
|
264
|
+
|
|
265
|
+
//Update Action Buttons
|
|
266
|
+
(isContainer && isSideBySideLayout ? this.getSelectedPanel() : control)
|
|
267
|
+
.getAggregation("actionButtons")
|
|
268
|
+
?.forEach((oActionButton) => this._controlMap.get(control.getId() + "-header-contentRight").addItem(this._fetchHeaderButton(oActionButton)));
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Creates and returns a wrapper for containing the specified panel
|
|
273
|
+
* content in case of Horizontal and Vertical layout
|
|
274
|
+
*
|
|
275
|
+
* @param {Object} panel - panel for which wrapper has to created
|
|
276
|
+
* @returns {Object} wrapper container for the given panel
|
|
277
|
+
*/
|
|
278
|
+
BaseContainer.prototype._fetchPanelContentWrapper = function (panel) {
|
|
279
|
+
const id = `${panel.getId()}-contentWrapper`;
|
|
280
|
+
this._controlMap = this._controlMap || new Map();
|
|
281
|
+
|
|
282
|
+
if (!this._controlMap.get(id)) {
|
|
283
|
+
this._controlMap.set(id, new FlexBox(id, {
|
|
284
|
+
width: panel.getWidth(),
|
|
285
|
+
height: panel.getHeight(),
|
|
286
|
+
direction: "Column",
|
|
287
|
+
renderType: "Bare"
|
|
288
|
+
}));
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
//Add header as the first item in case of Horizontal and Vertical layout
|
|
292
|
+
this._controlMap.get(id).addItem(this.updateAndFetchPanelHeader(panel));
|
|
293
|
+
panel.getContent()?.forEach((oContent) => this._controlMap.get(id).addItem(oContent));
|
|
294
|
+
|
|
295
|
+
return this._controlMap.get(id);
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Add content from all panels to the layout-specific inner control
|
|
300
|
+
*
|
|
301
|
+
*/
|
|
302
|
+
BaseContainer.prototype._addAllPanelContent = function () {
|
|
303
|
+
const aPanels = this.getContent();
|
|
304
|
+
|
|
305
|
+
if (this.getLayout() === LayoutType.SideBySide) {
|
|
306
|
+
this._iconTabBar.removeAllItems();
|
|
307
|
+
aPanels?.forEach((panel) => this._iconTabBar.addItem(this._fetchTabFilter(panel)));
|
|
308
|
+
this._iconTabBar.setSelectedKey(this.getSelectedKey());
|
|
309
|
+
} else {
|
|
310
|
+
this._wrapper.removeAllItems();
|
|
311
|
+
aPanels?.forEach((panel) => this._wrapper.addItem(this._fetchPanelContentWrapper(panel)));
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Creates and returns header for both container as well as panels
|
|
317
|
+
*
|
|
318
|
+
* @param {Object} control - can be a container or a panel
|
|
319
|
+
* @returns {Object} header for the given container or panel
|
|
320
|
+
*/
|
|
321
|
+
BaseContainer.prototype._createHeaderIfRequired = function (control) {
|
|
322
|
+
const controlId = control.getId();
|
|
323
|
+
const id = `${controlId}-header`;
|
|
324
|
+
const isPanel = control.isA("sap.suite.ui.commons.BasePanel");
|
|
325
|
+
this._controlMap = this._controlMap || new Map();
|
|
326
|
+
|
|
327
|
+
if (!this._controlMap.get(id)) {
|
|
328
|
+
//create header elements
|
|
329
|
+
this._controlMap.set(`${controlId}-header-title`, new Title(`${controlId}-title`, { titleStyle: isPanel ? "H6" : "H4" }));
|
|
330
|
+
this._controlMap.set(`${controlId}-header-contentLeft`, new HBox(`${controlId}-contentLeft`, { renderType: "Bare" }).addStyleClass("sapUiSectionContentArea"));
|
|
331
|
+
this._controlMap.set(`${controlId}-header-contentRight`, new HBox(`${controlId}-contentRight`, { renderType: "Bare" }).addStyleClass("sapUiSectionContentArea"));
|
|
332
|
+
this._controlMap.set(`${controlId}-header-content`, new HBox(`${controlId}-content`, {
|
|
333
|
+
width: "100%",
|
|
334
|
+
justifyContent: "SpaceBetween",
|
|
335
|
+
renderType: "Bare",
|
|
336
|
+
items: [
|
|
337
|
+
this._controlMap.get(`${controlId}-header-contentLeft`),
|
|
338
|
+
this._controlMap.get(`${controlId}-header-contentRight`)
|
|
339
|
+
]
|
|
340
|
+
}).addStyleClass("sapUiTinyMarginBegin"));
|
|
341
|
+
|
|
342
|
+
//create header container
|
|
343
|
+
this._controlMap.set(id, new HBox(`${controlId}-header`,{
|
|
344
|
+
alignItems: "Center",
|
|
345
|
+
items: [
|
|
346
|
+
this._controlMap.get(`${controlId}-header-title`),
|
|
347
|
+
this._controlMap.get(`${controlId}-header-content`)
|
|
348
|
+
]
|
|
349
|
+
}));
|
|
350
|
+
this._controlMap.get(id).setParent(this);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
//add control-specific styling
|
|
354
|
+
this._controlMap.get(id).addStyleClass(isPanel ? "sapUiPanelHeader" : "sapUiContainerHeader");
|
|
355
|
+
|
|
356
|
+
return this._controlMap.get(id);
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Handler for selection of panel in SideBySide layout
|
|
361
|
+
*
|
|
362
|
+
* @param {Object} event - event object
|
|
363
|
+
*/
|
|
364
|
+
BaseContainer.prototype.onPanelSelect = function (event) {
|
|
365
|
+
//suppress invalidation to prevent container re-rendering. render the specific header element instead
|
|
366
|
+
this.setProperty("selectedKey", event.getSource().getSelectedKey(), true);
|
|
367
|
+
this.updateContainerHeader();
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
BaseContainer.prototype.getActionButtons = function () {
|
|
371
|
+
this._aActionButtons = this._aActionButtons || this.getAggregation("actionButtons");
|
|
372
|
+
return this._aActionButtons;
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Updates the count information of IconTabFilter of IconTabBar inner control
|
|
377
|
+
* in case of SideBySide layout
|
|
378
|
+
*
|
|
379
|
+
* @param {Object} panel - associated panel
|
|
380
|
+
* @param {string} count - updated count
|
|
381
|
+
*/
|
|
382
|
+
BaseContainer.prototype.setPanelCount = function (panel, count) {
|
|
383
|
+
if (this.getLayout() === LayoutType.SideBySide) {
|
|
384
|
+
this._fetchTabFilter(panel).setCount(count);
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Removes a panel from the container and removes it from the
|
|
390
|
+
* corresponding inner control
|
|
391
|
+
*
|
|
392
|
+
* @param {Object} panel - panel to be removed
|
|
393
|
+
*/
|
|
394
|
+
BaseContainer.prototype.removeContent = function (panel) {
|
|
395
|
+
if (this.getSelectedKey() && this.getSelectedKey() === panel.getKey()) {
|
|
396
|
+
this.setProperty("selectedKey", undefined, true);
|
|
397
|
+
}
|
|
398
|
+
this.removeAggregation("content", panel);
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
return BaseContainer;
|
|
402
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
sap.ui.define([
|
|
2
|
+
"./library"
|
|
3
|
+
], function (
|
|
4
|
+
library
|
|
5
|
+
) {
|
|
6
|
+
"use strict";
|
|
7
|
+
|
|
8
|
+
var LayoutType = library.LayoutType;
|
|
9
|
+
|
|
10
|
+
return {
|
|
11
|
+
apiVersion: 2,
|
|
12
|
+
render: function (oRm, oControl) {
|
|
13
|
+
oRm.openStart("div", oControl).class("sapUiBaseContainer");
|
|
14
|
+
|
|
15
|
+
//Apply Layout based style classes
|
|
16
|
+
if (oControl.getLayout() === LayoutType.SideBySide) {
|
|
17
|
+
oRm.class("sapUiSideBySide");
|
|
18
|
+
} else if (oControl.getLayout() === LayoutType.Horizontal) {
|
|
19
|
+
oRm.class("sapUiHorizontal");
|
|
20
|
+
} else {
|
|
21
|
+
oRm.class("sapUiVertical");
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
oRm.openEnd();
|
|
25
|
+
this.renderContent(oRm, oControl);
|
|
26
|
+
oRm.close("div");
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
renderContent: function (oRm, oControl) {
|
|
30
|
+
oRm.renderControl(oControl.getHeader());
|
|
31
|
+
oRm.renderControl(oControl.getInnerControl());
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
});
|