@sapui5/sap.ui.vk 1.140.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.
Files changed (222) hide show
  1. package/package.json +1 -1
  2. package/src/sap/ui/vk/.library +1 -1
  3. package/src/sap/ui/vk/AnimationPlayback.js +1 -1
  4. package/src/sap/ui/vk/AnimationPlayer.js +1 -1
  5. package/src/sap/ui/vk/AnimationSequence.js +1 -1
  6. package/src/sap/ui/vk/AnimationTimeSlider.js +1 -1
  7. package/src/sap/ui/vk/AnimationTrack.js +1 -1
  8. package/src/sap/ui/vk/Annotation.js +1 -1
  9. package/src/sap/ui/vk/BaseNodeProxy.js +1 -1
  10. package/src/sap/ui/vk/Camera.js +1 -1
  11. package/src/sap/ui/vk/ContentConnector.js +1 -1
  12. package/src/sap/ui/vk/ContentManager.js +1 -1
  13. package/src/sap/ui/vk/ContentResource.js +1 -1
  14. package/src/sap/ui/vk/Core.js +1 -1
  15. package/src/sap/ui/vk/DownloadManager.js +1 -1
  16. package/src/sap/ui/vk/DrawerToolbar.js +34 -34
  17. package/src/sap/ui/vk/DvlException.js +1 -1
  18. package/src/sap/ui/vk/FlexibleControl.js +1 -1
  19. package/src/sap/ui/vk/FlexibleControlLayoutData.js +1 -1
  20. package/src/sap/ui/vk/Highlight.js +1 -1
  21. package/src/sap/ui/vk/ImageContentManager.js +1 -1
  22. package/src/sap/ui/vk/JointUtils.js +1 -1
  23. package/src/sap/ui/vk/LayerProxy.js +1 -1
  24. package/src/sap/ui/vk/Loco.js +1 -1
  25. package/src/sap/ui/vk/Material.js +1 -1
  26. package/src/sap/ui/vk/NativeViewport.js +1 -1
  27. package/src/sap/ui/vk/NodeContentType.js +6 -1
  28. package/src/sap/ui/vk/NodeHierarchy.js +1 -1
  29. package/src/sap/ui/vk/NodeProxy.js +1 -1
  30. package/src/sap/ui/vk/NodeUtils.js +1 -1
  31. package/src/sap/ui/vk/Notifications.js +1 -1
  32. package/src/sap/ui/vk/ObjectType.js +2 -1
  33. package/src/sap/ui/vk/OrthographicCamera.js +1 -1
  34. package/src/sap/ui/vk/PerspectiveCamera.js +1 -1
  35. package/src/sap/ui/vk/ProgressIndicator.js +1 -1
  36. package/src/sap/ui/vk/RedlineCollaboration.js +1 -1
  37. package/src/sap/ui/vk/RedlineConversation.js +1 -1
  38. package/src/sap/ui/vk/RedlineDesign.js +1 -1
  39. package/src/sap/ui/vk/RedlineElement.js +1 -1
  40. package/src/sap/ui/vk/RedlineElementComment.js +1 -1
  41. package/src/sap/ui/vk/RedlineElementEllipse.js +1 -1
  42. package/src/sap/ui/vk/RedlineElementFreehand.js +1 -1
  43. package/src/sap/ui/vk/RedlineElementLine.js +1 -1
  44. package/src/sap/ui/vk/RedlineElementRectangle.js +1 -1
  45. package/src/sap/ui/vk/RedlineElementText.js +1 -1
  46. package/src/sap/ui/vk/RedlineSurface.js +1 -1
  47. package/src/sap/ui/vk/SafeArea.js +1 -1
  48. package/src/sap/ui/vk/Scene.js +1 -1
  49. package/src/sap/ui/vk/SceneTree.js +1 -1
  50. package/src/sap/ui/vk/StepNavigation.js +1 -1
  51. package/src/sap/ui/vk/Texture.js +1 -1
  52. package/src/sap/ui/vk/ToggleMenuButton.js +1 -1
  53. package/src/sap/ui/vk/ToggleMenuItem.js +1 -1
  54. package/src/sap/ui/vk/Toolbar.js +1 -1
  55. package/src/sap/ui/vk/View.js +1 -1
  56. package/src/sap/ui/vk/ViewGallery.js +1 -1
  57. package/src/sap/ui/vk/ViewGalleryThumbnail.js +1 -1
  58. package/src/sap/ui/vk/ViewGroup.js +1 -1
  59. package/src/sap/ui/vk/ViewManager.js +1 -1
  60. package/src/sap/ui/vk/ViewStateManager.js +1 -1
  61. package/src/sap/ui/vk/ViewStateManagerBase.js +1 -1
  62. package/src/sap/ui/vk/Viewer.js +1 -1
  63. package/src/sap/ui/vk/Viewport.js +43 -1
  64. package/src/sap/ui/vk/ViewportBase.js +24 -1
  65. package/src/sap/ui/vk/dvl/BaseNodeProxy.js +1 -1
  66. package/src/sap/ui/vk/dvl/ContentManager.js +1 -1
  67. package/src/sap/ui/vk/dvl/GraphicsCore.js +1 -1
  68. package/src/sap/ui/vk/dvl/LayerProxy.js +1 -1
  69. package/src/sap/ui/vk/dvl/NodeHierarchy.js +1 -1
  70. package/src/sap/ui/vk/dvl/NodeProxy.js +1 -1
  71. package/src/sap/ui/vk/dvl/Scene.js +1 -1
  72. package/src/sap/ui/vk/dvl/ViewStateManager.js +1 -1
  73. package/src/sap/ui/vk/dvl/Viewport.js +2 -2
  74. package/src/sap/ui/vk/ecad/ElementsPanel.js +352 -141
  75. package/src/sap/ui/vk/ecad/LayersPanel.js +1 -1
  76. package/src/sap/ui/vk/i18n/messagebundle_ar.properties +0 -2
  77. package/src/sap/ui/vk/i18n/messagebundle_bg.properties +0 -2
  78. package/src/sap/ui/vk/i18n/messagebundle_ca.properties +0 -2
  79. package/src/sap/ui/vk/i18n/messagebundle_cnr.properties +0 -2
  80. package/src/sap/ui/vk/i18n/messagebundle_cs.properties +0 -2
  81. package/src/sap/ui/vk/i18n/messagebundle_cy.properties +0 -2
  82. package/src/sap/ui/vk/i18n/messagebundle_da.properties +0 -2
  83. package/src/sap/ui/vk/i18n/messagebundle_de.properties +0 -2
  84. package/src/sap/ui/vk/i18n/messagebundle_el.properties +0 -2
  85. package/src/sap/ui/vk/i18n/messagebundle_en.properties +0 -2
  86. package/src/sap/ui/vk/i18n/messagebundle_en_GB.properties +0 -2
  87. package/src/sap/ui/vk/i18n/messagebundle_es.properties +0 -2
  88. package/src/sap/ui/vk/i18n/messagebundle_es_MX.properties +0 -2
  89. package/src/sap/ui/vk/i18n/messagebundle_et.properties +0 -2
  90. package/src/sap/ui/vk/i18n/messagebundle_fi.properties +0 -2
  91. package/src/sap/ui/vk/i18n/messagebundle_fr.properties +0 -2
  92. package/src/sap/ui/vk/i18n/messagebundle_fr_CA.properties +0 -2
  93. package/src/sap/ui/vk/i18n/messagebundle_hi.properties +0 -2
  94. package/src/sap/ui/vk/i18n/messagebundle_hr.properties +0 -2
  95. package/src/sap/ui/vk/i18n/messagebundle_hu.properties +0 -2
  96. package/src/sap/ui/vk/i18n/messagebundle_id.properties +0 -2
  97. package/src/sap/ui/vk/i18n/messagebundle_it.properties +0 -2
  98. package/src/sap/ui/vk/i18n/messagebundle_iw.properties +1 -3
  99. package/src/sap/ui/vk/i18n/messagebundle_ja.properties +0 -2
  100. package/src/sap/ui/vk/i18n/messagebundle_kk.properties +0 -2
  101. package/src/sap/ui/vk/i18n/messagebundle_ko.properties +0 -2
  102. package/src/sap/ui/vk/i18n/messagebundle_lt.properties +0 -2
  103. package/src/sap/ui/vk/i18n/messagebundle_lv.properties +0 -2
  104. package/src/sap/ui/vk/i18n/messagebundle_mk.properties +0 -2
  105. package/src/sap/ui/vk/i18n/messagebundle_ms.properties +0 -2
  106. package/src/sap/ui/vk/i18n/messagebundle_nl.properties +0 -2
  107. package/src/sap/ui/vk/i18n/messagebundle_no.properties +0 -2
  108. package/src/sap/ui/vk/i18n/messagebundle_pl.properties +0 -2
  109. package/src/sap/ui/vk/i18n/messagebundle_pt.properties +0 -2
  110. package/src/sap/ui/vk/i18n/messagebundle_pt_PT.properties +0 -2
  111. package/src/sap/ui/vk/i18n/messagebundle_ro.properties +0 -2
  112. package/src/sap/ui/vk/i18n/messagebundle_ru.properties +0 -2
  113. package/src/sap/ui/vk/i18n/messagebundle_sh.properties +0 -2
  114. package/src/sap/ui/vk/i18n/messagebundle_sk.properties +0 -2
  115. package/src/sap/ui/vk/i18n/messagebundle_sl.properties +0 -2
  116. package/src/sap/ui/vk/i18n/messagebundle_sr.properties +0 -2
  117. package/src/sap/ui/vk/i18n/messagebundle_sv.properties +0 -2
  118. package/src/sap/ui/vk/i18n/messagebundle_th.properties +0 -2
  119. package/src/sap/ui/vk/i18n/messagebundle_tr.properties +0 -2
  120. package/src/sap/ui/vk/i18n/messagebundle_uk.properties +0 -2
  121. package/src/sap/ui/vk/i18n/messagebundle_vi.properties +0 -2
  122. package/src/sap/ui/vk/i18n/messagebundle_zh_CN.properties +0 -2
  123. package/src/sap/ui/vk/i18n/messagebundle_zh_TW.properties +0 -2
  124. package/src/sap/ui/vk/library.js +2 -2
  125. package/src/sap/ui/vk/matai/MataiLoaderWorker.js +29 -7
  126. package/src/sap/ui/vk/measurements/Angle.js +1 -1
  127. package/src/sap/ui/vk/measurements/Area.js +1 -1
  128. package/src/sap/ui/vk/measurements/Distance.js +1 -1
  129. package/src/sap/ui/vk/measurements/Edge.js +1 -1
  130. package/src/sap/ui/vk/measurements/Face.js +1 -1
  131. package/src/sap/ui/vk/measurements/Feature.js +1 -1
  132. package/src/sap/ui/vk/measurements/Vertex.js +1 -1
  133. package/src/sap/ui/vk/pdf/ContentManager.js +85 -13
  134. package/src/sap/ui/vk/pdf/Viewport.js +1 -1
  135. package/src/sap/ui/vk/svg/BaseNodeProxy.js +1 -1
  136. package/src/sap/ui/vk/svg/ContentDeliveryService.js +1 -1
  137. package/src/sap/ui/vk/svg/ContentManager.js +2 -1
  138. package/src/sap/ui/vk/svg/Element.js +162 -23
  139. package/src/sap/ui/vk/svg/Ellipse.js +4 -0
  140. package/src/sap/ui/vk/svg/HotspotHelper.js +30 -17
  141. package/src/sap/ui/vk/svg/MiniMap.js +63 -1
  142. package/src/sap/ui/vk/svg/NodeHierarchy.js +17 -1
  143. package/src/sap/ui/vk/svg/NodeProxy.js +1 -1
  144. package/src/sap/ui/vk/svg/OrthographicCamera.js +1 -1
  145. package/src/sap/ui/vk/svg/Scene.js +1 -1
  146. package/src/sap/ui/vk/svg/SceneBuilder.js +62 -5
  147. package/src/sap/ui/vk/svg/Text.js +72 -30
  148. package/src/sap/ui/vk/svg/ViewStateManager.js +2 -2
  149. package/src/sap/ui/vk/svg/Viewport.js +178 -32
  150. package/src/sap/ui/vk/svg/ViewportRenderer.js +82 -0
  151. package/src/sap/ui/vk/thirdparty/pdf.js +18003 -13388
  152. package/src/sap/ui/vk/thirdparty/pdf.worker.js +38149 -36166
  153. package/src/sap/ui/vk/threejs/AnimationHelper.js +1 -1
  154. package/src/sap/ui/vk/threejs/BaseNodeProxy.js +1 -1
  155. package/src/sap/ui/vk/threejs/Billboard.js +16 -15
  156. package/src/sap/ui/vk/threejs/Callout.js +1 -1
  157. package/src/sap/ui/vk/threejs/ContentDeliveryService.js +1 -1
  158. package/src/sap/ui/vk/threejs/ContentManager.js +1 -1
  159. package/src/sap/ui/vk/threejs/DetailView.js +1 -1
  160. package/src/sap/ui/vk/threejs/HighlightPlayer.js +1 -1
  161. package/src/sap/ui/vk/threejs/Material.js +1 -1
  162. package/src/sap/ui/vk/threejs/NodeHierarchy.js +1 -1
  163. package/src/sap/ui/vk/threejs/NodeProxy.js +1 -1
  164. package/src/sap/ui/vk/threejs/OrthographicCamera.js +1 -1
  165. package/src/sap/ui/vk/threejs/PerspectiveCamera.js +1 -1
  166. package/src/sap/ui/vk/threejs/PointCloudGroup.js +1 -1
  167. package/src/sap/ui/vk/threejs/Scene.js +1 -1
  168. package/src/sap/ui/vk/threejs/SceneBuilder.js +16 -5
  169. package/src/sap/ui/vk/threejs/Texture.js +1 -1
  170. package/src/sap/ui/vk/threejs/Thrustline.js +1 -1
  171. package/src/sap/ui/vk/threejs/ViewStateManager.js +3 -3
  172. package/src/sap/ui/vk/threejs/Viewport.js +8 -9
  173. package/src/sap/ui/vk/tools/AnchorPointTool.js +1 -1
  174. package/src/sap/ui/vk/tools/AnchorPointToolGizmo.js +1 -1
  175. package/src/sap/ui/vk/tools/AxisAngleRotationTool.js +1 -1
  176. package/src/sap/ui/vk/tools/AxisAngleRotationToolGizmo.js +1 -1
  177. package/src/sap/ui/vk/tools/CreateEllipseTool.js +1 -1
  178. package/src/sap/ui/vk/tools/CreateEllipseToolGizmo.js +1 -1
  179. package/src/sap/ui/vk/tools/CreateParametricGizmo.js +1 -1
  180. package/src/sap/ui/vk/tools/CreatePathTool.js +1 -1
  181. package/src/sap/ui/vk/tools/CreatePathToolGizmo.js +1 -1
  182. package/src/sap/ui/vk/tools/CreateRectangleTool.js +1 -1
  183. package/src/sap/ui/vk/tools/CreateRectangleToolGizmo.js +1 -1
  184. package/src/sap/ui/vk/tools/CreateTextTool.js +1 -1
  185. package/src/sap/ui/vk/tools/CreateTextToolGizmo.js +1 -1
  186. package/src/sap/ui/vk/tools/CrossSectionTool.js +1 -1
  187. package/src/sap/ui/vk/tools/CrossSectionToolGizmo.js +1 -1
  188. package/src/sap/ui/vk/tools/DuplicateSvgElementTool.js +1 -1
  189. package/src/sap/ui/vk/tools/DuplicateSvgElementToolGizmo.js +1 -1
  190. package/src/sap/ui/vk/tools/ExplodeTool.js +1 -1
  191. package/src/sap/ui/vk/tools/ExplodeToolGizmo.js +1 -1
  192. package/src/sap/ui/vk/tools/Gizmo.js +1 -1
  193. package/src/sap/ui/vk/tools/HitTestTool.js +1 -1
  194. package/src/sap/ui/vk/tools/MoveTool.js +1 -1
  195. package/src/sap/ui/vk/tools/MoveToolGizmo.js +1 -1
  196. package/src/sap/ui/vk/tools/PointCloudSelectionTool.js +1 -1
  197. package/src/sap/ui/vk/tools/PointCloudSelectionToolGizmo.js +1 -1
  198. package/src/sap/ui/vk/tools/RectSelectTool.js +1 -1
  199. package/src/sap/ui/vk/tools/RedlineTool.js +1 -1
  200. package/src/sap/ui/vk/tools/RedlineToolGizmo.js +1 -1
  201. package/src/sap/ui/vk/tools/RotateOrbitTool.js +1 -1
  202. package/src/sap/ui/vk/tools/RotateTool.js +1 -1
  203. package/src/sap/ui/vk/tools/RotateToolGizmo.js +1 -1
  204. package/src/sap/ui/vk/tools/RotateTurntableTool.js +1 -1
  205. package/src/sap/ui/vk/tools/ScaleTool.js +1 -1
  206. package/src/sap/ui/vk/tools/ScaleToolGizmo.js +1 -1
  207. package/src/sap/ui/vk/tools/SceneOrientationTool.js +1 -1
  208. package/src/sap/ui/vk/tools/SceneOrientationToolGizmo.js +1 -1
  209. package/src/sap/ui/vk/tools/Tool.js +1 -1
  210. package/src/sap/ui/vk/tools/TooltipTool.js +1 -1
  211. package/src/sap/ui/vk/tools/TooltipToolGizmo.js +1 -1
  212. package/src/sap/ui/vk/tools/TransformSvgElementTool.js +1 -1
  213. package/src/sap/ui/vk/tools/TransformSvgElementToolGizmo.js +3 -3
  214. package/src/sap/ui/vk/tools/TransformSvgElementToolHandler.js +1 -1
  215. package/src/sap/ui/vk/totara/Command.js +1 -0
  216. package/src/sap/ui/vk/totara/SceneContext.js +23 -1
  217. package/src/sap/ui/vk/totara/TotaraLoader.js +1 -0
  218. package/src/sap/ui/vk/totara/TotaraLoaderWorker.js +16 -0
  219. package/src/sap/ui/vk/totara/TotaraUtils.js +3 -1
  220. package/src/sap/ui/vk/ve/dvl.wasm +0 -0
  221. package/src/sap/ui/vk/ve/matai.js +2 -2
  222. package/src/sap/ui/vk/ve/matai.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 Sticky = SapMLibrary.Sticky;
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(function(entry) {
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.140.0
184
+ * @version 1.142.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((resolve) => {
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
- header: new Label({
351
- text: getResourceBundle().getText("ELEMENTS_PANEL_DEVICE_REFERENCE_COLUMN")
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: new ColumnListItem({
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._registerTableForP13n();
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: (event) => {
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((item) => {
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._registerTableForP13n = function() {
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 task table.
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: true }]
721
+ sortStates: [{ key: ColumnName.RefDes, descending: false }]
646
722
  };
647
723
 
648
724
  this._p13nEngine.applyState(this._table, state);
649
725
  };
650
726
 
651
- // Open settings dialog for personalization
652
- ElementsPanel.prototype._openSettingsDialog = function(panels) {
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(function(child) {
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
- }, this);
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((child) => this._scanTree(elements, child));
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(function(item) {
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
- }, this);
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(function(nodeRef) {
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
- }, this);
823
+ });
749
824
  };
750
825
 
751
- items.forEach(function(item) {
826
+ items.forEach(item => {
752
827
  process(selected, item, true);
753
828
  process(unselected, item, false);
754
- }, this);
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(function(item) {
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
- }, this);
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(function(item) {
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
- }, this);
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(function(item) {
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
- }, this);
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(function(ref) {
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
- // element.hiddenParts.delete(ref.uid);
882
- ref.children.forEach((child) => element.hiddenParts.delete(child.uid));
952
+ ref.children.forEach(child => element.hiddenParts.delete(child.uid));
883
953
  } else {
884
- // element.hiddenParts.add(ref.uid);
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
- }, this);
972
+ });
904
973
  };
905
974
 
906
- this._model.getData().forEach(function(element) {
975
+ this._model.getData().forEach(element => {
907
976
  process(hidden, element, false);
908
977
  process(visible, element, true);
909
- }, this);
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((filterGroupItem) => {
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
  });