comand-component-library 3.3.86 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/comand-component-library.js +856 -835
- package/dist/comand-component-library.umd.cjs +4 -4
- package/dist/media/images/slideshow-images/large/slide1.jpg +0 -0
- package/dist/media/images/slideshow-images/large/slide2.jpg +0 -0
- package/dist/media/images/slideshow-images/large/slide3.jpg +0 -0
- package/dist/media/images/slideshow-images/large/slide4.jpg +0 -0
- package/dist/media/images/slideshow-images/medium/slide1.jpg +0 -0
- package/dist/media/images/slideshow-images/medium/slide2.jpg +0 -0
- package/dist/media/images/slideshow-images/medium/slide3.jpg +0 -0
- package/dist/media/images/slideshow-images/medium/slide4.jpg +0 -0
- package/dist/media/images/slideshow-images/small/slide1.jpg +0 -0
- package/dist/media/images/slideshow-images/small/slide2.jpg +0 -0
- package/dist/media/images/slideshow-images/small/slide3.jpg +0 -0
- package/dist/media/images/slideshow-images/small/slide4.jpg +0 -0
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/App.vue +680 -632
- package/src/assets/data/address-data.json +3 -3
- package/src/components/CmdAddressData.vue +90 -96
- package/src/components/CmdAddressDataItem.vue +60 -52
- package/src/components/CmdBankAccountData.vue +1 -1
- package/src/components/CmdBox.vue +10 -10
- package/src/components/CmdBoxWrapper.vue +8 -4
- package/src/components/CmdBreadcrumbs.vue +1 -1
- package/src/components/CmdCompanyLogo.vue +14 -11
- package/src/components/CmdContainer.vue +24 -0
- package/src/components/CmdCookieDisclaimer.vue +1 -1
- package/src/components/CmdCopyrightInformation.vue +1 -1
- package/src/components/CmdFancyBox.vue +9 -6
- package/src/components/CmdForm.vue +7 -1
- package/src/components/CmdFormElement.vue +21 -75
- package/src/components/CmdFormFilters.vue +2 -1
- package/src/components/CmdGoogleMaps.vue +1 -1
- package/src/components/CmdHeadline.vue +20 -25
- package/src/components/CmdIcon.vue +1 -1
- package/src/components/CmdImage.vue +1 -1
- package/src/components/CmdImageGallery.vue +1 -1
- package/src/components/CmdImageZoom.vue +1 -1
- package/src/components/CmdInputGroup.vue +2 -2
- package/src/components/CmdListOfLinks.vue +1 -1
- package/src/components/CmdListOfLinksItem.vue +0 -4
- package/src/components/CmdListOfRequirements.vue +10 -2
- package/src/components/CmdLoginForm.vue +1 -1
- package/src/components/CmdMainNavigation.vue +18 -17
- package/src/components/CmdMultistepFormProgressBar.vue +7 -3
- package/src/components/CmdNewsletterSubscription.vue +1 -8
- package/src/components/CmdOpeningHours.vue +1 -1
- package/src/components/CmdOpeningHoursItem.vue +1 -1
- package/src/components/CmdPagination.vue +21 -15
- package/src/components/CmdProgressBar.vue +1 -1
- package/src/components/CmdSidebar.vue +7 -1
- package/src/components/CmdSiteFooter.vue +14 -14
- package/src/components/CmdSiteHeader.vue +12 -29
- package/src/components/CmdSlideButton.vue +9 -7
- package/src/components/CmdSlideshow.vue +14 -12
- package/src/components/CmdSocialNetworks.vue +11 -4
- package/src/components/CmdSocialNetworksItem.vue +2 -7
- package/src/components/CmdSwitchLanguage.vue +1 -1
- package/src/components/CmdSystemMessage.vue +10 -6
- package/src/components/CmdTable.vue +72 -17
- package/src/components/CmdTabs.vue +2 -2
- package/src/components/CmdTextImageBlock.vue +1 -1
- package/src/components/CmdThumbnailScroller.vue +157 -152
- package/src/components/CmdToggleDarkMode.vue +1 -1
- package/src/components/CmdTooltip.vue +1 -1
- package/src/components/CmdUploadForm.vue +2 -2
- package/src/components/CmdWidthLimitationWrapper.vue +7 -3
- package/src/index.js +1 -0
- package/src/mixins/FieldValidation.js +0 -17
@@ -23,7 +23,7 @@
|
|
23
23
|
v-for="(page, index) in pages"
|
24
24
|
:key="index"
|
25
25
|
@click.stop.prevent="showPage(page)" aria-live="polite">
|
26
|
-
|
26
|
+
<span :class="{hidden: !showPageNumbers}">{{ index + 1 }}</span>
|
27
27
|
</a>
|
28
28
|
</div>
|
29
29
|
</div>
|
@@ -48,11 +48,12 @@
|
|
48
48
|
// import mixins
|
49
49
|
import I18n from "../mixins/I18n"
|
50
50
|
import DefaultMessageProperties from "../mixins/CmdPager/DefaultMessageProperties"
|
51
|
+
|
51
52
|
export default {
|
52
53
|
name: "CmdPager",
|
53
54
|
mixins: [
|
54
|
-
|
55
|
-
|
55
|
+
I18n,
|
56
|
+
DefaultMessageProperties
|
56
57
|
],
|
57
58
|
emits: ['click'],
|
58
59
|
data() {
|
@@ -165,10 +166,8 @@ export default {
|
|
165
166
|
}
|
166
167
|
</script>
|
167
168
|
|
168
|
-
<style
|
169
|
+
<style>
|
169
170
|
/* begin cmd-pagination ---------------------------------------------------------------------------------------- */
|
170
|
-
@import '../assets/styles/variables';
|
171
|
-
|
172
171
|
.cmd-pager {
|
173
172
|
display: flex;
|
174
173
|
justify-content: space-between;
|
@@ -208,7 +207,14 @@ export default {
|
|
208
207
|
}
|
209
208
|
}
|
210
209
|
|
211
|
-
|
210
|
+
}
|
211
|
+
</style>
|
212
|
+
|
213
|
+
<style lang="scss">
|
214
|
+
@import '../assets/styles/variables';
|
215
|
+
|
216
|
+
@media only screen and (max-width: $medium-max-width) {
|
217
|
+
.cmd-pager {
|
212
218
|
> a.button {
|
213
219
|
span {
|
214
220
|
margin: 0;
|
@@ -218,16 +224,16 @@ export default {
|
|
218
224
|
}
|
219
225
|
}
|
220
226
|
}
|
221
|
-
}
|
222
227
|
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
228
|
+
@media only screen and (max-width: $small-max-width) {
|
229
|
+
.button {
|
230
|
+
width: auto; /* overwrite default settings from framework.css */
|
231
|
+
}
|
227
232
|
|
228
|
-
|
229
|
-
|
230
|
-
|
233
|
+
.page-index {
|
234
|
+
.flex-container {
|
235
|
+
flex-direction: row; /* overwrite default settings from framework.css */
|
236
|
+
}
|
231
237
|
}
|
232
238
|
}
|
233
239
|
}
|
@@ -122,7 +122,8 @@ export default {
|
|
122
122
|
}
|
123
123
|
</script>
|
124
124
|
|
125
|
-
<style
|
125
|
+
<style>
|
126
|
+
/* begin cmd-sidebar ---------------------------------------------------------------------------------------- */
|
126
127
|
.cmd-sidebar {
|
127
128
|
display: flex;
|
128
129
|
height: 100%;
|
@@ -131,6 +132,10 @@ export default {
|
|
131
132
|
padding: 0;
|
132
133
|
}
|
133
134
|
|
135
|
+
.cmd-box-wrapper > .grid-container-create-columns {
|
136
|
+
grid-template-columns: repeat(1, minmax(0, 1fr));
|
137
|
+
}
|
138
|
+
|
134
139
|
.inner-sidebar-wrapper {
|
135
140
|
flex: 1;
|
136
141
|
display: flex;
|
@@ -164,4 +169,5 @@ export default {
|
|
164
169
|
}
|
165
170
|
}
|
166
171
|
}
|
172
|
+
/* end cmd-sidebar ---------------------------------------------------------------------------------------- */
|
167
173
|
</style>
|
@@ -23,10 +23,8 @@ export default {
|
|
23
23
|
}
|
24
24
|
</script>
|
25
25
|
|
26
|
-
<style
|
26
|
+
<style>
|
27
27
|
/* begin cmd-site-footer ---------------------------------------------------------------------------------------- */
|
28
|
-
@import '../assets/styles/variables';
|
29
|
-
|
30
28
|
.cmd-site-footer {
|
31
29
|
padding: var(--grid-gap) 0;
|
32
30
|
border-top: var(--default-border);
|
@@ -49,6 +47,10 @@ export default {
|
|
49
47
|
flex: none;
|
50
48
|
}
|
51
49
|
}
|
50
|
+
</style>
|
51
|
+
|
52
|
+
<style lang="scss">
|
53
|
+
@import '../assets/styles/variables';
|
52
54
|
|
53
55
|
@media only screen and (max-width: $medium-max-width) {
|
54
56
|
.cmd-site-footer {
|
@@ -57,21 +59,19 @@ export default {
|
|
57
59
|
margin-bottom: calc(var(--default-margin) * 2);
|
58
60
|
}
|
59
61
|
}
|
60
|
-
}
|
61
|
-
}
|
62
62
|
|
63
|
-
@media only screen and (max-width: $small-max-width) {
|
64
|
-
|
65
|
-
|
66
|
-
text-decoration: underline;
|
63
|
+
@media only screen and (max-width: $small-max-width) {
|
64
|
+
a {
|
65
|
+
text-decoration: underline;
|
67
66
|
|
68
|
-
|
69
|
-
|
67
|
+
&:active {
|
68
|
+
text-decoration: none;
|
69
|
+
}
|
70
70
|
}
|
71
|
-
}
|
72
71
|
|
73
|
-
|
74
|
-
|
72
|
+
h4, h5, h6 {
|
73
|
+
margin-top: var(--default-margin);
|
74
|
+
}
|
75
75
|
}
|
76
76
|
}
|
77
77
|
}
|
@@ -1,5 +1,7 @@
|
|
1
1
|
<template>
|
2
|
-
<div
|
2
|
+
<div
|
3
|
+
:class="['cmd-site-header site-header', {sticky: sticky, 'navigation-inline': navigationInline, 'off-canvas-right': cmdMainNavigation?.offcanvasPosition === 'right'}]"
|
4
|
+
role="banner">
|
3
5
|
<!-- begin slot for elements above header -->
|
4
6
|
<div v-if="$slots.topheader" class="top-header">
|
5
7
|
<slot name="topheader"></slot>
|
@@ -106,7 +108,7 @@ export default {
|
|
106
108
|
}
|
107
109
|
},
|
108
110
|
methods: {
|
109
|
-
emitOffcanvasStatus(event){
|
111
|
+
emitOffcanvasStatus(event) {
|
110
112
|
this.$emit("offcanvas", event)
|
111
113
|
}
|
112
114
|
}
|
@@ -115,8 +117,6 @@ export default {
|
|
115
117
|
|
116
118
|
<style lang="scss">
|
117
119
|
/* begin cmd-site-header ---------------------------------------------------------------------------------------- */
|
118
|
-
@import '../assets/styles/variables';
|
119
|
-
|
120
120
|
.cmd-site-header {
|
121
121
|
grid-area: site-header;
|
122
122
|
display: flex;
|
@@ -152,7 +152,7 @@ export default {
|
|
152
152
|
border-bottom: 0;
|
153
153
|
}
|
154
154
|
|
155
|
-
|
155
|
+
/* use id to ensure high specificity */
|
156
156
|
> .cmd-main-navigation#main-navigation-wrapper:last-child {
|
157
157
|
border-bottom: 0;
|
158
158
|
}
|
@@ -183,14 +183,10 @@ export default {
|
|
183
183
|
.cmd-main-navigation,
|
184
184
|
nav ul li {
|
185
185
|
border-bottom: 0;
|
186
|
-
background: none;
|
187
|
-
}
|
188
|
-
|
189
|
-
.cmd-company-logo {
|
190
|
-
grid-column: span var(--grid-small-span);
|
191
186
|
}
|
192
187
|
}
|
193
188
|
|
189
|
+
/* begin inline-navigation (shares spaces with company-logo */
|
194
190
|
&.navigation-inline {
|
195
191
|
header {
|
196
192
|
&.has-navigation {
|
@@ -209,26 +205,7 @@ export default {
|
|
209
205
|
display: flex;
|
210
206
|
align-items: center;
|
211
207
|
justify-content: flex-end;
|
212
|
-
border: 0;
|
213
208
|
grid-column: span var(--grid-large-span);
|
214
|
-
background: none;
|
215
|
-
|
216
|
-
:where(nav, .nav) {
|
217
|
-
margin-right: 0;
|
218
|
-
|
219
|
-
> ul {
|
220
|
-
border: 0;
|
221
|
-
background: none;
|
222
|
-
|
223
|
-
li {
|
224
|
-
border: 0;
|
225
|
-
|
226
|
-
ul {
|
227
|
-
border-top: var(--default-border);
|
228
|
-
}
|
229
|
-
}
|
230
|
-
}
|
231
|
-
}
|
232
209
|
|
233
210
|
&:not(.persist-on-mobile) {
|
234
211
|
padding-left: 0 !important;
|
@@ -244,7 +221,13 @@ export default {
|
|
244
221
|
}
|
245
222
|
}
|
246
223
|
}
|
224
|
+
|
225
|
+
/* end inline-navigation (shares spaces with company-logo */
|
247
226
|
}
|
227
|
+
</style>
|
228
|
+
|
229
|
+
<style lang="scss">
|
230
|
+
@import '../assets/styles/variables';
|
248
231
|
|
249
232
|
@media only screen and (max-width: $medium-max-width) {
|
250
233
|
.cmd-site-header {
|
@@ -66,8 +66,6 @@ export default {
|
|
66
66
|
|
67
67
|
<style lang="scss">
|
68
68
|
/* begin cmd-slide-button ---------------------------------------------------------------------------------------- */
|
69
|
-
@import '../assets/styles/variables';
|
70
|
-
|
71
69
|
.cmd-slide-button {
|
72
70
|
&.button {
|
73
71
|
font-size: 2rem;
|
@@ -84,10 +82,6 @@ export default {
|
|
84
82
|
align-self: center;
|
85
83
|
}
|
86
84
|
|
87
|
-
&:hover, &:active, &:focus {
|
88
|
-
transition: var(--default-transition);
|
89
|
-
}
|
90
|
-
|
91
85
|
&.prev {
|
92
86
|
left: 0;
|
93
87
|
top: 0;
|
@@ -111,7 +105,15 @@ export default {
|
|
111
105
|
}
|
112
106
|
}
|
113
107
|
|
114
|
-
|
108
|
+
|
109
|
+
}
|
110
|
+
</style>
|
111
|
+
|
112
|
+
<style lang="scss">
|
113
|
+
@import '../assets/styles/variables';
|
114
|
+
|
115
|
+
@media only screen and (max-width: $small-max-width) {
|
116
|
+
.cmd-slide-button {
|
115
117
|
&.button {
|
116
118
|
width: auto; /* overwrite button-behavior for small-devices from frontend-framework */
|
117
119
|
}
|
@@ -313,10 +313,8 @@ export default {
|
|
313
313
|
}
|
314
314
|
</script>
|
315
315
|
|
316
|
-
<style
|
316
|
+
<style>
|
317
317
|
/* begin cmd-slideshow ---------------------------------------------------------------------------------------- */
|
318
|
-
@import '../assets/styles/variables';
|
319
|
-
|
320
318
|
.cmd-slideshow {
|
321
319
|
figure a, img {
|
322
320
|
display: block;
|
@@ -375,12 +373,11 @@ export default {
|
|
375
373
|
|
376
374
|
.image-wrapper {
|
377
375
|
width: 100%;
|
378
|
-
min-width: 11.1rem;
|
376
|
+
min-width: 11.1rem; /* assure to be as wide as action-buttons in edit-mode */
|
379
377
|
min-height: 50rem;
|
380
378
|
}
|
381
379
|
|
382
380
|
> ol {
|
383
|
-
display: -webkit-flex; /* Safari 6-8 */
|
384
381
|
display: flex;
|
385
382
|
margin: 0 auto;
|
386
383
|
position: absolute;
|
@@ -404,7 +401,7 @@ export default {
|
|
404
401
|
}
|
405
402
|
|
406
403
|
&:hover, &:active, &:focus, &.active {
|
407
|
-
border-color: var(--
|
404
|
+
border-color: var(--hyperlink-color);
|
408
405
|
|
409
406
|
a {
|
410
407
|
background: var(--pure-white);
|
@@ -448,12 +445,6 @@ export default {
|
|
448
445
|
background: var(--pure-white-reduced-opacity);
|
449
446
|
}
|
450
447
|
}
|
451
|
-
|
452
|
-
@media only screen and (max-width: $medium-max-width) {
|
453
|
-
figcaption {
|
454
|
-
font-size: 2rem;
|
455
|
-
}
|
456
|
-
}
|
457
448
|
}
|
458
449
|
|
459
450
|
.edit-mode .cmd-slideshow .image-wrapper.edit-items {
|
@@ -464,6 +455,17 @@ export default {
|
|
464
455
|
font-size: 3rem;
|
465
456
|
}
|
466
457
|
}
|
458
|
+
</style>
|
467
459
|
|
460
|
+
<style lang="scss">
|
461
|
+
@import '../assets/styles/variables';
|
462
|
+
|
463
|
+
@media only screen and (max-width: $medium-max-width) {
|
464
|
+
.cmd-slideshow {
|
465
|
+
figcaption {
|
466
|
+
font-size: 2rem;
|
467
|
+
}
|
468
|
+
}
|
469
|
+
}
|
468
470
|
/* end cmd-slideshow ------------------------------------------------------------------------------------------ */
|
469
471
|
</style>
|
@@ -21,12 +21,17 @@
|
|
21
21
|
|
22
22
|
<!-- begin list of networks -->
|
23
23
|
<ul v-if="validNetworks.length > 0" :class="['button-wrapper', {'no-gap': !useGap}]">
|
24
|
+
<!-- begin cmd-social-networks (default view) -->
|
24
25
|
<CmdSocialNetworksItem
|
25
26
|
v-if="!editModeContext"
|
26
27
|
v-for="(entry, index) in validNetworks"
|
27
28
|
:key="index"
|
28
29
|
:network="entry"
|
29
|
-
|
30
|
+
:userMustAcceptDataPrivacy="userMustAcceptDataPrivacy"
|
31
|
+
:buttonTextAlign="buttonTextAlign"
|
32
|
+
:dataPrivacyAccepted="dataPrivacyAccepted"
|
33
|
+
/>
|
34
|
+
<!-- end cmd-social-networks (default view) -->
|
30
35
|
|
31
36
|
<!-- begin edit-mode -->
|
32
37
|
<EditComponentWrapper
|
@@ -254,8 +259,6 @@ export default {
|
|
254
259
|
|
255
260
|
<style lang="scss">
|
256
261
|
/* begin cmd-social-networks -------------------------------------------------------------------------------------------- */
|
257
|
-
@import "../assets/styles/variables";
|
258
|
-
|
259
262
|
.cmd-social-networks {
|
260
263
|
display: flex;
|
261
264
|
flex-direction: column;
|
@@ -285,7 +288,7 @@ export default {
|
|
285
288
|
margin: 0;
|
286
289
|
}
|
287
290
|
|
288
|
-
|
291
|
+
&.text-align-right {
|
289
292
|
flex-direction: row-reverse;
|
290
293
|
}
|
291
294
|
}
|
@@ -401,6 +404,10 @@ export default {
|
|
401
404
|
--social-network-color: #0077b5;
|
402
405
|
}
|
403
406
|
}
|
407
|
+
</style>
|
408
|
+
|
409
|
+
<style lang="scss">
|
410
|
+
@import "../assets/styles/variables";
|
404
411
|
|
405
412
|
@container (max-width: #{$small-max-width}) {
|
406
413
|
.button-wrapper {
|
@@ -10,11 +10,7 @@
|
|
10
10
|
:title="tooltip(network.tooltip)">
|
11
11
|
|
12
12
|
<!-- begin CmdIcon -->
|
13
|
-
<CmdIcon
|
14
|
-
v-if="network.iconClass"
|
15
|
-
:iconClass="network.iconClass"
|
16
|
-
:type="network.iconType"
|
17
|
-
/>
|
13
|
+
<CmdIcon v-if="network.iconClass" :iconClass="network.iconClass" :type="network.iconType" />
|
18
14
|
<!-- end CmdIcon -->
|
19
15
|
|
20
16
|
<span v-if="network.linkText">{{ network.linkText }}</span>
|
@@ -46,8 +42,7 @@ export default {
|
|
46
42
|
* toggle if user has to accept that anonymous data will be send while sharing
|
47
43
|
*/
|
48
44
|
userMustAcceptDataPrivacy: {
|
49
|
-
type: Boolean
|
50
|
-
default: true
|
45
|
+
type: Boolean
|
51
46
|
},
|
52
47
|
/**
|
53
48
|
* alignment for buttons
|
@@ -130,7 +130,7 @@ export default {
|
|
130
130
|
}
|
131
131
|
</script>
|
132
132
|
|
133
|
-
<style
|
133
|
+
<style>
|
134
134
|
/* begin cmd-system-message ---------------------------------------------------------------------------------------- */
|
135
135
|
.cmd-system-message {
|
136
136
|
margin: var(--default-margin) 0;
|
@@ -158,31 +158,35 @@ export default {
|
|
158
158
|
text-decoration: none;
|
159
159
|
z-index: 100;
|
160
160
|
line-height: 1;
|
161
|
+
background: var(--pure-white);
|
162
|
+
border-radius: var(--full-circle);
|
161
163
|
|
162
164
|
[class*="icon-"] {
|
163
|
-
color: var(--
|
165
|
+
color: var(--default-text-color);
|
164
166
|
}
|
165
167
|
|
166
168
|
&:hover, &:active, &:focus {
|
169
|
+
background: none;
|
170
|
+
|
167
171
|
[class*="icon-"] {
|
168
|
-
color: var(--
|
172
|
+
color: var(--pure-white);
|
169
173
|
}
|
170
174
|
}
|
171
175
|
}
|
172
176
|
|
173
177
|
&.warning {
|
174
178
|
> a:not(.button) {
|
175
|
-
border-color: var(--text-color);
|
179
|
+
border-color: var(--default-text-color);
|
176
180
|
|
177
181
|
[class*="icon-"] {
|
178
|
-
color: var(--text-color);
|
182
|
+
color: var(--default-text-color);
|
179
183
|
}
|
180
184
|
|
181
185
|
&:hover, &:active, &:focus {
|
182
186
|
border-color: var(--hyperlink-color);
|
183
187
|
|
184
188
|
[class*="icon-"] {
|
185
|
-
color: var(--
|
189
|
+
color: var(--pure-white);
|
186
190
|
}
|
187
191
|
}
|
188
192
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<template>
|
2
2
|
<div
|
3
|
-
:class="['cmd-table-wrapper', {'collapsed': !showTableData, 'full-width': fullWidth, 'has-caption': hasCaption}]">
|
3
|
+
:class="['cmd-table-wrapper', {'collapsed': !showTableData, 'full-width': fullWidth, 'has-caption': hasCaption, 'has-overflow': hasOverflow}]">
|
4
4
|
<div v-if="collapsible || userCanToggleWidth" class="button-wrapper">
|
5
5
|
<a v-if="userCanToggleWidth" class="button"
|
6
6
|
href="#" @click.prevent="fullWidth = !fullWidth"
|
@@ -20,7 +20,7 @@
|
|
20
20
|
<!-- end CmdIcon -->
|
21
21
|
</a>
|
22
22
|
</div>
|
23
|
-
<div class="inner-wrapper">
|
23
|
+
<div class="inner-wrapper" ref="innerWrapper" @scroll="updatePosition">
|
24
24
|
<!-- begin CmdSlideButton -->
|
25
25
|
<CmdSlideButton
|
26
26
|
v-if="showSlideButtons"
|
@@ -30,7 +30,7 @@
|
|
30
30
|
<!-- end CmdSlideButton -->
|
31
31
|
|
32
32
|
<!-- begin table -->
|
33
|
-
<table ref="table" :class="{'full-width': fullWidth
|
33
|
+
<table ref="table" :class="{'full-width': fullWidth}">
|
34
34
|
<caption v-if="tableData.caption?.text || caption?.text" :class="{ hidden: hideCaption }">
|
35
35
|
{{ caption?.text || tableData.caption?.text }}
|
36
36
|
</caption>
|
@@ -76,13 +76,15 @@
|
|
76
76
|
</template>
|
77
77
|
|
78
78
|
<script>
|
79
|
-
import {
|
79
|
+
import {ref} from 'vue'
|
80
|
+
|
80
81
|
export default {
|
81
82
|
name: "CmdTable",
|
82
83
|
data() {
|
83
84
|
return {
|
84
85
|
showTableData: true,
|
85
|
-
fullWidth: this.fullWidthOnDefault
|
86
|
+
fullWidth: this.fullWidthOnDefault,
|
87
|
+
hasOverflow: false
|
86
88
|
}
|
87
89
|
},
|
88
90
|
props: {
|
@@ -187,6 +189,9 @@ export default {
|
|
187
189
|
}
|
188
190
|
}
|
189
191
|
},
|
192
|
+
mounted() {
|
193
|
+
this.hasOverflow = this.$refs.table.clientWidth > this.$refs.innerWrapper.clientWidth
|
194
|
+
},
|
190
195
|
computed: {
|
191
196
|
hasCaption() {
|
192
197
|
if (this.hideCaption) {
|
@@ -198,24 +203,66 @@ export default {
|
|
198
203
|
},
|
199
204
|
hideCaption() {
|
200
205
|
return this.caption?.show === false || (this.caption?.show !== true && !this.tableData.caption?.show)
|
201
|
-
},
|
202
|
-
hasOverflow() {
|
203
|
-
console.log("this.$refs.table", this.$refs.table)
|
204
|
-
// return this.$refs.table.scrollWidth > this.$refs.table.clientWidth
|
205
206
|
}
|
206
207
|
},
|
207
208
|
methods: {
|
208
209
|
scrollLeft() {
|
209
|
-
this.$refs.
|
210
|
+
this.$refs.innerWrapper.scrollLeft = 0
|
211
|
+
this.$refs.table.previousElementSibling.style.cssText = "left: 0;"
|
212
|
+
this.updatePosition()
|
210
213
|
},
|
211
214
|
scrollRight() {
|
212
|
-
this.$refs.table.
|
215
|
+
this.$refs.table.querySelector("th:last-child").scrollIntoView()
|
216
|
+
this.$refs.table.nextElementSibling.style.cssText = "right: auto;"
|
217
|
+
this.updatePosition()
|
218
|
+
},
|
219
|
+
updatePosition() {
|
220
|
+
const leftSlidebutton = this.$refs.table.previousElementSibling
|
221
|
+
const rightSlidebutton = this.$refs.table.nextElementSibling
|
222
|
+
const innerWrapper = this.$refs.innerWrapper
|
223
|
+
|
224
|
+
const parentRect = innerWrapper.getBoundingClientRect();
|
225
|
+
const newRight = parentRect.width + innerWrapper.scrollLeft - rightSlidebutton.getBoundingClientRect().width
|
226
|
+
const newLeft = innerWrapper.scrollLeft
|
227
|
+
|
228
|
+
console.log("parentRect", parentRect)
|
229
|
+
|
230
|
+
leftSlidebutton.style.left = `${newLeft}px`
|
231
|
+
rightSlidebutton.style.left = `${newRight}px`;
|
232
|
+
|
233
|
+
if(newLeft === 0) {
|
234
|
+
leftSlidebutton.style.display = "none"
|
235
|
+
} else {
|
236
|
+
leftSlidebutton.style.display = "flex"
|
237
|
+
}
|
238
|
+
|
239
|
+
if(newLeft === innerWrapper.scrollLeftMax) {
|
240
|
+
rightSlidebutton.style.display = "none"
|
241
|
+
} else {
|
242
|
+
rightSlidebutton.style.display = "flex"
|
243
|
+
}
|
244
|
+
|
245
|
+
// const parentRect = this.$refs.innerWrapper.getBoundingClientRect();
|
246
|
+
// const rightSlidebutton = this.$refs.table.nextElementSibling.getBoundingClientRect();
|
247
|
+
// const leftSlidebutton = this.$refs.table.previousElementSibling.getBoundingClientRect();
|
248
|
+
//
|
249
|
+
// // Calculate the new right position
|
250
|
+
// const newRight = rightSlidebutton.width + parentRect.right;
|
251
|
+
// const newLeft = parentRect.width - parentRect.left;
|
252
|
+
// console.log("parentRect.width", parentRect.width)
|
253
|
+
// console.log("parentRect.right", parentRect.right)
|
254
|
+
// console.log("parentRect.left", parentRect.left)
|
255
|
+
//
|
256
|
+
// // Apply the new right position
|
257
|
+
// this.$refs.table.nextElementSibling.style.left = `${newRight}px`;
|
258
|
+
// this.$refs.table.previousElementSibling.style.right = `${newLeft}px`;
|
213
259
|
}
|
260
|
+
|
214
261
|
}
|
215
262
|
}
|
216
263
|
</script>
|
217
264
|
|
218
|
-
<style
|
265
|
+
<style>
|
219
266
|
/* begin cmd-table-wrapper ---------------------------------------------------------------------------------------- */
|
220
267
|
.cmd-table-wrapper {
|
221
268
|
display: inline-flex;
|
@@ -250,19 +297,22 @@ export default {
|
|
250
297
|
}
|
251
298
|
}
|
252
299
|
|
300
|
+
.cmd-slide-button {
|
301
|
+
display: none;
|
302
|
+
}
|
303
|
+
|
253
304
|
.inner-wrapper {
|
254
305
|
display: flex;
|
255
306
|
overflow-x: auto;
|
256
307
|
width: 100%;
|
257
|
-
padding: 0 4rem;
|
258
308
|
|
259
309
|
.cmd-slide-button {
|
260
310
|
left: 0;
|
261
|
-
}
|
262
311
|
|
263
|
-
|
264
|
-
|
265
|
-
|
312
|
+
&:last-child {
|
313
|
+
right: 0;
|
314
|
+
left: auto;
|
315
|
+
}
|
266
316
|
}
|
267
317
|
|
268
318
|
table {
|
@@ -292,6 +342,11 @@ export default {
|
|
292
342
|
}
|
293
343
|
}
|
294
344
|
|
345
|
+
&.has-overflow {
|
346
|
+
.cmd-slide-button {
|
347
|
+
display: flex;
|
348
|
+
}
|
349
|
+
}
|
295
350
|
}
|
296
351
|
|
297
352
|
/* end cmd-table-wrapper ------------------------------------------------------------------------------------------ */
|