@sapui5/sap.suite.ui.commons 1.143.0 → 1.145.0

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 (126) hide show
  1. package/package.json +1 -1
  2. package/src/sap/suite/ui/commons/.library +1 -1
  3. package/src/sap/suite/ui/commons/AriaProperties.js +1 -1
  4. package/src/sap/suite/ui/commons/CalculationBuilder.js +26 -14
  5. package/src/sap/suite/ui/commons/CalculationBuilderExpression.js +2 -2
  6. package/src/sap/suite/ui/commons/CalculationBuilderFunction.js +1 -1
  7. package/src/sap/suite/ui/commons/CalculationBuilderGroup.js +1 -1
  8. package/src/sap/suite/ui/commons/CalculationBuilderInput.js +5 -5
  9. package/src/sap/suite/ui/commons/CalculationBuilderItem.js +1 -1
  10. package/src/sap/suite/ui/commons/CalculationBuilderValidationResult.js +1 -1
  11. package/src/sap/suite/ui/commons/CalculationBuilderVariable.js +1 -1
  12. package/src/sap/suite/ui/commons/CloudFilePicker.js +1 -3
  13. package/src/sap/suite/ui/commons/MicroProcessFlow.js +77 -73
  14. package/src/sap/suite/ui/commons/MicroProcessFlowItem.js +3 -3
  15. package/src/sap/suite/ui/commons/Timeline.js +9 -0
  16. package/src/sap/suite/ui/commons/TimelineNavigator.js +37 -5
  17. package/src/sap/suite/ui/commons/TimelineRenderer.js +3 -3
  18. package/src/sap/suite/ui/commons/collaboration/BaseHelperService.js +0 -1
  19. package/src/sap/suite/ui/commons/collaboration/CollaborationHelper.js +0 -3
  20. package/src/sap/suite/ui/commons/collaboration/CollaborationManagerService.js +0 -1
  21. package/src/sap/suite/ui/commons/collaboration/ContactHelper.js +7 -0
  22. package/src/sap/suite/ui/commons/collaboration/ContactPopover.fragment.xml +4 -1
  23. package/src/sap/suite/ui/commons/collaboration/MinimalContactPopover.fragment.xml +2 -1
  24. package/src/sap/suite/ui/commons/collaboration/TeamsHelperService.js +0 -6
  25. package/src/sap/suite/ui/commons/collaboration/channels/MessageChannel.js +0 -2
  26. package/src/sap/suite/ui/commons/collaboration/flpplugins/msplugin/Component-preload.js +1 -1
  27. package/src/sap/suite/ui/commons/collaboration/flpplugins/msplugin/Component.js +1 -2
  28. package/src/sap/suite/ui/commons/flexibility/changeHandler/PropertyChangeMapper.js +1 -1
  29. package/src/sap/suite/ui/commons/imageeditor/CropCustomShapeHistoryItem.js +1 -1
  30. package/src/sap/suite/ui/commons/imageeditor/CropEllipseHistoryItem.js +1 -1
  31. package/src/sap/suite/ui/commons/imageeditor/CropRectangleHistoryItem.js +1 -1
  32. package/src/sap/suite/ui/commons/imageeditor/CustomSizeItem.js +1 -1
  33. package/src/sap/suite/ui/commons/imageeditor/FilterHistoryItem.js +1 -1
  34. package/src/sap/suite/ui/commons/imageeditor/FlipHistoryItem.js +1 -1
  35. package/src/sap/suite/ui/commons/imageeditor/HistoryItem.js +1 -1
  36. package/src/sap/suite/ui/commons/imageeditor/ImageEditor.js +1 -1
  37. package/src/sap/suite/ui/commons/imageeditor/ImageEditorContainer.js +1 -1
  38. package/src/sap/suite/ui/commons/imageeditor/ImageEditorResponsiveContainer.js +1 -1
  39. package/src/sap/suite/ui/commons/imageeditor/ResizeHistoryItem.js +1 -1
  40. package/src/sap/suite/ui/commons/imageeditor/RotateHistoryItem.js +1 -1
  41. package/src/sap/suite/ui/commons/library.js +100 -3
  42. package/src/sap/suite/ui/commons/messagebundle.properties +76 -10
  43. package/src/sap/suite/ui/commons/messagebundle_ar.properties +51 -5
  44. package/src/sap/suite/ui/commons/messagebundle_bg.properties +62 -16
  45. package/src/sap/suite/ui/commons/messagebundle_ca.properties +52 -6
  46. package/src/sap/suite/ui/commons/messagebundle_cnr.properties +52 -6
  47. package/src/sap/suite/ui/commons/messagebundle_cs.properties +51 -5
  48. package/src/sap/suite/ui/commons/messagebundle_cy.properties +51 -5
  49. package/src/sap/suite/ui/commons/messagebundle_da.properties +51 -5
  50. package/src/sap/suite/ui/commons/messagebundle_de.properties +52 -6
  51. package/src/sap/suite/ui/commons/messagebundle_el.properties +52 -6
  52. package/src/sap/suite/ui/commons/messagebundle_en.properties +50 -7
  53. package/src/sap/suite/ui/commons/messagebundle_en_GB.properties +52 -6
  54. package/src/sap/suite/ui/commons/messagebundle_en_US_saprigi.properties +54 -6
  55. package/src/sap/suite/ui/commons/messagebundle_es.properties +53 -7
  56. package/src/sap/suite/ui/commons/messagebundle_es_MX.properties +54 -8
  57. package/src/sap/suite/ui/commons/messagebundle_et.properties +51 -5
  58. package/src/sap/suite/ui/commons/messagebundle_fi.properties +51 -5
  59. package/src/sap/suite/ui/commons/messagebundle_fr.properties +52 -6
  60. package/src/sap/suite/ui/commons/messagebundle_fr_CA.properties +52 -6
  61. package/src/sap/suite/ui/commons/messagebundle_hi.properties +52 -6
  62. package/src/sap/suite/ui/commons/messagebundle_hr.properties +52 -6
  63. package/src/sap/suite/ui/commons/messagebundle_hu.properties +51 -5
  64. package/src/sap/suite/ui/commons/messagebundle_id.properties +60 -14
  65. package/src/sap/suite/ui/commons/messagebundle_it.properties +53 -7
  66. package/src/sap/suite/ui/commons/messagebundle_iw.properties +51 -5
  67. package/src/sap/suite/ui/commons/messagebundle_ja.properties +52 -6
  68. package/src/sap/suite/ui/commons/messagebundle_kk.properties +51 -5
  69. package/src/sap/suite/ui/commons/messagebundle_ko.properties +51 -5
  70. package/src/sap/suite/ui/commons/messagebundle_lt.properties +51 -5
  71. package/src/sap/suite/ui/commons/messagebundle_lv.properties +52 -6
  72. package/src/sap/suite/ui/commons/messagebundle_mk.properties +51 -5
  73. package/src/sap/suite/ui/commons/messagebundle_ms.properties +59 -13
  74. package/src/sap/suite/ui/commons/messagebundle_nl.properties +51 -5
  75. package/src/sap/suite/ui/commons/messagebundle_no.properties +52 -6
  76. package/src/sap/suite/ui/commons/messagebundle_pl.properties +51 -5
  77. package/src/sap/suite/ui/commons/messagebundle_pt.properties +52 -6
  78. package/src/sap/suite/ui/commons/messagebundle_pt_PT.properties +51 -5
  79. package/src/sap/suite/ui/commons/messagebundle_ro.properties +51 -5
  80. package/src/sap/suite/ui/commons/messagebundle_ru.properties +51 -5
  81. package/src/sap/suite/ui/commons/messagebundle_sh.properties +52 -6
  82. package/src/sap/suite/ui/commons/messagebundle_sk.properties +51 -5
  83. package/src/sap/suite/ui/commons/messagebundle_sl.properties +51 -5
  84. package/src/sap/suite/ui/commons/messagebundle_sr.properties +52 -6
  85. package/src/sap/suite/ui/commons/messagebundle_sv.properties +51 -5
  86. package/src/sap/suite/ui/commons/messagebundle_th.properties +52 -6
  87. package/src/sap/suite/ui/commons/messagebundle_tr.properties +51 -5
  88. package/src/sap/suite/ui/commons/messagebundle_uk.properties +53 -7
  89. package/src/sap/suite/ui/commons/messagebundle_vi.properties +55 -9
  90. package/src/sap/suite/ui/commons/messagebundle_zh_CN.properties +51 -5
  91. package/src/sap/suite/ui/commons/messagebundle_zh_TW.properties +53 -7
  92. package/src/sap/suite/ui/commons/networkgraph/ElementBase.js +19 -1
  93. package/src/sap/suite/ui/commons/networkgraph/Graph.js +371 -29
  94. package/src/sap/suite/ui/commons/networkgraph/GraphRenderer.js +23 -10
  95. package/src/sap/suite/ui/commons/networkgraph/Group.js +43 -22
  96. package/src/sap/suite/ui/commons/networkgraph/KeyboardNavigator.js +54 -6
  97. package/src/sap/suite/ui/commons/networkgraph/Line.js +736 -31
  98. package/src/sap/suite/ui/commons/networkgraph/Node.js +546 -96
  99. package/src/sap/suite/ui/commons/networkgraph/Tooltip.js +5 -0
  100. package/src/sap/suite/ui/commons/networkgraph/layout/NoopLayout.js +28 -5
  101. package/src/sap/suite/ui/commons/networkgraph/util/ConnectionPathUtils.js +1144 -0
  102. package/src/sap/suite/ui/commons/networkgraph/util/CreateConnectionPopover.js +374 -0
  103. package/src/sap/suite/ui/commons/networkgraph/util/DependencyLayoutHelper.js +870 -0
  104. package/src/sap/suite/ui/commons/networkgraph/util/DragDropManager.js +563 -41
  105. package/src/sap/suite/ui/commons/networkgraph/util/PortManager.js +573 -0
  106. package/src/sap/suite/ui/commons/statusindicator/Circle.js +1 -1
  107. package/src/sap/suite/ui/commons/statusindicator/CustomShape.js +1 -1
  108. package/src/sap/suite/ui/commons/statusindicator/DiscreteThreshold.js +1 -1
  109. package/src/sap/suite/ui/commons/statusindicator/FillingOption.js +1 -1
  110. package/src/sap/suite/ui/commons/statusindicator/LibraryShape.js +1 -1
  111. package/src/sap/suite/ui/commons/statusindicator/Path.js +1 -1
  112. package/src/sap/suite/ui/commons/statusindicator/PropertyThreshold.js +1 -1
  113. package/src/sap/suite/ui/commons/statusindicator/Rectangle.js +1 -1
  114. package/src/sap/suite/ui/commons/statusindicator/Shape.js +1 -1
  115. package/src/sap/suite/ui/commons/statusindicator/ShapeGroup.js +1 -1
  116. package/src/sap/suite/ui/commons/statusindicator/SimpleShape.js +1 -1
  117. package/src/sap/suite/ui/commons/statusindicator/StatusIndicator.js +1 -1
  118. package/src/sap/suite/ui/commons/taccount/TAccount.js +1 -1
  119. package/src/sap/suite/ui/commons/taccount/TAccountGroup.js +1 -1
  120. package/src/sap/suite/ui/commons/taccount/TAccountItem.js +1 -1
  121. package/src/sap/suite/ui/commons/taccount/TAccountItemProperty.js +1 -1
  122. package/src/sap/suite/ui/commons/taccount/TAccountPanel.js +1 -1
  123. package/src/sap/suite/ui/commons/themes/base/NetworkGraph.less +13 -13
  124. package/src/sap/suite/ui/commons/themes/base/NetworkGroup.less +34 -2
  125. package/src/sap/suite/ui/commons/themes/base/NetworkLine.less +58 -13
  126. package/src/sap/suite/ui/commons/themes/base/NetworkNode.less +206 -1
@@ -0,0 +1,374 @@
1
+ /*!
2
+ *
3
+ SAP UI development toolkit for HTML5 (SAPUI5)
4
+ (c) Copyright 2009-2015 SAP SE. All rights reserved
5
+
6
+ */
7
+ sap.ui.define([
8
+ "sap/suite/ui/commons/library",
9
+ "sap/m/Popover",
10
+ "sap/m/ComboBox",
11
+ "sap/m/MultiComboBox",
12
+ "sap/m/Button",
13
+ "sap/m/VBox",
14
+ "sap/m/HBox",
15
+ "sap/m/Label",
16
+ "sap/m/Toolbar",
17
+ "sap/m/ToolbarSpacer",
18
+ "sap/ui/core/Item",
19
+ "sap/ui/core/Lib"
20
+ ], function (library, Popover, ComboBox, MultiComboBox, Button, VBox, HBox, Label, Toolbar, ToolbarSpacer, Item, CoreLib) {
21
+ "use strict";
22
+ var oResourceBundle = CoreLib.getResourceBundleFor("sap.suite.ui.commons");
23
+ /**
24
+ * Utility class for creating and managing connection creation popovers
25
+ * @class
26
+ * @private
27
+ */
28
+ var CreateConnectionPopover = function () {
29
+ this._oPopover = null;
30
+ this._oConnectionTypeCombo = null;
31
+ this._oDestinationCombo = null;
32
+ this._oOkButton = null;
33
+ this._aConnectionRows = []; // Store multiple connection rows
34
+ this._oConnectionsContainer = null; // VBox container for connection rows
35
+ this._oCreateButton = null; // Button to add more connections
36
+ this._iMaxConnections = 4; // Maximum number of connections allowed
37
+ };
38
+ /**
39
+ * Shows the connection popover for creating connections between nodes
40
+ * @param {Object} mConfig Configuration object
41
+ * @param {sap.suite.ui.commons.networkgraph.Node} mConfig.sourceNode The source node
42
+ * @param {Event} mConfig.event The triggering event
43
+ * @param {Function} mConfig.onConnectionCreate Callback function when connection is created
44
+ * @public
45
+ */
46
+ CreateConnectionPopover.prototype.show = function (mConfig) {
47
+ var oSourceNode = mConfig.sourceNode;
48
+ var oEvent = mConfig.event;
49
+ var fnOnConnectionCreate = mConfig.onConnectionCreate;
50
+ var oGraph = oSourceNode.getParent();
51
+ if (!oGraph) {
52
+ return;
53
+ }
54
+ // Clean up any existing popover
55
+ this._cleanup();
56
+
57
+ // Initialize connections container
58
+ this._oConnectionsContainer = new VBox();
59
+ this._aConnectionRows = [];
60
+
61
+ // Create the first connection row
62
+ this._addConnectionRow(oSourceNode, oGraph);
63
+ // Create "Create" button to add more connections
64
+ this._oCreateButton = new Button(oSourceNode.getId() + "-createButton", {
65
+ text: oResourceBundle.getText("NETWORKGRAPH_CREATE_BUTTON"),
66
+ type: "Transparent",
67
+ enabled: true,
68
+ press: function () {
69
+ this._addConnectionRow(oSourceNode, oGraph);
70
+ }.bind(this)
71
+ });
72
+
73
+ // Create OK button (initially disabled)
74
+ this._oOkButton = new Button(oSourceNode.getId() + "-okButton", {
75
+ text: oResourceBundle.getText("NETWORKGRAPH_OK_BUTTON"),
76
+ type: "Emphasized",
77
+ enabled: false,
78
+ press: function () {
79
+ this._handleConnectionCreate(oSourceNode, fnOnConnectionCreate);
80
+ }.bind(this)
81
+ });
82
+
83
+ // Create Cancel button
84
+ var oCancelButton = new Button(oSourceNode.getId() + "-cancelButton", {
85
+ text: oResourceBundle.getText("NETWORKGRAPH_CANCEL_BUTTON"),
86
+ type: "Transparent",
87
+ press: function () {
88
+ this._oPopover.close();
89
+ }.bind(this)
90
+ });
91
+
92
+ // Create popover content
93
+ var oPopoverContent = new VBox({
94
+ items: [
95
+ this._oConnectionsContainer,
96
+ new HBox({
97
+ justifyContent: "End",
98
+ items: [
99
+ this._oCreateButton
100
+ ]
101
+ }).addStyleClass("sapUiTinyMarginTop")
102
+ ]
103
+ }).addStyleClass("sapUiTinyMargin");
104
+
105
+ // Create footer toolbar with OK and Cancel buttons
106
+ var oFooterToolbar = new Toolbar({
107
+ content: [
108
+ new ToolbarSpacer(),
109
+ this._oOkButton,
110
+ oCancelButton
111
+ ]
112
+ });
113
+
114
+ // Create and show popover
115
+ this._oPopover = new Popover(oSourceNode.getId() + "-connectionPopover", {
116
+ title: oResourceBundle.getText("NETWORKGRAPH_CONNECTION_POPOVER_TITLE"),
117
+ content: oPopoverContent,
118
+ footer: oFooterToolbar,
119
+ placement: "PreferredTopOrFlip",
120
+ afterClose: function () {
121
+ this._cleanup();
122
+ }.bind(this)
123
+ });
124
+ // Open popover relative to the event target (arrow button)
125
+ this._oPopover.openBy(oEvent.target);
126
+ };
127
+ /**
128
+ * Creates connection type items dynamically from the ConnectionType enum
129
+ * based on the node ports configuration and graph-level connection type mapping.
130
+ * The mapping allows customization of display text - values starting with "NETWORKGRAPH_"
131
+ * are treated as message bundle keys, while other values are used as custom display text.
132
+ * @param {sap.suite.ui.commons.networkgraph.Graph} oGraph - The parent graph
133
+ * @returns {Array<sap.ui.core.Item>} Array of connection type items
134
+ * @private
135
+ */
136
+ CreateConnectionPopover.prototype._createConnectionTypeItems = function (oGraph) {
137
+ var aItems = [];
138
+ var oConnectionTypes = library.networkgraph.ConnectionType;
139
+ var sNodePorts = oGraph.getNodePorts();
140
+
141
+ // Define default message bundle keys mapping
142
+ var mDefaultMapping = {
143
+ "LeftToLeft": "NETWORKGRAPH_CONNECTION_TYPE_LEFT_TO_LEFT",
144
+ "LeftToRight": "NETWORKGRAPH_CONNECTION_TYPE_LEFT_TO_RIGHT",
145
+ "RightToLeft": "NETWORKGRAPH_CONNECTION_TYPE_RIGHT_TO_LEFT",
146
+ "RightToRight": "NETWORKGRAPH_CONNECTION_TYPE_RIGHT_TO_RIGHT"
147
+ };
148
+
149
+ // Get user-provided mapping and merge with defaults for missing/invalid keys
150
+ var mUserMapping = oGraph.getConnectionTypeMapping() || {};
151
+ var mMessageKeys = {};
152
+
153
+ // For each valid connection type, use user mapping if valid key exists, otherwise use default
154
+ for (var sConnectionType in mDefaultMapping) {
155
+ if (mDefaultMapping.hasOwnProperty(sConnectionType)) {
156
+ // Use user mapping if the exact key exists, otherwise fall back to default
157
+ mMessageKeys[sConnectionType] = mUserMapping[sConnectionType] || mDefaultMapping[sConnectionType];
158
+ }
159
+ }
160
+ // Define which connection types are available for each port configuration
161
+ var mPortConnectionMapping = {
162
+ "None": [], // No connections available
163
+ "LeftRight": [library.networkgraph.ConnectionType.LeftToLeft, library.networkgraph.ConnectionType.LeftToRight, library.networkgraph.ConnectionType.RightToLeft, library.networkgraph.ConnectionType.RightToRight]
164
+ };
165
+ // Get allowed connection types for current port configuration
166
+ var aAllowedTypes = mPortConnectionMapping[sNodePorts] || [];
167
+ // If port configuration is not recognized, show all available types
168
+ if (aAllowedTypes.length === 0 && sNodePorts !== "None") {
169
+ aAllowedTypes = Object.keys(oConnectionTypes);
170
+ }
171
+ // Loop through the enum values and create items for allowed types only
172
+ for (var sKey in oConnectionTypes) {
173
+ if (oConnectionTypes.hasOwnProperty(sKey) && aAllowedTypes.indexOf(sKey) !== -1) {
174
+ var sValue = oConnectionTypes[sKey];
175
+ var sTextOrKey = mMessageKeys[sKey];
176
+ var sDisplayText;
177
+
178
+ if (sTextOrKey) {
179
+ // Check if it's a message bundle key (starts with uppercase) or custom text
180
+ if (sTextOrKey.indexOf("NETWORKGRAPH_") === 0) {
181
+ // It's a message bundle key, try to get text from bundle
182
+ sDisplayText = oResourceBundle.getText(sTextOrKey) || sTextOrKey;
183
+ } else {
184
+ // It's custom text, use as-is
185
+ sDisplayText = sTextOrKey;
186
+ }
187
+ } else {
188
+ // Fallback to enum key if no mapping found
189
+ sDisplayText = sKey;
190
+ }
191
+
192
+ aItems.push(new Item({
193
+ key: sValue,
194
+ text: sDisplayText
195
+ }));
196
+ }
197
+ }
198
+ return aItems;
199
+ };
200
+ /**
201
+ * Adds a new connection row with ComboBoxes for connection type and destination
202
+ * @param {sap.suite.ui.commons.networkgraph.Node} oSourceNode The source node
203
+ * @param {sap.suite.ui.commons.networkgraph.Graph} oGraph The parent graph
204
+ * @private
205
+ */
206
+ CreateConnectionPopover.prototype._addConnectionRow = function (oSourceNode, oGraph) {
207
+ if (this._aConnectionRows.length >= this._iMaxConnections) {
208
+ return;
209
+ }
210
+
211
+ var iRowIndex = this._aConnectionRows.length;
212
+ var sRowId = oSourceNode.getId() + "-row-" + iRowIndex;
213
+
214
+ // Create connection type combo box
215
+ var oConnectionTypeCombo = new ComboBox(sRowId + "-connectionTypeCombo", {
216
+ items: this._createConnectionTypeItems(oGraph),
217
+ width: "14.125rem",
218
+ selectionChange: function () {
219
+ this._updateButtons();
220
+ }.bind(this)
221
+ });
222
+
223
+ // Create destination node multi combo box
224
+ var oDestinationCombo = new MultiComboBox(sRowId + "-destinationCombo", {
225
+ width: "14.125rem",
226
+ selectionChange: function () {
227
+ this._updateButtons();
228
+ }.bind(this)
229
+ });
230
+
231
+ // Populate destination combo with all other nodes
232
+ var aAllNodes = oGraph.getNodes();
233
+ var sCurrentNodeKey = oSourceNode.getKey();
234
+ aAllNodes.forEach(function (oNode) {
235
+ if (oNode.getKey() !== sCurrentNodeKey) {
236
+ oDestinationCombo.addItem(new Item({
237
+ key: oNode.getKey(),
238
+ text: oNode.getTitle() || oNode.getKey()
239
+ }));
240
+ }
241
+ });
242
+
243
+ // Create the row container
244
+ var oRowContainer = new VBox({
245
+ items: [
246
+ new HBox({
247
+ alignItems: "Center",
248
+ items: [
249
+ new Label({
250
+ text: oResourceBundle.getText("NETWORKGRAPH_CONNECTION_TYPE_LABEL"),
251
+ labelFor: oConnectionTypeCombo.getId(),
252
+ width: "9rem"
253
+ }),
254
+ oConnectionTypeCombo
255
+ ]
256
+ }).addStyleClass("sapUiTinyMargin"),
257
+ new HBox({
258
+ alignItems: "Center",
259
+ items: [
260
+ new Label({
261
+ text: oResourceBundle.getText("NETWORKGRAPH_DESTINATION_LABEL"),
262
+ labelFor: oDestinationCombo.getId(),
263
+ width: "9rem"
264
+ }),
265
+ oDestinationCombo
266
+ ]
267
+ }).addStyleClass("sapUiTinyMargin")
268
+ ]
269
+ });
270
+
271
+ // Store the row data
272
+ this._aConnectionRows.push({
273
+ container: oRowContainer,
274
+ connectionTypeCombo: oConnectionTypeCombo,
275
+ destinationCombo: oDestinationCombo
276
+ });
277
+
278
+ // Add to connections container
279
+ this._oConnectionsContainer.addItem(oRowContainer);
280
+
281
+ // Update button states
282
+ this._updateButtons();
283
+ };
284
+
285
+ /**
286
+ * Updates the OK and Create button states based on dropdown selections
287
+ * @private
288
+ */
289
+ CreateConnectionPopover.prototype._updateButtons = function () {
290
+ if (!this._oOkButton || !this._oCreateButton) {
291
+ return;
292
+ }
293
+
294
+ // Check if at least one row has both selections made
295
+ var bAtLeastOneComplete = this._aConnectionRows.some(function (oRow) {
296
+ return !!oRow.connectionTypeCombo.getSelectedKey() &&
297
+ oRow.destinationCombo.getSelectedKeys().length > 0;
298
+ });
299
+
300
+ // Enable OK button if at least one connection is complete
301
+ this._oOkButton.setEnabled(bAtLeastOneComplete);
302
+
303
+ // Disable Create button only when max connections reached
304
+ this._oCreateButton.setEnabled(this._aConnectionRows.length < this._iMaxConnections);
305
+ };
306
+ /**
307
+ * Handles connection creation when OK button is pressed
308
+ * Creates all complete connections from the rows
309
+ * @param {sap.suite.ui.commons.networkgraph.Node} oSourceNode The source node
310
+ * @param {Function} fnOnConnectionCreate Callback function when connection is created
311
+ * @private
312
+ */
313
+ CreateConnectionPopover.prototype._handleConnectionCreate = function (oSourceNode, fnOnConnectionCreate) {
314
+ var oGraph = oSourceNode.getParent();
315
+ if (!oGraph || !fnOnConnectionCreate) {
316
+ return;
317
+ }
318
+
319
+ // Collect all complete connections
320
+ var aConnections = [];
321
+ this._aConnectionRows.forEach(function (oRow) {
322
+ var sConnectionType = oRow.connectionTypeCombo.getSelectedKey();
323
+ var aTargetNodeKeys = oRow.destinationCombo.getSelectedKeys();
324
+
325
+ if (sConnectionType && aTargetNodeKeys.length > 0) {
326
+ // Create a connection for each selected destination node
327
+ aTargetNodeKeys.forEach(function (sTargetNodeKey) {
328
+ var oTargetNode = oGraph.getNodeByKey(sTargetNodeKey);
329
+ if (oTargetNode) {
330
+ aConnections.push({
331
+ from: oSourceNode.getKey(),
332
+ to: oTargetNode.getKey(),
333
+ connectionType: sConnectionType,
334
+ fromNode: oSourceNode,
335
+ toNode: oTargetNode
336
+ });
337
+ }
338
+ });
339
+ }
340
+ });
341
+
342
+ // Call the callback for each connection
343
+ aConnections.forEach(function (oConnection) {
344
+ fnOnConnectionCreate(oConnection);
345
+ });
346
+
347
+ // Close the popover
348
+ this._oPopover.close();
349
+ };
350
+ /**
351
+ * Cleans up the popover and its controls
352
+ * @private
353
+ */
354
+ CreateConnectionPopover.prototype._cleanup = function () {
355
+ if (this._oPopover) {
356
+ this._oPopover.destroy();
357
+ this._oPopover = null;
358
+ }
359
+ this._oConnectionTypeCombo = null;
360
+ this._oDestinationCombo = null;
361
+ this._oOkButton = null;
362
+ this._oCreateButton = null;
363
+ this._oConnectionsContainer = null;
364
+ this._aConnectionRows = [];
365
+ };
366
+ /**
367
+ * Destroys the popover utility and cleans up resources
368
+ * @public
369
+ */
370
+ CreateConnectionPopover.prototype.destroy = function () {
371
+ this._cleanup();
372
+ };
373
+ return CreateConnectionPopover;
374
+ });