@sapui5/sap.ui.vk 1.136.1 → 1.136.3

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 (185) hide show
  1. package/package.json +1 -1
  2. package/src/sap/ui/vk/.library +1 -1
  3. package/src/sap/ui/vk/AnimationPlayback.js +1 -1
  4. package/src/sap/ui/vk/AnimationPlayer.js +1 -1
  5. package/src/sap/ui/vk/AnimationSequence.js +1 -1
  6. package/src/sap/ui/vk/AnimationTimeSlider.js +1 -1
  7. package/src/sap/ui/vk/AnimationTrack.js +1 -1
  8. package/src/sap/ui/vk/Annotation.js +1 -1
  9. package/src/sap/ui/vk/BaseNodeProxy.js +1 -1
  10. package/src/sap/ui/vk/Camera.js +1 -1
  11. package/src/sap/ui/vk/ContentConnector.js +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/Core.js +1 -1
  15. package/src/sap/ui/vk/DownloadManager.js +1 -1
  16. package/src/sap/ui/vk/DrawerToolbar.js +140 -19
  17. package/src/sap/ui/vk/DrawerToolbarButton.js +5 -1
  18. package/src/sap/ui/vk/DvlException.js +1 -1
  19. package/src/sap/ui/vk/FlexibleControl.js +1 -1
  20. package/src/sap/ui/vk/FlexibleControlLayoutData.js +1 -1
  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/Loco.js +1 -1
  26. package/src/sap/ui/vk/Material.js +1 -1
  27. package/src/sap/ui/vk/NativeViewport.js +1 -1
  28. package/src/sap/ui/vk/NodeHierarchy.js +1 -1
  29. package/src/sap/ui/vk/NodeProxy.js +1 -1
  30. package/src/sap/ui/vk/NodeUtils.js +1 -1
  31. package/src/sap/ui/vk/Notifications.js +1 -1
  32. package/src/sap/ui/vk/OrthographicCamera.js +1 -1
  33. package/src/sap/ui/vk/PerspectiveCamera.js +1 -1
  34. package/src/sap/ui/vk/ProgressIndicator.js +1 -1
  35. package/src/sap/ui/vk/RedlineCollaboration.js +1 -1
  36. package/src/sap/ui/vk/RedlineConversation.js +1 -1
  37. package/src/sap/ui/vk/RedlineDesign.js +1 -1
  38. package/src/sap/ui/vk/RedlineElement.js +1 -1
  39. package/src/sap/ui/vk/RedlineElementComment.js +1 -1
  40. package/src/sap/ui/vk/RedlineElementEllipse.js +1 -1
  41. package/src/sap/ui/vk/RedlineElementFreehand.js +1 -1
  42. package/src/sap/ui/vk/RedlineElementLine.js +1 -1
  43. package/src/sap/ui/vk/RedlineElementRectangle.js +1 -1
  44. package/src/sap/ui/vk/RedlineElementText.js +1 -1
  45. package/src/sap/ui/vk/RedlineSurface.js +1 -1
  46. package/src/sap/ui/vk/SafeArea.js +1 -1
  47. package/src/sap/ui/vk/Scene.js +16 -1
  48. package/src/sap/ui/vk/SceneTree.js +3 -4
  49. package/src/sap/ui/vk/StepNavigation.js +1 -2
  50. package/src/sap/ui/vk/Texture.js +1 -1
  51. package/src/sap/ui/vk/ToggleMenuButton.js +1 -1
  52. package/src/sap/ui/vk/ToggleMenuItem.js +1 -1
  53. package/src/sap/ui/vk/Toolbar.js +68 -102
  54. package/src/sap/ui/vk/View.js +1 -1
  55. package/src/sap/ui/vk/ViewGallery.js +1 -1
  56. package/src/sap/ui/vk/ViewGalleryThumbnail.js +1 -1
  57. package/src/sap/ui/vk/ViewGroup.js +1 -1
  58. package/src/sap/ui/vk/ViewManager.js +1 -1
  59. package/src/sap/ui/vk/ViewStateManager.js +1 -1
  60. package/src/sap/ui/vk/ViewStateManagerBase.js +1 -1
  61. package/src/sap/ui/vk/Viewer.js +469 -234
  62. package/src/sap/ui/vk/Viewport.js +1 -1
  63. package/src/sap/ui/vk/ViewportBase.js +1 -1
  64. package/src/sap/ui/vk/dvl/BaseNodeProxy.js +1 -1
  65. package/src/sap/ui/vk/dvl/ContentManager.js +1 -1
  66. package/src/sap/ui/vk/dvl/GraphicsCore.js +1 -1
  67. package/src/sap/ui/vk/dvl/LayerProxy.js +1 -1
  68. package/src/sap/ui/vk/dvl/NodeHierarchy.js +1 -1
  69. package/src/sap/ui/vk/dvl/NodeProxy.js +1 -1
  70. package/src/sap/ui/vk/dvl/Scene.js +1 -1
  71. package/src/sap/ui/vk/dvl/ViewStateManager.js +1 -1
  72. package/src/sap/ui/vk/dvl/Viewport.js +2 -2
  73. package/src/sap/ui/vk/ecad/ElementsPanel.js +984 -212
  74. package/src/sap/ui/vk/ecad/LayersPanel.js +283 -145
  75. package/src/sap/ui/vk/i18n/messagebundle.properties +64 -37
  76. package/src/sap/ui/vk/i18n/messagebundle_id.properties +1 -1
  77. package/src/sap/ui/vk/i18n/messagebundle_iw.properties +1 -1
  78. package/src/sap/ui/vk/i18n/messagebundle_ja.properties +2 -2
  79. package/src/sap/ui/vk/i18n/messagebundle_no.properties +1 -1
  80. package/src/sap/ui/vk/i18n/messagebundle_vi.properties +1 -1
  81. package/src/sap/ui/vk/library.js +11 -4
  82. package/src/sap/ui/vk/measurements/Angle.js +1 -1
  83. package/src/sap/ui/vk/measurements/Area.js +1 -1
  84. package/src/sap/ui/vk/measurements/Distance.js +1 -1
  85. package/src/sap/ui/vk/measurements/Edge.js +1 -1
  86. package/src/sap/ui/vk/measurements/Face.js +1 -1
  87. package/src/sap/ui/vk/measurements/Feature.js +1 -1
  88. package/src/sap/ui/vk/measurements/Vertex.js +1 -1
  89. package/src/sap/ui/vk/pdf/ContentManager.js +1 -1
  90. package/src/sap/ui/vk/pdf/Viewport.js +5 -8
  91. package/src/sap/ui/vk/svg/BaseNodeProxy.js +1 -1
  92. package/src/sap/ui/vk/svg/ContentDeliveryService.js +1 -1
  93. package/src/sap/ui/vk/svg/ContentManager.js +3 -1
  94. package/src/sap/ui/vk/svg/Element.js +1 -0
  95. package/src/sap/ui/vk/svg/NodeHierarchy.js +1 -1
  96. package/src/sap/ui/vk/svg/NodeProxy.js +1 -1
  97. package/src/sap/ui/vk/svg/OrthographicCamera.js +1 -1
  98. package/src/sap/ui/vk/svg/Scene.js +1 -1
  99. package/src/sap/ui/vk/svg/SceneBuilder.js +44 -8
  100. package/src/sap/ui/vk/svg/ViewStateManager.js +2 -2
  101. package/src/sap/ui/vk/svg/Viewport.js +192 -2
  102. package/src/sap/ui/vk/themes/base/fonts/SAP-VE-icons-bold-v1.8.woff2 +0 -0
  103. package/src/sap/ui/vk/themes/base/fonts/SAP-VE-icons-regular-v1.8.woff2 +0 -0
  104. package/src/sap/ui/vk/themes/base/library.source.less +1 -1
  105. package/src/sap/ui/vk/themes/sap_belize_base/library.source.less +1 -1
  106. package/src/sap/ui/vk/themes/sap_bluecrystal_base/library.source.less +1 -1
  107. package/src/sap/ui/vk/themes/sap_hcb/library.source.less +1 -1
  108. package/src/sap/ui/vk/themes/sap_horizon/library.source.less +0 -5
  109. package/src/sap/ui/vk/themes/sap_horizon_dark/library.source.less +0 -5
  110. package/src/sap/ui/vk/themes/sap_horizon_hcb/library.source.less +0 -5
  111. package/src/sap/ui/vk/themes/sap_horizon_hcw/library.source.less +0 -5
  112. package/src/sap/ui/vk/thirdparty/pdf.worker.js +1 -1
  113. package/src/sap/ui/vk/threejs/AnimationHelper.js +1 -1
  114. package/src/sap/ui/vk/threejs/BaseNodeProxy.js +1 -1
  115. package/src/sap/ui/vk/threejs/Billboard.js +1 -1
  116. package/src/sap/ui/vk/threejs/Callout.js +1 -1
  117. package/src/sap/ui/vk/threejs/ContentDeliveryService.js +1 -1
  118. package/src/sap/ui/vk/threejs/ContentManager.js +1 -1
  119. package/src/sap/ui/vk/threejs/DetailView.js +1 -1
  120. package/src/sap/ui/vk/threejs/HighlightPlayer.js +1 -1
  121. package/src/sap/ui/vk/threejs/Material.js +1 -1
  122. package/src/sap/ui/vk/threejs/NodeHierarchy.js +1 -1
  123. package/src/sap/ui/vk/threejs/NodeProxy.js +1 -1
  124. package/src/sap/ui/vk/threejs/OrthographicCamera.js +1 -1
  125. package/src/sap/ui/vk/threejs/PerspectiveCamera.js +1 -1
  126. package/src/sap/ui/vk/threejs/PointCloudGroup.js +1 -1
  127. package/src/sap/ui/vk/threejs/Scene.js +1 -1
  128. package/src/sap/ui/vk/threejs/SceneBuilder.js +12 -1
  129. package/src/sap/ui/vk/threejs/Texture.js +1 -1
  130. package/src/sap/ui/vk/threejs/Thrustline.js +1 -1
  131. package/src/sap/ui/vk/threejs/ViewStateManager.js +1 -1
  132. package/src/sap/ui/vk/threejs/Viewport.js +1 -1
  133. package/src/sap/ui/vk/threejs/v2/ViewStateManager.js +1 -1
  134. package/src/sap/ui/vk/tools/AnchorPointTool.js +1 -1
  135. package/src/sap/ui/vk/tools/AnchorPointToolGizmo.js +1 -1
  136. package/src/sap/ui/vk/tools/AxisAngleRotationTool.js +1 -1
  137. package/src/sap/ui/vk/tools/AxisAngleRotationToolGizmo.js +1 -1
  138. package/src/sap/ui/vk/tools/CreateEllipseTool.js +1 -1
  139. package/src/sap/ui/vk/tools/CreateEllipseToolGizmo.js +1 -1
  140. package/src/sap/ui/vk/tools/CreateParametricGizmo.js +1 -1
  141. package/src/sap/ui/vk/tools/CreatePathTool.js +1 -1
  142. package/src/sap/ui/vk/tools/CreatePathToolGizmo.js +1 -1
  143. package/src/sap/ui/vk/tools/CreateRectangleTool.js +1 -1
  144. package/src/sap/ui/vk/tools/CreateRectangleToolGizmo.js +1 -1
  145. package/src/sap/ui/vk/tools/CreateTextTool.js +1 -1
  146. package/src/sap/ui/vk/tools/CreateTextToolGizmo.js +1 -1
  147. package/src/sap/ui/vk/tools/CrossSectionTool.js +1 -1
  148. package/src/sap/ui/vk/tools/CrossSectionToolGizmo.js +1 -1
  149. package/src/sap/ui/vk/tools/DuplicateSvgElementTool.js +1 -1
  150. package/src/sap/ui/vk/tools/DuplicateSvgElementToolGizmo.js +1 -1
  151. package/src/sap/ui/vk/tools/ExplodeTool.js +1 -1
  152. package/src/sap/ui/vk/tools/ExplodeToolGizmo.js +1 -1
  153. package/src/sap/ui/vk/tools/Gizmo.js +1 -1
  154. package/src/sap/ui/vk/tools/HitTestTool.js +1 -1
  155. package/src/sap/ui/vk/tools/MoveTool.js +1 -1
  156. package/src/sap/ui/vk/tools/MoveToolGizmo.js +1 -1
  157. package/src/sap/ui/vk/tools/PointCloudSelectionTool.js +1 -1
  158. package/src/sap/ui/vk/tools/PointCloudSelectionToolGizmo.js +1 -1
  159. package/src/sap/ui/vk/tools/RectSelectTool.js +1 -1
  160. package/src/sap/ui/vk/tools/RedlineTool.js +1 -1
  161. package/src/sap/ui/vk/tools/RedlineToolGizmo.js +1 -1
  162. package/src/sap/ui/vk/tools/RotateOrbitTool.js +1 -1
  163. package/src/sap/ui/vk/tools/RotateTool.js +1 -1
  164. package/src/sap/ui/vk/tools/RotateToolGizmo.js +1 -1
  165. package/src/sap/ui/vk/tools/RotateTurntableTool.js +1 -1
  166. package/src/sap/ui/vk/tools/ScaleTool.js +1 -1
  167. package/src/sap/ui/vk/tools/ScaleToolGizmo.js +1 -1
  168. package/src/sap/ui/vk/tools/SceneOrientationTool.js +1 -1
  169. package/src/sap/ui/vk/tools/SceneOrientationToolGizmo.js +1 -1
  170. package/src/sap/ui/vk/tools/Tool.js +1 -1
  171. package/src/sap/ui/vk/tools/TooltipTool.js +1 -1
  172. package/src/sap/ui/vk/tools/TooltipToolGizmo.js +1 -1
  173. package/src/sap/ui/vk/tools/TooltipToolHandler.js +5 -0
  174. package/src/sap/ui/vk/tools/TransformSvgElementTool.js +1 -1
  175. package/src/sap/ui/vk/tools/TransformSvgElementToolGizmo.js +1 -1
  176. package/src/sap/ui/vk/totara/TotaraLoader.js +4 -0
  177. package/src/sap/ui/vk/ve/dvl.wasm +0 -0
  178. package/src/sap/ui/vk/ve/matai.js +1 -1
  179. package/src/sap/ui/vk/ve/matai.wasm +0 -0
  180. package/src/sap/ui/vk/ToolbarRenderer.js +0 -41
  181. package/src/sap/ui/vk/ViewerRenderer.js +0 -48
  182. package/src/sap/ui/vk/ecad/ElementsPanelRenderer.js +0 -41
  183. package/src/sap/ui/vk/ecad/LayersPanelRenderer.js +0 -41
  184. package/src/sap/ui/vk/themes/base/fonts/SAP-VE-icons-bold-v1.4.woff2 +0 -0
  185. package/src/sap/ui/vk/themes/base/fonts/SAP-VE-icons-regular-v1.4.woff2 +0 -0
@@ -7,58 +7,106 @@
7
7
 
8
8
  // Provides control sap.ui.vk.ecad.LayerPanel
9
9
  sap.ui.define([
10
+ "sap/m/VBox",
10
11
  "sap/m/Button",
11
12
  "sap/m/SearchField",
12
13
  "sap/m/OverflowToolbar",
13
14
  "sap/m/ToolbarLayoutData",
14
15
  "sap/m/ToolbarSpacer",
15
- "sap/m/Text",
16
+ "sap/m/Label",
16
17
  "sap/m/Table",
17
18
  "sap/m/Column",
18
19
  "sap/m/Sticky",
19
20
  "sap/m/ScrollContainer",
20
21
  "sap/m/ColumnListItem",
22
+ "sap/m/IllustratedMessage",
23
+ "sap/m/IllustratedMessageType",
24
+ "sap/m/plugins/ColumnResizer",
21
25
  "sap/ui/core/Core",
22
26
  "sap/ui/core/Control",
23
27
  "sap/ui/core/Element",
24
28
  "sap/ui/core/Icon",
25
29
  "sap/ui/core/library",
26
- "sap/ui/core/ResizeHandler",
27
30
  "sap/ui/model/json/JSONModel",
28
31
  "../Core",
29
32
  "../library",
30
33
  "../ViewStateManager",
31
- "./LayersPanelRenderer",
32
34
  "./VisibilityType",
33
- "../getResourceBundle"
35
+ "../getResourceBundle",
36
+ "sap/m/library"
34
37
  ], function(
38
+ VBox,
35
39
  Button,
36
40
  SearchField,
37
41
  OverflowToolbar,
38
42
  ToolbarLayoutData,
39
43
  ToolbarSpacer,
40
- Text,
44
+ Label,
41
45
  Table,
42
46
  Column,
43
47
  Sticky,
44
48
  ScrollContainer,
45
49
  ColumnListItem,
50
+ IllustratedMessage,
51
+ IllustratedMessageType,
52
+ ColumnResizer,
46
53
  Core,
47
54
  Control,
48
55
  Element,
49
56
  Icon,
50
57
  Library,
51
- ResizeHandler,
52
58
  JSONModel,
53
59
  vkCore,
54
60
  vkLibrary,
55
61
  ViewStateManager,
56
- LayersPanelRenderer,
57
62
  VisibilityType,
58
- getResourceBundle
63
+ getResourceBundle,
64
+ SapMLibrary
59
65
  ) {
60
66
  "use strict";
61
67
 
68
+ const FlexRendertype = SapMLibrary.FlexRendertype;
69
+
70
+ function extractLayersIndex(scene) {
71
+ const index = new Map();
72
+ const metadata = scene.getSceneMetadata();
73
+ const layers = metadata.find((el) => el.category === "ecad" && el.tag === "Layers");
74
+
75
+ if (layers) {
76
+ const list = layers.value.split("|");
77
+ list.forEach(function(name) {
78
+ const idx = metadata.find((el) => el.category === name && el.tag === "Index");
79
+ if (idx) {
80
+ index.set(name, idx.value);
81
+ }
82
+ });
83
+ }
84
+ return index;
85
+ }
86
+
87
+ function getVisibility(layer) {
88
+ if (layer.hiddenElements.size === 0) {
89
+ return VisibilityType.Visible;
90
+ } else if (layer.hiddenElements.size < layer.elements.size) {
91
+ return VisibilityType.Partial;
92
+ }
93
+ return VisibilityType.Hidden;
94
+ }
95
+
96
+ function extractMetadata(nodeRef) {
97
+ const metadata = nodeRef?.userData?.metadata ?? {};
98
+ if (metadata.length) {
99
+ const map = new Map();
100
+ metadata.forEach(function(entry) {
101
+ if (entry.category === "ecad") {
102
+ map.set(entry.tag, entry.value);
103
+ }
104
+ });
105
+ return map;
106
+ }
107
+ return null;
108
+ }
109
+
62
110
  /**
63
111
  * Constructor for a new LayersPanel.
64
112
  *
@@ -69,7 +117,7 @@ sap.ui.define([
69
117
  * @extends sap.ui.core.Control
70
118
  *
71
119
  * @author SAP SE
72
- * @version 1.136.1
120
+ * @version 1.136.3
73
121
  *
74
122
  * @constructor
75
123
  * @public
@@ -80,9 +128,19 @@ sap.ui.define([
80
128
  var LayersPanel = Control.extend("sap.ui.vk.ecad.LayersPanel", /** @lends sap.ui.vk.ecad.LayersPanel.prototype */ {
81
129
  metadata: {
82
130
  library: "sap.ui.vk",
131
+ properties: {
132
+ width: {
133
+ type: "sap.ui.core.CSSSize",
134
+ defaultValue: "auto"
135
+ },
136
+ height: {
137
+ type: "sap.ui.core.CSSSize",
138
+ defaultValue: "100%"
139
+ }
140
+ },
83
141
  aggregations: {
84
142
  content: {
85
- type: "sap.m.ScrollContainer",
143
+ type: "sap.ui.core.Control",
86
144
  multiple: false
87
145
  }
88
146
  },
@@ -112,53 +170,81 @@ sap.ui.define([
112
170
  }
113
171
  }
114
172
  },
115
-
116
- renderer: LayersPanelRenderer,
117
-
173
+ renderer: {
174
+ apiVersion: 2,
175
+ render: function(oRm, oControl) {
176
+ oRm.openStart("div", oControl);
177
+ oRm.class("sapUiSizeCompact");
178
+ const width = oControl.getWidth();
179
+ if (width != null) {
180
+ oRm.style("width", width);
181
+ }
182
+ const height = oControl.getHeight();
183
+ if (height != null) {
184
+ oRm.style("height", height);
185
+ }
186
+ oRm.openEnd();
187
+ oRm.renderControl(oControl.getAggregation("content"));
188
+ oRm.close("div");
189
+ }
190
+ },
118
191
  constructor: function(sId, mSettings) {
119
192
  Control.apply(this, arguments);
120
193
  vkCore.observeAssociations(this);
121
194
  }
122
195
  });
123
196
 
124
- var iconHidden = "sap-icon://status-inactive";
125
- var iconPartial = "sap-icon://rhombus-milestone";
126
- var iconVisible = "sap-icon://rhombus-milestone-2";
197
+ const IconType = {
198
+ Hidden: "sap-icon://status-inactive",
199
+ Partial: "sap-icon://vk-icons/partially-visible-layer",
200
+ Visible: "sap-icon://rhombus-milestone-2"
201
+ };
127
202
 
203
+ const ElementType = {
204
+ Component: "2",
205
+ Net: "4"
206
+ };
128
207
  LayersPanel.prototype.onSetViewStateManager = function(manager) {
129
208
  this._manager = manager;
130
209
  manager.attachVisibilityChanged(this._onVisibilityChanged, this);
131
- this.refresh();
210
+ this._refresh();
132
211
  };
133
212
 
134
213
  LayersPanel.prototype.onUnsetViewStateManager = function(manager) {
135
214
  this._manager = null;
136
215
  manager.detachVisibilityChanged(this._onVisibilityChanged, this);
137
- this.refresh();
216
+ this._refresh();
138
217
  };
139
218
 
140
219
  LayersPanel.prototype.onSetContentConnector = function(connector) {
141
220
  connector.attachContentReplaced(this._onContentReplaced, this);
142
- connector.attachContentChangesFinished(this._onContentChangesFinished, this);
143
221
  this._setContent(connector.getContent());
144
222
  };
145
223
 
146
224
  LayersPanel.prototype.onUnsetContentConnector = function(connector) {
147
225
  this._setContent(null);
148
226
  connector.detachContentReplaced(this._onContentReplaced, this);
149
- connector.detachContentChangesFinished(this._onContentChangesFinished, this);
150
227
  };
151
228
 
152
229
  LayersPanel.prototype.init = function() {
153
230
  if (Control.prototype.init) {
154
231
  Control.prototype.init.apply(this);
155
232
  }
156
- var that = this;
233
+ const that = this;
234
+
235
+ this._searchField = new SearchField({
236
+ layoutData: new ToolbarLayoutData({
237
+ shrinkable: true,
238
+ maxWidth: "400px"
239
+ }),
240
+ search: function(event) {
241
+ that._onSearch.call(that, event.getParameter("query"));
242
+ }
243
+ });
157
244
 
158
245
  this._showButton = new Button({
159
246
  enabled: false,
160
- iconFirst: true,
161
- icon: iconVisible,
247
+ icon: IconType.Visible,
162
248
  text: getResourceBundle().getText("LAYERS_PANEL_SHOW_BUTTON"),
163
249
  tooltip: getResourceBundle().getText("LAYERS_PANEL_SHOW_BUTTON_TOOLTIP"),
164
250
  press: this._onShowLayers.bind(this)
@@ -166,44 +252,40 @@ sap.ui.define([
166
252
 
167
253
  this._hideButton = new Button({
168
254
  enabled: false,
169
- iconFirst: true,
170
- icon: iconHidden,
255
+ icon: IconType.Hidden,
171
256
  text: getResourceBundle().getText("LAYERS_PANEL_HIDE_BUTTON"),
172
257
  tooltip: getResourceBundle().getText("LAYERS_PANEL_HIDE_BUTTON_TOOLTIP"),
173
258
  press: this._onHideLayers.bind(this)
174
259
  });
175
260
 
176
261
  this._table = new Table({
262
+ visible: false,
177
263
  mode: "MultiSelect",
264
+ includeItemInSelection: true,
178
265
  sticky: [Sticky.HeaderToolbar, Sticky.ColumnHeaders],
179
- selectionChange: this._onSelectionChanged.bind(this),
266
+ selectionChange: this._updateButtons.bind(this),
180
267
  headerToolbar: new OverflowToolbar({
181
268
  content: [
182
- new SearchField({
183
- layoutData: new ToolbarLayoutData({
184
- shrinkable: true,
185
- maxWidth: "400px"
186
- }),
187
- search: function(event) {
188
- this._onSearch(event.getParameter("query")).bind(this);
189
- }
190
- }),
269
+ this._searchField,
191
270
  new ToolbarSpacer(),
192
271
  this._showButton,
193
272
  this._hideButton
194
273
  ]
195
274
  }),
275
+ dependents: [
276
+ new ColumnResizer()
277
+ ],
196
278
  columns: [
197
279
  new Column({
198
280
  minScreenWidth: "10rem",
199
281
  hAlign: Library.TextAlign.Begin,
200
- header: new Text({ text: getResourceBundle().getText("LAYERS_PANEL__NAME_COLUMN") })
282
+ header: new Label({ text: getResourceBundle().getText("LAYERS_PANEL_NAME_COLUMN") })
201
283
 
202
284
  }),
203
285
  new Column({
204
286
  minScreenWidth: "6rem",
205
287
  hAlign: Library.TextAlign.Center,
206
- header: new Text({ text: getResourceBundle().getText("LAYERS_PANEL_VISIBLE_COLUMN") })
288
+ header: new Label({ text: getResourceBundle().getText("LAYERS_PANEL_VISIBLE_COLUMN") })
207
289
  })
208
290
  ],
209
291
  items: {
@@ -211,32 +293,34 @@ sap.ui.define([
211
293
  template: new ColumnListItem({
212
294
  vAlign: "Middle",
213
295
  cells: [
214
- new Text({
296
+ new Label({
215
297
  text: "{name}"
216
298
  }),
217
299
  new Icon({
218
300
  src: {
219
301
  path: "",
220
302
  formatter: function(layer) {
221
- var type = that._getVisibility(layer);
222
- if (type === VisibilityType.Hidden) {
223
- return iconHidden;
224
- } else if (type === VisibilityType.Partial) {
225
- return iconPartial;
303
+ switch (getVisibility(layer)) {
304
+ case VisibilityType.Hidden:
305
+ return IconType.Hidden;
306
+ case VisibilityType.Partial:
307
+ return IconType.Partial;
308
+ default:
309
+ return IconType.Visible;
226
310
  }
227
- return iconVisible;
228
311
  }
229
312
  },
230
313
  tooltip: {
231
314
  path: "",
232
315
  formatter: function(layer) {
233
- var type = that._getVisibility(layer);
234
- if (type === VisibilityType.Hidden) {
235
- return getResourceBundle().getText("LAYERS_PANEL_VISIBLE_COLUMN_HIDDEN_TOOLTIP");
236
- } else if (type === VisibilityType.Partial) {
237
- return getResourceBundle().getText("LAYERS_PANEL_VISIBLE_COLUMN_PARTIAL_TOOLTIP");
316
+ switch (getVisibility(layer)) {
317
+ case VisibilityType.Hidden:
318
+ return getResourceBundle().getText("LAYERS_PANEL_VISIBLE_COLUMN_HIDDEN_TOOLTIP");
319
+ case VisibilityType.Partial:
320
+ return getResourceBundle().getText("LAYERS_PANEL_VISIBLE_COLUMN_PARTIAL_TOOLTIP");
321
+ default:
322
+ return getResourceBundle().getText("LAYERS_PANEL_VISIBLE_COLUMN_VISIBLE_TOOLTIP");
238
323
  }
239
- return getResourceBundle().getText("LAYERS_PANEL_VISIBLE_COLUMN_VISIBLE_TOOLTIP");
240
324
  }
241
325
  }
242
326
  })
@@ -245,122 +329,111 @@ sap.ui.define([
245
329
  }
246
330
  });
247
331
 
248
- this._scrollContainer = new ScrollContainer({
249
- vertical: true,
250
- horizontal: false,
332
+ this._message = new IllustratedMessage({
333
+ illustrationType: IllustratedMessageType.NoData,
334
+ enableVerticalResponsiveness: true
335
+ });
336
+
337
+ const content = new VBox({
251
338
  height: "100%",
252
- content: this._table
339
+ renderType: FlexRendertype.Bare,
340
+ items: [
341
+ this._table,
342
+ this._message
343
+ ]
253
344
  });
254
345
 
255
- this.setAggregation("content", this._scrollContainer);
346
+ this.setAggregation("content", content);
256
347
 
257
348
  this._scene = null;
258
349
  this._model = new JSONModel();
259
350
  this._table.setModel(this._model);
351
+ this._skipEvent = false;
260
352
  };
261
353
 
262
- LayersPanel.prototype.refresh = function() {
263
- if (!this._scene || !this._manager || !this._manager.getNodeHierarchy()) {
264
- this._model.setData([]);
354
+ LayersPanel.prototype.exit = function() {
355
+ this._model.destroy();
356
+ this._model = null;
357
+
358
+ Control.prototype.exit?.apply(this);
359
+ };
360
+
361
+ LayersPanel.prototype.getControl = function() {
362
+ return this._table;
363
+ };
364
+
365
+ LayersPanel.prototype._refresh = function() {
366
+ if (!this._scene || !this._manager) {
367
+ // This method may be called indirectly from the exit method after _model is destroyed
368
+ this._model?.setData([]);
369
+ this._updateMessage();
265
370
  return;
266
371
  }
267
372
  // scan the tree and collect layers info
268
- var layers = new Map();
269
- this._scanTree(layers, this._manager.getNodeHierarchy().getSceneRef());
373
+ this._initialLayerIndex = 1;
374
+ const layers = new Map();
375
+ this._scanTree(layers, this._scene.getRootElement());
270
376
 
271
- this._model.setData(layers.values().toArray());
272
- this._table.setModel(this._model);
273
- this.fireContentChanged();
274
- };
377
+ // get layer index info from scene metadata
378
+ const indices = extractLayersIndex(this._scene);
275
379
 
276
- LayersPanel.prototype.onBeforeRendering = function() {
277
- this._table.setVisible(true);
278
- if (!this._resizeListenerId) {
279
- this._resizeListenerId = ResizeHandler.register(this, this._handleResize.bind(this));
280
- }
281
- };
380
+ indices.forEach(function(index, name) {
381
+ const layer = layers.get(name);
382
+ if (layer) {
383
+ layer.index = +index;
384
+ }
385
+ }, this);
282
386
 
283
- LayersPanel.prototype._setScene = function(scene) {
284
- this._scene = scene;
285
- this.refresh();
286
- };
387
+ const data = layers.values().toArray();
388
+ data.sort((a, b) => a.index - b.index);
389
+ this._model.setSizeLimit(data.length);
390
+ this._model.setData(data);
391
+ this._table.setModel(this._model);
287
392
 
288
- LayersPanel.prototype._getVisibility = function(layer) {
289
- if (layer.hiddenElements === 0) {
290
- return VisibilityType.Visible;
291
- } else if (layer.hiddenElements < layer.elements.size) {
292
- return VisibilityType.Partial;
293
- }
294
- return VisibilityType.Hidden;
393
+ this._updateMessage();
394
+ this.fireContentChanged();
295
395
  };
296
396
 
297
- LayersPanel.prototype._extractMetadata = function(metadata) {
298
- if (metadata.length != undefined) {
299
- var map = new Map();
300
- metadata.forEach(function(entry) {
301
- if (entry.category === "ecad") {
302
- map.set(entry.tag, entry.value);
303
- }
304
- });
305
- return map;
306
- }
307
- return null;
397
+ LayersPanel.prototype._setScene = function(scene) {
398
+ this._scene = scene?.isECADScene() ? scene : null;
399
+ this._refresh();
308
400
  };
309
401
 
310
- LayersPanel.prototype._addElement = function(layers, layerName, nodeRef, nodeVisibility) {
311
- var layer = layers.get(layerName);
402
+ LayersPanel.prototype._addToLayer = function(layers, layerName, nodeRef) {
403
+ let layer = layers.get(layerName);
312
404
  if (!layer) {
313
405
  layer = {
314
406
  name: layerName,
315
- order: 0, // wait until CAD Translators support
407
+ index: this._initialLayerIndex++,
316
408
  elements: new Map(),
317
- hiddenElements: 0
409
+ hiddenElements: new Set()
318
410
  };
319
411
  layers.set(layerName, layer);
320
412
  }
321
- if (nodeVisibility == false) {
322
- layer.hiddenElements++;
413
+ if (this._manager.getVisibilityState(nodeRef) === false) {
414
+ layer.hiddenElements.add(nodeRef.uid);
323
415
  }
324
416
  layer.elements.set(nodeRef.uid, nodeRef);
325
417
  };
326
418
 
327
419
  LayersPanel.prototype._scanTree = function(layers, nodeRef) {
328
- var hierarchy = this._manager.getNodeHierarchy();
329
- var node = hierarchy.createNodeProxy(nodeRef);
330
- var metadata = this._extractMetadata(node.getNodeMetadata());
331
- hierarchy.destroyNodeProxy(node);
332
-
420
+ const metadata = extractMetadata(nodeRef);
333
421
  if (metadata) {
334
- var layer = metadata.get("layer");
422
+ const layer = metadata.get("layer");
335
423
  if (layer) {
336
- this._addElement(layers, layer, nodeRef, this._manager.getVisibilityState(nodeRef));
424
+ this._addToLayer(layers, layer, nodeRef);
337
425
  return; // don't go further down the hierarchy
338
426
  }
339
427
  }
340
-
341
- hierarchy.getChildren(nodeRef).forEach(function(ref) {
342
- this._scanTree(layers, ref);
343
- }, this);
344
- };
345
-
346
- LayersPanel.prototype._onSelectionChanged = function(event) {
347
- this._updateButtons();
348
- };
349
-
350
- LayersPanel.prototype._onVisibilityChanged = function(event) {
351
- //
352
- };
353
-
354
- LayersPanel.prototype._handleResize = function(event) {
355
- // this._updateSelection();
428
+ nodeRef.children.forEach((child) => this._scanTree(layers, child));
356
429
  };
357
430
 
358
431
  LayersPanel.prototype._setContent = function(content) {
359
432
  // If there is no explicitly assigned view state manager then use the content connector's default one.
360
433
  if (content && !this.getViewStateManager()) {
361
- var connector = Element.getElementById(this.getContentConnector());
434
+ const connector = Element.getElementById(this.getContentConnector());
362
435
  if (connector) {
363
- var defaultManager = connector.getDefaultViewStateManager();
436
+ const defaultManager = connector.getDefaultViewStateManager();
364
437
  if (defaultManager) {
365
438
  this.setViewStateManager(defaultManager);
366
439
  }
@@ -374,17 +447,14 @@ sap.ui.define([
374
447
  this._setContent(event.getParameter("newContent"));
375
448
  };
376
449
 
377
- LayersPanel.prototype._onContentChangesFinished = function(event) {
378
- this.refresh();
379
- };
380
-
381
450
  LayersPanel.prototype._updateButtons = function() {
382
- var canShow = false, canHide = false;
383
- var selected = this._table.getSelectedItems();
451
+ let canHide = false;
452
+ let canShow = false;
453
+ const selected = this._table.getSelectedItems();
384
454
 
385
455
  selected.forEach(function(item) {
386
- var layer = item.getBindingContext().getObject();
387
- var visibility = this._getVisibility(layer);
456
+ const layer = item.getBindingContext().getObject();
457
+ const visibility = getVisibility(layer);
388
458
 
389
459
  if (visibility === VisibilityType.Visible) {
390
460
  canHide = true;
@@ -401,40 +471,108 @@ sap.ui.define([
401
471
  };
402
472
 
403
473
  LayersPanel.prototype._onShowLayers = function() {
404
- var toShow = [];
405
- var selected = this._table.getSelectedItems();
474
+ const toShow = [];
475
+ const selected = this._table.getSelectedItems();
406
476
 
407
477
  selected.forEach(function(item) {
408
- var layer = item.getBindingContext().getObject();
409
- if (layer.hiddenElements !== 0) {
410
- layer.hiddenElements = 0;
478
+ const layer = item.getBindingContext().getObject();
479
+ if (layer.hiddenElements.size > 0) {
480
+ layer.hiddenElements.clear();
411
481
  layer.elements.forEach(function(nodeRef) {
412
482
  toShow.push(nodeRef);
413
- });
483
+ }, this);
414
484
  }
415
- });
485
+ }, this);
486
+
487
+ this._skipEvent = true;
416
488
  this._manager.setVisibilityState(toShow, true, true, true);
417
489
  this._model.updateBindings(true);
418
490
  this._updateButtons();
419
491
  };
420
492
 
421
493
  LayersPanel.prototype._onHideLayers = function() {
422
- var toHide = [];
423
- var selected = this._table.getSelectedItems();
494
+ const toHide = [];
495
+ const selected = this._table.getSelectedItems();
424
496
 
425
497
  selected.forEach(function(item) {
426
- var layer = item.getBindingContext().getObject();
427
- if (layer.hiddenElements !== layer.elements.size) {
428
- layer.hiddenElements = layer.elements.size;
498
+ const layer = item.getBindingContext().getObject();
499
+ if (layer.hiddenElements.size !== layer.elements.size) {
500
+ layer.hiddenElements.clear();
429
501
  layer.elements.forEach(function(nodeRef) {
502
+ layer.hiddenElements.add(nodeRef.uid);
430
503
  toHide.push(nodeRef);
431
- });
504
+ }, this);
432
505
  }
433
- });
506
+ }, this);
507
+ this._skipEvent = true;
434
508
  this._manager.setVisibilityState(toHide, false, true, true);
435
509
  this._model.updateBindings(true);
436
510
  this._updateButtons();
437
511
  };
438
512
 
513
+ LayersPanel.prototype._onSearch = function(query) {
514
+ if (query !== "") {
515
+ const selected = [];
516
+ this._table.getItems().forEach(function(item) {
517
+ if (item.getBindingContext().getObject().name.lastIndexOf(query) !== -1) {
518
+ selected.push(item);
519
+ }
520
+ }, this);
521
+ if (selected.length > 0) {
522
+ this._table.removeSelections(true, false);
523
+ selected.forEach(function(item) {
524
+ this._table.setSelectedItem(item);
525
+ }, this);
526
+ this._table.fireSelectionChange({ listItems: selected });
527
+ }
528
+ }
529
+ };
530
+
531
+ LayersPanel.prototype._onVisibilityChanged = function(event) {
532
+ if (this._skipEvent) {
533
+ this._skipEvent = false;
534
+ return;
535
+ }
536
+ const layers = this._model.getData();
537
+ const hidden = event.getParameter("hidden");
538
+ const visible = event.getParameter("visible");
539
+
540
+ const process = (list, show) => {
541
+ list.forEach(function(item) {
542
+ const metadata = extractMetadata(item);
543
+ const layer = metadata?.get("layer");
544
+ if (layer) {
545
+ const type = metadata?.get("type");
546
+ const input = type === ElementType.Component ? [item] : [item].concat(item.children);
547
+ input.forEach(function(ref) {
548
+ for (let i = 0; i < layers.length; ++i) {
549
+ if (layers[i].elements.has(ref.uid)) {
550
+ if (show) {
551
+ layers[i].hiddenElements.delete(ref.uid);
552
+ } else {
553
+ layers[i].hiddenElements.add(ref.uid);
554
+ }
555
+ break;
556
+ }
557
+ }
558
+ });
559
+ }
560
+ }, this);
561
+ };
562
+
563
+ process(hidden, false);
564
+ process(visible, true);
565
+
566
+ this._model.updateBindings(true);
567
+ this._updateButtons();
568
+ };
569
+
570
+ LayersPanel.prototype._updateMessage = function() {
571
+ const hasData = this._table.getItems().length > 0;
572
+
573
+ this._table.setVisible(hasData);
574
+ this._message.setVisible(!hasData);
575
+ };
576
+
439
577
  return LayersPanel;
440
578
  });