@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.
Files changed (36) hide show
  1. package/dist/client/adp/command-executor.js +99 -66
  2. package/dist/client/adp/controllers/AddCustomFragment.controller.js +120 -102
  3. package/dist/client/adp/controllers/AddFragment.controller.js +189 -163
  4. package/dist/client/adp/controllers/AddSubpage.controller.js +146 -137
  5. package/dist/client/adp/controllers/AddTableColumnFragments.controller.js +230 -188
  6. package/dist/client/adp/controllers/BaseDialog.controller.js +187 -164
  7. package/dist/client/adp/controllers/ControllerExtension.controller.js +329 -253
  8. package/dist/client/adp/controllers/ExtensionPoint.controller.js +158 -114
  9. package/dist/client/adp/extension-point.js +81 -60
  10. package/dist/client/adp/init.js +100 -99
  11. package/dist/client/adp/quick-actions/common/add-new-annotation-file.js +165 -147
  12. package/dist/client/adp/quick-actions/enablement-validator.js +0 -4
  13. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +105 -100
  14. package/dist/client/adp/quick-actions/simple-quick-action-base.js +44 -40
  15. package/dist/client/adp/quick-actions/table-quick-action-base.js +309 -266
  16. package/dist/client/adp/sync-views-utils.js +119 -83
  17. package/dist/client/cpe/changes/flex-change.js +64 -48
  18. package/dist/client/cpe/changes/service.js +492 -367
  19. package/dist/client/cpe/communication-service.js +41 -29
  20. package/dist/client/cpe/connector-service.js +87 -64
  21. package/dist/client/cpe/context-menu-service.js +87 -74
  22. package/dist/client/cpe/control-data.js +353 -263
  23. package/dist/client/cpe/documentation.js +183 -126
  24. package/dist/client/cpe/init.js +69 -75
  25. package/dist/client/cpe/outline/service.js +60 -45
  26. package/dist/client/cpe/quick-actions/quick-action-definition.js +0 -4
  27. package/dist/client/cpe/quick-actions/quick-action-service.js +154 -129
  28. package/dist/client/cpe/rta-service.js +91 -69
  29. package/dist/client/cpe/selection.js +239 -187
  30. package/dist/client/cpe/types.js +0 -4
  31. package/dist/client/flp/init.js +403 -296
  32. package/dist/client/manifest.json +7 -4
  33. package/dist/client/thirdparty/@sap-ux-private/control-property-editor-common.js +444 -370
  34. package/dist/client/utils/info-center-message.js +59 -31
  35. package/dist/client/utils/version.js +128 -72
  36. package/package.json +4 -4
@@ -1,88 +1,124 @@
1
- 'use strict';
2
- sap.ui.define([
3
- 'sap/base/Log',
4
- 'sap/ui/core/Element',
5
- 'open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common',
6
- '../utils/error',
7
- '../utils/info-center-message',
8
- '../utils/version'
9
- ], function (Log, Element, ___sap_ux_private_control_property_editor_common, ___utils_error, ___utils_info_center_message, ___utils_version) {
10
- 'use strict';
11
- function __ui5_require_async(path) {
12
- return new Promise(function (resolve, reject) {
13
- sap.ui.require([path], function (module) {
14
- if (!(module && module.__esModule)) {
15
- module = module === null || !(typeof module === 'object' && path.endsWith('/library')) ? { default: module } : module;
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
- if (!syncViews.size) {
62
- return;
63
- }
64
- warningShown = true;
65
- await sendInfoCenterMessage({
66
- title: { key: 'ADP_SYNC_VIEWS_TITLE' },
67
- description: { key: 'ADP_SYNC_VIEWS_MESSAGE' },
68
- type: MessageBarType.warning
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
- function isSyncView(element) {
72
- return element?.getMetadata()?.getName()?.includes('XMLView') && element?.oAsyncState === undefined;
73
- }
74
- function getSyncViewIds() {
75
- return syncViews;
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
- function resetSyncViews() {
78
- syncViews.clear();
79
- warningShown = false;
72
+ if (!syncViews.size) {
73
+ return;
80
74
  }
81
- var __exports = { __esModule: true };
82
- __exports.updateSyncViewsIds = updateSyncViewsIds;
83
- __exports.showSyncViewsWarning = showSyncViewsWarning;
84
- __exports.isSyncView = isSyncView;
85
- __exports.getSyncViewIds = getSyncViewIds;
86
- __exports.resetSyncViews = resetSyncViews;
87
- return __exports;
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
- 'use strict';
2
- sap.ui.define([
3
- 'sap/ui/rta/command/CommandFactory',
4
- 'open/ux/preview/client/thirdparty/@sap-ux-private/control-property-editor-common',
5
- './validator',
6
- '../../utils/fe-v4'
7
- ], function (CommandFactory, ___sap_ux_private_control_property_editor_common, ___validator, ____utils_fe_v4) {
8
- 'use strict';
9
- const PropertyType = ___sap_ux_private_control_property_editor_common['PropertyType'];
10
- const validateBindingModel = ___validator['validateBindingModel'];
11
- const createManifestPropertyChange = ____utils_fe_v4['createManifestPropertyChange'];
12
- function isBindingExpression(value) {
13
- return value.includes('{') && value.includes('}') && value.indexOf('{') < value.indexOf('}');
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
- async function applyChange(options, change) {
16
- const {rta} = options;
17
- const isBindingString = typeof change.value === 'string' && isBindingExpression(change.value);
18
- const flexSettings = rta.getFlexSettings();
19
- const modifiedControl = sap.ui.getCore().byId(change.controlId);
20
- if (!modifiedControl) {
21
- return;
22
- }
23
- if (change.propertyType === PropertyType.ControlProperty) {
24
- const modifiedControlModifiedProperties = modifiedControl.getMetadata().getAllProperties()[change.propertyName];
25
- const isBindingModel = isBindingString && modifiedControlModifiedProperties?.type === 'string';
26
- const changeType = isBindingString ? 'BindProperty' : 'Property';
27
- if (isBindingModel) {
28
- await validateBindingModel(modifiedControl, change.value);
29
- }
30
- const property = isBindingString ? 'newBinding' : 'newValue';
31
- const modifiedValue = {
32
- generator: flexSettings.generator,
33
- propertyName: change.propertyName,
34
- [property]: change.value
35
- };
36
- const command = await CommandFactory.getCommandFor(modifiedControl, changeType, modifiedValue, null, flexSettings);
37
- await rta.getCommandStack().pushAndExecute(command);
38
- } else if (change.propertyType === PropertyType.Configuration) {
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
- var __exports = { __esModule: true };
48
- __exports.applyChange = applyChange;
49
- return __exports;
50
- });
59
+ }
60
+ var __exports = {
61
+ __esModule: true
62
+ };
63
+ __exports.applyChange = applyChange;
64
+ return __exports;
65
+ });
66
+ //# sourceMappingURL=flex-change.js.map