@sap-ux/preview-middleware 0.17.32 → 0.17.34

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 (68) hide show
  1. package/dist/client/adp/api-handler.js +153 -153
  2. package/dist/client/adp/command-executor.js +75 -75
  3. package/dist/client/adp/control-utils.js +44 -44
  4. package/dist/client/adp/controllers/BaseDialog.controller.js +187 -187
  5. package/dist/client/adp/controllers/ControllerExtension.controller.js +213 -213
  6. package/dist/client/adp/controllers/ExtensionPoint.controller.js +138 -138
  7. package/dist/client/adp/controllers/FileExistsDialog.controller.js +66 -66
  8. package/dist/client/adp/dialog-factory.js +122 -122
  9. package/dist/client/adp/init-dialogs.js +100 -100
  10. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +55 -55
  11. package/dist/client/adp/quick-actions/common/create-page-action.js +50 -50
  12. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +36 -36
  13. package/dist/client/adp/quick-actions/common/op-add-header-field.js +48 -48
  14. package/dist/client/adp/quick-actions/common/utils.js +18 -18
  15. package/dist/client/adp/quick-actions/control-types.js +21 -21
  16. package/dist/client/adp/quick-actions/dialog-enablement-validator.js +24 -24
  17. package/dist/client/adp/quick-actions/enablement-validator.js +4 -4
  18. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -101
  19. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +70 -70
  20. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +96 -96
  21. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +78 -78
  22. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -77
  23. package/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.js +69 -69
  24. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +58 -58
  25. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +93 -93
  26. package/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.js +84 -84
  27. package/dist/client/adp/quick-actions/fe-v2/registry.js +75 -75
  28. package/dist/client/adp/quick-actions/fe-v2/utils.js +116 -116
  29. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +73 -73
  30. package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +49 -49
  31. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +46 -46
  32. package/dist/client/adp/quick-actions/fe-v4/enable-variant-management.js +81 -81
  33. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +55 -55
  34. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
  35. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +52 -52
  36. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +89 -89
  37. package/dist/client/adp/quick-actions/fe-v4/registry.js +58 -58
  38. package/dist/client/adp/quick-actions/fe-v4/utils.js +47 -47
  39. package/dist/client/adp/quick-actions/load.js +44 -44
  40. package/dist/client/adp/quick-actions/quick-action-base.js +53 -53
  41. package/dist/client/adp/quick-actions/table-quick-action-base.js +20 -15
  42. package/dist/client/adp/quick-actions/table-quick-action-base.ts +30 -22
  43. package/dist/client/adp/utils.js +160 -160
  44. package/dist/client/cpe/changes/index.js +10 -10
  45. package/dist/client/cpe/changes/validator.js +39 -39
  46. package/dist/client/cpe/documentation.js +164 -164
  47. package/dist/client/cpe/feature-service.js +36 -36
  48. package/dist/client/cpe/logger.js +30 -30
  49. package/dist/client/cpe/outline/editable.js +37 -37
  50. package/dist/client/cpe/outline/nodes.js +222 -222
  51. package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
  52. package/dist/client/cpe/quick-actions/registry.js +143 -143
  53. package/dist/client/cpe/quick-actions/utils.js +92 -92
  54. package/dist/client/cpe/types.js +4 -4
  55. package/dist/client/cpe/ui5-utils.js +33 -33
  56. package/dist/client/cpe/utils.js +138 -138
  57. package/dist/client/flp/WorkspaceConnector.js +86 -86
  58. package/dist/client/flp/common.js +28 -28
  59. package/dist/client/flp/enableFakeConnector.js +83 -83
  60. package/dist/client/flp/initConnectors.js +30 -30
  61. package/dist/client/flp/initRta.js +178 -178
  62. package/dist/client/i18n.js +56 -56
  63. package/dist/client/utils/application.js +32 -32
  64. package/dist/client/utils/core.js +68 -68
  65. package/dist/client/utils/error.js +19 -19
  66. package/dist/client/utils/fe-v4.js +118 -118
  67. package/dist/client/utils/version.js +102 -102
  68. package/package.json +5 -5
@@ -60,6 +60,14 @@ sap.ui.define([
60
60
  this.options = options;
61
61
  this.enablementValidators = enablementValidators;
62
62
  }
63
+ async addSettingsActionId(table, tableMapKey) {
64
+ if (this.options.includeServiceAction) {
65
+ const actions = await this.context.actionService.get(table.getId());
66
+ const actionsIds = await getActionId(table);
67
+ const changeColumnAction = actionsIds.find(actionId => actions.findIndex(action => action.id === actionId) > -1);
68
+ this.tableMap[tableMapKey].changeColumnActionId = changeColumnAction;
69
+ }
70
+ }
63
71
  async initialize() {
64
72
  const version = await getUi5Version();
65
73
  if (isLowerThanMinimalUi5Version(version, {
@@ -74,26 +82,20 @@ sap.ui.define([
74
82
  const tabKey = Object.keys(iconTabBarfilterMap).find(key => table.getId().endsWith(key));
75
83
  const section = getParentContainer(table, 'sap.uxap.ObjectPageSection');
76
84
  if (section) {
77
- this.collectChildrenInSection(section, table);
85
+ await this.collectChildrenInSection(section, table);
78
86
  } else if (this.iconTabBar && tabKey) {
79
87
  const label = `'${ iconTabBarfilterMap[tabKey] }' table`;
80
88
  const child = this.createChild(label, table);
81
89
  this.children.push(child);
82
- this.tableMap[`${ this.children.length - 1 }`] = {
90
+ const tableMapKey = `${ this.children.length - 1 }`;
91
+ this.tableMap[tableMapKey] = {
83
92
  table,
84
93
  iconTabBarFilterKey: tabKey,
85
94
  tableUpdateEventAttachedOnce: false
86
95
  };
96
+ await this.addSettingsActionId(table, tableMapKey);
87
97
  } else {
88
- this.processTable(table);
89
- }
90
- if (this.options.includeServiceAction) {
91
- const actions = await this.context.actionService.get(table.getId());
92
- const actionsIds = await getActionId(table);
93
- const changeColumnAction = actionsIds.find(actionId => actions.findIndex(action => action.id === actionId) > -1);
94
- Object.keys(this.tableMap).forEach(key => {
95
- this.tableMap[key].changeColumnActionId = changeColumnAction;
96
- });
98
+ await this.processTable(table);
97
99
  }
98
100
  }
99
101
  if (this.children.length > 0) {
@@ -147,13 +149,13 @@ sap.ui.define([
147
149
  }
148
150
  return iconTabBarFilterMap;
149
151
  }
150
- collectChildrenInSection(section, table) {
152
+ async collectChildrenInSection(section, table) {
151
153
  const layout = getParentContainer(table, 'sap.uxap.ObjectPageLayout');
152
154
  const subSections = section.getSubSections();
153
155
  const subSection = getParentContainer(table, 'sap.uxap.ObjectPageSubSection');
154
156
  if (subSection) {
155
157
  if (subSections?.length === 1) {
156
- this.processTable(table, {
158
+ await this.processTable(table, {
157
159
  section,
158
160
  subSection: subSections[0],
159
161
  layout
@@ -183,10 +185,11 @@ sap.ui.define([
183
185
  },
184
186
  tableUpdateEventAttachedOnce: false
185
187
  };
188
+ await this.addSettingsActionId(table, tableMapIndex);
186
189
  }
187
190
  }
188
191
  }
189
- processTable(table, sectionInfo) {
192
+ async processTable(table, sectionInfo) {
190
193
  if ([
191
194
  SMART_TABLE_TYPE,
192
195
  M_TABLE_TYPE,
@@ -199,11 +202,13 @@ sap.ui.define([
199
202
  const child = this.createChild(label, table);
200
203
  this.children.push(child);
201
204
  }
202
- this.tableMap[`${ this.children.length - 1 }`] = {
205
+ const tableMapKey = `${ this.children.length - 1 }`;
206
+ this.tableMap[tableMapKey] = {
203
207
  table,
204
208
  sectionInfo: sectionInfo,
205
209
  tableUpdateEventAttachedOnce: false
206
210
  };
211
+ await this.addSettingsActionId(table, tableMapKey);
207
212
  }
208
213
  selectOverlay(table) {
209
214
  const controlOverlay = OverlayUtil.getClosestOverlayFor(table);
@@ -91,6 +91,23 @@ export abstract class TableQuickActionDefinitionBase extends QuickActionDefiniti
91
91
  super(type, NESTED_QUICK_ACTION_KIND, defaultTextKey, context, enablementValidators);
92
92
  }
93
93
 
94
+ /**
95
+ * Adds action id to the table map entry, if the service actions are needed.
96
+ * @param table - table element
97
+ * @param tableMapKey - map key
98
+ */
99
+ protected async addSettingsActionId(table: UI5Element, tableMapKey: string): Promise<void> {
100
+ if (this.options.includeServiceAction) {
101
+ const actions = await this.context.actionService.get(table.getId());
102
+ const actionsIds = await getActionId(table);
103
+
104
+ const changeColumnAction = actionsIds.find(
105
+ (actionId) => actions.findIndex((action) => action.id === actionId) > -1
106
+ );
107
+ this.tableMap[tableMapKey].changeColumnActionId = changeColumnAction;
108
+ }
109
+ }
110
+
94
111
  /**
95
112
  * Initializes action object instance
96
113
  */
@@ -110,32 +127,20 @@ export abstract class TableQuickActionDefinitionBase extends QuickActionDefiniti
110
127
  const tabKey = Object.keys(iconTabBarfilterMap).find((key) => table.getId().endsWith(key));
111
128
  const section = getParentContainer<ObjectPageSection>(table, 'sap.uxap.ObjectPageSection');
112
129
  if (section) {
113
- this.collectChildrenInSection(section, table);
130
+ await this.collectChildrenInSection(section, table);
114
131
  } else if (this.iconTabBar && tabKey) {
115
132
  const label = `'${iconTabBarfilterMap[tabKey]}' table`;
116
133
  const child = this.createChild(label, table);
117
134
  this.children.push(child);
118
- this.tableMap[`${this.children.length - 1}`] = {
135
+ const tableMapKey = `${this.children.length - 1}`;
136
+ this.tableMap[tableMapKey] = {
119
137
  table,
120
138
  iconTabBarFilterKey: tabKey,
121
139
  tableUpdateEventAttachedOnce: false
122
140
  };
141
+ await this.addSettingsActionId(table, tableMapKey);
123
142
  } else {
124
- this.processTable(table);
125
- }
126
-
127
- // add action id to the table map, if the service actions are needed.
128
- if (this.options.includeServiceAction) {
129
- const actions = await this.context.actionService.get(table.getId());
130
- const actionsIds = await getActionId(table);
131
-
132
- const changeColumnAction = actionsIds.find(
133
- (actionId) => actions.findIndex((action) => action.id === actionId) > -1
134
- );
135
- Object.keys(this.tableMap).forEach((key) => {
136
- // Update the changeColumnActionId for each entry
137
- this.tableMap[key].changeColumnActionId = changeColumnAction;
138
- });
143
+ await this.processTable(table);
139
144
  }
140
145
  }
141
146
  if (this.children.length > 0) {
@@ -219,13 +224,13 @@ export abstract class TableQuickActionDefinitionBase extends QuickActionDefiniti
219
224
  * @param section - object page section
220
225
  * @param table - table element
221
226
  */
222
- private collectChildrenInSection(section: ObjectPageSection, table: UI5Element): void {
227
+ private async collectChildrenInSection(section: ObjectPageSection, table: UI5Element): Promise<void> {
223
228
  const layout = getParentContainer<ObjectPageLayout>(table, 'sap.uxap.ObjectPageLayout');
224
229
  const subSections = section.getSubSections();
225
230
  const subSection = getParentContainer<ObjectPageSubSection>(table, 'sap.uxap.ObjectPageSubSection');
226
231
  if (subSection) {
227
232
  if (subSections?.length === 1) {
228
- this.processTable(table, { section, subSection: subSections[0], layout });
233
+ await this.processTable(table, { section, subSection: subSections[0], layout });
229
234
  } else if (subSections.length > 1) {
230
235
  const existingChildIdx = this.children.findIndex(
231
236
  (val) => val.label === `'${section.getTitle()}' section`
@@ -253,6 +258,7 @@ export abstract class TableQuickActionDefinitionBase extends QuickActionDefiniti
253
258
  sectionInfo: { section, subSection, layout },
254
259
  tableUpdateEventAttachedOnce: false
255
260
  };
261
+ await this.addSettingsActionId(table, tableMapIndex);
256
262
  }
257
263
  }
258
264
  }
@@ -262,10 +268,10 @@ export abstract class TableQuickActionDefinitionBase extends QuickActionDefiniti
262
268
  * @param table - table element
263
269
  * @param sectionInfo - section info object
264
270
  */
265
- private processTable(
271
+ private async processTable(
266
272
  table: UI5Element,
267
273
  sectionInfo?: { section: ObjectPageSection; subSection: ObjectPageSubSection; layout?: ObjectPageLayout }
268
- ): void {
274
+ ): Promise<void> {
269
275
  if (
270
276
  [
271
277
  SMART_TABLE_TYPE,
@@ -281,11 +287,13 @@ export abstract class TableQuickActionDefinitionBase extends QuickActionDefiniti
281
287
  this.children.push(child);
282
288
  }
283
289
 
284
- this.tableMap[`${this.children.length - 1}`] = {
290
+ const tableMapKey = `${this.children.length - 1}`;
291
+ this.tableMap[tableMapKey] = {
285
292
  table,
286
293
  sectionInfo: sectionInfo,
287
294
  tableUpdateEventAttachedOnce: false
288
295
  };
296
+ await this.addSettingsActionId(table, tableMapKey);
289
297
  }
290
298
 
291
299
  /**
@@ -1,162 +1,162 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/m/MessageToast", "sap/ui/core/Element", "sap/base/Log", "sap/ui/fl/Utils", "../utils/error", "../utils/version"], function (MessageToast, Element, Log, FlexUtils, ___utils_error, ___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
- });
16
- }
17
- resolve(module);
18
- }, function (err) {
19
- reject(err);
20
- });
21
- });
22
- }
23
- const getError = ___utils_error["getError"];
24
- const isLowerThanMinimalUi5Version = ___utils_version["isLowerThanMinimalUi5Version"];
25
- /**
26
- * Defers the resolution of the promise, stores resolve/reject functions so that they can be accessed at a later stage.
27
- *
28
- * @description A Deferred object contains an unresolved promise along with the functions to resolve or reject that promise.
29
- *
30
- * @returns {Deferred} Deferred object
31
- */
32
- function createDeferred() {
33
- let resolve = null;
34
- let reject = null;
35
- const promise = new Promise((res, rej) => {
36
- resolve = res;
37
- reject = rej;
38
- });
39
- if (resolve === null || reject === null) {
40
- throw new Error('Failed to initialize resolve and reject functions.');
41
- }
42
- return {
43
- promise,
44
- resolve,
45
- reject
46
- };
47
- }
48
-
49
- /**
50
- * Checks if the fragment name associated with a command matches the specified fragment name.
51
- *
52
- * @param {FlexCommand} command - The command object containing the prepared change to be examined.
53
- * @param {string} fragmentName - The name of the fragment to match against the command's change.
54
- * @returns {boolean} Returns true if the command's change contains a fragment path that matches
55
- * the specified fragment name; otherwise, returns false.
56
- */
57
- function matchesFragmentName(command, fragmentName) {
58
- if (typeof command.getPreparedChange !== 'function') {
59
- return false;
60
- }
61
- const change = command.getPreparedChange().getDefinition();
62
- return change.content?.fragmentPath?.includes(`${fragmentName}.fragment.xml`) || false;
63
- }
64
-
65
- /**
66
- * Displays a message to the user indicating that an XML fragment will be created upon saving a change.
67
- *
68
- * @param {string} message - The message to be shown in the message toast.
69
- * @param {number} duration - The duration during which message toast will be active.
70
- */
71
- function notifyUser(message) {
72
- let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5000;
73
- MessageToast.show(message, {
74
- duration
75
- });
76
- }
77
-
78
- /**
79
- * Check if element is sync view
80
- *
81
- * @param element Design time Element
82
- * @returns boolean if element is sync view or not
83
- */
84
- function isSyncView(element) {
85
- return element?.getMetadata()?.getName()?.includes('XMLView') && element?.oAsyncState === undefined;
86
- }
87
-
88
- /**
89
- * Get Ids for all sync views
90
- *
91
- * @param ui5VersionInfo UI5 Version Information
92
- *
93
- * @returns array of Ids for application sync views
94
- */
95
- async function getAllSyncViewsIds(ui5VersionInfo) {
96
- const syncViewIds = [];
97
- try {
98
- if (isLowerThanMinimalUi5Version(ui5VersionInfo, {
99
- major: 1,
100
- minor: 120
101
- })) {
102
- const elements = Element.registry.filter(() => true);
103
- elements.forEach(ui5Element => {
104
- if (isSyncView(ui5Element)) {
105
- syncViewIds.push(ui5Element.getId());
106
- }
107
- });
108
- } else {
109
- const ElementRegistry = (await __ui5_require_async('sap/ui/core/ElementRegistry')).default;
110
- const elements = ElementRegistry.all();
111
- Object.entries(elements).forEach(_ref => {
112
- let [key, ui5Element] = _ref;
113
- if (isSyncView(ui5Element)) {
114
- syncViewIds.push(key);
115
- }
116
- });
117
- }
118
- } catch (error) {
119
- Log.error('Could not get application sync views', getError(error));
120
- }
121
- return syncViewIds;
122
- }
123
- /**
124
- * Gets controller name and view ID for the given UI5 control.
125
- *
126
- * @param control UI5 control.
127
- * @returns The controller name and view ID.
128
- */
129
-
130
- function getControllerInfoForControl(control) {
131
- const view = FlexUtils.getViewForControl(control);
132
- const controllerName = view.getController().getMetadata().getName();
133
- const viewId = view.getId();
134
- return {
135
- controllerName,
136
- viewId
137
- };
138
- }
139
-
140
- /**
141
- * Gets controller name and view ID for the given overlay control.
142
- *
143
- * @param overlayControl The overlay control.
144
- * @returns The controller name and view ID.
145
- */
146
-
147
- function getControllerInfo(overlayControl) {
148
- const control = overlayControl.getElement();
149
- return getControllerInfoForControl(control);
150
- }
151
- var __exports = {
152
- __esModule: true
153
- };
154
- __exports.createDeferred = createDeferred;
155
- __exports.matchesFragmentName = matchesFragmentName;
156
- __exports.notifyUser = notifyUser;
157
- __exports.getAllSyncViewsIds = getAllSyncViewsIds;
158
- __exports.getControllerInfoForControl = getControllerInfoForControl;
159
- __exports.getControllerInfo = getControllerInfo;
160
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/m/MessageToast", "sap/ui/core/Element", "sap/base/Log", "sap/ui/fl/Utils", "../utils/error", "../utils/version"], function (MessageToast, Element, Log, FlexUtils, ___utils_error, ___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
+ });
16
+ }
17
+ resolve(module);
18
+ }, function (err) {
19
+ reject(err);
20
+ });
21
+ });
22
+ }
23
+ const getError = ___utils_error["getError"];
24
+ const isLowerThanMinimalUi5Version = ___utils_version["isLowerThanMinimalUi5Version"];
25
+ /**
26
+ * Defers the resolution of the promise, stores resolve/reject functions so that they can be accessed at a later stage.
27
+ *
28
+ * @description A Deferred object contains an unresolved promise along with the functions to resolve or reject that promise.
29
+ *
30
+ * @returns {Deferred} Deferred object
31
+ */
32
+ function createDeferred() {
33
+ let resolve = null;
34
+ let reject = null;
35
+ const promise = new Promise((res, rej) => {
36
+ resolve = res;
37
+ reject = rej;
38
+ });
39
+ if (resolve === null || reject === null) {
40
+ throw new Error('Failed to initialize resolve and reject functions.');
41
+ }
42
+ return {
43
+ promise,
44
+ resolve,
45
+ reject
46
+ };
47
+ }
48
+
49
+ /**
50
+ * Checks if the fragment name associated with a command matches the specified fragment name.
51
+ *
52
+ * @param {FlexCommand} command - The command object containing the prepared change to be examined.
53
+ * @param {string} fragmentName - The name of the fragment to match against the command's change.
54
+ * @returns {boolean} Returns true if the command's change contains a fragment path that matches
55
+ * the specified fragment name; otherwise, returns false.
56
+ */
57
+ function matchesFragmentName(command, fragmentName) {
58
+ if (typeof command.getPreparedChange !== 'function') {
59
+ return false;
60
+ }
61
+ const change = command.getPreparedChange().getDefinition();
62
+ return change.content?.fragmentPath?.includes(`${fragmentName}.fragment.xml`) || false;
63
+ }
64
+
65
+ /**
66
+ * Displays a message to the user indicating that an XML fragment will be created upon saving a change.
67
+ *
68
+ * @param {string} message - The message to be shown in the message toast.
69
+ * @param {number} duration - The duration during which message toast will be active.
70
+ */
71
+ function notifyUser(message) {
72
+ let duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5000;
73
+ MessageToast.show(message, {
74
+ duration
75
+ });
76
+ }
77
+
78
+ /**
79
+ * Check if element is sync view
80
+ *
81
+ * @param element Design time Element
82
+ * @returns boolean if element is sync view or not
83
+ */
84
+ function isSyncView(element) {
85
+ return element?.getMetadata()?.getName()?.includes('XMLView') && element?.oAsyncState === undefined;
86
+ }
87
+
88
+ /**
89
+ * Get Ids for all sync views
90
+ *
91
+ * @param ui5VersionInfo UI5 Version Information
92
+ *
93
+ * @returns array of Ids for application sync views
94
+ */
95
+ async function getAllSyncViewsIds(ui5VersionInfo) {
96
+ const syncViewIds = [];
97
+ try {
98
+ if (isLowerThanMinimalUi5Version(ui5VersionInfo, {
99
+ major: 1,
100
+ minor: 120
101
+ })) {
102
+ const elements = Element.registry.filter(() => true);
103
+ elements.forEach(ui5Element => {
104
+ if (isSyncView(ui5Element)) {
105
+ syncViewIds.push(ui5Element.getId());
106
+ }
107
+ });
108
+ } else {
109
+ const ElementRegistry = (await __ui5_require_async('sap/ui/core/ElementRegistry')).default;
110
+ const elements = ElementRegistry.all();
111
+ Object.entries(elements).forEach(_ref => {
112
+ let [key, ui5Element] = _ref;
113
+ if (isSyncView(ui5Element)) {
114
+ syncViewIds.push(key);
115
+ }
116
+ });
117
+ }
118
+ } catch (error) {
119
+ Log.error('Could not get application sync views', getError(error));
120
+ }
121
+ return syncViewIds;
122
+ }
123
+ /**
124
+ * Gets controller name and view ID for the given UI5 control.
125
+ *
126
+ * @param control UI5 control.
127
+ * @returns The controller name and view ID.
128
+ */
129
+
130
+ function getControllerInfoForControl(control) {
131
+ const view = FlexUtils.getViewForControl(control);
132
+ const controllerName = view.getController().getMetadata().getName();
133
+ const viewId = view.getId();
134
+ return {
135
+ controllerName,
136
+ viewId
137
+ };
138
+ }
139
+
140
+ /**
141
+ * Gets controller name and view ID for the given overlay control.
142
+ *
143
+ * @param overlayControl The overlay control.
144
+ * @returns The controller name and view ID.
145
+ */
146
+
147
+ function getControllerInfo(overlayControl) {
148
+ const control = overlayControl.getElement();
149
+ return getControllerInfoForControl(control);
150
+ }
151
+ var __exports = {
152
+ __esModule: true
153
+ };
154
+ __exports.createDeferred = createDeferred;
155
+ __exports.matchesFragmentName = matchesFragmentName;
156
+ __exports.notifyUser = notifyUser;
157
+ __exports.getAllSyncViewsIds = getAllSyncViewsIds;
158
+ __exports.getControllerInfoForControl = getControllerInfoForControl;
159
+ __exports.getControllerInfo = getControllerInfo;
160
+ return __exports;
161
161
  });
162
162
  //# sourceMappingURL=utils.js.map
@@ -1,12 +1,12 @@
1
- "use strict";
2
-
3
- sap.ui.define(["./service"], function (___service) {
4
- "use strict";
5
-
6
- var __exports = {
7
- __esModule: true
8
- };
9
- __exports.ChangeService = ___service.ChangeService;
10
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["./service"], function (___service) {
4
+ "use strict";
5
+
6
+ var __exports = {
7
+ __esModule: true
8
+ };
9
+ __exports.ChangeService = ___service.ChangeService;
10
+ return __exports;
11
11
  });
12
12
  //# sourceMappingURL=index.js.map
@@ -1,41 +1,41 @@
1
- "use strict";
2
-
3
- sap.ui.define(["../../i18n"], function (____i18n) {
4
- "use strict";
5
-
6
- const getTextBundle = ____i18n["getTextBundle"];
7
- /**
8
- * Function to validate if a given value is a valid binding model.
9
- *
10
- * @param modifiedControl control to be modified.
11
- * @param value value to be checked.
12
- */
13
- async function validateBindingModel(modifiedControl, value) {
14
- const textBundle = await getTextBundle();
15
- const bindingValue = value.replace(/[{}]/gi, '').trim();
16
- const bindingParts = bindingValue.split('>').filter(el => el !== '');
17
- if (!bindingParts.length) {
18
- throw new SyntaxError(textBundle.getText('INVALID_BINDING_STRING'));
19
- }
20
- if (bindingParts.length === 2) {
21
- const bindingModel = bindingParts[0];
22
- const resourceKey = bindingParts[1].trim();
23
- const resourceModel = modifiedControl.getModel(bindingModel);
24
- if (!resourceModel) {
25
- throw new SyntaxError(textBundle.getText('INVALID_BINDING_MODEL'));
26
- }
27
- const resourceBundle = resourceModel.getResourceBundle();
28
- if (!resourceBundle.getText(resourceKey, undefined, true)) {
29
- throw new SyntaxError(textBundle.getText('INVALID_BINDING_MODEL_KEY'));
30
- }
31
- } else {
32
- throw new SyntaxError(textBundle.getText('INVALID_BINDING_STRING_FORMAT'));
33
- }
34
- }
35
- var __exports = {
36
- __esModule: true
37
- };
38
- __exports.validateBindingModel = validateBindingModel;
39
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["../../i18n"], function (____i18n) {
4
+ "use strict";
5
+
6
+ const getTextBundle = ____i18n["getTextBundle"];
7
+ /**
8
+ * Function to validate if a given value is a valid binding model.
9
+ *
10
+ * @param modifiedControl control to be modified.
11
+ * @param value value to be checked.
12
+ */
13
+ async function validateBindingModel(modifiedControl, value) {
14
+ const textBundle = await getTextBundle();
15
+ const bindingValue = value.replace(/[{}]/gi, '').trim();
16
+ const bindingParts = bindingValue.split('>').filter(el => el !== '');
17
+ if (!bindingParts.length) {
18
+ throw new SyntaxError(textBundle.getText('INVALID_BINDING_STRING'));
19
+ }
20
+ if (bindingParts.length === 2) {
21
+ const bindingModel = bindingParts[0];
22
+ const resourceKey = bindingParts[1].trim();
23
+ const resourceModel = modifiedControl.getModel(bindingModel);
24
+ if (!resourceModel) {
25
+ throw new SyntaxError(textBundle.getText('INVALID_BINDING_MODEL'));
26
+ }
27
+ const resourceBundle = resourceModel.getResourceBundle();
28
+ if (!resourceBundle.getText(resourceKey, undefined, true)) {
29
+ throw new SyntaxError(textBundle.getText('INVALID_BINDING_MODEL_KEY'));
30
+ }
31
+ } else {
32
+ throw new SyntaxError(textBundle.getText('INVALID_BINDING_STRING_FORMAT'));
33
+ }
34
+ }
35
+ var __exports = {
36
+ __esModule: true
37
+ };
38
+ __exports.validateBindingModel = validateBindingModel;
39
+ return __exports;
40
40
  });
41
41
  //# sourceMappingURL=validator.js.map