comand-component-library 4.3.28 → 5.0.0
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.js +9587 -9482
- package/dist/styles/demopage-only.css +12 -2
- package/package.json +47 -46
- package/src/ComponentLibrary.vue +2697 -2688
- package/src/assets/data/component-structure.json +1 -1
- package/src/assets/data/form-elements.json +224 -224
- package/src/assets/data/social-networks-page-by-json.json +43 -43
- package/src/assets/styles/component-library-global-styles.scss +296 -295
- package/src/componentSettingsDataAndControls.vue +1 -18
- package/src/components/CmdAccordion.vue +1 -1
- package/src/components/CmdAddressData.vue +6 -1
- package/src/components/CmdAddressDataItem.vue +6 -1
- package/src/components/CmdBasicForm.vue +2 -2
- package/src/components/CmdBox.vue +1103 -1092
- package/src/components/CmdBoxWrapper.vue +7 -1
- package/src/components/CmdBreadcrumbs.vue +2 -2
- package/src/components/CmdCodeOutput.vue +1 -1
- package/src/components/CmdCookieDisclaimer.vue +480 -480
- package/src/components/CmdFakeSelect.vue +930 -916
- package/src/components/CmdFlexibleScrollContainer.vue +42 -42
- package/src/components/CmdForm.vue +481 -481
- package/src/components/CmdFormElement.vue +1110 -1091
- package/src/components/CmdFormFilters.vue +146 -146
- package/src/components/CmdGoogleMaps.vue +1 -1
- package/src/components/CmdHeadline.vue +21 -4
- package/src/components/CmdIcon.vue +8 -2
- package/src/components/CmdImage.vue +14 -16
- package/src/components/CmdImageZoom.vue +9 -8
- package/src/components/CmdInputGroup.vue +436 -435
- package/src/components/CmdLink.vue +1 -1
- package/src/components/CmdList.vue +1 -1
- package/src/components/CmdListOfRequirements.vue +192 -192
- package/src/components/CmdLoginForm.vue +618 -618
- package/src/components/CmdMailToolFilter.vue +217 -217
- package/src/components/CmdMainNavigation.vue +581 -572
- package/src/components/CmdMultistepFormProgressBar.vue +9 -9
- package/src/components/CmdNewsletterSubscription.vue +199 -199
- package/src/components/CmdPagination.vue +4 -2
- package/src/components/CmdParagraph.vue +10 -4
- package/src/components/CmdProgressBar.vue +72 -72
- package/src/components/CmdSiteHeader.vue +382 -389
- package/src/components/CmdSiteSearch.vue +420 -420
- package/src/components/CmdSiteWrapper.vue +12 -5
- package/src/components/CmdSlideshow.vue +519 -519
- package/src/components/CmdSmartSearch.vue +291 -291
- package/src/components/CmdSystemMessage.vue +3 -2
- package/src/components/CmdTable.vue +401 -401
- package/src/components/CmdTabs.vue +262 -262
- package/src/components/CmdTag.vue +1 -1
- package/src/components/CmdTextImageBlock.vue +8 -2
- package/src/components/CmdThumbnailScroller.vue +0 -7
- package/src/components/CmdToggleDarkMode.vue +13 -11
- package/src/components/CmdTooltip.vue +305 -301
- package/src/components/CmdUploadForm.vue +1299 -1305
- package/src/components/CmdWidthLimitationWrapper.vue +1 -1
- package/src/components/EditComponentWrapper.vue +5 -5
- package/src/index.js +5 -0
- package/src/main.js +4 -3
- package/src/utils/template.js +57 -0
- package/src/assets/styles/template.css +0 -1
|
@@ -1,147 +1,147 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<!-- begin CmdFormFilters ---------------------------------------------------------------------------------------- -->
|
|
3
|
-
<ul v-if="options.length" class="cmd-form-filters">
|
|
4
|
-
<li v-if="options.length > 1">
|
|
5
|
-
<a href="#" @click.prevent="deleteAllFilters">
|
|
6
|
-
<!-- begin CmdIcon -->
|
|
7
|
-
<CmdIcon v-if="linkDeleteAllFilters.icon && linkDeleteAllFilters.icon.show" :iconClass="linkDeleteAllFilters.icon.iconClass" :title="linkDeleteAllFilters.icon.tooltip" />
|
|
8
|
-
<!-- end CmdIcon -->
|
|
9
|
-
<span v-if="linkDeleteAllFilters.text">{{ linkDeleteAllFilters.text }}</span>
|
|
10
|
-
</a>
|
|
11
|
-
</li>
|
|
12
|
-
<li v-for="(option, index) in options" :key="index">
|
|
13
|
-
<a href="#" @click.prevent="deleteClickedFilter(index)" :title="deleteFilterIcon.tooltip">
|
|
14
|
-
<span>{{ selectedOptionsName(option) }}</span>
|
|
15
|
-
<!-- begin CmdIcon -->
|
|
16
|
-
<CmdIcon :iconClass="deleteFilterIcon.iconClass" :type="deleteFilterIcon.iconType" />
|
|
17
|
-
<!-- end CmdIcon -->
|
|
18
|
-
</a>
|
|
19
|
-
</li>
|
|
20
|
-
</ul>
|
|
21
|
-
<!-- end CmdFormElement ---------------------------------------------------------------------------------------- -->
|
|
22
|
-
</template>
|
|
23
|
-
|
|
24
|
-
<script>
|
|
25
|
-
export default {
|
|
26
|
-
name: "CmdFormFilters",
|
|
27
|
-
emits: ["update:modelValue"],
|
|
28
|
-
data() {
|
|
29
|
-
return {
|
|
30
|
-
options: []
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
props: {
|
|
34
|
-
/**
|
|
35
|
-
* model-value to support v-model
|
|
36
|
-
*/
|
|
37
|
-
modelValue: {
|
|
38
|
-
type: Array,
|
|
39
|
-
required: true
|
|
40
|
-
},
|
|
41
|
-
/**
|
|
42
|
-
* delete-all-filters-link
|
|
43
|
-
*
|
|
44
|
-
* @requiredForAccessibility: partial
|
|
45
|
-
*/
|
|
46
|
-
linkDeleteAllFilters: {
|
|
47
|
-
type: Object,
|
|
48
|
-
default() {
|
|
49
|
-
return {
|
|
50
|
-
text: "Delete all filters",
|
|
51
|
-
icon: {
|
|
52
|
-
show: true,
|
|
53
|
-
iconClass: "icon-error-circle",
|
|
54
|
-
tooltip: ""
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
/**
|
|
60
|
-
* icon for deleting (a single) filter
|
|
61
|
-
*
|
|
62
|
-
* @requiredForAccessibility: partial
|
|
63
|
-
*/
|
|
64
|
-
deleteFilterIcon: {
|
|
65
|
-
type: Object,
|
|
66
|
-
default() {
|
|
67
|
-
return {
|
|
68
|
-
iconClass: "icon-error-circle",
|
|
69
|
-
tooltip: "Delete this filter",
|
|
70
|
-
type: "auto"
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
/**
|
|
75
|
-
* name for selected options
|
|
76
|
-
*/
|
|
77
|
-
selectedOptionsName: {
|
|
78
|
-
type: Function,
|
|
79
|
-
required: true
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
methods: {
|
|
83
|
-
deleteAllFilters() {
|
|
84
|
-
this.options = []
|
|
85
|
-
this.updateSelectedOptions()
|
|
86
|
-
},
|
|
87
|
-
deleteClickedFilter(index) {
|
|
88
|
-
this.options.splice(index, 1)
|
|
89
|
-
this.updateSelectedOptions()
|
|
90
|
-
},
|
|
91
|
-
updateSelectedOptions() {
|
|
92
|
-
this.$emit("update:modelValue", this.options)
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
watch: {
|
|
96
|
-
modelValue: {
|
|
97
|
-
handler() {
|
|
98
|
-
if(this.modelValue) {
|
|
99
|
-
this.options = JSON.parse(JSON.stringify(this.modelValue))
|
|
100
|
-
} else {
|
|
101
|
-
this.options = []
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
immediate: true,
|
|
105
|
-
deep: true
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
</script>
|
|
110
|
-
|
|
111
|
-
<style>
|
|
112
|
-
/* begin cmd-form-filters ------------------------------------------------------------------------------------------ */
|
|
113
|
-
.cmd-form-filters {
|
|
114
|
-
display: flex;
|
|
115
|
-
margin: 0;
|
|
116
|
-
|
|
117
|
-
li {
|
|
118
|
-
list-style-type: none;
|
|
119
|
-
margin-left: 0;
|
|
120
|
-
margin-right: var(--default-margin);
|
|
121
|
-
border: var(--default-border);
|
|
122
|
-
background: var(--color-
|
|
123
|
-
font-size: var(--font-size-small);
|
|
124
|
-
|
|
125
|
-
&:hover, &:active, &:focus {
|
|
126
|
-
border-color: var(--primary-color);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
a {
|
|
130
|
-
padding: calc(var(--default-padding) / 2);
|
|
131
|
-
display: flex;
|
|
132
|
-
align-items: center;
|
|
133
|
-
text-decoration: none;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
&:last-of-type {
|
|
137
|
-
margin-right: 0;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
[class*="icon-"] {
|
|
141
|
-
font-size: var(--icon-size-small);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/* end cmd-form-filters ------------------------------------------------------------------------------------------ */
|
|
1
|
+
<template>
|
|
2
|
+
<!-- begin CmdFormFilters ---------------------------------------------------------------------------------------- -->
|
|
3
|
+
<ul v-if="options.length" class="cmd-form-filters">
|
|
4
|
+
<li v-if="options.length > 1">
|
|
5
|
+
<a href="#" @click.prevent="deleteAllFilters">
|
|
6
|
+
<!-- begin CmdIcon -->
|
|
7
|
+
<CmdIcon v-if="linkDeleteAllFilters.icon && linkDeleteAllFilters.icon.show" :iconClass="linkDeleteAllFilters.icon.iconClass" :title="linkDeleteAllFilters.icon.tooltip" />
|
|
8
|
+
<!-- end CmdIcon -->
|
|
9
|
+
<span v-if="linkDeleteAllFilters.text">{{ linkDeleteAllFilters.text }}</span>
|
|
10
|
+
</a>
|
|
11
|
+
</li>
|
|
12
|
+
<li v-for="(option, index) in options" :key="index">
|
|
13
|
+
<a href="#" @click.prevent="deleteClickedFilter(index)" :title="deleteFilterIcon.tooltip">
|
|
14
|
+
<span>{{ selectedOptionsName(option) }}</span>
|
|
15
|
+
<!-- begin CmdIcon -->
|
|
16
|
+
<CmdIcon :iconClass="deleteFilterIcon.iconClass" :type="deleteFilterIcon.iconType" />
|
|
17
|
+
<!-- end CmdIcon -->
|
|
18
|
+
</a>
|
|
19
|
+
</li>
|
|
20
|
+
</ul>
|
|
21
|
+
<!-- end CmdFormElement ---------------------------------------------------------------------------------------- -->
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script>
|
|
25
|
+
export default {
|
|
26
|
+
name: "CmdFormFilters",
|
|
27
|
+
emits: ["update:modelValue"],
|
|
28
|
+
data() {
|
|
29
|
+
return {
|
|
30
|
+
options: []
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
props: {
|
|
34
|
+
/**
|
|
35
|
+
* model-value to support v-model
|
|
36
|
+
*/
|
|
37
|
+
modelValue: {
|
|
38
|
+
type: Array,
|
|
39
|
+
required: true
|
|
40
|
+
},
|
|
41
|
+
/**
|
|
42
|
+
* delete-all-filters-link
|
|
43
|
+
*
|
|
44
|
+
* @requiredForAccessibility: partial
|
|
45
|
+
*/
|
|
46
|
+
linkDeleteAllFilters: {
|
|
47
|
+
type: Object,
|
|
48
|
+
default() {
|
|
49
|
+
return {
|
|
50
|
+
text: "Delete all filters",
|
|
51
|
+
icon: {
|
|
52
|
+
show: true,
|
|
53
|
+
iconClass: "icon-error-circle",
|
|
54
|
+
tooltip: ""
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
/**
|
|
60
|
+
* icon for deleting (a single) filter
|
|
61
|
+
*
|
|
62
|
+
* @requiredForAccessibility: partial
|
|
63
|
+
*/
|
|
64
|
+
deleteFilterIcon: {
|
|
65
|
+
type: Object,
|
|
66
|
+
default() {
|
|
67
|
+
return {
|
|
68
|
+
iconClass: "icon-error-circle",
|
|
69
|
+
tooltip: "Delete this filter",
|
|
70
|
+
type: "auto"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
/**
|
|
75
|
+
* name for selected options
|
|
76
|
+
*/
|
|
77
|
+
selectedOptionsName: {
|
|
78
|
+
type: Function,
|
|
79
|
+
required: true
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
methods: {
|
|
83
|
+
deleteAllFilters() {
|
|
84
|
+
this.options = []
|
|
85
|
+
this.updateSelectedOptions()
|
|
86
|
+
},
|
|
87
|
+
deleteClickedFilter(index) {
|
|
88
|
+
this.options.splice(index, 1)
|
|
89
|
+
this.updateSelectedOptions()
|
|
90
|
+
},
|
|
91
|
+
updateSelectedOptions() {
|
|
92
|
+
this.$emit("update:modelValue", this.options)
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
watch: {
|
|
96
|
+
modelValue: {
|
|
97
|
+
handler() {
|
|
98
|
+
if(this.modelValue) {
|
|
99
|
+
this.options = JSON.parse(JSON.stringify(this.modelValue))
|
|
100
|
+
} else {
|
|
101
|
+
this.options = []
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
immediate: true,
|
|
105
|
+
deep: true
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
</script>
|
|
110
|
+
|
|
111
|
+
<style>
|
|
112
|
+
/* begin cmd-form-filters ------------------------------------------------------------------------------------------ */
|
|
113
|
+
.cmd-form-filters {
|
|
114
|
+
display: flex;
|
|
115
|
+
margin: 0;
|
|
116
|
+
|
|
117
|
+
li {
|
|
118
|
+
list-style-type: none;
|
|
119
|
+
margin-left: 0;
|
|
120
|
+
margin-right: var(--default-margin);
|
|
121
|
+
border: var(--default-border);
|
|
122
|
+
background: var(--color-scheme-background);
|
|
123
|
+
font-size: var(--font-size-small);
|
|
124
|
+
|
|
125
|
+
&:hover, &:active, &:focus {
|
|
126
|
+
border-color: var(--primary-color);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
a {
|
|
130
|
+
padding: calc(var(--default-padding) / 2);
|
|
131
|
+
display: flex;
|
|
132
|
+
align-items: center;
|
|
133
|
+
text-decoration: none;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
&:last-of-type {
|
|
137
|
+
margin-right: 0;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
[class*="icon-"] {
|
|
141
|
+
font-size: var(--icon-size-small);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/* end cmd-form-filters ------------------------------------------------------------------------------------------ */
|
|
147
147
|
</style>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<!-- end CmdHeadline-->
|
|
7
7
|
|
|
8
8
|
<!-- begin CmdSystemMessage -->
|
|
9
|
-
<CmdSystemMessage v-if="!cookiesAccepted" validationStatus="warning" textAlign="center" :
|
|
9
|
+
<CmdSystemMessage v-if="!cookiesAccepted" validationStatus="warning" textAlign="center" :allowUserToCloseMessage="false">
|
|
10
10
|
<p>
|
|
11
11
|
{{getMessage("google_maps.system_message.accept_terms")}}
|
|
12
12
|
</p>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<!-- begin CmdHeadline ---------------------------------------------------------------------------------------- -->
|
|
3
3
|
<!-- begin default-view -->
|
|
4
|
-
<
|
|
5
|
-
:
|
|
4
|
+
<HeadlineWrapper v-if="(!editModeContext && (headlineText || $slots.default)) || settingsContext || mainSidebarContext || headlineText"
|
|
5
|
+
:without-wrapper="withoutWrapper" :wrapper-attributes="wrapperAttributes">
|
|
6
6
|
<!-- begin headline with pre-headline-text -->
|
|
7
7
|
<template v-if="preHeadlineText">
|
|
8
8
|
<component v-if="headlineText" :is="headlineTag" :class="[highlightLevel, headlineTextAlign]">
|
|
@@ -50,12 +50,12 @@
|
|
|
50
50
|
<!-- end headline-text with slot -->
|
|
51
51
|
</component>
|
|
52
52
|
<!-- end headline without pre-headline-text -->
|
|
53
|
-
</
|
|
53
|
+
</HeadlineWrapper>
|
|
54
54
|
<!-- end default-view -->
|
|
55
55
|
|
|
56
56
|
<!-- begin edit-mode -->
|
|
57
57
|
<EditComponentWrapper
|
|
58
|
-
v-else
|
|
58
|
+
v-else-if="editModeContext"
|
|
59
59
|
ref="editComponentWrapper"
|
|
60
60
|
class="edit-items"
|
|
61
61
|
:showComponentName="false"
|
|
@@ -118,11 +118,17 @@
|
|
|
118
118
|
</template>
|
|
119
119
|
|
|
120
120
|
<script>
|
|
121
|
+
import {h} from "vue"
|
|
121
122
|
import EditMode from "../mixins/EditMode.vue"
|
|
122
123
|
import {buildComponentPath, findEditComponentWrapper, updateHandlerProvider} from "../utils/editmode.js"
|
|
123
124
|
|
|
125
|
+
// renders its content with or without the surrounding div (a Fragment cannot be used as dynamic component: it ignores slots)
|
|
126
|
+
const HeadlineWrapper = (props, {slots}) => props.withoutWrapper ? slots.default?.() : h("div", props.wrapperAttributes, slots.default?.())
|
|
127
|
+
HeadlineWrapper.props = ["withoutWrapper", "wrapperAttributes"]
|
|
128
|
+
|
|
124
129
|
export default {
|
|
125
130
|
name: "CmdHeadline",
|
|
131
|
+
components: {HeadlineWrapper},
|
|
126
132
|
mixins: [EditMode],
|
|
127
133
|
inject: {
|
|
128
134
|
editModeContext: {
|
|
@@ -194,9 +200,20 @@ export default {
|
|
|
194
200
|
cmdIcon: {
|
|
195
201
|
type: Object,
|
|
196
202
|
required: false
|
|
203
|
+
},
|
|
204
|
+
/**
|
|
205
|
+
* renders the headline-tag without the surrounding div.cmd-headline (needed where a div is not allowed as parent,
|
|
206
|
+
* i.e. inside <summary>, which only permits phrasing content and headings as children)
|
|
207
|
+
*/
|
|
208
|
+
withoutWrapper: {
|
|
209
|
+
type: Boolean,
|
|
210
|
+
default: false
|
|
197
211
|
}
|
|
198
212
|
},
|
|
199
213
|
computed: {
|
|
214
|
+
wrapperAttributes() {
|
|
215
|
+
return this.withoutWrapper ? undefined : {class: ['cmd-headline', {'has-pre-headline-text': this.preHeadlineText, 'has-icon': this.cmdIcon?.iconClass}]}
|
|
216
|
+
},
|
|
200
217
|
componentActive() {
|
|
201
218
|
return this.editModeContext?.system.isActiveComponent(buildComponentPath(findEditComponentWrapper(this)))
|
|
202
219
|
},
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<!-- begin CmdIcon ---------------------------------------------------------------------------------------- -->
|
|
3
3
|
<!-- begin iconify-icon -->
|
|
4
|
-
<Icon v-if="isIconify" :icon="iconClass" :title="tooltip"
|
|
4
|
+
<Icon v-if="isIconify" :icon="iconClass" :title="tooltip" v-bind="a11yAttributes"></Icon>
|
|
5
5
|
<!-- end iconify-icon -->
|
|
6
6
|
|
|
7
7
|
<!-- begin icon from local iconfont -->
|
|
8
|
-
<span v-else :class="
|
|
8
|
+
<span v-else :class="iconClass" :title="tooltip" v-bind="a11yAttributes"></span>
|
|
9
9
|
<!-- end icon from local iconfont -->
|
|
10
10
|
<!-- end CmdIcon ---------------------------------------------------------------------------------------- -->
|
|
11
11
|
</template>
|
|
@@ -56,6 +56,12 @@ export default {
|
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
computed: {
|
|
59
|
+
/**
|
|
60
|
+
* icons with tooltip are images with an accessible name, icons without tooltip are decorative (hidden for screen readers)
|
|
61
|
+
*/
|
|
62
|
+
a11yAttributes() {
|
|
63
|
+
return this.tooltip ? {role: "img", "aria-label": this.tooltip} : {"aria-hidden": "true"}
|
|
64
|
+
},
|
|
59
65
|
isIconify() {
|
|
60
66
|
if (this.type === "iconify") {
|
|
61
67
|
return true
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
@click.prevent="selectFiles"
|
|
41
41
|
title="Drag new image to this area to replace old one!">
|
|
42
42
|
<span class="icon-image"></span>
|
|
43
|
-
<img :src="imageSource" :alt="image?.alt" :title="image?.tooltip"/>
|
|
43
|
+
<img :src="imageSource" :alt="image?.alt ?? ''" :title="image?.tooltip"/>
|
|
44
44
|
</a>
|
|
45
45
|
<!-- end image with drop-area -->
|
|
46
46
|
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
</template>
|
|
59
59
|
<template v-else-if="imageSource">
|
|
60
60
|
<!-- begin image without drop-area -->
|
|
61
|
-
<img :src="imageSource" :alt="image?.alt" :title="image?.tooltip"/>
|
|
61
|
+
<img :src="imageSource" :alt="image?.alt ?? ''" :title="image?.tooltip"/>
|
|
62
62
|
<!-- end image without drop-area -->
|
|
63
63
|
</template>
|
|
64
64
|
<!-- end image-wrapper -->
|
|
@@ -98,15 +98,15 @@
|
|
|
98
98
|
|
|
99
99
|
<!-- begin default-view -->
|
|
100
100
|
<!-- begin image with figure/figcaption -->
|
|
101
|
-
<figure v-else-if="useFigureTag" :class="['cmd-image flex-container flex-direction-column', alignContent]">
|
|
101
|
+
<figure v-else-if="useFigureTag" :class="['cmd-image flex-container', {'flex-direction-column' : orientation === 'vertical'}, alignContent]">
|
|
102
102
|
<figcaption v-if="figcaptionProperties?.position === 'top' && figcaptionProperties?.text && figcaptionProperties?.show" v-html="figcaptionProperties?.text"/>
|
|
103
|
-
<img :src="imageSource" :alt="image?.alt" :title="image?.tooltip" :loading="image?.lazyLoading !== false ? 'lazy' : null" @load="onImageLoaded"/>
|
|
103
|
+
<img v-if="imageSource" :src="imageSource" :alt="image?.alt ?? ''" :title="image?.tooltip" :loading="image?.lazyLoading !== false ? 'lazy' : null" @load="onImageLoaded"/>
|
|
104
104
|
<figcaption v-if="figcaptionProperties?.position === 'bottom' && figcaptionProperties?.text && figcaptionProperties?.show" v-html="figcaptionProperties?.text"/>
|
|
105
105
|
</figure>
|
|
106
106
|
<!-- end image with figure/figcaption -->
|
|
107
107
|
|
|
108
108
|
<!-- begin image without figure/figcaption -->
|
|
109
|
-
<img v-else class="cmd-image" :src="imageSource" :alt="image?.alt" :title="image?.tooltip" :loading="image?.lazyLoading ? 'lazy' : null" @load="onImageLoaded"/>
|
|
109
|
+
<img v-else-if="imageSource" class="cmd-image" :src="imageSource" :alt="image?.alt ?? ''" :title="image?.tooltip" :loading="image?.lazyLoading ? 'lazy' : null" @load="onImageLoaded"/>
|
|
110
110
|
<!-- end image without figure/figcaption -->
|
|
111
111
|
<!-- end default-view -->
|
|
112
112
|
<!-- end CmdImage ---------------------------------------------------------------------------------------- -->
|
|
@@ -188,6 +188,15 @@ export default {
|
|
|
188
188
|
type: Boolean,
|
|
189
189
|
default: true
|
|
190
190
|
},
|
|
191
|
+
/**
|
|
192
|
+
* set orientation
|
|
193
|
+
*
|
|
194
|
+
* @allowedValues: "vertical, "horizontal"
|
|
195
|
+
*/
|
|
196
|
+
orientation: {
|
|
197
|
+
type: String,
|
|
198
|
+
default: "vertical"
|
|
199
|
+
},
|
|
191
200
|
/**
|
|
192
201
|
* figcaption-object including visibility, position (top/bottom), text
|
|
193
202
|
*
|
|
@@ -343,17 +352,6 @@ export default {
|
|
|
343
352
|
updateWindowWidth() {
|
|
344
353
|
this.currentWindowWidth = window.innerWidth
|
|
345
354
|
},
|
|
346
|
-
getImage() {
|
|
347
|
-
return {
|
|
348
|
-
image: {...this.image},
|
|
349
|
-
figcaption: {
|
|
350
|
-
show: this.showFigcaption,
|
|
351
|
-
position: this.figcaptionPosition,
|
|
352
|
-
textAlign: this.figcaptionTextAlign,
|
|
353
|
-
text: this.figcaptionText
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
},
|
|
357
355
|
dragEnter(event) {
|
|
358
356
|
this.dragOver(event)
|
|
359
357
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<!-- begin CmdImageZoom ---------------------------------------------------------------------------------------- -->
|
|
3
|
-
<div class="cmd-image-zoom flex-container">
|
|
3
|
+
<div class="cmd-image-zoom flex-container" ref="image-zoom">
|
|
4
4
|
<!-- begin small image -->
|
|
5
5
|
<a href="#" class="flex-none thumbnail-imagezoom" :title="imageSmall.image.tooltip">
|
|
6
6
|
<!-- begin CmdImage for small image -->
|
|
@@ -54,14 +54,15 @@ export default {
|
|
|
54
54
|
onMouseOver(e) {
|
|
55
55
|
this.showLargeImage = true
|
|
56
56
|
this.$nextTick(() => {
|
|
57
|
-
const
|
|
58
|
-
const
|
|
57
|
+
const element = this.$refs["image-zoom"]
|
|
58
|
+
const zoomContainerHeight = window.innerHeight - element.getBoundingClientRect().y - 10
|
|
59
|
+
const zoomContainer = element.querySelector('.zoom-container')
|
|
59
60
|
zoomContainer.style.height = `${zoomContainerHeight}px`
|
|
60
|
-
positionOverlay(
|
|
61
|
+
positionOverlay(element, e)
|
|
61
62
|
})
|
|
62
63
|
},
|
|
63
64
|
onMouseMove(e) {
|
|
64
|
-
positionOverlay(this, e)
|
|
65
|
+
positionOverlay(this.$refs["image-zoom"], e)
|
|
65
66
|
},
|
|
66
67
|
onMouseOut() {
|
|
67
68
|
this.showLargeImage = false
|
|
@@ -69,10 +70,10 @@ export default {
|
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
|
|
72
|
-
function positionOverlay(
|
|
73
|
-
const largeImageContainer =
|
|
73
|
+
function positionOverlay(imageZoomElement, e){
|
|
74
|
+
const largeImageContainer = imageZoomElement.querySelector('.zoom-container')
|
|
74
75
|
const largeImage = largeImageContainer.querySelector('img')
|
|
75
|
-
const zoomOverlay =
|
|
76
|
+
const zoomOverlay = imageZoomElement.querySelector('.zoom-overlay')
|
|
76
77
|
|
|
77
78
|
const smallImageWidth = e.target.getBoundingClientRect().width
|
|
78
79
|
const smallImageHeight = e.target.getBoundingClientRect().height
|