comand-component-library 3.1.68 → 3.1.71
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 +2 -2
- package/src/App.vue +271 -173
- package/src/assets/data/list-of-links.json +0 -1
- package/src/assets/fonts/iconfonts/logos-iconfont/icomoon.woff +0 -0
- package/src/assets/fonts/iconfonts/logos-iconfont/selection.json +1 -0
- package/src/assets/styles/global-styles.scss +56 -48
- package/src/assets/styles/logos-iconfont.css +47 -32
- package/src/components/CmdBackToTopButton.vue +1 -1
- package/src/components/CmdBox.vue +54 -28
- package/src/components/CmdBoxSiteSearch.vue +228 -46
- package/src/components/CmdCompanyLogo.vue +37 -12
- package/src/components/CmdCookieDisclaimer.vue +16 -17
- package/src/components/CmdCustomHeadline.vue +1 -1
- package/src/components/CmdFakeSelect.vue +24 -28
- package/src/components/CmdFormElement.vue +157 -141
- package/src/components/CmdInputGroup.vue +132 -4
- package/src/components/CmdLoginForm.vue +4 -2
- package/src/components/CmdMultipleSwitch.vue +14 -2
- package/src/components/CmdMultistepFormProgressBar.vue +2 -2
- package/src/components/CmdProgressBar.vue +2 -2
- package/src/components/CmdSiteHeader.vue +12 -3
- package/src/components/CmdTable.vue +1 -1
- package/src/components/CmdTabs.vue +3 -7
- package/src/components/CmdThumbnailScroller.vue +1 -1
- package/src/components/CmdToggleDarkMode.vue +66 -0
- package/src/components/CmdUploadForm.vue +5 -6
- package/src/index.js +1 -2
- package/src/mixins/CmdFormElement/DefaultMessageProperties.js +1 -1
- package/src/mixins/FieldValidation.js +1 -1
- package/src/mixins/GlobalDefaultMessageProperties.js +1 -2
- package/src/mixins/I18n.js +12 -2
- package/src/utils/{GetFileExtension.js → getFileExtension.js} +0 -0
- package/src/assets/fonts/iconfonts/logos-iconfont/logos-iconfont.json +0 -1
- package/src/components/CmdSwitchButton.vue +0 -181
@@ -21,16 +21,15 @@
|
|
21
21
|
:key="index"
|
22
22
|
>
|
23
23
|
<template v-slot:header>
|
24
|
-
<!-- begin
|
25
|
-
<
|
24
|
+
<!-- begin CmdFormElement -->
|
25
|
+
<CmdFormElement
|
26
|
+
element="input"
|
26
27
|
type="checkbox"
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
:status="cookie.status"
|
31
|
-
disabled="disabled"
|
28
|
+
labelText="Google Analytics"
|
29
|
+
id="google-analytics"
|
30
|
+
:toggleSwitch="true"
|
32
31
|
/>
|
33
|
-
<!-- end
|
32
|
+
<!-- end CmdFormElement -->
|
34
33
|
</template>
|
35
34
|
<template v-slot:body>
|
36
35
|
<p v-if="cookie.description">{{ cookie.description }}</p>
|
@@ -57,15 +56,15 @@
|
|
57
56
|
:key="index"
|
58
57
|
>
|
59
58
|
<template v-slot:header>
|
60
|
-
<!-- begin
|
61
|
-
<
|
59
|
+
<!-- begin CmdFormElement -->
|
60
|
+
<CmdFormElement
|
61
|
+
element="input"
|
62
62
|
type="checkbox"
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
:status="cookie.status"
|
63
|
+
labelText="Google Analytics"
|
64
|
+
id="google-analytics"
|
65
|
+
:toggleSwitch="true"
|
67
66
|
/>
|
68
|
-
<!-- end
|
67
|
+
<!-- end CmdFormElement -->
|
69
68
|
</template>
|
70
69
|
<template v-slot:body>
|
71
70
|
<p v-if="cookie.description">{{ cookie.description }}</p>
|
@@ -107,14 +106,14 @@
|
|
107
106
|
// import components
|
108
107
|
import CmdBox from "./CmdBox"
|
109
108
|
import CmdCustomHeadline from "./CmdCustomHeadline"
|
110
|
-
import
|
109
|
+
import CmdFormElement from "./CmdFormElement"
|
111
110
|
|
112
111
|
export default {
|
113
112
|
name: "CmdCookieDisclaimer",
|
114
113
|
components: {
|
115
114
|
CmdBox,
|
116
115
|
CmdCustomHeadline,
|
117
|
-
|
116
|
+
CmdFormElement
|
118
117
|
},
|
119
118
|
data() {
|
120
119
|
return {
|
@@ -12,24 +12,24 @@
|
|
12
12
|
:aria-required="$attrs.required !== undefined"
|
13
13
|
ref="fakeselect"
|
14
14
|
>
|
15
|
-
<
|
15
|
+
<template v-if="showLabel">
|
16
16
|
<!-- begin label -->
|
17
|
-
<span :id="labelId">
|
18
|
-
{{ labelText }}<sup v-if="$attrs.required !== undefined">*</sup>
|
17
|
+
<span class="label-text" :id="labelId">
|
18
|
+
<span>{{ labelText }}<sup v-if="$attrs.required !== undefined">*</sup></span>
|
19
|
+
<a v-if="$attrs.required || inputRequirements.length"
|
20
|
+
href="#"
|
21
|
+
@click.prevent
|
22
|
+
:class="getStatusIconClass"
|
23
|
+
:title="!useCustomTooltip ? getValidationMessage : ''"
|
24
|
+
:aria-errormessage="getValidationMessage"
|
25
|
+
aria-live="assertive"
|
26
|
+
:id="tooltipId"
|
27
|
+
:role="validationStatus === 'error' ? 'alert' : 'dialog'">
|
28
|
+
</a>
|
19
29
|
</span>
|
20
30
|
<!-- end label -->
|
21
|
-
|
22
|
-
|
23
|
-
@click.prevent
|
24
|
-
:class="getStatusIconClass"
|
25
|
-
:title="!useCustomTooltip ? getValidationMessage : ''"
|
26
|
-
:aria-errormessage="getValidationMessage"
|
27
|
-
aria-live="assertive"
|
28
|
-
:id="tooltipId"
|
29
|
-
:role="validationStatus === 'error' ? 'alert' : 'dialog'">
|
30
|
-
</a>
|
31
|
-
</span>
|
32
|
-
<ul :class="{'open': showOptions}" @clickout="closeOptions">
|
31
|
+
</template>
|
32
|
+
<ul :class="{'open': showOptions}" @clickout="closeOptions" :aria-expanded="showOptions">
|
33
33
|
<li>
|
34
34
|
<!-- begin default/selected-option -->
|
35
35
|
<a href="#" @click.prevent="toggleOptions" @blur="onBlur">
|
@@ -42,8 +42,8 @@
|
|
42
42
|
<!-- end default/selected-option-->
|
43
43
|
|
44
44
|
<!-- begin default dropdown (incl. optional icon) -->
|
45
|
-
<ul v-if="type === 'default' && showOptions"
|
46
|
-
<li v-for="(option, index) in selectData" :key="index" role="option">
|
45
|
+
<ul v-if="type === 'default' && showOptions" role="listbox">
|
46
|
+
<li v-for="(option, index) in selectData" :key="index" role="option" :aria-selected="option.value === modelValue">
|
47
47
|
<!-- begin type 'href' -->
|
48
48
|
<a v-if="optionLinkType === 'href'" href="#" @click.prevent="selectOption(option.value)" :class="{'active' : option.value === modelValue}">
|
49
49
|
<span v-if="option.iconClass" :class="option.iconClass"></span>
|
@@ -460,10 +460,6 @@ export default {
|
|
460
460
|
.cmd-fake-select {
|
461
461
|
align-self: flex-end;
|
462
462
|
|
463
|
-
& + .cmd-tooltip {
|
464
|
-
border-color: var(--status-color);
|
465
|
-
}
|
466
|
-
|
467
463
|
> span:first-child {
|
468
464
|
a {
|
469
465
|
align-self: flex-end;
|
@@ -475,7 +471,7 @@ export default {
|
|
475
471
|
margin: 0;
|
476
472
|
display: block;
|
477
473
|
min-width: 0;
|
478
|
-
background: var(--
|
474
|
+
background: var(--color-scheme-background-color);
|
479
475
|
box-shadow: none;
|
480
476
|
border-radius: var(--border-radius);
|
481
477
|
|
@@ -524,7 +520,7 @@ export default {
|
|
524
520
|
padding-top: .8rem;
|
525
521
|
outline: none;
|
526
522
|
border-bottom: var(--default-border);
|
527
|
-
color: var(--text-color);
|
523
|
+
color: var(--color-scheme-text-color);
|
528
524
|
text-decoration: none;
|
529
525
|
|
530
526
|
&:hover, &:active, &:focus {
|
@@ -604,21 +600,21 @@ export default {
|
|
604
600
|
}
|
605
601
|
}
|
606
602
|
|
607
|
-
&.
|
603
|
+
&.has-state {
|
608
604
|
> ul {
|
609
605
|
> li {
|
610
606
|
> a {
|
611
|
-
border-color: var(--
|
607
|
+
border-color: var(--status-color);
|
612
608
|
|
613
609
|
> span, span[class*="icon-"] {
|
614
|
-
color: var(--
|
610
|
+
color: var(--status-color);
|
615
611
|
}
|
616
612
|
|
617
613
|
&:hover, &:active, &:focus {
|
618
614
|
background: var(--pure-white);
|
619
615
|
|
620
616
|
span {
|
621
|
-
color: var(--
|
617
|
+
color: var(--status-color);
|
622
618
|
}
|
623
619
|
}
|
624
620
|
}
|
@@ -668,7 +664,7 @@ export default {
|
|
668
664
|
|
669
665
|
> span:first-child {
|
670
666
|
width: 1.5rem;
|
671
|
-
aspect-ratio: 1;
|
667
|
+
aspect-ratio: 1/1;
|
672
668
|
border: var(--default-border);
|
673
669
|
|
674
670
|
&[style=""] {
|
@@ -3,65 +3,57 @@
|
|
3
3
|
:class="[
|
4
4
|
'cmd-form-element',
|
5
5
|
validationStatus,
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
6
|
+
$attrs.class,
|
7
|
+
{
|
8
|
+
disabled: $attrs.disabled,
|
9
|
+
inline : displayLabelInline,
|
10
|
+
checked: isChecked,
|
11
|
+
'toggle-switch': toggleSwitch,
|
12
|
+
colored: colored,
|
13
|
+
on: colored && isChecked,
|
14
|
+
off: colored && !isChecked,
|
15
|
+
'has-state': validationStatus
|
16
|
+
}]"
|
16
17
|
:for="labelId"
|
17
18
|
ref="label">
|
18
19
|
|
19
20
|
<!-- begin label-text (+ required asterisk) -->
|
20
21
|
<span v-if="labelText && $attrs.type !== 'checkbox' && $attrs.type !== 'radio'"
|
21
|
-
:class="!showLabel ? 'hidden' : undefined">
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
</a>
|
35
|
-
</span>
|
22
|
+
:class="['label-text', !showLabel ? 'hidden' : undefined]">
|
23
|
+
<span>{{ labelText }}<sup v-if="$attrs.required">*</sup></span>
|
24
|
+
<a v-if="$attrs.required || inputRequirements.length"
|
25
|
+
href="#"
|
26
|
+
@click.prevent
|
27
|
+
:class="getStatusIconClass"
|
28
|
+
:title="validationTooltip"
|
29
|
+
:aria-errormessage="getValidationMessage"
|
30
|
+
aria-live="assertive"
|
31
|
+
:id="tooltipId"
|
32
|
+
:role="validationStatus === 'error' ? 'alert' : 'dialog'">
|
33
|
+
</a>
|
34
|
+
</span>
|
36
35
|
<!-- end label-text (+ required asterisk) -->
|
37
36
|
|
38
|
-
<!-- begin icon -->
|
39
|
-
<span
|
40
|
-
|
41
|
-
$attrs.type !== 'checkbox' &&
|
42
|
-
$attrs.type !== 'radio' &&
|
43
|
-
fieldIconClass
|
44
|
-
"
|
45
|
-
:class="['place-inside', fieldIconClass]"
|
46
|
-
></span>
|
47
|
-
<!-- end icon -->
|
37
|
+
<!-- begin icon inside field -->
|
38
|
+
<span v-if="$attrs.type !== 'checkbox' && $attrs.type !== 'radio' && fieldIconClass" :class="['place-inside', fieldIconClass]"></span>
|
39
|
+
<!-- end icon inside field -->
|
48
40
|
|
49
41
|
<!-- begin inputfield -->
|
50
|
-
<template
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
42
|
+
<template v-if="element === 'input' && $attrs.type !== 'checkbox' && $attrs.type !== 'radio' && $attrs.type !== 'search'">
|
43
|
+
<input
|
44
|
+
v-bind="elementAttributes"
|
45
|
+
:id="labelId"
|
46
|
+
:class="inputClass"
|
47
|
+
@focus="tooltip = true"
|
48
|
+
@blur="onBlur"
|
49
|
+
@input="onInput"
|
50
|
+
@mouseover="datalistFocus"
|
51
|
+
@keyup="checkForCapsLock"
|
52
|
+
:autocomplete="autocomplete"
|
53
|
+
:list="datalist ? datalist.id : null"
|
54
|
+
:value="modelValue"
|
55
|
+
:maxlength="getMaxLength()"
|
56
|
+
ref="input"
|
65
57
|
/>
|
66
58
|
</template>
|
67
59
|
<!-- end inputfield -->
|
@@ -88,37 +80,46 @@
|
|
88
80
|
|
89
81
|
<!-- begin checkbox and radiobutton -->
|
90
82
|
<template v-else-if="element === 'input' && ($attrs.type === 'checkbox' || $attrs.type === 'radio')">
|
91
|
-
<
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
<!-- begin labels for toggle-switch -->
|
83
|
+
<template v-if="!(onLabel && offLabel)">
|
84
|
+
<input
|
85
|
+
v-bind="elementAttributes"
|
86
|
+
@change="onChange"
|
87
|
+
@blur="onBlur"
|
88
|
+
:checked="isChecked"
|
89
|
+
:value="inputValue"
|
90
|
+
:class="[inputClass, validationStatus, toggleSwitchIconClass, { 'replace-input-type': replaceInputType, 'toggle-switch': toggleSwitch }]"
|
91
|
+
:id="labelId"
|
92
|
+
:aria-invalid="validationStatus === 'error'"
|
93
|
+
/>
|
94
|
+
<span v-if="labelText" :class="['label-text', { hidden: !showLabel }]"><span>{{ labelText }}<sup v-if="$attrs.required">*</sup></span></span>
|
95
|
+
</template>
|
96
|
+
<!-- begin labels for toggle-switch with switch-label -->
|
105
97
|
<template v-else-if="onLabel && offLabel">
|
106
|
-
<span
|
107
|
-
<
|
98
|
+
<span class="switch-label-wrapper">
|
99
|
+
<input v-bind="elementAttributes"
|
100
|
+
@change="onChange"
|
101
|
+
@blur="onBlur"
|
102
|
+
:checked="isChecked"
|
103
|
+
:value="inputValue"
|
104
|
+
:class="{inputClass, validationStatus}"
|
105
|
+
:id="labelId"
|
106
|
+
:aria-invalid="validationStatus === 'error'"
|
107
|
+
/>
|
108
|
+
<span class="label-text">{{ onLabel }}</span>
|
109
|
+
<span class="label-text">{{ offLabel }}</span>
|
108
110
|
</span>
|
109
|
-
<span class="
|
110
|
-
<span
|
111
|
-
<span class="label">{{ offLabel }}</span>
|
111
|
+
<span v-if="labelText" class="label-text">
|
112
|
+
<span>{{ labelText }}<sup v-if="$attrs.required">*</sup></span>
|
112
113
|
</span>
|
113
114
|
</template>
|
114
115
|
<slot v-else></slot>
|
115
|
-
<!-- end labels for toggle-switch -->
|
116
|
+
<!-- end labels for toggle-switch with switch-label -->
|
116
117
|
</template>
|
117
118
|
<!-- end checkbox and radiobutton -->
|
118
119
|
|
119
120
|
<!-- begin selectbox -->
|
120
121
|
<select v-if="element === 'select'"
|
121
|
-
v-bind="
|
122
|
+
v-bind="elementAttributes"
|
122
123
|
:id="labelId"
|
123
124
|
@blur="onBlur"
|
124
125
|
@change="$emit('update:modelValue', $event.target.value)">
|
@@ -130,7 +131,7 @@
|
|
130
131
|
|
131
132
|
<!-- begin textarea -->
|
132
133
|
<textarea v-if="element === 'textarea'"
|
133
|
-
v-bind="
|
134
|
+
v-bind="elementAttributes"
|
134
135
|
:id="labelId"
|
135
136
|
:value="modelValue"
|
136
137
|
:maxlength="getMaxLength()"
|
@@ -143,19 +144,19 @@
|
|
143
144
|
|
144
145
|
<!-- begin searchfield -->
|
145
146
|
<template v-else-if="element === 'input' && $attrs.type === 'search'">
|
146
|
-
<
|
147
|
-
<a v-if="iconDelete.show" href="#" @click.prevent="$emit('update:modelValue', '')" :class="iconDelete.iconClass" :title="iconDelete.tooltip"/>
|
147
|
+
<span class="search-field-wrapper flex-container no-gap">
|
148
148
|
<input
|
149
|
-
v-bind="
|
149
|
+
v-bind="elementAttributes"
|
150
150
|
:id="labelId"
|
151
151
|
@input="onInput"
|
152
|
-
:maxlength="
|
152
|
+
:maxlength="getMaxLength()"
|
153
153
|
:value="modelValue"
|
154
154
|
/>
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
155
|
+
<a v-if="showSearchButton" href="#" class="button no-flex" :title="iconSearch.tooltip" @click.prevent="executeSearch">
|
156
|
+
<span :class="iconSearch.iconClass"></span>
|
157
|
+
</a>
|
158
|
+
<a v-if="iconDelete.show" href="#" @click.prevent="$emit('update:modelValue', '')" :class="iconDelete.iconClass" :title="iconDelete.tooltip"></a>
|
159
|
+
</span>
|
159
160
|
</template>
|
160
161
|
</label>
|
161
162
|
<!-- end searchfield -->
|
@@ -217,7 +218,7 @@ import {createUuid} from "../utils/common.js"
|
|
217
218
|
|
218
219
|
// import mixins
|
219
220
|
import I18n from "../mixins/I18n"
|
220
|
-
import DefaultMessageProperties from "../mixins/
|
221
|
+
import DefaultMessageProperties from "../mixins/CmdFormElement/DefaultMessageProperties"
|
221
222
|
import FieldValidation from "../mixins/FieldValidation.js"
|
222
223
|
import Tooltip from "../mixins/Tooltip.js"
|
223
224
|
|
@@ -332,7 +333,7 @@ export default {
|
|
332
333
|
* allow checkbox/radio-buttons to get value from outside
|
333
334
|
*/
|
334
335
|
inputValue: {
|
335
|
-
type: String,
|
336
|
+
type: [String, Number],
|
336
337
|
required: false
|
337
338
|
},
|
338
339
|
/**
|
@@ -349,7 +350,7 @@ export default {
|
|
349
350
|
*
|
350
351
|
* may not be named as 'class' because it is a reserved keyword in JavaScript
|
351
352
|
*/
|
352
|
-
|
353
|
+
inputClass: {
|
353
354
|
type: String,
|
354
355
|
required: false
|
355
356
|
},
|
@@ -547,6 +548,33 @@ export default {
|
|
547
548
|
}
|
548
549
|
}
|
549
550
|
},
|
551
|
+
/**
|
552
|
+
* toggle if toggle-switch shows icons for checked/unchecked-status
|
553
|
+
*/
|
554
|
+
useIconsForToggleSwitch: {
|
555
|
+
type: Boolean,
|
556
|
+
default: false
|
557
|
+
},
|
558
|
+
/**
|
559
|
+
* icon for toggle-switch checked
|
560
|
+
*
|
561
|
+
* toggle-switch-property must be activated
|
562
|
+
* use-icons-for-toggle-switch-property must be activated
|
563
|
+
*/
|
564
|
+
toggleSwitchCheckedIconClass: {
|
565
|
+
type: String,
|
566
|
+
default: "icon-check-circle"
|
567
|
+
},
|
568
|
+
/**
|
569
|
+
* icon for toggle-switch unchecked
|
570
|
+
*
|
571
|
+
* toggle-switch-property must be activated
|
572
|
+
* use-icons-for-toggle-switch-property must be activated
|
573
|
+
*/
|
574
|
+
toggleSwitchUncheckedIconClass: {
|
575
|
+
type: String,
|
576
|
+
default: "icon-cancel-circle"
|
577
|
+
},
|
550
578
|
/**
|
551
579
|
* icon to toggle password-visibility
|
552
580
|
*
|
@@ -582,6 +610,19 @@ export default {
|
|
582
610
|
},
|
583
611
|
},
|
584
612
|
computed: {
|
613
|
+
elementAttributes() {
|
614
|
+
const commonAttributes = ["name", "required", "readonly", "disabled", "autofocus"]
|
615
|
+
const attributes = {
|
616
|
+
input: [...commonAttributes, "type", "minlength", "pattern", "min", "max", "multiple", "step", "autocomplete", "placeholder"],
|
617
|
+
select: [...commonAttributes, "multiple"],
|
618
|
+
textarea: [...commonAttributes, "placeholder"]
|
619
|
+
}
|
620
|
+
const attrs = {}
|
621
|
+
if (attributes[this.element]) {
|
622
|
+
Object.entries(this.$attrs).filter(([name]) => attributes[this.element].includes(name)).forEach(([name, value]) => attrs[name] = value)
|
623
|
+
}
|
624
|
+
return attrs
|
625
|
+
},
|
585
626
|
buttonAttrs() {
|
586
627
|
// copy all native attributes
|
587
628
|
const allAttrs = {...this.$attrs}
|
@@ -633,32 +674,42 @@ export default {
|
|
633
674
|
return this.getMessage("cmdformelement.validationTooltip.open_field_requirements")
|
634
675
|
},
|
635
676
|
autocomplete() {
|
636
|
-
if(this.$attrs.type !== 'file') {
|
677
|
+
if (this.$attrs.type !== 'file') {
|
637
678
|
return this.datalist ? 'off' : 'on'
|
638
679
|
}
|
639
680
|
return null
|
640
681
|
},
|
641
682
|
// get ID for accessibility
|
642
683
|
labelId() {
|
643
|
-
if(this.$attrs.id !== undefined) {
|
684
|
+
if (this.$attrs.id !== undefined) {
|
644
685
|
return this.$attrs.id
|
645
686
|
}
|
646
687
|
return "label-" + createUuid()
|
688
|
+
},
|
689
|
+
// toggle icons for toggle-switch
|
690
|
+
toggleSwitchIconClass() {
|
691
|
+
if(this.toggleSwitch && this.useIconsForToggleSwitch && this.toggleSwitchUncheckedIconClass && this.toggleSwitchCheckedIconClass) {
|
692
|
+
if(this.isChecked) {
|
693
|
+
return this.toggleSwitchCheckedIconClass
|
694
|
+
}
|
695
|
+
return this.toggleSwitchUncheckedIconClass
|
696
|
+
}
|
697
|
+
return null
|
647
698
|
}
|
648
699
|
},
|
649
700
|
methods: {
|
650
701
|
getDomElement() {
|
651
702
|
return this.$refs.label
|
652
703
|
},
|
704
|
+
// define max-length for different input-types
|
653
705
|
getMaxLength() {
|
654
706
|
if (this.$attrs.element === 'textarea') {
|
655
707
|
return this.$attrs.maxlength > 0 ? this.$attrs.maxlength : 5000
|
656
708
|
}
|
657
709
|
|
658
|
-
if (this.$attrs.type !== 'file') {
|
659
|
-
|
710
|
+
if (this.$attrs.type !== 'file' && this.$attrs.type !== 'number' && this.$attrs.type !== 'date') {
|
711
|
+
return this.$attrs.maxlength > 0 ? this.$attrs.maxlength : 255
|
660
712
|
}
|
661
|
-
|
662
713
|
return null
|
663
714
|
},
|
664
715
|
onBlur(event) {
|
@@ -749,6 +800,7 @@ export default {
|
|
749
800
|
</script>
|
750
801
|
|
751
802
|
<style lang="scss">
|
803
|
+
/* begin cmd-form-element ------------------------------------------------------------------------------------------ */
|
752
804
|
.cmd-form-element {
|
753
805
|
input + .place-inside[class*="icon"] {
|
754
806
|
left: auto;
|
@@ -756,22 +808,6 @@ export default {
|
|
756
808
|
}
|
757
809
|
|
758
810
|
&.has-state, & + .cmd-tooltip {
|
759
|
-
&.error {
|
760
|
-
--status-color: var(--error-color);
|
761
|
-
}
|
762
|
-
|
763
|
-
&.warning {
|
764
|
-
--status-color: var(--warning-color);
|
765
|
-
}
|
766
|
-
|
767
|
-
&.success {
|
768
|
-
--status-color: var(--success-color);
|
769
|
-
}
|
770
|
-
|
771
|
-
&.info {
|
772
|
-
--status-color: var(--info-color);
|
773
|
-
}
|
774
|
-
|
775
811
|
::placeholder {
|
776
812
|
color: var(--status-color);
|
777
813
|
}
|
@@ -785,13 +821,9 @@ export default {
|
|
785
821
|
}
|
786
822
|
}
|
787
823
|
|
788
|
-
& + .cmd-tooltip {
|
789
|
-
border-color: var(--status-color);
|
790
|
-
}
|
791
|
-
|
792
824
|
&.inline {
|
793
825
|
& > span {
|
794
|
-
& > a {
|
826
|
+
& > a:not(.button) {
|
795
827
|
margin-left: calc(var(--default-margin) / 2);
|
796
828
|
}
|
797
829
|
}
|
@@ -800,23 +832,23 @@ export default {
|
|
800
832
|
.search-field-wrapper {
|
801
833
|
margin: 0;
|
802
834
|
|
803
|
-
a {
|
835
|
+
a[class*="icon"] {
|
804
836
|
position: absolute;
|
805
837
|
top: 50%;
|
806
838
|
right: 1rem;
|
807
839
|
transform: translateY(-50%);
|
808
840
|
z-index: 100;
|
841
|
+
}
|
809
842
|
|
810
|
-
|
811
|
-
|
843
|
+
a.button {
|
844
|
+
& + a[class*="icon"] {
|
845
|
+
right: 5rem;
|
812
846
|
}
|
813
847
|
}
|
814
848
|
}
|
815
849
|
|
816
850
|
.place-inside {
|
817
851
|
+ .search-field-wrapper {
|
818
|
-
|
819
|
-
|
820
852
|
input {
|
821
853
|
padding-left: calc(var(--default-padding) * 3);
|
822
854
|
}
|
@@ -824,33 +856,15 @@ export default {
|
|
824
856
|
}
|
825
857
|
|
826
858
|
/* begin toggle-switch */
|
827
|
-
/* no cmd-prefix-styling (class based on frontend-framework */
|
859
|
+
/* no cmd-prefix-styling (class based on frontend-framework) */
|
828
860
|
&.toggle-switch {
|
829
|
-
&.
|
830
|
-
|
831
|
-
|
832
|
-
padding-right: calc(var(--default-padding) / 3 * 2);
|
833
|
-
|
834
|
-
&::before {
|
835
|
-
top: 0.2rem;
|
836
|
-
}
|
837
|
-
|
838
|
-
& + .label {
|
839
|
-
padding-left: calc(var(--default-padding) / 3 * 2);
|
840
|
-
|
841
|
-
&::before {
|
842
|
-
top: 0.2rem;
|
843
|
-
}
|
844
|
-
}
|
845
|
-
}
|
846
|
-
}
|
847
|
-
|
848
|
-
&.colored {
|
849
|
-
&.off {
|
861
|
+
&.colored {
|
862
|
+
&.off {
|
863
|
+
.switch-label-wrapper {
|
850
864
|
border-color: var(--error-color);
|
851
865
|
|
852
866
|
span {
|
853
|
-
&.label {
|
867
|
+
&.label-text {
|
854
868
|
color: var(--error-color);
|
855
869
|
|
856
870
|
&::before {
|
@@ -860,12 +874,14 @@ export default {
|
|
860
874
|
}
|
861
875
|
}
|
862
876
|
}
|
877
|
+
}
|
863
878
|
|
864
|
-
|
879
|
+
&.on {
|
880
|
+
.switch-label-wrapper {
|
865
881
|
border-color: var(--success-color);
|
866
882
|
|
867
883
|
span {
|
868
|
-
&.label {
|
884
|
+
&.label-text {
|
869
885
|
color: var(--success-color);
|
870
886
|
|
871
887
|
&::before {
|
@@ -878,7 +894,7 @@ export default {
|
|
878
894
|
}
|
879
895
|
}
|
880
896
|
}
|
881
|
-
|
882
|
-
/* end toggle-switch ------------------------------------------------------------------------------------------ */
|
897
|
+
/* end toggle-switch */
|
883
898
|
}
|
899
|
+
/* end cmd-form-element------------------------------------------------------------------------------------------ */
|
884
900
|
</style>
|