@vcmap/ui 5.0.0-rc.6 → 5.0.0-rc.9

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 (264) hide show
  1. package/README.md +72 -22
  2. package/build/build.js +0 -3
  3. package/build/buildHelpers.js +0 -1
  4. package/build/commonViteConfig.js +1 -1
  5. package/config/aerowest.config.json +2 -1
  6. package/config/base.config.json +7 -7
  7. package/config/dev.config.json +4 -4
  8. package/dist/assets/cesium/Workers/{AttributeCompression-27507afe.js → AttributeCompression-80665726.js} +1 -1
  9. package/dist/assets/cesium/Workers/{AxisAlignedBoundingBox-7565c1e8.js → AxisAlignedBoundingBox-a655a4bc.js} +1 -1
  10. package/dist/assets/cesium/Workers/{BoundingRectangle-9d707275.js → BoundingRectangle-c3b79029.js} +1 -1
  11. package/dist/assets/cesium/Workers/{BoxGeometry-fb31d3b5.js → BoxGeometry-f8f9c981.js} +1 -1
  12. package/dist/assets/cesium/Workers/{Color-56bb5728.js → Color-de06a177.js} +1 -1
  13. package/dist/assets/cesium/Workers/{CoplanarPolygonGeometryLibrary-72143c19.js → CoplanarPolygonGeometryLibrary-48cdc26d.js} +1 -1
  14. package/dist/assets/cesium/Workers/{CorridorGeometryLibrary-7bae1712.js → CorridorGeometryLibrary-ddc027d3.js} +1 -1
  15. package/dist/assets/cesium/Workers/{CylinderGeometry-331891fe.js → CylinderGeometry-82a8cbe6.js} +1 -1
  16. package/dist/assets/cesium/Workers/{EllipseGeometry-5e3f67b6.js → EllipseGeometry-32d55454.js} +1 -1
  17. package/dist/assets/cesium/Workers/{EllipseGeometryLibrary-dbc15162.js → EllipseGeometryLibrary-b2ae188a.js} +1 -1
  18. package/dist/assets/cesium/Workers/{EllipseOutlineGeometry-21191fce.js → EllipseOutlineGeometry-f05a5a27.js} +1 -1
  19. package/dist/assets/cesium/Workers/{EllipsoidGeodesic-cc3bace8.js → EllipsoidGeodesic-19e75e11.js} +1 -1
  20. package/dist/assets/cesium/Workers/{EllipsoidGeometry-8bfa24a9.js → EllipsoidGeometry-7c99fc81.js} +1 -1
  21. package/dist/assets/cesium/Workers/{EllipsoidOutlineGeometry-48d9c023.js → EllipsoidOutlineGeometry-21c243df.js} +1 -1
  22. package/dist/assets/cesium/Workers/{EllipsoidRhumbLine-125a8b72.js → EllipsoidRhumbLine-6145377b.js} +1 -1
  23. package/dist/assets/cesium/Workers/EllipsoidTangentPlane-a01286f6.js +1 -0
  24. package/dist/assets/cesium/Workers/{EncodedCartesian3-96fdc0ef.js → EncodedCartesian3-d9f5c4a4.js} +1 -1
  25. package/dist/assets/cesium/Workers/{FrustumGeometry-9ab86004.js → FrustumGeometry-17776af8.js} +1 -1
  26. package/dist/assets/cesium/Workers/GeometryAttribute-89a520b9.js +1 -0
  27. package/dist/assets/cesium/Workers/{GeometryInstance-13e4ff38.js → GeometryInstance-4fbf16ba.js} +1 -1
  28. package/dist/assets/cesium/Workers/{GeometryPipeline-e0eb4567.js → GeometryPipeline-309fad76.js} +1 -1
  29. package/dist/assets/cesium/Workers/IntersectionTests-58aa8f80.js +1 -0
  30. package/dist/assets/cesium/Workers/{Matrix2-37e55508.js → Matrix2-47e98d76.js} +0 -0
  31. package/dist/assets/cesium/Workers/{OrientedBoundingBox-e9c07538.js → OrientedBoundingBox-fcb5b750.js} +1 -1
  32. package/dist/assets/cesium/Workers/{Plane-6ee42cab.js → Plane-3f01019d.js} +1 -1
  33. package/dist/assets/cesium/Workers/{PolygonGeometryLibrary-b408c688.js → PolygonGeometryLibrary-0b29eb16.js} +1 -1
  34. package/dist/assets/cesium/Workers/{PolygonPipeline-7b8e4643.js → PolygonPipeline-a934c4dd.js} +1 -1
  35. package/dist/assets/cesium/Workers/{PolylinePipeline-6757400c.js → PolylinePipeline-8095c9bc.js} +1 -1
  36. package/dist/assets/cesium/Workers/{PolylineVolumeGeometryLibrary-eb972210.js → PolylineVolumeGeometryLibrary-67d12fff.js} +1 -1
  37. package/dist/assets/cesium/Workers/{PrimitivePipeline-f244975e.js → PrimitivePipeline-980e44c5.js} +1 -1
  38. package/dist/assets/cesium/Workers/{RectangleGeometryLibrary-1bd6152a.js → RectangleGeometryLibrary-621c6de8.js} +1 -1
  39. package/dist/assets/cesium/Workers/{TerrainEncoding-5a21a97f.js → TerrainEncoding-f96552d5.js} +1 -1
  40. package/dist/assets/cesium/Workers/{Transforms-eb5c1a84.js → Transforms-c8cb8f43.js} +3 -3
  41. package/dist/assets/cesium/Workers/{WallGeometryLibrary-a6b6a368.js → WallGeometryLibrary-c03d8479.js} +1 -1
  42. package/dist/assets/cesium/Workers/{WebMercatorProjection-2839e524.js → WebMercatorProjection-79b3214e.js} +1 -1
  43. package/dist/assets/cesium/Workers/combineGeometry.js +1 -1
  44. package/dist/assets/cesium/Workers/createBoxGeometry.js +1 -1
  45. package/dist/assets/cesium/Workers/createBoxOutlineGeometry.js +1 -1
  46. package/dist/assets/cesium/Workers/createCircleGeometry.js +1 -1
  47. package/dist/assets/cesium/Workers/createCircleOutlineGeometry.js +1 -1
  48. package/dist/assets/cesium/Workers/createCoplanarPolygonGeometry.js +1 -1
  49. package/dist/assets/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +1 -1
  50. package/dist/assets/cesium/Workers/createCorridorGeometry.js +1 -1
  51. package/dist/assets/cesium/Workers/createCorridorOutlineGeometry.js +1 -1
  52. package/dist/assets/cesium/Workers/createCylinderGeometry.js +1 -1
  53. package/dist/assets/cesium/Workers/createCylinderOutlineGeometry.js +1 -1
  54. package/dist/assets/cesium/Workers/createEllipseGeometry.js +1 -1
  55. package/dist/assets/cesium/Workers/createEllipseOutlineGeometry.js +1 -1
  56. package/dist/assets/cesium/Workers/createEllipsoidGeometry.js +1 -1
  57. package/dist/assets/cesium/Workers/createEllipsoidOutlineGeometry.js +1 -1
  58. package/dist/assets/cesium/Workers/createFrustumGeometry.js +1 -1
  59. package/dist/assets/cesium/Workers/createFrustumOutlineGeometry.js +1 -1
  60. package/dist/assets/cesium/Workers/createGeometry.js +1 -1
  61. package/dist/assets/cesium/Workers/createGroundPolylineGeometry.js +1 -1
  62. package/dist/assets/cesium/Workers/createPlaneGeometry.js +1 -1
  63. package/dist/assets/cesium/Workers/createPlaneOutlineGeometry.js +1 -1
  64. package/dist/assets/cesium/Workers/createPolygonGeometry.js +1 -1
  65. package/dist/assets/cesium/Workers/createPolygonOutlineGeometry.js +1 -1
  66. package/dist/assets/cesium/Workers/createPolylineGeometry.js +1 -1
  67. package/dist/assets/cesium/Workers/createPolylineVolumeGeometry.js +1 -1
  68. package/dist/assets/cesium/Workers/createPolylineVolumeOutlineGeometry.js +1 -1
  69. package/dist/assets/cesium/Workers/createRectangleGeometry.js +1 -1
  70. package/dist/assets/cesium/Workers/createRectangleOutlineGeometry.js +1 -1
  71. package/dist/assets/cesium/Workers/createSimplePolylineGeometry.js +1 -1
  72. package/dist/assets/cesium/Workers/createSphereGeometry.js +1 -1
  73. package/dist/assets/cesium/Workers/createSphereOutlineGeometry.js +1 -1
  74. package/dist/assets/cesium/Workers/createVectorTileClampedPolylines.js +1 -1
  75. package/dist/assets/cesium/Workers/createVectorTileGeometries.js +1 -1
  76. package/dist/assets/cesium/Workers/createVectorTilePoints.js +1 -1
  77. package/dist/assets/cesium/Workers/createVectorTilePolygons.js +1 -1
  78. package/dist/assets/cesium/Workers/createVectorTilePolylines.js +1 -1
  79. package/dist/assets/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +1 -1
  80. package/dist/assets/cesium/Workers/createVerticesFromHeightmap.js +1 -1
  81. package/dist/assets/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +1 -1
  82. package/dist/assets/cesium/Workers/createWallGeometry.js +1 -1
  83. package/dist/assets/cesium/Workers/createWallOutlineGeometry.js +1 -1
  84. package/dist/assets/cesium/Workers/upsampleQuantizedTerrainMesh.js +1 -1
  85. package/dist/assets/{cesium.fba8ca.js → cesium.4e40f4.js} +955 -968
  86. package/dist/assets/cesium.js +1 -1
  87. package/dist/assets/core.edcf5e.js +4 -0
  88. package/dist/assets/core.js +1 -1
  89. package/dist/assets/{index.6a83278e.js → index.889d0f3a.js} +1 -1
  90. package/dist/assets/{ol.abea3a.js → ol.246fd4.js} +0 -0
  91. package/dist/assets/ol.js +1 -1
  92. package/dist/assets/ui.df4f6d.css +1 -0
  93. package/dist/assets/ui.df4f6d.js +43 -0
  94. package/dist/assets/ui.js +1 -1
  95. package/dist/assets/{vue-composition-api.7051d7.js → vue-composition-api.a520f3.js} +1 -1
  96. package/dist/assets/vue-composition-api.js +2 -2
  97. package/dist/assets/{vue.9fd7f6.js → vue.2cee44.js} +0 -0
  98. package/dist/assets/vue.js +1 -1
  99. package/dist/assets/{vuetify.33dafc.css → vuetify.cc817b.css} +1 -1
  100. package/dist/assets/{vuetify.33dafc.js → vuetify.cc817b.js} +1 -1
  101. package/dist/assets/vuetify.js +2 -2
  102. package/dist/index.html +1 -1
  103. package/index.js +96 -6
  104. package/package.json +3 -4
  105. package/plugins/@vcmap/pluginExample/index.js +5 -5
  106. package/plugins/@vcmap/pluginExample/pluginExampleComponent.vue +1 -1
  107. package/plugins/@vcmap/project-selector/ContextsListComponent.vue +1 -1
  108. package/plugins/@vcmap/project-selector/index.js +5 -5
  109. package/plugins/@vcmap/project-selector/package.json +1 -2
  110. package/plugins/@vcmap/theme-changer/index.js +6 -6
  111. package/plugins/buttonExamples/ButtonExamples.vue +1 -1
  112. package/plugins/buttonExamples/index.js +5 -4
  113. package/plugins/categoryTest/Categories.vue +1 -1
  114. package/plugins/categoryTest/Category.vue +1 -1
  115. package/plugins/categoryTest/index.js +5 -5
  116. package/plugins/example/index.js +33 -14
  117. package/plugins/test/allIconsComponent.vue +34 -0
  118. package/plugins/test/editor.vue +1 -1
  119. package/plugins/test/index.js +40 -17
  120. package/plugins/test/toolbox-data.js +106 -26
  121. package/plugins/test/windowManagerExample.vue +1 -2
  122. package/src/actions/actionHelper.js +41 -1
  123. package/src/actions/styleSelector.vue +1 -1
  124. package/src/application/Navbar.vue +47 -6
  125. package/src/application/VcsApp.vue +37 -29
  126. package/src/application/VcsMap.vue +1 -20
  127. package/src/assets/logo-mobile.svg +9 -0
  128. package/src/assets/logo.svg +23 -23
  129. package/src/components/buttons/VcsActionButtonList.vue +99 -0
  130. package/src/components/buttons/VcsButton.vue +201 -0
  131. package/src/components/form-inputs-controls/VcsCheckbox.vue +73 -0
  132. package/src/components/form-inputs-controls/VcsColorPicker.vue +81 -0
  133. package/src/components/form-inputs-controls/VcsFormSection.vue +46 -0
  134. package/src/components/form-inputs-controls/VcsLabel.vue +38 -0
  135. package/src/components/form-inputs-controls/VcsSelect.vue +97 -0
  136. package/src/components/form-inputs-controls/VcsTextArea.vue +130 -0
  137. package/src/components/form-inputs-controls/VcsTextField.vue +129 -0
  138. package/src/components/form-output/VcsFormattedNumber.vue +103 -0
  139. package/src/components/lists/VcsActionList.vue +100 -0
  140. package/src/components/lists/VcsTreeview.vue +109 -0
  141. package/src/components/lists/VcsTreeviewLeaf.vue +105 -0
  142. package/src/components/lists/VcsTreeviewSearchbar.vue +156 -0
  143. package/src/components/notification/VcsBadge.vue +27 -0
  144. package/src/components/notification/VcsTooltip.vue +154 -0
  145. package/src/components/notification/validation.js +19 -0
  146. package/src/contentTree/LayerTree.vue +1 -1
  147. package/src/contentTree/contentTreeCollection.js +6 -2
  148. package/src/icons/+all.js +359 -0
  149. package/src/icons/2DAreaIcon.vue +21 -0
  150. package/src/icons/2DDistanceIcon.vue +18 -0
  151. package/src/icons/3DAreaIcon.vue +21 -0
  152. package/src/icons/3DDistanceIcon.vue +18 -0
  153. package/src/icons/3DHeightIcon.vue +18 -0
  154. package/src/icons/AngleIcon.vue +8 -0
  155. package/src/icons/AssociationsIcon.vue +34 -0
  156. package/src/icons/AxisIcon.vue +10 -0
  157. package/src/icons/BoundingBoxIcon.vue +15 -0
  158. package/src/icons/CheckboxCheckedIcon.vue +16 -0
  159. package/src/icons/CheckboxIcon.vue +23 -0
  160. package/src/icons/CheckboxIndeterminateIcon.vue +24 -0
  161. package/src/icons/CircleIcon.vue +10 -0
  162. package/src/icons/ColorSwatchIcon.vue +17 -0
  163. package/src/icons/CommentIcon.vue +19 -0
  164. package/src/icons/CompassIcon.vue +8 -0
  165. package/src/icons/ComponentsIcon.vue +7 -0
  166. package/src/icons/ConeIcon.vue +11 -0
  167. package/src/icons/DimensionsHouseIcon.vue +14 -0
  168. package/src/icons/ElevationProfileIcon.vue +111 -0
  169. package/src/icons/ExportAreaIcon.vue +7 -0
  170. package/src/icons/ExportFlightIcon.vue +7 -0
  171. package/src/icons/ExportIcon.vue +8 -0
  172. package/src/icons/ExternalLinkIcon.vue +10 -0
  173. package/src/icons/EyeIcon.vue +7 -0
  174. package/src/icons/FastForwardIcon.vue +7 -0
  175. package/src/icons/FilterIcon.vue +8 -0
  176. package/src/icons/GlobeNatureIcon.vue +14 -0
  177. package/src/icons/HealthCareIndustriesIcon.vue +118 -0
  178. package/src/icons/HelpIcon.vue +7 -0
  179. package/src/icons/HomePointIcon.vue +8 -0
  180. package/src/icons/HospitalsIcon.vue +237 -0
  181. package/src/icons/HouseIcon.vue +25 -0
  182. package/src/icons/ImportIcon.vue +8 -0
  183. package/src/icons/InfoIcon.vue +10 -0
  184. package/src/icons/KebabIcon.vue +36 -0
  185. package/src/icons/LabelIcon.vue +7 -0
  186. package/src/icons/LayersIcon.vue +26 -0
  187. package/src/icons/LegendIcon.vue +65 -0
  188. package/src/icons/LineIcon.vue +7 -0
  189. package/src/icons/LinkIcon.vue +7 -0
  190. package/src/icons/MapIcon.vue +8 -0
  191. package/src/icons/MenuIcon.vue +34 -0
  192. package/src/icons/MinusIcon.vue +8 -0
  193. package/src/icons/ObjectAttributeIcon.vue +18 -0
  194. package/src/icons/ObjectSelectIcon.vue +8 -0
  195. package/src/icons/ObliqueViewIcon.vue +13 -0
  196. package/src/icons/PdfIcon.vue +10 -0
  197. package/src/icons/PedestrianIcon.vue +8 -0
  198. package/src/icons/PenIcon.vue +14 -0
  199. package/src/icons/PlayCircleIcon.vue +10 -0
  200. package/src/icons/PlusIcon.vue +9 -0
  201. package/src/icons/PoiIcon.vue +7 -0
  202. package/src/icons/PointSelectIcon.vue +7 -0
  203. package/src/icons/PolygonIcon.vue +38 -0
  204. package/src/icons/PresentationModeIcon.vue +7 -0
  205. package/src/icons/ProgressIcon.vue +24 -0
  206. package/src/icons/QueryIcon.vue +15 -0
  207. package/src/icons/RectangleIcon.vue +9 -0
  208. package/src/icons/ReturnIcon.vue +7 -0
  209. package/src/icons/RewindIcon.vue +6 -0
  210. package/src/icons/SearchIcon.vue +8 -0
  211. package/src/icons/ShadowIcon.vue +9 -0
  212. package/src/icons/ShapesIcon.vue +28 -0
  213. package/src/icons/ShareIcon.vue +22 -0
  214. package/src/icons/SimpleCircleFilledIcon.vue +15 -0
  215. package/src/icons/SimpleCircleHalfFilledIcon.vue +12 -0
  216. package/src/icons/SimpleCircleOutlinedIcon.vue +15 -0
  217. package/src/icons/SkipNextIcon.vue +7 -0
  218. package/src/icons/SkipPreviousIcon.vue +9 -0
  219. package/src/icons/SplitViewIcon.vue +19 -0
  220. package/src/icons/TextStyleIcon.vue +14 -0
  221. package/src/icons/ThreeDimensionsIcon.vue +7 -0
  222. package/src/icons/ToolsIcon.vue +35 -0
  223. package/src/icons/TouchIcon.vue +8 -0
  224. package/src/icons/TrashCanIcon.vue +7 -0
  225. package/src/icons/TriangleIcon.vue +15 -0
  226. package/src/icons/TwoDimensionsIcon.vue +8 -0
  227. package/src/icons/UploadIcon.vue +14 -0
  228. package/src/icons/VideoRecorderIcon.vue +14 -0
  229. package/src/icons/WalkingIcon.vue +7 -0
  230. package/src/icons/WallIcon.vue +14 -0
  231. package/src/manager/buttonManager.js +5 -52
  232. package/src/manager/navbarManager.js +81 -0
  233. package/src/manager/toolbox/ToolboxGroupComponent.vue +128 -0
  234. package/src/manager/toolbox/ToolboxManager.vue +119 -76
  235. package/src/manager/toolbox/toolboxManager.js +204 -0
  236. package/src/manager/window/WindowComponent.vue +27 -20
  237. package/src/manager/window/WindowComponentHeader.vue +13 -6
  238. package/src/manager/window/WindowManager.vue +18 -1
  239. package/src/manager/window/windowManager.js +3 -5
  240. package/src/navigation/mapNavigation.vue +34 -5
  241. package/src/navigation/orientationToolsButton.vue +1 -1
  242. package/src/navigation/overviewMap.js +616 -0
  243. package/src/navigation/overviewMapClickedInteraction.js +38 -0
  244. package/src/navigation/tiltSlider.vue +1 -1
  245. package/src/styles/_theming.scss +10 -0
  246. package/src/styles/main.scss +3 -0
  247. package/src/styles/variables.scss +70 -0
  248. package/src/styles/vcsFont.scss +5 -0
  249. package/src/styles/vcsGrid.scss +4 -0
  250. package/src/vcsUiApp.js +18 -3
  251. package/src/vuePlugins/vuetify.js +1 -1
  252. package/dist/assets/cesium/Workers/EllipsoidTangentPlane-678e34e4.js +0 -1
  253. package/dist/assets/cesium/Workers/GeometryAttribute-3915ea0b.js +0 -1
  254. package/dist/assets/cesium/Workers/IntersectionTests-ac2459de.js +0 -1
  255. package/dist/assets/core.d5ed0f.js +0 -4
  256. package/dist/assets/ui.ad1ec9.css +0 -1
  257. package/dist/assets/ui.ad1ec9.js +0 -39
  258. package/dist/assets/uicomponents.161461.css +0 -1
  259. package/dist/assets/uicomponents.161461.js +0 -31
  260. package/dist/assets/uicomponents.js +0 -1
  261. package/lib/uicomponents.js +0 -1
  262. package/src/manager/toolbox/ToolboxMultiSelectButton.vue +0 -96
  263. package/src/manager/toolbox/ToolboxSingleSelectButton.vue +0 -98
  264. package/src/manager/toolbox/toolbox-manager.js +0 -203
@@ -1,43 +1,24 @@
1
+ <script src="../../vcsUiApp.js"></script>
1
2
  <template>
2
3
  <v-toolbar
4
+ v-if="toolboxOpen && actionGroups.length > 0 && $vuetify.breakpoint.mdAndUp"
3
5
  dense
4
- class="vcs-toolbox toolbar__secondary rounded-b mx-auto v-sheet"
5
- :style="{ maxWidth: `${getWidth()}px` }"
6
+ class="vcs-toolbox toolbar__secondary rounded-b mx-auto v-sheet marginToTop"
7
+ :width="width"
6
8
  >
7
9
  <v-toolbar-items class="w-full">
8
10
  <div class="d-flex align-center justify-space-between w-full">
9
- <span
10
- v-for="group of groups"
11
+ <ToolboxGroupComponent
12
+ v-for="(group, idx) in actionGroups"
11
13
  :key="group.id"
12
- >
13
- <component
14
- v-if="group.type === 'customComponent'"
15
- :is="group.component"
16
- :icon="'$vcsObjectAttribute'"
17
- :value="group.active"
18
- @click.native="group.active = !group.active"
19
- :group="group"
20
- />
21
- <Button
22
- v-if="group.type === 'toggleButton'"
23
- :group="group"
24
- :icon="'$vcsObjectAttribute'"
25
- :value="group.active"
26
- @click.native="group.active = !group.active"
27
- />
28
- <ToolboxSingleSelectButton
29
- v-if="toolboxGroupVisible(group) && group.type === 'singleSelectButton'"
30
- :group="group"
31
- @selected="id => selectSingleSelectOption(id)"
32
- @set-open="({ id, open }) => setGroupOpen({ id, open })"
33
- />
34
- <ToolboxMultiSelectButton
35
- v-if="toolboxGroupVisible(group) && group.type === 'multiSelectButton'"
36
- :group="group"
37
- @selected="id => selectMultiSlectOption(id)"
38
- @set-open="({ id, open }) => setGroupOpen({ id, open })"
39
- />
40
- </span>
14
+ :group-icon="group.icon"
15
+ :group-title="group.title"
16
+ :actions="group.actions"
17
+ class="px-2"
18
+ :active="groupId === group.id"
19
+ :position="getPosition(idx)"
20
+ @click="toggleGroup(group.id)"
21
+ />
41
22
  </div>
42
23
  </v-toolbar-items>
43
24
  </v-toolbar>
@@ -60,55 +41,117 @@
60
41
  background-color: #ffffffda;
61
42
  }
62
43
  }
44
+
45
+ .marginToTop {
46
+ margin-top: 2px;
47
+ }
63
48
  </style>
64
49
 
65
50
  <script>
66
51
 
67
- import { inject } from '@vue/composition-api';
68
- import { VcsButton } from '@vcsuite/ui-components';
52
+ import { inject, ref, computed, watch, onUnmounted } from '@vue/composition-api';
53
+ import ToolboxGroupComponent from './ToolboxGroupComponent.vue';
54
+ import {ButtonLocation, vcsAppSymbol} from '@vcmap/ui';
55
+
56
+ /**
57
+ * @typedef {Object} ActionGroup
58
+ * @property {string} id
59
+ * @property {string} icon
60
+ * @property {string} title
61
+ * @property {Array<VcsAction>} actions
62
+ */
69
63
 
70
- import ToolboxSingleSelectButton from './ToolboxSingleSelectButton.vue';
71
- import ToolboxMultiSelectButton from './ToolboxMultiSelectButton.vue';
64
+ /**
65
+ * @description ToolboxManager component rendering toolbox using {@link ToolboxGroupComponent}.
66
+ * @vue-computed {Array<ActionGroup>} actionGroups - Array of group components
67
+ * @vue-computed {number} width - width of toolbox depending on number of groups
68
+ */
69
+ export default {
70
+ name: 'VcsToolboxManager',
71
+ components: {
72
+ ToolboxGroupComponent,
73
+ },
74
+ setup() {
75
+ const app = inject('vcsApp');
72
76
 
73
- export default {
74
- name: 'VcsToolbox',
75
- props: {
76
- width: {
77
- type: Number,
78
- default: 600,
77
+ const toolboxComponentIds = ref(app.toolboxManager.componentIds);
78
+ const actionGroups = computed(() => {
79
+ const groups = toolboxComponentIds.value.map(id => app.toolboxManager.get(id));
80
+ return groups
81
+ .map((g) => {
82
+ const buttonIds = ref(g.buttonManager.componentIds);
83
+ return {
84
+ id: g.id,
85
+ icon: g.icon,
86
+ title: g.title,
87
+ actions: buttonIds.value.map(id => g.buttonManager.get(id).action),
88
+ };
89
+ })
90
+ .filter(g => g.actions.length > 0);
91
+ });
92
+
93
+ const toolboxOpen = ref(true);
94
+ const toolboxToggleAction = {
95
+ name: 'toolboxToggleAction',
96
+ icon: '$vcsTools',
97
+ title: 'Toolbox',
98
+ active: true,
99
+ callback() {
100
+ this.active = !this.active;
101
+ toolboxOpen.value = this.active;
79
102
  },
80
- },
81
- setup() {
82
- const app = inject('vcsApp');
83
- const { toolboxManager } = app;
84
- const { state: { groups } } = toolboxManager;
85
- const getWidth = () => toolboxManager.getNumberOfUsedSlots() * 75;
86
- const toolboxGroupVisible = value => value &&
87
- value.options &&
88
- value.options.length;
89
- const selectSingleSelectOption = (id) => {
90
- toolboxManager.bringToTop(id);
91
- };
92
- const selectMultiSlectOption = (id) => {
93
- toolboxManager.selectOption(id);
94
- };
95
- const setGroupOpen = ({ id, open }) => {
96
- toolboxManager.setGroupOpen(id, open);
97
- };
103
+ };
104
+
105
+ const stopWatching = watch([actionGroups],
106
+ ([actionGroups]) => {
107
+ if (actionGroups.length > 0) {
108
+ if (!app.navbarManager.has('toolbox')) {
109
+ app.navbarManager.add(
110
+ {
111
+ id: 'toolbox',
112
+ action: toolboxToggleAction,
113
+ },
114
+ vcsAppSymbol,
115
+ ButtonLocation.TOOL,
116
+ );
117
+ }
118
+ } else {
119
+ app.navbarManager.remove('toolbox');
120
+ }
121
+ }
122
+ );
123
+
124
+ onUnmounted(() => {
125
+ stopWatching();
126
+ });
127
+
128
+ // XXX can this solved by CSS to get rid of the hardcoded size and padding?
129
+ const buttonSize = 54;
130
+ const buttonPadding = 8;
131
+ const size = buttonSize + (2 * buttonPadding);
132
+ const width = computed(() => actionGroups.value.length * size);
98
133
 
99
- return {
100
- groups,
101
- getWidth,
102
- selectSingleSelectOption,
103
- selectMultiSlectOption,
104
- setGroupOpen,
105
- toolboxGroupVisible,
106
- };
107
- },
108
- components: {
109
- ToolboxSingleSelectButton,
110
- ToolboxMultiSelectButton,
111
- VcsButton,
112
- },
113
- };
134
+ /**
135
+ * calculates relative x-position of a button from the left edge of toolbar
136
+ * @param {number} idx
137
+ * @returns {number}
138
+ */
139
+ const getPosition = (idx) => (size * (idx + 1)) - (size / 2);
140
+
141
+ return {
142
+ toolboxOpen,
143
+ actionGroups,
144
+ width,
145
+ getPosition,
146
+ groupId: null,
147
+ toggleGroup(groupId) {
148
+ if (this.groupId === groupId) {
149
+ this.groupId = null;
150
+ } else {
151
+ this.groupId = groupId;
152
+ }
153
+ },
154
+ };
155
+ },
156
+ };
114
157
  </script>
@@ -0,0 +1,204 @@
1
+ /* eslint-disable import/prefer-default-export */
2
+ import { VcsEvent } from '@vcmap/core';
3
+ import { reactive } from '@vue/composition-api';
4
+ import { check, checkMaybe } from '@vcsuite/check';
5
+ import { v4 as uuidv4 } from 'uuid';
6
+ import { ButtonManager } from '../buttonManager.js';
7
+
8
+ /**
9
+ * @typedef ToolboxGroupComponentOptions
10
+ * @property {string} [id] Optional ID, If not provided an uuid will be generated.
11
+ * @property {string} [icon] Optional group icon, for dropdowns
12
+ * @property {string} [title] Optional group title, for dropdowns
13
+ */
14
+
15
+ /**
16
+ * @typedef ToolboxGroupComponent
17
+ * @property {string} id
18
+ * @property {string} title
19
+ * @property {ButtonManager} buttonManager
20
+ */
21
+
22
+ /**
23
+ * Default groups predefining icon and title of the group
24
+ * @type {Array<ToolboxGroupComponentOptions>}
25
+ */
26
+ const defaultGroups = [
27
+ {
28
+ id: 'select',
29
+ icon: '$vcsPen',
30
+ title: 'select',
31
+ },
32
+ {
33
+ id: 'measurement',
34
+ icon: '$vcsDimensionsHouse',
35
+ title: 'measurement',
36
+ },
37
+ {
38
+ id: 'flight',
39
+ icon: '$vcsVideoRecorder',
40
+ title: 'flight',
41
+ },
42
+ ];
43
+
44
+ /**
45
+ * Requests default groups for a toolboxManager.
46
+ * Once requested, group id, icon and title are defined and cannot be changed or overwritten.
47
+ * @param {ToolboxManager} toolboxManager
48
+ * @param {Array<ToolboxGroupComponentOptions>} groups
49
+ */
50
+ export function setupDefaultGroups(toolboxManager, groups = defaultGroups) {
51
+ groups.forEach(({ id, icon, title }) => toolboxManager.requestGroup(id, icon, title));
52
+ }
53
+
54
+ /**
55
+ * @class ToolboxManager
56
+ * @description Manages a set of Toolbox Groups
57
+ * @implements VcsComponentManager<ToolboxGroupComponent,ToolboxGroupComponentOptions>
58
+ */
59
+ export class ToolboxManager {
60
+ constructor() {
61
+ /**
62
+ * @type {import("@vcmap/core").VcsEvent<ToolboxGroupComponent>}
63
+ */
64
+ this.added = new VcsEvent();
65
+ /**
66
+ * @type {import("@vcmap/core").VcsEvent<ToolboxGroupComponent>}
67
+ */
68
+ this.removed = new VcsEvent();
69
+ /**
70
+ * reactive ordered array of ids,
71
+ * @type {Array<string>}
72
+ */
73
+ this.componentIds = reactive([]);
74
+
75
+ /**
76
+ * @type {Map<string, ToolboxGroupComponent>}
77
+ * @private
78
+ */
79
+ this._toolboxGroups = new Map();
80
+ }
81
+
82
+ /**
83
+ * @param {string} id
84
+ * @returns {ToolboxGroupComponent}
85
+ */
86
+ get(id) {
87
+ return this._toolboxGroups.get(id);
88
+ }
89
+
90
+ /**
91
+ * @param {string} id
92
+ * @returns {boolean}
93
+ */
94
+ has(id) {
95
+ return this._toolboxGroups.has(id);
96
+ }
97
+
98
+ /**
99
+ * Toolbox groups should be static. Removing them can lead to undefined behavior.
100
+ * @param {string} id
101
+ */
102
+ remove(id) {
103
+ check(id, String);
104
+ const toolboxGroupComponent = this._toolboxGroups.get(id);
105
+ if (toolboxGroupComponent) {
106
+ const index = this.componentIds.indexOf(id);
107
+ this.componentIds.splice(index, 1);
108
+ this._toolboxGroups.delete(id);
109
+ this.removed.raiseEvent(toolboxGroupComponent);
110
+ toolboxGroupComponent.buttonManager.destroy();
111
+ }
112
+ }
113
+
114
+ /**
115
+ * Do not call add directly. Use requestGroup for adding toolbox groups.
116
+ * @param {ToolboxGroupComponentOptions} toolboxGroupComponentOptions
117
+ * @throws {Error} if a buttonComponent with the same ID has already been added
118
+ * @returns {ToolboxGroupComponent}
119
+ */
120
+ add(toolboxGroupComponentOptions) {
121
+ checkMaybe(toolboxGroupComponentOptions.id, String);
122
+ checkMaybe(toolboxGroupComponentOptions.icon, String);
123
+ checkMaybe(toolboxGroupComponentOptions.title, String);
124
+
125
+ if (toolboxGroupComponentOptions.id && this.has(toolboxGroupComponentOptions.id)) {
126
+ throw new Error(`A toolGroup with id ${toolboxGroupComponentOptions.id} has already been registered.`);
127
+ }
128
+ const id = toolboxGroupComponentOptions.id || uuidv4();
129
+ const icon = toolboxGroupComponentOptions.icon || undefined;
130
+ const title = toolboxGroupComponentOptions.title || undefined;
131
+ const buttonManager = new ButtonManager();
132
+
133
+ /**
134
+ * @type {ToolboxGroupComponent}
135
+ */
136
+ const toolboxGroupComponent = {
137
+ get id() {
138
+ return id;
139
+ },
140
+ get icon() {
141
+ return icon;
142
+ },
143
+ get title() {
144
+ return title;
145
+ },
146
+ get buttonManager() {
147
+ return buttonManager;
148
+ },
149
+ };
150
+
151
+ this._toolboxGroups.set(id, toolboxGroupComponent);
152
+ this.componentIds.push(id);
153
+ this.added.raiseEvent(toolboxGroupComponent);
154
+ return toolboxGroupComponent;
155
+ }
156
+
157
+ /**
158
+ * Returns an existing group or creates a new group. Add toolbox groups with this API.
159
+ * @param {string} id
160
+ * @param {string} [icon='mdi-select-group']
161
+ * @param {string} [title='defaultGroup']
162
+ * @returns {ToolboxGroupComponent}
163
+ */
164
+ requestGroup(id, icon = 'mdi-select-group', title = 'defaultGroup') {
165
+ check(id, String);
166
+ checkMaybe(icon, String);
167
+ checkMaybe(title, String);
168
+
169
+ if (this.has(id)) {
170
+ return this.get(id);
171
+ } else {
172
+ return this.add({ id, icon, title });
173
+ }
174
+ }
175
+
176
+ /**
177
+ * removes all {@link ButtonComponent}s of a specific owner and fires removed Events
178
+ * @param {string|vcsAppSymbol} owner
179
+ */
180
+ removeOwner(owner) {
181
+ this.componentIds.forEach((id) => {
182
+ this.get(id).buttonManager.removeOwner(owner);
183
+ });
184
+ }
185
+
186
+ /**
187
+ * removes all buttonComponents and fires removed Events
188
+ */
189
+ clear() {
190
+ const componentIds = [...this.componentIds];
191
+ componentIds.forEach((id) => { this.remove(id); });
192
+ }
193
+
194
+ /**
195
+ * destroys the ButtonManager;
196
+ */
197
+ destroy() {
198
+ this.added.destroy();
199
+ this.removed.destroy();
200
+ this.clear();
201
+ this.componentIds.splice(0);
202
+ this._toolboxGroups.clear();
203
+ }
204
+ }
@@ -1,36 +1,43 @@
1
1
  <template>
2
- <div
2
+ <v-sheet
3
3
  :id="`window-component--${windowState.id}`"
4
- class="vsc-window v-sheet elevation-0 position-absolute"
4
+ class="elevation-3 position-absolute d-flex flex-column"
5
5
  ref="windowComponentRef"
6
6
  @click="clicked"
7
+ :class="{
8
+ 'rounded': !isDocked,
9
+ 'marginToTop': isDocked
10
+ }"
7
11
  >
8
- <v-sheet
12
+ <div
9
13
  v-if="!windowState.hideHeader"
10
14
  ref="draggableHeaderRef"
11
- class="v-sheet elevation-3 pa-2 transition-color-100-ease"
15
+ class="pa-2"
12
16
  :class="{
13
17
  'cursor-grab': isDynamic,
14
18
  'grey--text': !isOnTop,
15
- 'rounded-tl': !isDocked,
16
- 'rounded-tr': !isDocked,
17
19
  }"
18
20
  :draggable="isDynamic"
19
21
  >
20
22
  <slot name="headerComponent" />
21
- </v-sheet>
22
- <v-sheet
23
- class="v-sheet elevation-3 overflow-y-auto overflow-x-hidden w-full h-full"
24
- :class="{
25
- 'rounded-br': !isDocked,
26
- 'rounded-bl': !isDocked,
27
- }"
23
+ </div>
24
+ <v-divider />
25
+ <div
26
+ class="overflow-x-hidden"
28
27
  >
29
28
  <slot />
30
- </v-sheet>
31
- </div>
29
+ </div>
30
+ </v-sheet>
32
31
  </template>
33
32
 
33
+ <style scoped>
34
+
35
+ .marginToTop {
36
+ margin-top: 2px;
37
+ }
38
+
39
+ </style>
40
+
34
41
  <script>
35
42
  import {
36
43
  onMounted, onUnmounted, computed, ref, nextTick,
@@ -58,8 +65,8 @@
58
65
  setup({ windowState, slotWindow }, { emit }) {
59
66
  const draggableHeaderRef = ref(null);
60
67
  const windowComponentRef = ref(null);
61
- const isDynamic = computed(() => slotWindow !== WindowSlot.STATIC);
62
- const isDocked = computed(() => slotWindow !== WindowSlot.DETACHED);
68
+ const isDynamic = computed(() => slotWindow.value !== WindowSlot.STATIC);
69
+ const isDocked = computed(() => slotWindow.value !== WindowSlot.DETACHED);
63
70
  const clicked = (e) => {
64
71
  emit('click', e);
65
72
  };
@@ -69,8 +76,7 @@
69
76
  onMounted(() => {
70
77
  if (!windowState.hideHeader && slotWindow.value !== WindowSlot.STATIC) {
71
78
  nextTick(() => {
72
- // To get to the Root Element of a Custom Component .$el is used here.
73
- const dragStart = fromEvent(draggableHeaderRef.value.$el, 'dragstart');
79
+ const dragStart = fromEvent(draggableHeaderRef.value, 'dragstart');
74
80
  const dragOver = fromEvent(document.body, 'dragover');
75
81
  const drop = fromEvent(document.body, 'drop');
76
82
  const dragThenDrop = dragStart.pipe(
@@ -82,7 +88,8 @@
82
88
  });
83
89
  }),
84
90
  switchMap((startEvent) => {
85
- const style = window.getComputedStyle(windowComponentRef.value, null);
91
+ // To get to the Root Element of a Custom Component .$el is used here.
92
+ const style = window.getComputedStyle(windowComponentRef.value.$el, null);
86
93
  const windowPosition = {
87
94
  top: parseInt(style.getPropertyValue('top'), 10),
88
95
  left: parseInt(style.getPropertyValue('left'), 10),
@@ -1,27 +1,34 @@
1
1
  <template>
2
- <span class="d-flex justify-space-between">
2
+ <span class="d-flex justify-space-between align-center window-component-header">
3
3
  <span>
4
4
  <v-icon
5
5
  v-if="windowState.headerIcon"
6
6
  class="mr-2 primary--text"
7
7
  v-text="windowState.headerIcon"
8
8
  />
9
- <h3 class="font-size-14 d-inline-block user-select-none">
9
+ <h3 class="font-size-14 d-inline-block user-select-none font-weight-bold">
10
10
  {{ windowState.headerTitle | translate }}
11
11
  </h3>
12
12
  </span>
13
- <v-icon
14
- class=".float-right"
13
+ <VcsButton
15
14
  @click.stop="close"
16
- size="16"
17
- v-text="'mdi-close-thick'"
15
+ small
16
+ icon="mdi-close-thick"
18
17
  />
19
18
  </span>
20
19
  </template>
21
20
 
21
+ <style>
22
+ .window-component-header{
23
+ max-height: 16px;
24
+ }
25
+ </style>
26
+
22
27
  <script>
28
+ import VcsButton from '../../components/buttons/VcsButton.vue';
23
29
 
24
30
  export default {
31
+ components: { VcsButton },
25
32
  props: {
26
33
  windowState: {
27
34
  type: Object,
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div>
2
+ <div :class="$vuetify.breakpoint.xs ? 'win-container-mobile' : 'unset'">
3
3
  <WindowComponent
4
4
  v-for="(id, zIndex) in componentIds"
5
5
  :key="id"
@@ -28,6 +28,23 @@
28
28
  </div>
29
29
  </template>
30
30
 
31
+ <style scoped lang="scss">
32
+ .win-container-mobile {
33
+ position: absolute;
34
+ z-index: 2;
35
+ width: 100%;
36
+ height: 100%;
37
+ }
38
+ .win-container-mobile > {
39
+ div{
40
+ width: 100% !important;
41
+ inset: unset !important;
42
+ border-radius: 0 !important;
43
+ }
44
+ }
45
+
46
+ </style>
47
+
31
48
  <script>
32
49
  import { inject } from '@vue/composition-api';
33
50
 
@@ -71,7 +71,7 @@ export const WindowPositions = {
71
71
 
72
72
  /**
73
73
  * @typedef WindowComponentOptions
74
- * @property {string} [id] Optional ID, If not provided a uuid will be generated.
74
+ * @property {string} [id] Optional ID, If not provided an uuid will be generated.
75
75
  * @property {VueComponent} component Main Component which is shown below the header.
76
76
  * @property {VueComponent} [headerComponent] Replaces the Header Component.
77
77
  * @property {WindowPositionOptions} [position] Will be ignored if WindowSlot !== DETACHED, can be given otherwise or default will be used
@@ -199,10 +199,7 @@ export class WindowManager {
199
199
  * @returns {WindowComponent}
200
200
  */
201
201
  get(id) {
202
- if (this.has(id)) {
203
- return this._windowComponents.get(id);
204
- }
205
- return undefined;
202
+ return this._windowComponents.get(id);
206
203
  }
207
204
 
208
205
  /**
@@ -219,6 +216,7 @@ export class WindowManager {
219
216
  * @param {string} id
220
217
  */
221
218
  remove(id) {
219
+ check(id, String);
222
220
  const windowComponent = this._windowComponents.get(id);
223
221
  if (windowComponent) {
224
222
  const index = this.componentIds.indexOf(id);