comand-component-library 3.1.66 → 3.1.69
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 +152 -114
- package/src/assets/data/box-user.json +0 -8
- package/src/assets/data/tabs.json +6 -3
- package/src/assets/styles/global-styles.scss +30 -48
- package/src/components/CmdBackToTopButton.vue +1 -1
- package/src/components/CmdBox.vue +40 -24
- package/src/components/CmdBoxSiteSearch.vue +228 -46
- package/src/components/CmdCompanyLogo.vue +38 -13
- package/src/components/CmdCookieDisclaimer.vue +0 -17
- package/src/components/CmdCustomHeadline.vue +4 -4
- package/src/components/CmdFakeSelect.vue +17 -7
- package/src/components/CmdFormElement.vue +110 -77
- package/src/components/CmdFormFilters.vue +1 -1
- package/src/components/CmdInputGroup.vue +47 -0
- package/src/components/CmdListOfLinks.vue +6 -4
- package/src/components/CmdLoginForm.vue +7 -5
- package/src/components/CmdMultipleSwitch.vue +14 -2
- package/src/components/CmdMultistepFormProgressBar.vue +3 -3
- package/src/components/CmdProgressBar.vue +1 -0
- package/src/components/CmdSiteHeader.vue +15 -4
- package/src/components/CmdTabs.vue +4 -4
- 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 +0 -1
- package/src/mixins/FieldValidation.js +1 -1
- package/src/utils/common.js +10 -1
- package/src/components/CmdSwitchButton.vue +0 -181
@@ -0,0 +1,66 @@
|
|
1
|
+
<template>
|
2
|
+
<div :class="['cmd-toggle-dark-mode', {'dark-mode': darkMode}]">
|
3
|
+
<CmdFormElement
|
4
|
+
element="input"
|
5
|
+
type="checkbox"
|
6
|
+
:labelText="labelText"
|
7
|
+
:showLabel="showLabel"
|
8
|
+
v-model="darkMode"
|
9
|
+
/>
|
10
|
+
</div>
|
11
|
+
</template>
|
12
|
+
|
13
|
+
<script>
|
14
|
+
import CmdFormElement from "./CmdFormElement"
|
15
|
+
|
16
|
+
export default {
|
17
|
+
data() {
|
18
|
+
return {
|
19
|
+
darkMode: false
|
20
|
+
}
|
21
|
+
},
|
22
|
+
components: {
|
23
|
+
CmdFormElement
|
24
|
+
},
|
25
|
+
props: {
|
26
|
+
labelText: {
|
27
|
+
type: String,
|
28
|
+
default: "Toggle Darkmode"
|
29
|
+
},
|
30
|
+
showLabel: {
|
31
|
+
type: Boolean,
|
32
|
+
default: false
|
33
|
+
}
|
34
|
+
},
|
35
|
+
created() {
|
36
|
+
// get color-scheme (light-/dark-mode) from browser-settings
|
37
|
+
// this.darkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
|
38
|
+
// document.body.classList.add(this.darkMode ? 'dark-mode' : 'light-mode');
|
39
|
+
|
40
|
+
const mql = window.matchMedia('(prefers-color-scheme: dark)')
|
41
|
+
mql.addEventListener("change", this.onColorSchemeChange)
|
42
|
+
this.onColorSchemeChange(mql)
|
43
|
+
},
|
44
|
+
beforeUnmount() {
|
45
|
+
window.matchMedia('(prefers-color-scheme: dark)').removeEventListener("change", this.onColorSchemeChange)
|
46
|
+
},
|
47
|
+
methods: {
|
48
|
+
onColorSchemeChange(event) {
|
49
|
+
this.darkMode = event.matches
|
50
|
+
document.querySelector('html').classList.add(this.darkMode ? 'dark-mode' : 'light-mode')
|
51
|
+
}
|
52
|
+
},
|
53
|
+
watch: {
|
54
|
+
darkMode() {
|
55
|
+
// toggle classes to overwrite media-query styles for color-schemes
|
56
|
+
const htmlTag = document.querySelector('html')
|
57
|
+
if(this.darkMode) {
|
58
|
+
htmlTag.classList.replace("light-mode", "dark-mode");
|
59
|
+
} else {
|
60
|
+
htmlTag.classList.replace("dark-mode", "light-mode");
|
61
|
+
}
|
62
|
+
htmlTag.dispatchEvent(new CustomEvent('toggle-color-scheme', { detail: this.darkMode ? 'dark-mode' : 'light-mode' }))
|
63
|
+
}
|
64
|
+
}
|
65
|
+
}
|
66
|
+
</script>
|
@@ -212,7 +212,7 @@
|
|
212
212
|
:labelText="getMessage('cmduploadform.labeltext.comment')"
|
213
213
|
v-model="comment"
|
214
214
|
:required="commentRequired"
|
215
|
-
:
|
215
|
+
:validationMessage="commentStatusMessage"
|
216
216
|
:placeholder="getMessage('cmduploadform.placeholder.comment')"
|
217
217
|
:status="commentStatusMessage ? 'error' : ''"
|
218
218
|
/>
|
@@ -980,14 +980,13 @@ export default {
|
|
980
980
|
<style lang="scss">
|
981
981
|
/* begin cmd-upload-form -------------------------------------------------------------------------------------------- */
|
982
982
|
.cmd-upload-form {
|
983
|
-
|
984
983
|
.cmd-custom-headline {
|
985
984
|
margin: 0;
|
986
985
|
justify-content: center;
|
987
986
|
}
|
988
987
|
|
989
988
|
.box {
|
990
|
-
background: var(--
|
989
|
+
background: var(--color-scheme-background-color);
|
991
990
|
|
992
991
|
dl {
|
993
992
|
justify-content: center;
|
@@ -1031,7 +1030,7 @@ export default {
|
|
1031
1030
|
|
1032
1031
|
progress {
|
1033
1032
|
&[value] {
|
1034
|
-
background: var(--
|
1033
|
+
background: var(--color-scheme-background-color);
|
1035
1034
|
|
1036
1035
|
&::-moz-progress-bar {
|
1037
1036
|
border-top-left-radius: var(--border-radius);
|
@@ -1051,7 +1050,7 @@ export default {
|
|
1051
1050
|
top: 0.2rem;
|
1052
1051
|
padding: 0.1rem 0.2rem;
|
1053
1052
|
line-height: 100%;
|
1054
|
-
background: var(--
|
1053
|
+
background: var(--color-scheme-background-color);
|
1055
1054
|
}
|
1056
1055
|
}
|
1057
1056
|
}
|
@@ -1119,7 +1118,7 @@ export default {
|
|
1119
1118
|
.drop-area {
|
1120
1119
|
border: var(--default-border);
|
1121
1120
|
border-style: dashed;
|
1122
|
-
background: var(--
|
1121
|
+
background: var(--color-scheme-background-color);
|
1123
1122
|
padding: (var(--default-padding));
|
1124
1123
|
text-align: center;
|
1125
1124
|
|
package/src/index.js
CHANGED
@@ -32,7 +32,6 @@ export { default as CmdShareButtons } from '@/components/CmdShareButtons'
|
|
32
32
|
export { default as CmdSiteHeader } from '@/components/CmdSiteHeader'
|
33
33
|
export { default as CmdSlideButton } from '@/components/CmdSlideButton'
|
34
34
|
export { default as CmdSlideshow } from '@/components/CmdSlideshow'
|
35
|
-
export { default as CmdSwitchButton } from '@/components/CmdSwitchButton'
|
36
35
|
export { default as CmdSwitchLanguage } from '@/components/CmdSwitchLanguage'
|
37
36
|
export { default as CmdSystemMessage } from '@/components/CmdSystemMessage'
|
38
37
|
export { default as CmdTable } from '@/components/CmdTable'
|
package/src/utils/common.js
CHANGED
@@ -3,4 +3,13 @@ function isFrameMode() {
|
|
3
3
|
return frameUrl.searchParams.has("frameMode")
|
4
4
|
}
|
5
5
|
|
6
|
-
|
6
|
+
function createUuid(){
|
7
|
+
let dt = new Date().getTime()
|
8
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
|
9
|
+
const r = (dt + Math.random() * 16) % 16 | 0
|
10
|
+
dt = Math.floor(dt / 16)
|
11
|
+
return (c === "x" ? r : (r & 0x3 | 0x8)).toString(16)
|
12
|
+
})
|
13
|
+
}
|
14
|
+
|
15
|
+
export {isFrameMode, createUuid}
|
@@ -1,181 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<label :class="['cmd-switch-button', 'toggle-switch',
|
3
|
-
{'switch-label': onLabel && offLabel && !labelText,
|
4
|
-
'colored' : colored, 'on' : colored && isChecked,
|
5
|
-
'off' : colored && !isChecked, 'disabled': $attrs.disabled
|
6
|
-
}
|
7
|
-
]"
|
8
|
-
:for="id"
|
9
|
-
:title="$attrs.title"
|
10
|
-
>
|
11
|
-
<input :type="type" :id="id" :name="name" :value="inputValue" :checked="isChecked" @change="onChange" v-bind="$attrs"/>
|
12
|
-
<span class="label" v-if="onLabel && offLabel && !labelText">{{ onLabel }}</span>
|
13
|
-
<span class="label" v-if="onLabel && offLabel && !labelText">{{ offLabel }}</span>
|
14
|
-
<span class="label" v-if="!onLabel && !offLabel && labelText">{{ labelText }}</span>
|
15
|
-
</label>
|
16
|
-
</template>
|
17
|
-
|
18
|
-
<script>
|
19
|
-
export default {
|
20
|
-
inheritAttrs: false,
|
21
|
-
name: "CmdSwitchButton",
|
22
|
-
emits: ["update:value"],
|
23
|
-
props: {
|
24
|
-
/**
|
25
|
-
* set type for input
|
26
|
-
*
|
27
|
-
* values: checkbox, radio
|
28
|
-
*/
|
29
|
-
type: {
|
30
|
-
type: String,
|
31
|
-
required: true
|
32
|
-
},
|
33
|
-
/**
|
34
|
-
* set id for input
|
35
|
-
*
|
36
|
-
* @requiredForAccessibility: true
|
37
|
-
*/
|
38
|
-
id: {
|
39
|
-
type: String,
|
40
|
-
required: true
|
41
|
-
},
|
42
|
-
/**
|
43
|
-
* set name for input
|
44
|
-
*
|
45
|
-
* required for radio-buttons (and form-submit by browser)
|
46
|
-
*/
|
47
|
-
name: {
|
48
|
-
type: String,
|
49
|
-
required: false
|
50
|
-
},
|
51
|
-
/**
|
52
|
-
* value for v-model
|
53
|
-
*/
|
54
|
-
value: {
|
55
|
-
type: [String, Array, Boolean],
|
56
|
-
required: false
|
57
|
-
},
|
58
|
-
/**
|
59
|
-
* set value to pre-check toggle-switch
|
60
|
-
*/
|
61
|
-
inputValue: {
|
62
|
-
type: String,
|
63
|
-
required: false
|
64
|
-
},
|
65
|
-
/**
|
66
|
-
* text for label
|
67
|
-
*
|
68
|
-
* required if onLabel/offLabel are not set
|
69
|
-
*
|
70
|
-
* @requiredForAccessibility: true
|
71
|
-
*/
|
72
|
-
labelText: {
|
73
|
-
type: String,
|
74
|
-
required: false
|
75
|
-
},
|
76
|
-
/**
|
77
|
-
* text for on-label
|
78
|
-
*
|
79
|
-
* set to activate switch-label (=label is placed on toggle-switch (not behind))
|
80
|
-
*
|
81
|
-
* @requiredForAccessibility: true
|
82
|
-
*/
|
83
|
-
onLabel: {
|
84
|
-
type: String,
|
85
|
-
required: false
|
86
|
-
},
|
87
|
-
/**
|
88
|
-
* text for off-label
|
89
|
-
*
|
90
|
-
* set to activate switch-label (=label is placed on toggle-switch (not behind))
|
91
|
-
*
|
92
|
-
* @requiredForAccessibility: true
|
93
|
-
*/
|
94
|
-
offLabel: {
|
95
|
-
type: String,
|
96
|
-
required: false
|
97
|
-
},
|
98
|
-
/**
|
99
|
-
* set to true, if checkbox/radio-buttons should have green/checked and red/unchecked color-coding
|
100
|
-
*
|
101
|
-
* @affectsStyling: true
|
102
|
-
*/
|
103
|
-
colored: {
|
104
|
-
type: Boolean,
|
105
|
-
required: false
|
106
|
-
}
|
107
|
-
},
|
108
|
-
computed: {
|
109
|
-
isChecked() {
|
110
|
-
if (typeof this.value === 'boolean') {
|
111
|
-
return this.value
|
112
|
-
}
|
113
|
-
if (typeof this.value === 'string') {
|
114
|
-
return this.value === this.inputValue
|
115
|
-
}
|
116
|
-
if(this.value !== undefined) {
|
117
|
-
return this.value.includes(this.inputValue)
|
118
|
-
}
|
119
|
-
return false
|
120
|
-
}
|
121
|
-
},
|
122
|
-
methods: {
|
123
|
-
onChange(e) {
|
124
|
-
if (typeof this.value === 'boolean') {
|
125
|
-
this.$emit('update:value', e.target.checked)
|
126
|
-
} else if (typeof this.value === 'string') {
|
127
|
-
this.$emit('update:value', e.target.value)
|
128
|
-
} else {
|
129
|
-
let values = [...this.value]
|
130
|
-
if (e.target.checked) {
|
131
|
-
values.push(e.target.value)
|
132
|
-
} else {
|
133
|
-
values = values.filter(value => value !== e.target.value)
|
134
|
-
}
|
135
|
-
this.$emit('update:value', values)
|
136
|
-
}
|
137
|
-
}
|
138
|
-
}
|
139
|
-
}
|
140
|
-
</script>
|
141
|
-
|
142
|
-
<style lang="scss">
|
143
|
-
/* begin cmd-switch-button ------------------------------------------------------------------------------------------ */
|
144
|
-
/* no cmd-prefix-styling (class based on frontend-framework */
|
145
|
-
.toggle-switch {
|
146
|
-
&.switch-label {
|
147
|
-
&.colored {
|
148
|
-
&.off {
|
149
|
-
border-color: var(--error-color);
|
150
|
-
|
151
|
-
span {
|
152
|
-
&.label {
|
153
|
-
color: var(--error-color);
|
154
|
-
|
155
|
-
&::before {
|
156
|
-
border-color: var(--error-color);
|
157
|
-
background-color: var(--pure-white);
|
158
|
-
}
|
159
|
-
}
|
160
|
-
}
|
161
|
-
}
|
162
|
-
|
163
|
-
&.on {
|
164
|
-
border-color: var(--success-color);
|
165
|
-
|
166
|
-
span {
|
167
|
-
&.label {
|
168
|
-
color: var(--success-color);
|
169
|
-
|
170
|
-
&::before {
|
171
|
-
border-color: var(--success-color);
|
172
|
-
background-color: var(--success-color);
|
173
|
-
}
|
174
|
-
}
|
175
|
-
}
|
176
|
-
}
|
177
|
-
}
|
178
|
-
}
|
179
|
-
}
|
180
|
-
/* end cmd-switch-button ------------------------------------------------------------------------------------------ */
|
181
|
-
</style>
|