@vcmap/ui 5.0.0-rc.28 → 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 (65) hide show
  1. package/config/base.config.json +22 -0
  2. package/config/dev.config.json +4 -0
  3. package/dist/assets/cesium/Workers/cesiumWorkerBootstrapper.js +1 -1
  4. package/dist/assets/cesium/Workers/package.js +1 -1
  5. package/dist/assets/cesium/Workers/transferTypedArrayTest.js +1 -1
  6. package/dist/assets/{cesium.973919.js → cesium.eaf7cc.js} +149552 -149560
  7. package/dist/assets/cesium.js +1 -1
  8. package/dist/assets/{core.7a2173.js → core.b16511.js} +4077 -3965
  9. package/dist/assets/core.js +1 -1
  10. package/dist/assets/index-c115e3a1.js +1 -0
  11. package/dist/assets/{ol.f6e2e4.js → ol.4bbf0f.js} +11405 -11126
  12. package/dist/assets/ol.js +1 -1
  13. package/dist/assets/{ui.bd7a9a.css → ui.ab815e.css} +2 -2
  14. package/dist/assets/{ui.bd7a9a.js → ui.ab815e.js} +4232 -3512
  15. package/dist/assets/ui.js +1 -1
  16. package/dist/assets/vue.js +2 -2
  17. package/dist/assets/{vuetify.95f6c3.js → vuetify.ea3fa8.js} +1 -1
  18. package/dist/assets/vuetify.js +2 -2
  19. package/dist/index.html +1 -1
  20. package/index.js +7 -0
  21. package/lib/olLib.js +6 -0
  22. package/package.json +3 -3
  23. package/plugins/@vcmap/search-nominatim/SearchNominatimEditor.vue +90 -0
  24. package/plugins/@vcmap/search-nominatim/index.js +37 -0
  25. package/plugins/@vcmap-show-case/form-inputs-example/FormInputsExample.vue +37 -1
  26. package/plugins/@vcmap-show-case/form-inputs-example/index.js +3 -0
  27. package/plugins/@vcmap-show-case/form-inputs-example/validation.js +11 -0
  28. package/plugins/@vcmap-show-case/style-input-example/styleExample.vue +0 -1
  29. package/plugins/@vcmap-show-case/vector-properties-example/index.js +40 -0
  30. package/plugins/@vcmap-show-case/vector-properties-example/package.json +5 -0
  31. package/plugins/@vcmap-show-case/vector-properties-example/vectorPropertiesExample.vue +109 -0
  32. package/plugins/@vcmap-show-case/window-tester/WindowExample.vue +27 -9
  33. package/plugins/@vcmap-show-case/window-tester/index.js +13 -1
  34. package/plugins/@vcmap-show-case/window-tester/windowExampleToggleChild.vue +11 -10
  35. package/src/actions/actionHelper.js +7 -3
  36. package/src/application/VcsApp.vue +31 -0
  37. package/src/components/form-inputs-controls/VcsChipArrayInput.vue +282 -0
  38. package/src/components/form-inputs-controls/VcsTextField.vue +12 -5
  39. package/src/components/icons/+all.js +3 -3
  40. package/src/components/lists/VcsTreeviewLeaf.vue +1 -1
  41. package/src/components/lists/VcsTreeviewSearchbar.vue +9 -4
  42. package/src/components/plugins/AbstractConfigEditor.vue +84 -0
  43. package/src/components/style/VcsImageSelector.vue +6 -5
  44. package/src/components/style/VcsTextSelector.vue +1 -1
  45. package/src/components/tables/VcsDataTable.vue +100 -13
  46. package/src/components/vector-properties/VcsVectorPropertiesComponent.vue +737 -0
  47. package/src/components/vector-properties/composables.js +93 -0
  48. package/src/contentTree/contentTreeCollection.js +3 -0
  49. package/src/featureInfo/abstractFeatureInfoView.js +3 -1
  50. package/src/featureInfo/balloonFeatureInfoView.js +3 -2
  51. package/src/featureInfo/featureInfo.js +1 -0
  52. package/src/i18n/de.js +44 -9
  53. package/src/i18n/en.js +42 -7
  54. package/src/manager/collectionManager/collectionComponent.js +1 -1
  55. package/src/manager/window/WindowComponent.vue +4 -1
  56. package/src/manager/window/WindowComponentHeader.vue +25 -13
  57. package/src/manager/window/windowManager.js +6 -2
  58. package/src/navigation/overviewMap.js +1 -1
  59. package/src/pluginHelper.js +57 -17
  60. package/src/uiConfig.js +1 -0
  61. package/src/vcsUiApp.js +45 -34
  62. package/dist/assets/index-1b09f88d.js +0 -1
  63. /package/dist/assets/{vue.d4be99.js → vue.67e80f.js} +0 -0
  64. /package/dist/assets/{vuetify.95f6c3.css → vuetify.ea3fa8.css} +0 -0
  65. /package/src/components/icons/{PolygonIcon.vue → PointIcon.vue} +0 -0
@@ -4,7 +4,18 @@
4
4
  v-if="showSearchbar"
5
5
  :placeholder="$t(searchbarPlaceholder)"
6
6
  v-model="search"
7
- />
7
+ @input="handleSearch"
8
+ >
9
+ <template #prepend="scope">
10
+ <slot name="prepend" v-bind="scope" />
11
+ </template>
12
+ <template #default="scope">
13
+ <slot v-bind="scope" />
14
+ </template>
15
+ <template #append="scope">
16
+ <slot name="append" v-bind="scope" />
17
+ </template>
18
+ </VcsTreeviewSearchbar>
8
19
  <v-data-table
9
20
  dense
10
21
  :headers="translatedHeaders"
@@ -22,14 +33,20 @@
22
33
  $t('components.vcsDataTable.noResultsPlaceholder')
23
34
  "
24
35
  :single-select="singleSelect"
36
+ :server-items-length="serverItemsLength"
25
37
  hide-default-footer
26
38
  v-bind="$attrs"
27
39
  v-on="$listeners"
28
40
  class="vcs-table rounded-0"
41
+ @update:options="(o) => $emit('update:items', { ...o, search })"
29
42
  >
30
43
  <!-- eslint-disable-next-line -->
31
44
  <template v-for="(_, slot) of $scopedSlots" #[slot]="scope">
32
- <slot :name="slot" v-bind="scope" />
45
+ <slot
46
+ v-if="!['prepend', 'default', 'append'].includes(slot)"
47
+ :name="slot"
48
+ v-bind="scope"
49
+ />
33
50
  </template>
34
51
  <!-- eslint-disable-next-line -->
35
52
  <template v-slot:header.data-table-select="{ props, on }">
@@ -54,10 +71,11 @@
54
71
  </div>
55
72
  </template>
56
73
  <!-- eslint-disable-next-line -->
57
- <template v-slot:item.data-table-select="{ isSelected, select, index }">
74
+ <template #item.data-table-select="{ isSelected, select, item, index }">
58
75
  <div @mouseover="hovering = index" @mouseout="hovering = null">
59
76
  <v-icon
60
77
  v-if="isSelected"
78
+ :disabled="item.disabled"
61
79
  @click="select(!isSelected)"
62
80
  class="vcs-select-icon"
63
81
  >
@@ -67,17 +85,23 @@
67
85
  v-else-if="
68
86
  hovering === index || (!singleSelect && value.length > 0)
69
87
  "
88
+ :disabled="item.disabled"
70
89
  @click="select(!isSelected)"
71
90
  class="vcs-select-icon"
72
91
  >
73
92
  mdi-circle-outline
74
93
  </v-icon>
75
- <v-icon v-else @click="select(!isSelected)" class="vcs-select-icon">
94
+ <v-icon
95
+ v-else
96
+ :disabled="item.disabled"
97
+ @click="select(!isSelected)"
98
+ class="vcs-select-icon"
99
+ >
76
100
  mdi-circle-small
77
101
  </v-icon>
78
102
  </div>
79
103
  </template>
80
- <template #footer v-if="items.length > itemsPerPageRef">
104
+ <template #footer v-if="showFooter">
81
105
  <v-divider />
82
106
  <v-container class="pa-2 vcs-pagination-bar">
83
107
  <v-row dense no-gutters justify="center" class="align-center">
@@ -143,14 +167,31 @@
143
167
  import VcsTreeviewSearchbar from '../lists/VcsTreeviewSearchbar.vue';
144
168
  import VcsButton from '../buttons/VcsButton.vue';
145
169
 
170
+ /**
171
+ * @typedef {Object} UpdateItemsEvent
172
+ * @property {number} page
173
+ * @property {number} itemsPerPage
174
+ * @property {string[]} sortBy
175
+ * @property {boolean[]} sortDesc
176
+ * @property {string[]} groupBy
177
+ * @property {boolean[]} groupDesc
178
+ * @property {boolean} multiSort
179
+ * @property {boolean} mustSort
180
+ * @property {string} search
181
+ */
182
+
146
183
  /**
147
184
  * @description A wrapper around {@link https://vuetifyjs.com/en/api/v-data-table/#props v-data-table } with custom pagination
185
+ * Passes all slots to v-data-table and 'prepend', 'default' and 'append' slots to VcsSearchbar
148
186
  * @vue-prop {Array<Object>} items - array of items, where each item must provide a unique key
149
187
  * @vue-prop {string} itemKey - the key property, which is unique on all items.
188
+ * @vue-prop {number} serverItemsLength - number of total items on a backend. Used for server-side pagination.
189
+ * @vue-prop {number} serverPagesLength - number of total pages on a backend. Used for server-side pagination.
150
190
  * @vue-prop {Array<{text: string, value: string}>} [headers] - optional array defining column names. Text will be translated
151
191
  * @vue-prop {boolean} [showSearchbar=true] - whether to show searchbar
152
192
  * @vue-prop {string} [searchbarPlaceholder] - placeholder for searchbar
153
193
  * @vue-prop {boolean} [singleSelect=false]
194
+ * @vue-event {UpdateItemsEvent} update:items - Emits when one of the options properties is updated or on search input. Can be used to update items via API call to a server.
154
195
  * @vue-computed {Array<TableItem>} filteredItems - array of items with search filter applied on. If search string is empty, same as items array.
155
196
  * @vue-computed {Array<import("vuetify").DataTableHeader>} translatedHeaders - array of translated header items.
156
197
  * @vue-computed {number} numberOfItems - number of filtered items (depending on search).
@@ -187,6 +228,14 @@
187
228
  type: String,
188
229
  required: true,
189
230
  },
231
+ serverItemsLength: {
232
+ type: Number,
233
+ default: -1,
234
+ },
235
+ serverPagesLength: {
236
+ type: Number,
237
+ default: -1,
238
+ },
190
239
  itemsPerPage: {
191
240
  type: Number,
192
241
  default: 10,
@@ -212,7 +261,7 @@
212
261
  default: () => [],
213
262
  },
214
263
  },
215
- setup(props) {
264
+ setup(props, { attrs, emit }) {
216
265
  const vm = getCurrentInstance().proxy;
217
266
  const hovering = ref(null);
218
267
  /**
@@ -230,12 +279,15 @@
230
279
  if (filter) {
231
280
  const q = filter.toLocaleLowerCase();
232
281
  return Object.values(item).some((i) => {
233
- const content = i.toString();
234
- const translated = vm.$t(content);
235
- return (
236
- translated.toLowerCase().includes(q) ||
237
- content.toLowerCase().includes(q)
238
- );
282
+ if (i) {
283
+ const content = i.toString();
284
+ const translated = vm.$t(content);
285
+ return (
286
+ translated.toLowerCase().includes(q) ||
287
+ content.toLowerCase().includes(q)
288
+ );
289
+ }
290
+ return false;
239
291
  });
240
292
  }
241
293
  return true;
@@ -249,7 +301,12 @@
249
301
  handleFilter(item.value, search.value, item),
250
302
  ),
251
303
  );
252
- const numberOfItems = computed(() => filteredItems.value.length);
304
+ const numberOfItems = computed(() => {
305
+ if (props.serverItemsLength > -1) {
306
+ return props.serverItemsLength;
307
+ }
308
+ return filteredItems.value.length;
309
+ });
253
310
  const totalNumber = computed(() => props.items.length);
254
311
 
255
312
  /**
@@ -267,6 +324,9 @@
267
324
  */
268
325
  const itemsPerPageRef = ref(props.itemsPerPage);
269
326
  const numberOfPages = computed(() => {
327
+ if (props.serverPagesLength > -1) {
328
+ return props.serverPagesLength;
329
+ }
270
330
  return Math.ceil(numberOfItems.value / itemsPerPageRef.value);
271
331
  });
272
332
  /**
@@ -281,6 +341,31 @@
281
341
  return last < numberOfItems.value ? last : numberOfItems.value;
282
342
  });
283
343
 
344
+ const handleSearch = () => {
345
+ page.value = 1;
346
+ const { sortBy, sortDesc, groupBy, groupDesc, multiSort, mustSort } =
347
+ attrs;
348
+ // attrs of v-data-table cannot be accessed outside this component but are necessary for server-side pagination and search
349
+ // hence all relevant variables are emitted
350
+ emit('update:items', {
351
+ page: page.value,
352
+ itemsPerPage: itemsPerPageRef.value,
353
+ sortBy,
354
+ sortDesc,
355
+ groupBy,
356
+ groupDesc,
357
+ multiSort,
358
+ mustSort,
359
+ search: search.value,
360
+ });
361
+ };
362
+
363
+ const showFooter = computed(
364
+ () =>
365
+ props.items.length > itemsPerPageRef.value ||
366
+ props.serverItemsLength > itemsPerPageRef.value,
367
+ );
368
+
284
369
  return {
285
370
  hovering,
286
371
  search,
@@ -306,7 +391,9 @@
306
391
  itemsPerPageRef.value = number;
307
392
  },
308
393
  handleFilter,
394
+ handleSearch,
309
395
  translatedHeaders,
396
+ showFooter,
310
397
  };
311
398
  },
312
399
  };