comand-component-library 3.1.71 → 3.1.72
Sign up to get free protection for your applications and to get access to all the features.
- 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 +265 -179
- package/src/components/CmdBox.vue +6 -4
- package/src/components/CmdFakeSelect.vue +12 -3
- package/src/components/CmdFormElement.vue +51 -40
- package/src/components/CmdInputGroup.vue +19 -7
- package/src/components/CmdToggleDarkMode.vue +30 -10
- package/src/components/CmdTooltip.vue +1 -1
@@ -8,9 +8,10 @@
|
|
8
8
|
<slot name="header"></slot>
|
9
9
|
<!-- end slot 'header' -->
|
10
10
|
<a href="#"
|
11
|
+
class="toggle-icon"
|
11
12
|
:title="open ? iconOpen.tooltip : iconClosed.tooltip"
|
12
13
|
@click.prevent="toggleContentVisibility">
|
13
|
-
<span
|
14
|
+
<span :class="[open ? iconOpen.iconClass : iconClosed.iconClass]"></span>
|
14
15
|
</a>
|
15
16
|
</div>
|
16
17
|
<!-- end collapsible header with slot -->
|
@@ -313,8 +314,8 @@ export default {
|
|
313
314
|
margin-bottom: 0;
|
314
315
|
}
|
315
316
|
|
316
|
-
&:not(.open)
|
317
|
-
|
317
|
+
&:not(.open) {
|
318
|
+
justify-content: flex-start;
|
318
319
|
}
|
319
320
|
}
|
320
321
|
|
@@ -334,9 +335,10 @@ export default {
|
|
334
335
|
|
335
336
|
* {
|
336
337
|
color: var(--pure-white);
|
338
|
+
margin-bottom: 0;
|
337
339
|
}
|
338
340
|
|
339
|
-
> [class*="icon"]
|
341
|
+
> .toggle-icon, .toggle-icon > [class*="icon"] {
|
340
342
|
font-size: 1rem;
|
341
343
|
margin-left: auto;
|
342
344
|
}
|
@@ -5,7 +5,8 @@
|
|
5
5
|
'cmd-fake-select label',
|
6
6
|
{
|
7
7
|
color: type === 'color',
|
8
|
-
'has-state': validationStatus && validationStatus !== 'none'
|
8
|
+
'has-state': validationStatus && validationStatus !== 'none',
|
9
|
+
disabled: $attrs.disabled
|
9
10
|
}
|
10
11
|
]"
|
11
12
|
:aria-labelledby="labelId"
|
@@ -229,7 +230,7 @@ export default {
|
|
229
230
|
/**
|
230
231
|
* status (i.e. for validation)
|
231
232
|
*
|
232
|
-
* @allowedValues: error, success,
|
233
|
+
* @allowedValues: error, warning, success, info
|
233
234
|
* @affectsStyling: true
|
234
235
|
*/
|
235
236
|
status: {
|
@@ -372,7 +373,7 @@ export default {
|
|
372
373
|
}
|
373
374
|
},
|
374
375
|
toggleOptions() {
|
375
|
-
if (this.
|
376
|
+
if (this.$attrs.disabled !== 'disabled') {
|
376
377
|
this.showOptions = !this.showOptions
|
377
378
|
}
|
378
379
|
},
|
@@ -546,8 +547,16 @@ export default {
|
|
546
547
|
&.active {
|
547
548
|
background: var(--light-gray);
|
548
549
|
|
550
|
+
span {
|
551
|
+
color: var(--text-color);
|
552
|
+
}
|
553
|
+
|
549
554
|
&:hover, &:active, &:focus {
|
550
555
|
background: var(--primary-color);
|
556
|
+
|
557
|
+
span {
|
558
|
+
color: var(--pure-white);
|
559
|
+
}
|
551
560
|
}
|
552
561
|
}
|
553
562
|
}
|
@@ -21,6 +21,46 @@
|
|
21
21
|
<span v-if="labelText && $attrs.type !== 'checkbox' && $attrs.type !== 'radio'"
|
22
22
|
:class="['label-text', !showLabel ? 'hidden' : undefined]">
|
23
23
|
<span>{{ labelText }}<sup v-if="$attrs.required">*</sup></span>
|
24
|
+
|
25
|
+
<!-- begin CmdTooltip -->
|
26
|
+
<CmdTooltip v-if="useCustomTooltip" class="box" :class="validationStatus" :relatedId="tooltipId" :toggle-visibility-by-click="true">
|
27
|
+
<!-- begin CmdSystemMessage -->
|
28
|
+
<CmdSystemMessage
|
29
|
+
v-if="getValidationMessage"
|
30
|
+
:message="getValidationMessage"
|
31
|
+
:validation-status="validationStatus"
|
32
|
+
:iconClose="{show: false}"
|
33
|
+
/>
|
34
|
+
<!-- end CmdSystemMessage -->
|
35
|
+
|
36
|
+
<template v-if="showRequirements && (validationStatus === '' || validationStatus === 'error')">
|
37
|
+
<!-- begin list of requirements -->
|
38
|
+
<h6>
|
39
|
+
{{ getMessage("cmdformelement.headline.requirements_for_input") }}<br/>
|
40
|
+
"{{ labelText }}"
|
41
|
+
</h6>
|
42
|
+
<dl class="list-of-requirements">
|
43
|
+
<template v-for="(requirement, index) in inputRequirements" :key="index">
|
44
|
+
<dt aria-live="assertive" :class="requirement.valid(modelValue, $attrs) ? 'success' : 'error'">{{ requirement.message }}:</dt>
|
45
|
+
<dd :class="requirement.valid(modelValue, $attrs) ? 'success' : 'error'">
|
46
|
+
<span aria-live="assertive" :class="requirement.valid(modelValue, $attrs) ? iconHasStateSuccess.iconClass : iconHasStateError.iconClass"
|
47
|
+
:title="requirement.valid(modelValue, $attrs) ? iconHasStateSuccess.tooltip : iconHasStateError.tooltip"></span>
|
48
|
+
</dd>
|
49
|
+
</template>
|
50
|
+
</dl>
|
51
|
+
<!-- end list of requirements -->
|
52
|
+
|
53
|
+
<!-- begin helplink -->
|
54
|
+
<hr v-if="helplink?.show"/>
|
55
|
+
<a v-if="helplink?.show && helplink?.url" :href="helplink.url" :target="helplink.target" @click.prevent>
|
56
|
+
<span v-if="helplink.icon?.iconClass" :class="helplink.icon?.iconClass" :title="helplink.icon?.tooltip"></span>
|
57
|
+
<span v-if="helplink.text">{{ helplink.text }}</span>
|
58
|
+
</a>
|
59
|
+
<!-- end helplink -->
|
60
|
+
</template>
|
61
|
+
</CmdTooltip>
|
62
|
+
<!-- end CmdTooltip -->
|
63
|
+
|
24
64
|
<a v-if="$attrs.required || inputRequirements.length"
|
25
65
|
href="#"
|
26
66
|
@click.prevent
|
@@ -89,6 +129,7 @@
|
|
89
129
|
:value="inputValue"
|
90
130
|
:class="[inputClass, validationStatus, toggleSwitchIconClass, { 'replace-input-type': replaceInputType, 'toggle-switch': toggleSwitch }]"
|
91
131
|
:id="labelId"
|
132
|
+
:disabled="$attrs.disabled"
|
92
133
|
:aria-invalid="validationStatus === 'error'"
|
93
134
|
/>
|
94
135
|
<span v-if="labelText" :class="['label-text', { hidden: !showLabel }]"><span>{{ labelText }}<sup v-if="$attrs.required">*</sup></span></span>
|
@@ -103,6 +144,7 @@
|
|
103
144
|
:value="inputValue"
|
104
145
|
:class="{inputClass, validationStatus}"
|
105
146
|
:id="labelId"
|
147
|
+
:disabled="$attrs.disabled"
|
106
148
|
:aria-invalid="validationStatus === 'error'"
|
107
149
|
/>
|
108
150
|
<span class="label-text">{{ onLabel }}</span>
|
@@ -152,7 +194,7 @@
|
|
152
194
|
:maxlength="getMaxLength()"
|
153
195
|
:value="modelValue"
|
154
196
|
/>
|
155
|
-
<a v-if="showSearchButton" href="#" class="button no-flex" :title="iconSearch.tooltip" @click.prevent="executeSearch">
|
197
|
+
<a v-if="showSearchButton" href="#" :class="['button no-flex', {disabled: $attrs.disabled}]" :title="iconSearch.tooltip" @click.prevent="executeSearch">
|
156
198
|
<span :class="iconSearch.iconClass"></span>
|
157
199
|
</a>
|
158
200
|
<a v-if="iconDelete.show" href="#" @click.prevent="$emit('update:modelValue', '')" :class="iconDelete.iconClass" :title="iconDelete.tooltip"></a>
|
@@ -171,45 +213,6 @@
|
|
171
213
|
<span v-if="nativeButton?.icon?.show && nativeButton?.icon?.position === 'after'" :class="nativeButton?.icon?.iconClass"></span>
|
172
214
|
</button>
|
173
215
|
<!-- end button -->
|
174
|
-
|
175
|
-
<!-- begin CmdTooltip -->
|
176
|
-
<CmdTooltip v-if="useCustomTooltip" class="box" :class="validationStatus" :relatedId="tooltipId" :toggle-visibility-by-click="true">
|
177
|
-
<!-- begin CmdSystemMessage -->
|
178
|
-
<CmdSystemMessage
|
179
|
-
v-if="getValidationMessage"
|
180
|
-
:message="getValidationMessage"
|
181
|
-
:validation-status="validationStatus"
|
182
|
-
:iconClose="{show: false}"
|
183
|
-
/>
|
184
|
-
<!-- end CmdSystemMessage -->
|
185
|
-
|
186
|
-
<template v-if="showRequirements && (validationStatus === '' || validationStatus === 'error')">
|
187
|
-
<!-- begin list of requirements -->
|
188
|
-
<h6>
|
189
|
-
{{ getMessage("cmdformelement.headline.requirements_for_input") }}<br/>
|
190
|
-
"{{ labelText }}"
|
191
|
-
</h6>
|
192
|
-
<dl class="list-of-requirements">
|
193
|
-
<template v-for="(requirement, index) in inputRequirements" :key="index">
|
194
|
-
<dt aria-live="assertive" :class="requirement.valid(modelValue, $attrs) ? 'success' : 'error'">{{ requirement.message }}:</dt>
|
195
|
-
<dd :class="requirement.valid(modelValue, $attrs) ? 'success' : 'error'">
|
196
|
-
<span aria-live="assertive" :class="requirement.valid(modelValue, $attrs) ? iconHasStateSuccess.iconClass : iconHasStateError.iconClass"
|
197
|
-
:title="requirement.valid(modelValue, $attrs) ? iconHasStateSuccess.tooltip : iconHasStateError.tooltip"></span>
|
198
|
-
</dd>
|
199
|
-
</template>
|
200
|
-
</dl>
|
201
|
-
<!-- end list of requirements -->
|
202
|
-
|
203
|
-
<!-- begin helplink -->
|
204
|
-
<hr v-if="helplink?.show"/>
|
205
|
-
<a v-if="helplink?.show && helplink?.url" :href="helplink.url" :target="helplink.target" @click.prevent>
|
206
|
-
<span v-if="helplink.icon?.iconClass" :class="helplink.icon?.iconClass" :title="helplink.icon?.tooltip"></span>
|
207
|
-
<span v-if="helplink.text">{{ helplink.text }}</span>
|
208
|
-
</a>
|
209
|
-
<!-- end helplink -->
|
210
|
-
</template>
|
211
|
-
</CmdTooltip>
|
212
|
-
<!-- end CmdTooltip -->
|
213
216
|
</template>
|
214
217
|
|
215
218
|
<script>
|
@@ -807,6 +810,14 @@ export default {
|
|
807
810
|
right: .5rem
|
808
811
|
}
|
809
812
|
|
813
|
+
.cmd-tooltip {
|
814
|
+
position: absolute;
|
815
|
+
right: 0;
|
816
|
+
transform: translateY(calc(-100% - calc(var(--default-margin) / 2)));
|
817
|
+
left: auto !important;
|
818
|
+
top: 0 !important;
|
819
|
+
}
|
820
|
+
|
810
821
|
&.has-state, & + .cmd-tooltip {
|
811
822
|
::placeholder {
|
812
823
|
color: var(--status-color);
|
@@ -1,21 +1,24 @@
|
|
1
1
|
<template>
|
2
|
-
<div :class="['cmd-input-group label', {inline: labelInline, 'multiple-switch': multipleSwitch}]">
|
2
|
+
<div :class="['cmd-input-group label', {inline: labelInline, 'multiple-switch': multipleSwitch, disabled: disabled}]">
|
3
3
|
<span :class="['label-text', { hidden: !showLabel}]" :id="labelId" :aria-labelledby="labelId">
|
4
4
|
<span>{{ labelText }}<sup v-if="$attrs.required">*</sup></span>
|
5
5
|
</span>
|
6
6
|
<span v-if="!useSlot" :class="['flex-container', {'no-flex': !stretchHorizontally, 'no-gap': multipleSwitch}]">
|
7
7
|
<label v-for="(inputElement, index) in inputElements" :key="index" :for="inputElement.id">
|
8
|
-
<input
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
<input
|
9
|
+
:type="inputTypes"
|
10
|
+
:id="inputElement.id"
|
11
|
+
:name="inputElement.name"
|
12
|
+
:value="inputElement.value"
|
13
|
+
v-model="inputValue"
|
14
|
+
:disabled="disabled"
|
15
|
+
:class="{'replace-input-type': replaceInputType}"
|
14
16
|
/>
|
15
17
|
<span v-if="multipleSwitch && inputElement.iconClass" :class="inputElement.iconClass"></span>
|
16
18
|
<span v-if="inputElement.labelText">{{ inputElement.labelText }}</span>
|
17
19
|
</label>
|
18
20
|
</span>
|
21
|
+
|
19
22
|
<!-- begin useSlot -->
|
20
23
|
<div v-else class="flex-container no-flex">
|
21
24
|
<!-- begin slot -->
|
@@ -117,6 +120,15 @@ export default {
|
|
117
120
|
stretchHorizontally: {
|
118
121
|
type: Boolean,
|
119
122
|
default: false
|
123
|
+
},
|
124
|
+
/**
|
125
|
+
* define disabled-property to set disabled-style
|
126
|
+
*
|
127
|
+
* component cannot handle native disabled-attribute, because it is no native form-element
|
128
|
+
*/
|
129
|
+
disabled: {
|
130
|
+
type: Boolean,
|
131
|
+
default: false
|
120
132
|
}
|
121
133
|
},
|
122
134
|
computed: {
|
@@ -6,6 +6,10 @@
|
|
6
6
|
:labelText="labelText"
|
7
7
|
:showLabel="showLabel"
|
8
8
|
v-model="darkMode"
|
9
|
+
:toggle-switch="true"
|
10
|
+
:useIconsForToggleSwitch="true"
|
11
|
+
toggle-switch-checked-icon-class="icon-home"
|
12
|
+
toggle-switch-unchecked-icon-class="icon-globe"
|
9
13
|
/>
|
10
14
|
</div>
|
11
15
|
</template>
|
@@ -14,19 +18,17 @@
|
|
14
18
|
import CmdFormElement from "./CmdFormElement"
|
15
19
|
|
16
20
|
export default {
|
17
|
-
|
18
|
-
return {
|
19
|
-
darkMode: false
|
20
|
-
}
|
21
|
-
},
|
21
|
+
name: "ToggleDarkMode",
|
22
22
|
components: {
|
23
23
|
CmdFormElement
|
24
24
|
},
|
25
|
+
data() {
|
26
|
+
return {
|
27
|
+
darkMode: false,
|
28
|
+
labelText: "Light mode activated"
|
29
|
+
}
|
30
|
+
},
|
25
31
|
props: {
|
26
|
-
labelText: {
|
27
|
-
type: String,
|
28
|
-
default: "Toggle Darkmode"
|
29
|
-
},
|
30
32
|
showLabel: {
|
31
33
|
type: Boolean,
|
32
34
|
default: false
|
@@ -56,11 +58,29 @@ export default {
|
|
56
58
|
const htmlTag = document.querySelector('html')
|
57
59
|
if(this.darkMode) {
|
58
60
|
htmlTag.classList.replace("light-mode", "dark-mode");
|
61
|
+
this.labelText = "Dark-Mode enabled"
|
59
62
|
} else {
|
60
63
|
htmlTag.classList.replace("dark-mode", "light-mode");
|
64
|
+
this.labelText = "Light-Mode enabled"
|
61
65
|
}
|
62
66
|
htmlTag.dispatchEvent(new CustomEvent('toggle-color-scheme', { detail: this.darkMode ? 'dark-mode' : 'light-mode' }))
|
63
67
|
}
|
64
68
|
}
|
65
69
|
}
|
66
|
-
</script>
|
70
|
+
</script>
|
71
|
+
|
72
|
+
<style lang="scss">
|
73
|
+
.cmd-toggle-dark-mode {
|
74
|
+
.cmd-form-element {
|
75
|
+
input {
|
76
|
+
background: blue;
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
80
|
+
&.dark-mode {
|
81
|
+
input {
|
82
|
+
background: black;
|
83
|
+
}
|
84
|
+
}
|
85
|
+
}
|
86
|
+
</style>
|
@@ -138,7 +138,7 @@ export default {
|
|
138
138
|
},
|
139
139
|
unmounted() {
|
140
140
|
if(this.relatedId) {
|
141
|
-
const relatedElement = document.getElementById(this.
|
141
|
+
const relatedElement = document.getElementById(this.npm )
|
142
142
|
|
143
143
|
if(relatedElement) {
|
144
144
|
relatedElement.removeEventListener("mouseenter", this.showTooltip)
|