@vcmap/ui 5.1.0-rc.4 → 5.1.0

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/dist/assets/ui.js CHANGED
@@ -1 +1 @@
1
- export * from "./ui.21bb56.js";
1
+ export * from "./ui.301d83.js";
@@ -1,5 +1,5 @@
1
- export * from "./vue.403631.js";
2
- import { default as f } from "./vue.403631.js";
1
+ export * from "./vue.806e32.js";
2
+ import { default as f } from "./vue.806e32.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.145dc5.css');import v from "./vue.403631.js";
16
+ } await loadCss('./assets/vuetify.2fbc17.css');import v from "./vue.806e32.js";
17
17
  const Ne = v.extend().extend({
18
18
  name: "themeable",
19
19
  provide() {
@@ -1,5 +1,5 @@
1
- export * from "./vuetify.145dc5.js";
2
- import { default as f } from "./vuetify.145dc5.js";
1
+ export * from "./vuetify.2fbc17.js";
2
+ import { default as f } from "./vuetify.2fbc17.js";
3
3
  export {
4
4
  f as default
5
5
  };
package/dist/index.html CHANGED
@@ -91,7 +91,7 @@
91
91
  }
92
92
  }
93
93
  </style>
94
- <script type="module" crossorigin src="./assets/index-564248ae.js"></script>
94
+ <script type="module" crossorigin src="./assets/index-de529e1b.js"></script>
95
95
  </head>
96
96
  <body style="height: 100vh; margin: 0;">
97
97
  <noscript>
package/index.d.ts CHANGED
@@ -52,8 +52,6 @@ export { default as CollectionManagerComponent } from "./src/manager/collectionM
52
52
  export type * from "./src/manager/collectionManager/CollectionManager.vue.d.ts";
53
53
  export { default as CollectionComponentProvider } from "./src/manager/collectionManager/CollectionComponentProvider.vue";
54
54
  export type * from "./src/manager/collectionManager/CollectionComponentProvider.vue.d.ts";
55
- export { default as CollectionComponentClass } from "./src/manager/collectionManager/collectionComponentClass.js";
56
- export type * from "./src/manager/collectionManager/collectionComponentClass.d.ts";
57
55
  export { default as CollectionComponent } from "./src/manager/collectionManager/CollectionComponent.vue";
58
56
  export type * from "./src/manager/collectionManager/CollectionComponent.vue.d.ts";
59
57
  export { default as CollectionComponentList } from "./src/manager/collectionManager/CollectionComponentList.vue";
@@ -218,6 +216,8 @@ export { default as NavbarManager, ButtonLocation, getActionsByLocation } from "
218
216
  export type * from "./src/manager/navbarManager.d.ts";
219
217
  export { default as ToolboxManager, ToolboxType, defaultToolboxName } from "./src/manager/toolbox/toolboxManager.js";
220
218
  export type * from "./src/manager/toolbox/toolboxManager.d.ts";
219
+ export { default as CollectionComponentClass, createSupportedMapMappingFunction } from "./src/manager/collectionManager/collectionComponentClass.js";
220
+ export type * from "./src/manager/collectionManager/collectionComponentClass.d.ts";
221
221
  export { makeEditorCollectionComponentClass, isEditorCollectionComponentClass } from "./src/manager/collectionManager/editorCollectionComponentClass.js";
222
222
  export type * from "./src/manager/collectionManager/editorCollectionComponentClass.d.ts";
223
223
  export { applyKeyMapping, applyValueMapping, default as AbstractFeatureInfoView } from "./src/featureInfo/abstractFeatureInfoView.js";
package/index.js CHANGED
@@ -111,7 +111,10 @@ export { default as CategoryManager } from './src/manager/collectionManager/cate
111
111
  export { default as CollectionManager } from './src/manager/collectionManager/collectionManager.js';
112
112
  export { default as CollectionManagerComponent } from './src/manager/collectionManager/CollectionManager.vue';
113
113
  export { default as CollectionComponentProvider } from './src/manager/collectionManager/CollectionComponentProvider.vue';
114
- export { default as CollectionComponentClass } from './src/manager/collectionManager/collectionComponentClass.js';
114
+ export {
115
+ default as CollectionComponentClass,
116
+ createSupportedMapMappingFunction,
117
+ } from './src/manager/collectionManager/collectionComponentClass.js';
115
118
  export {
116
119
  makeEditorCollectionComponentClass,
117
120
  isEditorCollectionComponentClass,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vcmap/ui",
3
- "version": "5.1.0-rc.4",
3
+ "version": "5.1.0",
4
4
  "author": "Virtual City Systems",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -53,7 +53,7 @@
53
53
  },
54
54
  "peerDependencies": {
55
55
  "@vcmap-cesium/engine": "^4.0.3",
56
- "@vcmap/core": "^5.1.0-rc.3",
56
+ "@vcmap/core": "^5.1.0",
57
57
  "ol": "^7.5.2",
58
58
  "vue": "~2.7.3",
59
59
  "vuetify": "~2.6.7"
@@ -3,7 +3,7 @@
3
3
  "@vcmap/print": "^1.0.2",
4
4
  "@vcmap/swipe-tool": "^1.0.3",
5
5
  "@vcmap/export": "^1.0.1",
6
- "@vcmap/shadow": "^1.0.1",
6
+ "@vcmap/shadow": "^2.0.0",
7
7
  "@vcmap/draw": "^2.0.0",
8
8
  "@vcmap/create-link": "^1.0.1",
9
9
  "@vcmap/search-nominatim": "^1.0.1",
@@ -14,6 +14,6 @@
14
14
  "@vcmap/flight": "^1.0.1"
15
15
  },
16
16
  "optionalDependencies": {
17
- "@vcmap/planning": "^1.0.1"
17
+ "@vcmap/planning": "^5.0.1"
18
18
  }
19
19
  }
@@ -74,6 +74,7 @@
74
74
  unit="s"
75
75
  step="1"
76
76
  :decimals="2"
77
+ :disabled="disablePlayer"
77
78
  :rules="[durationRule]"
78
79
  />
79
80
  </v-col>
@@ -6,6 +6,8 @@ export type ICategoryManager = import("../../vcsUiApp.js").VcsComponentManager<i
6
6
  /**
7
7
  * Manages all requested category collections.
8
8
  * Provides an API to add/remove collectionsComponents.
9
+ * Per default only items of the defaultDynamicModuleId are shown in the CategoryManager.
10
+ * Further modules can be supported using the addModuleId API.
9
11
  * @implements {ICategoryManager}
10
12
  * @extends CollectionManager
11
13
  */
@@ -27,6 +29,11 @@ declare class CategoryManager extends CollectionManager implements ICategoryMana
27
29
  * @private
28
30
  */
29
31
  private _dynamicModuleId;
32
+ /**
33
+ * @type {string[]}
34
+ * @private
35
+ */
36
+ private _moduleIds;
30
37
  /**
31
38
  * @param {Object} item
32
39
  * @return {boolean}
@@ -52,5 +59,15 @@ declare class CategoryManager extends CollectionManager implements ICategoryMana
52
59
  collectionComponent: import("./collectionComponentClass.js").default<T>;
53
60
  category: import("@vcmap/core/dist/src/category/category.js").default<T>;
54
61
  }>;
62
+ /**
63
+ * Updates the filterFunction for added moduleIds.
64
+ * Items of added moduleIds, are shown in the CategoryManager
65
+ * @param {string} id
66
+ */
67
+ addModuleId(id: string): void;
68
+ /**
69
+ * @param {string} id
70
+ */
71
+ removeModuleId(id: string): void;
55
72
  }
56
73
  import CollectionManager from './collectionManager.js';
@@ -1,4 +1,5 @@
1
- import { moduleIdSymbol } from '@vcmap/core';
1
+ import { defaultDynamicModuleId, moduleIdSymbol } from '@vcmap/core';
2
+ import { check } from '@vcsuite/check';
2
3
  import { vcsAppSymbol } from '../../pluginHelper.js';
3
4
  import CollectionManager from './collectionManager.js';
4
5
 
@@ -9,6 +10,8 @@ import CollectionManager from './collectionManager.js';
9
10
  /**
10
11
  * Manages all requested category collections.
11
12
  * Provides an API to add/remove collectionsComponents.
13
+ * Per default only items of the defaultDynamicModuleId are shown in the CategoryManager.
14
+ * Further modules can be supported using the addModuleId API.
12
15
  * @implements {ICategoryManager}
13
16
  * @extends CollectionManager
14
17
  */
@@ -31,7 +34,12 @@ class CategoryManager extends CollectionManager {
31
34
  * @type {string}
32
35
  * @private
33
36
  */
34
- this._dynamicModuleId = this._app.dynamicModuleId;
37
+ this._dynamicModuleId = defaultDynamicModuleId;
38
+ /**
39
+ * @type {string[]}
40
+ * @private
41
+ */
42
+ this._moduleIds = [];
35
43
 
36
44
  /**
37
45
  * @param {Object} item
@@ -49,7 +57,9 @@ class CategoryManager extends CollectionManager {
49
57
  */
50
58
  this._categoryListeners = [
51
59
  this._app.dynamicModuleIdChanged.addEventListener((id) => {
52
- this._dynamicModuleId = id;
60
+ if (id === defaultDynamicModuleId || this._moduleIds.includes(id)) {
61
+ this._dynamicModuleId = id;
62
+ }
53
63
  this.reset();
54
64
  }),
55
65
  this._app.categories.removed.addEventListener((category) => {
@@ -88,6 +98,34 @@ class CategoryManager extends CollectionManager {
88
98
  return { collectionComponent, category };
89
99
  }
90
100
 
101
+ /**
102
+ * Updates the filterFunction for added moduleIds.
103
+ * Items of added moduleIds, are shown in the CategoryManager
104
+ * @param {string} id
105
+ */
106
+ addModuleId(id) {
107
+ check(id, String);
108
+ if (!this._moduleIds.includes(id)) {
109
+ this._moduleIds.push(id);
110
+ }
111
+ if (id === this._app.dynamicModuleId) {
112
+ this.reset();
113
+ }
114
+ }
115
+
116
+ /**
117
+ * @param {string} id
118
+ */
119
+ removeModuleId(id) {
120
+ const idx = this._moduleIds.indexOf(id);
121
+ if (idx > -1) {
122
+ this._moduleIds.splice(idx, 1);
123
+ }
124
+ if (id === this._app.dynamicModuleId) {
125
+ this.reset();
126
+ }
127
+ }
128
+
91
129
  destroy() {
92
130
  super.destroy();
93
131
  this._categoryListeners.forEach((cb) => cb());
@@ -1,3 +1,10 @@
1
+ /**
2
+ * @param {string[]|function(T):string[]} supportedMaps
3
+ * @param {import("@vcmap/core").MapCollection} mapCollection
4
+ * @template {Object|import("@vcmap/core").VcsObject} T
5
+ * @returns {import("./collectionManager.js").MappingFunction<T>}
6
+ */
7
+ export function createSupportedMapMappingFunction<T extends Object | import("@vcmap/core/dist/src/vcsObject.js").default>(supportedMaps: string[] | ((arg0: T) => string[]), mapCollection: import("@vcmap/core").MapCollection): import("./collectionManager.js").MappingFunction<T>;
1
8
  export default CollectionComponentClass;
2
9
  export type CollectionComponentUiOptions = {
3
10
  id?: string | undefined;
@@ -3,6 +3,7 @@ import { getLogger } from '@vcsuite/logger';
3
3
  import { v4 as uuidv4 } from 'uuid';
4
4
  import { computed, ref, watch } from 'vue';
5
5
  import { parseBoolean, parseNumber } from '@vcsuite/parsers';
6
+ import { check } from '@vcsuite/check';
6
7
  import { validateAction } from '../../components/lists/VcsActionList.vue';
7
8
  import { sortByWeight } from '../buttonManager.js';
8
9
  import {
@@ -63,6 +64,30 @@ function titleChanged(item, listItem, newTitle) {
63
64
  listItem.title = newTitle;
64
65
  }
65
66
 
67
+ /**
68
+ * @param {string[]|function(T):string[]} supportedMaps
69
+ * @param {import("@vcmap/core").MapCollection} mapCollection
70
+ * @template {Object|import("@vcmap/core").VcsObject} T
71
+ * @returns {import("./collectionManager.js").MappingFunction<T>}
72
+ */
73
+ export function createSupportedMapMappingFunction(
74
+ supportedMaps,
75
+ mapCollection,
76
+ ) {
77
+ check(supportedMaps, [[String], Function]);
78
+
79
+ return (item, _c, listItem) => {
80
+ const mapNames =
81
+ typeof supportedMaps === 'function' ? supportedMaps(item) : supportedMaps;
82
+ listItem.disabled = !mapNames.includes(mapCollection.activeMap.className);
83
+ listItem.destroyFunctions.push(
84
+ mapCollection.mapActivated.addEventListener((map) => {
85
+ listItem.disabled = !mapNames.includes(map.className);
86
+ }),
87
+ );
88
+ };
89
+ }
90
+
66
91
  /**
67
92
  * Manages one collection and creates a mirrored items array with ListItems.
68
93
  * Listens to all collection events and synchronizes changes to the items array.
@@ -1 +0,0 @@
1
- import{initAppFromAppConfig as p}from"./ui.21bb56.js";p("#app","app.config.json");
File without changes
File without changes
File without changes