@vcmap/ui 6.0.0-rc.8 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/README.md +2 -0
  2. package/build/buildHelpers.js +1 -1
  3. package/build/commonViteConfig.js +7 -0
  4. package/config/aerowest.config.json +12 -2
  5. package/config/analysis.config.json +17 -0
  6. package/config/base.config.json +19 -5
  7. package/config/components-show-case.config.json +53 -0
  8. package/config/concepts-show-case.config.json +39 -0
  9. package/config/dev.config.json +164 -105
  10. package/config/dynamic-layer.config.json +32 -0
  11. package/config/hello-world.config.json +11 -0
  12. package/config/projects.config.json +9 -1
  13. package/config/solar.config.json +65 -0
  14. package/config/vectorTile.config.json +70 -0
  15. package/config/www.config.json +34 -13
  16. package/dist/assets/{cesium-2ec6aae0.js → cesium-00deba88.js} +4672 -4704
  17. package/dist/assets/cesium.js +1 -1
  18. package/dist/assets/{core-6f2522e5.js → core-a599e8b6.js} +7932 -7342
  19. package/dist/assets/core.js +1 -1
  20. package/dist/assets/{ol-b0e134cb.js → ol-21bbc740.js} +12206 -11711
  21. package/dist/assets/ol.js +1 -1
  22. package/dist/assets/ui-adeddc7d.css +1 -0
  23. package/dist/assets/{ui-bf3d1f84.js → ui-adeddc7d.js} +10415 -9588
  24. package/dist/assets/ui.js +1 -1
  25. package/dist/assets/vue.js +1 -1
  26. package/dist/assets/{vuetify-99bf601c.css → vuetify-c0e02f11.css} +1 -1
  27. package/dist/assets/{vuetify-99bf601c.js → vuetify-c0e02f11.js} +5313 -5294
  28. package/dist/assets/vuetify.js +1 -1
  29. package/index.d.ts +4 -0
  30. package/index.js +2 -0
  31. package/lib/olLib.js +6 -0
  32. package/package.json +12 -12
  33. package/plugins/@vcmap-show-case/README.md +15 -6
  34. package/plugins/@vcmap-show-case/category-tester/package.json +1 -1
  35. package/plugins/@vcmap-show-case/category-tester/src/CollectionComponentOptions.vue +23 -23
  36. package/plugins/@vcmap-show-case/category-tester/src/FoobarEditor.vue +2 -8
  37. package/plugins/@vcmap-show-case/collection-manager-example/package.json +1 -1
  38. package/plugins/@vcmap-show-case/collection-manager-example/src/CollectionManagerExample.vue +10 -8
  39. package/plugins/@vcmap-show-case/context-menu-tester/package.json +1 -1
  40. package/plugins/@vcmap-show-case/extent-example/package.json +1 -1
  41. package/plugins/@vcmap-show-case/flight-component-example/package.json +1 -1
  42. package/plugins/@vcmap-show-case/form-inputs-example/package.json +1 -1
  43. package/plugins/@vcmap-show-case/hello-world/package.json +1 -1
  44. package/plugins/@vcmap-show-case/icons-example/package.json +1 -1
  45. package/plugins/@vcmap-show-case/notifier-tester/package.json +1 -1
  46. package/plugins/@vcmap-show-case/panel-tester/package.json +1 -1
  47. package/plugins/@vcmap-show-case/plugin-editors/package.json +1 -1
  48. package/plugins/@vcmap-show-case/plugin-editors/src/index.js +17 -6
  49. package/plugins/@vcmap-show-case/project-selector/package.json +1 -9
  50. package/plugins/@vcmap-show-case/project-selector/src/ModulesListComponent.vue +22 -31
  51. package/plugins/@vcmap-show-case/project-selector/src/ProjectSelectorComponent.vue +15 -23
  52. package/plugins/@vcmap-show-case/projection-example/README.md +3 -0
  53. package/plugins/@vcmap-show-case/projection-example/package.json +5 -0
  54. package/plugins/@vcmap-show-case/projection-example/src/ProjectionExample.vue +73 -0
  55. package/plugins/@vcmap-show-case/{table-example → projection-example}/src/index.js +22 -11
  56. package/plugins/@vcmap-show-case/search-example/package.json +1 -1
  57. package/plugins/@vcmap-show-case/simple-graph/package.json +1 -4
  58. package/plugins/@vcmap-show-case/style-input-example/package.json +1 -1
  59. package/plugins/@vcmap-show-case/switch-map-callback-example/README.md +2 -2
  60. package/plugins/@vcmap-show-case/switch-map-callback-example/package.json +2 -1
  61. package/plugins/@vcmap-show-case/switch-map-callback-example/src/index.js +4 -1
  62. package/plugins/@vcmap-show-case/theming-example/package.json +1 -1
  63. package/plugins/@vcmap-show-case/toolbox-example/package.json +1 -1
  64. package/plugins/@vcmap-show-case/vector-properties-example/package.json +1 -1
  65. package/plugins/@vcmap-show-case/viewpoint-component-example/package.json +1 -1
  66. package/plugins/@vcmap-show-case/window-tester/package.json +1 -1
  67. package/plugins/@vcmap-show-case/window-tester/src/WindowExample.vue +1 -1
  68. package/plugins/@vcmap-show-case/window-tester/src/WindowExampleToggleChild.vue +5 -1
  69. package/plugins/@vcmap-show-case/wizard-example/package.json +1 -1
  70. package/plugins/package.json +23 -3
  71. package/src/actions/flightActions.js +40 -20
  72. package/src/actions/listActions.d.ts +1 -1
  73. package/src/actions/listActions.js +1 -1
  74. package/src/application/VcsApp.vue +3 -0
  75. package/src/application/VcsApp.vue.d.ts +15 -0
  76. package/src/application/VcsAttributions.vue +1 -1
  77. package/src/application/VcsAttributionsFooter.vue +1 -1
  78. package/src/application/VcsContainer.vue +0 -1
  79. package/src/application/VcsContainer.vue.d.ts +15 -0
  80. package/src/application/VcsObliqueFooter.vue +110 -0
  81. package/src/application/VcsObliqueFooter.vue.d.ts +4 -0
  82. package/src/application/VcsTextPageFooter.vue +1 -0
  83. package/src/application/attributionsHelper.js +10 -6
  84. package/src/components/buttons/VcsButton.vue +2 -2
  85. package/src/components/buttons/VcsButton.vue.d.ts +1 -1
  86. package/src/components/buttons/VcsFormButton.vue +2 -2
  87. package/src/components/buttons/VcsFormButton.vue.d.ts +1 -1
  88. package/src/components/buttons/VcsToolButton.vue +2 -2
  89. package/src/components/buttons/VcsToolButton.vue.d.ts +1 -1
  90. package/src/components/composables.d.ts +2 -2
  91. package/src/components/composables.js +3 -5
  92. package/src/components/flight/VcsFlightPlayer.vue +26 -20
  93. package/src/components/form-inputs-controls/VcsCheckbox.vue +11 -5
  94. package/src/components/form-inputs-controls/VcsCheckbox.vue.d.ts +10 -1
  95. package/src/components/form-inputs-controls/VcsDatePicker.vue +23 -3
  96. package/src/components/form-inputs-controls/VcsDatePicker.vue.d.ts +1 -1
  97. package/src/components/form-inputs-controls/VcsFileInput.vue +3 -3
  98. package/src/components/form-inputs-controls/VcsFileInput.vue.d.ts +1 -1
  99. package/src/components/form-inputs-controls/VcsLabel.vue +10 -1
  100. package/src/components/form-inputs-controls/VcsLabel.vue.d.ts +9 -0
  101. package/src/components/form-inputs-controls/VcsRadio.vue +4 -0
  102. package/src/components/form-inputs-controls/VcsSelect.vue +2 -2
  103. package/src/components/form-inputs-controls/VcsSelect.vue.d.ts +3 -3
  104. package/src/components/form-inputs-controls/VcsSlider.vue +2 -2
  105. package/src/components/form-inputs-controls/VcsSlider.vue.d.ts +1 -1
  106. package/src/components/form-inputs-controls/VcsTextArea.vue +2 -2
  107. package/src/components/form-inputs-controls/VcsTextArea.vue.d.ts +1 -1
  108. package/src/components/form-inputs-controls/VcsTextField.vue +3 -3
  109. package/src/components/form-inputs-controls/VcsTextField.vue.d.ts +1 -1
  110. package/src/components/form-inputs-controls/VcsWizard.vue +2 -2
  111. package/src/components/form-inputs-controls/VcsWizard.vue.d.ts +1 -1
  112. package/src/components/form-inputs-controls/VcsWizardStep.vue +2 -2
  113. package/src/components/form-inputs-controls/VcsWizardStep.vue.d.ts +3 -3
  114. package/src/components/import/VcsImportComponent.vue +3 -3
  115. package/src/components/lists/VcsActionList.vue +1 -1
  116. package/src/components/lists/VcsList.vue +56 -39
  117. package/src/components/lists/VcsListItemComponent.vue +14 -12
  118. package/src/components/lists/VcsListItemComponent.vue.d.ts +5 -28
  119. package/src/components/lists/VcsTreeview.vue +4 -2
  120. package/src/components/lists/VcsTreeview.vue.d.ts +1 -1
  121. package/src/components/notification/VcsHelp.vue +0 -1
  122. package/src/components/notification/VcsHelpTooltip.vue +48 -0
  123. package/src/components/notification/VcsHelpTooltip.vue.d.ts +25 -0
  124. package/src/components/projection/VcsProjection.vue +329 -0
  125. package/src/components/projection/VcsProjection.vue.d.ts +7 -0
  126. package/src/components/section/VcsFormSection.vue +0 -1
  127. package/src/components/section/VcsFormSection.vue.d.ts +1 -1
  128. package/src/components/tables/VcsDataTable.vue +15 -4
  129. package/src/components/tables/VcsDataTable.vue.d.ts +13 -2
  130. package/src/components/vector-properties/VcsFeatureEditingWindow.vue +17 -1
  131. package/src/components/vector-properties/VcsFeatureEditingWindow.vue.d.ts +10 -1
  132. package/src/components/vector-properties/VcsFeatureTransforms.vue +39 -5
  133. package/src/components/vector-properties/VcsFeatureTransforms.vue.d.ts +2 -1
  134. package/src/components/vector-properties/VcsVectorPropertiesComponent.vue +44 -24
  135. package/src/components/vector-properties/VcsVectorPropertiesComponent.vue.d.ts +27 -2
  136. package/src/components/viewpoint/VcsViewpointComponent.vue +6 -6
  137. package/src/contentTree/contentTreeCollection.js +12 -1
  138. package/src/contentTree/obliqueCollectionContentTreeItem.js +6 -1
  139. package/src/featureInfo/abstractFeatureInfoView.d.ts +9 -0
  140. package/src/featureInfo/abstractFeatureInfoView.js +20 -3
  141. package/src/i18n/de.d.ts +93 -39
  142. package/src/i18n/de.js +68 -22
  143. package/src/i18n/en.d.ts +93 -39
  144. package/src/i18n/en.js +64 -18
  145. package/src/legend/StyleLegendItem.vue +1 -5
  146. package/src/legend/VcsLegend.vue +9 -10
  147. package/src/legend/VcsLegend.vue.d.ts +1 -1
  148. package/src/legend/legendHelper.js +6 -1
  149. package/src/manager/collectionManager/collectionComponentClass.js +9 -5
  150. package/src/manager/collectionManager/editorCollectionComponentClass.js +5 -3
  151. package/src/manager/toolbox/GroupToolboxComponent.vue +6 -1
  152. package/src/manager/toolbox/SelectToolboxComponent.vue +6 -2
  153. package/src/manager/toolbox/ToolboxManagerComponent.vue +7 -2
  154. package/src/manager/window/WindowComponentHeader.vue +1 -1
  155. package/src/manager/window/windowManager.d.ts +59 -3
  156. package/src/manager/window/windowManager.js +23 -2
  157. package/src/navigation/MapNavCompass.vue +166 -140
  158. package/src/navigation/MapNavCompass.vue.d.ts +3 -1
  159. package/src/navigation/MapNavigation.vue +22 -5
  160. package/src/navigation/VcsCompass.vue +2 -1
  161. package/src/navigation/overviewMap.js +4 -1
  162. package/src/obliqueFallbackWarnings.d.ts +5 -0
  163. package/src/obliqueFallbackWarnings.js +54 -0
  164. package/src/styles/main.scss +2 -2
  165. package/src/uiConfig.d.ts +30 -0
  166. package/src/uiConfig.js +3 -0
  167. package/src/vcsUiApp.d.ts +37 -10
  168. package/src/vcsUiApp.js +4 -0
  169. package/src/vuePlugins/i18n.js +1 -0
  170. package/src/vuePlugins/vuetify.js +2 -0
  171. package/dist/assets/ui-bf3d1f84.css +0 -1
  172. package/plugins/@vcmap-show-case/buttons-example/README.md +0 -4
  173. package/plugins/@vcmap-show-case/buttons-example/package.json +0 -5
  174. package/plugins/@vcmap-show-case/buttons-example/src/ButtonsExample.vue +0 -281
  175. package/plugins/@vcmap-show-case/buttons-example/src/index.js +0 -51
  176. package/plugins/@vcmap-show-case/config-editor/README.md +0 -3
  177. package/plugins/@vcmap-show-case/config-editor/package.json +0 -5
  178. package/plugins/@vcmap-show-case/config-editor/src/ConfigEditor.vue +0 -62
  179. package/plugins/@vcmap-show-case/config-editor/src/index.js +0 -49
  180. package/plugins/@vcmap-show-case/list-example/README.md +0 -3
  181. package/plugins/@vcmap-show-case/list-example/package.json +0 -5
  182. package/plugins/@vcmap-show-case/list-example/src/ListExample.vue +0 -403
  183. package/plugins/@vcmap-show-case/list-example/src/index.js +0 -46
  184. package/plugins/@vcmap-show-case/table-example/README.md +0 -3
  185. package/plugins/@vcmap-show-case/table-example/package.json +0 -5
  186. package/plugins/@vcmap-show-case/table-example/src/DataTableExample.vue +0 -203
  187. package/plugins/@vcmap-show-case/textfields-example/README.md +0 -3
  188. package/plugins/@vcmap-show-case/textfields-example/package.json +0 -5
  189. package/plugins/@vcmap-show-case/textfields-example/src/TextfieldsExample.vue +0 -115
  190. package/plugins/@vcmap-show-case/textfields-example/src/index.js +0 -64
  191. /package/dist/assets/{vue-43880c5a.js → vue-8269279d.js} +0 -0
@@ -1,51 +0,0 @@
1
- import { ButtonLocation, createToggleAction, WindowSlot } from '@vcmap/ui';
2
- import packageJSON from '../package.json';
3
- import ButtonsExample from './ButtonsExample.vue';
4
-
5
- /**
6
- * @returns {VcsPlugin}
7
- */
8
- export default async function buttonsExample() {
9
- return {
10
- get name() {
11
- return packageJSON.name;
12
- },
13
- get version() {
14
- return packageJSON.version;
15
- },
16
- get mapVersion() {
17
- return packageJSON.mapVersion;
18
- },
19
- onVcsAppMounted(app) {
20
- const { action, destroy } = createToggleAction(
21
- {
22
- name: 'Buttons Examples',
23
- title: 'Buttons Example Plugin',
24
- icon: '$vcsTouch',
25
- },
26
- {
27
- id: 'buttons-buttons-example',
28
- component: ButtonsExample,
29
- slot: WindowSlot.DETACHED,
30
- state: {
31
- headerTitle: 'Buttons Example',
32
- headerIcon: '$vcsTouch',
33
- },
34
- position: {
35
- width: 500,
36
- },
37
- },
38
- app.windowManager,
39
- packageJSON.name,
40
- );
41
- app.navbarManager.add({ action }, packageJSON.name, ButtonLocation.TOOL);
42
- this._destroyAction = destroy;
43
- },
44
- destroy() {
45
- if (this._destroyAction) {
46
- this._destroyAction();
47
- this._destroyAction = null;
48
- }
49
- },
50
- };
51
- }
@@ -1,3 +0,0 @@
1
- # Config Editor
2
-
3
- This is a show-case plugin demonstrating the concept of VC Map Config.
@@ -1,5 +0,0 @@
1
- {
2
- "name": "@vcmap-show-case/config-editor",
3
- "version": "1.0.0",
4
- "mapVersion": "^5.0.0"
5
- }
@@ -1,62 +0,0 @@
1
- <template>
2
- <v-container class="py-0 px-1">
3
- <VcsTextArea v-model="configString" v-if="!loading" />
4
- <v-progress-circular v-else />
5
-
6
- <div class="d-flex gc-2 px-1 pt-2 pb-1 justify-end">
7
- <VcsFormButton variant="filled" @click="replaceModule">
8
- Apply
9
- </VcsFormButton>
10
- <VcsFormButton @click="removeModule"> Remove </VcsFormButton>
11
- </div>
12
- </v-container>
13
- </template>
14
-
15
- <script>
16
- import { ref, inject } from 'vue';
17
- import { VcsTextArea, VcsFormButton } from '@vcmap/ui';
18
- import { VcsModule } from '@vcmap/core';
19
- import { VContainer, VProgressCircular } from 'vuetify/components';
20
-
21
- const moduleId = 'foo';
22
-
23
- export default {
24
- name: 'ConfigEditor',
25
- components: {
26
- VcsFormButton,
27
- VcsTextArea,
28
- VContainer,
29
- VProgressCircular,
30
- },
31
- setup() {
32
- /** @type {VcsUiApp} */
33
- const app = inject('vcsApp');
34
- const module = app.getModuleById(moduleId);
35
- const configString = ref(
36
- JSON.stringify(module ? module.config : {}, null, 2),
37
- );
38
- const loading = ref(false);
39
-
40
- return {
41
- configString,
42
- loading,
43
- async replaceModule() {
44
- loading.value = true;
45
- const config = JSON.parse(configString.value);
46
- config.id = moduleId;
47
- const newModule = new VcsModule(config);
48
- await this.removeModule();
49
- await app.addModule(newModule);
50
- loading.value = false;
51
- },
52
- async removeModule() {
53
- if (app.getModuleById(moduleId)) {
54
- await app.removeModule(moduleId);
55
- }
56
- },
57
- };
58
- },
59
- };
60
- </script>
61
-
62
- <style scoped></style>
@@ -1,49 +0,0 @@
1
- import { ButtonLocation, createToggleAction, WindowSlot } from '@vcmap/ui';
2
- import packageJSON from '../package.json';
3
- import ConfigEditor from './ConfigEditor.vue';
4
-
5
- /**
6
- * @returns {VcsPlugin}
7
- */
8
- export default async function configEditor() {
9
- return {
10
- get name() {
11
- return packageJSON.name;
12
- },
13
- get version() {
14
- return packageJSON.version;
15
- },
16
- get mapVersion() {
17
- return packageJSON.mapVersion;
18
- },
19
- onVcsAppMounted(app) {
20
- const { action, destroy } = createToggleAction(
21
- {
22
- name: 'Config Editor',
23
- },
24
- {
25
- id: 'config-editor',
26
- state: {
27
- headerTitle: 'Config Editor',
28
- },
29
- component: ConfigEditor,
30
- slot: WindowSlot.DYNAMIC_LEFT,
31
- },
32
- app.windowManager,
33
- packageJSON.name,
34
- );
35
- app.navbarManager.add(
36
- { id: 'config-editor', action },
37
- packageJSON.name,
38
- ButtonLocation.TOOL,
39
- );
40
- this._destroyAction = destroy;
41
- },
42
- destroy() {
43
- if (this._destroyAction) {
44
- this._destroyAction();
45
- this._destroyAction = null;
46
- }
47
- },
48
- };
49
- }
@@ -1,3 +0,0 @@
1
- # List Example
2
-
3
- This is a show-case plugin demonstrating the usage of [VcsList](../../../src/components/lists/VcsList.vue).
@@ -1,5 +0,0 @@
1
- {
2
- "name": "@vcmap-show-case/list-example",
3
- "version": "1.0.0",
4
- "mapVersion": "^5.0.0"
5
- }
@@ -1,403 +0,0 @@
1
- <template>
2
- <v-sheet>
3
- <VcsFormSection heading="Settings">
4
- <v-container class="py-0 px-4">
5
- <v-row no-gutters>
6
- <v-col>
7
- <v-switch v-model="selectable" label="Selectable" />
8
- </v-col>
9
- <v-col>
10
- <v-switch
11
- :disabled="!selectable"
12
- v-model="selectSingle"
13
- label=" Single Select"
14
- />
15
- </v-col>
16
- </v-row>
17
- <v-row no-gutters>
18
- <v-col>
19
- <v-switch v-model="searchable" label="Searchable" />
20
- </v-col>
21
- <v-col>
22
- <v-switch v-model="draggable" label="Draggable" />
23
- </v-col>
24
- </v-row>
25
- <v-row no-gutters>
26
- <v-col>
27
- <v-switch
28
- v-model="prependIndex"
29
- label="Prepend Index"
30
- class="ma-0"
31
- />
32
- </v-col>
33
- <v-col>
34
- <v-switch v-model="appendIndex" label="Append Index" />
35
- </v-col>
36
- </v-row>
37
- </v-container>
38
- </VcsFormSection>
39
- <VcsFormSection heading="Title">
40
- <v-container class="py-0 px-4">
41
- <v-row no-gutters>
42
- <v-col>
43
- <v-switch v-model="showTitle" label="Show Title" />
44
- </v-col>
45
- <v-col>
46
- <vcs-text-field
47
- v-model="title"
48
- placeholder="Title"
49
- :disabled="!showTitle"
50
- />
51
- </v-col>
52
- </v-row>
53
- <v-row no-gutters>
54
- <v-col>
55
- <v-switch
56
- v-model="titleActions"
57
- label="Title Actions"
58
- class="ma-0"
59
- />
60
- </v-col>
61
- <v-col>
62
- <v-switch v-model="titleIcon" label="Title Icon" class="ma-0" />
63
- </v-col>
64
- </v-row>
65
- </v-container>
66
- </VcsFormSection>
67
- <VcsFormSection heading="Item">
68
- <v-container class="py-2 px-4">
69
- <v-row no-gutters>
70
- <v-dialog v-model="dialog" width="400">
71
- <template #activator="{ props }">
72
- <vcs-form-button v-bind="props"> Add An item </vcs-form-button>
73
- </template>
74
- <v-card class="py-2 px-4">
75
- <v-form @submit.prevent="add">
76
- <vcs-text-field
77
- v-model="newItem.name"
78
- label="Name"
79
- :rules="required"
80
- />
81
- <vcs-text-field
82
- v-model="newItem.title"
83
- label="Title"
84
- :rules="required"
85
- />
86
- <v-switch label="visible" v-model="newItem.visible" />
87
- <v-switch label="disabled" v-model="newItem.disabled" />
88
- <v-switch label="random icon" v-model="newItem.icon" />
89
- <v-switch label="hasUpdate" v-model="newItem.hasUpdate" />
90
- <v-switch label="rename action" v-model="newItem.renamable" />
91
- <v-switch
92
- label="toggle rename action"
93
- v-model="newItem.toggleRename"
94
- />
95
- <v-switch label="console.log action" v-model="newItem.action" />
96
- <v-switch
97
- label="console.log on clicked"
98
- v-model="newItem.clicked"
99
- />
100
- <v-switch
101
- label="console.log selected state"
102
- v-model="newItem.selected"
103
- />
104
- <vcs-form-button type="submit"> Add </vcs-form-button>
105
- </v-form>
106
- </v-card>
107
- </v-dialog>
108
- </v-row>
109
- </v-container>
110
- </VcsFormSection>
111
- <VcsFormSection heading="Selection">
112
- <v-container class="py-2 px-4">
113
- <v-row no-gutters>
114
- <template v-if="selectable">
115
- <v-col>
116
- <v-switch
117
- v-model="showSelection"
118
- label="Show Selection"
119
- dense
120
- class="ma-0"
121
- />
122
- </v-col>
123
- </template>
124
- </v-row>
125
- <v-row no-gutters>
126
- <ul v-if="showSelection" class="mx-2">
127
- <li v-for="(i, index) in selected" :key="`item-${index}`">
128
- {{ i.title }}
129
- </li>
130
- </ul>
131
- </v-row>
132
- </v-container>
133
- </VcsFormSection>
134
-
135
- <vcs-list
136
- :items="items"
137
- :draggable="draggable"
138
- :selectable="selectable"
139
- :single-select="selectSingle"
140
- :searchable="searchable"
141
- :show-title="showTitle"
142
- :icon="titleIconSrc"
143
- :actions="titleActionsArray"
144
- :title="title"
145
- v-model="selected"
146
- @item-moved="move"
147
- @item-renamed="({ item, newTitle }) => (item.title = newTitle)"
148
- >
149
- <template #[`item.prepend-title`]="{ index }" v-if="prependIndex">
150
- {{ index }}
151
- </template>
152
- <template #[`item.append-title`]="{ index }" v-if="appendIndex">
153
- {{ index }}
154
- </template>
155
- </vcs-list>
156
- </v-sheet>
157
- </template>
158
-
159
- <script>
160
- import {
161
- VcsList,
162
- VcsFormButton,
163
- VcsTextField,
164
- Icons,
165
- VcsFormSection,
166
- } from '@vcmap/ui';
167
- import {
168
- VSwitch,
169
- VSheet,
170
- VDialog,
171
- VCard,
172
- VForm,
173
- VContainer,
174
- VRow,
175
- VCol,
176
- } from 'vuetify/components';
177
- import { computed, reactive, ref } from 'vue';
178
-
179
- function getRandomIcon() {
180
- const keys = Object.keys(Icons);
181
- const index = Math.floor(keys.length * Math.random());
182
- return `$${keys[index]}`;
183
- }
184
-
185
- const defaultItems = [
186
- {
187
- name: 'foo',
188
- title: 'Foo',
189
- tooltip: 'this is the foo',
190
- icon: 'mdi-pen',
191
- selectionChanged: (value) => console.log('changed cb foo', value),
192
- },
193
- {
194
- name: 'bar',
195
- title: 'Bar',
196
- actions: [
197
- {
198
- name: 'console.log',
199
- callback() {
200
- console.log('bar action');
201
- },
202
- },
203
- ],
204
- selectionChanged: (value) => console.log('changed cb bar', value),
205
- },
206
- {
207
- name: 'baz',
208
- title: 'Baz',
209
- tooltip: 'special baz',
210
- selectionChanged: (value) => console.log('bchanged cb baz', value),
211
- },
212
- ];
213
-
214
- export default {
215
- name: 'ListExample',
216
- components: {
217
- VcsList,
218
- VcsFormButton,
219
- VcsTextField,
220
- VcsFormSection,
221
- VSwitch,
222
- VSheet,
223
- VDialog,
224
- VCard,
225
- VForm,
226
- VContainer,
227
- VRow,
228
- VCol,
229
- },
230
- setup() {
231
- const draggable = ref(true);
232
- const selectable = ref(true);
233
- const searchable = ref(true);
234
- const selectSingle = ref(false);
235
- const showSelection = ref(false);
236
- const prependIndex = ref(false);
237
- const appendIndex = ref(false);
238
- const showTitle = ref(true);
239
- const title = ref('Title');
240
- const titleActionsArray = ref([]);
241
- const titleIconSrc = ref(null);
242
- const selected = ref([]);
243
- const items = ref(defaultItems);
244
- const newItem = ref({
245
- name: 'foo',
246
- title: 'foo',
247
- disabled: false,
248
- visible: true,
249
- icon: false,
250
- renamable: false,
251
- toggleRename: false,
252
- action: false,
253
- clicked: false,
254
- selected: false,
255
- });
256
- const dialog = ref(false);
257
-
258
- return {
259
- draggable,
260
- selectable,
261
- searchable,
262
- selectSingle,
263
- selected,
264
- showSelection,
265
- prependIndex,
266
- appendIndex,
267
- showTitle,
268
- title,
269
- titleActionsArray,
270
- titleIconSrc,
271
- items,
272
- newItem,
273
- dialog,
274
- required: [
275
- (v) => !!v || 'Input may not be null',
276
- (v) => v.length > 0 || 'Input must have a length',
277
- ],
278
- add() {
279
- const item = reactive({
280
- name: newItem.value.name,
281
- title: newItem.value.title,
282
- disabled: newItem.value.disabled,
283
- visible: newItem.value.visible,
284
- hasUpdate: newItem.value.hasUpdate,
285
- renamable: newItem.value.renamable,
286
- });
287
-
288
- if (newItem.value.icon) {
289
- item.icon = getRandomIcon();
290
- }
291
-
292
- item.actions = [];
293
-
294
- if (newItem.value.toggleRename) {
295
- item.actions.push({
296
- name: 'toggle rename',
297
- callback() {
298
- item.renamable = !item.renamable;
299
- },
300
- });
301
- }
302
-
303
- if (newItem.value.action) {
304
- item.actions.push({
305
- name: 'console.log',
306
- callback() {
307
- console.log("hi, i'm: ", item.name);
308
- },
309
- });
310
- }
311
-
312
- if (newItem.value.clicked) {
313
- item.clickedCallbacks = [
314
- () => {
315
- console.log(`${item.name} just got clicked`);
316
- },
317
- ];
318
- }
319
-
320
- if (newItem.value.selected) {
321
- item.selectionChanged = (selectedValue) => {
322
- if (selectedValue) {
323
- console.log(`${item.name} is selected`);
324
- } else {
325
- console.log(`${item.name} is no longer selected`);
326
- }
327
- };
328
- }
329
-
330
- if (newItem.value.renamable) {
331
- item.titleChanged = (newTitle) => {
332
- item.title = newTitle;
333
- };
334
- }
335
-
336
- items.value.push(item);
337
- newItem.value = {
338
- name: 'foo',
339
- title: 'foo',
340
- disabled: false,
341
- visible: true,
342
- icon: false,
343
- renamable: false,
344
- action: false,
345
- clicked: false,
346
- selected: false,
347
- hasUpdate: false,
348
- };
349
- dialog.value = false;
350
- },
351
- titleActions: computed({
352
- get() {
353
- return titleActionsArray.value.length > 0;
354
- },
355
- set(value) {
356
- if (value) {
357
- titleActionsArray.value = [
358
- {
359
- name: 'console.log foo',
360
- callback() {
361
- console.log('foo');
362
- },
363
- },
364
- ];
365
- } else {
366
- titleActionsArray.value = [];
367
- }
368
- },
369
- }),
370
- titleIcon: computed({
371
- get() {
372
- return !!titleIconSrc.value;
373
- },
374
- set(value) {
375
- if (value) {
376
- titleIconSrc.value = getRandomIcon();
377
- } else {
378
- titleIconSrc.value = null;
379
- }
380
- },
381
- }),
382
- move({ item, targetIndex }) {
383
- let target = targetIndex;
384
- target = target >= 0 ? target : 0;
385
- target =
386
- target < items.value.length ? target : items.value.length - 1;
387
- const from = items.value.indexOf(item);
388
- if (from !== target) {
389
- items.value.splice(from, 1);
390
- items.value.splice(target, 0, item);
391
- }
392
- },
393
- };
394
- },
395
- };
396
- </script>
397
-
398
- <style lang="scss" scoped>
399
- .d-grid {
400
- display: grid;
401
- grid-template-columns: 1fr 1fr;
402
- }
403
- </style>
@@ -1,46 +0,0 @@
1
- import { ButtonLocation, createToggleAction, WindowSlot } from '@vcmap/ui';
2
- import packageJSON from '../package.json';
3
- import ListExample from './ListExample.vue';
4
-
5
- /**
6
- * @returns {VcsPlugin}
7
- */
8
- export default async function iconsExample() {
9
- return {
10
- get name() {
11
- return packageJSON.name;
12
- },
13
- get version() {
14
- return packageJSON.version;
15
- },
16
- get mapVersion() {
17
- return packageJSON.mapVersion;
18
- },
19
- onVcsAppMounted(app) {
20
- const { action, destroy } = createToggleAction(
21
- {
22
- name: 'List Examples',
23
- title: 'List Example Plugin',
24
- },
25
- {
26
- id: 'list-example',
27
- component: ListExample,
28
- slot: WindowSlot.DYNAMIC_LEFT,
29
- state: {
30
- headerTitle: 'List Example',
31
- },
32
- },
33
- app.windowManager,
34
- packageJSON.name,
35
- );
36
- app.navbarManager.add({ action }, packageJSON.name, ButtonLocation.TOOL);
37
- this._destroyAction = destroy;
38
- },
39
- destroy() {
40
- if (this._destroyAction) {
41
- this._destroyAction();
42
- this._destroyAction = null;
43
- }
44
- },
45
- };
46
- }
@@ -1,3 +0,0 @@
1
- # List Example
2
-
3
- This is a show-case plugin demonstrating the usage of [VcsDataTable](../../../src/components/tables/VcsDataTable.vue).
@@ -1,5 +0,0 @@
1
- {
2
- "name": "@vcmap-show-case/table-example",
3
- "version": "1.0.0",
4
- "mapVersion": "^5.0.0"
5
- }