comand-component-library 3.1.97 → 3.1.99
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 +1 -1
- package/src/assets/styles/global-styles.scss +2 -3
- package/src/components/CmdBox.vue +7 -5
- package/src/components/CmdFancyBox.vue +2 -1
- package/src/components/CmdFormElement.vue +3 -1
- package/src/components/CmdFormFilters.vue +1 -1
- package/src/components/CmdInputGroup.vue +1 -1
- package/src/components/CmdLoginForm.vue +1 -1
- package/src/components/CmdMainNavigation.vue +2 -6
- package/src/components/CmdShareButtons.vue +15 -1
- package/src/components/CmdSiteHeader.vue +37 -12
- package/src/components/CmdSystemMessage.vue +25 -3
- package/src/components/CmdTabs.vue +8 -6
- package/src/components/CmdWidthLimitationWrapper.vue +25 -1
- package/src/documentation/generated/CmdSiteHeaderPropertyDescriptions.json +1 -1
- package/src/documentation/generated/CmdWidthLimitationWrapperPropertyDescriptions.json +7 -0
- package/src/index.js +3 -0
- package/src/main.js +3 -3
- package/src/utils/common.js +1 -6
- package/src/components/CmdMultipleSwitch.vue +0 -118
- package/src/directives/scrollPadding.js +0 -6
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "comand-component-library",
|
3
|
-
"version": "3.1.
|
3
|
+
"version": "3.1.99",
|
4
4
|
"private": false,
|
5
5
|
"scripts": {
|
6
6
|
"serve": "vue-cli-service serve",
|
@@ -18,7 +18,7 @@
|
|
18
18
|
],
|
19
19
|
"dependencies": {
|
20
20
|
"clickout-event": "^1.1.2",
|
21
|
-
"comand-frontend-framework": "^3.2.
|
21
|
+
"comand-frontend-framework": "^3.2.84",
|
22
22
|
"core-js": "^3.20.1",
|
23
23
|
"prismjs": "^1.27.0",
|
24
24
|
"sass": "^1.54.9",
|
package/src/App.vue
CHANGED
@@ -960,7 +960,7 @@
|
|
960
960
|
<CmdWidthLimitationWrapper>
|
961
961
|
<h2 class="headline-demopage">Login Form</h2>
|
962
962
|
<CmdForm :use-validation="true" :use-fieldset="false">
|
963
|
-
<CmdLoginForm v-model="loginData" textLegendLoginForm="Please log in"/>
|
963
|
+
<CmdLoginForm v-model="loginData" textLegendLoginForm="Please log in" />
|
964
964
|
</CmdForm>
|
965
965
|
<p>LoginData: {{ loginData }}</p>
|
966
966
|
</CmdWidthLimitationWrapper>
|
@@ -52,7 +52,7 @@
|
|
52
52
|
}
|
53
53
|
|
54
54
|
#component-library {
|
55
|
-
scroll-padding-top: unset !important
|
55
|
+
/*scroll-padding-top: unset !important;*/
|
56
56
|
scroll-snap-type: unset !important;
|
57
57
|
}
|
58
58
|
|
@@ -298,5 +298,4 @@ html {
|
|
298
298
|
}
|
299
299
|
}
|
300
300
|
}
|
301
|
-
|
302
|
-
/* ---------------------------------------------- END COLORS-SCHEMES (LIGHT-/DARK-MODE) -------------------------------------------------- */
|
301
|
+
/* ---------------------------------------------- END COLORS-SCHEMES (LIGHT-/DARK-MODE) -------------------------------------------------- */
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<template>
|
2
2
|
<!-- begin boxType 'content' -->
|
3
|
-
<div v-if="boxType === 'content'"
|
3
|
+
<div v-if="boxType === 'content'"
|
4
|
+
:class="['cmd-box box content', {open : open, collapsible: collapsible, 'stretch-vertically': stretchVertically, 'stretch-horizontally': stretchHorizontally}]">
|
4
5
|
<template v-if="useSlots?.includes('header')">
|
5
6
|
<!-- begin collapsible header with slot -->
|
6
7
|
<div v-if="collapsible" class="box-header">
|
@@ -67,7 +68,7 @@
|
|
67
68
|
<!-- begin boxType 'product' -->
|
68
69
|
<a v-else-if="boxType === 'product' && product" :class="['cmd-box box product', {'stretch-vertically': stretchVertically, 'stretch-horizontally': stretchHorizontally}]" href="#" @click.prevent="clickOnProduct(product)">
|
69
70
|
<div class="box-header flex-container vertical">
|
70
|
-
<figure v-if="product.image">
|
71
|
+
<figure v-if="product.image !== undefined">
|
71
72
|
<img :src="product.image.src" :alt="product.image.alt"/>
|
72
73
|
<figcaption>{{ product.name }}</figcaption>
|
73
74
|
</figure>
|
@@ -141,7 +142,7 @@ export default {
|
|
141
142
|
active: true
|
142
143
|
}
|
143
144
|
},
|
144
|
-
emits: ["click"],
|
145
|
+
emits: ["click", "toggle-collapse"],
|
145
146
|
props: {
|
146
147
|
collapsingBoxesOpen: {
|
147
148
|
type: Boolean,
|
@@ -314,14 +315,15 @@ export default {
|
|
314
315
|
}
|
315
316
|
|
316
317
|
&.collapsible {
|
317
|
-
.box-header {
|
318
|
+
a.box-header {
|
318
319
|
justify-content: space-between;
|
320
|
+
background: var(--primary-color);
|
319
321
|
|
320
322
|
&:hover, &:active, &:focus {
|
321
323
|
background: var(--pure-white);
|
322
324
|
|
323
325
|
* {
|
324
|
-
color: var(--
|
326
|
+
color: var(--primary-color);
|
325
327
|
}
|
326
328
|
}
|
327
329
|
}
|
@@ -36,7 +36,7 @@
|
|
36
36
|
<div :class="{'grayscale' : printInGrayscale}">
|
37
37
|
<!-- begin CmdHeadline -->
|
38
38
|
<CmdHeadline
|
39
|
-
v-
|
39
|
+
v-if="cmdHeadline?.show"
|
40
40
|
:headlineText="cmdHeadline?.headlineText"
|
41
41
|
:headlineLevel="cmdHeadline?.headlineLevel"
|
42
42
|
:id="htmlId"
|
@@ -49,6 +49,7 @@
|
|
49
49
|
<div v-else-if="fancyBoxContent" class="content" v-html="fancyBoxContent"></div>
|
50
50
|
<div v-else-if="fancyBoxElements" class="content"></div>
|
51
51
|
<div v-else-if="fancyBoxGallery" class="content">
|
52
|
+
|
52
53
|
<!-- begin CmdSlideButton -->
|
53
54
|
<CmdSlideButton @click.prevent="showPrevItem" slideButtonType="prev" />
|
54
55
|
<!-- end CmdSlideButton -->
|
@@ -218,6 +218,8 @@ import Tooltip from "../mixins/Tooltip.js"
|
|
218
218
|
// import components
|
219
219
|
import CmdTooltipForInputElements from "./CmdTooltipForInputElements"
|
220
220
|
|
221
|
+
const TYPES_WITHOUT_MAXLENGTH = ["color", "date", "datetime-local", "file", "number", "range"]
|
222
|
+
|
221
223
|
export default {
|
222
224
|
inheritAttrs: false,
|
223
225
|
name: "CmdFormElement",
|
@@ -708,7 +710,7 @@ export default {
|
|
708
710
|
return this.$attrs.maxlength > 0 ? this.$attrs.maxlength : 5000
|
709
711
|
}
|
710
712
|
|
711
|
-
if (
|
713
|
+
if (!TYPES_WITHOUT_MAXLENGTH.includes(this.$attrs.type)) {
|
712
714
|
return this.$attrs.maxlength > 0 ? this.$attrs.maxlength : 255
|
713
715
|
}
|
714
716
|
return null
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<template>
|
2
|
-
<ul class="cmd-form-filters">
|
2
|
+
<ul v-if="options.length" class="cmd-form-filters">
|
3
3
|
<li v-if="options.length > 1">
|
4
4
|
<a href="#" @click.prevent="deleteAllFilters">
|
5
5
|
<span v-if="linkDeleteAllFilters.icon && linkDeleteAllFilters.icon.show" :class="linkDeleteAllFilters.icon.iconClass" :title="linkDeleteAllFilters.icon.tooltip"></span>
|
@@ -18,7 +18,7 @@
|
|
18
18
|
v-if="useCustomTooltip && (validationStatus === '' || validationStatus === 'error')"
|
19
19
|
ref="tooltip"
|
20
20
|
:showRequirements="showRequirements"
|
21
|
-
:
|
21
|
+
:cmdListOfRequirements="listOfRequirements"
|
22
22
|
:validationStatus="validationStatus"
|
23
23
|
:validationMessage="getValidationMessage"
|
24
24
|
:inputAttributes="$attrs"
|
@@ -43,7 +43,7 @@
|
|
43
43
|
</div>
|
44
44
|
<!-- end form elements -->
|
45
45
|
|
46
|
-
<div class="option-wrapper flex-container"
|
46
|
+
<div class="option-wrapper flex-container">
|
47
47
|
<template v-if="options.forgotPassword || options.createAccount">
|
48
48
|
<!-- begin link for 'forgot password' -->
|
49
49
|
<a v-if="options.forgotPassword" href="#" @click.prevent="sendLogin = true">
|
@@ -70,9 +70,7 @@
|
|
70
70
|
<!-- begin type === router -->
|
71
71
|
<router-link v-if="navigationSubEntry.type === 'router'"
|
72
72
|
:to="getRoute(navigationSubEntry)"
|
73
|
-
:title="navigationSubEntry.tooltip"
|
74
|
-
:target="navigationSubEntry.target"
|
75
|
-
@click="executeLink($event, navigationSubEntry)">
|
73
|
+
:title="navigationSubEntry.tooltip">
|
76
74
|
<span v-if="navigationSubEntry.iconClass" :class="navigationSubEntry.iconClass"></span>
|
77
75
|
<span v-if="navigationSubEntry.text">{{ navigationSubEntry.text }}</span>
|
78
76
|
<span v-if="navigationSubEntry.subentries && navigationSubEntry.subentries.length > 0"
|
@@ -101,9 +99,7 @@
|
|
101
99
|
<!-- begin type === router -->
|
102
100
|
<router-link v-if="navigationEntry.type === 'router'"
|
103
101
|
:to="getRoute(navigationSubSubEntry)"
|
104
|
-
:target="navigationSubSubEntry.target"
|
105
|
-
:title="navigationSubSubEntry.tooltip"
|
106
|
-
@click="executeLink($event, navigationSubSubEntry)">
|
102
|
+
:target="navigationSubSubEntry.target">
|
107
103
|
<span v-if="navigationSubSubEntry.iconClass" :class="navigationSubSubEntry.iconClass"></span>
|
108
104
|
<span v-if="navigationSubSubEntry.text">{{ navigationSubSubEntry.text }}</span>
|
109
105
|
<span v-if="navigationSubSubEntry.subentries && navigationSubSubEntry.subentries.length > 0"
|
@@ -14,6 +14,7 @@
|
|
14
14
|
:key="shareButton.path" :class="['button', {disabled: userMustAcceptDataPrivacy && !dataPrivacyAccepted}]"
|
15
15
|
:id="shareButton.id"
|
16
16
|
:href="getUrl(shareButton)"
|
17
|
+
@click="preventOnDisabled"
|
17
18
|
target="_blank"
|
18
19
|
:title="tooltip(shareButton.tooltip)">
|
19
20
|
<span v-if="shareButton.iconClass && shareButton.iconPosition !== 'right'" :class="shareButton.iconClass"></span>
|
@@ -139,7 +140,20 @@ export default {
|
|
139
140
|
// if path is given completely by json-data
|
140
141
|
return shareButton.path
|
141
142
|
}
|
142
|
-
return
|
143
|
+
return "#"
|
144
|
+
},
|
145
|
+
preventOnDisabled(event) {
|
146
|
+
let clickedElement = event.target
|
147
|
+
|
148
|
+
if(clickedElement.tagName !== "A") {
|
149
|
+
// get surrounding <a> if inner <span> is clicked
|
150
|
+
clickedElement = clickedElement.closest("a")
|
151
|
+
}
|
152
|
+
|
153
|
+
// href must be set due to html-validity, so click must be prevented if href contains "#" only (equals button is styled as disabled)
|
154
|
+
if(clickedElement.getAttribute("href") === "#") {
|
155
|
+
event.preventDefault()
|
156
|
+
}
|
143
157
|
},
|
144
158
|
tooltip(tooltip) {
|
145
159
|
if(this.userMustAcceptDataPrivacy && this.dataPrivacyAccepted) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<template>
|
2
|
-
<div :class="['cmd-site-header', {
|
2
|
+
<div :class="['cmd-site-header', {sticky: sticky, 'navigation-inline': navigationInline }]" role="banner">
|
3
3
|
<!-- begin slot for elements above header -->
|
4
4
|
<div v-if="$slots.topheader" class="top-header">
|
5
5
|
<slot name="topheader"></slot>
|
@@ -7,14 +7,19 @@
|
|
7
7
|
<!-- end for elements above header -->
|
8
8
|
|
9
9
|
<!-- begin header-wrapper with slots for logo and other header elements -->
|
10
|
-
<header
|
10
|
+
<header
|
11
|
+
v-if="$slots.logo || $slots.header || $slots.navigation"
|
12
|
+
:class="[useGrid ? 'grid-container-create-columns': 'flex-container', {'has-navigation': cmdMainNavigation || $slots.navigation, 'one-child-only' : oneChildOnly},]">
|
11
13
|
<slot name="logo"></slot>
|
12
14
|
<slot name="header"></slot>
|
13
15
|
<slot name="navigation"></slot>
|
14
16
|
</header>
|
15
17
|
<!-- end header-wrapper with slots for logo and other header elements -->
|
16
18
|
|
17
|
-
<header
|
19
|
+
<header
|
20
|
+
v-if="cmdCompanyLogo || cmdMainNavigation?.navigationEntries?.length"
|
21
|
+
:class="[{'has-navigation': cmdMainNavigation, 'one-child-only' : oneChildOnly}, useGrid ? 'grid-container-create-columns': 'flex-container']">
|
22
|
+
|
18
23
|
<!-- begin CmdCompanyLogo -->
|
19
24
|
<CmdCompanyLogo
|
20
25
|
v-if="cmdCompanyLogo"
|
@@ -78,7 +83,7 @@ export default {
|
|
78
83
|
default: true
|
79
84
|
},
|
80
85
|
/**
|
81
|
-
* properties for
|
86
|
+
* properties for CmdCompanyLogo-component
|
82
87
|
*/
|
83
88
|
cmdCompanyLogo: {
|
84
89
|
type: Object,
|
@@ -91,6 +96,12 @@ export default {
|
|
91
96
|
type: Object,
|
92
97
|
required: false
|
93
98
|
}
|
99
|
+
},
|
100
|
+
computed: {
|
101
|
+
oneChildOnly() {
|
102
|
+
// check if sum of children equals "1" by turning objects into booleans, which will be converted to numbers by using "+".
|
103
|
+
return (!!this.cmdCompanyLogo + !!this.cmdMainNavigation + !!this.$slots.logo + !!this.$slots.header + !!this.$slots.navigation) === 1
|
104
|
+
}
|
94
105
|
}
|
95
106
|
}
|
96
107
|
</script>
|
@@ -118,10 +129,6 @@ export default {
|
|
118
129
|
padding: 0 var(--default-padding);
|
119
130
|
}
|
120
131
|
|
121
|
-
&:not(.navigation-inline) header {
|
122
|
-
padding-bottom: 0;
|
123
|
-
}
|
124
|
-
|
125
132
|
.cmd-main-navigation nav {
|
126
133
|
width: auto;
|
127
134
|
}
|
@@ -148,11 +155,21 @@ export default {
|
|
148
155
|
border-bottom: 0;
|
149
156
|
}
|
150
157
|
|
158
|
+
|
159
|
+
|
151
160
|
header {
|
152
161
|
padding-top: calc(var(--default-padding) * 2);
|
153
162
|
padding-bottom: calc(var(--default-padding) * 2);
|
154
|
-
|
155
|
-
|
163
|
+
|
164
|
+
&.has-navigation {
|
165
|
+
grid-template-rows: 1fr min-content;
|
166
|
+
grid-template-areas: "company-logo" "main-navigation";
|
167
|
+
padding-bottom: 0;
|
168
|
+
}
|
169
|
+
|
170
|
+
&.one-child-only {
|
171
|
+
gap: 0;
|
172
|
+
}
|
156
173
|
|
157
174
|
&.flex-container {
|
158
175
|
width: 100%;
|
@@ -175,12 +192,19 @@ export default {
|
|
175
192
|
.cmd-company-logo {
|
176
193
|
grid-column: span var(--grid-small-span);
|
177
194
|
}
|
195
|
+
|
196
|
+
> *:only-child {
|
197
|
+
gap: 0;
|
198
|
+
}
|
178
199
|
}
|
179
200
|
|
180
201
|
&.navigation-inline {
|
181
202
|
header {
|
182
|
-
|
183
|
-
|
203
|
+
&.has-navigation {
|
204
|
+
grid-template-rows: 1fr;
|
205
|
+
grid-template-areas: "company-logo main-navigation";
|
206
|
+
padding-bottom: calc(var(--default-padding) * 2);
|
207
|
+
}
|
184
208
|
|
185
209
|
.cmd-company-logo {
|
186
210
|
grid-column: span var(--grid-small-span);
|
@@ -188,6 +212,7 @@ export default {
|
|
188
212
|
|
189
213
|
#main-navigation-wrapper {
|
190
214
|
display: flex;
|
215
|
+
align-items: center;
|
191
216
|
border: 0;
|
192
217
|
grid-column: span var(--grid-large-span);
|
193
218
|
background: none;
|
@@ -141,13 +141,35 @@ export default {
|
|
141
141
|
}
|
142
142
|
|
143
143
|
> a[class*="icon-"]:not(.button) {
|
144
|
-
font-size:
|
145
|
-
|
146
|
-
|
144
|
+
font-size: 0.8rem;
|
145
|
+
font-weight: bold;
|
146
|
+
color: var(--pure-white);
|
147
147
|
position: absolute;
|
148
148
|
right: 0.5rem;
|
149
149
|
text-decoration: none;
|
150
150
|
top: 0.5rem;
|
151
|
+
border: var(--default-border);
|
152
|
+
border-color: var(--pure-white);
|
153
|
+
border-radius: var(--full-circle);
|
154
|
+
padding: calc(var(--default-padding) / 2);
|
155
|
+
|
156
|
+
&:hover, &:active, &:focus {
|
157
|
+
color: var(--hyperlink-color);
|
158
|
+
border-color: var(--hyperlink-color);
|
159
|
+
background: var(--pure-white);
|
160
|
+
}
|
161
|
+
}
|
162
|
+
|
163
|
+
&.warning {
|
164
|
+
> a[class*="icon-"]:not(.button) {
|
165
|
+
color: var(--text-color);
|
166
|
+
border-color: var(--text-color);
|
167
|
+
|
168
|
+
&:hover, &:active, &:focus {
|
169
|
+
color: var(--hyperlink-color);
|
170
|
+
border-color: var(--hyperlink-color);
|
171
|
+
}
|
172
|
+
}
|
151
173
|
}
|
152
174
|
}
|
153
175
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<template>
|
2
2
|
<div class="cmd-tabs">
|
3
3
|
<ul :class="{'stretch-tabs' : stretchTabs}" role="tablist">
|
4
|
-
<li
|
5
|
-
<a @click.prevent="setActiveTab(index)" :title="!tab.name ? tab.tooltip : false">
|
4
|
+
<li v-for="(tab, index) in tabs" :key="index" role="tab">
|
5
|
+
<a :class="{active : showTab === index}" @click.prevent="setActiveTab(index)" :title="!tab.name ? tab.tooltip : false" href="#">
|
6
6
|
<span v-if="tab.iconClass" :class="tab.iconClass"></span>
|
7
7
|
<span v-if="tab.name">{{ tab.name }}</span>
|
8
8
|
</a>
|
@@ -112,8 +112,6 @@ export default {
|
|
112
112
|
border-top-right-radius: var(--border-radius);
|
113
113
|
list-style-type: none;
|
114
114
|
background: var(--color-scheme-background-color);
|
115
|
-
border: var(--default-border);
|
116
|
-
border-bottom: 0;
|
117
115
|
|
118
116
|
&.active {
|
119
117
|
border-color: var(--primary-color);
|
@@ -125,12 +123,16 @@ export default {
|
|
125
123
|
justify-content: center;
|
126
124
|
padding: var(--default-padding);
|
127
125
|
color: var(--color-scheme-text-color);
|
126
|
+
border: var(--default-border);
|
127
|
+
border-bottom: 0;
|
128
128
|
border-top-left-radius: var(--border-radius);
|
129
129
|
border-top-right-radius: var(--border-radius);
|
130
|
+
text-decoration: none;
|
130
131
|
|
131
|
-
&:hover, &:active, &:focus {
|
132
|
+
&:hover, &:active, &:focus, &.active {
|
132
133
|
cursor: pointer;
|
133
|
-
color: var(--
|
134
|
+
color: var(--hyperlink-color);
|
135
|
+
border-color: var(--hyperlink-color);
|
134
136
|
}
|
135
137
|
}
|
136
138
|
}
|
@@ -2,6 +2,15 @@
|
|
2
2
|
<div class="cmd-width-limitation-wrapper" :class="{'sticky': sticky}">
|
3
3
|
<section v-if="innerWrapper" :class="setInnerClass">
|
4
4
|
<a v-if="anchorId" :id="anchorId"></a>
|
5
|
+
<!-- begin cmd-headline -->
|
6
|
+
<CmdHeadline
|
7
|
+
v-if="cmdHeadline"
|
8
|
+
:pre-headline-text="cmdHeadline.preHeadlineLevel"
|
9
|
+
:headline-text="cmdHeadline.headlineText"
|
10
|
+
:headline-level="cmdHeadline.headlineLevel"
|
11
|
+
/>
|
12
|
+
<!-- end cmd-headline -->
|
13
|
+
|
5
14
|
<!-- begin slot-content -->
|
6
15
|
<slot></slot>
|
7
16
|
<!-- end slot-content -->
|
@@ -16,8 +25,14 @@
|
|
16
25
|
</template>
|
17
26
|
|
18
27
|
<script>
|
28
|
+
// import components
|
29
|
+
import CmdHeadline from "./CmdHeadline"
|
30
|
+
|
19
31
|
export default {
|
20
32
|
name: "CmdWidthLimitationWrapper",
|
33
|
+
components: {
|
34
|
+
CmdHeadline
|
35
|
+
},
|
21
36
|
props: {
|
22
37
|
/**
|
23
38
|
* set a html-tag as inner tag
|
@@ -67,7 +82,16 @@ export default {
|
|
67
82
|
anchorId: {
|
68
83
|
type: String,
|
69
84
|
required: false
|
70
|
-
}
|
85
|
+
},
|
86
|
+
/**
|
87
|
+
* properties for CmdHeadline-component
|
88
|
+
*
|
89
|
+
* @requiredForAccessibilty
|
90
|
+
*/
|
91
|
+
cmdHeadline: {
|
92
|
+
type: Object,
|
93
|
+
required: false
|
94
|
+
},
|
71
95
|
},
|
72
96
|
computed: {
|
73
97
|
setInnerClass() {
|
package/src/index.js
CHANGED
@@ -47,5 +47,8 @@ export { default as CmdWidthLimitationWrapper } from '@/components/CmdWidthLimit
|
|
47
47
|
export { default as DirFocus } from '@/directives/focus'
|
48
48
|
export { default as DirTelephone } from '@/directives/telephone'
|
49
49
|
|
50
|
+
// export directives
|
51
|
+
export { createUuid, createHtmlId } from '@/utils/common'
|
52
|
+
|
50
53
|
// export composables
|
51
54
|
export { useSequence } from '@/composables/sequence'
|
package/src/main.js
CHANGED
@@ -13,6 +13,7 @@ import 'comand-frontend-framework/src/assets/css/framework-iconfont.css'
|
|
13
13
|
/* end imports css from comand-frontend-framework ---------------------------------------------------------------------------------------- */
|
14
14
|
|
15
15
|
import { createApp } from 'vue'
|
16
|
+
|
16
17
|
// import App from './App.vue'
|
17
18
|
import App from './App'
|
18
19
|
//import { createRouter, createWebHistory } from 'vue-router'
|
@@ -21,10 +22,9 @@ import "clickout-event"
|
|
21
22
|
/* import directives */
|
22
23
|
// directive to format telephone- and fax-number
|
23
24
|
import directiveTelephone from "./directives/telephone"
|
25
|
+
|
24
26
|
// directive to set focus on specific form-elements
|
25
27
|
import directiveFocus from "./directives/focus"
|
26
|
-
// directive to set scroll-padding to place anchors correctly below sticky header
|
27
|
-
import directiveScrollPadding from "./directives/scrollPadding"
|
28
28
|
|
29
29
|
/* begin imports css from comand-component-library ---------------------------------------------------------------------------------------- */
|
30
30
|
/* import additional iconfont containing company-logos */
|
@@ -60,4 +60,4 @@ import router from "./router"
|
|
60
60
|
// })
|
61
61
|
|
62
62
|
// createApp(App).use(router).directive('telephone', directiveTelephone).directive('focus', directiveFocus).mount('#app')
|
63
|
-
createApp(App).use(router).directive('telephone', directiveTelephone).directive('focus', directiveFocus).
|
63
|
+
createApp(App).use(router).directive('telephone', directiveTelephone).directive('focus', directiveFocus).mount('#app')
|
package/src/utils/common.js
CHANGED
@@ -1,8 +1,3 @@
|
|
1
|
-
function isFrameMode() {
|
2
|
-
const frameUrl = new URL(location)
|
3
|
-
return frameUrl.searchParams.has("frameMode")
|
4
|
-
}
|
5
|
-
|
6
1
|
function createUuid(){
|
7
2
|
let dt = new Date().getTime()
|
8
3
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {
|
@@ -16,4 +11,4 @@ function createHtmlId() {
|
|
16
11
|
return "cmd-" + createUuid()
|
17
12
|
}
|
18
13
|
|
19
|
-
export {
|
14
|
+
export {createUuid, createHtmlId}
|
@@ -1,118 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<div :class="['cmd-multiple-switch multiple-switch label', {disabled: status === 'disabled', error: status === 'error'}]" :aria-labelledby="labelId">
|
3
|
-
<span v-show="showLabel" :id="htmlId">{{ labelText }}</span>
|
4
|
-
<span class="flex-container no-gap no-flex">
|
5
|
-
<label :class="{disabled: status === 'disabled'}" :for="multipleswitch.id"
|
6
|
-
v-for="(multipleswitch, index) in multipleSwitches" :key="index">
|
7
|
-
<input :type="switchTypes"
|
8
|
-
:id="multipleswitch.id"
|
9
|
-
:disabled="status === 'disabled'"
|
10
|
-
:name="switchNames"
|
11
|
-
:value="multipleswitch.value"
|
12
|
-
:checked="isChecked(multipleswitch)"
|
13
|
-
@change="onChange"
|
14
|
-
/>
|
15
|
-
<span v-if="multipleswitch.iconClass" :class="multipleswitch.iconClass"></span>
|
16
|
-
<span v-if="multipleswitch.labelText">{{ multipleswitch.labelText }}</span>
|
17
|
-
</label>
|
18
|
-
</span>
|
19
|
-
</div>
|
20
|
-
</template>
|
21
|
-
|
22
|
-
<script>
|
23
|
-
// import mixins
|
24
|
-
import Identifier from "../mixins/Identifier"
|
25
|
-
|
26
|
-
export default {
|
27
|
-
name: "CmdMultipleSwitch",
|
28
|
-
mixins: [Identifier],
|
29
|
-
props: {
|
30
|
-
/**
|
31
|
-
* value for v-model
|
32
|
-
*/
|
33
|
-
value: {
|
34
|
-
type: [String, Array],
|
35
|
-
required: false,
|
36
|
-
default: ""
|
37
|
-
},
|
38
|
-
/**
|
39
|
-
* toggle label visibility
|
40
|
-
*/
|
41
|
-
showLabel: {
|
42
|
-
type: Boolean,
|
43
|
-
default: true
|
44
|
-
},
|
45
|
-
/**
|
46
|
-
* text for label
|
47
|
-
*
|
48
|
-
* @requiredForAccessibility: true
|
49
|
-
*/
|
50
|
-
labelText: {
|
51
|
-
type: String,
|
52
|
-
required: false
|
53
|
-
},
|
54
|
-
/**
|
55
|
-
* list of switches
|
56
|
-
*/
|
57
|
-
multipleSwitches: {
|
58
|
-
type: Array,
|
59
|
-
required: true
|
60
|
-
},
|
61
|
-
/**
|
62
|
-
* set type for switches
|
63
|
-
*
|
64
|
-
* @allowedValues: checkbox, radio
|
65
|
-
*/
|
66
|
-
switchTypes: {
|
67
|
-
type: String,
|
68
|
-
required: true
|
69
|
-
},
|
70
|
-
/**
|
71
|
-
* name-attribute for switches
|
72
|
-
*/
|
73
|
-
switchNames: {
|
74
|
-
type: String,
|
75
|
-
required: true
|
76
|
-
},
|
77
|
-
/**
|
78
|
-
* status for all switches
|
79
|
-
*
|
80
|
-
* @allowedValues: error, disabled
|
81
|
-
*/
|
82
|
-
status: {
|
83
|
-
type: String,
|
84
|
-
required: false
|
85
|
-
}
|
86
|
-
},
|
87
|
-
methods: {
|
88
|
-
onChange(e) {
|
89
|
-
if (typeof this.value === "string") {
|
90
|
-
this.$emit("update:value", e.target.value)
|
91
|
-
} else if (this.value !== undefined) {
|
92
|
-
let values = [...this.value]
|
93
|
-
if (e.target.checked) {
|
94
|
-
values.push(e.target.value)
|
95
|
-
} else {
|
96
|
-
values = values.filter(value => value !== e.target.value)
|
97
|
-
}
|
98
|
-
this.$emit("update:value", values)
|
99
|
-
}
|
100
|
-
},
|
101
|
-
isChecked(multipleswitch) {
|
102
|
-
if (typeof this.value === "string") {
|
103
|
-
return this.value === multipleswitch.value
|
104
|
-
}
|
105
|
-
if (this.value !== undefined) {
|
106
|
-
return this.value.includes(multipleswitch.value)
|
107
|
-
}
|
108
|
-
return false
|
109
|
-
}
|
110
|
-
}
|
111
|
-
}
|
112
|
-
</script>
|
113
|
-
|
114
|
-
<style lang="scss">
|
115
|
-
/* begin cmd-multiple-switch ------------------------------------------------------------------------------------------ */
|
116
|
-
|
117
|
-
/* end cmd-multiple-switch ------------------------------------------------------------------------------------------ */
|
118
|
-
</style>
|