comand-component-library 3.1.65 → 3.1.68
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/dist/comand-component-library.css +1 -1
- package/dist/comand-component-library.umd.min.js +1 -1
- package/package.json +1 -1
- package/src/App.vue +59 -24
- package/src/assets/data/box-user.json +0 -8
- package/src/assets/data/cookie-disclaimer.json +3 -3
- package/src/assets/data/tabs.json +6 -3
- package/src/components/CmdBox.vue +18 -5
- package/src/components/CmdCompanyLogo.vue +4 -4
- package/src/components/CmdCookieDisclaimer.vue +88 -101
- package/src/components/CmdCustomHeadline.vue +3 -3
- package/src/components/CmdFakeSelect.vue +12 -2
- package/src/components/CmdFormElement.vue +44 -20
- package/src/components/CmdFormFilters.vue +1 -1
- package/src/components/CmdInputGroup.vue +38 -0
- package/src/components/CmdListOfLinks.vue +6 -4
- package/src/components/CmdLoginForm.vue +3 -3
- package/src/components/CmdProgressBar.vue +1 -0
- package/src/components/CmdSiteHeader.vue +4 -2
- package/src/components/CmdTabs.vue +1 -1
- package/src/components/CmdUploadForm.vue +124 -98
- package/src/mixins/CmdUploadForm/DefaultMessageProperties.js +1 -1
- package/src/mixins/FieldValidation.js +1 -1
- package/src/utils/common.js +10 -1
@@ -1,5 +1,5 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
2
|
+
<div :class="['cmd-custom-headline', { 'has-pre-headline-text': preHeadlineText}]">
|
3
3
|
<span v-if="iconClass" :class="iconClass"></span>
|
4
4
|
<div v-if="preHeadlineText">
|
5
5
|
<span class="pre-headline-text">{{ preHeadlineText }}</span>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<component v-else :is="getHeadlineTag">
|
11
11
|
<slot>{{ headlineText }}</slot>
|
12
12
|
</component>
|
13
|
-
</
|
13
|
+
</div>
|
14
14
|
</template>
|
15
15
|
|
16
16
|
<script>
|
@@ -22,7 +22,7 @@ export default {
|
|
22
22
|
*/
|
23
23
|
headlineText: {
|
24
24
|
type: String,
|
25
|
-
required:
|
25
|
+
required: false
|
26
26
|
},
|
27
27
|
/**
|
28
28
|
* level for headline
|
@@ -8,13 +8,13 @@
|
|
8
8
|
'has-state': validationStatus && validationStatus !== 'none'
|
9
9
|
}
|
10
10
|
]"
|
11
|
-
:aria-labelledby="
|
11
|
+
:aria-labelledby="labelId"
|
12
12
|
:aria-required="$attrs.required !== undefined"
|
13
13
|
ref="fakeselect"
|
14
14
|
>
|
15
15
|
<span v-if="showLabel">
|
16
16
|
<!-- begin label -->
|
17
|
-
<span>
|
17
|
+
<span :id="labelId">
|
18
18
|
{{ labelText }}<sup v-if="$attrs.required !== undefined">*</sup>
|
19
19
|
</span>
|
20
20
|
<!-- end label -->
|
@@ -149,6 +149,9 @@
|
|
149
149
|
</template>
|
150
150
|
|
151
151
|
<script>
|
152
|
+
// import utils
|
153
|
+
import {createUuid} from "../utils/common.js"
|
154
|
+
|
152
155
|
// import mixins
|
153
156
|
import I18n from "../mixins/I18n"
|
154
157
|
import DefaultMessageProperties from "../mixins/CmdBox/DefaultMessageProperties"
|
@@ -327,6 +330,13 @@ export default {
|
|
327
330
|
},
|
328
331
|
selectAllOptionsIcon() {
|
329
332
|
return "icon-check"
|
333
|
+
},
|
334
|
+
// get ID for accessibility
|
335
|
+
labelId() {
|
336
|
+
if(this.$attrs.id !== undefined) {
|
337
|
+
return this.$attrs.id
|
338
|
+
}
|
339
|
+
return "label-" + createUuid()
|
330
340
|
}
|
331
341
|
},
|
332
342
|
mounted() {
|
@@ -13,7 +13,7 @@
|
|
13
13
|
off: colored && !isChecked,
|
14
14
|
'has-state': validationStatus
|
15
15
|
}]"
|
16
|
-
:for="
|
16
|
+
:for="labelId"
|
17
17
|
ref="label">
|
18
18
|
|
19
19
|
<!-- begin label-text (+ required asterisk) -->
|
@@ -50,17 +50,17 @@
|
|
50
50
|
<template
|
51
51
|
v-if="element === 'input' && $attrs.type !== 'checkbox' && $attrs.type !== 'radio' && $attrs.type !== 'search'">
|
52
52
|
<input v-bind="$attrs"
|
53
|
-
:id="
|
53
|
+
:id="labelId"
|
54
54
|
:class="htmlClass"
|
55
55
|
@focus="tooltip = true"
|
56
56
|
@blur="onBlur"
|
57
57
|
@input="onInput"
|
58
58
|
@mouseover="datalistFocus"
|
59
59
|
@keyup="checkForCapsLock"
|
60
|
-
:autocomplete="
|
61
|
-
:list="datalist ? datalist.id :
|
60
|
+
:autocomplete="autocomplete"
|
61
|
+
:list="datalist ? datalist.id : null"
|
62
62
|
:value="modelValue"
|
63
|
-
:maxlength="
|
63
|
+
:maxlength="getMaxLength()"
|
64
64
|
ref="input"
|
65
65
|
/>
|
66
66
|
</template>
|
@@ -92,27 +92,24 @@
|
|
92
92
|
@change="onChange"
|
93
93
|
@blur="onBlur"
|
94
94
|
:checked="isChecked"
|
95
|
-
:role="$attrs.type"
|
96
|
-
:aria-checked="isChecked"
|
97
95
|
:value="inputValue"
|
98
96
|
:class="[htmlClass, validationStatus, { 'replace-input-type': replaceInputType, 'toggle-switch': toggleSwitch }]"
|
99
|
-
:id="
|
97
|
+
:id="labelId"
|
100
98
|
:aria-invalid="validationStatus === 'error'"
|
101
|
-
:aria-describedby="`status-message-${id}`"
|
102
99
|
/>
|
103
|
-
|
104
|
-
<!-- begin labels for toggle-switch -->
|
105
100
|
<span v-if="!(onLabel && offLabel)" :class="{ hidden: !showLabel }">
|
106
101
|
<span v-if="labelText">{{ labelText }}<sup v-if="$attrs.required">*</sup></span>
|
107
102
|
</span>
|
103
|
+
|
104
|
+
<!-- begin labels for toggle-switch -->
|
108
105
|
<template v-else-if="onLabel && offLabel">
|
109
106
|
<span v-if="labelText">
|
110
107
|
<span>{{ labelText }}<sup v-if="$attrs.required">*</sup></span>
|
111
108
|
</span>
|
112
|
-
<
|
109
|
+
<span class="toggle-switch switch-label">
|
113
110
|
<span class="label">{{ onLabel }}</span>
|
114
111
|
<span class="label">{{ offLabel }}</span>
|
115
|
-
</
|
112
|
+
</span>
|
116
113
|
</template>
|
117
114
|
<slot v-else></slot>
|
118
115
|
<!-- end labels for toggle-switch -->
|
@@ -122,7 +119,7 @@
|
|
122
119
|
<!-- begin selectbox -->
|
123
120
|
<select v-if="element === 'select'"
|
124
121
|
v-bind="$attrs"
|
125
|
-
:id="
|
122
|
+
:id="labelId"
|
126
123
|
@blur="onBlur"
|
127
124
|
@change="$emit('update:modelValue', $event.target.value)">
|
128
125
|
<option v-for="(option, index) in selectOptions" :key="index" :value="option.value"
|
@@ -134,9 +131,9 @@
|
|
134
131
|
<!-- begin textarea -->
|
135
132
|
<textarea v-if="element === 'textarea'"
|
136
133
|
v-bind="$attrs"
|
137
|
-
:id="
|
134
|
+
:id="labelId"
|
138
135
|
:value="modelValue"
|
139
|
-
:maxlength="getMaxLength"
|
136
|
+
:maxlength="getMaxLength()"
|
140
137
|
@input="onInput"
|
141
138
|
@focus="tooltip = true"
|
142
139
|
@blur="onBlur">
|
@@ -150,15 +147,15 @@
|
|
150
147
|
<a v-if="iconDelete.show" href="#" @click.prevent="$emit('update:modelValue', '')" :class="iconDelete.iconClass" :title="iconDelete.tooltip"/>
|
151
148
|
<input
|
152
149
|
v-bind="$attrs"
|
153
|
-
:id="
|
150
|
+
:id="labelId"
|
154
151
|
@input="onInput"
|
155
152
|
:maxlength="$attrs.maxlength > 0 ? $attrs.maxlength : 255"
|
156
153
|
:value="modelValue"
|
157
154
|
/>
|
158
155
|
</div>
|
159
|
-
<
|
156
|
+
<a v-if="showSearchButton" href="#" class="button no-flex" :title="iconSearch.tooltip" @click.prevent="executeSearch">
|
160
157
|
<span :class="iconSearch.iconClass"></span>
|
161
|
-
</
|
158
|
+
</a>
|
162
159
|
</template>
|
163
160
|
</label>
|
164
161
|
<!-- end searchfield -->
|
@@ -215,6 +212,9 @@
|
|
215
212
|
</template>
|
216
213
|
|
217
214
|
<script>
|
215
|
+
// import utils
|
216
|
+
import {createUuid} from "../utils/common.js"
|
217
|
+
|
218
218
|
// import mixins
|
219
219
|
import I18n from "../mixins/I18n"
|
220
220
|
import DefaultMessageProperties from "../mixins/CmdBox/DefaultMessageProperties"
|
@@ -631,6 +631,19 @@ export default {
|
|
631
631
|
return this.getMessage("cmdformelement.validationTooltip.caps_lock_is_activated")
|
632
632
|
}
|
633
633
|
return this.getMessage("cmdformelement.validationTooltip.open_field_requirements")
|
634
|
+
},
|
635
|
+
autocomplete() {
|
636
|
+
if(this.$attrs.type !== 'file') {
|
637
|
+
return this.datalist ? 'off' : 'on'
|
638
|
+
}
|
639
|
+
return null
|
640
|
+
},
|
641
|
+
// get ID for accessibility
|
642
|
+
labelId() {
|
643
|
+
if(this.$attrs.id !== undefined) {
|
644
|
+
return this.$attrs.id
|
645
|
+
}
|
646
|
+
return "label-" + createUuid()
|
634
647
|
}
|
635
648
|
},
|
636
649
|
methods: {
|
@@ -638,7 +651,15 @@ export default {
|
|
638
651
|
return this.$refs.label
|
639
652
|
},
|
640
653
|
getMaxLength() {
|
641
|
-
|
654
|
+
if (this.$attrs.element === 'textarea') {
|
655
|
+
return this.$attrs.maxlength > 0 ? this.$attrs.maxlength : 5000
|
656
|
+
}
|
657
|
+
|
658
|
+
if (this.$attrs.type !== 'file') {
|
659
|
+
return this.$attrs.maxlength > 0 ? this.$attrs.maxlength : 255
|
660
|
+
}
|
661
|
+
|
662
|
+
return null
|
642
663
|
},
|
643
664
|
onBlur(event) {
|
644
665
|
// check if surrounding form with data-use-validation exists
|
@@ -711,6 +732,9 @@ export default {
|
|
711
732
|
hidePassword() {
|
712
733
|
this.$refs.input.nextElementSibling.classList.replace(this.iconPasswordInvisible.iconClass, this.iconPasswordVisible.iconClass)
|
713
734
|
this.$refs.input.setAttribute("type", "password")
|
735
|
+
},
|
736
|
+
executeSearch() {
|
737
|
+
this.$emit("search", this.value)
|
714
738
|
}
|
715
739
|
},
|
716
740
|
watch: {
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="cmd-input-group">
|
3
|
+
<span :class="['label', { hidden: !showLabel, inline: labelInline }]">{{ labelText }}</span>
|
4
|
+
<div class="flex-container no-flex">
|
5
|
+
<slot></slot>
|
6
|
+
</div>
|
7
|
+
</div>
|
8
|
+
</template>
|
9
|
+
|
10
|
+
<script>
|
11
|
+
export default {
|
12
|
+
props: {
|
13
|
+
/**
|
14
|
+
* toggle label-text visibility
|
15
|
+
*/
|
16
|
+
showLabel: {
|
17
|
+
type: Boolean,
|
18
|
+
default: true
|
19
|
+
},
|
20
|
+
/**
|
21
|
+
* label-text for input-group
|
22
|
+
*
|
23
|
+
* @requiredForAccessibility: true
|
24
|
+
*/
|
25
|
+
labelText: {
|
26
|
+
type: String,
|
27
|
+
required: true
|
28
|
+
},
|
29
|
+
/**
|
30
|
+
* toggle label-position (inline/left of input-elements or above input-elements)
|
31
|
+
*/
|
32
|
+
labelInline: {
|
33
|
+
type: Boolean,
|
34
|
+
default: false
|
35
|
+
}
|
36
|
+
}
|
37
|
+
}
|
38
|
+
</script>
|
@@ -137,6 +137,7 @@ export default {
|
|
137
137
|
ul {
|
138
138
|
flex-direction: column;
|
139
139
|
gap: calc(var(--default-gap) / 2);
|
140
|
+
margin: 0;
|
140
141
|
|
141
142
|
li {
|
142
143
|
list-style: none;
|
@@ -145,23 +146,24 @@ export default {
|
|
145
146
|
}
|
146
147
|
|
147
148
|
&.horizontal {
|
149
|
+
flex-direction: row;
|
150
|
+
|
148
151
|
ul {
|
149
|
-
flex-direction: row;
|
150
152
|
gap: var(--default-gap);
|
153
|
+
flex-direction: row;
|
151
154
|
|
152
155
|
> li {
|
153
156
|
flex: none;
|
154
157
|
display: flex;
|
155
|
-
align-items: center;
|
156
158
|
}
|
157
159
|
}
|
158
160
|
|
159
161
|
&.align-center {
|
160
|
-
|
162
|
+
justify-content: center;
|
161
163
|
}
|
162
164
|
|
163
165
|
&.align-right {
|
164
|
-
|
166
|
+
justify-content: flex-end;
|
165
167
|
}
|
166
168
|
}
|
167
169
|
}
|
@@ -16,7 +16,7 @@
|
|
16
16
|
:name="cmdFormElementUsername.name"
|
17
17
|
:id="cmdFormElementUsername.id"
|
18
18
|
v-model="username"
|
19
|
-
:
|
19
|
+
:fieldIconClass="cmdFormElementUsername.innerIconClass"
|
20
20
|
:labelText="cmdFormElementUsername.labelText"
|
21
21
|
:placeholder="cmdFormElementUsername.placeholder"
|
22
22
|
/>
|
@@ -28,7 +28,7 @@
|
|
28
28
|
type="password"
|
29
29
|
:name="cmdFormElementPassword.name"
|
30
30
|
:id="cmdFormElementPassword.id"
|
31
|
-
:
|
31
|
+
:fieldIconClass="cmdFormElementPassword.innerIconClass"
|
32
32
|
v-model="password"
|
33
33
|
:labelText="cmdFormElementPassword.labelText"
|
34
34
|
:placeholder="cmdFormElementPassword.placeholder"
|
@@ -133,7 +133,7 @@
|
|
133
133
|
<CmdFormElement
|
134
134
|
element="input"
|
135
135
|
type="email"
|
136
|
-
:
|
136
|
+
:fieldIconClass="cmdFormElementSendLogin.innerIconClass"
|
137
137
|
:labelText="cmdFormElementSendLogin.labelText"
|
138
138
|
:placeholder="cmdFormElementSendLogin.placeholder"
|
139
139
|
:name="cmdFormElementSendLogin.name"
|
@@ -72,7 +72,6 @@ export default {
|
|
72
72
|
grid-area: site-header;
|
73
73
|
display: flex;
|
74
74
|
flex-direction: column;
|
75
|
-
gap: var(--default-gap);
|
76
75
|
border-bottom: var(--default-border);
|
77
76
|
background: var(--pure-white);
|
78
77
|
|
@@ -81,8 +80,9 @@ export default {
|
|
81
80
|
z-index: 300;
|
82
81
|
}
|
83
82
|
|
84
|
-
header, .cmd-main-navigation nav, .cmd-
|
83
|
+
header, .cmd-main-navigation nav, .cmd-list-of-links > ul {
|
85
84
|
max-width: var(--max-width);
|
85
|
+
width: 100%; /* stretch flex-item */
|
86
86
|
margin: 0 auto;
|
87
87
|
padding: 0 var(--default-padding);
|
88
88
|
}
|
@@ -92,6 +92,8 @@ export default {
|
|
92
92
|
}
|
93
93
|
|
94
94
|
header {
|
95
|
+
padding: calc(var(--default-padding) * 2) 0;
|
96
|
+
|
95
97
|
&.flex-container {
|
96
98
|
width: 100%;
|
97
99
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<template>
|
2
2
|
<div class="cmd-tabs">
|
3
|
-
<ul :class="{'stretch-tabs' : stretchTabs}">
|
3
|
+
<ul :class="{'stretch-tabs' : stretchTabs}" role="tablist">
|
4
4
|
<li :class="{active : showTab === index}" v-for="(tab, index) in tabs" :key="index" role="tab">
|
5
5
|
<a @click.prevent="setActiveTab(index)" :title="!tab.name ? tab.tooltip : false">
|
6
6
|
<span v-if="tab.iconClass">{{ tab.iconClass }}</span>
|