@vcmap/ui 5.0.0-rc.20 → 5.0.0-rc.22

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 (104) hide show
  1. package/build/buildHelpers.js +1 -0
  2. package/build/commonViteConfig.js +1 -0
  3. package/config/www.config.json +25 -14
  4. package/dist/assets/cesium.js +1 -1
  5. package/dist/assets/{core.60e74d.js → core.a66593.js} +2443 -2457
  6. package/dist/assets/core.js +1 -1
  7. package/dist/assets/favicon.decf54cc.svg +10 -0
  8. package/dist/assets/{index.884a53ef.js → index.8b833ead.js} +1 -1
  9. package/dist/assets/{ol.c6ff35.js → ol.d4539f.js} +12406 -12152
  10. package/dist/assets/ol.js +1 -1
  11. package/dist/assets/ui.d760e4.css +5 -0
  12. package/dist/assets/{ui.bf504d.js → ui.d760e4.js} +5218 -4240
  13. package/dist/assets/ui.js +1 -1
  14. package/dist/assets/vue.js +2 -2
  15. package/dist/assets/vuetify.427322.css +5 -0
  16. package/dist/assets/{vuetify.0d7360.js → vuetify.427322.js} +1 -1
  17. package/dist/assets/vuetify.js +2 -2
  18. package/dist/index.html +6 -1
  19. package/index.html +5 -0
  20. package/index.js +2 -1
  21. package/lib/olLib.js +15 -1
  22. package/package.json +4 -3
  23. package/plugins/@vcmap/project-selector/ProjectSelectorComponent.vue +1 -1
  24. package/plugins/@vcmap/theme-changer/ThemeChangerComponent.vue +10 -4
  25. package/plugins/@vcmap-show-case/form-inputs-example/FormInputsExample.vue +75 -81
  26. package/plugins/@vcmap-show-case/form-inputs-example/index.js +7 -3
  27. package/plugins/@vcmap-show-case/form-inputs-example/validation.js +1 -1
  28. package/plugins/@vcmap-show-case/list-example/ListExample.vue +5 -2
  29. package/plugins/@vcmap-show-case/wizard-example/wizardExample.vue +57 -23
  30. package/plugins/package.json +2 -1
  31. package/src/application/VcsApp.vue +13 -5
  32. package/src/application/VcsAttributions.vue +2 -3
  33. package/src/application/VcsAttributionsFooter.vue +10 -16
  34. package/src/application/VcsNavbar.vue +1 -2
  35. package/src/application/VcsSettings.vue +21 -8
  36. package/src/assets/favicon-128.png +0 -0
  37. package/src/assets/favicon-180.png +0 -0
  38. package/src/assets/favicon-192.png +0 -0
  39. package/src/assets/favicon-32.png +0 -0
  40. package/src/assets/favicon.svg +10 -0
  41. package/src/components/buttons/VcsButton.vue +2 -3
  42. package/src/components/form-inputs-controls/VcsCheckbox.vue +46 -26
  43. package/src/components/form-inputs-controls/VcsFormSection.vue +15 -13
  44. package/src/components/form-inputs-controls/VcsLabel.vue +10 -1
  45. package/src/components/form-inputs-controls/VcsRadio.vue +38 -18
  46. package/src/components/form-inputs-controls/VcsSelect.vue +117 -59
  47. package/src/components/form-inputs-controls/VcsTextArea.vue +101 -60
  48. package/src/components/form-inputs-controls/VcsTextField.vue +171 -69
  49. package/src/components/form-inputs-controls/VcsWizard.vue +20 -14
  50. package/src/components/form-inputs-controls/VcsWizardStep.vue +18 -16
  51. package/src/components/form-inputs-controls/composables.js +26 -0
  52. package/src/components/form-output/VcsFormattedNumber.vue +1 -1
  53. package/src/components/icons/2DDistanceIcon.vue +0 -3
  54. package/src/components/icons/3DDistanceIcon.vue +0 -3
  55. package/src/components/icons/3DHeightIcon.vue +0 -3
  56. package/src/components/icons/CheckboxCheckedIcon.vue +4 -11
  57. package/src/components/icons/CheckboxIcon.vue +9 -2
  58. package/src/components/icons/CheckboxIndeterminateIcon.vue +4 -21
  59. package/src/components/icons/CommentIcon.vue +1 -5
  60. package/src/components/icons/ObliqueViewIcon.vue +6 -8
  61. package/src/components/icons/SimpleCircleOutlinedIcon.vue +1 -1
  62. package/src/components/icons/SplitViewIcon.vue +0 -4
  63. package/src/components/icons/ToolsIcon.vue +2 -4
  64. package/src/components/lists/VcsActionList.vue +0 -1
  65. package/src/components/lists/VcsList.vue +6 -25
  66. package/src/components/lists/VcsTreeview.vue +2 -2
  67. package/src/components/lists/VcsTreeviewLeaf.vue +3 -9
  68. package/src/components/lists/VcsTreeviewSearchbar.vue +4 -4
  69. package/src/components/notification/VcsBadge.vue +6 -2
  70. package/src/components/notification/VcsHelp.vue +39 -0
  71. package/src/components/tables/VcsTable.vue +70 -24
  72. package/src/featureInfo/AddressBalloonComponent.vue +1 -1
  73. package/src/featureInfo/BalloonComponent.vue +14 -9
  74. package/src/featureInfo/featureInfo.js +25 -7
  75. package/src/featureInfo/tableFeatureInfoView.js +4 -0
  76. package/src/i18n/de.js +5 -1
  77. package/src/i18n/en.js +5 -1
  78. package/src/legend/styleLegendItem.vue +24 -2
  79. package/src/legend/vcsLegend.vue +24 -31
  80. package/src/manager/toolbox/GroupToolboxComponent.vue +2 -3
  81. package/src/manager/toolbox/SelectToolboxComponent.vue +11 -5
  82. package/src/manager/toolbox/ToolboxManager.vue +0 -7
  83. package/src/manager/window/WindowComponent.vue +0 -1
  84. package/src/manager/window/WindowComponentHeader.vue +2 -2
  85. package/src/navigation/overviewMap.js +6 -15
  86. package/src/navigation/tiltSlider.vue +30 -6
  87. package/src/search/resultsComponent.vue +0 -1
  88. package/src/search/search.js +7 -17
  89. package/src/search/searchComponent.vue +6 -7
  90. package/src/styles/_theming.scss +72 -3
  91. package/src/styles/_typography.scss +0 -5
  92. package/src/styles/main.scss +1 -0
  93. package/src/styles/shades.scss +2 -0
  94. package/src/styles/variables.scss +40 -4
  95. package/src/uiConfig.js +1 -0
  96. package/src/vcsUiApp.js +5 -0
  97. package/src/vuePlugins/vuetify.js +59 -13
  98. package/dist/assets/core.f198cf.js +0 -15993
  99. package/dist/assets/ol.dbd604.js +0 -44299
  100. package/dist/assets/ui.bf504d.css +0 -1
  101. package/dist/assets/vue.a831f1.js +0 -4675
  102. package/dist/assets/vuetify.0d7360.css +0 -5
  103. /package/dist/assets/{cesium.adbd45.js → cesium.88cffd.js} +0 -0
  104. /package/dist/assets/{vue.75b819.js → vue.db5102.js} +0 -0
@@ -10,44 +10,67 @@
10
10
  v-model.number="step"
11
11
  >
12
12
  <template #content>
13
- <div>
14
- This is the content of the first step.
15
- </div>
16
- <VcsButton
17
- @click="increaseStep()"
18
- class="my-2"
19
- >
20
- Next
21
- </VcsButton>
13
+ <!-- px-2 because does not contain input components -->
14
+ <v-container class="px-2 py-0">
15
+ <div>
16
+ This is the content of the first step.
17
+ </div>
18
+ <VcsButton
19
+ @click="increaseStep()"
20
+ class="my-2"
21
+ >
22
+ Next
23
+ </VcsButton>
24
+ </v-container>
22
25
  </template>
23
26
  </VcsWizardStep>
24
27
  <VcsWizardStep
25
- :rules="[() => false]"
26
28
  step="2"
27
29
  editable
28
30
  :header-actions="actions.second"
29
31
  heading="This is the second step"
30
32
  v-model.number="step"
33
+ :rules="[v => !!formValid]"
31
34
  >
32
35
  <template #help>
36
+ Allowed options:
33
37
  <ol>
34
- <li>this</li>
35
38
  <li>is</li>
36
- <li>the help slot</li>
39
+ <li>a</li>
40
+ <li>test</li>
37
41
  </ol>
38
42
  </template>
39
43
  <template #content>
40
- <VcsSelect
41
- :items="['this', 'is', 'a', 'test']"
42
- v-model="selection"
43
- label="Select"
44
- class="my-2"
45
- />
46
- <VcsButton
47
- @click="decreaseStep()"
48
- >
49
- Back
50
- </VcsButton>
44
+ <v-container class="px-1 py-0">
45
+ <v-form ref="form" v-model="formValid" lazy-validation>
46
+ <VcsSelect
47
+ :items="['this', 'is', 'a', 'test']"
48
+ v-model="selection"
49
+ placeholder="Select"
50
+ :rules="[v => (!!v && v !== 'this') || 'Please select a valid option.']"
51
+ />
52
+ <VcsButton
53
+ @click="decreaseStep()"
54
+ >
55
+ Back
56
+ </VcsButton>
57
+ </v-form>
58
+ </v-container>
59
+ </template>
60
+ </VcsWizardStep>
61
+ <VcsWizardStep
62
+ step="3"
63
+ v-model.number="step"
64
+ >
65
+ <template #header>
66
+ <div class="d-flex flex-grow-1 flex-row-reverse">
67
+ <VcsButton
68
+ :disabled="!selection || !formValid"
69
+ @click="finish()"
70
+ >
71
+ Finish
72
+ </VcsButton>
73
+ </div>
51
74
  </template>
52
75
  </VcsWizardStep>
53
76
  </VcsWizard>
@@ -55,6 +78,7 @@
55
78
 
56
79
  <script>
57
80
  import { VcsWizard, VcsWizardStep, VcsButton, VcsSelect } from '@vcmap/ui';
81
+ import { VForm, VContainer } from 'vuetify/lib';
58
82
  import { ref } from 'vue';
59
83
 
60
84
  /** Component to showcase the VcsWizard and VcsWizardStep. */
@@ -65,10 +89,14 @@
65
89
  VcsWizardStep,
66
90
  VcsButton,
67
91
  VcsSelect,
92
+ VForm,
93
+ VContainer,
68
94
  },
69
95
  setup() {
70
96
  const step = ref(1);
71
97
  const selection = ref();
98
+ const form = ref();
99
+ const formValid = ref(false);
72
100
  const actions = {
73
101
  second: [{
74
102
  name: 'resetSecondStep',
@@ -85,6 +113,12 @@
85
113
  decreaseStep() { step.value -= 1; },
86
114
  selection,
87
115
  actions,
116
+ formValid,
117
+ form,
118
+ finish() {
119
+ step.value = 1;
120
+ form.value.reset();
121
+ },
88
122
  };
89
123
  },
90
124
  };
@@ -2,6 +2,7 @@
2
2
  "dependencies": {
3
3
  "@vcmap/hello-world": "^1.0.7",
4
4
  "@vcmap/print": "^1.0.2",
5
- "@vcmap/swipe-tool": "^1.0.3"
5
+ "@vcmap/swipe-tool": "^1.0.3",
6
+ "@vcmap/export": "^1.0.1"
6
7
  }
7
8
  }
@@ -69,7 +69,7 @@
69
69
  getCurrentInstance,
70
70
  onMounted,
71
71
  onUnmounted,
72
- provide,
72
+ provide, watch,
73
73
  } from 'vue';
74
74
  import { getVcsAppById } from '@vcmap/core';
75
75
  import { VContainer, VFooter } from 'vuetify/lib';
@@ -350,6 +350,7 @@
350
350
  * This helper sets up a listener to sync the theming relevant keys from the {@see UiConfigObject}
351
351
  * with a given vuetify instance. Use this helper, if you do not use the VcsApp component and wish to evaluate
352
352
  * the theming keys. Returns a function to stop syncing.
353
+ * Also adds a watcher to vuetify theme, which triggers themeChanged event on the VcsUiApp.
353
354
  * @param {VcsUiApp} app
354
355
  * @param {import("vuetify").Framework} vuetify
355
356
  * @returns {function():void} - call to stop syncing
@@ -358,21 +359,28 @@
358
359
  const listeners = [
359
360
  app.uiConfig.added.addEventListener((item) => {
360
361
  if (item.name === 'primaryColor') {
361
- vuetify.theme.themes.dark.primary = item.value;
362
- vuetify.theme.themes.light.primary = item.value;
362
+ vuetify.theme.themes.dark.primary = item.value?.dark || item.value;
363
+ vuetify.theme.themes.light.primary = item.value?.light || item.value;
364
+ app.themeChanged.raiseEvent();
363
365
  }
364
366
  }),
365
367
  app.uiConfig.removed.addEventListener((item) => {
366
368
  if (item.name === 'primaryColor') {
367
- vuetify.theme.themes.dark.primary = defaultPrimaryColor;
368
- vuetify.theme.themes.light.primary = defaultPrimaryColor;
369
+ vuetify.theme.themes.dark.primary = defaultPrimaryColor.dark;
370
+ vuetify.theme.themes.light.primary = defaultPrimaryColor.light;
371
+ app.themeChanged.raiseEvent();
369
372
  }
370
373
  }),
371
374
  ];
375
+ const stopWatching = watch(
376
+ () => vuetify.theme.dark,
377
+ () => app.themeChanged.raiseEvent(),
378
+ );
372
379
 
373
380
  return () => {
374
381
  listeners.forEach((cb) => { cb(); });
375
382
  listeners.splice(0);
383
+ stopWatching();
376
384
  };
377
385
  }
378
386
 
@@ -1,6 +1,6 @@
1
1
  <template>
2
- <v-list>
3
- <v-list-item v-for="({key, title, attributions}) in entries" :key="key">
2
+ <v-list class="px-1">
3
+ <v-list-item v-for="({key, title, attributions}) in entries" :key="key" class="px-1">
4
4
  <v-list-item-content>
5
5
  <v-list-item-title>{{ $t(title) }}</v-list-item-title>
6
6
  <v-list-item-subtitle
@@ -11,7 +11,6 @@
11
11
  <a
12
12
  :href="attribution.url"
13
13
  target="_blank"
14
- class="text--secondary"
15
14
  >
16
15
  {{ $t(attribution.provider) }} {{ attribution.year }}
17
16
  </a>
@@ -1,14 +1,13 @@
1
1
  <template>
2
- <span class="attribution-wrap">
2
+ <span class="d-inline-block text-truncate mr-10 attribution-wrap">
3
3
  <span v-for="attribution in mergedAttributions" class="attribution-span" :key="attribution.provider">
4
4
  <a
5
5
  :href="attribution.url"
6
6
  target="_blank"
7
- class="text--secondary"
8
7
  >{{ $t(attribution.provider) }} <span>{{ attribution.years }}</span></a>
9
8
  </span>
10
9
  <VcsButton
11
- class="d-flex text--secondary"
10
+ class="d-flex"
12
11
  small
13
12
  :key="attributionAction.name"
14
13
  :tooltip="attributionAction.title"
@@ -20,18 +19,13 @@
20
19
  </template>
21
20
 
22
21
  <style lang="scss" scoped>
23
- .attribution-wrap{
24
- white-space: nowrap;
25
- margin-right: 40px;
26
- overflow: hidden;
27
- text-overflow: ellipsis;
28
22
 
29
- .vcs-button-wrap{
30
- position: absolute;
31
- right: 4px;
32
- bottom: 3px;
33
- }
23
+ .attribution-wrap .vcs-button-wrap {
24
+ position: absolute;
25
+ right: 4px;
26
+ bottom: 3px;
34
27
  }
28
+
35
29
  a:before {
36
30
  content: '\00a9\00a0';
37
31
  }
@@ -40,17 +34,17 @@
40
34
  &:before {
41
35
  content: '\00a0\007c\00a0';
42
36
  }
43
- &:first-child::before{
37
+ &:first-child::before {
44
38
  content: '';
45
39
  }
46
- span{
40
+ span {
47
41
  font-size: inherit;
48
42
  }
49
43
  }
50
44
 
51
45
  </style>
52
46
 
53
- <script >
47
+ <script>
54
48
 
55
49
  import { computed } from 'vue';
56
50
  import { mergeAttributions } from './attributionsHelper.js';
@@ -4,7 +4,6 @@
4
4
  dense
5
5
  elevation="0"
6
6
  :height="$vuetify.breakpoint.xs ? '56px' : '48px'"
7
- :color="'var(--v-basic-base)'"
8
7
  :bottom="$vuetify.breakpoint.xs ? 'bottom' : undefined"
9
8
  width="100%"
10
9
  >
@@ -31,7 +30,7 @@
31
30
  />
32
31
  <v-divider
33
32
  v-if="contentActions.length > 0 && toolActions.length > 0"
34
- class="mx-2"
33
+ class="mx-2 base lighten-2"
35
34
  vertical
36
35
  inset
37
36
  />
@@ -1,14 +1,21 @@
1
1
  <template>
2
- <v-container class="pa-2">
2
+ <v-container class="px-1 py-0">
3
3
  <v-row
4
4
  no-gutters
5
5
  align="center"
6
6
  >
7
7
  <v-col>
8
- <VcsLabel>
9
- {{ $t('settings.languageTitle') }}
8
+ <VcsLabel html-for="settingsLanguageSelect">
9
+ {{ $t('settings.languageSelector') }}
10
10
  </VcsLabel>
11
11
  </v-col>
12
+ <v-col>
13
+ <VcsSelect
14
+ id="settingsLanguageSelect"
15
+ :items="languages"
16
+ v-model="language"
17
+ />
18
+ </v-col>
12
19
  </v-row>
13
20
  <v-row
14
21
  no-gutters
@@ -16,14 +23,18 @@
16
23
  >
17
24
  <v-col>
18
25
  <VcsLabel html-for="settingsLanguageSelect">
19
- {{ $t('settings.languageSelector') }}
26
+ {{ $t('settings.theme.title') }}
20
27
  </VcsLabel>
21
28
  </v-col>
22
29
  <v-col>
23
- <VcsSelect
24
- id="settingsLanguageSelect"
25
- :items="languages"
26
- v-model="language"
30
+ <VcsRadio
31
+ dense
32
+ :items="[
33
+ { label: 'settings.theme.light', value: false },
34
+ { label: 'settings.theme.dark', value: true },
35
+ ]"
36
+ v-model="$vuetify.theme.dark"
37
+ row
27
38
  />
28
39
  </v-col>
29
40
  </v-row>
@@ -37,11 +48,13 @@
37
48
  import { VCol, VContainer, VRow } from 'vuetify/lib';
38
49
  import VcsLabel from '../components/form-inputs-controls/VcsLabel.vue';
39
50
  import VcsSelect from '../components/form-inputs-controls/VcsSelect.vue';
51
+ import VcsRadio from '../components/form-inputs-controls/VcsRadio.vue';
40
52
 
41
53
  export default {
42
54
  name: 'VcsSettings',
43
55
  components: {
44
56
  VcsSelect,
57
+ VcsRadio,
45
58
  VcsLabel,
46
59
  VContainer,
47
60
  VRow,
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg id="SvgjsSvg1004" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128">
3
+ <rect width="128" height="128" style="fill: none;"/>
4
+ <g>
5
+ <path id="SvgjsPath1003" d="m120.44,41.1l-22.64,22.9-30.07-30.44c-.98-1-2.33-1.56-3.73-1.56h52.71c1.4,0,2.73.56,3.73,1.56,2.04,2.05,2.06,5.4.05,7.48,0,0-.05.06-.05.06Z" style="fill: #86b110; isolation: isolate; opacity: .9;"/>
6
+ <path id="SvgjsPath1002" d="m97.8,64l-30.09,30.44c-2.06,2.08-5.39,2.08-7.45,0-.98-1-1.55-2.36-1.55-3.78v-53.32c0-1.41.56-2.77,1.55-3.78,2.06-2.08,5.39-2.08,7.45,0l30.09,30.44Z" style="fill: #005434; isolation: isolate; opacity: .9;"/>
7
+ <path id="SvgjsPath1001" d="m58.71,37.34v53.32c0,1.41.56,2.77,1.55,3.78L7.54,41.1c-2.04-2.05-2.06-5.4-.05-7.48l.05-.06c1-1,2.33-1.56,3.73-1.56h52.71c-1.4,0-2.73.56-3.73,1.56-.98.99-1.55,2.34-1.55,3.78Z" style="fill: #409d76; isolation: isolate; opacity: .9;"/>
8
+ <path id="SvgjsPath1000" d="m120.44,94.44c-.98,1-2.33,1.56-3.73,1.56h-52.71c1.4,0,2.73-.56,3.73-1.56l30.09-30.44,22.64,22.9c2.04,2.05,2.06,5.4.05,7.48l-.05.06h-.02Z" style="fill: #00a0ba; isolation: isolate; opacity: .9;"/>
9
+ </g>
10
+ </svg>
@@ -52,7 +52,7 @@
52
52
  font-size: 12px;
53
53
  border: 1px solid transparent;
54
54
  &:hover{
55
- color: var(--v-accent-lighten5) !important;
55
+ color: var(--v-base-lighten5) !important;
56
56
  border-color: var(--v-primary-base);
57
57
  background-color: var(--v-primary-base);
58
58
  }
@@ -87,8 +87,7 @@
87
87
 
88
88
  &.vcs-button--active-background {
89
89
  border: 2px solid var(--v-primary-base);
90
- color: var(--v-secondary-base);
91
- background-color: var(--v-accent-darken1) !important;
90
+ background-color: var(--v-base-lighten2) !important;
92
91
  }
93
92
 
94
93
  &.v-btn--disabled {
@@ -3,24 +3,26 @@
3
3
  :tooltip-position="tooltipPosition"
4
4
  :tooltip="errorMessage"
5
5
  color="error"
6
+ :max-width="200"
6
7
  >
7
8
  <template #activator="{ on, attrs }">
8
9
  <span v-on="on">
9
10
  <v-checkbox
11
+ ref="checkbox"
10
12
  :input-value="$attrs.value"
11
13
  on-icon="$vcsCheckboxChecked"
12
14
  off-icon="$vcsCheckbox"
13
15
  class="vcs-checkbox"
16
+ :class="{'pl-1': !isDense }"
14
17
  hide-details
15
18
  indeterminate-icon="$vcsCheckboxIndeterminate"
16
- :dense="$attrs.dense!==false"
19
+ :dense="isDense"
17
20
  :ripple="false"
18
21
  v-bind="{...$attrs, ...attrs}"
19
22
  v-on="{...$listeners, ...on}"
20
- @update:error="setError"
21
23
  >
22
24
  <template #label>
23
- <VcsLabel :html-for="$attrs.id" :dense="!!$attrs.dense">
25
+ <VcsLabel :html-for="$attrs.id" :dense="isDense">
24
26
  <slot name="label" />
25
27
  <span v-if="!$slots.label">{{ $t($attrs.label) }}</span>
26
28
  </VcsLabel>
@@ -31,28 +33,45 @@
31
33
  </VcsTooltip>
32
34
  </template>
33
35
  <style lang="scss" scoped>
34
- .vcs-checkbox {
35
- ::v-deep {
36
- label.v-label,
37
- .v-icon.v-icon{
38
- color: inherit;
39
- }
40
- .v-input--selection-controls__input {
41
- margin: 0;
42
- padding: 0;
36
+ @import '../../styles/shades.scss';
37
+ .vcs-checkbox {
38
+ ::v-deep {
39
+ .v-input--selection-controls__input {
40
+ margin: 0;
41
+ padding: 0;
42
+ }
43
+ label.v-label.error--text {
44
+ animation: none;
45
+ }
46
+ .v-icon,
47
+ .v-label {
48
+ &.theme--light {
49
+ color: map-get($shades, 'black') !important;
50
+ &.error--text{
51
+ color: var(--v-error-base) !important;
52
+ }
53
+ }
54
+ &.theme--dark {
55
+ color: map-get($shades, 'white') !important;
56
+ &.error--text{
57
+ color: var(--v-error-base) !important;
58
+ }
59
+ }
60
+ }
43
61
  }
44
62
  }
45
- }
46
- .v-input--selection-controls {
47
- margin: 0;
48
- padding: 0;
49
- }
63
+ .v-input--selection-controls {
64
+ margin: 0;
65
+ padding: 0;
66
+ }
67
+
50
68
  </style>
51
69
  <script>
70
+ import { computed, ref } from 'vue';
52
71
  import { VCheckbox } from 'vuetify/lib';
53
72
  import VcsLabel from './VcsLabel.vue';
54
73
  import VcsTooltip from '../notification/VcsTooltip.vue';
55
- import validate from '../notification/validation.js';
74
+ import { useErrorSync } from './composables.js';
56
75
 
57
76
  /**
58
77
  * @description Stylized wrapper around {@link https://vuetifyjs.com/en/api/v-checkbox/ |vuetify checkbox}.
@@ -77,17 +96,18 @@
77
96
  default: 'right',
78
97
  },
79
98
  },
80
- data() {
99
+ setup(props, { attrs }) {
100
+ const checkbox = ref();
101
+
102
+ const errorMessage = useErrorSync(checkbox);
103
+ const isDense = computed(() => attrs.dense !== false);
104
+
81
105
  return {
82
- errorMessage: '',
106
+ checkbox,
107
+ errorMessage,
108
+ isDense,
83
109
  };
84
110
  },
85
- methods: {
86
- setError() {
87
- const rules = [...this.$attrs.rules].concat(this.$attrs.errorMessages);
88
- this.errorMessage = validate(rules, this.$attrs.value).join('\n');
89
- },
90
- },
91
111
  model: {
92
112
  event: 'change',
93
113
  },
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <section class="vcs-form-section">
3
3
  <slot name="header" :heading="heading" :actions="actions">
4
- <article class="pa-2 accent">
4
+ <article class="pa-2 base lighten-3">
5
5
  <div class="form-section-header d-flex justify-space-between align-center">
6
6
  <strong class="caption">{{ $t(heading) }}</strong>
7
7
  <VcsActionButtonList
@@ -12,17 +12,13 @@
12
12
  </div>
13
13
  </article>
14
14
  </slot>
15
- <v-alert
16
- :value="showHelp"
17
- dense
18
- text
19
- color="secondary"
20
- class="ma-0"
15
+ <VcsHelp
16
+ :text="helpText"
17
+ :show="showHelp"
18
+ class="base lighten-4"
21
19
  >
22
- <slot name="help">
23
- <span>{{ $t(helpText) }}</span>
24
- </slot>
25
- </v-alert>
20
+ <slot name="help" />
21
+ </VcsHelp>
26
22
  <article class="section-content">
27
23
  <slot />
28
24
  </article>
@@ -32,8 +28,8 @@
32
28
 
33
29
  <script>
34
30
  import { computed, reactive } from 'vue';
35
- import { VAlert } from 'vuetify/lib';
36
31
  import VcsActionButtonList from '../buttons/VcsActionButtonList.vue';
32
+ import VcsHelp from '../notification/VcsHelp.vue';
37
33
 
38
34
  /**
39
35
  * @description
@@ -51,7 +47,7 @@
51
47
  name: 'VcsFormSection',
52
48
  components: {
53
49
  VcsActionButtonList,
54
- VAlert,
50
+ VcsHelp,
55
51
  },
56
52
  props: {
57
53
  heading: {
@@ -98,3 +94,9 @@
98
94
  },
99
95
  };
100
96
  </script>
97
+
98
+ <style scoped>
99
+ .v-alert--text:before{
100
+ background-color: transparent;
101
+ }
102
+ </style>
@@ -1,8 +1,17 @@
1
1
  <template>
2
- <label :htmlFor="htmlFor" class="vcs-label" :class="{'vcs-label-dense': dense}">
2
+ <label
3
+ :htmlFor="htmlFor"
4
+ class="vcs-label"
5
+ :class="{
6
+ 'vcs-label-dense': dense,
7
+ 'px-1': dense,
8
+ 'px-2': !dense,
9
+ }"
10
+ >
3
11
  <slot />
4
12
  </label>
5
13
  </template>
14
+
6
15
  <style lang="scss" scoped>
7
16
  @import "../../styles/vcsGrid.scss";
8
17
  @import "../../styles/vcsFont";