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