@sapui5/sap.suite.ui.commons 1.144.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.
- package/package.json +1 -1
- package/src/sap/suite/ui/commons/.library +1 -1
- package/src/sap/suite/ui/commons/AriaProperties.js +1 -1
- package/src/sap/suite/ui/commons/CalculationBuilder.js +8 -4
- package/src/sap/suite/ui/commons/CalculationBuilderExpression.js +1 -1
- package/src/sap/suite/ui/commons/CalculationBuilderFunction.js +1 -1
- package/src/sap/suite/ui/commons/CalculationBuilderGroup.js +1 -1
- package/src/sap/suite/ui/commons/CalculationBuilderItem.js +1 -1
- package/src/sap/suite/ui/commons/CalculationBuilderValidationResult.js +1 -1
- package/src/sap/suite/ui/commons/CalculationBuilderVariable.js +1 -1
- package/src/sap/suite/ui/commons/CloudFilePicker.js +1 -3
- package/src/sap/suite/ui/commons/MicroProcessFlow.js +1 -1
- package/src/sap/suite/ui/commons/MicroProcessFlowItem.js +1 -1
- package/src/sap/suite/ui/commons/Timeline.js +9 -0
- package/src/sap/suite/ui/commons/TimelineNavigator.js +37 -5
- package/src/sap/suite/ui/commons/TimelineRenderer.js +3 -3
- package/src/sap/suite/ui/commons/collaboration/BaseHelperService.js +0 -1
- package/src/sap/suite/ui/commons/collaboration/CollaborationHelper.js +0 -3
- package/src/sap/suite/ui/commons/collaboration/CollaborationManagerService.js +0 -1
- package/src/sap/suite/ui/commons/collaboration/ContactHelper.js +7 -0
- package/src/sap/suite/ui/commons/collaboration/ContactPopover.fragment.xml +4 -1
- package/src/sap/suite/ui/commons/collaboration/MinimalContactPopover.fragment.xml +2 -1
- package/src/sap/suite/ui/commons/collaboration/TeamsHelperService.js +0 -6
- package/src/sap/suite/ui/commons/collaboration/channels/MessageChannel.js +0 -2
- package/src/sap/suite/ui/commons/collaboration/flpplugins/msplugin/Component-preload.js +1 -1
- package/src/sap/suite/ui/commons/collaboration/flpplugins/msplugin/Component.js +1 -2
- package/src/sap/suite/ui/commons/flexibility/changeHandler/PropertyChangeMapper.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/CropCustomShapeHistoryItem.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/CropEllipseHistoryItem.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/CropRectangleHistoryItem.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/CustomSizeItem.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/FilterHistoryItem.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/FlipHistoryItem.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/HistoryItem.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/ImageEditor.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/ImageEditorContainer.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/ImageEditorResponsiveContainer.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/ResizeHistoryItem.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/RotateHistoryItem.js +1 -1
- package/src/sap/suite/ui/commons/library.js +25 -1
- package/src/sap/suite/ui/commons/messagebundle.properties +16 -9
- package/src/sap/suite/ui/commons/messagebundle_ar.properties +17 -2
- package/src/sap/suite/ui/commons/messagebundle_bg.properties +18 -3
- package/src/sap/suite/ui/commons/messagebundle_ca.properties +18 -3
- package/src/sap/suite/ui/commons/messagebundle_cnr.properties +18 -3
- package/src/sap/suite/ui/commons/messagebundle_cs.properties +17 -2
- package/src/sap/suite/ui/commons/messagebundle_cy.properties +17 -2
- package/src/sap/suite/ui/commons/messagebundle_da.properties +17 -2
- package/src/sap/suite/ui/commons/messagebundle_de.properties +30 -15
- package/src/sap/suite/ui/commons/messagebundle_el.properties +18 -3
- package/src/sap/suite/ui/commons/messagebundle_en.properties +18 -3
- package/src/sap/suite/ui/commons/messagebundle_en_GB.properties +18 -3
- package/src/sap/suite/ui/commons/messagebundle_en_US_saprigi.properties +2 -0
- package/src/sap/suite/ui/commons/messagebundle_es.properties +18 -3
- package/src/sap/suite/ui/commons/messagebundle_es_MX.properties +18 -3
- package/src/sap/suite/ui/commons/messagebundle_et.properties +17 -2
- package/src/sap/suite/ui/commons/messagebundle_fi.properties +17 -2
- package/src/sap/suite/ui/commons/messagebundle_fr.properties +26 -11
- package/src/sap/suite/ui/commons/messagebundle_fr_CA.properties +17 -2
- package/src/sap/suite/ui/commons/messagebundle_hi.properties +18 -3
- package/src/sap/suite/ui/commons/messagebundle_hr.properties +18 -3
- package/src/sap/suite/ui/commons/messagebundle_hu.properties +17 -2
- package/src/sap/suite/ui/commons/messagebundle_id.properties +18 -3
- package/src/sap/suite/ui/commons/messagebundle_it.properties +17 -2
- package/src/sap/suite/ui/commons/messagebundle_iw.properties +17 -2
- package/src/sap/suite/ui/commons/messagebundle_ja.properties +18 -3
- package/src/sap/suite/ui/commons/messagebundle_kk.properties +17 -2
- package/src/sap/suite/ui/commons/messagebundle_ko.properties +17 -2
- package/src/sap/suite/ui/commons/messagebundle_lt.properties +17 -2
- package/src/sap/suite/ui/commons/messagebundle_lv.properties +18 -3
- package/src/sap/suite/ui/commons/messagebundle_mk.properties +17 -2
- package/src/sap/suite/ui/commons/messagebundle_ms.properties +17 -2
- package/src/sap/suite/ui/commons/messagebundle_nl.properties +17 -2
- package/src/sap/suite/ui/commons/messagebundle_no.properties +18 -3
- package/src/sap/suite/ui/commons/messagebundle_pl.properties +17 -2
- package/src/sap/suite/ui/commons/messagebundle_pt.properties +17 -2
- package/src/sap/suite/ui/commons/messagebundle_pt_PT.properties +17 -2
- package/src/sap/suite/ui/commons/messagebundle_ro.properties +17 -2
- package/src/sap/suite/ui/commons/messagebundle_ru.properties +17 -2
- package/src/sap/suite/ui/commons/messagebundle_sh.properties +18 -3
- package/src/sap/suite/ui/commons/messagebundle_sk.properties +17 -2
- package/src/sap/suite/ui/commons/messagebundle_sl.properties +17 -2
- package/src/sap/suite/ui/commons/messagebundle_sr.properties +18 -3
- package/src/sap/suite/ui/commons/messagebundle_sv.properties +17 -2
- package/src/sap/suite/ui/commons/messagebundle_th.properties +18 -3
- package/src/sap/suite/ui/commons/messagebundle_tr.properties +17 -2
- package/src/sap/suite/ui/commons/messagebundle_uk.properties +17 -2
- package/src/sap/suite/ui/commons/messagebundle_vi.properties +19 -4
- package/src/sap/suite/ui/commons/messagebundle_zh_CN.properties +17 -2
- package/src/sap/suite/ui/commons/messagebundle_zh_TW.properties +19 -4
- package/src/sap/suite/ui/commons/networkgraph/Graph.js +45 -16
- package/src/sap/suite/ui/commons/networkgraph/KeyboardNavigator.js +45 -4
- package/src/sap/suite/ui/commons/networkgraph/Line.js +52 -0
- package/src/sap/suite/ui/commons/networkgraph/Node.js +289 -86
- package/src/sap/suite/ui/commons/networkgraph/util/DependencyLayoutHelper.js +143 -70
- package/src/sap/suite/ui/commons/networkgraph/util/PortManager.js +2 -3
- package/src/sap/suite/ui/commons/statusindicator/Circle.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/CustomShape.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/DiscreteThreshold.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/FillingOption.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/LibraryShape.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/Path.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/PropertyThreshold.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/Rectangle.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/Shape.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/ShapeGroup.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/SimpleShape.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/StatusIndicator.js +1 -1
- package/src/sap/suite/ui/commons/taccount/TAccount.js +1 -1
- package/src/sap/suite/ui/commons/taccount/TAccountGroup.js +1 -1
- package/src/sap/suite/ui/commons/taccount/TAccountItem.js +1 -1
- package/src/sap/suite/ui/commons/taccount/TAccountItemProperty.js +1 -1
- package/src/sap/suite/ui/commons/taccount/TAccountPanel.js +1 -1
- package/src/sap/suite/ui/commons/themes/base/NetworkLine.less +26 -5
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
sap.ui.define(["sap/suite/ui/commons/library", "sap/base/Log"], function (library, Log) {
|
|
8
8
|
"use strict";
|
|
9
9
|
|
|
10
|
-
const ConnectionType = library.networkgraph.ConnectionType
|
|
10
|
+
const ConnectionType = library.networkgraph.ConnectionType,
|
|
11
|
+
ComponentArrangement = library.networkgraph.ComponentArrangement;
|
|
11
12
|
const DEFAULT_HORIZONTAL_SPACING = 240;
|
|
12
13
|
const DEFAULT_VERTICAL_SPACING = 100;
|
|
13
14
|
|
|
@@ -21,6 +22,12 @@ sap.ui.define(["sap/suite/ui/commons/library", "sap/base/Log"], function (librar
|
|
|
21
22
|
* @since 1.144
|
|
22
23
|
*/
|
|
23
24
|
const DependencyLayoutHelper = {
|
|
25
|
+
/**
|
|
26
|
+
* WeakMap to store last calculated positions and origin flag for automatic drag detection.
|
|
27
|
+
* Structure: {x: number, y: number, bIsUserPositioned: boolean}
|
|
28
|
+
*/
|
|
29
|
+
_lastCalculated: new WeakMap(),
|
|
30
|
+
|
|
24
31
|
/**
|
|
25
32
|
* Calculates and sets positions for nodes without coordinates based on their dependency relationships.
|
|
26
33
|
* Uses topological sorting (Kahn's algorithm) and DFS-based cycle detection to arrange nodes
|
|
@@ -30,6 +37,7 @@ sap.ui.define(["sap/suite/ui/commons/library", "sap/base/Log"], function (librar
|
|
|
30
37
|
* @param {object} [mConfig] - Configuration object
|
|
31
38
|
* @param {number} [mConfig.horizontalSpacing=240] - Horizontal spacing between layers
|
|
32
39
|
* @param {number} [mConfig.verticalSpacing=100] - Vertical spacing between nodes
|
|
40
|
+
* @param {sap.suite.ui.commons.networkgraph.ComponentArrangement} [mConfig.componentArrangement=Horizontal] - Component arrangement: "Horizontal" or "Vertical"
|
|
33
41
|
* @public
|
|
34
42
|
*/
|
|
35
43
|
calculatePositions: function (oGraph, mConfig) {
|
|
@@ -41,17 +49,19 @@ sap.ui.define(["sap/suite/ui/commons/library", "sap/base/Log"], function (librar
|
|
|
41
49
|
{
|
|
42
50
|
horizontalSpacing: DEFAULT_HORIZONTAL_SPACING,
|
|
43
51
|
verticalSpacing: DEFAULT_VERTICAL_SPACING,
|
|
52
|
+
componentArrangement: ComponentArrangement.Horizontal,
|
|
44
53
|
},
|
|
45
54
|
mConfig || {}
|
|
46
55
|
);
|
|
47
|
-
|
|
48
56
|
try {
|
|
57
|
+
this._detectUserChanges(oGraph);
|
|
49
58
|
this._buildDependencyGraph(oGraph);
|
|
50
59
|
const aComponents = this._identifyComponents(oGraph);
|
|
51
|
-
this._processComponents(aComponents);
|
|
60
|
+
this._processComponents(aComponents, config);
|
|
52
61
|
this._calculateCoordinates(oGraph, config);
|
|
53
62
|
this._adjustHorizontalSpacingForNodeWidths(oGraph, config);
|
|
54
63
|
this._adjustVerticalSpacingForNodeHeights(oGraph, config);
|
|
64
|
+
this._storeFinalPositions(oGraph);
|
|
55
65
|
} catch (e) {
|
|
56
66
|
Log.error("DependencyLayoutHelper error: " + e.message, e);
|
|
57
67
|
throw new Error("DependencyLayoutHelper error: " + e.message);
|
|
@@ -64,8 +74,8 @@ sap.ui.define(["sap/suite/ui/commons/library", "sap/base/Log"], function (librar
|
|
|
64
74
|
},
|
|
65
75
|
|
|
66
76
|
/**
|
|
67
|
-
* Builds the
|
|
68
|
-
* Initializes layout data for each node and categorizes connections
|
|
77
|
+
* Builds the dependency graph structure by analyzing node relationships.
|
|
78
|
+
* Initializes layout data for each node and categorizes connections.
|
|
69
79
|
*
|
|
70
80
|
* @param {sap.suite.ui.commons.networkgraph.Graph} oGraph - The network graph instance
|
|
71
81
|
* @private
|
|
@@ -79,9 +89,9 @@ sap.ui.define(["sap/suite/ui/commons/library", "sap/base/Log"], function (librar
|
|
|
79
89
|
mNodeMap.set(oNode.getKey(), oNode);
|
|
80
90
|
const fX = oNode.getX();
|
|
81
91
|
const fY = oNode.getY();
|
|
82
|
-
|
|
83
|
-
//
|
|
84
|
-
const
|
|
92
|
+
const oLastPos = this._lastCalculated.get(oNode);
|
|
93
|
+
// Only preserve coordinates if they were original or user-dragged
|
|
94
|
+
const bShouldPreserve = oLastPos?.bIsUserPositioned;
|
|
85
95
|
|
|
86
96
|
oNode._layoutData = {
|
|
87
97
|
layer: -1,
|
|
@@ -91,9 +101,10 @@ sap.ui.define(["sap/suite/ui/commons/library", "sap/base/Log"], function (librar
|
|
|
91
101
|
parallelNodes: [],
|
|
92
102
|
backwardEdges: [],
|
|
93
103
|
backwardEdgeLines: [],
|
|
94
|
-
|
|
104
|
+
isBackwardSource: false,
|
|
105
|
+
bShouldPreserve,
|
|
95
106
|
userX: fX,
|
|
96
|
-
userY: fY
|
|
107
|
+
userY: fY
|
|
97
108
|
};
|
|
98
109
|
});
|
|
99
110
|
|
|
@@ -164,12 +175,9 @@ sap.ui.define(["sap/suite/ui/commons/library", "sap/base/Log"], function (librar
|
|
|
164
175
|
oNode._layoutData.isBackwardSource = true;
|
|
165
176
|
oNode._layoutData.backwardEdges.push(oTargetNode);
|
|
166
177
|
|
|
167
|
-
const
|
|
168
|
-
if (
|
|
169
|
-
|
|
170
|
-
if (oLine) {
|
|
171
|
-
oNode._layoutData.backwardEdgeLines.push(oLine);
|
|
172
|
-
}
|
|
178
|
+
const oLine = this._lineMap.get(sKey)?.get(sTargetKey);
|
|
179
|
+
if (oLine) {
|
|
180
|
+
oNode._layoutData.backwardEdgeLines.push(oLine);
|
|
173
181
|
}
|
|
174
182
|
|
|
175
183
|
const idx = oTargetNode._layoutData.incoming.indexOf(oNode);
|
|
@@ -251,9 +259,10 @@ sap.ui.define(["sap/suite/ui/commons/library", "sap/base/Log"], function (librar
|
|
|
251
259
|
* Processes all components: separates isolated nodes and arranges connected components.
|
|
252
260
|
*
|
|
253
261
|
* @param {Array<sap.suite.ui.commons.networkgraph.Node[]>} aComponents - Array of components (groups of connected nodes)
|
|
262
|
+
* @param {object} config - Configuration object
|
|
254
263
|
* @private
|
|
255
264
|
*/
|
|
256
|
-
_processComponents: function (aComponents) {
|
|
265
|
+
_processComponents: function (aComponents, { componentArrangement }) {
|
|
257
266
|
const aIsolatedNodes = [];
|
|
258
267
|
const aConnectedComponents = [];
|
|
259
268
|
|
|
@@ -261,7 +270,8 @@ sap.ui.define(["sap/suite/ui/commons/library", "sap/base/Log"], function (librar
|
|
|
261
270
|
const bIsIsolated =
|
|
262
271
|
aComponentNodes.length === 1 &&
|
|
263
272
|
aComponentNodes[0]._layoutData.incoming.length === 0 &&
|
|
264
|
-
aComponentNodes[0]._layoutData.outgoing.length === 0
|
|
273
|
+
aComponentNodes[0]._layoutData.outgoing.length === 0 &&
|
|
274
|
+
!aComponentNodes[0]._layoutData.bShouldPreserve;
|
|
265
275
|
|
|
266
276
|
if (bIsIsolated) {
|
|
267
277
|
aIsolatedNodes.push(aComponentNodes[0]);
|
|
@@ -269,7 +279,7 @@ sap.ui.define(["sap/suite/ui/commons/library", "sap/base/Log"], function (librar
|
|
|
269
279
|
aConnectedComponents.push(aComponentNodes);
|
|
270
280
|
}
|
|
271
281
|
});
|
|
272
|
-
|
|
282
|
+
const bSideBySide = componentArrangement !== ComponentArrangement.Vertical;
|
|
273
283
|
let iMaxVerticalPosition = 0;
|
|
274
284
|
let iMaxLayerAcrossAll = 0;
|
|
275
285
|
|
|
@@ -278,35 +288,56 @@ sap.ui.define(["sap/suite/ui/commons/library", "sap/base/Log"], function (librar
|
|
|
278
288
|
this._adjustParallelLayersForComponent(aComponentNodes);
|
|
279
289
|
this._assignVerticalPositionsForComponent(aComponentNodes);
|
|
280
290
|
|
|
281
|
-
|
|
282
|
-
oNode
|
|
283
|
-
|
|
284
|
-
|
|
291
|
+
if (bSideBySide) {
|
|
292
|
+
aComponentNodes.forEach((oNode) => {
|
|
293
|
+
oNode._layoutData.layer += iMaxLayerAcrossAll;
|
|
294
|
+
oNode._layoutData.componentOffset = 0;
|
|
295
|
+
});
|
|
285
296
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
297
|
+
let iComponentMaxLayer = -1;
|
|
298
|
+
aComponentNodes.forEach((n) => {
|
|
299
|
+
if (n._layoutData.layer > iComponentMaxLayer) {
|
|
300
|
+
iComponentMaxLayer = n._layoutData.layer;
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
iMaxLayerAcrossAll = iComponentMaxLayer + 1;
|
|
304
|
+
} else {
|
|
305
|
+
aComponentNodes.forEach((oNode) => {
|
|
306
|
+
oNode._layoutData.position += iMaxVerticalPosition;
|
|
307
|
+
oNode._layoutData.componentOffset = 0;
|
|
308
|
+
});
|
|
293
309
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
310
|
+
let iComponentMaxPosition = -1;
|
|
311
|
+
aComponentNodes.forEach((n) => {
|
|
312
|
+
if (n._layoutData.position > iComponentMaxPosition) {
|
|
313
|
+
iComponentMaxPosition = n._layoutData.position;
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
iMaxVerticalPosition = iComponentMaxPosition + 1;
|
|
317
|
+
|
|
318
|
+
let iComponentMaxLayer = -1;
|
|
319
|
+
aComponentNodes.forEach((n) => {
|
|
320
|
+
if (n._layoutData.layer > iComponentMaxLayer) {
|
|
321
|
+
iComponentMaxLayer = n._layoutData.layer;
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
iMaxLayerAcrossAll = Math.max(iMaxLayerAcrossAll, iComponentMaxLayer);
|
|
325
|
+
}
|
|
301
326
|
});
|
|
302
327
|
|
|
303
328
|
if (aIsolatedNodes.length > 0) {
|
|
304
329
|
const iRightSideOffset = iMaxLayerAcrossAll + 1;
|
|
305
330
|
|
|
306
331
|
aIsolatedNodes.forEach((oNode, idx) => {
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
332
|
+
if (bSideBySide) {
|
|
333
|
+
oNode._layoutData.layer = Math.floor(idx / 2);
|
|
334
|
+
oNode._layoutData.position = idx % 2;
|
|
335
|
+
oNode._layoutData.componentOffset = iMaxLayerAcrossAll;
|
|
336
|
+
} else {
|
|
337
|
+
oNode._layoutData.layer = idx % 2;
|
|
338
|
+
oNode._layoutData.position = Math.floor(idx / 2);
|
|
339
|
+
oNode._layoutData.componentOffset = iRightSideOffset;
|
|
340
|
+
}
|
|
310
341
|
});
|
|
311
342
|
}
|
|
312
343
|
},
|
|
@@ -657,10 +688,10 @@ sap.ui.define(["sap/suite/ui/commons/library", "sap/base/Log"], function (librar
|
|
|
657
688
|
* @param {object} config - Configuration with spacing values
|
|
658
689
|
* @private
|
|
659
690
|
*/
|
|
660
|
-
_calculateCoordinates: function (oGraph,
|
|
691
|
+
_calculateCoordinates: function (oGraph, { horizontalSpacing, verticalSpacing }) {
|
|
661
692
|
const aNodes = oGraph.getNodes();
|
|
662
|
-
const iHSpacing =
|
|
663
|
-
const iVSpacing =
|
|
693
|
+
const iHSpacing = horizontalSpacing;
|
|
694
|
+
const iVSpacing = verticalSpacing;
|
|
664
695
|
|
|
665
696
|
aNodes.forEach((oNode) => {
|
|
666
697
|
const iComponentOffset = oNode._layoutData.componentOffset || 0;
|
|
@@ -671,11 +702,10 @@ sap.ui.define(["sap/suite/ui/commons/library", "sap/base/Log"], function (librar
|
|
|
671
702
|
});
|
|
672
703
|
|
|
673
704
|
aNodes.forEach((oNode) => {
|
|
674
|
-
if (oNode._layoutData.
|
|
675
|
-
const
|
|
676
|
-
|
|
677
|
-
oNode.
|
|
678
|
-
oNode.setY(fUserY);
|
|
705
|
+
if (oNode._layoutData.bShouldPreserve) {
|
|
706
|
+
const { userX, userY } = oNode._layoutData;
|
|
707
|
+
oNode.setX(userX);
|
|
708
|
+
oNode.setY(userY);
|
|
679
709
|
}
|
|
680
710
|
});
|
|
681
711
|
},
|
|
@@ -684,18 +714,15 @@ sap.ui.define(["sap/suite/ui/commons/library", "sap/base/Log"], function (librar
|
|
|
684
714
|
* Adjusts horizontal spacing to accommodate nodes with varying widths.
|
|
685
715
|
*
|
|
686
716
|
* @param {sap.suite.ui.commons.networkgraph.Graph} oGraph - The network graph instance
|
|
687
|
-
* @param {object} config - Configuration with spacing values
|
|
688
717
|
* @private
|
|
689
718
|
*/
|
|
690
|
-
_adjustHorizontalSpacingForNodeWidths: function (oGraph
|
|
719
|
+
_adjustHorizontalSpacingForNodeWidths: function (oGraph) {
|
|
691
720
|
const aNodes = oGraph.getNodes();
|
|
692
|
-
const iDefaultSpacing = config.horizontalSpacing;
|
|
693
|
-
const iHGap = iDefaultSpacing;
|
|
694
721
|
const mLayerWidths = {};
|
|
695
722
|
let iMaxLayer = -1;
|
|
696
723
|
|
|
697
724
|
aNodes.forEach((oNode) => {
|
|
698
|
-
if (!oNode._layoutData.
|
|
725
|
+
if (!oNode._layoutData.bShouldPreserve) {
|
|
699
726
|
const iLayer =
|
|
700
727
|
oNode._layoutData.layer + (oNode._layoutData.componentOffset || 0);
|
|
701
728
|
iMaxLayer = Math.max(iMaxLayer, iLayer);
|
|
@@ -716,16 +743,12 @@ sap.ui.define(["sap/suite/ui/commons/library", "sap/base/Log"], function (librar
|
|
|
716
743
|
mLayerOffsets[iLayer] = iCumulativeOffset;
|
|
717
744
|
const iActualWidth = mLayerWidths[iLayer];
|
|
718
745
|
if (iActualWidth) {
|
|
719
|
-
|
|
720
|
-
iCumulativeOffset += iActualWidth - iDefaultSpacing + iHGap;
|
|
721
|
-
} else {
|
|
722
|
-
iCumulativeOffset += iActualWidth;
|
|
723
|
-
}
|
|
746
|
+
iCumulativeOffset += iActualWidth;
|
|
724
747
|
}
|
|
725
748
|
}
|
|
726
749
|
|
|
727
750
|
aNodes.forEach((oNode) => {
|
|
728
|
-
if (!oNode._layoutData.
|
|
751
|
+
if (!oNode._layoutData.bShouldPreserve) {
|
|
729
752
|
const iLayer =
|
|
730
753
|
oNode._layoutData.layer + (oNode._layoutData.componentOffset || 0);
|
|
731
754
|
const iOffset = mLayerOffsets[iLayer] || 0;
|
|
@@ -738,18 +761,15 @@ sap.ui.define(["sap/suite/ui/commons/library", "sap/base/Log"], function (librar
|
|
|
738
761
|
* Adjusts vertical spacing to accommodate nodes with varying heights.
|
|
739
762
|
*
|
|
740
763
|
* @param {sap.suite.ui.commons.networkgraph.Graph} oGraph - The network graph instance
|
|
741
|
-
* @param {object} config - Configuration with spacing values
|
|
742
764
|
* @private
|
|
743
765
|
*/
|
|
744
|
-
_adjustVerticalSpacingForNodeHeights: function (oGraph
|
|
766
|
+
_adjustVerticalSpacingForNodeHeights: function (oGraph) {
|
|
745
767
|
const aNodes = oGraph.getNodes();
|
|
746
|
-
const iDefaultSpacing = config.verticalSpacing;
|
|
747
|
-
const iVGap = iDefaultSpacing;
|
|
748
768
|
const mPositionHeights = {};
|
|
749
769
|
const mAllPositions = {};
|
|
750
770
|
|
|
751
771
|
aNodes.forEach((oNode) => {
|
|
752
|
-
if (!oNode._layoutData.
|
|
772
|
+
if (!oNode._layoutData.bShouldPreserve) {
|
|
753
773
|
const iPosition = oNode._layoutData.position;
|
|
754
774
|
mAllPositions[iPosition] = true;
|
|
755
775
|
|
|
@@ -775,22 +795,75 @@ sap.ui.define(["sap/suite/ui/commons/library", "sap/base/Log"], function (librar
|
|
|
775
795
|
mPositionOffsets[iPosition] = iCumulativeOffset;
|
|
776
796
|
const iActualHeight = mPositionHeights[iPosition];
|
|
777
797
|
if (iActualHeight) {
|
|
778
|
-
|
|
779
|
-
iCumulativeOffset += iActualHeight - iDefaultSpacing + iVGap;
|
|
780
|
-
} else {
|
|
781
|
-
iCumulativeOffset += iActualHeight;
|
|
782
|
-
}
|
|
798
|
+
iCumulativeOffset += iActualHeight;
|
|
783
799
|
}
|
|
784
800
|
});
|
|
785
801
|
|
|
786
802
|
aNodes.forEach((oNode) => {
|
|
787
|
-
if (!oNode._layoutData.
|
|
803
|
+
if (!oNode._layoutData.bShouldPreserve) {
|
|
788
804
|
const iPosition = oNode._layoutData.position;
|
|
789
805
|
const iOffset = mPositionOffsets[iPosition] || 0;
|
|
790
806
|
oNode.setY(oNode.getY() + iOffset);
|
|
791
807
|
}
|
|
792
808
|
});
|
|
793
809
|
},
|
|
810
|
+
|
|
811
|
+
/**
|
|
812
|
+
* Stores final calculated positions for automatic drag detection on next call.
|
|
813
|
+
* Only stores positions for nodes that were calculated (not original/dragged).
|
|
814
|
+
*
|
|
815
|
+
* @param {sap.suite.ui.commons.networkgraph.Graph} oGraph - The network graph instance
|
|
816
|
+
* @private
|
|
817
|
+
*/
|
|
818
|
+
_storeFinalPositions: function (oGraph) {
|
|
819
|
+
const aNodes = oGraph.getNodes();
|
|
820
|
+
|
|
821
|
+
aNodes.forEach((oNode) => {
|
|
822
|
+
if (!oNode._layoutData.bShouldPreserve) {
|
|
823
|
+
this._lastCalculated.set(oNode, {
|
|
824
|
+
x: oNode.getX(),
|
|
825
|
+
y: oNode.getY(),
|
|
826
|
+
bIsUserPositioned: false
|
|
827
|
+
});
|
|
828
|
+
}
|
|
829
|
+
});
|
|
830
|
+
},
|
|
831
|
+
|
|
832
|
+
/**
|
|
833
|
+
* Detects user-made position changes by comparing current positions with last calculated positions.
|
|
834
|
+
* Marks nodes with original coordinates and tracks drag operations.
|
|
835
|
+
*
|
|
836
|
+
* @param {sap.suite.ui.commons.networkgraph.Graph} oGraph - The network graph instance
|
|
837
|
+
* @private
|
|
838
|
+
*/
|
|
839
|
+
_detectUserChanges: function (oGraph) {
|
|
840
|
+
const aNodes = oGraph.getNodes();
|
|
841
|
+
|
|
842
|
+
aNodes.forEach((oNode) => {
|
|
843
|
+
const fX = oNode.getX();
|
|
844
|
+
const fY = oNode.getY();
|
|
845
|
+
// Constraint: Nodes with coordinates (0,0) or negative values are treated as unpositioned.
|
|
846
|
+
// For origin positioning, use (0.1, 0.1) or (1, 1).
|
|
847
|
+
const bHasCoordinates = fX !== undefined && fY !== undefined && (fX !== 0 || fY !== 0);
|
|
848
|
+
const oLastPos = this._lastCalculated.get(oNode);
|
|
849
|
+
|
|
850
|
+
if (!oLastPos && bHasCoordinates) {
|
|
851
|
+
// First time seeing this node with coordinates - mark as original
|
|
852
|
+
this._lastCalculated.set(oNode, {
|
|
853
|
+
x: fX,
|
|
854
|
+
y: fY,
|
|
855
|
+
bIsUserPositioned: true
|
|
856
|
+
});
|
|
857
|
+
} else if (oLastPos) {
|
|
858
|
+
// Check if user dragged it
|
|
859
|
+
if (fX !== oLastPos.x || fY !== oLastPos.y) {
|
|
860
|
+
oLastPos.x = fX;
|
|
861
|
+
oLastPos.y = fY;
|
|
862
|
+
oLastPos.bIsUserPositioned = true;
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
});
|
|
866
|
+
},
|
|
794
867
|
};
|
|
795
868
|
|
|
796
869
|
return DependencyLayoutHelper;
|
|
@@ -68,8 +68,7 @@ sap.ui.define([
|
|
|
68
68
|
* @param {boolean} bTriggerNode - Whether the node is a trigger node.
|
|
69
69
|
*/
|
|
70
70
|
addPortsToNode(oNode, bTriggerNode) {
|
|
71
|
-
var
|
|
72
|
-
var sNodePorts = oGraph.getNodePorts();
|
|
71
|
+
var sNodePorts = oNode._getNodePorts();
|
|
73
72
|
// Remove existing ports first
|
|
74
73
|
this.removePortsFromNode(oNode);
|
|
75
74
|
if (sNodePorts === "None") {
|
|
@@ -200,7 +199,7 @@ sap.ui.define([
|
|
|
200
199
|
*/
|
|
201
200
|
addInletPortsToOtherNodes(oNode) {
|
|
202
201
|
var oGraph = oNode.getParent();
|
|
203
|
-
var sNodePorts =
|
|
202
|
+
var sNodePorts = oNode._getNodePorts();
|
|
204
203
|
// Don't add inlet ports if nodePorts is "None"
|
|
205
204
|
if (sNodePorts === "None") {
|
|
206
205
|
return;
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
.sapSuiteUiCommonsNetworkLines .sapSuiteUiCommonsNetworkElementHighlight .sapSuiteUiCommonsNetworkLinePath,
|
|
15
15
|
.sapSuiteUiCommonsNetworkLines .sapSuiteUiCommonsNetworkElementHighlight .sapSuiteUiCommonsNetworkLineArrow,
|
|
16
16
|
.sapSuiteUiCommonsNetworkLines .sapSuiteUiCommonsNetworkElementHighlight .sapSuiteUiCommonsNetworkLineNipple,
|
|
17
|
-
.sapSuiteUiCommonsNetworkLines .sapSuiteUiCommonsNetworkElementHighlight .sapSuiteUiCommonsNetworkLineTextBoxBackground
|
|
17
|
+
.sapSuiteUiCommonsNetworkLines .sapSuiteUiCommonsNetworkElementHighlight .sapSuiteUiCommonsNetworkLineTextBoxBackground,
|
|
18
|
+
.sapSuiteUiCommonsNetworkLineTexts .sapSuiteUiCommonsNetworkElementHighlight .sapSuiteUiCommonsNetworkLineTextBoxBackground {
|
|
18
19
|
stroke-width: 2;
|
|
19
20
|
}
|
|
20
21
|
|
|
@@ -49,7 +50,9 @@
|
|
|
49
50
|
.sapSuiteUiCommonsNetworkElementWarning.sapSuiteUiCommonsNetworkElementHighlight .sapSuiteUiCommonsNetworkLinePath,
|
|
50
51
|
.sapSuiteUiCommonsNetworkElementWarning .sapSuiteUiCommonsNetworkLinePath,
|
|
51
52
|
.sapSuiteUiCommonsNetworkElementWarning.sapSuiteUiCommonsNetworkElementHighlight .sapSuiteUiCommonsNetworkLineTextBoxBackground,
|
|
52
|
-
.sapSuiteUiCommonsNetworkElementWarning .sapSuiteUiCommonsNetworkLineTextBoxBackground
|
|
53
|
+
.sapSuiteUiCommonsNetworkElementWarning .sapSuiteUiCommonsNetworkLineTextBoxBackground,
|
|
54
|
+
.sapSuiteUiCommonsNetworkLineTexts .sapSuiteUiCommonsNetworkElementWarning.sapSuiteUiCommonsNetworkElementHighlight .sapSuiteUiCommonsNetworkLineTextBoxBackground,
|
|
55
|
+
.sapSuiteUiCommonsNetworkLineTexts .sapSuiteUiCommonsNetworkElementWarning .sapSuiteUiCommonsNetworkLineTextBoxBackground {
|
|
53
56
|
stroke: @sapWarningBorderColor;
|
|
54
57
|
}
|
|
55
58
|
|
|
@@ -63,7 +66,9 @@
|
|
|
63
66
|
.sapSuiteUiCommonsNetworkElementError.sapSuiteUiCommonsNetworkElementHighlight .sapSuiteUiCommonsNetworkLinePath,
|
|
64
67
|
.sapSuiteUiCommonsNetworkElementError .sapSuiteUiCommonsNetworkLinePath,
|
|
65
68
|
.sapSuiteUiCommonsNetworkElementError.sapSuiteUiCommonsNetworkElementHighlight .sapSuiteUiCommonsNetworkLineTextBoxBackground,
|
|
66
|
-
.sapSuiteUiCommonsNetworkElementError .sapSuiteUiCommonsNetworkLineTextBoxBackground
|
|
69
|
+
.sapSuiteUiCommonsNetworkElementError .sapSuiteUiCommonsNetworkLineTextBoxBackground,
|
|
70
|
+
.sapSuiteUiCommonsNetworkLineTexts .sapSuiteUiCommonsNetworkElementError.sapSuiteUiCommonsNetworkElementHighlight .sapSuiteUiCommonsNetworkLineTextBoxBackground,
|
|
71
|
+
.sapSuiteUiCommonsNetworkLineTexts .sapSuiteUiCommonsNetworkElementError .sapSuiteUiCommonsNetworkLineTextBoxBackground {
|
|
67
72
|
stroke: @sapErrorBorderColor;
|
|
68
73
|
}
|
|
69
74
|
|
|
@@ -77,7 +82,9 @@
|
|
|
77
82
|
.sapSuiteUiCommonsNetworkElementSuccess.sapSuiteUiCommonsNetworkElementHighlight .sapSuiteUiCommonsNetworkLinePath,
|
|
78
83
|
.sapSuiteUiCommonsNetworkElementSuccess .sapSuiteUiCommonsNetworkLinePath,
|
|
79
84
|
.sapSuiteUiCommonsNetworkElementSuccess.sapSuiteUiCommonsNetworkElementHighlight .sapSuiteUiCommonsNetworkLineTextBoxBackground,
|
|
80
|
-
.sapSuiteUiCommonsNetworkElementSuccess .sapSuiteUiCommonsNetworkLineTextBoxBackground
|
|
85
|
+
.sapSuiteUiCommonsNetworkElementSuccess .sapSuiteUiCommonsNetworkLineTextBoxBackground,
|
|
86
|
+
.sapSuiteUiCommonsNetworkLineTexts .sapSuiteUiCommonsNetworkElementSuccess.sapSuiteUiCommonsNetworkElementHighlight .sapSuiteUiCommonsNetworkLineTextBoxBackground,
|
|
87
|
+
.sapSuiteUiCommonsNetworkLineTexts .sapSuiteUiCommonsNetworkElementSuccess .sapSuiteUiCommonsNetworkLineTextBoxBackground {
|
|
81
88
|
stroke: @sapSuccessBorderColor;
|
|
82
89
|
}
|
|
83
90
|
|
|
@@ -92,7 +99,9 @@
|
|
|
92
99
|
.sapSuiteUiCommonsNetworkElementInformation.sapSuiteUiCommonsNetworkElementHighlight .sapSuiteUiCommonsNetworkLinePath,
|
|
93
100
|
.sapSuiteUiCommonsNetworkElementInformation .sapSuiteUiCommonsNetworkLinePath,
|
|
94
101
|
.sapSuiteUiCommonsNetworkElementInformation.sapSuiteUiCommonsNetworkElementHighlight .sapSuiteUiCommonsNetworkLineTextBoxBackground,
|
|
95
|
-
.sapSuiteUiCommonsNetworkElementInformation .sapSuiteUiCommonsNetworkLineTextBoxBackground
|
|
102
|
+
.sapSuiteUiCommonsNetworkElementInformation .sapSuiteUiCommonsNetworkLineTextBoxBackground,
|
|
103
|
+
.sapSuiteUiCommonsNetworkLineTexts .sapSuiteUiCommonsNetworkElementInformation.sapSuiteUiCommonsNetworkElementHighlight .sapSuiteUiCommonsNetworkLineTextBoxBackground,
|
|
104
|
+
.sapSuiteUiCommonsNetworkLineTexts .sapSuiteUiCommonsNetworkElementInformation .sapSuiteUiCommonsNetworkLineTextBoxBackground {
|
|
96
105
|
stroke: @sapInformationBorderColor;
|
|
97
106
|
}
|
|
98
107
|
|
|
@@ -266,3 +275,15 @@
|
|
|
266
275
|
pointer-events: all;
|
|
267
276
|
}
|
|
268
277
|
|
|
278
|
+
.sapSuiteUiCommonsNetworkLineTexts .sapSuiteUiCommonsNetworkElementFocus .sapSuiteUiCommonsNetworkLineTextBoxBackground {
|
|
279
|
+
stroke: @sapContent_FocusColor !important;
|
|
280
|
+
stroke-width: 2;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.sapSuiteUiCommonsNetworkLineTexts .sapSuiteUiCommonsNetworkElementFocus .sapSuiteUiCommonsNetworkLineText {
|
|
284
|
+
font-weight: bold;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.sapSuiteUiCommonsNetworkLineTexts .sapSuiteUiCommonsNetworkElementHighlight .sapSuiteUiCommonsNetworkLineText {
|
|
288
|
+
font-weight: bold;
|
|
289
|
+
}
|