@sapui5/sap.ui.vk 1.136.1 → 1.139.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 (242) hide show
  1. package/package.json +1 -1
  2. package/src/sap/ui/vk/.library +9 -1
  3. package/src/sap/ui/vk/AnimationPlayback.js +1 -1
  4. package/src/sap/ui/vk/AnimationPlayer.js +2 -2
  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 +2 -2
  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 +19 -15
  12. package/src/sap/ui/vk/ContentManager.js +1 -1
  13. package/src/sap/ui/vk/ContentResource.js +3 -2
  14. package/src/sap/ui/vk/ContentType.js +1 -1
  15. package/src/sap/ui/vk/Core.js +1 -3
  16. package/src/sap/ui/vk/DownloadManager.js +1 -1
  17. package/src/sap/ui/vk/DrawerToolbar.js +152 -19
  18. package/src/sap/ui/vk/DrawerToolbarButton.js +12 -1
  19. package/src/sap/ui/vk/DvlException.js +1 -1
  20. package/src/sap/ui/vk/FlexibleControl.js +1 -2
  21. package/src/sap/ui/vk/FlexibleControlLayoutData.js +1 -2
  22. package/src/sap/ui/vk/Highlight.js +1 -1
  23. package/src/sap/ui/vk/ImageContentManager.js +1 -1
  24. package/src/sap/ui/vk/JointUtils.js +1 -1
  25. package/src/sap/ui/vk/LayerProxy.js +1 -1
  26. package/src/sap/ui/vk/LegendItem.js +1 -1
  27. package/src/sap/ui/vk/ListPanel.js +1 -1
  28. package/src/sap/ui/vk/ListPanelStack.js +1 -1
  29. package/src/sap/ui/vk/Loco.js +1 -1
  30. package/src/sap/ui/vk/Material.js +1 -1
  31. package/src/sap/ui/vk/NativeViewport.js +1 -1
  32. package/src/sap/ui/vk/NodeHierarchy.js +1 -1
  33. package/src/sap/ui/vk/NodeProxy.js +1 -1
  34. package/src/sap/ui/vk/NodeUtils.js +1 -1
  35. package/src/sap/ui/vk/Notifications.js +1 -1
  36. package/src/sap/ui/vk/OrthographicCamera.js +1 -1
  37. package/src/sap/ui/vk/OutputSettings.js +0 -1
  38. package/src/sap/ui/vk/Overlay.js +1 -1
  39. package/src/sap/ui/vk/PerspectiveCamera.js +1 -1
  40. package/src/sap/ui/vk/ProgressIndicator.js +1 -1
  41. package/src/sap/ui/vk/RedlineCollaboration.js +1 -1
  42. package/src/sap/ui/vk/RedlineConversation.js +1 -1
  43. package/src/sap/ui/vk/RedlineDesign.js +1 -1
  44. package/src/sap/ui/vk/RedlineElement.js +1 -1
  45. package/src/sap/ui/vk/RedlineElementComment.js +1 -1
  46. package/src/sap/ui/vk/RedlineElementEllipse.js +1 -1
  47. package/src/sap/ui/vk/RedlineElementFreehand.js +1 -1
  48. package/src/sap/ui/vk/RedlineElementLine.js +1 -1
  49. package/src/sap/ui/vk/RedlineElementRectangle.js +1 -1
  50. package/src/sap/ui/vk/RedlineElementText.js +1 -1
  51. package/src/sap/ui/vk/RedlineSurface.js +2 -2
  52. package/src/sap/ui/vk/SafeArea.js +1 -1
  53. package/src/sap/ui/vk/Scene.js +16 -1
  54. package/src/sap/ui/vk/SceneTree.js +23 -9
  55. package/src/sap/ui/vk/StepNavigation.js +1 -2
  56. package/src/sap/ui/vk/Texture.js +2 -2
  57. package/src/sap/ui/vk/ToggleMenuButton.js +1 -1
  58. package/src/sap/ui/vk/ToggleMenuItem.js +7 -4
  59. package/src/sap/ui/vk/ToggleMenuItemRenderer.js +224 -0
  60. package/src/sap/ui/vk/Toolbar.js +62 -100
  61. package/src/sap/ui/vk/View.js +7 -13
  62. package/src/sap/ui/vk/ViewGallery.js +2 -2
  63. package/src/sap/ui/vk/ViewGalleryThumbnail.js +1 -1
  64. package/src/sap/ui/vk/ViewGroup.js +1 -1
  65. package/src/sap/ui/vk/ViewManager.js +1 -1
  66. package/src/sap/ui/vk/ViewStateManager.js +4 -11
  67. package/src/sap/ui/vk/ViewStateManagerBase.js +4 -4
  68. package/src/sap/ui/vk/Viewer.js +408 -234
  69. package/src/sap/ui/vk/Viewport.js +2 -2
  70. package/src/sap/ui/vk/ViewportBase.js +24 -70
  71. package/src/sap/ui/vk/dvl/BaseNodeProxy.js +1 -1
  72. package/src/sap/ui/vk/dvl/ContentManager.js +1 -1
  73. package/src/sap/ui/vk/dvl/GraphicsCore.js +1 -1
  74. package/src/sap/ui/vk/dvl/LayerProxy.js +1 -1
  75. package/src/sap/ui/vk/dvl/NodeHierarchy.js +1 -1
  76. package/src/sap/ui/vk/dvl/NodeProxy.js +1 -1
  77. package/src/sap/ui/vk/dvl/Scene.js +1 -1
  78. package/src/sap/ui/vk/dvl/ViewStateManager.js +1 -1
  79. package/src/sap/ui/vk/dvl/Viewport.js +1 -1
  80. package/src/sap/ui/vk/ecad/ElementsPanel.js +627 -132
  81. package/src/sap/ui/vk/ecad/LayersPanel.js +247 -131
  82. package/src/sap/ui/vk/i18n/messagebundle.properties +70 -38
  83. package/src/sap/ui/vk/i18n/messagebundle_ar.properties +30 -12
  84. package/src/sap/ui/vk/i18n/messagebundle_bg.properties +30 -12
  85. package/src/sap/ui/vk/i18n/messagebundle_ca.properties +30 -12
  86. package/src/sap/ui/vk/i18n/messagebundle_cnr.properties +30 -12
  87. package/src/sap/ui/vk/i18n/messagebundle_cs.properties +30 -12
  88. package/src/sap/ui/vk/i18n/messagebundle_cy.properties +30 -12
  89. package/src/sap/ui/vk/i18n/messagebundle_da.properties +30 -12
  90. package/src/sap/ui/vk/i18n/messagebundle_de.properties +30 -12
  91. package/src/sap/ui/vk/i18n/messagebundle_el.properties +30 -12
  92. package/src/sap/ui/vk/i18n/messagebundle_en.properties +30 -12
  93. package/src/sap/ui/vk/i18n/messagebundle_en_GB.properties +30 -12
  94. package/src/sap/ui/vk/i18n/messagebundle_en_US_saprigi.properties +31 -12
  95. package/src/sap/ui/vk/i18n/messagebundle_es.properties +30 -12
  96. package/src/sap/ui/vk/i18n/messagebundle_es_MX.properties +30 -12
  97. package/src/sap/ui/vk/i18n/messagebundle_et.properties +30 -12
  98. package/src/sap/ui/vk/i18n/messagebundle_fi.properties +30 -12
  99. package/src/sap/ui/vk/i18n/messagebundle_fr.properties +30 -12
  100. package/src/sap/ui/vk/i18n/messagebundle_fr_CA.properties +30 -12
  101. package/src/sap/ui/vk/i18n/messagebundle_hi.properties +30 -12
  102. package/src/sap/ui/vk/i18n/messagebundle_hr.properties +30 -12
  103. package/src/sap/ui/vk/i18n/messagebundle_hu.properties +30 -12
  104. package/src/sap/ui/vk/i18n/messagebundle_id.properties +30 -12
  105. package/src/sap/ui/vk/i18n/messagebundle_it.properties +30 -12
  106. package/src/sap/ui/vk/i18n/messagebundle_iw.properties +30 -12
  107. package/src/sap/ui/vk/i18n/messagebundle_ja.properties +30 -12
  108. package/src/sap/ui/vk/i18n/messagebundle_kk.properties +30 -12
  109. package/src/sap/ui/vk/i18n/messagebundle_ko.properties +27 -9
  110. package/src/sap/ui/vk/i18n/messagebundle_lt.properties +30 -12
  111. package/src/sap/ui/vk/i18n/messagebundle_lv.properties +30 -12
  112. package/src/sap/ui/vk/i18n/messagebundle_mk.properties +30 -12
  113. package/src/sap/ui/vk/i18n/messagebundle_ms.properties +30 -12
  114. package/src/sap/ui/vk/i18n/messagebundle_nl.properties +30 -12
  115. package/src/sap/ui/vk/i18n/messagebundle_no.properties +30 -12
  116. package/src/sap/ui/vk/i18n/messagebundle_pl.properties +30 -12
  117. package/src/sap/ui/vk/i18n/messagebundle_pt.properties +30 -12
  118. package/src/sap/ui/vk/i18n/messagebundle_pt_PT.properties +30 -12
  119. package/src/sap/ui/vk/i18n/messagebundle_ro.properties +30 -12
  120. package/src/sap/ui/vk/i18n/messagebundle_ru.properties +30 -12
  121. package/src/sap/ui/vk/i18n/messagebundle_sh.properties +30 -12
  122. package/src/sap/ui/vk/i18n/messagebundle_sk.properties +30 -12
  123. package/src/sap/ui/vk/i18n/messagebundle_sl.properties +30 -12
  124. package/src/sap/ui/vk/i18n/messagebundle_sr.properties +30 -12
  125. package/src/sap/ui/vk/i18n/messagebundle_sv.properties +30 -12
  126. package/src/sap/ui/vk/i18n/messagebundle_th.properties +30 -12
  127. package/src/sap/ui/vk/i18n/messagebundle_tr.properties +30 -12
  128. package/src/sap/ui/vk/i18n/messagebundle_uk.properties +30 -12
  129. package/src/sap/ui/vk/i18n/messagebundle_vi.properties +30 -12
  130. package/src/sap/ui/vk/i18n/messagebundle_zh_CN.properties +30 -12
  131. package/src/sap/ui/vk/i18n/messagebundle_zh_TW.properties +30 -12
  132. package/src/sap/ui/vk/library.js +7 -4
  133. package/src/sap/ui/vk/measurements/Angle.js +1 -1
  134. package/src/sap/ui/vk/measurements/Area.js +1 -1
  135. package/src/sap/ui/vk/measurements/Distance.js +1 -1
  136. package/src/sap/ui/vk/measurements/Edge.js +1 -1
  137. package/src/sap/ui/vk/measurements/Face.js +1 -1
  138. package/src/sap/ui/vk/measurements/Feature.js +1 -1
  139. package/src/sap/ui/vk/measurements/Vertex.js +1 -1
  140. package/src/sap/ui/vk/pdf/ContentManager.js +1 -1
  141. package/src/sap/ui/vk/pdf/Page.js +9 -10
  142. package/src/sap/ui/vk/pdf/Utils.js +4 -2
  143. package/src/sap/ui/vk/pdf/Viewport.js +5 -8
  144. package/src/sap/ui/vk/svg/BaseNodeProxy.js +1 -1
  145. package/src/sap/ui/vk/svg/ContentDeliveryService.js +1 -1
  146. package/src/sap/ui/vk/svg/ContentManager.js +2 -1
  147. package/src/sap/ui/vk/svg/HotspotHelper.js +2 -2
  148. package/src/sap/ui/vk/svg/NodeHierarchy.js +1 -1
  149. package/src/sap/ui/vk/svg/NodeProxy.js +1 -1
  150. package/src/sap/ui/vk/svg/OrthographicCamera.js +1 -1
  151. package/src/sap/ui/vk/svg/Scene.js +1 -1
  152. package/src/sap/ui/vk/svg/SceneBuilder.js +12 -4
  153. package/src/sap/ui/vk/svg/ViewStateManager.js +2 -2
  154. package/src/sap/ui/vk/svg/Viewport.js +192 -2
  155. package/src/sap/ui/vk/themes/base/fonts/SAP-VE-icons-bold-v1.8.woff2 +0 -0
  156. package/src/sap/ui/vk/themes/base/fonts/SAP-VE-icons-regular-v1.8.woff2 +0 -0
  157. package/src/sap/ui/vk/themes/base/library.source.less +1 -1
  158. package/src/sap/ui/vk/themes/sap_belize_base/library.source.less +1 -1
  159. package/src/sap/ui/vk/themes/sap_bluecrystal_base/library.source.less +1 -1
  160. package/src/sap/ui/vk/themes/sap_hcb/library.source.less +1 -1
  161. package/src/sap/ui/vk/themes/sap_horizon/library.source.less +0 -5
  162. package/src/sap/ui/vk/themes/sap_horizon_dark/library.source.less +0 -5
  163. package/src/sap/ui/vk/themes/sap_horizon_hcb/library.source.less +0 -5
  164. package/src/sap/ui/vk/themes/sap_horizon_hcw/library.source.less +0 -5
  165. package/src/sap/ui/vk/thirdparty/pdf.worker.js +1 -1
  166. package/src/sap/ui/vk/threejs/AnimationHelper.js +1 -1
  167. package/src/sap/ui/vk/threejs/BaseNodeProxy.js +1 -1
  168. package/src/sap/ui/vk/threejs/Billboard.js +23 -11
  169. package/src/sap/ui/vk/threejs/Callout.js +11 -1
  170. package/src/sap/ui/vk/threejs/ContentDeliveryService.js +1 -1
  171. package/src/sap/ui/vk/threejs/ContentManager.js +3 -2
  172. package/src/sap/ui/vk/threejs/DetailView.js +1 -1
  173. package/src/sap/ui/vk/threejs/HighlightPlayer.js +14 -22
  174. package/src/sap/ui/vk/threejs/Material.js +2 -2
  175. package/src/sap/ui/vk/threejs/NodeHierarchy.js +1 -1
  176. package/src/sap/ui/vk/threejs/NodeProxy.js +9 -11
  177. package/src/sap/ui/vk/threejs/OrthographicCamera.js +1 -1
  178. package/src/sap/ui/vk/threejs/OutlineRenderer.js +4 -10
  179. package/src/sap/ui/vk/threejs/PerspectiveCamera.js +1 -1
  180. package/src/sap/ui/vk/threejs/PointCloudGroup.js +1 -1
  181. package/src/sap/ui/vk/threejs/Scene.js +1 -15
  182. package/src/sap/ui/vk/threejs/SceneBuilder.js +17 -4
  183. package/src/sap/ui/vk/threejs/Texture.js +2 -2
  184. package/src/sap/ui/vk/threejs/ThreeExtensions.js +10 -174
  185. package/src/sap/ui/vk/threejs/ThreeUtils.js +7 -18
  186. package/src/sap/ui/vk/threejs/Thrustline.js +1 -1
  187. package/src/sap/ui/vk/threejs/ViewStateManager.js +752 -447
  188. package/src/sap/ui/vk/threejs/Viewport.js +43 -33
  189. package/src/sap/ui/vk/tools/AnchorPointTool.js +1 -1
  190. package/src/sap/ui/vk/tools/AnchorPointToolGizmo.js +1 -1
  191. package/src/sap/ui/vk/tools/AxisAngleRotationTool.js +1 -1
  192. package/src/sap/ui/vk/tools/AxisAngleRotationToolGizmo.js +1 -1
  193. package/src/sap/ui/vk/tools/CreateEllipseTool.js +1 -1
  194. package/src/sap/ui/vk/tools/CreateEllipseToolGizmo.js +1 -1
  195. package/src/sap/ui/vk/tools/CreateParametricGizmo.js +1 -1
  196. package/src/sap/ui/vk/tools/CreatePathTool.js +1 -1
  197. package/src/sap/ui/vk/tools/CreatePathToolGizmo.js +1 -1
  198. package/src/sap/ui/vk/tools/CreateRectangleTool.js +1 -1
  199. package/src/sap/ui/vk/tools/CreateRectangleToolGizmo.js +1 -1
  200. package/src/sap/ui/vk/tools/CreateTextTool.js +1 -1
  201. package/src/sap/ui/vk/tools/CreateTextToolGizmo.js +1 -1
  202. package/src/sap/ui/vk/tools/CrossSectionTool.js +1 -1
  203. package/src/sap/ui/vk/tools/CrossSectionToolGizmo.js +1 -1
  204. package/src/sap/ui/vk/tools/DuplicateSvgElementTool.js +1 -1
  205. package/src/sap/ui/vk/tools/DuplicateSvgElementToolGizmo.js +1 -1
  206. package/src/sap/ui/vk/tools/ExplodeItemGroup.js +1 -1
  207. package/src/sap/ui/vk/tools/ExplodeTool.js +1 -1
  208. package/src/sap/ui/vk/tools/ExplodeToolGizmo.js +1 -1
  209. package/src/sap/ui/vk/tools/Gizmo.js +1 -1
  210. package/src/sap/ui/vk/tools/HitTestTool.js +1 -1
  211. package/src/sap/ui/vk/tools/MoveTool.js +1 -1
  212. package/src/sap/ui/vk/tools/MoveToolGizmo.js +1 -1
  213. package/src/sap/ui/vk/tools/PointCloudSelectionTool.js +2 -2
  214. package/src/sap/ui/vk/tools/PointCloudSelectionToolGizmo.js +1 -1
  215. package/src/sap/ui/vk/tools/RectSelectTool.js +1 -1
  216. package/src/sap/ui/vk/tools/RedlineTool.js +1 -1
  217. package/src/sap/ui/vk/tools/RedlineToolGizmo.js +1 -1
  218. package/src/sap/ui/vk/tools/RotateOrbitTool.js +1 -1
  219. package/src/sap/ui/vk/tools/RotateTool.js +1 -1
  220. package/src/sap/ui/vk/tools/RotateToolGizmo.js +1 -1
  221. package/src/sap/ui/vk/tools/RotateTurntableTool.js +1 -1
  222. package/src/sap/ui/vk/tools/ScaleTool.js +1 -1
  223. package/src/sap/ui/vk/tools/ScaleToolGizmo.js +1 -1
  224. package/src/sap/ui/vk/tools/SceneOrientationTool.js +1 -1
  225. package/src/sap/ui/vk/tools/SceneOrientationToolGizmo.js +1 -1
  226. package/src/sap/ui/vk/tools/Tool.js +1 -1
  227. package/src/sap/ui/vk/tools/TooltipTool.js +1 -1
  228. package/src/sap/ui/vk/tools/TooltipToolGizmo.js +1 -1
  229. package/src/sap/ui/vk/tools/TooltipToolHandler.js +5 -0
  230. package/src/sap/ui/vk/tools/TransformSvgElementTool.js +1 -1
  231. package/src/sap/ui/vk/tools/TransformSvgElementToolGizmo.js +1 -1
  232. package/src/sap/ui/vk/totara/TotaraLoader.js +5 -1
  233. package/src/sap/ui/vk/ve/matai.js +1 -1
  234. package/src/sap/ui/vk/ve/matai.wasm +0 -0
  235. package/ui5.yaml +5 -3
  236. package/src/sap/ui/vk/ToolbarRenderer.js +0 -41
  237. package/src/sap/ui/vk/ViewerRenderer.js +0 -48
  238. package/src/sap/ui/vk/ecad/ElementsPanelRenderer.js +0 -41
  239. package/src/sap/ui/vk/ecad/LayersPanelRenderer.js +0 -41
  240. package/src/sap/ui/vk/themes/base/fonts/SAP-VE-icons-bold-v1.4.woff2 +0 -0
  241. package/src/sap/ui/vk/themes/base/fonts/SAP-VE-icons-regular-v1.4.woff2 +0 -0
  242. package/src/sap/ui/vk/threejs/v2/ViewStateManager.js +0 -1445
@@ -8,57 +8,88 @@
8
8
  // Provides control sap.ui.vk.ecad.ElementsPanel
9
9
  sap.ui.define([
10
10
  "sap/m/Button",
11
- "sap/m/SearchField",
12
11
  "sap/m/OverflowToolbar",
13
- "sap/m/ToolbarLayoutData",
14
12
  "sap/m/ToolbarSpacer",
15
- "sap/m/Text",
13
+ "sap/m/Label",
14
+ "sap/m/Input",
16
15
  "sap/m/Table",
16
+ "sap/m/table/ColumnWidthController",
17
17
  "sap/m/Column",
18
- "sap/m/Sticky",
19
- "sap/m/ScrollContainer",
20
18
  "sap/m/ColumnListItem",
21
- "sap/ui/core/Core",
19
+ "sap/m/plugins/ColumnResizer",
20
+ "sap/m/MultiComboBox",
21
+ "sap/m/p13n/Engine",
22
+ "sap/m/p13n/SelectionController",
23
+ "sap/m/p13n/GroupController",
24
+ "sap/m/p13n/SortController",
25
+ "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",
22
31
  "sap/ui/core/Control",
23
32
  "sap/ui/core/Element",
24
33
  "sap/ui/core/Icon",
25
34
  "sap/ui/core/library",
26
- "sap/ui/core/ResizeHandler",
27
35
  "sap/ui/model/json/JSONModel",
36
+ "sap/ui/model/Filter",
37
+ "sap/ui/model/FilterOperator",
28
38
  "../Core",
29
- "../library",
30
- "../ViewStateManager",
31
- "./ElementsPanelRenderer",
32
39
  "./VisibilityType",
33
- "../getResourceBundle"
40
+ "../getResourceBundle",
41
+ "sap/m/library",
42
+ "sap/f/library",
43
+ "sap/ui/comp/library"
34
44
  ], function(
35
45
  Button,
36
- SearchField,
37
46
  OverflowToolbar,
38
- ToolbarLayoutData,
39
47
  ToolbarSpacer,
40
- Text,
48
+ Label,
49
+ Input,
41
50
  Table,
51
+ ColumnWidthController,
42
52
  Column,
43
- Sticky,
44
- ScrollContainer,
45
53
  ColumnListItem,
46
- Core,
54
+ ColumnResizer,
55
+ MultiComboBox,
56
+ Engine,
57
+ SelectionController,
58
+ GroupController,
59
+ SortController,
60
+ MetadataHelper,
61
+ DynamicPage,
62
+ DynamicPageTitle,
63
+ DynamicPageHeader,
64
+ FilterBar,
65
+ FilterGroupItem,
47
66
  Control,
48
67
  Element,
49
68
  Icon,
50
69
  Library,
51
- ResizeHandler,
52
70
  JSONModel,
71
+ Filter,
72
+ FilterOperator,
53
73
  vkCore,
54
- vkLibrary,
55
- ViewStateManager,
56
- ElementsPanelRenderer,
57
74
  VisibilityType,
58
- getResourceBundle
75
+ getResourceBundle,
76
+ SapMLibrary,
77
+ SapFLibrary,
78
+ SapUiComp
59
79
  ) {
60
80
  "use strict";
61
81
 
82
+ const Sticky = SapMLibrary.Sticky;
83
+
84
+ function isAncestorOf(ancestor, descendant) {
85
+ for (let current = descendant.getParent(); current != null; current = current.getParent()) {
86
+ if (current === ancestor) {
87
+ return true;
88
+ }
89
+ }
90
+ return false;
91
+ }
92
+
62
93
  /**
63
94
  * Constructor for a new ElementsPanel.
64
95
  *
@@ -69,7 +100,7 @@ sap.ui.define([
69
100
  * @extends sap.ui.core.Control
70
101
  *
71
102
  * @author SAP SE
72
- * @version 1.136.1
103
+ * @version 1.139.0
73
104
  *
74
105
  * @constructor
75
106
  * @private
@@ -80,9 +111,19 @@ sap.ui.define([
80
111
  var ElementsPanel = Control.extend("sap.ui.vk.ecad.ElementsPanel", /** @lends sap.ui.vk.ecad.ElementsPanel.prototype */ {
81
112
  metadata: {
82
113
  library: "sap.ui.vk",
114
+ properties: {
115
+ width: {
116
+ type: "sap.ui.core.CSSSize",
117
+ defaultValue: "auto"
118
+ },
119
+ height: {
120
+ type: "sap.ui.core.CSSSize",
121
+ defaultValue: "100%"
122
+ }
123
+ },
83
124
  aggregations: {
84
125
  content: {
85
- type: "sap.m.ScrollContainer",
126
+ type: "sap.f.DynamicPage",
86
127
  multiple: false
87
128
  }
88
129
  },
@@ -112,27 +153,62 @@ sap.ui.define([
112
153
  }
113
154
  }
114
155
  },
115
-
116
- renderer: ElementsPanelRenderer,
117
-
156
+ renderer: {
157
+ apiVersion: 2,
158
+ render: function(oRm, oControl) {
159
+ oRm.openStart("div", oControl);
160
+ oRm.class("sapUiSizeCompact");
161
+ const width = oControl.getWidth();
162
+ if (width != null) {
163
+ oRm.style("width", width);
164
+ }
165
+ const height = oControl.getHeight();
166
+ if (height != null) {
167
+ oRm.style("height", height);
168
+ }
169
+ oRm.openEnd();
170
+ oRm.renderControl(oControl.getAggregation("content"));
171
+ oRm.close("div");
172
+ }
173
+ },
118
174
  constructor: function(sId, mSettings) {
119
175
  Control.apply(this, arguments);
120
176
  vkCore.observeAssociations(this);
121
177
  }
122
178
  });
123
179
 
124
- var iconHidden = "sap-icon://hide";
125
- var iconPartial = "sap-icon://hide";
126
- var iconVisible = "sap-icon://show";
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
+ };
127
201
 
128
202
  ElementsPanel.prototype.onSetViewStateManager = function(manager) {
129
203
  this._manager = manager;
204
+ manager.attachSelectionChanged(this._onViewportSelectionChanged, this);
130
205
  manager.attachVisibilityChanged(this._onVisibilityChanged, this);
131
206
  this.refresh();
132
207
  };
133
208
 
134
209
  ElementsPanel.prototype.onUnsetViewStateManager = function(manager) {
135
210
  this._manager = null;
211
+ manager.detachSelectionChanged(this._onViewportSelectionChanged, this);
136
212
  manager.detachVisibilityChanged(this._onVisibilityChanged, this);
137
213
  this.refresh();
138
214
  };
@@ -153,12 +229,11 @@ sap.ui.define([
153
229
  if (Control.prototype.init) {
154
230
  Control.prototype.init.apply(this);
155
231
  }
156
- var that = this;
232
+ const that = this;
157
233
 
158
234
  this._showButton = new Button({
159
235
  enabled: false,
160
- iconFirst: true,
161
- icon: iconVisible,
236
+ icon: IconType.Visible,
162
237
  text: getResourceBundle().getText("ELEMENTS_PANEL_SHOW_BUTTON"),
163
238
  tooltip: getResourceBundle().getText("ELEMENTS_PANEL_SHOW_BUTTON_TOOLTIP"),
164
239
  press: this._onShowElements.bind(this)
@@ -166,50 +241,59 @@ sap.ui.define([
166
241
 
167
242
  this._hideButton = new Button({
168
243
  enabled: false,
169
- iconFirst: true,
170
- icon: iconHidden,
244
+ icon: IconType.Hidden,
171
245
  text: getResourceBundle().getText("ELEMENTS_PANEL_HIDE_BUTTON"),
172
246
  tooltip: getResourceBundle().getText("ELEMENTS_PANEL_HIDE_BUTTON_TOOLTIP"),
173
247
  press: this._onHideElements.bind(this)
174
248
  });
175
249
 
176
250
  this._settingsButton = new Button({
177
- icon: "sap-icon://settings",
251
+ icon: "sap-icon://action-settings",
178
252
  tooltip: getResourceBundle().getText("ELEMENTS_PANEL_SETTINGS_BUTTON_TOOLTIP"),
179
253
  press: this._onSettings.bind(this)
180
254
  });
181
255
 
182
256
  this._table = new Table({
183
257
  mode: "MultiSelect",
258
+ fixedLayout: "Strict",
259
+ autoPopinMode: true,
260
+ popinLayout: "GridSmall",
261
+ includeItemInSelection: true,
262
+ noDataText: getResourceBundle().getText("ELEMENTS_PANEL_NO_DATA"),
184
263
  sticky: [Sticky.HeaderToolbar, Sticky.ColumnHeaders],
185
- selectionChange: this._onSelectionChanged.bind(this),
264
+ selectionChange: this._onTableSelectionChanged.bind(this),
186
265
  headerToolbar: new OverflowToolbar({
187
266
  content: [
267
+ new ToolbarSpacer(),
188
268
  this._showButton,
189
269
  this._hideButton,
190
- new ToolbarSpacer(),
191
270
  this._settingsButton
192
271
  ]
193
272
  }),
273
+ dependents: [
274
+ new ColumnResizer({
275
+ columnResize: that._onColumnResize.bind(this)
276
+ })
277
+ ],
194
278
  columns: [
195
279
  new Column({
196
280
  hAlign: Library.TextAlign.Begin,
197
- header: new Text({ text: getResourceBundle().getText("ELEMENTS_PANEL_NAME_COLUMN") })
281
+ header: new Label({ text: getResourceBundle().getText("ELEMENTS_PANEL_NAME_COLUMN") })
198
282
 
199
283
  }),
200
284
  new Column({
201
285
  hAlign: Library.TextAlign.Begin,
202
- header: new Text({ text: getResourceBundle().getText("ELEMENTS_PANEL_TYPE_COLUMN") })
286
+ header: new Label({ text: getResourceBundle().getText("ELEMENTS_PANEL_TYPE_COLUMN") })
203
287
  }),
204
288
  new Column({
205
289
  hAlign: Library.TextAlign.Begin,
206
- header: new Text({
290
+ header: new Label({
207
291
  text: getResourceBundle().getText("ELEMENTS_PANEL_DEVICE_REFERENCE_COLUMN")
208
292
  })
209
293
  }),
210
294
  new Column({
211
295
  hAlign: Library.TextAlign.Center,
212
- header: new Text({ text: getResourceBundle().getText("ELEMENTS_PANEL_VISIBLE_COLUMN") })
296
+ header: new Label({ text: getResourceBundle().getText("ELEMENTS_PANEL_VISIBLE_COLUMN") })
213
297
  })
214
298
  ],
215
299
  items: {
@@ -217,49 +301,52 @@ sap.ui.define([
217
301
  template: new ColumnListItem({
218
302
  vAlign: "Middle",
219
303
  cells: [
220
- new Text({
304
+ new Label({
221
305
  text: "{refdes}"
222
306
  }),
223
- new Text({
307
+ new Label({
224
308
  text: {
225
309
  path: "",
226
310
  formatter: function(element) {
227
- if (element.type === "2") {
228
- return getResourceBundle().getText("ELEMENTS_PANEL_TYPE_COMPONENT");
229
- } else if (element.type === "4") {
230
- return getResourceBundle().getText("ELEMENTS_PANEL_TYPE_NET");
231
- } else {
232
- return getResourceBundle().getText("ELEMENTS_PANEL_TYPE_UNKNOWN");
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");
233
318
  }
234
319
  }
235
320
  }
236
321
  }),
237
- new Text({
322
+ new Label({
238
323
  text: "{deviceref}"
239
324
  }),
240
325
  new Icon({
241
326
  src: {
242
327
  path: "",
243
328
  formatter: function(element) {
244
- var type = that._getVisibility(element);
245
- if (type === VisibilityType.Hidden) {
246
- return iconHidden;
247
- } else if (type === VisibilityType.Partial) {
248
- return iconPartial;
329
+ switch (that._getVisibility(element)) {
330
+ case VisibilityType.Hidden:
331
+ return IconType.Hidden;
332
+ case VisibilityType.Partial:
333
+ return IconType.Partial;
334
+ default:
335
+ return IconType.Visible;
249
336
  }
250
- return iconVisible;
251
337
  }
252
338
  },
253
339
  tooltip: {
254
340
  path: "",
255
341
  formatter: function(element) {
256
- var type = that._getVisibility(element);
257
- if (type === VisibilityType.Hidden) {
258
- return getResourceBundle().getText("ELEMENTS_PANEL_VISIBLE_COLUMN_HIDDEN_TOOLTIP");
259
- } else if (type === VisibilityType.Partial) {
260
- return getResourceBundle().getText("ELEMENTS_PANEL_VISIBLE_COLUMN_PARTIAL_TOOLTIP");
342
+ switch (that._getVisibility(element)) {
343
+ case VisibilityType.Hidden:
344
+ return getResourceBundle().getText("ELEMENTS_PANEL_VISIBLE_COLUMN_HIDDEN_TOOLTIP");
345
+ case VisibilityType.Partial:
346
+ return getResourceBundle().getText("ELEMENTS_PANEL_VISIBLE_COLUMN_PARTIAL_TOOLTIP");
347
+ default:
348
+ return getResourceBundle().getText("ELEMENTS_PANEL_VISIBLE_COLUMN_VISIBLE_TOOLTIP");
261
349
  }
262
- return getResourceBundle().getText("ELEMENTS_PANEL_VISIBLE_COLUMN_VISIBLE_TOOLTIP");
263
350
  }
264
351
  }
265
352
  })
@@ -268,54 +355,245 @@ sap.ui.define([
268
355
  }
269
356
  });
270
357
 
271
- this._scrollContainer = new ScrollContainer({
272
- vertical: true,
273
- horizontal: false,
274
- height: "100%",
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");
398
+ }
399
+ }
400
+ }
401
+ })
402
+ }
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
+ });
417
+
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
+ }),
275
433
  content: this._table
276
434
  });
277
435
 
278
- this.setAggregation("content", this._scrollContainer);
436
+ this.setAggregation("content", this._page);
437
+
438
+ this._p13nEngine = Engine.getInstance();
439
+
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
+ ]);
458
+
459
+ const filterSummaryData = {
460
+ expandedFilterSummary: "",
461
+ snappedFilterSummary: ""
462
+ };
463
+
464
+ const elementTypeData = [ElementType.Component, ElementType.Net];
279
465
 
280
466
  this._scene = null;
281
467
  this._model = new JSONModel();
282
- this._model.setSizeLimit(100000);
283
468
  this._table.setModel(this._model);
469
+ this._skipEvent = false;
470
+ this._filterSummaryModel = new JSONModel(filterSummaryData);
471
+ this._elementTypeModel = new JSONModel(elementTypeData);
472
+
473
+ this.setModel(this._filterSummaryModel, ModelName.FilterSummary);
474
+ this.setModel(this._elementTypeModel, ModelName.ElementType);
475
+
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
+ }
496
+ });
497
+
498
+ this._filterBar.registerGetFiltersWithValues(this._getFiltersWithValues.bind(this));
499
+
500
+ this._onAssignedFiltersChanged();
501
+ this._updateFilterBarToolbarText();
502
+ };
503
+
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;
510
+
511
+ this._model.destroy();
512
+ this._model = null;
513
+ this._elementTypeModel.destroy();
514
+ this._elementTypeModel = null;
515
+ this._filterSummaryModel.destroy();
516
+ this._filterSummaryModel = null;
517
+
518
+ Control.prototype.exit?.apply(this);
519
+ };
520
+
521
+ ElementsPanel.prototype.getControl = function() {
522
+ return this._page;
284
523
  };
285
524
 
286
525
  ElementsPanel.prototype.refresh = function() {
287
- if (!this._scene || !this._manager || !this._manager.getNodeHierarchy()) {
288
- this._model.setData([]);
526
+ if (!this._scene || !this._manager) {
527
+ // This method may be called indirectly from the exit method after _model is destroyed
528
+ this._model?.setData([]);
289
529
  return;
290
530
  }
291
531
  // scan the tree and collect elements info
292
- var elements = new Map();
293
- this._scanTree(elements, this._manager.getNodeHierarchy().getSceneRef());
294
-
295
- this._model.setData(elements.values().toArray());
532
+ const elements = new Map();
533
+ this._scanTree(elements, this._scene.getRootElement());
534
+ const data = elements.values().toArray();
535
+ this._model.setSizeLimit(data.length);
536
+ this._model.setData(data);
296
537
  this._table.setModel(this._model);
538
+
297
539
  this.fireContentChanged();
298
540
  };
299
541
 
300
- ElementsPanel.prototype.onBeforeRendering = function() {
301
- this._table.setVisible(true);
302
- if (!this._resizeListenerId) {
303
- this._resizeListenerId = ResizeHandler.register(this, this._handleResize.bind(this));
304
- }
542
+ ElementsPanel.prototype._registerTableForP13n = function() {
543
+
544
+ this._p13nEngine.register(this._table, {
545
+ helper: this._metadataHelper,
546
+ controller: {
547
+ columnStates: new SelectionController({
548
+ control: this._table,
549
+ targetAggregation: "columns"
550
+ }),
551
+ columnWidthStates: new ColumnWidthController({
552
+ control: this._table
553
+ }),
554
+ sortStates: new SortController({
555
+ control: this._table
556
+ }),
557
+ groupStates: new GroupController({
558
+ control: this._table
559
+ })
560
+ }
561
+ });
562
+
563
+ this._p13nEngine.attachStateChange(this._onTableStateChange.bind(this));
564
+
565
+ // Set up default column visibility and sorting for the task table.
566
+ const state = {
567
+ columnStates: this._metadataHelper.getProperties().map(({ key }) => ({ key })),
568
+ sortStates: [{ key: ColumnName.RefDes, descending: true }]
569
+ };
570
+
571
+ this._p13nEngine.applyState(this._table, state);
572
+ };
573
+
574
+ // Open settings dialog for personalization
575
+ ElementsPanel.prototype._openSettingsDialog = function(panels) {
576
+ this._p13nEngine.show(this._table, panels, { source: this._table });
305
577
  };
306
578
 
307
579
  ElementsPanel.prototype._setScene = function(scene) {
308
- this._scene = scene;
580
+ this._scene = scene?.isECADScene() ? scene : null;
309
581
  this.refresh();
310
582
  };
311
583
 
312
584
  ElementsPanel.prototype._getVisibility = function(element) {
313
- return VisibilityType.Visible;
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;
314
591
  };
315
592
 
316
- ElementsPanel.prototype._extractMetadata = function(metadata) {
593
+ ElementsPanel.prototype._extractMetadata = function(nodeRef) {
594
+ const metadata = nodeRef?.userData?.metadata ?? {};
317
595
  if (metadata.length != undefined) {
318
- var map = new Map();
596
+ const map = new Map();
319
597
  metadata.forEach(function(entry) {
320
598
  if (entry.category === "ecad") {
321
599
  map.set(entry.tag, entry.value);
@@ -326,10 +604,10 @@ sap.ui.define([
326
604
  return null;
327
605
  };
328
606
 
329
- ElementsPanel.prototype._addElement = function(elements, metadata, nodeRef, nodeVisibility) {
330
- var type = metadata.get("type");
331
- var refdes = metadata.get("refdes");
332
- var deviceref = metadata.get("deviceref");
607
+ ElementsPanel.prototype._addElement = function(elements, nodeRef, metadata) {
608
+ const type = metadata.get("type");
609
+ const refdes = metadata.get("refdes");
610
+ const deviceref = metadata.get("deviceref");
333
611
 
334
612
  var element = elements.get(refdes);
335
613
  if (!element) {
@@ -337,43 +615,91 @@ sap.ui.define([
337
615
  refdes: refdes,
338
616
  type: type,
339
617
  deviceref: deviceref,
340
- elements: new Map(),
341
- hiddenElements: 0
618
+ parts: new Map(),
619
+ hiddenParts: new Set()
342
620
  };
343
621
  elements.set(refdes, element);
344
622
  }
345
623
 
346
- if (nodeVisibility == false) {
347
- // layer.hiddenElements++;
624
+ switch (type) {
625
+ case ElementType.Component:
626
+ element.parts.set(nodeRef.uid, nodeRef);
627
+ if (this._manager.getVisibilityState(nodeRef) === false) {
628
+ element.hiddenParts.add(nodeRef.uid);
629
+ }
630
+ break;
631
+ case ElementType.Net:
632
+ nodeRef.children.forEach(function(child) {
633
+ element.parts.set(child.uid, child);
634
+ if (this._manager.getVisibilityState(child) === false) {
635
+ element.hiddenParts.add(child.uid);
636
+ }
637
+ }, this);
638
+ break;
639
+ default:
640
+ break;
348
641
  }
349
- element.elements.set(nodeRef.uid, nodeRef);
350
642
  };
351
643
 
352
644
  ElementsPanel.prototype._scanTree = function(elements, nodeRef) {
353
- var hierarchy = this._manager.getNodeHierarchy();
354
- var node = hierarchy.createNodeProxy(nodeRef);
355
- var metadata = this._extractMetadata(node.getNodeMetadata());
356
- hierarchy.destroyNodeProxy(node);
357
-
645
+ const metadata = this._extractMetadata(nodeRef);
358
646
  if (metadata) {
359
- var name = metadata.get("refdes");
647
+ const name = metadata.get("refdes");
360
648
  if (name) {
361
- this._addElement(elements, metadata, nodeRef, this._manager.getVisibilityState(nodeRef));
649
+ this._addElement(elements, nodeRef, metadata);
362
650
  return; // don't go further down the hierarchy
363
651
  }
364
652
  }
653
+ nodeRef.children.forEach((child) => this._scanTree(elements, child));
654
+ };
365
655
 
366
- hierarchy.getChildren(nodeRef).forEach(function(ref) {
367
- this._scanTree(elements, ref);
656
+ ElementsPanel.prototype._onTableSelectionChanged = function(event) {
657
+ const items = event.getParameter("listItems");
658
+ const selected = event.getParameter("selected");
659
+ const output = [];
660
+
661
+ items.forEach(function(item) {
662
+ const element = item.getBindingContext().getObject();
663
+ switch (element.type) {
664
+ case ElementType.Component:
665
+ output.push(element.parts.values().toArray()[0]);
666
+ break;
667
+ case ElementType.Net:
668
+ output.push(element.parts.values().toArray()[0].parent);
669
+ break;
670
+ default:
671
+ break;
672
+ }
368
673
  }, this);
369
- };
370
674
 
371
- ElementsPanel.prototype._onSelectionChanged = function(event) {
675
+ this._manager.setSelectionState(output, selected, true, true);
372
676
  this._updateButtons();
373
677
  };
374
678
 
375
- ElementsPanel.prototype._onVisibilityChanged = function(event) {
376
- //
679
+ ElementsPanel.prototype._onViewportSelectionChanged = function(event) {
680
+ const items = this._table.getItems();
681
+ const selected = event.getParameter("selected");
682
+ const unselected = event.getParameter("unselected");
683
+
684
+ const process = (list, item, select) => {
685
+ const element = item.getBindingContext().getObject();
686
+
687
+ list.forEach(function(nodeRef) {
688
+ const metadata = this._extractMetadata(nodeRef);
689
+ const refdes = metadata?.get("refdes");
690
+
691
+ if (refdes === element.refdes) {
692
+ this._table.setSelectedItem(item, select, false);
693
+ }
694
+ }, this);
695
+ };
696
+
697
+ items.forEach(function(item) {
698
+ process(selected, item, true);
699
+ process(unselected, item, false);
700
+ }, this);
701
+
702
+ this._updateButtons();
377
703
  };
378
704
 
379
705
  ElementsPanel.prototype._handleResize = function(event) {
@@ -383,9 +709,9 @@ sap.ui.define([
383
709
  ElementsPanel.prototype._setContent = function(content) {
384
710
  // If there is no explicitly assigned view state manager then use the content connector's default one.
385
711
  if (content && !this.getViewStateManager()) {
386
- var connector = Element.getElementById(this.getContentConnector());
712
+ const connector = Element.getElementById(this.getContentConnector());
387
713
  if (connector) {
388
- var defaultManager = connector.getDefaultViewStateManager();
714
+ const defaultManager = connector.getDefaultViewStateManager();
389
715
  if (defaultManager) {
390
716
  this.setViewStateManager(defaultManager);
391
717
  }
@@ -400,16 +726,18 @@ sap.ui.define([
400
726
  };
401
727
 
402
728
  ElementsPanel.prototype._onContentChangesFinished = function(event) {
403
- this.refresh();
729
+ // causes second rebuild of everything ?
730
+ // this.refresh();
404
731
  };
405
732
 
406
733
  ElementsPanel.prototype._updateButtons = function() {
407
- var canShow = false, canHide = false;
408
- var selected = this._table.getSelectedItems();
734
+ let canHide = false;
735
+ let canShow = false;
736
+ const selected = this._table.getSelectedItems();
409
737
 
410
738
  selected.forEach(function(item) {
411
- var element = item.getBindingContext().getObject();
412
- var visibility = this._getVisibility(element);
739
+ const element = item.getBindingContext().getObject();
740
+ const visibility = this._getVisibility(element);
413
741
 
414
742
  if (visibility === VisibilityType.Visible) {
415
743
  canHide = true;
@@ -426,43 +754,210 @@ sap.ui.define([
426
754
  };
427
755
 
428
756
  ElementsPanel.prototype._onShowElements = function() {
429
- var toShow = [];
430
- var selected = this._table.getSelectedItems();
757
+ const toShow = [];
758
+ const selected = this._table.getSelectedItems();
431
759
 
432
760
  selected.forEach(function(item) {
433
- var layer = item.getBindingContext().getObject();
434
- if (layer.hiddenElements !== 0) {
435
- layer.hiddenElements = 0;
436
- layer.elements.forEach(function(nodeRef) {
437
- toShow.push(nodeRef);
438
- });
761
+ const element = item.getBindingContext().getObject();
762
+
763
+ if (element.hiddenParts.size > 0) {
764
+ const ref = element.parts.values().toArray()[0];
765
+ element.hiddenParts.clear();
766
+
767
+ if (element.type === ElementType.Component) {
768
+ toShow.push(ref);
769
+ } else if (element.type === ElementType.Net) {
770
+ toShow.push(ref.parent);
771
+ }
439
772
  }
440
- });
773
+ }, this);
774
+
775
+ this._skipEvent = true;
441
776
  this._manager.setVisibilityState(toShow, true, true, true);
442
777
  this._model.updateBindings(true);
443
778
  this._updateButtons();
444
779
  };
445
780
 
446
781
  ElementsPanel.prototype._onHideElements = function() {
447
- var toHide = [];
448
- var selected = this._table.getSelectedItems();
782
+ const toHide = [];
783
+ const selected = this._table.getSelectedItems();
449
784
 
450
785
  selected.forEach(function(item) {
451
- var layer = item.getBindingContext().getObject();
452
- if (layer.hiddenElements !== layer.elements.size) {
453
- layer.hiddenElements = layer.elements.size;
454
- layer.elements.forEach(function(nodeRef) {
455
- toHide.push(nodeRef);
456
- });
786
+ const element = item.getBindingContext().getObject();
787
+
788
+ if (element.hiddenParts.size < element.parts.size) {
789
+ const ref = element.parts.values().toArray()[0];
790
+ element.parts.forEach(part => element.hiddenParts.add(part.uid));
791
+
792
+ if (element.type === ElementType.Component) {
793
+ toHide.push(ref);
794
+ } else if (element.type === ElementType.Net) {
795
+ toHide.push(ref.parent);
796
+ }
457
797
  }
458
- });
798
+ }, this);
799
+
800
+ this._skipEvent = true;
459
801
  this._manager.setVisibilityState(toHide, false, true, true);
460
802
  this._model.updateBindings(true);
461
803
  this._updateButtons();
462
804
  };
463
805
 
806
+ ElementsPanel.prototype._onVisibilityChanged = function(event) {
807
+ if (this._skipEvent) {
808
+ this._skipEvent = false;
809
+ return;
810
+ }
811
+ const hidden = event.getParameter("hidden");
812
+ const visible = event.getParameter("visible");
813
+
814
+ const process = (list, element, show) => {
815
+ list.forEach(function(ref) {
816
+ const metadata = this._extractMetadata(ref);
817
+ const refdes = metadata?.get("refdes");
818
+
819
+ if (refdes === element.refdes) {
820
+ switch (metadata.get("type")) {
821
+ case ElementType.Component:
822
+ if (show) {
823
+ element.hiddenParts.delete(ref.uid);
824
+ } else {
825
+ element.hiddenParts.add(ref.uid);
826
+ }
827
+ break;
828
+ case ElementType.Net:
829
+ if (show) {
830
+ // element.hiddenParts.delete(ref.uid);
831
+ ref.children.forEach((child) => element.hiddenParts.delete(child.uid));
832
+ } else {
833
+ // element.hiddenParts.add(ref.uid);
834
+ ref.children.forEach((child) => element.hiddenParts.add(child.uid));
835
+ }
836
+ break;
837
+ default:
838
+ break;
839
+ }
840
+ } else {
841
+ const layer = metadata?.get("layer");
842
+ if (layer) {
843
+ if (element.parts.has(ref.uid)) {
844
+ if (show) {
845
+ element.hiddenParts.delete(ref.uid);
846
+ } else {
847
+ element.hiddenParts.add(ref.uid);
848
+ }
849
+ }
850
+ }
851
+ }
852
+ }, this);
853
+ };
854
+
855
+ this._model.getData().forEach(function(element) {
856
+ process(hidden, element, false);
857
+ process(visible, element, true);
858
+ }, this);
859
+
860
+ this._model.updateBindings(true);
861
+ this._updateButtons();
862
+ };
863
+
464
864
  ElementsPanel.prototype._onSettings = function() {
465
- //
865
+ this._openSettingsDialog(["columnStates", "sortStates", "groupStates"]);
866
+ };
867
+
868
+ // Go button on the filter bar
869
+ ElementsPanel.prototype._onSearch = function() {
870
+ this._table.setShowOverlay(true);
871
+
872
+ const filters = this._getFiltersWithValues().reduce((result, filterGroupItem) => {
873
+ var control = filterGroupItem.getControl();
874
+ const filterName = filterGroupItem.getName();
875
+ var filters = [];
876
+
877
+ switch (filterName) {
878
+ case ColumnName.RefDes:
879
+ case ColumnName.Device:
880
+ const value = control.getValue();
881
+ filters.push(new Filter({
882
+ path: filterGroupItem.getName(),
883
+ operator: FilterOperator.Contains,
884
+ value1: value
885
+ }));
886
+ break;
887
+ case ColumnName.Type:
888
+ const selected = control.getSelectedKeys();
889
+ selected.forEach(key => filters.push(new Filter({
890
+ path: filterGroupItem.getName(),
891
+ operator: FilterOperator.Contains,
892
+ value1: key
893
+ })));
894
+ break;
895
+ default:
896
+ break;
897
+ }
898
+
899
+ if (filters.length > 0) {
900
+ result.push(new Filter({
901
+ filters: filters,
902
+ and: false
903
+ }));
904
+ }
905
+ return result;
906
+ }, []);
907
+
908
+ this._table.getBinding("items").filter(filters);
909
+ this._table.setShowOverlay(false);
910
+ };
911
+
912
+ ElementsPanel.prototype._onFilterChange = function() {
913
+ this._table.setShowOverlay(true);
914
+ };
915
+
916
+ ElementsPanel.prototype._onAssignedFiltersChanged = function() {
917
+ this._filterSummaryModel.setProperty("/snappedFilterSummary", this._filterBar.retrieveFiltersWithValuesAsText());
918
+ this._filterSummaryModel.setProperty("/expandedFilterSummary", this._filterBar.retrieveFiltersWithValuesAsTextExpanded());
919
+ };
920
+
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
+ // Returns the filter items with non-empty values from the filter bar.
940
+ ElementsPanel.prototype._getFiltersWithValues = function() {
941
+ return this._filterBar
942
+ .getFilterGroupItems()
943
+ .filter((filterGroupItem) => {
944
+ const control = filterGroupItem.getControl();
945
+
946
+ if (control instanceof MultiComboBox) {
947
+ return control.getSelectedItems().length > 0;
948
+ } else if (control instanceof Input) {
949
+ return control.getValue().length > 0;
950
+ } else {
951
+ return false;
952
+ }
953
+ });
954
+ };
955
+
956
+ // Currently there is no way to programmatically update
957
+ // text next to Go button, it's a FilterBar bug,
958
+ // so check for private function and call it
959
+ ElementsPanel.prototype._updateFilterBarToolbarText = function() {
960
+ this._filterBar._updateToolbarText?.();
466
961
  };
467
962
 
468
963
  return ElementsPanel;