@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.
- package/README.md +2 -2
- package/app.config.json +5 -0
- package/build/buildPreview.js +2 -2
- package/config/aerowest.config.json +2 -0
- package/config/base.config.json +1 -0
- package/config/codes.config.json +2 -0
- package/config/dev.config.json +6 -0
- package/config/graphFeatureInfo.config.json +3 -1
- package/config/projects.config.json +27 -0
- package/config/www.config.json +2 -0
- package/dist/assets/cesium.js +1 -1
- package/dist/assets/{core.a66593.js → core.9342a1.js} +7804 -5352
- package/dist/assets/core.js +1 -1
- package/dist/assets/index.fd041928.js +1 -0
- package/dist/assets/ol.js +1 -1
- package/dist/assets/ui.c27597.css +5 -0
- package/dist/assets/{ui.d760e4.js → ui.c27597.js} +5055 -4694
- package/dist/assets/ui.js +1 -1
- package/dist/assets/vue.js +2 -2
- package/dist/assets/{vuetify.427322.js → vuetify.2f1432.js} +1 -1
- package/dist/assets/vuetify.js +2 -2
- package/dist/index.html +1 -1
- package/index.js +5 -2
- package/package.json +3 -3
- package/plugins/@vcmap/project-selector/{ContextsListComponent.vue → ModulesListComponent.vue} +10 -10
- package/plugins/@vcmap/project-selector/ProjectSelectorComponent.vue +15 -15
- package/plugins/@vcmap/project-selector/README.md +15 -21
- package/plugins/@vcmap/project-selector/config.json +3 -3
- package/plugins/@vcmap/project-selector/de.json +3 -0
- package/plugins/@vcmap/project-selector/en.json +3 -0
- package/plugins/@vcmap/project-selector/index.js +76 -101
- package/plugins/@vcmap/simple-graph/index.js +1 -1
- package/plugins/@vcmap-show-case/category-tester/Categories.vue +2 -2
- package/plugins/@vcmap-show-case/category-tester/Category.vue +1 -4
- package/plugins/@vcmap-show-case/config-editor/editor.vue +14 -14
- package/plugins/@vcmap-show-case/form-inputs-example/FormInputsExample.vue +18 -1
- package/plugins/@vcmap-show-case/form-inputs-example/index.js +1 -0
- package/plugins/@vcmap-show-case/table-example/DataTableExample.vue +202 -0
- package/plugins/@vcmap-show-case/table-example/README.md +3 -0
- package/plugins/@vcmap-show-case/table-example/index.js +47 -0
- package/plugins/@vcmap-show-case/table-example/package.json +5 -0
- package/src/actions/actionHelper.js +16 -27
- package/src/actions/styleSelector.vue +26 -19
- package/src/components/form-inputs-controls/VcsDatePicker.vue +111 -0
- package/src/components/form-inputs-controls/VcsTextField.vue +18 -7
- package/src/components/form-inputs-controls/VcsWizard.vue +3 -1
- package/src/components/icons/CheckboxCheckedIcon.vue +1 -1
- package/src/components/icons/LegendIcon.vue +10 -60
- package/src/components/lists/VcsList.vue +25 -6
- package/src/components/tables/VcsDataTable.vue +386 -0
- package/src/components/tables/VcsTable.vue +33 -278
- package/src/contentTree/contentTreeCollection.js +1 -1
- package/src/contentTree/layerContentTreeItem.js +3 -0
- package/src/downloadHelper.js +49 -0
- package/src/featureInfo/BalloonComponent.vue +9 -8
- package/src/featureInfo/abstractFeatureInfoView.js +1 -1
- package/src/featureInfo/featureInfo.js +3 -3
- package/src/i18n/de.js +8 -0
- package/src/i18n/en.js +8 -0
- package/src/i18n/i18nCollection.js +22 -22
- package/src/init.js +90 -7
- package/src/manager/categoryManager/CategoryComponent.vue +56 -47
- package/src/manager/categoryManager/CategoryManager.vue +23 -10
- package/src/manager/categoryManager/categoryManager.js +11 -11
- package/src/manager/navbarManager.js +18 -0
- package/src/manager/window/WindowComponent.vue +10 -15
- package/src/manager/window/WindowComponentHeader.vue +4 -2
- package/src/manager/window/WindowManager.vue +14 -15
- package/src/manager/window/windowHelper.js +1 -1
- package/src/manager/window/windowManager.js +18 -7
- package/src/navigation/mapNavCompass.vue +1 -1
- package/src/navigation/mapNavigation.vue +6 -6
- package/src/navigation/obliqueRotation.vue +36 -13
- package/src/navigation/orientationToolsButton.vue +0 -1
- package/src/navigation/overviewMap.js +5 -5
- package/src/navigation/vcsZoomButton.vue +37 -11
- package/src/pluginHelper.js +20 -0
- package/src/search/search.js +12 -3
- package/src/search/searchComponent.vue +15 -0
- package/src/state.js +6 -6
- package/src/uiConfig.js +3 -3
- package/src/vcsUiApp.js +44 -40
- package/src/vuePlugins/i18n.js +1 -0
- package/start.js +8 -2
- package/dist/assets/index.8b833ead.js +0 -1
- package/dist/assets/ui.d760e4.css +0 -5
- package/map.config.json +0 -44
- /package/dist/assets/{cesium.88cffd.js → cesium.166f91.js} +0 -0
- /package/dist/assets/{ol.d4539f.js → ol.d2cba3.js} +0 -0
- /package/dist/assets/{vue.db5102.js → vue.5d00e9.js} +0 -0
- /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
|
-
|
3
|
+
moduleIdSymbol,
|
4
4
|
Collection,
|
5
5
|
makeOverrideCollection,
|
6
6
|
destroyCollection,
|
7
7
|
OverrideClassRegistry,
|
8
|
-
|
8
|
+
defaultDynamicModuleId,
|
9
9
|
ObliqueMap,
|
10
10
|
Viewpoint,
|
11
|
-
|
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.
|
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[
|
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.
|
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[
|
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.
|
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.
|
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.
|
345
|
-
.filter(({
|
346
|
-
.map(({
|
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[
|
354
|
-
l[
|
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[
|
370
|
-
l.style[
|
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[
|
379
|
-
p[
|
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").
|
394
|
+
* @param {import("@vcmap/core").VcsModule} module
|
391
395
|
* @returns {Promise<void>}
|
392
396
|
* @protected
|
393
397
|
*/
|
394
|
-
async
|
395
|
-
const { config } =
|
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[
|
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,
|
418
|
+
await this.i18n.parseItems(config.i18n, module._id);
|
415
419
|
}
|
416
|
-
await super.
|
417
|
-
await this._contentTree.parseItems(config.contentTree,
|
418
|
-
await this._uiConfig.parseItems(config.uiConfig,
|
419
|
-
await this._featureInfo.collection.parseItems(config.featureInfo,
|
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").
|
427
|
+
* @param {import("@vcmap/core").VcsModule} module
|
424
428
|
* @returns {Promise<void>}
|
425
429
|
* @protected
|
426
430
|
*/
|
427
|
-
async
|
428
|
-
await super.
|
429
|
-
if (this._cachedAppState.
|
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.
|
463
|
+
this._cachedAppState.moduleIds.splice(this._cachedAppState.moduleIds.indexOf(module._id), 1);
|
460
464
|
}
|
461
465
|
}
|
462
466
|
|
463
467
|
/**
|
464
|
-
* @param {string}
|
468
|
+
* @param {string} moduleId
|
465
469
|
* @returns {Promise<void>}
|
466
470
|
* @protected
|
467
471
|
*/
|
468
|
-
async
|
472
|
+
async _removeModule(moduleId) {
|
469
473
|
await Promise.all([
|
470
|
-
super.
|
471
|
-
this._plugins.
|
472
|
-
this._i18n.
|
473
|
-
this._contentTree.
|
474
|
-
this._featureInfo.collection.
|
475
|
-
this._uiConfig.
|
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
|
|
package/src/vuePlugins/i18n.js
CHANGED
package/start.js
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
-
|
1
|
+
// to load a app.config.json containing a set of configs
|
2
|
+
import { initAppFromAppConfig } from '@vcmap/ui';
|
2
3
|
|
3
|
-
|
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");
|