@sapui5/sap.ui.vk 1.139.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.
Files changed (223) 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 +3 -3
  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 +1 -1
  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 +12 -2
  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 +636 -375
  75. package/src/sap/ui/vk/ecad/LayersPanel.js +88 -75
  76. package/src/sap/ui/vk/i18n/messagebundle.properties +0 -4
  77. package/src/sap/ui/vk/i18n/messagebundle_ar.properties +2 -3
  78. package/src/sap/ui/vk/i18n/messagebundle_bg.properties +2 -3
  79. package/src/sap/ui/vk/i18n/messagebundle_ca.properties +2 -3
  80. package/src/sap/ui/vk/i18n/messagebundle_cnr.properties +2 -3
  81. package/src/sap/ui/vk/i18n/messagebundle_cs.properties +2 -3
  82. package/src/sap/ui/vk/i18n/messagebundle_cy.properties +2 -3
  83. package/src/sap/ui/vk/i18n/messagebundle_da.properties +2 -3
  84. package/src/sap/ui/vk/i18n/messagebundle_de.properties +4 -5
  85. package/src/sap/ui/vk/i18n/messagebundle_el.properties +2 -3
  86. package/src/sap/ui/vk/i18n/messagebundle_en.properties +2 -3
  87. package/src/sap/ui/vk/i18n/messagebundle_en_GB.properties +2 -3
  88. package/src/sap/ui/vk/i18n/messagebundle_en_US_saprigi.properties +1 -3
  89. package/src/sap/ui/vk/i18n/messagebundle_es.properties +2 -3
  90. package/src/sap/ui/vk/i18n/messagebundle_es_MX.properties +2 -3
  91. package/src/sap/ui/vk/i18n/messagebundle_et.properties +2 -3
  92. package/src/sap/ui/vk/i18n/messagebundle_fi.properties +2 -3
  93. package/src/sap/ui/vk/i18n/messagebundle_fr.properties +2 -3
  94. package/src/sap/ui/vk/i18n/messagebundle_fr_CA.properties +2 -3
  95. package/src/sap/ui/vk/i18n/messagebundle_hi.properties +2 -3
  96. package/src/sap/ui/vk/i18n/messagebundle_hr.properties +2 -3
  97. package/src/sap/ui/vk/i18n/messagebundle_hu.properties +2 -3
  98. package/src/sap/ui/vk/i18n/messagebundle_id.properties +3 -4
  99. package/src/sap/ui/vk/i18n/messagebundle_it.properties +2 -3
  100. package/src/sap/ui/vk/i18n/messagebundle_iw.properties +2 -3
  101. package/src/sap/ui/vk/i18n/messagebundle_ja.properties +4 -5
  102. package/src/sap/ui/vk/i18n/messagebundle_kk.properties +2 -3
  103. package/src/sap/ui/vk/i18n/messagebundle_ko.properties +2 -3
  104. package/src/sap/ui/vk/i18n/messagebundle_lt.properties +2 -3
  105. package/src/sap/ui/vk/i18n/messagebundle_lv.properties +2 -3
  106. package/src/sap/ui/vk/i18n/messagebundle_mk.properties +2 -3
  107. package/src/sap/ui/vk/i18n/messagebundle_ms.properties +2 -3
  108. package/src/sap/ui/vk/i18n/messagebundle_nl.properties +2 -3
  109. package/src/sap/ui/vk/i18n/messagebundle_no.properties +3 -4
  110. package/src/sap/ui/vk/i18n/messagebundle_pl.properties +2 -3
  111. package/src/sap/ui/vk/i18n/messagebundle_pt.properties +2 -3
  112. package/src/sap/ui/vk/i18n/messagebundle_pt_PT.properties +2 -3
  113. package/src/sap/ui/vk/i18n/messagebundle_ro.properties +2 -3
  114. package/src/sap/ui/vk/i18n/messagebundle_ru.properties +2 -3
  115. package/src/sap/ui/vk/i18n/messagebundle_sh.properties +2 -3
  116. package/src/sap/ui/vk/i18n/messagebundle_sk.properties +2 -3
  117. package/src/sap/ui/vk/i18n/messagebundle_sl.properties +2 -3
  118. package/src/sap/ui/vk/i18n/messagebundle_sr.properties +2 -3
  119. package/src/sap/ui/vk/i18n/messagebundle_sv.properties +2 -3
  120. package/src/sap/ui/vk/i18n/messagebundle_th.properties +2 -3
  121. package/src/sap/ui/vk/i18n/messagebundle_tr.properties +2 -3
  122. package/src/sap/ui/vk/i18n/messagebundle_uk.properties +2 -3
  123. package/src/sap/ui/vk/i18n/messagebundle_vi.properties +3 -4
  124. package/src/sap/ui/vk/i18n/messagebundle_zh_CN.properties +2 -3
  125. package/src/sap/ui/vk/i18n/messagebundle_zh_TW.properties +2 -3
  126. package/src/sap/ui/vk/library.js +2 -2
  127. package/src/sap/ui/vk/measurements/Angle.js +1 -1
  128. package/src/sap/ui/vk/measurements/Area.js +1 -1
  129. package/src/sap/ui/vk/measurements/Distance.js +1 -1
  130. package/src/sap/ui/vk/measurements/Edge.js +1 -1
  131. package/src/sap/ui/vk/measurements/Face.js +1 -1
  132. package/src/sap/ui/vk/measurements/Feature.js +1 -1
  133. package/src/sap/ui/vk/measurements/Vertex.js +1 -1
  134. package/src/sap/ui/vk/pdf/ContentManager.js +85 -13
  135. package/src/sap/ui/vk/pdf/Viewport.js +1 -1
  136. package/src/sap/ui/vk/svg/BaseNodeProxy.js +1 -1
  137. package/src/sap/ui/vk/svg/ContentDeliveryService.js +1 -1
  138. package/src/sap/ui/vk/svg/ContentManager.js +2 -1
  139. package/src/sap/ui/vk/svg/Element.js +162 -23
  140. package/src/sap/ui/vk/svg/Ellipse.js +4 -0
  141. package/src/sap/ui/vk/svg/HotspotHelper.js +30 -17
  142. package/src/sap/ui/vk/svg/MiniMap.js +63 -1
  143. package/src/sap/ui/vk/svg/NodeHierarchy.js +17 -1
  144. package/src/sap/ui/vk/svg/NodeProxy.js +1 -1
  145. package/src/sap/ui/vk/svg/OrthographicCamera.js +1 -1
  146. package/src/sap/ui/vk/svg/Scene.js +1 -1
  147. package/src/sap/ui/vk/svg/SceneBuilder.js +57 -5
  148. package/src/sap/ui/vk/svg/Text.js +72 -30
  149. package/src/sap/ui/vk/svg/ViewStateManager.js +2 -2
  150. package/src/sap/ui/vk/svg/Viewport.js +178 -32
  151. package/src/sap/ui/vk/svg/ViewportRenderer.js +82 -0
  152. package/src/sap/ui/vk/thirdparty/BufferGeometryUtils.js +86 -27
  153. package/src/sap/ui/vk/thirdparty/pdf.js +18003 -13388
  154. package/src/sap/ui/vk/thirdparty/pdf.worker.js +38149 -36166
  155. package/src/sap/ui/vk/thirdparty/three.js +48127 -25854
  156. package/src/sap/ui/vk/threejs/AnimationHelper.js +1 -1
  157. package/src/sap/ui/vk/threejs/BaseNodeProxy.js +1 -1
  158. package/src/sap/ui/vk/threejs/Billboard.js +1 -1
  159. package/src/sap/ui/vk/threejs/Callout.js +1 -1
  160. package/src/sap/ui/vk/threejs/ContentDeliveryService.js +1 -1
  161. package/src/sap/ui/vk/threejs/ContentManager.js +1 -1
  162. package/src/sap/ui/vk/threejs/DetailView.js +1 -1
  163. package/src/sap/ui/vk/threejs/HighlightPlayer.js +1 -1
  164. package/src/sap/ui/vk/threejs/Material.js +1 -1
  165. package/src/sap/ui/vk/threejs/NodeHierarchy.js +1 -1
  166. package/src/sap/ui/vk/threejs/NodeProxy.js +1 -1
  167. package/src/sap/ui/vk/threejs/OrthographicCamera.js +1 -1
  168. package/src/sap/ui/vk/threejs/PerspectiveCamera.js +1 -1
  169. package/src/sap/ui/vk/threejs/PointCloudGroup.js +1 -1
  170. package/src/sap/ui/vk/threejs/Scene.js +1 -1
  171. package/src/sap/ui/vk/threejs/SceneBuilder.js +12 -1
  172. package/src/sap/ui/vk/threejs/Texture.js +1 -1
  173. package/src/sap/ui/vk/threejs/Thrustline.js +1 -1
  174. package/src/sap/ui/vk/threejs/ViewStateManager.js +7 -8
  175. package/src/sap/ui/vk/threejs/Viewport.js +7 -5
  176. package/src/sap/ui/vk/tools/AnchorPointTool.js +1 -1
  177. package/src/sap/ui/vk/tools/AnchorPointToolGizmo.js +1 -1
  178. package/src/sap/ui/vk/tools/AxisAngleRotationTool.js +1 -1
  179. package/src/sap/ui/vk/tools/AxisAngleRotationToolGizmo.js +1 -1
  180. package/src/sap/ui/vk/tools/CreateEllipseTool.js +1 -1
  181. package/src/sap/ui/vk/tools/CreateEllipseToolGizmo.js +1 -1
  182. package/src/sap/ui/vk/tools/CreateParametricGizmo.js +1 -1
  183. package/src/sap/ui/vk/tools/CreatePathTool.js +1 -1
  184. package/src/sap/ui/vk/tools/CreatePathToolGizmo.js +1 -1
  185. package/src/sap/ui/vk/tools/CreateRectangleTool.js +1 -1
  186. package/src/sap/ui/vk/tools/CreateRectangleToolGizmo.js +1 -1
  187. package/src/sap/ui/vk/tools/CreateTextTool.js +1 -1
  188. package/src/sap/ui/vk/tools/CreateTextToolGizmo.js +1 -1
  189. package/src/sap/ui/vk/tools/CrossSectionTool.js +1 -1
  190. package/src/sap/ui/vk/tools/CrossSectionToolGizmo.js +1 -1
  191. package/src/sap/ui/vk/tools/DuplicateSvgElementTool.js +1 -1
  192. package/src/sap/ui/vk/tools/DuplicateSvgElementToolGizmo.js +1 -1
  193. package/src/sap/ui/vk/tools/ExplodeTool.js +1 -1
  194. package/src/sap/ui/vk/tools/ExplodeToolGizmo.js +1 -1
  195. package/src/sap/ui/vk/tools/Gizmo.js +4 -3
  196. package/src/sap/ui/vk/tools/HitTestTool.js +1 -1
  197. package/src/sap/ui/vk/tools/MoveTool.js +1 -1
  198. package/src/sap/ui/vk/tools/MoveToolGizmo.js +1 -1
  199. package/src/sap/ui/vk/tools/PointCloudSelectionTool.js +1 -1
  200. package/src/sap/ui/vk/tools/PointCloudSelectionToolGizmo.js +1 -1
  201. package/src/sap/ui/vk/tools/RectSelectTool.js +1 -1
  202. package/src/sap/ui/vk/tools/RedlineTool.js +1 -1
  203. package/src/sap/ui/vk/tools/RedlineToolGizmo.js +1 -1
  204. package/src/sap/ui/vk/tools/RotateOrbitTool.js +1 -1
  205. package/src/sap/ui/vk/tools/RotateTool.js +1 -1
  206. package/src/sap/ui/vk/tools/RotateToolGizmo.js +1 -1
  207. package/src/sap/ui/vk/tools/RotateTurntableTool.js +1 -1
  208. package/src/sap/ui/vk/tools/ScaleTool.js +1 -1
  209. package/src/sap/ui/vk/tools/ScaleToolGizmo.js +1 -1
  210. package/src/sap/ui/vk/tools/SceneOrientationTool.js +1 -1
  211. package/src/sap/ui/vk/tools/SceneOrientationToolGizmo.js +1 -1
  212. package/src/sap/ui/vk/tools/Tool.js +1 -1
  213. package/src/sap/ui/vk/tools/TooltipTool.js +1 -1
  214. package/src/sap/ui/vk/tools/TooltipToolGizmo.js +1 -1
  215. package/src/sap/ui/vk/tools/TransformSvgElementTool.js +1 -1
  216. package/src/sap/ui/vk/tools/TransformSvgElementToolGizmo.js +3 -3
  217. package/src/sap/ui/vk/tools/TransformSvgElementToolHandler.js +1 -1
  218. package/src/sap/ui/vk/totara/Command.js +1 -0
  219. package/src/sap/ui/vk/totara/SceneContext.js +26 -2
  220. package/src/sap/ui/vk/totara/TotaraLoader.js +1 -0
  221. package/src/sap/ui/vk/totara/TotaraLoaderWorker.js +16 -0
  222. package/src/sap/ui/vk/totara/TotaraUtils.js +3 -1
  223. package/src/sap/ui/vk/ve/dvl.wasm +0 -0
@@ -7,6 +7,7 @@
7
7
 
8
8
  // Provides control sap.ui.vk.ecad.ElementsPanel
9
9
  sap.ui.define([
10
+ "sap/m/VBox",
10
11
  "sap/m/Button",
11
12
  "sap/m/OverflowToolbar",
12
13
  "sap/m/ToolbarSpacer",
@@ -14,34 +15,38 @@ sap.ui.define([
14
15
  "sap/m/Input",
15
16
  "sap/m/Table",
16
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",
17
23
  "sap/m/Column",
18
24
  "sap/m/ColumnListItem",
19
25
  "sap/m/plugins/ColumnResizer",
20
26
  "sap/m/MultiComboBox",
27
+ "sap/m/IllustratedMessage",
28
+ "sap/m/IllustratedMessageType",
21
29
  "sap/m/p13n/Engine",
22
30
  "sap/m/p13n/SelectionController",
23
31
  "sap/m/p13n/GroupController",
24
32
  "sap/m/p13n/SortController",
25
33
  "sap/m/p13n/MetadataHelper",
26
- "sap/f/DynamicPage",
27
- "sap/f/DynamicPageTitle",
28
- "sap/f/DynamicPageHeader",
29
- "sap/ui/comp/filterbar/FilterBar",
30
- "sap/ui/comp/filterbar/FilterGroupItem",
31
34
  "sap/ui/core/Control",
35
+ "sap/ui/core/CustomData",
32
36
  "sap/ui/core/Element",
33
37
  "sap/ui/core/Icon",
38
+ "sap/ui/core/Lib",
34
39
  "sap/ui/core/library",
35
40
  "sap/ui/model/json/JSONModel",
36
41
  "sap/ui/model/Filter",
37
42
  "sap/ui/model/FilterOperator",
43
+ "sap/ui/model/Sorter",
38
44
  "../Core",
39
45
  "./VisibilityType",
40
46
  "../getResourceBundle",
41
- "sap/m/library",
42
- "sap/f/library",
43
- "sap/ui/comp/library"
47
+ "sap/m/library"
44
48
  ], function(
49
+ VBox,
45
50
  Button,
46
51
  OverflowToolbar,
47
52
  ToolbarSpacer,
@@ -49,37 +54,71 @@ sap.ui.define([
49
54
  Input,
50
55
  Table,
51
56
  ColumnWidthController,
57
+ Menu,
58
+ QuickGroup,
59
+ QuickGroupItem,
60
+ QuickSort,
61
+ QuickSortItem,
52
62
  Column,
53
63
  ColumnListItem,
54
64
  ColumnResizer,
55
65
  MultiComboBox,
66
+ IllustratedMessage,
67
+ IllustratedMessageType,
56
68
  Engine,
57
69
  SelectionController,
58
70
  GroupController,
59
71
  SortController,
60
72
  MetadataHelper,
61
- DynamicPage,
62
- DynamicPageTitle,
63
- DynamicPageHeader,
64
- FilterBar,
65
- FilterGroupItem,
66
73
  Control,
74
+ CustomData,
67
75
  Element,
68
76
  Icon,
69
- Library,
77
+ Lib,
78
+ CoreLibrary,
70
79
  JSONModel,
71
80
  Filter,
72
81
  FilterOperator,
82
+ Sorter,
73
83
  vkCore,
74
84
  VisibilityType,
75
85
  getResourceBundle,
76
- SapMLibrary,
77
- SapFLibrary,
78
- SapUiComp
86
+ SapMLibrary
79
87
  ) {
80
88
  "use strict";
81
89
 
82
- const Sticky = SapMLibrary.Sticky;
90
+ const SortOrder = CoreLibrary.SortOrder;
91
+
92
+ const IconType = {
93
+ Hidden: "sap-icon://hide",
94
+ Partial: "sap-icon://vk-icons/partially-visible-element",
95
+ Visible: "sap-icon://show"
96
+ };
97
+
98
+ const ColumnName = {
99
+ RefDes: "refdes",
100
+ Type: "type",
101
+ Device: "deviceref",
102
+ Visibility: "visibility"
103
+ };
104
+
105
+ const ElementType = {
106
+ Component: "2",
107
+ Net: "4"
108
+ };
109
+
110
+ const ModelName = {
111
+ FilterSummary: "FilterSummary",
112
+ ElementType: "ElementType"
113
+ };
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
+ }
83
122
 
84
123
  function isAncestorOf(ancestor, descendant) {
85
124
  for (let current = descendant.getParent(); current != null; current = current.getParent()) {
@@ -90,20 +129,62 @@ sap.ui.define([
90
129
  return false;
91
130
  }
92
131
 
132
+ function getVisibility(element) {
133
+ if (element.hiddenParts.size === 0) {
134
+ return VisibilityType.Visible;
135
+ } else if (element.hiddenParts.size < element.parts.size) {
136
+ return VisibilityType.Partial;
137
+ }
138
+ return VisibilityType.Hidden;
139
+ }
140
+
141
+ function extractMetadata(nodeRef) {
142
+ const metadata = nodeRef?.userData?.metadata ?? {};
143
+ if (metadata.length != undefined) {
144
+ const map = new Map();
145
+ metadata.forEach(entry => {
146
+ if (entry.category === "ecad") {
147
+ map.set(entry.tag, entry.value);
148
+ }
149
+ });
150
+ return map;
151
+ }
152
+ return null;
153
+ }
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
+
93
166
  /**
94
167
  * Constructor for a new ElementsPanel.
95
168
  *
96
169
  * @param {string} [sId] id for the new control, generated automatically if no id is given
97
170
  * @param {object} [mSettings] initial settings for the new control
98
171
  *
99
- * @class Provides a flat list view of all the ECAD layers in a given scene in table format.
100
- * @extends sap.ui.core.Control
172
+ * @class Provides a list of all ECAD elements in a given scene in table format.
101
173
  *
174
+ * <b>NOTE:</b> To use this control the application developer should add dependencies to the
175
+ * following libraries on application level to ensure that the libraries are loaded before the
176
+ * module dependencies will be required:
177
+ * <ul>
178
+ * <li>sap.f</li>
179
+ * <li>sap.ui.comp</li>
180
+ * </ul>
181
+ *
182
+ * @extends sap.ui.core.Control
102
183
  * @author SAP SE
103
- * @version 1.139.0
184
+ * @version 1.141.0
104
185
  *
105
186
  * @constructor
106
- * @private
187
+ * @public
107
188
  * @alias sap.ui.vk.ecad.ElementsPanel
108
189
  * @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
109
190
  * @since 1.136.0
@@ -123,8 +204,9 @@ sap.ui.define([
123
204
  },
124
205
  aggregations: {
125
206
  content: {
126
- type: "sap.f.DynamicPage",
127
- multiple: false
207
+ type: "sap.ui.core.Control",
208
+ multiple: false,
209
+ visibility: "hidden"
128
210
  }
129
211
  },
130
212
  associations: {
@@ -177,156 +259,146 @@ sap.ui.define([
177
259
  }
178
260
  });
179
261
 
180
- const IconType = {
181
- Hidden: "sap-icon://hide",
182
- Partial: "sap-icon://vk-icons/partially-visible-element",
183
- Visible: "sap-icon://show"
184
- };
185
-
186
- const ColumnName = {
187
- RefDes: "refdes",
188
- Type: "type",
189
- Device: "deviceref"
190
- };
191
-
192
- const ElementType = {
193
- Component: "2",
194
- Net: "4"
195
- };
196
-
197
- const ModelName = {
198
- FilterSummary: "FilterSummary",
199
- ElementType: "ElementType"
200
- };
201
-
202
262
  ElementsPanel.prototype.onSetViewStateManager = function(manager) {
203
263
  this._manager = manager;
204
264
  manager.attachSelectionChanged(this._onViewportSelectionChanged, this);
205
265
  manager.attachVisibilityChanged(this._onVisibilityChanged, this);
206
- this.refresh();
266
+ this._refresh();
207
267
  };
208
268
 
209
269
  ElementsPanel.prototype.onUnsetViewStateManager = function(manager) {
210
270
  this._manager = null;
211
271
  manager.detachSelectionChanged(this._onViewportSelectionChanged, this);
212
272
  manager.detachVisibilityChanged(this._onVisibilityChanged, this);
213
- this.refresh();
273
+ this._refresh();
214
274
  };
215
275
 
216
276
  ElementsPanel.prototype.onSetContentConnector = function(connector) {
217
277
  connector.attachContentReplaced(this._onContentReplaced, this);
218
- connector.attachContentChangesFinished(this._onContentChangesFinished, this);
219
278
  this._setContent(connector.getContent());
220
279
  };
221
280
 
222
281
  ElementsPanel.prototype.onUnsetContentConnector = function(connector) {
223
282
  this._setContent(null);
224
283
  connector.detachContentReplaced(this._onContentReplaced, this);
225
- connector.detachContentChangesFinished(this._onContentChangesFinished, this);
226
284
  };
227
285
 
228
286
  ElementsPanel.prototype.init = function() {
229
- if (Control.prototype.init) {
230
- Control.prototype.init.apply(this);
231
- }
232
- const that = this;
233
-
234
- this._showButton = new Button({
235
- enabled: false,
236
- icon: IconType.Visible,
237
- text: getResourceBundle().getText("ELEMENTS_PANEL_SHOW_BUTTON"),
238
- tooltip: getResourceBundle().getText("ELEMENTS_PANEL_SHOW_BUTTON_TOOLTIP"),
239
- press: this._onShowElements.bind(this)
240
- });
287
+ Control.prototype.init?.apply(this);
241
288
 
242
- this._hideButton = new Button({
243
- enabled: false,
244
- icon: IconType.Hidden,
245
- text: getResourceBundle().getText("ELEMENTS_PANEL_HIDE_BUTTON"),
246
- tooltip: getResourceBundle().getText("ELEMENTS_PANEL_HIDE_BUTTON_TOOLTIP"),
247
- press: this._onHideElements.bind(this)
248
- });
289
+ const filterSummaryData = {
290
+ expandedFilterSummary: "",
291
+ snappedFilterSummary: ""
292
+ };
249
293
 
250
- this._settingsButton = new Button({
251
- icon: "sap-icon://action-settings",
252
- tooltip: getResourceBundle().getText("ELEMENTS_PANEL_SETTINGS_BUTTON_TOOLTIP"),
253
- press: this._onSettings.bind(this)
254
- });
294
+ const elementTypeData = [ElementType.Component, ElementType.Net];
255
295
 
256
- this._table = new Table({
257
- mode: "MultiSelect",
258
- fixedLayout: "Strict",
259
- autoPopinMode: true,
260
- popinLayout: "GridSmall",
261
- includeItemInSelection: true,
262
- noDataText: getResourceBundle().getText("ELEMENTS_PANEL_NO_DATA"),
263
- sticky: [Sticky.HeaderToolbar, Sticky.ColumnHeaders],
264
- selectionChange: this._onTableSelectionChanged.bind(this),
265
- headerToolbar: new OverflowToolbar({
266
- content: [
267
- new ToolbarSpacer(),
268
- this._showButton,
269
- this._hideButton,
270
- this._settingsButton
271
- ]
272
- }),
273
- dependents: [
274
- new ColumnResizer({
275
- columnResize: that._onColumnResize.bind(this)
276
- })
277
- ],
278
- columns: [
279
- new Column({
280
- hAlign: Library.TextAlign.Begin,
281
- header: new Label({ text: getResourceBundle().getText("ELEMENTS_PANEL_NAME_COLUMN") })
296
+ this._scene = null;
297
+ this._model = new JSONModel();
298
+ this._skipEvent = false;
299
+ this._filterSummaryModel = new JSONModel(filterSummaryData);
300
+ this._elementTypeModel = new JSONModel(elementTypeData);
282
301
 
283
- }),
284
- new Column({
285
- hAlign: Library.TextAlign.Begin,
286
- header: new Label({ text: getResourceBundle().getText("ELEMENTS_PANEL_TYPE_COLUMN") })
287
- }),
288
- new Column({
289
- hAlign: Library.TextAlign.Begin,
290
- header: new Label({
291
- text: getResourceBundle().getText("ELEMENTS_PANEL_DEVICE_REFERENCE_COLUMN")
292
- })
293
- }),
294
- new Column({
295
- hAlign: Library.TextAlign.Center,
296
- header: new Label({ text: getResourceBundle().getText("ELEMENTS_PANEL_VISIBLE_COLUMN") })
297
- })
298
- ],
299
- items: {
300
- path: "/",
301
- template: new ColumnListItem({
302
+ this.setModel(this._filterSummaryModel, ModelName.FilterSummary);
303
+ this.setModel(this._elementTypeModel, ModelName.ElementType);
304
+
305
+ // show no data message before libraries loaded
306
+ this.setAggregation("content", new IllustratedMessage({
307
+ illustrationType: IllustratedMessageType.NoData,
308
+ enableVerticalResponsiveness: true
309
+ }));
310
+
311
+ this._promise = Promise.all([
312
+ Lib.load("sap.f"),
313
+ Lib.load("sap.ui.comp")
314
+ ]).then(() => new Promise(resolve => {
315
+ sap.ui.require([
316
+ "sap/f/DynamicPage",
317
+ "sap/f/DynamicPageTitle",
318
+ "sap/f/DynamicPageHeader",
319
+ "sap/ui/comp/filterbar/FilterBar",
320
+ "sap/ui/comp/filterbar/FilterGroupItem"
321
+ ], (
322
+ DynamicPage,
323
+ DynamicPageTitle,
324
+ DynamicPageHeader,
325
+ FilterBar,
326
+ FilterGroupItem
327
+ ) => {
328
+ this._showButton = new Button({
329
+ enabled: false,
330
+ icon: IconType.Visible,
331
+ text: getResourceBundle().getText("ELEMENTS_PANEL_SHOW_BUTTON"),
332
+ tooltip: getResourceBundle().getText("ELEMENTS_PANEL_SHOW_BUTTON_TOOLTIP"),
333
+ press: this._onShowElements.bind(this)
334
+ });
335
+
336
+ this._hideButton = new Button({
337
+ enabled: false,
338
+ icon: IconType.Hidden,
339
+ text: getResourceBundle().getText("ELEMENTS_PANEL_HIDE_BUTTON"),
340
+ tooltip: getResourceBundle().getText("ELEMENTS_PANEL_HIDE_BUTTON_TOOLTIP"),
341
+ press: this._onHideElements.bind(this)
342
+ });
343
+
344
+ this._settingsButton = new Button({
345
+ icon: "sap-icon://action-settings",
346
+ tooltip: getResourceBundle().getText("ELEMENTS_PANEL_SETTINGS_BUTTON_TOOLTIP"),
347
+ press: this._onSettings.bind(this)
348
+ });
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({
302
380
  vAlign: "Middle",
303
381
  cells: [
304
382
  new Label({
305
- text: "{refdes}"
383
+ text: "{refdes}",
384
+ customData: new CustomData({ key: "key", value: ColumnName.RefDes })
306
385
  }),
307
386
  new Label({
308
387
  text: {
309
388
  path: "",
310
- formatter: function(element) {
311
- switch (element.type) {
312
- case ElementType.Component:
313
- return getResourceBundle().getText("ELEMENTS_PANEL_TYPE_COMPONENT");
314
- case ElementType.Net:
315
- return getResourceBundle().getText("ELEMENTS_PANEL_TYPE_NET");
316
- default:
317
- return getResourceBundle().getText("ELEMENTS_PANEL_TYPE_UNKNOWN");
318
- }
319
- }
389
+ formatter: formatElementType,
390
+ customData: new CustomData({ key: "key", value: ColumnName.Type })
320
391
  }
321
392
  }),
322
393
  new Label({
323
- text: "{deviceref}"
394
+ text: "{deviceref}",
395
+ customData: new CustomData({ key: "key", value: ColumnName.Device })
324
396
  }),
325
397
  new Icon({
326
398
  src: {
327
399
  path: "",
328
400
  formatter: function(element) {
329
- switch (that._getVisibility(element)) {
401
+ switch (getVisibility(element)) {
330
402
  case VisibilityType.Hidden:
331
403
  return IconType.Hidden;
332
404
  case VisibilityType.Partial:
@@ -339,7 +411,7 @@ sap.ui.define([
339
411
  tooltip: {
340
412
  path: "",
341
413
  formatter: function(element) {
342
- switch (that._getVisibility(element)) {
414
+ switch (getVisibility(element)) {
343
415
  case VisibilityType.Hidden:
344
416
  return getResourceBundle().getText("ELEMENTS_PANEL_VISIBLE_COLUMN_HIDDEN_TOOLTIP");
345
417
  case VisibilityType.Partial:
@@ -348,184 +420,238 @@ sap.ui.define([
348
420
  return getResourceBundle().getText("ELEMENTS_PANEL_VISIBLE_COLUMN_VISIBLE_TOOLTIP");
349
421
  }
350
422
  }
351
- }
423
+ },
424
+ customData: new CustomData({ key: "key", value: ColumnName.Visibility })
352
425
  })
353
426
  ]
354
- })
355
- }
356
- });
427
+ });
428
+
429
+ this._table = new Table({
430
+ id: "elements-table",
431
+ mode: "MultiSelect",
432
+ fixedLayout: "Strict",
433
+ autoPopinMode: true,
434
+ popinLayout: "GridSmall",
435
+ includeItemInSelection: true,
436
+ sticky: [SapMLibrary.Sticky.HeaderToolbar, SapMLibrary.Sticky.ColumnHeaders],
437
+ selectionChange: this._onTableSelectionChanged.bind(this),
438
+ headerToolbar: new OverflowToolbar({
439
+ content: [
440
+ new ToolbarSpacer(),
441
+ this._showButton,
442
+ this._hideButton,
443
+ this._settingsButton
444
+ ]
445
+ }),
446
+ dependents: [
447
+ new ColumnResizer({
448
+ columnResize: this._onColumnResize.bind(this)
449
+ })
450
+ ],
451
+ columns: [
452
+ new Column({
453
+ headerMenu: sortMenu,
454
+ hAlign: CoreLibrary.TextAlign.Begin,
455
+ customData: new CustomData({ key: "key", value: ColumnName.RefDes }),
456
+ header: new Label({ text: getResourceBundle().getText("ELEMENTS_PANEL_NAME_COLUMN") })
357
457
 
358
- this._filterBar = new FilterBar({
359
- useToolbar: false,
360
- persistencyKey: "Filters",
361
- search: this._onSearch.bind(this),
362
- filterChange: this._onFilterChange.bind(this),
363
- assignedFiltersChanged: this._onAssignedFiltersChanged.bind(this),
364
- filterGroupItems: [
365
- new FilterGroupItem({
366
- name: ColumnName.RefDes,
367
- label: getResourceBundle().getText("REFDES_FILTER_LABEL"),
368
- groupName: "basic",
369
- visible: true,
370
- visibleInFilterBar: true,
371
- control: new Input({
372
- change: this._onFilterChange.bind(this)
373
- })
374
- }),
375
- new FilterGroupItem({
376
- name: ColumnName.Type,
377
- label: getResourceBundle().getText("TYPE_FILTER_LABEL"),
378
- groupName: "basic",
379
- visible: true,
380
- visibleInFilterBar: true,
381
- control: new MultiComboBox({
382
- selectionChange: this._onFilterChange.bind(this),
383
- items: {
384
- path: ModelName.ElementType + ">/",
385
- templateShareable: false,
386
- template: new sap.ui.core.Item({
387
- key: "{" + ModelName.ElementType + ">}",
388
- text: {
389
- path: ModelName.ElementType + ">",
390
- formatter: function(type) {
391
- switch (type) {
392
- case ElementType.Component:
393
- return getResourceBundle().getText("ELEMENTS_PANEL_TYPE_COMPONENT");
394
- case ElementType.Net:
395
- return getResourceBundle().getText("ELEMENTS_PANEL_TYPE_NET");
396
- default:
397
- return getResourceBundle().getText("ELEMENTS_TYPE_FILTER_ALL");
458
+ }),
459
+ new Column({
460
+ headerMenu: sortGroupMenu,
461
+ hAlign: CoreLibrary.TextAlign.Begin,
462
+ customData: new CustomData({ key: "key", value: ColumnName.Type }),
463
+ header: new Label({ text: getResourceBundle().getText("ELEMENTS_PANEL_TYPE_COLUMN") })
464
+ }),
465
+ new Column({
466
+ headerMenu: sortGroupMenu,
467
+ hAlign: CoreLibrary.TextAlign.Begin,
468
+ customData: new CustomData({ key: "key", value: ColumnName.Device }),
469
+ header: new Label({ text: getResourceBundle().getText("ELEMENTS_PANEL_DEVICE_REFERENCE_COLUMN") })
470
+ }),
471
+ new Column({
472
+ hAlign: CoreLibrary.TextAlign.Center,
473
+ customData: new CustomData({ key: "key", value: ColumnName.Visibility }),
474
+ header: new Label({ text: getResourceBundle().getText("ELEMENTS_PANEL_VISIBLE_COLUMN") })
475
+ })
476
+ ],
477
+ items: {
478
+ path: "/",
479
+ template: this._rowTemplate
480
+ }
481
+ });
482
+
483
+ this._table.setModel(this._model);
484
+
485
+ this._filterBar = new FilterBar({
486
+ useToolbar: false,
487
+ persistencyKey: "Filters",
488
+ search: this._onSearch.bind(this),
489
+ filterChange: this._onFilterChange.bind(this),
490
+ assignedFiltersChanged: this._onAssignedFiltersChanged.bind(this),
491
+ filterGroupItems: [
492
+ new FilterGroupItem({
493
+ name: ColumnName.RefDes,
494
+ label: getResourceBundle().getText("REFDES_FILTER_LABEL"),
495
+ groupName: "basic",
496
+ visible: true,
497
+ visibleInFilterBar: true,
498
+ control: new Input({
499
+ change: this._onFilterChange.bind(this)
500
+ })
501
+ }),
502
+ new FilterGroupItem({
503
+ name: ColumnName.Type,
504
+ label: getResourceBundle().getText("TYPE_FILTER_LABEL"),
505
+ groupName: "basic",
506
+ visible: true,
507
+ visibleInFilterBar: true,
508
+ control: new MultiComboBox({
509
+ selectionChange: this._onFilterChange.bind(this),
510
+ items: {
511
+ path: ModelName.ElementType + ">/",
512
+ templateShareable: false,
513
+ template: new sap.ui.core.Item({
514
+ key: "{" + ModelName.ElementType + ">}",
515
+ text: {
516
+ path: ModelName.ElementType + ">",
517
+ formatter: function(type) {
518
+ switch (type) {
519
+ case ElementType.Component:
520
+ return getResourceBundle().getText("ELEMENTS_PANEL_TYPE_COMPONENT");
521
+ case ElementType.Net:
522
+ return getResourceBundle().getText("ELEMENTS_PANEL_TYPE_NET");
523
+ default:
524
+ return getResourceBundle().getText("ELEMENTS_TYPE_FILTER_ALL");
525
+ }
526
+ }
398
527
  }
399
- }
528
+ })
400
529
  }
401
530
  })
531
+ }),
532
+ new FilterGroupItem({
533
+ name: ColumnName.Device,
534
+ label: getResourceBundle().getText("DEVICE_REF_FILTER_LABEL"),
535
+ groupName: "basic",
536
+ visible: true,
537
+ visibleInFilterBar: true,
538
+ control: new Input({
539
+ change: this._onFilterChange.bind(this)
540
+ })
541
+ })
542
+ ]
543
+ });
544
+
545
+ this._page = new DynamicPage({
546
+ visible: false,
547
+ fitContent: true,
548
+ showFooter: false,
549
+ headerExpanded: false,
550
+ title: new DynamicPageTitle({
551
+ heading: this._filterTitle,
552
+ expandedContent: new Label({
553
+ text: "{" + ModelName.FilterSummary + ">/expandedFilterSummary}"
554
+ }),
555
+ snappedContent: new Label({
556
+ text: "{" + ModelName.FilterSummary + ">/snappedFilterSummary}"
557
+ })
558
+ }),
559
+ header: new DynamicPageHeader({
560
+ content: this._filterBar
561
+ }),
562
+ content: this._table
563
+ });
564
+
565
+ this._message = new IllustratedMessage({
566
+ illustrationType: IllustratedMessageType.NoData,
567
+ enableVerticalResponsiveness: true
568
+ });
569
+
570
+ const content = new VBox({
571
+ height: "100%",
572
+ renderType: SapMLibrary.FlexRendertype.Bare,
573
+ items: [
574
+ this._page,
575
+ this._message
576
+ ]
577
+ });
578
+
579
+ this.destroyAggregation("content");
580
+ this.setAggregation("content", content);
581
+
582
+ this._p13nEngine = Engine.getInstance();
583
+
584
+ // Register the elements table for personalization
585
+ this._registerForP13n();
586
+
587
+ // Set up filter bar data handlers
588
+ this._filterBar.addEventDelegate({
589
+ // When the user hits the `Enter` key in any of the filter bar controls, we trigger the
590
+ // search. This handler covers all the filter group items. The basic search field is handled separately.
591
+ onsapenter: event => {
592
+ const control = event.srcControl;
593
+ // If `control` itself or its ancestor is a part of the `filterGroupItems` aggregation of
594
+ // the `FilterBar` control, then we can trigger the search.
595
+ if (this._filterBar.getFilterGroupItems().some(item => {
596
+ const itemControl = item.getControl();
597
+ return itemControl === control || isAncestorOf(itemControl, control);
598
+ })) {
599
+ this._onAssignedFiltersChanged();
600
+ this._updateFilterBarToolbarText();
601
+ this._onSearch();
402
602
  }
403
- })
404
- }),
405
- new FilterGroupItem({
406
- name: ColumnName.Device,
407
- label: getResourceBundle().getText("DEVICE_REF_FILTER_LABEL"),
408
- groupName: "basic",
409
- visible: true,
410
- visibleInFilterBar: true,
411
- control: new Input({
412
- change: this._onFilterChange.bind(this)
413
- })
414
- })
415
- ]
416
- });
603
+ }
604
+ });
417
605
 
418
- this._page = new DynamicPage({
419
- showFooter: false,
420
- headerExpanded: false,
421
- title: new DynamicPageTitle({
422
- heading: this._filterTitle,
423
- expandedContent: new Label({
424
- text: "{" + ModelName.FilterSummary + ">/expandedFilterSummary}"
425
- }),
426
- snappedContent: new Label({
427
- text: "{" + ModelName.FilterSummary + ">/snappedFilterSummary}"
428
- })
429
- }),
430
- header: new DynamicPageHeader({
431
- content: this._filterBar
432
- }),
433
- content: this._table
434
- });
606
+ this._filterBar.registerGetFiltersWithValues(this._getFiltersWithValues.bind(this));
435
607
 
436
- this.setAggregation("content", this._page);
608
+ this._onAssignedFiltersChanged();
609
+ this._updateFilterBarToolbarText();
437
610
 
438
- this._p13nEngine = Engine.getInstance();
611
+ resolve();
612
+ });
613
+ }));
614
+ };
439
615
 
440
- this._metadataHelper = new MetadataHelper([
441
- {
442
- key: ColumnName.RefDes,
443
- path: ColumnName.RefDes,
444
- label: getResourceBundle().getText("ELEMENTS_PANEL_NAME_COLUMN"),
445
- groupable: false
446
- },
447
- {
448
- key: ColumnName.Type,
449
- path: ColumnName.Type,
450
- label: getResourceBundle().getText("ELEMENTS_PANEL_TYPE_COLUMN")
451
- },
452
- {
453
- key: ColumnName.Device,
454
- path: ColumnName.Device,
455
- label: getResourceBundle().getText("ELEMENTS_PANEL_DEVICE_REFERENCE_COLUMN")
456
- }
457
- ]);
616
+ ElementsPanel.prototype.exit = function() {
617
+ this._promise = this._promise.then(() => {
618
+ this._p13nEngine.detachStateChange(this._onTableStateChange);
619
+ this._p13nEngine.deregister(this._table);
620
+ this._p13nEngine = null;
458
621
 
459
- const filterSummaryData = {
460
- expandedFilterSummary: "",
461
- snappedFilterSummary: ""
462
- };
622
+ this._metadataHelper.destroy();
623
+ this._metadataHelper = null;
463
624
 
464
- const elementTypeData = [ElementType.Component, ElementType.Net];
625
+ this._model.destroy();
626
+ this._model = null;
465
627
 
466
- this._scene = null;
467
- this._model = new JSONModel();
468
- this._table.setModel(this._model);
469
- this._skipEvent = false;
470
- this._filterSummaryModel = new JSONModel(filterSummaryData);
471
- this._elementTypeModel = new JSONModel(elementTypeData);
628
+ this._elementTypeModel.destroy();
629
+ this._elementTypeModel = null;
472
630
 
473
- this.setModel(this._filterSummaryModel, ModelName.FilterSummary);
474
- this.setModel(this._elementTypeModel, ModelName.ElementType);
631
+ this._filterSummaryModel.destroy();
632
+ this._filterSummaryModel = null;
475
633
 
476
- // Register the elements table for personalization
477
- this._registerTableForP13n();
478
-
479
- // Set up filter bar data handlers
480
- this._filterBar.addEventDelegate({
481
- // When the user hits the `Enter` key in any of the filter bar controls, we trigger the
482
- // search. This handler covers all the filter group items. The basic search field is handled separately.
483
- onsapenter: function(event) {
484
- const control = event.srcControl;
485
- // If `control` itself or its ancestor is a part of the `filterGroupItems` aggregation of
486
- // the `FilterBar` control, then we can trigger the search.
487
- if (that._filterBar.getFilterGroupItems().some((item) => {
488
- const itemControl = item.getControl();
489
- return itemControl === control || isAncestorOf(itemControl, control);
490
- })) {
491
- that._onAssignedFiltersChanged();
492
- that._updateFilterBarToolbarText();
493
- that._onSearch();
494
- }
495
- }
634
+ Control.prototype.exit?.apply(this);
496
635
  });
497
-
498
- this._filterBar.registerGetFiltersWithValues(this._getFiltersWithValues.bind(this));
499
-
500
- this._onAssignedFiltersChanged();
501
- this._updateFilterBarToolbarText();
502
636
  };
503
637
 
504
- ElementsPanel.prototype.exit = function() {
505
- this._p13nEngine.detachStateChange(this._onTableStateChange);
506
- this._p13nEngine.deregister(this._table);
507
- this._p13nEngine = null;
508
- this._metadataHelper.destroy();
509
- this._metadataHelper = null;
638
+ ElementsPanel.prototype._updateMessage = function(filtering) {
639
+ const hasData = this._table.getItems().length > 0;
640
+ const control = filtering === true ? this._table : this._page;
510
641
 
511
- this._model.destroy();
512
- this._model = null;
513
- this._elementTypeModel.destroy();
514
- this._elementTypeModel = null;
515
- this._filterSummaryModel.destroy();
516
- this._filterSummaryModel = null;
642
+ control.setVisible(hasData);
517
643
 
518
- Control.prototype.exit?.apply(this);
644
+ this._message.setVisible(!hasData);
645
+ this._message.setIllustrationType(filtering === true ? IllustratedMessageType.NoFilterResults : sap.m.IllustratedMessageType.NoData);
519
646
  };
520
647
 
521
- ElementsPanel.prototype.getControl = function() {
522
- return this._page;
523
- };
648
+ ElementsPanel.prototype._refresh = async function() {
649
+ await this._promise;
524
650
 
525
- ElementsPanel.prototype.refresh = function() {
526
651
  if (!this._scene || !this._manager) {
527
652
  // This method may be called indirectly from the exit method after _model is destroyed
528
653
  this._model?.setData([]);
654
+ this._updateMessage(false);
529
655
  return;
530
656
  }
531
657
  // scan the tree and collect elements info
@@ -536,17 +662,44 @@ sap.ui.define([
536
662
  this._model.setData(data);
537
663
  this._table.setModel(this._model);
538
664
 
665
+ this._updateMessage(false);
539
666
  this.fireContentChanged();
540
667
  };
541
668
 
542
- 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
+ ]);
543
695
 
544
696
  this._p13nEngine.register(this._table, {
545
697
  helper: this._metadataHelper,
546
698
  controller: {
547
699
  columnStates: new SelectionController({
548
700
  control: this._table,
549
- targetAggregation: "columns"
701
+ targetAggregation: "columns",
702
+ getKeyForItem
550
703
  }),
551
704
  columnWidthStates: new ColumnWidthController({
552
705
  control: this._table
@@ -562,46 +715,22 @@ sap.ui.define([
562
715
 
563
716
  this._p13nEngine.attachStateChange(this._onTableStateChange.bind(this));
564
717
 
565
- // Set up default column visibility and sorting for the task table.
718
+ // Set up default column visibility and sorting for the table.
566
719
  const state = {
567
720
  columnStates: this._metadataHelper.getProperties().map(({ key }) => ({ key })),
568
- sortStates: [{ key: ColumnName.RefDes, descending: true }]
721
+ sortStates: [{ key: ColumnName.RefDes, descending: false }]
569
722
  };
570
723
 
571
724
  this._p13nEngine.applyState(this._table, state);
572
725
  };
573
726
 
574
- // Open settings dialog for personalization
575
- ElementsPanel.prototype._openSettingsDialog = function(panels) {
576
- 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 });
577
729
  };
578
730
 
579
731
  ElementsPanel.prototype._setScene = function(scene) {
580
732
  this._scene = scene?.isECADScene() ? scene : null;
581
- this.refresh();
582
- };
583
-
584
- ElementsPanel.prototype._getVisibility = function(element) {
585
- if (element.hiddenParts.size === 0) {
586
- return VisibilityType.Visible;
587
- } else if (element.hiddenParts.size < element.parts.size) {
588
- return VisibilityType.Partial;
589
- }
590
- return VisibilityType.Hidden;
591
- };
592
-
593
- ElementsPanel.prototype._extractMetadata = function(nodeRef) {
594
- const metadata = nodeRef?.userData?.metadata ?? {};
595
- if (metadata.length != undefined) {
596
- const map = new Map();
597
- metadata.forEach(function(entry) {
598
- if (entry.category === "ecad") {
599
- map.set(entry.tag, entry.value);
600
- }
601
- });
602
- return map;
603
- }
604
- return null;
733
+ this._refresh();
605
734
  };
606
735
 
607
736
  ElementsPanel.prototype._addElement = function(elements, nodeRef, metadata) {
@@ -629,12 +758,12 @@ sap.ui.define([
629
758
  }
630
759
  break;
631
760
  case ElementType.Net:
632
- nodeRef.children.forEach(function(child) {
761
+ nodeRef.children.forEach(child => {
633
762
  element.parts.set(child.uid, child);
634
763
  if (this._manager.getVisibilityState(child) === false) {
635
764
  element.hiddenParts.add(child.uid);
636
765
  }
637
- }, this);
766
+ });
638
767
  break;
639
768
  default:
640
769
  break;
@@ -642,7 +771,7 @@ sap.ui.define([
642
771
  };
643
772
 
644
773
  ElementsPanel.prototype._scanTree = function(elements, nodeRef) {
645
- const metadata = this._extractMetadata(nodeRef);
774
+ const metadata = extractMetadata(nodeRef);
646
775
  if (metadata) {
647
776
  const name = metadata.get("refdes");
648
777
  if (name) {
@@ -650,7 +779,7 @@ sap.ui.define([
650
779
  return; // don't go further down the hierarchy
651
780
  }
652
781
  }
653
- nodeRef.children.forEach((child) => this._scanTree(elements, child));
782
+ nodeRef.children.forEach(child => this._scanTree(elements, child));
654
783
  };
655
784
 
656
785
  ElementsPanel.prototype._onTableSelectionChanged = function(event) {
@@ -658,7 +787,7 @@ sap.ui.define([
658
787
  const selected = event.getParameter("selected");
659
788
  const output = [];
660
789
 
661
- items.forEach(function(item) {
790
+ items.forEach(item => {
662
791
  const element = item.getBindingContext().getObject();
663
792
  switch (element.type) {
664
793
  case ElementType.Component:
@@ -670,7 +799,7 @@ sap.ui.define([
670
799
  default:
671
800
  break;
672
801
  }
673
- }, this);
802
+ });
674
803
 
675
804
  this._manager.setSelectionState(output, selected, true, true);
676
805
  this._updateButtons();
@@ -684,28 +813,24 @@ sap.ui.define([
684
813
  const process = (list, item, select) => {
685
814
  const element = item.getBindingContext().getObject();
686
815
 
687
- list.forEach(function(nodeRef) {
688
- const metadata = this._extractMetadata(nodeRef);
816
+ list.forEach(nodeRef => {
817
+ const metadata = extractMetadata(nodeRef);
689
818
  const refdes = metadata?.get("refdes");
690
819
 
691
820
  if (refdes === element.refdes) {
692
821
  this._table.setSelectedItem(item, select, false);
693
822
  }
694
- }, this);
823
+ });
695
824
  };
696
825
 
697
- items.forEach(function(item) {
826
+ items.forEach(item => {
698
827
  process(selected, item, true);
699
828
  process(unselected, item, false);
700
- }, this);
829
+ });
701
830
 
702
831
  this._updateButtons();
703
832
  };
704
833
 
705
- ElementsPanel.prototype._handleResize = function(event) {
706
- // this._updateSelection();
707
- };
708
-
709
834
  ElementsPanel.prototype._setContent = function(content) {
710
835
  // If there is no explicitly assigned view state manager then use the content connector's default one.
711
836
  if (content && !this.getViewStateManager()) {
@@ -725,19 +850,14 @@ sap.ui.define([
725
850
  this._setContent(event.getParameter("newContent"));
726
851
  };
727
852
 
728
- ElementsPanel.prototype._onContentChangesFinished = function(event) {
729
- // causes second rebuild of everything ?
730
- // this.refresh();
731
- };
732
-
733
853
  ElementsPanel.prototype._updateButtons = function() {
734
854
  let canHide = false;
735
855
  let canShow = false;
736
856
  const selected = this._table.getSelectedItems();
737
857
 
738
- selected.forEach(function(item) {
858
+ selected.forEach(item => {
739
859
  const element = item.getBindingContext().getObject();
740
- const visibility = this._getVisibility(element);
860
+ const visibility = getVisibility(element);
741
861
 
742
862
  if (visibility === VisibilityType.Visible) {
743
863
  canHide = true;
@@ -747,7 +867,7 @@ sap.ui.define([
747
867
  canHide = canShow = true;
748
868
  }
749
869
 
750
- }, this);
870
+ });
751
871
 
752
872
  this._showButton.setEnabled(canShow);
753
873
  this._hideButton.setEnabled(canHide);
@@ -757,7 +877,7 @@ sap.ui.define([
757
877
  const toShow = [];
758
878
  const selected = this._table.getSelectedItems();
759
879
 
760
- selected.forEach(function(item) {
880
+ selected.forEach(item => {
761
881
  const element = item.getBindingContext().getObject();
762
882
 
763
883
  if (element.hiddenParts.size > 0) {
@@ -770,7 +890,7 @@ sap.ui.define([
770
890
  toShow.push(ref.parent);
771
891
  }
772
892
  }
773
- }, this);
893
+ });
774
894
 
775
895
  this._skipEvent = true;
776
896
  this._manager.setVisibilityState(toShow, true, true, true);
@@ -782,7 +902,7 @@ sap.ui.define([
782
902
  const toHide = [];
783
903
  const selected = this._table.getSelectedItems();
784
904
 
785
- selected.forEach(function(item) {
905
+ selected.forEach(item => {
786
906
  const element = item.getBindingContext().getObject();
787
907
 
788
908
  if (element.hiddenParts.size < element.parts.size) {
@@ -795,7 +915,7 @@ sap.ui.define([
795
915
  toHide.push(ref.parent);
796
916
  }
797
917
  }
798
- }, this);
918
+ });
799
919
 
800
920
  this._skipEvent = true;
801
921
  this._manager.setVisibilityState(toHide, false, true, true);
@@ -803,7 +923,7 @@ sap.ui.define([
803
923
  this._updateButtons();
804
924
  };
805
925
 
806
- ElementsPanel.prototype._onVisibilityChanged = function(event) {
926
+ ElementsPanel.prototype._onVisibilityChanged = async function(event) {
807
927
  if (this._skipEvent) {
808
928
  this._skipEvent = false;
809
929
  return;
@@ -811,9 +931,11 @@ sap.ui.define([
811
931
  const hidden = event.getParameter("hidden");
812
932
  const visible = event.getParameter("visible");
813
933
 
934
+ await this._promise;
935
+
814
936
  const process = (list, element, show) => {
815
- list.forEach(function(ref) {
816
- const metadata = this._extractMetadata(ref);
937
+ list.forEach(ref => {
938
+ const metadata = extractMetadata(ref);
817
939
  const refdes = metadata?.get("refdes");
818
940
 
819
941
  if (refdes === element.refdes) {
@@ -827,11 +949,9 @@ sap.ui.define([
827
949
  break;
828
950
  case ElementType.Net:
829
951
  if (show) {
830
- // element.hiddenParts.delete(ref.uid);
831
- ref.children.forEach((child) => element.hiddenParts.delete(child.uid));
952
+ ref.children.forEach(child => element.hiddenParts.delete(child.uid));
832
953
  } else {
833
- // element.hiddenParts.add(ref.uid);
834
- ref.children.forEach((child) => element.hiddenParts.add(child.uid));
954
+ ref.children.forEach(child => element.hiddenParts.add(child.uid));
835
955
  }
836
956
  break;
837
957
  default:
@@ -849,22 +969,18 @@ sap.ui.define([
849
969
  }
850
970
  }
851
971
  }
852
- }, this);
972
+ });
853
973
  };
854
974
 
855
- this._model.getData().forEach(function(element) {
975
+ this._model.getData().forEach(element => {
856
976
  process(hidden, element, false);
857
977
  process(visible, element, true);
858
- }, this);
978
+ });
859
979
 
860
980
  this._model.updateBindings(true);
861
981
  this._updateButtons();
862
982
  };
863
983
 
864
- ElementsPanel.prototype._onSettings = function() {
865
- this._openSettingsDialog(["columnStates", "sortStates", "groupStates"]);
866
- };
867
-
868
984
  // Go button on the filter bar
869
985
  ElementsPanel.prototype._onSearch = function() {
870
986
  this._table.setShowOverlay(true);
@@ -907,6 +1023,8 @@ sap.ui.define([
907
1023
 
908
1024
  this._table.getBinding("items").filter(filters);
909
1025
  this._table.setShowOverlay(false);
1026
+
1027
+ this._updateMessage(true);
910
1028
  };
911
1029
 
912
1030
  ElementsPanel.prototype._onFilterChange = function() {
@@ -918,29 +1036,11 @@ sap.ui.define([
918
1036
  this._filterSummaryModel.setProperty("/expandedFilterSummary", this._filterBar.retrieveFiltersWithValuesAsTextExpanded());
919
1037
  };
920
1038
 
921
- ElementsPanel.prototype._onBasicSearch = function() {
922
- };
923
-
924
- ElementsPanel.prototype._onTableStateChange = function(event) {
925
- if (event.getParameter("control") !== this._table) {
926
- return;
927
- }
928
- const state = event.getParameter("state");
929
- // NOTE: There is a bug in UI5 1.120 - this event should not be fired with `null` state.
930
- // TODO(fix): Remove this check once the bug is fixed in later versions of UI5.
931
- if (state == null) {
932
- return;
933
- }
934
- };
935
-
936
- ElementsPanel.prototype._onColumnResize = function(event) {
937
- };
938
-
939
1039
  // Returns the filter items with non-empty values from the filter bar.
940
1040
  ElementsPanel.prototype._getFiltersWithValues = function() {
941
1041
  return this._filterBar
942
1042
  .getFilterGroupItems()
943
- .filter((filterGroupItem) => {
1043
+ .filter(filterGroupItem => {
944
1044
  const control = filterGroupItem.getControl();
945
1045
 
946
1046
  if (control instanceof MultiComboBox) {
@@ -960,5 +1060,166 @@ sap.ui.define([
960
1060
  this._filterBar._updateToolbarText?.();
961
1061
  };
962
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
+
963
1224
  return ElementsPanel;
964
1225
  });