@sapui5/sap.ui.vk 1.140.0 → 1.141.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/ui/vk/.library +1 -1
- package/src/sap/ui/vk/AnimationPlayback.js +1 -1
- package/src/sap/ui/vk/AnimationPlayer.js +1 -1
- package/src/sap/ui/vk/AnimationSequence.js +1 -1
- package/src/sap/ui/vk/AnimationTimeSlider.js +1 -1
- package/src/sap/ui/vk/AnimationTrack.js +1 -1
- package/src/sap/ui/vk/Annotation.js +1 -1
- package/src/sap/ui/vk/BaseNodeProxy.js +1 -1
- package/src/sap/ui/vk/Camera.js +1 -1
- package/src/sap/ui/vk/ContentConnector.js +1 -1
- package/src/sap/ui/vk/ContentManager.js +1 -1
- package/src/sap/ui/vk/ContentResource.js +1 -1
- package/src/sap/ui/vk/Core.js +1 -1
- package/src/sap/ui/vk/DownloadManager.js +1 -1
- package/src/sap/ui/vk/DrawerToolbar.js +1 -1
- package/src/sap/ui/vk/DvlException.js +1 -1
- package/src/sap/ui/vk/FlexibleControl.js +1 -1
- package/src/sap/ui/vk/FlexibleControlLayoutData.js +1 -1
- package/src/sap/ui/vk/Highlight.js +1 -1
- package/src/sap/ui/vk/ImageContentManager.js +1 -1
- package/src/sap/ui/vk/JointUtils.js +1 -1
- package/src/sap/ui/vk/LayerProxy.js +1 -1
- package/src/sap/ui/vk/Loco.js +1 -1
- package/src/sap/ui/vk/Material.js +1 -1
- package/src/sap/ui/vk/NativeViewport.js +1 -1
- package/src/sap/ui/vk/NodeContentType.js +6 -1
- package/src/sap/ui/vk/NodeHierarchy.js +1 -1
- package/src/sap/ui/vk/NodeProxy.js +1 -1
- package/src/sap/ui/vk/NodeUtils.js +1 -1
- package/src/sap/ui/vk/Notifications.js +1 -1
- package/src/sap/ui/vk/ObjectType.js +2 -1
- package/src/sap/ui/vk/OrthographicCamera.js +1 -1
- package/src/sap/ui/vk/PerspectiveCamera.js +1 -1
- package/src/sap/ui/vk/ProgressIndicator.js +1 -1
- package/src/sap/ui/vk/RedlineCollaboration.js +1 -1
- package/src/sap/ui/vk/RedlineConversation.js +1 -1
- package/src/sap/ui/vk/RedlineDesign.js +1 -1
- package/src/sap/ui/vk/RedlineElement.js +1 -1
- package/src/sap/ui/vk/RedlineElementComment.js +1 -1
- package/src/sap/ui/vk/RedlineElementEllipse.js +1 -1
- package/src/sap/ui/vk/RedlineElementFreehand.js +1 -1
- package/src/sap/ui/vk/RedlineElementLine.js +1 -1
- package/src/sap/ui/vk/RedlineElementRectangle.js +1 -1
- package/src/sap/ui/vk/RedlineElementText.js +1 -1
- package/src/sap/ui/vk/RedlineSurface.js +1 -1
- package/src/sap/ui/vk/SafeArea.js +1 -1
- package/src/sap/ui/vk/Scene.js +1 -1
- package/src/sap/ui/vk/SceneTree.js +1 -1
- package/src/sap/ui/vk/StepNavigation.js +1 -1
- package/src/sap/ui/vk/Texture.js +1 -1
- package/src/sap/ui/vk/ToggleMenuButton.js +1 -1
- package/src/sap/ui/vk/ToggleMenuItem.js +1 -1
- package/src/sap/ui/vk/Toolbar.js +1 -1
- package/src/sap/ui/vk/View.js +1 -1
- package/src/sap/ui/vk/ViewGallery.js +1 -1
- package/src/sap/ui/vk/ViewGalleryThumbnail.js +1 -1
- package/src/sap/ui/vk/ViewGroup.js +1 -1
- package/src/sap/ui/vk/ViewManager.js +1 -1
- package/src/sap/ui/vk/ViewStateManager.js +1 -1
- package/src/sap/ui/vk/ViewStateManagerBase.js +1 -1
- package/src/sap/ui/vk/Viewer.js +1 -1
- package/src/sap/ui/vk/Viewport.js +43 -1
- package/src/sap/ui/vk/ViewportBase.js +24 -1
- package/src/sap/ui/vk/dvl/BaseNodeProxy.js +1 -1
- package/src/sap/ui/vk/dvl/ContentManager.js +1 -1
- package/src/sap/ui/vk/dvl/GraphicsCore.js +1 -1
- package/src/sap/ui/vk/dvl/LayerProxy.js +1 -1
- package/src/sap/ui/vk/dvl/NodeHierarchy.js +1 -1
- package/src/sap/ui/vk/dvl/NodeProxy.js +1 -1
- package/src/sap/ui/vk/dvl/Scene.js +1 -1
- package/src/sap/ui/vk/dvl/ViewStateManager.js +1 -1
- package/src/sap/ui/vk/dvl/Viewport.js +2 -2
- package/src/sap/ui/vk/ecad/ElementsPanel.js +352 -141
- package/src/sap/ui/vk/ecad/LayersPanel.js +1 -1
- package/src/sap/ui/vk/i18n/messagebundle_ar.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_bg.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_ca.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_cnr.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_cs.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_cy.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_da.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_de.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_el.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_en.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_en_GB.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_es.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_es_MX.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_et.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_fi.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_fr.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_fr_CA.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_hi.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_hr.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_hu.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_id.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_it.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_iw.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_ja.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_kk.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_ko.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_lt.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_lv.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_mk.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_ms.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_nl.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_no.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_pl.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_pt.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_pt_PT.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_ro.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_ru.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_sh.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_sk.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_sl.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_sr.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_sv.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_th.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_tr.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_uk.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_vi.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_zh_CN.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_zh_TW.properties +0 -2
- package/src/sap/ui/vk/library.js +2 -2
- package/src/sap/ui/vk/measurements/Angle.js +1 -1
- package/src/sap/ui/vk/measurements/Area.js +1 -1
- package/src/sap/ui/vk/measurements/Distance.js +1 -1
- package/src/sap/ui/vk/measurements/Edge.js +1 -1
- package/src/sap/ui/vk/measurements/Face.js +1 -1
- package/src/sap/ui/vk/measurements/Feature.js +1 -1
- package/src/sap/ui/vk/measurements/Vertex.js +1 -1
- package/src/sap/ui/vk/pdf/ContentManager.js +85 -13
- package/src/sap/ui/vk/pdf/Viewport.js +1 -1
- package/src/sap/ui/vk/svg/BaseNodeProxy.js +1 -1
- package/src/sap/ui/vk/svg/ContentDeliveryService.js +1 -1
- package/src/sap/ui/vk/svg/ContentManager.js +2 -1
- package/src/sap/ui/vk/svg/Element.js +162 -23
- package/src/sap/ui/vk/svg/Ellipse.js +4 -0
- package/src/sap/ui/vk/svg/HotspotHelper.js +30 -17
- package/src/sap/ui/vk/svg/MiniMap.js +63 -1
- package/src/sap/ui/vk/svg/NodeHierarchy.js +17 -1
- package/src/sap/ui/vk/svg/NodeProxy.js +1 -1
- package/src/sap/ui/vk/svg/OrthographicCamera.js +1 -1
- package/src/sap/ui/vk/svg/Scene.js +1 -1
- package/src/sap/ui/vk/svg/SceneBuilder.js +57 -5
- package/src/sap/ui/vk/svg/Text.js +72 -30
- package/src/sap/ui/vk/svg/ViewStateManager.js +2 -2
- package/src/sap/ui/vk/svg/Viewport.js +178 -32
- package/src/sap/ui/vk/svg/ViewportRenderer.js +82 -0
- package/src/sap/ui/vk/thirdparty/pdf.js +18003 -13388
- package/src/sap/ui/vk/thirdparty/pdf.worker.js +38149 -36166
- package/src/sap/ui/vk/threejs/AnimationHelper.js +1 -1
- package/src/sap/ui/vk/threejs/BaseNodeProxy.js +1 -1
- package/src/sap/ui/vk/threejs/Billboard.js +1 -1
- package/src/sap/ui/vk/threejs/Callout.js +1 -1
- package/src/sap/ui/vk/threejs/ContentDeliveryService.js +1 -1
- package/src/sap/ui/vk/threejs/ContentManager.js +1 -1
- package/src/sap/ui/vk/threejs/DetailView.js +1 -1
- package/src/sap/ui/vk/threejs/HighlightPlayer.js +1 -1
- package/src/sap/ui/vk/threejs/Material.js +1 -1
- package/src/sap/ui/vk/threejs/NodeHierarchy.js +1 -1
- package/src/sap/ui/vk/threejs/NodeProxy.js +1 -1
- package/src/sap/ui/vk/threejs/OrthographicCamera.js +1 -1
- package/src/sap/ui/vk/threejs/PerspectiveCamera.js +1 -1
- package/src/sap/ui/vk/threejs/PointCloudGroup.js +1 -1
- package/src/sap/ui/vk/threejs/Scene.js +1 -1
- package/src/sap/ui/vk/threejs/SceneBuilder.js +12 -1
- package/src/sap/ui/vk/threejs/Texture.js +1 -1
- package/src/sap/ui/vk/threejs/Thrustline.js +1 -1
- package/src/sap/ui/vk/threejs/ViewStateManager.js +3 -3
- package/src/sap/ui/vk/threejs/Viewport.js +1 -1
- package/src/sap/ui/vk/tools/AnchorPointTool.js +1 -1
- package/src/sap/ui/vk/tools/AnchorPointToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/AxisAngleRotationTool.js +1 -1
- package/src/sap/ui/vk/tools/AxisAngleRotationToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/CreateEllipseTool.js +1 -1
- package/src/sap/ui/vk/tools/CreateEllipseToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/CreateParametricGizmo.js +1 -1
- package/src/sap/ui/vk/tools/CreatePathTool.js +1 -1
- package/src/sap/ui/vk/tools/CreatePathToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/CreateRectangleTool.js +1 -1
- package/src/sap/ui/vk/tools/CreateRectangleToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/CreateTextTool.js +1 -1
- package/src/sap/ui/vk/tools/CreateTextToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/CrossSectionTool.js +1 -1
- package/src/sap/ui/vk/tools/CrossSectionToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/DuplicateSvgElementTool.js +1 -1
- package/src/sap/ui/vk/tools/DuplicateSvgElementToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/ExplodeTool.js +1 -1
- package/src/sap/ui/vk/tools/ExplodeToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/Gizmo.js +1 -1
- package/src/sap/ui/vk/tools/HitTestTool.js +1 -1
- package/src/sap/ui/vk/tools/MoveTool.js +1 -1
- package/src/sap/ui/vk/tools/MoveToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/PointCloudSelectionTool.js +1 -1
- package/src/sap/ui/vk/tools/PointCloudSelectionToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/RectSelectTool.js +1 -1
- package/src/sap/ui/vk/tools/RedlineTool.js +1 -1
- package/src/sap/ui/vk/tools/RedlineToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/RotateOrbitTool.js +1 -1
- package/src/sap/ui/vk/tools/RotateTool.js +1 -1
- package/src/sap/ui/vk/tools/RotateToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/RotateTurntableTool.js +1 -1
- package/src/sap/ui/vk/tools/ScaleTool.js +1 -1
- package/src/sap/ui/vk/tools/ScaleToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/SceneOrientationTool.js +1 -1
- package/src/sap/ui/vk/tools/SceneOrientationToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/Tool.js +1 -1
- package/src/sap/ui/vk/tools/TooltipTool.js +1 -1
- package/src/sap/ui/vk/tools/TooltipToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/TransformSvgElementTool.js +1 -1
- package/src/sap/ui/vk/tools/TransformSvgElementToolGizmo.js +3 -3
- package/src/sap/ui/vk/tools/TransformSvgElementToolHandler.js +1 -1
- package/src/sap/ui/vk/totara/Command.js +1 -0
- package/src/sap/ui/vk/totara/SceneContext.js +23 -1
- package/src/sap/ui/vk/totara/TotaraLoader.js +1 -0
- package/src/sap/ui/vk/totara/TotaraLoaderWorker.js +16 -0
- package/src/sap/ui/vk/totara/TotaraUtils.js +3 -1
- package/src/sap/ui/vk/ve/dvl.wasm +0 -0
|
@@ -15,6 +15,11 @@ sap.ui.define([
|
|
|
15
15
|
"sap/m/Input",
|
|
16
16
|
"sap/m/Table",
|
|
17
17
|
"sap/m/table/ColumnWidthController",
|
|
18
|
+
"sap/m/table/columnmenu/Menu",
|
|
19
|
+
"sap/m/table/columnmenu/QuickGroup",
|
|
20
|
+
"sap/m/table/columnmenu/QuickGroupItem",
|
|
21
|
+
"sap/m/table/columnmenu/QuickSort",
|
|
22
|
+
"sap/m/table/columnmenu/QuickSortItem",
|
|
18
23
|
"sap/m/Column",
|
|
19
24
|
"sap/m/ColumnListItem",
|
|
20
25
|
"sap/m/plugins/ColumnResizer",
|
|
@@ -27,6 +32,7 @@ sap.ui.define([
|
|
|
27
32
|
"sap/m/p13n/SortController",
|
|
28
33
|
"sap/m/p13n/MetadataHelper",
|
|
29
34
|
"sap/ui/core/Control",
|
|
35
|
+
"sap/ui/core/CustomData",
|
|
30
36
|
"sap/ui/core/Element",
|
|
31
37
|
"sap/ui/core/Icon",
|
|
32
38
|
"sap/ui/core/Lib",
|
|
@@ -34,6 +40,7 @@ sap.ui.define([
|
|
|
34
40
|
"sap/ui/model/json/JSONModel",
|
|
35
41
|
"sap/ui/model/Filter",
|
|
36
42
|
"sap/ui/model/FilterOperator",
|
|
43
|
+
"sap/ui/model/Sorter",
|
|
37
44
|
"../Core",
|
|
38
45
|
"./VisibilityType",
|
|
39
46
|
"../getResourceBundle",
|
|
@@ -47,6 +54,11 @@ sap.ui.define([
|
|
|
47
54
|
Input,
|
|
48
55
|
Table,
|
|
49
56
|
ColumnWidthController,
|
|
57
|
+
Menu,
|
|
58
|
+
QuickGroup,
|
|
59
|
+
QuickGroupItem,
|
|
60
|
+
QuickSort,
|
|
61
|
+
QuickSortItem,
|
|
50
62
|
Column,
|
|
51
63
|
ColumnListItem,
|
|
52
64
|
ColumnResizer,
|
|
@@ -59,6 +71,7 @@ sap.ui.define([
|
|
|
59
71
|
SortController,
|
|
60
72
|
MetadataHelper,
|
|
61
73
|
Control,
|
|
74
|
+
CustomData,
|
|
62
75
|
Element,
|
|
63
76
|
Icon,
|
|
64
77
|
Lib,
|
|
@@ -66,6 +79,7 @@ sap.ui.define([
|
|
|
66
79
|
JSONModel,
|
|
67
80
|
Filter,
|
|
68
81
|
FilterOperator,
|
|
82
|
+
Sorter,
|
|
69
83
|
vkCore,
|
|
70
84
|
VisibilityType,
|
|
71
85
|
getResourceBundle,
|
|
@@ -73,8 +87,7 @@ sap.ui.define([
|
|
|
73
87
|
) {
|
|
74
88
|
"use strict";
|
|
75
89
|
|
|
76
|
-
const
|
|
77
|
-
const FlexRendertype = SapMLibrary.FlexRendertype;
|
|
90
|
+
const SortOrder = CoreLibrary.SortOrder;
|
|
78
91
|
|
|
79
92
|
const IconType = {
|
|
80
93
|
Hidden: "sap-icon://hide",
|
|
@@ -85,7 +98,8 @@ sap.ui.define([
|
|
|
85
98
|
const ColumnName = {
|
|
86
99
|
RefDes: "refdes",
|
|
87
100
|
Type: "type",
|
|
88
|
-
Device: "deviceref"
|
|
101
|
+
Device: "deviceref",
|
|
102
|
+
Visibility: "visibility"
|
|
89
103
|
};
|
|
90
104
|
|
|
91
105
|
const ElementType = {
|
|
@@ -98,6 +112,14 @@ sap.ui.define([
|
|
|
98
112
|
ElementType: "ElementType"
|
|
99
113
|
};
|
|
100
114
|
|
|
115
|
+
function getKeyForItem(element) {
|
|
116
|
+
return element.data("key");
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function findItemByKey(items, key) {
|
|
120
|
+
return items.find(element => getKeyForItem(element) === key);
|
|
121
|
+
}
|
|
122
|
+
|
|
101
123
|
function isAncestorOf(ancestor, descendant) {
|
|
102
124
|
for (let current = descendant.getParent(); current != null; current = current.getParent()) {
|
|
103
125
|
if (current === ancestor) {
|
|
@@ -120,7 +142,7 @@ sap.ui.define([
|
|
|
120
142
|
const metadata = nodeRef?.userData?.metadata ?? {};
|
|
121
143
|
if (metadata.length != undefined) {
|
|
122
144
|
const map = new Map();
|
|
123
|
-
metadata.forEach(
|
|
145
|
+
metadata.forEach(entry => {
|
|
124
146
|
if (entry.category === "ecad") {
|
|
125
147
|
map.set(entry.tag, entry.value);
|
|
126
148
|
}
|
|
@@ -130,6 +152,17 @@ sap.ui.define([
|
|
|
130
152
|
return null;
|
|
131
153
|
}
|
|
132
154
|
|
|
155
|
+
function formatElementType(element) {
|
|
156
|
+
switch (element.type) {
|
|
157
|
+
case ElementType.Component:
|
|
158
|
+
return getResourceBundle().getText("ELEMENTS_PANEL_TYPE_COMPONENT");
|
|
159
|
+
case ElementType.Net:
|
|
160
|
+
return getResourceBundle().getText("ELEMENTS_PANEL_TYPE_NET");
|
|
161
|
+
default:
|
|
162
|
+
return getResourceBundle().getText("ELEMENTS_PANEL_TYPE_UNKNOWN");
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
133
166
|
/**
|
|
134
167
|
* Constructor for a new ElementsPanel.
|
|
135
168
|
*
|
|
@@ -148,7 +181,7 @@ sap.ui.define([
|
|
|
148
181
|
*
|
|
149
182
|
* @extends sap.ui.core.Control
|
|
150
183
|
* @author SAP SE
|
|
151
|
-
* @version 1.
|
|
184
|
+
* @version 1.141.0
|
|
152
185
|
*
|
|
153
186
|
* @constructor
|
|
154
187
|
* @public
|
|
@@ -278,7 +311,7 @@ sap.ui.define([
|
|
|
278
311
|
this._promise = Promise.all([
|
|
279
312
|
Lib.load("sap.f"),
|
|
280
313
|
Lib.load("sap.ui.comp")
|
|
281
|
-
]).then(() => new Promise(
|
|
314
|
+
]).then(() => new Promise(resolve => {
|
|
282
315
|
sap.ui.require([
|
|
283
316
|
"sap/f/DynamicPage",
|
|
284
317
|
"sap/f/DynamicPageTitle",
|
|
@@ -314,13 +347,93 @@ sap.ui.define([
|
|
|
314
347
|
press: this._onSettings.bind(this)
|
|
315
348
|
});
|
|
316
349
|
|
|
350
|
+
// Menu with sorting
|
|
351
|
+
const sortMenu = new Menu({
|
|
352
|
+
showTableSettingsButton: true,
|
|
353
|
+
beforeOpen: this._onBeforeOpenColumnMenu.bind(this),
|
|
354
|
+
tableSettingsPressed: this._onSettings.bind(this),
|
|
355
|
+
quickActions: [
|
|
356
|
+
new QuickSort({
|
|
357
|
+
change: this._onSort.bind(this), items: [new QuickSortItem()]
|
|
358
|
+
})
|
|
359
|
+
]
|
|
360
|
+
});
|
|
361
|
+
|
|
362
|
+
// Menu with sorting and grouping
|
|
363
|
+
const sortGroupMenu = new Menu({
|
|
364
|
+
showTableSettingsButton: true,
|
|
365
|
+
beforeOpen: this._onBeforeOpenColumnMenu.bind(this),
|
|
366
|
+
tableSettingsPressed: this._onSettings.bind(this),
|
|
367
|
+
quickActions: [
|
|
368
|
+
new QuickSort({
|
|
369
|
+
change: this._onSort.bind(this),
|
|
370
|
+
items: [new QuickSortItem()]
|
|
371
|
+
}),
|
|
372
|
+
new QuickGroup({
|
|
373
|
+
change: this._onGroup.bind(this),
|
|
374
|
+
items: [new QuickGroupItem()]
|
|
375
|
+
})
|
|
376
|
+
]
|
|
377
|
+
});
|
|
378
|
+
|
|
379
|
+
this._rowTemplate = new ColumnListItem({
|
|
380
|
+
vAlign: "Middle",
|
|
381
|
+
cells: [
|
|
382
|
+
new Label({
|
|
383
|
+
text: "{refdes}",
|
|
384
|
+
customData: new CustomData({ key: "key", value: ColumnName.RefDes })
|
|
385
|
+
}),
|
|
386
|
+
new Label({
|
|
387
|
+
text: {
|
|
388
|
+
path: "",
|
|
389
|
+
formatter: formatElementType,
|
|
390
|
+
customData: new CustomData({ key: "key", value: ColumnName.Type })
|
|
391
|
+
}
|
|
392
|
+
}),
|
|
393
|
+
new Label({
|
|
394
|
+
text: "{deviceref}",
|
|
395
|
+
customData: new CustomData({ key: "key", value: ColumnName.Device })
|
|
396
|
+
}),
|
|
397
|
+
new Icon({
|
|
398
|
+
src: {
|
|
399
|
+
path: "",
|
|
400
|
+
formatter: function(element) {
|
|
401
|
+
switch (getVisibility(element)) {
|
|
402
|
+
case VisibilityType.Hidden:
|
|
403
|
+
return IconType.Hidden;
|
|
404
|
+
case VisibilityType.Partial:
|
|
405
|
+
return IconType.Partial;
|
|
406
|
+
default:
|
|
407
|
+
return IconType.Visible;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
tooltip: {
|
|
412
|
+
path: "",
|
|
413
|
+
formatter: function(element) {
|
|
414
|
+
switch (getVisibility(element)) {
|
|
415
|
+
case VisibilityType.Hidden:
|
|
416
|
+
return getResourceBundle().getText("ELEMENTS_PANEL_VISIBLE_COLUMN_HIDDEN_TOOLTIP");
|
|
417
|
+
case VisibilityType.Partial:
|
|
418
|
+
return getResourceBundle().getText("ELEMENTS_PANEL_VISIBLE_COLUMN_PARTIAL_TOOLTIP");
|
|
419
|
+
default:
|
|
420
|
+
return getResourceBundle().getText("ELEMENTS_PANEL_VISIBLE_COLUMN_VISIBLE_TOOLTIP");
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
},
|
|
424
|
+
customData: new CustomData({ key: "key", value: ColumnName.Visibility })
|
|
425
|
+
})
|
|
426
|
+
]
|
|
427
|
+
});
|
|
428
|
+
|
|
317
429
|
this._table = new Table({
|
|
430
|
+
id: "elements-table",
|
|
318
431
|
mode: "MultiSelect",
|
|
319
432
|
fixedLayout: "Strict",
|
|
320
433
|
autoPopinMode: true,
|
|
321
434
|
popinLayout: "GridSmall",
|
|
322
435
|
includeItemInSelection: true,
|
|
323
|
-
sticky: [Sticky.HeaderToolbar, Sticky.ColumnHeaders],
|
|
436
|
+
sticky: [SapMLibrary.Sticky.HeaderToolbar, SapMLibrary.Sticky.ColumnHeaders],
|
|
324
437
|
selectionChange: this._onTableSelectionChanged.bind(this),
|
|
325
438
|
headerToolbar: new OverflowToolbar({
|
|
326
439
|
content: [
|
|
@@ -337,83 +450,36 @@ sap.ui.define([
|
|
|
337
450
|
],
|
|
338
451
|
columns: [
|
|
339
452
|
new Column({
|
|
453
|
+
headerMenu: sortMenu,
|
|
340
454
|
hAlign: CoreLibrary.TextAlign.Begin,
|
|
455
|
+
customData: new CustomData({ key: "key", value: ColumnName.RefDes }),
|
|
341
456
|
header: new Label({ text: getResourceBundle().getText("ELEMENTS_PANEL_NAME_COLUMN") })
|
|
342
457
|
|
|
343
458
|
}),
|
|
344
459
|
new Column({
|
|
460
|
+
headerMenu: sortGroupMenu,
|
|
345
461
|
hAlign: CoreLibrary.TextAlign.Begin,
|
|
462
|
+
customData: new CustomData({ key: "key", value: ColumnName.Type }),
|
|
346
463
|
header: new Label({ text: getResourceBundle().getText("ELEMENTS_PANEL_TYPE_COLUMN") })
|
|
347
464
|
}),
|
|
348
465
|
new Column({
|
|
466
|
+
headerMenu: sortGroupMenu,
|
|
349
467
|
hAlign: CoreLibrary.TextAlign.Begin,
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
})
|
|
468
|
+
customData: new CustomData({ key: "key", value: ColumnName.Device }),
|
|
469
|
+
header: new Label({ text: getResourceBundle().getText("ELEMENTS_PANEL_DEVICE_REFERENCE_COLUMN") })
|
|
353
470
|
}),
|
|
354
471
|
new Column({
|
|
355
472
|
hAlign: CoreLibrary.TextAlign.Center,
|
|
473
|
+
customData: new CustomData({ key: "key", value: ColumnName.Visibility }),
|
|
356
474
|
header: new Label({ text: getResourceBundle().getText("ELEMENTS_PANEL_VISIBLE_COLUMN") })
|
|
357
475
|
})
|
|
358
476
|
],
|
|
359
477
|
items: {
|
|
360
478
|
path: "/",
|
|
361
|
-
template:
|
|
362
|
-
vAlign: "Middle",
|
|
363
|
-
cells: [
|
|
364
|
-
new Label({
|
|
365
|
-
text: "{refdes}"
|
|
366
|
-
}),
|
|
367
|
-
new Label({
|
|
368
|
-
text: {
|
|
369
|
-
path: "",
|
|
370
|
-
formatter: function(element) {
|
|
371
|
-
switch (element.type) {
|
|
372
|
-
case ElementType.Component:
|
|
373
|
-
return getResourceBundle().getText("ELEMENTS_PANEL_TYPE_COMPONENT");
|
|
374
|
-
case ElementType.Net:
|
|
375
|
-
return getResourceBundle().getText("ELEMENTS_PANEL_TYPE_NET");
|
|
376
|
-
default:
|
|
377
|
-
return getResourceBundle().getText("ELEMENTS_PANEL_TYPE_UNKNOWN");
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
}),
|
|
382
|
-
new Label({
|
|
383
|
-
text: "{deviceref}"
|
|
384
|
-
}),
|
|
385
|
-
new Icon({
|
|
386
|
-
src: {
|
|
387
|
-
path: "",
|
|
388
|
-
formatter: function(element) {
|
|
389
|
-
switch (getVisibility(element)) {
|
|
390
|
-
case VisibilityType.Hidden:
|
|
391
|
-
return IconType.Hidden;
|
|
392
|
-
case VisibilityType.Partial:
|
|
393
|
-
return IconType.Partial;
|
|
394
|
-
default:
|
|
395
|
-
return IconType.Visible;
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
},
|
|
399
|
-
tooltip: {
|
|
400
|
-
path: "",
|
|
401
|
-
formatter: function(element) {
|
|
402
|
-
switch (getVisibility(element)) {
|
|
403
|
-
case VisibilityType.Hidden:
|
|
404
|
-
return getResourceBundle().getText("ELEMENTS_PANEL_VISIBLE_COLUMN_HIDDEN_TOOLTIP");
|
|
405
|
-
case VisibilityType.Partial:
|
|
406
|
-
return getResourceBundle().getText("ELEMENTS_PANEL_VISIBLE_COLUMN_PARTIAL_TOOLTIP");
|
|
407
|
-
default:
|
|
408
|
-
return getResourceBundle().getText("ELEMENTS_PANEL_VISIBLE_COLUMN_VISIBLE_TOOLTIP");
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
})
|
|
413
|
-
]
|
|
414
|
-
})
|
|
479
|
+
template: this._rowTemplate
|
|
415
480
|
}
|
|
416
481
|
});
|
|
482
|
+
|
|
417
483
|
this._table.setModel(this._model);
|
|
418
484
|
|
|
419
485
|
this._filterBar = new FilterBar({
|
|
@@ -503,7 +569,7 @@ sap.ui.define([
|
|
|
503
569
|
|
|
504
570
|
const content = new VBox({
|
|
505
571
|
height: "100%",
|
|
506
|
-
renderType: FlexRendertype.Bare,
|
|
572
|
+
renderType: SapMLibrary.FlexRendertype.Bare,
|
|
507
573
|
items: [
|
|
508
574
|
this._page,
|
|
509
575
|
this._message
|
|
@@ -515,37 +581,18 @@ sap.ui.define([
|
|
|
515
581
|
|
|
516
582
|
this._p13nEngine = Engine.getInstance();
|
|
517
583
|
|
|
518
|
-
this._metadataHelper = new MetadataHelper([
|
|
519
|
-
{
|
|
520
|
-
key: ColumnName.RefDes,
|
|
521
|
-
path: ColumnName.RefDes,
|
|
522
|
-
label: getResourceBundle().getText("ELEMENTS_PANEL_NAME_COLUMN"),
|
|
523
|
-
groupable: false
|
|
524
|
-
},
|
|
525
|
-
{
|
|
526
|
-
key: ColumnName.Type,
|
|
527
|
-
path: ColumnName.Type,
|
|
528
|
-
label: getResourceBundle().getText("ELEMENTS_PANEL_TYPE_COLUMN")
|
|
529
|
-
},
|
|
530
|
-
{
|
|
531
|
-
key: ColumnName.Device,
|
|
532
|
-
path: ColumnName.Device,
|
|
533
|
-
label: getResourceBundle().getText("ELEMENTS_PANEL_DEVICE_REFERENCE_COLUMN")
|
|
534
|
-
}
|
|
535
|
-
]);
|
|
536
|
-
|
|
537
584
|
// Register the elements table for personalization
|
|
538
|
-
this.
|
|
585
|
+
this._registerForP13n();
|
|
539
586
|
|
|
540
587
|
// Set up filter bar data handlers
|
|
541
588
|
this._filterBar.addEventDelegate({
|
|
542
589
|
// When the user hits the `Enter` key in any of the filter bar controls, we trigger the
|
|
543
590
|
// search. This handler covers all the filter group items. The basic search field is handled separately.
|
|
544
|
-
onsapenter:
|
|
591
|
+
onsapenter: event => {
|
|
545
592
|
const control = event.srcControl;
|
|
546
593
|
// If `control` itself or its ancestor is a part of the `filterGroupItems` aggregation of
|
|
547
594
|
// the `FilterBar` control, then we can trigger the search.
|
|
548
|
-
if (this._filterBar.getFilterGroupItems().some(
|
|
595
|
+
if (this._filterBar.getFilterGroupItems().some(item => {
|
|
549
596
|
const itemControl = item.getControl();
|
|
550
597
|
return itemControl === control || isAncestorOf(itemControl, control);
|
|
551
598
|
})) {
|
|
@@ -571,13 +618,16 @@ sap.ui.define([
|
|
|
571
618
|
this._p13nEngine.detachStateChange(this._onTableStateChange);
|
|
572
619
|
this._p13nEngine.deregister(this._table);
|
|
573
620
|
this._p13nEngine = null;
|
|
621
|
+
|
|
574
622
|
this._metadataHelper.destroy();
|
|
575
623
|
this._metadataHelper = null;
|
|
576
624
|
|
|
577
625
|
this._model.destroy();
|
|
578
626
|
this._model = null;
|
|
627
|
+
|
|
579
628
|
this._elementTypeModel.destroy();
|
|
580
629
|
this._elementTypeModel = null;
|
|
630
|
+
|
|
581
631
|
this._filterSummaryModel.destroy();
|
|
582
632
|
this._filterSummaryModel = null;
|
|
583
633
|
|
|
@@ -616,14 +666,40 @@ sap.ui.define([
|
|
|
616
666
|
this.fireContentChanged();
|
|
617
667
|
};
|
|
618
668
|
|
|
619
|
-
ElementsPanel.prototype.
|
|
669
|
+
ElementsPanel.prototype._registerForP13n = function() {
|
|
670
|
+
this._metadataHelper = new MetadataHelper([
|
|
671
|
+
{
|
|
672
|
+
groupable: false,
|
|
673
|
+
key: ColumnName.RefDes,
|
|
674
|
+
path: ColumnName.RefDes,
|
|
675
|
+
label: getResourceBundle().getText("ELEMENTS_PANEL_NAME_COLUMN")
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
key: ColumnName.Type,
|
|
679
|
+
path: ColumnName.Type,
|
|
680
|
+
label: getResourceBundle().getText("ELEMENTS_PANEL_TYPE_COLUMN")
|
|
681
|
+
},
|
|
682
|
+
{
|
|
683
|
+
key: ColumnName.Device,
|
|
684
|
+
path: ColumnName.Device,
|
|
685
|
+
label: getResourceBundle().getText("ELEMENTS_PANEL_DEVICE_REFERENCE_COLUMN")
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
sortable: false,
|
|
689
|
+
groupable: false,
|
|
690
|
+
key: ColumnName.Visibility,
|
|
691
|
+
path: ColumnName.Visibility,
|
|
692
|
+
label: getResourceBundle().getText("ELEMENTS_PANEL_VISIBLE_COLUMN")
|
|
693
|
+
}
|
|
694
|
+
]);
|
|
620
695
|
|
|
621
696
|
this._p13nEngine.register(this._table, {
|
|
622
697
|
helper: this._metadataHelper,
|
|
623
698
|
controller: {
|
|
624
699
|
columnStates: new SelectionController({
|
|
625
700
|
control: this._table,
|
|
626
|
-
targetAggregation: "columns"
|
|
701
|
+
targetAggregation: "columns",
|
|
702
|
+
getKeyForItem
|
|
627
703
|
}),
|
|
628
704
|
columnWidthStates: new ColumnWidthController({
|
|
629
705
|
control: this._table
|
|
@@ -639,18 +715,17 @@ sap.ui.define([
|
|
|
639
715
|
|
|
640
716
|
this._p13nEngine.attachStateChange(this._onTableStateChange.bind(this));
|
|
641
717
|
|
|
642
|
-
// Set up default column visibility and sorting for the
|
|
718
|
+
// Set up default column visibility and sorting for the table.
|
|
643
719
|
const state = {
|
|
644
720
|
columnStates: this._metadataHelper.getProperties().map(({ key }) => ({ key })),
|
|
645
|
-
sortStates: [{ key: ColumnName.RefDes, descending:
|
|
721
|
+
sortStates: [{ key: ColumnName.RefDes, descending: false }]
|
|
646
722
|
};
|
|
647
723
|
|
|
648
724
|
this._p13nEngine.applyState(this._table, state);
|
|
649
725
|
};
|
|
650
726
|
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
this._p13nEngine.show(this._table, panels, { source: this._table });
|
|
727
|
+
ElementsPanel.prototype._onSettings = function() {
|
|
728
|
+
this._p13nEngine.show(this._table, ["columnStates", "sortStates", "groupStates"], { source: this._table });
|
|
654
729
|
};
|
|
655
730
|
|
|
656
731
|
ElementsPanel.prototype._setScene = function(scene) {
|
|
@@ -683,12 +758,12 @@ sap.ui.define([
|
|
|
683
758
|
}
|
|
684
759
|
break;
|
|
685
760
|
case ElementType.Net:
|
|
686
|
-
nodeRef.children.forEach(
|
|
761
|
+
nodeRef.children.forEach(child => {
|
|
687
762
|
element.parts.set(child.uid, child);
|
|
688
763
|
if (this._manager.getVisibilityState(child) === false) {
|
|
689
764
|
element.hiddenParts.add(child.uid);
|
|
690
765
|
}
|
|
691
|
-
}
|
|
766
|
+
});
|
|
692
767
|
break;
|
|
693
768
|
default:
|
|
694
769
|
break;
|
|
@@ -704,7 +779,7 @@ sap.ui.define([
|
|
|
704
779
|
return; // don't go further down the hierarchy
|
|
705
780
|
}
|
|
706
781
|
}
|
|
707
|
-
nodeRef.children.forEach(
|
|
782
|
+
nodeRef.children.forEach(child => this._scanTree(elements, child));
|
|
708
783
|
};
|
|
709
784
|
|
|
710
785
|
ElementsPanel.prototype._onTableSelectionChanged = function(event) {
|
|
@@ -712,7 +787,7 @@ sap.ui.define([
|
|
|
712
787
|
const selected = event.getParameter("selected");
|
|
713
788
|
const output = [];
|
|
714
789
|
|
|
715
|
-
items.forEach(
|
|
790
|
+
items.forEach(item => {
|
|
716
791
|
const element = item.getBindingContext().getObject();
|
|
717
792
|
switch (element.type) {
|
|
718
793
|
case ElementType.Component:
|
|
@@ -724,7 +799,7 @@ sap.ui.define([
|
|
|
724
799
|
default:
|
|
725
800
|
break;
|
|
726
801
|
}
|
|
727
|
-
}
|
|
802
|
+
});
|
|
728
803
|
|
|
729
804
|
this._manager.setSelectionState(output, selected, true, true);
|
|
730
805
|
this._updateButtons();
|
|
@@ -738,28 +813,24 @@ sap.ui.define([
|
|
|
738
813
|
const process = (list, item, select) => {
|
|
739
814
|
const element = item.getBindingContext().getObject();
|
|
740
815
|
|
|
741
|
-
list.forEach(
|
|
816
|
+
list.forEach(nodeRef => {
|
|
742
817
|
const metadata = extractMetadata(nodeRef);
|
|
743
818
|
const refdes = metadata?.get("refdes");
|
|
744
819
|
|
|
745
820
|
if (refdes === element.refdes) {
|
|
746
821
|
this._table.setSelectedItem(item, select, false);
|
|
747
822
|
}
|
|
748
|
-
}
|
|
823
|
+
});
|
|
749
824
|
};
|
|
750
825
|
|
|
751
|
-
items.forEach(
|
|
826
|
+
items.forEach(item => {
|
|
752
827
|
process(selected, item, true);
|
|
753
828
|
process(unselected, item, false);
|
|
754
|
-
}
|
|
829
|
+
});
|
|
755
830
|
|
|
756
831
|
this._updateButtons();
|
|
757
832
|
};
|
|
758
833
|
|
|
759
|
-
ElementsPanel.prototype._handleResize = function(event) {
|
|
760
|
-
// this._updateSelection();
|
|
761
|
-
};
|
|
762
|
-
|
|
763
834
|
ElementsPanel.prototype._setContent = function(content) {
|
|
764
835
|
// If there is no explicitly assigned view state manager then use the content connector's default one.
|
|
765
836
|
if (content && !this.getViewStateManager()) {
|
|
@@ -784,7 +855,7 @@ sap.ui.define([
|
|
|
784
855
|
let canShow = false;
|
|
785
856
|
const selected = this._table.getSelectedItems();
|
|
786
857
|
|
|
787
|
-
selected.forEach(
|
|
858
|
+
selected.forEach(item => {
|
|
788
859
|
const element = item.getBindingContext().getObject();
|
|
789
860
|
const visibility = getVisibility(element);
|
|
790
861
|
|
|
@@ -796,7 +867,7 @@ sap.ui.define([
|
|
|
796
867
|
canHide = canShow = true;
|
|
797
868
|
}
|
|
798
869
|
|
|
799
|
-
}
|
|
870
|
+
});
|
|
800
871
|
|
|
801
872
|
this._showButton.setEnabled(canShow);
|
|
802
873
|
this._hideButton.setEnabled(canHide);
|
|
@@ -806,7 +877,7 @@ sap.ui.define([
|
|
|
806
877
|
const toShow = [];
|
|
807
878
|
const selected = this._table.getSelectedItems();
|
|
808
879
|
|
|
809
|
-
selected.forEach(
|
|
880
|
+
selected.forEach(item => {
|
|
810
881
|
const element = item.getBindingContext().getObject();
|
|
811
882
|
|
|
812
883
|
if (element.hiddenParts.size > 0) {
|
|
@@ -819,7 +890,7 @@ sap.ui.define([
|
|
|
819
890
|
toShow.push(ref.parent);
|
|
820
891
|
}
|
|
821
892
|
}
|
|
822
|
-
}
|
|
893
|
+
});
|
|
823
894
|
|
|
824
895
|
this._skipEvent = true;
|
|
825
896
|
this._manager.setVisibilityState(toShow, true, true, true);
|
|
@@ -831,7 +902,7 @@ sap.ui.define([
|
|
|
831
902
|
const toHide = [];
|
|
832
903
|
const selected = this._table.getSelectedItems();
|
|
833
904
|
|
|
834
|
-
selected.forEach(
|
|
905
|
+
selected.forEach(item => {
|
|
835
906
|
const element = item.getBindingContext().getObject();
|
|
836
907
|
|
|
837
908
|
if (element.hiddenParts.size < element.parts.size) {
|
|
@@ -844,7 +915,7 @@ sap.ui.define([
|
|
|
844
915
|
toHide.push(ref.parent);
|
|
845
916
|
}
|
|
846
917
|
}
|
|
847
|
-
}
|
|
918
|
+
});
|
|
848
919
|
|
|
849
920
|
this._skipEvent = true;
|
|
850
921
|
this._manager.setVisibilityState(toHide, false, true, true);
|
|
@@ -863,7 +934,7 @@ sap.ui.define([
|
|
|
863
934
|
await this._promise;
|
|
864
935
|
|
|
865
936
|
const process = (list, element, show) => {
|
|
866
|
-
list.forEach(
|
|
937
|
+
list.forEach(ref => {
|
|
867
938
|
const metadata = extractMetadata(ref);
|
|
868
939
|
const refdes = metadata?.get("refdes");
|
|
869
940
|
|
|
@@ -878,11 +949,9 @@ sap.ui.define([
|
|
|
878
949
|
break;
|
|
879
950
|
case ElementType.Net:
|
|
880
951
|
if (show) {
|
|
881
|
-
|
|
882
|
-
ref.children.forEach((child) => element.hiddenParts.delete(child.uid));
|
|
952
|
+
ref.children.forEach(child => element.hiddenParts.delete(child.uid));
|
|
883
953
|
} else {
|
|
884
|
-
|
|
885
|
-
ref.children.forEach((child) => element.hiddenParts.add(child.uid));
|
|
954
|
+
ref.children.forEach(child => element.hiddenParts.add(child.uid));
|
|
886
955
|
}
|
|
887
956
|
break;
|
|
888
957
|
default:
|
|
@@ -900,22 +969,18 @@ sap.ui.define([
|
|
|
900
969
|
}
|
|
901
970
|
}
|
|
902
971
|
}
|
|
903
|
-
}
|
|
972
|
+
});
|
|
904
973
|
};
|
|
905
974
|
|
|
906
|
-
this._model.getData().forEach(
|
|
975
|
+
this._model.getData().forEach(element => {
|
|
907
976
|
process(hidden, element, false);
|
|
908
977
|
process(visible, element, true);
|
|
909
|
-
}
|
|
978
|
+
});
|
|
910
979
|
|
|
911
980
|
this._model.updateBindings(true);
|
|
912
981
|
this._updateButtons();
|
|
913
982
|
};
|
|
914
983
|
|
|
915
|
-
ElementsPanel.prototype._onSettings = function() {
|
|
916
|
-
this._openSettingsDialog(["columnStates", "sortStates", "groupStates"]);
|
|
917
|
-
};
|
|
918
|
-
|
|
919
984
|
// Go button on the filter bar
|
|
920
985
|
ElementsPanel.prototype._onSearch = function() {
|
|
921
986
|
this._table.setShowOverlay(true);
|
|
@@ -971,26 +1036,11 @@ sap.ui.define([
|
|
|
971
1036
|
this._filterSummaryModel.setProperty("/expandedFilterSummary", this._filterBar.retrieveFiltersWithValuesAsTextExpanded());
|
|
972
1037
|
};
|
|
973
1038
|
|
|
974
|
-
ElementsPanel.prototype._onTableStateChange = function(event) {
|
|
975
|
-
if (event.getParameter("control") !== this._table) {
|
|
976
|
-
return;
|
|
977
|
-
}
|
|
978
|
-
const state = event.getParameter("state");
|
|
979
|
-
// NOTE: There is a bug in UI5 1.120 - this event should not be fired with `null` state.
|
|
980
|
-
// TODO(fix): Remove this check once the bug is fixed in later versions of UI5.
|
|
981
|
-
if (state == null) {
|
|
982
|
-
return;
|
|
983
|
-
}
|
|
984
|
-
};
|
|
985
|
-
|
|
986
|
-
ElementsPanel.prototype._onColumnResize = function(event) {
|
|
987
|
-
};
|
|
988
|
-
|
|
989
1039
|
// Returns the filter items with non-empty values from the filter bar.
|
|
990
1040
|
ElementsPanel.prototype._getFiltersWithValues = function() {
|
|
991
1041
|
return this._filterBar
|
|
992
1042
|
.getFilterGroupItems()
|
|
993
|
-
.filter(
|
|
1043
|
+
.filter(filterGroupItem => {
|
|
994
1044
|
const control = filterGroupItem.getControl();
|
|
995
1045
|
|
|
996
1046
|
if (control instanceof MultiComboBox) {
|
|
@@ -1010,5 +1060,166 @@ sap.ui.define([
|
|
|
1010
1060
|
this._filterBar._updateToolbarText?.();
|
|
1011
1061
|
};
|
|
1012
1062
|
|
|
1063
|
+
ElementsPanel.prototype._onBeforeOpenColumnMenu = function(event) {
|
|
1064
|
+
const menu = event.getSource();
|
|
1065
|
+
const column = event.getParameter("openBy");
|
|
1066
|
+
const quickActions = menu.getQuickActions();
|
|
1067
|
+
|
|
1068
|
+
// Handle sorting
|
|
1069
|
+
const sortQuickAction = quickActions.find(quickAction => quickAction instanceof QuickSort);
|
|
1070
|
+
if (sortQuickAction != null) {
|
|
1071
|
+
const sortItem = sortQuickAction.getItems()[0];
|
|
1072
|
+
sortItem.setKey(getKeyForItem(column));
|
|
1073
|
+
sortItem.setLabel(column.getHeader().getText(false));
|
|
1074
|
+
sortItem.setSortOrder(column.getSortIndicator());
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
// Handle grouping, if available - not all columns are groupable
|
|
1078
|
+
const groupQuickAction = quickActions.find(quickAction => quickAction instanceof QuickGroup);
|
|
1079
|
+
if (groupQuickAction != null) {
|
|
1080
|
+
const groupItem = groupQuickAction.getItems()[0];
|
|
1081
|
+
groupItem.setKey(getKeyForItem(column));
|
|
1082
|
+
groupItem.setLabel(column.getHeader().getText(false));
|
|
1083
|
+
groupItem.setGrouped(column.data("grouped"));
|
|
1084
|
+
}
|
|
1085
|
+
};
|
|
1086
|
+
|
|
1087
|
+
ElementsPanel.prototype._onColumnResize = function(event) {
|
|
1088
|
+
};
|
|
1089
|
+
|
|
1090
|
+
ElementsPanel.prototype._onSort = function(event) {
|
|
1091
|
+
this._p13nEngine.retrieveState(this._table).then(state => {
|
|
1092
|
+
const sortStates = state.sortStates;
|
|
1093
|
+
|
|
1094
|
+
for (const state of sortStates) {
|
|
1095
|
+
state.sorted = false;
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
const item = event.getParameter("item");
|
|
1099
|
+
const key = item.getKey();
|
|
1100
|
+
const sortOrder = item.getSortOrder();
|
|
1101
|
+
|
|
1102
|
+
if (sortOrder !== SortOrder.None) {
|
|
1103
|
+
sortStates.push({ key, descending: sortOrder === SortOrder.Descending });
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
this._p13nEngine.applyState(this._table, state);
|
|
1107
|
+
});
|
|
1108
|
+
};
|
|
1109
|
+
|
|
1110
|
+
ElementsPanel.prototype._onGroup = function(event) {
|
|
1111
|
+
this._p13nEngine.retrieveState(this._table).then(state => {
|
|
1112
|
+
const groupStates = state.groupStates;
|
|
1113
|
+
|
|
1114
|
+
for (const state of groupStates) {
|
|
1115
|
+
state.grouped = false;
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
const groupItem = event.getParameter("item");
|
|
1119
|
+
const key = groupItem.getKey();
|
|
1120
|
+
|
|
1121
|
+
if (groupItem.getGrouped()) {
|
|
1122
|
+
groupStates.push({ key });
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
this._p13nEngine.applyState(this._table, state);
|
|
1126
|
+
});
|
|
1127
|
+
};
|
|
1128
|
+
|
|
1129
|
+
ElementsPanel.prototype._onTableStateChange = function(event) {
|
|
1130
|
+
if (event.getParameter("control") !== this._table) {
|
|
1131
|
+
return;
|
|
1132
|
+
}
|
|
1133
|
+
const state = event.getParameter("state");
|
|
1134
|
+
// NOTE: There is a bug in UI5 1.120 - this event should not be fired with `null` state.
|
|
1135
|
+
// TODO(fix): Remove this check once the bug is fixed in later versions of UI5.
|
|
1136
|
+
if (state == null) {
|
|
1137
|
+
return;
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
const info = this._table.getBindingInfo("items");
|
|
1141
|
+
const bindingInfo = {
|
|
1142
|
+
path: info.path,
|
|
1143
|
+
model: info.model,
|
|
1144
|
+
factory: info.factory
|
|
1145
|
+
};
|
|
1146
|
+
|
|
1147
|
+
const columns = this._table.getColumns();
|
|
1148
|
+
|
|
1149
|
+
// Reset all columns to be invisible, unsorted and ungrouped
|
|
1150
|
+
for (const column of columns) {
|
|
1151
|
+
column.setVisible(false);
|
|
1152
|
+
column.setSortIndicator(SortOrder.None);
|
|
1153
|
+
column.data("grouped", false);
|
|
1154
|
+
|
|
1155
|
+
const width = state.columnWidthStates[getKeyForItem(column)];
|
|
1156
|
+
|
|
1157
|
+
if (width !== undefined) {
|
|
1158
|
+
column.setWidth();
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
const cellTemplates = this._rowTemplate.getCells();
|
|
1163
|
+
|
|
1164
|
+
// Make column visible and in right order
|
|
1165
|
+
state.columnStates.forEach((columnState, index) => {
|
|
1166
|
+
const column = findItemByKey(this._table.getColumns(), columnState.key);
|
|
1167
|
+
column.setVisible(true);
|
|
1168
|
+
|
|
1169
|
+
this._table.removeColumn(column);
|
|
1170
|
+
this._table.insertColumn(column, index);
|
|
1171
|
+
|
|
1172
|
+
const template = findItemByKey(cellTemplates, columnState.key);
|
|
1173
|
+
|
|
1174
|
+
this._rowTemplate.removeCell(template);
|
|
1175
|
+
this._rowTemplate.insertCell(template, index);
|
|
1176
|
+
});
|
|
1177
|
+
|
|
1178
|
+
// Create sorters
|
|
1179
|
+
//
|
|
1180
|
+
// If there is a column used for grouping, we need to create a sorter for it as well and that
|
|
1181
|
+
// sorter must be the first in the list of sorters. The column used for grouping can also be one
|
|
1182
|
+
// of the columns used for sorting but it is not mandatory. Only one column can be used for grouping
|
|
1183
|
+
bindingInfo.sorter = [];
|
|
1184
|
+
|
|
1185
|
+
if (state.groupStates.length === 1) {
|
|
1186
|
+
const key = state.groupStates[0].key;
|
|
1187
|
+
const path = this._metadataHelper.getProperty(key).path;
|
|
1188
|
+
|
|
1189
|
+
// If this column is also used for sorting, we need to take its sorting order from the corresponding item in state.sortStates
|
|
1190
|
+
const sortState = state.sortStates.find(sortState => sortState.key === key);
|
|
1191
|
+
const descending = sortState?.descending ?? false;
|
|
1192
|
+
|
|
1193
|
+
const getGroupHeader = context => {
|
|
1194
|
+
switch (path) {
|
|
1195
|
+
case ColumnName.Type:
|
|
1196
|
+
return formatElementType(context.getObject());
|
|
1197
|
+
default:
|
|
1198
|
+
return context.getProperty(path);
|
|
1199
|
+
}
|
|
1200
|
+
};
|
|
1201
|
+
|
|
1202
|
+
bindingInfo.sorter.push(new Sorter(path, descending, getGroupHeader));
|
|
1203
|
+
|
|
1204
|
+
const column = findItemByKey(columns, key);
|
|
1205
|
+
column.data("grouped", true);
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
for (let sortState of state.sortStates) {
|
|
1209
|
+
const column = findItemByKey(columns, sortState.key);
|
|
1210
|
+
column.setSortIndicator(sortState.descending ? SortOrder.Descending : SortOrder.Ascending);
|
|
1211
|
+
|
|
1212
|
+
if (state.groupStates[0]?.key === sortState.key) {
|
|
1213
|
+
continue;
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
const path = this._metadataHelper.getProperty(sortState.key).path;
|
|
1217
|
+
bindingInfo.sorter.push(new Sorter(path, sortState.descending));
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
// Apply new binding info to the table
|
|
1221
|
+
this._table.bindItems(bindingInfo);
|
|
1222
|
+
};
|
|
1223
|
+
|
|
1013
1224
|
return ElementsPanel;
|
|
1014
1225
|
});
|