@sapui5/sap.suite.ui.commons 1.141.0 → 1.142.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 +1 -1
- package/src/sap/suite/ui/commons/CalculationBuilderExpression.js +11 -7
- 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 +12 -6
- 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 +21 -21
- package/src/sap/suite/ui/commons/MicroProcessFlow.js +2 -2
- package/src/sap/suite/ui/commons/MicroProcessFlowItem.js +7 -9
- package/src/sap/suite/ui/commons/Timeline.js +22 -24
- package/src/sap/suite/ui/commons/TimelineItemRenderer.js +12 -2
- package/src/sap/suite/ui/commons/collaboration/TeamsHelperService.js +152 -3
- package/src/sap/suite/ui/commons/collaboration/UniversalCollaborationBar.js +366 -0
- package/src/sap/suite/ui/commons/collaboration/flpplugins/msplugin/Component-preload.js +4 -1
- 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 +1 -1
- package/src/sap/suite/ui/commons/messagebundle.properties +16 -1
- package/src/sap/suite/ui/commons/messagebundle_en.properties +3 -0
- package/src/sap/suite/ui/commons/networkgraph/Graph.js +105 -5
- package/src/sap/suite/ui/commons/networkgraph/Node.js +33 -11
- package/src/sap/suite/ui/commons/networkgraph/util/DragDropManager.js +197 -0
- 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/CollaborationPopover.less +29 -1
- package/src/sap/suite/ui/commons/themes/base/NetworkGraph.less +5 -0
|
@@ -493,6 +493,8 @@ NETWORK_GRAPH_WRONGDATA=Network graph data is not consistent. Check the console
|
|
|
493
493
|
NETWORK_GRAPH_COLLAPSED=Collapsed
|
|
494
494
|
#XACT: Title for expanded icon.
|
|
495
495
|
NETWORK_GRAPH_EXPANDED=Expanded
|
|
496
|
+
#XACT: Title for collapsed icon.
|
|
497
|
+
NETWORK_GRAPH_PARTIAL=Partially Expanded
|
|
496
498
|
#XACT: No Data title
|
|
497
499
|
NETWORK_GRAPH_NO_DATA=No data found.
|
|
498
500
|
#XACT: Title for group details
|
|
@@ -543,7 +545,8 @@ MICRO_PROCESS_FLOW_ERROR=Error
|
|
|
543
545
|
MICRO_PROCESS_FLOW_INFORMATION=Information
|
|
544
546
|
#XACT: Text for ARIA text
|
|
545
547
|
MICRO_PROCESS_FLOW_ITEM=Item
|
|
546
|
-
|
|
548
|
+
#XBUT: Text for confirm button
|
|
549
|
+
MICRO_PROCESS_FLOW_ITEM_ACC_BUTTON=Button {0} of {1}. To move to an item press the Arrow keys.
|
|
547
550
|
|
|
548
551
|
#YINS: Placeholder text for search variable field
|
|
549
552
|
CALCULATION_BUILDER_SEARCH_VARIABLE=Search...
|
|
@@ -701,6 +704,10 @@ CALCULATION_BUILDER_LOGICAL_DISJUNCTION_TOOLTIP=Logical disjunction
|
|
|
701
704
|
CALCULATION_BUILDER_EXCLUSIVE_DISJUNCTION_TOOLTIP=Exclusive disjunction
|
|
702
705
|
#XCAP: Tooltip for negation operator
|
|
703
706
|
CALCULATION_BUILDER_NEGATION_TOOLTIP=Negation
|
|
707
|
+
#XCAP: CalculationBuilder Negative Action Tutor message
|
|
708
|
+
CALCULATION_BUILDER_NEGATIVE_ACTION=Negative Action.
|
|
709
|
+
#XCAP: CalculationBuilder Navigation Tutor message
|
|
710
|
+
CALCULATION_BUILDER_NAVIGATION=Use arrow keys to navigate
|
|
704
711
|
|
|
705
712
|
#XCAP: T Account title
|
|
706
713
|
TACCOUNT_TITLE=T Account
|
|
@@ -1005,10 +1012,18 @@ COLLABORATION_MSTEAMS_CHAT_SINGLE=Chat in Microsoft Teams
|
|
|
1005
1012
|
COLLABORATION_MSTEAMS_CARD_SINGLE=Card in Microsoft Teams
|
|
1006
1013
|
#XTXT: Text for Collaboration popover teams option
|
|
1007
1014
|
COLLABORATION_POPOVER_TEAMS = Microsoft Teams Chat
|
|
1015
|
+
#XTXT: Text for Universal collaboration bar Chat option
|
|
1016
|
+
COLLABORATION_POPOVER_CHAT=Chat
|
|
1017
|
+
#XTXT: Text for Universal collaboration bar Tab option
|
|
1018
|
+
COLLABORATION_POPOVER_TAB=Tab
|
|
1019
|
+
#XTXT: Text for Universal collaboration bar Collaboration Manager option
|
|
1020
|
+
COLLABORATION_POPOVER_MANAGER=Collaboration Manager
|
|
1008
1021
|
#XTXT: Text for Collaboration popover Mail option
|
|
1009
1022
|
COLLABORATION_POPOVER_MAIL = Email
|
|
1010
1023
|
#XTXT: Message strip text for copy link
|
|
1011
1024
|
COLLABORATION_POPOVER_MSGSTRIP = Click to copy the link for later use
|
|
1025
|
+
#XTXT: Message text for copy link successfully
|
|
1026
|
+
COLLABORATION_POPOVER_MSGSTRIP_SUCCESS = Link copied successfully
|
|
1012
1027
|
#XTXT: Text for Collaboration popover Copy URL Button
|
|
1013
1028
|
COLLABORATION_POPOVER_COPYURL_BUTTON = Copy Link
|
|
1014
1029
|
#XTXT: Text for Share to Collaboration Manager
|
|
@@ -520,9 +520,12 @@ COLLABORATION_MSTEAMS_TAB_SINGLE=Tab to Microsoft Teams
|
|
|
520
520
|
COLLABORATION_MSTEAMS_CHAT_SINGLE=Chat in Microsoft Teams
|
|
521
521
|
COLLABORATION_MSTEAMS_CARD_SINGLE=Card in Microsoft Teams
|
|
522
522
|
COLLABORATION_POPOVER_TEAMS=Microsoft Teams Chat
|
|
523
|
+
COLLABORATION_POPOVER_CHAT=Chat
|
|
524
|
+
COLLABORATION_POPOVER_TAB=Tab
|
|
523
525
|
COLLABORATION_POPOVER_MAIL=Email
|
|
524
526
|
COLLABORATION_POPOVER_MSGSTRIP=Click to copy the link for later use
|
|
525
527
|
COLLABORATION_POPOVER_COPYURL_BUTTON=Copy Link
|
|
528
|
+
COLLABORATION_POPOVER_MANAGER=Collaboration Manager
|
|
526
529
|
COLLABORATION_MANGER=Collaboration Manager
|
|
527
530
|
SAVE_CARD_ERROR=The card couldn't be shared. Please try again later.
|
|
528
531
|
|
|
@@ -42,7 +42,8 @@ sap.ui.define([
|
|
|
42
42
|
"sap/ui/core/RenderManager",
|
|
43
43
|
"sap/ui/core/Theming",
|
|
44
44
|
'sap/ui/core/InvisibleText',
|
|
45
|
-
"./GraphRenderer"
|
|
45
|
+
"./GraphRenderer",
|
|
46
|
+
"./util/DragDropManager"
|
|
46
47
|
], function (
|
|
47
48
|
library,
|
|
48
49
|
jQuery,
|
|
@@ -80,7 +81,8 @@ sap.ui.define([
|
|
|
80
81
|
RenderManager,
|
|
81
82
|
Theming,
|
|
82
83
|
InvisibleText,
|
|
83
|
-
GraphRenderer
|
|
84
|
+
GraphRenderer,
|
|
85
|
+
DragDropManager
|
|
84
86
|
) {
|
|
85
87
|
"use strict";
|
|
86
88
|
|
|
@@ -98,7 +100,8 @@ sap.ui.define([
|
|
|
98
100
|
var ZOOM_MILESTONES = [0.05, 0.1, 0.25, 0.33, 0.50, 0.67, 0.75, 0.80, 0.90, 1, 1.1, 1.25, 1.5, 1.75, 2, 2.5, 3, 4, 5],
|
|
99
101
|
DEFAULT_ZOOM_MILESTONE = 1,
|
|
100
102
|
ZOOM_OUT_RATING = 0.4,
|
|
101
|
-
SUGGESTION_ITEMS_LIMIT = 100
|
|
103
|
+
SUGGESTION_ITEMS_LIMIT = 100,
|
|
104
|
+
MOVING_THRESHOLD = 20;
|
|
102
105
|
|
|
103
106
|
var SUGGESTIONS = {
|
|
104
107
|
Group: "group",
|
|
@@ -136,6 +139,7 @@ sap.ui.define([
|
|
|
136
139
|
var Graph = SvgBase.extend("sap.suite.ui.commons.networkgraph.Graph", {
|
|
137
140
|
metadata: {
|
|
138
141
|
library: "sap.suite.ui.commons",
|
|
142
|
+
dnd: { draggable: false, droppable: true },
|
|
139
143
|
properties: {
|
|
140
144
|
/**
|
|
141
145
|
* The height of the graph. If this property is set to 'auto', the network graph will be resized to fit the height of its content, regardless of the height of the parent control.
|
|
@@ -210,10 +214,19 @@ sap.ui.define([
|
|
|
210
214
|
* Only works when enableWheelZoom is set to true or 'ctrl' key is pressed while wheel scrolling.
|
|
211
215
|
* Add delay in milliseconds.
|
|
212
216
|
*
|
|
213
|
-
* @private
|
|
217
|
+
* @private
|
|
214
218
|
*/
|
|
215
219
|
_smoothWheelZoom: {
|
|
216
220
|
type: "int", group: "Behavior", defaultValue: 125, visibility: "hidden"
|
|
221
|
+
},
|
|
222
|
+
/**
|
|
223
|
+
* Enables the drag and drop of nodes. This property is ignored if the layout property is not set to noop.
|
|
224
|
+
* If set to <code>true</code>, nodes can be dragged and dropped within the graph.
|
|
225
|
+
*
|
|
226
|
+
* @private
|
|
227
|
+
*/
|
|
228
|
+
enableDragAndDrop: {
|
|
229
|
+
type: "boolean", group: "Behavior", defaultValue: false, visibility: "hidden"
|
|
217
230
|
}
|
|
218
231
|
},
|
|
219
232
|
aggregations: {
|
|
@@ -327,7 +340,28 @@ sap.ui.define([
|
|
|
327
340
|
term: { type: "string" },
|
|
328
341
|
key: { type: "string" }
|
|
329
342
|
}
|
|
330
|
-
}
|
|
343
|
+
},
|
|
344
|
+
/**
|
|
345
|
+
* This event is fired when a user drops a node in the graph. This event is available only for the noop layout.
|
|
346
|
+
* @private
|
|
347
|
+
*/
|
|
348
|
+
nodeDropped: {
|
|
349
|
+
parameters: {
|
|
350
|
+
/**
|
|
351
|
+
* The node that was moved.
|
|
352
|
+
*/
|
|
353
|
+
node: { type: "sap.suite.ui.commons.networkgraph.Node" },
|
|
354
|
+
/**
|
|
355
|
+
* The new x coordinate of the node.
|
|
356
|
+
*/
|
|
357
|
+
newX: { type: "float" },
|
|
358
|
+
/**
|
|
359
|
+
* The new y coordinate of the node.
|
|
360
|
+
*/
|
|
361
|
+
newY: { type: "float" }
|
|
362
|
+
},
|
|
363
|
+
visibility: "hidden"
|
|
364
|
+
},
|
|
331
365
|
}
|
|
332
366
|
}
|
|
333
367
|
});
|
|
@@ -408,6 +442,17 @@ sap.ui.define([
|
|
|
408
442
|
|
|
409
443
|
this._createToolbar();
|
|
410
444
|
|
|
445
|
+
/**
|
|
446
|
+
* Attach drag and drop events
|
|
447
|
+
*/
|
|
448
|
+
if (this.getDragDropConfig().length === 0) {
|
|
449
|
+
try {
|
|
450
|
+
DragDropManager.injectDnD(this);
|
|
451
|
+
} catch (error) {
|
|
452
|
+
Log.error("Graph DnD: ", error);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
|
|
411
456
|
};
|
|
412
457
|
|
|
413
458
|
Graph.prototype.onBeforeRendering = function () {
|
|
@@ -553,6 +598,7 @@ sap.ui.define([
|
|
|
553
598
|
if (this._oFullScreenUtil) {
|
|
554
599
|
this._oFullScreenUtil.cleanUpFullScreen(this);
|
|
555
600
|
}
|
|
601
|
+
DragDropManager.removeDnD(this);
|
|
556
602
|
};
|
|
557
603
|
/* =========================================================== */
|
|
558
604
|
/* Pseudo events and event triggers */
|
|
@@ -864,6 +910,20 @@ sap.ui.define([
|
|
|
864
910
|
this.$().find("." + this.FOCUS_CLASS).removeClass(this.FOCUS_CLASS);
|
|
865
911
|
};
|
|
866
912
|
|
|
913
|
+
/**
|
|
914
|
+
* @private
|
|
915
|
+
*/
|
|
916
|
+
Graph.prototype.setEnableDragAndDrop = function (bEnabled) {
|
|
917
|
+
this.setProperty("enableDragAndDrop", bEnabled, true);
|
|
918
|
+
};
|
|
919
|
+
|
|
920
|
+
/**
|
|
921
|
+
* @private
|
|
922
|
+
*/
|
|
923
|
+
Graph.prototype.getEnableDragAndDrop = function () {
|
|
924
|
+
return this.getProperty("enableDragAndDrop");
|
|
925
|
+
};
|
|
926
|
+
|
|
867
927
|
/**
|
|
868
928
|
* Sets focus of the graph. Since one element at max can be focused at one time, handling of this belongs to the graph itself.
|
|
869
929
|
* @param {object} oFocus Element (and optionally button) to focus
|
|
@@ -1029,6 +1089,14 @@ sap.ui.define([
|
|
|
1029
1089
|
return this.getNodes().concat(this.getGroups());
|
|
1030
1090
|
};
|
|
1031
1091
|
|
|
1092
|
+
Graph.prototype._isNoopLayout = function () {
|
|
1093
|
+
return this._getLayoutAlgorithm().isA("sap.suite.ui.commons.networkgraph.layout.NoopLayout");
|
|
1094
|
+
};
|
|
1095
|
+
|
|
1096
|
+
Graph.prototype._isDnDEnabled = function() {
|
|
1097
|
+
return this._isNoopLayout() && this.getEnableDragAndDrop();
|
|
1098
|
+
};
|
|
1099
|
+
|
|
1032
1100
|
Graph.prototype._render = function () {
|
|
1033
1101
|
this._beforeRender();
|
|
1034
1102
|
|
|
@@ -1092,6 +1160,10 @@ sap.ui.define([
|
|
|
1092
1160
|
|
|
1093
1161
|
if (!this._isSwimLane() && !this._isTwoColumnsLayout()) {
|
|
1094
1162
|
this.$("innerscroller").addClass(" sapSuiteUiCommonsNetworkGraphInnerScrollerCenter ");
|
|
1163
|
+
if (this._isDnDEnabled()) {
|
|
1164
|
+
// If NoopLayout is used, users must set certain styles to ensure precise coordinates setting.
|
|
1165
|
+
this.$("innerscroller").addClass("sapSuiteUiCommonsNetworkGraphInnerScrollerNoMargin");
|
|
1166
|
+
}
|
|
1095
1167
|
}
|
|
1096
1168
|
};
|
|
1097
1169
|
|
|
@@ -2161,6 +2233,34 @@ sap.ui.define([
|
|
|
2161
2233
|
$wrapper.on("touchmove", function (oEvent) {
|
|
2162
2234
|
fnTouchMove(oEvent);
|
|
2163
2235
|
});
|
|
2236
|
+
|
|
2237
|
+
this.getDomRef("wrapper").addEventListener("keydown",(oEvent) => {
|
|
2238
|
+
var oScroller = this.$scroller[0];
|
|
2239
|
+
setTimeout(() => {
|
|
2240
|
+
// Check whether the focus is not on childElements
|
|
2241
|
+
if (!document.querySelector(".sapSuiteUiCommonsNetworkElementFocus")) {
|
|
2242
|
+
var iX = 0;
|
|
2243
|
+
var iY = 0;
|
|
2244
|
+
|
|
2245
|
+
// Handle horizontal movement
|
|
2246
|
+
if (oEvent.key === "ArrowLeft") {
|
|
2247
|
+
iX = -MOVING_THRESHOLD;
|
|
2248
|
+
} else if (oEvent.key === "ArrowRight") {
|
|
2249
|
+
iX = MOVING_THRESHOLD;
|
|
2250
|
+
}
|
|
2251
|
+
|
|
2252
|
+
// Handle vertical movement
|
|
2253
|
+
if (oEvent.key === "ArrowUp") {
|
|
2254
|
+
iY = -MOVING_THRESHOLD;
|
|
2255
|
+
} else if (oEvent.key === "ArrowDown") {
|
|
2256
|
+
iY = MOVING_THRESHOLD;
|
|
2257
|
+
}
|
|
2258
|
+
|
|
2259
|
+
oScroller.scrollTop = oScroller.scrollTop + iY;
|
|
2260
|
+
oScroller.scrollLeft = oScroller.scrollLeft + iX;
|
|
2261
|
+
}
|
|
2262
|
+
}, 0);
|
|
2263
|
+
});
|
|
2164
2264
|
this._bEventsAdded = true;
|
|
2165
2265
|
}
|
|
2166
2266
|
|
|
@@ -20,8 +20,10 @@ sap.ui.define([
|
|
|
20
20
|
"sap/ui/core/Core",
|
|
21
21
|
"sap/ui/core/Theming",
|
|
22
22
|
"sap/ui/core/Lib",
|
|
23
|
-
"./Utils"
|
|
24
|
-
|
|
23
|
+
"./Utils",
|
|
24
|
+
"sap/base/Log",
|
|
25
|
+
"./util/DragDropManager"
|
|
26
|
+
], function(jQuery, library, ElementBase, ElementAttribute, IconPool, Device, encodeXML, sanitizeHTML, CheckBox, Text, NodeRenderer, Core, Theming, CoreLib, Utils, Log, DragDropManager) {
|
|
25
27
|
"use strict";
|
|
26
28
|
|
|
27
29
|
var Shape = library.networkgraph.NodeShape,
|
|
@@ -116,6 +118,7 @@ sap.ui.define([
|
|
|
116
118
|
var Node = ElementBase.extend("sap.suite.ui.commons.networkgraph.Node", {
|
|
117
119
|
metadata: {
|
|
118
120
|
library: "sap.suite.ui.commons",
|
|
121
|
+
dnd : { draggable: true, droppable: false },
|
|
119
122
|
properties: {
|
|
120
123
|
/**
|
|
121
124
|
* Defines if the Header checkbox should be displayed and whether it should be selected or not. By default, the checkbox is hidden. Available only for box nodes.
|
|
@@ -338,6 +341,13 @@ sap.ui.define([
|
|
|
338
341
|
}
|
|
339
342
|
},
|
|
340
343
|
onAfterRendering: function() {
|
|
344
|
+
if (this.getDragDropConfig().length === 0) {
|
|
345
|
+
try {
|
|
346
|
+
DragDropManager.injectDnD(this);
|
|
347
|
+
} catch (error) {
|
|
348
|
+
Log.error("Node DnD: ", error);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
341
351
|
this._afterRenderingBase();
|
|
342
352
|
}
|
|
343
353
|
});
|
|
@@ -453,6 +463,10 @@ sap.ui.define([
|
|
|
453
463
|
}
|
|
454
464
|
};
|
|
455
465
|
|
|
466
|
+
Node.prototype.exit = function () {
|
|
467
|
+
DragDropManager.removeDnD(this);
|
|
468
|
+
};
|
|
469
|
+
|
|
456
470
|
Node.prototype._isInteractiveNode = function() {
|
|
457
471
|
var bIsShowExpandButton = this.getShowExpandButton() && this._hasVisibleChildren(),
|
|
458
472
|
bIsShowDetailButton = this.getShowDetailButton() && (this._hasDetailData() || this.getTitle()),
|
|
@@ -615,9 +629,7 @@ sap.ui.define([
|
|
|
615
629
|
"class": "sapSuiteUiCommonsNetworkNodeActionCollapseIcon",
|
|
616
630
|
icon: this._getExpandIcon(true),
|
|
617
631
|
enable: this._hasVisibleChildren(),
|
|
618
|
-
title: this.
|
|
619
|
-
oResourceBundle.getText("NETWORK_GRAPH_EXPANDED") :
|
|
620
|
-
oResourceBundle.getText("NETWORK_GRAPH_COLLAPSED"),
|
|
632
|
+
title: this._getExpandStateTitle(),
|
|
621
633
|
id: this._getDomId("actionCollapse"),
|
|
622
634
|
click: this._expandClick.bind(this)
|
|
623
635
|
}, $right);
|
|
@@ -723,6 +735,7 @@ sap.ui.define([
|
|
|
723
735
|
id: sId,
|
|
724
736
|
"data-sap-ui": sId,
|
|
725
737
|
"class": sNodeClass,
|
|
738
|
+
"draggable": !!(this.getParent()._isDnDEnabled())
|
|
726
739
|
};
|
|
727
740
|
|
|
728
741
|
if (sNodeClass.includes("sapSuiteUiCommonsNetworkBox") && this.getTooltip_AsString()) {
|
|
@@ -2041,6 +2054,19 @@ sap.ui.define([
|
|
|
2041
2054
|
}
|
|
2042
2055
|
};
|
|
2043
2056
|
|
|
2057
|
+
Node.prototype._getExpandStateTitle = function () {
|
|
2058
|
+
switch (this._oExpandState) {
|
|
2059
|
+
case ExpandState.PARTIAL:
|
|
2060
|
+
return oResourceBundle.getText("NETWORK_GRAPH_PARTIAL");
|
|
2061
|
+
case ExpandState.EXPANDED:
|
|
2062
|
+
return oResourceBundle.getText("NETWORK_GRAPH_EXPANDED");
|
|
2063
|
+
case ExpandState.COLLAPSED:
|
|
2064
|
+
return oResourceBundle.getText("NETWORK_GRAPH_COLLAPSED");
|
|
2065
|
+
default:
|
|
2066
|
+
return oResourceBundle.getText("NETWORK_GRAPH_EXPANDED");
|
|
2067
|
+
}
|
|
2068
|
+
};
|
|
2069
|
+
|
|
2044
2070
|
Node.prototype._createLineText = function(sText, iWidth, oText, iMaxLines) {
|
|
2045
2071
|
var aLines = [[]],
|
|
2046
2072
|
iLine = 0, sRest,
|
|
@@ -3158,9 +3184,7 @@ sap.ui.define([
|
|
|
3158
3184
|
icon: this._getExpandIcon(true),
|
|
3159
3185
|
"class": "sapSuiteUiCommonsNetworkNodeActionCollapseIcon",
|
|
3160
3186
|
enable: this._hasVisibleChildren(),
|
|
3161
|
-
title: this.
|
|
3162
|
-
oResourceBundle.getText("NETWORK_GRAPH_EXPANDED") :
|
|
3163
|
-
oResourceBundle.getText("NETWORK_GRAPH_COLLAPSED"),
|
|
3187
|
+
title: this._getExpandStateTitle(),
|
|
3164
3188
|
id: this._getDomId("actionCollapse"),
|
|
3165
3189
|
click: this._expandClick.bind(this)
|
|
3166
3190
|
});
|
|
@@ -3413,9 +3437,7 @@ sap.ui.define([
|
|
|
3413
3437
|
if ($icon[0]) {
|
|
3414
3438
|
$icon[0].textContent = this._getExpandIcon();
|
|
3415
3439
|
if ($iconParent && $iconParent.title) {
|
|
3416
|
-
$iconParent.title = this.
|
|
3417
|
-
oResourceBundle.getText("NETWORK_GRAPH_EXPANDED") :
|
|
3418
|
-
oResourceBundle.getText("NETWORK_GRAPH_COLLAPSED")
|
|
3440
|
+
$iconParent.title = this._getExpandStateTitle();
|
|
3419
3441
|
}
|
|
3420
3442
|
}
|
|
3421
3443
|
|
|
@@ -0,0 +1,197 @@
|
|
|
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/ui/core/dnd/DragInfo",
|
|
9
|
+
"sap/ui/core/dnd/DropInfo",
|
|
10
|
+
"sap/base/Log"
|
|
11
|
+
], function (DragInfo, DropInfo, Log) {
|
|
12
|
+
"use strict";
|
|
13
|
+
|
|
14
|
+
// Instance object: Only one will exist
|
|
15
|
+
var instance = null;
|
|
16
|
+
var sDragSessionKey = "networkGraphDragSession";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Constructor for DragDropManager.
|
|
20
|
+
* This class is for internal use only
|
|
21
|
+
*
|
|
22
|
+
* @class
|
|
23
|
+
* Manages drag and drop functionality for network graph components.
|
|
24
|
+
* This class handles drag start, drag end, drag over, and drop events
|
|
25
|
+
* for both Graph and Node controls in the network graph library.
|
|
26
|
+
*
|
|
27
|
+
* @private
|
|
28
|
+
*/
|
|
29
|
+
function DragDropManager() { }
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Validates if the given control is supported for drag and drop operations.
|
|
33
|
+
*
|
|
34
|
+
* @param oControl - The control to validate
|
|
35
|
+
* @returns {boolean} True if the control is eligible for drag and drop, otherwise false
|
|
36
|
+
* @private
|
|
37
|
+
*/
|
|
38
|
+
DragDropManager.prototype.isValidControl = function (oControl) {
|
|
39
|
+
if (!oControl || typeof oControl !== 'object') {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Check if it's an empty object
|
|
44
|
+
if (Object.keys(oControl).length === 0 && oControl.constructor === Object) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Check if it has the required isA method
|
|
49
|
+
if (typeof oControl.isA !== 'function') {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return oControl.isA("sap.suite.ui.commons.networkgraph.Graph") ||
|
|
54
|
+
oControl.isA("sap.suite.ui.commons.networkgraph.Node");
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Handles the drag start event for nodes.
|
|
59
|
+
*
|
|
60
|
+
* @param {sap.ui.base.Event} oEvent - The drag start event handler
|
|
61
|
+
* @private
|
|
62
|
+
*/
|
|
63
|
+
DragDropManager.prototype._handleDragStart = function (oEvent) {
|
|
64
|
+
let dragSession = oEvent.getParameter("dragSession");
|
|
65
|
+
let browserEvent = oEvent.getParameter("browserEvent");
|
|
66
|
+
dragSession.setComplexData(sDragSessionKey, {
|
|
67
|
+
cursorX: browserEvent.clientX,
|
|
68
|
+
cursorY: browserEvent.clientY
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Handles the drag end event for nodes.
|
|
74
|
+
*
|
|
75
|
+
* @param {sap.ui.base.Event} oEvent - The drag End event handler
|
|
76
|
+
* @private
|
|
77
|
+
*/
|
|
78
|
+
DragDropManager.prototype._handleDragEnd = function (oEvent) {
|
|
79
|
+
|
|
80
|
+
let oBrowserEvent = oEvent.getParameter("browserEvent");
|
|
81
|
+
|
|
82
|
+
if (!oBrowserEvent) {
|
|
83
|
+
Log.warn("No native browser event available in drag end event.");
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Handles the drag over event for nodes.
|
|
90
|
+
*
|
|
91
|
+
* @param {sap.ui.base.Event} oEvent - The drag over event handler
|
|
92
|
+
* @private
|
|
93
|
+
*/
|
|
94
|
+
DragDropManager.prototype._handleDragOver = function (oEvent) {
|
|
95
|
+
// Optional: Implement visual feedback of drag ghost for Lasso selection
|
|
96
|
+
let oBrowserEvent = oEvent.getParameter("browserEvent");
|
|
97
|
+
|
|
98
|
+
if (!oBrowserEvent) {
|
|
99
|
+
Log.warn("No native browser event available in drag over event.");
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Handles the drop event.
|
|
106
|
+
*
|
|
107
|
+
* @param {sap.ui.base.Event} oEvent - The drop event
|
|
108
|
+
* @param {sap.suite.ui.commons.networkgraph.Graph} oGraph - The graph control
|
|
109
|
+
* @private
|
|
110
|
+
*/
|
|
111
|
+
DragDropManager.prototype._handleDrop = function (oEvent, oGraph) {
|
|
112
|
+
let oBrowserEvent = oEvent.getParameter("browserEvent") || {};
|
|
113
|
+
let { clientX = 0, clientY = 0 } = oBrowserEvent,
|
|
114
|
+
oDraggedControl = oEvent.getParameter("draggedControl");
|
|
115
|
+
if (!oBrowserEvent) {
|
|
116
|
+
Log.warn("No native browser event available in drop event.");
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (oEvent.getParameter("draggedControl")?.isA("sap.suite.ui.commons.networkgraph.Node")) {
|
|
121
|
+
let dragSessionComplexData = oEvent.getParameter("dragSession").getComplexData(sDragSessionKey),
|
|
122
|
+
deltaX = clientX - (dragSessionComplexData?.cursorX || 0),
|
|
123
|
+
deltaY = clientY - (dragSessionComplexData?.cursorY || 0);
|
|
124
|
+
|
|
125
|
+
oGraph.fireEvent("nodeDropped", {
|
|
126
|
+
node: oDraggedControl,
|
|
127
|
+
newX: oDraggedControl.getX() + deltaX,
|
|
128
|
+
newY: oDraggedControl.getY() + deltaY
|
|
129
|
+
});
|
|
130
|
+
} else {
|
|
131
|
+
let boundingRect = oGraph?._$innerscroller[0]?.getBoundingClientRect() || { left: 0, top: 0 },
|
|
132
|
+
x = clientX - boundingRect.left,
|
|
133
|
+
y = clientY - boundingRect.top;
|
|
134
|
+
|
|
135
|
+
oGraph.fireEvent("nodeDropped", {
|
|
136
|
+
...oEvent.getParameters(),
|
|
137
|
+
node: oDraggedControl,
|
|
138
|
+
newX: x,
|
|
139
|
+
newY: y
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
// Add drag and drop config if needed
|
|
145
|
+
DragDropManager.prototype.injectDnD = function (oControl) {
|
|
146
|
+
if (!this.isValidControl(oControl)) {
|
|
147
|
+
throw new Error("DragDropManager: Control is not valid for DnD");
|
|
148
|
+
}
|
|
149
|
+
var sControlType = oControl.getMetadata().getName();
|
|
150
|
+
switch (sControlType) {
|
|
151
|
+
case "sap.suite.ui.commons.networkgraph.Graph":
|
|
152
|
+
var dragInfo = new DragInfo({
|
|
153
|
+
sourceAggregation: "nodes",
|
|
154
|
+
dragEnd: this._handleDragEnd.bind(this)
|
|
155
|
+
});
|
|
156
|
+
var dropInfo = new DropInfo({
|
|
157
|
+
dropPosition: "Between",
|
|
158
|
+
drop: function (oEvent) {
|
|
159
|
+
this._handleDrop(oEvent, oControl);
|
|
160
|
+
}.bind(this),
|
|
161
|
+
dragOver: this._handleDragOver.bind(this)
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
oControl.addDragDropConfig(dragInfo);
|
|
165
|
+
oControl.addDragDropConfig(dropInfo);
|
|
166
|
+
break;
|
|
167
|
+
case "sap.suite.ui.commons.networkgraph.Node":
|
|
168
|
+
var dragInfo = new DragInfo({
|
|
169
|
+
dragStart: this._handleDragStart.bind(this),
|
|
170
|
+
});
|
|
171
|
+
oControl.addDragDropConfig(dragInfo);
|
|
172
|
+
break;
|
|
173
|
+
default:
|
|
174
|
+
throw new Error("DragDropManager: Control type " + sControlType + " is not supported");
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
// Remove DnD config
|
|
179
|
+
DragDropManager.prototype.removeDnD = function (oControl) {
|
|
180
|
+
if (!this.isValidControl(oControl)) {
|
|
181
|
+
throw new Error("DragDropManager: Control is not valid for DnD");
|
|
182
|
+
}
|
|
183
|
+
// Check if control has any drag drop configurations
|
|
184
|
+
if (!oControl.getDragDropConfig || oControl.getDragDropConfig().length === 0) {
|
|
185
|
+
return true; // Not an error, just nothing to remove
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
oControl?.destroyDragDropConfig();
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
// Exported singleton object - instantiate on first access
|
|
192
|
+
if (!instance) {
|
|
193
|
+
instance = new DragDropManager();
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return instance;
|
|
197
|
+
}, /* bExport= */true);
|