@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,30 +1,33 @@
1
1
  <template>
2
- <div
3
- @mouseover="hover = true"
4
- @mouseleave="hover = false"
5
- >
2
+ <div>
6
3
  <VcsTooltip
7
4
  :tooltip-position="tooltipPosition"
8
5
  :tooltip="errorMessage"
9
- :value="(hover || focus) && isError"
10
6
  color="error"
11
7
  :max-width="200"
12
8
  >
13
- <template #activator="{ attrs }">
9
+ <template #activator="{ on, attrs }">
14
10
  <v-textarea
15
11
  ref="textAreaRef"
16
12
  hide-details
17
13
  :dense="isDense"
18
14
  :clearable="isClearable"
19
15
  @focus="focus = true"
20
- @blur="focus = neverBlurred = false"
21
- @input="firstInput = true"
22
- :outlined="isOutlined"
16
+ @blur="focus = false"
17
+ @mouseover="hover = true"
18
+ @mouseleave="hover = false"
19
+ outlined
23
20
  v-bind="{...$attrs, ...attrs}"
24
- v-on="{...$listeners}"
21
+ v-on="{...$listeners, ...on}"
25
22
  :rows="$attrs.rows || (isDense ? 3 : 5)"
26
- class="ma-0 pb-1 pt-1 primary--placeholder"
27
- :class="$attrs.color === 'primary' ? 'primary--textarea' : ''"
23
+ class="ma-0 py-1 primary--placeholder"
24
+ :class="{
25
+ 'remove-outline': !isOutlined,
26
+ 'outline--current': focus,
27
+ 'outline--error': errorMessage,
28
+ 'input--dense': isDense,
29
+ 'input--not-dense': !isDense,
30
+ }"
28
31
  />
29
32
  </template>
30
33
  </VcsTooltip>
@@ -41,18 +44,77 @@
41
44
  }
42
45
  }
43
46
  }
44
- .primary--textarea {
45
- ::v-deep {
46
- textarea {
47
- color: var(--v-primary-base);
47
+ .remove-outline {
48
+ ::v-deep {
49
+ fieldset {
50
+ border-width: 0;
51
+ border-radius: 0;
52
+ }
53
+ }
54
+ }
55
+ .outline--current {
56
+ ::v-deep {
57
+ .v-input__slot fieldset {
58
+ border-color: currentColor;
59
+ transition: border-color 0.5s ease;
60
+ }
61
+ .v-text-field__slot textarea {
62
+ border-color: transparent;
63
+ }
64
+ }
65
+ }
66
+ .outline--error {
67
+ ::v-deep {
68
+ .v-input__slot fieldset, .v-text-field__slot textarea {
69
+ border-color: var(--v-error-base);
70
+ }
71
+ }
72
+ }
73
+ .input--dense {
74
+ ::v-deep {
75
+ .v-input__slot {
76
+ padding: 0 4px !important;
77
+ }
78
+ fieldset {
79
+ padding-left: 2px;
80
+ }
81
+ }
82
+ }
83
+ .input--not-dense {
84
+ ::v-deep {
85
+ .v-input__slot {
86
+ padding: 0 8px !important;
87
+ }
88
+ fieldset {
89
+ padding-left: 6px;
90
+ }
91
+ }
92
+ }
93
+ .v-input {
94
+ ::v-deep {
95
+ textarea {
96
+ border-bottom: 1px solid var(--v-base-base);
97
+ border-radius: 0;
98
+ }
99
+ textarea::selection {
100
+ background-color: var(--v-primary-base);
101
+ }
102
+ fieldset {
103
+ border-radius: 2px;
104
+ border-color: var(--v-base-base);
105
+ }
106
+ .v-text-field__slot {
107
+ margin-right: 0 !important;
108
+ }
48
109
  }
49
110
  }
50
- }
51
111
  </style>
52
112
 
53
113
  <script>
114
+ import { computed, ref } from 'vue';
54
115
  import { VTextarea } from 'vuetify/lib';
55
116
  import VcsTooltip from '../notification/VcsTooltip.vue';
117
+ import { useErrorSync } from './composables.js';
56
118
 
57
119
  /**
58
120
  * @description extends API of {@link https://vuetifyjs.com/en/api/v-textarea/|vuetify v-textarea}.
@@ -82,51 +144,30 @@
82
144
  default: 'right',
83
145
  },
84
146
  },
85
- data() {
147
+ setup(props, { attrs }) {
148
+ const hover = ref(false);
149
+ const focus = ref(false);
150
+ const textAreaRef = ref();
151
+
152
+ const errorMessage = useErrorSync(textAreaRef);
153
+
154
+ const isClearable = computed(() => {
155
+ return (attrs.clearable !== undefined && attrs.clearable !== false) &&
156
+ (hover.value || focus.value || errorMessage.value);
157
+ });
158
+ const isDense = computed(() => attrs.dense !== false);
159
+ const isOutlined = computed(() => {
160
+ return (hover.value || focus.value || errorMessage.value) && !(attrs.disabled || attrs.disabled === '');
161
+ });
86
162
  return {
87
- hover: false,
88
- focus: false,
89
- firstInput: false,
90
- neverBlurred: true,
91
- isMounted: false,
92
- errorMessage: '',
163
+ hover,
164
+ focus,
165
+ textAreaRef,
166
+ errorMessage,
167
+ isClearable,
168
+ isDense,
169
+ isOutlined,
93
170
  };
94
171
  },
95
- computed: {
96
- isClearable() {
97
- return (this.$attrs.clearable !== undefined && this.$attrs.clearable !== false) &&
98
- (this.hover || this.focus || this.isError);
99
- },
100
- isDense() {
101
- return this.$attrs.dense !== undefined && this.$attrs.dense !== false;
102
- },
103
- isError() {
104
- return this.joinedErrorBucket.length > 0 && (this.firstInput || !this.neverBlurred);
105
- },
106
- isOutlined() {
107
- return (this.hover || this.focus || this.isError) && !(this.$attrs.disabled || this.$attrs.disabled === '');
108
- },
109
- joinedErrorBucket() {
110
- if (!this.isMounted) {
111
- return false;
112
- } else {
113
- return this.$refs.textAreaRef.errorBucket.concat(this.$refs.textAreaRef.errorMessages).join('\n');
114
- }
115
- },
116
- },
117
- watch: {
118
- joinedErrorBucket(newValue, oldValue) {
119
- if (oldValue && !newValue) {
120
- setTimeout(() => {
121
- this.errorMessage = newValue;
122
- }, 200);
123
- } else {
124
- this.errorMessage = newValue;
125
- }
126
- },
127
- },
128
- mounted() {
129
- this.isMounted = true;
130
- },
131
172
  };
132
173
  </script>
@@ -6,26 +6,36 @@
6
6
  <VcsTooltip
7
7
  :tooltip-position="tooltipPosition"
8
8
  :tooltip="errorMessage"
9
- :value="(hover || focus) && isError"
10
9
  color="error"
11
10
  :max-width="200"
12
11
  >
13
- <template #activator="{ attrs }">
12
+ <template #activator="{ attrs, on }">
14
13
  <component
15
14
  :is="inputComponent"
16
15
  ref="textFieldRef"
17
16
  hide-details
17
+ :hide-spin-buttons="!showSpinButtons"
18
18
  :dense="isDense"
19
19
  :clearable="isClearable"
20
- @focus="focus = true"
21
- @blur="focus = neverBlurred = false"
22
- @input="firstInput = true"
23
- :outlined="isOutlined"
20
+ @focus="onFocus"
21
+ @blur="onBlur"
22
+ @keydown.esc="onEscape"
23
+ @keydown="$emit('keydown', $event)"
24
+ :value="visibleValue"
25
+ :type="type"
26
+ outlined
24
27
  v-bind="{...$attrs, ...attrs}"
25
- v-on="{...$listeners}"
28
+ v-on="{...$listeners, ...on}"
26
29
  :height="isDense ? 24 : 32"
27
- class="ma-0 pb-1 pt-1 primary--placeholder align-center"
28
- :class="$attrs.color === 'primary' ? 'primary--textfield' : ''"
30
+ class="py-1 primary--placeholder align-center"
31
+ :class="{
32
+ 'remove-outline': !isOutlined,
33
+ 'outline--current': focus,
34
+ 'outline--error': !!errorMessage,
35
+ 'input--dense': isDense,
36
+ 'input--not-dense': !isDense,
37
+ 'file-border-bottom': inputComponent === 'VFileInput' && !focus && !hover && !errorMessage,
38
+ }"
29
39
  />
30
40
  </template>
31
41
  </VcsTooltip>
@@ -33,27 +43,101 @@
33
43
  </template>
34
44
 
35
45
  <style lang="scss" scoped>
36
- .primary--placeholder {
37
- ::v-deep {
38
- input::placeholder {
39
- color: var(--v-primary-base);
40
- font-style: italic;
41
- opacity: 1;
46
+ .primary--placeholder {
47
+ ::v-deep {
48
+ input::placeholder {
49
+ color: var(--v-primary-base);
50
+ font-style: italic;
51
+ opacity: 1;
52
+ }
42
53
  }
43
54
  }
44
- }
45
- .primary--textfield {
46
- ::v-deep {
47
- input {
48
- color: var(--v-primary-base);
55
+ .remove-outline {
56
+ ::v-deep {
57
+ fieldset {
58
+ border-width: 0;
59
+ border-radius: 0;
60
+ }
61
+ }
62
+ }
63
+ .outline--current {
64
+ ::v-deep {
65
+ .v-input__slot fieldset {
66
+ border-color: currentColor;
67
+ transition: border-color 0.5s ease;
68
+ }
69
+ .v-text-field__slot input {
70
+ border-color: transparent;
71
+ }
72
+ }
73
+ }
74
+ .outline--error {
75
+ ::v-deep {
76
+ .v-input__slot fieldset, .v-text-field__slot input {
77
+ border-color: var(--v-error-base);
78
+ }
79
+ }
80
+ }
81
+ .input--dense {
82
+ ::v-deep {
83
+ .v-text-field__slot input {
84
+ height: 24px;
85
+ }
86
+ .v-input__slot {
87
+ padding: 0 4px !important;
88
+ }
89
+ fieldset {
90
+ padding-left: 2px;
91
+ }
92
+ }
93
+ }
94
+ .input--not-dense {
95
+ ::v-deep {
96
+ .v-input__slot {
97
+ padding: 0 8px !important;
98
+ }
99
+ fieldset {
100
+ padding-left: 6px;
101
+ }
102
+ }
103
+ }
104
+ .file-border-bottom {
105
+ ::v-deep {
106
+ .v-file-input__text {
107
+ border-bottom: 1px solid var(--v-base-base);
108
+ border-radius: 0;
109
+ }
110
+ }
111
+ }
112
+ .v-input {
113
+ ::v-deep {
114
+ input {
115
+ height: 32px;
116
+ border-bottom: 1px solid var(--v-base-base);
117
+ border-radius: 0;
118
+ }
119
+ input::selection {
120
+ background-color: var(--v-primary-base);
121
+ }
122
+ .v-text-field__prefix {
123
+ padding-right: 8px;
124
+ }
125
+ .v-text-field__suffix {
126
+ padding-left: 4px;
127
+ }
128
+ fieldset {
129
+ border-radius: 2px;
130
+ border-color: var(--v-base-base);
131
+ }
49
132
  }
50
133
  }
51
- }
52
134
  </style>
53
135
 
54
136
  <script>
137
+ import { computed, onMounted, ref } from 'vue';
55
138
  import { VTextField, VFileInput } from 'vuetify/lib';
56
139
  import VcsTooltip from '../notification/VcsTooltip.vue';
140
+ import { useErrorSync } from './composables.js';
57
141
 
58
142
  /**
59
143
  * @description extends API of {@link https://vuetifyjs.com/en/api/v-text-field v-text-field}.
@@ -63,12 +147,15 @@
63
147
  * Provides VcsTooltip to
64
148
  * - show error messages on focus
65
149
  * - show tooltips, if supplied, when hovered over append-icon
150
+ * When clicking esc key, previous input is restored.
66
151
  * @vue-prop {('bottom' | 'left' | 'top' | 'right')} [tooltipPosition='right'] - Position of the error tooltip.
152
+ * @vue-prop {string} unit - Unit for number input fields. Is displayed behind the number.
153
+ * @vue-prop {boolean} showSpinButtons - If true, spin buttons are displayed in number input fields. Overrides Vuetify hide-spin-buttons.
67
154
  * @vue-computed {boolean} isClearable - Whether textfield is isClearable. Makes sure icon is only shown on focus, hover or error.
68
155
  * @vue-computed {boolean} isDense - Whether size of textfield is dense.
69
- * @vue-computed {boolean} isError - Whether errorBucket is not empty and textfield was focused at least once.
70
156
  * @vue-computed {boolean} isOutlined - Textfield is outlined on either hover, focus or error, if not disabled.
71
- * @vue-computed {Array<string>} joinedErrorBucket - errorBucket + errorMessages of child v-text-field.
157
+ * @vue-computed {string | number} visibleValue - Returns the number input as string with unit, in case unit is provided.
158
+ * @vue-computed {string} type - The input field type. If number input field is blurred and unit is provided, type changes to text field, so unit can be displayed in input field.
72
159
  */
73
160
  export default {
74
161
  name: 'VcsTextField',
@@ -82,60 +169,86 @@
82
169
  type: String,
83
170
  default: 'right',
84
171
  },
172
+ unit: {
173
+ type: String,
174
+ default: '',
175
+ },
176
+ showSpinButtons: {
177
+ type: Boolean,
178
+ default: false,
179
+ },
85
180
  },
86
- data() {
87
- return {
88
- hover: false,
89
- focus: false,
90
- firstInput: false,
91
- neverBlurred: true,
92
- isMounted: false,
93
- errorMessage: '',
94
- };
95
- },
96
- computed: {
97
- inputComponent() {
98
- if (this.$attrs.type === 'file') {
181
+ setup(props, { attrs, emit }) {
182
+ const hover = ref(false);
183
+ const focus = ref(false);
184
+ const textFieldRef = ref();
185
+
186
+ onMounted(() => {
187
+ // fix for autofocus
188
+ focus.value = attrs.autofocus != null;
189
+ });
190
+
191
+ const errorMessage = useErrorSync(textFieldRef);
192
+
193
+ const inputComponent = computed(() => {
194
+ if (attrs.type === 'file') {
99
195
  return 'VFileInput';
100
196
  }
101
197
  return 'VTextField';
102
- },
103
- isClearable() {
104
- return (this.$attrs.clearable !== undefined && this.$attrs.clearable !== false) &&
105
- (this.hover || this.focus || this.isError);
106
- },
107
- isDense() {
108
- return this.$attrs.dense !== undefined && this.$attrs.dense !== false;
109
- },
110
- isError() {
111
- return this.joinedErrorBucket.length > 0 && (this.firstInput || !this.neverBlurred);
112
- },
113
- isOutlined() {
114
- return (this.$attrs.outlined || this.hover || this.focus || this.isError) && !(this.$attrs.disabled || this.$attrs.disabled === '');
115
- },
116
- joinedErrorBucket() {
117
- if (!this.isMounted) {
118
- return false;
198
+ });
199
+ const isClearable = computed(() => {
200
+ return (attrs.clearable !== undefined && attrs.clearable !== false) &&
201
+ (hover.value || focus.value || !!errorMessage.value);
202
+ });
203
+ const isDense = computed(() => attrs.dense !== false);
204
+ const isOutlined = computed(() => {
205
+ return (hover.value || focus.value || !!errorMessage.value) && !(attrs.disabled || attrs.disabled === '');
206
+ });
207
+ const visibleValue = computed(() => {
208
+ if (attrs.type === 'number' && attrs.value && props.unit && !focus.value && !hover.value) {
209
+ return `${attrs.value} ${props.unit}`;
119
210
  } else {
120
- return this.$refs.textFieldRef.errorBucket.concat(this.$refs.textFieldRef.errorMessages).join('\n');
211
+ return attrs.value || '';
121
212
  }
122
- },
123
- },
124
- watch: {
125
- joinedErrorBucket(newValue, oldValue) {
126
- if (oldValue && !newValue) {
127
- setTimeout(() => {
128
- this.errorMessage = newValue;
129
- }, 200);
213
+ });
214
+ const type = computed(() => {
215
+ if (attrs.type === 'number' && !focus.value) {
216
+ return 'text';
130
217
  } else {
131
- this.errorMessage = newValue;
218
+ return attrs.type || 'text';
132
219
  }
133
- },
134
- },
135
- mounted() {
136
- this.isMounted = true;
137
- // fix for autofocus
138
- this.focus = this.$attrs.autofocus != null;
220
+ });
221
+
222
+ function onEscape(event) {
223
+ textFieldRef.value.blur();
224
+ emit('input', textFieldRef.value.initialValue);
225
+ emit('keydown', event);
226
+ }
227
+
228
+ function onBlur(event) {
229
+ focus.value = false;
230
+ emit('blur', event);
231
+ }
232
+ function onFocus(event) {
233
+ focus.value = true;
234
+ emit('focus', event);
235
+ }
236
+
237
+ return {
238
+ hover,
239
+ focus,
240
+ inputComponent,
241
+ isClearable,
242
+ isDense,
243
+ isOutlined,
244
+ visibleValue,
245
+ type,
246
+ onEscape,
247
+ textFieldRef,
248
+ errorMessage,
249
+ onBlur,
250
+ onFocus,
251
+ };
139
252
  },
140
253
  };
141
254
  </script>
@@ -3,6 +3,7 @@
3
3
  vertical
4
4
  :value="value"
5
5
  @change="newValue => $emit('input', newValue)"
6
+ class="rounded-0"
6
7
  >
7
8
  <slot />
8
9
  </v-stepper>
@@ -32,21 +33,28 @@
32
33
  };
33
34
  </script>
34
35
  <style scoped lang="scss">
36
+ @import '../../styles/shades.scss';
35
37
  .v-stepper{
36
38
  &.theme--light {
37
39
  ::v-deep{
38
40
  .v-stepper__step {
41
+ .v-stepper__label {
42
+ color: map-get($shades, 'black');
43
+ }
39
44
  &--active {
40
45
  background-color: rgba(34, 34, 34, 0.1);
41
46
  .v-stepper__label {
42
- color: rgba(34, 34, 34, 0.8);
47
+ color: var(--v-primary-base);
43
48
  }
44
49
  }
45
50
  &--complete {
46
51
  .v-stepper__label {
47
- color: rgba(0, 0, 0, 0.38);
52
+ color: map-get($shades, 'black');
48
53
  }
49
54
  }
55
+ .v-stepper__step__step::before {
56
+ color: map-get($shades, 'white');
57
+ }
50
58
  }
51
59
  .step-border:not(:last-child) > .v-stepper__content {
52
60
  border-left: 2px solid rgba(0, 0, 0, 0.12);
@@ -54,23 +62,30 @@
54
62
  }
55
63
  }
56
64
  &.theme--dark {
65
+ background: map-get($shades, 'black');
57
66
  ::v-deep{
58
67
  .v-stepper__step {
68
+ .v-stepper__label {
69
+ color: map-get($shades, 'white');
70
+ }
59
71
  &--active {
60
- background-color: rgba(255, 255, 255, 0.5);
72
+ background-color: rgba(255, 255, 255, 0.17);
61
73
  .v-stepper__label {
62
- color: rgba(255, 255, 255, 1);
74
+ color: var(--v-primary-base);
63
75
  }
64
76
  }
65
77
  &--complete {
66
78
  .v-stepper__label {
67
- color: rgba(255, 255, 255, 0.5);
79
+ color: map-get($shades, 'white');
68
80
  }
69
81
  }
70
82
  .v-stepper__step__step {
71
83
  .v-icon {
72
84
  color: transparent;
73
85
  }
86
+ &:before{
87
+ color: map-get($shades, 'black');
88
+ }
74
89
  }
75
90
  &.v-stepper__step--error{
76
91
  .v-stepper__label{
@@ -88,26 +103,19 @@
88
103
  }
89
104
  ::v-deep{
90
105
  .v-stepper__step {
91
- align-items: start;
106
+ padding-top: 0;
107
+ padding-bottom: 0;
92
108
  .v-stepper__label {
93
109
  font-weight: 700;
94
110
  text-shadow: none !important;
95
- position: relative;
96
- &::before{
97
- content: '';
98
- position: absolute;
99
- top: 14px;
100
- bottom: 2px;
101
- left: -15px;
102
- }
103
111
  }
104
112
  .v-stepper__step__step {
105
113
  color: transparent;
106
114
  position: relative;
107
115
  margin-top: 2px;
116
+ margin-right: 5px;
108
117
  &:before{
109
118
  content: '\25cf';
110
- color: var(--v-basic-base);
111
119
  font-size: 18px;
112
120
  position: absolute;
113
121
  top: -9px;
@@ -5,12 +5,15 @@
5
5
  :editable="editable"
6
6
  :complete="complete"
7
7
  :rules="rules"
8
+ class="pr-6"
8
9
  >
9
- <div class="form-section-header d-flex justify-space-between align-center">
10
+ <div class="d-flex justify-space-between align-center">
10
11
  <slot name="header" />
11
- <span v-if="!$slots.header">{{ $t(heading) }}</span>
12
+ <div v-if="!$slots.header" class="py-3">
13
+ <span>{{ $t(heading) }}</span>
14
+ </div>
12
15
  <VcsActionButtonList
13
- v-if="editable || Number(step) === Number(value)"
16
+ v-if="Number(step) === Number(value)"
14
17
  :actions="actions"
15
18
  :overflow-count="actionButtonListOverflowCount"
16
19
  small
@@ -22,20 +25,15 @@
22
25
  </v-stepper-step>
23
26
  <v-stepper-content
24
27
  v-if="$slots.content"
25
- class="pr-5"
28
+ class="pr-4"
26
29
  :step="step"
27
30
  >
28
- <v-alert
29
- :value="showHelp"
30
- dense
31
- text
32
- color="grey"
33
- class="mt-2 mb-0 font-weight-regular rounded-0 px-0 pt-0"
31
+ <VcsHelp
32
+ :text="helpText"
33
+ :show="showHelp"
34
34
  >
35
- <slot name="help">
36
- <span>{{ $t(helpText) }}</span>
37
- </slot>
38
- </v-alert>
35
+ <slot name="help" />
36
+ </VcsHelp>
39
37
  <slot name="content" />
40
38
  </v-stepper-content>
41
39
  </div>
@@ -43,8 +41,9 @@
43
41
 
44
42
  <script>
45
43
  import { computed, reactive, watch } from 'vue';
46
- import { VStepperStep, VStepperContent, VAlert } from 'vuetify/lib';
44
+ import { VStepperStep, VStepperContent } from 'vuetify/lib';
47
45
  import VcsActionButtonList from '../buttons/VcsActionButtonList.vue';
46
+ import VcsHelp from '../notification/VcsHelp.vue';
48
47
 
49
48
  /**
50
49
  * @description Stylized wrapper around {@link https://vuetifyjs.com/en/api/v-stepper-step/ |vuetify VStepperStep} and
@@ -68,7 +67,7 @@
68
67
  VStepperStep,
69
68
  VStepperContent,
70
69
  VcsActionButtonList,
71
- VAlert,
70
+ VcsHelp,
72
71
  },
73
72
  props: {
74
73
  step: {
@@ -157,4 +156,7 @@
157
156
  }
158
157
  }
159
158
  }
159
+ .v-stepper__content {
160
+ padding-left: 2px !important;
161
+ }
160
162
  </style>