@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
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
  /**
@@ -106,13 +110,18 @@ class VcsUiApp extends VcsApp {
106
110
 
107
111
  constructor() {
108
112
  super();
113
+ /**
114
+ * An event triggered when the vuetify theme mode changes or the primary color is updated by a new uiConfig entry.
115
+ * @type {VcsEvent<void>}
116
+ */
117
+ this.themeChanged = new VcsEvent();
109
118
  /**
110
119
  * @type {import("@vcmap/core").OverrideCollection<VcsPlugin>}
111
120
  * @private
112
121
  */
113
122
  this._plugins = makeOverrideCollection(
114
123
  new Collection(),
115
- () => this.dynamicContextId,
124
+ () => this.dynamicModuleId,
116
125
  serializePlugin,
117
126
  deserializePlugin,
118
127
  );
@@ -129,11 +138,11 @@ class VcsUiApp extends VcsApp {
129
138
  this._contextMenuManager.removeOwner(plugin.name);
130
139
  this._search.removeOwner(plugin.name);
131
140
  if (plugin.i18n) {
132
- this.i18n.addPluginMessages(plugin.name, plugin[contextIdSymbol], plugin.i18n);
141
+ this.i18n.addPluginMessages(plugin.name, plugin[moduleIdSymbol], plugin.i18n);
133
142
  }
134
143
  if (plugin.initialize) {
135
144
  let state;
136
- if (this._cachedAppState.contextIds.includes(plugin[contextIdSymbol])) {
145
+ if (this._cachedAppState.moduleIds.includes(plugin[moduleIdSymbol])) {
137
146
  state = this._cachedAppState.plugins.find(s => s.name === plugin.name);
138
147
  }
139
148
  try {
@@ -150,7 +159,7 @@ class VcsUiApp extends VcsApp {
150
159
  this._categoryManager.removeOwner(plugin.name);
151
160
  this._contextMenuManager.removeOwner(plugin.name);
152
161
  this._search.removeOwner(plugin.name);
153
- this.i18n.removePluginMessages(plugin.name, plugin[contextIdSymbol]);
162
+ this.i18n.removePluginMessages(plugin.name, plugin[moduleIdSymbol]);
154
163
  }),
155
164
  ];
156
165
 
@@ -187,7 +196,7 @@ class VcsUiApp extends VcsApp {
187
196
  * @type {UiConfig}
188
197
  * @private
189
198
  */
190
- this._uiConfig = new UiConfig(() => this.dynamicContextId);
199
+ this._uiConfig = new UiConfig(() => this.dynamicModuleId);
191
200
  /**
192
201
  * @type {FeatureInfo}
193
202
  * @private
@@ -204,7 +213,7 @@ class VcsUiApp extends VcsApp {
204
213
  * @type {I18nCollection<Object>}
205
214
  * @private
206
215
  */
207
- this._i18n = new I18nCollection(() => this.dynamicContextId);
216
+ this._i18n = new I18nCollection(() => this.dynamicModuleId);
208
217
 
209
218
  /**
210
219
  * @type {CategoryManager}
@@ -336,17 +345,17 @@ class VcsUiApp extends VcsApp {
336
345
  */
337
346
  async getState(forUrl) {
338
347
  const state = createEmptyState();
339
- state.contextIds = this.contexts
340
- .filter(({ id }) => id !== defaultDynamicContextId)
341
- .map(({ id }) => id);
348
+ state.moduleIds = this.modules
349
+ .filter(({ _id }) => _id !== defaultDynamicModuleId)
350
+ .map(({ _id }) => _id);
342
351
 
343
352
  state.activeMap = this.maps.activeMap.name;
344
353
  const viewpoint = await this.maps.activeMap.getViewpoint();
345
354
  state.activeViewpoint = viewpoint?.isValid?.() ? viewpoint.toJSON() : undefined;
346
355
  state.layers = [...this.layers]
347
356
  .filter(l => l.isSupported(this.maps.activeMap) &&
348
- l[contextIdSymbol] !== defaultDynamicContextId &&
349
- l[contextIdSymbol] !== volatileContextId &&
357
+ l[moduleIdSymbol] !== defaultDynamicModuleId &&
358
+ l[moduleIdSymbol] !== volatileModuleId &&
350
359
  (
351
360
  ((l.active || l.loading) && !l.activeOnStartup) ||
352
361
  (!l.active && l.activeOnStartup) ||
@@ -361,8 +370,8 @@ class VcsUiApp extends VcsApp {
361
370
  l.style &&
362
371
  l.style.name !== l.defaultStyle.name &&
363
372
  this.styles.has(l.style) &&
364
- l.style[contextIdSymbol] !== defaultDynamicContextId &&
365
- l.style[contextIdSymbol] !== volatileContextId
373
+ l.style[moduleIdSymbol] !== defaultDynamicModuleId &&
374
+ l.style[moduleIdSymbol] !== volatileModuleId
366
375
  ) {
367
376
  layerState.styleName = l.style.name;
368
377
  }
@@ -370,8 +379,8 @@ class VcsUiApp extends VcsApp {
370
379
  });
371
380
 
372
381
  state.plugins = await Promise.all([...this.plugins]
373
- .filter(p => p[contextIdSymbol] !== defaultDynamicContextId &&
374
- p[contextIdSymbol] !== volatileContextId &&
382
+ .filter(p => p[moduleIdSymbol] !== defaultDynamicModuleId &&
383
+ p[moduleIdSymbol] !== volatileModuleId &&
375
384
  typeof p.getState === 'function')
376
385
  .map(async p => ({ name: p.name, state: await p.getState(forUrl) })));
377
386
 
@@ -382,12 +391,12 @@ class VcsUiApp extends VcsApp {
382
391
  }
383
392
 
384
393
  /**
385
- * @param {import("@vcmap/core").Context} context
394
+ * @param {import("@vcmap/core").VcsModule} module
386
395
  * @returns {Promise<void>}
387
396
  * @protected
388
397
  */
389
- async _parseContext(context) {
390
- const { config } = context;
398
+ async _parseModule(module) {
399
+ const { config } = module;
391
400
  if (Array.isArray(config.plugins)) {
392
401
  const plugins = await Promise.all(config.plugins.map(async (pluginConfig) => {
393
402
  const plugin = await loadPlugin(pluginConfig.name, pluginConfig);
@@ -397,7 +406,7 @@ class VcsUiApp extends VcsApp {
397
406
  if (!isValidPackageName(plugin.name)) {
398
407
  getLogger().warning(`plugin ${plugin.name} has no valid package name!`);
399
408
  }
400
- plugin[contextIdSymbol] = context.id;
409
+ plugin[moduleIdSymbol] = module._id;
401
410
  return plugin;
402
411
  }));
403
412
 
@@ -406,22 +415,22 @@ class VcsUiApp extends VcsApp {
406
415
  .map(p => this._plugins.override(p));
407
416
  }
408
417
  if (Array.isArray(config.i18n)) {
409
- await this.i18n.parseItems(config.i18n, context.id);
418
+ await this.i18n.parseItems(config.i18n, module._id);
410
419
  }
411
- await super._parseContext(context);
412
- await this._contentTree.parseItems(config.contentTree, context.id);
413
- await this._uiConfig.parseItems(config.uiConfig, context.id);
414
- 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);
415
424
  }
416
425
 
417
426
  /**
418
- * @param {import("@vcmap/core").Context} context
427
+ * @param {import("@vcmap/core").VcsModule} module
419
428
  * @returns {Promise<void>}
420
429
  * @protected
421
430
  */
422
- async _setContextState(context) {
423
- await super._setContextState(context);
424
- if (this._cachedAppState.contextIds.includes(context.id)) {
431
+ async _setModuleState(module) {
432
+ await super._setModuleState(module);
433
+ if (this._cachedAppState.moduleIds.includes(module._id)) {
425
434
  this._cachedAppState.layers.forEach((layerState) => {
426
435
  const layer = this.layers.getByKey(layerState.name);
427
436
  if (layer) {
@@ -451,23 +460,23 @@ class VcsUiApp extends VcsApp {
451
460
  } else if (this._cachedAppState.activeViewpoint && this.maps.activeMap) {
452
461
  await this.maps.activeMap.gotoViewpoint(new Viewpoint(this._cachedAppState.activeViewpoint));
453
462
  }
454
- this._cachedAppState.contextIds.splice(this._cachedAppState.contextIds.indexOf(context.id), 1);
463
+ this._cachedAppState.moduleIds.splice(this._cachedAppState.moduleIds.indexOf(module._id), 1);
455
464
  }
456
465
  }
457
466
 
458
467
  /**
459
- * @param {string} contextId
468
+ * @param {string} moduleId
460
469
  * @returns {Promise<void>}
461
470
  * @protected
462
471
  */
463
- async _removeContext(contextId) {
472
+ async _removeModule(moduleId) {
464
473
  await Promise.all([
465
- super._removeContext(contextId),
466
- this._plugins.removeContext(contextId),
467
- this._i18n.removeContext(contextId),
468
- this._contentTree.removeContext(contextId),
469
- this._featureInfo.collection.removeContext(contextId),
470
- 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),
471
480
  ]);
472
481
  }
473
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
  }
@@ -1,14 +1,19 @@
1
1
  import '@mdi/font/css/materialdesignicons.css';
2
2
  import Vue from 'vue';
3
3
  import Vuetify from 'vuetify/lib';
4
+ import { genVariations } from 'vuetify/lib/services/theme/utils.js';
5
+ import { colorToInt } from 'vuetify/lib/util/colorUtils.js';
4
6
  import Icons from '../components/icons/+all.js';
5
7
 
6
8
  Vue.use(Vuetify);
7
9
 
8
10
  /**
9
- * @type {string}
11
+ * @type {{light:string,dark:string}}
10
12
  */
11
- export const defaultPrimaryColor = '#409D76';
13
+ export const defaultPrimaryColor = {
14
+ light: '#409D76',
15
+ dark: '#27B97C',
16
+ };
12
17
 
13
18
  /**
14
19
  * @returns {import("vuetify").default}
@@ -27,23 +32,38 @@ export function createVuetify() {
27
32
  },
28
33
  themes: {
29
34
  light: {
30
- basic: '#FFFFFF',
31
- primary: defaultPrimaryColor,
32
- accent: '#EDEDED',
35
+ base: {
36
+ base: '#9E9E9E',
37
+ lighten5: '#FFFFFF',
38
+ lighten4: '#F8F8F8',
39
+ lighten3: '#EBEBEB',
40
+ lighten2: '#D0D0D0',
41
+ lighten1: '#B8B8B8',
42
+ darken1: '#858585',
43
+ darken2: '#6B6B6B',
44
+ darken3: '#525252',
45
+ darken4: '#383838',
46
+ },
47
+ primary: defaultPrimaryColor.light,
33
48
  warning: '#FFCE00',
34
- 'gray-200': '#DEDEDE',
35
- gray: '#707070',
36
- // todo: change remaining colors
37
- secondary: '#222222',
38
49
  error: '#AA0000',
39
50
  info: '#2196F3',
40
51
  success: '#4CAF50',
41
52
  },
42
53
  dark: {
43
- basic: '#000000',
44
- primary: defaultPrimaryColor,
45
- secondary: '#FFFFFF',
46
- accent: '#757575',
54
+ base: {
55
+ base: '#9E9E9E',
56
+ lighten5: '#FFFFFF',
57
+ lighten4: '#383838',
58
+ lighten3: '#525252',
59
+ lighten2: '#6B6B6B',
60
+ lighten1: '#858585',
61
+ darken1: '#B8B8B8',
62
+ darken2: '#D0D0D0',
63
+ darken3: '#EBEBEB',
64
+ darken4: '#F8F8F8',
65
+ },
66
+ primary: defaultPrimaryColor.dark,
47
67
  warning: '#FFCE00',
48
68
  error: '#FF5252',
49
69
  info: '#2196F3',
@@ -64,3 +84,29 @@ export function createVuetify() {
64
84
  * @type {import("vuetify").default}
65
85
  */
66
86
  export const vuetify = createVuetify();
87
+
88
+ /**
89
+ * Returns the default primary color depending on the selected theme mode
90
+ * @returns {string}
91
+ */
92
+ export function getDefaultPrimaryColor() {
93
+ if (vuetify.framework.theme.isDark) {
94
+ return defaultPrimaryColor.dark;
95
+ }
96
+ return defaultPrimaryColor.light;
97
+ }
98
+
99
+ /**
100
+ * Returns the color depending on the current theme mode
101
+ * @param {string} value - color key, e.g. 'primary'
102
+ * @param {string=} variant - color variant, e.g. 'lighten1', 'darken4', ...
103
+ * @returns {string}
104
+ */
105
+ export function getColorByKey(value, variant) {
106
+ const mode = vuetify.framework.theme.isDark ? 'dark' : 'light';
107
+ const color = vuetify.framework.theme.themes[mode][value];
108
+ if (color && variant) {
109
+ return color[variant] ?? genVariations(value, colorToInt(color))[variant];
110
+ }
111
+ return color?.base ?? color;
112
+ }
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.80175f.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");