@sap-ux/preview-middleware 0.23.48 → 0.23.50
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/command-executor.js +99 -66
- package/dist/client/adp/controllers/AddCustomFragment.controller.js +120 -102
- package/dist/client/adp/controllers/AddFragment.controller.js +189 -163
- package/dist/client/adp/controllers/AddSubpage.controller.js +146 -137
- package/dist/client/adp/controllers/AddTableColumnFragments.controller.js +230 -188
- package/dist/client/adp/controllers/BaseDialog.controller.js +187 -164
- package/dist/client/adp/controllers/ControllerExtension.controller.js +329 -253
- package/dist/client/adp/controllers/ExtensionPoint.controller.js +158 -114
- package/dist/client/adp/extension-point.js +81 -60
- package/dist/client/adp/init.js +100 -99
- package/dist/client/adp/quick-actions/common/add-new-annotation-file.js +165 -147
- package/dist/client/adp/quick-actions/enablement-validator.js +0 -4
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +105 -100
- package/dist/client/adp/quick-actions/simple-quick-action-base.js +44 -40
- package/dist/client/adp/quick-actions/table-quick-action-base.js +309 -266
- package/dist/client/adp/sync-views-utils.js +119 -83
- package/dist/client/cpe/changes/flex-change.js +64 -48
- package/dist/client/cpe/changes/service.js +492 -367
- package/dist/client/cpe/communication-service.js +41 -29
- package/dist/client/cpe/connector-service.js +87 -64
- package/dist/client/cpe/context-menu-service.js +87 -74
- package/dist/client/cpe/control-data.js +353 -263
- package/dist/client/cpe/documentation.js +183 -126
- package/dist/client/cpe/init.js +69 -75
- package/dist/client/cpe/outline/service.js +60 -45
- package/dist/client/cpe/quick-actions/quick-action-definition.js +0 -4
- package/dist/client/cpe/quick-actions/quick-action-service.js +154 -129
- package/dist/client/cpe/rta-service.js +91 -69
- package/dist/client/cpe/selection.js +239 -187
- package/dist/client/cpe/types.js +0 -4
- package/dist/client/flp/init.js +403 -296
- package/dist/client/manifest.json +7 -4
- package/dist/client/thirdparty/@sap-ux-private/control-property-editor-common.js +444 -370
- package/dist/client/utils/info-center-message.js +59 -31
- package/dist/client/utils/version.js +128 -72
- package/package.json +4 -4
|
@@ -1,88 +1,124 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
Object.defineProperty(module, '__esModule', { value: true });
|
|
17
|
-
}
|
|
18
|
-
resolve(module);
|
|
19
|
-
}, function (err) {
|
|
20
|
-
reject(err);
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
const MessageBarType = ___sap_ux_private_control_property_editor_common['MessageBarType'];
|
|
25
|
-
const getError = ___utils_error['getError'];
|
|
26
|
-
const sendInfoCenterMessage = ___utils_info_center_message['sendInfoCenterMessage'];
|
|
27
|
-
const isLowerThanMinimalUi5Version = ___utils_version['isLowerThanMinimalUi5Version'];
|
|
28
|
-
const syncViews = new Set();
|
|
29
|
-
let warningShown = false;
|
|
30
|
-
async function updateSyncViewsIds(ui5VersionInfo) {
|
|
31
|
-
try {
|
|
32
|
-
if (isLowerThanMinimalUi5Version(ui5VersionInfo, {
|
|
33
|
-
major: 1,
|
|
34
|
-
minor: 120,
|
|
35
|
-
patch: 2
|
|
36
|
-
})) {
|
|
37
|
-
const elements = Element.registry.filter(() => true);
|
|
38
|
-
elements.forEach(ui5Element => {
|
|
39
|
-
if (isSyncView(ui5Element)) {
|
|
40
|
-
syncViews.add(ui5Element.getId());
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
} else {
|
|
44
|
-
const ElementRegistry = (await __ui5_require_async('sap/ui/core/ElementRegistry')).default;
|
|
45
|
-
const elements = ElementRegistry.all();
|
|
46
|
-
Object.entries(elements).forEach(_ref => {
|
|
47
|
-
let [key, ui5Element] = _ref;
|
|
48
|
-
if (isSyncView(ui5Element)) {
|
|
49
|
-
syncViews.add(key);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
} catch (error) {
|
|
54
|
-
Log.error('Could not get application sync views', getError(error));
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
async function showSyncViewsWarning() {
|
|
58
|
-
if (warningShown) {
|
|
59
|
-
return;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/base/Log", "sap/ui/core/Element", "open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common", "../utils/error", "../utils/info-center-message", "../utils/version"], function (Log, Element, ___sap_ux_private_control_property_editor_common, ___utils_error, ___utils_info_center_message, ___utils_version) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
function __ui5_require_async(path) {
|
|
7
|
+
return new Promise(function (resolve, reject) {
|
|
8
|
+
sap.ui.require([path], function (module) {
|
|
9
|
+
if (!(module && module.__esModule)) {
|
|
10
|
+
module = module === null || !(typeof module === "object" && path.endsWith("/library")) ? {
|
|
11
|
+
default: module
|
|
12
|
+
} : module;
|
|
13
|
+
Object.defineProperty(module, "__esModule", {
|
|
14
|
+
value: true
|
|
15
|
+
});
|
|
60
16
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
17
|
+
resolve(module);
|
|
18
|
+
}, function (err) {
|
|
19
|
+
reject(err);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
const MessageBarType = ___sap_ux_private_control_property_editor_common["MessageBarType"];
|
|
24
|
+
const getError = ___utils_error["getError"];
|
|
25
|
+
const sendInfoCenterMessage = ___utils_info_center_message["sendInfoCenterMessage"];
|
|
26
|
+
const isLowerThanMinimalUi5Version = ___utils_version["isLowerThanMinimalUi5Version"];
|
|
27
|
+
const syncViews = new Set();
|
|
28
|
+
let warningShown = false;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Get Ids for all sync views
|
|
32
|
+
*
|
|
33
|
+
* @param ui5VersionInfo UI5 Version Information
|
|
34
|
+
*
|
|
35
|
+
* @returns array of Ids for application sync views
|
|
36
|
+
*/
|
|
37
|
+
async function updateSyncViewsIds(ui5VersionInfo) {
|
|
38
|
+
try {
|
|
39
|
+
if (isLowerThanMinimalUi5Version(ui5VersionInfo, {
|
|
40
|
+
major: 1,
|
|
41
|
+
minor: 120,
|
|
42
|
+
patch: 2
|
|
43
|
+
})) {
|
|
44
|
+
const elements = Element.registry.filter(() => true);
|
|
45
|
+
elements.forEach(ui5Element => {
|
|
46
|
+
if (isSyncView(ui5Element)) {
|
|
47
|
+
syncViews.add(ui5Element.getId());
|
|
48
|
+
}
|
|
69
49
|
});
|
|
50
|
+
} else {
|
|
51
|
+
const ElementRegistry = (await __ui5_require_async('sap/ui/core/ElementRegistry')).default;
|
|
52
|
+
const elements = ElementRegistry.all();
|
|
53
|
+
Object.entries(elements).forEach(_ref => {
|
|
54
|
+
let [key, ui5Element] = _ref;
|
|
55
|
+
if (isSyncView(ui5Element)) {
|
|
56
|
+
syncViews.add(key);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
} catch (error) {
|
|
61
|
+
Log.error('Could not get application sync views', getError(error));
|
|
70
62
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Show warning message if there are sync views in the application and the warning has not been shown yet.
|
|
67
|
+
*/
|
|
68
|
+
async function showSyncViewsWarning() {
|
|
69
|
+
if (warningShown) {
|
|
70
|
+
return;
|
|
76
71
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
warningShown = false;
|
|
72
|
+
if (!syncViews.size) {
|
|
73
|
+
return;
|
|
80
74
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
75
|
+
warningShown = true;
|
|
76
|
+
await sendInfoCenterMessage({
|
|
77
|
+
title: {
|
|
78
|
+
key: 'ADP_SYNC_VIEWS_TITLE'
|
|
79
|
+
},
|
|
80
|
+
description: {
|
|
81
|
+
key: 'ADP_SYNC_VIEWS_MESSAGE'
|
|
82
|
+
},
|
|
83
|
+
type: MessageBarType.warning
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Check if element is sync view
|
|
89
|
+
*
|
|
90
|
+
* @param element Design time Element
|
|
91
|
+
* @returns boolean if element is sync view or not
|
|
92
|
+
*/
|
|
93
|
+
function isSyncView(element) {
|
|
94
|
+
return element?.getMetadata()?.getName()?.includes('XMLView') && element?.oAsyncState === undefined;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Retrieves the set of synchronious view IDs.
|
|
99
|
+
*
|
|
100
|
+
* @returns Cached set containing the IDs of all synchronious views.
|
|
101
|
+
*/
|
|
102
|
+
function getSyncViewIds() {
|
|
103
|
+
return syncViews;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Resets the cached synchronious views and warning state.
|
|
108
|
+
* Needed for testing purposes to ensure a clean state.
|
|
109
|
+
*/
|
|
110
|
+
function resetSyncViews() {
|
|
111
|
+
syncViews.clear();
|
|
112
|
+
warningShown = false;
|
|
113
|
+
}
|
|
114
|
+
var __exports = {
|
|
115
|
+
__esModule: true
|
|
116
|
+
};
|
|
117
|
+
__exports.updateSyncViewsIds = updateSyncViewsIds;
|
|
118
|
+
__exports.showSyncViewsWarning = showSyncViewsWarning;
|
|
119
|
+
__exports.isSyncView = isSyncView;
|
|
120
|
+
__exports.getSyncViewIds = getSyncViewIds;
|
|
121
|
+
__exports.resetSyncViews = resetSyncViews;
|
|
122
|
+
return __exports;
|
|
123
|
+
});
|
|
124
|
+
//# sourceMappingURL=sync-views-utils.js.map
|
|
@@ -1,50 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["sap/ui/rta/command/CommandFactory", "open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common", "./validator", "../../utils/fe-v4"], function (CommandFactory, ___sap_ux_private_control_property_editor_common, ___validator, ____utils_fe_v4) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const PropertyType = ___sap_ux_private_control_property_editor_common["PropertyType"];
|
|
7
|
+
const validateBindingModel = ___validator["validateBindingModel"];
|
|
8
|
+
const createManifestPropertyChange = ____utils_fe_v4["createManifestPropertyChange"];
|
|
9
|
+
/**
|
|
10
|
+
* Function to check a give value is a binding expression.
|
|
11
|
+
*
|
|
12
|
+
* @param value value to be checked.
|
|
13
|
+
* @returns boolean
|
|
14
|
+
*/
|
|
15
|
+
function isBindingExpression(value) {
|
|
16
|
+
return value.includes('{') && value.includes('}') && value.indexOf('{') < value.indexOf('}');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @param options UI5 adaptation options
|
|
22
|
+
* @param change changed property/app descriptor property of a control
|
|
23
|
+
*/
|
|
24
|
+
async function applyChange(options, change) {
|
|
25
|
+
const {
|
|
26
|
+
rta
|
|
27
|
+
} = options;
|
|
28
|
+
const isBindingString = typeof change.value === 'string' && isBindingExpression(change.value);
|
|
29
|
+
const flexSettings = rta.getFlexSettings();
|
|
30
|
+
const modifiedControl = sap.ui.getCore().byId(change.controlId);
|
|
31
|
+
if (!modifiedControl) {
|
|
32
|
+
return;
|
|
14
33
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const command = await createManifestPropertyChange(modifiedControl, flexSettings, { [change.propertyName]: change.value });
|
|
40
|
-
if (command) {
|
|
41
|
-
await rta.getCommandStack().pushAndExecute(command);
|
|
42
|
-
} else {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
34
|
+
if (change.propertyType === PropertyType.ControlProperty) {
|
|
35
|
+
const modifiedControlModifiedProperties = modifiedControl.getMetadata().getAllProperties()[change.propertyName];
|
|
36
|
+
const isBindingModel = isBindingString && modifiedControlModifiedProperties?.type === 'string';
|
|
37
|
+
const changeType = isBindingString ? 'BindProperty' : 'Property';
|
|
38
|
+
if (isBindingModel) {
|
|
39
|
+
await validateBindingModel(modifiedControl, change.value);
|
|
40
|
+
}
|
|
41
|
+
const property = isBindingString ? 'newBinding' : 'newValue';
|
|
42
|
+
const modifiedValue = {
|
|
43
|
+
generator: flexSettings.generator,
|
|
44
|
+
propertyName: change.propertyName,
|
|
45
|
+
[property]: change.value
|
|
46
|
+
};
|
|
47
|
+
const command = await CommandFactory.getCommandFor(modifiedControl, changeType, modifiedValue, null, flexSettings);
|
|
48
|
+
await rta.getCommandStack().pushAndExecute(command);
|
|
49
|
+
} else if (change.propertyType === PropertyType.Configuration) {
|
|
50
|
+
const command = await createManifestPropertyChange(modifiedControl, flexSettings, {
|
|
51
|
+
[change.propertyName]: change.value
|
|
52
|
+
});
|
|
53
|
+
if (command) {
|
|
54
|
+
await rta.getCommandStack().pushAndExecute(command);
|
|
55
|
+
} else {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
46
58
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
59
|
+
}
|
|
60
|
+
var __exports = {
|
|
61
|
+
__esModule: true
|
|
62
|
+
};
|
|
63
|
+
__exports.applyChange = applyChange;
|
|
64
|
+
return __exports;
|
|
65
|
+
});
|
|
66
|
+
//# sourceMappingURL=flex-change.js.map
|