@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.
- package/README.md +2 -2
- package/app.config.json +5 -0
- package/build/buildHelpers.js +1 -0
- package/build/buildPreview.js +2 -2
- package/build/commonViteConfig.js +1 -0
- package/config/aerowest.config.json +2 -0
- package/config/base.config.json +1 -0
- package/config/codes.config.json +2 -0
- package/config/dev.config.json +6 -0
- package/config/graphFeatureInfo.config.json +3 -1
- package/config/projects.config.json +27 -0
- package/config/www.config.json +27 -14
- package/dist/assets/cesium.js +1 -1
- package/dist/assets/{core.59d4d1.js → core.9342a1.js} +7912 -5474
- package/dist/assets/core.js +1 -1
- package/dist/assets/favicon.decf54cc.svg +10 -0
- package/dist/assets/index.fd041928.js +1 -0
- package/dist/assets/{ol.c1c512.js → ol.d2cba3.js} +12406 -12152
- package/dist/assets/ol.js +1 -1
- package/dist/assets/ui.c27597.css +5 -0
- package/dist/assets/{ui.80175f.js → ui.c27597.js} +6508 -5169
- package/dist/assets/ui.js +1 -1
- package/dist/assets/vue.js +2 -2
- package/dist/assets/vuetify.2f1432.css +5 -0
- package/dist/assets/{vuetify.efc158.js → vuetify.2f1432.js} +1 -1
- package/dist/assets/vuetify.js +2 -2
- package/dist/index.html +6 -1
- package/index.html +5 -0
- package/index.js +7 -3
- package/lib/olLib.js +15 -1
- package/package.json +5 -4
- package/plugins/@vcmap/project-selector/{ContextsListComponent.vue → ModulesListComponent.vue} +10 -10
- package/plugins/@vcmap/project-selector/ProjectSelectorComponent.vue +16 -16
- package/plugins/@vcmap/project-selector/README.md +15 -21
- package/plugins/@vcmap/project-selector/config.json +3 -3
- package/plugins/@vcmap/project-selector/de.json +3 -0
- package/plugins/@vcmap/project-selector/en.json +3 -0
- package/plugins/@vcmap/project-selector/index.js +76 -101
- package/plugins/@vcmap/simple-graph/index.js +1 -1
- package/plugins/@vcmap/theme-changer/ThemeChangerComponent.vue +10 -4
- package/plugins/@vcmap-show-case/category-tester/Categories.vue +2 -2
- package/plugins/@vcmap-show-case/category-tester/Category.vue +1 -4
- package/plugins/@vcmap-show-case/config-editor/editor.vue +14 -14
- package/plugins/@vcmap-show-case/form-inputs-example/FormInputsExample.vue +92 -81
- package/plugins/@vcmap-show-case/form-inputs-example/index.js +8 -3
- package/plugins/@vcmap-show-case/form-inputs-example/validation.js +1 -1
- package/plugins/@vcmap-show-case/list-example/ListExample.vue +5 -2
- package/plugins/@vcmap-show-case/table-example/DataTableExample.vue +202 -0
- package/plugins/@vcmap-show-case/table-example/README.md +3 -0
- package/plugins/@vcmap-show-case/table-example/index.js +47 -0
- package/plugins/@vcmap-show-case/table-example/package.json +5 -0
- package/plugins/@vcmap-show-case/wizard-example/wizardExample.vue +57 -23
- package/plugins/package.json +2 -1
- package/src/actions/actionHelper.js +16 -27
- package/src/actions/styleSelector.vue +26 -19
- package/src/application/VcsApp.vue +13 -5
- package/src/application/VcsAttributions.vue +2 -3
- package/src/application/VcsAttributionsFooter.vue +10 -16
- package/src/application/VcsNavbar.vue +1 -2
- package/src/application/VcsSettings.vue +21 -8
- package/src/assets/favicon-128.png +0 -0
- package/src/assets/favicon-180.png +0 -0
- package/src/assets/favicon-192.png +0 -0
- package/src/assets/favicon-32.png +0 -0
- package/src/assets/favicon.svg +10 -0
- package/src/components/buttons/VcsButton.vue +2 -3
- package/src/components/form-inputs-controls/VcsCheckbox.vue +46 -26
- package/src/components/form-inputs-controls/VcsDatePicker.vue +111 -0
- package/src/components/form-inputs-controls/VcsFormSection.vue +15 -13
- package/src/components/form-inputs-controls/VcsLabel.vue +10 -1
- package/src/components/form-inputs-controls/VcsRadio.vue +38 -18
- package/src/components/form-inputs-controls/VcsSelect.vue +117 -59
- package/src/components/form-inputs-controls/VcsTextArea.vue +101 -60
- package/src/components/form-inputs-controls/VcsTextField.vue +182 -69
- package/src/components/form-inputs-controls/VcsWizard.vue +23 -15
- package/src/components/form-inputs-controls/VcsWizardStep.vue +18 -16
- package/src/components/form-inputs-controls/composables.js +26 -0
- package/src/components/form-output/VcsFormattedNumber.vue +1 -1
- package/src/components/icons/2DDistanceIcon.vue +0 -3
- package/src/components/icons/3DDistanceIcon.vue +0 -3
- package/src/components/icons/3DHeightIcon.vue +0 -3
- package/src/components/icons/CheckboxCheckedIcon.vue +4 -11
- package/src/components/icons/CheckboxIcon.vue +9 -2
- package/src/components/icons/CheckboxIndeterminateIcon.vue +4 -21
- package/src/components/icons/CommentIcon.vue +1 -5
- package/src/components/icons/LegendIcon.vue +10 -60
- package/src/components/icons/ObliqueViewIcon.vue +6 -8
- package/src/components/icons/SimpleCircleOutlinedIcon.vue +1 -1
- package/src/components/icons/SplitViewIcon.vue +0 -4
- package/src/components/icons/ToolsIcon.vue +2 -4
- package/src/components/lists/VcsActionList.vue +0 -1
- package/src/components/lists/VcsList.vue +30 -30
- package/src/components/lists/VcsTreeview.vue +2 -2
- package/src/components/lists/VcsTreeviewLeaf.vue +3 -9
- package/src/components/lists/VcsTreeviewSearchbar.vue +4 -4
- package/src/components/notification/VcsBadge.vue +6 -2
- package/src/components/notification/VcsHelp.vue +39 -0
- package/src/components/tables/VcsDataTable.vue +386 -0
- package/src/components/tables/VcsTable.vue +55 -254
- package/src/contentTree/contentTreeCollection.js +1 -1
- package/src/contentTree/layerContentTreeItem.js +3 -0
- package/src/downloadHelper.js +49 -0
- package/src/featureInfo/AddressBalloonComponent.vue +1 -1
- package/src/featureInfo/BalloonComponent.vue +21 -15
- package/src/featureInfo/abstractFeatureInfoView.js +1 -1
- package/src/featureInfo/featureInfo.js +27 -9
- package/src/featureInfo/tableFeatureInfoView.js +4 -0
- package/src/i18n/de.js +13 -1
- package/src/i18n/en.js +13 -1
- package/src/i18n/i18nCollection.js +22 -22
- package/src/init.js +90 -7
- package/src/legend/styleLegendItem.vue +24 -2
- package/src/legend/vcsLegend.vue +24 -31
- package/src/manager/categoryManager/CategoryComponent.vue +56 -47
- package/src/manager/categoryManager/CategoryManager.vue +23 -10
- package/src/manager/categoryManager/categoryManager.js +11 -11
- package/src/manager/navbarManager.js +18 -0
- package/src/manager/toolbox/GroupToolboxComponent.vue +2 -3
- package/src/manager/toolbox/SelectToolboxComponent.vue +11 -5
- package/src/manager/toolbox/ToolboxManager.vue +0 -7
- package/src/manager/window/WindowComponent.vue +10 -16
- package/src/manager/window/WindowComponentHeader.vue +6 -4
- package/src/manager/window/WindowManager.vue +14 -15
- package/src/manager/window/windowHelper.js +1 -1
- package/src/manager/window/windowManager.js +18 -7
- package/src/navigation/mapNavCompass.vue +1 -1
- package/src/navigation/mapNavigation.vue +6 -6
- package/src/navigation/obliqueRotation.vue +36 -13
- package/src/navigation/orientationToolsButton.vue +0 -1
- package/src/navigation/overviewMap.js +11 -20
- package/src/navigation/tiltSlider.vue +30 -6
- package/src/navigation/vcsZoomButton.vue +37 -11
- package/src/pluginHelper.js +20 -0
- package/src/search/resultsComponent.vue +0 -1
- package/src/search/search.js +19 -20
- package/src/search/searchComponent.vue +21 -7
- package/src/state.js +6 -6
- package/src/styles/_theming.scss +72 -3
- package/src/styles/_typography.scss +0 -5
- package/src/styles/main.scss +1 -0
- package/src/styles/shades.scss +2 -0
- package/src/styles/variables.scss +40 -4
- package/src/uiConfig.js +4 -3
- package/src/vcsUiApp.js +49 -40
- package/src/vuePlugins/i18n.js +1 -0
- package/src/vuePlugins/vuetify.js +59 -13
- package/start.js +8 -2
- package/dist/assets/index.a3861d4e.js +0 -1
- package/dist/assets/ui.80175f.css +0 -1
- package/dist/assets/vuetify.efc158.css +0 -5
- package/map.config.json +0 -44
- /package/dist/assets/{cesium.49585c.js → cesium.166f91.js} +0 -0
- /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 =
|
21
|
-
@
|
22
|
-
|
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
|
27
|
-
:class="
|
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
|
-
.
|
45
|
-
|
46
|
-
|
47
|
-
|
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
|
-
|
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
|
88
|
-
focus
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
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="
|
21
|
-
@blur="
|
22
|
-
@
|
23
|
-
|
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="
|
28
|
-
:class="
|
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
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
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
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
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 {
|
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
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
};
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
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 (
|
105
|
-
(
|
106
|
-
}
|
107
|
-
isDense()
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
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
|
211
|
+
return attrs.value || '';
|
121
212
|
}
|
122
|
-
}
|
123
|
-
|
124
|
-
|
125
|
-
|
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
|
-
|
218
|
+
return attrs.type || 'text';
|
132
219
|
}
|
133
|
-
}
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
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:
|
47
|
+
color: var(--v-primary-base);
|
43
48
|
}
|
44
49
|
}
|
45
50
|
&--complete {
|
46
51
|
.v-stepper__label {
|
47
|
-
color:
|
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.
|
72
|
+
background-color: rgba(255, 255, 255, 0.17);
|
61
73
|
.v-stepper__label {
|
62
|
-
color:
|
74
|
+
color: var(--v-primary-base);
|
63
75
|
}
|
64
76
|
}
|
65
77
|
&--complete {
|
66
78
|
.v-stepper__label {
|
67
|
-
color:
|
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
|
-
|
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="
|
10
|
+
<div class="d-flex justify-space-between align-center">
|
10
11
|
<slot name="header" />
|
11
|
-
<
|
12
|
+
<div v-if="!$slots.header" class="py-3">
|
13
|
+
<span>{{ $t(heading) }}</span>
|
14
|
+
</div>
|
12
15
|
<VcsActionButtonList
|
13
|
-
v-if="
|
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-
|
28
|
+
class="pr-4"
|
26
29
|
:step="step"
|
27
30
|
>
|
28
|
-
<
|
29
|
-
:
|
30
|
-
|
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
|
-
|
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
|
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
|
-
|
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>
|