@vcmap/ui 5.0.0-rc.22 → 5.0.0-rc.23

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 (91) hide show
  1. package/README.md +2 -2
  2. package/app.config.json +5 -0
  3. package/build/buildPreview.js +2 -2
  4. package/config/aerowest.config.json +2 -0
  5. package/config/base.config.json +1 -0
  6. package/config/codes.config.json +2 -0
  7. package/config/dev.config.json +6 -0
  8. package/config/graphFeatureInfo.config.json +3 -1
  9. package/config/projects.config.json +27 -0
  10. package/config/www.config.json +2 -0
  11. package/dist/assets/cesium.js +1 -1
  12. package/dist/assets/{core.a66593.js → core.9342a1.js} +7804 -5352
  13. package/dist/assets/core.js +1 -1
  14. package/dist/assets/index.fd041928.js +1 -0
  15. package/dist/assets/ol.js +1 -1
  16. package/dist/assets/ui.c27597.css +5 -0
  17. package/dist/assets/{ui.d760e4.js → ui.c27597.js} +5055 -4694
  18. package/dist/assets/ui.js +1 -1
  19. package/dist/assets/vue.js +2 -2
  20. package/dist/assets/{vuetify.427322.js → vuetify.2f1432.js} +1 -1
  21. package/dist/assets/vuetify.js +2 -2
  22. package/dist/index.html +1 -1
  23. package/index.js +5 -2
  24. package/package.json +3 -3
  25. package/plugins/@vcmap/project-selector/{ContextsListComponent.vue → ModulesListComponent.vue} +10 -10
  26. package/plugins/@vcmap/project-selector/ProjectSelectorComponent.vue +15 -15
  27. package/plugins/@vcmap/project-selector/README.md +15 -21
  28. package/plugins/@vcmap/project-selector/config.json +3 -3
  29. package/plugins/@vcmap/project-selector/de.json +3 -0
  30. package/plugins/@vcmap/project-selector/en.json +3 -0
  31. package/plugins/@vcmap/project-selector/index.js +76 -101
  32. package/plugins/@vcmap/simple-graph/index.js +1 -1
  33. package/plugins/@vcmap-show-case/category-tester/Categories.vue +2 -2
  34. package/plugins/@vcmap-show-case/category-tester/Category.vue +1 -4
  35. package/plugins/@vcmap-show-case/config-editor/editor.vue +14 -14
  36. package/plugins/@vcmap-show-case/form-inputs-example/FormInputsExample.vue +18 -1
  37. package/plugins/@vcmap-show-case/form-inputs-example/index.js +1 -0
  38. package/plugins/@vcmap-show-case/table-example/DataTableExample.vue +202 -0
  39. package/plugins/@vcmap-show-case/table-example/README.md +3 -0
  40. package/plugins/@vcmap-show-case/table-example/index.js +47 -0
  41. package/plugins/@vcmap-show-case/table-example/package.json +5 -0
  42. package/src/actions/actionHelper.js +16 -27
  43. package/src/actions/styleSelector.vue +26 -19
  44. package/src/components/form-inputs-controls/VcsDatePicker.vue +111 -0
  45. package/src/components/form-inputs-controls/VcsTextField.vue +18 -7
  46. package/src/components/form-inputs-controls/VcsWizard.vue +3 -1
  47. package/src/components/icons/CheckboxCheckedIcon.vue +1 -1
  48. package/src/components/icons/LegendIcon.vue +10 -60
  49. package/src/components/lists/VcsList.vue +25 -6
  50. package/src/components/tables/VcsDataTable.vue +386 -0
  51. package/src/components/tables/VcsTable.vue +33 -278
  52. package/src/contentTree/contentTreeCollection.js +1 -1
  53. package/src/contentTree/layerContentTreeItem.js +3 -0
  54. package/src/downloadHelper.js +49 -0
  55. package/src/featureInfo/BalloonComponent.vue +9 -8
  56. package/src/featureInfo/abstractFeatureInfoView.js +1 -1
  57. package/src/featureInfo/featureInfo.js +3 -3
  58. package/src/i18n/de.js +8 -0
  59. package/src/i18n/en.js +8 -0
  60. package/src/i18n/i18nCollection.js +22 -22
  61. package/src/init.js +90 -7
  62. package/src/manager/categoryManager/CategoryComponent.vue +56 -47
  63. package/src/manager/categoryManager/CategoryManager.vue +23 -10
  64. package/src/manager/categoryManager/categoryManager.js +11 -11
  65. package/src/manager/navbarManager.js +18 -0
  66. package/src/manager/window/WindowComponent.vue +10 -15
  67. package/src/manager/window/WindowComponentHeader.vue +4 -2
  68. package/src/manager/window/WindowManager.vue +14 -15
  69. package/src/manager/window/windowHelper.js +1 -1
  70. package/src/manager/window/windowManager.js +18 -7
  71. package/src/navigation/mapNavCompass.vue +1 -1
  72. package/src/navigation/mapNavigation.vue +6 -6
  73. package/src/navigation/obliqueRotation.vue +36 -13
  74. package/src/navigation/orientationToolsButton.vue +0 -1
  75. package/src/navigation/overviewMap.js +5 -5
  76. package/src/navigation/vcsZoomButton.vue +37 -11
  77. package/src/pluginHelper.js +20 -0
  78. package/src/search/search.js +12 -3
  79. package/src/search/searchComponent.vue +15 -0
  80. package/src/state.js +6 -6
  81. package/src/uiConfig.js +3 -3
  82. package/src/vcsUiApp.js +44 -40
  83. package/src/vuePlugins/i18n.js +1 -0
  84. package/start.js +8 -2
  85. package/dist/assets/index.8b833ead.js +0 -1
  86. package/dist/assets/ui.d760e4.css +0 -5
  87. package/map.config.json +0 -44
  88. /package/dist/assets/{cesium.88cffd.js → cesium.166f91.js} +0 -0
  89. /package/dist/assets/{ol.d4539f.js → ol.d2cba3.js} +0 -0
  90. /package/dist/assets/{vue.db5102.js → vue.5d00e9.js} +0 -0
  91. /package/dist/assets/{vuetify.427322.css → vuetify.2f1432.css} +0 -0
package/dist/assets/ui.js CHANGED
@@ -1 +1 @@
1
- export * from "./ui.d760e4.js";
1
+ export * from "./ui.c27597.js";
@@ -1,5 +1,5 @@
1
- export * from "./vue.db5102.js";
2
- import { default as f } from "./vue.db5102.js";
1
+ export * from "./vue.5d00e9.js";
2
+ import { default as f } from "./vue.5d00e9.js";
3
3
  export {
4
4
  f as default
5
5
  };
@@ -13,7 +13,7 @@ function loadCss(href) {
13
13
  elem.onerror = reject;
14
14
  document.head.appendChild(elem);
15
15
  });
16
- } await loadCss('./assets/vuetify.427322.css');import v from "./vue.db5102.js";
16
+ } await loadCss('./assets/vuetify.2f1432.css');import v from "./vue.5d00e9.js";
17
17
  const Ne = v.extend().extend({
18
18
  name: "themeable",
19
19
  provide() {
@@ -1,5 +1,5 @@
1
- export * from "./vuetify.427322.js";
2
- import { default as f } from "./vuetify.427322.js";
1
+ export * from "./vuetify.2f1432.js";
2
+ import { default as f } from "./vuetify.2f1432.js";
3
3
  export {
4
4
  f as default
5
5
  };
package/dist/index.html CHANGED
@@ -8,7 +8,7 @@
8
8
  <link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAYAAAA9zQYyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABh9JREFUeNrs3d1rW2UcwPEnJ+lJMrt0RfbSru0oMmTE6d686I1MHVu9UmcpeDfdX5AJXnhTvfFCGL3ybpvDG2EI6o2usoFXdrghohS8qLq+rRd26ys2SfPiiU0hdmty2pxznpfz/cIhrE1S+D0fHk4SsiMEERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERERFpX2SnDzx99f20c9PPCOtXKpZi8w8fxZYWFouzE3+J3v1Z66X0/Frv/tUS06nbonOMfPD6wpSvoB3IFcQfOkc3M9+6crkcm52ebZn8434+u5ot1v4uapXtE88sR187MZdN2KUy06rbqHNk3MKObBPzoHMzzIzrl8/l47/e/aW4srxSqHe/3cli8sKrD9Y62nMFpla3JecYcFCPeQYazC5PMUol++cf75UaYd6oNVGMv3PmQRHUrlCfbbRTWy4xp5ybj5hp4ybG70fdYq60ko3mPrvVGZ2dj8eYXt1SbjZUy+WT9VefkOrvzvGZyensdh8Hatf1ffzNnm4vQJ9jli5elj9aKBfWCjt6kQdq96i9AN3GHF2gXF6JNPX4Kups3oowzS3zZIcmFxUKhabfgqugvnrrIKh3GKAVbOZhvHDtdqcN6ief2XkB+iZzDLbpuUTu+u3OJKgfa9QL0CNi/X1ACrDJucQ/oP4/5kYfrrgC/cPFTypvZl9hnqCW3JBn59AO6svOzQ1mCmpJZdx89L2tF4UO6gyoQS0Jsyt3236XA9SgVhXzjkCDGtSqYt4xaFCDWkXMTYEGNahVw9w0aFCDWiXMnoAGNahVwewZaFCDWgXMnoKuQT0KMVDLwOw56GrvOscYxEAdNGZfQDu79H/f0AU1qIPG7NcODWpQS8HsG2hQg7pBV/zA7CtoUIN6i244mIf8enLfv4IFalBvwpzx8w8E8p1CUM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iIiIiIiIiIiIiIiIiIiIiIiIiIiIGvevAAMAlVPPQtniZxQAAAAASUVORK5CYII=" sizes="180x180">
9
9
  <link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMAAAADACAYAAABS3GwHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABrBJREFUeNrs3U1vVFUcx/E79w4zU6ilIBZoqaIukLAwxCcaNyYa04WRhdiNm0J5A8TERTeVjQsT5Q3QwM6kGx9WYCCRhZaoC4NMIglGSgGjKSkPtQ/TmbmeaaYGScS595577/+c8/0kkwHTFjz39+1MeRrPAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADyskeefXJj/oUXf7OMboms2mX1+tF1vfvvTdhbX/Nv7ubzVOJp7xg3emMwtADX9Q3X2obsMcfTRhGAbzt+dLN2duNG//Obfyz4UoeIVN5UZp6Lm74dCeO6uVUjPktCK5p25n1G1CxXAvtQDU+EfU3QnOO7raSq185fIvoRr+Iz/TP9bV6Bp9/dbqzi0rdU4tVgiHVARV7QEw/gTjr9VKl77/qblwf6GjUXdXGuXDb9xqEEG6EfgRn/Yc52zjfa01c/Va0On4WxaWg5VT5/qD3+fLRY4vstbXppOdvKEf4YMebX9gRLS4sFhRz/mXor4fESQy+NGXvSM6AxjhTOO5ef1GM+77EkEiegJoP/3hs39Mf91fSPQrOkQQ25CuR4BdnGU8YRgWl5eWG0k/DhGkw+cIUg/A1xEAEeQYwDdjH09zVDIQQSSzOh8BiIAITHNWZwBTnCcRGOaktgDU06ApHgWIwKTxjx+8o/UpUMsRdatytkQg3JQa/4S2L4IfeBRY+zMWRCAvgs8u7PCXa36B01gb/7FO3zjyL4MSgUxz9zfUJs8NBI5HUI0y/lgBEIFcN2+X66fO91ccjaDa3qSXegBEINfsXGXp9Pn+LsciWBt/lL8IkzgAIpDr+lxl0aEIYo8/cQBEQAQmj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7A9/3V3q29JcZPAK5GEAbFYoHx52KWAAREsK1vG+PPxzQBCIhg+8COy5WuSsD4M3eSAAREoL4OePuZPc9eZfwZj3/0zSoBCImgd+uWt3p6N19h/Jk4o8Y/0ckbFjirDB16sfVb8+97rReF+C/b95a8vcOB1/3EEgcWy6dq/J90+sYEkE8Ig+0I9nmlTQVv6+4Na/dPveR5Pf01r1AIOaQYn/U976wa/yxHAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAECDvwUYABs1+KWG0Rz3AAAAAElFTkSuQmCC" sizes="192x192">
10
10
  <link rel="icon" type="image/svg+xml" href="./assets/favicon.decf54cc.svg" />
11
- <script type="module" crossorigin src="./assets/index.8b833ead.js"></script>
11
+ <script type="module" crossorigin src="./assets/index.fd041928.js"></script>
12
12
  </head>
13
13
  <body style="height: 100vH;">
14
14
  <noscript>
package/index.js CHANGED
@@ -101,7 +101,8 @@ export { default as VcsZoomButton } from './src/navigation/vcsZoomButton.vue';
101
101
 
102
102
  export { createVueI18n, setupI18n } from './src/vuePlugins/i18n.js';
103
103
  export { createVuetify, vuetify, getColorByKey, getDefaultPrimaryColor } from './src/vuePlugins/vuetify.js';
104
- export { default as initApp } from './src/init.js';
104
+ export { downloadURI, downloadBlob, downloadText, downloadCanvas } from './src/downloadHelper.js';
105
+ export { default as initApp, VcsUiAppConfigPattern, initAppFromModule, initAppFromAppConfig } from './src/init.js';
105
106
  export {
106
107
  vcsAppSymbol,
107
108
  pluginFactorySymbol,
@@ -123,6 +124,7 @@ export { default as VcsTooltip } from './src/components/notification/VcsTooltip.
123
124
  export { default as VcsHelp } from './src/components/notification/VcsHelp.vue';
124
125
 
125
126
  export { default as VcsTable } from './src/components/tables/VcsTable.vue';
127
+ export { default as VcsDataTable } from './src/components/tables/VcsDataTable.vue';
126
128
 
127
129
  // export { default as VcsConfirmationDialog } from './src/components/dialogs/VcsConfirmationDialog.vue';
128
130
 
@@ -139,6 +141,7 @@ export { default as VcsTextField } from './src/components/form-inputs-controls/V
139
141
  export { default as VcsTextArea } from './src/components/form-inputs-controls/VcsTextArea.vue';
140
142
  export { default as VcsWizard } from './src/components/form-inputs-controls/VcsWizard.vue';
141
143
  export { default as VcsWizardStep } from './src/components/form-inputs-controls/VcsWizardStep.vue';
144
+ export { default as VcsDatePicker } from './src/components/form-inputs-controls/VcsDatePicker.vue';
142
145
 
143
146
  export { default as VcsFormattedNumber } from './src/components/form-output/VcsFormattedNumber.vue';
144
147
 
@@ -147,7 +150,7 @@ export { default as VcsActionList, validateAction, validateActions } from './src
147
150
  export { default as VcsList } from './src/components/lists/VcsList.vue';
148
151
  export { default as VcsTreeview } from './src/components/lists/VcsTreeview.vue';
149
152
  export { default as VcsTreeviewLeaf } from './src/components/lists/VcsTreeviewLeaf.vue';
150
- // export { default as VcsTreeviewSearchbar } from './src/components/lists/VcsTreeviewSearchbar.vue';
153
+ export { default as VcsTreeviewSearchbar } from './src/components/lists/VcsTreeviewSearchbar.vue';
151
154
 
152
155
  // export { default as VcsMediaControls } from './src/components/media-controls/VcsMediaControls.vue';
153
156
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vcmap/ui",
3
- "version": "5.0.0-rc.22",
3
+ "version": "5.0.0-rc.23",
4
4
  "author": "Virtual City Systems",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -23,7 +23,7 @@
23
23
  "index.js",
24
24
  "start.js",
25
25
  "index.html",
26
- "map.config.json",
26
+ "app.config.json",
27
27
  "dist/",
28
28
  "src/",
29
29
  "plugins/",
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "peerDependencies": {
44
44
  "@vcmap-cesium/engine": "~1.1.2",
45
- "@vcmap/core": "~5.0.0-rc.27",
45
+ "@vcmap/core": "^5.0.0-rc.30",
46
46
  "ol": "~7.2.2",
47
47
  "vue": "~2.7.3",
48
48
  "vuetify": "~2.6.7"
@@ -4,17 +4,17 @@
4
4
  color="rgba(0,0,0,0)"
5
5
  >
6
6
  <v-chip
7
- v-for="(context, index) in contexts"
7
+ v-for="(module, index) in modules"
8
8
  :key="index"
9
9
  class="mx-1"
10
- :color="context.active ? 'primary' : undefined"
10
+ :color="module.active ? 'primary' : undefined"
11
11
  :disabled="!toggleable"
12
- @click="toggle(context)"
12
+ @click="toggle(module)"
13
13
  >
14
- {{ context.name || context.configUrl }}
14
+ {{ module.name || module.configUrl }}
15
15
  <VcsTooltip
16
- v-if="context.description"
17
- :tooltip="context.description"
16
+ v-if="module.description && toggleable"
17
+ :tooltip="module.description"
18
18
  >
19
19
  <template #activator="{ on, attrs }">
20
20
  <v-icon
@@ -36,7 +36,7 @@
36
36
  import { VChip, VContainer, VIcon, VList } from 'vuetify/lib';
37
37
 
38
38
  export default {
39
- name: 'ContextsListComponent',
39
+ name: 'ModulesListComponent',
40
40
  components: {
41
41
  VcsTooltip,
42
42
  VContainer,
@@ -45,7 +45,7 @@
45
45
  VIcon,
46
46
  },
47
47
  props: {
48
- contexts: {
48
+ modules: {
49
49
  type: Array,
50
50
  required: true,
51
51
  },
@@ -55,9 +55,9 @@
55
55
  },
56
56
  },
57
57
  methods: {
58
- toggle(context) {
58
+ toggle(module) {
59
59
  if (this.toggleable) {
60
- this.$emit('toggle-context', context);
60
+ this.$emit('toggle-module', module);
61
61
  }
62
62
  },
63
63
  },
@@ -2,7 +2,7 @@
2
2
  <v-container>
3
3
  <h1>{{ $t('project-selector.project.title') }}</h1>
4
4
  <v-list
5
- v-for="(project, index) in state.projects.value"
5
+ v-for="(project, index) in state.projects"
6
6
  :key="index"
7
7
  >
8
8
  <v-card
@@ -19,9 +19,9 @@
19
19
  {{ project.name }}
20
20
  </v-list-item-title>
21
21
  <v-list-item-subtitle>{{ project.description }}</v-list-item-subtitle>
22
- <ContextsListComponent
23
- :contexts="project.contexts"
24
- @toggle-context="toggleContext"
22
+ <ModulesListComponent
23
+ :modules="project.modules"
24
+ @toggle-module="toggleModule"
25
25
  :toggleable="false"
26
26
  />
27
27
  </v-list-item-content>
@@ -38,10 +38,10 @@
38
38
  </v-card>
39
39
  </v-list>
40
40
  <v-divider />
41
- <h1>Contexts</h1>
42
- <ContextsListComponent
43
- :contexts="state.contexts.value"
44
- @toggle-context="toggleContext"
41
+ <h1>{{ $t('project-selector.module.title') }}</h1>
42
+ <ModulesListComponent
43
+ :modules="state.modules"
44
+ @toggle-module="toggleModule"
45
45
  />
46
46
  </v-container>
47
47
  </template>
@@ -60,12 +60,12 @@
60
60
  VAvatar,
61
61
  VDivider,
62
62
  } from 'vuetify/lib';
63
- import ContextsListComponent from './ContextsListComponent.vue';
63
+ import ModulesListComponent from './ModulesListComponent.vue';
64
64
 
65
65
  export default {
66
66
  name: 'ProjectSelector',
67
67
  components: {
68
- ContextsListComponent,
68
+ ModulesListComponent,
69
69
  VList,
70
70
  VContainer,
71
71
  VCard,
@@ -87,11 +87,11 @@
87
87
  this.loading = undefined;
88
88
  }
89
89
 
90
- async function toggleContext(context) {
91
- if (context.active) {
92
- await plugin.unloadContext(app, context);
90
+ async function toggleModule(module) {
91
+ if (module.active) {
92
+ await plugin.unloadModule(app, module);
93
93
  } else {
94
- await plugin.loadContext(app, context);
94
+ await plugin.loadModule(app, module);
95
95
  }
96
96
  }
97
97
 
@@ -100,7 +100,7 @@
100
100
  state: plugin.state,
101
101
  config: plugin.config,
102
102
  selectProject,
103
- toggleContext,
103
+ toggleModule,
104
104
  };
105
105
  },
106
106
  };
@@ -1,29 +1,23 @@
1
1
  # VC Map Plugin Project Selector
2
2
 
3
- This is a plugin to select and load `VCMapProjects` and `VCMapContexts`.
3
+ This is a plugin to select and load `Projects` and `VcsModules`.
4
4
 
5
5
  ## configuration
6
6
 
7
- You can add projects or contexts and define the startup behavior of the plugin:
7
+ You can add projects or modules and define the startup behavior of the plugin:
8
8
 
9
9
  ### ProjectSelectorConfig
10
- | Property | Type | default | Description |
11
- |------------------|----------------------------|---------------|------------------------------|
12
- | selected | string | 'VC Map Base' | selected project on startup |
13
- | selectedContexts | string[] | [] | selected contexts on startup |
14
- | projects | Array<VCMapProjectOptions> | [] | |
15
- | contexts | Array<VCMapContextOptions> | [] | |
10
+ | Property | Type | default | Description |
11
+ |-----------------|-----------------------|---------------|-----------------------------|
12
+ | selected | string | 'VC Map Base' | selected project on startup |
13
+ | selectedModules | string[] | [] | selected modules on startup |
14
+ | open | boolean | false | open plugin on startup |
15
+ | projects | Array<ProjectOptions> | [] | |
16
+ | modules | Array<string> | [] | list of config urls |
16
17
 
17
- ### VCMapProjectOptions
18
- | Property | Type | Description |
19
- |-------------|----------------------------|----------------------------|
20
- | name | string | name of the project |
21
- | description | string | description of the project |
22
- | contexts | Array<VCMapContextOptions> | |
23
-
24
- ### VCMapContextOptions
25
- | Property | Type | Description |
26
- |-------------|--------|----------------------------|
27
- | name | string | name of the context |
28
- | description | string | description of the context |
29
- | configUrl | string | url to config.json |
18
+ ### ProjectOptions
19
+ | Property | Type | Description |
20
+ |-------------|---------------|----------------------------|
21
+ | name | string | name of the project |
22
+ | description | string | description of the project |
23
+ | modules | Array<string> | list of config urls |
@@ -2,14 +2,14 @@
2
2
  "name": "projectSelector",
3
3
  "entry": "plugins/@vcmap/project-selector/index.js",
4
4
  "selected": "VC Map Base",
5
- "selectedContexts": [],
5
+ "selectedModules": [],
6
6
  "open": false,
7
7
  "projects": [
8
8
  {
9
9
  "name": "VC Map Base",
10
10
  "description": "Base Layout with basic datasets",
11
- "contexts": [ { "configUrl": "config/base.config.json" } ]
11
+ "modules": [ "config/base.config.json" ]
12
12
  }
13
13
  ],
14
- "contexts": []
14
+ "modules": []
15
15
  }
@@ -2,6 +2,9 @@
2
2
  "project-selector": {
3
3
  "project" : {
4
4
  "title": "Projekte"
5
+ },
6
+ "module" : {
7
+ "title": "Module"
5
8
  }
6
9
  }
7
10
  }
@@ -2,6 +2,9 @@
2
2
  "project-selector": {
3
3
  "project" : {
4
4
  "title": "Projects"
5
+ },
6
+ "module" : {
7
+ "title": "Modules"
5
8
  }
6
9
  }
7
10
  }
@@ -1,50 +1,42 @@
1
- import { ref } from 'vue';
1
+ import { reactive } from 'vue';
2
2
  import { ButtonLocation, createToggleAction } from '@vcmap/ui';
3
- import { Context } from '@vcmap/core';
3
+ import { VcsModule } from '@vcmap/core';
4
4
  import { getLogger } from '@vcsuite/logger';
5
5
  import ProjectsComponent from './ProjectSelectorComponent.vue';
6
6
  import packageJSON from './package.json';
7
7
  import defaultConfig from './config.json';
8
8
  import de from './de.json';
9
9
  import en from './en.json';
10
- /**
11
- * @typedef {Object} VCMapContextOptions
12
- * @property {string} [name]
13
- * @property {string} [description]
14
- * @property {string} configUrl
15
- */
16
10
 
17
11
  /**
18
- * @typedef {Object} VCMapContext
12
+ * @typedef {Object} VcsModuleState
13
+ * @property {string} _id
19
14
  * @property {string} [name]
20
15
  * @property {string} [description]
21
16
  * @property {string} configUrl
22
- * @property {string} contextId
23
17
  * @property {boolean} active
24
18
  */
25
19
 
26
20
  /**
27
- * @typedef {Object} VCMapProjectOptions
21
+ * @typedef {Object} ProjectOptions
28
22
  * @property {string} name
29
23
  * @property {string} [description]
30
- * @property {Array<VCMapContextOptions>} contexts
24
+ * @property {Array<string>} modules - a list of config urls
31
25
  */
32
26
 
33
27
  /**
34
- * @typedef {Object} VCMapProject
35
- * @property {string} name
36
- * @property {string} [description]
37
- * @property {Array<VCMapContext>} contexts
28
+ * @typedef {ProjectOptions} Project
38
29
  * @property {boolean} active
30
+ * @property {Array<VcsModuleState>} modules
39
31
  */
40
32
 
41
33
  /**
42
34
  * @typedef {Object} ProjectSelectorConfig
43
35
  * @property {string} [selected='VC Map Base'] - selected project on startup
44
- * @property {string[]} [selectedContexts] - selected contexts on startup
36
+ * @property {string[]} [selectedModules] - selected modules on startup
45
37
  * @property {boolean} [open=false] - open plugin on startup
46
- * @property {Array<VCMapProjectOptions>} projects
47
- * @property {Array<VCMapContextOptions>} contexts
38
+ * @property {Array<Project>} projects
39
+ * @property {Array<string>} modules
48
40
  */
49
41
 
50
42
  /**
@@ -52,120 +44,103 @@ import en from './en.json';
52
44
  * @returns {VcsPlugin}
53
45
  */
54
46
  export default async function projectSelector(config) {
55
- const { selected, selectedContexts, open, projects = [], contexts = [] } = config;
47
+ const { selected, selectedModules, open, projects = [], modules = [] } = config;
56
48
 
57
- const pluginConfig = {
58
- selected: ref(selected || defaultConfig.selected),
59
- selectedContexts: ref(selectedContexts || defaultConfig.selectedContexts),
60
- open: ref(open || defaultConfig.open),
61
- projects: ref(/** @type {Array<VCMapProjectOptions>} */[...defaultConfig.projects, ...projects]),
62
- contexts: ref(/** @type {Array<VCMapContextOptions>} */[...defaultConfig.contexts, ...contexts]),
63
- };
49
+ const pluginConfig = reactive({
50
+ selected: selected || defaultConfig.selected,
51
+ selectedModules: selectedModules || defaultConfig.selectedModules,
52
+ open: open || defaultConfig.open,
53
+ projects: /** @type {Array<ProjectOptions>} */[...defaultConfig.projects, ...projects],
54
+ modules: /** @type {Array<string>} */[...defaultConfig.modules, ...modules],
55
+ });
64
56
 
65
- const pluginState = {
66
- projects: ref(/** @type {Array<VCMapProject>} */[]),
67
- contexts: ref(/** @type {Array<VCMapContext>} */[]),
68
- };
57
+ const pluginState = reactive({
58
+ projects: /** @type {Array<Project>} */[],
59
+ modules: /** @type {Array<VcsModuleState>} */[],
60
+ });
69
61
 
70
62
  /**
71
- * @param {VCMapContextOptions} contextOptions
63
+ * @param {string} configUrl
72
64
  */
73
- function addContextFromOptions(contextOptions) {
74
- /**
75
- * @type {VCMapContext}
76
- */
77
- const context = {
78
- name: undefined,
79
- description: undefined,
80
- configUrl: undefined,
81
- ...contextOptions,
82
- contextId: undefined,
83
- active: false,
84
- };
85
- pluginState.contexts.value.push(context);
65
+ function addModule(configUrl) {
66
+ pluginState.modules.push({ _id: undefined, configUrl, active: false });
86
67
  }
87
68
 
88
69
  /**
89
- * @param {VCMapContext} context
70
+ * @param {string} moduleId
90
71
  */
91
- function removeContext(context) {
92
- const idx = pluginState.contexts.value.findIndex(c => c.configUrl === context.configUrl);
93
- pluginState.contexts.value.splice(idx, 1);
72
+ function removeModule(moduleId) {
73
+ const idx = pluginState.modules.findIndex(({ _id }) => _id === moduleId);
74
+ pluginState.modules.splice(idx, 1);
94
75
  }
95
76
 
96
77
  /**
97
- * @param {VCMapProjectOptions} projectOptions
78
+ * @param {ProjectOptions} projectOptions
98
79
  */
99
- function addProjectFromOptions(projectOptions) {
100
- const { name, description, contexts: contextsOptions = [] } = projectOptions;
101
- /**
102
- * @type {VCMapProject}
103
- */
80
+ function addProject({ name, description, modules: configUrls }) {
104
81
  const project = {
105
82
  name,
106
83
  description,
107
- contexts: contextsOptions.map(options => /** @type {VCMapContext} */({
108
- name: undefined,
109
- description: undefined,
110
- configUrl: undefined,
111
- ...options,
112
- contextId: undefined,
113
- active: false,
114
- })),
84
+ modules: configUrls.map(configUrl => ({ _id: undefined, configUrl, active: false })),
115
85
  active: false,
116
86
  };
117
- pluginState.projects.value.push(project);
87
+ pluginState.projects.push(project);
118
88
  }
119
89
 
120
90
  /**
121
- * @param {VCMapProject} project
91
+ * @param {Project} project
122
92
  */
123
93
  function removeProject(project) {
124
94
  const projectIdx = pluginState.projects.findIndex(p => p.name === project.name);
125
- pluginState.projects.value.splice(projectIdx, 1);
95
+ pluginState.projects.splice(projectIdx, 1);
126
96
  }
127
97
 
128
98
  /**
129
99
  * @param {VcsApp} app
130
- * @param {VCMapContext} vcMapContext
100
+ * @param {VcsModuleState} moduleState
131
101
  * @returns {Promise<void>}
132
102
  */
133
- async function loadContext(app, vcMapContext) {
103
+ async function loadModule(app, moduleState) {
134
104
  try {
135
- const configJson = await fetch(vcMapContext.configUrl)
136
- .then(response => response.json());
137
- const context = new Context(configJson);
138
- if (!app.getContextById(context.id)) {
139
- await app.addContext(context);
105
+ const response = await fetch(moduleState.configUrl);
106
+ if (response.ok) {
107
+ const configJson = await response.json();
108
+ const module = new VcsModule(configJson);
109
+ if (!app.getModuleById(module._id)) {
110
+ await app.addModule(module);
111
+ moduleState._id = module._id;
112
+ moduleState.name = module.name;
113
+ moduleState.description = module.description;
114
+ moduleState.active = true;
115
+ }
140
116
  }
141
- vcMapContext.contextId = context.id;
142
- vcMapContext.active = true;
143
117
  } catch (err) {
144
- getLogger().error(`Failed loading context from ${ vcMapContext.configUrl}`, err);
118
+ getLogger().error(`Failed loading module from ${moduleState.configUrl}`, err);
145
119
  }
146
120
  }
147
121
 
148
122
  /**
149
123
  * @param {VcsApp} app
150
- * @param {VCMapContext} vcMapContext
124
+ * @param {VcsModuleState} moduleState
151
125
  * @returns {Promise<void>}
152
126
  */
153
- async function unloadContext(app, vcMapContext) {
154
- if (app.getContextById(vcMapContext.contextId)) {
155
- await app.removeContext(vcMapContext.contextId);
127
+ async function unloadModule(app, moduleState) {
128
+ if (app.getModuleById(moduleState._id)) {
129
+ await app.removeModule(moduleState._id);
130
+ moduleState.active = false;
131
+ moduleState._id = undefined;
156
132
  }
157
- vcMapContext.active = false;
158
133
  }
159
134
 
160
135
  /**
161
136
  * @param {VcsApp} app
162
- * @param {VCMapProject} project
137
+ * @param {Project} project
163
138
  * @returns {Promise<void>}
164
139
  */
165
140
  async function deselectProject(app, project) {
166
141
  if (project.active) {
167
- await Promise.all([...project.contexts].map((context) => {
168
- return unloadContext(app, context);
142
+ await Promise.all([...project.modules].map((moduleState) => {
143
+ return unloadModule(app, moduleState);
169
144
  }));
170
145
  project.active = false;
171
146
  }
@@ -173,16 +148,16 @@ export default async function projectSelector(config) {
173
148
 
174
149
  /**
175
150
  * @param {VcsApp} app
176
- * @param {VCMapProject} project
151
+ * @param {Project} project
177
152
  * @returns {Promise<void>}
178
153
  */
179
154
  async function selectProject(app, project) {
180
155
  if (!project.active) {
181
- await Promise.all([...pluginState.projects.value].map((p) => {
156
+ await Promise.all([...pluginState.projects].map((p) => {
182
157
  return deselectProject(app, p);
183
158
  }));
184
- await Promise.all([...project.contexts].map((context) => {
185
- return loadContext(app, context);
159
+ await Promise.all([...project.modules].map((moduleState) => {
160
+ return loadModule(app, moduleState);
186
161
  }));
187
162
  project.active = true;
188
163
  }
@@ -194,14 +169,14 @@ export default async function projectSelector(config) {
194
169
  get vcMapVersion() { return packageJSON.vcMapVersion; },
195
170
  config: pluginConfig,
196
171
  state: pluginState,
197
- addContextFromOptions,
198
- removeContext,
199
- addProjectFromOptions,
172
+ addModule,
173
+ removeModule,
174
+ addProject,
200
175
  removeProject,
201
176
  selectProject,
202
177
  deselectProject,
203
- loadContext,
204
- unloadContext,
178
+ loadModule,
179
+ unloadModule,
205
180
  onVcsAppMounted(app) {
206
181
  const windowComponent = {
207
182
  id: 'project-selector',
@@ -232,15 +207,15 @@ export default async function projectSelector(config) {
232
207
  );
233
208
  this._destroyAction = destroy;
234
209
 
235
- pluginConfig.contexts.value.forEach(c => addContextFromOptions(c));
236
- pluginConfig.projects.value.forEach(p => addProjectFromOptions(p));
237
- const projectToSelect = [...pluginState.projects.value]
238
- .find(p => p.name === pluginConfig.selected.value) ||
239
- pluginState.projects.value[0];
210
+ pluginConfig.modules.forEach(c => addModule(c));
211
+ pluginConfig.projects.forEach(p => addProject(p));
212
+ const projectToSelect = [...pluginState.projects]
213
+ .find(p => p.name === pluginConfig.selected) ||
214
+ pluginState.projects[0];
240
215
  selectProject(app, projectToSelect);
241
- const contextsToSelect = [...pluginState.contexts.value]
242
- .filter(c => pluginConfig.selectedContexts.value.includes(c.name));
243
- contextsToSelect.forEach(c => loadContext(app, c));
216
+ const modulesToSelect = [...pluginState.modules]
217
+ .filter(m => pluginConfig.selectedModules.includes(m.configUrl));
218
+ modulesToSelect.forEach(m => loadModule(app, m));
244
219
  if (pluginConfig.open) {
245
220
  app.windowManager.add(windowComponent, packageJSON.name);
246
221
  }
@@ -8,7 +8,7 @@ export default async function () {
8
8
  onVcsAppMounted(app) {
9
9
  /** Example for registering custom component on FeatureInfo */
10
10
  app.featureInfo.classRegistry.registerClass(
11
- app.dynamicContextId,
11
+ app.dynamicModuleId,
12
12
  SimpleGraphView.className,
13
13
  SimpleGraphView,
14
14
  );
@@ -163,7 +163,7 @@
163
163
  }
164
164
  const category = await app.categories.requestCategory({ name: jsonUpload.name, type: 'Category' });
165
165
  if (jsonUpload?.items?.length > 0) {
166
- await app.categories.parseCategoryItems(jsonUpload.name, jsonUpload.items, app.dynamicContextId);
166
+ await app.categories.parseCategoryItems(jsonUpload.name, jsonUpload.items, app.dynamicModuleId);
167
167
  }
168
168
  app.categoryManager.add({ categoryName: category.name }, packageJSON.name);
169
169
  uploadString.value = '';
@@ -176,7 +176,7 @@
176
176
  if (!app.categories.hasKey('layers')) {
177
177
  const layersCat = await app.categories.requestCategory({
178
178
  name: 'layers',
179
- type: 'AppBackedCategory',
179
+ type: 'Category',
180
180
  collectionName: 'layers',
181
181
  title: 'categories.layers',
182
182
  });