@vcmap/ui 5.0.0-rc.10 → 5.0.0-rc.11

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 (116) hide show
  1. package/README.md +11 -4
  2. package/build/build.js +0 -3
  3. package/build/buildHelpers.js +0 -1
  4. package/build/buildPreview.js +7 -0
  5. package/config/aerowest.config.json +13 -3
  6. package/config/base.config.json +89 -64
  7. package/config/codes.config.json +397 -0
  8. package/config/dev.config.json +169 -0
  9. package/config/graphFeatureInfo.config.json +100 -0
  10. package/config/www.config.json +1232 -0
  11. package/dist/assets/{cesium.eb5667.js → cesium.e67536.js} +0 -0
  12. package/dist/assets/cesium.js +1 -1
  13. package/dist/assets/core.ebf665.js +4 -0
  14. package/dist/assets/core.js +1 -1
  15. package/dist/assets/{index.4ccd4433.js → index.9b213929.js} +1 -1
  16. package/dist/assets/{ol.ef03b1.js → ol.8bbd50.js} +0 -0
  17. package/dist/assets/ol.js +1 -1
  18. package/dist/assets/ui.fdfe0d.css +1 -0
  19. package/dist/assets/ui.fdfe0d.js +68 -0
  20. package/dist/assets/ui.js +1 -1
  21. package/dist/assets/vue.0bb7c6.js +9 -0
  22. package/dist/assets/vue.js +2 -1
  23. package/dist/assets/{vuetify.401a29.css → vuetify.53300f.css} +1 -1
  24. package/dist/assets/{vuetify.401a29.js → vuetify.53300f.js} +71 -71
  25. package/dist/assets/vuetify.js +2 -2
  26. package/dist/index.html +1 -1
  27. package/index.js +36 -5
  28. package/lib/vue.js +1 -0
  29. package/map.config.json +15 -6
  30. package/package.json +6 -7
  31. package/plugins/@vcmap/create-link/fallbackCreateLink.vue +71 -0
  32. package/plugins/@vcmap/create-link/index.js +83 -0
  33. package/plugins/@vcmap/create-link/package.json +6 -0
  34. package/plugins/@vcmap/pluginExample/index.js +1 -1
  35. package/plugins/@vcmap/pluginExample/pluginExampleComponent.vue +20 -3
  36. package/plugins/@vcmap/project-selector/ProjectSelectorComponent.vue +1 -1
  37. package/plugins/@vcmap/project-selector/index.js +1 -1
  38. package/plugins/@vcmap/project-selector/package.json +1 -2
  39. package/plugins/@vcmap/theme-changer/ThemeChangerComponent.vue +1 -1
  40. package/plugins/@vcmap/theme-changer/index.js +1 -1
  41. package/plugins/@vcmap/theme-changer/package.json +1 -2
  42. package/plugins/categoryTest/Categories.vue +89 -1
  43. package/plugins/categoryTest/Category.vue +1 -1
  44. package/plugins/simple-graph/README.md +51 -0
  45. package/plugins/simple-graph/SimpleGraphComponent.vue +70 -0
  46. package/plugins/simple-graph/index.js +17 -0
  47. package/plugins/simple-graph/package.json +11 -0
  48. package/plugins/simple-graph/simpleGraphView.js +76 -0
  49. package/plugins/test/editor.vue +1 -1
  50. package/plugins/test/index.js +63 -2
  51. package/plugins/test/windowManagerExample.vue +1 -1
  52. package/src/actions/stateRefAction.js +2 -2
  53. package/src/actions/styleSelector.vue +1 -1
  54. package/src/application/Navbar.vue +13 -2
  55. package/src/application/VcsApp.vue +201 -92
  56. package/src/application/VcsMap.vue +1 -1
  57. package/src/application/VcsSettings.vue +1 -1
  58. package/src/application/vcsAppWrapper.vue +1 -0
  59. package/src/components/form-inputs-controls/VcsCheckbox.vue +13 -0
  60. package/src/components/form-inputs-controls/VcsColorPicker.vue +1 -1
  61. package/src/components/form-inputs-controls/VcsRadio.vue +123 -0
  62. package/src/components/form-output/VcsFormattedNumber.vue +1 -1
  63. package/src/components/lists/VcsActionList.vue +13 -4
  64. package/src/components/lists/VcsTreeview.vue +4 -4
  65. package/src/components/lists/VcsTreeviewLeaf.vue +9 -2
  66. package/src/components/lists/VcsTreeviewSearchbar.vue +1 -2
  67. package/src/components/tables/VcsTable.vue +245 -0
  68. package/src/contentTree/LayerTree.vue +1 -1
  69. package/src/contentTree/contentTreeCollection.js +4 -4
  70. package/src/contentTree/contentTreeItem.js +9 -9
  71. package/src/contentTree/groupContentTreeItem.js +1 -1
  72. package/src/contentTree/layerContentTreeItem.js +15 -1
  73. package/src/contentTree/layerGroupContentTreeItem.js +21 -1
  74. package/src/contentTree/nodeContentTreeItem.js +1 -1
  75. package/src/featureInfo/AddressBalloonComponent.vue +47 -0
  76. package/src/featureInfo/BalloonComponent.vue +138 -0
  77. package/src/featureInfo/abstractFeatureInfoView.js +313 -0
  78. package/src/featureInfo/addressBalloonFeatureInfoView.js +118 -0
  79. package/src/featureInfo/balloonFeatureInfoView.js +151 -0
  80. package/src/featureInfo/balloonHelper.js +132 -0
  81. package/src/featureInfo/featureInfo.js +455 -0
  82. package/src/featureInfo/featureInfoInteraction.js +42 -0
  83. package/src/featureInfo/iframeFeatureInfoView.js +95 -0
  84. package/src/featureInfo/tableFeatureInfoView.js +106 -0
  85. package/src/i18n/de.js +16 -0
  86. package/src/i18n/en.js +16 -0
  87. package/src/i18n/i18nCollection.js +17 -0
  88. package/src/manager/buttonManager.js +5 -5
  89. package/src/manager/categoryManager/ComponentsManager.vue +30 -0
  90. package/src/manager/categoryManager/categoryManager.js +500 -0
  91. package/src/manager/contextMenu/contextMenuComponent.vue +43 -0
  92. package/src/manager/contextMenu/contextMenuInteraction.js +42 -0
  93. package/src/manager/contextMenu/contextMenuManager.js +197 -0
  94. package/src/manager/navbarManager.js +8 -8
  95. package/src/manager/toolbox/ToolboxManager.vue +2 -2
  96. package/src/manager/toolbox/toolboxManager.js +7 -3
  97. package/src/manager/window/WindowComponent.vue +1 -1
  98. package/src/manager/window/WindowManager.vue +5 -3
  99. package/src/manager/window/windowManager.js +118 -14
  100. package/src/navigation/mapNavigation.vue +3 -5
  101. package/src/navigation/overviewMap.js +28 -5
  102. package/src/navigation/vcsCompass.vue +1 -1
  103. package/src/setup.js +0 -2
  104. package/src/state.js +256 -0
  105. package/src/styles/_theming.scss +0 -5
  106. package/src/uiConfig.js +79 -0
  107. package/src/vcsUiApp.js +210 -20
  108. package/src/vuePlugins/vuetify.js +14 -4
  109. package/config/berlin.config.json +0 -510
  110. package/dist/assets/core.216494.js +0 -4
  111. package/dist/assets/ui.99a1a7.css +0 -1
  112. package/dist/assets/ui.99a1a7.js +0 -70
  113. package/dist/assets/vue-composition-api.c5aca1.js +0 -14
  114. package/dist/assets/vue-composition-api.js +0 -2
  115. package/dist/assets/vue.762edd.js +0 -9
  116. package/lib/vue-composition-api.js +0 -2
@@ -0,0 +1,95 @@
1
+ import AbstractFeatureInfoView from './abstractFeatureInfoView.js';
2
+
3
+ /**
4
+ * @description An iframe component
5
+ * @vue-prop {string} src - Specifies the address of the document to embed in the <iframe>
6
+ * @vue-prop {string} [title] - optional title for the <iframe>
7
+ */
8
+ const IframeComponent = {
9
+ name: 'IframeComponent',
10
+ props: {
11
+ src: {
12
+ type: String,
13
+ required: true,
14
+ },
15
+ title: {
16
+ type: String,
17
+ default: undefined,
18
+ },
19
+ },
20
+ template: '<iframe :src="src" :title="title" />',
21
+ };
22
+
23
+ /**
24
+ * @typedef {FeatureInfoViewOptions} IframeFeatureInfoViewOptions
25
+ * @property {string} src - Specifies the address of the document to embed in the <iframe>. Variables wrapped in `${}` are replaced by their values, e.g. `${featureId}` or `${attributes.gml:name}`
26
+ * @property {string} [title] - optional title for the <iframe>
27
+ */
28
+
29
+ /**
30
+ * @typedef {FeatureInfoProps} IframeFeatureInfoViewProps
31
+ * @property {string} src
32
+ * @property {string|undefined} title
33
+ */
34
+
35
+ /**
36
+ * @class
37
+ * @description An iframe view.
38
+ * @extends {AbstractFeatureInfoView}
39
+ */
40
+ class IframeFeatureInfoView extends AbstractFeatureInfoView {
41
+ /**
42
+ * @type {string}
43
+ */
44
+ static get className() { return 'IframeFeatureInfoView'; }
45
+
46
+ /**
47
+ * @param {IframeFeatureInfoViewOptions} options
48
+ */
49
+ constructor(options) {
50
+ super(options, IframeComponent);
51
+
52
+ /**
53
+ * @type {string}
54
+ */
55
+ this.src = options.src;
56
+ /**
57
+ * @type {string|undefined}
58
+ */
59
+ this.title = options.title || undefined;
60
+ }
61
+
62
+ /**
63
+ * Variables wrapped in `${}` within `src` are replaced by their values, e.g. `${featureId}` or `${attributes.gml:name}`
64
+ * @param {FeatureInfoEvent} featureInfo
65
+ * @param {import("@vcmap/core").Layer} layer
66
+ * @returns {IframeFeatureInfoViewProps}
67
+ */
68
+ getProperties(featureInfo, layer) {
69
+ const properties = super.getProperties(featureInfo, layer);
70
+ return {
71
+ ...properties,
72
+ src: this.src.replace(/\$\{(.*?)}/g, (match, token) => {
73
+ const variable = token.split('.');
74
+ return variable.reduce((obj, prop) => obj?.[prop], properties);
75
+ }),
76
+ title: this.title,
77
+ };
78
+ }
79
+
80
+ /**
81
+ * @returns {IframeFeatureInfoViewOptions}
82
+ */
83
+ toJSON() {
84
+ const config = super.toJSON();
85
+ if (this.src) {
86
+ config.src = this.src;
87
+ }
88
+ if (this.title) {
89
+ config.title = this.title;
90
+ }
91
+ return config;
92
+ }
93
+ }
94
+
95
+ export default IframeFeatureInfoView;
@@ -0,0 +1,106 @@
1
+ import AbstractFeatureInfoView from './abstractFeatureInfoView.js';
2
+ import VcsTable from '../components/tables/VcsTable.vue';
3
+
4
+ /**
5
+ * @typedef {FeatureInfoViewOptions} TableFeatureInfoViewOptions
6
+ * @property {number} [itemsPerPage=10] - default has to be one of itemsPerPageArray
7
+ * @property {number[]} [itemsPerPageArray=[5, 10, 15]]
8
+ * @property {boolean} [showSearchbar]
9
+ * @property {string} [searchbarPlaceholder]
10
+ */
11
+
12
+ /**
13
+ * @typedef {FeatureInfoProps} TableFeatureInfoViewProps
14
+ * @property {number} [itemsPerPage=10]
15
+ * @property {number[]} [itemsPerPageArray=[5, 10, 15]]
16
+ * @property {boolean} [showGroupBtn]
17
+ * @property {boolean} [showSearchbar]
18
+ * @property {string} [searchbarPlaceholder]
19
+ */
20
+
21
+ /**
22
+ * @class
23
+ * @description A table view for feature attributes
24
+ * @extends {AbstractFeatureInfoView}
25
+ */
26
+ class TableFeatureInfoView extends AbstractFeatureInfoView {
27
+ /**
28
+ * @type {string}
29
+ */
30
+ static get className() { return 'TableFeatureInfoView'; }
31
+
32
+ /** @returns {TableFeatureInfoViewOptions} */
33
+ static getDefaultOptions() {
34
+ return {
35
+ itemsPerPageArray: [5, 10, 15],
36
+ itemsPerPage: 10,
37
+ showSearchbar: true,
38
+ };
39
+ }
40
+
41
+ /**
42
+ * @param {TableFeatureInfoViewOptions} options
43
+ */
44
+ constructor(options) {
45
+ super(options, VcsTable);
46
+ const defaultOptions = TableFeatureInfoView.getDefaultOptions();
47
+ /**
48
+ * @type {number[]}
49
+ */
50
+ this.itemsPerPageArray = options.itemsPerPageArray || defaultOptions.itemsPerPageArray;
51
+
52
+ const itemsPerPage = options.itemsPerPage || defaultOptions.itemsPerPage;
53
+ /**
54
+ * @type {number}
55
+ */
56
+ this.itemsPerPage = this.itemsPerPageArray.includes(itemsPerPage) ? itemsPerPage : this.itemsPerPageArray[0];
57
+ /**
58
+ * @type {boolean}
59
+ */
60
+ this.showSearchbar = options.showSearchbar || defaultOptions.showSearchbar;
61
+ /**
62
+ * @type {string}
63
+ */
64
+ this.searchbarPlaceholder = options.searchbarPlaceholder;
65
+ }
66
+
67
+ /**
68
+ * @param {FeatureInfoEvent} featureInfo
69
+ * @param {import("@vcmap/core").Layer} layer
70
+ * @returns {TableFeatureInfoViewProps}
71
+ */
72
+ getProperties(featureInfo, layer) {
73
+ const properties = super.getProperties(featureInfo, layer);
74
+ return {
75
+ ...properties,
76
+ itemsPerPage: this.itemsPerPage,
77
+ itemsPerPageArray: this.itemsPerPageArray,
78
+ showSearchbar: this.showSearchbar,
79
+ searchbarPlaceholder: this.searchbarPlaceholder,
80
+ };
81
+ }
82
+
83
+ /**
84
+ * @returns {TableFeatureInfoViewOptions}
85
+ */
86
+ toJSON() {
87
+ const config = super.toJSON();
88
+ const defaultOptions = TableFeatureInfoView.getDefaultOptions();
89
+ if (this.itemsPerPageArray.length !== defaultOptions.itemsPerPageArray.length ||
90
+ this.itemsPerPageArray.some((e, idx) => e !== defaultOptions.itemsPerPageArray[idx])) {
91
+ config.itemsPerPageArray = this.itemsPerPageArray;
92
+ }
93
+ if (this.itemsPerPage !== defaultOptions.itemsPerPage) {
94
+ config.itemsPerPage = this.itemsPerPage;
95
+ }
96
+ if (this.showSearchbar !== defaultOptions.showSearchbar) {
97
+ config.showSearchbar = this.showSearchbar;
98
+ }
99
+ if (this.searchbarPlaceholder) {
100
+ config.searchbarPlaceholder = this.searchbarPlaceholder;
101
+ }
102
+ return config;
103
+ }
104
+ }
105
+
106
+ export default TableFeatureInfoView;
package/src/i18n/de.js CHANGED
@@ -41,12 +41,28 @@ const messages = {
41
41
  pitchTooltip: 'Kamera pitch: {0}°',
42
42
  overviewMapTooltip: 'Übersichtskarte',
43
43
  },
44
+ components: {
45
+ title: 'Komponenten',
46
+ tooltip: 'Komponenten',
47
+ vcsTable: {
48
+ key: 'Name',
49
+ value: 'Wert',
50
+ searchbarPlaceholder: 'Name, Wert, ...',
51
+ itemsPerPage: 'pro Seite',
52
+ nextPage: 'Nächste Seite',
53
+ formerPage: 'Vorherige Seite',
54
+ },
55
+ },
44
56
  settings: {
45
57
  title: 'Einstellungen',
46
58
  tooltip: 'Einstellungen',
47
59
  languageTitle: 'Spracheinstellungen',
48
60
  languageSelector: 'Sprache',
49
61
  },
62
+ featureInfo: {
63
+ activateToolTitle: 'Informationstool aktivieren',
64
+ deactivateToolTitle: 'Informationstool deaktivieren',
65
+ },
50
66
  footer: {
51
67
  title: 'Fußzeile',
52
68
  },
package/src/i18n/en.js CHANGED
@@ -41,12 +41,28 @@ const messages = {
41
41
  pitchTooltip: 'Camera pitch: {0}°',
42
42
  overviewMapTooltip: 'Overview Map',
43
43
  },
44
+ components: {
45
+ title: 'Components',
46
+ tooltip: 'Components',
47
+ vcsTable: {
48
+ key: 'Name',
49
+ value: 'Value',
50
+ searchbarPlaceholder: 'Name, Value, ...',
51
+ itemsPerPage: 'per page',
52
+ nextPage: 'Next page',
53
+ formerPage: 'Former page',
54
+ },
55
+ },
44
56
  settings: {
45
57
  title: 'Settings',
46
58
  tooltip: 'Settings',
47
59
  languageTitle: 'Language settings',
48
60
  languageSelector: 'Language',
49
61
  },
62
+ featureInfo: {
63
+ activateToolTitle: 'Activate Infotool',
64
+ deactivateToolTitle: 'Deactivate Infotool',
65
+ },
50
66
  footer: {
51
67
  title: 'Footer',
52
68
  },
@@ -109,15 +109,32 @@ class I18nCollection extends IndexedCollection {
109
109
  }
110
110
 
111
111
  /**
112
+ * This method adds plugin messages to the collection. It is no necessary to call this function
113
+ * from within a plugin. Use the i18n property on your plugin.
112
114
  * @param {string} plugin Name of the plugin
113
115
  * @param {string} contextId
114
116
  * @param {Object} messages
115
117
  */
116
118
  addPluginMessages(plugin, contextId, messages) {
117
119
  messages[i18nPluginSymbol] = plugin;
120
+ messages[contextIdSymbol] = contextId;
118
121
  this.add(messages);
119
122
  }
120
123
 
124
+ /**
125
+ * This method removes plugin messages from the collection. It is no necessary to call this function
126
+ * from within a plugin. Once your plugin is removed, the VcsUiApp will call this for you.
127
+ * @param {string} pluginName
128
+ * @param {string} contextId
129
+ */
130
+ removePluginMessages(pluginName, contextId) {
131
+ [...this]
132
+ .filter(item => item[i18nPluginSymbol] === pluginName && item[contextIdSymbol] === contextId)
133
+ .forEach((item) => {
134
+ this.remove(item);
135
+ });
136
+ }
137
+
121
138
  /**
122
139
  * returns a merged Message Object with the locale as a key and an Object with all the translated keys
123
140
  * @returns {Object}
@@ -1,5 +1,4 @@
1
- /* eslint-disable import/prefer-default-export */
2
- import { reactive } from '@vue/composition-api';
1
+ import { reactive } from 'vue';
3
2
  import { VcsEvent } from '@vcmap/core';
4
3
  import { v4 as uuidv4 } from 'uuid';
5
4
  import { check, checkMaybe } from '@vcsuite/check';
@@ -23,7 +22,7 @@ import { vcsAppSymbol } from '../pluginHelper.js';
23
22
  * @description Manages a set of Map Buttons
24
23
  * @implements VcsComponentManager<ButtonComponent,ButtonComponentOptions>
25
24
  */
26
- export class ButtonManager {
25
+ class ButtonManager {
27
26
  constructor() {
28
27
  /**
29
28
  * @type {import("@vcmap/core").VcsEvent<ButtonComponent>}
@@ -37,8 +36,7 @@ export class ButtonManager {
37
36
  * reactive ordered array of ids,
38
37
  * @type {Array<string>}
39
38
  */
40
- this.componentIds = reactive([]);
41
-
39
+ this.componentIds = [];
42
40
  /**
43
41
  * @type {Map<string, ButtonComponent>}
44
42
  * @private
@@ -154,3 +152,5 @@ export class ButtonManager {
154
152
  this._buttonComponents.clear();
155
153
  }
156
154
  }
155
+
156
+ export default ButtonManager;
@@ -0,0 +1,30 @@
1
+ <template>
2
+ <div>
3
+ <VcsTreeview
4
+ v-if="tree && tree.length"
5
+ :items="tree"
6
+ :has-searchbar="true"
7
+ />
8
+ </div>
9
+ </template>
10
+
11
+ <script>
12
+ import { inject } from 'vue';
13
+ import VcsTreeview from '../../components/lists/VcsTreeview.vue';
14
+
15
+ /**
16
+ * @description
17
+ * uses a VcsTreeview and shows 'a components Window' based on the "categoryManager"
18
+ * Uses the provided 'vcsApp'
19
+ */
20
+ export default {
21
+ name: 'VcsComponentsManager',
22
+ components: { VcsTreeview },
23
+ setup() {
24
+ const app = inject('vcsApp');
25
+ return {
26
+ tree: app.categoryManager.items,
27
+ };
28
+ },
29
+ };
30
+ </script>