@sap-ux/preview-middleware 0.16.4 → 0.16.5
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/dist/client/adp/api-handler.js +142 -142
- package/dist/client/adp/command-executor.js +58 -58
- package/dist/client/adp/control-utils.js +44 -44
- package/dist/client/adp/controllers/AddFragment.controller.js +219 -219
- package/dist/client/adp/controllers/BaseDialog.controller.js +105 -105
- package/dist/client/adp/controllers/ControllerExtension.controller.js +228 -228
- package/dist/client/adp/controllers/ExtensionPoint.controller.js +138 -138
- package/dist/client/adp/init-dialogs.js +121 -121
- package/dist/client/adp/ui5-version-utils.js +63 -63
- package/dist/client/adp/utils.js +61 -61
- package/dist/client/cpe/changes/flex-change.js +51 -51
- package/dist/client/cpe/changes/index.js +10 -10
- package/dist/client/cpe/changes/validator.js +34 -34
- package/dist/client/cpe/documentation.js +164 -164
- package/dist/client/cpe/error-utils.js +19 -19
- package/dist/client/cpe/logger.js +30 -30
- package/dist/client/cpe/outline/nodes.js +151 -151
- package/dist/client/cpe/outline/utils.js +37 -37
- package/dist/client/cpe/types.js +4 -4
- package/dist/client/cpe/ui5-utils.js +49 -49
- package/dist/client/cpe/utils.js +48 -48
- package/dist/client/flp/WorkspaceConnector.js +84 -84
- package/dist/client/flp/common.js +28 -28
- package/dist/client/flp/enableFakeConnector.js +84 -84
- package/dist/client/flp/initConnectors.js +33 -33
- package/dist/client/flp/initRta.js +178 -178
- package/package.json +2 -2
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define([], function () {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Returns the Error if the error is an instance of `Error` otherwise a new Error instance with string representation of the error.
|
|
8
|
-
*
|
|
9
|
-
* @param error {unknown} - the error instance
|
|
10
|
-
* @returns {Error} the error
|
|
11
|
-
*/
|
|
12
|
-
function getError(error) {
|
|
13
|
-
return error instanceof Error ? error : new Error(JSON.stringify(error));
|
|
14
|
-
}
|
|
15
|
-
var __exports = {
|
|
16
|
-
__esModule: true
|
|
17
|
-
};
|
|
18
|
-
__exports.getError = getError;
|
|
19
|
-
return __exports;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define([], function () {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Returns the Error if the error is an instance of `Error` otherwise a new Error instance with string representation of the error.
|
|
8
|
+
*
|
|
9
|
+
* @param error {unknown} - the error instance
|
|
10
|
+
* @returns {Error} the error
|
|
11
|
+
*/
|
|
12
|
+
function getError(error) {
|
|
13
|
+
return error instanceof Error ? error : new Error(JSON.stringify(error));
|
|
14
|
+
}
|
|
15
|
+
var __exports = {
|
|
16
|
+
__esModule: true
|
|
17
|
+
};
|
|
18
|
+
__exports.getError = getError;
|
|
19
|
+
return __exports;
|
|
20
20
|
});
|
|
21
21
|
//# sourceMappingURL=error-utils.js.map
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["sap/base/Log"], function (Log) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
function getString(message) {
|
|
7
|
-
if (typeof message === 'object') {
|
|
8
|
-
return JSON.stringify(message).toString();
|
|
9
|
-
}
|
|
10
|
-
return message;
|
|
11
|
-
}
|
|
12
|
-
const logger = {
|
|
13
|
-
info: message => {
|
|
14
|
-
Log.info(getString(message));
|
|
15
|
-
},
|
|
16
|
-
debug: message => {
|
|
17
|
-
Log.debug(getString(message));
|
|
18
|
-
},
|
|
19
|
-
warn: message => {
|
|
20
|
-
Log.warning(getString(message));
|
|
21
|
-
},
|
|
22
|
-
error: message => {
|
|
23
|
-
Log.error(getString(message));
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
var __exports = {
|
|
27
|
-
__esModule: true
|
|
28
|
-
};
|
|
29
|
-
__exports.logger = logger;
|
|
30
|
-
return __exports;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/base/Log"], function (Log) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
function getString(message) {
|
|
7
|
+
if (typeof message === 'object') {
|
|
8
|
+
return JSON.stringify(message).toString();
|
|
9
|
+
}
|
|
10
|
+
return message;
|
|
11
|
+
}
|
|
12
|
+
const logger = {
|
|
13
|
+
info: message => {
|
|
14
|
+
Log.info(getString(message));
|
|
15
|
+
},
|
|
16
|
+
debug: message => {
|
|
17
|
+
Log.debug(getString(message));
|
|
18
|
+
},
|
|
19
|
+
warn: message => {
|
|
20
|
+
Log.warning(getString(message));
|
|
21
|
+
},
|
|
22
|
+
error: message => {
|
|
23
|
+
Log.error(getString(message));
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
var __exports = {
|
|
27
|
+
__esModule: true
|
|
28
|
+
};
|
|
29
|
+
__exports.logger = logger;
|
|
30
|
+
return __exports;
|
|
31
31
|
});
|
|
32
32
|
//# sourceMappingURL=logger.js.map
|
|
@@ -1,153 +1,153 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["./utils"], function (___utils) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const isEditable = ___utils["isEditable"];
|
|
7
|
-
/**
|
|
8
|
-
* Retrieves additional data for a given control ID.
|
|
9
|
-
*
|
|
10
|
-
* @param id The unique identifier of the control.
|
|
11
|
-
* @returns An object containing the text and the technical name of the control.
|
|
12
|
-
*/
|
|
13
|
-
function getAdditionalData(id) {
|
|
14
|
-
const control = sap.ui.getCore().byId(id);
|
|
15
|
-
if (!control) {
|
|
16
|
-
return {};
|
|
17
|
-
}
|
|
18
|
-
const metadata = control.getMetadata();
|
|
19
|
-
let details = {};
|
|
20
|
-
const technicalName = metadata.getElementName();
|
|
21
|
-
if (technicalName) {
|
|
22
|
-
details.technicalName = technicalName;
|
|
23
|
-
}
|
|
24
|
-
if (metadata.getProperty('text')) {
|
|
25
|
-
const text = control.getProperty('text');
|
|
26
|
-
if (typeof text === 'string' && text.trim() !== '') {
|
|
27
|
-
details.text = text;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return details;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Gets the children nodes of an aggregation type node.
|
|
35
|
-
*
|
|
36
|
-
* @param current The current node to retrieve children from
|
|
37
|
-
* @returns An array of children nodes, or an empty array if none are found
|
|
38
|
-
*/
|
|
39
|
-
function getChildren(current) {
|
|
40
|
-
return (current.elements ?? []).flatMap(element => element.type === 'aggregation' ? element.elements ?? [] : []);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Adds a new child node to the extension point's children array based on the given control ID.
|
|
45
|
-
*
|
|
46
|
-
* @param {string} id - The unique identifier of the control to be added as a child node.
|
|
47
|
-
* @param {OutlineNode[]} children - The array of children nodes to which the new node will be added.
|
|
48
|
-
*/
|
|
49
|
-
function addChildToExtensionPoint(id, children) {
|
|
50
|
-
const {
|
|
51
|
-
text,
|
|
52
|
-
technicalName
|
|
53
|
-
} = getAdditionalData(id);
|
|
54
|
-
const editable = isEditable(id);
|
|
55
|
-
children.push({
|
|
56
|
-
controlId: id,
|
|
57
|
-
controlType: technicalName ?? 'sap.ui.extensionpoint.child',
|
|
58
|
-
name: text ?? id,
|
|
59
|
-
visible: true,
|
|
60
|
-
editable,
|
|
61
|
-
children: [],
|
|
62
|
-
hasDefaultContent: false
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Transform node.
|
|
68
|
-
*
|
|
69
|
-
* @param input outline view node
|
|
70
|
-
* @param scenario type of project
|
|
71
|
-
* @param extPointIDs ids that need are filled when extension point has default content or created controls inside
|
|
72
|
-
* @returns {Promise<OutlineNode[]>} transformed outline tree nodes
|
|
73
|
-
*/
|
|
74
|
-
async function transformNodes(input, scenario) {
|
|
75
|
-
const stack = [...input];
|
|
76
|
-
const items = [];
|
|
77
|
-
while (stack.length) {
|
|
78
|
-
const current = stack.shift();
|
|
79
|
-
const editable = isEditable(current?.id);
|
|
80
|
-
const isAdp = scenario === 'ADAPTATION_PROJECT';
|
|
81
|
-
const isExtPoint = current?.type === 'extensionPoint';
|
|
82
|
-
if (current?.type === 'element') {
|
|
83
|
-
const children = getChildren(current);
|
|
84
|
-
const {
|
|
85
|
-
text
|
|
86
|
-
} = getAdditionalData(current.id);
|
|
87
|
-
const technicalName = current.technicalName.split('.').slice(-1)[0];
|
|
88
|
-
const transformedChildren = isAdp ? await handleDuplicateNodes(children, scenario) : await transformNodes(children, scenario);
|
|
89
|
-
const node = {
|
|
90
|
-
controlId: current.id,
|
|
91
|
-
controlType: current.technicalName,
|
|
92
|
-
name: text ?? technicalName,
|
|
93
|
-
editable,
|
|
94
|
-
visible: current.visible ?? true,
|
|
95
|
-
children: transformedChildren
|
|
96
|
-
};
|
|
97
|
-
items.push(node);
|
|
98
|
-
}
|
|
99
|
-
if (isAdp && isExtPoint) {
|
|
100
|
-
const {
|
|
101
|
-
defaultContent,
|
|
102
|
-
createdControls
|
|
103
|
-
} = current.extensionPointInfo;
|
|
104
|
-
let children = [];
|
|
105
|
-
// We can combine both because there can only be either defaultContent or createdControls for one extension point node.
|
|
106
|
-
[...defaultContent, ...createdControls].forEach(id => {
|
|
107
|
-
addChildToExtensionPoint(id, children);
|
|
108
|
-
});
|
|
109
|
-
const node = {
|
|
110
|
-
controlId: current.id,
|
|
111
|
-
controlType: current.technicalName,
|
|
112
|
-
name: current.name ?? '',
|
|
113
|
-
editable,
|
|
114
|
-
visible: current.visible ?? true,
|
|
115
|
-
children,
|
|
116
|
-
hasDefaultContent: defaultContent.length > 0
|
|
117
|
-
};
|
|
118
|
-
items.push(node);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
return items;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Handles duplicate nodes that are retrieved from extension point default content and created controls,
|
|
126
|
-
* if they exist under an extension point these controls are removed from the children array
|
|
127
|
-
*
|
|
128
|
-
* @param children outline view node children
|
|
129
|
-
* @param scenario type of project
|
|
130
|
-
* @returns transformed outline tree nodes
|
|
131
|
-
*/
|
|
132
|
-
async function handleDuplicateNodes(children, scenario) {
|
|
133
|
-
const extPointIDs = new Set();
|
|
134
|
-
children.forEach(child => {
|
|
135
|
-
if (child.type === 'extensionPoint') {
|
|
136
|
-
const {
|
|
137
|
-
defaultContent,
|
|
138
|
-
createdControls
|
|
139
|
-
} = child.extensionPointInfo;
|
|
140
|
-
[...defaultContent, ...createdControls].forEach(id => extPointIDs.add(id));
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
const uniqueChildren = children.filter(child => !extPointIDs.has(child.id));
|
|
144
|
-
return transformNodes(uniqueChildren, scenario);
|
|
145
|
-
}
|
|
146
|
-
var __exports = {
|
|
147
|
-
__esModule: true
|
|
148
|
-
};
|
|
149
|
-
__exports.transformNodes = transformNodes;
|
|
150
|
-
__exports.handleDuplicateNodes = handleDuplicateNodes;
|
|
151
|
-
return __exports;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["./utils"], function (___utils) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const isEditable = ___utils["isEditable"];
|
|
7
|
+
/**
|
|
8
|
+
* Retrieves additional data for a given control ID.
|
|
9
|
+
*
|
|
10
|
+
* @param id The unique identifier of the control.
|
|
11
|
+
* @returns An object containing the text and the technical name of the control.
|
|
12
|
+
*/
|
|
13
|
+
function getAdditionalData(id) {
|
|
14
|
+
const control = sap.ui.getCore().byId(id);
|
|
15
|
+
if (!control) {
|
|
16
|
+
return {};
|
|
17
|
+
}
|
|
18
|
+
const metadata = control.getMetadata();
|
|
19
|
+
let details = {};
|
|
20
|
+
const technicalName = metadata.getElementName();
|
|
21
|
+
if (technicalName) {
|
|
22
|
+
details.technicalName = technicalName;
|
|
23
|
+
}
|
|
24
|
+
if (metadata.getProperty('text')) {
|
|
25
|
+
const text = control.getProperty('text');
|
|
26
|
+
if (typeof text === 'string' && text.trim() !== '') {
|
|
27
|
+
details.text = text;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return details;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Gets the children nodes of an aggregation type node.
|
|
35
|
+
*
|
|
36
|
+
* @param current The current node to retrieve children from
|
|
37
|
+
* @returns An array of children nodes, or an empty array if none are found
|
|
38
|
+
*/
|
|
39
|
+
function getChildren(current) {
|
|
40
|
+
return (current.elements ?? []).flatMap(element => element.type === 'aggregation' ? element.elements ?? [] : []);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Adds a new child node to the extension point's children array based on the given control ID.
|
|
45
|
+
*
|
|
46
|
+
* @param {string} id - The unique identifier of the control to be added as a child node.
|
|
47
|
+
* @param {OutlineNode[]} children - The array of children nodes to which the new node will be added.
|
|
48
|
+
*/
|
|
49
|
+
function addChildToExtensionPoint(id, children) {
|
|
50
|
+
const {
|
|
51
|
+
text,
|
|
52
|
+
technicalName
|
|
53
|
+
} = getAdditionalData(id);
|
|
54
|
+
const editable = isEditable(id);
|
|
55
|
+
children.push({
|
|
56
|
+
controlId: id,
|
|
57
|
+
controlType: technicalName ?? 'sap.ui.extensionpoint.child',
|
|
58
|
+
name: text ?? id,
|
|
59
|
+
visible: true,
|
|
60
|
+
editable,
|
|
61
|
+
children: [],
|
|
62
|
+
hasDefaultContent: false
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Transform node.
|
|
68
|
+
*
|
|
69
|
+
* @param input outline view node
|
|
70
|
+
* @param scenario type of project
|
|
71
|
+
* @param extPointIDs ids that need are filled when extension point has default content or created controls inside
|
|
72
|
+
* @returns {Promise<OutlineNode[]>} transformed outline tree nodes
|
|
73
|
+
*/
|
|
74
|
+
async function transformNodes(input, scenario) {
|
|
75
|
+
const stack = [...input];
|
|
76
|
+
const items = [];
|
|
77
|
+
while (stack.length) {
|
|
78
|
+
const current = stack.shift();
|
|
79
|
+
const editable = isEditable(current?.id);
|
|
80
|
+
const isAdp = scenario === 'ADAPTATION_PROJECT';
|
|
81
|
+
const isExtPoint = current?.type === 'extensionPoint';
|
|
82
|
+
if (current?.type === 'element') {
|
|
83
|
+
const children = getChildren(current);
|
|
84
|
+
const {
|
|
85
|
+
text
|
|
86
|
+
} = getAdditionalData(current.id);
|
|
87
|
+
const technicalName = current.technicalName.split('.').slice(-1)[0];
|
|
88
|
+
const transformedChildren = isAdp ? await handleDuplicateNodes(children, scenario) : await transformNodes(children, scenario);
|
|
89
|
+
const node = {
|
|
90
|
+
controlId: current.id,
|
|
91
|
+
controlType: current.technicalName,
|
|
92
|
+
name: text ?? technicalName,
|
|
93
|
+
editable,
|
|
94
|
+
visible: current.visible ?? true,
|
|
95
|
+
children: transformedChildren
|
|
96
|
+
};
|
|
97
|
+
items.push(node);
|
|
98
|
+
}
|
|
99
|
+
if (isAdp && isExtPoint) {
|
|
100
|
+
const {
|
|
101
|
+
defaultContent,
|
|
102
|
+
createdControls
|
|
103
|
+
} = current.extensionPointInfo;
|
|
104
|
+
let children = [];
|
|
105
|
+
// We can combine both because there can only be either defaultContent or createdControls for one extension point node.
|
|
106
|
+
[...defaultContent, ...createdControls].forEach(id => {
|
|
107
|
+
addChildToExtensionPoint(id, children);
|
|
108
|
+
});
|
|
109
|
+
const node = {
|
|
110
|
+
controlId: current.id,
|
|
111
|
+
controlType: current.technicalName,
|
|
112
|
+
name: current.name ?? '',
|
|
113
|
+
editable,
|
|
114
|
+
visible: current.visible ?? true,
|
|
115
|
+
children,
|
|
116
|
+
hasDefaultContent: defaultContent.length > 0
|
|
117
|
+
};
|
|
118
|
+
items.push(node);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return items;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Handles duplicate nodes that are retrieved from extension point default content and created controls,
|
|
126
|
+
* if they exist under an extension point these controls are removed from the children array
|
|
127
|
+
*
|
|
128
|
+
* @param children outline view node children
|
|
129
|
+
* @param scenario type of project
|
|
130
|
+
* @returns transformed outline tree nodes
|
|
131
|
+
*/
|
|
132
|
+
async function handleDuplicateNodes(children, scenario) {
|
|
133
|
+
const extPointIDs = new Set();
|
|
134
|
+
children.forEach(child => {
|
|
135
|
+
if (child.type === 'extensionPoint') {
|
|
136
|
+
const {
|
|
137
|
+
defaultContent,
|
|
138
|
+
createdControls
|
|
139
|
+
} = child.extensionPointInfo;
|
|
140
|
+
[...defaultContent, ...createdControls].forEach(id => extPointIDs.add(id));
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
const uniqueChildren = children.filter(child => !extPointIDs.has(child.id));
|
|
144
|
+
return transformNodes(uniqueChildren, scenario);
|
|
145
|
+
}
|
|
146
|
+
var __exports = {
|
|
147
|
+
__esModule: true
|
|
148
|
+
};
|
|
149
|
+
__exports.transformNodes = transformNodes;
|
|
150
|
+
__exports.handleDuplicateNodes = handleDuplicateNodes;
|
|
151
|
+
return __exports;
|
|
152
152
|
});
|
|
153
153
|
//# sourceMappingURL=nodes.js.map
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["../control-data", "../utils", "sap/ui/dt/OverlayUtil", "sap/ui/dt/OverlayRegistry", "../ui5-utils"], function (___control_data, ___utils, OverlayUtil, OverlayRegistry, ___ui5_utils) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const buildControlData = ___control_data["buildControlData"];
|
|
7
|
-
const getRuntimeControl = ___utils["getRuntimeControl"];
|
|
8
|
-
const getComponent = ___ui5_utils["getComponent"];
|
|
9
|
-
const isEditable = function () {
|
|
10
|
-
let id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
11
|
-
let editable = false;
|
|
12
|
-
const control = sap.ui.getCore().byId(id);
|
|
13
|
-
if (!control) {
|
|
14
|
-
const component = getComponent(id);
|
|
15
|
-
if (component) {
|
|
16
|
-
return editable;
|
|
17
|
-
}
|
|
18
|
-
} else {
|
|
19
|
-
let controlOverlay = OverlayRegistry.getOverlay(control);
|
|
20
|
-
if (!controlOverlay?.getDomRef()) {
|
|
21
|
-
//look for closest control
|
|
22
|
-
controlOverlay = OverlayUtil.getClosestOverlayFor(control);
|
|
23
|
-
}
|
|
24
|
-
if (controlOverlay) {
|
|
25
|
-
const runtimeControl = getRuntimeControl(controlOverlay);
|
|
26
|
-
const controlData = buildControlData(runtimeControl, controlOverlay);
|
|
27
|
-
const prop = controlData.properties.find(item => item.isEnabled === true);
|
|
28
|
-
editable = prop !== undefined;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return editable;
|
|
32
|
-
};
|
|
33
|
-
var __exports = {
|
|
34
|
-
__esModule: true
|
|
35
|
-
};
|
|
36
|
-
__exports.isEditable = isEditable;
|
|
37
|
-
return __exports;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["../control-data", "../utils", "sap/ui/dt/OverlayUtil", "sap/ui/dt/OverlayRegistry", "../ui5-utils"], function (___control_data, ___utils, OverlayUtil, OverlayRegistry, ___ui5_utils) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const buildControlData = ___control_data["buildControlData"];
|
|
7
|
+
const getRuntimeControl = ___utils["getRuntimeControl"];
|
|
8
|
+
const getComponent = ___ui5_utils["getComponent"];
|
|
9
|
+
const isEditable = function () {
|
|
10
|
+
let id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
11
|
+
let editable = false;
|
|
12
|
+
const control = sap.ui.getCore().byId(id);
|
|
13
|
+
if (!control) {
|
|
14
|
+
const component = getComponent(id);
|
|
15
|
+
if (component) {
|
|
16
|
+
return editable;
|
|
17
|
+
}
|
|
18
|
+
} else {
|
|
19
|
+
let controlOverlay = OverlayRegistry.getOverlay(control);
|
|
20
|
+
if (!controlOverlay?.getDomRef()) {
|
|
21
|
+
//look for closest control
|
|
22
|
+
controlOverlay = OverlayUtil.getClosestOverlayFor(control);
|
|
23
|
+
}
|
|
24
|
+
if (controlOverlay) {
|
|
25
|
+
const runtimeControl = getRuntimeControl(controlOverlay);
|
|
26
|
+
const controlData = buildControlData(runtimeControl, controlOverlay);
|
|
27
|
+
const prop = controlData.properties.find(item => item.isEnabled === true);
|
|
28
|
+
editable = prop !== undefined;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return editable;
|
|
32
|
+
};
|
|
33
|
+
var __exports = {
|
|
34
|
+
__esModule: true
|
|
35
|
+
};
|
|
36
|
+
__exports.isEditable = isEditable;
|
|
37
|
+
return __exports;
|
|
38
38
|
});
|
|
39
39
|
//# sourceMappingURL=utils.js.map
|
package/dist/client/cpe/types.js
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["sap/ui/core/Component", "sap/ui/core/IconPool"], function (Component, IconPool) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Gets Component by id.
|
|
8
|
-
*
|
|
9
|
-
* @param id - unique identifier for control
|
|
10
|
-
* @returns Component | undefined
|
|
11
|
-
*/
|
|
12
|
-
function getComponent(id) {
|
|
13
|
-
if (Component?.get) {
|
|
14
|
-
return Component.get(id);
|
|
15
|
-
} else {
|
|
16
|
-
// Older version must be still supported until maintenance period.
|
|
17
|
-
return sap.ui.getCore().getComponent(id); // NOSONAR
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Get ui5 icons.
|
|
23
|
-
*
|
|
24
|
-
* @returns IconDetails[]
|
|
25
|
-
*/
|
|
26
|
-
function getIcons() {
|
|
27
|
-
return IconPool.getIconNames('undefined').map(icon => {
|
|
28
|
-
const iconInfo = IconPool.getIconInfo(icon);
|
|
29
|
-
return {
|
|
30
|
-
name: icon.toLowerCase(),
|
|
31
|
-
content: iconInfo.content,
|
|
32
|
-
fontFamily: iconInfo.fontFamily
|
|
33
|
-
};
|
|
34
|
-
}).sort((item1, item2) => {
|
|
35
|
-
if (item1.name < item2.name) {
|
|
36
|
-
return -1;
|
|
37
|
-
}
|
|
38
|
-
if (item1.name > item2.name) {
|
|
39
|
-
return 1;
|
|
40
|
-
}
|
|
41
|
-
return 0;
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
var __exports = {
|
|
45
|
-
__esModule: true
|
|
46
|
-
};
|
|
47
|
-
__exports.getComponent = getComponent;
|
|
48
|
-
__exports.getIcons = getIcons;
|
|
49
|
-
return __exports;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/core/Component", "sap/ui/core/IconPool"], function (Component, IconPool) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Gets Component by id.
|
|
8
|
+
*
|
|
9
|
+
* @param id - unique identifier for control
|
|
10
|
+
* @returns Component | undefined
|
|
11
|
+
*/
|
|
12
|
+
function getComponent(id) {
|
|
13
|
+
if (Component?.get) {
|
|
14
|
+
return Component.get(id);
|
|
15
|
+
} else {
|
|
16
|
+
// Older version must be still supported until maintenance period.
|
|
17
|
+
return sap.ui.getCore().getComponent(id); // NOSONAR
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Get ui5 icons.
|
|
23
|
+
*
|
|
24
|
+
* @returns IconDetails[]
|
|
25
|
+
*/
|
|
26
|
+
function getIcons() {
|
|
27
|
+
return IconPool.getIconNames('undefined').map(icon => {
|
|
28
|
+
const iconInfo = IconPool.getIconInfo(icon);
|
|
29
|
+
return {
|
|
30
|
+
name: icon.toLowerCase(),
|
|
31
|
+
content: iconInfo.content,
|
|
32
|
+
fontFamily: iconInfo.fontFamily
|
|
33
|
+
};
|
|
34
|
+
}).sort((item1, item2) => {
|
|
35
|
+
if (item1.name < item2.name) {
|
|
36
|
+
return -1;
|
|
37
|
+
}
|
|
38
|
+
if (item1.name > item2.name) {
|
|
39
|
+
return 1;
|
|
40
|
+
}
|
|
41
|
+
return 0;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
var __exports = {
|
|
45
|
+
__esModule: true
|
|
46
|
+
};
|
|
47
|
+
__exports.getComponent = getComponent;
|
|
48
|
+
__exports.getIcons = getIcons;
|
|
49
|
+
return __exports;
|
|
50
50
|
});
|
|
51
51
|
//# sourceMappingURL=ui5-utils.js.map
|