comand-component-library 3.3.24 → 3.3.25
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.js +1530 -1428
- package/dist/comand-component-library.umd.cjs +4 -4
- package/dist/style.css +1 -1
- package/package.json +5 -5
- package/src/App.vue +43 -8
- package/src/assets/data/address-data.json +1 -1
- package/src/assets/data/thumbnail-scroller-text.json +43 -0
- package/src/components/CmdAddressData.vue +1 -1
- package/src/components/CmdBox.vue +7 -4
- package/src/components/CmdMainNavigation.vue +1 -1
- package/src/components/CmdSiteFooter.vue +4 -0
- package/src/components/CmdSiteHeader.vue +6 -0
- package/src/components/CmdSiteSearch.vue +2 -1
- package/src/components/CmdTextBlock.vue +61 -0
- package/src/components/CmdThumbnailScroller.vue +82 -20
- package/src/components/CmdTooltip.vue +2 -2
- package/src/index.js +1 -0
- package/src/mixins/CmdThumbnailScroller/DefaultMessageProperties.js +3 -1
- /package/src/assets/data/{thumbnail-scroller.json → thumbnail-scroller-images.json} +0 -0
@@ -9,11 +9,24 @@
|
|
9
9
|
|
10
10
|
<!-- begin list of images to slide -->
|
11
11
|
<transition-group name="slide" tag="ul">
|
12
|
-
<li v-for="(
|
13
|
-
<a href="
|
12
|
+
<li v-for="(item, index) in items" :key="index" :class="{'active' : activeItemIndex === index}">
|
13
|
+
<a :href="executeOnClick === 'url' ? item.url : '#'"
|
14
|
+
@click="executeLink(index, $event)"
|
15
|
+
:title="getTooltip"
|
16
|
+
:target="executeOnClick === 'url' ? '_blank' : null"
|
17
|
+
>
|
14
18
|
<!-- begin CmdImage -->
|
15
|
-
<CmdImage :image="
|
19
|
+
<CmdImage v-if="contentType === 'image'" :image="item.image" :figcaption="item.figcaption" />
|
16
20
|
<!-- end CmdImage -->
|
21
|
+
|
22
|
+
<!-- begin contentType === text -->
|
23
|
+
<template v-else>
|
24
|
+
<!-- begin CmdIcon -->
|
25
|
+
<CmdIcon v-if="item.iconClass" :iconClass="item.iconClass" :type="item.iconType" />
|
26
|
+
<!-- end CmdIcon -->
|
27
|
+
<template v-if="item.text">{{item.text}}</template>
|
28
|
+
</template>
|
29
|
+
<!-- end contentType === text -->
|
17
30
|
</a>
|
18
31
|
</li>
|
19
32
|
</transition-group>
|
@@ -38,13 +51,14 @@ import DefaultMessageProperties from "../mixins/CmdThumbnailScroller/DefaultMess
|
|
38
51
|
|
39
52
|
export default {
|
40
53
|
name: "CmdThumbnailScroller",
|
54
|
+
emits: ["click"],
|
41
55
|
mixins: [
|
42
56
|
I18n,
|
43
57
|
DefaultMessageProperties
|
44
58
|
],
|
45
59
|
data() {
|
46
60
|
return {
|
47
|
-
|
61
|
+
items: []
|
48
62
|
}
|
49
63
|
},
|
50
64
|
props: {
|
@@ -57,6 +71,24 @@ export default {
|
|
57
71
|
type: Boolean,
|
58
72
|
default: false
|
59
73
|
},
|
74
|
+
/**
|
75
|
+
* set content-type
|
76
|
+
*
|
77
|
+
* @allowedValues: "image", "text"
|
78
|
+
*/
|
79
|
+
contentType: {
|
80
|
+
type: String,
|
81
|
+
default: "image"
|
82
|
+
},
|
83
|
+
/**
|
84
|
+
* set type to define what will be executed on click on a thumbnail-scroller-item
|
85
|
+
*
|
86
|
+
* @allowedValues: "fancybox", "url", "emit"
|
87
|
+
*/
|
88
|
+
executeOnClick: {
|
89
|
+
type: String,
|
90
|
+
default: "fancybox"
|
91
|
+
},
|
60
92
|
/**
|
61
93
|
* list of thumbnail-scroller-items
|
62
94
|
*/
|
@@ -74,7 +106,7 @@ export default {
|
|
74
106
|
/**
|
75
107
|
* set a default index to activate/highlight a specific image/item
|
76
108
|
*/
|
77
|
-
|
109
|
+
activeItemIndex: {
|
78
110
|
type: Number,
|
79
111
|
required: false
|
80
112
|
},
|
@@ -117,33 +149,64 @@ export default {
|
|
117
149
|
}
|
118
150
|
}
|
119
151
|
},
|
152
|
+
computed: {
|
153
|
+
getTooltip() {
|
154
|
+
if (this.contentType === "image") {
|
155
|
+
return this.getMessage("cmdthumbnailscroller.tooltip.open_large_image")
|
156
|
+
}
|
157
|
+
if (this.executeOnClick === "url") {
|
158
|
+
return this.getMessage("cmdthumbnailscroller.tooltip.open_url")
|
159
|
+
}
|
160
|
+
return this.getMessage("cmdthumbnailscroller.tooltip.open")
|
161
|
+
}
|
162
|
+
},
|
120
163
|
methods: {
|
121
164
|
showNextItem() {
|
122
|
-
const
|
123
|
-
if (
|
124
|
-
this.
|
165
|
+
const item = this.items.shift(); // remove first element of array
|
166
|
+
if (item) {
|
167
|
+
this.items.push(item);
|
125
168
|
}
|
126
169
|
},
|
127
170
|
showPrevItem() {
|
128
|
-
const
|
129
|
-
if (
|
130
|
-
this.
|
171
|
+
const item = this.items.pop(); // remove last element of array
|
172
|
+
if (item) {
|
173
|
+
this.items.unshift(item);
|
131
174
|
}
|
132
175
|
},
|
133
176
|
showFancyBox(index) {
|
134
177
|
if (this.allowOpenFancyBox) {
|
135
|
-
openFancyBox({fancyBoxGallery: this.
|
178
|
+
openFancyBox({fancyBoxGallery: this.items, defaultGalleryIndex: index})
|
179
|
+
}
|
180
|
+
this.emitCurrentItemId(index)
|
181
|
+
},
|
182
|
+
emitCurrentItemId(index) {
|
183
|
+
// emit id of current/clicked item
|
184
|
+
this.$emit("click", this.items[index].id)
|
185
|
+
},
|
186
|
+
executeLink(index, event) {
|
187
|
+
if(this.executeOnClick === "emit") {
|
188
|
+
event.preventDefault()
|
189
|
+
// emit id of current/clicked item
|
190
|
+
this.emitCurrentItemId(index)
|
191
|
+
} else if(this.executeOnClick === "fancybox") {
|
192
|
+
event.preventDefault()
|
193
|
+
// show content in fancybox
|
194
|
+
this.showFancyBox(index)
|
136
195
|
}
|
137
|
-
this.$emit("click", this.thumbnails[index].id)
|
138
196
|
}
|
139
197
|
},
|
140
198
|
watch: {
|
141
199
|
thumbnailScrollerItems: {
|
142
200
|
handler() {
|
143
201
|
// change keys for images to fit CmdImage-properties
|
144
|
-
this.
|
145
|
-
|
146
|
-
|
202
|
+
this.items = this.thumbnailScrollerItems.map((item) => {
|
203
|
+
let newItem
|
204
|
+
if(this.contentType === "image") {
|
205
|
+
newItem = {image: {...item.image}, figcaption: {...item.figcaption}}
|
206
|
+
newItem.image.src = newItem.image.srcImageSmall
|
207
|
+
} else {
|
208
|
+
newItem = {text: item.text, url: item.url}
|
209
|
+
}
|
147
210
|
return newItem
|
148
211
|
})
|
149
212
|
},
|
@@ -154,8 +217,9 @@ export default {
|
|
154
217
|
</script>
|
155
218
|
|
156
219
|
<style lang="scss">
|
157
|
-
@import '../assets/styles/variables';
|
158
220
|
/* begin cmd-thumbnail-scroller ------------------------------------------------------------------------------------------ */
|
221
|
+
@import '../assets/styles/variables';
|
222
|
+
|
159
223
|
.cmd-thumbnail-scroller {
|
160
224
|
overflow: hidden;
|
161
225
|
border-radius: var(--border-radius);
|
@@ -288,16 +352,14 @@ export default {
|
|
288
352
|
& > ul > li img {
|
289
353
|
max-height: 7rem;
|
290
354
|
}
|
291
|
-
}
|
292
355
|
|
293
|
-
@media only screen and (max-width: $medium-max-width) {
|
294
356
|
&.gallery-scroller {
|
295
357
|
max-width: calc(100% - calc(var(--default-margin) * 3));
|
296
358
|
}
|
297
359
|
}
|
298
360
|
}
|
299
361
|
|
300
|
-
@
|
362
|
+
@container (width <= #{$small-max-width}) {
|
301
363
|
.cmd-thumbnail-scroller {
|
302
364
|
display: block;
|
303
365
|
}
|
@@ -157,8 +157,8 @@ export default {
|
|
157
157
|
this.$nextTick( () => {
|
158
158
|
const verticalOffset = 25
|
159
159
|
// this.$refs.tooltip.addEventListener("keyup", this.hideTooltip)
|
160
|
-
this.$refs.tooltip.style.left = this.pointerX
|
161
|
-
this.$refs.tooltip.style.top = (this.pointerY + verticalOffset) /
|
160
|
+
this.$refs.tooltip.style.left = this.pointerX / 0 + "rem"
|
161
|
+
this.$refs.tooltip.style.top = (this.pointerY + verticalOffset) / 0 + "rem"
|
162
162
|
})
|
163
163
|
}
|
164
164
|
}
|
package/src/index.js
CHANGED
@@ -39,6 +39,7 @@ export { default as CmdSwitchLanguage } from '@/components/CmdSwitchLanguage.vue
|
|
39
39
|
export { default as CmdSystemMessage } from '@/components/CmdSystemMessage.vue'
|
40
40
|
export { default as CmdTable } from '@/components/CmdTable.vue'
|
41
41
|
export { default as CmdTabs } from '@/components/CmdTabs.vue'
|
42
|
+
export { default as CmdTextBlock } from '@/components/CmdTextBlock.vue'
|
42
43
|
export { default as CmdThumbnailScroller } from '@/components/CmdThumbnailScroller.vue'
|
43
44
|
export { default as CmdToggleDarkMode } from '@/components/CmdToggleDarkMode.vue'
|
44
45
|
export { default as CmdTooltip } from '@/components/CmdTooltip.vue'
|
@@ -2,7 +2,9 @@ export default {
|
|
2
2
|
data() {
|
3
3
|
return {
|
4
4
|
defaultMessageProperties: {
|
5
|
-
"cmdthumbnailscroller.tooltip.open_large_image": "Open large image"
|
5
|
+
"cmdthumbnailscroller.tooltip.open_large_image": "Open large image",
|
6
|
+
"cmdthumbnailscroller.tooltip.open_url": "Open URL in a new tab",
|
7
|
+
"cmdthumbnailscroller.tooltip.open": "Open"
|
6
8
|
}
|
7
9
|
}
|
8
10
|
}
|
File without changes
|