@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
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <v-form v-model="isValid">
2
+ <v-form v-model="isValid" ref="form">
3
3
  <VcsFormSection
4
4
  heading="VcsFormSection Select & Text Inputs"
5
5
  :header-actions="actions"
@@ -16,9 +16,8 @@
16
16
  </ol>
17
17
  </template>
18
18
  <template #default v-if="showSection">
19
- <v-container class="pa-2">
19
+ <v-container class="py-0 px-1">
20
20
  <v-row
21
- :dense="dense"
22
21
  no-gutters
23
22
  align="center"
24
23
  >
@@ -32,13 +31,13 @@
32
31
  id="selectInput"
33
32
  :items="selectOptions"
34
33
  :dense="dense"
35
- :rules="[conditionalTest(state.conditionalInput, state.selected)]"
34
+ :rules="[v => v !== 'D' || 'D is not allowed']"
36
35
  v-model="state.selected"
36
+ color="purple"
37
37
  />
38
38
  </v-col>
39
39
  </v-row>
40
40
  <v-row
41
- :dense="dense"
42
41
  no-gutters
43
42
  align="center"
44
43
  >
@@ -54,44 +53,38 @@
54
53
  :dense="dense"
55
54
  :rules="[conditionalTest(state.conditionalInput, state.selected)]"
56
55
  v-model="state.conditionalInput"
56
+ placeholder="conditional"
57
57
  />
58
58
  </v-col>
59
59
  </v-row>
60
60
  <v-row
61
- :dense="dense"
62
61
  no-gutters
63
62
  align="center"
64
63
  >
65
64
  <v-col>
66
65
  <VcsTextField
67
66
  :dense="dense"
68
- v-model="initialTextInput"
67
+ v-model="state.initialTextInput"
68
+ :rules="[isValidText]"
69
+ :loading="state.initialTextInput === 'myInitialText'"
70
+ :error-messages="!state.checkboxInput ? ['manual error message depending on checkbox'] : undefined"
69
71
  />
70
72
  </v-col>
71
73
  </v-row>
72
74
  <v-row
73
- :dense="dense"
74
75
  no-gutters
75
76
  align="center"
76
77
  >
77
78
  <v-col>
78
- <VcsLabel html-for="initialTextInput" :dense="dense">
79
- InitialTextInput
80
- </VcsLabel>
81
- </v-col>
82
- <v-col>
83
- <VcsTextField
84
- id="initialTextInput"
79
+ <VcsTextArea
85
80
  :dense="dense"
86
- :rules="[isValidText]"
87
- :loading="state.initialTextInput === 'myInitialText'"
88
- v-model="state.initialTextInput"
89
- :error-messages="!state.checkboxInput ? ['manual error message depending on checkbox'] : undefined"
81
+ :rules="[v => !!v || 'text area must not be empty']"
82
+ placeholder="This is a text area"
83
+ rows="2"
90
84
  />
91
85
  </v-col>
92
86
  </v-row>
93
87
  <v-row
94
- :dense="dense"
95
88
  no-gutters
96
89
  align="center"
97
90
  >
@@ -107,11 +100,12 @@
107
100
  type="email"
108
101
  :rules="[isValidEmail]"
109
102
  v-model="state.email"
103
+ color="blue"
104
+ placeholder="Email address"
110
105
  />
111
106
  </v-col>
112
107
  </v-row>
113
108
  <v-row
114
- :dense="dense"
115
109
  no-gutters
116
110
  align="center"
117
111
  >
@@ -126,17 +120,17 @@
126
120
  :dense="dense"
127
121
  prepend-icon="mdi-map-marker"
128
122
  v-model="state.prependedInput"
123
+ label="text"
129
124
  />
130
125
  </v-col>
131
126
  </v-row>
132
127
  <v-row
133
- :dense="dense"
134
128
  no-gutters
135
129
  align="center"
136
130
  >
137
131
  <v-col>
138
132
  <VcsLabel html-for="fileInput" :dense="dense">
139
- Email
133
+ File input
140
134
  </VcsLabel>
141
135
  </v-col>
142
136
  <v-col>
@@ -149,6 +143,19 @@
149
143
  />
150
144
  </v-col>
151
145
  </v-row>
146
+ <v-row
147
+ no-gutters
148
+ align="center"
149
+ >
150
+ <v-col>
151
+ <VcsLabel html-for="dateInput" :dense="dense">
152
+ Date
153
+ </VcsLabel>
154
+ </v-col>
155
+ <v-col>
156
+ <VcsDatePicker id="dateInput" v-model="state.dateInput" />
157
+ </v-col>
158
+ </v-row>
152
159
  </v-container>
153
160
  </template>
154
161
  </VcsFormSection>
@@ -157,9 +164,8 @@
157
164
  help-text="form-inputs-example.help"
158
165
  >
159
166
  <template #default>
160
- <v-container>
167
+ <v-container class="py-0 px-1">
161
168
  <v-row
162
- :dense="dense"
163
169
  no-gutters
164
170
  align="center"
165
171
  >
@@ -173,14 +179,14 @@
173
179
  id="numberInput"
174
180
  :dense="dense"
175
181
  type="number"
176
- step="10"
177
- suffix="cm"
182
+ step="1"
183
+ unit="cm"
178
184
  v-model.number="state.numberInput"
185
+ show-spin-buttons
179
186
  />
180
187
  </v-col>
181
188
  </v-row>
182
189
  <v-row
183
- :dense="dense"
184
190
  no-gutters
185
191
  align="center"
186
192
  >
@@ -200,52 +206,39 @@
200
206
  </v-col>
201
207
  </v-row>
202
208
  <v-row
203
- :dense="dense"
204
209
  no-gutters
205
210
  align="center"
206
211
  >
207
- <v-col cols="1" class="px-1">
208
- <VcsLabel html-for="coordinateX" :dense="dense">
209
- X
210
- </VcsLabel>
211
- </v-col>
212
212
  <v-col>
213
213
  <VcsTextField
214
214
  id="coordinateX"
215
215
  :dense="dense"
216
216
  type="number"
217
217
  step="10"
218
- suffix="m"
218
+ prefix="X"
219
+ unit="m"
219
220
  v-model.number="state.numberInput"
220
221
  />
221
222
  </v-col>
222
- <v-col cols="1" class="px-1">
223
- <VcsLabel html-for="coordinateY" :dense="dense">
224
- Y
225
- </VcsLabel>
226
- </v-col>
227
- <v-col>
223
+ <v-col class="px-2">
228
224
  <VcsTextField
229
225
  id="coordinateY"
230
226
  :dense="dense"
231
227
  type="number"
232
228
  step="10"
233
- suffix="m"
229
+ prefix="Y"
230
+ unit="m"
234
231
  v-model.number="state.numberInput"
235
232
  />
236
233
  </v-col>
237
- <v-col cols="1" class="px-1">
238
- <VcsLabel html-for="coordinateZ" :dense="dense">
239
- Z
240
- </VcsLabel>
241
- </v-col>
242
234
  <v-col>
243
235
  <VcsTextField
244
236
  id="coordinateZ"
245
237
  :dense="dense"
246
238
  type="number"
247
239
  step="10"
248
- suffix="m"
240
+ unit="m"
241
+ prefix="Z"
249
242
  v-model.number="state.numberInput"
250
243
  />
251
244
  </v-col>
@@ -257,9 +250,8 @@
257
250
  heading="VcsFormSection Radio & Checkbox"
258
251
  >
259
252
  <template #default>
260
- <v-container>
253
+ <v-container class="py-0 px-1">
261
254
  <v-row
262
- :dense="dense"
263
255
  no-gutters
264
256
  align="center"
265
257
  >
@@ -268,12 +260,19 @@
268
260
  :dense="dense"
269
261
  :items="[...selectOptions, { label: 'Radio Option E colored', color: 'primary', value: 'E' }]"
270
262
  v-model="state.selected"
263
+ :rules="[v => v !== 'D' || 'D is not allowed']"
271
264
  row
272
265
  />
273
266
  </v-col>
274
267
  </v-row>
268
+ <v-row no-gutters>
269
+ <v-col>
270
+ <VcsLabel :dense="dense">
271
+ Text
272
+ </VcsLabel>
273
+ </v-col>
274
+ </v-row>
275
275
  <v-row
276
- :dense="dense"
277
276
  no-gutters
278
277
  align="center"
279
278
  >
@@ -307,15 +306,14 @@
307
306
  heading="VcsFormSection Mixed Inputs"
308
307
  >
309
308
  <template #header="{ heading }">
310
- <article class="pa-2 secondary text--primary">
309
+ <article class="pa-2 text--primary">
311
310
  {{ heading }}
312
311
  <h3>This is a custom header using header slot</h3>
313
312
  </article>
314
313
  </template>
315
314
  <template #default>
316
- <v-container>
315
+ <v-container class="py-0 px-1">
317
316
  <v-row
318
- :dense="dense"
319
317
  align="center"
320
318
  >
321
319
  <v-col cols="1">
@@ -323,7 +321,7 @@
323
321
  1
324
322
  </VcsLabel>
325
323
  </v-col>
326
- <v-col cols="3">
324
+ <v-col>
327
325
  <VcsSelect
328
326
  :items="[
329
327
  {value: 'one', i18n: 'form-inputs-example.numbers.one'},
@@ -331,9 +329,10 @@
331
329
  {value: 'three', i18n: 'form-inputs-example.numbers.three'}]"
332
330
  :item-text="item => item.i18n"
333
331
  :dense="dense"
332
+ placeholder="Numbers"
334
333
  />
335
334
  </v-col>
336
- <v-col cols="3">
335
+ <v-col>
337
336
  <VcsSelect
338
337
  :items="[
339
338
  {value: 'Anna', fullName: 'Annabella'},
@@ -343,35 +342,35 @@
343
342
  :dense="dense"
344
343
  multiple
345
344
  v-model="state.selectedMultiple"
346
- />
347
- </v-col>
348
- <v-col cols="5">
349
- <VcsTextField
350
- id="textInput"
351
- clearable
352
- :dense="dense"
353
- v-model="state.conditionalInput"
345
+ :rules="[v => !!v.length || 'Please select at least one option.']"
354
346
  />
355
347
  </v-col>
356
348
  </v-row>
357
349
  </v-container>
358
350
  </template>
359
351
  </VcsFormSection>
360
- <VcsButton
361
- @click="logState(state)"
362
- :disabled="!isValid"
363
- :tooltip="'Log current state in console'"
364
- :has-update="isValid && newUpdate"
365
- class="mx-2 mb-2"
366
- >
367
- Log State
368
- </VcsButton>
369
- <VcsButton
370
- type="reset"
371
- icon="$vcsReturn"
372
- >
373
- Reset
374
- </VcsButton>
352
+ <div class="d-flex justify-space-between px-2">
353
+ <VcsButton
354
+ @click="logState(state)"
355
+ :disabled="!isValid"
356
+ :tooltip="'Log current state in console'"
357
+ :has-update="isValid && newUpdate"
358
+ class="mx-2 mb-2"
359
+ >
360
+ Log State
361
+ </VcsButton>
362
+ <VcsButton
363
+ @click="validate();"
364
+ >
365
+ Val
366
+ </VcsButton>
367
+ <VcsButton
368
+ @click="resetState();"
369
+ icon="$vcsReturn"
370
+ >
371
+ Reset
372
+ </VcsButton>
373
+ </div>
375
374
  </v-form>
376
375
  </template>
377
376
  <script>
@@ -385,6 +384,8 @@
385
384
  VcsFormattedNumber,
386
385
  VcsFormSection,
387
386
  VcsLabel,
387
+ VcsTextArea,
388
+ VcsDatePicker,
388
389
  } from '@vcmap/ui';
389
390
  import { VCol, VContainer, VForm, VRow } from 'vuetify/lib';
390
391
  import packageJSON from './package.json';
@@ -401,10 +402,12 @@
401
402
  VcsFormattedNumber,
402
403
  VcsFormSection,
403
404
  VcsLabel,
405
+ VcsTextArea,
404
406
  VForm,
405
407
  VRow,
406
408
  VCol,
407
409
  VContainer,
410
+ VcsDatePicker,
408
411
  },
409
412
  props: {
410
413
  actions: {
@@ -425,18 +428,26 @@
425
428
  const plugin = app.plugins.getByKey(packageJSON.name);
426
429
  const newUpdate = ref(true);
427
430
  watch(plugin.state, () => { newUpdate.value = true; });
431
+ const form = ref();
428
432
 
429
433
  return {
430
434
  // no object-destruction of reactive objects! or use toRef()
431
435
  state: plugin.state,
432
436
  // do not put the whole config here, since it would become reactive
433
437
  selectOptions: plugin.config.selectOptions,
434
- initialTextInput: plugin.config.initialTextInput,
435
- isValid: false,
438
+ form,
439
+ isValid: ref(true),
436
440
  isValidText,
437
441
  conditionalTest,
438
442
  isValidEmail,
439
443
  newUpdate,
444
+ resetState() {
445
+ plugin.resetState();
446
+ form.value.resetValidation();
447
+ },
448
+ validate() {
449
+ form.value.validate();
450
+ },
440
451
  logState() {
441
452
  // eslint-disable-next-line no-console
442
453
  console.log(plugin.getSerializedState());
@@ -74,7 +74,7 @@ export default function (config) {
74
74
  /**
75
75
  * @type {FormInputsExampleState}
76
76
  */
77
- const pluginState = reactive({
77
+ const pluginState = {
78
78
  selected: pluginConfig.selectOptions.value[0],
79
79
  selectedMultiple: [],
80
80
  conditionalInput: '',
@@ -84,7 +84,11 @@ export default function (config) {
84
84
  email: '',
85
85
  prependedInput: '',
86
86
  files: [],
87
- });
87
+ dateInput: '',
88
+ };
89
+
90
+ /** @type {FormInputsExampleState} */
91
+ const defaultState = JSON.parse(JSON.stringify(pluginState));
88
92
 
89
93
 
90
94
  /**
@@ -149,7 +153,8 @@ export default function (config) {
149
153
  get version() { return packageJSON.version; },
150
154
  get vcMapVersion() { return packageJSON.vcMapVersion; },
151
155
  config: pluginConfig,
152
- state: pluginState,
156
+ state: reactive(pluginState),
157
+ resetState: () => Object.assign(pluginState, JSON.parse(JSON.stringify(defaultState))),
153
158
  getSerializedState,
154
159
  setSerializedState,
155
160
  onVcsAppMounted(app) {
@@ -13,7 +13,7 @@ export function isValidText(value) {
13
13
  * @returns {boolean|string}
14
14
  */
15
15
  export function conditionalTest(value, condition) {
16
- if (condition === 'Option A') {
16
+ if (condition === 'B') {
17
17
  return value === 'test' || `input ${value} must be "test"`;
18
18
  } else {
19
19
  return true;
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <v-sheet>
3
- <v-sheet class="pa-2">
3
+ <v-sheet class="px-2 d-grid">
4
4
  <v-switch
5
5
  v-model="selectable"
6
6
  label="Selectable"
@@ -286,5 +286,8 @@
286
286
  </script>
287
287
 
288
288
  <style lang="scss" scoped>
289
-
289
+ .d-grid{
290
+ display: grid;
291
+ grid-template-columns: 1fr 1fr;
292
+ }
290
293
  </style>
@@ -0,0 +1,202 @@
1
+ <template>
2
+ <v-sheet>
3
+ <v-sheet class="px-2 d-grid">
4
+ <v-switch
5
+ v-model="selectable"
6
+ label="Selectable"
7
+ />
8
+ <v-switch
9
+ :disabled="!selectable"
10
+ v-model="selectSingle"
11
+ label=" Single Select"
12
+ />
13
+ <v-switch
14
+ v-model="searchable"
15
+ label="Searchable"
16
+ />
17
+ <v-dialog
18
+ v-model="dialog"
19
+ width="400"
20
+ >
21
+ <template #activator="{ on }">
22
+ <vcs-button v-on="on">
23
+ Add An item
24
+ </vcs-button>
25
+ </template>
26
+ <v-card class="pa-2">
27
+ <v-form
28
+ @submit.prevent="add"
29
+ >
30
+ <vcs-text-field
31
+ v-model="newItem.name"
32
+ label="Name"
33
+ :rules="required"
34
+ />
35
+ <vcs-text-field
36
+ v-model="newItem.type"
37
+ label="type"
38
+ :rules="required"
39
+ />
40
+ <vcs-text-field
41
+ v-model="newItem.date"
42
+ type="date"
43
+ label="date"
44
+ />
45
+ <vcs-button
46
+ type="submit"
47
+ >
48
+ Add
49
+ </vcs-button>
50
+ </v-form>
51
+ </v-card>
52
+ </v-dialog>
53
+ </v-sheet>
54
+
55
+ <vcs-data-table
56
+ :items="items"
57
+ item-key="id"
58
+ :headers="headers"
59
+ :show-select="selectable"
60
+ :single-select="selectSingle"
61
+ :show-searchbar="searchable"
62
+ v-model="selected"
63
+ >
64
+ <!-- eslint-disable-next-line -->
65
+ <template v-slot:item.actions="{ item }">
66
+ <VcsActionButtonList
67
+ v-if="item.actions"
68
+ :actions="item.actions"
69
+ :block-overflow="true"
70
+ :overflow-count="2"
71
+ small
72
+ />
73
+ </template>
74
+ </vcs-data-table>
75
+ </v-sheet>
76
+ </template>
77
+
78
+ <script>
79
+ import { VcsDataTable, VcsButton, VcsTextField, VcsActionButtonList } from '@vcmap/ui';
80
+ import {
81
+ VSwitch,
82
+ VSheet,
83
+ VDialog,
84
+ VCard,
85
+ VForm,
86
+ } from 'vuetify/lib';
87
+ import { ref } from 'vue';
88
+
89
+ const defaultHeaders = [
90
+ {
91
+ text: 'Name',
92
+ value: 'name',
93
+ },
94
+ {
95
+ text: 'Type',
96
+ value: 'type',
97
+ },
98
+ {
99
+ text: 'Datum',
100
+ value: 'date',
101
+ sort: (a, b) => new Date(b) - new Date(a),
102
+ },
103
+ { text: 'Actions', value: 'actions', sortable: false },
104
+ ];
105
+
106
+ const defaultItems = [
107
+ {
108
+ id: 0,
109
+ name: 'foo',
110
+ type: 'Foo',
111
+ date: '8/3/2023 9:24',
112
+ actions: [
113
+ {
114
+ name: 'console.log',
115
+ icon: 'mdi-printer',
116
+ callback() {
117
+ console.log('foo action');
118
+ },
119
+ },
120
+ ],
121
+ },
122
+ {
123
+ id: 1,
124
+ name: 'bar',
125
+ type: 'Bar',
126
+ date: '1/8/2022 19:54',
127
+ },
128
+ {
129
+ id: 2,
130
+ name: 'baz',
131
+ type: 'Baz',
132
+ date: '11/2/2012 14:03',
133
+ },
134
+ ];
135
+
136
+ export default {
137
+ name: 'DataTableExample',
138
+ components: {
139
+ VcsDataTable,
140
+ VcsButton,
141
+ VcsTextField,
142
+ VcsActionButtonList,
143
+ VSwitch,
144
+ VSheet,
145
+ VDialog,
146
+ VCard,
147
+ VForm,
148
+ },
149
+ setup() {
150
+ const selectable = ref(true);
151
+ const searchable = ref(true);
152
+ const selectSingle = ref(false);
153
+ const selected = ref([]);
154
+ const items = ref(defaultItems);
155
+ const headers = ref(defaultHeaders);
156
+ const newItem = ref({
157
+ id: items.value.length,
158
+ name: 'foo',
159
+ type: 'foo',
160
+ date: new Date(),
161
+ });
162
+ const dialog = ref(false);
163
+
164
+ return {
165
+ selectable,
166
+ searchable,
167
+ selectSingle,
168
+ selected,
169
+ items,
170
+ headers,
171
+ newItem,
172
+ dialog,
173
+ required: [
174
+ v => !!v || 'Input may not be null',
175
+ v => v.length > 0 || 'Input must have a length',
176
+ ],
177
+ add() {
178
+ const item = {
179
+ name: newItem.value.name,
180
+ type: newItem.value.type,
181
+ date: newItem.value.date,
182
+ };
183
+
184
+ items.value.push(item);
185
+ newItem.value = {
186
+ name: 'foo',
187
+ type: 'foo',
188
+ date: new Date(),
189
+ };
190
+ dialog.value = false;
191
+ },
192
+ };
193
+ },
194
+ };
195
+ </script>
196
+
197
+ <style lang="scss" scoped>
198
+ .d-grid{
199
+ display: grid;
200
+ grid-template-columns: 1fr 1fr;
201
+ }
202
+ </style>
@@ -0,0 +1,3 @@
1
+ # List Example
2
+
3
+ This is a show-case plugin demonstrating the usage of [VcsDataTable](../../../src/components/tables/VcsDataTable.vue).