@vcmap/ui 5.0.0-rc.29 → 5.0.0-rc.30

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 (41) hide show
  1. package/config/dev.config.json +4 -0
  2. package/dist/assets/cesium.js +1 -1
  3. package/dist/assets/{core.74da2a.js → core.b16511.js} +2 -2
  4. package/dist/assets/core.js +1 -1
  5. package/dist/assets/index-c115e3a1.js +1 -0
  6. package/dist/assets/ol.js +1 -1
  7. package/dist/assets/{ui.d3054c.css → ui.ab815e.css} +2 -2
  8. package/dist/assets/{ui.d3054c.js → ui.ab815e.js} +4081 -3460
  9. package/dist/assets/ui.js +1 -1
  10. package/dist/assets/vue.js +2 -2
  11. package/dist/assets/{vuetify.946bd8.js → vuetify.ea3fa8.js} +1 -1
  12. package/dist/assets/vuetify.js +2 -2
  13. package/dist/index.html +1 -1
  14. package/index.js +6 -0
  15. package/package.json +1 -1
  16. package/plugins/@vcmap/search-nominatim/SearchNominatimEditor.vue +90 -0
  17. package/plugins/@vcmap/search-nominatim/index.js +37 -0
  18. package/plugins/@vcmap-show-case/form-inputs-example/FormInputsExample.vue +37 -1
  19. package/plugins/@vcmap-show-case/form-inputs-example/index.js +3 -0
  20. package/plugins/@vcmap-show-case/form-inputs-example/validation.js +11 -0
  21. package/plugins/@vcmap-show-case/style-input-example/styleExample.vue +0 -1
  22. package/plugins/@vcmap-show-case/vector-properties-example/index.js +40 -0
  23. package/plugins/@vcmap-show-case/vector-properties-example/package.json +5 -0
  24. package/plugins/@vcmap-show-case/vector-properties-example/vectorPropertiesExample.vue +109 -0
  25. package/src/components/form-inputs-controls/VcsChipArrayInput.vue +282 -0
  26. package/src/components/form-inputs-controls/VcsTextField.vue +9 -3
  27. package/src/components/plugins/AbstractConfigEditor.vue +84 -0
  28. package/src/components/style/VcsImageSelector.vue +6 -5
  29. package/src/components/style/VcsTextSelector.vue +1 -1
  30. package/src/components/vector-properties/VcsVectorPropertiesComponent.vue +737 -0
  31. package/src/components/vector-properties/composables.js +93 -0
  32. package/src/i18n/de.js +40 -9
  33. package/src/i18n/en.js +38 -7
  34. package/src/manager/collectionManager/collectionComponent.js +1 -1
  35. package/src/pluginHelper.js +57 -17
  36. package/src/vcsUiApp.js +17 -27
  37. package/dist/assets/index-cb070eff.js +0 -1
  38. /package/dist/assets/{cesium.16590b.js → cesium.eaf7cc.js} +0 -0
  39. /package/dist/assets/{ol.50a512.js → ol.4bbf0f.js} +0 -0
  40. /package/dist/assets/{vue.30740e.js → vue.67e80f.js} +0 -0
  41. /package/dist/assets/{vuetify.946bd8.css → vuetify.ea3fa8.css} +0 -0
package/dist/assets/ui.js CHANGED
@@ -1 +1 @@
1
- export * from "./ui.d3054c.js";
1
+ export * from "./ui.ab815e.js";
@@ -1,5 +1,5 @@
1
- export * from "./vue.30740e.js";
2
- import { default as f } from "./vue.30740e.js";
1
+ export * from "./vue.67e80f.js";
2
+ import { default as f } from "./vue.67e80f.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.946bd8.css');import v from "./vue.30740e.js";
16
+ } await loadCss('./assets/vuetify.ea3fa8.css');import v from "./vue.67e80f.js";
17
17
  const Ne = v.extend().extend({
18
18
  name: "themeable",
19
19
  provide() {
@@ -1,5 +1,5 @@
1
- export * from "./vuetify.946bd8.js";
2
- import { default as f } from "./vuetify.946bd8.js";
1
+ export * from "./vuetify.ea3fa8.js";
2
+ import { default as f } from "./vuetify.ea3fa8.js";
3
3
  export {
4
4
  f as default
5
5
  };
package/dist/index.html CHANGED
@@ -29,7 +29,7 @@
29
29
  />
30
30
  <link rel="icon" type="image/svg+xml" href="./assets/favicon.d5ec97.svg" />
31
31
 
32
- <script type="module" crossorigin src="./assets/index-cb070eff.js"></script>
32
+ <script type="module" crossorigin src="./assets/index-c115e3a1.js"></script>
33
33
  </head>
34
34
  <body style="height: 100vh">
35
35
  <noscript>
package/index.js CHANGED
@@ -162,6 +162,7 @@ export {
162
162
  vcsAppSymbol,
163
163
  pluginFactorySymbol,
164
164
  pluginBaseUrlSymbol,
165
+ pluginModuleUrlSymbol,
165
166
  getPluginAssetUrl,
166
167
  isValidPackageName,
167
168
  loadPlugin,
@@ -204,6 +205,7 @@ export { default as VcsFormSection } from './src/components/form-inputs-controls
204
205
  export { default as VcsSelect } from './src/components/form-inputs-controls/VcsSelect.vue';
205
206
  export { default as VcsSlider } from './src/components/form-inputs-controls/VcsSlider.vue';
206
207
  export { default as VcsTextField } from './src/components/form-inputs-controls/VcsTextField.vue';
208
+ export { default as VcsChipArrayInput } from './src/components/form-inputs-controls/VcsChipArrayInput.vue';
207
209
  export { default as VcsTextArea } from './src/components/form-inputs-controls/VcsTextArea.vue';
208
210
  export { default as VcsWizard } from './src/components/form-inputs-controls/VcsWizard.vue';
209
211
  export { default as VcsWizardStep } from './src/components/form-inputs-controls/VcsWizardStep.vue';
@@ -245,5 +247,9 @@ export {
245
247
  VectorStyleMenus,
246
248
  } from './src/components/style/VcsVectorStyleComponent.vue';
247
249
 
250
+ export { default as VcsVectorPropertiesComponent } from './src/components/vector-properties/VcsVectorPropertiesComponent.vue';
251
+
248
252
  // export { default as VcsFileNamePopover } from './src/components/popovers/VcsFileNamePopover.vue';
249
253
  // export { default as VcsTexturePopover } from './src/components/popovers/VcsTexturePopover.vue';
254
+
255
+ export { default as AbstractConfigEditor } from './src/components/plugins/AbstractConfigEditor.vue';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vcmap/ui",
3
- "version": "5.0.0-rc.29",
3
+ "version": "5.0.0-rc.30",
4
4
  "author": "Virtual City Systems",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -0,0 +1,90 @@
1
+ <template>
2
+ <AbstractConfigEditor @submit="apply" v-bind="{ ...$attrs, ...$props }">
3
+ <v-container class="py-0 px-1">
4
+ <v-row
5
+ no-gutters
6
+ v-for="key in ['url', 'state', 'city', 'countryCode']"
7
+ :key="key"
8
+ >
9
+ <v-col>
10
+ <VcsLabel :html-for="key" dense>
11
+ {{ $t(`searchNominatim.${key}`) }}
12
+ </VcsLabel>
13
+ </v-col>
14
+ <v-col>
15
+ <VcsTextField
16
+ :id="key"
17
+ clearable
18
+ dense
19
+ v-model.trim="localConfig[key]"
20
+ />
21
+ </v-col>
22
+ </v-row>
23
+ <!-- XXX extent -->
24
+ <v-row no-gutters>
25
+ <v-col>
26
+ <VcsLabel html-for="limit" dense>
27
+ {{ $t('searchNominatim.limit') }}
28
+ </VcsLabel>
29
+ </v-col>
30
+ <v-col>
31
+ <VcsTextField
32
+ id="limit"
33
+ clearable
34
+ dense
35
+ type="number"
36
+ v-model.number="localConfig.limit"
37
+ />
38
+ </v-col>
39
+ </v-row>
40
+ </v-container>
41
+ </AbstractConfigEditor>
42
+ </template>
43
+
44
+ <script>
45
+ import { VContainer, VRow, VCol } from 'vuetify/lib';
46
+ import { VcsLabel, VcsTextField, AbstractConfigEditor } from '@vcmap/ui';
47
+ import { ref } from 'vue';
48
+ import Nominatim from './nominatim.js';
49
+
50
+ export default {
51
+ name: 'SearchNominatimEditor',
52
+ title: 'Search Nominatim Editor',
53
+ components: {
54
+ VContainer,
55
+ VRow,
56
+ VCol,
57
+ AbstractConfigEditor,
58
+ VcsLabel,
59
+ VcsTextField,
60
+ },
61
+ props: {
62
+ getConfig: {
63
+ type: Function,
64
+ required: true,
65
+ },
66
+ setConfig: {
67
+ type: Function,
68
+ required: true,
69
+ },
70
+ },
71
+ setup(props) {
72
+ const localConfig = ref({});
73
+ const defaultOptions = Nominatim.getDefaultOptions();
74
+ props.getConfig().then((config) => {
75
+ localConfig.value = Object.assign(defaultOptions, config);
76
+ });
77
+
78
+ const apply = async () => {
79
+ await props.setConfig(localConfig.value);
80
+ };
81
+
82
+ return {
83
+ localConfig,
84
+ apply,
85
+ };
86
+ },
87
+ };
88
+ </script>
89
+
90
+ <style scoped></style>
@@ -1,5 +1,6 @@
1
1
  import { version, name } from './package.json';
2
2
  import Nominatim from './nominatim.js';
3
+ import SearchNominatimEditor from './SearchNominatimEditor.vue';
3
4
 
4
5
  /**
5
6
  * @param {NominatimSearchOptions} config - the configuration of this plugin instance, passed in from the app.
@@ -25,5 +26,41 @@ export default function searchNominatim(config) {
25
26
  this._app = vcsUiApp;
26
27
  vcsUiApp.search.add(this._instance, name);
27
28
  },
29
+ /**
30
+ * @returns {NominatimSearchOptions}
31
+ */
32
+ toJSON() {
33
+ return this._instance.toJSON();
34
+ },
35
+ getDefaultOptions() {
36
+ return Nominatim.getDefaultOptions();
37
+ },
38
+ getConfigEditors() {
39
+ return [{ component: SearchNominatimEditor }];
40
+ },
41
+ i18n: {
42
+ de: {
43
+ searchNominatim: {
44
+ name: 'Name',
45
+ url: 'URL zu Nominatim',
46
+ state: 'Bundesland',
47
+ city: 'Stadt',
48
+ countryCode: 'Ländercode',
49
+ limit: 'Maximale Anzahl Resultate',
50
+ bbox: 'Bounding Box',
51
+ },
52
+ },
53
+ en: {
54
+ searchNominatim: {
55
+ name: 'Name',
56
+ url: 'URL to Nominatim',
57
+ state: 'State',
58
+ city: 'City',
59
+ countryCode: 'Country Code',
60
+ limit: 'Maximum number of results',
61
+ bbox: 'Bounding Box',
62
+ },
63
+ },
64
+ },
28
65
  };
29
66
  }
@@ -54,6 +54,34 @@
54
54
  />
55
55
  </v-col>
56
56
  </v-row>
57
+ <v-row no-gutters>
58
+ <v-col class="w-max-half">
59
+ <VcsLabel html-for="arrayInput" :dense="dense">
60
+ Array Input
61
+ </VcsLabel>
62
+ </v-col>
63
+ </v-row>
64
+ <v-row no-gutters>
65
+ <v-col>
66
+ <VcsChipArrayInput
67
+ id="arrayInput"
68
+ type="number"
69
+ :dense="dense"
70
+ v-model="state.arrayInput"
71
+ :rules="[arrayTest]"
72
+ />
73
+ </v-col>
74
+ </v-row>
75
+ <v-row no-gutters>
76
+ <v-col>
77
+ <VcsChipArrayInput
78
+ id="arrayInput"
79
+ :dense="dense"
80
+ v-model="state.arrayInputString"
81
+ column
82
+ />
83
+ </v-col>
84
+ </v-row>
57
85
  <v-row no-gutters>
58
86
  <v-col>
59
87
  <VcsTextField
@@ -394,6 +422,7 @@
394
422
  VcsRadio,
395
423
  VcsFormButton,
396
424
  VcsTextField,
425
+ VcsChipArrayInput,
397
426
  VcsFormattedNumber,
398
427
  VcsFormSection,
399
428
  VcsLabel,
@@ -404,7 +433,12 @@
404
433
  } from '@vcmap/ui';
405
434
  import { VCol, VContainer, VForm, VRow, VIcon } from 'vuetify/lib';
406
435
  import packageJSON from './package.json';
407
- import { isValidText, conditionalTest, isValidEmail } from './validation.js';
436
+ import {
437
+ isValidText,
438
+ conditionalTest,
439
+ arrayTest,
440
+ isValidEmail,
441
+ } from './validation.js';
408
442
 
409
443
  export default {
410
444
  name: 'FormInputsExample',
@@ -418,6 +452,7 @@
418
452
  VcsFormSection,
419
453
  VcsLabel,
420
454
  VcsTextArea,
455
+ VcsChipArrayInput,
421
456
  VForm,
422
457
  VRow,
423
458
  VCol,
@@ -455,6 +490,7 @@
455
490
  isValid: ref(true),
456
491
  isValidText,
457
492
  conditionalTest,
493
+ arrayTest,
458
494
  isValidEmail,
459
495
  newUpdate,
460
496
  resetState() {
@@ -26,6 +26,7 @@ function getLogger() {
26
26
  * @typedef FormInputsExampleState
27
27
  * @property {string} selected
28
28
  * @property {Array<string>} selectedMultiple
29
+ * @property {Array<number>} arrayInput
29
30
  * @property {string} conditionalInput
30
31
  * @property {string} initialTextInput
31
32
  * @property {number} numberInput
@@ -83,6 +84,8 @@ export default function formInputsExample(config) {
83
84
  const pluginState = {
84
85
  selected: pluginConfig.selectOptions.value[0],
85
86
  selectedMultiple: [],
87
+ arrayInput: [1, 2, 3],
88
+ arrayInputString: ['a', 'b', 'c'],
86
89
  conditionalInput: '',
87
90
  initialTextInput: pluginConfig.initialTextInput.value,
88
91
  numberInput: 100.156,
@@ -20,6 +20,17 @@ export function conditionalTest(value, condition) {
20
20
  }
21
21
  }
22
22
 
23
+ /**
24
+ * @param {number[]} value
25
+ * @returns {boolean|string}
26
+ */
27
+ export function arrayTest(value) {
28
+ if (value > 10) {
29
+ return 'Input must be lower 10';
30
+ }
31
+ return true;
32
+ }
33
+
23
34
  /**
24
35
  * @param {string} value
25
36
  * @returns {boolean|string}
@@ -135,7 +135,6 @@
135
135
  color: parseColor(image.getStroke().getColor()),
136
136
  width: image.getStroke().getWidth(),
137
137
  },
138
- src: 'mdi-circle-outline',
139
138
  };
140
139
  } else if (image instanceof Icon) {
141
140
  styleOptions.value.image = {
@@ -0,0 +1,40 @@
1
+ import { WindowSlot, createToggleAction, ButtonLocation } from '@vcmap/ui';
2
+ import packageJSON from './package.json';
3
+ import component from './vectorPropertiesExample.vue';
4
+
5
+ export default function createVectorPropertiesExamplePlugin() {
6
+ return {
7
+ get name() {
8
+ return packageJSON.name;
9
+ },
10
+ get version() {
11
+ return packageJSON.version;
12
+ },
13
+ get vcMapVersion() {
14
+ return packageJSON.vcMapVersion;
15
+ },
16
+ initialize(vcsApp) {
17
+ const { action, destroy } = createToggleAction(
18
+ {
19
+ name: 'Vector Properties Example',
20
+ },
21
+ {
22
+ id: 'vector-properties-example',
23
+ state: {
24
+ headerTitle: 'Vector Properties Example',
25
+ },
26
+ component,
27
+ slot: WindowSlot.DYNAMIC_LEFT,
28
+ },
29
+ vcsApp.windowManager,
30
+ packageJSON.name,
31
+ );
32
+ vcsApp.navbarManager.add(
33
+ { id: 'vectorProperties', action },
34
+ packageJSON.name,
35
+ ButtonLocation.TOOL,
36
+ );
37
+ this.destroy = destroy;
38
+ },
39
+ };
40
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "@vcmap-show-case/vector-properties-example",
3
+ "version": "1.0.0",
4
+ "vcMapVersion": "~5.0.0"
5
+ }
@@ -0,0 +1,109 @@
1
+ <template>
2
+ <v-sheet>
3
+ <v-container>
4
+ <v-row>
5
+ <v-col>
6
+ <VcsList
7
+ :items="propertiesToSelectFrom"
8
+ :selectable="true"
9
+ v-model="propertiesToDisplay"
10
+ title="Select all"
11
+ />
12
+ </v-col>
13
+ </v-row>
14
+ </v-container>
15
+ <VcsVectorPropertiesComponent
16
+ v-model="featureProperties"
17
+ :value-default="defaultOptions"
18
+ :show3-d-properties="is3D"
19
+ :properties="propertiesToDisplay.map((item) => item.name)"
20
+ />
21
+ </v-sheet>
22
+ </template>
23
+
24
+ <script>
25
+ import { inject, onMounted, onUnmounted, ref, watch } from 'vue';
26
+ import { CesiumMap, VectorLayer, VectorProperties } from '@vcmap/core';
27
+ import { VcsVectorPropertiesComponent, VcsList } from '@vcmap/ui';
28
+ import { VSheet, VContainer, VRow, VCol } from 'vuetify/lib';
29
+ import { Feature } from 'ol';
30
+ import { Polygon } from 'ol/geom.js';
31
+
32
+ export const polygonCoords = [
33
+ [
34
+ [13.37302869387225, 52.515969833848686, 34.5146781549614],
35
+ [13.374380945328324, 52.51418689937603, 33.692166432214975],
36
+ [13.376569529360477, 52.516925129014055, 34.36842554294618],
37
+ [13.37302869387225, 52.515969833848686, 34.5146781549614],
38
+ ],
39
+ ];
40
+
41
+ export default {
42
+ name: 'VectorPropertiesExample',
43
+ components: {
44
+ VcsVectorPropertiesComponent,
45
+ VcsList,
46
+ VSheet,
47
+ VContainer,
48
+ VRow,
49
+ VCol,
50
+ },
51
+ setup() {
52
+ /** @type {import('@vcmap/core').VcsApp} */
53
+ const vcsApp = inject('vcsApp');
54
+ const is3D = ref(false);
55
+
56
+ function updateIs3D() {
57
+ is3D.value = vcsApp.maps.activeMap instanceof CesiumMap;
58
+ }
59
+ const mapActivatedListener =
60
+ vcsApp.maps.mapActivated.addEventListener(updateIs3D);
61
+ updateIs3D();
62
+
63
+ const feature = new Feature({
64
+ geometry: new Polygon(polygonCoords),
65
+ });
66
+ const layer = new VectorLayer({
67
+ name: 'vectorPropertiesExampleLayer',
68
+ projection: {
69
+ epsg: 'EPSG:4326',
70
+ },
71
+ });
72
+
73
+ const featureProperties = ref(
74
+ layer.vectorProperties.getValuesForFeatures([feature]),
75
+ );
76
+ watch(featureProperties, () => {
77
+ layer.vectorProperties.setValuesForFeatures(featureProperties.value, [
78
+ feature,
79
+ ]);
80
+ });
81
+
82
+ const defaultOptions = VectorProperties.getDefaultOptions();
83
+ const propertiesToSelectFrom = Object.keys(defaultOptions).map((key) => ({
84
+ name: key,
85
+ title: key,
86
+ }));
87
+
88
+ onMounted(() => {
89
+ vcsApp.layers.add(layer);
90
+ layer.addFeatures([feature]);
91
+ layer.activate();
92
+ });
93
+
94
+ onUnmounted(() => {
95
+ layer.deactivate();
96
+ vcsApp.layers.remove(layer);
97
+ layer.destroy();
98
+ mapActivatedListener();
99
+ });
100
+ return {
101
+ featureProperties,
102
+ defaultOptions,
103
+ is3D,
104
+ propertiesToSelectFrom,
105
+ propertiesToDisplay: ref([...propertiesToSelectFrom]),
106
+ };
107
+ },
108
+ };
109
+ </script>