@sap-ux/preview-middleware 0.16.78 → 0.16.80

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