@vcmap/ui 5.0.0-rc.21 → 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 (153) hide show
  1. package/README.md +2 -2
  2. package/app.config.json +5 -0
  3. package/build/buildHelpers.js +1 -0
  4. package/build/buildPreview.js +2 -2
  5. package/build/commonViteConfig.js +1 -0
  6. package/config/aerowest.config.json +2 -0
  7. package/config/base.config.json +1 -0
  8. package/config/codes.config.json +2 -0
  9. package/config/dev.config.json +6 -0
  10. package/config/graphFeatureInfo.config.json +3 -1
  11. package/config/projects.config.json +27 -0
  12. package/config/www.config.json +27 -14
  13. package/dist/assets/cesium.js +1 -1
  14. package/dist/assets/{core.59d4d1.js → core.9342a1.js} +7912 -5474
  15. package/dist/assets/core.js +1 -1
  16. package/dist/assets/favicon.decf54cc.svg +10 -0
  17. package/dist/assets/index.fd041928.js +1 -0
  18. package/dist/assets/{ol.c1c512.js → ol.d2cba3.js} +12406 -12152
  19. package/dist/assets/ol.js +1 -1
  20. package/dist/assets/ui.c27597.css +5 -0
  21. package/dist/assets/{ui.80175f.js → ui.c27597.js} +6508 -5169
  22. package/dist/assets/ui.js +1 -1
  23. package/dist/assets/vue.js +2 -2
  24. package/dist/assets/vuetify.2f1432.css +5 -0
  25. package/dist/assets/{vuetify.efc158.js → vuetify.2f1432.js} +1 -1
  26. package/dist/assets/vuetify.js +2 -2
  27. package/dist/index.html +6 -1
  28. package/index.html +5 -0
  29. package/index.js +7 -3
  30. package/lib/olLib.js +15 -1
  31. package/package.json +5 -4
  32. package/plugins/@vcmap/project-selector/{ContextsListComponent.vue → ModulesListComponent.vue} +10 -10
  33. package/plugins/@vcmap/project-selector/ProjectSelectorComponent.vue +16 -16
  34. package/plugins/@vcmap/project-selector/README.md +15 -21
  35. package/plugins/@vcmap/project-selector/config.json +3 -3
  36. package/plugins/@vcmap/project-selector/de.json +3 -0
  37. package/plugins/@vcmap/project-selector/en.json +3 -0
  38. package/plugins/@vcmap/project-selector/index.js +76 -101
  39. package/plugins/@vcmap/simple-graph/index.js +1 -1
  40. package/plugins/@vcmap/theme-changer/ThemeChangerComponent.vue +10 -4
  41. package/plugins/@vcmap-show-case/category-tester/Categories.vue +2 -2
  42. package/plugins/@vcmap-show-case/category-tester/Category.vue +1 -4
  43. package/plugins/@vcmap-show-case/config-editor/editor.vue +14 -14
  44. package/plugins/@vcmap-show-case/form-inputs-example/FormInputsExample.vue +92 -81
  45. package/plugins/@vcmap-show-case/form-inputs-example/index.js +8 -3
  46. package/plugins/@vcmap-show-case/form-inputs-example/validation.js +1 -1
  47. package/plugins/@vcmap-show-case/list-example/ListExample.vue +5 -2
  48. package/plugins/@vcmap-show-case/table-example/DataTableExample.vue +202 -0
  49. package/plugins/@vcmap-show-case/table-example/README.md +3 -0
  50. package/plugins/@vcmap-show-case/table-example/index.js +47 -0
  51. package/plugins/@vcmap-show-case/table-example/package.json +5 -0
  52. package/plugins/@vcmap-show-case/wizard-example/wizardExample.vue +57 -23
  53. package/plugins/package.json +2 -1
  54. package/src/actions/actionHelper.js +16 -27
  55. package/src/actions/styleSelector.vue +26 -19
  56. package/src/application/VcsApp.vue +13 -5
  57. package/src/application/VcsAttributions.vue +2 -3
  58. package/src/application/VcsAttributionsFooter.vue +10 -16
  59. package/src/application/VcsNavbar.vue +1 -2
  60. package/src/application/VcsSettings.vue +21 -8
  61. package/src/assets/favicon-128.png +0 -0
  62. package/src/assets/favicon-180.png +0 -0
  63. package/src/assets/favicon-192.png +0 -0
  64. package/src/assets/favicon-32.png +0 -0
  65. package/src/assets/favicon.svg +10 -0
  66. package/src/components/buttons/VcsButton.vue +2 -3
  67. package/src/components/form-inputs-controls/VcsCheckbox.vue +46 -26
  68. package/src/components/form-inputs-controls/VcsDatePicker.vue +111 -0
  69. package/src/components/form-inputs-controls/VcsFormSection.vue +15 -13
  70. package/src/components/form-inputs-controls/VcsLabel.vue +10 -1
  71. package/src/components/form-inputs-controls/VcsRadio.vue +38 -18
  72. package/src/components/form-inputs-controls/VcsSelect.vue +117 -59
  73. package/src/components/form-inputs-controls/VcsTextArea.vue +101 -60
  74. package/src/components/form-inputs-controls/VcsTextField.vue +182 -69
  75. package/src/components/form-inputs-controls/VcsWizard.vue +23 -15
  76. package/src/components/form-inputs-controls/VcsWizardStep.vue +18 -16
  77. package/src/components/form-inputs-controls/composables.js +26 -0
  78. package/src/components/form-output/VcsFormattedNumber.vue +1 -1
  79. package/src/components/icons/2DDistanceIcon.vue +0 -3
  80. package/src/components/icons/3DDistanceIcon.vue +0 -3
  81. package/src/components/icons/3DHeightIcon.vue +0 -3
  82. package/src/components/icons/CheckboxCheckedIcon.vue +4 -11
  83. package/src/components/icons/CheckboxIcon.vue +9 -2
  84. package/src/components/icons/CheckboxIndeterminateIcon.vue +4 -21
  85. package/src/components/icons/CommentIcon.vue +1 -5
  86. package/src/components/icons/LegendIcon.vue +10 -60
  87. package/src/components/icons/ObliqueViewIcon.vue +6 -8
  88. package/src/components/icons/SimpleCircleOutlinedIcon.vue +1 -1
  89. package/src/components/icons/SplitViewIcon.vue +0 -4
  90. package/src/components/icons/ToolsIcon.vue +2 -4
  91. package/src/components/lists/VcsActionList.vue +0 -1
  92. package/src/components/lists/VcsList.vue +30 -30
  93. package/src/components/lists/VcsTreeview.vue +2 -2
  94. package/src/components/lists/VcsTreeviewLeaf.vue +3 -9
  95. package/src/components/lists/VcsTreeviewSearchbar.vue +4 -4
  96. package/src/components/notification/VcsBadge.vue +6 -2
  97. package/src/components/notification/VcsHelp.vue +39 -0
  98. package/src/components/tables/VcsDataTable.vue +386 -0
  99. package/src/components/tables/VcsTable.vue +55 -254
  100. package/src/contentTree/contentTreeCollection.js +1 -1
  101. package/src/contentTree/layerContentTreeItem.js +3 -0
  102. package/src/downloadHelper.js +49 -0
  103. package/src/featureInfo/AddressBalloonComponent.vue +1 -1
  104. package/src/featureInfo/BalloonComponent.vue +21 -15
  105. package/src/featureInfo/abstractFeatureInfoView.js +1 -1
  106. package/src/featureInfo/featureInfo.js +27 -9
  107. package/src/featureInfo/tableFeatureInfoView.js +4 -0
  108. package/src/i18n/de.js +13 -1
  109. package/src/i18n/en.js +13 -1
  110. package/src/i18n/i18nCollection.js +22 -22
  111. package/src/init.js +90 -7
  112. package/src/legend/styleLegendItem.vue +24 -2
  113. package/src/legend/vcsLegend.vue +24 -31
  114. package/src/manager/categoryManager/CategoryComponent.vue +56 -47
  115. package/src/manager/categoryManager/CategoryManager.vue +23 -10
  116. package/src/manager/categoryManager/categoryManager.js +11 -11
  117. package/src/manager/navbarManager.js +18 -0
  118. package/src/manager/toolbox/GroupToolboxComponent.vue +2 -3
  119. package/src/manager/toolbox/SelectToolboxComponent.vue +11 -5
  120. package/src/manager/toolbox/ToolboxManager.vue +0 -7
  121. package/src/manager/window/WindowComponent.vue +10 -16
  122. package/src/manager/window/WindowComponentHeader.vue +6 -4
  123. package/src/manager/window/WindowManager.vue +14 -15
  124. package/src/manager/window/windowHelper.js +1 -1
  125. package/src/manager/window/windowManager.js +18 -7
  126. package/src/navigation/mapNavCompass.vue +1 -1
  127. package/src/navigation/mapNavigation.vue +6 -6
  128. package/src/navigation/obliqueRotation.vue +36 -13
  129. package/src/navigation/orientationToolsButton.vue +0 -1
  130. package/src/navigation/overviewMap.js +11 -20
  131. package/src/navigation/tiltSlider.vue +30 -6
  132. package/src/navigation/vcsZoomButton.vue +37 -11
  133. package/src/pluginHelper.js +20 -0
  134. package/src/search/resultsComponent.vue +0 -1
  135. package/src/search/search.js +19 -20
  136. package/src/search/searchComponent.vue +21 -7
  137. package/src/state.js +6 -6
  138. package/src/styles/_theming.scss +72 -3
  139. package/src/styles/_typography.scss +0 -5
  140. package/src/styles/main.scss +1 -0
  141. package/src/styles/shades.scss +2 -0
  142. package/src/styles/variables.scss +40 -4
  143. package/src/uiConfig.js +4 -3
  144. package/src/vcsUiApp.js +49 -40
  145. package/src/vuePlugins/i18n.js +1 -0
  146. package/src/vuePlugins/vuetify.js +59 -13
  147. package/start.js +8 -2
  148. package/dist/assets/index.a3861d4e.js +0 -1
  149. package/dist/assets/ui.80175f.css +0 -1
  150. package/dist/assets/vuetify.efc158.css +0 -5
  151. package/map.config.json +0 -44
  152. /package/dist/assets/{cesium.49585c.js → cesium.166f91.js} +0 -0
  153. /package/dist/assets/{vue.a08ab1.js → vue.5d00e9.js} +0 -0
@@ -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
  );
@@ -38,22 +38,28 @@
38
38
  </v-list-item-action>
39
39
  </v-list-item>
40
40
  <v-card class="my-1 ma-1 py-1 white">
41
+ <h2>
42
+ light
43
+ </h2>
41
44
  <v-chip
42
45
  class="mx-1"
43
46
  label
44
- :color="theme.dark[key]"
45
- v-for="(key, index) in Object.keys(theme.dark)"
47
+ :color="theme.light[key]?.base || theme.light[key]"
48
+ v-for="(key, index) in Object.keys(theme.light)"
46
49
  :key="index"
47
50
  >
48
51
  {{ key }}
49
52
  </v-chip>
50
53
  </v-card>
51
54
  <v-card class="my-1 ma-1 py-1 black">
55
+ <h2 class="white--text">
56
+ dark
57
+ </h2>
52
58
  <v-chip
53
59
  class="mx-1"
54
60
  label
55
- :color="theme.light[key]"
56
- v-for="(key, index) in Object.keys(theme.light)"
61
+ :color="theme.dark[key]?.base || theme.dark[key]"
62
+ v-for="(key, index) in Object.keys(theme.dark)"
57
63
  :key="index"
58
64
  >
59
65
  {{ key }}
@@ -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
  });
@@ -66,14 +66,12 @@
66
66
  VCard,
67
67
  VForm,
68
68
  VTextarea,
69
- VBtn,
70
69
  } from 'vuetify/lib';
71
70
 
72
71
  export default {
73
72
  name: 'CategoryComponent',
74
73
  components: {
75
74
  VcsButton,
76
- VSheet,
77
75
  VVirtualScroll,
78
76
  VListItem,
79
77
  VListItemContent,
@@ -84,7 +82,6 @@
84
82
  VForm,
85
83
  VTextarea,
86
84
  VSheet,
87
- VBtn,
88
85
  },
89
86
  props: {
90
87
  categoryName: {
@@ -129,7 +126,7 @@
129
126
  dialog.value = false;
130
127
  },
131
128
  download() {
132
- const stringObject = JSON.stringify(categoryObject.serializeForContext(app.dynamicContextId), null, 2);
129
+ const stringObject = JSON.stringify(categoryObject.serializeModule(app.dynamicModuleId), null, 2);
133
130
  downloadLink.value = `data:text/json;charset=utf-8,${encodeURIComponent(stringObject)}`;
134
131
  if (downloadLink.value) {
135
132
  nextTick(() => {
@@ -8,10 +8,10 @@
8
8
  v-else
9
9
  />
10
10
 
11
- <VcsButton @click="replaceContext">
11
+ <VcsButton @click="replaceModule">
12
12
  Apply
13
13
  </VcsButton>
14
- <VcsButton @click="removeContext">
14
+ <VcsButton @click="removeModule">
15
15
  Remove
16
16
  </VcsButton>
17
17
  </div>
@@ -20,10 +20,10 @@
20
20
  <script>
21
21
  import { ref, inject } from 'vue';
22
22
  import { VcsButton } from '@vcmap/ui';
23
- import { Context } from '@vcmap/core';
23
+ import { VcsModule } from '@vcmap/core';
24
24
  import { VProgressCircular, VTextarea } from 'vuetify/lib';
25
25
 
26
- const contextId = 'foo';
26
+ const moduleId = 'foo';
27
27
 
28
28
  export default {
29
29
  name: 'Editor',
@@ -35,25 +35,25 @@
35
35
  setup() {
36
36
  /** @type {VcsUiApp} */
37
37
  const app = inject('vcsApp');
38
- const context = app.getContextById(contextId);
39
- const configString = ref(JSON.stringify(context ? context.config : {}, null, 2));
38
+ const module = app.getModuleById(moduleId);
39
+ const configString = ref(JSON.stringify(module ? module.config : {}, null, 2));
40
40
  const loading = ref(false);
41
41
 
42
42
  return {
43
43
  configString,
44
44
  loading,
45
- async replaceContext() {
45
+ async replaceModule() {
46
46
  loading.value = true;
47
47
  const config = JSON.parse(configString.value);
48
- config.id = contextId;
49
- const newContext = new Context(config);
50
- await this.removeContext();
51
- await app.addContext(newContext);
48
+ config.id = moduleId;
49
+ const newModule = new VcsModule(config);
50
+ await this.removeModule();
51
+ await app.addModule(newModule);
52
52
  loading.value = false;
53
53
  },
54
- async removeContext() {
55
- if (app.getContextById(contextId)) {
56
- await app.removeContext(contextId);
54
+ async removeModule() {
55
+ if (app.getModuleById(moduleId)) {
56
+ await app.removeModule(moduleId);
57
57
  }
58
58
  },
59
59
  };