@sap-ux/preview-middleware 0.16.159 → 0.16.160

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 (62) hide show
  1. package/dist/client/adp/api-handler.js +142 -142
  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/dialog-factory.js +113 -113
  8. package/dist/client/adp/init-dialogs.js +100 -100
  9. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +55 -55
  10. package/dist/client/adp/quick-actions/common/create-page-action.js +50 -50
  11. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +36 -36
  12. package/dist/client/adp/quick-actions/common/op-add-header-field.js +48 -48
  13. package/dist/client/adp/quick-actions/common/utils.js +18 -18
  14. package/dist/client/adp/quick-actions/control-types.js +21 -21
  15. package/dist/client/adp/quick-actions/dialog-enablement-validator.js +24 -24
  16. package/dist/client/adp/quick-actions/enablement-validator.js +4 -4
  17. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -101
  18. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +70 -70
  19. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +96 -96
  20. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +60 -60
  21. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -77
  22. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +57 -57
  23. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +93 -93
  24. package/dist/client/adp/quick-actions/fe-v2/registry.js +72 -72
  25. package/dist/client/adp/quick-actions/fe-v2/utils.js +95 -95
  26. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +49 -49
  27. package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +47 -47
  28. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +46 -46
  29. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +55 -55
  30. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
  31. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +52 -52
  32. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +89 -89
  33. package/dist/client/adp/quick-actions/fe-v4/registry.js +56 -56
  34. package/dist/client/adp/quick-actions/fe-v4/utils.js +47 -47
  35. package/dist/client/adp/quick-actions/load.js +44 -44
  36. package/dist/client/adp/quick-actions/quick-action-base.js +53 -53
  37. package/dist/client/adp/utils.js +160 -160
  38. package/dist/client/cpe/changes/index.js +10 -10
  39. package/dist/client/cpe/changes/validator.js +34 -34
  40. package/dist/client/cpe/documentation.js +164 -164
  41. package/dist/client/cpe/feature-service.js +36 -36
  42. package/dist/client/cpe/logger.js +30 -30
  43. package/dist/client/cpe/outline/editable.js +37 -37
  44. package/dist/client/cpe/outline/nodes.js +217 -217
  45. package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
  46. package/dist/client/cpe/quick-actions/registry.js +143 -143
  47. package/dist/client/cpe/quick-actions/utils.js +92 -92
  48. package/dist/client/cpe/types.js +4 -4
  49. package/dist/client/cpe/ui5-utils.js +33 -33
  50. package/dist/client/cpe/utils.js +138 -138
  51. package/dist/client/flp/WorkspaceConnector.js +86 -86
  52. package/dist/client/flp/common.js +28 -28
  53. package/dist/client/flp/enableFakeConnector.js +83 -83
  54. package/dist/client/flp/initConnectors.js +30 -30
  55. package/dist/client/flp/initRta.js +178 -178
  56. package/dist/client/i18n.js +56 -56
  57. package/dist/client/utils/application.js +32 -32
  58. package/dist/client/utils/core.js +68 -68
  59. package/dist/client/utils/error.js +19 -19
  60. package/dist/client/utils/fe-v4.js +118 -118
  61. package/dist/client/utils/version.js +102 -102
  62. package/package.json +3 -3
@@ -1,219 +1,219 @@
1
- "use strict";
2
-
3
- sap.ui.define(["../../utils/version", "../../utils/core", "../utils", "./editable", "../../utils/fe-v4"], function (____utils_version, ____utils_core, ___utils, ___editable, ____utils_fe_v4) {
4
- "use strict";
5
-
6
- const getUi5Version = ____utils_version["getUi5Version"];
7
- const getControlById = ____utils_core["getControlById"];
8
- const getOverlay = ___utils["getOverlay"];
9
- const isReuseComponent = ___utils["isReuseComponent"];
10
- const isEditable = ___editable["isEditable"];
11
- const getConfigMapControlIdMap = ____utils_fe_v4["getConfigMapControlIdMap"];
12
- const getPageName = ____utils_fe_v4["getPageName"];
13
- /**
14
- * Retrieves additional data for a given control ID.
15
- *
16
- * @param id The unique identifier of the control.
17
- * @returns An object containing the text and the technical name of the control.
18
- */
19
- function getAdditionalData(id) {
20
- const control = getControlById(id);
21
- if (!control) {
22
- return {};
23
- }
24
- const metadata = control.getMetadata();
25
- let details = {};
26
- const technicalName = metadata.getElementName();
27
- if (technicalName) {
28
- details.technicalName = technicalName;
29
- }
30
- if (metadata.getProperty('text')) {
31
- const text = control.getProperty('text');
32
- if (typeof text === 'string' && text.trim() !== '') {
33
- details.text = text;
34
- }
35
- }
36
- return details;
37
- }
38
-
39
- /**
40
- * Gets the children nodes of an aggregation type node.
41
- *
42
- * @param current The current node to retrieve children from
43
- * @returns An array of children nodes, or an empty array if none are found
44
- */
45
- function getChildren(current) {
46
- return (current.elements ?? []).flatMap(element => element.type === 'aggregation' ? element.elements ?? [] : []);
47
- }
48
-
49
- /**
50
- * Adds a new child node to the extension point's children array based on the given control ID.
51
- *
52
- * @param {string} id - The unique identifier of the control to be added as a child node.
53
- * @param {OutlineNode[]} children - The array of children nodes to which the new node will be added.
54
- * @param {ChangeService} changeService - Change service for change stack event handling.
55
- */
56
- function addChildToExtensionPoint(id, children, changeService) {
57
- const {
58
- text,
59
- technicalName
60
- } = getAdditionalData(id);
61
- const editable = isEditable(changeService, id);
62
- children.push({
63
- controlId: id,
64
- controlType: technicalName ?? 'sap.ui.extensionpoint.child',
65
- name: text ?? id,
66
- visible: true,
67
- editable,
68
- children: [],
69
- hasDefaultContent: false
70
- });
71
- }
72
- /**
73
- * Creates conrol index for all controls in the app.
74
- *
75
- * @param {ControlTreeIndex} controlIndex - Control index for the ui5 app.
76
- * @param {OutlineNode} node - control node added to the outline.
77
- */
78
- function indexNode(controlIndex, node) {
79
- const indexedControls = controlIndex[node.controlType];
80
- if (indexedControls) {
81
- indexedControls.push(node);
82
- } else {
83
- controlIndex[node.controlType] = [node];
84
- }
85
- }
86
- function addToPropertyIdMap(node, propertyIdMap) {
87
- const control = getControlById(node.controlId);
88
- if (control) {
89
- const overlay = getOverlay(control);
90
- const overlayData = overlay?.getDesignTimeMetadata().getData();
91
- if (!overlayData?.manifestPropertyPath) {
92
- return;
93
- }
94
- if (overlayData) {
95
- const path = overlayData?.manifestPropertyPath?.(control);
96
- const pageName = getPageName(control);
97
- const key = getConfigMapControlIdMap(pageName, path.split('/').filter(item => item));
98
- if (key) {
99
- if (!propertyIdMap.get(key)) {
100
- propertyIdMap.set(key, []);
101
- }
102
- propertyIdMap.get(key)?.push(node.controlId);
103
- }
104
- }
105
- }
106
- }
107
-
108
- /**
109
- * Transform node.
110
- *
111
- * @param input outline view node
112
- * @param scenario type of project
113
- * @param reuseComponentsIds ids of reuse components that are filled when outline nodes are transformed
114
- * @param controlIndex Control tree index
115
- * @param changeService ChanegService for change stack event handling.
116
- * @param propertyIdMap ChanegService for change stack event handling.
117
- * @returns transformed outline tree nodes
118
- */
119
- async function transformNodes(input, scenario, reuseComponentsIds, controlIndex, changeService, propertyIdMap) {
120
- const stack = [...input];
121
- const items = [];
122
- const ui5VersionInfo = await getUi5Version();
123
- while (stack.length) {
124
- const current = stack.shift();
125
- const editable = isEditable(changeService, current?.id);
126
- const isAdp = scenario === 'ADAPTATION_PROJECT';
127
- const isExtPoint = current?.type === 'extensionPoint';
128
- if (current?.type === 'element') {
129
- const children = getChildren(current);
130
- const {
131
- text
132
- } = getAdditionalData(current.id);
133
- const technicalName = current.technicalName.split('.').slice(-1)[0];
134
- const transformedChildren = isAdp ? await handleDuplicateNodes(children, scenario, reuseComponentsIds, controlIndex, changeService, propertyIdMap) : await transformNodes(children, scenario, reuseComponentsIds, controlIndex, changeService, propertyIdMap);
135
- const node = {
136
- controlId: current.id,
137
- controlType: current.technicalName,
138
- name: text ?? technicalName,
139
- editable,
140
- visible: current.visible ?? true,
141
- children: transformedChildren
142
- };
143
- indexNode(controlIndex, node);
144
- addToPropertyIdMap(node, propertyIdMap);
145
- fillReuseComponents(reuseComponentsIds, current, scenario, ui5VersionInfo);
146
- items.push(node);
147
- }
148
- if (isAdp && isExtPoint) {
149
- const {
150
- defaultContent = [],
151
- createdControls = []
152
- } = current.extensionPointInfo;
153
- let children = [];
154
- // We can combine both because there can only be either defaultContent or createdControls for one extension point node.
155
- [...defaultContent, ...createdControls].forEach(id => {
156
- addChildToExtensionPoint(id, children, changeService);
157
- });
158
- const node = {
159
- controlId: current.id,
160
- controlType: current.technicalName,
161
- name: current.name ?? '',
162
- editable,
163
- visible: current.visible ?? true,
164
- children,
165
- hasDefaultContent: defaultContent.length > 0
166
- };
167
- items.push(node);
168
- }
169
- }
170
- return items;
171
- }
172
-
173
- /**
174
- * Fill reuse components ids.
175
- *
176
- * @param reuseComponentsIds ids of reuse components that are filled when outline nodes are transformed
177
- * @param node view node
178
- * @param scenario type of project
179
- * @param ui5VersionInfo UI5 version information
180
- */
181
- function fillReuseComponents(reuseComponentsIds, node, scenario, ui5VersionInfo) {
182
- if (scenario === 'ADAPTATION_PROJECT' && node?.component && isReuseComponent(node.id, ui5VersionInfo)) {
183
- reuseComponentsIds.add(node.id);
184
- }
185
- }
186
- /**
187
- * Handles duplicate nodes that are retrieved from extension point default content and created controls,
188
- * if they exist under an extension point these controls are removed from the children array
189
- *
190
- * @param children outline view node children
191
- * @param scenario type of project
192
- * @param reuseComponentsIds ids of reuse components that are filled when outline nodes are transformed
193
- * @param controlIndex Control tree index
194
- * @param changeService ChangeService for change stack event handling.
195
- * @param propertyIdMap Map<string, string[]>.
196
- * @returns transformed outline tree nodes
197
- */
198
- async function handleDuplicateNodes(children, scenario, reuseComponentsIds, controlIndex, changeService, propertyIdMap) {
199
- const extPointIDs = new Set();
200
- children.forEach(child => {
201
- if (child.type === 'extensionPoint') {
202
- const {
203
- defaultContent = [],
204
- createdControls = []
205
- } = child.extensionPointInfo;
206
- [...defaultContent, ...createdControls].forEach(id => extPointIDs.add(id));
207
- }
208
- });
209
- const uniqueChildren = children.filter(child => !extPointIDs.has(child.id));
210
- return transformNodes(uniqueChildren, scenario, reuseComponentsIds, controlIndex, changeService, propertyIdMap);
211
- }
212
- var __exports = {
213
- __esModule: true
214
- };
215
- __exports.transformNodes = transformNodes;
216
- __exports.handleDuplicateNodes = handleDuplicateNodes;
217
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["../../utils/version", "../../utils/core", "../utils", "./editable", "../../utils/fe-v4"], function (____utils_version, ____utils_core, ___utils, ___editable, ____utils_fe_v4) {
4
+ "use strict";
5
+
6
+ const getUi5Version = ____utils_version["getUi5Version"];
7
+ const getControlById = ____utils_core["getControlById"];
8
+ const getOverlay = ___utils["getOverlay"];
9
+ const isReuseComponent = ___utils["isReuseComponent"];
10
+ const isEditable = ___editable["isEditable"];
11
+ const getConfigMapControlIdMap = ____utils_fe_v4["getConfigMapControlIdMap"];
12
+ const getPageName = ____utils_fe_v4["getPageName"];
13
+ /**
14
+ * Retrieves additional data for a given control ID.
15
+ *
16
+ * @param id The unique identifier of the control.
17
+ * @returns An object containing the text and the technical name of the control.
18
+ */
19
+ function getAdditionalData(id) {
20
+ const control = getControlById(id);
21
+ if (!control) {
22
+ return {};
23
+ }
24
+ const metadata = control.getMetadata();
25
+ let details = {};
26
+ const technicalName = metadata.getElementName();
27
+ if (technicalName) {
28
+ details.technicalName = technicalName;
29
+ }
30
+ if (metadata.getProperty('text')) {
31
+ const text = control.getProperty('text');
32
+ if (typeof text === 'string' && text.trim() !== '') {
33
+ details.text = text;
34
+ }
35
+ }
36
+ return details;
37
+ }
38
+
39
+ /**
40
+ * Gets the children nodes of an aggregation type node.
41
+ *
42
+ * @param current The current node to retrieve children from
43
+ * @returns An array of children nodes, or an empty array if none are found
44
+ */
45
+ function getChildren(current) {
46
+ return (current.elements ?? []).flatMap(element => element.type === 'aggregation' ? element.elements ?? [] : []);
47
+ }
48
+
49
+ /**
50
+ * Adds a new child node to the extension point's children array based on the given control ID.
51
+ *
52
+ * @param {string} id - The unique identifier of the control to be added as a child node.
53
+ * @param {OutlineNode[]} children - The array of children nodes to which the new node will be added.
54
+ * @param {ChangeService} changeService - Change service for change stack event handling.
55
+ */
56
+ function addChildToExtensionPoint(id, children, changeService) {
57
+ const {
58
+ text,
59
+ technicalName
60
+ } = getAdditionalData(id);
61
+ const editable = isEditable(changeService, id);
62
+ children.push({
63
+ controlId: id,
64
+ controlType: technicalName ?? 'sap.ui.extensionpoint.child',
65
+ name: text ?? id,
66
+ visible: true,
67
+ editable,
68
+ children: [],
69
+ hasDefaultContent: false
70
+ });
71
+ }
72
+ /**
73
+ * Creates conrol index for all controls in the app.
74
+ *
75
+ * @param {ControlTreeIndex} controlIndex - Control index for the ui5 app.
76
+ * @param {OutlineNode} node - control node added to the outline.
77
+ */
78
+ function indexNode(controlIndex, node) {
79
+ const indexedControls = controlIndex[node.controlType];
80
+ if (indexedControls) {
81
+ indexedControls.push(node);
82
+ } else {
83
+ controlIndex[node.controlType] = [node];
84
+ }
85
+ }
86
+ function addToPropertyIdMap(node, propertyIdMap) {
87
+ const control = getControlById(node.controlId);
88
+ if (control) {
89
+ const overlay = getOverlay(control);
90
+ const overlayData = overlay?.getDesignTimeMetadata().getData();
91
+ if (!overlayData?.manifestPropertyPath) {
92
+ return;
93
+ }
94
+ if (overlayData) {
95
+ const path = overlayData?.manifestPropertyPath?.(control);
96
+ const pageName = getPageName(control);
97
+ const key = getConfigMapControlIdMap(pageName, path.split('/').filter(item => item));
98
+ if (key) {
99
+ if (!propertyIdMap.get(key)) {
100
+ propertyIdMap.set(key, []);
101
+ }
102
+ propertyIdMap.get(key)?.push(node.controlId);
103
+ }
104
+ }
105
+ }
106
+ }
107
+
108
+ /**
109
+ * Transform node.
110
+ *
111
+ * @param input outline view node
112
+ * @param scenario type of project
113
+ * @param reuseComponentsIds ids of reuse components that are filled when outline nodes are transformed
114
+ * @param controlIndex Control tree index
115
+ * @param changeService ChanegService for change stack event handling.
116
+ * @param propertyIdMap ChanegService for change stack event handling.
117
+ * @returns transformed outline tree nodes
118
+ */
119
+ async function transformNodes(input, scenario, reuseComponentsIds, controlIndex, changeService, propertyIdMap) {
120
+ const stack = [...input];
121
+ const items = [];
122
+ const ui5VersionInfo = await getUi5Version();
123
+ while (stack.length) {
124
+ const current = stack.shift();
125
+ const editable = isEditable(changeService, current?.id);
126
+ const isAdp = scenario === 'ADAPTATION_PROJECT';
127
+ const isExtPoint = current?.type === 'extensionPoint';
128
+ if (current?.type === 'element') {
129
+ const children = getChildren(current);
130
+ const {
131
+ text
132
+ } = getAdditionalData(current.id);
133
+ const technicalName = current.technicalName.split('.').slice(-1)[0];
134
+ const transformedChildren = isAdp ? await handleDuplicateNodes(children, scenario, reuseComponentsIds, controlIndex, changeService, propertyIdMap) : await transformNodes(children, scenario, reuseComponentsIds, controlIndex, changeService, propertyIdMap);
135
+ const node = {
136
+ controlId: current.id,
137
+ controlType: current.technicalName,
138
+ name: text ?? technicalName,
139
+ editable,
140
+ visible: current.visible ?? true,
141
+ children: transformedChildren
142
+ };
143
+ indexNode(controlIndex, node);
144
+ addToPropertyIdMap(node, propertyIdMap);
145
+ fillReuseComponents(reuseComponentsIds, current, scenario, ui5VersionInfo);
146
+ items.push(node);
147
+ }
148
+ if (isAdp && isExtPoint) {
149
+ const {
150
+ defaultContent = [],
151
+ createdControls = []
152
+ } = current.extensionPointInfo;
153
+ let children = [];
154
+ // We can combine both because there can only be either defaultContent or createdControls for one extension point node.
155
+ [...defaultContent, ...createdControls].forEach(id => {
156
+ addChildToExtensionPoint(id, children, changeService);
157
+ });
158
+ const node = {
159
+ controlId: current.id,
160
+ controlType: current.technicalName,
161
+ name: current.name ?? '',
162
+ editable,
163
+ visible: current.visible ?? true,
164
+ children,
165
+ hasDefaultContent: defaultContent.length > 0
166
+ };
167
+ items.push(node);
168
+ }
169
+ }
170
+ return items;
171
+ }
172
+
173
+ /**
174
+ * Fill reuse components ids.
175
+ *
176
+ * @param reuseComponentsIds ids of reuse components that are filled when outline nodes are transformed
177
+ * @param node view node
178
+ * @param scenario type of project
179
+ * @param ui5VersionInfo UI5 version information
180
+ */
181
+ function fillReuseComponents(reuseComponentsIds, node, scenario, ui5VersionInfo) {
182
+ if (scenario === 'ADAPTATION_PROJECT' && node?.component && isReuseComponent(node.id, ui5VersionInfo)) {
183
+ reuseComponentsIds.add(node.id);
184
+ }
185
+ }
186
+ /**
187
+ * Handles duplicate nodes that are retrieved from extension point default content and created controls,
188
+ * if they exist under an extension point these controls are removed from the children array
189
+ *
190
+ * @param children outline view node children
191
+ * @param scenario type of project
192
+ * @param reuseComponentsIds ids of reuse components that are filled when outline nodes are transformed
193
+ * @param controlIndex Control tree index
194
+ * @param changeService ChangeService for change stack event handling.
195
+ * @param propertyIdMap Map<string, string[]>.
196
+ * @returns transformed outline tree nodes
197
+ */
198
+ async function handleDuplicateNodes(children, scenario, reuseComponentsIds, controlIndex, changeService, propertyIdMap) {
199
+ const extPointIDs = new Set();
200
+ children.forEach(child => {
201
+ if (child.type === 'extensionPoint') {
202
+ const {
203
+ defaultContent = [],
204
+ createdControls = []
205
+ } = child.extensionPointInfo;
206
+ [...defaultContent, ...createdControls].forEach(id => extPointIDs.add(id));
207
+ }
208
+ });
209
+ const uniqueChildren = children.filter(child => !extPointIDs.has(child.id));
210
+ return transformNodes(uniqueChildren, scenario, reuseComponentsIds, controlIndex, changeService, propertyIdMap);
211
+ }
212
+ var __exports = {
213
+ __esModule: true
214
+ };
215
+ __exports.transformNodes = transformNodes;
216
+ __exports.handleDuplicateNodes = handleDuplicateNodes;
217
+ return __exports;
218
218
  });
219
219
  //# sourceMappingURL=nodes.js.map
@@ -1,6 +1,6 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
5
  });
6
6
  //# sourceMappingURL=quick-action-definition.js.map