@openui5/sap.ui.documentation 1.99.0 → 1.100.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/THIRDPARTY.txt +2 -2
- package/package.json +6 -6
- package/src/sap/ui/documentation/.library +1 -1
- package/src/sap/ui/documentation/TitleLink.js +1 -2
- package/src/sap/ui/documentation/library.js +4 -5
- package/src/sap/ui/documentation/sdk/Component.js +1 -5
- package/src/sap/ui/documentation/sdk/controller/ApiDetail.controller.js +7 -13
- package/src/sap/ui/documentation/sdk/controller/ApiDetailIndexDeprecatedExperimental.controller.js +1 -3
- package/src/sap/ui/documentation/sdk/controller/ApiMaster.controller.js +0 -2
- package/src/sap/ui/documentation/sdk/controller/App.controller.js +0 -2
- package/src/sap/ui/documentation/sdk/controller/Code.controller.js +1 -2
- package/src/sap/ui/documentation/sdk/controller/ControlsMaster.controller.js +11 -15
- package/src/sap/ui/documentation/sdk/controller/Entity.controller.js +1 -2
- package/src/sap/ui/documentation/sdk/controller/LiveEditor.controller.js +1 -2
- package/src/sap/ui/documentation/sdk/controller/Sample.controller.js +173 -308
- package/src/sap/ui/documentation/sdk/controller/SampleBaseController.js +2 -3
- package/src/sap/ui/documentation/sdk/controller/SearchPage.controller.js +4 -5
- package/src/sap/ui/documentation/sdk/controller/SubApiDetail.controller.js +8 -9
- package/src/sap/ui/documentation/sdk/controller/TermsOfUse.controller.js +3 -2
- package/src/sap/ui/documentation/sdk/controller/TopicDetail.controller.js +17 -19
- package/src/sap/ui/documentation/sdk/controller/TopicDetailInitial.controller.js +2 -2
- package/src/sap/ui/documentation/sdk/controller/VersionNotFound.controller.js +2 -0
- package/src/sap/ui/documentation/sdk/controller/Welcome.controller.js +3 -3
- package/src/sap/ui/documentation/sdk/controller/util/ConfigUtil.js +3 -4
- package/src/sap/ui/documentation/sdk/controller/util/ControlsInfo.js +7 -6
- package/src/sap/ui/documentation/sdk/controller/util/DataTable.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/DataTableHelper.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/IndexWorker.js +1 -1
- package/src/sap/ui/documentation/sdk/controller/util/datatable/filters/DataTableFilterDropDown.js +0 -2
- package/src/sap/ui/documentation/sdk/controller/util/datatable/filters/DataTableFilterRange.js +2 -4
- package/src/sap/ui/documentation/sdk/controller/util/overlay/Overlay.js +1 -1
- package/src/sap/ui/documentation/sdk/cookieSettingsDialog/controller/CookieSettingsDialog.controller.js +1 -2
- package/src/sap/ui/documentation/sdk/index.html +133 -25
- package/src/sap/ui/documentation/sdk/model/formatter.js +1 -1
- package/src/sap/ui/documentation/sdk/model/libraryData.js +9 -4
- package/src/sap/ui/documentation/sdk/util/DocumentationRouter.js +8 -4
- package/src/sap/ui/documentation/sdk/util/Resources.js +5 -2
- package/src/sap/ui/documentation/sdk/view/Sample.view.xml +2 -2
- package/src/sap/ui/documentation/themes/sap_horizon_dark/library.source.less +9 -0
- package/src/sap/ui/documentation/themes/sap_horizon_hcb/library.source.less +9 -0
- package/src/sap/ui/documentation/themes/sap_horizon_hcw/library.source.less +9 -0
|
@@ -7,10 +7,7 @@
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/ui/thirdparty/jquery",
|
|
9
9
|
"sap/ui/documentation/sdk/controller/BaseController",
|
|
10
|
-
"sap/ui/model/json/JSONModel",
|
|
11
|
-
"sap/ui/documentation/sdk/controller/util/ControlsInfo",
|
|
12
10
|
"sap/ui/documentation/sdk/util/ToggleFullScreenHandler",
|
|
13
|
-
"sap/ui/documentation/sdk/controller/util/APIInfo",
|
|
14
11
|
"sap/ui/documentation/sdk/model/formatter",
|
|
15
12
|
"sap/m/Image",
|
|
16
13
|
"sap/m/Label",
|
|
@@ -23,9 +20,12 @@ sap.ui.define([
|
|
|
23
20
|
"sap/m/library",
|
|
24
21
|
"sap/ui/core/library",
|
|
25
22
|
"sap/m/CustomListItem",
|
|
26
|
-
"sap/m/List"
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
"sap/m/List",
|
|
24
|
+
"sap/ui/dom/includeStylesheet",
|
|
25
|
+
"sap/ui/dom/includeScript"
|
|
26
|
+
], function (jQuery, BaseController, ToggleFullScreenHandler,
|
|
27
|
+
formatter, Image, Label, Link, Text, HBox, ObjectAttribute, ObjectStatus, Popover,
|
|
28
|
+
library, coreLibrary, CustomListItem, List, includeStylesheet, includeScript) {
|
|
29
29
|
"use strict";
|
|
30
30
|
|
|
31
31
|
// shortcut for sap.m.FlexWrap
|
|
@@ -48,9 +48,8 @@ sap.ui.define([
|
|
|
48
48
|
|
|
49
49
|
if ( !window.hljs ) {
|
|
50
50
|
//solarized-light
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
includeStylesheet("resources/sap/ui/documentation/sdk/thirdparty/highlight.js/styles.css");
|
|
52
|
+
includeScript({ url: "resources/sap/ui/documentation/sdk/thirdparty/highlight.js/highlight.js" });
|
|
54
53
|
}
|
|
55
54
|
},
|
|
56
55
|
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
-
"sap/ui/documentation/sdk/controller/BaseController"
|
|
9
|
-
|
|
8
|
+
"sap/ui/documentation/sdk/controller/BaseController",
|
|
9
|
+
"sap/ui/thirdparty/jquery"
|
|
10
|
+
], function (BaseController, jQuery) {
|
|
10
11
|
"use strict";
|
|
11
12
|
|
|
12
13
|
return BaseController.extend("sap.ui.documentation.sdk.controller.TermsOfUse", {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
-
"jquery
|
|
8
|
+
"sap/ui/thirdparty/jquery",
|
|
9
9
|
"sap/ui/core/ResizeHandler",
|
|
10
10
|
"sap/ui/documentation/sdk/controller/BaseController",
|
|
11
11
|
"sap/ui/model/json/JSONModel",
|
|
@@ -15,15 +15,14 @@ sap.ui.define([
|
|
|
15
15
|
"sap/ui/documentation/sdk/util/Resources",
|
|
16
16
|
"sap/ui/documentation/sdk/controller/util/ResponsiveImageMap",
|
|
17
17
|
"sap/ui/documentation/sdk/controller/util/SidyBySideImageMap",
|
|
18
|
-
"sap/ui/core/HTML",
|
|
19
|
-
"sap/base/Log",
|
|
20
18
|
"sap/m/LightBox",
|
|
21
19
|
"sap/m/LightBoxItem",
|
|
22
20
|
"./util/DataTableHelper",
|
|
23
21
|
"./util/DataTable",
|
|
24
22
|
"sap/m/Button",
|
|
25
|
-
"sap/m/MessageToast"
|
|
26
|
-
|
|
23
|
+
"sap/m/MessageToast",
|
|
24
|
+
"sap/ui/dom/includeStylesheet",
|
|
25
|
+
"sap/ui/dom/includeScript"
|
|
27
26
|
],
|
|
28
27
|
function (
|
|
29
28
|
jQuery,
|
|
@@ -36,14 +35,14 @@ sap.ui.define([
|
|
|
36
35
|
ResourcesUtil,
|
|
37
36
|
ResponsiveImageMap,
|
|
38
37
|
SidyBySideImageMap,
|
|
39
|
-
HTML,
|
|
40
|
-
Log,
|
|
41
38
|
LightBox,
|
|
42
39
|
LightBoxItem,
|
|
43
40
|
DataTableHelper,
|
|
44
41
|
DataTable,
|
|
45
42
|
Button,
|
|
46
|
-
MessageToast
|
|
43
|
+
MessageToast,
|
|
44
|
+
includeStylesheet,
|
|
45
|
+
includeScript
|
|
47
46
|
) {
|
|
48
47
|
"use strict";
|
|
49
48
|
|
|
@@ -78,30 +77,29 @@ sap.ui.define([
|
|
|
78
77
|
|
|
79
78
|
if ( !window.hljs ) {
|
|
80
79
|
//solarized-light
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
includeStylesheet("resources/sap/ui/documentation/sdk/thirdparty/highlight.js/styles.css");
|
|
81
|
+
includeScript({ url: "resources/sap/ui/documentation/sdk/thirdparty/highlight.js/highlight.js" });
|
|
84
82
|
}
|
|
85
83
|
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
includeStylesheet("resources/sap/ui/documentation/sdk/thirdparty/DataTables/DataTables-1.10.15/css/dataTables.jqueryui.css");
|
|
85
|
+
includeStylesheet("resources/sap/ui/documentation/sdk/thirdparty/DataTables/Buttons-1.4.0/css/buttons.jqueryui.css");
|
|
88
86
|
|
|
89
87
|
// order is important
|
|
90
|
-
|
|
88
|
+
includeScript({ url: "resources/sap/ui/documentation/sdk/thirdparty/DataTables/DataTables-1.10.15/js/jquery.dataTables.js" })
|
|
91
89
|
.then(function () {
|
|
92
|
-
return
|
|
90
|
+
return includeScript({ url: "resources/sap/ui/documentation/sdk/thirdparty/DataTables/DataTables-1.10.15/js/dataTables.jqueryui.js" });
|
|
93
91
|
})
|
|
94
92
|
.then(function () {
|
|
95
|
-
return
|
|
93
|
+
return includeScript({ url: "resources/sap/ui/documentation/sdk/thirdparty/DataTables/Buttons-1.4.0/js/dataTables.buttons.js" });
|
|
96
94
|
})
|
|
97
95
|
.then(function () {
|
|
98
|
-
return
|
|
96
|
+
return includeScript({ url: "resources/sap/ui/documentation/sdk/thirdparty/DataTables/Buttons-1.4.0/js/buttons.jqueryui.js" });
|
|
99
97
|
})
|
|
100
98
|
.then(function () {
|
|
101
|
-
return
|
|
99
|
+
return includeScript({ url: "resources/sap/ui/documentation/sdk/thirdparty/DataTables/Buttons-1.4.0/js/buttons.html5.js" });
|
|
102
100
|
})
|
|
103
101
|
.then(function () {
|
|
104
|
-
return
|
|
102
|
+
return includeScript({ url: "resources/sap/ui/documentation/sdk/thirdparty/DataTables/Buttons-1.4.0/js/buttons.colVis.js" });
|
|
105
103
|
})
|
|
106
104
|
.then(function () {
|
|
107
105
|
dataTablesConfigURL = ResourcesUtil.getResourceOriginPath(oConfig.docuPath + 'dataTablesConfig.json');
|
|
@@ -8,7 +8,7 @@ sap.ui.define([
|
|
|
8
8
|
"sap/ui/documentation/sdk/controller/BaseController",
|
|
9
9
|
"sap/ui/Device",
|
|
10
10
|
"sap/ui/thirdparty/jquery"
|
|
11
|
-
], function(BaseController, Device,
|
|
11
|
+
], function(BaseController, Device, jQuery) {
|
|
12
12
|
"use strict";
|
|
13
13
|
|
|
14
14
|
var GIT_HUB_URL = "https://github.com/SAP/openui5-docs";
|
|
@@ -35,7 +35,7 @@ sap.ui.define([
|
|
|
35
35
|
* to show disclaimer message if such is available in the loaded json file.
|
|
36
36
|
*/
|
|
37
37
|
handleDocumentationDisclaimer: function () {
|
|
38
|
-
|
|
38
|
+
jQuery.ajax(this.getConfig().docuPath + "disclaimer.json", {dataType: "json"}).then(function (oData) {
|
|
39
39
|
var oView = this.getView();
|
|
40
40
|
if (oData.showDisclaimer && oData.message) {
|
|
41
41
|
oView.byId("disclaimerBlock").setVisible(true);
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/ui/documentation/sdk/controller/BaseController",
|
|
9
9
|
"sap/ui/Device",
|
|
10
|
+
"sap/ui/VersionInfo",
|
|
10
11
|
"sap/ui/model/json/JSONModel",
|
|
11
|
-
"sap/ui/model/resource/ResourceModel",
|
|
12
12
|
"sap/base/Log"
|
|
13
|
-
], function (BaseController, Device,
|
|
13
|
+
], function (BaseController, Device, VersionInfo, JSONModel, Log) {
|
|
14
14
|
"use strict";
|
|
15
15
|
|
|
16
16
|
return BaseController.extend("sap.ui.documentation.sdk.controller.Welcome", {
|
|
@@ -22,7 +22,7 @@ sap.ui.define([
|
|
|
22
22
|
onInit: function () {
|
|
23
23
|
this.getRouter().getRoute("welcome").attachPatternMatched(this._onMatched, this);
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
VersionInfo.load().then(function (oVersionInfo) {
|
|
26
26
|
var oModel = new JSONModel({
|
|
27
27
|
isOpenUI5: oVersionInfo && oVersionInfo.gav && /openui5/i.test(oVersionInfo.gav)
|
|
28
28
|
});
|
|
@@ -93,10 +93,9 @@ sap.ui.define([
|
|
|
93
93
|
|
|
94
94
|
_getRouteConfig: function(sRouteName) {
|
|
95
95
|
var oConfig = this._getSapUI5ConfigEntry(),
|
|
96
|
-
aRoutes = oConfig.routing.routes
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
return oRoute;
|
|
96
|
+
aRoutes = oConfig.routing.routes;
|
|
97
|
+
|
|
98
|
+
return aRoutes.find(function(oRoute){return oRoute.name === sRouteName; });
|
|
100
99
|
},
|
|
101
100
|
|
|
102
101
|
_getSapUI5ConfigEntry: function () {
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
// Provides information about 'explored' samples.
|
|
8
|
-
sap.ui.define(["sap/ui/thirdparty/jquery", 'sap/ui/documentation/library', "sap/base/Log"],
|
|
9
|
-
function(jQuery, library, Log) {
|
|
8
|
+
sap.ui.define(["sap/ui/thirdparty/jquery", 'sap/ui/documentation/library', "sap/base/Log", "sap/ui/documentation/sdk/util/Resources"],
|
|
9
|
+
function(jQuery, library, Log, ResourcesUtil) {
|
|
10
10
|
"use strict";
|
|
11
11
|
|
|
12
12
|
var oPromise;
|
|
@@ -52,7 +52,8 @@ sap.ui.define(["sap/ui/thirdparty/jquery", 'sap/ui/documentation/library', "sap/
|
|
|
52
52
|
"Data Binding",
|
|
53
53
|
"Data Visualization",
|
|
54
54
|
"Map",
|
|
55
|
-
"Utility"
|
|
55
|
+
"Utility",
|
|
56
|
+
"Web Components"
|
|
56
57
|
];
|
|
57
58
|
var afilterProps = ["namespace", "since", "category"]; // content density are set manually
|
|
58
59
|
var oFilterSets = {
|
|
@@ -118,7 +119,7 @@ sap.ui.define(["sap/ui/thirdparty/jquery", 'sap/ui/documentation/library', "sap/
|
|
|
118
119
|
oDoc.explored.samplesRef.forEach(function (oItem) {
|
|
119
120
|
(function() {
|
|
120
121
|
var paths = {};
|
|
121
|
-
paths[oItem.namespace.replace(/\./g, "/")] = "" + oItem.ref || ".";
|
|
122
|
+
paths[oItem.namespace.replace(/\./g, "/")] = "" + ResourcesUtil.getResourceOriginPath(oItem.ref || ".");
|
|
122
123
|
sap.ui.loader.config({paths: paths});
|
|
123
124
|
}());
|
|
124
125
|
});
|
|
@@ -126,7 +127,7 @@ sap.ui.define(["sap/ui/thirdparty/jquery", 'sap/ui/documentation/library', "sap/
|
|
|
126
127
|
// register a single namespace
|
|
127
128
|
(function() {
|
|
128
129
|
var paths = {};
|
|
129
|
-
paths[oDoc.explored.samplesRef.namespace.replace(/\./g, "/")] = "" + oDoc.explored.samplesRef.ref || ".";
|
|
130
|
+
paths[oDoc.explored.samplesRef.namespace.replace(/\./g, "/")] = "" + ResourcesUtil.getResourceOriginPath(oDoc.explored.samplesRef.ref || ".");
|
|
130
131
|
sap.ui.loader.config({paths: paths});
|
|
131
132
|
}());
|
|
132
133
|
}
|
|
@@ -420,4 +421,4 @@ sap.ui.define(["sap/ui/thirdparty/jquery", 'sap/ui/documentation/library', "sap/
|
|
|
420
421
|
|
|
421
422
|
return ControlsInfo;
|
|
422
423
|
|
|
423
|
-
}, /* bExport= */ true);
|
|
424
|
+
}, /* bExport= */ true);
|
package/src/sap/ui/documentation/sdk/controller/util/datatable/filters/DataTableFilterRange.js
CHANGED
|
@@ -6,11 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
sap.ui.define(
|
|
8
8
|
[
|
|
9
|
-
"jquery.sap.global",
|
|
10
9
|
'sap/ui/core/Control',
|
|
11
10
|
'./DataTableFilterRangeRenderer'
|
|
12
11
|
], function (
|
|
13
|
-
$,
|
|
14
12
|
Control,
|
|
15
13
|
DataTableFilterRangeRenderer
|
|
16
14
|
) {
|
|
@@ -44,8 +42,8 @@ sap.ui.define(
|
|
|
44
42
|
oFrom = this.getAggregation("from");
|
|
45
43
|
oTo = this.getAggregation("to");
|
|
46
44
|
|
|
47
|
-
[oFrom, oTo].forEach(function (
|
|
48
|
-
|
|
45
|
+
[oFrom, oTo].forEach(function (oControl) {
|
|
46
|
+
oControl.attachLiveChange(function () {
|
|
49
47
|
oValue = {
|
|
50
48
|
from: oFrom.getValue(),
|
|
51
49
|
to: oTo.getValue()
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
sap.ui.define(["
|
|
7
|
+
sap.ui.define(["./shapes/ShapeFactory"], function (ShapeFactory) {
|
|
8
8
|
"use strict";
|
|
9
9
|
|
|
10
10
|
var SVG_NAMESPACE = "http://www.w3.org/2000/svg";
|
|
@@ -6,12 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/ui/core/mvc/Controller",
|
|
9
|
-
"sap/m/library",
|
|
10
9
|
"sap/ui/model/json/JSONModel",
|
|
11
10
|
"sap/ui/core/Fragment",
|
|
12
11
|
"sap/ui/model/resource/ResourceModel",
|
|
13
12
|
"sap/ui/core/Core"
|
|
14
|
-
], function (Controller,
|
|
13
|
+
], function (Controller, JSONModel, Fragment, ResourceModel, Core) {
|
|
15
14
|
"use strict";
|
|
16
15
|
|
|
17
16
|
return Controller.extend("sap.ui.documentation.sdk.cookieSettingsDialog.controller.CookieSettingsDialog", {
|
|
@@ -6,48 +6,156 @@
|
|
|
6
6
|
<title>SAPUI5 Navigation</title>
|
|
7
7
|
<script>
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
var getUrlParam = function(sParamName) {
|
|
10
|
+
return new window.URLSearchParams(window.location.search).get(sParamName);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
var encodeOrigin = function (sResourceOrigin) {
|
|
14
|
+
return sResourceOrigin
|
|
15
|
+
.replaceAll("&", "&")
|
|
16
|
+
.replaceAll("<", "<")
|
|
17
|
+
.replaceAll(">", ">")
|
|
18
|
+
.replaceAll("\"", """)
|
|
19
|
+
.replaceAll("’", "'");
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
var sSampleId = getUrlParam('sap-ui-xx-sample-id'),
|
|
23
|
+
sOrigin = getUrlParam('sap-ui-xx-sample-origin'),
|
|
24
|
+
oPath = {};
|
|
13
25
|
|
|
14
|
-
oPath = {};
|
|
15
26
|
if (!sOrigin || sOrigin == ".") {
|
|
16
27
|
sOrigin = window.location.origin + (window.location.pathname.includes("testsuite") ? "/testsuite" : "");
|
|
17
|
-
} else {
|
|
18
|
-
sOrigin = sOrigin + sVersion;
|
|
19
28
|
}
|
|
20
29
|
|
|
21
|
-
oPath[sSampleId.replace(/\./g, "/")] = sSamplePath;
|
|
22
30
|
oPath["sap/ui/demo/mock"] = sOrigin + "/test-resources/sap/ui/documentation/sdk";
|
|
23
31
|
oPath["test-resources/sap/ui/documentation/sdk"] = ".";
|
|
24
|
-
oPath["sap/uxap/sample"] = sOrigin + "/test-resources/sap/uxap/demokit/sample";
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
document.write("<script src=" + sOrigin + '/resources/sap-ui-core.js' + " id='sap-ui-bootstrap' " +
|
|
29
|
-
"data-sap-ui-libs='sap.m' data-sap-ui-bindingSyntax='complex' data-sap-ui-compatVersion='edge'></scr" + "ipt>");
|
|
30
|
-
document.write("<base href=" + sOrigin + "/>");
|
|
31
32
|
|
|
33
|
+
document.write("<script src=" + encodeOrigin(sOrigin) + '/resources/sap-ui-core.js' + " id='sap-ui-bootstrap' " +
|
|
34
|
+
"data-sap-ui-libs='sap.m' data-sap-ui-bindingSyntax='complex' data-sap-ui-theme='sap_fiori_3' data-sap-ui-compatVersion='edge' data-sap-ui-resourceroots=" + JSON.stringify(oPath) + "></scr" + "ipt>");
|
|
35
|
+
document.write("<base href=" + encodeOrigin(sOrigin) + "/>");
|
|
32
36
|
</script>
|
|
33
37
|
</head>
|
|
34
38
|
<body class="sapUiBody sapUiSizeCompact" id="content">
|
|
35
39
|
<script>
|
|
36
40
|
sap.ui.getCore().attachInit(function () {
|
|
37
41
|
sap.ui.require([
|
|
38
|
-
"sap/ui/core/ComponentContainer"
|
|
39
|
-
|
|
42
|
+
"sap/ui/core/ComponentContainer",
|
|
43
|
+
"sap/ui/core/Component",
|
|
44
|
+
"sap/ui/documentation/sdk/controller/util/ControlsInfo",
|
|
45
|
+
"sap/base/Log"
|
|
46
|
+
], function (ComponentContainer, Component, ControlsInfo, Log) {
|
|
47
|
+
|
|
48
|
+
ControlsInfo.loadData().then(function(){
|
|
49
|
+
Log.info("Samples paths added successfully");
|
|
50
|
+
|
|
51
|
+
var sCompId = 'sampleComp-' + sSampleId;
|
|
52
|
+
var sCompName = sSampleId;
|
|
53
|
+
|
|
54
|
+
Promise.all([
|
|
55
|
+
sap.ui.getCore().loadLibrary("sap.ui.fl", {async: true}),
|
|
56
|
+
sap.ui.getCore().loadLibrary("sap.ui.rta", {async: true})
|
|
57
|
+
]).then(function () {
|
|
58
|
+
sap.ui.require([
|
|
59
|
+
"sap/ui/fl/Utils",
|
|
60
|
+
"sap/ui/fl/FakeLrepConnectorLocalStorage",
|
|
61
|
+
"sap/ui/core/util/reflection/JsControlTreeModifier"
|
|
62
|
+
], function(Utils,
|
|
63
|
+
FakeLrepConnectorLocalStorage,
|
|
64
|
+
JsControlTreeModifier) {
|
|
65
|
+
// fake stable IDs
|
|
66
|
+
JsControlTreeModifier.checkControlId = function () {
|
|
67
|
+
return true;
|
|
68
|
+
};
|
|
69
|
+
Utils.checkControlId = function() {
|
|
70
|
+
return true;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
FakeLrepConnectorLocalStorage.enableFakeConnector({
|
|
74
|
+
"isProductiveSystem": true
|
|
75
|
+
});
|
|
76
|
+
window.parent.postMessage({
|
|
77
|
+
type: "RTA",
|
|
78
|
+
data: {
|
|
79
|
+
"msg": "RTA is loaded"
|
|
80
|
+
}
|
|
81
|
+
}, getUrlParam('sap-ui-xx-dk-origin'))
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
Component.create({
|
|
86
|
+
id: sCompId,
|
|
87
|
+
name: sCompName
|
|
88
|
+
}).then(function (oComponent) {
|
|
40
89
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
90
|
+
var oContainer = new ComponentContainer({component : oComponent, height: "100%"})
|
|
91
|
+
.placeAt("content");
|
|
92
|
+
var oMessage = {};
|
|
93
|
+
oMessage.type = "INIT";
|
|
94
|
+
oMessage.data = {
|
|
95
|
+
"msg": "fired after component container is placed in DOM"
|
|
96
|
+
};
|
|
97
|
+
oMessage.config = oComponent.getMetadata().getConfig();
|
|
98
|
+
window.parent.postMessage(oMessage, getUrlParam('sap-ui-xx-dk-origin'));
|
|
44
99
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
100
|
+
window.addEventListener("message", function(eMessage){
|
|
101
|
+
if (eMessage.data.type === "EXIT") {
|
|
102
|
+
oComponent.destroy();
|
|
103
|
+
} else if (eMessage.data.type === "RTA") {
|
|
104
|
+
enableRta();
|
|
105
|
+
} else if (eMessage.data.type === "SETTINGS") {
|
|
106
|
+
if (eMessage.data.reason === "get") {
|
|
107
|
+
window.parent.postMessage({
|
|
108
|
+
type: "SETTINGS",
|
|
109
|
+
data: {
|
|
110
|
+
"density": document.body.classList[1],
|
|
111
|
+
"theme": sap.ui.getCore().getConfiguration().getTheme(),
|
|
112
|
+
"RTL": sap.ui.getCore().getConfiguration().getRTL()
|
|
113
|
+
}
|
|
114
|
+
}, getUrlParam('sap-ui-xx-dk-origin'));
|
|
115
|
+
} else if (eMessage.data.reason === "set") {
|
|
116
|
+
var sBodyDensityClass = Array.prototype.find.call(document.body.classList, function(el){
|
|
117
|
+
return el.includes("sapUiSize");
|
|
118
|
+
});
|
|
119
|
+
sBodyDensityClass ? document.body.classList.replace(sBodyDensityClass, eMessage.data.data.density) :
|
|
120
|
+
document.body.classList.add(eMessage.data.data.density);
|
|
121
|
+
sap.ui.getCore().getConfiguration().setRTL(eMessage.data.data.RTL);
|
|
122
|
+
sap.ui.getCore().applyTheme(eMessage.data.data.theme);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
});
|
|
50
126
|
|
|
127
|
+
function enableRta() {
|
|
128
|
+
sap.ui.require([
|
|
129
|
+
"sap/ui/rta/api/startKeyUserAdaptation"
|
|
130
|
+
], function (
|
|
131
|
+
startKeyUserAdaptation
|
|
132
|
+
) {
|
|
133
|
+
startKeyUserAdaptation({
|
|
134
|
+
rootControl: oContainer.getComponentInstance()
|
|
135
|
+
}).then(function (oRta) {
|
|
136
|
+
oContainer.$().css({
|
|
137
|
+
"padding-top": "2.5rem",
|
|
138
|
+
"box-sizing": "border-box"
|
|
139
|
+
});
|
|
140
|
+
oRta.attachStop(function () {
|
|
141
|
+
oContainer.$().css({
|
|
142
|
+
"padding-top": "0",
|
|
143
|
+
"box-sizing": "content-box"
|
|
144
|
+
});
|
|
145
|
+
oRta.destroy();
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
}).catch(function(err){
|
|
151
|
+
window.parent.postMessage({
|
|
152
|
+
type: "ERR",
|
|
153
|
+
data: {
|
|
154
|
+
"msg": err
|
|
155
|
+
}
|
|
156
|
+
}, getUrlParam('sap-ui-xx-dk-origin'));
|
|
157
|
+
});
|
|
158
|
+
})
|
|
51
159
|
});
|
|
52
160
|
});
|
|
53
161
|
</script>
|
|
@@ -23,7 +23,7 @@ sap.ui.define([
|
|
|
23
23
|
* Formats a library namespace to link to the API reference if it starts with sap.
|
|
24
24
|
*
|
|
25
25
|
* @public
|
|
26
|
-
* @param {string}
|
|
26
|
+
* @param {string} sLink value to be formatted
|
|
27
27
|
* @returns {string} formatted link
|
|
28
28
|
*/
|
|
29
29
|
crossLink: function (sLink) {
|
|
@@ -4,7 +4,12 @@
|
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
sap.ui.define([
|
|
7
|
+
sap.ui.define([
|
|
8
|
+
"sap/ui/documentation/library",
|
|
9
|
+
"sap/base/Log",
|
|
10
|
+
"sap/base/util/extend",
|
|
11
|
+
"sap/base/util/isPlainObject"
|
|
12
|
+
],function(library, Log, extend, isPlainObject) {
|
|
8
13
|
"use strict";
|
|
9
14
|
|
|
10
15
|
// function to compute the app objects for a demo object
|
|
@@ -12,7 +17,7 @@ sap.ui.define(["sap/ui/thirdparty/jquery", 'sap/ui/documentation/library', "sap/
|
|
|
12
17
|
// transform simple demo app link to a configuration object
|
|
13
18
|
var aLinks = [];
|
|
14
19
|
// transform link object to a bindable array of objects
|
|
15
|
-
if (
|
|
20
|
+
if (isPlainObject(oDemoAppMetadata.links)) {
|
|
16
21
|
aLinks = Object.keys(oDemoAppMetadata.links).map(function (sKey) {
|
|
17
22
|
return {
|
|
18
23
|
name: sKey,
|
|
@@ -52,7 +57,7 @@ sap.ui.define(["sap/ui/thirdparty/jquery", 'sap/ui/documentation/library', "sap/
|
|
|
52
57
|
* }
|
|
53
58
|
*
|
|
54
59
|
* Under path /demoApps the following properties can be found: lib, name, icon, desc, type, ref
|
|
55
|
-
* Under path /
|
|
60
|
+
* Under path /demoAppsByCategory the apps are structured by the entry "category" and grouped in batches
|
|
56
61
|
* of 4 items so that they can be bound to the BlockLayoutRow control directly
|
|
57
62
|
* @param {array} aLibs an array of the currently loaded UI5 libraries
|
|
58
63
|
* @param {object} oDocIndicies an object of the currently loaded UI5 library docu metadata
|
|
@@ -152,7 +157,7 @@ sap.ui.define(["sap/ui/thirdparty/jquery", 'sap/ui/documentation/library', "sap/
|
|
|
152
157
|
|
|
153
158
|
// set model
|
|
154
159
|
var oModelData = oModel.getData();
|
|
155
|
-
oModel.setData(
|
|
160
|
+
oModel.setData(extend(oModelData, createModelData(aLibs, oDocIndicies)));
|
|
156
161
|
}
|
|
157
162
|
|
|
158
163
|
// load and process all lib info
|
|
@@ -175,10 +175,14 @@ sap.ui.define([
|
|
|
175
175
|
* @private
|
|
176
176
|
*/
|
|
177
177
|
_destroySampleComponent: function () {
|
|
178
|
-
var
|
|
179
|
-
if (
|
|
180
|
-
|
|
181
|
-
|
|
178
|
+
var oSample = this._getOwnerComponent()._oCurrentOpenedSample;
|
|
179
|
+
if (oSample) {
|
|
180
|
+
oSample.getDomRef().contentWindow.postMessage({
|
|
181
|
+
type: "EXIT",
|
|
182
|
+
data: {
|
|
183
|
+
"msg": "Destroy the container"
|
|
184
|
+
}
|
|
185
|
+
}, this._getOwnerComponent()._sSampleIframeOrigin);
|
|
182
186
|
}
|
|
183
187
|
}
|
|
184
188
|
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
if (oUri && oUri.is("absolute")) {
|
|
31
31
|
return sPath;
|
|
32
32
|
}
|
|
33
|
-
sOrigin = this.getConfig()
|
|
33
|
+
sOrigin = this.getConfig();
|
|
34
34
|
|
|
35
35
|
return sOrigin + sVersionPrefixPath + this._formatPath(sPath);
|
|
36
36
|
},
|
|
@@ -42,7 +42,10 @@
|
|
|
42
42
|
return this.getHasProxy() && window.sessionStorage.getItem("versionPrefixPath") || "";
|
|
43
43
|
},
|
|
44
44
|
getConfig: function() {
|
|
45
|
-
return self['sap-ui-documentation-config'] && self['sap-ui-documentation-config'].demoKitResourceOrigin;
|
|
45
|
+
return self['sap-ui-documentation-config'] && self['sap-ui-documentation-config'].demoKitResourceOrigin || ".";
|
|
46
|
+
},
|
|
47
|
+
getResourceOrigin: function() {
|
|
48
|
+
return this.getConfig().replace("/sapui5", "").replace("/openui5", "");
|
|
46
49
|
},
|
|
47
50
|
_formatPath: function(sPath) {
|
|
48
51
|
sPath = sPath.replace(/^\.\//, '/');
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
class="sapUiHideOnPhone"
|
|
62
62
|
tooltip="{i18n>SAMPLE_ADAPT_BTN_TOOLTIP}"
|
|
63
63
|
press="onToggleAdaptationMode"
|
|
64
|
-
visible="{= ${/rtaLoaded}}" />
|
|
64
|
+
visible="{= ${/rtaLoaded} && !${/iframe} }" />
|
|
65
65
|
<Button
|
|
66
66
|
id="code"
|
|
67
67
|
icon="sap-icon://syntax"
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
icon="sap-icon://inspect"
|
|
74
74
|
press="onNewTab" />
|
|
75
75
|
<Button id="sampleSettings"
|
|
76
|
-
visible="{= ${/showSettings}}"
|
|
76
|
+
visible="{= ${/showSettings} && !${/iframe} }"
|
|
77
77
|
icon="sap-icon://action-settings"
|
|
78
78
|
press="handleSettings" />
|
|
79
79
|
<Button
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
@import "../base/library.source.less";
|
|
8
|
+
@import "../../../../../sap/ui/core/themes/sap_horizon_dark/base.less";
|
|
9
|
+
@import "../../../../../sap/ui/core/themes/sap_horizon_dark/global.less";
|