@vcmap/ui 6.0.0-rc.2 → 6.0.0-rc.5

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 (278) hide show
  1. package/build/build.js +40 -60
  2. package/build/buildHelpers.js +62 -19
  3. package/build/bundle.js +1 -1
  4. package/build/info/conf.json +1 -1
  5. package/build/info/publish.js +25 -31
  6. package/build/lintTypes.js +5 -0
  7. package/config/base.config.json +2 -1
  8. package/config/dev.config.json +7 -1
  9. package/config/projects.config.json +2 -1
  10. package/config/splashscreen.config.json +45 -0
  11. package/config/www.config.json +25 -22
  12. package/dist/.htaccess +7 -0
  13. package/dist/assets/@mdi/font/README.md +25 -0
  14. package/dist/assets/@mdi/font/css/materialdesignicons.min-680621ca.css +3 -0
  15. package/dist/assets/@mdi/font/css/materialdesignicons.min.css.map +16 -0
  16. package/dist/assets/@mdi/font/fonts/materialdesignicons-webfont.woff2 +0 -0
  17. package/dist/assets/{cesium.0b750d.js → cesium-126f111a.js} +272 -385
  18. package/dist/assets/cesium.js +1 -1
  19. package/dist/assets/{core.cbf44a.js → core-1c8b8674.js} +2015 -2019
  20. package/dist/assets/core.js +1 -1
  21. package/dist/assets/{ol.86e93c.js → ol-27f9b3f3.js} +42521 -44394
  22. package/dist/assets/ol.js +1 -1
  23. package/dist/assets/ui-7214428e.css +1 -0
  24. package/dist/assets/{ui.7c276c.js → ui-7214428e.js} +13968 -13907
  25. package/dist/assets/ui.js +1 -1
  26. package/dist/assets/vue-c78a5f76.js +6083 -0
  27. package/dist/assets/vue.js +1 -1
  28. package/dist/assets/{vuetify.4d18fe.css → vuetify-88a2fabe.css} +2 -2
  29. package/dist/assets/{vuetify.4d18fe.js → vuetify-88a2fabe.js} +7793 -7940
  30. package/dist/assets/vuetify.js +1 -1
  31. package/dist/index.html +11 -10
  32. package/index.d.ts +11 -11
  33. package/index.html +5 -5
  34. package/index.js +9 -7
  35. package/lib/olLib.js +84 -23
  36. package/package.json +19 -19
  37. package/plugins/@vcmap-show-case/flight-component-example/src/FlightExample.vue +41 -1
  38. package/plugins/@vcmap-show-case/form-inputs-example/src/FormInputsExample.vue +71 -32
  39. package/plugins/@vcmap-show-case/form-inputs-example/src/exampleActions.js +7 -11
  40. package/plugins/@vcmap-show-case/form-inputs-example/src/index.js +2 -2
  41. package/plugins/@vcmap-show-case/list-example/src/ListExample.vue +21 -8
  42. package/plugins/@vcmap-show-case/project-selector/src/ModulesListComponent.vue +18 -11
  43. package/plugins/@vcmap-show-case/search-example/src/index.js +1 -0
  44. package/plugins/@vcmap-show-case/search-example/src/searchImpl.js +35 -5
  45. package/plugins/@vcmap-show-case/style-input-example/src/StyleExample.vue +29 -90
  46. package/plugins/@vcmap-show-case/toolbox-example/src/index.js +2 -1
  47. package/plugins/package.json +3 -23
  48. package/public/assets/@mdi/font/README.md +25 -0
  49. package/public/assets/@mdi/font/css/materialdesignicons.min.css +2 -2
  50. package/public/assets/@mdi/font/css/materialdesignicons.min.css.map +16 -0
  51. package/public/assets/@mdi/font/fonts/materialdesignicons-webfont.woff2 +0 -0
  52. package/src/actions/StyleSelector.vue +1 -1
  53. package/src/actions/actionHelper.js +33 -22
  54. package/src/actions/flightActions.js +5 -5
  55. package/src/actions/listActions.d.ts +4 -11
  56. package/src/actions/listActions.js +6 -22
  57. package/src/actions/stateRefAction.js +2 -2
  58. package/src/application/VcsApp.vue +147 -57
  59. package/src/application/VcsApp.vue.d.ts +298 -4
  60. package/src/application/VcsAttributions.vue +2 -13
  61. package/src/application/VcsAttributionsFooter.vue +10 -11
  62. package/src/application/VcsContainer.vue +26 -9
  63. package/src/application/VcsContainer.vue.d.ts +237 -0
  64. package/src/application/VcsMainMap.vue +7 -7
  65. package/src/application/VcsMainMap.vue.d.ts +2 -2
  66. package/src/application/VcsNavbar.vue +5 -1
  67. package/src/application/VcsPositionDisplay.vue +8 -23
  68. package/src/application/VcsPositionDisplay.vue.d.ts +0 -1
  69. package/src/application/VcsSettings.vue +10 -17
  70. package/src/application/VcsSplashScreen.vue +21 -40
  71. package/src/application/VcsSplashScreen.vue.d.ts +0 -2
  72. package/src/application/VcsTextPage.vue +12 -43
  73. package/src/application/VcsTextPage.vue.d.ts +4 -8
  74. package/src/application/VcsTextPageFooter.vue +23 -40
  75. package/src/components/buttons/VcsActionButtonList.vue +59 -3
  76. package/src/components/buttons/VcsActionButtonList.vue.d.ts +28 -0
  77. package/src/components/extent/VcsExtentEditor.vue +1 -1
  78. package/src/components/flight/VcsFlightAnchorsComponent.vue +63 -36
  79. package/src/components/flight/VcsFlightComponent.vue +16 -21
  80. package/src/components/flight/VcsFlightPlayer.vue +27 -5
  81. package/src/components/form-inputs-controls/VcsCheckbox.vue +9 -5
  82. package/src/components/form-inputs-controls/VcsChipArrayInput.vue +15 -13
  83. package/src/components/form-inputs-controls/VcsChipArrayInput.vue.d.ts +3 -4
  84. package/src/components/form-inputs-controls/VcsCoordinate.vue +17 -4
  85. package/src/components/form-inputs-controls/VcsCoordinate.vue.d.ts +5 -2
  86. package/src/components/form-inputs-controls/VcsDatePicker.vue +34 -60
  87. package/src/components/form-inputs-controls/VcsDatePicker.vue.d.ts +1 -63
  88. package/src/components/form-inputs-controls/VcsFileInput.vue +17 -18
  89. package/src/components/form-inputs-controls/VcsFileInput.vue.d.ts +1 -0
  90. package/src/components/form-inputs-controls/VcsLabel.vue +1 -1
  91. package/src/components/form-inputs-controls/VcsRadio.vue +17 -3
  92. package/src/components/form-inputs-controls/VcsRadio.vue.d.ts +1 -0
  93. package/src/components/form-inputs-controls/VcsSelect.vue +40 -31
  94. package/src/components/form-inputs-controls/VcsSelect.vue.d.ts +5 -2
  95. package/src/components/form-inputs-controls/VcsSlider.vue +13 -1
  96. package/src/components/form-inputs-controls/VcsSlider.vue.d.ts +1 -0
  97. package/src/components/form-inputs-controls/VcsTextArea.vue +27 -26
  98. package/src/components/form-inputs-controls/VcsTextArea.vue.d.ts +1 -0
  99. package/src/components/form-inputs-controls/VcsTextField.vue +20 -4
  100. package/src/components/form-inputs-controls/VcsTextField.vue.d.ts +9 -0
  101. package/src/components/form-inputs-controls/VcsWizardStep.vue +3 -6
  102. package/src/components/form-inputs-controls/vcsTextField.scss +9 -12
  103. package/src/components/form-output/VcsFormattedNumber.vue +21 -5
  104. package/src/components/form-output/VcsFormattedNumber.vue.d.ts +9 -0
  105. package/src/components/form-output/VcsMarkdown.vue +15 -12
  106. package/src/components/form-output/VcsMarkdown.vue.d.ts +1 -0
  107. package/src/components/form-output/markdownHelper.d.ts +30 -0
  108. package/src/components/form-output/markdownHelper.js +398 -0
  109. package/src/components/import/VcsFileDrop.vue +8 -5
  110. package/src/components/import/VcsImportComponent.vue +4 -3
  111. package/src/components/import/VcsImportComponent.vue.d.ts +1 -2
  112. package/src/components/lists/VcsActionList.vue +11 -7
  113. package/src/components/lists/VcsList.vue +30 -52
  114. package/src/components/lists/VcsList.vue.d.ts +14 -59
  115. package/src/components/lists/{VcsListItem.vue → VcsListItemComponent.vue} +68 -22
  116. package/src/components/lists/VcsListItemComponent.vue.d.ts +69 -0
  117. package/src/components/lists/VcsTreeview.vue +43 -16
  118. package/src/components/lists/VcsTreeview.vue.d.ts +14 -3
  119. package/src/components/lists/VcsTreeviewLeaf.vue +15 -6
  120. package/src/components/lists/VcsTreeviewSearchbar.vue +2 -2
  121. package/src/components/notification/VcsHelp.vue +1 -1
  122. package/src/components/notification/VcsHelp.vue.d.ts +3 -2
  123. package/src/components/section/VcsExpansionPanel.vue +101 -0
  124. package/src/components/section/VcsExpansionPanel.vue.d.ts +19 -0
  125. package/src/components/{form-inputs-controls → section}/VcsFormSection.vue +10 -4
  126. package/src/components/{form-inputs-controls → section}/VcsFormSection.vue.d.ts +1 -2
  127. package/src/components/style/MenuWrapper.vue +24 -26
  128. package/src/components/style/MenuWrapper.vue.d.ts +4 -4
  129. package/src/components/style/VcsFillMenu.vue +9 -16
  130. package/src/components/style/VcsFillMenu.vue.d.ts +0 -18
  131. package/src/components/style/VcsFillSelector.vue +13 -16
  132. package/src/components/style/VcsImageMenu.vue +8 -25
  133. package/src/components/style/VcsImageMenu.vue.d.ts +0 -27
  134. package/src/components/style/VcsImageSelector.vue +102 -167
  135. package/src/components/style/VcsImageSelector.vue.d.ts +15 -15
  136. package/src/components/style/VcsStrokeMenu.vue +8 -15
  137. package/src/components/style/VcsStrokeMenu.vue.d.ts +0 -18
  138. package/src/components/style/VcsStrokeSelector.vue +11 -18
  139. package/src/components/style/VcsTextMenu.vue +9 -12
  140. package/src/components/style/VcsTextMenu.vue.d.ts +0 -9
  141. package/src/components/style/VcsTextSelector.vue +79 -95
  142. package/src/components/style/VcsTextSelector.vue.d.ts +20 -22
  143. package/src/components/style/VcsVectorStyleComponent.vue +8 -19
  144. package/src/components/style/VcsVectorStyleComponent.vue.d.ts +1 -1
  145. package/src/components/style/composables.d.ts +0 -14
  146. package/src/components/style/composables.js +0 -49
  147. package/src/components/tables/VcsDataTable.vue +28 -22
  148. package/src/components/tables/VcsTable.vue +45 -62
  149. package/src/components/tables/VcsTable.vue.d.ts +30 -17
  150. package/src/components/tables/VcsTableCell.vue +72 -0
  151. package/src/components/tables/VcsTableCell.vue.d.ts +13 -0
  152. package/src/components/vector-properties/VcsFeatureEditingWindow.vue +43 -9
  153. package/src/components/vector-properties/VcsFeatureTransforms.vue +5 -0
  154. package/src/components/vector-properties/VcsVectorPropertiesComponent.vue +1 -1
  155. package/src/components/viewpoint/VcsViewpointComponent.vue +23 -10
  156. package/src/components/viewpoint/VcsViewpointEditor.vue +2 -1
  157. package/src/contentTree/LayerTree.vue +9 -27
  158. package/src/contentTree/LayerTree.vue.d.ts +1 -1
  159. package/src/contentTree/contentTreeCollection.d.ts +1 -0
  160. package/src/contentTree/contentTreeCollection.js +45 -11
  161. package/src/contentTree/contentTreeItem.d.ts +2 -2
  162. package/src/contentTree/contentTreeItem.js +7 -7
  163. package/src/featureInfo/BalloonComponent.vue +14 -15
  164. package/src/featureInfo/MarkdownBalloonComponent.vue +4 -2
  165. package/src/featureInfo/MarkdownBalloonComponent.vue.d.ts +2 -2
  166. package/src/featureInfo/abstractFeatureInfoView.d.ts +6 -0
  167. package/src/featureInfo/abstractFeatureInfoView.js +15 -7
  168. package/src/featureInfo/featureInfo.d.ts +5 -5
  169. package/src/featureInfo/featureInfo.js +59 -41
  170. package/src/featureInfo/iframeFeatureInfoView.d.ts +8 -2
  171. package/src/featureInfo/iframeFeatureInfoView.js +15 -5
  172. package/src/featureInfo/markdownBalloonFeatureInfoView.d.ts +1 -1
  173. package/src/featureInfo/markdownBalloonFeatureInfoView.js +5 -5
  174. package/src/featureInfo/markdownFeatureInfoView.d.ts +1 -1
  175. package/src/featureInfo/markdownFeatureInfoView.js +9 -11
  176. package/src/featureInfo/tableFeatureInfoView.js +13 -4
  177. package/src/init.d.ts +5 -38
  178. package/src/init.js +19 -18
  179. package/src/legend/StyleLegendItem.vue +4 -9
  180. package/src/legend/VcsLegend.vue +28 -54
  181. package/src/manager/buttonManager.js +4 -4
  182. package/src/manager/collectionManager/CollectionComponent.vue +17 -42
  183. package/src/manager/collectionManager/CollectionComponent.vue.d.ts +4 -2
  184. package/src/manager/collectionManager/CollectionComponentContent.vue +7 -6
  185. package/src/manager/collectionManager/CollectionComponentContent.vue.d.ts +3 -1
  186. package/src/manager/collectionManager/CollectionComponentList.vue +11 -9
  187. package/src/manager/collectionManager/CollectionComponentList.vue.d.ts +6 -4
  188. package/src/manager/collectionManager/CollectionComponentProvider.vue +1 -1
  189. package/src/manager/collectionManager/CollectionComponentStandalone.vue +3 -2
  190. package/src/manager/collectionManager/CollectionManager.vue +1 -1
  191. package/src/manager/collectionManager/collectionComponentClass.d.ts +1 -1
  192. package/src/manager/collectionManager/collectionComponentClass.js +7 -10
  193. package/src/manager/collectionManager/collectionManager.js +10 -10
  194. package/src/manager/collectionManager/editorCollectionComponentClass.js +6 -5
  195. package/src/manager/contextMenu/contextMenuManager.js +2 -2
  196. package/src/manager/navbarManager.js +2 -2
  197. package/src/manager/panel/PanelComponent.vue +2 -9
  198. package/src/manager/panel/PanelManagerComponent.vue +7 -3
  199. package/src/manager/panel/panelHelper.js +3 -3
  200. package/src/manager/panel/panelManager.d.ts +9 -1
  201. package/src/manager/panel/panelManager.js +18 -6
  202. package/src/manager/toolbox/GroupToolboxComponent.vue +8 -4
  203. package/src/manager/toolbox/GroupToolboxComponent.vue.d.ts +1 -0
  204. package/src/manager/toolbox/SelectToolboxComponent.vue +7 -4
  205. package/src/manager/toolbox/SelectToolboxComponent.vue.d.ts +1 -0
  206. package/src/manager/toolbox/ToolboxManager.vue +9 -6
  207. package/src/manager/toolbox/ToolboxManager.vue.d.ts +1 -0
  208. package/src/manager/toolbox/toolboxManager.js +10 -10
  209. package/src/manager/window/WindowComponent.vue +12 -8
  210. package/src/manager/window/WindowComponentHeader.vue +29 -8
  211. package/src/manager/window/WindowComponentHeader.vue.d.ts +2 -0
  212. package/src/manager/window/WindowManager.vue +2 -2
  213. package/src/manager/window/windowManager.d.ts +2 -2
  214. package/src/manager/window/windowManager.js +4 -4
  215. package/src/navigation/MapNavigation.vue +20 -0
  216. package/src/navigation/locatorHelper.js +1 -1
  217. package/src/navigation/overviewMap.js +1 -1
  218. package/src/notifier/NotifierComponent.vue +18 -15
  219. package/src/search/ResultItem.vue +18 -6
  220. package/src/search/ResultsComponent.vue +31 -20
  221. package/src/search/ResultsComponent.vue.d.ts +2 -1
  222. package/src/search/SearchComponent.vue +8 -14
  223. package/src/search/SearchComponent.vue.d.ts +1 -0
  224. package/src/search/search.js +2 -2
  225. package/src/siteConfig.js +9 -9
  226. package/src/state.js +4 -4
  227. package/src/styles/_typography.scss +0 -2
  228. package/src/styles/main.scss +0 -4
  229. package/src/uiConfig.d.ts +300 -5
  230. package/src/uiConfig.js +28 -16
  231. package/src/vcsUiApp.d.ts +21 -17
  232. package/src/vcsUiApp.js +11 -10
  233. package/src/vuePlugins/vuetify.d.ts +2 -0
  234. package/src/vuePlugins/vuetify.js +14 -0
  235. package/dist/assets/@mdi/font/css/materialdesignicons.css.map +0 -16
  236. package/dist/assets/@mdi/font/css/materialdesignicons.min.e3f476.css +0 -3
  237. package/dist/assets/index-8eGauqjA.js +0 -1
  238. package/dist/assets/ui.7c276c.css +0 -1
  239. package/dist/assets/vue.a3cd64.js +0 -6096
  240. package/public/assets/@mdi/font/css/materialdesignicons.css.map +0 -16
  241. package/src/application/VcsCustomScreen.vue +0 -45
  242. package/src/application/VcsCustomScreen.vue.d.ts +0 -15
  243. package/src/application/markdownHelper.d.ts +0 -12
  244. package/src/application/markdownHelper.js +0 -70
  245. package/src/components/lists/VcsListItem.vue.d.ts +0 -21
  246. package/src/components/notification/VcsTooltip.vue +0 -156
  247. package/src/components/notification/VcsTooltip.vue.d.ts +0 -27
  248. package/src/featureInfo/MarkdownComponent.vue +0 -16
  249. package/src/featureInfo/MarkdownComponent.vue.d.ts +0 -7
  250. package/src/styles/_theming.scss +0 -73
  251. package/src/styles/settings.scss +0 -6
  252. package/src/styles/shades.scss +0 -4
  253. package/src/styles/variables.scss +0 -140
  254. package/src/styles/vcsFont.scss +0 -2
  255. package/src/styles/vcsGrid.scss +0 -3
  256. /package/dist/assets/{favicon-128.4c4ce5.png → favicon-128-4c4ce5df.png} +0 -0
  257. /package/dist/assets/{favicon-180.5b99c0.png → favicon-180-4c4ce5df.png} +0 -0
  258. /package/dist/assets/{favicon-192.0e205e.png → favicon-192-4c4ce5df.png} +0 -0
  259. /package/dist/assets/{favicon-32.6b9add.png → favicon-32-4c4ce5df.png} +0 -0
  260. /package/dist/assets/{favicon.d5ec97.svg → favicon-4c4ce5df.svg} +0 -0
  261. /package/dist/assets/font/{TitilliumWeb-Regular.9ca076.woff2 → TitilliumWeb-Regular-9ca076be.woff2} +0 -0
  262. /package/dist/assets/style/{icon-marker.70960f.png → icon-marker-70960f05.png} +0 -0
  263. /package/dist/assets/style/{icon-marker-blue.534e37.png → icon-marker-blue-534e374b.png} +0 -0
  264. /package/dist/assets/style/{icon-marker-green.0b6a92.png → icon-marker-green-0b6a92bc.png} +0 -0
  265. /package/dist/assets/style/{icon-marker-o.036477.png → icon-marker-o-036477fa.png} +0 -0
  266. /package/dist/assets/style/{icon-marker-o-blue.7b6d62.png → icon-marker-o-blue-7b6d6279.png} +0 -0
  267. /package/dist/assets/style/{icon-marker-o-green.c863c0.png → icon-marker-o-green-c863c0fa.png} +0 -0
  268. /package/dist/assets/style/{icon-marker-o-red.93ff58.png → icon-marker-o-red-93ff58df.png} +0 -0
  269. /package/dist/assets/style/{icon-marker-red.313d03.png → icon-marker-red-313d03e8.png} +0 -0
  270. /package/dist/assets/style/{icon-pin.b7ce77.png → icon-pin-b7ce771e.png} +0 -0
  271. /package/dist/assets/style/{icon-pin-blue.7be369.png → icon-pin-blue-7be369a3.png} +0 -0
  272. /package/dist/assets/style/{icon-pin-green.cbb935.png → icon-pin-green-cbb935fe.png} +0 -0
  273. /package/dist/assets/style/{icon-pin-red.3f25b2.png → icon-pin-red-3f25b245.png} +0 -0
  274. /package/public/assets/{favicon-128.png → favicon-128-4c4ce5df.png} +0 -0
  275. /package/public/assets/{favicon-180.png → favicon-180-4c4ce5df.png} +0 -0
  276. /package/public/assets/{favicon-192.png → favicon-192-4c4ce5df.png} +0 -0
  277. /package/public/assets/{favicon-32.png → favicon-32-4c4ce5df.png} +0 -0
  278. /package/public/assets/{favicon.svg → favicon-4c4ce5df.svg} +0 -0
@@ -32,7 +32,7 @@
32
32
  </template>
33
33
  </v-list-item>
34
34
  <template v-for="(item, index) in renderingItems">
35
- <VcsListItem
35
+ <VcsListItemComponent
36
36
  v-if="item"
37
37
  :dragging="dragging === index"
38
38
  :item="item"
@@ -56,18 +56,17 @@
56
56
  'cursor-pointer': selectable && !isDraggable,
57
57
  }"
58
58
  @click="select(item, $event)"
59
- @item-renamed="$emit('item-renamed', $event)"
60
59
  >
61
- <template #prepend-title>
62
- <slot name="item.prepend-title" :item="item" :index="index" />
60
+ <template #title="titleScope">
61
+ <slot name="item.title" v-bind="{ ...titleScope, index }"></slot>
63
62
  </template>
64
- <template #title>
65
- <slot name="item.title" :item="item" :index="index"></slot>
63
+ <template #subtitle="subtitleScope">
64
+ <slot name="item.subtitle" v-bind="{ ...subtitleScope, index }" />
66
65
  </template>
67
- <template #append-title>
68
- <slot name="item.append-title" :item="item" :index="index" />
66
+ <template #default="scope">
67
+ <slot name="item.default" v-bind="{ ...scope, index }" />
69
68
  </template>
70
- </VcsListItem>
69
+ </VcsListItemComponent>
71
70
  <slot name="item.intermediate" :item="item" :index="index" />
72
71
  <div
73
72
  v-if="hasIntermediateSlot"
@@ -95,14 +94,14 @@
95
94
  VListItemTitle,
96
95
  VTooltip,
97
96
  } from 'vuetify/components';
97
+ import VcsListItemComponent from './VcsListItemComponent.vue';
98
98
  import VcsActionButtonList from '../buttons/VcsActionButtonList.vue';
99
99
  import VcsTreeviewSearchbar from './VcsTreeviewSearchbar.vue';
100
- import VcsListItem from './VcsListItem.vue';
101
100
  import { createEllipseTooltip } from '../composables.js';
102
101
 
103
102
  /**
104
- * @param {import("vue").Ref<VcsListItem[]>} items
105
- * @param {import("vue").ShallowRef<VcsListItem[]>} selected
103
+ * @param {import("vue").Ref<import("./VcsListItemComponent.vue").VcsListItem[]>} items
104
+ * @param {import("vue").ShallowRef<import("./VcsListItemComponent.vue").VcsListItem[]>} selected
106
105
  * @param {function(string, ...any[]):void} emit
107
106
  * @returns {Array<import("../../actions/actionHelper.js").VcsAction>}
108
107
  */
@@ -139,34 +138,12 @@
139
138
  ];
140
139
  }
141
140
 
142
- /**
143
- * @typedef {Object} VcsListItem
144
- * @property {string} name
145
- * @property {boolean} [visible] - Whether to display this item or not.
146
- * @property {boolean} [disabled] - Whether this item should be displayed as disabled.
147
- * @property {boolean} [rename] - Whether the title of can be edited. will add a rename action to the end of the action list
148
- * @property {string} title - The title to be displayed
149
- * @property {string} [tooltip]
150
- * @property {string|HTMLCanvasElement|HTMLImageElement|undefined} [icon] - An optional icon to display with this item. Can be a URL or HTMLElement.
151
- * @property {boolean} [hasUpdate] - Shows badge, if item has an update.
152
- * @property {Array<import("../../actions/actionHelper.js").VcsAction>} [actions]
153
- * @property {Array<function(PointerEvent):void>|undefined} [clickedCallbacks] - An array of callbacks called on item click. called before selection update
154
- * @property {function(boolean):void} [selectionChanged] - A callback called if the selection changes with the current selection status. called before value update
155
- * @property {function(string):void} [titleChanged] - A callback called if the title changes via rename action. called before value update
156
- */
157
-
158
141
  /**
159
142
  * @typedef {Object} ItemMovedEvent
160
- * @property {VcsListItem} item
143
+ * @property {import("./VcsListItemComponent.vue").VcsListItem} item
161
144
  * @property {number} targetIndex
162
145
  */
163
146
 
164
- /**
165
- * @typedef {Object} ItemRenamedEvent
166
- * @property {VcsListItem} item
167
- * @property {string} newTitle
168
- */
169
-
170
147
  /**
171
148
  * @description
172
149
  * The VCS list is intended to render items. Items can be selectable (by default, more than one) or only a single item can
@@ -179,12 +156,12 @@
179
156
  * Clicking with CTRL adds or removes to a selection set.
180
157
  * Clicking with SHIFT will create a selection range, starting or ending with the first item in the list
181
158
  * or the last normally selected item (not the last item clicked with CTRL for instance).
182
- * @vue-prop {Array<VcsListItem>} items
159
+ * @vue-prop {Array<import("./VcsListItemComponent.vue").VcsListItem>} items
183
160
  * @vue-prop {boolean} [draggable=false]
184
161
  * @vue-prop {boolean} [selectable=false]
185
162
  * @vue-prop {boolean} [singleSelect=false]
186
- * @vue-prop {Array<VcsListItem>} [value=[]] - the initial items to be selected.
187
- * @vue-prop {boolean} [searchable=false] - if this list can have its items searched. you can provide your own predicate function by providing "filterPredicate" which is of type function(VcsListItem, string):boolean
163
+ * @vue-prop {Array<import("./VcsListItemComponent.vue").VcsListItem>} [value=[]] - the initial items to be selected.
164
+ * @vue-prop {boolean} [searchable=false] - if this list can have its items searched. you can provide your own predicate function by providing "filterPredicate" which is of type function(import("./VcsListItemComponent.vue").VcsListItem, string):boolean
188
165
  * @vue-prop {string} [searchbarPlaceholder] - placeholder to render inside the search field
189
166
  * @vue-prop {boolean} [showTitle=true] - show the title component
190
167
  * @vue-prop {number} [actionButtonListOverflowCount] - overflow count to use for action lists in the title and items
@@ -193,7 +170,6 @@
193
170
  * @vue-prop {string} [tooltip] - tooltip to render on the list title
194
171
  * @vue-prop {Array<import("../../actions/actionHelper.js").VcsAction>} [actions] - actions to render in the list title
195
172
  * @vue-event {ItemMovedEvent} item-moved - event triggered after item was dragged and is dropped
196
- * @vue-event {ItemRenamedEvent} item-renamed - event triggered after item was renamed
197
173
  * @vue-data {slot} [#item.prepend-title] - A slot to adapt the list item titel, adding content before the title. Binds item and index.
198
174
  * @vue-data {slot} [#item.title] - A slot to adapt the list item titel. Default content is a span or VcsTextField for active rename action. Binds item and index.
199
175
  * @vue-data {slot} [#item.append-title] - A slot to adapt the list item titel, adding content after the title. Binds item and index.
@@ -202,7 +178,7 @@
202
178
  export default {
203
179
  name: 'VcsList',
204
180
  components: {
205
- VcsListItem,
181
+ VcsListItemComponent,
206
182
  VcsTreeviewSearchbar,
207
183
  VcsActionButtonList,
208
184
  VTooltip,
@@ -271,7 +247,7 @@
271
247
  },
272
248
  },
273
249
  setup(props, { emit, slots }) {
274
- /** @type {import("vue").ShallowRef<Array<VcsListItem>>} */
250
+ /** @type {import("vue").ShallowRef<Array<import("./VcsListItemComponent.vue").VcsListItem>>} */
275
251
  const selected = shallowRef([]);
276
252
  /** @type {import("vue").Ref<string>} */
277
253
  const query = ref('');
@@ -327,7 +303,7 @@
327
303
  );
328
304
 
329
305
  const vm = getCurrentInstance().proxy;
330
- /** @type {function(VcsListItem, string):boolean} */
306
+ /** @type {function(import("./VcsListItemComponent.vue").VcsListItem, string):boolean} */
331
307
  const filterPredicate = inject(
332
308
  'filterPredicate',
333
309
  (item, queryString = '') => {
@@ -339,7 +315,7 @@
339
315
  );
340
316
 
341
317
  /**
342
- * @type {VcsListItem|null}
318
+ * @type {import("./VcsListItemComponent.vue").VcsListItem|null}
343
319
  */
344
320
  let draggedItem = null;
345
321
 
@@ -364,7 +340,7 @@
364
340
 
365
341
  /**
366
342
  * @param {MouseEvent} e
367
- * @param {VcsListItem} item
343
+ * @param {import("./VcsListItemComponent.vue").VcsListItem} item
368
344
  * @param {number} index
369
345
  */
370
346
  function drag(e, item, index) {
@@ -377,7 +353,7 @@
377
353
  }
378
354
 
379
355
  /**
380
- * @type {import("vue").ComputedRef<Array<VcsListItem>>}
356
+ * @type {import("vue").ComputedRef<Array<import("./VcsListItemComponent.vue").VcsListItem>>}
381
357
  */
382
358
  const renderingItems = computed(() => {
383
359
  let items = props.items.filter((i) => i.visible !== false);
@@ -416,13 +392,13 @@
416
392
  */
417
393
  renderingActions,
418
394
  /**
419
- * @type {import("vue").ComputedRef<Array<VcsListItem>>}
395
+ * @type {import("vue").ComputedRef<Array<import("./VcsListItemComponent.vue").VcsListItem>>}
420
396
  */
421
397
  renderingItems,
422
- /** @type {import("vue").ShallowRef<Array<VcsListItem>>} */
398
+ /** @type {import("vue").ShallowRef<Array<import("./VcsListItemComponent.vue").VcsListItem>>} */
423
399
  selected,
424
400
  /**
425
- * @param {import("vue").UnwrapNestedRef<VcsListItem>} item
401
+ * @param {import("vue").UnwrapNestedRef<import("./VcsListItemComponent.vue").VcsListItem>} item
426
402
  * @param {PointerEvent} event
427
403
  */
428
404
  select(item, event) {
@@ -516,7 +492,7 @@
516
492
  emit('update:modelValue', selected.value);
517
493
  },
518
494
  /**
519
- * @param {import("vue").UnwrapNestedRefs<VcsListItem>} item
495
+ * @param {import("vue").UnwrapNestedRefs<import("./VcsListItemComponent.vue").VcsListItem>} item
520
496
  */
521
497
  add(item) {
522
498
  if (!isReactive(item)) {
@@ -529,7 +505,7 @@
529
505
  }
530
506
  },
531
507
  /**
532
- * @param {import("vue").UnwrapNestedRefs<VcsListItem>} item
508
+ * @param {import("vue").UnwrapNestedRefs<import("./VcsListItemComponent.vue").VcsListItem>} item
533
509
  */
534
510
  remove(item) {
535
511
  if (selected.value.includes(item) && !item.disabled) {
@@ -577,7 +553,8 @@
577
553
  .v-list-item__selected {
578
554
  border-left: solid 4px;
579
555
  border-left-color: rgb(var(--v-theme-primary));
580
- padding-left: 13px !important;
556
+ color: rgb(var(--v-theme-primary));
557
+ padding-left: 12px !important;
581
558
  }
582
559
  .v-list-item--active {
583
560
  .v-list-item__append {
@@ -604,10 +581,11 @@
604
581
  }
605
582
 
606
583
  &:not(.vcs-list__selectable) {
584
+ cursor: auto;
585
+
607
586
  .v-list-item--link {
608
587
  cursor: auto;
609
588
  }
610
- cursor: auto;
611
589
 
612
590
  &:hover {
613
591
  .v-list-item__overlay {
@@ -1,10 +1,10 @@
1
1
  /**
2
- * @param {import("vue").Ref<VcsListItem[]>} items
3
- * @param {import("vue").ShallowRef<VcsListItem[]>} selected
2
+ * @param {import("vue").Ref<import("./VcsListItemComponent.vue").VcsListItem[]>} items
3
+ * @param {import("vue").ShallowRef<import("./VcsListItemComponent.vue").VcsListItem[]>} selected
4
4
  * @param {function(string, ...any[]):void} emit
5
5
  * @returns {Array<import("../../actions/actionHelper.js").VcsAction>}
6
6
  */
7
- export function createSelectionActions(items: import("vue").Ref<VcsListItem[]>, selected: import("vue").ShallowRef<VcsListItem[]>, emit: (arg0: string, ...args: any[][]) => void): Array<import("../../actions/actionHelper.js").VcsAction>;
7
+ export function createSelectionActions(items: import("vue").Ref<import("./VcsListItemComponent.vue").VcsListItem[]>, selected: import("vue").ShallowRef<import("./VcsListItemComponent.vue").VcsListItem[]>, emit: (arg0: string, ...args: any[][]) => void): Array<import("../../actions/actionHelper.js").VcsAction>;
8
8
  declare const _default: import("vue").DefineComponent<{
9
9
  items: {
10
10
  type: ArrayConstructor;
@@ -76,26 +76,26 @@ declare const _default: import("vue").DefineComponent<{
76
76
  */
77
77
  renderingActions: import("vue").ComputedRef<Array<import("../../actions/actionHelper.js").VcsAction>>;
78
78
  /**
79
- * @type {import("vue").ComputedRef<Array<VcsListItem>>}
79
+ * @type {import("vue").ComputedRef<Array<import("./VcsListItemComponent.vue").VcsListItem>>}
80
80
  */
81
- renderingItems: import("vue").ComputedRef<Array<VcsListItem>>;
82
- /** @type {import("vue").ShallowRef<Array<VcsListItem>>} */
83
- selected: import("vue").ShallowRef<Array<VcsListItem>>;
81
+ renderingItems: import("vue").ComputedRef<Array<import("./VcsListItemComponent.vue").VcsListItem>>;
82
+ /** @type {import("vue").ShallowRef<Array<import("./VcsListItemComponent.vue").VcsListItem>>} */
83
+ selected: import("vue").ShallowRef<Array<import("./VcsListItemComponent.vue").VcsListItem>>;
84
84
  /**
85
- * @param {import("vue").UnwrapNestedRef<VcsListItem>} item
85
+ * @param {import("vue").UnwrapNestedRef<import("./VcsListItemComponent.vue").VcsListItem>} item
86
86
  * @param {PointerEvent} event
87
87
  */
88
88
  select(item: any, event: PointerEvent): void;
89
89
  /**
90
- * @param {import("vue").UnwrapNestedRefs<VcsListItem>} item
90
+ * @param {import("vue").UnwrapNestedRefs<import("./VcsListItemComponent.vue").VcsListItem>} item
91
91
  */
92
- add(item: import("vue").UnwrapNestedRefs<VcsListItem>): void;
92
+ add(item: import("vue").UnwrapNestedRefs<import("./VcsListItemComponent.vue").VcsListItem>): void;
93
93
  /**
94
- * @param {import("vue").UnwrapNestedRefs<VcsListItem>} item
94
+ * @param {import("vue").UnwrapNestedRefs<import("./VcsListItemComponent.vue").VcsListItem>} item
95
95
  */
96
- remove(item: import("vue").UnwrapNestedRefs<VcsListItem>): void;
96
+ remove(item: import("vue").UnwrapNestedRefs<import("./VcsListItemComponent.vue").VcsListItem>): void;
97
97
  clear(): void;
98
- drag: (e: MouseEvent, item: VcsListItem, index: number) => void;
98
+ drag: (e: MouseEvent, item: import("./VcsListItemComponent.vue").VcsListItem, index: number) => void;
99
99
  drop: (e: MouseEvent, targetIndex: number) => void;
100
100
  listHeader: import("vue").Ref<any>;
101
101
  listHeaderTooltip: import("vue").ComputedRef<string>;
@@ -173,52 +173,7 @@ declare const _default: import("vue").DefineComponent<{
173
173
  showTitle: boolean;
174
174
  }, {}>;
175
175
  export default _default;
176
- export type VcsListItem = {
177
- name: string;
178
- /**
179
- * - Whether to display this item or not.
180
- */
181
- visible?: boolean | undefined;
182
- /**
183
- * - Whether this item should be displayed as disabled.
184
- */
185
- disabled?: boolean | undefined;
186
- /**
187
- * - Whether the title of can be edited. will add a rename action to the end of the action list
188
- */
189
- rename?: boolean | undefined;
190
- /**
191
- * - The title to be displayed
192
- */
193
- title: string;
194
- tooltip?: string | undefined;
195
- /**
196
- * - An optional icon to display with this item. Can be a URL or HTMLElement.
197
- */
198
- icon?: string | HTMLCanvasElement | HTMLImageElement | undefined;
199
- /**
200
- * - Shows badge, if item has an update.
201
- */
202
- hasUpdate?: boolean | undefined;
203
- actions?: import("../../actions/actionHelper.js", { with: { "resolution-mode": "import" } }).VcsAction[] | undefined;
204
- /**
205
- * - An array of callbacks called on item click. called before selection update
206
- */
207
- clickedCallbacks?: Array<(arg0: PointerEvent) => void> | undefined;
208
- /**
209
- * - A callback called if the selection changes with the current selection status. called before value update
210
- */
211
- selectionChanged?: ((arg0: boolean) => void) | undefined;
212
- /**
213
- * - A callback called if the title changes via rename action. called before value update
214
- */
215
- titleChanged?: ((arg0: string) => void) | undefined;
216
- };
217
176
  export type ItemMovedEvent = {
218
- item: VcsListItem;
177
+ item: import("./VcsListItemComponent.vue").VcsListItem;
219
178
  targetIndex: number;
220
179
  };
221
- export type ItemRenamedEvent = {
222
- item: VcsListItem;
223
- newTitle: string;
224
- };
@@ -6,13 +6,30 @@
6
6
  VTooltip,
7
7
  } from 'vuetify/components';
8
8
  import { computed, ref } from 'vue';
9
+ import { is } from '@vcsuite/check';
9
10
  import VcsBadge from '../notification/VcsBadge.vue';
10
11
  import VcsActionButtonList from '../buttons/VcsActionButtonList.vue';
11
12
  import VcsTextField from '../form-inputs-controls/VcsTextField.vue';
12
13
  import { createEllipseTooltip } from '../composables.js';
13
14
 
15
+ /**
16
+ * @typedef {Object} VcsListItem
17
+ * @property {string} name
18
+ * @property {boolean} [visible] - Whether to display this item or not.
19
+ * @property {boolean} [disabled] - Whether this item should be displayed as disabled.
20
+ * @property {boolean|import("../../actions/actionHelper.js").ActionOptions} [renamable] - Whether the title of can be edited. will add a rename action to the end of the action list. This action will call titleChanged with the new title, you must provide the callback yourself, otherwise this does not work as expeted.
21
+ * @property {string} title - The title to be displayed
22
+ * @property {string} [tooltip]
23
+ * @property {string|HTMLCanvasElement|HTMLImageElement|undefined} [icon] - An optional icon to display with this item. Can be a URL or HTMLElement.
24
+ * @property {boolean} [hasUpdate] - Shows badge, if item has an update.
25
+ * @property {Array<import("../../actions/actionHelper.js").VcsAction>} [actions]
26
+ * @property {Array<function(PointerEvent):void>|undefined} [clickedCallbacks] - An array of callbacks called on item click. called before selection update
27
+ * @property {function(boolean):void} [selectionChanged] - A callback called if the selection changes with the current selection status. called before value update
28
+ * @property {function(string):void} [titleChanged] - A callback called if the title changes via rename action. only usable with renamble true.
29
+ */
30
+
14
31
  const props = defineProps({
15
- /** @type {import("./VcsList.vue").VcsListItem} */
32
+ /** @type {VcsListItem} */
16
33
  item: {
17
34
  type: Object,
18
35
  required: true,
@@ -27,17 +44,35 @@
27
44
  },
28
45
  });
29
46
 
30
- const emits = defineEmits(['item-renamed']);
47
+ const rename = ref(false);
48
+ const renameAction = computed(() => {
49
+ if (props.item.renamable) {
50
+ return {
51
+ name: 'list.renameItem',
52
+ ...(is(props.item.renamable, Object) ? props.item.renamable : {}),
53
+ callback() {
54
+ rename.value = true;
55
+ },
56
+ };
57
+ }
58
+ return undefined;
59
+ });
31
60
 
32
61
  function renameOff() {
33
- // eslint-disable-next-line vue/no-mutating-props
34
- props.item.rename = false;
62
+ rename.value = false;
35
63
  }
36
64
 
65
+ const actions = computed(() => {
66
+ if (renameAction.value) {
67
+ return [...(props.item?.actions || []), renameAction.value];
68
+ }
69
+ return [...(props.item?.actions || [])];
70
+ });
71
+
37
72
  const title = ref();
38
73
  const tooltip = createEllipseTooltip(
39
74
  computed(() => {
40
- if (props.item?.rename) {
75
+ if (rename.value) {
41
76
  return undefined;
42
77
  }
43
78
  return title.value?.$el;
@@ -46,9 +81,8 @@
46
81
  computed(() => props.item?.title),
47
82
  );
48
83
 
49
- function rename(item, newTitle) {
84
+ function renameItem(item, newTitle) {
50
85
  if (newTitle) {
51
- emits('item-renamed', { item, newTitle });
52
86
  item.titleChanged?.(newTitle);
53
87
  }
54
88
  }
@@ -61,15 +95,17 @@
61
95
  {{ item.icon }}
62
96
  </v-icon>
63
97
  </template>
64
- <template #default>
65
- <v-list-item-title ref="title">
66
- <slot name="prepend-title" :item="item" />
67
- <slot name="title" :item="item">
98
+ <template #title>
99
+ <slot name="title" v-bind="{ item, dragging, tooltip }">
100
+ <v-list-item-title
101
+ ref="title"
102
+ :class="{ 'vcs-list-item__rename': rename }"
103
+ >
68
104
  <vcs-text-field
69
- v-if="item.rename"
105
+ v-if="rename"
70
106
  :model-value="item.title"
71
107
  autofocus
72
- @update:model-value="(value) => rename(item, value)"
108
+ @update:model-value="(value) => renameItem(item, value)"
73
109
  @click.stop
74
110
  @keydown.enter="renameOff"
75
111
  @blur="renameOff"
@@ -79,18 +115,23 @@
79
115
  <template v-else>
80
116
  {{ $st(item.title) }}
81
117
  </template>
82
- </slot>
83
- <slot name="append-title" :item="item" class="ml-auto" />
84
- <v-tooltip v-if="dragging === false && tooltip" activator="parent">
85
- {{ $st(tooltip) }}
86
- </v-tooltip>
87
- </v-list-item-title>
118
+ <v-tooltip v-if="dragging === false && tooltip" activator="parent">
119
+ {{ $st(tooltip) }}
120
+ </v-tooltip>
121
+ </v-list-item-title>
122
+ </slot>
123
+ </template>
124
+ <template #subtitle>
125
+ <slot name="subtitle" v-bind="{ item }" />
126
+ </template>
127
+ <template #default="scope">
128
+ <slot name="default" v-bind="{ ...scope, item, dragging, tooltip }" />
88
129
  </template>
89
130
  <template #append>
90
131
  <vcs-badge v-if="item.hasUpdate" class="mr-1" />
91
132
  <vcs-action-button-list
92
- v-if="item.actions?.length > 0"
93
- :actions="item.actions"
133
+ v-if="actions.length > 0"
134
+ :actions="actions"
94
135
  :disabled="item.disabled"
95
136
  :block-overflow="true"
96
137
  :overflow-count="actionButtonListOverflowCount"
@@ -102,7 +143,9 @@
102
143
 
103
144
  <style lang="scss" scoped>
104
145
  .v-list-item {
105
- padding: 4px 8px 4px 16px;
146
+ padding: 4px 8px 4px 8px;
147
+ padding-inline-end: 8px !important;
148
+ padding-inline-start: 16px !important;
106
149
  &.border-bottom {
107
150
  border-bottom: solid;
108
151
  border-bottom-color: rgb(var(--v-theme-base-lighten-2));
@@ -150,5 +193,8 @@
150
193
  :deep(.v-list-item__overlay) {
151
194
  background-color: transparent;
152
195
  }
196
+ :deep(.vcs-list-item__rename) {
197
+ color: rgb(var(--v-theme-on-surface));
198
+ }
153
199
  }
154
200
  </style>
@@ -0,0 +1,69 @@
1
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {
2
+ $props: {
3
+ readonly [x: string]: any;
4
+ };
5
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>, {
6
+ title?(_: {
7
+ item: any;
8
+ dragging: any;
9
+ tooltip: string;
10
+ }): any;
11
+ subtitle?(_: {
12
+ item: any;
13
+ }): any;
14
+ default?(_: {
15
+ item: any;
16
+ dragging: any;
17
+ tooltip: string;
18
+ isActive: boolean;
19
+ isOpen: boolean;
20
+ isSelected: boolean;
21
+ isIndeterminate: boolean;
22
+ select: (value: boolean) => void;
23
+ }): any;
24
+ }>;
25
+ export default _default;
26
+ export type VcsListItem = {
27
+ name: string;
28
+ /**
29
+ * - Whether to display this item or not.
30
+ */
31
+ visible?: boolean | undefined;
32
+ /**
33
+ * - Whether this item should be displayed as disabled.
34
+ */
35
+ disabled?: boolean | undefined;
36
+ /**
37
+ * - Whether the title of can be edited. will add a rename action to the end of the action list. This action will call titleChanged with the new title, you must provide the callback yourself, otherwise this does not work as expeted.
38
+ */
39
+ renamable?: boolean | import("../../actions/actionHelper.js", { with: { "resolution-mode": "import" } }).ActionOptions | undefined;
40
+ /**
41
+ * - The title to be displayed
42
+ */
43
+ title: string;
44
+ tooltip?: string | undefined;
45
+ /**
46
+ * - An optional icon to display with this item. Can be a URL or HTMLElement.
47
+ */
48
+ icon?: string | HTMLCanvasElement | HTMLImageElement | undefined;
49
+ /**
50
+ * - Shows badge, if item has an update.
51
+ */
52
+ hasUpdate?: boolean | undefined;
53
+ actions?: import("../../actions/actionHelper.js", { with: { "resolution-mode": "import" } }).VcsAction[] | undefined;
54
+ /**
55
+ * - An array of callbacks called on item click. called before selection update
56
+ */
57
+ clickedCallbacks?: Array<(arg0: PointerEvent) => void> | undefined;
58
+ /**
59
+ * - A callback called if the selection changes with the current selection status. called before value update
60
+ */
61
+ selectionChanged?: ((arg0: boolean) => void) | undefined;
62
+ /**
63
+ * - A callback called if the title changes via rename action. only usable with renamble true.
64
+ */
65
+ titleChanged?: ((arg0: string) => void) | undefined;
66
+ };
67
+ type __VLS_WithTemplateSlots<T, S> = T & (new () => {
68
+ $slots: S;
69
+ });
@@ -3,17 +3,20 @@
3
3
  <VcsTreeviewSearchbar
4
4
  v-if="showSearchbar"
5
5
  :placeholder="searchbarPlaceholder"
6
- v-model="search"
6
+ v-model="localSearchValue"
7
7
  />
8
8
  <v-treeview
9
9
  class="vcs-treeview"
10
- v-bind="{ ...$props, ...$attrs }"
10
+ density="compact"
11
11
  item-value="name"
12
12
  :item-props="true"
13
- :search="search"
14
13
  :custom-filter="handleFilter"
15
14
  :selectable="false"
16
15
  :activatable="false"
16
+ expand-icon="mdi-chevron-right"
17
+ collapse-icon="mdi-chevron-down"
18
+ v-bind="{ ...$props, ...$attrs }"
19
+ :search="localSearchValue"
17
20
  >
18
21
  <template #item="{ props: item }">
19
22
  <VcsTreeviewLeaf
@@ -33,6 +36,7 @@
33
36
  > .v-list-item,
34
37
  > .v-list-group > .v-list-item {
35
38
  min-height: calc(var(--v-vcs-item-height) + 8px) !important;
39
+ padding-left: 6px;
36
40
  }
37
41
  // Border around root nodes with children included
38
42
  > .v-list-item:not(:last-child),
@@ -46,17 +50,32 @@
46
50
  > .v-list-item-title {
47
51
  font-weight: 700 !important;
48
52
  }
49
- // remove ripple effect from expand icon
50
- .v-icon.v-icon {
51
- &::after {
52
- background-color: transparent;
53
- }
54
- }
55
- // Toggle Item Chevron with should be 16px
56
- .v-treeview-node__toggle {
57
- width: 16px;
53
+ }
54
+
55
+ // leaf indent
56
+ :deep(.v-list--slim .v-treeview-group.v-list-group) {
57
+ --prepend-width: 0px;
58
+ }
59
+
60
+ // Padding left of root nodes
61
+ :deep(.v-list-item__prepend) {
62
+ width: var(--v-vcs-font-size);
63
+ margin-right: 8px;
64
+ > .v-list-item-action > .v-btn {
65
+ width: var(--v-vcs-font-size);
66
+ height: var(--v-vcs-font-size);
67
+ margin: auto;
58
68
  }
59
69
  }
70
+
71
+ // remove hover shadow over button
72
+ :deep(.v-btn__overlay) {
73
+ --v-hover-opacity: 0;
74
+ }
75
+ // remove ripple effect
76
+ :deep(.v-ripple__container) {
77
+ display: none;
78
+ }
60
79
  // hide active class
61
80
  :deep(.v-list-item__overlay) {
62
81
  display: none;
@@ -68,8 +87,9 @@
68
87
  </style>
69
88
 
70
89
  <script>
71
- import { getCurrentInstance, ref } from 'vue';
90
+ import { getCurrentInstance } from 'vue';
72
91
  import { VTreeview } from 'vuetify/labs/VTreeview';
92
+ import { useProxiedAtomicModel } from '../modelHelper.js';
73
93
  import VcsTreeviewSearchbar from './VcsTreeviewSearchbar.vue';
74
94
  import VcsTreeviewLeaf from './VcsTreeviewLeaf.vue';
75
95
 
@@ -77,6 +97,7 @@
77
97
  * @description extends API of https://vuetifyjs.com/en/api/v-treeview/
78
98
  * Can render dynamic components as leaf items.
79
99
  * In order to display an item needs to be registered and added to `availableComponents`.
100
+ * Exposes the `search` value for filtering the treeview.
80
101
  * @vue-prop {boolean} [showSearchbar=false] - Whether there is a searchbar for this treeview
81
102
  * @vue-prop {string} [searchbarPlaceholder] - Placeholder text for the searchbar, will be translated
82
103
  */
@@ -88,6 +109,10 @@
88
109
  VTreeview,
89
110
  },
90
111
  props: {
112
+ search: {
113
+ type: String,
114
+ default: '',
115
+ },
91
116
  showSearchbar: {
92
117
  type: Boolean,
93
118
  default: false,
@@ -97,8 +122,10 @@
97
122
  default: undefined,
98
123
  },
99
124
  },
100
- setup() {
101
- const search = ref('');
125
+ emits: ['update:search'],
126
+ setup(props, { emit }) {
127
+ const localSearchValue = useProxiedAtomicModel(props, 'search', emit);
128
+
102
129
  // TODO properly type the tree view item interface & export in index.d.ts
103
130
 
104
131
  const vm = getCurrentInstance().proxy;
@@ -119,7 +146,7 @@
119
146
  };
120
147
 
121
148
  return {
122
- search,
149
+ localSearchValue,
123
150
  handleFilter,
124
151
  };
125
152
  },