@vcmap/ui 5.0.2 → 5.1.0-rc.1

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 (443) hide show
  1. package/README.md +2 -2
  2. package/build/buildTypes.js +176 -0
  3. package/build/lintTypes.js +30 -0
  4. package/config/aerowest.config.json +4 -0
  5. package/config/base.config.json +22 -0
  6. package/config/dev.config.json +176 -5
  7. package/config/www.config.json +24 -0
  8. package/dist/assets/{cesium.a3a1dc.js → cesium.e9b3ca.js} +1859 -1828
  9. package/dist/assets/cesium.js +1 -1
  10. package/dist/assets/{core.bb64ed.js → core.a9fe5a.js} +5859 -5041
  11. package/dist/assets/core.js +1 -1
  12. package/dist/assets/index-bb2549d6.js +1 -0
  13. package/dist/assets/{ol.833fa9.js → ol.5f0496.js} +7257 -7252
  14. package/dist/assets/ol.js +1 -1
  15. package/dist/assets/{ui.aeb2ec.css → ui.3c73c2.css} +2 -2
  16. package/dist/assets/{ui.aeb2ec.js → ui.3c73c2.js} +14199 -9198
  17. package/dist/assets/ui.js +1 -1
  18. package/dist/assets/{vue.8e1850.js → vue.4fe14e.js} +1243 -1234
  19. package/dist/assets/vue.js +2 -2
  20. package/dist/assets/{vuetify.3ed426.css → vuetify.260d9a.css} +1 -1
  21. package/dist/assets/{vuetify.3ed426.js → vuetify.260d9a.js} +155 -154
  22. package/dist/assets/vuetify.js +2 -2
  23. package/dist/index.html +1 -1
  24. package/index.d.ts +256 -0
  25. package/index.js +48 -11
  26. package/package.json +21 -14
  27. package/plugins/@vcmap-show-case/buttons-example/src/ButtonsExample.vue +3 -0
  28. package/plugins/@vcmap-show-case/category-tester/src/CategoriesExample.vue +312 -43
  29. package/plugins/@vcmap-show-case/category-tester/src/CollectionComponentOptions.vue +48 -182
  30. package/plugins/@vcmap-show-case/category-tester/src/FoobarEditor.vue +118 -0
  31. package/plugins/@vcmap-show-case/category-tester/src/importExportHelper.js +29 -0
  32. package/plugins/@vcmap-show-case/category-tester/src/index.js +16 -0
  33. package/plugins/@vcmap-show-case/collection-manager-example/src/CollectionManagerExample.vue +2 -1
  34. package/plugins/@vcmap-show-case/collection-manager-example/src/index.js +8 -4
  35. package/plugins/@vcmap-show-case/extent-example/README.md +3 -0
  36. package/plugins/@vcmap-show-case/extent-example/package.json +5 -0
  37. package/plugins/@vcmap-show-case/extent-example/src/ExtentExample.vue +71 -0
  38. package/plugins/@vcmap-show-case/extent-example/src/index.js +68 -0
  39. package/plugins/@vcmap-show-case/flight-component-example/README.md +3 -0
  40. package/plugins/@vcmap-show-case/flight-component-example/package.json +5 -0
  41. package/plugins/@vcmap-show-case/flight-component-example/src/FlightExample.vue +53 -0
  42. package/plugins/@vcmap-show-case/flight-component-example/src/index.js +42 -0
  43. package/plugins/@vcmap-show-case/form-inputs-example/src/FormInputsExample.vue +78 -5
  44. package/plugins/@vcmap-show-case/hello-world/src/helloWorld.vue +2 -2
  45. package/plugins/@vcmap-show-case/list-example/src/ListExample.vue +22 -10
  46. package/plugins/@vcmap-show-case/toolbox-example/README.md +9 -0
  47. package/plugins/@vcmap-show-case/toolbox-example/package.json +5 -0
  48. package/plugins/@vcmap-show-case/toolbox-example/src/TriStateExampleWindow.vue +21 -0
  49. package/plugins/@vcmap-show-case/toolbox-example/src/dummyToolboxActions.js +94 -0
  50. package/plugins/@vcmap-show-case/toolbox-example/src/index.js +260 -0
  51. package/plugins/@vcmap-show-case/vector-properties-example/src/VectorPropertiesExample.vue +12 -2
  52. package/plugins/@vcmap-show-case/viewpoint-component-example/README.md +3 -0
  53. package/plugins/@vcmap-show-case/viewpoint-component-example/package.json +5 -0
  54. package/plugins/@vcmap-show-case/viewpoint-component-example/src/ViewpointExample.vue +52 -0
  55. package/plugins/@vcmap-show-case/viewpoint-component-example/src/index.js +42 -0
  56. package/plugins/@vcmap-show-case/window-tester/src/WindowExample.vue +31 -1
  57. package/plugins/@vcmap-show-case/window-tester/src/WindowExampleToggleChild.vue +20 -16
  58. package/plugins/@vcmap-show-case/window-tester/src/index.js +2 -17
  59. package/plugins/package.json +3 -1
  60. package/src/actions/StyleSelector.vue +8 -7
  61. package/src/actions/StyleSelector.vue.d.ts +27 -0
  62. package/src/actions/actionHelper.d.ts +153 -0
  63. package/src/actions/actionHelper.js +36 -19
  64. package/src/actions/extentActions.d.ts +40 -0
  65. package/src/actions/extentActions.js +359 -0
  66. package/src/actions/flightActions.d.ts +59 -0
  67. package/src/actions/flightActions.js +232 -0
  68. package/src/actions/listActions.d.ts +63 -0
  69. package/src/actions/listActions.js +185 -0
  70. package/src/actions/stateRefAction.d.ts +19 -0
  71. package/src/actions/stateRefAction.js +1 -1
  72. package/src/application/VcsApp.vue +103 -28
  73. package/src/application/VcsApp.vue.d.ts +86 -0
  74. package/src/application/VcsAppWrapper.vue.d.ts +12 -0
  75. package/src/application/VcsAttributions.vue.d.ts +14 -0
  76. package/src/application/VcsAttributionsFooter.vue +1 -4
  77. package/src/application/VcsAttributionsFooter.vue.d.ts +26 -0
  78. package/src/application/VcsMap.vue.d.ts +12 -0
  79. package/src/application/VcsNavbar.vue.d.ts +45 -0
  80. package/src/application/VcsPositionDisplay.vue +208 -0
  81. package/src/application/VcsPositionDisplay.vue.d.ts +18 -0
  82. package/src/application/VcsSettings.vue.d.ts +5 -0
  83. package/src/application/VcsTextPage.vue +65 -0
  84. package/src/application/VcsTextPage.vue.d.ts +16 -0
  85. package/src/application/VcsTextPageFooter.vue +89 -0
  86. package/src/application/VcsTextPageFooter.vue.d.ts +22 -0
  87. package/src/application/attributionsHelper.d.ts +64 -0
  88. package/src/application/attributionsHelper.js +1 -1
  89. package/src/application/markdownHelper.d.ts +5 -0
  90. package/src/application/markdownHelper.js +11 -0
  91. package/src/application/positionDisplayInteraction.d.ts +42 -0
  92. package/src/application/positionDisplayInteraction.js +65 -0
  93. package/src/callback/activateLayersCallback.d.ts +29 -0
  94. package/src/callback/activateLayersCallback.js +2 -2
  95. package/src/callback/applyLayerStyleCallback.d.ts +36 -0
  96. package/src/callback/applyLayerStyleCallback.js +2 -2
  97. package/src/callback/deactivateLayersCallback.d.ts +29 -0
  98. package/src/callback/deactivateLayersCallback.js +2 -2
  99. package/src/callback/goToViewpointCallback.d.ts +29 -0
  100. package/src/callback/goToViewpointCallback.js +2 -2
  101. package/src/callback/vcsCallback.d.ts +44 -0
  102. package/src/callback/vcsCallback.js +4 -9
  103. package/src/components/ImageElementInjector.vue.d.ts +24 -0
  104. package/src/components/buttons/VcsActionButtonList.vue +24 -16
  105. package/src/components/buttons/VcsActionButtonList.vue.d.ts +68 -0
  106. package/src/components/buttons/VcsButton.vue +7 -0
  107. package/src/components/buttons/VcsButton.vue.d.ts +89 -0
  108. package/src/components/buttons/VcsFormButton.vue +9 -0
  109. package/src/components/buttons/VcsFormButton.vue.d.ts +91 -0
  110. package/src/components/buttons/VcsToolButton.vue +9 -0
  111. package/src/components/buttons/VcsToolButton.vue.d.ts +91 -0
  112. package/src/components/flight/VcsFlightAnchorsComponent.vue +329 -0
  113. package/src/components/flight/VcsFlightAnchorsComponent.vue.d.ts +45 -0
  114. package/src/components/flight/VcsFlightComponent.vue +284 -0
  115. package/src/components/flight/VcsFlightComponent.vue.d.ts +104 -0
  116. package/src/components/flight/VcsFlightEditor.vue +77 -0
  117. package/src/components/flight/VcsFlightEditor.vue.d.ts +34 -0
  118. package/src/components/flight/VcsFlightPlayer.vue +124 -0
  119. package/src/components/flight/VcsFlightPlayer.vue.d.ts +25 -0
  120. package/src/components/flight/composables.d.ts +11 -0
  121. package/src/components/flight/composables.js +39 -0
  122. package/src/components/form-inputs-controls/VcsCheckbox.vue.d.ts +18 -0
  123. package/src/components/form-inputs-controls/VcsChipArrayInput.vue.d.ts +82 -0
  124. package/src/components/form-inputs-controls/VcsCoordinate.vue +152 -0
  125. package/src/components/form-inputs-controls/VcsCoordinate.vue.d.ts +90 -0
  126. package/src/components/form-inputs-controls/VcsDatePicker.vue +2 -2
  127. package/src/components/form-inputs-controls/VcsDatePicker.vue.d.ts +31 -0
  128. package/src/components/form-inputs-controls/VcsExtent.vue +122 -0
  129. package/src/components/form-inputs-controls/VcsExtent.vue.d.ts +36 -0
  130. package/src/components/form-inputs-controls/VcsFormSection.vue +6 -1
  131. package/src/components/form-inputs-controls/VcsFormSection.vue.d.ts +75 -0
  132. package/src/components/form-inputs-controls/VcsLabel.vue +18 -0
  133. package/src/components/form-inputs-controls/VcsLabel.vue.d.ts +41 -0
  134. package/src/components/form-inputs-controls/VcsRadio.vue.d.ts +32 -0
  135. package/src/components/form-inputs-controls/VcsRadioGrid.vue.d.ts +35 -0
  136. package/src/components/form-inputs-controls/VcsSelect.vue.d.ts +31 -0
  137. package/src/components/form-inputs-controls/VcsSlider.vue.d.ts +2 -0
  138. package/src/components/form-inputs-controls/VcsTextArea.vue.d.ts +22 -0
  139. package/src/components/form-inputs-controls/VcsTextField.vue +57 -10
  140. package/src/components/form-inputs-controls/VcsTextField.vue.d.ts +65 -0
  141. package/src/components/form-inputs-controls/VcsWizard.vue.d.ts +14 -0
  142. package/src/components/form-inputs-controls/VcsWizardStep.vue.d.ts +89 -0
  143. package/src/components/form-inputs-controls/composables.d.ts +7 -0
  144. package/src/components/form-inputs-controls/composables.js +1 -1
  145. package/src/components/form-output/VcsFormattedNumber.vue +13 -2
  146. package/src/components/form-output/VcsFormattedNumber.vue.d.ts +89 -0
  147. package/src/components/icons/+all.d.ts +9 -0
  148. package/src/components/icons/+all.js +16 -0
  149. package/src/components/icons/2DAreaIcon.vue.d.ts +2 -0
  150. package/src/components/icons/2DDistanceIcon.vue.d.ts +2 -0
  151. package/src/components/icons/2DHeightObliqueIcon.vue +20 -0
  152. package/src/components/icons/2DHeightObliqueIcon.vue.d.ts +2 -0
  153. package/src/components/icons/3DAreaIcon.vue.d.ts +2 -0
  154. package/src/components/icons/3DDistanceIcon.vue.d.ts +2 -0
  155. package/src/components/icons/3DHeightIcon.vue.d.ts +2 -0
  156. package/src/components/icons/AngleIcon.vue.d.ts +2 -0
  157. package/src/components/icons/AssociationsIcon.vue.d.ts +2 -0
  158. package/src/components/icons/AxisIcon.vue.d.ts +2 -0
  159. package/src/components/icons/BoundingBoxIcon.vue.d.ts +2 -0
  160. package/src/components/icons/CheckboxCheckedIcon.vue.d.ts +2 -0
  161. package/src/components/icons/CheckboxIcon.vue.d.ts +2 -0
  162. package/src/components/icons/CheckboxIndeterminateIcon.vue.d.ts +2 -0
  163. package/src/components/icons/CircleIcon.vue.d.ts +2 -0
  164. package/src/components/icons/ClippingHorizontalIcon.vue.d.ts +2 -0
  165. package/src/components/icons/ClippingIcon.vue.d.ts +2 -0
  166. package/src/components/icons/ClippingVerticalIcon.vue.d.ts +2 -0
  167. package/src/components/icons/ColorPickerIcon.vue.d.ts +2 -0
  168. package/src/components/icons/ColorSwatchIcon.vue.d.ts +2 -0
  169. package/src/components/icons/CommentIcon.vue.d.ts +2 -0
  170. package/src/components/icons/CompassIcon.vue.d.ts +2 -0
  171. package/src/components/icons/ComponentsIcon.vue.d.ts +2 -0
  172. package/src/components/icons/ComponentsPlusIcon.vue +17 -0
  173. package/src/components/icons/ComponentsPlusIcon.vue.d.ts +2 -0
  174. package/src/components/icons/ConeIcon.vue.d.ts +2 -0
  175. package/src/components/icons/DimensionsHouseIcon.vue.d.ts +2 -0
  176. package/src/components/icons/EditIcon.vue.d.ts +2 -0
  177. package/src/components/icons/EditVerticesIcon.vue.d.ts +2 -0
  178. package/src/components/icons/ElevationProfileIcon.vue.d.ts +2 -0
  179. package/src/components/icons/ExportAreaIcon.vue.d.ts +2 -0
  180. package/src/components/icons/ExportFlightIcon.vue.d.ts +2 -0
  181. package/src/components/icons/ExportIcon.vue.d.ts +2 -0
  182. package/src/components/icons/ExternalLinkIcon.vue.d.ts +2 -0
  183. package/src/components/icons/EyeIcon.vue.d.ts +2 -0
  184. package/src/components/icons/FastForwardIcon.vue.d.ts +2 -0
  185. package/src/components/icons/FilterIcon.vue.d.ts +2 -0
  186. package/src/components/icons/GlobalTerrainIcon.vue.d.ts +2 -0
  187. package/src/components/icons/GlobeNatureIcon.vue.d.ts +2 -0
  188. package/src/components/icons/GroundIcon.vue.d.ts +2 -0
  189. package/src/components/icons/HealthCareIndustriesIcon.vue.d.ts +2 -0
  190. package/src/components/icons/HelpIcon.vue.d.ts +2 -0
  191. package/src/components/icons/HideIcon.vue.d.ts +2 -0
  192. package/src/components/icons/HomePointIcon.vue.d.ts +2 -0
  193. package/src/components/icons/HospitalsIcon.vue.d.ts +2 -0
  194. package/src/components/icons/HouseIcon.vue.d.ts +2 -0
  195. package/src/components/icons/ImportIcon.vue.d.ts +2 -0
  196. package/src/components/icons/InfoIcon.vue.d.ts +2 -0
  197. package/src/components/icons/KebabIcon.vue.d.ts +2 -0
  198. package/src/components/icons/LabelIcon.vue.d.ts +2 -0
  199. package/src/components/icons/LayersIcon.vue.d.ts +2 -0
  200. package/src/components/icons/LegendIcon.vue.d.ts +2 -0
  201. package/src/components/icons/LineIcon.vue.d.ts +2 -0
  202. package/src/components/icons/LinkIcon.vue.d.ts +2 -0
  203. package/src/components/icons/LogoutIcon.vue.d.ts +2 -0
  204. package/src/components/icons/MapIcon.vue.d.ts +2 -0
  205. package/src/components/icons/MenuIcon.vue.d.ts +2 -0
  206. package/src/components/icons/MinusIcon.vue.d.ts +2 -0
  207. package/src/components/icons/MultiViewIcon.vue +16 -0
  208. package/src/components/icons/MultiViewIcon.vue.d.ts +2 -0
  209. package/src/components/icons/ObjectAttributeIcon.vue.d.ts +2 -0
  210. package/src/components/icons/ObjectSelectIcon.vue.d.ts +2 -0
  211. package/src/components/icons/ObliqueViewIcon.vue.d.ts +2 -0
  212. package/src/components/icons/PdfIcon.vue.d.ts +2 -0
  213. package/src/components/icons/PedestrianIcon.vue.d.ts +2 -0
  214. package/src/components/icons/PenIcon.vue.d.ts +2 -0
  215. package/src/components/icons/PlayCircleIcon.vue.d.ts +2 -0
  216. package/src/components/icons/PlusIcon.vue.d.ts +2 -0
  217. package/src/components/icons/PoiIcon.vue.d.ts +2 -0
  218. package/src/components/icons/PointIcon.vue.d.ts +2 -0
  219. package/src/components/icons/PointMeasurementIcon.vue +36 -0
  220. package/src/components/icons/PointMeasurementIcon.vue.d.ts +2 -0
  221. package/src/components/icons/PointSelectIcon.vue.d.ts +2 -0
  222. package/src/components/icons/PresentationModeIcon.vue.d.ts +2 -0
  223. package/src/components/icons/ProgressIcon.vue.d.ts +2 -0
  224. package/src/components/icons/QueryIcon.vue.d.ts +2 -0
  225. package/src/components/icons/RectangleIcon.vue.d.ts +2 -0
  226. package/src/components/icons/ReturnIcon.vue.d.ts +2 -0
  227. package/src/components/icons/RewindIcon.vue.d.ts +2 -0
  228. package/src/components/icons/RotateLeftIcon.vue.d.ts +2 -0
  229. package/src/components/icons/RotateRightIcon.vue.d.ts +2 -0
  230. package/src/components/icons/ScreenshotIcon.vue.d.ts +2 -0
  231. package/src/components/icons/SearchIcon.vue.d.ts +2 -0
  232. package/src/components/icons/ShadowIcon.vue.d.ts +2 -0
  233. package/src/components/icons/ShapesIcon.vue.d.ts +2 -0
  234. package/src/components/icons/ShareIcon.vue.d.ts +2 -0
  235. package/src/components/icons/SimpleCircleFilledIcon.vue.d.ts +2 -0
  236. package/src/components/icons/SimpleCircleHalfFilledIcon.vue.d.ts +2 -0
  237. package/src/components/icons/SimpleCircleOutlinedIcon.vue.d.ts +2 -0
  238. package/src/components/icons/SkipNextIcon.vue.d.ts +2 -0
  239. package/src/components/icons/SkipPreviousIcon.vue.d.ts +2 -0
  240. package/src/components/icons/SplitViewIcon.vue.d.ts +2 -0
  241. package/src/components/icons/TerrainBoxIcon.vue.d.ts +2 -0
  242. package/src/components/icons/TextStyleIcon.vue.d.ts +2 -0
  243. package/src/components/icons/ThreeDimensionsIcon.vue.d.ts +2 -0
  244. package/src/components/icons/ToolsIcon.vue.d.ts +2 -0
  245. package/src/components/icons/TouchIcon.vue.d.ts +2 -0
  246. package/src/components/icons/TrashCanIcon.vue.d.ts +2 -0
  247. package/src/components/icons/TriangleIcon.vue.d.ts +2 -0
  248. package/src/components/icons/TwoDimensionsIcon.vue.d.ts +2 -0
  249. package/src/components/icons/UploadIcon.vue.d.ts +2 -0
  250. package/src/components/icons/UserProfileIcon.vue.d.ts +2 -0
  251. package/src/components/icons/UserShareIcon.vue.d.ts +2 -0
  252. package/src/components/icons/VideoRecorderIcon.vue.d.ts +2 -0
  253. package/src/components/icons/ViewpointFlightIcon.vue.d.ts +2 -0
  254. package/src/components/icons/ViewpointIcon.vue.d.ts +2 -0
  255. package/src/components/icons/Viewshed360Icon.vue.d.ts +2 -0
  256. package/src/components/icons/ViewshedConeIcon.vue.d.ts +2 -0
  257. package/src/components/icons/ViewshedIcon.vue.d.ts +2 -0
  258. package/src/components/icons/WalkingIcon.vue.d.ts +2 -0
  259. package/src/components/icons/WallIcon.vue.d.ts +2 -0
  260. package/src/components/icons/WandIcon.vue.d.ts +2 -0
  261. package/src/components/import/FileDrop.vue +69 -0
  262. package/src/components/import/FileDrop.vue.d.ts +26 -0
  263. package/src/components/import/ImportComponent.vue +78 -0
  264. package/src/components/import/ImportComponent.vue.d.ts +34 -0
  265. package/src/components/lists/VcsActionList.vue +8 -15
  266. package/src/components/lists/VcsActionList.vue.d.ts +66 -0
  267. package/src/components/lists/VcsList.vue +207 -116
  268. package/src/components/lists/VcsList.vue.d.ts +227 -0
  269. package/src/components/lists/VcsTreeview.vue +3 -1
  270. package/src/components/lists/VcsTreeview.vue.d.ts +28 -0
  271. package/src/components/lists/VcsTreeviewLeaf.vue +1 -0
  272. package/src/components/lists/VcsTreeviewLeaf.vue.d.ts +19 -0
  273. package/src/components/lists/VcsTreeviewSearchbar.vue.d.ts +41 -0
  274. package/src/components/notification/VcsBadge.vue.d.ts +14 -0
  275. package/src/components/notification/VcsHelp.vue.d.ts +22 -0
  276. package/src/components/notification/VcsTooltip.vue.d.ts +27 -0
  277. package/src/components/notification/validation.d.ts +8 -0
  278. package/src/components/notification/validation.js +3 -2
  279. package/src/components/plugins/AbstractConfigEditor.vue +25 -4
  280. package/src/components/plugins/AbstractConfigEditor.vue.d.ts +55 -0
  281. package/src/components/style/MenuWrapper.vue.d.ts +55 -0
  282. package/src/components/style/VcsFeatureStyleComponent.vue +389 -0
  283. package/src/components/style/VcsFeatureStyleComponent.vue.d.ts +31 -0
  284. package/src/components/style/VcsFillMenu.vue.d.ts +34 -0
  285. package/src/components/style/VcsFillSelector.vue.d.ts +22 -0
  286. package/src/components/style/VcsImageMenu.vue.d.ts +43 -0
  287. package/src/components/style/VcsImageSelector.vue.d.ts +128 -0
  288. package/src/components/style/VcsStrokeMenu.vue.d.ts +34 -0
  289. package/src/components/style/VcsStrokeSelector.vue.d.ts +23 -0
  290. package/src/components/style/VcsTextMenu.vue.d.ts +52 -0
  291. package/src/components/style/VcsTextSelector.vue.d.ts +58 -0
  292. package/src/components/style/VcsVectorStyleComponent.vue.d.ts +76 -0
  293. package/src/components/style/composables.d.ts +43 -0
  294. package/src/components/style/composables.js +11 -8
  295. package/src/components/tables/VcsDataTable.vue +11 -3
  296. package/src/components/tables/VcsDataTable.vue.d.ts +142 -0
  297. package/src/components/tables/VcsTable.vue +71 -2
  298. package/src/components/tables/VcsTable.vue.d.ts +88 -0
  299. package/src/components/vector-properties/VcsFeatureEditingWindow.vue +392 -0
  300. package/src/components/vector-properties/VcsFeatureEditingWindow.vue.d.ts +87 -0
  301. package/src/components/vector-properties/VcsFeatureTransforms.vue +217 -0
  302. package/src/components/vector-properties/VcsFeatureTransforms.vue.d.ts +45 -0
  303. package/src/components/vector-properties/VcsVectorPropertiesComponent.vue +96 -52
  304. package/src/components/vector-properties/VcsVectorPropertiesComponent.vue.d.ts +119 -0
  305. package/src/components/vector-properties/composables.d.ts +33 -0
  306. package/src/components/vector-properties/composables.js +21 -14
  307. package/src/components/viewpoint/VcsViewpointComponent.vue +514 -0
  308. package/src/components/viewpoint/VcsViewpointComponent.vue.d.ts +126 -0
  309. package/src/components/viewpoint/VcsViewpointEditor.vue +87 -0
  310. package/src/components/viewpoint/VcsViewpointEditor.vue.d.ts +25 -0
  311. package/src/contentTree/LayerTree.vue.d.ts +15 -0
  312. package/src/contentTree/contentTreeCollection.d.ts +113 -0
  313. package/src/contentTree/contentTreeCollection.js +10 -20
  314. package/src/contentTree/contentTreeItem.d.ts +334 -0
  315. package/src/contentTree/contentTreeItem.js +31 -17
  316. package/src/contentTree/flightContentTreeItem.d.ts +53 -0
  317. package/src/contentTree/flightContentTreeItem.js +201 -0
  318. package/src/contentTree/groupContentTreeItem.d.ts +14 -0
  319. package/src/contentTree/groupContentTreeItem.js +2 -2
  320. package/src/contentTree/layerContentTreeItem.d.ts +76 -0
  321. package/src/contentTree/layerContentTreeItem.js +7 -9
  322. package/src/contentTree/layerGroupContentTreeItem.d.ts +50 -0
  323. package/src/contentTree/layerGroupContentTreeItem.js +2 -3
  324. package/src/contentTree/nodeContentTreeItem.d.ts +10 -0
  325. package/src/contentTree/nodeContentTreeItem.js +2 -2
  326. package/src/contentTree/obliqueCollectionContentTreeItem.d.ts +46 -0
  327. package/src/contentTree/obliqueCollectionContentTreeItem.js +3 -5
  328. package/src/contentTree/subContentTreeItem.d.ts +15 -0
  329. package/src/contentTree/subContentTreeItem.js +3 -3
  330. package/src/contentTree/vcsObjectContentTreeItem.d.ts +56 -0
  331. package/src/contentTree/vcsObjectContentTreeItem.js +3 -4
  332. package/src/contentTree/viewpointContentTreeItem.d.ts +46 -0
  333. package/src/contentTree/viewpointContentTreeItem.js +3 -4
  334. package/src/downloadHelper.d.ts +27 -0
  335. package/src/featureInfo/AddressBalloonComponent.vue.d.ts +2 -0
  336. package/src/featureInfo/BalloonComponent.vue +16 -3
  337. package/src/featureInfo/BalloonComponent.vue.d.ts +61 -0
  338. package/src/featureInfo/abstractFeatureInfoView.d.ts +199 -0
  339. package/src/featureInfo/abstractFeatureInfoView.js +82 -18
  340. package/src/featureInfo/addressBalloonFeatureInfoView.d.ts +67 -0
  341. package/src/featureInfo/addressBalloonFeatureInfoView.js +9 -2
  342. package/src/featureInfo/balloonFeatureInfoView.d.ts +49 -0
  343. package/src/featureInfo/balloonFeatureInfoView.js +12 -11
  344. package/src/featureInfo/balloonHelper.d.ts +31 -0
  345. package/src/featureInfo/balloonHelper.js +6 -6
  346. package/src/featureInfo/featureInfo.d.ts +146 -0
  347. package/src/featureInfo/featureInfo.js +11 -16
  348. package/src/featureInfo/featureInfoInteraction.d.ts +21 -0
  349. package/src/featureInfo/featureInfoInteraction.js +2 -2
  350. package/src/featureInfo/iframeFeatureInfoView.d.ts +48 -0
  351. package/src/featureInfo/iframeFeatureInfoView.js +3 -5
  352. package/src/featureInfo/tableFeatureInfoView.d.ts +75 -0
  353. package/src/featureInfo/tableFeatureInfoView.js +19 -9
  354. package/src/i18n/de.d.ts +353 -0
  355. package/src/i18n/de.js +114 -2
  356. package/src/i18n/en.d.ts +352 -0
  357. package/src/i18n/en.js +113 -1
  358. package/src/i18n/i18nCollection.d.ts +82 -0
  359. package/src/i18n/i18nCollection.js +3 -3
  360. package/src/init.d.ts +58 -0
  361. package/src/init.js +3 -5
  362. package/src/legend/StyleLegendItem.vue.d.ts +25 -0
  363. package/src/legend/VcsLegend.vue.d.ts +20 -0
  364. package/src/legend/legendHelper.d.ts +172 -0
  365. package/src/legend/legendHelper.js +21 -21
  366. package/src/manager/buttonManager.d.ts +106 -0
  367. package/src/manager/buttonManager.js +8 -4
  368. package/src/manager/collectionManager/CollectionComponent.vue +38 -42
  369. package/src/manager/collectionManager/CollectionComponent.vue.d.ts +17 -0
  370. package/src/manager/collectionManager/CollectionComponentList.vue +53 -18
  371. package/src/manager/collectionManager/CollectionComponentList.vue.d.ts +38 -0
  372. package/src/manager/collectionManager/CollectionComponentProvider.vue +3 -2
  373. package/src/manager/collectionManager/CollectionComponentProvider.vue.d.ts +12 -0
  374. package/src/manager/collectionManager/CollectionManager.vue +29 -4
  375. package/src/manager/collectionManager/CollectionManager.vue.d.ts +8 -0
  376. package/src/manager/collectionManager/categoryManager.d.ts +56 -0
  377. package/src/manager/collectionManager/categoryManager.js +21 -7
  378. package/src/manager/collectionManager/collectionComponentClass.d.ts +257 -0
  379. package/src/manager/collectionManager/{collectionComponent.js → collectionComponentClass.js} +210 -57
  380. package/src/manager/collectionManager/collectionManager.d.ts +200 -0
  381. package/src/manager/collectionManager/collectionManager.js +45 -39
  382. package/src/manager/collectionManager/editorCollectionComponentClass.d.ts +60 -0
  383. package/src/manager/collectionManager/editorCollectionComponentClass.js +295 -0
  384. package/src/manager/contextMenu/ContextMenuComponent.vue.d.ts +18 -0
  385. package/src/manager/contextMenu/contextMenuInteraction.d.ts +24 -0
  386. package/src/manager/contextMenu/contextMenuManager.d.ts +70 -0
  387. package/src/manager/contextMenu/contextMenuManager.js +5 -5
  388. package/src/manager/navbarManager.d.ts +60 -0
  389. package/src/manager/navbarManager.js +10 -6
  390. package/src/manager/toolbox/GroupToolboxComponent.vue.d.ts +17 -0
  391. package/src/manager/toolbox/SelectToolboxComponent.vue +1 -0
  392. package/src/manager/toolbox/SelectToolboxComponent.vue.d.ts +15 -0
  393. package/src/manager/toolbox/ToolboxManager.vue +33 -7
  394. package/src/manager/toolbox/ToolboxManager.vue.d.ts +21 -0
  395. package/src/manager/toolbox/toolboxManager.d.ts +177 -0
  396. package/src/manager/toolbox/toolboxManager.js +86 -31
  397. package/src/manager/window/WindowComponent.vue.d.ts +40 -0
  398. package/src/manager/window/WindowComponentHeader.vue +1 -1
  399. package/src/manager/window/WindowComponentHeader.vue.d.ts +36 -0
  400. package/src/manager/window/WindowManager.vue +1 -0
  401. package/src/manager/window/WindowManager.vue.d.ts +19 -0
  402. package/src/manager/window/windowHelper.d.ts +134 -0
  403. package/src/manager/window/windowHelper.js +20 -20
  404. package/src/manager/window/windowManager.d.ts +422 -0
  405. package/src/manager/window/windowManager.js +95 -40
  406. package/src/navigation/MapNavCompass.vue.d.ts +25 -0
  407. package/src/navigation/MapNavigation.vue +2 -2
  408. package/src/navigation/MapNavigation.vue.d.ts +46 -0
  409. package/src/navigation/ObliqueRotation.vue +8 -4
  410. package/src/navigation/ObliqueRotation.vue.d.ts +14 -0
  411. package/src/navigation/OrientationToolsButton.vue.d.ts +30 -0
  412. package/src/navigation/TiltSlider.vue.d.ts +19 -0
  413. package/src/navigation/VcsCompass.vue.d.ts +25 -0
  414. package/src/navigation/VcsZoomButton.vue +6 -3
  415. package/src/navigation/VcsZoomButton.vue.d.ts +2 -0
  416. package/src/navigation/overviewMap.d.ts +199 -0
  417. package/src/navigation/overviewMap.js +3 -7
  418. package/src/navigation/overviewMapClickedInteraction.d.ts +21 -0
  419. package/src/notifier/NotifierComponent.vue.d.ts +10 -0
  420. package/src/notifier/notifier.d.ts +53 -0
  421. package/src/notifier/notifier.js +0 -1
  422. package/src/pluginHelper.d.ts +67 -0
  423. package/src/pluginHelper.js +11 -9
  424. package/src/search/ResultItem.vue.d.ts +25 -0
  425. package/src/search/ResultsComponent.vue +1 -1
  426. package/src/search/ResultsComponent.vue.d.ts +24 -0
  427. package/src/search/SearchComponent.vue +1 -1
  428. package/src/search/SearchComponent.vue.d.ts +10 -0
  429. package/src/search/search.d.ts +129 -0
  430. package/src/search/search.js +8 -11
  431. package/src/setup.d.ts +1 -0
  432. package/src/state.d.ts +57 -0
  433. package/src/state.js +7 -5
  434. package/src/uiConfig.d.ts +99 -0
  435. package/src/uiConfig.js +17 -7
  436. package/src/vcsUiApp.d.ts +301 -0
  437. package/src/vcsUiApp.js +58 -54
  438. package/src/vuePlugins/i18n.d.ts +10 -0
  439. package/src/vuePlugins/i18n.js +3 -3
  440. package/src/vuePlugins/vuetify.d.ts +27 -0
  441. package/tsconfig.json +36 -0
  442. package/dist/assets/index-661636d9.js +0 -1
  443. package/plugins/@vcmap-show-case/window-tester/src/toolboxData.js +0 -288
@@ -1,28 +1,68 @@
1
1
  import { IndexedCollection, isOverrideCollection } from '@vcmap/core';
2
2
  import { getLogger } from '@vcsuite/logger';
3
3
  import { v4 as uuidv4 } from 'uuid';
4
- import { computed, ref } from 'vue';
5
- import { parseNumber } from '@vcsuite/parsers';
4
+ import { computed, ref, watch } from 'vue';
5
+ import { parseBoolean, parseNumber } from '@vcsuite/parsers';
6
6
  import { validateAction } from '../../components/lists/VcsActionList.vue';
7
7
  import { sortByWeight } from '../buttonManager.js';
8
+ import {
9
+ createListItemBulkAction,
10
+ createListItemDeleteAction,
11
+ createListItemRenameAction,
12
+ } from '../../actions/listActions.js';
13
+ import { sortByOwner } from '../navbarManager.js';
8
14
 
9
15
  /**
10
16
  * @typedef {Object} CollectionComponentUiOptions
11
17
  * @property {string} [id]
12
18
  * @property {string} [title]
13
- * @property {boolean} [draggable] - only supported for IndexedCollections
14
- * @property {boolean} [selectable]
15
- * @property {boolean} [singleSelect]
19
+ * @property {boolean} [draggable=false] - only supported for IndexedCollections
20
+ * @property {boolean} [renamable=false] - adds actions to rename items from list. Sets a default titleChanged callback on all list items, which can be overwritten in the mapping function, if necessary.
21
+ * @property {boolean} [removable=false] - adds actions to remove items from list. Also adds a header action to delete selected, if selectable is set to true.
22
+ * @property {boolean} [selectable=false]
23
+ * @property {boolean} [singleSelect=false]
16
24
  * @property {number} [overflowCount=2] - number of header action buttons rendered until overflow
17
25
  * @property {number} [limit=10] - limit number of items in rendered list (more items are rendered in extra window)
18
26
  */
19
27
 
20
28
  /**
21
- * @typedef {CollectionComponentUiOptions} CollectionComponentOptions
22
- * @property {import("@vcmap/core").Collection<T>} collection
29
+ * @typedef {CollectionComponentUiOptions & {
30
+ * collection: import("@vcmap/core").Collection<T>
31
+ * }} CollectionComponentClassOptions
23
32
  * @template {Object} T
24
33
  */
25
34
 
35
+ /**
36
+ * @typedef {import("../../components/lists/VcsList.vue").VcsListItem & {
37
+ * actions: Array<import("../../actions/actionHelper.js").VcsAction & { weight?: number }>,
38
+ * clickedCallbacks: Array<function(PointerEvent):void>,
39
+ * destroy: function():void|undefined
40
+ * destroyFunctions: Array<function():void>
41
+ * }} CollectionComponentListItem
42
+ */
43
+
44
+ /**
45
+ * @param {CollectionComponentListItem} listItem
46
+ */
47
+ function destroyListItem(listItem) {
48
+ listItem.destroyFunctions.forEach((cb) => cb());
49
+ listItem.destroy?.();
50
+ }
51
+
52
+ /**
53
+ * Renames the title of an item for VcsObject based items.
54
+ * @param {import("@vcmap/core").VcsObject} item
55
+ * @param {import("../../components/lists/VcsList").VcsListItem} listItem
56
+ * @param {string} newTitle
57
+ */
58
+ function titleChanged(item, listItem, newTitle) {
59
+ if (!item.properties) {
60
+ item.properties = {};
61
+ }
62
+ item.properties.title = newTitle;
63
+ listItem.title = newTitle;
64
+ }
65
+
26
66
  /**
27
67
  * Manages one collection and creates a mirrored items array with ListItems.
28
68
  * Listens to all collection events and synchronizes changes to the items array.
@@ -30,15 +70,15 @@ import { sortByWeight } from '../buttonManager.js';
30
70
  * @class
31
71
  * @template {Object|import("@vcmap/core").VcsObject} T
32
72
  */
33
- class CollectionComponent {
73
+ class CollectionComponentClass {
34
74
  /**
35
- * @param {CollectionComponentOptions} options
36
- * @param {string|vcsAppSymbol} owner
75
+ * @param {CollectionComponentClassOptions<T>} options
76
+ * @param {string|import("../../pluginHelper.js").vcsAppSymbol} owner
37
77
  */
38
78
  constructor(options, owner) {
39
79
  if (!options?.collection?.uniqueKey) {
40
80
  throw new Error(
41
- 'CollectionComponentOptions requires a collection with mandatory key!',
81
+ 'CollectionComponentClassOptions requires a collection with mandatory key!',
42
82
  );
43
83
  }
44
84
 
@@ -80,11 +120,19 @@ class CollectionComponent {
80
120
  /**
81
121
  * @type {import("vue").Ref<boolean>}
82
122
  */
83
- this.selectable = ref(options.selectable);
123
+ this.renamable = ref(parseBoolean(options.renamable, false));
124
+ /**
125
+ * @type {import("vue").Ref<boolean>}
126
+ */
127
+ this.removable = ref(parseBoolean(options.removable, false));
84
128
  /**
85
129
  * @type {import("vue").Ref<boolean>}
86
130
  */
87
- this.singleSelect = ref(options.singleSelect);
131
+ this.selectable = ref(parseBoolean(options.selectable));
132
+ /**
133
+ * @type {import("vue").Ref<boolean>}
134
+ */
135
+ this.singleSelect = ref(parseBoolean(options.singleSelect));
88
136
  /**
89
137
  * @type {string|vcsAppSymbol}
90
138
  * @private
@@ -92,29 +140,53 @@ class CollectionComponent {
92
140
  this._owner = owner;
93
141
 
94
142
  /**
95
- * @type {import("vue").Ref<Array<OwnedAction>>}
143
+ * @type {import("vue").Ref<Array<import("./collectionManager.js").OwnedAction>>}
96
144
  */
97
145
  this._actions = ref([]);
98
146
  /**
99
- * @type {Array<ItemMapping<*>>}
147
+ * @type {Array<import("./collectionManager.js").ItemMapping<T>>}
100
148
  * @private
101
149
  */
102
150
  this._itemMappings = [];
103
151
  /**
104
- * @type {Array<ItemFilter<*>>}
152
+ * @type {Array<import("./collectionManager.js").ItemFilter<T>>}
105
153
  * @private
106
154
  */
107
155
  this._itemFilters = [];
108
156
  /**
109
- * @type {import("vue").Ref<Array<import("@vcmap/ui").VcsListItem & { destroy: (function():void)|undefined }>>}
157
+ * @type {import("vue").Ref<Array<CollectionComponentListItem>>}
110
158
  * @private
111
159
  */
112
160
  this._listItems = ref([]);
113
161
  /**
114
- * @type {import("vue").Ref<Array<import("@vcmap/ui").VcsListItem & { destroy: (function():void)|undefined }>>}
162
+ * @type {import("vue").Ref<Array<CollectionComponentListItem>>}
115
163
  */
116
164
  this.selection = ref([]);
117
165
 
166
+ this._resetWatchers = [
167
+ watch(this.renamable, () => this.reset()),
168
+ watch([this.removable, this.selectable], () => {
169
+ if (this.removable.value && this.selectable.value) {
170
+ this._addBulkDeleteAction();
171
+ } else {
172
+ this._removeBulkDeleteAction();
173
+ }
174
+ this.reset();
175
+ }),
176
+ watch(this._draggable, () => {
177
+ if (!(this._collection instanceof IndexedCollection)) {
178
+ getLogger('CollectionComponentClass').warning(
179
+ 'draggable can only be set to IndexedCollections!',
180
+ );
181
+ this._draggable.value = false;
182
+ }
183
+ }),
184
+ ];
185
+ this._destroyBulkDelete = () => {};
186
+ if (this.removable.value && this.selectable.value) {
187
+ this._addBulkDeleteAction();
188
+ }
189
+
118
190
  this._listeners = [
119
191
  this._collection.added.addEventListener(this._handleItemAdded.bind(this)),
120
192
  this._collection.removed.addEventListener(
@@ -124,9 +196,9 @@ class CollectionComponent {
124
196
 
125
197
  if (this._collection[isOverrideCollection]) {
126
198
  this._listeners.push(
127
- this._collection.replaced.addEventListener((replacedEvent) => {
128
- this._handleItemRemoved(replacedEvent.old);
129
- }),
199
+ this._collection.replaced.addEventListener(
200
+ this._handleItemReplaced.bind(this),
201
+ ),
130
202
  );
131
203
  }
132
204
 
@@ -137,29 +209,25 @@ class CollectionComponent {
137
209
  ),
138
210
  );
139
211
  }
140
-
141
212
  this.reset();
142
213
  }
143
214
 
144
215
  /**
145
216
  * @type {string}
146
- * @readonly
147
217
  */
148
218
  get id() {
149
219
  return this._id;
150
220
  }
151
221
 
152
222
  /**
153
- * @type {import("@vcmap/core").Collection<*>}
154
- * @readonly
223
+ * @type {import("@vcmap/core").Collection<T>}
155
224
  */
156
225
  get collection() {
157
226
  return this._collection;
158
227
  }
159
228
 
160
229
  /**
161
- * @type {import("vue").Ref<Array<import("@vcmap/ui").VcsListItem & { destroy: (function():void)|undefined }>>}
162
- * @readonly
230
+ * @type {import("vue").Ref<Array<CollectionComponentListItem>>}
163
231
  */
164
232
  get items() {
165
233
  return this._listItems;
@@ -167,7 +235,6 @@ class CollectionComponent {
167
235
 
168
236
  /**
169
237
  * @type {import("vue").Ref<boolean>}
170
- * @readonly
171
238
  */
172
239
  get draggable() {
173
240
  return this._draggable;
@@ -175,36 +242,66 @@ class CollectionComponent {
175
242
 
176
243
  /**
177
244
  * @param {boolean} value
245
+ * @deprecated
178
246
  */
179
247
  set draggable(value) {
180
- if (this._collection instanceof IndexedCollection) {
181
- getLogger('CollectionComponent').warn(
182
- 'draggable can only be set to IndexedCollections!',
183
- );
184
- return;
185
- }
248
+ getLogger('CollectionComponentClass').deprecate('set draggable');
186
249
  this._draggable.value = value;
187
250
  }
188
251
 
189
252
  /**
190
- * @type {string|vcsAppSymbol}
191
- * @readonly
253
+ * @type {string|import("../../pluginHelper.js").vcsAppSymbol}
192
254
  */
193
255
  get owner() {
194
256
  return this._owner;
195
257
  }
196
258
 
197
259
  /**
198
- * @returns {import("vue").ComputedRef<VcsAction[]>}
260
+ * @returns {import("vue").ComputedRef<import("../../actions/actionHelper.js").VcsAction[]>}
199
261
  */
200
262
  getActions() {
201
263
  return computed(() => this._actions.value.map(({ action }) => action));
202
264
  }
203
265
 
204
266
  /**
205
- * uses the itemMappings to transform the given Item to an VcsListItem usable in the VcsList
267
+ * @private
268
+ */
269
+ _addBulkDeleteAction() {
270
+ const { action, destroy } = createListItemBulkAction(this.selection, {
271
+ name: 'list.delete',
272
+ callback: () => {
273
+ [...this.selection.value].forEach((listItem) => {
274
+ this._collection.remove(this._collection.getByKey(listItem.name));
275
+ });
276
+ },
277
+ });
278
+ this._destroyBulkDelete = destroy;
279
+ this.addActions([
280
+ {
281
+ action,
282
+ owner: this._owner,
283
+ weight: 100,
284
+ },
285
+ ]);
286
+ }
287
+
288
+ /**
289
+ * @private
290
+ */
291
+ _removeBulkDeleteAction() {
292
+ this._destroyBulkDelete();
293
+ const action = this._actions.value.find(
294
+ (a) => a.action.name === 'list.delete',
295
+ );
296
+ if (action) {
297
+ this.removeActions([action]);
298
+ }
299
+ }
300
+
301
+ /**
302
+ * uses the itemMappings to transform the given Item to an CollectionComponentListItem usable in the VcsList
206
303
  * @param {T} item
207
- * @returns {import("@vcmap/ui").VcsListItem & { destroy: (function():void)|undefined }}
304
+ * @returns {CollectionComponentListItem}
208
305
  * @template T
209
306
  * @private
210
307
  */
@@ -219,9 +316,21 @@ class CollectionComponent {
219
316
  disabled: item?.properties?.disabled,
220
317
  tooltip: item?.properties?.tooltip,
221
318
  icon: item?.properties?.icon,
222
- hasUpdate: item?.properties?.hasUpdate,
319
+ hasUpdate: false,
320
+ rename: false,
223
321
  actions: [],
322
+ clickedCallbacks: [],
323
+ destroy: undefined,
324
+ destroyFunctions: [],
224
325
  };
326
+ if (this.renamable.value) {
327
+ listItem.actions.push(createListItemRenameAction(listItem));
328
+ listItem.titleChanged = (newTitle) =>
329
+ titleChanged(item, listItem, newTitle);
330
+ }
331
+ if (this.removable.value) {
332
+ listItem.actions.push(createListItemDeleteAction(this._collection, item));
333
+ }
225
334
  this._itemMappings.forEach((itemMapping) => {
226
335
  if (
227
336
  itemMapping.predicate === undefined ||
@@ -230,16 +339,18 @@ class CollectionComponent {
230
339
  itemMapping.mappingFunction(item, this, listItem);
231
340
  }
232
341
  });
233
- listItem.actions = listItem.actions.filter((action) => {
234
- return validateAction(action);
235
- });
342
+ listItem.actions = listItem.actions
343
+ .filter((action) => {
344
+ return validateAction(action);
345
+ })
346
+ .sort((a, b) => sortByWeight(a.weight, b.weight));
236
347
  return listItem;
237
348
  }
238
349
 
239
350
  /**
240
351
  * Inserts the listItem into the list items array at the correct relative position in respect to the position of the listItem
241
352
  * in the collection
242
- * @param {import("@vcmap/ui").VcsListItem} listItem
353
+ * @param {CollectionComponentListItem} listItem
243
354
  * @private
244
355
  */
245
356
  _insertListItem(listItem) {
@@ -266,7 +377,7 @@ class CollectionComponent {
266
377
  }
267
378
 
268
379
  /**
269
- * synchronizes the category items with the internal items list.
380
+ * synchronizes the collection items with the internal items list.
270
381
  * @param {T} item
271
382
  * @template T
272
383
  * @private
@@ -282,6 +393,31 @@ class CollectionComponent {
282
393
  }
283
394
  }
284
395
 
396
+ /**
397
+ * synchronizes the collection items with the internal items list by preserving previous selection
398
+ * @param {import("@vcmap/core").ReplacedEvent<T>} replaced
399
+ * @private
400
+ */
401
+ _handleItemReplaced(replaced) {
402
+ const selectedIdx = this.selection.value.findIndex(
403
+ (l) => l.name === replaced.old[this.collection.uniqueKey],
404
+ );
405
+ this._handleItemRemoved(replaced.old);
406
+ if (selectedIdx > -1) {
407
+ const addedListener = this._collection.added.addEventListener((added) => {
408
+ if (added === replaced.new) {
409
+ const newListItem = this.items.value.find(
410
+ (l) => l.name === added[this.collection.uniqueKey],
411
+ );
412
+ if (newListItem) {
413
+ this.selection.value.splice(selectedIdx, 0, newListItem);
414
+ }
415
+ addedListener();
416
+ }
417
+ });
418
+ }
419
+ }
420
+
285
421
  /**
286
422
  * synchronizes the order of the list items with respect to the order of the items in the collection.
287
423
  * removes and reinserts the moved item.
@@ -318,16 +454,28 @@ class CollectionComponent {
318
454
  });
319
455
  if (index > -1) {
320
456
  const listItem = this._listItems.value[index];
321
- if (listItem.destroy) {
322
- listItem.destroy();
457
+ const selectionIdx = this.selection.value.indexOf(listItem);
458
+ if (selectionIdx > -1) {
459
+ this.selection.value.splice(selectionIdx, 1);
323
460
  }
461
+ destroyListItem(this._listItems.value[index]);
324
462
  this._listItems.value.splice(index, 1);
325
463
  }
326
464
  }
327
465
 
466
+ /**
467
+ * @param {T} item
468
+ * @template T
469
+ * @returns {CollectionComponentListItem|undefined}
470
+ */
471
+ getListItemForItem(item) {
472
+ const itemKey = item[this._collection.uniqueKey];
473
+ return this.items.value.find((i) => i.name === itemKey);
474
+ }
475
+
328
476
  /**
329
477
  * recreates the items array with the new Mapping Function
330
- * @param {ItemMapping} itemMapping
478
+ * @param {import("./collectionManager.js").ItemMapping<T>} itemMapping
331
479
  */
332
480
  addItemMapping(itemMapping) {
333
481
  if (
@@ -345,7 +493,7 @@ class CollectionComponent {
345
493
 
346
494
  /**
347
495
  * recreates the items array with the new Mapping Function
348
- * @param {ItemMapping} itemMapping
496
+ * @param {import("./collectionManager.js").ItemMapping<T>} itemMapping
349
497
  */
350
498
  removeItemMapping(itemMapping) {
351
499
  const index = this._itemMappings.findIndex(({ mappingFunction, owner }) => {
@@ -362,7 +510,7 @@ class CollectionComponent {
362
510
 
363
511
  /**
364
512
  * recreates the items array with the new Filter Function
365
- * @param {ItemFilter} itemFilter
513
+ * @param {import("./collectionManager.js").ItemFilter<T>} itemFilter
366
514
  */
367
515
  addItemFilter(itemFilter) {
368
516
  if (
@@ -380,7 +528,7 @@ class CollectionComponent {
380
528
 
381
529
  /**
382
530
  * recreates the items array with the new Filter Function
383
- * @param {ItemFilter} itemFilter
531
+ * @param {import("./collectionManager.js").ItemFilter<T>} itemFilter
384
532
  */
385
533
  removeItemFilter(itemFilter) {
386
534
  const index = this._itemFilters.findIndex(({ filterFunction, owner }) => {
@@ -396,7 +544,7 @@ class CollectionComponent {
396
544
  }
397
545
 
398
546
  /**
399
- * @param {Array<OwnedAction>} ownedActions
547
+ * @param {Array<import("./collectionManager.js").OwnedAction>} ownedActions
400
548
  */
401
549
  addActions(ownedActions) {
402
550
  const actions = [...this._actions.value, ...ownedActions];
@@ -404,11 +552,14 @@ class CollectionComponent {
404
552
  .filter((item, pos, self) => {
405
553
  return self.indexOf(item) === pos;
406
554
  })
407
- .sort(sortByWeight);
555
+ .sort(
556
+ (a, b) =>
557
+ sortByWeight(a.weight, b.weight) || sortByOwner(a.owner, b.owner),
558
+ );
408
559
  }
409
560
 
410
561
  /**
411
- * @param {Array<OwnedAction>} ownedActions
562
+ * @param {Array<import("./collectionManager.js").OwnedAction>} ownedActions
412
563
  */
413
564
  removeActions(ownedActions) {
414
565
  this._actions.value = this._actions.value.filter((ownedAction) => {
@@ -446,7 +597,7 @@ class CollectionComponent {
446
597
  * re-adding them from the collection applying current filter and mapping functions
447
598
  */
448
599
  reset() {
449
- this._listItems.value.forEach((i) => i.destroy?.());
600
+ this._listItems.value.forEach(destroyListItem);
450
601
  this._listItems.value = [];
451
602
  this.selection.value = [];
452
603
  [...this._collection]
@@ -461,10 +612,12 @@ class CollectionComponent {
461
612
 
462
613
  destroy() {
463
614
  this._listeners.forEach((cb) => cb());
464
- this._listItems.value.forEach((i) => i.destroy?.());
615
+ this._destroyBulkDelete();
616
+ this._resetWatchers.forEach((cb) => cb());
617
+ this._listItems.value.forEach(destroyListItem);
465
618
  this._listItems.value = [];
466
619
  this.selection.value = [];
467
620
  }
468
621
  }
469
622
 
470
- export default CollectionComponent;
623
+ export default CollectionComponentClass;
@@ -0,0 +1,200 @@
1
+ export default CollectionManager;
2
+ export type MappingFunction<T extends Object> = (arg0: T, arg1: import("./collectionComponentClass.js").default<T>, arg2: import("./collectionComponentClass.js").CollectionComponentListItem) => void;
3
+ export type PredicateFunction<T extends Object> = (arg0: T, arg1: import("./collectionComponentClass.js").default<T>) => boolean;
4
+ export type ItemMapping<T extends Object> = {
5
+ predicate?: PredicateFunction<T>;
6
+ mappingFunction: MappingFunction<T>;
7
+ owner: string | symbol;
8
+ };
9
+ export type ItemFilter<T extends Object> = {
10
+ filterFunction: PredicateFunction<T>;
11
+ owner: string | symbol;
12
+ };
13
+ export type OwnedAction = {
14
+ action: import("../../actions/actionHelper.js").VcsAction;
15
+ /**
16
+ * Optional weight affecting the displaying order
17
+ */
18
+ weight?: number | undefined;
19
+ owner: string | symbol;
20
+ };
21
+ export type ICollectionManager = import("../../vcsUiApp.js").VcsComponentManager<CollectionComponentClass<any>, import("./collectionComponentClass.js").CollectionComponentClassOptions<Object>>;
22
+ /**
23
+ * @typedef {function(T, import("./collectionComponentClass.js").default<T>, import("./collectionComponentClass.js").CollectionComponentListItem): void} MappingFunction
24
+ * @template {Object} T
25
+ */
26
+ /**
27
+ * @typedef {function(T, import("./collectionComponentClass.js").default<T>): boolean} PredicateFunction
28
+ * @template {Object} T
29
+ */
30
+ /**
31
+ * @typedef {{
32
+ * predicate?: PredicateFunction<T>,
33
+ * mappingFunction: MappingFunction<T>,
34
+ * owner: string | symbol,
35
+ * }} ItemMapping
36
+ * @template {Object} T
37
+ */
38
+ /**
39
+ * @typedef {{
40
+ * filterFunction: PredicateFunction<T>,
41
+ * owner: string | symbol
42
+ * }} ItemFilter
43
+ * @template {Object} T
44
+ */
45
+ /**
46
+ * @typedef {Object} OwnedAction
47
+ * @property {import("../../actions/actionHelper.js").VcsAction} action
48
+ * @property {number} [weight=0] Optional weight affecting the displaying order
49
+ * @property {string | symbol} owner
50
+ */
51
+ /**
52
+ * @typedef {import("../../vcsUiApp.js").VcsComponentManager<CollectionComponentClass, import("./collectionComponentClass.js").CollectionComponentClassOptions<Object>>} ICollectionManager
53
+ */
54
+ /**
55
+ * Manages a list of collections as collectionComponents.
56
+ * Sets the correct mapping/filter functions and actions on the collectionComponent
57
+ * Provides an API to add/remove collectionsComponents.
58
+ * @implements {ICollectionManager}
59
+ */
60
+ declare class CollectionManager implements ICollectionManager {
61
+ /**
62
+ * @type {VcsEvent<CollectionComponentClass<Object>>}
63
+ */
64
+ added: VcsEvent<CollectionComponentClass<Object>>;
65
+ /**
66
+ * @type {VcsEvent<CollectionComponentClass<Object>>}
67
+ */
68
+ removed: VcsEvent<CollectionComponentClass<Object>>;
69
+ /**
70
+ * @type {Array<string>}
71
+ */
72
+ componentIds: Array<string>;
73
+ /**
74
+ * @type {Map<string, CollectionComponentClass<Object>>}
75
+ * @private
76
+ */
77
+ private _collectionComponents;
78
+ /**
79
+ * @type {Array<ItemMapping & { collectionComponentIds:Array<string> }>}
80
+ * @private
81
+ */
82
+ private _itemMappings;
83
+ /**
84
+ * @type {Array<ItemFilter & { collectionComponentIds:Array<string> }>}
85
+ * @private
86
+ */
87
+ private _itemFilters;
88
+ /**
89
+ * @type {Array<{actions:Array<import("../../actions/actionHelper.js").VcsAction>,owner:string|symbol,collectionComponentIds:Array<string>}>}
90
+ * @private
91
+ */
92
+ private _actions;
93
+ /**
94
+ * @param {string} id
95
+ * @returns {CollectionComponentClass<Object>|undefined}
96
+ */
97
+ get(id: string): CollectionComponentClass<Object> | undefined;
98
+ /**
99
+ * @param {string} id
100
+ * @returns {boolean}
101
+ */
102
+ has(id: string): boolean;
103
+ /**
104
+ * @param {import("@vcmap/core").Collection<Object>} collection
105
+ * @returns {boolean}
106
+ */
107
+ hasCollection(collection: import("@vcmap/core").Collection<Object>): boolean;
108
+ /**
109
+ * gets all collection components corresponding to provided collection
110
+ * @param {import("@vcmap/core").Collection<T>} collection
111
+ * @returns {CollectionComponentClass<T>[]}
112
+ * @template {Object|import("@vcmap/core").VcsObject} T
113
+ */
114
+ getCollection<T extends Object | import("@vcmap/core/dist/src/vcsObject.js").default>(collection: Collection<T>): CollectionComponentClass<T>[];
115
+ /**
116
+ * adds a collectionComponent
117
+ * @param {import("./collectionComponentClass.js").CollectionComponentClassOptions<T>} collectionComponentOptions
118
+ * @param {string|symbol} owner
119
+ * @returns {CollectionComponentClass<T>}
120
+ * @template {Object|import("@vcmap/core").VcsObject} T
121
+ */
122
+ add<T_1 extends Object | import("@vcmap/core/dist/src/vcsObject.js").default>(collectionComponentOptions: import("./collectionComponentClass.js").CollectionComponentClassOptions<T_1>, owner: string | symbol): CollectionComponentClass<T_1>;
123
+ /**
124
+ * removes a CollectionComponentClass, Component will not be rendered anymore and will be destroyed. Add CollectionComponentClass again
125
+ * to show the component again
126
+ * @param {string} id
127
+ */
128
+ remove(id: string): void;
129
+ /**
130
+ * Gets affected ids for adding mapping and filter functions or actions.
131
+ * If no ids are provided, ids of all managed collectionComponents are returned.
132
+ * @param {Array<string>} [collectionComponentIds]
133
+ * @returns {string[]}
134
+ * @private
135
+ */
136
+ private _getAffectedIds;
137
+ /**
138
+ * adds MappingFunction to the collectionManager. For the given collectionComponents each Item will be transformed by the
139
+ * mappingFunction if the predicate returns true.
140
+ * @param {PredicateFunction<T>} predicate
141
+ * @param {MappingFunction<T>} mappingFunction
142
+ * @param {string | symbol} owner
143
+ * @param {Array<string>} [collectionComponentIds] list of collectionComponents this mappingFunction should be used on. If empty, mappingFunction is applied to all managed collectionComponents.
144
+ * @template {Object} T
145
+ */
146
+ addMappingFunction<T_2 extends Object>(predicate: PredicateFunction<T_2>, mappingFunction: MappingFunction<T_2>, owner: string | symbol, collectionComponentIds?: string[] | undefined): void;
147
+ /**
148
+ * removes the given mappingFunction
149
+ * @param {MappingFunction<T>} mappingFunction
150
+ * @param {string | symbol} owner
151
+ * @template {Object} T
152
+ */
153
+ removeMappingFunction<T_3 extends Object>(mappingFunction: MappingFunction<T_3>, owner: string | symbol): void;
154
+ /**
155
+ * @param {PredicateFunction<T>} filterFunction
156
+ * @param {string | symbol} owner
157
+ * @param {Array<string>} [collectionComponentIds] list of collectionComponents this filterFunction should be used on. If empty, filterFunction is applied to all managed collectionComponents.
158
+ * @template {Object} T
159
+ */
160
+ addFilterFunction<T_4 extends Object>(filterFunction: PredicateFunction<T_4>, owner: string | symbol, collectionComponentIds?: string[] | undefined): void;
161
+ /**
162
+ * removes the given filterFunction
163
+ * @param {PredicateFunction<T>} filterFunction
164
+ * @param {string | symbol} owner
165
+ * @template {Object} T
166
+ */
167
+ removeFilterFunction<T_5 extends Object>(filterFunction: PredicateFunction<T_5>, owner: string | symbol): void;
168
+ /**
169
+ * add multiple actions owned by the same owner
170
+ * @param {Array<import("../../actions/actionHelper.js").VcsAction>} actions
171
+ * @param {string | symbol} owner
172
+ * @param {Array<string>} [collectionComponentIds] list of collectionComponents this mappingFunction should be used on. If empty, actions are applied to all managed collectionComponents.
173
+ */
174
+ addActions(actions: Array<import("../../actions/actionHelper.js").VcsAction>, owner: string | symbol, collectionComponentIds?: string[] | undefined): void;
175
+ /**
176
+ * @param {Array<import("../../actions/actionHelper.js").VcsAction>} actions
177
+ * @param {string | symbol} owner
178
+ */
179
+ removeActions(actions: Array<import("../../actions/actionHelper.js").VcsAction>, owner: string | symbol): void;
180
+ /**
181
+ * removes managed collection components or actions and mapping/ filter functions belonging to the given owner.
182
+ * @param {string | symbol} owner
183
+ */
184
+ removeOwner(owner: string | symbol): void;
185
+ /**
186
+ * Resets all collectionComponents
187
+ */
188
+ reset(): void;
189
+ /**
190
+ * Clears the manager of all added categories and item mappings
191
+ */
192
+ clear(): void;
193
+ /**
194
+ * destroys the categoryManager, removes all Listeners and clears all Managed Categories
195
+ */
196
+ destroy(): void;
197
+ }
198
+ import CollectionComponentClass from './collectionComponentClass.js';
199
+ import { VcsEvent } from '@vcmap/core';
200
+ import { Collection } from '@vcmap/core';