@sap-ux/preview-middleware 0.17.18 → 0.17.19

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