@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/src/vcsUiApp.js CHANGED
@@ -1,14 +1,15 @@
1
1
  import {
2
2
  VcsApp,
3
- contextIdSymbol,
3
+ moduleIdSymbol,
4
4
  Collection,
5
5
  makeOverrideCollection,
6
6
  destroyCollection,
7
7
  OverrideClassRegistry,
8
- defaultDynamicContextId,
8
+ defaultDynamicModuleId,
9
9
  ObliqueMap,
10
10
  Viewpoint,
11
- volatileContextId, VcsEvent,
11
+ volatileModuleId,
12
+ VcsEvent,
12
13
  } from '@vcmap/core';
13
14
  import { getLogger as getLoggerByName } from '@vcsuite/logger';
14
15
  import {
@@ -37,6 +38,9 @@ import Notifier from './notifier/notifier.js';
37
38
  * @typedef {import("@vcmap/core").VcsAppConfig} VcsUiAppConfig
38
39
  * @property {Array<Object>} [plugins]
39
40
  * @property {Array<ContentTreeItemOptions>} [contentTree]
41
+ * @property {Array<UiConfigurationItem>} [uiConfig]
42
+ * @property {Array<FeatureInfoViewOptions>} [featureInfo]
43
+ * @property {Array<Object>} [i18n]
40
44
  */
41
45
 
42
46
  /**
@@ -117,7 +121,7 @@ class VcsUiApp extends VcsApp {
117
121
  */
118
122
  this._plugins = makeOverrideCollection(
119
123
  new Collection(),
120
- () => this.dynamicContextId,
124
+ () => this.dynamicModuleId,
121
125
  serializePlugin,
122
126
  deserializePlugin,
123
127
  );
@@ -134,11 +138,11 @@ class VcsUiApp extends VcsApp {
134
138
  this._contextMenuManager.removeOwner(plugin.name);
135
139
  this._search.removeOwner(plugin.name);
136
140
  if (plugin.i18n) {
137
- this.i18n.addPluginMessages(plugin.name, plugin[contextIdSymbol], plugin.i18n);
141
+ this.i18n.addPluginMessages(plugin.name, plugin[moduleIdSymbol], plugin.i18n);
138
142
  }
139
143
  if (plugin.initialize) {
140
144
  let state;
141
- if (this._cachedAppState.contextIds.includes(plugin[contextIdSymbol])) {
145
+ if (this._cachedAppState.moduleIds.includes(plugin[moduleIdSymbol])) {
142
146
  state = this._cachedAppState.plugins.find(s => s.name === plugin.name);
143
147
  }
144
148
  try {
@@ -155,7 +159,7 @@ class VcsUiApp extends VcsApp {
155
159
  this._categoryManager.removeOwner(plugin.name);
156
160
  this._contextMenuManager.removeOwner(plugin.name);
157
161
  this._search.removeOwner(plugin.name);
158
- this.i18n.removePluginMessages(plugin.name, plugin[contextIdSymbol]);
162
+ this.i18n.removePluginMessages(plugin.name, plugin[moduleIdSymbol]);
159
163
  }),
160
164
  ];
161
165
 
@@ -192,7 +196,7 @@ class VcsUiApp extends VcsApp {
192
196
  * @type {UiConfig}
193
197
  * @private
194
198
  */
195
- this._uiConfig = new UiConfig(() => this.dynamicContextId);
199
+ this._uiConfig = new UiConfig(() => this.dynamicModuleId);
196
200
  /**
197
201
  * @type {FeatureInfo}
198
202
  * @private
@@ -209,7 +213,7 @@ class VcsUiApp extends VcsApp {
209
213
  * @type {I18nCollection<Object>}
210
214
  * @private
211
215
  */
212
- this._i18n = new I18nCollection(() => this.dynamicContextId);
216
+ this._i18n = new I18nCollection(() => this.dynamicModuleId);
213
217
 
214
218
  /**
215
219
  * @type {CategoryManager}
@@ -341,17 +345,17 @@ class VcsUiApp extends VcsApp {
341
345
  */
342
346
  async getState(forUrl) {
343
347
  const state = createEmptyState();
344
- state.contextIds = this.contexts
345
- .filter(({ id }) => id !== defaultDynamicContextId)
346
- .map(({ id }) => id);
348
+ state.moduleIds = this.modules
349
+ .filter(({ _id }) => _id !== defaultDynamicModuleId)
350
+ .map(({ _id }) => _id);
347
351
 
348
352
  state.activeMap = this.maps.activeMap.name;
349
353
  const viewpoint = await this.maps.activeMap.getViewpoint();
350
354
  state.activeViewpoint = viewpoint?.isValid?.() ? viewpoint.toJSON() : undefined;
351
355
  state.layers = [...this.layers]
352
356
  .filter(l => l.isSupported(this.maps.activeMap) &&
353
- l[contextIdSymbol] !== defaultDynamicContextId &&
354
- l[contextIdSymbol] !== volatileContextId &&
357
+ l[moduleIdSymbol] !== defaultDynamicModuleId &&
358
+ l[moduleIdSymbol] !== volatileModuleId &&
355
359
  (
356
360
  ((l.active || l.loading) && !l.activeOnStartup) ||
357
361
  (!l.active && l.activeOnStartup) ||
@@ -366,8 +370,8 @@ class VcsUiApp extends VcsApp {
366
370
  l.style &&
367
371
  l.style.name !== l.defaultStyle.name &&
368
372
  this.styles.has(l.style) &&
369
- l.style[contextIdSymbol] !== defaultDynamicContextId &&
370
- l.style[contextIdSymbol] !== volatileContextId
373
+ l.style[moduleIdSymbol] !== defaultDynamicModuleId &&
374
+ l.style[moduleIdSymbol] !== volatileModuleId
371
375
  ) {
372
376
  layerState.styleName = l.style.name;
373
377
  }
@@ -375,8 +379,8 @@ class VcsUiApp extends VcsApp {
375
379
  });
376
380
 
377
381
  state.plugins = await Promise.all([...this.plugins]
378
- .filter(p => p[contextIdSymbol] !== defaultDynamicContextId &&
379
- p[contextIdSymbol] !== volatileContextId &&
382
+ .filter(p => p[moduleIdSymbol] !== defaultDynamicModuleId &&
383
+ p[moduleIdSymbol] !== volatileModuleId &&
380
384
  typeof p.getState === 'function')
381
385
  .map(async p => ({ name: p.name, state: await p.getState(forUrl) })));
382
386
 
@@ -387,12 +391,12 @@ class VcsUiApp extends VcsApp {
387
391
  }
388
392
 
389
393
  /**
390
- * @param {import("@vcmap/core").Context} context
394
+ * @param {import("@vcmap/core").VcsModule} module
391
395
  * @returns {Promise<void>}
392
396
  * @protected
393
397
  */
394
- async _parseContext(context) {
395
- const { config } = context;
398
+ async _parseModule(module) {
399
+ const { config } = module;
396
400
  if (Array.isArray(config.plugins)) {
397
401
  const plugins = await Promise.all(config.plugins.map(async (pluginConfig) => {
398
402
  const plugin = await loadPlugin(pluginConfig.name, pluginConfig);
@@ -402,7 +406,7 @@ class VcsUiApp extends VcsApp {
402
406
  if (!isValidPackageName(plugin.name)) {
403
407
  getLogger().warning(`plugin ${plugin.name} has no valid package name!`);
404
408
  }
405
- plugin[contextIdSymbol] = context.id;
409
+ plugin[moduleIdSymbol] = module._id;
406
410
  return plugin;
407
411
  }));
408
412
 
@@ -411,22 +415,22 @@ class VcsUiApp extends VcsApp {
411
415
  .map(p => this._plugins.override(p));
412
416
  }
413
417
  if (Array.isArray(config.i18n)) {
414
- await this.i18n.parseItems(config.i18n, context.id);
418
+ await this.i18n.parseItems(config.i18n, module._id);
415
419
  }
416
- await super._parseContext(context);
417
- await this._contentTree.parseItems(config.contentTree, context.id);
418
- await this._uiConfig.parseItems(config.uiConfig, context.id);
419
- await this._featureInfo.collection.parseItems(config.featureInfo, context.id);
420
+ await super._parseModule(module);
421
+ await this._contentTree.parseItems(config.contentTree, module._id);
422
+ await this._uiConfig.parseItems(config.uiConfig, module._id);
423
+ await this._featureInfo.collection.parseItems(config.featureInfo, module._id);
420
424
  }
421
425
 
422
426
  /**
423
- * @param {import("@vcmap/core").Context} context
427
+ * @param {import("@vcmap/core").VcsModule} module
424
428
  * @returns {Promise<void>}
425
429
  * @protected
426
430
  */
427
- async _setContextState(context) {
428
- await super._setContextState(context);
429
- if (this._cachedAppState.contextIds.includes(context.id)) {
431
+ async _setModuleState(module) {
432
+ await super._setModuleState(module);
433
+ if (this._cachedAppState.moduleIds.includes(module._id)) {
430
434
  this._cachedAppState.layers.forEach((layerState) => {
431
435
  const layer = this.layers.getByKey(layerState.name);
432
436
  if (layer) {
@@ -456,23 +460,23 @@ class VcsUiApp extends VcsApp {
456
460
  } else if (this._cachedAppState.activeViewpoint && this.maps.activeMap) {
457
461
  await this.maps.activeMap.gotoViewpoint(new Viewpoint(this._cachedAppState.activeViewpoint));
458
462
  }
459
- this._cachedAppState.contextIds.splice(this._cachedAppState.contextIds.indexOf(context.id), 1);
463
+ this._cachedAppState.moduleIds.splice(this._cachedAppState.moduleIds.indexOf(module._id), 1);
460
464
  }
461
465
  }
462
466
 
463
467
  /**
464
- * @param {string} contextId
468
+ * @param {string} moduleId
465
469
  * @returns {Promise<void>}
466
470
  * @protected
467
471
  */
468
- async _removeContext(contextId) {
472
+ async _removeModule(moduleId) {
469
473
  await Promise.all([
470
- super._removeContext(contextId),
471
- this._plugins.removeContext(contextId),
472
- this._i18n.removeContext(contextId),
473
- this._contentTree.removeContext(contextId),
474
- this._featureInfo.collection.removeContext(contextId),
475
- this._uiConfig.removeContext(contextId),
474
+ super._removeModule(moduleId),
475
+ this._plugins.removeModule(moduleId),
476
+ this._i18n.removeModule(moduleId),
477
+ this._contentTree.removeModule(moduleId),
478
+ this._featureInfo.collection.removeModule(moduleId),
479
+ this._uiConfig.removeModule(moduleId),
476
480
  ]);
477
481
  }
478
482
 
@@ -21,6 +21,7 @@ export function createVueI18n() {
21
21
  messages: {
22
22
  en: {},
23
23
  },
24
+ postTranslation: (val, key) => (typeof val === 'string' ? val : key),
24
25
  });
25
26
  return i18n;
26
27
  }
package/start.js CHANGED
@@ -1,3 +1,9 @@
1
- import { initApp } from '@vcmap/ui';
1
+ // to load a app.config.json containing a set of configs
2
+ import { initAppFromAppConfig } from '@vcmap/ui';
2
3
 
3
- initApp('#app', 'map.config.json');
4
+ initAppFromAppConfig('#app', 'app.config.json');
5
+
6
+ // to load a single module (config)
7
+ // import { initAppFromModule } from '@vcmap/ui';
8
+
9
+ // initAppFromModule('#app', 'config/projects.config.json');
@@ -1 +0,0 @@
1
- import{initApp as s}from"./ui.d760e4.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))i(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function n(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerpolicy&&(r.referrerPolicy=e.referrerpolicy),e.crossorigin==="use-credentials"?r.credentials="include":e.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(e){if(e.ep)return;e.ep=!0;const r=n(e);fetch(e.href,r)}})();s("#app","map.config.json");